/* ==========================================================================
   AdAtlas — iridescent glass UI
   Dark-first. Tokens are declared once on :root (dark), then redefined for
   light under prefers-color-scheme and the explicit data-theme stamps.
   Components read tokens only.
   ========================================================================== */
:root {
  --bg: #07070C;
  --bg-2: #0D0D16;
  --surface: rgba(255, 255, 255, .04);
  --surface-2: rgba(255, 255, 255, .075);
  --card-solid: #10101A;
  --pop: #151521;
  --nav-bg: rgba(12, 12, 20, .62);
  --finder-bg: rgba(10, 10, 18, .44);
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .17);
  --ink: #F5F4FB;
  --ink-2: #CBC9DA;
  --muted: #908EA6;
  --field: #E9EDF8;
  --field-2: #DCE2F2;
  --field-ink: #10101A;
  --field-muted: #5F6274;
  --field-on: #0A0A12;        /* selected pill on the pale field; fields stay pale in both themes */
  --field-on-ink: #FFFFFF;
  --cta: #FFFFFF;
  --cta-ink: #0A0A12;
  --cta-hover: #E3E8F6;
  --free: #4ADE80;
  --free-bg: rgba(74, 222, 128, .13);
  --paid: #FBBF24;
  --paid-bg: rgba(251, 191, 36, .13);
  --both: #5EEAD4;
  --star: #FBBF24;
  --ring: #B9A8FF;
  --iris: linear-gradient(100deg, #8B6CFF 0%, #4F8DF9 32%, #F472B6 66%, #FB923C 100%);
  --stage-fade: linear-gradient(90deg, rgba(7, 7, 12, .84) 0%, rgba(7, 7, 12, .46) 36%, rgba(7, 7, 12, 0) 76%);
  --stage-fallback:
    radial-gradient(520px 380px at 78% 28%, rgba(139, 108, 255, .50), transparent 70%),
    radial-gradient(460px 340px at 94% 78%, rgba(251, 146, 60, .40), transparent 70%),
    radial-gradient(420px 320px at 58% 92%, rgba(79, 141, 249, .38), transparent 70%),
    radial-gradient(300px 240px at 66% 40%, rgba(244, 114, 182, .30), transparent 70%);
  --glow-a: rgba(124, 92, 255, .16);
  --glow-b: rgba(251, 146, 60, .09);
  --code-bg: rgba(255, 255, 255, .05);
  --code-ink: #D9D6EA;
  --backdrop: rgba(4, 4, 10, .66);
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, .85);
  --shadow-sm: 0 12px 32px -16px rgba(0, 0, 0, .75);
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --font-display: "Sora", "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F3F2F8;
    --bg-2: #FFFFFF;
    --surface: rgba(255, 255, 255, .80);
    --surface-2: #FFFFFF;
    --card-solid: #FFFFFF;
    --pop: #FFFFFF;
    --nav-bg: rgba(255, 255, 255, .72);
    --finder-bg: rgba(255, 255, 255, .68);
    --line: rgba(22, 20, 45, .10);
    --line-2: rgba(22, 20, 45, .19);
    --ink: #0B0A14;
    --ink-2: #3A3850;
    --muted: #6B6882;
    --field: #ECEEF7;
    --field-2: #DFE3F1;
    --field-ink: #0B0A14;
    --field-muted: #666A80;
    --cta: #0A0A12;
    --cta-ink: #FFFFFF;
    --cta-hover: #26253B;
    --free: #15803D;
    --free-bg: #DCFCE7;
    --paid: #B45309;
    --paid-bg: #FEF3C7;
    --both: #0F766E;
    --star: #D97706;
    --ring: #5B3DF0;
    --iris: linear-gradient(100deg, #6D4CFF 0%, #2F6FEB 32%, #E0489B 66%, #F0791F 100%);
    --stage-fade: linear-gradient(90deg, rgba(255, 255, 255, .90) 0%, rgba(255, 255, 255, .58) 40%, rgba(255, 255, 255, .04) 100%);
    --stage-fallback:
      radial-gradient(520px 380px at 78% 28%, rgba(167, 139, 250, .42), transparent 70%),
      radial-gradient(460px 340px at 94% 78%, rgba(253, 186, 116, .46), transparent 70%),
      radial-gradient(420px 320px at 58% 92%, rgba(147, 197, 253, .50), transparent 70%),
      radial-gradient(300px 240px at 66% 40%, rgba(249, 168, 212, .40), transparent 70%);
    --glow-a: rgba(124, 92, 255, .10);
    --glow-b: rgba(251, 146, 60, .10);
    --code-bg: #11101C;
    --code-ink: #E8E6F5;
    --backdrop: rgba(20, 18, 40, .38);
    --shadow: 0 30px 70px -34px rgba(40, 30, 90, .38);
    --shadow-sm: 0 12px 28px -16px rgba(40, 30, 90, .30);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #F3F2F8;
  --bg-2: #FFFFFF;
  --surface: rgba(255, 255, 255, .80);
  --surface-2: #FFFFFF;
  --card-solid: #FFFFFF;
  --pop: #FFFFFF;
  --nav-bg: rgba(255, 255, 255, .72);
  --finder-bg: rgba(255, 255, 255, .68);
  --line: rgba(22, 20, 45, .10);
  --line-2: rgba(22, 20, 45, .19);
  --ink: #0B0A14;
  --ink-2: #3A3850;
  --muted: #6B6882;
  --field: #ECEEF7;
  --field-2: #DFE3F1;
  --field-ink: #0B0A14;
  --field-muted: #666A80;
  --cta: #0A0A12;
  --cta-ink: #FFFFFF;
  --cta-hover: #26253B;
  --free: #15803D;
  --free-bg: #DCFCE7;
  --paid: #B45309;
  --paid-bg: #FEF3C7;
  --both: #0F766E;
  --star: #D97706;
  --ring: #5B3DF0;
  --iris: linear-gradient(100deg, #6D4CFF 0%, #2F6FEB 32%, #E0489B 66%, #F0791F 100%);
  --stage-fade: linear-gradient(90deg, rgba(255, 255, 255, .90) 0%, rgba(255, 255, 255, .58) 40%, rgba(255, 255, 255, .04) 100%);
  --stage-fallback:
    radial-gradient(520px 380px at 78% 28%, rgba(167, 139, 250, .42), transparent 70%),
    radial-gradient(460px 340px at 94% 78%, rgba(253, 186, 116, .46), transparent 70%),
    radial-gradient(420px 320px at 58% 92%, rgba(147, 197, 253, .50), transparent 70%),
    radial-gradient(300px 240px at 66% 40%, rgba(249, 168, 212, .40), transparent 70%);
  --glow-a: rgba(124, 92, 255, .10);
  --glow-b: rgba(251, 146, 60, .10);
  --code-bg: #11101C;
  --code-ink: #E8E6F5;
  --backdrop: rgba(20, 18, 40, .38);
  --shadow: 0 30px 70px -34px rgba(40, 30, 90, .38);
  --shadow-sm: 0 12px 28px -16px rgba(40, 30, 90, .30);
  color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html:has(dialog[open]) { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.wrap { max-width: 1240px; margin-inline: auto; padding-inline: 24px; }
.label { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
section[id], header[id] { scroll-margin-top: 92px; }

.ambient {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(700px 500px at 8% -6%, var(--glow-a), transparent 70%),
    radial-gradient(800px 560px at 104% 108%, var(--glow-b), transparent 70%);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid transparent; background: transparent;
  font-weight: 600; font-size: 13.5px; letter-spacing: .01em; text-decoration: none; white-space: nowrap; color: var(--ink);
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.btn-cta { background: var(--cta); color: var(--cta-ink); }
.btn-cta:hover { background: var(--cta-hover); }
.btn-line { border-color: var(--line-2); }
.btn-line:hover { background: var(--surface-2); }
.btn-quiet { color: var(--ink-2); padding: 0 10px; }
.btn-quiet:hover { color: var(--ink); background: var(--surface-2); }
.btn-icon { width: 40px; padding: 0; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-sm.btn-icon { width: 34px; padding: 0; }
.star[aria-pressed="true"] { color: var(--star); border-color: var(--star); }
.star[aria-pressed="true"] svg { fill: currentColor; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 12px; z-index: 40; padding-top: 12px; }
.nav-inner {
  display: flex; align-items: center; gap: 18px; padding: 8px 8px 8px 14px; border-radius: 999px;
  background: var(--nav-bg); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
  position: relative;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: 0 0 auto; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: .01em; }
.nav-links { display: flex; gap: 4px; margin-inline: auto; }
.nav-links a {
  text-decoration: none; font-size: 14px; font-weight: 500; color: var(--ink-2); padding: 8px 12px; border-radius: 999px; position: relative;
}
.nav-links a:hover { color: var(--ink); background: var(--surface-2); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--iris); }
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-links + .nav-actions { margin-left: 0; }
.count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line-2); font: 500 11px/1 var(--font-mono);
}
.count.has { background: var(--star); color: #1A1200; border-color: transparent; }
.menu-btn { display: none; }
.ico-star, .ico-pen { display: inline-flex; }

/* ---------- stage (hero) ---------- */
.stage {
  position: relative; z-index: 5; isolation: isolate; margin-top: 18px; border-radius: var(--r-xl);
  border: 1px solid var(--line-2); background: var(--stage-fallback), var(--bg-2); box-shadow: var(--shadow);
}
#flow {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; border-radius: inherit; display: block;
  opacity: 0; transition: opacity .9s ease;
}
#flow.on { opacity: 1; }
.stage::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--stage-fade); }
.stage-grid {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(330px, 430px); gap: clamp(24px, 4vw, 56px); align-items: center;
  padding: clamp(22px, 4vw, 56px); min-height: 560px;
}
.hero-copy { display: grid; gap: 18px; align-content: center; min-width: 0; }
.eyebrow-chip {
  justify-self: start; display: inline-flex; align-items: center; gap: 9px; padding: 6px 12px 6px 10px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.eyebrow-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--iris); box-shadow: 0 0 0 3px var(--surface-2); flex: 0 0 auto; }
.eyebrow-chip b { color: var(--ink); font-weight: 600; }
.hero-copy h1 {
  font-family: var(--font-display); font-weight: 600; letter-spacing: -.015em; line-height: 1.06;
  font-size: clamp(30px, 4.5vw, 56px); text-wrap: balance; max-width: 15ch;
}
.iris-text { background: var(--iris); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: clamp(15px, 1.3vw, 17px); color: var(--ink-2); max-width: 56ch; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.quick .label { margin-right: 4px; }
.qchip {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 8px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 500;
}
.qchip:hover { color: var(--ink); background: var(--surface-2); }
.qchip[aria-pressed="true"] { background: var(--cta); color: var(--cta-ink); border-color: var(--cta); }
.detected { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.detected svg { width: 14px; height: 14px; flex: 0 0 auto; }
.detected button { border: 0; background: none; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }

/* ---------- finder (glass form) ---------- */
.finder {
  display: grid; gap: 14px; padding: 24px; border-radius: var(--r-lg); min-width: 0;
  background: var(--finder-bg); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
}
.finder h2 { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: .02em; text-align: center; text-wrap: balance; line-height: 1.25; }
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.mode-tabs button { height: 36px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.mode-tabs button:hover { color: var(--ink); }
.mode-tabs button[aria-selected="true"] { background: var(--cta); color: var(--cta-ink); }
.search-field {
  display: flex; align-items: center; gap: 9px; height: 50px; padding: 0 12px 0 14px; border-radius: var(--r-sm);
  background: var(--field); color: var(--field-ink); border: 1px solid transparent; cursor: text;
}
.search-field:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 28%, transparent); }
.search-field svg { width: 19px; height: 19px; color: var(--field-muted); flex: 0 0 auto; }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--field-ink); font-size: 15px; }
.search-field input::placeholder { color: var(--field-muted); }
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.kbd { font: 500 11px/1 var(--font-mono); color: var(--field-muted); border: 1px solid rgba(16, 16, 26, .22); border-radius: 6px; padding: 4px 7px; }
.search-field:focus-within .kbd { display: none; }
.clear { border: 0; background: transparent; color: var(--field-muted); padding: 5px; border-radius: 8px; display: inline-flex; }
.clear:hover { color: var(--field-ink); background: var(--field-2); }
.understood { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.u-chip { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-2); }
.finder-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
.field { display: grid; gap: 6px; min-width: 0; }
.cta {
  height: 52px; width: 100%; border: 0; border-radius: 999px; background: var(--cta); color: var(--cta-ink);
  font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: .03em; transition: background .18s ease, transform .18s ease;
}
.cta:hover { background: var(--cta-hover); }
.cta:active { transform: scale(.985); }
.finder-note { font-size: 12.5px; color: var(--muted); text-align: center; text-wrap: balance; }

/* picker */
.picker { position: relative; min-width: 0; }
.picker-btn {
  width: 100%; height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 12px; text-align: left;
  border-radius: var(--r-sm); border: 1px solid transparent; background: var(--field); color: var(--field-ink); font-size: 14.5px;
}
.picker-btn:hover { background: var(--field-2); }
.picker-btn[aria-expanded="true"] { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 28%, transparent); }
.picker-btn .val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.picker-btn .val.placeholder { color: var(--field-muted); font-weight: 400; }
.picker-btn .chev { width: 16px; height: 16px; color: var(--field-muted); flex: 0 0 auto; }
.pk-icon { display: inline-flex; align-items: center; flex: 0 0 auto; }
.picker-panel {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: max(100%, 290px); max-width: calc(100vw - 32px);
  display: grid; gap: 6px; padding: 8px; border-radius: var(--r-md); background: var(--pop); color: var(--ink);
  border: 1px solid var(--line-2); box-shadow: var(--shadow);
}
.picker.align-right .picker-panel { left: auto; right: 0; }
.picker-panel input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; outline: 0;
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line);
}
.picker-panel input:focus { border-color: var(--ring); }
.picker-panel input::placeholder { color: var(--muted); }
.picker-list { max-height: 300px; overflow: auto; margin: 0; padding: 0; list-style: none; scrollbar-width: thin; }
.picker-list .group { padding: 9px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.picker-list li[role="option"] { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 14.5px; }
.picker-list li[role="option"]:hover, .picker-list li.active { background: var(--surface-2); }
.picker-list li[aria-selected="true"] { font-weight: 600; }
.picker-list li[aria-selected="true"]::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--iris); flex: 0 0 auto; }
.picker-list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-list .n { font: 400 12px/1 var(--font-mono); color: var(--muted); }
.picker-list .empty { padding: 12px 10px; color: var(--muted); font-size: 14px; }
.flag {
  position: relative; display: inline-grid; place-items: center; width: 24px; height: 17px; border-radius: 4px; overflow: hidden; flex: 0 0 auto;
  background: rgba(127, 127, 150, .22); font: 700 9px/1 var(--font-body); letter-spacing: .04em;
}
.flag img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.flag.flag-world { background: transparent; }
.flag.flag-world svg { width: 17px; height: 17px; }

/* segmented */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 3px; border-radius: var(--r-sm); background: var(--field); height: 46px; }
.seg label { position: relative; display: grid; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--field-muted); white-space: nowrap; padding: 0 8px; }
.seg input:checked + span { background: var(--field-on); color: var(--field-on-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 1px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.dot-free { background: #22C55E; }
.dot-paid { background: #F59E0B; }
.seg.seg-sm { height: 36px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; }
.seg.seg-sm span { border-radius: 999px; color: var(--ink-2); font-weight: 500; font-size: 13px; padding: 0 12px; }
.seg.seg-sm input:checked + span { background: var(--cta); color: var(--cta-ink); }

/* ---------- filters ---------- */
.filters { margin-top: 22px; display: grid; gap: 12px; padding: 16px 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.filters-row { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; }
.filters-end { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.summary-side { display: grid; gap: 12px; justify-items: end; width: min(360px, 100%); }
.summary-side .mix { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips .label { margin-right: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.chip:hover { color: var(--ink); background: var(--surface-2); }
.chip .n { font: 400 11px/1 var(--font-mono); color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--cta); color: var(--cta-ink); border-color: var(--cta); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: .65; }
.chip:disabled { opacity: .35; cursor: not-allowed; }
.sort { display: inline-flex; align-items: center; gap: 8px; }
.sort select {
  height: 36px; padding: 0 30px 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); font-size: 13px;
  -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px; background-size: 5px 5px; background-repeat: no-repeat;
}
.sort select option { background: var(--pop); color: var(--ink); }
.view-toggle { display: inline-flex; gap: 4px; }
.view-toggle .btn { height: 36px; width: 36px; }
.view-toggle .btn[aria-pressed="true"] { background: var(--cta); color: var(--cta-ink); border-color: var(--cta); }

/* ---------- summary ---------- */
.summary { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 28px; flex-wrap: wrap; margin: 34px 0 18px; }
.summary h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(20px, 2.4vw, 28px); letter-spacing: -.005em; line-height: 1.2; text-wrap: balance; }
.summary h2 b { background: var(--iris); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.summary .meta { margin-top: 6px; color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 0; }
.summary .meta span + span::before { content: "·"; margin: 0 8px; opacity: .6; }
.mix { width: min(340px, 100%); display: grid; gap: 7px; }
.mix-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.mix-bar i { display: block; height: 100%; min-width: 3px; border-radius: 999px; }
.mix-bar .f { background: var(--free); } .mix-bar .b { background: var(--both); } .mix-bar .p { background: var(--paid); }
.mix-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mix-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mix-legend i { width: 8px; height: 8px; border-radius: 50%; }
.mix-legend b { color: var(--ink-2); font-weight: 600; }

/* ---------- results ---------- */
.section { margin-bottom: 34px; }
.section-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--iris); }
.eyebrow.global::before { background: var(--muted); }
.section-head .n { font: 400 12px/1 var(--font-mono); color: var(--muted); }
.section-head .desc { flex-basis: 100%; color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }

.card {
  position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 18px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--surface);
  transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--line-2); background: var(--surface-2); box-shadow: var(--shadow-sm); }
.card.top { border-color: transparent; background: linear-gradient(var(--card-solid), var(--card-solid)) padding-box, var(--iris) border-box; }
.card-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar {
  position: relative; width: 46px; height: 46px; border-radius: 14px; flex: 0 0 auto; overflow: hidden; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px; color: #FFFFFF; letter-spacing: -.01em;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 9px; background: #FFFFFF; }
.avatar.sm { width: 38px; height: 38px; border-radius: 11px; font-size: 13px; }
.avatar.sm img { padding: 7px; }
.card-title { min-width: 0; flex: 1; }
.card-title h3 { font-size: 16px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.card-title .domain { font: 400 12px/1.5 var(--font-mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-pick { display: inline-block; margin-bottom: 3px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; background: var(--iris); -webkit-background-clip: text; background-clip: text; color: transparent; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.free { background: var(--free-bg); color: var(--free); }
.badge.paid { background: var(--paid-bg); color: var(--paid); }
.badge.type { background: var(--surface-2); color: var(--ink-2); font-weight: 500; }
.badge.scope { border: 1px solid var(--line-2); color: var(--muted); font-weight: 500; }
.reach { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; margin-left: auto; }
.reach i { display: block; width: 4px; border-radius: 1px; background: var(--line-2); }
.reach i.on { background: var(--ink-2); }
.card p { color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { padding: 2px 9px; border-radius: 999px; font-size: 12px; color: var(--muted); border: 1px solid var(--line); }
.tag.hit { color: var(--ink); border-color: var(--line-2); background: var(--surface-2); font-weight: 600; }
.card-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.meta-row { flex-basis: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.meta-row .who { font-size: 12px; color: var(--muted); }
.reach-wrap { display: inline-flex; align-items: center; gap: 7px; }
.reach-wrap .label { font-size: 10px; }
.card-foot .push { margin-left: auto; display: inline-flex; gap: 6px; }
.btn-search { max-width: 100%; overflow: hidden; }
.btn-search span { overflow: hidden; text-overflow: ellipsis; }

/* list view */
.rows { display: grid; gap: 8px; }
.rowitem {
  display: grid; grid-template-columns: 38px minmax(0, 1.5fr) minmax(0, 1.4fr) auto; gap: 14px; align-items: center;
  padding: 10px 12px 10px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface);
}
.rowitem:hover { border-color: var(--line-2); background: var(--surface-2); }
.rowitem.top { border-color: transparent; background: linear-gradient(var(--card-solid), var(--card-solid)) padding-box, var(--iris) border-box; }
.rowitem .r-name { min-width: 0; }
.rowitem .r-name b { display: block; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowitem .r-name span { display: block; font: 400 12px/1.4 var(--font-mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowitem .r-actions { display: inline-flex; gap: 6px; align-items: center; }
.more-row { display: flex; justify-content: center; margin-top: 16px; }

.empty { border: 1px dashed var(--line-2); border-radius: 20px; padding: 24px; color: var(--ink-2); background: var(--surface); display: grid; gap: 8px; justify-items: start; }
.empty h3 { font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.empty p { font-size: 14px; max-width: 70ch; }

/* ---------- panels: discover / safety / embed ---------- */
.panel { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: clamp(18px, 2.4vw, 26px); margin-bottom: 22px; }
.panel-head { display: grid; gap: 4px; margin-bottom: 16px; }
.panel-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: -.005em; }
.panel-head p { color: var(--muted); font-size: 14px; max-width: 78ch; }
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 8px; }
.link {
  display: flex; align-items: center; gap: 11px; min-width: 0; padding: 11px 13px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: transparent; text-decoration: none; color: var(--ink);
}
.link:hover { border-color: var(--line-2); background: var(--surface-2); }
.link .ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; font: 700 11px/1 var(--font-display); color: #FFFFFF; }
.link .t { min-width: 0; flex: 1; }
.link .t b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link .t span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link svg { width: 14px; height: 14px; color: var(--muted); flex: 0 0 auto; }
.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; }
.tip { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); align-content: start; }
.tip b { font-weight: 600; font-size: 14.5px; }
.tip span { color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.embed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.codebox { display: grid; gap: 8px; min-width: 0; align-content: start; }
.label-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.codebox pre {
  margin: 0; padding: 13px 15px; border-radius: var(--r-md); background: var(--code-bg); color: var(--code-ink); border: 1px solid var(--line);
  font: 400 12.5px/1.6 var(--font-mono); overflow-x: auto; white-space: pre; max-width: 100%;
}
.embed-hint { margin-top: 12px; font-size: 13px; color: var(--muted); }

/* ---------- footer ---------- */
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px; padding-block: 22px 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); margin-top: 12px; }
.foot b { color: var(--ink-2); font-weight: 600; }
.foot a { color: var(--ink-2); }

/* ---------- dialogs ---------- */
dialog { border: 0; padding: 0; margin: auto; color: var(--ink); background: var(--pop); max-width: none; max-height: none; }
dialog::backdrop { background: var(--backdrop); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog.modal { width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border-radius: 24px; border: 1px solid var(--line-2); box-shadow: var(--shadow); overflow: auto; }
dialog.modal.wide { width: min(1040px, calc(100vw - 24px)); }
dialog.sheet { margin: 0 0 0 auto; width: min(480px, 100vw); height: 100dvh; max-height: 100dvh; border-left: 1px solid var(--line-2); border-radius: 24px 0 0 24px; box-shadow: var(--shadow); overflow: hidden; }
dialog.sheet[open] { display: grid; grid-template-rows: auto auto auto 1fr auto; }
.dlg-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 14px; }
.dlg-head .ttl { flex: 1; min-width: 0; display: grid; gap: 3px; }
.dlg-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.dlg-head .sub { color: var(--muted); font-size: 13.5px; }
.dlg-head .domain { font: 400 12.5px/1.5 var(--font-mono); color: var(--muted); }
.dlg-body { padding: 4px 22px 22px; display: grid; gap: 18px; align-content: start; }
.sheet .dlg-body { overflow: auto; padding-top: 12px; }
.dlg-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 22px 20px; border-top: 1px solid var(--line); }
.dlg-foot .push { margin-left: auto; }
.kv { display: grid; gap: 8px; }
.kv h3 { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kv p, .kv li { color: var(--ink-2); font-size: 14.5px; }
.kv ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.model { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.model .bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--iris); flex: 0 0 auto; }
.model b { display: block; font-weight: 600; }
.model span { color: var(--ink-2); font-size: 14px; }
.inline-search { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-search input {
  flex: 1 1 220px; min-width: 0; height: 44px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid transparent; outline: 0;
  background: var(--field); color: var(--field-ink);
}
.inline-search input::placeholder { color: var(--field-muted); }
.inline-search input:focus { border-color: var(--ring); }
.inline-search .btn { height: 44px; }

.progress { display: flex; align-items: center; gap: 12px; padding: 0 22px 12px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-bar i { display: block; height: 100%; border-radius: 999px; background: var(--iris); transition: width .3s ease; }
.tabs { display: flex; gap: 4px; padding: 0 22px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 10px 12px; font-size: 14px; font-weight: 600; color: var(--muted); position: relative; }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--iris); }
.check-row { display: grid; grid-template-columns: auto 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line); }
.check-row.done { opacity: .62; }
.check-row.done .r-name b { text-decoration: line-through; }
.check-row .r-name b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-row .r-name span { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.check { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-2); background: transparent; display: grid; place-items: center; padding: 0; color: transparent; }
.check[aria-checked="true"] { background: var(--free); border-color: var(--free); color: #04140A; }
.check svg { width: 14px; height: 14px; }
.list-rows { display: grid; gap: 8px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
table.cmp { border-collapse: collapse; width: 100%; font-size: 13.5px; min-width: 560px; }
table.cmp th, table.cmp td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.cmp th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; white-space: nowrap; }
table.cmp tr:last-child td { border-bottom: 0; }
table.cmp td b { font-weight: 600; }
.yes { color: var(--free); font-weight: 600; } .no { color: var(--muted); }

/* ad writer */
.writer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; align-content: start; }
.form-grid .full { grid-column: 1 / -1; }
.fld { display: grid; gap: 6px; min-width: 0; }
.fld input, .fld select, .fld textarea {
  width: 100%; min-width: 0; height: 44px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid transparent; outline: 0;
  background: var(--field); color: var(--field-ink); font-size: 14.5px;
}
.fld textarea { height: 118px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.fld input::placeholder, .fld textarea::placeholder { color: var(--field-muted); }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 28%, transparent); }
.fld select option { background: #FFFFFF; color: #10101A; }
.checkline { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.checkline input { width: 17px; height: 17px; accent-color: #7C5CFF; }
.out { display: grid; gap: 12px; align-content: start; min-width: 0; }
.out-box { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); display: grid; min-width: 0; }
.out-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--line); }
.out-head b { font-size: 13.5px; font-weight: 600; }
.out-head .cnt { font: 400 11.5px/1 var(--font-mono); color: var(--muted); margin-left: auto; }
.out-head .cnt.warn { color: var(--paid); }
.out-box pre { margin: 0; padding: 12px 14px; font: 400 14px/1.6 var(--font-body); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); max-height: 230px; overflow: auto; }
.out-box pre[dir="rtl"] { text-align: right; }

/* ---------- app store buttons ---------- */
.apps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.apps .label { margin-right: 2px; }
.store {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px 0 10px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.store:hover { background: var(--surface-2); border-color: var(--ink-2); }
.store svg { width: 14px; height: 14px; flex: 0 0 auto; }
.store.compact { width: 34px; height: 34px; padding: 0; justify-content: center; }
.getapp { display: flex; flex-wrap: wrap; gap: 12px; }
.qr-card { display: grid; gap: 10px; justify-items: center; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.qr { width: 128px; height: 128px; border-radius: 10px; background: #FFFFFF; padding: 6px; }
.qr svg { width: 100%; height: 100%; display: block; }
.hint { font-size: 13px; color: var(--muted); }

/* ---------- sector tiles ---------- */
.sectors { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.sector {
  display: grid; gap: 6px; justify-items: start; padding: 12px 14px; border-radius: var(--r-md); text-align: left; min-width: 0;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  transition: border-color .18s ease, background .18s ease;
}
.sector svg { width: 20px; height: 20px; color: var(--ink); }
.sector b { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sector span { font: 400 11.5px/1 var(--font-mono); color: var(--muted); }
.sector:hover { border-color: var(--line-2); background: var(--surface-2); }
.sector[aria-pressed="true"] { border-color: transparent; background: linear-gradient(var(--card-solid), var(--card-solid)) padding-box, var(--iris) border-box; }

/* ---------- posting plan ---------- */
.plan-link {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 14px; border-radius: 999px;
  border: 1px dashed var(--line-2); background: transparent; color: var(--ink-2); font-size: 13.5px; font-weight: 600; text-wrap: balance;
}
.plan-link:hover { color: var(--ink); border-style: solid; background: var(--surface-2); }
.plan-link svg { width: 16px; height: 16px; flex: 0 0 auto; }
.plan-grid { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 22px; }
.form-grid.one { grid-template-columns: 1fr; }
.fld select:disabled { opacity: .5; }
.plan-group { display: grid; gap: 8px; }
.plan-group h3 { display: inline-flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.plan-group h3::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--iris); }
.plan-group p { color: var(--muted); font-size: 13.5px; }
.step { display: grid; grid-template-columns: 26px 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line); }
.step .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font: 500 12px/1 var(--font-mono); color: var(--ink-2); }
.step .r-name { min-width: 0; }
.step .r-name b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step .r-name span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.step .r-actions { display: inline-flex; gap: 6px; align-items: center; }
@media (max-width: 860px) { .plan-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .sectors { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 136px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .step { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .step .avatar { display: none; }
  .qr { display: none !important; }   /* on a phone the store button is the fastest path */
  .getapp + .hint { display: none; }
}
.is-embed .sectors { margin-top: 12px; }

/* ---------- live bar: 24-hour clock, date, where the visitor is ---------- */
.live {
  justify-self: start; display: flex; align-items: center; gap: 16px; max-width: 100%; padding: 12px 18px 12px 14px; border-radius: 22px;
  border: 1px solid transparent; background: linear-gradient(var(--card-solid), var(--card-solid)) padding-box, var(--iris) border-box;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--ring) 9%, transparent), var(--shadow-sm);
}
.live-clock { display: flex; align-items: center; gap: 11px; padding-right: 16px; border-right: 1px solid var(--line-2); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--free); box-shadow: 0 0 0 4px var(--free-bg); flex: 0 0 auto; }
@media (prefers-reduced-motion: no-preference) { .live-dot { animation: livePulse 2s ease-in-out infinite; } }
@keyframes livePulse { 50% { box-shadow: 0 0 0 8px transparent; } }
.digits { display: inline-flex; align-items: baseline; gap: 5px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; line-height: 1; }
.digits b { font-weight: 500; font-size: clamp(28px, 3.200vw, 38px); letter-spacing: .03em; color: var(--ink); }
.digits i { font-style: normal; font-size: 16px; font-weight: 500; background: var(--iris); -webkit-background-clip: text; background-clip: text; color: transparent; }
.live-meta { display: grid; gap: 4px; min-width: 0; font-size: 13px; color: var(--ink-2); }
.live-date { font-weight: 600; color: var(--ink); font-size: 13.5px; }
.live-who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.live-who b { color: var(--ink); font-weight: 600; }
.live-who svg { width: 14px; height: 14px; flex: 0 0 auto; }
.live-who button { border: 0; background: none; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.live .ip { font: 500 12px/1 var(--font-mono); color: var(--ink); padding: 4px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); letter-spacing: .02em; }
.nav-clock {
  display: none; align-items: center; height: 40px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-2);
  font: 500 13px/1 var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: .05em; color: var(--ink);
}
@media (min-width: 1180px) { .nav-clock { display: inline-flex; } }
#liveBtn .live-dot { width: 7px; height: 7px; box-shadow: none; animation: none; }
#liveBtn:disabled { opacity: .6; cursor: progress; }
.st { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.st-up { background: var(--free); }
.st-slow { background: var(--paid); }
.st-down { background: transparent; box-shadow: inset 0 0 0 2px var(--muted); }
.wc-list { display: grid; gap: 6px; }
.wc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: baseline; padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--line); }
.wc-row.me { border-color: transparent; background: linear-gradient(var(--pop), var(--pop)) padding-box, var(--iris) border-box; }
.wc-row b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc-row b small { font-weight: 400; color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.wc-t { font: 500 17px/1 var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.wc-d { font-size: 12.5px; color: var(--muted); min-width: 92px; text-align: right; }

/* ---------- country facts bar ---------- */
.facts {
  margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; padding: 14px 18px; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: var(--surface);
}
.fact { display: inline-flex; align-items: baseline; gap: 8px; font-size: 14px; white-space: nowrap; }
.fact b { font-weight: 600; font-variant-numeric: tabular-nums; }
.fact.lead { align-items: center; gap: 9px; font-family: var(--font-display); font-size: 16px; padding-right: 8px; }
.fact .label { font-size: 10.5px; }

/* ---------- news ---------- */
.badge.news { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-2); }
.news-pick { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-bottom: 12px; }
.news-pick select {
  height: 38px; max-width: 100%; padding: 0 34px 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background-color: var(--surface-2); color: var(--ink); font-size: 14px; font-weight: 500;
  -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 16px, calc(100% - 13px) 16px; background-size: 5px 5px; background-repeat: no-repeat;
}
.news-pick select option { background: var(--pop); color: var(--ink); }
.news-langs { margin-bottom: 14px; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 8px; }
.news-tile { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line); }
.news-tile:hover { border-color: var(--line-2); background: var(--surface-2); }
.news-tile .r-name { min-width: 0; }
.news-tile .r-name a { text-decoration: none; }
.news-tile .r-name a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.news-tile .r-name b { display: block; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-tile .r-name span { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-tile .r-actions { display: inline-flex; gap: 6px; align-items: center; }
.news-quick { margin-top: 14px; }
.news-world { margin-top: 14px; }
a.chip { text-decoration: none; }

/* ---------- toolbox ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tool {
  display: grid; gap: 6px; justify-items: start; text-align: left; padding: 16px; border-radius: var(--r-md); min-width: 0;
  border: 1px solid var(--line); background: transparent; color: var(--ink-2); transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.tool:hover { border-color: var(--line-2); background: var(--surface-2); transform: translateY(-2px); }
.tool-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--cta-ink); background: var(--cta); margin-bottom: 4px; }
.tool-ico svg { width: 18px; height: 18px; }
.tool b { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--ink); }
.tool span:last-child { font-size: 13.5px; line-height: 1.45; }
.risk { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.risk-bar { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.risk-bar i { display: block; height: 100%; border-radius: 999px; background: var(--free); transition: width .3s ease; }
.risk.mid .risk-bar i { background: var(--paid); }
.risk.high .risk-bar i { background: #EF4444; }
.risk b { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.risk.high b { color: #EF4444; }
.risk span { font-size: 13px; color: var(--muted); }
.flag-row { display: grid; gap: 3px; padding: 11px 14px; border-radius: var(--r-md); border: 1px solid var(--line); }
.flag-row b { font-weight: 600; font-size: 14.5px; }
.flag-row span { font-size: 13.5px; color: var(--ink-2); }
.fx-form { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: end; }
.fx-form .btn-icon { height: 44px; width: 44px; }
.fx-big { display: grid; gap: 2px; padding: 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.fx-big span { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.fx-big b { font-family: var(--font-display); font-weight: 600; font-size: clamp(24px, 4vw, 34px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fx-out { display: grid; gap: 10px; }
.mic.live { color: #EF4444; }
.foot-right { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.credit { font-family: var(--font-display); font-weight: 600; font-size: 13px; letter-spacing: .02em; padding: 5px 12px; border-radius: 999px; color: var(--ink); border: 1px solid transparent; background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--iris) border-box; }
@media (max-width: 600px) {
  .facts { gap: 8px 18px; padding: 12px 14px; }
  .fx-form { grid-template-columns: 1fr 1fr; }
  .fx-form .fld:first-child { grid-column: 1 / -1; }
  .fx-form .btn-icon { display: none; }
  .news-grid { grid-template-columns: 1fr; }
  .live { flex-direction: column; align-items: flex-start; gap: 10px; width: 100%; border-radius: 18px; }
  .lede { display: none; }   /* the search form should be close to the top on a phone */
  .live-clock { border-right: 0; padding-right: 0; }
  .wc-row { grid-template-columns: minmax(0, 1fr) auto; }
  .wc-d { grid-column: 1 / -1; text-align: left; min-width: 0; }
}
.is-embed .tools, .is-embed .news-world { display: none !important; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100; transform: translate(-50%, 10px); opacity: 0; pointer-events: none;
  padding: 11px 18px; border-radius: 999px; background: var(--cta); color: var(--cta-ink); font-size: 14px; font-weight: 600; box-shadow: var(--shadow);
  transition: opacity .2s ease, transform .2s ease; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- embed (compact) mode ---------- */
.is-embed .ambient, .is-embed .hero-copy, .is-embed .safety, .is-embed .embed, .is-embed .nav-links, .is-embed .menu-btn { display: none !important; }
.is-embed .nav { position: static; padding-top: 8px; }
.is-embed .stage { margin-top: 10px; }
.is-embed .stage-grid { grid-template-columns: 1fr; min-height: 0; padding: 14px; }
.is-embed .finder { padding: 18px; }
.is-embed .finder h2, .is-embed .finder-note { display: none; }
.is-embed .finder-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.is-embed .foot { padding-block: 14px 18px; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .stage-grid { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy h1 { max-width: 20ch; }
  .is-embed .finder-fields { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .nav-links {
    display: none; position: absolute; top: calc(100% + 8px); right: 0; left: 0; margin: 0; padding: 8px; flex-direction: column; gap: 2px;
    background: var(--pop); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 14px; }
  .nav-links a.active::after { display: none; }
  .menu-btn { display: inline-flex; }
  .nav-actions { margin-left: auto; }
  .writer { grid-template-columns: 1fr; }
  .embed-grid { grid-template-columns: 1fr; }
  .rowitem { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .rowitem .badges { grid-column: 2 / -1; grid-row: 2; }
}
@media (max-width: 600px) {
  .wrap { padding-inline: 16px; }
  .hide-sm { display: none; }
  .nav-inner { gap: 6px; padding: 7px 7px 7px 9px; }
  .nav-actions { gap: 6px; }
  .nav-actions .btn { height: 38px; }
  .nav-actions .btn-icon { width: 38px; }
  .brand { gap: 8px; }
  .brand-name { font-size: 16px; }
  #writerBtn { width: 38px; padding: 0; }
  #writerBtn .w-text { display: none; }
  #listBtn { padding: 0 10px; gap: 5px; }
  .stage-grid { padding: 18px 14px 14px; gap: 22px; }
  .finder { padding: 18px 14px; }
  .filters { padding: 14px; }
  .summary-side { width: 100%; justify-items: stretch; }
  .filters-end { justify-content: flex-start; }
  .filters-end .sort { margin-right: auto; }
  .grid { grid-template-columns: 1fr; }
  .summary { margin-top: 26px; }
  .mix { width: 100%; }
  .picker-panel { width: max(100%, 260px); }
  dialog.sheet { border-radius: 0; border-left: 0; }
  .dlg-head { padding: 18px 16px 12px; }
  .dlg-body { padding: 4px 16px 18px; }
  .dlg-foot, .progress, .tabs { padding-inline: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .rowitem .r-actions .hide-xs { display: none; }
}
@media (max-width: 400px) {
  .finder-fields { grid-template-columns: 1fr; }
  .picker.align-right .picker-panel { left: 0; right: auto; }
  #listBtn { padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
