:root {
  --accent: #ef3f22;
  --accent-2: #ff6a19;
  --accent-rgb: 239, 63, 34;
  --accent-2-rgb: 255, 106, 25;
  --text: #202124;
  --muted: #6f7378;
  --line: #e8e5e2;
  --surface: #ffffff;
  --soft: #f7f6f4;
  --shadow: 0 12px 35px rgba(48, 39, 30, .08);
  --radius: 18px;
  --sidebar-width: 260px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", sans-serif; color: var(--text); background: #fbfaf9; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
.container { width: min(1420px, calc(100% - 40px)); margin-inline: auto; }
[hidden] { display: none !important; }

/* shared brand */
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark { width: 46px; aspect-ratio: 1; display: grid; place-items: center; color: #fff; font-size: 22px; font-weight: 900; background: linear-gradient(145deg, var(--accent), var(--accent-2)); border-radius: 14px; box-shadow: 0 7px 18px rgba(var(--accent-rgb),.25); }
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font-size: 24px; color: var(--accent); letter-spacing: .01em; }
.brand-copy small { color: var(--muted); font-size: 10px; margin-top: 5px; letter-spacing: .06em; }
.eyebrow { display: inline-block; color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-weight: 850; font-size: 11px; }

/* app shell and sidebar */
.app-shell { min-height: 100vh; }
.site-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 80; width: var(--sidebar-width); display: flex; flex-direction: column; padding: 25px 18px 20px; background: rgba(255,255,255,.98); border-right: 1px solid var(--line); box-shadow: 8px 0 30px rgba(43,36,31,.04); transition: transform .24s ease, box-shadow .24s ease; }
.sidebar-brand-wrap { display: flex; align-items: center; justify-content: space-between; padding: 0 7px 29px; }
.sidebar-close { display: none; border: 0; background: #f4f2f0; width: 36px; height: 36px; border-radius: 10px; font-size: 23px; cursor: pointer; }
.sidebar-collapse-button { position: absolute; right: -17px; top: 50%; transform: translateY(-50%); width: 34px; height: 56px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 0 14px 14px 0; background: #fff; color: #777; box-shadow: 5px 4px 18px rgba(48,39,30,.09); cursor: pointer; font-size: 25px; line-height: 1; transition: color .18s, background .18s; }
.sidebar-collapse-button:hover { color: var(--accent); background: #fff8f5; }
.sidebar-reveal-button { position: fixed; left: 14px; top: 88px; z-index: 65; display: none; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 9px 13px; background: rgba(255,255,255,.96); color: #555; box-shadow: 0 8px 24px rgba(48,39,30,.12); backdrop-filter: blur(12px); cursor: pointer; font-weight: 800; }
.sidebar-reveal-button:hover { color: var(--accent); }
body.sidebar-collapsed .site-sidebar { transform: translateX(calc(-100% - 20px)); box-shadow: none; }
body.sidebar-collapsed .app-main { margin-left: 0; }
body.sidebar-collapsed .sidebar-reveal-button { display: inline-flex; }
.side-nav { display: grid; gap: 7px; }
.side-nav-label { margin: 24px 13px 5px; color: #999; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.side-nav-item { width: 100%; min-height: 52px; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; border: 0; border-radius: 14px; padding: 10px 13px; background: transparent; text-align: left; font-weight: 800; cursor: pointer; transition: .18s; }
.side-nav-item:hover { background: #f7f3f1; color: var(--accent); }
.side-nav-item.is-active { color: #fff; background: linear-gradient(130deg, var(--accent), var(--accent-2)); box-shadow: 0 9px 22px rgba(var(--accent-rgb),.18); }
.side-nav-item small { color: #aaa; font-size: 10px; font-weight: 700; }
.side-nav-item.is-active small { color: rgba(255,255,255,.78); }
.side-nav-icon { font-size: 20px; line-height: 1; text-align: center; }
.sidebar-bottom { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid var(--line); }
.side-admin-link { display: inline-flex; color: var(--accent); font-weight: 800; font-size: 13px; }
.sidebar-bottom p { margin: 10px 0 0; color: #999; font-size: 11px; }
.sidebar-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(32,26,23,.48); backdrop-filter: blur(2px); }
.app-main { min-width: 0; min-height: 100vh; margin-left: var(--sidebar-width); display: flex; flex-direction: column; transition: margin-left .24s ease; }
.app-main > main { flex: 1; }

/* header */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.93); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.mobile-title-group { display: flex; align-items: center; gap: 11px; }
.mobile-title-group > strong { font-size: 18px; }
.mobile-brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: #fff; font-weight: 900; background: linear-gradient(145deg, var(--accent), var(--accent-2)); }
.menu-button { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; }
.top-nav { display: flex; align-items: center; gap: 20px; color: #676767; font-size: 14px; }
.top-nav a:hover { color: var(--accent); }
.admin-link { font-weight: 800; }

/* views */
.page-view { display: none; }
.page-view.is-active { display: block; }
.page-intro { padding-top: 38px; }
.page-intro h1 { margin: 5px 0 6px; font-size: clamp(30px, 4vw, 45px); line-height: 1.15; }
.page-intro p { margin: 0; color: var(--muted); }

/* featured posts */
.featured-section { min-height: 570px; padding-block: 26px 60px; }
.featured-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 23px; }
.post-card { overflow: hidden; display: flex; flex-direction: column; min-height: 390px; border: 1px solid #ebe7e4; border-radius: 20px; background: #fff; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.post-card:hover { transform: translateY(-3px); box-shadow: 0 17px 44px rgba(48,39,30,.12); }
.post-cover { position: relative; height: 190px; overflow: hidden; background: linear-gradient(135deg, rgba(var(--accent-rgb),.98), rgba(var(--accent-2-rgb),.9)); }
.post-cover img { width: 100%; height: 100%; display: block; object-fit: cover; }
.post-cover-fallback { height: 100%; display: grid; place-items: center; color: rgba(255,255,255,.94); font-size: 32px; font-weight: 900; letter-spacing: .08em; }
.post-date-badge { position: absolute; left: 16px; top: 15px; padding: 6px 9px; color: #fff; border-radius: 999px; background: rgba(31,27,25,.72); backdrop-filter: blur(7px); font-size: 11px; font-weight: 800; }
.post-body { flex: 1; display: flex; flex-direction: column; padding: 22px; }
.post-body h2 { margin: 5px 0 9px; font-size: 22px; line-height: 1.35; }
.post-body p { margin: 0; color: #666; }
.post-actions { display: flex; gap: 9px; margin-top: auto; padding-top: 20px; }
.post-actions > * { flex: 1; }
.post-dialog-content { white-space: pre-wrap; color: #555; }
.post-dialog .post-dialog-date { color: var(--accent); font-weight: 800; font-size: 13px; }
.post-dialog h2 { margin-top: 7px; }

/* dining filters */
.search-panel { background: #fff; border-bottom: 1px solid var(--line); padding: 20px 0 14px; }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 14px; }
.search-box { display: flex; align-items: center; gap: 10px; background: #f8f7f6; border: 1px solid #e3dfdc; border-radius: 14px; padding: 0 15px; transition: .2s; }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb),.10); background: #fff; }
.search-box svg { width: 22px; fill: none; stroke: #777; stroke-width: 2; }
.search-box input { min-width: 0; width: 100%; height: 48px; border: 0; outline: 0; background: transparent; font-size: 16px; }
.control { border: 1px solid #e3dfdc; border-radius: 14px; background: #fff; padding: 0 14px; color: #333; }
.filter-section { display: grid; grid-template-columns: 62px minmax(0,1fr); gap: 10px; align-items: center; margin-top: 15px; }
.filter-label { color: #7a7a7a; font-size: 13px; font-weight: 700; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; padding: 2px 0 7px; }
.chip-row::-webkit-scrollbar { height: 5px; }
.chip-row::-webkit-scrollbar-thumb { background: #d7d3cf; border-radius: 999px; }
.chip { flex: 0 0 auto; border: 1px solid transparent; background: #f4f3f2; color: #414141; border-radius: 999px; padding: 8px 13px; cursor: pointer; transition: .18s; }
.chip:hover { background: #ece9e7; }
.chip.is-active { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 5px 14px rgba(var(--accent-rgb),.18); }
.brand-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: var(--dot); margin-right: 6px; }
.brand-dot.large { width: 12px; height: 12px; }
.price-filter-row { grid-template-columns: 62px auto auto 1fr; }
.chip-row.compact { overflow: visible; }
.custom-price { display: inline-flex; align-items: center; gap: 7px; }
.custom-price input { width: 90px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 9px; }
.mini-button { border: 0; color: #fff; background: #333; border-radius: 9px; padding: 8px 12px; cursor: pointer; }
.filter-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 11px; padding-top: 12px; border-top: 1px solid #f0eeec; }
.result-summary { color: var(--muted); }
.result-summary strong { color: var(--text); }
.text-button { color: var(--accent); border: 0; background: transparent; cursor: pointer; }

/* offers */
.content-section { min-height: 480px; padding-block: 30px 55px; }
.offer-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 24px; }
.offer-card { position: relative; display: flex; flex-direction: column; min-height: 350px; overflow: hidden; background: var(--surface); border: 1px solid #ebe7e4; border-radius: var(--radius); padding: 25px 24px 22px; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.offer-card:hover { transform: translateY(-3px); box-shadow: 0 16px 42px rgba(48,39,30,.12); }
.discount-ribbon { position: absolute; right: -42px; top: 18px; width: 142px; padding: 8px 0; transform: rotate(45deg); text-align: center; color: #fff; font-weight: 900; background: linear-gradient(90deg,var(--accent),var(--accent-2)); box-shadow: 0 4px 10px rgba(var(--accent-rgb),.25); }
.offer-card-top { display: flex; gap: 13px; align-items: flex-start; padding-right: 48px; }
.brand-badge { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; font-weight: 900; border-radius: 12px; background: var(--brand); }
.offer-heading { min-width: 0; }
.offer-brand { display: block; color: #888; font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.offer-heading h2 { margin: 0; font-size: 20px; line-height: 1.3; }
.item-list { margin: 17px 0 10px; padding: 0 0 0 19px; color: #64676b; min-height: 52px; }
.item-list li { margin: 4px 0; }
.item-list li::marker { color: #f06d78; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-row span { color: #6a6a6a; background: #f5f3f1; border-radius: 999px; padding: 4px 8px; font-size: 11px; }
.card-divider { margin: 16px 0; border-top: 1px solid #ece9e6; }
.price-date-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.price-block { display: flex; align-items: baseline; gap: 9px; }
.price-block strong { color: var(--accent); font-size: 27px; line-height: 1; }
.price-block del { color: #858585; font-size: 13px; }
.date-block { text-align: right; color: #818181; font-size: 11px; }
.date-block span { display: block; }
.date-block strong { color: #6f6f6f; font-weight: 600; }
.save-note { margin-top: 7px; color: #db5a2d; font-size: 12px; font-weight: 700; }
.card-actions { display: grid; grid-template-columns: .9fr 1.25fr; gap: 9px; margin-top: auto; padding-top: 18px; }
.primary-button, .secondary-button, .danger-button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; border-radius: 11px; padding: 9px 15px; font-weight: 750; cursor: pointer; transition: .18s; }
.primary-button { color: #fff; border: 0; background: linear-gradient(120deg,var(--accent),var(--accent-2)); box-shadow: 0 7px 17px rgba(var(--accent-rgb),.18); }
.primary-button:hover { filter: brightness(.97); transform: translateY(-1px); }
.secondary-button { color: #333; border: 1px solid #dfdbd8; background: #fff; }
.secondary-button:hover { border-color: #cfc8c2; background: #faf8f7; }
.danger-button { color: #b42318; border: 1px solid #f4c7c2; background: #fff5f4; }
.empty-state { text-align: center; padding: 90px 20px; }
.empty-icon { font-size: 44px; }
.empty-state h2 { margin-bottom: 5px; }
.empty-state p { color: var(--muted); }
.empty-state .primary-button { margin-top: 12px; }

/* tech placeholder */
.placeholder-section { min-height: calc(100vh - 150px); display: grid; place-items: center; padding-block: 60px; }
.placeholder-card { width: min(650px, 100%); text-align: center; padding: 58px 35px; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.placeholder-icon { display: block; font-size: 54px; margin-bottom: 13px; }
.placeholder-card h1 { margin: 7px 0; font-size: 35px; }
.placeholder-card p { color: var(--muted); margin: 0; }

/* footer and dialog */
.site-footer { border-top: 1px solid var(--line); background: #fff; }
.footer-inner { display: flex; justify-content: space-between; gap: 15px; padding-block: 24px; color: #777; font-size: 13px; }
.offer-dialog { width: min(590px, calc(100% - 28px)); border: 0; border-radius: 20px; padding: 31px; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.offer-dialog::backdrop { background: rgba(20,17,15,.55); backdrop-filter: blur(4px); }
.dialog-close { position: absolute; right: 14px; top: 10px; border: 0; background: transparent; font-size: 29px; color: #777; cursor: pointer; }
.dialog-brand { color: var(--brand); font-weight: 850; font-size: 13px; }
.offer-dialog h2 { margin: 5px 30px 8px 0; font-size: 27px; }
.dialog-price { display: flex; gap: 10px; align-items: baseline; }
.dialog-price strong { color: var(--accent); font-size: 31px; }
.dialog-price del { color: #888; }
.dialog-items { padding-left: 20px; color: #555; }
.detail-list { margin: 22px 0; border-top: 1px solid var(--line); }
.detail-list div { display: grid; grid-template-columns: 90px 1fr; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-list dt { color: #888; }
.detail-list dd { margin: 0; }
.dialog-cta { width: 100%; }

/* admin */
.admin-body { background: #f6f4f2; }
.admin-main { padding-block: 35px 65px; }
.admin-hero { display: flex; justify-content: space-between; gap: 25px; align-items: flex-end; margin-bottom: 24px; }
.admin-hero h1 { margin: 5px 0; font-size: 34px; }
.admin-hero p, .panel-header p { color: var(--muted); margin: 0; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.file-label { cursor: pointer; }
.notice { position: sticky; top: 82px; z-index: 30; margin-bottom: 18px; border: 1px solid #bde7cd; background: #effbf3; color: #166534; border-radius: 11px; padding: 12px 15px; }
.notice.error { border-color: #f2b8b5; background: #fff2f1; color: #b42318; }
.admin-grid { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 24px; align-items: start; }
.admin-sidebar { position: sticky; top: 96px; display: grid; gap: 7px; }
.admin-tab { text-align: left; border: 0; border-radius: 11px; padding: 12px 14px; background: transparent; color: #666; cursor: pointer; }
.admin-tab.is-active { background: #fff; color: var(--accent); font-weight: 800; box-shadow: 0 5px 16px rgba(48,39,30,.07); }
.admin-panel { display: none; }
.admin-panel.is-active { display: block; }
.panel-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin: 0 0 13px; }
.panel-header h2 { margin: 0 0 3px; }
.form-card { border: 1px solid #e7e2de; background: #fff; border-radius: 16px; padding: 23px; box-shadow: 0 7px 22px rgba(48,39,30,.05); }
.form-grid { display: grid; gap: 16px; }
.form-grid.two-col { grid-template-columns: 1fr 1fr; }
.form-card label, .form-card legend { display: grid; gap: 7px; color: #555; font-weight: 700; font-size: 13px; }
.form-card label span, legend span { color: var(--accent); }
.form-card input, .form-card select, .form-card textarea, .admin-search { width: 100%; border: 1px solid #ddd8d4; border-radius: 10px; padding: 10px 11px; outline: none; background: #fff; }
.form-card input:focus, .form-card select:focus, .form-card textarea:focus, .admin-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.09); }
.form-card fieldset { margin: 17px 0; padding: 0; border: 0; }
.checkbox-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.check-chip { display: inline-flex !important; cursor: pointer; }
.check-chip input { position: absolute; opacity: 0; pointer-events: none; }
.check-chip span { color: #555 !important; background: #f6f4f2; border: 1px solid transparent; border-radius: 999px; padding: 7px 11px; }
.check-chip input:checked + span { color: var(--accent) !important; border-color: #f4b0a5; background: #fff4f1; }
.switch-label { display: flex !important; grid-template-columns: auto 1fr; align-items: center; margin-top: 15px; }
.switch-label input { width: auto; }
.switch-label span { color: #555 !important; }
.form-actions { display: flex; gap: 9px; margin-top: 18px; }
.list-header { margin-top: 30px; }
.admin-search { width: 260px; }
.admin-list { display: grid; gap: 9px; }
.admin-list-item, .manage-item { display: flex; justify-content: space-between; align-items: center; gap: 15px; border: 1px solid #e7e2de; background: #fff; border-radius: 13px; padding: 14px 16px; }
.admin-item-main, .manage-item > div { display: flex; align-items: center; gap: 11px; min-width: 0; }
.admin-item-main > div, .manage-item > div { min-width: 0; }
.admin-item-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-item-main small, .manage-item small { display: block; color: #888; margin-top: 2px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #b7b7b7; }
.status-dot.live { background: #22a06b; box-shadow: 0 0 0 4px #e0f4ea; }
.row-actions { display: flex; gap: 5px; }
.icon-button { border: 0; background: #f5f3f1; color: #555; border-radius: 8px; padding: 7px 10px; cursor: pointer; }
.danger-text { color: #b42318; }
.inline-form { display: grid; grid-template-columns: 1fr 150px auto; align-items: end; gap: 14px; margin-bottom: 18px; }
.manage-list { display: grid; gap: 8px; }
.manage-emoji { font-size: 22px; }
.empty-admin { color: #888; background: #fff; border-radius: 12px; padding: 25px; text-align: center; }
.form-grid-full { grid-column: 1 / -1; }
.image-upload-field { display: grid; gap: 9px; }
.form-field-title { color: #555; font-weight: 700; font-size: 13px; }
.image-upload-box { position: relative; min-height: 220px; display: grid; place-items: center; overflow: hidden; border: 2px dashed #ddd5d0; border-radius: 14px; background: #faf8f7; cursor: pointer; transition: border-color .18s, background .18s, box-shadow .18s; }
.image-upload-box:hover, .image-upload-box:focus, .image-upload-box.is-dragging { border-color: var(--accent); background: rgba(var(--accent-rgb),.055); box-shadow: 0 0 0 4px rgba(var(--accent-rgb),.08); outline: none; }
.image-upload-placeholder { display: grid; justify-items: center; gap: 5px; padding: 30px; text-align: center; color: #666; }
.image-upload-placeholder::before { content: "＋"; width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); font-size: 28px; font-weight: 400; box-shadow: 0 8px 20px rgba(var(--accent-rgb),.18); }
.image-upload-placeholder small { max-width: 520px; color: #8b8b8b; font-weight: 500; }
.image-upload-preview { width: 100%; height: 280px; display: block; object-fit: cover; background: #eee; }
.image-upload-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.image-upload-status { color: #888; font-weight: 500; }

@media (max-width: 1250px) {
  .offer-grid, .featured-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 1050px) {
  .updated-text { display:none; }
  .price-filter-row { grid-template-columns: 62px 1fr; }
  .price-filter-row > .chip, .custom-price { grid-column: 2; justify-self: start; }
  .admin-grid { grid-template-columns: 150px minmax(0,1fr); }
}
@media (max-width: 900px) {
  body.sidebar-collapsed .site-sidebar { transform: translateX(-105%); }
  body.sidebar-collapsed .sidebar-reveal-button { display: none; }
  .sidebar-collapse-button { display: none; }
  .site-sidebar { transform: translateX(-105%); transition: transform .22s ease; box-shadow: 18px 0 50px rgba(0,0,0,.18); }
  .site-sidebar.is-open { transform: translateX(0); }
  .sidebar-close { display: grid; place-items: center; }
  .app-main { margin-left: 0; }
  .menu-button { display: grid; place-items: center; }
}
@media (max-width: 760px) {
  .container { width: min(100% - 24px, 1420px); }
  .header-inner { min-height: 64px; }
  .mobile-brand-mark { display: none; }
  .top-nav a:not(.admin-link) { display:none; }
  .search-panel { padding-top: 13px; }
  .search-row { grid-template-columns: 1fr; }
  .control { min-height: 44px; }
  .filter-section { grid-template-columns: 1fr; gap: 5px; }
  .filter-label { padding-left: 2px; }
  .price-filter-row { grid-template-columns: 1fr; }
  .price-filter-row > .chip, .custom-price { grid-column: 1; }
  .custom-price { flex-wrap: wrap; }
  .filter-footer { gap: 10px; }
  .text-button { white-space: nowrap; }
  .content-section { padding-top: 18px; }
  .offer-grid, .featured-grid { grid-template-columns: 1fr; gap: 15px; }
  .offer-card { min-height: 330px; padding: 21px 18px 18px; }
  .offer-heading h2 { font-size: 19px; }
  .price-date-row { align-items: flex-start; flex-direction: column; }
  .date-block { text-align: left; }
  .card-actions { grid-template-columns: 1fr 1.2fr; }
  .post-cover { height: 175px; }
  .page-intro { padding-top: 26px; }
  .footer-inner { flex-direction: column; }
  .offer-dialog { padding: 27px 21px; }
  .admin-main { padding-top: 22px; }
  .admin-hero { align-items: flex-start; flex-direction: column; }
  .admin-hero h1 { font-size: 29px; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; grid-template-columns: repeat(4, minmax(120px, 1fr)); overflow-x: auto; }
  .admin-tab { text-align: center; white-space: nowrap; }
  .form-grid.two-col { grid-template-columns: 1fr; }
  .panel-header { align-items: flex-start; flex-direction: column; }
  .admin-search { width: 100%; }
  .inline-form { grid-template-columns: 1fr; }
  .admin-list-item { align-items: flex-start; flex-direction: column; }
  .row-actions { align-self: flex-end; }
  .image-upload-box { min-height: 180px; }
  .image-upload-preview { height: 210px; }
}


/* v4: dynamic main categories, product thumbnails and category-specific admin */
.dynamic-side-nav, .admin-section-tabs { display: grid; gap: 7px; }
.catalog-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.catalog-heading-row h1 { margin: 3px 0 2px; font-size: clamp(25px, 3vw, 34px); line-height: 1.2; }
.catalog-heading-row p { margin: 0; color: var(--muted); font-size: 13px; }

.offer-thumbnail, .brand-badge {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 14px;
}
.offer-thumbnail { overflow: hidden; background: #f2f0ee; border: 1px solid #e8e3df; }
.offer-thumbnail img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand-badge { font-size: 20px; box-shadow: 0 7px 16px color-mix(in srgb, var(--brand) 22%, transparent); }
.offer-card-top { min-height: 52px; }
.dialog-product-image { width: 118px; height: 118px; display: block; object-fit: cover; border-radius: 20px; margin-bottom: 17px; border: 1px solid var(--line); box-shadow: 0 10px 26px rgba(48,39,30,.10); }
.post-dialog-image { width: 100%; max-height: 330px; display: block; object-fit: cover; border-radius: 15px; margin-bottom: 18px; }

.admin-nav-label { margin: 14px 10px 2px; color: #999; font-size: 11px; font-weight: 850; letter-spacing: .08em; }
.admin-section-select { min-width: 190px; border: 1px solid #ddd8d4; border-radius: 11px; background: #fff; padding: 10px 12px; }
.inline-form.four-fields { grid-template-columns: minmax(150px,.8fr) minmax(180px,1.2fr) 120px auto; }
.list-filter-row { display: flex; justify-content: flex-end; margin: 2px 0 13px; }
.list-filter-row label { display: flex; align-items: center; gap: 8px; color: #666; font-size: 13px; font-weight: 700; }
.list-filter-row select { min-width: 180px; border: 1px solid #ddd8d4; border-radius: 10px; background: #fff; padding: 8px 10px; }
.compact-switch { align-self: end; min-height: 42px; }
.empty-inline { width: 100%; color: #8a8a8a; border: 1px dashed #ddd7d2; border-radius: 11px; padding: 12px; background: #faf9f8; }
.admin-thumb { width: 52px; height: 38px; flex: 0 0 auto; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); background: #eee; }
.admin-thumb.square, .admin-fallback-thumb { width: 44px; height: 44px; border-radius: 11px; }
.admin-fallback-thumb { display: grid; place-items: center; flex: 0 0 auto; color: #fff; font-weight: 900; background: var(--brand); }
.offer-image-field { grid-template-columns: minmax(160px, 220px) 1fr; align-items: center; column-gap: 18px; }
.offer-image-field .form-field-title { grid-column: 1 / -1; }
.image-upload-box-square { width: 190px; min-height: 190px; aspect-ratio: 1; }
.image-upload-preview-square { width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; }
.offer-image-field .image-upload-actions, .offer-image-field .image-upload-status { grid-column: 2; }
.offer-image-field .image-upload-actions { align-self: end; }
.offer-image-field .image-upload-status { align-self: start; }

@media (max-width: 980px) {
  .inline-form.four-fields { grid-template-columns: 1fr 1fr; }
  .inline-form.four-fields .primary-button { align-self: end; }
}

@media (max-width: 760px) {
  .catalog-heading-row { margin-bottom: 13px; }
  .catalog-heading-row h1 { font-size: 25px; }
  .offer-thumbnail, .brand-badge { width: 48px; height: 48px; border-radius: 13px; }
  .admin-sidebar { display: flex; gap: 7px; overflow-x: auto; }
  .admin-section-tabs { display: contents; }
  .admin-nav-label { display: none; }
  .inline-form.four-fields { grid-template-columns: 1fr; }
  .list-filter-row { justify-content: stretch; }
  .list-filter-row label, .list-filter-row select { width: 100%; }
  .offer-image-field { grid-template-columns: 1fr; }
  .offer-image-field .form-field-title, .offer-image-field .image-upload-actions, .offer-image-field .image-upload-status { grid-column: 1; }
  .image-upload-box-square { width: min(220px, 100%); min-height: 180px; }
  .admin-section-select { width: 100%; }
}

/* v5: legal pages and brand-specific item filters */
.sidebar-legal-links { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 12px; font-size: 10px; color: #888; }
.sidebar-legal-links a:hover { color: var(--accent); }
.footer-inner { align-items: center; flex-wrap: wrap; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; }
.footer-links a { color: #666; }
.footer-links a:hover, .footer-links a[aria-current="page"] { color: var(--accent); }
.chip.is-disabled { cursor: default; color: #999; background: #f6f4f2; border-color: #ebe7e4; }
.brand-item-tags span { color: #9b2c19; background: #fff0eb; }
.fieldset-help { margin: 3px 0 8px; color: var(--muted); font-size: 12px; font-weight: 500; }
.brand-item-form { grid-template-columns: minmax(145px,.8fr) minmax(155px,.9fr) minmax(180px,1.2fr) 105px auto; }
.brand-item-list-filters { gap: 12px; }

.legal-body { min-height: 100vh; display: flex; flex-direction: column; background: #f7f5f3; }
.legal-header { position: sticky; top: 0; }
.legal-main { flex: 1; width: min(920px, calc(100% - 40px)); padding-block: 42px 70px; }
.legal-card { border: 1px solid var(--line); border-radius: 22px; padding: clamp(26px, 5vw, 54px); background: #fff; box-shadow: var(--shadow); }
.legal-card > h1 { margin: 7px 0 2px; font-size: clamp(32px, 5vw, 46px); line-height: 1.15; }
.legal-updated { margin: 0 0 35px; color: var(--muted); font-size: 13px; }
.legal-card section { padding-block: 20px; border-top: 1px solid #efebe8; }
.legal-card section:first-of-type { border-top: 0; padding-top: 0; }
.legal-card h2 { margin: 0 0 10px; font-size: 20px; }
.legal-card p { margin: 0 0 11px; color: #555; line-height: 1.85; }
.legal-card p:last-child { margin-bottom: 0; }

@media (max-width: 1100px) {
  .brand-item-form { grid-template-columns: 1fr 1fr; }
  .brand-item-form .primary-button { align-self: end; }
}

@media (max-width: 760px) {
  .footer-links { justify-content: flex-start; }
  .brand-item-form { grid-template-columns: 1fr; }
  .brand-item-list-filters { align-items: stretch; flex-direction: column; }
  .legal-main { width: min(100% - 24px, 920px); padding-block: 24px 44px; }
  .legal-card { border-radius: 17px; padding: 25px 20px; }
  .legal-card h2 { font-size: 18px; }
}

/* v6: announcements, editable legal documents and back-to-top */
.announcement-bar {
  position: relative;
  z-index: 45;
  min-height: 42px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(110deg, var(--accent), var(--accent), var(--accent-2));
  box-shadow: 0 5px 18px rgba(var(--accent-rgb),.16);
}
.announcement-label {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 17px;
  background: rgba(126,20,8,.24);
  border-right: 1px solid rgba(255,255,255,.24);
  font-size: 13px;
  letter-spacing: .04em;
  white-space: nowrap;
}
.ticker-viewport { min-width: 0; flex: 1; overflow: hidden; display: flex; align-items: center; }
.ticker-track {
  --ticker-duration: 26s;
  display: flex;
  width: max-content;
  will-change: transform;
  animation: ticker-scroll var(--ticker-duration) linear infinite;
}
.ticker-group { display: inline-flex; align-items: center; gap: 48px; padding-right: 48px; white-space: nowrap; }
.ticker-item { display: inline-flex; align-items: center; gap: 9px; min-height: 42px; color: #fff; font-size: 13px; font-weight: 700; }
a.ticker-item:hover { text-decoration: underline; text-underline-offset: 3px; }
.ticker-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 0 0 4px rgba(255,255,255,.13); }
.announcement-bar:hover .ticker-track, .announcement-bar:focus-within .ticker-track { animation-play-state: paused; }
@keyframes ticker-scroll { to { transform: translateX(-50%); } }

.back-to-top {
  position: fixed;
  right: 25px;
  bottom: 25px;
  z-index: 65;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 45px;
  border: 1px solid rgba(var(--accent-rgb),.18);
  border-radius: 999px;
  padding: 10px 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px rgba(var(--accent-rgb),.28);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  transition: transform .18s ease, box-shadow .18s ease;
}
.back-to-top:hover { transform: translateY(-2px); box-shadow: 0 16px 35px rgba(var(--accent-rgb),.34); }
.back-to-top > span:first-child { font-size: 18px; line-height: 1; }

.legal-content-editor { min-height: 440px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; line-height: 1.65; }
.form-card input[readonly] { color: #777; background: #f2f0ee; cursor: not-allowed; }
.legal-content > p { margin-bottom: 17px; }
.legal-content h3 { margin: 18px 0 9px; font-size: 17px; }
.legal-list { margin: 0 0 14px; padding-left: 1.4em; color: #555; line-height: 1.85; }
.legal-not-found { text-align: center; }
.legal-not-found h1 { margin-bottom: 12px; }
.legal-not-found .primary-button { display: inline-flex; margin-top: 12px; }
.legal-announcement-bar { flex: 0 0 auto; }

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; transform: none; }
  .ticker-viewport { overflow-x: auto; }
  .ticker-group[aria-hidden="true"] { display: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 760px) {
  .announcement-bar { min-height: 39px; }
  .announcement-label { padding: 0 11px; font-size: 12px; }
  .announcement-label span { display: none; }
  .ticker-item { min-height: 39px; font-size: 12px; }
  .ticker-group { gap: 34px; padding-right: 34px; }
  .back-to-top { right: 14px; bottom: 15px; min-width: 44px; min-height: 44px; justify-content: center; padding: 9px 13px; }
  .back-to-top > span:last-child { display: none; }
  .legal-content-editor { min-height: 360px; }
}
.ticker-group[aria-hidden="true"] { pointer-events: none; }


/* v7: editable site appearance */
.theme-preset-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.theme-preset { min-height: 78px; display: grid; justify-items: center; align-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; transition: transform .18s, border-color .18s, box-shadow .18s; }
.theme-preset:hover { transform: translateY(-2px); border-color: rgba(var(--accent-rgb),.42); }
.theme-preset.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.11); }
.theme-preset > span { width: 46px; height: 26px; border-radius: 999px; background: linear-gradient(90deg, var(--preset-a), var(--preset-b)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.theme-preset strong { font-size: 13px; }
.form-card input[type="color"] { width: 100%; min-height: 48px; padding: 5px; cursor: pointer; }
.range-field { display: grid !important; gap: 9px; }
.range-field > span { font-weight: 800; }
.range-field output { color: var(--accent); }
.range-field input[type="range"] { width: 100%; accent-color: var(--accent); }
.range-field small { color: var(--muted); font-weight: 500; }
.theme-preview { --preview-accent: var(--accent); --preview-accent-2: var(--accent-2); display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(135deg, rgba(var(--accent-rgb),.035), #fff); }
.theme-preview-brand { display: flex; align-items: center; gap: 12px; }
.theme-preview-brand .brand-mark { background: linear-gradient(145deg, var(--preview-accent), var(--preview-accent-2)); }
.theme-preview-brand div { display: grid; line-height: 1.2; }
.theme-preview-brand strong { color: var(--preview-accent); font-size: 20px; }
.theme-preview-brand small { color: var(--muted); }
.theme-preview-actions { display: flex; align-items: center; gap: 10px; }
.preview-chip { padding: 8px 13px; border-radius: 999px; color: #fff; background: linear-gradient(135deg, var(--preview-accent), var(--preview-accent-2)); }
.preview-button { padding: 9px 14px; border-radius: 10px; color: #fff; background: linear-gradient(120deg, var(--preview-accent), var(--preview-accent-2)); font-weight: 800; }
@media (max-width: 850px) { .theme-preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .theme-preview { align-items: flex-start; flex-direction: column; } }

/* ===== MVP v8: wallet, calculator and indexable content pages ===== */
.user-wallet-bar { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-bottom:24px; padding:15px 17px; border:1px solid var(--line); border-radius:16px; background:#fff; box-shadow:0 6px 22px rgba(48,39,30,.05); }
.wallet-bar-label { display:flex; align-items:center; gap:10px; min-width:250px; }
.wallet-bar-label > span { font-size:24px; }
.wallet-bar-label > div { display:grid; }
.wallet-bar-label strong { font-size:14px; }
.wallet-bar-label small { color:var(--muted); font-size:11px; }
.wallet-pills { display:flex; flex:1; flex-wrap:wrap; gap:8px; }
.wallet-pill { display:inline-flex; align-items:center; gap:5px; border:1px solid #ddd8d4; border-radius:999px; padding:7px 11px; background:#f8f7f6; color:#464646; cursor:pointer; transition:.18s; }
.wallet-pill:hover { border-color:var(--accent); }
.wallet-pill small { padding-left:4px; color:#777; font-size:10px; }
.wallet-pill.is-active { color:#fff; border-color:var(--accent); background:linear-gradient(135deg,var(--accent),var(--accent-2)); box-shadow:0 5px 14px rgba(var(--accent-rgb),.2); }
.wallet-pill.is-active small { color:rgba(255,255,255,.82); }
.wallet-empty { color:var(--muted); font-size:13px; }
.effective-price-note { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:10px; padding:9px 11px; border-radius:10px; color:#116b57; background:#eaf8f3; font-size:12px; }
.effective-price-note strong { font-size:14px; }
.inline-brand-page-link { color:var(--accent); font-weight:800; }
.card-actions.three-actions { grid-template-columns:repeat(3,minmax(0,1fr)); }
.card-actions.three-actions > * { min-width:0; padding-inline:8px; }
.offer-heading h2 a:hover, .post-body h2 a:hover { color:var(--accent); }

.calculator-dialog { width:min(620px,calc(100% - 28px)); max-height:92vh; padding:0; overflow:hidden; border:0; border-radius:22px; background:#fff; box-shadow:0 28px 85px rgba(25,20,17,.28); }
.calculator-dialog::backdrop { background:rgba(30,24,21,.58); backdrop-filter:blur(3px); }
.calc-dialog-header { position:relative; display:flex; align-items:flex-start; justify-content:space-between; gap:20px; padding:22px 24px; color:#fff; background:linear-gradient(135deg,var(--accent),var(--accent-2)); }
.calc-dialog-header h2 { margin:7px 48px 0 0; font-size:24px; line-height:1.3; }
.calc-brand-badge { display:inline-flex; padding:5px 9px; border-radius:999px; background:rgba(255,255,255,.2); font-size:12px; font-weight:800; }
.calc-inner-close { position:absolute; top:15px; right:16px; color:#fff; background:rgba(255,255,255,.17); }
.calc-dialog-body { max-height:67vh; overflow:auto; padding:22px 24px; }
.calc-step-section { margin-bottom:24px; }
.calc-step-header { display:flex; align-items:center; gap:9px; margin-bottom:11px; }
.calc-step-header > span { width:25px; height:25px; display:grid; place-items:center; border-radius:50%; color:#fff; background:var(--accent); font-size:12px; font-weight:900; }
.calc-step-header h3 { margin:0; font-size:17px; }
.calc-step-hint { margin:-2px 0 12px; color:var(--muted); font-size:12px; }
.calc-base-row { display:flex; justify-content:space-between; align-items:center; gap:14px; padding:14px; border:1px dashed rgba(var(--accent-rgb),.32); border-radius:13px; background:rgba(var(--accent-rgb),.035); }
.coupon-box { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.coupon-label { color:var(--muted); font-size:11px; }
.coupon-box strong { color:var(--accent); font-size:20px; letter-spacing:.07em; }
.quantity-selector { display:flex; align-items:center; overflow:hidden; border:1px solid #d9d5d1; border-radius:10px; background:#fff; }
.quantity-selector strong { min-width:40px; text-align:center; }
.qty-btn { width:38px; height:36px; border:0; background:#f3f1ef; cursor:pointer; font-size:18px; }
.stack-options-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.stack-card-option { position:relative; display:grid; gap:3px; min-height:104px; padding:12px; text-align:left; border:2px solid #e5e1de; border-radius:13px; background:#fff; cursor:pointer; transition:.18s; }
.stack-card-option:hover:not(:disabled) { border-color:rgba(var(--accent-rgb),.55); transform:translateY(-1px); }
.stack-card-option.is-selected { border-color:var(--accent); background:rgba(var(--accent-rgb),.045); box-shadow:0 5px 16px rgba(var(--accent-rgb),.10); }
.stack-card-option.is-selected::after { content:'✓'; position:absolute; top:8px; right:10px; color:var(--accent); font-weight:900; }
.stack-card-option:disabled { cursor:not-allowed; opacity:.55; }
.stack-pay-name { color:var(--muted); font-size:11px; }
.stack-card-name { padding-right:18px; font-size:14px; }
.stack-reward-tag { width:max-content; max-width:100%; padding:3px 6px; border-radius:6px; color:#116b57; background:#eaf8f3; font-size:11px; }
.stack-card-option small { color:#85817e; font-size:9px; line-height:1.35; }
.calc-empty { color:var(--muted); }
.calc-result-banner { padding:16px; border-left:4px solid var(--accent); border-radius:14px; background:#f7f7f7; }
.result-main { display:grid; grid-template-columns:1fr 1fr auto; gap:12px; align-items:stretch; }
.result-cost-box { display:grid; align-content:center; gap:2px; padding:10px; border-radius:10px; background:#fff; }
.result-cost-box > span { color:var(--muted); font-size:11px; }
.result-cost-box > strong { font-size:23px; }
.result-cost-box > small { color:#888; font-size:9px; }
.result-cost-box.featured { outline:2px solid rgba(var(--accent-rgb),.18); }
.result-cost-box.featured > strong { color:var(--accent); }
.result-saving-badge { display:grid; align-content:center; min-width:96px; padding:9px 12px; text-align:right; border-radius:10px; color:#a12618; background:#ffe9e4; }
.result-saving-badge span { font-size:10px; }.result-saving-badge strong { font-size:18px; }.result-saving-badge small { font-weight:800; }
.result-breakdown-accordion { margin-top:13px; }
.result-breakdown-accordion summary { color:#4d4d4d; cursor:pointer; font-size:12px; font-weight:800; }
.breakdown-list { display:grid; gap:8px; margin:10px 0 0; padding:0; list-style:none; }
.breakdown-list li { display:grid; grid-template-columns:1fr auto; gap:3px 10px; font-size:12px; }
.breakdown-list li small { grid-column:1/-1; color:#888; font-size:9px; }
.calculator-disclaimer { margin:13px 0 0; color:#8b8581; font-size:9px; line-height:1.5; }
.dialog-footer { padding:16px 24px; border-top:1px solid var(--line); background:#f6f5f4; }
.full-width-btn { width:100%; justify-content:center; }

.content-page-body { background:#fbfaf9; }
.content-page-hero { padding-top:30px; }
.breadcrumb { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:24px; color:#817c78; font-size:12px; }
.breadcrumb a:hover { color:var(--accent); }
.brand-page-heading { display:flex; align-items:center; gap:20px; padding:28px; border:1px solid var(--line); border-radius:22px; background:#fff; box-shadow:var(--shadow); }
.brand-page-mark { width:88px; height:88px; flex:0 0 auto; display:grid; place-items:center; color:#fff; border-radius:24px; background:var(--brand); font-size:40px; font-weight:900; }
.brand-page-heading h1 { margin:5px 0 7px; font-size:clamp(30px,5vw,50px); line-height:1.1; }
.brand-page-heading p { margin:0; color:var(--muted); }
.brand-page-stats { display:flex; gap:12px; margin:14px 0 0; }
.brand-page-stats span { padding:8px 12px; border:1px solid var(--line); border-radius:999px; background:#fff; color:var(--muted); font-size:12px; }
.brand-page-stats strong { color:var(--text); }
.content-chip-row { margin:0 0 20px; }
.content-page-error { padding:60px 20px; text-align:center; }
.content-page-error h1 { font-size:38px; }
.section-heading { display:flex; justify-content:space-between; align-items:end; margin:38px 0 18px; }
.section-heading h2 { margin:4px 0 0; }

.offer-detail-card { display:grid; grid-template-columns:minmax(260px,390px) 1fr; gap:28px; padding:28px; border:1px solid var(--line); border-radius:24px; background:#fff; box-shadow:var(--shadow); }
.offer-detail-media { min-height:340px; overflow:hidden; border-radius:18px; background:#f7f5f3; }
.offer-detail-media img { width:100%; height:100%; min-height:340px; object-fit:cover; }
.offer-detail-fallback { height:100%; min-height:340px; display:grid; place-items:center; align-content:center; gap:10px; color:#fff; background:linear-gradient(145deg,var(--brand),#333); }
.offer-detail-fallback span { font-size:88px; font-weight:900; }.offer-detail-fallback small { font-size:18px; }
.offer-detail-main { align-self:center; }
.offer-detail-main h1 { margin:12px 0; font-size:clamp(29px,4vw,46px); line-height:1.15; }
.offer-detail-price { display:flex; flex-wrap:wrap; align-items:baseline; gap:12px; }
.offer-detail-price > strong { color:var(--accent); font-size:38px; }.offer-detail-price del { color:#999; }.offer-detail-price > span { padding:5px 9px; border-radius:8px; color:#116b57; background:#eaf8f3; font-size:12px; font-weight:800; }
.offer-detail-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:22px; }
.offer-detail-info { grid-column:1/-1; display:grid; grid-template-columns:1fr 1fr; gap:22px; padding-top:22px; border-top:1px solid var(--line); }
.offer-detail-info h2 { margin-top:0; font-size:18px; }.offer-detail-info ul { padding-left:20px; }
.offer-trust-note { grid-column:1/-1; padding:14px 16px; border-left:4px solid #d7a229; border-radius:10px; background:#fff8df; color:#66521d; }
.offer-trust-note p { margin:4px 0 0; font-size:12px; }

.article-page { max-width:900px; padding-block:34px 70px; }
.article-header { margin-bottom:26px; }
.article-header h1 { margin:8px 0 14px; font-size:clamp(34px,6vw,58px); line-height:1.14; }
.article-summary { color:#5e5b58; font-size:18px; }
.article-meta { color:#999; font-size:12px; }
.article-cover { width:100%; max-height:500px; object-fit:cover; margin-bottom:30px; border-radius:22px; box-shadow:var(--shadow); }
.article-content { padding:30px; border:1px solid var(--line); border-radius:20px; background:#fff; font-size:17px; line-height:1.9; }
.article-content p:first-child { margin-top:0; }.article-content p:last-child { margin-bottom:0; }

.stacking-admin-fieldset { border-color:rgba(var(--accent-rgb),.24) !important; background:rgba(var(--accent-rgb),.025); }
.payment-method-badge { display:inline-flex; padding:4px 7px; border-radius:6px; background:#eef8f3; color:#116b57; font-size:11px; }
.check-chip small { color:#999; font-size:9px; }

@media (max-width:900px) {
  .card-actions.three-actions { grid-template-columns:1fr 1fr; }
  .card-actions.three-actions > :last-child { grid-column:1/-1; }
  .offer-detail-card { grid-template-columns:1fr; }
  .offer-detail-media,.offer-detail-media img,.offer-detail-fallback { min-height:280px; max-height:420px; }
  .result-main { grid-template-columns:1fr 1fr; }.result-saving-badge { grid-column:1/-1; text-align:center; }
}
@media (max-width:620px) {
  .user-wallet-bar { align-items:flex-start; }.wallet-bar-label { min-width:0; width:100%; }.wallet-pills { flex-wrap:nowrap; overflow-x:auto; padding-bottom:3px; }
  .wallet-pill { flex:0 0 auto; }
  .stack-options-grid { grid-template-columns:1fr; }.calc-dialog-body { padding:18px; }.calc-base-row { align-items:flex-start; flex-direction:column; }.quantity-selector { align-self:flex-end; }
  .result-main { grid-template-columns:1fr; }.result-saving-badge { grid-column:auto; text-align:left; }
  .brand-page-heading { align-items:flex-start; padding:20px; }.brand-page-mark { width:64px; height:64px; border-radius:18px; font-size:28px; }.brand-page-stats { flex-wrap:wrap; }
  .offer-detail-card { padding:17px; }.offer-detail-info { grid-template-columns:1fr; }.offer-detail-actions > * { width:100%; justify-content:center; }
  .article-content { padding:20px; font-size:16px; }
}

/* ===== MVP v9: 分享優惠、我的優惠夾、網友投稿與 App 化 ===== */
.top-nav-cta { padding:8px 13px; border-radius:999px; color:#fff !important; background:linear-gradient(120deg,var(--accent),var(--accent-2)); font-weight:800; box-shadow:0 5px 14px rgba(var(--accent-rgb),.2); }
.top-nav-cta:hover { filter:brightness(.97); }
.tabbar-count { min-width:18px; height:18px; display:inline-grid; place-items:center; padding:0 5px; border-radius:999px; color:#fff; background:var(--accent); font-size:10px; font-style:normal; font-weight:900; line-height:1; }
.side-nav-item .tabbar-count { color:#fff; font-size:10px; }
.install-app-button { width:100%; margin-bottom:12px; border:1px dashed rgba(var(--accent-rgb),.45); border-radius:12px; padding:10px 12px; color:var(--accent); background:rgba(var(--accent-rgb),.05); font-weight:800; cursor:pointer; }

.card-social-row { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-top:12px; }
.shared-by-badge { display:inline-flex; align-items:center; gap:4px; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:4px 9px; border-radius:999px; color:#7a4b00 !important; background:#fff3d6 !important; font-size:11px; font-weight:800; }
.social-actions { display:flex; flex:0 0 auto; gap:6px; }
.social-button { display:inline-flex; align-items:center; gap:4px; min-height:32px; border:1px solid #e5e0dc; border-radius:999px; padding:5px 11px; background:#fff; color:#555; font-size:12px; font-weight:800; cursor:pointer; transition:.18s; }
.social-button:hover { border-color:var(--accent); color:var(--accent); }
.social-icon { font-size:14px; line-height:1; }
.favorite-button.is-active { color:#e0245e; border-color:#f7b9cc; background:#fff0f5; }
.favorite-button.is-active .social-icon { animation:favorite-pop .28s ease; }
@keyframes favorite-pop { 50% { transform:scale(1.35); } }
.offer-detail-social { display:flex; flex-wrap:wrap; gap:10px; margin-top:10px; }
.offer-detail-social .favorite-button { gap:6px; }
.offer-detail-social .favorite-button.is-active { color:#e0245e; border-color:#f7b9cc; background:#fff0f5; }
.article-meta { display:flex; flex-wrap:wrap; align-items:center; gap:14px; }
.article-share { padding:0; font-weight:800; }
.brand-page-stats { flex-wrap:wrap; align-items:center; }
.brand-page-stats .is-warning { color:#9a5b00; border-color:#f3d28b; background:#fff8e6; }
.brand-page-action { padding:8px 12px; border:1px solid rgba(var(--accent-rgb),.3); border-radius:999px; color:var(--accent); background:rgba(var(--accent-rgb),.05); font-size:12px; font-weight:800; cursor:pointer; }
.brand-page-action:hover { background:rgba(var(--accent-rgb),.1); }

.share-dialog { width:min(480px,calc(100% - 24px)); border:0; border-radius:22px; padding:22px; box-shadow:0 28px 85px rgba(25,20,17,.28); }
.share-dialog::backdrop { background:rgba(30,24,21,.55); backdrop-filter:blur(3px); }
.share-dialog-header { position:relative; margin-bottom:14px; }
.share-dialog-header h2 { margin:3px 40px 0 0; font-size:22px; }
.share-close { top:-6px; right:-6px; }
.share-preview { margin-bottom:14px; padding:13px 14px; border:1px dashed rgba(var(--accent-rgb),.35); border-radius:14px; background:rgba(var(--accent-rgb),.04); }
.share-preview p { margin:0 0 6px; color:#333; font-size:14px; line-height:1.6; }
.share-preview small { display:block; overflow:hidden; color:var(--muted); font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.share-native { margin-bottom:12px; }
.share-channel-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:12px; }
.share-channel { display:grid; justify-items:center; gap:6px; padding:10px 4px; border-radius:14px; color:#444; font-size:12px; transition:background .18s; }
.share-channel:hover { background:#f6f4f2; }
.share-channel span { width:46px; height:46px; display:grid; place-items:center; border-radius:50%; color:#fff; font-size:20px; font-weight:900; }
.share-channel-line span { background:#06c755; }
.share-channel-facebook span { background:#1877f2; font-family:Georgia,serif; }
.share-channel-threads span, .share-channel-x span { background:#111; }
.share-copy-row { display:flex; flex-wrap:wrap; gap:8px; }
.share-copy-row > * { flex:1 1 130px; }
.share-hint { margin:12px 0 0; color:#999; font-size:11px; text-align:center; }

.app-toast { position:fixed; left:50%; bottom:28px; z-index:120; max-width:calc(100% - 40px); padding:11px 18px; border-radius:999px; color:#fff; background:rgba(32,28,26,.92); box-shadow:0 12px 30px rgba(0,0,0,.2); font-size:14px; font-weight:700; opacity:0; pointer-events:none; transform:translate(-50%,16px); transition:opacity .2s, transform .2s; }
.app-toast.is-visible { opacity:1; transform:translate(-50%,0); }

.saved-hero { display:flex; justify-content:space-between; align-items:flex-end; gap:20px; padding:28px; border:1px solid var(--line); border-radius:22px; background:linear-gradient(135deg,rgba(var(--accent-rgb),.06),#fff 55%); box-shadow:var(--shadow); }
.saved-hero h1 { margin:5px 0 7px; font-size:clamp(28px,4.5vw,44px); line-height:1.15; }
.saved-hero p { margin:0; color:var(--muted); }
.saved-hero-actions { display:flex; flex-wrap:wrap; gap:10px; }
.saved-hero-actions .primary-button:disabled { cursor:default; opacity:.7; transform:none; }
.saved-inactive-item strong { color:#888; }

.submit-page { max-width:860px; padding-block:30px 70px; }
.submit-hero { display:grid; gap:18px; margin-bottom:20px; }
.submit-hero h1 { margin:5px 0 8px; font-size:clamp(30px,5vw,46px); line-height:1.15; }
.submit-hero p { margin:0; color:var(--muted); }
.submit-steps { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:0; padding:0; list-style:none; }
.submit-steps li { display:flex; align-items:center; gap:9px; padding:12px; border:1px solid var(--line); border-radius:14px; background:#fff; color:#555; font-size:13px; font-weight:700; }
.submit-steps span { width:26px; height:26px; flex:0 0 auto; display:grid; place-items:center; border-radius:50%; color:#fff; background:linear-gradient(135deg,var(--accent),var(--accent-2)); font-size:12px; }
.submit-form > label { margin-top:16px; }
.submit-success { margin-bottom:16px; padding:15px 17px; border:1px solid #bde7cd; border-radius:14px; color:#166534; background:#effbf3; }
.submit-success p { margin:4px 0 0; font-size:13px; }
.submit-prefill-hint { margin:0 0 14px; padding:11px 14px; border-radius:12px; color:#7a4b00; background:#fff3d6; font-size:13px; }
.submit-error { margin:14px 0 0; padding:11px 14px; border-radius:11px; color:#b42318; background:#fff2f1; font-size:13px; font-weight:700; }
.submit-honeypot { position:absolute !important; left:-9999px; width:1px; height:1px; overflow:hidden; }
.submit-agree span a { color:var(--accent); text-decoration:underline; }
.my-submissions { margin-top:10px; }
.submission-status { flex:0 0 auto; padding:4px 9px; border-radius:999px; font-size:11px; font-weight:800; white-space:nowrap; }
.submission-status-pending { color:#9a5b00; background:#fff3d6; }
.submission-status-approved { color:#116b57; background:#eaf8f3; }
.submission-status-rejected { color:#b42318; background:#fff2f1; }

.admin-badge { min-width:20px; display:inline-grid; place-items:center; margin-left:6px; padding:1px 6px; border-radius:999px; color:#fff; background:var(--accent); font-size:11px; font-weight:900; }
.submission-review-list { display:grid; gap:12px; }
.submission-card { padding:16px 18px; border:1px solid #e7e2de; border-radius:14px; background:#fff; }
.submission-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.submission-card-head strong { display:block; font-size:16px; }
.submission-card-head small { color:#888; }
.submission-card dl { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:8px 16px; margin:12px 0; }
.submission-card dl div { min-width:0; }
.submission-card dt { color:#999; font-size:11px; }
.submission-card dd { margin:0; overflow-wrap:anywhere; font-size:13px; }
.submission-card .row-actions { justify-content:flex-end; flex-wrap:wrap; }
.review-banner { margin-bottom:14px; padding:12px 14px; border:1px solid #f3d28b; border-radius:12px; color:#7a4b00; background:#fff8e6; font-size:13px; }

.mobile-tabbar { display:none; }
@media (max-width:900px) {
  body:has(.mobile-tabbar) { padding-bottom:calc(68px + env(safe-area-inset-bottom)); }
  .mobile-tabbar { position:fixed; inset:auto 0 0 0; z-index:75; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); padding:6px 6px calc(6px + env(safe-area-inset-bottom)); border-top:1px solid var(--line); background:rgba(255,255,255,.96); backdrop-filter:blur(16px); box-shadow:0 -6px 24px rgba(48,39,30,.07); }
  .mobile-tabbar a { position:relative; display:grid; justify-items:center; gap:2px; padding:5px 2px; border-radius:12px; color:#8a8580; font-size:11px; }
  .mobile-tabbar a > span { position:relative; height:28px; display:grid; place-items:center; font-size:19px; line-height:1; }
  .mobile-tabbar a strong { font-weight:800; }
  .mobile-tabbar a.is-active { color:var(--accent); }
  .mobile-tabbar .tabbar-cta > span { width:40px; height:28px; display:grid; place-items:center; border-radius:12px; color:#fff; background:linear-gradient(135deg,var(--accent),var(--accent-2)); box-shadow:0 6px 14px rgba(var(--accent-rgb),.28); font-size:20px; font-weight:900; }
  .mobile-tabbar .tabbar-count { position:absolute; top:-4px; left:calc(100% - 6px); height:16px; min-width:16px; font-size:9px; }
  body:has(.mobile-tabbar) .back-to-top { bottom:calc(82px + env(safe-area-inset-bottom)); }
  body:has(.mobile-tabbar) .app-toast { bottom:calc(84px + env(safe-area-inset-bottom)); }
}
@media (max-width:760px) {
  /* v8 的價格快選在手機上不換行，會把整頁撐寬到可左右滑動。 */
  .chip-row.compact { flex-wrap:wrap; }
}
@media (max-width:620px) {
  .share-dialog { padding:18px; }
  .share-channel-grid { gap:4px; }
  .saved-hero { align-items:flex-start; flex-direction:column; padding:20px; }
  .saved-hero-actions { width:100%; }
  .saved-hero-actions > * { flex:1 1 100%; justify-content:center; }
  .submit-steps { grid-template-columns:1fr; }
  .card-social-row { flex-wrap:wrap; }
}

/* ===== MVP v10: 雲端、無障礙與操作細節 ===== */
:focus-visible { outline:3px solid rgba(var(--accent-rgb),.55); outline-offset:2px; border-radius:8px; }
.skip-link { position:fixed; left:12px; top:-60px; z-index:200; padding:10px 16px; border-radius:10px; color:#fff; background:#222; font-weight:800; transition:top .15s; }
.skip-link:focus { top:12px; }
.cloud-mode .admin-link, .cloud-mode .side-admin-link, .cloud-mode [data-admin-only] { display:none !important; }

.sync-banner { position:fixed; left:50%; top:12px; z-index:110; max-width:calc(100% - 32px); padding:9px 16px; border-radius:999px; color:#fff; background:rgba(32,28,26,.9); box-shadow:0 10px 26px rgba(0,0,0,.18); font-size:13px; font-weight:700; transform:translateX(-50%); }
.sync-banner.is-warning { color:#7a4b00; background:#fff3d6; border:1px solid #f3d28b; }

.expiry-badge { display:inline-flex; width:max-content; margin-top:4px; padding:2px 8px; border-radius:999px; color:#9a5b00; background:#fff3d6; font-size:11px; font-weight:800; }
.expiry-badge.is-today { color:#fff; background:#e5484d; }
.date-block .expiry-badge { margin-left:auto; }

.app-toast.has-action { display:flex; align-items:center; gap:12px; pointer-events:none; }
.app-toast.is-visible.has-action { pointer-events:auto; }
.toast-action { border:0; border-radius:999px; padding:4px 12px; color:#222; background:#fff; font-weight:900; cursor:pointer; }

.report-button { padding:6px 0; color:#9a5b00; font-size:13px; font-weight:700; }
.report-target { margin:0 0 12px; padding:10px 12px; border-radius:10px; background:#f6f4f2; font-weight:800; }
.report-reasons { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:0 0 12px; padding:0; border:0; }
.report-reasons legend { margin-bottom:8px; color:#555; font-size:13px; font-weight:800; }
.report-reasons label { display:flex; align-items:center; gap:8px; min-height:44px; padding:8px 12px; border:1px solid var(--line); border-radius:12px; cursor:pointer; }
.report-reasons label:has(input:checked) { border-color:var(--accent); background:rgba(var(--accent-rgb),.05); }
.report-note { display:grid; gap:6px; margin-bottom:12px; color:#555; font-size:13px; font-weight:800; }
.report-note textarea { width:100%; border:1px solid #ddd8d4; border-radius:10px; padding:10px; font:inherit; }
.report-note-text { margin:10px 0; color:#555; font-size:13px; }

body.is-locked .admin-hero, body.is-locked .admin-grid, body.is-locked #cloudSetupBanner { display:none !important; }
.auth-gate { display:grid; place-items:center; min-height:60vh; margin-bottom:30px; }
.auth-card { width:min(420px,100%); display:grid; gap:12px; justify-items:center; padding:32px 28px; border:1px solid var(--line); border-radius:22px; background:#fff; box-shadow:var(--shadow); text-align:center; }
.auth-card h1 { margin:4px 0 0; font-size:26px; }
.auth-card p { margin:0; color:var(--muted); font-size:13px; }
.auth-form { width:100%; display:grid; gap:12px; margin-top:8px; text-align:left; }
.auth-form label { display:grid; gap:6px; color:#555; font-size:13px; font-weight:800; }
.auth-form input { width:100%; min-height:46px; border:1px solid #ddd8d4; border-radius:11px; padding:10px 12px; font:inherit; }
.auth-back { color:var(--muted); font-size:13px; }

.cloud-status { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:6px 0 8px; }
.cloud-status small { color:var(--muted); font-size:12px; }
.cloud-chip { padding:4px 10px; border-radius:999px; font-size:12px; font-weight:800; }
.cloud-chip.is-local { color:#555; background:#ece9e6; }
.cloud-chip.is-connecting, .cloud-chip.is-syncing { color:#1f4fbf; background:#e8efff; }
.cloud-chip.is-synced { color:#116b57; background:#eaf8f3; }
.cloud-chip.is-error { color:#b42318; background:#fff2f1; }
.cloud-setup-banner { display:grid; gap:10px; }
.cloud-setup-actions { display:flex; flex-wrap:wrap; gap:10px; }
.panel-tools { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }

@media (max-width:760px) {
  .social-button { min-height:44px; padding:8px 14px; }
  .icon-button { min-height:40px; }
  .report-reasons { grid-template-columns:1fr; }
}

/* 上線設定精靈 */
.launch-steps { display:grid; gap:18px; margin:0; padding:0; list-style:none; counter-reset:launch; }
.launch-steps > li { position:relative; display:grid; gap:10px; padding:4px 0 18px 48px; border-bottom:1px solid #f0ece9; counter-increment:launch; }
.launch-steps > li:last-child { border-bottom:0; padding-bottom:0; }
.launch-steps > li::before { content:counter(launch); position:absolute; left:0; top:2px; width:32px; height:32px; display:grid; place-items:center; border-radius:50%; color:#fff; background:linear-gradient(135deg,var(--accent),var(--accent-2)); font-weight:900; }
.launch-steps h3 { margin:4px 0 0; font-size:17px; }
.launch-steps p { margin:0; color:var(--muted); font-size:13px; }
.launch-steps > li > .secondary-button, .launch-steps > li > .primary-button { justify-self:start; }
.launch-steps textarea { font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:12px; }
.launch-downloads { display:flex; flex-wrap:wrap; gap:10px; }
.launch-result { margin:0; padding:11px 14px; border-radius:11px; font-size:13px; font-weight:700; }
.launch-result.is-success { color:#166534; background:#effbf3; }
.launch-result.is-error { color:#b42318; background:#fff2f1; }
.launch-result.is-info { color:#1f4fbf; background:#e8efff; }
@media (max-width:620px) { .launch-steps > li { padding-left:0; padding-top:44px; } }
