/* NameHot — Terminal design system (see /DESIGN.md).
   Dark (default) and light palettes are CSS variables on [data-theme]; layout, type, spacing, radius and motion
   come from the shared tokens below. All text/UI colours meet WCAG 2.2 AA on every surface they are used on. */

/* ---- fonts: self-hosted variable subsets, font-display: swap, metric-matched fallbacks (no layout jump) ---- */
@font-face {
  font-family: "Inter Variable"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2-variations"), url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono Variable"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations"), url("/assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Fallback"; src: local("Arial"), local("Helvetica Neue"), local("Liberation Sans");
  size-adjust: 107.4%; ascent-override: 90.2%; descent-override: 22.5%; line-gap-override: 0%;
}
@font-face {
  font-family: "JetBrains Mono Fallback"; src: local("Courier New"), local("Liberation Mono"), local("Cousine");
  size-adjust: 100%; ascent-override: 102%; descent-override: 30%; line-gap-override: 0%;
}

/* ---- tokens shared by both themes ---- */
:root {
  /* type: Latin from Inter, Chinese from the platform CJK face; numbers/domains-adjacent data in JetBrains Mono */
  --font: "Inter Variable", "Inter Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --mono: "JetBrains Mono Variable", "JetBrains Mono Fallback", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --fs-2xs: 11px; --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 18px; --fs-stat: 24px; --fs-h1: 26px;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700;
  --lh-tight: 1.25; --lh-snug: 1.4; --lh-base: 1.5;
  --ls-heading: -.015em; --ls-num: -.01em; --ls-caps: .08em;
  /* space: 4px base */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  /* radius */
  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-pill: 999px;
  /* controls */
  --ctl: 36px; --ctl-lg: 40px; --tap: 44px;
  /* motion */
  --ease: cubic-bezier(.2, .8, .2, 1); --dur-1: .12s; --dur-2: .2s;
  --bp-m: 900px;
  /* Logo flame only — not a second UI accent. See DESIGN.md § Logo. */
  --flame: #FF4A1C;
  --flame-rgb: 255, 74, 28;
}
:root, [data-theme="dark"] {
  --bg: #0A0D10; --s1: #10151A; --s2: #151B21; --s3: #1B232B;
  --bd: #222B34; --bd2: #2C3844; --bd-ctl: #5B6B7B;
  --fg: #E7EDF3; --mut: #8F9EAE; --dim: #7F8C98;
  --g: #2EE6A6; --g2: #12B886; --g-ink: #04130D;
  --amber: #F5B83D; --silver: #B9C4D0; --red: #FF5C6C;
  --g-rgb: 46, 230, 166; --amber-rgb: 245, 184, 61; --red-rgb: 255, 92, 108;
  --top-bg: rgba(10, 13, 16, .86);
  --wash-g: rgba(46, 230, 166, .07); --wash-a: rgba(245, 184, 61, .04);
  --logo-bg: linear-gradient(145deg, #12382F, #0C2620);
  --logo-bd: rgba(46, 230, 166, .35); --logo-glow: 0 0 18px rgba(46, 230, 166, .18);
  --banner-bg: #2A2110; --banner-fg: #F3DE9A; --banner-line: #4a3a14;
  --tier1-price: #fff; --tier3-name: #fff;
  --sh-pop: 0 20px 60px rgba(0, 0, 0, .6); --scrim: rgba(0, 0, 0, .65);
  --skel-a: #19212A; --skel-b: #26313C;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #F3F5F7; --s1: #FFFFFF; --s2: #EEF1F4; --s3: #E7EBEE;
  --bd: #D4DBE2; --bd2: #C2CAD3; --bd-ctl: #7A8896;
  --fg: #1B232C; --mut: #536271; --dim: #5E6A76;
  --g: #00714A; --g2: #00714A; --g-ink: #FFFFFF;
  --amber: #8B5800; --silver: #5A6570; --red: #B62B3B;
  --g-rgb: 0, 113, 74; --amber-rgb: 139, 88, 0; --red-rgb: 182, 43, 59;
  --top-bg: rgba(243, 245, 247, .90);
  --wash-g: rgba(0, 113, 74, .06); --wash-a: rgba(139, 88, 0, .04);
  --logo-bg: linear-gradient(145deg, #E7F6F0, #D4EEE4);
  --logo-bd: rgba(0, 113, 74, .35); --logo-glow: 0 0 0 0 transparent;
  --banner-bg: #FFF6E0; --banner-fg: #6B4A00; --banner-line: #E6D4A0;
  --tier1-price: #1B232C; --tier3-name: #1B232C;
  --sh-pop: 0 20px 60px rgba(20, 30, 40, .18); --scrim: rgba(20, 30, 40, .35);
  --skel-a: #E9EDF1; --skel-b: #F5F7F9;
  color-scheme: light;
}
@media (pointer: coarse), (max-width: 900px) { :root { --ctl: var(--tap); --ctl-lg: var(--tap); } }
:lang(zh) { --ls-caps: .02em; }

/* ---- base ---- */
* { box-sizing: border-box; }
html {
  background: var(--bg); scrollbar-color: var(--bd2) var(--bg); scrollbar-width: thin; scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bd2); border-radius: var(--r-md); border: 2px solid var(--bg); }
body {
  margin: 0; min-height: 100dvh; color: var(--fg);
  background:
    radial-gradient(1000px 500px at 85% -10%, var(--wash-g), transparent 60%),
    radial-gradient(800px 400px at 0% 0%, var(--wash-a), transparent 55%),
    var(--bg);
  font: var(--fw-regular) var(--fs-md)/var(--lh-snug) var(--font);
  font-synthesis: none; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--sp-5); }
h1, h2, h3 { font-weight: var(--fw-semibold); }
:focus-visible { outline: 2px solid var(--g); outline-offset: 2px; }
main:focus { outline: none; }
[hidden] { display: none !important; }
.num, .price, .time, .stat .v, .rcount, .rank-num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "zero" 0, "calt" 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip {
  /* sr-only: clipped, out of flow, no layout. Shown only for keyboard :focus-visible. */
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip:focus-visible {
  clip: auto; clip-path: none; width: auto; height: auto; margin: 0; overflow: visible;
  top: var(--sp-3); left: var(--sp-3); z-index: 100; padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md); background: var(--g); color: var(--g-ink);
  font-weight: var(--fw-semibold); text-decoration: none;
}

.test-banner {
  background: var(--banner-bg); color: var(--banner-fg); text-align: center; padding: 6px var(--sp-3); font-size: var(--fs-sm);
  border-bottom: 1px solid var(--banner-line);
}

/* ---- buttons (shared states: hover / active / focus-visible / disabled) ---- */
.ghost, .cta, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--ctl);
  border-radius: var(--r-md); font-weight: var(--fw-medium); text-decoration: none; line-height: var(--lh-tight);
  transition: background var(--dur-1), border-color var(--dur-1), color var(--dur-1), transform var(--dur-1), filter var(--dur-1);
}
.ghost { background: var(--s2); border: 1px solid var(--bd-ctl); padding: 0 var(--sp-3); color: var(--fg); }
.ghost:hover { border-color: var(--g); color: var(--g); }
.ghost:active { background: var(--s3); transform: translateY(1px); }
.ghost:disabled { opacity: .5; }
.icon-btn { min-width: var(--ctl); padding: 0 var(--sp-2); }
.icon-btn[aria-pressed="false"] { opacity: .6; }
.cta, .btn { background: var(--g); color: var(--g-ink); border: 0; padding: 0 var(--sp-4); font-weight: var(--fw-bold); }
.cta:hover, .btn:hover { filter: brightness(1.08); }
.cta:active, .btn:active { filter: brightness(.94); transform: translateY(1px); }
.btn:disabled { opacity: .55; filter: none; transform: none; }

/* ---- header ---- */
.top {
  position: sticky; top: 0; z-index: 40; background: var(--top-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--bd);
}
.bar-in { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 10px; flex-wrap: nowrap; }
.brand-wrap { display: flex; align-items: center; min-width: 0; }
.brand {
  display: flex; align-items: center; min-height: var(--tap); color: var(--fg);
  text-decoration: none; border-radius: var(--r-md);
}
.brand-svg {
  display: block; flex: none; height: 26px; width: auto;
  aspect-ratio: 1150.191 / 260.41; overflow: visible;
}
.brand-svg .letter { fill: currentColor; }
.brand-svg .flame { fill: var(--flame); }
.status {
  display: inline-flex; align-items: center; gap: 7px; margin-left: var(--sp-3); padding: 3px 9px;
  border: 1px solid rgba(var(--g-rgb), .3); background: rgba(var(--g-rgb), .08); border-radius: var(--r-pill); color: var(--g);
  font: var(--fw-medium) var(--fs-xs)/var(--lh-snug) var(--mono); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}
.status.poll { color: var(--amber); border-color: rgba(var(--amber-rgb), .35); background: rgba(var(--amber-rgb), .08); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); display: inline-block; flex: none; }
.status.live .dot { background: var(--g); box-shadow: 0 0 8px var(--g); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.actions { display: flex; gap: var(--sp-2); align-items: center; flex: none; flex-wrap: nowrap; }

/* ---- ticker (hidden until it has items; 36px once visible) ---- */
.ticker { border-bottom: 1px solid var(--bd); background: var(--s1); overflow: hidden; white-space: nowrap; height: 36px; }
.ticker .track { display: inline-flex; gap: 34px; padding: 9px 0 9px 34px; animation: tick 70s linear infinite; will-change: transform; }
.ticker span { font: var(--fs-xs)/var(--lh-snug) var(--mono); color: var(--mut); }
.ticker b { color: var(--fg); font-weight: var(--fw-semibold); margin-right: 6px; }
.ticker em { font-style: normal; color: var(--g); }
.ticker em[data-tier="2"] { color: var(--amber); }
.ticker em[data-tier="1"] { color: var(--silver); }
.ticker:hover .track, .ticker:focus-within .track { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---- title + stats ---- */
.head { padding: 28px 0 0; }
h1 { margin: 0; font-size: var(--fs-h1); font-weight: var(--fw-bold); letter-spacing: var(--ls-heading); line-height: var(--lh-tight); }
.tagline { margin: 6px 0 0; color: var(--mut); font-size: var(--fs-sm); }
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--bd);
  border: 1px solid var(--bd); border-radius: var(--r-lg); overflow: hidden; margin: 18px 0;
}
.stat { background: var(--s1); padding: var(--sp-4) 18px; min-width: 0; }
.stat .k { font-size: var(--fs-2xs); letter-spacing: var(--ls-caps); text-transform: uppercase; color: var(--dim); font-weight: var(--fw-semibold); }
.stat .v { font-size: var(--fs-stat); font-weight: var(--fw-bold); line-height: 32px; height: 32px; margin-top: var(--sp-1); letter-spacing: var(--ls-num); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat .v.up { color: var(--g); }
.stat .s { font: var(--fs-xs)/var(--lh-snug) var(--mono); color: var(--mut); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 17px; }

/* ---- toolbar: search + filters ---- */
.tools { display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--sp-3); position: relative; z-index: 5; }
.searchbar { display: flex; gap: var(--sp-2); align-items: center; }
.sbox { position: relative; flex: 1; min-width: 0; }
.sbox input {
  width: 100%; height: var(--ctl-lg); padding: 0 40px 0 40px; background: var(--s1); border: 1px solid var(--bd-ctl); border-radius: 10px;
  color: var(--fg); font: var(--fs-md) var(--mono); appearance: none; -webkit-appearance: none;
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.sbox input:hover { border-color: var(--mut); }
.sbox input::placeholder { color: var(--dim); font-family: var(--font); opacity: 1; }
.sbox input:focus { outline: none; border-color: var(--g); box-shadow: 0 0 0 3px rgba(var(--g-rgb), .22); }
.sbox input::-webkit-search-cancel-button { display: none; }
.sicon { position: absolute; left: 13px; top: 50%; width: 16px; height: 16px; margin-top: -8px; fill: none; stroke: var(--dim); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.sbox:focus-within .sicon { stroke: var(--g); }
.sclear {
  position: absolute; right: 2px; top: 50%; width: var(--tap); height: var(--tap); margin-top: calc(var(--tap) / -2);
  border: 0; background: none; color: var(--mut); border-radius: var(--r-md); font-size: var(--fs-sm);
}
.sclear::before { content: ""; position: absolute; inset: 8px; border-radius: var(--r-sm); background: transparent; z-index: -1; }
.sclear { z-index: 0; isolation: isolate; }
.sclear:hover { color: var(--fg); }
.sclear:hover::before { background: var(--s3); }
.seg { position: relative; display: inline-flex; flex: none; border-radius: 10px; overflow: hidden; background: var(--s1); }
.seg::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--bd-ctl); border-radius: inherit; pointer-events: none; }
.seg button { border: 0; background: none; height: var(--ctl-lg); padding: 0 13px; color: var(--mut); font-weight: var(--fw-semibold); font-size: var(--fs-sm); white-space: nowrap; transition: background var(--dur-1), color var(--dur-1); }
.seg button + button { border-left: 1px solid var(--bd); }
.seg button:hover { color: var(--fg); background: var(--s2); }
.seg button:active { background: var(--s3); }
.seg button.on { background: rgba(var(--g-rgb), .14); color: var(--g); }
.seg button:focus-visible { outline-offset: -2px; }
.fbtn { display: inline-flex; align-items: center; gap: 7px; height: var(--ctl-lg); padding: 0 14px; border-radius: 10px; flex: none; }
.fbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.fbtn b { background: var(--g); color: var(--g-ink); border-radius: var(--r-pill); min-width: 18px; height: 18px; padding: 0 5px; font: var(--fw-bold) var(--fs-2xs)/18px var(--mono); text-align: center; }
.fbtn[aria-expanded="true"] { border-color: rgba(var(--g-rgb), .7); color: var(--g); }

.adv-backdrop { display: none; }
.adv { background: var(--s1); border: 1px solid var(--bd); border-radius: var(--r-lg); padding: var(--sp-4); }
.adv-head { display: flex; justify-content: space-between; align-items: center; }
.adv-head h2 { margin: 0; font-size: var(--fs-2xs); letter-spacing: var(--ls-caps); text-transform: uppercase; color: var(--dim); font-weight: var(--fw-semibold); }
.adv-head .icon-btn { min-height: 32px; height: 32px; border: 0; background: none; }
.adv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3) 18px; margin-top: var(--sp-2); }
.fld { min-width: 0; }
.fld label { display: block; font-size: var(--fs-xs); color: var(--mut); margin-bottom: 5px; font-weight: var(--fw-semibold); }
.fld label em { font-style: normal; color: var(--dim); font-weight: var(--fw-regular); margin-left: 6px; }
.fld input, .fld select {
  width: 100%; height: var(--ctl); background: var(--s2); border: 1px solid var(--bd-ctl); border-radius: var(--r-md); color: var(--fg);
  padding: 0 10px; font: var(--fs-sm) var(--mono); min-width: 0; transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.fld input::placeholder { color: var(--dim); font-family: var(--font); opacity: 1; }
.fld select { font-family: var(--font); padding-right: 6px; }
.fld input:hover, .fld select:hover { border-color: var(--mut); }
.fld input:focus, .fld select:focus { outline: none; border-color: var(--g); box-shadow: 0 0 0 3px rgba(var(--g-rgb), .22); }
.fld input[aria-invalid="true"] { border-color: var(--red); }
.pair { display: flex; align-items: center; gap: var(--sp-2); }
.pair i { color: var(--dim); font-style: normal; flex: none; }

.msel { position: relative; }
.msel-btn {
  width: 100%; height: var(--ctl); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  background: var(--s2); border: 1px solid var(--bd-ctl); border-radius: var(--r-md); color: var(--fg);
  padding: 0 var(--sp-2) 0 10px; font: var(--fs-sm) var(--font); text-align: left; transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.msel-btn:hover { border-color: var(--mut); }
.msel-btn .sum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--fs-sm) var(--mono); min-width: 0; }
.msel-btn .chev { width: 16px; height: 16px; flex: none; stroke: var(--mut); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur-1); }
.msel-btn[aria-expanded="true"] { border-color: var(--g); box-shadow: 0 0 0 3px rgba(var(--g-rgb), .22); }
.msel-btn[aria-expanded="true"] .chev { transform: rotate(180deg); stroke: var(--g); }
.msel-btn:focus { outline: none; border-color: var(--g); box-shadow: 0 0 0 3px rgba(var(--g-rgb), .22); }
.msel-menu {
  display: none; position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: auto; min-width: 100%; width: max(100%, 16.5rem);
  background: var(--s1); border: 1px solid var(--bd2); border-radius: 10px;
  box-shadow: var(--sh-pop); max-height: min(480px, 70vh); overflow-y: auto; padding: var(--sp-1) 0; overscroll-behavior: contain;
}
.msel.open .msel-menu, .msel-menu:not([hidden]) { display: block; }
.msel-h { font-size: var(--fs-2xs); color: var(--dim); padding: var(--sp-2) var(--sp-3) 3px; letter-spacing: var(--ls-caps); text-transform: uppercase; font-weight: var(--fw-semibold); }
.msel-opt {
  display: flex; align-items: center; gap: var(--sp-2); width: 100%; min-height: 34px; padding: 6px var(--sp-3); background: none; border: 0;
  color: var(--fg); font: var(--fs-sm) var(--font); text-align: left; cursor: pointer;
}
.msel-opt:hover { background: var(--s2); }
.msel-opt:focus-visible { outline: 2px solid var(--g); outline-offset: -2px; background: var(--s2); border-radius: 0; }
.msel-opt .ck { width: 16px; height: 16px; flex: none; border: 1px solid var(--bd-ctl); border-radius: 3px; background: var(--s2); display: grid; place-items: center; }
.msel-opt .ck svg { width: 10px; height: 10px; stroke: transparent; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.msel-opt[aria-selected="true"] { color: var(--g); font-weight: var(--fw-medium); }
.msel-opt[aria-selected="true"] .ck { background: var(--g); border-color: var(--g); }
.msel-opt[aria-selected="true"] .ck svg { stroke: var(--g-ink); }
.msel-opt i { margin-left: auto; color: var(--dim); font: var(--fs-2xs) var(--mono); }
.msel-opt[aria-selected="true"] i { color: var(--g2); }
.adv-foot { display: flex; justify-content: flex-end; gap: var(--sp-2); margin-top: 14px; }

.active {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--bd); background: var(--s1); border-radius: 10px;
}
.rcount { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--g); white-space: nowrap; }
.atags { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.atag {
  display: inline-flex; align-items: center; gap: var(--sp-1); background: rgba(var(--g-rgb), .1); border: 1px solid rgba(var(--g-rgb), .4);
  color: var(--fg); border-radius: var(--r-sm); padding: 1px 3px 1px var(--sp-2); font-size: var(--fs-sm); max-width: 100%;
}
.atag b { color: var(--dim); font-weight: var(--fw-semibold); }
.atag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: var(--fs-xs); }
.atag button { position: relative; border: 0; background: none; color: var(--mut); width: 22px; height: 22px; border-radius: var(--r-xs); line-height: 1; font-size: var(--fs-2xs); padding: 0; }
.atag button::after { content: ""; position: absolute; inset: -11px; } /* 44px hit area */
.atag button:hover { color: var(--fg); background: rgba(var(--g-rgb), .2); }
.linkbtn { position: relative; background: none; border: 0; color: var(--g); font-weight: var(--fw-semibold); font-size: var(--fs-sm); padding: var(--sp-1) 6px; border-radius: var(--r-sm); white-space: nowrap; }
.linkbtn::after { content: ""; position: absolute; inset: -9px -2px; }
.linkbtn:hover { background: rgba(var(--g-rgb), .1); }
.linkbtn:active { background: rgba(var(--g-rgb), .18); }
.linkbtn.danger { color: var(--red); }
.linkbtn.danger:hover { background: rgba(var(--red-rgb), .1); }

/* ---- sort tabs + suffix chips ---- */
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--bd); }
.tabs::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent; padding: 0 14px; min-height: 42px;
  color: var(--mut); font-weight: var(--fw-semibold); white-space: nowrap; margin-bottom: -1px; transition: color var(--dur-1), background var(--dur-1);
}
.tab:hover { color: var(--fg); background: rgba(var(--g-rgb), .05); }
.tab:active { background: rgba(var(--g-rgb), .1); }
.tab.on { color: var(--g); border-bottom-color: var(--g); }
.tab:focus-visible { outline-offset: -3px; }
.tabs .sp { flex: 1; min-width: 10px; }
.tabs .grp { color: var(--dim); font: var(--fs-2xs) var(--mono); align-self: center; padding: 0 var(--sp-2); letter-spacing: .12em; }
.tld-toolbar { display: block; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tld-more { display: none; }
.chip-btn {
  position: relative; isolation: isolate; flex: none; background: none; border: 0; padding: 4px 10px; color: var(--mut);
  font: var(--fs-sm) var(--mono); transition: color var(--dur-1);
}
.chip-btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--s2); border: 1px solid var(--bd); border-radius: var(--r-sm);
  transition: background var(--dur-1), border-color var(--dur-1);
}
.chip-btn i { font-style: normal; color: var(--dim); margin-left: 5px; }
.chip-btn:hover { color: var(--fg); }
.chip-btn:hover::before { border-color: var(--bd-ctl); }
.chip-btn:active::before { background: var(--s3); }
.chip-btn.on { color: var(--g); }
.chip-btn.on::before { background: rgba(var(--g-rgb), .12); border-color: rgba(var(--g-rgb), .55); }
.chip-btn.on i { color: var(--g2); }
.chip-btn:focus-visible { outline-offset: 1px; }

/* source + sale type badges on every row */
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: var(--sp-1); }
.pill {
  display: inline-flex; align-items: center; gap: 5px; border-radius: var(--r-xs); padding: 1px 6px;
  font: var(--fw-bold) var(--fs-2xs)/1.5 var(--mono); letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
  transition: opacity .4s ease, transform .4s ease;
}
.pill.new { background: rgba(var(--g-rgb), .14); color: var(--g); border: 1px solid rgba(var(--g-rgb), .5); }
.pill.new::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--g); animation: blink 1.4s infinite; }
.pill.test { background: var(--banner-bg); color: var(--banner-fg); border: 1px solid var(--banner-line); }
.pill.gone { opacity: 0; transform: scale(.7); }
.pill.tier { border: 1px solid var(--bd2); color: var(--silver); background: var(--s3); letter-spacing: .02em; text-transform: none; }
.pill.tier[data-tier="2"] { color: var(--amber); border-color: rgba(var(--amber-rgb), .55); background: rgba(var(--amber-rgb), .1); }
.pill.tier[data-tier="3"] { color: var(--g); border-color: rgba(var(--g-rgb), .6); background: rgba(var(--g-rgb), .12); }
.pill.tag { border: 1px solid var(--bd2); background: var(--s3); color: var(--mut); text-transform: none; letter-spacing: .01em; font-weight: var(--fw-semibold); }
.pill.tag.st-auction_ended { color: var(--amber); border-color: rgba(var(--amber-rgb), .5); background: rgba(var(--amber-rgb), .09); }
.pill.tag.st-bin { color: var(--g); border-color: rgba(var(--g-rgb), .45); background: rgba(var(--g-rgb), .08); }
.pill.tag.st-report { border-style: dashed; }

/* ---- table ---- */
.table { border: 1px solid var(--bd); border-radius: var(--r-lg); overflow: hidden; background: var(--s1); }
.th, .item {
  display: grid; grid-template-columns: 54px minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, .95fr) 150px 76px;
  align-items: center; gap: 0 var(--sp-3); padding: 0 var(--sp-4);
}
.th { height: 36px; background: var(--s2); color: var(--dim); font-size: var(--fs-2xs); letter-spacing: var(--ls-caps); text-transform: uppercase; font-weight: var(--fw-semibold); border-bottom: 1px solid var(--bd); }
.th .r { text-align: right; }
.feed { list-style: none; margin: 0; padding: 0; transition: opacity var(--dur-2); }
.feed.is-loading { opacity: .55; }
.item { position: relative; min-height: 62px; padding-top: 9px; padding-bottom: 9px; border-bottom: 1px solid var(--bd); transition: background var(--dur-1); }
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--s2); }
.item:has(.ex) { cursor: pointer; }
.item:has(.ex):focus-within { background: var(--s2); }
.rank-num { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--dim); }
.rank-num.lead { color: var(--amber); }
.dcell { min-width: 0; }
.name { font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: -.005em; line-height: var(--lh-snug); overflow-wrap: anywhere; }
.flags { display: inline-flex; gap: 6px; vertical-align: middle; margin-left: var(--sp-2); align-items: center; flex-wrap: wrap; }
.reposts { margin-top: 3px; }
.reposts-btn { position: relative; background: none; border: 0; padding: 0; color: var(--mut); font-size: var(--fs-xs); text-align: left; border-radius: var(--r-xs); }
.reposts-btn::after { content: ""; position: absolute; inset: -12px -4px; }
.reposts-btn:hover { color: var(--g); text-decoration: underline; text-underline-offset: 3px; }
.reposts-list {
  list-style: none; margin: 6px 0 0; padding: var(--sp-2) 10px; background: var(--s3); border: 1px solid var(--bd);
  border-radius: var(--r-sm); display: flex; flex-direction: column; gap: 6px;
}
.repost { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) 10px; font-size: var(--fs-xs); color: var(--mut); }
.repost .seller { color: var(--fg); }
.repost .time { font-size: var(--fs-xs); }
.chip { border: 1px solid var(--bd2); background: var(--s2); color: var(--mut); border-radius: var(--r-xs); padding: 0 6px; font-size: var(--fs-xs); }

.price { font-size: 17px; font-weight: var(--fw-bold); line-height: 1.3; text-align: right; white-space: nowrap; letter-spacing: var(--ls-num); }
.plat, .sell, .time { font-size: var(--fs-sm); color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sell { color: var(--fg); }
.time { font-size: var(--fs-xs); }
.time .ago { display: block; color: var(--dim); font-size: var(--fs-2xs); }
.time.date-only { align-self: center; }
.src {
  position: relative; justify-self: end; text-decoration: none; color: var(--g); font-weight: var(--fw-semibold); font-size: var(--fs-sm);
  border: 1px solid rgba(var(--g-rgb), .4); border-radius: var(--r-sm); padding: 3px 9px; white-space: nowrap; transition: background var(--dur-1);
}
.src::after { content: ""; position: absolute; inset: -10px -4px; }
.src:hover { background: rgba(var(--g-rgb), .12); }
.src:active { background: rgba(var(--g-rgb), .2); }
.ex {
  display: none; grid-column: 1 / -1; margin: var(--sp-2) 0 0; padding: var(--sp-2) 10px; background: var(--s3);
  border-left: 2px solid var(--g2); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--mut); font-size: var(--fs-sm); line-height: var(--lh-base);
  white-space: pre-wrap; word-break: break-word;
}
.item.open .ex { display: block; }

/* ---- price tiers: silver / gold / green glow ---- */
.item.tier-1::before, .item.tier-2::before, .item.tier-3::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.item.tier-1::before { background: var(--silver); }
.item.tier-1 .price { color: var(--tier1-price); }
.item.tier-2 { background: linear-gradient(90deg, rgba(var(--amber-rgb), .11), rgba(var(--amber-rgb), .02) 55%, transparent); }
.item.tier-2::before { background: var(--amber); box-shadow: 0 0 14px var(--amber); }
.item.tier-2 .price { color: var(--amber); text-shadow: 0 0 18px rgba(var(--amber-rgb), .35); }
.item.tier-3 {
  background: linear-gradient(90deg, rgba(var(--g-rgb), .16), rgba(var(--g-rgb), .04) 60%, transparent);
  box-shadow: inset 0 0 0 1px rgba(var(--g-rgb), .55), 0 0 28px rgba(var(--g-rgb), .18);
  z-index: 1; animation: glow-breathe 2.6s ease-in-out infinite;
}
.item.tier-3::before { background: var(--g); box-shadow: 0 0 18px var(--g); width: 4px; }
.item.tier-3 .price { color: var(--g); text-shadow: 0 0 20px rgba(var(--g-rgb), .45); font-size: 19px; }
.item.tier-3 .name { color: var(--tier3-name); }
.item.tier-2:hover, .item.tier-3:hover { filter: brightness(1.08); }
@keyframes glow-breathe {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(var(--g-rgb), .45), 0 0 18px rgba(var(--g-rgb), .14); }
  50% { box-shadow: inset 0 0 0 1px rgba(var(--g-rgb), .7), 0 0 30px rgba(var(--g-rgb), .28); }
}

/* ---- live arrival ---- */
.item.enter { animation: enter .6s var(--ease); }
.item.flash { animation: enter .6s var(--ease), flash 3s ease-out; }
.item.tier-3.enter, .item.tier-3.flash { animation: enter .6s var(--ease), glow-breathe 2.6s ease-in-out infinite; }
@keyframes enter { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes flash { 0% { background-color: rgba(var(--g-rgb), .22); } 100% { background-color: transparent; } }

.more { display: block; width: 100%; margin: 0; border: 0; border-top: 1px solid var(--bd); background: var(--s2); min-height: var(--tap); padding: var(--sp-3); color: var(--g); font-weight: var(--fw-semibold); transition: background var(--dur-1); }
.more:hover { background: var(--s3); }
.more:active { background: var(--bd); }
.more:disabled { color: var(--mut); }

/* ---- loading skeleton, empty and error states ---- */
.sk {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); min-height: 62px; padding: 0 var(--sp-4); border-bottom: 1px solid var(--bd);
}
.sk:last-child { border-bottom: 0; }
.sk-l { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 0; }
.sk-bar {
  display: block; height: 12px; border-radius: var(--r-xs); max-width: 100%;
  background: linear-gradient(90deg, var(--skel-a) 25%, var(--skel-b) 50%, var(--skel-a) 75%); background-size: 300% 100%;
  animation: shimmer 1.5s linear infinite;
}
.sk-name { width: 34%; height: 15px; }
.sk-meta { width: 52%; height: 10px; }
.sk-price { width: 84px; height: 16px; flex: none; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.empty { padding: 36px var(--sp-5); text-align: center; color: var(--mut); margin: 0; display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); }
.empty-ico { width: 40px; height: 40px; border-radius: var(--r-lg); display: grid; place-items: center; background: var(--s2); border: 1px solid var(--bd); color: var(--dim); }
.empty-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empty-t { margin: 0; color: var(--fg); font-weight: var(--fw-semibold); font-size: var(--fs-lg); }
.empty-h { margin: 0; font-size: var(--fs-sm); max-width: 44ch; line-height: var(--lh-base); }
.empty .ghost { margin-top: var(--sp-2); }
.empty.error .empty-ico { color: var(--red); border-color: rgba(var(--red-rgb), .45); background: rgba(var(--red-rgb), .08); }

/* ---- footer ---- */
.foot {
  margin-top: 34px; padding-top: 22px; padding-bottom: calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--bd); display: flex; flex-direction: column; gap: 6px; align-items: center;
  color: var(--mut); font-size: var(--fs-sm); text-align: center;
}
.foot p { margin: 0; }
.foot-copy { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px; color: var(--fg); }
.foot-sep { color: var(--bd-ctl); }
.foot-x { color: var(--g); font-weight: var(--fw-bold); text-decoration: none; padding: 10px 4px; }
.foot-x:hover, .foot-x:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.foot-note { line-height: var(--lh-base); max-width: 70ch; }

/* ---- subscribe dialog ---- */
.dlg {
  background: var(--s1); color: var(--fg); border: 1px solid var(--bd2); border-radius: 14px; padding: 0;
  width: min(440px, calc(100vw - 24px)); box-shadow: var(--sh-pop);
}
.dlg::backdrop { background: var(--scrim); }
.dlg-in { padding: var(--sp-4); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; }
.dlg h2 { margin: 0; font-size: var(--fs-xl); letter-spacing: var(--ls-heading); }
.muted { color: var(--mut); font-size: var(--fs-sm); line-height: var(--lh-base); }
.chan { border: 1px solid var(--bd); border-radius: 10px; padding: var(--sp-3); margin-top: 10px; background: var(--s2); }
.chan h3 { margin: 0 0 var(--sp-1); font-size: var(--fs-md); }
.chan p { margin: 0 0 var(--sp-2); color: var(--mut); font-size: var(--fs-sm); line-height: var(--lh-base); }
.chan code { font: var(--fs-xs) var(--mono); background: var(--bg); color: var(--fg); padding: 2px 6px; border-radius: var(--r-sm); word-break: break-all; }
.chan .row { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }

/* ---- responsive: <= 900px is the compact / touch layout ---- */
@media (max-width: 900px) {
  .brand-svg { height: 24px; }
  .th { display: none; }
  .item {
    grid-template-columns: 30px minmax(0, 1fr) auto; grid-template-areas: "rk d p" "rk m s";
    gap: var(--sp-1) 10px; padding: var(--sp-3) 14px; min-height: 0;
  }
  .rank-num { grid-area: rk; align-self: start; padding-top: 2px; }
  .dcell { grid-area: d; }
  .price { grid-area: p; align-self: start; font-size: var(--fs-lg); }
  .plat, .sell { display: none; }
  .mrow { grid-area: m; display: flex; flex-wrap: wrap; gap: var(--sp-1) 10px; align-items: center; font-size: var(--fs-xs); color: var(--mut); min-width: 0; }
  .mrow .plat.mp { display: inline; }
  .time { display: flex; gap: 6px; overflow: visible; flex-wrap: wrap; }
  .time .ago { display: inline; }
  .src { grid-area: s; align-self: center; }
  .sk { min-height: 74px; padding: 0 14px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .wrap { padding: 0 var(--sp-3); }
  /* Compact live indicator: breathing dot only, label is sr-only so EN Subscribe still fits. */
  .status {
    margin-left: var(--sp-2); padding: 0; border: 0; background: transparent;
    min-height: 20px; gap: 0; flex: none;
  }
  .status.poll { background: transparent; border: 0; }
  .status #statusText {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
  }
  .dot { width: 8px; height: 8px; }
  .item.tier-3 .price { font-size: var(--fs-lg); }
  .searchbar { flex-wrap: wrap; }
  .sbox { flex: 1 1 100%; }
  .seg { flex: 1; }
  .seg button { flex: 1; padding: 0 6px; }
  .adv {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
    border-radius: var(--r-xl) var(--r-xl) 0 0; border-bottom: 0; padding: 14px var(--sp-4) calc(14px + env(safe-area-inset-bottom));
    box-shadow: var(--sh-pop); animation: sheet .22s var(--ease);
  }
  .adv-grid { grid-template-columns: 1fr; }
  .adv-head h2 { font-size: var(--fs-sm); }
  .adv-head .icon-btn { height: var(--tap); min-width: var(--tap); }
  .adv-foot { position: sticky; bottom: calc(-14px - env(safe-area-inset-bottom)); margin: 14px calc(-1 * var(--sp-4)) calc(-14px - env(safe-area-inset-bottom)); padding: 10px var(--sp-4) calc(10px + env(safe-area-inset-bottom)); background: var(--s1); border-top: 1px solid var(--bd); }
  .adv-foot .cta { flex: 1; }
  .adv-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 65; background: var(--scrim); }
  body.adv-open { overflow: hidden; }
  .fld input, .fld select, .msel-btn, .sbox input { font-size: var(--fs-lg); }
  .fld label { font-size: var(--fs-sm); }
  .msel-menu { position: static; margin-top: 6px; max-height: none; box-shadow: none; width: 100%; }
  .msel-opt { min-height: var(--tap); font-size: 15px; }
  .tab { min-height: var(--tap); }
  .tld-more { display: none !important; }
  .chips, .chips.is-collapsed, .chips.is-expanded { flex-wrap: nowrap; overflow-x: auto; max-height: none; padding-bottom: 0; }
  .chip-btn { min-height: var(--tap); padding: 0 14px; }
  .chip-btn::before { inset: 7px 0; }
  .tld-toolbar { min-height: var(--tap); }
  .foot-x { padding: 14px 8px; }
}
@keyframes sheet { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 901px) {
  #advDone { display: none; }
  .mrow { display: contents; }
  .mrow .plat.mp { display: none; }
  .tld-toolbar { display: flex; align-items: flex-end; gap: var(--sp-2); min-height: 62px; }
  .chips { flex: 1; min-width: 0; flex-wrap: wrap; overflow: hidden; padding-bottom: 0; }
  .chips.is-collapsed { max-height: var(--tld-collapsed, 4.1em); overflow: hidden; }
  .tld-more {
    display: inline-flex; align-items: center; flex: none; background: var(--s2); border: 1px solid var(--bd); border-radius: var(--r-sm);
    padding: var(--sp-1) var(--sp-3); color: var(--g); font: var(--fw-semibold) var(--fs-sm) var(--mono); white-space: nowrap; min-height: 30px;
    transition: background var(--dur-1), border-color var(--dur-1);
  }
  .tld-more:hover { border-color: rgba(var(--g-rgb), .5); background: rgba(var(--g-rgb), .1); }
  .tld-more:active { background: rgba(var(--g-rgb), .18); }
  .tld-more[aria-expanded="true"] { color: var(--fg); }
}
@media (max-width: 420px) {
  .brand-svg { height: 20px; }
  h1 { font-size: 22px; }
  .stat { padding: var(--sp-3) 14px; }
  .stat .v { font-size: 20px; }
  .name { font-size: 15px; }
  .actions { gap: 6px; }
  .cta { padding: 0 var(--sp-3); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .ticker { overflow-x: auto; }
  .sk-bar { background: var(--skel-a); }
}
@media (forced-colors: active) {
  .item.tier-1::before, .item.tier-2::before, .item.tier-3::before { background: Highlight; }
  .chip-btn::before { border-color: ButtonText; }
  .chip-btn.on::before { border-color: Highlight; border-width: 2px; }
}
