/* =========================================================
   kdelivery - 모바일 앱 스타일 (쿠팡이츠 참고)
   ========================================================= */
:root {
    --brand: #0a84ff;
    --brand-dark: #0066d6;
    --brand-soft: #e8f2ff;
    --text: #111318;
    --text-2: #4b5059;
    --muted: #8b9099;
    --line: #eceef1;
    --line-2: #dfe2e6;
    --bg: #ffffff;
    --bg-2: #f4f5f7;
    --danger: #f0443a;
    --success: #12b76a;
    --warning: #f79009;
    --star: #ffb800;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 2px 10px rgba(17, 19, 24, 0.06);
    --shadow-up: 0 -2px 12px rgba(17, 19, 24, 0.06);
    --header-h: 56px;
    --tabbar-h: 62px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Noto Sans", "Noto Sans Thai", "Noto Sans Khmer", "Noto Sans SC", "Hiragino Sans", "Malgun Gothic", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg-2);
    letter-spacing: -0.01em;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
button { font-family: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.icon { flex: none; vertical-align: middle; }
.brand-color { color: var(--brand); }
.muted { color: var(--muted); font-size: 0.87rem; margin: 2px 0; }
.center { text-align: center; }
.danger { color: var(--danger) !important; }
.nowrap { white-space: nowrap; }

/* ---------- 앱 틀: 모바일 폭 가운데 ---------- */
.app { max-width: 600px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; }
.app-wide { max-width: none; background: var(--bg-2); }
.page { padding: 0 0 24px; }
.has-tabbar .page { padding-bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); }
.section { padding: 20px 16px; }
.section + .section { border-top: 8px solid var(--bg-2); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-title { font-size: 1.15rem; font-weight: 800; }
.section-link { color: var(--muted); font-size: 0.87rem; }
.pad { padding: 16px; }

/* ---------- 상단 헤더 ---------- */
.app-header {
    position: sticky; top: 0; z-index: 30; height: var(--header-h);
    display: flex; align-items: center; gap: 8px; padding: 0 8px 0 12px;
    background: rgba(255, 255, 255, 0.96); backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.header-title { flex: 1; font-size: 1.05rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.header-actions form { margin: 0; }
.header-login { font-weight: 700; color: var(--brand); padding: 8px 10px; }
.icon-button {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; color: var(--text); cursor: pointer;
}
.icon-button:active { background: var(--bg-2); }
.badge-count {
    position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--brand); color: #fff; font-size: 0.7rem; font-weight: 700; line-height: 18px; text-align: center;
}
.address-button { display: flex; align-items: center; gap: 4px; min-width: 0; font-weight: 800; font-size: 1.05rem; }
.address-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }

.locale-label { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; color: var(--text); cursor: pointer; }
.locale-label select { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 16px; }

/* ---------- 하단 탭 ---------- */
.tabbar {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 40;
    width: 100%; max-width: 600px; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #a3a8b0; font-size: 0.7rem; font-weight: 600; }
.tabbar a.active { color: var(--text); }

/* ---------- 알림 토스트 ---------- */
.toast {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 16px); z-index: 60;
    background: rgba(17, 19, 24, 0.9); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 0.92rem;
    max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: toast 3.2s ease forwards;
}
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 10px); } 8%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; visibility: hidden; } }

/* ---------- 버튼 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
    border: 1px solid var(--line-2); background: #fff; color: var(--text);
    font-size: 0.95rem; font-weight: 700; cursor: pointer; text-align: center; white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-dark { background: var(--text); border-color: var(--text); color: #fff; }
.btn-soft { background: var(--brand-soft); border-color: var(--brand-soft); color: var(--brand); }
.btn-danger { background: #fff; border-color: #ffd0cc; color: var(--danger); }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 54px; font-size: 1.05rem; border-radius: 12px; }
.btn-small { min-height: 34px; padding: 0 12px; font-size: 0.85rem; border-radius: 8px; }
.btn[disabled], .btn.disabled { opacity: 0.45; pointer-events: none; }
.link-button { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 0.87rem; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* 화면 하단 고정 버튼 (주문하기, 담기 등) */
.bottom-bar {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 45;
    width: 100%; max-width: 600px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: #fff; box-shadow: var(--shadow-up);
}
.has-bottom-bar .page { padding-bottom: 110px; }
.has-tabbar .bottom-bar { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

/* ---------- 폼 ---------- */
.form { padding: 16px; }
.field { margin-bottom: 16px; }
.field > label, .field-label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.9rem; }
.input, .field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=password],
.field input[type=number], .field input[type=search], .field input[type=time], .field input[type=date],
.field input[type=datetime-local], .field select, .field textarea {
    width: 100%; min-height: 48px; padding: 12px 14px; font: inherit; font-size: 16px;
    border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; color: var(--text);
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: 0.9rem; cursor: pointer; }
.field .check input { margin-top: 2px; width: 20px; height: 20px; flex: none; accent-color: var(--brand); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { color: var(--muted); font-size: 0.82rem; margin: 6px 0 0; }
.error { color: var(--danger); font-size: 0.84rem; margin: 6px 0 0; }
details.translations { margin: -6px 0 16px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); padding: 8px 12px; }
details.translations summary { cursor: pointer; color: var(--text-2); font-size: 0.87rem; font-weight: 600; }
details.translations .field { margin: 10px 0 0; }

.auth-card { padding: 28px 20px; }
.auth-card h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 20px; }
.auth-links { text-align: center; margin-top: 18px; color: var(--muted); font-size: 0.9rem; }
.auth-links a { color: var(--brand); font-weight: 700; }

/* ---------- 알림/빈 화면 ---------- */
.notice { background: var(--brand-soft); color: #164a8a; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.9rem; margin: 12px 0; }
.notice-warning { background: #fff4e5; color: #8a4b00; }
.notice-danger { background: #ffeceb; color: #a3231b; }
.empty { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty .icon { color: #c4c8ce; margin: 0 auto 12px; display: block; }
.empty p { margin: 0 0 16px; }

/* ---------- 뱃지 ---------- */
.badge { display: inline-flex; align-items: center; gap: 3px; font-size: 0.74rem; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: var(--bg-2); color: var(--text-2); white-space: nowrap; }
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.badge-open, .badge-approved, .badge-delivered, .badge-paid, .badge-active { background: #e7f8ef; color: #067647; }
.badge-pending, .badge-paused, .badge-placed, .badge-pending_payment, .badge-searching, .badge-waiting, .badge-unpaid { background: #fff4e5; color: #b54708; }
.badge-closed, .badge-banned, .badge-suspended, .badge-rejected, .badge-cancelled, .badge-failed, .badge-refunded { background: #ffeceb; color: #b42318; }
.badge-accepted, .badge-ready, .badge-assigned, .badge-picked_up { background: var(--brand-soft); color: var(--brand-dark); }
.badge-popular { background: #ffeceb; color: var(--danger); }
.badge-fast { background: var(--brand); color: #fff; }

/* ---------- 홈 ---------- */
.home-search {
    display: flex; align-items: center; gap: 10px; margin: 12px 16px 0; padding: 0 14px; height: 48px;
    border-radius: 24px; background: var(--bg-2); color: var(--muted);
}
.home-search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 16px; color: var(--text); outline: none; }

.banners { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 16px 16px 4px; scrollbar-width: none; }
.banners::-webkit-scrollbar { display: none; }
.banner { position: relative; flex: none; width: 88%; aspect-ratio: 2.33 / 1; border-radius: var(--radius); overflow: hidden; scroll-snap-align: center; background: #dde6f3; }
.banner img { width: 100%; height: 100%; object-fit: cover; }
.banner-text { position: absolute; left: 0; top: 0; bottom: 0; width: 65%; padding: 18px; display: flex; flex-direction: column; justify-content: flex-end;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0)); color: #fff; }
.banner-text strong { font-size: 1.15rem; font-weight: 800; line-height: 1.3; }
.banner-text span { font-size: 0.82rem; opacity: 0.9; }

.categories { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 6px; padding: 18px 12px 6px; }
.category { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; color: var(--text-2); text-align: center; }
.category-img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; background: var(--bg-2); border: 2px solid transparent; }
.category.active .category-img { border-color: var(--brand); }
.category.active { color: var(--brand); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 18px; border: 1px solid var(--line-2); background: #fff; font-size: 0.85rem; font-weight: 600; color: var(--text-2); }
.chip.active { background: var(--text); border-color: var(--text); color: #fff; }

/* 가게 카드 (큰 사진) */
.store-list { list-style: none; margin: 0; padding: 0; }
.store-card { display: block; margin-bottom: 22px; }
.store-cover-wrap { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1.9 / 1; background: var(--bg-2); }
.store-cover { width: 100%; height: 100%; object-fit: cover; }
.store-cover-wrap .badge-fast { position: absolute; left: 10px; top: 10px; }
.store-closed-cover { position: absolute; inset: 0; background: rgba(17, 19, 24, 0.55); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.05rem; }
.store-card-body { padding: 10px 2px 0; }
.store-card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.store-name { font-size: 1.08rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 3px; font-size: 0.86rem; color: var(--text-2); }
.store-meta .dot::before { content: "\00B7"; color: var(--muted); margin-right: 6px; }
.rating { display: inline-flex; align-items: center; gap: 2px; font-weight: 800; color: var(--text); }
.rating .icon { color: var(--star); }

/* 사진 자리 대체 블록 */
.placeholder { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #e3eeff, #b7d4ff); color: #fff; font-weight: 800; }
.placeholder span { font-size: 2rem; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); }

/* ---------- 가게 상세 ---------- */
.store-hero { position: relative; aspect-ratio: 1.9 / 1; background: var(--bg-2); }
.store-hero img, .store-hero .placeholder { width: 100%; height: 100%; object-fit: cover; }
.store-hero-actions { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; }
.store-hero-actions .icon-button { background: rgba(255, 255, 255, 0.92); box-shadow: var(--shadow); }
.store-summary { position: relative; margin: -28px 16px 0; padding: 18px 16px 14px; background: #fff; border-radius: var(--radius); box-shadow: 0 4px 18px rgba(17, 19, 24, 0.1); text-align: center; }
.store-summary h1 { font-size: 1.35rem; font-weight: 800; }
.store-summary .store-meta { justify-content: center; }
.store-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 16px 16px 0; font-size: 0.9rem; }
.store-facts dt { color: var(--muted); }
.store-facts dd { margin: 0; }
.store-desc { margin: 12px 16px 0; color: var(--text-2); font-size: 0.9rem; }

.menu-tabs { position: sticky; top: var(--header-h); z-index: 20; display: flex; gap: 18px; overflow-x: auto; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.menu-tabs::-webkit-scrollbar { display: none; }
.menu-tabs a { flex: none; padding: 14px 0 12px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; }
.menu-tabs a.active { color: var(--text); border-bottom-color: var(--text); }

.popular-row { display: flex; gap: 12px; overflow-x: auto; padding: 0 16px 4px; scrollbar-width: none; }
.popular-row::-webkit-scrollbar { display: none; }
.popular-card { flex: none; width: 140px; }
.popular-card img, .popular-card .placeholder { width: 140px; height: 140px; border-radius: 12px; object-fit: cover; }
.popular-card strong { display: block; margin-top: 8px; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.menu-section { padding: 22px 16px 6px; scroll-margin-top: calc(var(--header-h) + 50px); }
.menu-section h2 { font-size: 1.12rem; font-weight: 800; margin-bottom: 4px; }
.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-item { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.menu-list li:last-child .menu-item { border-bottom: 0; }
.menu-info { flex: 1; min-width: 0; }
.menu-name { font-weight: 700; font-size: 1rem; }
.menu-desc { color: var(--muted); font-size: 0.85rem; margin: 3px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.menu-price { font-weight: 700; margin-top: 4px; }
.menu-thumb { flex: none; width: 104px; height: 104px; border-radius: 12px; object-fit: cover; }
.menu-thumb.placeholder span { font-size: 1.5rem; }
.is-sold-out { opacity: 0.45; }

/* 플로팅 장바구니 */
.floating-cart {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 45;
    width: calc(100% - 32px); max-width: 568px; height: 56px; padding: 0 20px;
    display: flex; align-items: center; justify-content: space-between;
    background: var(--brand); color: #fff; border-radius: 14px; font-weight: 800; box-shadow: 0 8px 24px rgba(10, 132, 255, 0.35);
}
.has-tabbar .floating-cart { bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); }
.floating-cart .count { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; border-radius: 12px; background: #fff; color: var(--brand); font-size: 0.85rem; margin-right: 8px; }

/* ---------- 메뉴 옵션 화면 ---------- */
.item-hero { aspect-ratio: 1.25 / 1; background: var(--bg-2); }
.item-hero img, .item-hero .placeholder { width: 100%; height: 100%; object-fit: cover; }
.item-head { padding: 20px 16px 16px; }
.item-head h1 { font-size: 1.4rem; font-weight: 800; }
.item-head .price { font-size: 1.2rem; font-weight: 800; margin-top: 8px; }
.option-group { border: 0; margin: 0; padding: 18px 16px 6px; border-top: 8px solid var(--bg-2); }
.option-group legend { float: left; width: 100%; display: flex; align-items: center; justify-content: space-between; font-weight: 800; font-size: 1.02rem; margin-bottom: 8px; }
.option-group legend .badge { font-weight: 700; }
.option { clear: both; display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.option:last-child { border-bottom: 0; }
.option span.name { flex: 1; }
.option input { width: 22px; height: 22px; accent-color: var(--brand); flex: none; }
.qty-section { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px; border-top: 8px solid var(--bg-2); font-weight: 800; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 22px; height: 40px; }
.stepper button { width: 40px; height: 38px; border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text); }
.stepper input { width: 36px; border: 0; text-align: center; font: inherit; font-weight: 800; font-size: 16px; -moz-appearance: textfield; background: none; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-sm { height: 34px; }
.stepper-sm button { width: 32px; height: 32px; }
.stepper-sm input { width: 28px; font-size: 0.95rem; }

/* ---------- 장바구니/주문서 ---------- */
.cart-store { display: flex; align-items: center; gap: 10px; padding: 16px; font-weight: 800; font-size: 1.05rem; }
.cart-store img, .cart-store .placeholder { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.cart-store .placeholder span { font-size: 0.9rem; }
.cart-list { list-style: none; margin: 0; padding: 0 16px; }
.cart-line { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.cart-line .thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; }
.cart-line .thumb.placeholder span { font-size: 1.1rem; }
.cart-line-body { flex: 1; min-width: 0; }
.cart-line-body .options { color: var(--muted); font-size: 0.84rem; margin: 2px 0 8px; }
.cart-line-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cart-line-remove { align-self: flex-start; color: var(--muted); }

.summary { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 18px 16px; margin: 0; font-size: 0.94rem; }
.summary dt { color: var(--text-2); }
.summary dd { margin: 0; text-align: right; }
.summary .total { font-weight: 800; font-size: 1.12rem; color: var(--text); padding-top: 12px; border-top: 1px solid var(--line); }
.summary .discount { color: var(--danger); }

.choice-list { list-style: none; margin: 0; padding: 0; }
.choice { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line-2); border-radius: 12px; margin-bottom: 8px; cursor: pointer; }
.choice input { width: 20px; height: 20px; accent-color: var(--brand); }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice.disabled { opacity: 0.45; }
.choice .grow { flex: 1; }

/* ---------- 지도 ---------- */
.map { height: 320px; border-radius: var(--radius); z-index: 0; }
.map-full { height: 260px; border-radius: 0; }
.map-tall { height: 380px; }

/* ---------- 목록 (주소, 주문 등) ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); background: #fff; }
.list-item.selected { background: var(--brand-soft); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item strong { font-weight: 700; }
.list-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.list-actions form { margin: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; }
.page-head h1, .page-head h2 { font-size: 1.3rem; font-weight: 800; }

/* 주문 카드 */
.order-card { display: flex; gap: 12px; padding: 16px; border-bottom: 8px solid var(--bg-2); background: #fff; }
.order-card .thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; }
.order-card .thumb.placeholder span { font-size: 1.1rem; }
.order-card-body { flex: 1; min-width: 0; }
.order-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.order-card-actions { display: flex; gap: 8px; margin-top: 10px; }
.order-card-actions .btn, .order-card-actions form { flex: 1; }
.order-card-actions form .btn { width: 100%; }

/* 주문 진행 상태 */
.progress-hero { padding: 24px 16px 18px; }
.progress-hero h1 { font-size: 1.45rem; font-weight: 800; }
.progress-hero .eta { font-size: 0.95rem; color: var(--text-2); margin-top: 4px; }
.steps { display: flex; gap: 4px; margin-top: 18px; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps span.done { background: var(--brand); }
.steps span.current { background: linear-gradient(90deg, var(--brand) 50%, var(--line) 50%); background-size: 200% 100%; animation: step 1.4s linear infinite; }
@keyframes step { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.step-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); margin-top: 6px; }
.timeline { list-style: none; margin: 0; padding: 0 16px; }
.timeline li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 0.9rem; }

/* ---------- 리뷰 ---------- */
.review { padding: 16px; border-bottom: 1px solid var(--line); }
.review-head { display: flex; justify-content: space-between; align-items: center; }
.review-images { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; }
.review-images img { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; flex: none; }
.owner-reply { margin-top: 10px; padding: 10px 12px; background: var(--bg-2); border-radius: 10px; font-size: 0.9rem; }
.stars { display: inline-flex; gap: 1px; color: var(--star); }
.stars .off { color: #dfe2e6; }
.star-input { display: flex; flex-direction: row-reverse; justify-content: center; gap: 6px; }
.star-input input { display: none; }
.star-input label { cursor: pointer; color: #dfe2e6; }
.star-input label .icon { width: 40px; height: 40px; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--star); }

/* ---------- 내 정보 ---------- */
.profile { display: flex; align-items: center; gap: 14px; padding: 22px 16px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.3rem; }
.menu-links { list-style: none; margin: 0; padding: 0; }
.menu-links a, .menu-links button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px; border: 0; border-bottom: 1px solid var(--line); background: #fff; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.menu-links .grow { flex: 1; }
.menu-links .icon:last-child { color: #c4c8ce; }

/* ---------- 사장님/라이더/관리자 공통 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat-label { display: block; color: var(--muted); font-size: 0.82rem; }
.stat strong { display: block; font-size: 1.35rem; font-weight: 800; margin-top: 2px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 12px; }
.cards { padding: 16px; }

.segmented { display: flex; gap: 6px; padding: 12px 16px; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--line); }
.segmented a { flex: none; padding: 8px 14px; border-radius: 18px; background: var(--bg-2); font-weight: 700; font-size: 0.87rem; color: var(--text-2); }
.segmented a.active { background: var(--text); color: #fff; }
.segmented .count { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 0.72rem; text-align: center; }

.ticket { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); margin: 12px 16px; overflow: hidden; }
.ticket.is-new { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.ticket-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ticket-body { padding: 12px 16px; font-size: 0.92rem; }
.ticket-body ul { margin: 0; padding-left: 18px; }
.ticket-foot { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: #fafbfc; flex-wrap: wrap; }
.ticket-foot form { margin: 0; display: flex; gap: 6px; flex: 1; }
.ticket-foot select { min-height: 40px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 8px; font: inherit; }

.online-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px; padding: 18px; border-radius: var(--radius); background: var(--text); color: #fff; }
.online-toggle.on { background: var(--success); }
.online-toggle strong { font-size: 1.15rem; }

.thumb-upload { display: flex; align-items: center; gap: 14px; }
.thumb-upload img, .thumb-upload .placeholder { width: 88px; height: 88px; border-radius: 12px; object-fit: cover; flex: none; }
.thumb-upload.wide img, .thumb-upload.wide .placeholder { width: 160px; height: 84px; }

/* 표 (관리자/사장님 매출) */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.table th { background: #fafbfc; color: var(--text-2); font-weight: 700; }
.table td.num, .table th.num { text-align: right; }
.table tr.warn td { background: #fff8eb; }

/* 관리자 */
.is-admin .app-header { max-width: none; }
.admin-nav { position: sticky; top: var(--header-h); z-index: 25; display: flex; gap: 2px; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--line); padding: 0 12px; scrollbar-width: none; }
.admin-nav a { flex: none; padding: 13px 12px; color: var(--muted); font-weight: 700; font-size: 0.9rem; border-bottom: 2px solid transparent; }
.admin-nav a.active { color: var(--text); border-bottom-color: var(--text); }
.admin-page { max-width: 1200px; margin: 0 auto; padding: 20px 16px; }
.admin-page .page-head { padding: 0 0 16px; }
.admin-page .stat-grid { padding: 0 0 16px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters select, .filters input { min-height: 40px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; font: inherit; background: #fff; }
.pagination { display: flex; gap: 6px; justify-content: center; margin: 16px 0; }
.pagination a, .pagination span { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; font-size: 0.87rem; }
.pagination span { background: var(--text); color: #fff; border-color: var(--text); }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.inline-form input, .inline-form select { min-height: 34px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 8px; font: inherit; }
.two-col { display: grid; gap: 16px; }

/* 법적 고지/문서 */
.doc { padding: 20px 16px; line-height: 1.7; }
.doc h2 { font-size: 1.1rem; margin: 22px 0 8px; }
.doc p, .doc li { color: var(--text-2); font-size: 0.93rem; }

/* 데스크톱에서 모바일 틀 주변 */
@media (min-width: 640px) {
    body:not(.is-admin) { background: #e9ebef; }
    .app:not(.app-wide) { box-shadow: 0 0 40px rgba(17, 19, 24, 0.08); }
    .categories { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 900px) {
    .two-col { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 360px) {
    .categories { grid-template-columns: repeat(4, 1fr); gap: 12px 2px; }
    .category-img { width: 52px; height: 52px; }
}

/* 지도 마커 */
.map-dot span { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%;
    color: #fff; font-weight: 800; font-size: 0.85rem; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }

/* =========================================================
   다듬기: 선택 상자, 체크박스, 파일 선택, 시트, 언어 버튼
   ========================================================= */

/* 선택 상자: 기본 모양 대신 둥근 상자 + 화살표 */
select, .filters select, .inline-form select, .ticket-foot select, .field select {
    -webkit-appearance: none; appearance: none;
    min-height: 44px; padding: 0 40px 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
    background-color: #fff; color: var(--text); font: inherit; font-size: 15px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b9099' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
    transition: border-color .15s, box-shadow .15s;
}
.field select { min-height: 50px; font-size: 16px; }
select:hover { border-color: #c9cdd3; }
select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.inline-form select, .ticket-foot select { min-height: 38px; font-size: 14px; padding-left: 12px; }

/* 입력칸 공통 다듬기 */
.field input, .field textarea { transition: border-color .15s, box-shadow .15s; }
.field input::placeholder, .field textarea::placeholder, .home-search input::placeholder { color: #b0b4bb; }
input[type=number] { -moz-appearance: textfield; }

/* 체크박스: 둥근 사각 + 체크 */
input[type=checkbox] {
    -webkit-appearance: none; appearance: none; flex: none;
    width: 22px; height: 22px; margin: 0; border: 1.6px solid #c9cdd3; border-radius: 7px; background: #fff;
    display: inline-grid; place-content: center; cursor: pointer; transition: background .15s, border-color .15s; vertical-align: middle;
}
input[type=checkbox]::after {
    content: ""; width: 11px; height: 6px; border: 2.4px solid #fff; border-top: 0; border-right: 0;
    transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .12s;
}
input[type=checkbox]:checked { background: var(--brand); border-color: var(--brand); }
input[type=checkbox]:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }

/* 라디오: 바깥 원 + 안쪽 점 */
input[type=radio] {
    -webkit-appearance: none; appearance: none; flex: none;
    width: 22px; height: 22px; margin: 0; border: 1.6px solid #c9cdd3; border-radius: 50%; background: #fff;
    display: inline-grid; place-content: center; cursor: pointer; transition: border-color .15s;
}
input[type=radio]::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); transform: scale(0); transition: transform .12s; }
input[type=radio]:checked { border-color: var(--brand); border-width: 2px; }
input[type=radio]:checked::after { transform: scale(1); }
input[type=radio]:disabled, input[type=checkbox]:disabled { background: var(--bg-2); cursor: not-allowed; }

/* 체크박스가 들어간 칩: 체크박스는 숨기고 칩 색으로 표시 */
.chip:has(input[type=checkbox]) { cursor: pointer; user-select: none; }
.chip input[type=checkbox] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

/* 파일 선택 버튼 */
input[type=file] { font: inherit; font-size: 0.85rem; color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button {
    margin-right: 10px; padding: 9px 14px; border: 1px solid var(--line-2); border-radius: 10px;
    background: #fff; color: var(--text); font: inherit; font-weight: 700; font-size: 0.85rem; cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--bg-2); }

/* 헤더 언어 버튼: 지구본 + 언어 코드 */
.lang-button {
    display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 10px; margin-right: 2px;
    border-radius: 17px; background: var(--bg-2); color: var(--text-2); font-size: 0.78rem; font-weight: 800; letter-spacing: .02em;
}
.lang-button:hover { background: #eaecef; }

/* 아래에서 올라오는 시트 */
dialog.sheet {
    position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 600px; max-height: 80vh;
    padding: 8px 0 calc(12px + env(safe-area-inset-bottom)); border: 0; border-radius: 22px 22px 0 0;
    background: #fff; color: var(--text); overflow-y: auto; box-shadow: 0 -10px 40px rgba(0, 0, 0, .15);
}
dialog.sheet[open] { animation: sheet-up .22s cubic-bezier(.2, .8, .2, 1); }
dialog.sheet::backdrop { background: rgba(17, 19, 24, .45); backdrop-filter: blur(2px); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: #dfe2e6; margin: 4px auto 6px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 12px 8px 20px; }
.sheet-head h2 { font-size: 1.15rem; font-weight: 800; }
html.sheet-open { overflow: hidden; }

/* 선택 목록 (언어 등) */
.option-list { margin: 0; padding: 0 8px; }
.option-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
    padding: 14px 14px; border: 0; border-radius: 14px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.option-row:hover { background: var(--bg-2); }
.option-row.is-current { background: var(--brand-soft); }
.option-main { display: flex; flex-direction: column; }
.option-main strong { font-size: 1rem; font-weight: 700; }
.option-main .muted { margin: 0; font-size: 0.8rem; }

/* 카드 그림자 살짝, 경계 부드럽게 */
.card, .stat, .ticket, .table-wrap { box-shadow: 0 1px 2px rgba(17, 19, 24, .04); }
.stat { border-radius: 16px; }
.btn { transition: background .15s, border-color .15s, transform .08s; }
.btn:hover { border-color: #c9cdd3; }
.btn-primary:hover { border-color: var(--brand-dark); }
.btn:focus-visible, a:focus-visible { outline: 3px solid var(--brand-soft); outline-offset: 1px; }
.choice { transition: border-color .15s, background .15s; }
.choice:hover { border-color: #c9cdd3; }
.icon.off { color: #dfe2e6; }
.brand-star { color: var(--star); }
.list-item .thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; }
.thumb-upload .thumb { width: 88px; height: 88px; border-radius: 12px; object-fit: cover; flex: none; }
.thumb-upload.wide .thumb { width: 160px; height: 84px; }
.store-cover-wrap { transition: transform .2s; }
.store-card:active .store-cover-wrap { transform: scale(.99); }
.store-hero-img { width: 100%; height: 100%; object-fit: cover; }
.cart-store-img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.popular-img { width: 140px; height: 140px; border-radius: 12px; object-fit: cover; }

/* 영업시간 한 줄: 요일 / 오픈 ~ 마감 / 휴무 */
.hours-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 10px minmax(0, 1fr) auto; gap: 6px; align-items: center; margin-bottom: 8px; }
.hours-row input[type=time] { width: 100%; min-width: 0; min-height: 44px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 10px; font: inherit; font-size: 15px; background: #fff; }
.hours-off { display: inline-flex; align-items: center; gap: 4px; font-size: 0.82rem; white-space: nowrap; cursor: pointer; }
.hours-row:has(.hours-off input:checked) input[type=time] { opacity: .4; }
/* 혹시 넘치는 요소가 있어도 화면이 옆으로 밀리지 않게 */
.app { overflow-x: clip; }
.field input, .field select, .field textarea { max-width: 100%; }

/* =========================================================
   실시간 배달 추적
   ========================================================= */
.track-map-wrap { position: relative; }
.track-map-wrap .map { height: 300px; }
.map-note { position: absolute; left: 12px; bottom: 12px; z-index: 500; margin: 0; padding: 6px 10px; border-radius: 8px;
    background: rgba(17, 19, 24, .78); color: #fff; font-size: .78rem; }
.eta-live { font-weight: 700; color: var(--brand) !important; }

/* 가게/집 핀 */
.map-pin .pin { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%;
    border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .3); }

/* 라이더: 파란 원 + 방향 화살표 + 퍼지는 파동 */
.map-rider { position: relative; }
.map-rider .arrow { position: absolute; left: 6px; top: 6px; width: 32px; height: 32px; border-radius: 50%; background: var(--brand);
    border: 3px solid #fff; box-shadow: 0 3px 12px rgba(10, 132, 255, .5); display: flex; align-items: center; justify-content: center;
    transition: transform .4s ease; }
.map-rider .pulse { position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 50%; background: rgba(10, 132, 255, .25);
    animation: rider-pulse 2s ease-out infinite; }
.map-rider.is-stale .arrow { background: #8b9099; box-shadow: none; }
.map-rider.is-stale .pulse { display: none; }
@keyframes rider-pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }

/* 라이더 정보 카드 */
.rider-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.rider-card .avatar { width: 48px; height: 48px; font-size: 1rem; }
.rider-card .grow { flex: 1; min-width: 0; }
.rider-card p { margin: 2px 0 0; }

/* 관리자 실시간 지도 */
.live-layout { display: grid; gap: 16px; }
.live-map { height: 70vh; min-height: 420px; border-radius: var(--radius); }
.live-side { max-height: 70vh; overflow-y: auto; }
.live-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .82rem; color: var(--text-2); margin: 0 0 10px; }
.live-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.live-item { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: .87rem; color: var(--text); }
.live-item:hover { background: var(--bg-2); }
.map-rider.idle .arrow { background: var(--success); box-shadow: 0 3px 12px rgba(18, 183, 106, .45); }
.map-rider.idle .pulse { background: rgba(18, 183, 106, .25); }
@media (min-width: 900px) { .live-layout { grid-template-columns: 1fr 340px; } }

/* 합계 줄: 구분선이 끊기지 않게 열 간격 대신 안쪽 여백 사용 */
.summary { column-gap: 0; }
.summary dd { padding-left: 12px; }

/* 지도 아래 "현재 위치" 버튼 간격, 타입 없는 입력칸도 같은 모양 */
.map + input + input + [data-locate], [data-locate] { margin: 10px 0 16px; }
.field input:not([type]) { width: 100%; min-height: 48px; padding: 12px 14px; font: inherit; font-size: 16px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; }

/* 별점 입력: 라디오는 숨기고 별만 보이게 (공통 라디오 스타일보다 우선) */
.star-input input[type=radio] { display: none; }

/* 사진 올리기 줄: 안내 문구가 줄바꿈되게 */
.thumb-upload > div { flex: 1; min-width: 0; }
.thumb-upload input[type=file] { width: 100%; }
.admin-page .two-col .stat-grid { grid-template-columns: repeat(2, 1fr); }

/* =========================================================
   사장님 메뉴/옵션 편집, 입점 심사, 체크리스트
   ========================================================= */
.row-tools { display: flex; align-items: center; gap: 4px; }
.row-tools form { margin: 0; }
.icon-button.sm { width: 32px; height: 32px; color: var(--text-2); }
.popover { position: relative; }
.popover-card { position: absolute; right: 0; z-index: 10; width: 290px; margin-top: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.owner-item { align-items: flex-start; }
.owner-item .menu-thumb { width: 80px; height: 80px; }
.is-hidden-item { opacity: .55; }
.option-card.is-broken { border-color: #ffd0cc; }
.option-rows li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.option-row-main { display: flex; align-items: center; gap: 8px; }
.option-row-main form { margin: 0; }
.option-row-main .grow { flex: 1; min-width: 0; }
.inline-edit summary { list-style: none; display: inline-block; margin-top: 4px; }
.inline-edit summary::-webkit-details-marker { display: none; }
.option-add { display: grid; grid-template-columns: 1fr 96px auto; gap: 6px; margin-top: 10px; }
.option-add .input { min-height: 40px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; font: inherit; min-width: 0; }

.form-section-title { font-size: 1.1rem; font-weight: 800; margin: 28px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.form .form-section-title:first-of-type { border-top: 0; padding-top: 0; }
.step-list { list-style: none; margin: 12px 0 20px; padding: 0; display: grid; gap: 8px; }
.step-list li { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--text-2); }
.step-list strong { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%;
    background: var(--brand); color: #fff; font-size: .8rem; flex: none; }
.doc-current { margin: 0 0 6px; font-size: .85rem; color: var(--success); }

.verify-status { text-align: center; padding: 8px 0 18px; }
.verify-status h2 { font-size: 1.3rem; font-weight: 800; margin: 8px 0 4px; }
.verify-status p { margin: 4px 0; color: var(--text-2); }
.verify-status .notice { text-align: left; }

.checklist ul { list-style: none; margin: 0; padding: 0; }
.checklist li a { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text); font-size: .92rem; }
.checklist li.done a { color: var(--muted); }
.checklist .grow { flex: 1; }
.check-dot { width: 22px; height: 22px; border-radius: 50%; border: 1.6px solid #c9cdd3; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.checklist li.done .check-dot { background: var(--success); border-color: var(--success); color: #fff; }
.checklist-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.checklist-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #4fa3ff); border-radius: 4px; }
.badge-rejected { background: #ffeceb; color: #b42318; }

/* ---------------- 이벤트 / 쿠폰함 ---------------- */
.form-narrow { max-width: 640px; }
.link-more { display: inline-flex; align-items: center; gap: 2px; font-size: .85rem; font-weight: 600; color: var(--text-2); }
.check-row { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; padding: 4px 0; }
.coupon-fields { margin-top: 12px; }
.segmented-radio { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg-2); margin-bottom: 12px; }
.segmented-radio label { cursor: pointer; }
.segmented-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.segmented-radio span { display: block; padding: 7px 16px; border-radius: 8px; font-size: .88rem; font-weight: 700; color: var(--text-2); }
.segmented-radio input:checked + span { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(17, 19, 24, .1); }
.segmented-radio input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-soft); }

.badge-event-running { background: #e7f8ef; color: #027a48; }
.badge-event-scheduled { background: var(--brand-soft); color: var(--brand-dark); }
.badge-event-ended, .badge-event-inactive { background: var(--bg-2); color: var(--muted); }
.event-thumb { width: 88px; height: 50px; object-fit: cover; border-radius: 8px; display: block; }
.event-form-image { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 8px; }
.event-admin-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; margin-bottom: 12px; }
.event-admin-img { width: 100%; aspect-ratio: 2.4 / 1; object-fit: cover; display: block; }
.event-admin-body { padding: 14px 16px; }
.event-admin-body p { margin: 6px 0 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.event-coupon-line { font-weight: 700; color: var(--brand-dark); }
.event-coupon-line .muted { font-weight: 500; }

.event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.event-card { position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow); border: 1px solid var(--line); color: var(--text); }
.event-card-img { display: block; width: 100%; aspect-ratio: 2.2 / 1; object-fit: cover; background: var(--bg-2); }
.event-card-body { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 14px; }
.event-card-body strong { font-size: 1.02rem; }
.event-card-body span { color: var(--text-2); font-size: .9rem; }
.event-card-body .event-until, .event-until { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .8rem; margin-top: 4px; }
.event-coupon-tag { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 20px; background: rgba(17, 19, 24, .78); color: #fff; font-size: .75rem; font-weight: 700; }
.event-coupon-tag.sm { top: 6px; left: 6px; padding: 2px 7px; font-size: .68rem; }
.store-event-list li { border-bottom: 1px solid var(--line); }
.store-event-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; color: var(--text); }
.store-event-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.store-event-row .muted { font-size: .8rem; }
.store-event-thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; background: var(--bg-2); }
.event-discount { display: inline-flex; align-items: center; gap: 4px; color: var(--brand-dark); font-weight: 700; font-size: .85rem; }

.event-hero { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; background: var(--bg-2); }
.event-title { font-size: 1.35rem; line-height: 1.35; margin: 4px 0 6px; }
.event-summary { color: var(--text-2); margin: 0 0 6px; }
.event-detail .muted { display: flex; align-items: center; gap: 4px; font-size: .85rem; }
.event-store-link { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: .82rem; font-weight: 600; }
.event-body { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--text-2); line-height: 1.7; word-break: break-word; }

.coupon-ticket { position: relative; display: flex; align-items: center; gap: 12px; margin: 16px 0 8px; padding: 16px; border-radius: var(--radius); background: linear-gradient(135deg, #f2f8ff, #e6f0ff); border: 1px solid #cfe2ff; }
.coupon-ticket::before, .coupon-ticket::after { content: ""; position: absolute; right: 116px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 1px solid #cfe2ff; }
.coupon-ticket::before { top: -9px; }
.coupon-ticket::after { bottom: -9px; }
.coupon-ticket-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.coupon-ticket-main .muted { font-size: .8rem; display: block; }
.coupon-ticket-amount { font-size: 1.2rem; font-weight: 800; color: var(--brand-dark); letter-spacing: -.01em; }
.coupon-ticket-action { flex: none; width: 104px; display: flex; justify-content: center; padding-left: 12px; border-left: 1.5px dashed #b9d4ff; }
.coupon-ticket-action form { margin: 0; }
.coupon-ticket.is-off { background: var(--bg-2); border-color: var(--line-2); filter: grayscale(1); opacity: .75; }
.coupon-wallet { list-style: none; margin: 0; padding: 0; }
.coupon-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; font-weight: 700; color: var(--brand-dark); word-break: break-all; text-align: center; }

.store-events { margin: 4px 16px 8px; padding: 14px 16px; border-radius: var(--radius); background: #f5f9ff; border: 1px solid #dbe9ff; }
.store-events .section-title { display: flex; align-items: center; gap: 6px; font-size: .98rem; margin: 0 0 6px; }
.store-event { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.store-event + .store-event { border-top: 1px solid #e3eefc; }
.store-event form { margin: 0; }
.store-event-text { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--text); }
.store-event-text strong { font-size: .92rem; }
.store-event-text .muted { font-size: .82rem; }

.home-events { padding-top: 14px; }
.event-strip { display: flex; gap: 10px; overflow-x: auto; padding: 8px 16px 4px; scrollbar-width: none; }
.event-strip::-webkit-scrollbar { display: none; }
.event-chip { position: relative; flex: none; width: 148px; color: var(--text); }
.event-chip-img { display: block; width: 148px; height: 92px; border-radius: 12px; object-fit: cover; background: var(--bg-2); }
.event-chip-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 6px; font-size: .84rem; font-weight: 600; line-height: 1.35; }

.checkout-coupons { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.checkout-coupon { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line-2); border-radius: 12px; color: var(--text); }
.checkout-coupon .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.checkout-coupon .muted { font-size: .8rem; }
.checkout-coupon.selected { border-color: var(--brand); background: var(--brand-soft); }
.checkout-coupon.is-off { opacity: .6; pointer-events: none; }
.radio-dot { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 1.6px solid #c4c8ce; background: #fff; }
.checkout-coupon.selected .radio-dot { border: 6px solid var(--brand); }
.coupon-save { font-weight: 800; color: var(--brand-dark); }
