/* StaySniper HUB — the visual system.
 *
 * "Night ledger": a concierge's ledger, not a SaaS dashboard. Linen ground
 * and ink in daylight, pine-black and bone after dark. Bodoni Moda (a variable
 * Didone with an optical-size axis) carries titles and headline prices —
 * the face of a hotel letterhead, not a SaaS dashboard; IBM Plex Sans
 * carries everything else with tabular numerals. One brass accent for the
 * single primary action on a card; one kind palette (ember, pine, slate,
 * plum, ochre, teal, brass) that means the same thing on every page.
 *
 * Tokens are defined once on :root and re-pointed for dark. Components use
 * tokens only — no raw colours below the token block.
 */

/* ---------- fonts: metric-matched fallbacks so the swap does not shift ----
 * One fallback family per platform face, each size-adjusted to the web
 * font's average advance width (measured against IBM Plex Sans / Bodoni
 * Moda). The stack lists them all; the browser keeps the first whose
 * local() resolves, so iOS gets Helvetica Neue, Android Roboto, Linux
 * DejaVu — each at the width the real font will land at. */
@font-face { font-family: "PlexFB Helvetica"; src: local("Helvetica Neue"), local("HelveticaNeue"); size-adjust: 103%; ascent-override: 102%; descent-override: 27%; line-gap-override: 0%; }
@font-face { font-family: "PlexFB Arial"; src: local("Arial"), local("ArialMT"); size-adjust: 103%; ascent-override: 102%; descent-override: 27%; line-gap-override: 0%; }
@font-face { font-family: "PlexFB Roboto"; src: local("Roboto"); size-adjust: 104%; ascent-override: 102%; descent-override: 27%; line-gap-override: 0%; }
@font-face { font-family: "PlexFB Liberation"; src: local("Liberation Sans"); size-adjust: 103%; ascent-override: 102%; descent-override: 27%; line-gap-override: 0%; }
@font-face { font-family: "PlexFB DejaVu"; src: local("DejaVu Sans"); size-adjust: 91.4%; ascent-override: 102%; descent-override: 27%; line-gap-override: 0%; }
@font-face { font-family: "BodoniFB Didot"; src: local("Didot"), local("Bodoni 72"), local("Bodoni MT"); size-adjust: 100%; ascent-override: 92%; descent-override: 24%; line-gap-override: 0%; }
@font-face { font-family: "BodoniFB Georgia"; src: local("Georgia"); size-adjust: 90%; ascent-override: 92%; descent-override: 24%; line-gap-override: 0%; }
@font-face { font-family: "BodoniFB Times"; src: local("Times New Roman"), local("Times"); size-adjust: 95%; ascent-override: 92%; descent-override: 24%; line-gap-override: 0%; }
@font-face { font-family: "BodoniFB DejaVu"; src: local("DejaVu Serif"); size-adjust: 87.6%; ascent-override: 92%; descent-override: 24%; line-gap-override: 0%; }

/* ---------- tokens ------------------------------------------------------ */
:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --surface: #fcfbf7;
  --surface-2: #ebe6da;
  --surface-3: #e2dccd;
  --ink: #1b1a16;
  --ink-2: #3f3d36;
  --muted: #6a675e;
  --line: #dfd9cb;
  --line-strong: #c9c2b1;
  --accent: #8a5a12;
  --accent-ink: #ffffff;
  --accent-soft: #f6e8c8;
  --link: #1f5a47;
  --focus: #2f5b8e;
  --ok: #1f6a45;
  --warn: #8a5a12;
  --bad: #a52a1a;
  --spark: #2f5b8e;

  --k-mistake: #a52a1a;   --k-mistake-bg: #f9e0da;
  --k-deal: #1f6a45;      --k-deal-bg: #dcefe2;
  --k-channel: #2f5b8e;   --k-channel-bg: #dde7f4;
  --k-cpp: #6b3a8c;       --k-cpp-bg: #ece0f4;
  --k-community: #7a5410; --k-community-bg: #f4e6c5;
  --k-scout: #1b6667;     --k-scout-bg: #d7ecec;
  --k-opening: #8a5a12;   --k-opening-bg: #f6e8c8;

  --display: "Bodoni Moda", "BodoniFB Didot", "BodoniFB Georgia", "BodoniFB Times", "BodoniFB DejaVu", Georgia, serif;
  --sans: "IBM Plex Sans", "PlexFB Helvetica", "PlexFB Arial", "PlexFB Roboto", "PlexFB Liberation", "PlexFB DejaVu", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --fs-xs: .74rem; --fs-s: .84rem; --fs-m: .95rem; --fs-l: 1.1rem;
  --fs-xl: 1.5rem; --fs-2xl: 2rem; --fs-3xl: 2.6rem;

  --sp-1: .25rem; --sp-2: .5rem; --sp-3: .75rem; --sp-4: 1rem;
  --sp-5: 1.5rem; --sp-6: 2rem; --sp-7: 3rem;

  --r-s: .45rem; --r-m: .8rem; --r-l: 1.15rem; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(27, 26, 22, .06), 0 1px 1px rgba(27, 26, 22, .04);
  --shadow-2: 0 6px 20px -8px rgba(27, 26, 22, .22), 0 2px 4px rgba(27, 26, 22, .05);
  --tap: 44px;
  --top-h: 3.4rem;
  --tab-h: calc(3.6rem + env(safe-area-inset-bottom));
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f1210;
    --surface: #171b18;
    --surface-2: #20261f;
    --surface-3: #2a312a;
    --ink: #ece7db;
    --ink-2: #c9c3b5;
    --muted: #9b968a;
    --line: #2a302a;
    --line-strong: #3a423a;
    --accent: #d9ac52;
    --accent-ink: #1b1a16;
    --accent-soft: #3a2c0f;
    --link: #8fd0b0;
    --focus: #9cc0ee;
    --ok: #8fd8ac;
    --warn: #e8b95d;
    --bad: #ff9d88;
    --spark: #9cc0ee;

    --k-mistake: #ff9d88;   --k-mistake-bg: #3b1d17;
    --k-deal: #8fd8ac;      --k-deal-bg: #17301f;
    --k-channel: #9cc0ee;   --k-channel-bg: #1a2a3d;
    --k-cpp: #d1a9ea;       --k-cpp-bg: #2d1f3b;
    --k-community: #e6c26a; --k-community-bg: #362a10;
    --k-scout: #86d0d0;     --k-scout-bg: #143232;
    --k-opening: #e8b95d;   --k-opening-bg: #3a2c0f;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 10px 28px -10px rgba(0, 0, 0, .7), 0 1px 2px rgba(0, 0, 0, .4);
  }
}

/* ---------- base -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 1rem); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--fs-m)/1.5 var(--sans);
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tab-h) + var(--sp-5));
}
a { color: var(--link); text-decoration: none; text-underline-offset: .15em; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-s); }
h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: -.005em; margin: 0; font-optical-sizing: auto; }
h1 { font-size: var(--fs-2xl); line-height: 1.1; }
h1 .keys { font-size: .5em; vertical-align: .2em; margin-right: .3em; letter-spacing: -.1em; }
h2 { font-size: var(--fs-xl); line-height: 1.2; margin: var(--sp-6) 0 var(--sp-3); }
h3 { font-size: var(--fs-l); line-height: 1.25; }
p { margin: 0 0 var(--sp-3); }
code { font-family: var(--mono); font-size: .85em; background: var(--surface-2); padding: .1em .35em; border-radius: var(--r-s); }
svg { display: block; }
::selection { background: var(--accent-soft); }

/* ---------- chrome ------------------------------------------------------ */
.top {
  position: sticky; top: 0; z-index: 20; height: var(--top-h);
  display: flex; align-items: center; gap: var(--sp-4);
  padding: 0 var(--sp-4); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--display); font-size: 1.35rem; font-weight: 500; color: var(--ink);
  letter-spacing: -.01em; white-space: nowrap;
}
.brand i { font-style: italic; font-weight: 400; color: var(--accent); }
.brand:hover { text-decoration: none; }
.brand .dot { display: inline-block; width: .38em; height: .38em; border-radius: 50%; background: var(--accent); margin: 0 .25em 0 .1em; vertical-align: .18em; }
.topnav { display: flex; gap: .15rem; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  color: var(--ink-2); font-weight: 500; font-size: var(--fs-s); padding: .45rem .7rem;
  border-radius: var(--r-pill); white-space: nowrap; min-height: 36px; display: inline-flex; align-items: center;
}
.topnav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.topnav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: var(--tab-h);
  padding-bottom: env(safe-area-inset-bottom);
  display: none; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a, .tabbar summary {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
  color: var(--muted); font-size: .68rem; font-weight: 500; text-decoration: none;
  min-height: var(--tap); cursor: pointer; list-style: none; user-select: none;
}
.tabbar summary::-webkit-details-marker { display: none; }
.tabbar a svg, .tabbar summary svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current="page"], .tabbar details[open] summary, .tabbar details.here summary { color: var(--accent); }
.tabbar details { position: relative; }
.tabbar .more {
  position: absolute; bottom: calc(100% + .5rem); right: .5rem; min-width: 12rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
  box-shadow: var(--shadow-2); padding: .4rem; display: grid;
}
.tabbar .more a { flex-direction: row; justify-content: flex-start; gap: .7rem; padding: 0 .8rem; font-size: var(--fs-m); color: var(--ink); border-radius: var(--r-m); }
.tabbar .more a:hover { background: var(--surface-2); }
.tabbar .more a[aria-current="page"] { color: var(--accent); }
main { max-width: 64rem; margin: 0 auto; padding: var(--sp-5) var(--sp-4) 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-2) var(--sp-4); margin-bottom: var(--sp-4); }
.page-head .sub { color: var(--muted); font-size: var(--fs-s); flex-basis: 100%; }
.eyebrow { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 760px) {
  .topnav { display: none; }
  .tabbar { display: grid; }
  main { padding-top: var(--sp-4); }
  h1 { font-size: 1.75rem; }
}
@media (min-width: 761px) {
  body { padding-bottom: var(--sp-7); }
}

/* ---------- surfaces ---------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
  padding: var(--sp-4) var(--sp-4); margin: var(--sp-3) 0; box-shadow: var(--shadow-1);
}
.card.tint { background: var(--surface-2); }
.card.flat { box-shadow: none; }
.stack > * + * { margin-top: var(--sp-3); }
.k, .meta { color: var(--muted); font-size: var(--fs-s); }
.mono { font-family: var(--mono); font-size: .8rem; white-space: pre; overflow-x: auto; display: block; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ok { color: var(--ok); font-weight: 600; }
.warn { color: var(--warn); font-weight: 600; }
.bad { color: var(--bad); font-weight: 700; }
.empty {
  border: 1px dashed var(--line-strong); border-radius: var(--r-l); padding: var(--sp-5) var(--sp-4);
  text-align: center; color: var(--ink-2); background: transparent; margin: var(--sp-4) 0;
}
.empty h3 { margin-bottom: var(--sp-2); }
.empty p { margin: 0 auto; max-width: 34rem; color: var(--muted); }
.empty p + p { margin-top: var(--sp-2); }

/* ---------- tags & kind palette ---------------------------------------- */
.tag {
  display: inline-flex; align-items: center; gap: .3em; font-size: var(--fs-xs); font-weight: 600;
  line-height: 1; padding: .34em .65em; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap; vertical-align: middle;
}
.tag.badge { background: transparent; border: 1px solid var(--line-strong); color: var(--ink-2); font-weight: 500; }
.tag.on { background: var(--ink); color: var(--bg); }
.kind { text-transform: capitalize; letter-spacing: .01em; }
.kind-mistake   { background: var(--k-mistake-bg);   color: var(--k-mistake); }
.kind-deal      { background: var(--k-deal-bg);      color: var(--k-deal); }
.kind-channel   { background: var(--k-channel-bg);   color: var(--k-channel); }
.kind-cpp       { background: var(--k-cpp-bg);       color: var(--k-cpp); }
.kind-community { background: var(--k-community-bg); color: var(--k-community); }
.kind-scout     { background: var(--k-scout-bg);     color: var(--k-scout); }
.kind-opening   { background: var(--k-opening-bg);   color: var(--k-opening); }
/* legacy pill names still used by badges/tags in a few places */
.pill-mulberry { background: var(--k-mistake-bg); color: var(--k-mistake); }
.pill-fuchsia { background: var(--ink); color: var(--bg); }
.pill-fern { background: var(--k-deal-bg); color: var(--k-deal); }
.pill-babyblue { background: var(--k-channel-bg); color: var(--k-channel); }
.pill-shell { background: var(--surface-2); color: var(--ink-2); }
.badges { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: var(--sp-2); }

/* chips: filters with counts, active state, 44px targets */
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: var(--sp-3) 0 var(--sp-4); }
.chips.rail { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .3rem; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.chip {
  display: inline-flex; align-items: center; gap: .4em; min-height: 2.3rem; padding: .35rem .85rem;
  border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--ink-2); font-size: var(--fs-s); font-weight: 500; white-space: nowrap; line-height: 1;
}
.chip:hover { text-decoration: none; border-color: var(--ink-2); color: var(--ink); }
.chip .n { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; font-size: var(--fs-xs); }
.chip .sw { width: .55em; height: .55em; border-radius: 50%; background: var(--ink-2); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.on .n { color: var(--bg); opacity: .75; }
.chip.on .sw { background: var(--bg); }
.chip.dim { opacity: .55; }
.chip.kind-mistake .sw { background: var(--k-mistake); }
.chip.kind-deal .sw { background: var(--k-deal); }
.chip.kind-channel .sw { background: var(--k-channel); }
.chip.kind-cpp .sw { background: var(--k-cpp); }
.chip.kind-community .sw { background: var(--k-community); }
.chip.kind-scout .sw { background: var(--k-scout); }
.chip.kind-opening .sw { background: var(--k-opening); }
.chip[class*="kind-"] { background: var(--surface); color: var(--ink-2); }
.chip.on[class*="kind-"] { background: var(--ink); color: var(--bg); }
@media (max-width: 760px) { .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .3rem; scrollbar-width: none; margin-left: calc(-1 * var(--sp-4)); margin-right: calc(-1 * var(--sp-4)); padding-left: var(--sp-4); padding-right: var(--sp-4); } .chips::-webkit-scrollbar { display: none; } }

/* ---------- buttons & forms -------------------------------------------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-height: var(--tap); padding: .55rem 1.1rem; border-radius: var(--r-pill);
  background: var(--ink); color: var(--bg); border: 1px solid transparent;
  font: 600 var(--fs-s)/1 var(--sans); cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform .06s ease, background .12s ease;
}
button:hover, .btn:hover { text-decoration: none; filter: brightness(1.08); }
button:active, .btn:active { transform: translateY(1px); }
.btn.primary, button.primary { background: var(--accent); color: var(--accent-ink); }
button.ghost, .btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
button.ghost:hover, .btn.ghost:hover { background: var(--surface-2); filter: none; }
button.small, .btn.small { min-height: 36px; padding: .35rem .8rem; font-size: var(--fs-xs); }
.wide { width: 100%; }
form.inline { display: inline; }
.field { display: block; margin: 0 0 var(--sp-3); }
.field > span, label.lbl { display: block; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: .3rem; }
.field .hint { display: block; font-size: var(--fs-xs); color: var(--muted); margin-top: .25rem; text-transform: none; letter-spacing: 0; font-weight: 400; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%; min-height: var(--tap); background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-m); padding: .55rem .85rem;
  font: 400 var(--fs-m)/1.3 var(--sans); margin: 0;
}
select { appearance: none; -webkit-appearance: none; padding-right: 2.2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 50%, calc(100% - .8rem) 50%; background-size: .35rem .35rem; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--focus); outline-offset: 0; border-color: transparent; }
input::placeholder { color: var(--muted); opacity: .8; }
.check { display: inline-flex; align-items: center; gap: .55rem; min-height: var(--tap); font-size: var(--fs-s); color: var(--ink-2); cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--accent); }
.form-grid { display: grid; gap: 0 var(--sp-4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .span2 { grid-column: span 2; } }
.form-actions { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-2); }

/* segmented outcome control */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-pill); overflow: hidden; background: var(--surface); }
.seg form { display: contents; }
.seg button { border-radius: 0; background: transparent; color: var(--ink-2); border: 0; border-right: 1px solid var(--line); min-height: 40px; padding: .4rem .9rem; font-size: var(--fs-xs); }
.seg form:last-child button { border-right: 0; }
.seg button:hover { background: var(--surface-2); color: var(--ink); filter: none; }
.seg .verdict-booked:hover { color: var(--ok); }
.seg .verdict-false_positive:hover { color: var(--bad); }
.outcome { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-3); }
.outcome .lbl-o { font-size: var(--fs-xs); color: var(--muted); }
.stamp { display: inline-flex; align-items: center; gap: .35em; font-family: var(--display); font-style: italic; font-size: var(--fs-m); color: var(--muted); }
.stamp.booked { color: var(--ok); }
.stamp.false_positive { color: var(--bad); }

/* ---------- tables ------------------------------------------------------ */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
td, th { padding: .55rem .6rem; text-align: left; border-bottom: 1px solid var(--line); font-size: var(--fs-s); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 600; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; }
table.sheet th { width: 34%; text-transform: none; letter-spacing: 0; font-size: var(--fs-s); color: var(--muted); font-weight: 500; }
table.compact td, table.compact th { padding: .4rem .5rem; }
.bar { position: relative; height: .4rem; background: var(--surface-3); border-radius: var(--r-pill); overflow: hidden; min-width: 6rem; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--ok); border-radius: var(--r-pill); }
.bar.hot > i { background: var(--warn); }
.bar.dry > i { background: var(--bad); }

/* ---------- summary strip ---------------------------------------------- */
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); margin: 0 0 var(--sp-4); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: .7rem .85rem; min-width: 0; }
.stat .lbl { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .val { font-family: var(--display); font-size: 1.7rem; line-height: 1.1; font-weight: 500; font-variant-numeric: tabular-nums; margin-top: .15rem; }
.stat .val.bad { color: var(--bad); }
.stat .val.ok { color: var(--ok); }
.stat .sub { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .summary { grid-template-columns: repeat(2, 1fr); } }

/* ---------- alert card -------------------------------------------------- */
.alert {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
  padding: var(--sp-4) var(--sp-4) var(--sp-3) calc(var(--sp-4) + .3rem); margin: var(--sp-3) 0; box-shadow: var(--shadow-1);
  content-visibility: auto; contain-intrinsic-size: auto 600px;
}
.alert::before { content: ""; position: absolute; left: 0; top: 1rem; bottom: 1rem; width: 4px; border-radius: 0 4px 4px 0; background: var(--kc, var(--line-strong)); }
.alert.k-mistake { --kc: var(--k-mistake); }
.alert.k-deal { --kc: var(--k-deal); }
.alert.k-channel { --kc: var(--k-channel); }
.alert.k-cpp { --kc: var(--k-cpp); }
.alert.k-community { --kc: var(--k-community); }
.alert.k-scout { --kc: var(--k-scout); }
.alert.k-opening { --kc: var(--k-opening); }
.alert.done { opacity: .7; }
.alert-top { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.alert-top .when { margin-left: auto; font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.src { display: inline-flex; align-items: center; gap: .35em; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); }
.src::before { content: ""; width: .5em; height: .5em; border-radius: 2px; background: var(--kc, var(--muted)); opacity: .8; }
.src .via { font-weight: 400; color: var(--muted); }
.alert h3 { margin: .55rem 0 .15rem; font-size: 1.2rem; font-weight: 500; overflow-wrap: anywhere; }
.alert h3 a { color: var(--ink); }
.alert.k-community h3 { font-family: var(--sans); font-size: 1.02rem; font-weight: 600; line-height: 1.35; }
.alert .sub { color: var(--ink-2); font-size: var(--fs-s); margin: -.05rem 0 .15rem; }
.alert .where { color: var(--ink-2); font-size: var(--fs-s); }
.alert .where b { font-weight: 500; color: var(--ink); }
.price-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin: var(--sp-3) 0 var(--sp-3); }
.price { font-family: var(--display); font-weight: 500; font-size: 2.2rem; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums lining-nums; color: var(--ink); }
.price .cur { font-size: .55em; vertical-align: .45em; margin-right: .05em; color: var(--muted); font-weight: 400; }
.price-note { font-size: var(--fs-s); color: var(--muted); margin: -.5rem 0 var(--sp-3); }
.saving { text-align: right; }
.saving .pct { font-family: var(--display); font-size: 1.5rem; font-weight: 500; line-height: 1; color: var(--ok); font-variant-numeric: tabular-nums; }
.saving .pct.meh { color: var(--muted); }
.saving .vs { display: block; font-size: var(--fs-xs); color: var(--muted); margin-top: .3rem; }
.alert .act { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; margin-top: var(--sp-2); }
.alert .act .btn { flex: 1 1 100%; }
@media (min-width: 640px) { .alert .act .btn { flex: 0 0 auto; min-width: 14rem; } }
.alert .links { display: flex; flex-wrap: wrap; gap: .2rem 1rem; font-size: var(--fs-s); }
.alert .links a { min-height: 36px; display: inline-flex; align-items: center; }
details.why { margin-top: var(--sp-3); border-top: 1px solid var(--line); padding-top: .4rem; }
details.why summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .5rem; min-height: 40px; font-size: var(--fs-s); color: var(--ink-2); font-weight: 500; user-select: none; }
details.why summary::-webkit-details-marker { display: none; }
details.why summary::before { content: ""; width: .45rem; height: .45rem; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin-left: .2rem; }
details.why[open] summary::before { transform: rotate(45deg); }
details.why summary .conf { margin-left: auto; font-size: var(--fs-xs); color: var(--muted); font-weight: 400; }
details.why ul { margin: .3rem 0 .6rem; padding-left: 1.2rem; color: var(--ink-2); font-size: var(--fs-s); }
details.why li + li { margin-top: .25rem; }
.repeats { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--sp-3); margin-top: var(--sp-3); font-size: var(--fs-xs); color: var(--muted); }
.repeats b { color: var(--ink-2); font-weight: 600; }
.repeats svg { grid-column: 2; grid-row: 1 / span 2; height: 30px; width: 140px; }
.repeats .range { grid-column: 1; font-variant-numeric: tabular-nums; }
.verified { color: var(--ok); font-weight: 600; font-size: var(--fs-xs); }
.unverified { color: var(--muted); font-size: var(--fs-xs); }
.alert .badges { margin-top: .4rem; }

/* channel table inside the why-details */
.channels { margin-top: .4rem; }
.channels td:first-child { max-width: 14rem; }
.channels .tag { margin-left: .3rem; }

/* ---------- hotels browser ---------------------------------------------- */
.filters { position: sticky; top: var(--top-h); z-index: 10; margin: 0 0 var(--sp-3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: .6rem .75rem; box-shadow: var(--shadow-1); }
.filters .row { display: flex; gap: .5rem; align-items: center; }
.filters .row + .row { margin-top: .5rem; }
.filters input[name="q"] { flex: 1 1 auto; }
.filters select { flex: 1 1 0; min-width: 0; }
.filters .check { min-height: 36px; }
.filters .toggles { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-left: auto; }
.filters button { flex: 0 0 auto; }
@media (max-width: 760px) { .filters .toggles { margin-left: 0; } }
.pager { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-3) 0; color: var(--muted); font-size: var(--fs-s); }
.pager .btn { margin-left: auto; }
.pager .btn + .btn { margin-left: 0; }
.hotel-list { display: grid; gap: .5rem; }
.hotel {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem var(--sp-3); align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: .7rem .9rem;
  content-visibility: auto; contain-intrinsic-size: auto 118px;
}
.hotel .name { font-weight: 600; font-size: var(--fs-m); color: var(--ink); overflow-wrap: anywhere; }
.hotel .name a { color: var(--ink); }
.hotel .name .keys { color: var(--accent); letter-spacing: -.05em; margin-right: .3rem; }
.hotel .place { color: var(--muted); font-size: var(--fs-s); }
.hotel .name, .hotel .place, .hotel .lists, .hotel .k { grid-column: 1; }
.hotel .side { grid-column: 2; grid-row: 1 / span 4; display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; }
.hotel .side a.gh { font-size: var(--fs-xs); min-height: 32px; display: inline-flex; align-items: center; }
.hotel .lists { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .15rem; }
.hotel .lists .tag { font-size: .68rem; padding: .25em .55em; }
.hotel .brand { margin-left: .3rem; }
@media (max-width: 480px) { .hotel .side { flex-direction: column; } }

/* hotel page */
.hero { margin-bottom: var(--sp-4); }
.hero .keys { color: var(--accent); font-size: 1.1rem; letter-spacing: -.05em; }
.hero .place { color: var(--ink-2); font-size: var(--fs-l); margin-top: .2rem; }
.hero .row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: var(--sp-3); }
.linkrow { display: flex; flex-wrap: wrap; gap: .5rem; }
.linkrow .btn { flex: 1 1 auto; }
@media (min-width: 640px) { .linkrow .btn { flex: 0 0 auto; } }
.tagcloud { display: flex; flex-wrap: wrap; gap: .3rem; }
.prose { color: var(--ink-2); line-height: 1.6; white-space: pre-line; }
.sighting { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.sighting:last-child { border-bottom: 0; }
.sighting .when { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; }

/* ---------- deals ------------------------------------------------------- */
.deal { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3rem var(--sp-3); align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: .8rem .95rem; margin: .5rem 0; }
.deal .kind { margin-top: .15rem; }
.deal .t { font-weight: 500; overflow-wrap: anywhere; }
.deal .hotel-ref { font-weight: 600; }
.deal .meta { display: flex; flex-wrap: wrap; gap: .3rem .8rem; }

/* ---------- properties / scout / radar cards ---------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: var(--sp-3); }
.grid .card { margin: 0; }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr)); }
.card .head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); }
.card .head h3 { overflow-wrap: anywhere; }
.card .tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.spark { margin: var(--sp-3) 0; }
.spark svg { width: 100%; height: 44px; }
.spark .range { font-size: var(--fs-xs); color: var(--muted); }
.card .foot { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-3); }
.state { font-family: var(--display); font-style: italic; font-size: var(--fs-l); }

/* ---------- cert board -------------------------------------------------- */
.board h3 { display: block; margin-bottom: .5rem; }
.board h3 .wallet { display: block; font-family: var(--sans); font-size: var(--fs-s); font-weight: 500; color: var(--muted); margin-top: .2rem; }
.board .urgency { display: block; font-family: var(--sans); color: var(--warn); font-weight: 600; font-size: var(--fs-s); margin-top: .15rem; }

/* ---------- login ------------------------------------------------------- */
.login { max-width: 22rem; margin: 12vh auto 0; }
.login .brand { font-size: 2rem; display: block; margin-bottom: var(--sp-4); }
.login p.k { margin-top: var(--sp-3); }

/* ---------- motion & print --------------------------------------------- */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print { .top, .tabbar { display: none; } .alert, .card { break-inside: avoid; box-shadow: none; } }

/* ---------- award calendar (/awards/<slug>) --------------------------- */
.awcal { display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: var(--sp-4); margin-top: var(--sp-4); }
.awmonth { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: var(--sp-3); }
.awmonth h3 { margin: 0 0 var(--sp-2); font-family: var(--display); font-weight: 500; }
.awgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.awhead { font-size: var(--fs-xs); color: var(--muted); text-align: center; padding-bottom: .2rem; }
.awday { min-height: 3.3rem; padding: .25rem .3rem; border-radius: var(--r-s); background: var(--surface-2); font-size: var(--fs-xs); line-height: 1.2; display: flex; flex-direction: column; gap: .1rem; overflow: hidden; }
.awday .d { color: var(--muted); font-variant-numeric: tabular-nums; }
.awday .p { font-weight: 600; font-variant-numeric: tabular-nums; }
.awday .r { color: var(--muted); font-size: .68rem; line-height: 1.15; }
.awday.avail { background: var(--k-deal-bg); color: var(--k-deal); }
.awday.avail .d { color: var(--k-deal); opacity: .75; }
.awday.win { box-shadow: inset 0 0 0 2px var(--accent); }
.awday.none { color: var(--muted); background: var(--surface-3); }
.awday.closed { color: var(--muted); border: 1px solid var(--line); background: repeating-linear-gradient(135deg, transparent 0 6px, var(--surface-3) 6px 8px); }
.awchip { font-family: var(--sans); font-size: var(--fs-xs); font-weight: 500; letter-spacing: .02em; padding: .1rem .5rem; border-radius: var(--r-pill); margin-left: .5rem; vertical-align: middle; background: var(--k-deal-bg); color: var(--k-deal); }
.awchip.closed { background: var(--surface-3); color: var(--muted); }
.awchip.unknown { background: transparent; border: 1px dashed var(--line-strong); color: var(--muted); }
.awchip.none { background: var(--surface-3); color: var(--ink-2); }
.chip .sw.closed { background: transparent; border: 1px solid var(--line-strong); }
.awday.premium { background: var(--k-cpp-bg); color: var(--k-cpp); }
.chip .sw.premium { background: var(--k-cpp); }
.awday.unknown { background: transparent; border: 1px dashed var(--line); }
.awday.past, .awday.blank { background: transparent; min-height: 2rem; }
.awday.past .d { opacity: .35; }
.chip .sw.avail { background: var(--k-deal); }
.chip .sw.win { background: var(--accent); }
.chip .sw.none { background: var(--line-strong); }
.chip .sw.unknown { background: transparent; border: 1px dashed var(--muted); }
