:root {
  --bg: #faf8f3;
  --surface: #ffffff;
  --surface-2: #f4efe4;
  --ink: #1d1a14;
  --muted: #6b6457;
  --faint: #9a9282;
  --line: #e9e3d6;
  --accent: #b07d12;
  --accent-ink: #7d5704;
  --accent-soft: #fbf1d9;
  --good: #147a3e;
  --good-soft: #e5f3e9;
  --bad: #b3261e;
  --bad-soft: #fdecea;
  --card: #1f5fa8;
  --card-soft: #e7f0fb;
  --shadow: 0 1px 2px rgb(40 30 10 / 6%), 0 4px 16px rgb(40 30 10 / 5%);
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12100c;
    --surface: #1b1812;
    --surface-2: #231f17;
    --ink: #f3eee2;
    --muted: #b3aa98;
    --faint: #857d6e;
    --line: #2f2a20;
    --accent: #e0b04b;
    --accent-ink: #f0c56a;
    --accent-soft: #2c2312;
    --good: #5fcb8d;
    --good-soft: #14281b;
    --bad: #f28b82;
    --bad-soft: #2d1614;
    --card: #8cb8f0;
    --card-soft: #152235;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 20px rgb(0 0 0 / 25%);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #12100c;
  --surface: #1b1812;
  --surface-2: #231f17;
  --ink: #f3eee2;
  --muted: #b3aa98;
  --faint: #857d6e;
  --line: #2f2a20;
  --accent: #e0b04b;
  --accent-ink: #f0c56a;
  --accent-soft: #2c2312;
  --good: #5fcb8d;
  --good-soft: #14281b;
  --bad: #f28b82;
  --bad-soft: #2d1614;
  --card: #8cb8f0;
  --card-soft: #152235;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 20px rgb(0 0 0 / 25%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 140px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  font-variant-numeric: tabular-nums;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
em { font-style: normal; font-weight: 700; }
/* Relative times ("5m ago", see timeTag): a faint dotted underline says the exact time is on hover. */
time.rel {
  text-decoration: underline dotted 1px;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 3px; cursor: help;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: 16px; top: -40px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1680px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 720px) { .wrap { padding-inline: 24px; } }
.hint { font-size: 12.5px; color: var(--faint); margin: 8px 0 0; }
.hint.sub { margin-top: 10px; }
.hint.top { margin-top: 0; margin-bottom: 8px; }

/* ------------------------------ top bar ------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.logo-mark { flex: none; width: 40px; height: 40px; border-radius: 8px; }
.header-social { display: flex; align-items: center; flex: none; gap: 2px; }
.social-link { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); text-decoration: none; }
.social-link svg { width: 16px; height: 16px; stroke-width: 1.6; }
.social-link .social-icon-fill { fill: currentColor; stroke: none; }
.social-link-whatsapp { color: var(--good); }
.social-link-telegram { color: var(--card); }
.social-link:hover { background: var(--surface-2); border-color: currentColor; }
@media (max-width: 399.98px) {
  .topbar-inner { gap: 8px; }
  .topbar .logo { gap: 6px; }
  .logo-mark { width: 34px; height: 34px; }
  .social-link { width: 28px; height: 28px; }
}

.gold-rate { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 4px 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.gold-rate-chip {
  display: inline-flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap;
  padding: 5px 14px; border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent) 22%, var(--accent-soft)));
  box-shadow: 0 1px 6px color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--ink);
}
.gold-rate-label { font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); }
.gold-rate strong { color: var(--accent-ink); font-family: var(--serif); font-size: 21px; }
.gold-rate small { font-size: 12px; }
.theme-toggle { display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 9px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; }
.theme-toggle:hover { background: var(--accent-soft); border-color: var(--accent); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .theme-sun { display: none; }
.admin-signout[hidden] + .theme-toggle { margin-left: auto; }
:root[data-theme="dark"] .theme-toggle .theme-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .theme-moon { display: none; }
@media (max-width: 719.98px) { .gold-rate { flex-basis: 100%; justify-content: flex-start; order: 1; } .theme-toggle { margin-left: auto; } .admin-nav + .theme-toggle { margin-left: 0; } .admin-nav[hidden] + .theme-toggle { margin-left: auto; } .admin-nav { margin-left: auto; } }

/* --------------------------- community links --------------------------- */
.hero-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 10px; }
.connect-links { display: flex; align-items: center; gap: 6px; flex: none; }
.connect-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 44px; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 650;
  text-decoration: none; white-space: nowrap;
}
.connect-link svg { flex: none; width: 18px; height: 18px; stroke-width: 1.6; }
.connect-link .connect-icon-fill { fill: currentColor; stroke: none; }
.connect-whatsapp { color: var(--good); background: var(--good-soft); }
.connect-link.connect-telegram {
  flex: none; justify-content: flex-start; gap: 12px; min-height: 64px; padding: 10px 16px;
  border-color: #0868ac; border-radius: 12px; background: #0868ac; color: #fff;
  box-shadow: 0 4px 14px rgb(8 104 172 / 22%); white-space: normal;
}
.connect-telegram svg { width: 26px; height: 26px; }
.connect-telegram strong { display: block; }
.connect-telegram strong { font-size: 15px; font-weight: 750; }
.connect-arrow { margin-left: auto; font-size: 23px; }
.connect-link:hover { border-color: currentColor; }
.connect-link.connect-telegram:hover { background: #07558e; border-color: #07558e; }
.connect-telegram:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.footer-connect { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); }
.footer-connect .connect-link { padding-inline: 12px; }
@media (max-width: 999.98px) {
  .hero-heading { flex-wrap: wrap; }
}
@media (max-width: 479.98px) {
  .connect-link.connect-telegram { width: 100%; min-width: 0; gap: 10px; padding-inline: 12px; }
  .connect-telegram strong { font-size: 14px; }
}

/* -------------------------------- hero -------------------------------- */
.hero { padding-block: 28px 16px; }
.hero h1 {
  font-family: var(--serif); font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(26px, 4.6vw, 42px); line-height: 1.1; margin: 0 0 10px; 
}
.hero-heading h1 { margin-bottom: 0; }
.lede { color: var(--muted); margin: 0 0 18px; font-size: 15.5px; }
.beta-note { width: fit-content; margin: 0 0 18px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 13px; }
.beta-note .feedback-link { margin-left: 4px; }
.feedback-link { color: var(--accent-ink); font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.feedback-link:hover { text-decoration-thickness: 2px; }

.notice {
  margin-block: 4px 12px; padding: 12px 14px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.notice.error { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }

/* ------------------------------ filter bar ------------------------------ */
.filterbar {
  position: sticky; top: 60px; z-index: 20;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-block: 1px solid var(--line);
  padding-block: 8px 6px;
}
@media (max-width: 719.98px) { .filterbar { top: 0; position: static; } }
.frow { display: flex; align-items: center; gap: 8px; padding-block: 4px; min-width: 0; }
.flabel { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; width: 56px; flex: none; }
.frow-tools { flex-wrap: wrap; gap: 8px 10px; padding-top: 6px; }
.frow-tools .clear-all { margin-left: auto; }

.chip-set { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; padding-block: 2px; -webkit-overflow-scrolling: touch; mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.chip-scroll::-webkit-scrollbar { display: none; }
.chip-scroll .chip-toggle { flex: none; }
.chip-toggle {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 12px; cursor: pointer; font-size: 14px; font-weight: 600; min-height: 36px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
.chip-toggle small { color: var(--faint); font-weight: 500; margin-left: 2px; }
/* Store chips: "Name (count) – best ₹x/g", all on one text baseline. */
.site-chip { align-items: baseline; gap: 5px; padding-block: 8px; }
.site-chip .n { color: var(--muted); font-weight: 600; }
.site-chip .sep { color: var(--muted); }
.site-chip .best { color: var(--accent-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.site-chip[aria-pressed="true"] .n,
.site-chip[aria-pressed="true"] .sep,
.site-chip[aria-pressed="true"] .best { color: inherit; }
.chip-toggle[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-toggle[aria-pressed="true"] small { color: inherit; opacity: .7; }
.chip-toggle:disabled { opacity: .45; cursor: default; }
.chip-toggle.weight { min-width: 58px; justify-content: center; }
.chip-toggle.weight small { display: none; }
.chip-toggle.weight[data-count="0"] { opacity: .45; }

.dd { position: relative; flex: none; }
.dd > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 12px; font-size: 14px; font-weight: 600; min-height: 36px; white-space: nowrap;
}
.dd > summary::-webkit-details-marker { display: none; }
.dd > summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .6; }
.dd[open] > summary { border-color: var(--ink); }
.dd[open] > summary::after { transform: translateY(1px) rotate(225deg); }
.dd.is-on > summary { border-color: color-mix(in srgb, var(--accent) 70%, var(--line)); background: var(--accent-soft); color: var(--accent-ink); }
.dd-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 240px; max-width: min(92vw, 360px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px;
  max-height: min(60vh, 440px); overflow: auto;
}
.dd-panel.wide { width: 320px; min-width: 0; }
#priceDd .dd-panel, #offerDd .dd-panel { width: 440px; max-width: calc(100vw - 32px); min-width: 0; }
.dd-done { display: none; }
@media (max-width: 719.98px) {
  /* backdrop-filter would make the bar the containing block for the fixed
     bottom sheets below, pinning them to the bar instead of the screen. */
  .filterbar { backdrop-filter: none; background: var(--bg); }
  /* Label and dropdown share the first line; the chips get full-width lines below. */
  .frow { flex-wrap: wrap; }
  .frow .dd { margin-left: auto; }
  #weightOpts, #siteOpts { flex: 1 1 100%; order: 3; }
  .chip-toggle.weight { flex: 1 1 calc(33.333% - 6px); min-width: 0; }
  .chip-scroll { mask-image: linear-gradient(90deg, #000 calc(100% - 20px), transparent); }
  /* Panels become bottom sheets: always on screen, however far down the bar sits. */
  .dd-panel {
    position: fixed; left: 0; right: 0; top: auto; bottom: 0; margin: 0; width: auto; max-width: none; min-width: 0;
    border-radius: 16px 16px 0 0; max-height: 70vh; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 40px rgb(0 0 0 / 25%);
  }
  .dd-panel.wide, #priceDd .dd-panel, #offerDd .dd-panel { width: auto; max-width: none; }
  .dd-done {
    display: block; width: 100%; margin-top: 12px; min-height: 42px; border-radius: 999px; border: 0;
    background: var(--ink); color: var(--bg); font-weight: 700; cursor: pointer;
  }
}
.dd-search { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); margin-bottom: 8px; }

.check {
  display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; cursor: pointer; min-height: 36px;
}
.check:hover { background: var(--surface-2); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }
.check .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check .n { color: var(--faint); font-size: 13px; }
.check.zero .label { color: var(--faint); }

.range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.range input { width: 100%; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.range input:focus { outline: none; border-color: var(--accent); }
.range span { color: var(--faint); }

.offer { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.offer label { display: flex; flex: 1 1 140px; min-width: 0; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.offer input { width: 100%; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font-weight: 600; }
@media (max-width: 399.98px) {
  .range { grid-template-columns: minmax(0, 1fr); }
  .range > span { display: none; }
}

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 36px; padding: 0 12px 0 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 600; font-size: 14px; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 32px; height: 18px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / 25%); transition: transform .15s; }
.switch input:checked + .track { background: var(--good); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch.is-off { opacity: .5; cursor: not-allowed; }
.switch.is-on { border-color: color-mix(in srgb, var(--good) 60%, var(--line)); color: var(--good); }

/* ------------------------------- buttons ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:disabled { opacity: .5; cursor: default; }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; }

/* A gold outline distinguishes purchase links without a heavy fill. */
.btn[data-buy] {
  min-height: 48px;
  background: var(--surface);
  color: var(--ink);
  border-color: var(--accent);
  font-weight: 600;
}
.btn[data-buy]:hover { background: var(--accent-soft); border-color: var(--accent-ink); }
.btn[data-buy]:active { background: var(--accent-soft); }
.btn[data-buy]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.link { border: 0; background: none; color: var(--accent-ink); cursor: pointer; padding: 4px; font-weight: 600; }
.link:hover { text-decoration: underline; }
.icon-btn { border: 0; background: none; cursor: pointer; padding: 8px; border-radius: 999px; font-size: 20px; display: inline-flex; }
.icon-btn:hover { background: var(--surface-2); }
.pill { background: var(--accent); color: #fff; border-radius: 999px; font-size: 11.5px; padding: 0 7px; line-height: 18px; font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips:not(:empty) { padding-top: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px;
  border-radius: 999px; background: var(--surface-2); font-size: 13px; border: 1px solid var(--line);
}
.chip button { border: 0; background: none; cursor: pointer; padding: 2px; display: inline-flex; color: var(--muted); border-radius: 999px; font-size: 14px; }
.chip button:hover { color: var(--ink); background: var(--line); }

/* ------------------------------ best strip ------------------------------ */
.best-strip { padding-block: 22px 6px; }
.strip-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.strip-head h2 { font-family: var(--serif); font-size: 22px; margin: 0; }
.strip-head .hint { margin: 0; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(172px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.best-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; scroll-snap-align: start; min-width: 0;
}
.best-card.is-on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.best-main { text-align: left; border: 0; background: none; padding: 12px 12px 8px; cursor: pointer; font: inherit; color: inherit; flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.best-main:hover { background: var(--surface-2); }
.best-main .w { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.best-main .w small { font-weight: 500; text-transform: none; letter-spacing: 0; }
.best-main .r { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; color: var(--accent-ink); }
.best-main .r small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 0; line-height: 1.45; }
.best-main .b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.best-main .p { font-size: 12.5px; color: var(--muted); }
.best-main .p .good { color: var(--good); font-weight: 600; }
.best-buy { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 600; text-decoration: none; color: var(--accent-ink); }
.best-buy:hover { background: var(--accent-soft); }
.best-buy svg { font-size: 13px; }

/* ------------------------------- toolbar ------------------------------ */
.results { padding-block: 16px 40px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.count { font-size: 18px; margin: 0; }
.count small { font-weight: 500; color: var(--muted); font-size: 14px; }
.toolbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sort { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.sort select {
  height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-weight: 600; max-width: 62vw;
}
@media (max-width: 520px) { .sort > span { display: none; } #shareBtn span { display: none; } }
.view-toggle { display: inline-flex; flex-shrink: 0; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
.view-toggle button { border: 0; background: none; padding: 7px 12px; min-height: 36px; border-radius: 999px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.view-toggle button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); }

/* -------------------------------- cards ------------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 236px), 1fr)); gap: 16px; }

.deal {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.grid .deal { cursor: pointer; }
.deal:hover { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--ink) 14%, var(--line)); }
.deal.is-best { border-color: #c49125; box-shadow: 0 0 0 2px rgb(196 145 37 / 35%), 0 4px 16px rgb(120 80 10 / 12%); }

/* One white surface prevents hairline seams when share previews are scaled. */
.deal-visual, .coupon-space { background: white; }
.deal-visual .media, .deal-visual .badges { background: transparent; }
/* Each desktop row shares the visual, coupon and body tracks. An empty coupon
   track collapses unless another card in that row has a coupon. */
@media (min-width: 720px) {
  .grid:has(> .deal) { row-gap: 0; }
  /* minmax(0, 1fr): a long unbreakable line (e.g. the brand) must not widen the card's column. */
  .grid .deal { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: subgrid; grid-row: span 3; row-gap: 0; margin-bottom: 16px; }
}

.media { position: relative; height: 220px; max-width: 100%; background: white; display: grid; place-items: center; overflow: hidden; }
/* Bound the photo independently of its natural size; labels have their own rows. */
.media img { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); object-fit: contain; }

.coin {
  width: min(42%, 76px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: clamp(12px, 3vw, 15px); color: #5a3d05;
  background: radial-gradient(circle at 32% 28%, #fff3c4 0%, #f0cf73 32%, #c7962a 70%, #9c6e10 100%);
  box-shadow: inset 0 0 0 5px rgb(255 240 200 / 45%), 0 6px 18px rgb(120 80 10 / 25%);
}
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 46px; padding: 10px 12px 0; background: white; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); white-space: nowrap;
}
.badge.rank { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.badge.best { gap: 6px; padding: 6px 10px; border-radius: 8px; background: linear-gradient(135deg, #ffe39a, #e7b341); color: #3b2905; border-color: #c49125; font-size: 14px; font-weight: 800; box-shadow: 0 2px 6px rgb(120 80 10 / 22%); }
.badge.best svg { width: 15px; height: 15px; flex: none; fill: currentColor; stroke: none; }
.badge.under { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 30%, var(--good-soft)); }

.deal-body { display: flex; flex-direction: column; gap: 7px; padding: 14px; flex: 1; }
.brand { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--muted); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; justify-content: space-between; gap: 8px; }
.brand .store { color: var(--ink); opacity: .8; font-weight: 600; letter-spacing: .03em; text-transform: none; }
/* A long brand name truncates; the store name always stays whole. */
.brand > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.brand .store { flex: none; }
.title { font-size: 15px; font-weight: 600; line-height: 1.35; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.title a { text-decoration: none; }
.title a:hover { text-decoration: underline; }
.specs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.spec { font-size: 13px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-weight: 600; }

.rate { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; flex-wrap: wrap; }
.rate strong { font-size: 24px; letter-spacing: -0.01em; line-height: 1.1; }
.rate span { font-size: 13px; color: var(--muted); }
.rate .was { font-size: 12px; color: var(--faint); width: 100%; }
.deal.is-best .rate strong { color: var(--accent-ink); }
/* The difference from today's 24K rate: red above it, green below, as a pill.
   `.rate span` above would otherwise grey it out, so colours are set here. */
.rate .vs { margin-left: 4px; font-size: 14px; }
.rate .vs span { font-size: inherit; font-weight: 700; padding: 2px 9px; border-radius: 999px; color: var(--ink); background: var(--surface-2); }
.rate .vs .bad { color: var(--bad); background: var(--bad-soft); }
.rate .vs .good { color: var(--good); background: var(--good-soft); }
.good { color: var(--good); font-weight: 600; }
.bad { color: var(--bad); font-weight: 600; }

.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.price { display: block; }
/* A checkout-style summary: icon and label on the left, amounts right-aligned so
   their digits line up, one rule across the full width above the total. */
.price-breakdown { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.pb-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pb-label { display: flex; align-items: baseline; gap: 6px; min-width: 0; color: var(--muted); line-height: 1.3; text-align: left; }
/* Centred on the first line of the label, which may wrap on a narrow card. */
.pb-label svg { width: 14px; height: 14px; flex: none; align-self: flex-start; margin-top: calc((1.3em - 14px) / 2); }
.pb-amt { flex: none; text-align: right; font-weight: 700; white-space: nowrap; color: var(--ink); }
.pb-was .pb-amt { font-weight: 500; color: var(--faint); }
.pb-card .pb-amt, .pb-card .pb-label { color: var(--card); }
.pb-coupon .pb-amt, .pb-coupon .pb-label { color: var(--good); }
.pb-lens .pb-amt, .pb-lens .pb-label { color: var(--accent-ink); }
.pb-fee .pb-amt, .pb-fee .pb-label { color: var(--bad); }
.pb-row + .pb-total { margin-top: 2px; padding-top: 6px; border-top: 1px solid var(--line); }
.pb-total .pb-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.pb-total .pb-amt { font-size: 20px; line-height: 1.1; }
table.deals .price-breakdown { font-size: 12.5px; min-width: 190px; }
table.deals .pb-total .pb-label { font-size: 13px; }
table.deals .pb-total .pb-amt { font-size: 15px; }
.asof { margin: 0; font-size: 11.5px; color: var(--faint); }
.asof a { color: var(--muted); }
table.deals small.asof { display: block; white-space: nowrap; }
.best-card .asof { padding: 0 12px 8px; }
.aff-note { margin: -4px 0 12px; }
/* Store coupons (admin-entered; see server/coupons.js): savings and how to claim them. */
.badge.coupon { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }
.coupon-note { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.coupon-note strong { color: var(--ink); }
.coupon-note a, .coupon-links a { font-weight: 700; text-underline-offset: 3px; }
.best-card .coupon-note { padding: 0 12px 8px; }
/* The store's own card offer ("Buy for ₹31,250 with SBI credit card"), published by bullion-rate-parser and already inside the price. */

.coupon-trigger {
  width: 100%; min-height: 56px; padding: 8px 12px; border: 0;
  border-bottom: 1px dashed #afd1b8; background: linear-gradient(110deg, #edf9ee, #f7f3da);
  color: #215c34; display: flex; align-items: center; gap: 10px; text-align: left;
  cursor: pointer; font: inherit; flex-shrink: 0;
}
.coupon-trigger > svg, .coupon-popover-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; flex-shrink: 0; }
.coupon-trigger > span:not(.coupon-info) { display: flex; flex-direction: column; gap: 1px; }
.coupon-trigger strong { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.coupon-trigger small { font-size: 11px; color: #45694c; }
.coupon-info { margin-left: auto; border: 1px solid #87ab8c; border-radius: 50%; width: 20px; height: 20px; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.coupon-trigger:hover, .coupon-trigger[aria-expanded="true"] { background: #e0f1df; }
.coupon-trigger:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
/* Keep one accessible coupon control in a dedicated strip below the photo. */
.deal > .coupon-trigger { min-height: 44px; padding: 8px 12px; gap: 8px; }
.deal > .coupon-trigger > svg { width: 18px; height: 18px; }
.deal > .coupon-trigger > span:not(.coupon-info) { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.deal > .coupon-trigger strong { font-size: 14px; }
.deal > .coupon-trigger small { font-size: 12px; }
.deal > .coupon-trigger .see-how { display: none; }
.deal > .coupon-trigger .coupon-info { width: 18px; height: 18px; font-size: 11px; }
table.deals .coupon-trigger { width: auto; min-height: 0; padding: 3px 8px; gap: 6px; border: 1px dashed #afd1b8; border-radius: 6px; margin-bottom: 6px; white-space: nowrap; }
table.deals .coupon-trigger > svg { width: 16px; height: 16px; }
table.deals .coupon-trigger > span:not(.coupon-info) { flex-direction: row; align-items: baseline; gap: 6px; }
table.deals .coupon-trigger strong { font-size: 12.5px; }
table.deals .coupon-trigger small { font-size: 11px; }
table.deals .coupon-info { width: 15px; height: 15px; font-size: 10px; margin-left: 4px; }

.coupon-popover {
  position: fixed; inset: auto; margin: 0; width: min(330px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px); overflow: auto; padding: 20px;
  border: 1px solid #b9d5ba; border-radius: 16px; background: var(--surface); color: var(--ink);
  box-shadow: 0 12px 45px rgb(19 49 28 / 20%); font-size: 14px; line-height: 1.5;
}
.coupon-popover-icon { display: grid; place-items: center; width: 44px; height: 44px; background: #e5f3e4; color: #215c34; border-radius: 12px; margin-bottom: 10px; }
.coupon-popover h3 { margin: 0 35px 4px 0; font-size: 24px; color: var(--good); }
.coupon-popover p { margin: 8px 0; overflow-wrap: anywhere; }
.coupon-popover .coupon-terms { font-weight: 700; font-size: 16px; }
.coupon-popover .coupon-code { padding: 9px 11px; border: 1px dashed #9cbc9e; border-radius: 8px; background: #f1f8ef; color: #215c34; }
.coupon-popover .coupon-code strong { display: inline-block; letter-spacing: .03em; }
.coupon-popover .coupon-expiry { color: var(--muted); font-size: 12px; }
.coupon-popover .coupon-warning { padding: 10px 12px; border-radius: 8px; background: #fff3d9; color: #684411; font-size: 13px; }
.coupon-popover .coupon-included { margin: 12px 0 0; border-top: 1px solid var(--line); padding-top: 10px; color: var(--muted); font-size: 12px; }
.coupon-close { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; background: none; border: 0; border-radius: 50%; font: inherit; font-size: 26px; color: var(--muted); cursor: pointer; }
.coupon-close:hover { background: var(--surface-2); }
table.deals small.coupon-note { display: block; margin-top: 4px; font-size: 12px; }
.switch .n { color: var(--faint); font-weight: 500; }

.deal .cta { margin-top: auto; display: flex; gap: 8px; align-items: center; }

/* Admin mode (see isAdmin in app.js). */
.admin-nav { flex: none; display: flex; gap: 4px; }
.admin-nav .icon-btn { color: var(--muted); border: 1px solid var(--line); }
.admin-nav .icon-btn:hover { color: var(--ink); }
.admin-tools { display: flex; justify-content: flex-end; }
table.deals .admin-tools { justify-content: flex-start; margin-top: 4px; }
.link.danger { color: var(--bad); font-size: 13px; }
.link.danger:disabled { opacity: .5; cursor: default; }
.admin-tools .icon-btn { color: var(--muted); padding: 6px; }
.admin-tools .icon-btn:hover { color: var(--ink); }
.admin-tools .icon-btn.danger { color: var(--bad); }
.admin-tools .icon-btn.danger:hover { background: var(--bad-soft); }
.admin-tools .icon-btn:disabled { opacity: .5; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Admin share preview: a phone-width card to screenshot (see sharePreviewHtml in app.js). */
.share-preview { padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); }
.share-preview::backdrop { background: rgb(0 0 0 / 55%); }
.share-preview-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); }
.share-preview-head h2 { margin: 0 auto 0 0; font-size: 15px; white-space: nowrap; }
.share-preview-skus { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.share-preview-skus span { min-width: 6ch; text-align: center; font-size: 13px; }
.share-preview-skus .btn { min-width: 36px; }
.share-preview-actions { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; order: 1; flex-basis: 100%; }
/* The frame keeps the width the image is drawn at and is scaled to fit the window (openSharePreview). */
.share-preview-body { overflow: hidden; }
.share-preview iframe { display: block; border: 0; background: var(--bg); transform-origin: 0 0; }
.share-view { min-height: 0; }
.share-view .wrap { max-width: none; }
.share-view .grid { grid-template-columns: repeat(var(--share-columns, 1), minmax(0, 1fr)); }
.share-view [data-share-count="2"] { --share-columns: 2; }
.share-view [data-share-count="3"] { --share-columns: 3; }
.share-view [data-share-count="4"] { --share-columns: 4; }
.share-view [data-share-count="5"] { --share-columns: 5; }
.share-view [data-share-count="6"] { --share-columns: 6; }
.share-view main { padding-block: 16px; }
/* Best-at-store cards in fixed columns at any width, never the phone scroller. */
.share-view .store-best { display: grid; grid-template-columns: repeat(var(--share-columns, 1), minmax(0, 1fr)); margin: 0; padding: 0; overflow: visible; }
.cta .btn { flex: 1; }
.cta .btn svg { font-size: 14px; }

/* -------------------------------- table ------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.deals { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 900px; }
table.deals th, table.deals td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.deals th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
table.deals tr:last-child td { border-bottom: 0; }
table.deals td.num, table.deals th.num { text-align: right; white-space: nowrap; }
table.deals .t-title { max-width: 360px; }
table.deals .t-title a { font-weight: 600; text-decoration: none; }
table.deals .t-title a:hover { text-decoration: underline; }
table.deals .t-brand { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
table.deals .t-rate { font-weight: 800; }
table.deals tr.is-best td { background: var(--accent-soft); }
table.deals tr.is-best .t-rate { color: var(--accent-ink); }
table.deals small.was { display: block; color: var(--faint); font-size: 12px; }
table.deals .off { color: var(--good); font-weight: 700; }

/* ------------------------------- admin ------------------------------- */
.admin-tag {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
  color: var(--accent-ink); background: var(--accent-soft); padding: 3px 9px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.admin-signout { margin-left: auto; }
.admin { max-width: 1280px; margin-inline: auto; padding-block: 24px 96px; }
.admin-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.admin-card h1 { font-family: var(--serif); font-size: 24px; margin: 0 0 6px; }
.admin-card .card-title { font-size: 17px; line-height: 1.3; margin: 0 0 4px; }
.admin-lock { max-width: 440px; margin: 32px auto 0; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }

/* The dashboard: section nav (a scrolling strip on phones, a sidebar from 900px) and one panel. */
.dash { display: grid; gap: 20px; }
.dash-main { min-width: 0; }
.dash-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.dash-nav::-webkit-scrollbar { display: none; }
.dash-nav a {
  display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.dash-nav a:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); }
.dash-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.dash-nav svg { width: 18px; height: 18px; stroke-width: 1.8; flex: none; }
.nav-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 700;
}
.nav-badge.bad { background: var(--bad-soft); color: var(--bad); }
@media (min-width: 900px) {
  .dash { grid-template-columns: 216px minmax(0, 1fr); gap: 32px; align-items: start; }
  .dash-nav { position: sticky; top: 84px; flex-direction: column; gap: 2px; overflow: visible; padding: 0; }
  .dash-nav a { min-height: 42px; padding: 0 12px; border-color: transparent; border-radius: 10px; background: none; }
  .dash-nav a:hover { background: var(--surface-2); border-color: transparent; }
  .dash-nav a[aria-current="page"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
  .dash-nav .nav-badge { margin-left: auto; }
}

.dash-panel { display: flex; flex-direction: column; gap: 16px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.panel-head > div:first-child { flex: 1 1 420px; min-width: 0; }
.panel-head h1 { font-family: var(--serif); font-size: clamp(24px, 3vw, 30px); line-height: 1.15; letter-spacing: -0.01em; margin: 0; }
.panel-head h1:focus { outline: none; }
.panel-lede { margin: 6px 0 0; max-width: 80ch; color: var(--muted); font-size: 14px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.panel-grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1200px) { .panel-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.card-status { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.card-head .card-status { margin: 0; }

/* Overview tiles: each one opens its panel. */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 176px), 1fr)); gap: 12px; }
.tile {
  display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s;
}
.tile:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: var(--shadow); }
.tile-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tile-label svg { width: 16px; height: 16px; flex: none; color: var(--accent-ink); }
.tile-value { font-size: 22px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; overflow-wrap: anywhere; }
.tile-value small { font-size: 13px; font-weight: 500; color: var(--muted); }
.tile-meta { font-size: 13px; color: var(--muted); }
.tile-go { margin-top: auto; padding-top: 8px; font-size: 13px; font-weight: 700; color: var(--accent-ink); }
.tile-go::after { content: " →"; }
.tile.bad { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.tile.bad .tile-value, .tile.bad .tile-meta { color: var(--bad); }
.tile.warn .tile-meta { color: var(--accent-ink); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } }

.attention { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.attention li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font-size: 14px;
}
.attention li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.attention li span { flex: 1 1 240px; min-width: 0; }
.attention a { font-weight: 700; white-space: nowrap; text-underline-offset: 3px; }
.attention .bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); color: var(--bad); }
.attention .bad::before { background: var(--bad); }
.attention .warn { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent-ink); }
.attention .warn::before { background: var(--accent); }
.attention .good { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 30%, transparent); color: var(--good); font-weight: 600; }
.attention .good::before { background: var(--good); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip span { color: var(--faint); font-weight: 700; }
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.chip[aria-pressed="true"] span { color: inherit; }

.danger-zone { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.danger-zone > div { flex: 1 1 320px; min-width: 0; }
.danger-zone .card-title { color: var(--bad); }
.danger-zone .hint { margin: 0; }

/* Admin messages float above the page so they show wherever the panel is scrolled. */
.admin-toast { position: fixed; z-index: 60; left: 16px; right: 16px; bottom: 16px; display: flex; justify-content: center; pointer-events: none; }
.admin-toast-inner { position: relative; width: 100%; max-width: 560px; }
.admin-toast .notice { margin: 0; padding-right: 48px; box-shadow: var(--shadow); pointer-events: auto; }
.notice-close {
  position: absolute; top: 4px; right: 4px; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: none; color: inherit; font-size: 22px; line-height: 1; cursor: pointer; pointer-events: auto;
}
.notice-close:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.admin-toast .notice:not(.error) + .notice-close { color: var(--accent-ink); }
.admin-toast .notice.error + .notice-close { color: var(--bad); }
.admin-toast .notice[hidden] + .notice-close { display: none; }

.admin-stores { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-store-table { min-width: 600px; }
.admin-stores th, .admin-stores td { padding: 10px; text-align: left; border-bottom: 1px solid var(--line); }
.admin-stores th { background: var(--surface-2); }
.admin-stores tr:last-child td { border-bottom: 0; }
.admin-stores small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.admin-stores .switch { white-space: nowrap; }
.admin-stores .switch input:disabled ~ span { opacity: .6; }
.admin-stores td:nth-child(2) { font-variant-numeric: tabular-nums; }
.admin-form { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.admin-card > .admin-form:first-child { margin-top: 0; }
.display-settings-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.display-settings-form .switch { min-height: 44px; padding: 8px 12px; border-radius: 10px; }
.display-settings-form .switch input:disabled ~ span { opacity: .6; }
.admin-form > label { font-size: 13px; font-weight: 600; color: var(--muted); }
.admin-form input { width: 100%; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.admin-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.admin-row { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-row input { flex: 1 1 180px; }
.admin-now {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px;
  margin: 0; padding: 14px; background: var(--surface-2); border-radius: 12px;
}
.admin-now div { min-width: 0; }
.admin-now dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted); }
.admin-now dd { margin: 2px 0 0; font-weight: 600; }
.admin-now dd.big { font-size: 20px; font-weight: 800; }
.admin-now dd.big small { font-size: 13px; font-weight: 500; color: var(--muted); }
.admin-now dd.warn { color: var(--bad); }
.admin-now dd.pinned { color: var(--accent-ink); }

#couponStatus.warn, .admin-coupons .warn { color: var(--bad); font-weight: 700; }
.admin-coupons { min-width: 820px; }
.admin-coupons td { vertical-align: top; }
.admin-coupons code { font-size: 12.5px; }
.admin-coupons .status { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.admin-coupons .status.active { color: var(--good); background: var(--good-soft); }
.admin-coupons .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.coupon-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.coupon-toggle:disabled { opacity: .5; cursor: wait; }
.coupon-toggle-track { position: relative; width: 32px; height: 18px; border-radius: 10px; background: #a4a8a3; }
.coupon-toggle-track::after { content: ""; position: absolute; width: 12px; height: 12px; top: 3px; left: 3px; border-radius: 50%; background: white; }
.coupon-toggle[aria-checked="true"] .coupon-toggle-track { background: var(--good); }
.coupon-toggle[aria-checked="true"] .coupon-toggle-track::after { left: 17px; }
.coupon-form .card-title { margin: 0; }
.coupon-form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.coupon-form legend, .coupon-form .field-label { width: 100%; padding: 0; margin: 0 0 2px; font-size: 13px; font-weight: 600; color: var(--muted); }
.coupon-form input[type=radio], .coupon-form input[type=checkbox] { width: auto; height: auto; margin: 0; accent-color: var(--accent); }
.coupon-form .choice { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
.coupon-form .field { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.coupon-form .field input { color: var(--ink); font-weight: 400; }
.coupon-form .field select { width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-weight: 400; }
.coupon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 12px; }
.coupon-form .coupon-fees { display: block; min-width: 0; }
#couponFeeSlabs { display: grid; gap: 12px; margin-bottom: 8px; }
.coupon-fee-slab .btn { align-self: end; }
.coupon-nodes { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 13px; }
.coupon-nodes label { display: flex; align-items: center; gap: 8px; min-width: 0; cursor: pointer; }
.coupon-nodes code { font-weight: 700; flex: none; }
.coupon-nodes small { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coupon-nodes p { margin: 0; color: var(--muted); }

/* On phones, admin tables become one card per row, each cell labelled from data-label. */
@media (max-width: 719.98px) {
  .admin-stores.stack-table { min-width: 0; }
  .stack-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td, .stack-table th { display: block; }
  .stack-table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .stack-table tr:last-child { border-bottom: 0; }
  .admin-stores.stack-table td, .admin-stores.stack-table th { position: relative; padding: 3px 0; border: 0; background: none; }
  .admin-stores.stack-table [data-label] { padding-left: 116px; min-height: 26px; }
  .stack-table [data-label]::before { content: attr(data-label); position: absolute; left: 0; top: 4px; width: 108px; font-size: 12px; font-weight: 600; color: var(--muted); }
  .stack-table .cell-head { padding-bottom: 6px; font-size: 15px; font-weight: 700; }
  .stack-table .cell-actions { padding-top: 8px; }
}

/* ------------------------------ states ------------------------------ */
.empty { grid-column: 1 / -1; text-align: center; padding: 56px 16px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.empty h3 { color: var(--ink); margin: 0 0 6px; font-size: 18px; }
.skeleton { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.skeleton .media { animation: shimmer 1.2s ease-in-out infinite; }
.skeleton .bar { height: 12px; margin: 14px; border-radius: 6px; background: var(--surface-2); animation: shimmer 1.2s ease-in-out infinite; }
.skeleton .bar.short { width: 45%; }
@keyframes shimmer { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .skeleton .media, .skeleton .bar { animation: none; } .switch .track, .switch .track::after { transition: none; } }

.more { display: flex; justify-content: center; margin-top: 24px; }

.about { padding-block: 8px 32px; border-top: 1px solid var(--line); }
.about h2 { font-family: var(--serif); font-size: 22px; margin: 20px 0 12px; }
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px 28px; }
.about h3 { font-size: 15px; margin: 0 0 4px; }
.about p { margin: 0; color: var(--muted); font-size: 14px; max-width: 60ch; }

.buying-note { margin: -6px 0 20px; color: var(--muted); font-size: 13px; max-width: 90ch; }
.buying-note a { color: var(--accent-ink); text-underline-offset: 3px; }
.gold-disclaimer { border-top: 1px solid var(--line); padding: 24px 0 32px; scroll-margin-top: 24px; }
.gold-disclaimer h2 { font-family: var(--serif); font-size: 24px; margin: 0 0 10px; }
.disclaimer-intro { max-width: 85ch; color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.gold-disclaimer details { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.gold-disclaimer summary { padding: 14px 18px; cursor: pointer; font-size: 14px; font-weight: 600; }
.gold-disclaimer summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 12px; }
.disclaimer-body { max-width: 90ch; padding: 0 18px 18px; }
.disclaimer-body h3 { font-size: 15px; margin: 22px 0 7px; }
.disclaimer-body p { color: var(--muted); font-size: 14px; line-height: 1.65; margin: 0 0 10px; }
.disclaimer-body a { text-underline-offset: 3px; }
#list { transition: opacity .15s ease; }
#list.is-loading { opacity: .55; }

.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; z-index: 60; box-shadow: var(--shadow); }

.footer { padding-block: 20px 40px; color: var(--faint); font-size: 13px; border-top: 1px solid var(--line); margin-top: 8px; }
.footer p { margin: 0 0 8px;  }
.footer p:last-child { margin-bottom: 0; }
.footer strong { color: var(--muted); font-weight: 700; }


.store-expand { display:grid; place-items:center; flex:none; width:36px; height:36px; padding:0; border:1px solid var(--line); border-radius:50%; background:var(--surface); color:var(--ink); cursor:pointer; }
.store-expand svg { width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:1.6; }
.store-expand[aria-expanded=true] svg { transform:rotate(180deg); }
.store-expand:disabled { opacity:.45; cursor:default; }
.store-expand:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.store-best { display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:10px; margin:4px 0 12px 56px; }
.store-best-card { display:flex; flex-direction:column; gap:10px; min-width:0; padding:12px 14px 14px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.store-best-heading { margin:0; padding-bottom:9px; border-bottom:1px solid var(--line); color:var(--accent-ink); font-size:14px; line-height:1.2; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.store-best-heading span { margin-right:5px; font-size:10.5px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); }
/* Image beside the title and specs only; everything below runs the card's full width. */
.store-best-top { display:flex; align-items:center; gap:12px; min-height:56px; }
.store-best-media { position:relative; display:grid; place-items:center; flex:none; width:56px; height:56px; border-radius:8px; overflow:hidden; background:#fff; }
.store-best-media img { width:100%; height:100%; object-fit:contain; }
.store-best-info { display:flex; flex-direction:column; gap:3px; min-width:0; }
.store-best-title { font-size:13px; line-height:1.3; font-weight:600; text-decoration:none; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.store-best-title:hover { text-decoration:underline; }
.store-best-spec { margin:0; font-size:11.5px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.store-best-rate { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:2px 8px; margin:0; padding:7px 10px; border-radius:8px; background:var(--accent-soft); font-size:11.5px; color:var(--muted); font-variant-numeric:tabular-nums; }
.store-best-rate strong { font-size:17px; line-height:1.1; color:var(--accent-ink); }
.store-best-card .price-breakdown { margin:0; font-size:13px; }
.store-best-card .coupon-note { font-size:12px; }
.store-best-foot { display:flex; flex-direction:column; gap:2px; min-width:0; margin:0; font-size:11px; color:var(--faint); }
.store-best-foot:empty { display:none; }
.store-best-foot .asof { font-size:inherit; }
.store-best-sku { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.store-best-card>.btn { margin-top:auto; }
.stores-page-intro { padding-block: 28px 16px; }
.stores-page-intro h1 { margin: 0 0 8px; }
.stores-page-intro p { max-width: 70ch; }
.stores-page .store-best { margin: 16px 0 24px; }
.stores-page .store-best-heading a { color: inherit; }
.stores-page .store-best-card>p:not(.store-best-rate) { margin: 0; }
.stores-page-link { margin: 2px 0 12px; font-size: 13px; }
/* Admin mode only: a hidden store's listings, shown because "show hidden stores to admins" is on. */
.admin-flags { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.admin-flag { display: inline-flex; align-items: center; padding: 2px 7px; border: 1px dashed var(--bad); border-radius: 999px; background: var(--bad-soft); color: var(--bad); font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge.admin-flag { border-style: dashed; }
@media(max-width:719.98px) {
  #storesExpand { order:2; width:40px; height:40px; }
  .store-best { display:flex; overflow-x:auto; scroll-snap-type:x proximity; margin-left:0; padding-bottom:4px; }
  .store-best-card { flex:0 0 min(300px,90%); scroll-snap-align:start; }
  .stores-page .store-best { display:grid; grid-template-columns:1fr; overflow:visible; }
  .stores-page .store-best-card { flex:auto; }
}

/* Compact mobile filters; extra options stay available in bottom sheets. */
.mobile-only { display:none; }
@media(max-width:719.98px) {
  .topbar { position:static; }
  html { scroll-padding-top:0; }
  .mobile-only { display:inline-flex; }
  .desktop-only { display:none; }
  .weight-row, .store-row { flex-wrap:nowrap; gap:5px; }
  .weight-row .flabel, .store-row .flabel { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  #weightOpts { flex:1 1 auto; order:0; flex-wrap:nowrap; gap:5px; }
  #weightOpts .weight { flex:1 1 0; min-width:0; padding:6px 4px; font-size:13px; min-height:36px; }
  #weightOpts [data-value="8"] { display:none; }
  .weight-row .dd, .store-row .dd { margin-left:0; }
  .weight-row summary, .store-row summary { padding:6px 9px; font-size:13px; }
  #siteOpts { flex:1 1 auto; order:0; overflow:visible; mask-image:none; gap:5px; }
  #siteOpts>.site-chip:nth-child(n+3) { display:none; }
  #siteOpts>.site-chip { flex:1 1 0; min-width:0; }
  .site-chip { flex-direction:column; align-items:center; gap:1px; padding:5px 7px; font-size:12px; }
  .site-chip .name { max-width:100%; overflow:hidden; text-overflow:ellipsis; }
  .site-chip .n, .site-chip .sep, .site-chip .best-word { display:none; }
  .site-chip .best { font-size:11px; }
  #storesExpand { order:0; width:32px; height:36px; }
  #otherStores { gap:8px; }
  #otherStores .site-chip { flex:1 1 42%; }
  #otherStores .name { white-space:normal; }
  #filterbar { scroll-margin-top:0; }
}


/* Mobile cards use content-sized rows so absent coupon content leaves no gaps. */
.deal-heading, .deal-pricing, .deal-summary, .deal-footer { display:contents; }
.mobile-buy-label { display:none; }
@media(max-width:719.98px) {
  #list.grid { grid-template-columns:minmax(0,1fr); gap:10px; }
  .grid .deal { display:grid; grid-template-columns:84px minmax(0,1fr); align-content:start; gap:6px 10px; padding:10px; border-radius:12px; }
  .grid .deal-visual { display:contents; }
  .grid .deal .coupon-space { display:none; }
  .grid .deal-body { display:contents; }
  .grid .deal .media { grid-column:1; grid-row:1; width:84px; height:84px; border-radius:8px; background:white; }
  .grid .deal .media img, .grid .deal.has-coupon .media img { inset:5px; width:calc(100% - 10px); height:calc(100% - 10px); }
  .grid .deal .deal-heading { display:flex; grid-column:2; grid-row:1; flex-direction:column; justify-content:flex-start; gap:5px; min-width:0; }
  .grid .deal .brand { font-size:12px; letter-spacing:0; gap:6px; }
  .grid .deal .brand>span:first-child { overflow:hidden; text-overflow:ellipsis; }
  .grid .deal .brand .store { flex:none; }
  .grid .deal .title { font-size:15px; line-height:1.35; min-height:0; -webkit-line-clamp:3; }
  .grid .deal .specs { gap:4px; }
  .grid .deal .spec { font-size:12px; padding:1px 5px; }
  .grid .deal .badges { grid-column:1; grid-row:2; align-self:center; min-height:0; padding:0; background:none; }
  .grid .deal .badge { font-size:11px; padding:2px 6px; }
  .grid .deal .badge.best { gap:3px; padding:5px 4px; font-size:11px; }
  .grid .deal .badge.best svg { width:11px; height:11px; }
  .grid .deal>.coupon-trigger { display:flex; position:relative; inset:auto; grid-column:2; grid-row:2; width:fit-content; min-height:44px; padding:4px 8px; border:1px dashed #afd1b8; border-radius:6px; gap:6px; }
  .grid .deal>.coupon-trigger>svg { width:17px; height:17px; }
  .grid .deal>.coupon-trigger strong { font-size:13px; }
  .grid .deal>.coupon-trigger small { display:none; }
  .grid .deal>.coupon-trigger .coupon-info { width:17px; height:17px; font-size:11px; margin-left:4px; }
  .grid .deal .deal-pricing { display:grid; grid-column:1 / -1; grid-row:3; grid-template-columns:minmax(0,1fr) minmax(112px,.75fr); gap:6px 10px; padding-top:6px; border-top:1px solid var(--line); }
  .grid .deal .deal-summary, .grid .deal .deal-footer { display:contents; }
  .grid .deal .rate { grid-column:1; grid-row:1; display:flex; flex-direction:column; align-items:flex-start; margin:0; gap:2px; }
  .grid .deal .rate strong { font-size:24px; }
  .grid .deal .rate>span[title] { font-size:12px; }
  .grid .deal .rate .vs { margin:0; font-size:12px; }
  .grid .deal .rate .vs span { padding:1px 5px; }
  .grid .deal .price { grid-column:1 / -1; grid-row:2; padding:6px 0 2px; }
  .grid .deal .price-breakdown { font-size:13.5px; }
  .grid .deal .coupon-note { grid-column:1 / -1; font-size:12px; }
  .grid .deal .asof { grid-column:1 / -1; grid-row:3; min-width:0; font-size:12px; line-height:1.35; }
  .grid .deal .cta { grid-column:2; grid-row:1; justify-self:end; align-self:start; margin:0; }
  .grid .deal .cta .btn { width:auto; min-width:112px; min-height:48px; padding:10px 18px; font-size:15px; font-weight:700; }
  .grid .deal .buy-label { display:none; }
  .grid .deal .mobile-buy-label { display:inline; white-space:normal; line-height:1.2; }
  .grid .deal .cta .btn svg { flex:none; }
  .grid .deal .cta { max-width:100%; }
  .grid .deal .cta .btn { max-width:100%; padding-inline:12px; }
  .grid .deal .admin-tools { grid-column:1 / -1; }
}

/* Stretch the native buy link across card gaps; text remains selectable above it. */
.grid .deal .cta .btn::after { content:""; position:absolute; inset:0; z-index:1; border-radius:var(--radius); }
.grid .deal .media,
.grid .deal .brand,
.grid .deal .title,
.grid .deal .specs,
.grid .deal .rate,
.grid .deal .price,
.grid .deal .coupon-note,
.grid .deal .asof,
.grid .deal .admin-tools { position:relative; z-index:2; }
.grid .deal .cta .btn>span, .grid .deal .cta .btn>svg { position:relative; z-index:2; pointer-events:none; }
.grid .deal>.coupon-trigger { z-index:3; }
.grid .deal .badges { z-index:2; pointer-events:auto; }

/* Responsive browsing, touch targets and keyboard accessibility. */
.hero { padding-block: 22px 16px; }
.hero .lede { max-width: 85ch; margin-bottom: 14px; }
.hero-heading .connect-telegram { min-height: 48px; padding-block: 8px; }
.deal-search { display: flex; gap: 8px; margin-bottom: 16px; max-width: 680px; }
.deal-search input { width: 100%; min-width: 0; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 16px; }
.deal-search .btn { min-height: 44px; }
.results { scroll-margin-top: 80px; }
@media (min-width: 720px) {
  .store-row { align-items: flex-start; }
  .store-row .flabel { padding-top: 10px; }
  #siteOpts { flex-wrap: wrap; overflow: visible; mask-image: none; }
  #storesExpand { margin-top: 3px; }
}
@media (max-width: 719.98px) {
  .hero { padding-block: 18px 14px; }
  .hero h1 { font-size: 30px; }
  .hero .lede { font-size: 14px; line-height: 1.5; }
  .hero-heading { gap: 12px; }
  .hero-heading .connect-telegram { min-height: 44px; width: auto; }
  .hero-heading .connect-telegram svg { width: 20px; height: 20px; }
  .hero-heading .connect-telegram strong { font-size: 13px; }
  .store-row { flex-wrap: wrap; }
  .store-row .flabel { position: static; width: auto; height: auto; clip-path: none; overflow: visible; flex-basis: 100%; }
  #siteOpts { flex: 1 1 0; overflow-x: auto; gap: 8px; padding-bottom: 6px; scrollbar-width: thin; }
  #siteOpts > .site-chip:nth-child(n) { display: inline-flex; flex: 0 0 auto; min-width: 104px; min-height: 48px; }
  #storesExpand { width: 44px; height: 48px; }
  .store-row #storeDd { display: none; }
  .chip-toggle, .dd > summary, .switch { min-height: 44px; }
  .dd-panel .check, .dd-done { min-height: 44px; }
  .dd-search, .dd-panel input[type="number"] { font-size: 16px; min-height: 44px; }
  #weightOpts .weight, .weight-row summary, .store-row summary { min-height: 44px; }
  .frow-tools { gap: 8px; }
  .results { scroll-margin-top: 12px; padding-top: 16px; }
  .count { font-size: 18px; }
  .count small { display: block; font-size: 12px; margin-top: 2px; }
  .toolbar-actions { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .sort { grid-column: 1 / -1; }
  .sort select { width: 100%; max-width: none; min-height: 44px; font-size: 16px; }
  .view-toggle { justify-self: start; }
  .view-toggle button { min-height: 40px; }
  #shareBtn { min-width: 44px; min-height: 44px; }
  .toast { max-width: calc(100vw - 24px); width: max-content; text-align: center; border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}


/* ---------------------------------------------------------------------------
   Platform extensions (platform.js, admin-platform.js): location selector,
   availability badges, deal detail and alerts dialogs, admin orchestration panels.
   --------------------------------------------------------------------------- */
.location-row .pf-select { min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); max-width: min(100%, 320px); }
.pf-inline-hint { margin: 0; }
.badge.elsewhere { background: var(--card-soft); color: var(--card); border-color: color-mix(in srgb, var(--card) 35%, var(--line)); }
.badge.pf-stock-badge { background: var(--surface-2); color: var(--muted); }
.badge.pf-stock-badge.pf-gone { background: var(--bad-soft); color: var(--bad); }
.deal.pf-unavailable, tr.pf-unavailable { opacity: .55; }
/* The buy button's ::after makes the whole card clickable; the details control must sit above it. */
.details-btn { position: relative; z-index: 3; flex: none; margin-left: auto; font-size: 13px; padding: 4px 6px; }
@media (max-width: 719.98px) { .grid .deal .cta { flex-wrap: wrap; justify-content: flex-end; } .grid .deal .details-btn { margin-left: 0; } }
table.deals .details-btn { display: inline-block; margin: 4px 0 0; }
.pf-alerts-btn { position: relative; }
.pf-alerts-btn svg { width: 20px; height: 20px; }
.pf-alerts-count { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; line-height: 16px; text-align: center; }
.pf-dialog { width: min(100% - 24px, 720px); max-height: calc(100vh - 24px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.pf-dialog::backdrop { background: rgb(0 0 0 / 55%); }
.pf-dialog-inner { padding: 18px 20px 22px; }
.pf-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.pf-detail-head h2 { margin: 2px 0 4px; font-family: var(--serif); font-size: 20px; line-height: 1.25; }
.pf-detail-head .brand { margin: 0; display: flex; gap: 8px; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pf-close { font-size: 22px; line-height: 1; padding: 4px 10px; }
.pf-section { padding-top: 14px; }
.pf-section h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pf-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pf-table th, .pf-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.pf-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pf-table .num { text-align: right; }
.pf-table small, .pf-list small { color: var(--faint); font-size: 12px; display: block; }
.pf-dim { opacity: .6; }
.pf-spark { width: 100%; height: 56px; stroke: var(--accent); stroke-width: 2; fill: none; }
.pf-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pf-form { display: grid; gap: 10px; }
.pf-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.pf-form input, .pf-form select, .pf-form textarea { min-height: 38px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.pf-form textarea { min-height: 96px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.pf-form fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.pf-form legend { font-size: 12px; color: var(--muted); padding: 0 4px; }
.pf-form.pf-inline { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); align-items: end; }
.pf-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pf-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.pf-panel { display: grid; gap: 14px; }
.pf-panel .admin-card { margin: 0; }
.pf-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.pf-kpi { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.pf-kpi strong { display: block; font-size: 20px; font-family: var(--serif); }
.pf-kpi span { font-size: 12px; color: var(--muted); }
.pf-status { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.pf-status.ok { background: var(--good-soft); color: var(--good); }
.pf-status.warn { background: var(--accent-soft); color: var(--accent-ink); }
.pf-status.bad { background: var(--bad-soft); color: var(--bad); }
.pf-row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-row-actions .btn { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.pf-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
.pf-code { display: block; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; overflow-x: auto; white-space: pre; }
.pf-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
@media (max-width: 719.98px) {
  .pf-dialog { width: 100%; max-height: 100vh; border-radius: 0; }
  .pf-table { font-size: 13px; }
  .pf-detail-head h2 { font-size: 18px; }
}
