/* ==========================================================================
   NagarData — a NagarLab product
   Design tokens follow nagarlab.com so both sites read as one family.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/geist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/geist-latin.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: "Geist Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/geist-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/geist-mono-latin.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;
}

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  --font-sans: "Geist", "Noto Sans Bengali", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --container: 1160px;
  --gutter: 24px;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --header-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* 4px spacing scale */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px; --s20: 80px; --s24: 96px;
}

/* Dark is the default, as on nagarlab.com */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #16181c;
  --bg-alt: #1b1e22;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-strong: #22252a;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.15);
  --input-border: #6b7079;          /* ≥3:1 against the page (WCAG 1.4.11) */
  --text: #e9ebee;
  --text-2: #aeb2b9;
  --text-3: #8d929b;                /* ≥4.5:1 on --bg and --surface-strong (WCAG 1.4.3) */
  --accent: #3ddc97;
  --accent-ink: #04130c;
  --accent-soft: rgba(61, 220, 151, 0.1);
  --accent-line: rgba(61, 220, 151, 0.32);
  --amber: #f5b84c;
  --amber-soft: rgba(245, 184, 76, 0.1);
  --amber-line: rgba(245, 184, 76, 0.3);
  --red: #ff7a7a;
  --red-soft: rgba(255, 122, 122, 0.1);
  --blue: #7cb7ff;
  --grid: rgba(255, 255, 255, 0.045);
  --glow: rgba(61, 220, 151, 0.14);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 60px -20px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 8px 24px -12px rgba(0, 0, 0, 0.35);
  --header-bg: rgba(22, 24, 28, 0.86);
  --nav-pill-bg: rgba(255, 255, 255, 0.04);
  --nav-pill-active: rgba(255, 255, 255, 0.1);
  --input-bg: rgba(255, 255, 255, 0.04);
  --code-bg: #1d2025;
  --chart-a: #3ddc97;
  --chart-b: #7cb7ff;
  --chart-d: #c792ea;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-alt: #f7f8f8;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-2: #f3f5f4;
  --surface-strong: #ffffff;
  --border: rgba(10, 14, 12, 0.09);
  --border-strong: rgba(10, 14, 12, 0.16);
  --input-border: #868c89;          /* ≥3:1 on white and --bg-alt */
  --text: #0b0d0c;
  --text-2: #4d5350;
  --text-3: #5f6562;                /* ≥4.5:1 on white and --bg-alt */
  --accent: #0f7a4f;
  --accent-ink: #ffffff;
  --accent-soft: rgba(15, 122, 79, 0.08);
  --accent-line: rgba(15, 122, 79, 0.3);
  --amber: #a8640a;
  --amber-soft: rgba(168, 100, 10, 0.08);
  --amber-line: rgba(168, 100, 10, 0.28);
  --red: #c23b3b;
  --red-soft: rgba(194, 59, 59, 0.08);
  --blue: #2563c9;
  --grid: rgba(10, 14, 12, 0.05);
  --glow: rgba(15, 122, 79, 0.1);
  --shadow: 0 1px 2px rgba(10, 14, 12, 0.04), 0 18px 40px -22px rgba(10, 14, 12, 0.18);
  --shadow-sm: 0 1px 2px rgba(10, 14, 12, 0.05), 0 6px 16px -10px rgba(10, 14, 12, 0.14);
  --header-bg: rgba(255, 255, 255, 0.9);
  --nav-pill-bg: rgba(10, 14, 12, 0.03);
  --nav-pill-active: #ffffff;
  --input-bg: #ffffff;
  --code-bg: #0e0f12;
  --chart-a: #0f7a4f;
  --chart-b: #2563c9;
  --chart-d: #8b3fc7;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, dl, dd, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
code, pre, kbd { font-family: var(--font-mono); }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }

section[id] { scroll-margin-top: calc(var(--header-h) + 24px); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}


/* --------------------------------------------------------------------------
   Type
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--accent);
  font: 500 12px/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow-dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}

.display {
  font-size: clamp(36px, 5.4vw, 60px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.h1 {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.h2 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.h3 { font-size: 18px; font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; }
.h4 { font-size: 15px; font-weight: 600; line-height: 1.4; letter-spacing: -0.01em; }

.lead { color: var(--text-2); font-size: clamp(16px, 1.6vw, 18px); line-height: 1.65; max-width: 640px; text-wrap: pretty; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.small { font-size: 14px; line-height: 1.55; }
.xsmall { font-size: 13px; line-height: 1.5; }
.mono { font-family: var(--font-mono); }
.label-mono {
  color: var(--text-3);
  font: 500 11.5px/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.link {
  white-space: nowrap;
  color: var(--accent);
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  transition: gap 0.2s var(--ease), opacity 0.2s;
}
.link:hover { gap: 9px; }
.link svg { width: 14px; height: 14px; }

/* --------------------------------------------------------------------------
   Icons
   -------------------------------------------------------------------------- */
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 15px; height: 15px; }
.i-lg { width: 22px; height: 22px; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font: 500 14px/1 var(--font-sans); letter-spacing: -0.005em;
  white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease),
    transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.button:active { transform: translateY(1px); }
.button .i { width: 16px; height: 16px; }

.button-primary { background: var(--text); color: var(--bg); }
.button-primary:hover { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px var(--accent-soft); }

.button-accent { background: var(--accent); color: var(--accent-ink); }
.button-accent:hover { box-shadow: 0 0 0 4px var(--accent-soft); filter: brightness(1.06); }

.button-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.button-ghost:hover { border-color: var(--text-3); background: var(--surface-strong); }

.button-quiet { background: transparent; color: var(--text-2); }
.button-quiet:hover { color: var(--text); background: var(--surface-2); }

.button-danger { background: transparent; border-color: var(--border-strong); color: var(--red); }
.button-danger:hover { background: var(--red-soft); border-color: var(--red); }

.button-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.button-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.button-block { width: 100%; }

.icon-button {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: transparent; color: var(--text-2); cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.icon-button:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface); }
.icon-button .i { width: 17px; height: 17px; }

:root[data-theme="dark"] .icon-moon,
:root:not([data-theme]) .icon-moon,
:root[data-theme="light"] .icon-sun { display: none; }

/* --------------------------------------------------------------------------
   Tags & badges
   -------------------------------------------------------------------------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  color: var(--text-2);
  font: 500 11.5px/1 var(--font-mono); letter-spacing: 0.02em;
  white-space: nowrap;
}
.tag-live, .tag-free { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.tag-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag-pro { border-color: var(--amber-line); background: var(--amber-soft); color: var(--amber); }
.tag-planned { color: var(--text-3); }

.kbd {
  display: inline-grid; place-items: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px;
  color: var(--text-3); font: 500 11px/1 var(--font-mono);
}

/* --------------------------------------------------------------------------
   Surfaces
   -------------------------------------------------------------------------- */
.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: var(--s6); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  padding: var(--s5) var(--s6);
  border-bottom: 1px solid var(--border);
}
.card-body { padding: var(--s6); }

a.card, .card-link { transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), transform 0.2s var(--ease); }
a.card:hover, .card-link:hover { border-color: var(--border-strong); background: var(--surface-2); }

.grid-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 75%);
}
.glow {
  position: absolute; z-index: -1; pointer-events: none;
  width: 720px; height: 420px; left: 50%; top: -180px; transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--glow), transparent);
}

.divider { height: 1px; background: var(--border); border: 0; margin: 0; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(20px);
  transition: border-color 0.2s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--border); }

.nav {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: var(--s6); height: 100%;
}

.brand { display: inline-flex; align-items: center; gap: 10px; justify-self: start; min-width: 0; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-mark rect { fill: var(--text); }
.brand-mark path { stroke: var(--bg); }
.brand-name { font-size: 17px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.brand-by {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; margin-left: 2px;
  border: 1px solid var(--border-strong); border-radius: 6px;
  color: var(--text-3); font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.04em;
  transition: color 0.2s, border-color 0.2s;
}
a.brand-by:hover { color: var(--text); border-color: var(--text-3); }

.nav-links {
  display: flex; align-items: center; gap: 2px; justify-self: center;
  padding: 4px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--nav-pill-bg);
}
.nav-links a:not(.button) {
  padding: 6px 14px; border-radius: 999px;
  color: var(--text-2); font-size: 14px; font-weight: 500; line-height: 20px; white-space: nowrap;
  transition: color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.nav-links a:not(.button):hover { color: var(--text); }
.nav-links a.is-active {
  color: var(--text); background: var(--nav-pill-active);
  box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(0, 0, 0, 0.06);
}
.nav-mobile-only { display: none; }

.nav-actions { display: flex; align-items: center; gap: 8px; justify-self: end; }

.menu-toggle { display: none; position: relative; }
.menu-toggle span {
  position: absolute; left: 11px; right: 11px; height: 1.5px; border-radius: 2px;
  background: currentColor; transition: transform 0.25s var(--ease), top 0.25s var(--ease);
}
.menu-toggle span:nth-child(1) { top: 15px; }
.menu-toggle span:nth-child(2) { top: 23px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { top: 19px; transform: rotate(-45deg); }

/* --------------------------------------------------------------------------
   Page sections
   -------------------------------------------------------------------------- */
.section { padding-block: var(--s24); }
.section-sm { padding-block: var(--s16); }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section:not(.section-alt) + .section:not(.section-alt) { padding-top: 0; }

.section-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: var(--s4) var(--s8); margin-bottom: var(--s10);
}
.section-head > div { display: grid; gap: var(--s3); max-width: 640px; }

.page-head {
  position: relative; isolation: isolate; overflow: hidden;
  padding: var(--s16) 0 var(--s12);
  border-bottom: 1px solid var(--border);
}
.page-head-inner { display: grid; gap: var(--s4); }
.page-head .lead { max-width: 680px; }

.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text-3); font-size: 13.5px; }
.breadcrumb a { color: var(--text-2); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { opacity: 0.6; }

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */
.stack { display: grid; gap: var(--s4); }
.stack-sm { display: grid; gap: var(--s2); align-content: start; }
.stack { align-content: start; }
.stack-lg { display: grid; gap: var(--s8); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3) var(--s6); }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }

/* sidebar (left) + content */
.with-sidebar { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: var(--s10); align-items: start; }
/* content + rail (right) */
.with-rail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s8); align-items: start; }
.sticky { position: sticky; top: calc(var(--header-h) + 24px); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.field { display: grid; gap: 8px; min-width: 0; align-content: start; }
.field-label { font-size: 14px; font-weight: 500; color: var(--text); }
.field-label .opt { color: var(--text-3); font-weight: 400; }
.field-hint { font-size: 13px; color: var(--text-3); line-height: 1.5; }
.field-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.input, .select, .textarea {
  width: 100%; min-width: 0;
  height: 44px; padding: 0 14px;
  border: 1px solid var(--input-border); border-radius: var(--radius-sm);
  background: var(--input-bg); color: var(--text);
  font-size: 15px; line-height: 1.4;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.textarea { height: auto; min-height: 132px; padding: 12px 14px; resize: vertical; line-height: 1.55; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.select option { background: var(--surface-strong); color: var(--text); }
.select-sm { height: 36px; font-size: 14px; border-radius: 8px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); }
.form-grid .span-2 { grid-column: 1 / -1; }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }

.check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14.5px; color: var(--text-2); cursor: pointer; line-height: 1.45;
}
.check input, .choice input {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 18px; height: 18px; margin: 1px 0 0;
  border: 1.5px solid var(--border-strong); border-radius: 5px;
  background: var(--input-bg); cursor: pointer;
  display: grid; place-items: center;
  transition: background-color 0.15s, border-color 0.15s;
}
.check input[type="radio"], .choice input[type="radio"] { border-radius: 50%; }
.check input::after, .choice input::after { content: ""; opacity: 0; transition: opacity 0.15s; }
.check input[type="checkbox"]::after, .choice input[type="checkbox"]::after {
  width: 10px; height: 6px; margin-top: -2px;
  border-left: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink);
  transform: rotate(-45deg);
}
.check input[type="radio"]::after, .choice input[type="radio"]::after { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-ink); }
.check input:checked, .choice input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after, .choice input:checked::after { opacity: 1; }
.check input:focus-visible, .choice input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.check:hover input:not(:checked) { border-color: var(--text-3); }
.check a { color: var(--accent); }

/* Selectable option cards (radio) */
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.choice {
  position: relative; display: grid; gap: 4px;
  padding: 14px 16px 14px 44px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--input-bg); cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.choice:hover { border-color: var(--text-3); }
.choice input { position: absolute; left: 16px; top: 16px; margin: 0; }
.choice strong { font-size: 14.5px; font-weight: 600; color: var(--text); }
.choice span { font-size: 13px; color: var(--text-3); line-height: 1.45; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }

/* Segmented control */
.segmented {
  display: inline-flex; gap: 2px; padding: 4px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--nav-pill-bg);
}
.segmented button {
  height: 34px; padding: 0 18px;
  border: 0; border-radius: 999px; background: transparent;
  color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"], .segmented button[aria-selected="true"] {
  color: var(--text); background: var(--nav-pill-active);
  box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(0, 0, 0, 0.08);
}
.segmented-block { display: flex; width: 100%; }
.segmented-block button { flex: 1; justify-content: center; }

/* Search bar */
.searchbar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 16px;
  border: 1px solid var(--border-strong); border-radius: 16px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.searchbar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.searchbar > .i { color: var(--text-3); }
.searchbar input {
  flex: 1; min-width: 0; height: 44px; padding: 0 4px;
  border: 0; background: transparent; outline: none;
  font-size: 16px; color: var(--text);
}
.searchbar input::placeholder { color: var(--text-3); }
.searchbar input::-webkit-search-cancel-button { display: none; }
.searchbar .kbd { margin-right: 4px; }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { font-size: 14px; }
.table caption { caption-side: bottom; padding: 12px 16px; text-align: left; color: var(--text-3); font-size: 12.5px; border-top: 1px solid var(--border); }
.table th, .table td { padding: 13px 16px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
.table thead th {
  background: var(--surface-2);
  color: var(--text-3); font: 500 11.5px/1.4 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap;
}
.table tbody tr:last-child > * { border-bottom: 0; }
.table tbody tr { transition: background-color 0.15s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody th { font-weight: 500; color: var(--text); }
.table td { color: var(--text-2); }
.table .num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text); }
.table .strong { color: var(--text); font-weight: 500; }

/* --------------------------------------------------------------------------
   Code
   -------------------------------------------------------------------------- */
.code {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--code-bg); color: #d7dbe0; overflow: hidden;
}
:root[data-theme="light"] .code { border-color: #1c1f24; }
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 42px; padding: 0 8px 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #8b9099; font: 500 11.5px/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase;
}
.code-head .dots { display: flex; gap: 6px; }
.code-head .dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.code pre {
  margin: 0; padding: 16px 18px; overflow-x: auto;
  font-size: 13px; line-height: 1.7; tab-size: 2;
}
.code .copy {
  height: 28px; padding: 0 10px; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 7px;
  background: transparent; color: #a6abb3; font: 500 12px/1 var(--font-sans); letter-spacing: 0; text-transform: none;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: color 0.2s, border-color 0.2s;
}
.code .copy:hover { color: #fff; border-color: rgba(255, 255, 255, 0.28); }
.code .copy .i { width: 13px; height: 13px; }
.tok-k { color: #7cb7ff; }
.tok-s { color: #3ddc97; }
.tok-n { color: #f5b84c; }
.tok-c { color: #6b6f78; }
.tok-p { color: #c792ea; }

.inline-code {
  padding: 2px 6px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface-2); color: var(--text); font-size: 0.86em;
}

/* --------------------------------------------------------------------------
   Notices, meters, lists
   -------------------------------------------------------------------------- */
.notice {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--accent-line); border-radius: var(--radius);
  background: var(--accent-soft); color: var(--text); font-size: 14px; line-height: 1.55;
}
.notice .i { color: var(--accent); margin-top: 1px; }
.notice-amber { border-color: var(--amber-line); background: var(--amber-soft); }
.notice-amber .i { color: var(--amber); }

.meter { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.meter-amber > span { background: var(--amber); }

.check-list { display: grid; gap: 12px; }
.check-list li { position: relative; padding-left: 28px; color: var(--text-2); font-size: 14.5px; line-height: 1.5; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 1px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233ddc97' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 11px no-repeat;
}
:root[data-theme="light"] .check-list li::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f7a4f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
.check-list li strong { color: var(--text); font-weight: 500; }

/* definition grid used for dataset/endpoint metadata */
.meta-grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  overflow: hidden;
}
.meta-grid > div { display: grid; gap: 6px; padding: 16px 20px; border-left: 1px solid var(--border); min-width: 0; }
.meta-grid > div:first-child { border-left: 0; }
.meta-grid dt { color: var(--text-3); font: 500 11px/1.4 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.meta-grid dd { font-size: 14.5px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs button {
  position: relative; height: 44px; padding: 0 14px;
  border: 0; background: transparent; color: var(--text-2);
  font-size: 14.5px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color 0.2s;
}
.tabs button:hover { color: var(--text); }
.tabs button::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  border-radius: 2px; background: transparent; transition: background-color 0.2s;
}
.tabs button[aria-selected="true"] { color: var(--text); }
.tabs button[aria-selected="true"]::after { background: var(--accent); }
.tabs .i { width: 15px; height: 15px; }

/* FAQ */
.faq-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--s12); }
.faq-grid > .stack { align-content: start; }
.faq { display: grid; border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px 0; cursor: pointer; list-style: none;
  font-size: 16.5px; font-weight: 500; letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 28px; height: 28px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E") center / 14px no-repeat;
  transition: transform 0.25s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 48px 24px 0; color: var(--text-2); font-size: 15px; line-height: 1.65; max-width: 760px; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer { padding: var(--s16) 0 var(--s8); border-top: 1px solid var(--border); background: var(--bg-alt); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--s10); }
.footer-brand { display: grid; gap: var(--s4); align-content: start; }
.footer-brand p { color: var(--text-2); font-size: 14px; line-height: 1.6; max-width: 320px; }
.footer-col { display: grid; gap: 10px; align-content: start; }
.footer-col h4 { margin-bottom: 4px; color: var(--text-3); font: 500 12px/1.4 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.footer-col a { color: var(--text-2); font-size: 14px; transition: color 0.2s; width: fit-content; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: var(--s12); padding-top: var(--s6); border-top: 1px solid var(--border);
  color: var(--text-3); font-size: 13px;
}
.footer-legal { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-legal a { transition: color 0.2s; }
.footer-legal a:hover { color: var(--text); }

/* ==========================================================================
   Page: Home
   ========================================================================== */
.hero { position: relative; isolation: isolate; overflow: hidden; padding: var(--s20) 0 var(--s16); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: var(--s12); align-items: center; }
.hero-copy { display: grid; gap: var(--s6); }
.hero-copy .display { max-width: 640px; }
.hero-search { display: grid; gap: var(--s4); max-width: 600px; margin-top: var(--s2); }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chips > span { color: var(--text-3); font-size: 13.5px; margin-right: 2px; }
.chip {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text-2); font-size: 13.5px; transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }

.preview-card { overflow: hidden; }
.preview-card .card-head { padding: 16px 20px; }
.preview-stat { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 20px 20px 4px; }
.preview-stat .value { font-size: 36px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.preview-stat .value small { font-size: 15px; font-weight: 500; color: var(--text-3); letter-spacing: -0.01em; margin-left: 6px; }
.delta { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 6px; font: 500 12px/1 var(--font-mono); }
.delta-up { color: var(--amber); background: var(--amber-soft); }
.delta-down { color: var(--accent); background: var(--accent-soft); }
.preview-chart { padding: 8px 12px 0; }
.preview-foot {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}
.preview-foot > div { display: grid; gap: 4px; padding: 14px 20px; border-left: 1px solid var(--border); min-width: 0; }
.preview-foot > div:first-child { border-left: 0; }
.preview-foot span:last-child { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stats-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
}
.stats-strip > div { display: grid; gap: 6px; padding: 22px 24px; border-left: 1px solid var(--border); }
.stats-strip > div:first-child { border-left: 0; }
.stats-strip strong { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.2; }
.stats-strip span { color: var(--text-2); font-size: 14px; line-height: 1.45; }

.sector-card { display: grid; grid-template-rows: auto 1fr auto; gap: 14px; padding: 22px; min-height: 196px; }
.sector-card .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sector-icon {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--border-strong); border-radius: 11px; background: var(--surface-2); color: var(--text-2);
}
.sector-card.is-live .sector-icon { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.sector-card p { color: var(--text-2); font-size: 14px; line-height: 1.55; }
.sector-card .foot { display: flex; align-items: center; justify-content: space-between; color: var(--text-3); font-size: 13px; }
.sector-card .foot .i { width: 16px; height: 16px; transition: transform 0.2s var(--ease), color 0.2s; }
.sector-card:hover .foot .i { transform: translateX(3px); color: var(--text); }

.list-card { overflow: hidden; }
.list-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 120px 150px 120px 24px;
  align-items: center; gap: 24px; padding: 18px 24px;
  border-top: 1px solid var(--border); transition: background-color 0.15s;
}
.list-row:first-child { border-top: 0; }
.list-row:hover { background: var(--surface-2); }
.list-row .title { display: grid; gap: 3px; min-width: 0; }
.list-row .title strong { font-size: 15.5px; font-weight: 500; letter-spacing: -0.01em; }
.list-row .title span { color: var(--text-3); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .cell { color: var(--text-2); font-size: 14px; }
.list-row > .i { color: var(--text-3); transition: transform 0.2s var(--ease), color 0.2s; }
.list-row:hover > .i { transform: translateX(3px); color: var(--text); }
.list-head {
  display: grid; grid-template-columns: minmax(0, 1fr) 120px 150px 120px 24px; gap: 24px;
  padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}

.plan-mini { display: grid; gap: 14px; align-content: start; padding: 28px; }
.plan-mini.is-featured { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line) inset, var(--shadow); }
.plan-mini p { color: var(--text-2); font-size: 14.5px; line-height: 1.6; }

.dev-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--s12); align-items: center; }
.feature-list { display: grid; gap: 20px; margin-top: var(--s2); }
.feature-list li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.feature-list .sector-icon { width: 40px; height: 40px; }
.feature-list strong { display: block; font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.feature-list span { color: var(--text-2); font-size: 14px; line-height: 1.55; }

.cta-band {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s8);
  padding: var(--s12);
  border: 1px solid var(--border); border-radius: 24px; background: var(--surface);
}
.cta-band .grid-bg { -webkit-mask-image: radial-gradient(ellipse 70% 90% at 100% 50%, #000 20%, transparent 70%); mask-image: radial-gradient(ellipse 70% 90% at 100% 50%, #000 20%, transparent 70%); }

/* ==========================================================================
   Page: Browse
   ========================================================================== */
.browse-search { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: var(--s3); margin-top: var(--s4); max-width: 820px; }
.browse-search .searchbar { box-shadow: none; border-radius: var(--radius-sm); padding: 0 6px 0 14px; height: 48px; }
.browse-search .searchbar input { height: 46px; font-size: 15px; }
.browse-search .select { height: 48px; }

.filters { display: grid; gap: var(--s8); }
.filter-group { display: grid; gap: 12px; }
.filter-group h3, .filter-group h2 { margin-bottom: 4px; }
.filter-group legend { float: left; width: 100%; margin-bottom: 14px; }
.filter-group legend + * { clear: both; }
legend.label-mono { float: left; width: 100%; }
legend.label-mono + * { clear: both; }
.filter-nav { display: grid; gap: 2px; }
.filter-nav button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid transparent; border-radius: 9px; background: transparent;
  color: var(--text-2); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
.filter-nav button:hover { color: var(--text); background: var(--surface-2); }
.filter-nav button[aria-pressed="true"] { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); }
.filter-nav .count { color: var(--text-3); font: 500 12px/1 var(--font-mono); }
.filter-nav button[aria-pressed="true"] .count { color: var(--accent); }
.filter-group .check { font-size: 14px; }

.results-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: var(--s4); margin-bottom: var(--s5); border-bottom: 1px solid var(--border);
}
.results-bar p { color: var(--text-2); font-size: 14px; }
.results-bar strong { color: var(--text); font-weight: 600; }
.results { display: grid; gap: var(--s3); }

.dataset-card { display: grid; gap: 14px; padding: 22px 24px; }
.dataset-card .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dataset-card h3 a { transition: color 0.2s; }
.dataset-card h3 a:hover { color: var(--accent); }
.dataset-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.dataset-card p { color: var(--text-2); font-size: 14.5px; line-height: 1.55; max-width: 720px; }
.dataset-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--text-3); font-size: 13px; }
.dataset-meta span { display: inline-flex; align-items: center; gap: 7px; }
.dataset-meta .i { width: 14px; height: 14px; }
.dataset-meta b { color: var(--text-2); font-weight: 500; }
.dataset-card .actions { position: relative; z-index: 1; display: flex; gap: 8px; }
.dataset-card:hover { border-color: var(--border-strong); background: var(--surface-2); }

.empty-state { display: grid; justify-items: center; gap: 14px; padding: var(--s16) var(--s8); text-align: center; }
.empty-state .sector-icon { width: 52px; height: 52px; border-radius: 14px; }
.empty-state p { max-width: 440px; color: var(--text-2); font-size: 15px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: var(--s8); }
.pagination button {
  min-width: 38px; height: 38px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 9px; background: transparent;
  color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
.pagination button:hover { color: var(--text); border-color: var(--border-strong); }
.pagination button[aria-current="page"] { color: var(--bg); background: var(--text); border-color: var(--text); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

.filter-toggle { display: none; }

/* ==========================================================================
   Page: Dataset
   ========================================================================== */
.ds-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s6) var(--s10); align-items: end; }
.ds-head .titles { display: grid; gap: 14px; }
.ds-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.page-head .meta-grid { margin-top: var(--s8); }

.chart-card .card-head { flex-wrap: wrap; }
.chart-wrap { padding: 20px 20px 8px; }
.chart { width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--border); stroke-width: 1; }
.chart .axis-label { fill: var(--text-3); font: 500 11px var(--font-mono); }
.chart .dot { stroke: var(--bg); stroke-width: 2; }
.chart .crosshair { stroke: var(--border-strong); stroke-dasharray: 3 3; }
.chart-tooltip {
  position: absolute; pointer-events: none; z-index: 5;
  min-width: 150px; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface-strong); box-shadow: var(--shadow);
  font-size: 13px; transform: translate(-50%, calc(-100% - 14px));
  transition: opacity 0.12s;
}
.chart-tooltip .t-date { color: var(--text-3); font: 500 11px/1.4 var(--font-mono); margin-bottom: 6px; }
.chart-tooltip .t-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.chart-tooltip .t-row span { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); }
.chart-tooltip .t-row b { font-family: var(--font-mono); font-weight: 500; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 14px 24px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 13px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.legend .sw { margin-right: 8px; vertical-align: -1px; }
.legend .note { margin-left: auto; color: var(--text-3); font-size: 12.5px; }

.upsell {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px;
  padding: 20px 24px; border: 1px solid var(--amber-line); border-radius: var(--radius-lg); background: var(--amber-soft);
}
.upsell .sector-icon { color: var(--amber); border-color: var(--amber-line); background: transparent; }
.upsell p { color: var(--text-2); font-size: 14px; line-height: 1.55; margin-top: 2px; }

.rail { display: grid; gap: var(--s4); }
.rail .card-pad { display: grid; gap: 14px; }
.col-list { display: grid; }
.col-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.col-list li:first-child { border-top: 0; padding-top: 0; }
.col-list code { color: var(--text); font-size: 12.5px; }
.col-list span { color: var(--text-3); text-align: right; }

/* ==========================================================================
   Page: Pricing
   ========================================================================== */
.pricing-head { text-align: center; justify-items: center; }
.pricing-head .lead { margin-inline: auto; }
.save-badge { height: 20px; padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font: 500 11px/20px var(--font-mono); }

.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); align-items: stretch; }
.plan { display: grid; grid-template-rows: auto auto auto 1fr; gap: 0; padding: 0; overflow: hidden; }
.plan-top { display: grid; gap: 8px; padding: 28px 28px 0; min-height: 112px; align-content: start; }
.plan-top .row-between { min-height: 28px; }
.plan-top p { color: var(--text-2); font-size: 14.5px; line-height: 1.55; }
.plan-price { display: flex; align-items: baseline; gap: 8px; padding: 20px 28px 22px; min-height: 92px; }
.plan-price .amount { font-size: 42px; font-weight: 600; letter-spacing: -0.045em; line-height: 1; }
.plan-price .per { color: var(--text-3); font-size: 14px; }
.plan-cta { padding: 0 28px 28px; }
.plan-features { padding: 24px 28px 30px; border-top: 1px solid var(--border); display: grid; gap: 14px; align-content: start; }
.plan.is-featured { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line) inset, 0 30px 80px -30px var(--glow), var(--shadow); }
.plan.is-featured::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.compare .table th:not(:first-child), .compare .table td { text-align: center; }
.compare .table thead th:first-child { width: 34%; }
.compare .table thead th.is-featured { color: var(--accent); }
.compare .table td.is-featured { background: var(--accent-soft); }
.compare .yes, .compare .no { display: inline-flex; vertical-align: middle; }
.compare .yes { color: var(--accent); }
.compare .no { color: var(--text-3); }

/* ==========================================================================
   Page: Request
   ========================================================================== */
.form-card { padding: var(--s8); }
.form-card form { display: grid; gap: var(--s6); }
.form-section { display: grid; gap: var(--s5); }
.form-section + .form-section { padding-top: var(--s6); border-top: 1px solid var(--border); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: var(--s6); border-top: 1px solid var(--border); }

.steps { display: grid; gap: 0; }
.steps li { position: relative; display: grid; grid-template-columns: 32px 1fr; gap: 14px; padding-bottom: 22px; }
.steps li:last-child { padding-bottom: 0; }
.steps li:not(:last-child)::before { content: ""; position: absolute; left: 15.5px; top: 34px; bottom: 2px; width: 1px; background: var(--border-strong); }
.step-num {
  display: grid; place-items: center; width: 32px; height: 32px;
  border: 1px solid var(--accent-line); border-radius: 50%; background: var(--accent-soft);
  color: var(--accent); font: 500 13px/1 var(--font-mono);
}
.steps strong { display: block; font-size: 15px; font-weight: 600; margin: 5px 0 2px; }
.steps span { color: var(--text-2); font-size: 14px; line-height: 1.55; }

.success { display: grid; justify-items: center; gap: 16px; padding: var(--s16) var(--s8); text-align: center; }
.success-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent); }
.success p { max-width: 440px; color: var(--text-2); }

/* ==========================================================================
   Page: Auth
   ========================================================================== */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-aside {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto; gap: var(--s10);
  padding: var(--s10) var(--s12);
  border-right: 1px solid var(--border); background: var(--bg-alt);
}
.auth-aside .grid-bg { -webkit-mask-image: radial-gradient(ellipse 90% 70% at 20% 40%, #000 25%, transparent 75%); mask-image: radial-gradient(ellipse 90% 70% at 20% 40%, #000 25%, transparent 75%); }
.auth-aside .glow { left: 30%; top: 20%; }
.auth-pitch { display: grid; gap: var(--s8); align-content: center; max-width: 460px; }
.auth-quote { padding: 20px 22px; }
.auth-main { position: relative; display: grid; place-items: center; padding: var(--s10) var(--gutter); }
.auth-theme { position: absolute; top: 24px; right: 24px; }
.auth-box { width: 100%; max-width: 400px; display: grid; gap: var(--s6); }
.auth-box form { display: grid; gap: var(--s4); }
.or { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; color: var(--text-3); font-size: 12.5px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; }
.or::before, .or::after { content: ""; height: 1px; background: var(--border); }
.auth-top { display: flex; justify-content: space-between; align-items: center; }
.auth-back { display: none; }

/* ==========================================================================
   Page: Account
   ========================================================================== */
.side-nav { display: grid; gap: 2px; }
.side-nav .label-mono { padding: 0 12px 8px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px;
  border-radius: 9px; color: var(--text-2); font-size: 14px; font-weight: 500;
  transition: color 0.15s, background-color 0.15s;
}
.side-nav a:hover { color: var(--text); background: var(--surface-2); }
.side-nav a[aria-current="true"], .side-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: 0 0 0 1px var(--border) inset; }
.side-nav a .i { width: 16px; height: 16px; color: var(--text-3); }
.side-nav a[aria-current] .i { color: var(--accent); }
.side-nav hr { margin: 10px 12px; border: 0; height: 1px; background: var(--border); }

.account-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: var(--s8); }
.usage-grid { display: grid; grid-template-columns: 1.1fr repeat(3, minmax(0, 1fr)); }
.usage-grid > div { display: grid; gap: 10px; align-content: start; padding: 22px 24px; border-left: 1px solid var(--border); }
.usage-grid > div:first-child { border-left: 0; }
.usage-grid .value { font-size: 26px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; }
.usage-grid .value small { font-size: 14px; color: var(--text-3); font-weight: 500; letter-spacing: 0; }

.key-box {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--input-bg);
}
.key-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--text); }

.saved-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 20px; padding: 16px 24px; border-top: 1px solid var(--border); }
.saved-row:first-child { border-top: 0; }
.saved-row a.title { font-weight: 500; font-size: 15px; transition: color 0.2s; }
.saved-row a.title:hover { color: var(--accent); }

/* Toggle switch */
.switch { display: inline-flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13.5px; cursor: pointer; }
.switch input {
  appearance: none; -webkit-appearance: none; position: relative; flex: none;
  width: 34px; height: 20px; margin: 0; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border-strong); cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}
.switch input::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-3); transition: transform 0.2s var(--ease), background-color 0.2s;
}
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::after { transform: translateX(14px); background: var(--accent-ink); }
.switch input:disabled { opacity: 0.5; cursor: not-allowed; }
.switch:has(input:disabled) { cursor: not-allowed; }

/* ==========================================================================
   Page: API docs
   ========================================================================== */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s12); align-items: start; padding: var(--s12) 0 var(--s24); }
.docs-nav { display: grid; gap: 2px; }
.docs-nav .label-mono { padding: 0 12px 10px; }
.docs-nav a {
  position: relative; display: flex; align-items: center; height: 34px; padding: 0 12px;
  border-radius: 8px; color: var(--text-2); font-size: 14px; transition: color 0.15s, background-color 0.15s;
}
.docs-nav a:hover { color: var(--text); }
.docs-nav a.is-active { color: var(--text); background: var(--surface-2); }
.docs-nav a.is-active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--accent); }
.docs-content { display: grid; gap: var(--s16); max-width: 820px; }
.docs-section { display: grid; gap: var(--s5); }
.docs-section > p { color: var(--text-2); font-size: 15.5px; line-height: 1.7; }
.base-url { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.base-url code { font-size: 14px; color: var(--text); }
.method { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font: 500 11.5px/1 var(--font-mono); letter-spacing: 0.04em; }
.endpoint code { color: var(--text); font-size: 13px; white-space: nowrap; }
.errors { display: grid; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.errors > div { display: grid; grid-template-columns: 72px 160px minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--border); font-size: 14px; }
.errors > div:first-child { border-top: 0; }
.errors dt { font-family: var(--font-mono); font-weight: 500; color: var(--red); }
.errors .name { color: var(--text); font-weight: 500; }
.errors dd { color: var(--text-2); }
.code-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s4); }

/* ==========================================================================
   Motion
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
html:not(.js) .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 16px; border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--surface-strong); box-shadow: var(--shadow); color: var(--text); font-size: 14px;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast .i { color: var(--accent); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .nav-links a:not(.button) { padding: 6px 11px; }
  .hero-grid, .dev-grid { grid-template-columns: 1fr; }
  .hero-copy .display { max-width: 760px; }
  .preview-card { max-width: 640px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .with-rail { grid-template-columns: 1fr; }
  .rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .meta-grid > div:nth-child(4) { border-left: 0; }
  .meta-grid > div:nth-child(n+4) { border-top: 1px solid var(--border); }
  .usage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .usage-grid > div:nth-child(3) { border-left: 0; }
  .usage-grid > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .list-row, .list-head { grid-template-columns: minmax(0, 1fr) 110px 130px 24px; }
  .list-row .col-freq, .list-head .col-freq { display: none; }
}

@media (max-width: 960px) {
  :root { --header-h: 60px; }
  .nav { grid-template-columns: 1fr auto; }
  .menu-toggle { display: inline-grid; }
  .nav-actions .hide-sm { display: none; }
  .nav-links {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    display: grid; gap: 4px; justify-self: stretch;
    padding: 16px var(--gutter) 24px;
    border: 0; border-bottom: 1px solid var(--border); border-radius: 0;
    background: var(--bg);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
  }
  .nav-links.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav-links a:not(.button) { padding: 12px 14px; font-size: 16px; border-radius: 10px; }
  .nav-links a.is-active { box-shadow: none; background: var(--surface-2); }
  .nav-mobile-only { display: flex; }
  .nav-links .nav-mobile-only.button { margin-top: 8px; height: 46px; }

  .section { padding-block: var(--s16); }
  .grid-3, .plans { grid-template-columns: 1fr; }
  .plans { max-width: 520px; margin-inline: auto; }
  .plan-top { min-height: 0; }
  .stats-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-strip > div:nth-child(3) { border-left: 0; }
  .stats-strip > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }

  .with-sidebar { grid-template-columns: 1fr; gap: var(--s6); }
  .filter-toggle { display: inline-flex; }
  .filters { display: none; padding: var(--s6); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6); }
  .filters.is-open { display: grid; }
  .filters .filter-group:first-child { grid-column: 1 / -1; }
  .filters .filter-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .ds-head { grid-template-columns: 1fr; }
  .ds-actions { justify-content: flex-start; }

  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-back { display: flex; }

  .faq-grid { grid-template-columns: 1fr; gap: var(--s6); }
  .filters.sticky { position: static; }
  .auth-theme { display: none; }
  .docs { grid-template-columns: 1fr; gap: var(--s6); padding-top: var(--s8); }
  .docs-nav { position: static; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
  .docs-nav .label-mono { display: none; }
  .docs-nav a { flex: none; }
  .docs-nav a.is-active::before { display: none; }
  .code-pair { grid-template-columns: 1fr; }

  .account-layout .side-nav { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
  .account-layout .side-nav .label-mono, .account-layout .side-nav hr { display: none; }
  .account-layout .side-nav a { flex: none; }
  .account-layout .sticky { position: static; }
}

@media (max-width: 680px) {
  :root { --gutter: 16px; }
  .brand-by { display: none; }
  .hero { padding: var(--s12) 0 var(--s10); }
  .page-head { padding: var(--s10) 0 var(--s8); }
  .searchbar .kbd { display: none; }
  .grid-4, .form-grid, .choice-grid, .rail { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .browse-search { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .filters .filter-nav { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: 1fr; }
  .stats-strip > div { border-left: 0 !important; border-top: 1px solid var(--border); }
  .stats-strip > div:first-child { border-top: 0; }
  .meta-grid, .usage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta-grid > div, .usage-grid > div { border-left: 0 !important; border-top: 1px solid var(--border); }
  .meta-grid > div:nth-child(even), .usage-grid > div:nth-child(even) { border-left: 1px solid var(--border) !important; }
  .meta-grid > div:nth-child(-n+2), .usage-grid > div:nth-child(-n+2) { border-top: 0; }
  .meta-grid > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .list-head { display: none; }
  .list-row { grid-template-columns: minmax(0, 1fr) 20px; gap: 8px 16px; padding: 16px; }
  .list-row .cell { display: none; }
  .list-row .title .tag { margin-top: 6px; }
  .preview-foot { grid-template-columns: 1fr 1fr; }
  .preview-foot > div:last-child { display: none; }
  .cta-band { grid-template-columns: 1fr; padding: var(--s8) var(--s6); }
  .dataset-card { padding: 18px; }
  .dataset-card .head { flex-direction: column; gap: 10px; }
  .upsell { grid-template-columns: 1fr; }
  .upsell .sector-icon { display: none; }
  .form-card { padding: var(--s6) var(--s5); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .saved-row { grid-template-columns: 1fr auto; padding: 16px; }
  .saved-row .switch { grid-column: 1 / -1; grid-row: 2; }
  .errors > div { grid-template-columns: 56px minmax(0, 1fr); }
  .errors .name { display: none; }
  .legend .note { margin-left: 0; width: 100%; }
  .key-box { flex-wrap: wrap; padding: 10px; }
  .key-box code { flex-basis: 100%; padding: 4px 4px 6px; }
  .faq details p { padding-right: 0; }
  .table th, .table td { padding: 12px 14px; white-space: nowrap; }
  .stats-strip strong { font-size: 18px; }
  .chart-wrap { padding: 12px 8px 4px; }
}


/* ==========================================================================
   App components (live data)
   ========================================================================== */

/* Form states */
.field-error { color: var(--red); font-size: 13px; line-height: 1.45; }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.form-error { font-size: 14px; }
.input[type="file"] { padding: 6px 8px; height: auto; min-height: 44px; color: var(--text-2); font-size: 14px; }
.input[type="file"]::file-selector-button {
  margin-right: 12px; height: 30px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface-2); color: var(--text); font: 500 13px var(--font-sans); cursor: pointer;
}
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; opacity: 0; }
.button.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.button.is-busy > * { visibility: hidden; }
.button.is-busy::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--text-3) var(--text-3) var(--text-3) transparent;
  animation: nd-spin 0.7s linear infinite;
}
.button-primary.is-busy::after, .button-accent.is-busy::after { border-color: var(--bg) var(--bg) var(--bg) transparent; opacity: 0.8; }
@keyframes nd-spin { to { transform: rotate(360deg); } }
.button:disabled:not(.is-busy) { opacity: 0.55; cursor: not-allowed; }
a.button[aria-disabled="true"] { pointer-events: none; opacity: 0.6; }
button.link { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; }
.toast.is-error .i { color: var(--red); }

/* Loading skeletons */
.skeleton, .skeleton-text {
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface) 50%, var(--surface-2) 100%);
  background-size: 200% 100%; animation: nd-shimmer 1.4s ease-in-out infinite; border-color: transparent;
}
.skeleton-text { display: block; height: 0.9em; margin: 0.15em 0; border-radius: 6px; width: 90%; }
@keyframes nd-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Dataset filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px 16px; padding: 16px 24px 0; }
.filter-field { display: grid; gap: 6px; min-width: 150px; }
.filter-field .select { width: 100%; }

/* Status pills */
.status-pill {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--border-strong); color: var(--text-2); font: 500 12px/1 var(--font-sans); text-transform: capitalize;
}
.status-new, .status-reviewing, .status-open, .status-running { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 35%, transparent); background: color-mix(in srgb, var(--blue) 10%, transparent); }
.status-quoted, .status-past_due, .status-on_hold, .status-trialing, .status-refunded, .status-partial, .status-sent { color: var(--amber); border-color: var(--amber-line); background: var(--amber-soft); }
.status-accepted, .status-in_progress, .status-delivered, .status-paid, .status-succeeded { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.status-declined, .status-cancelled, .status-failed, .status-void, .status-uncollectible, .status-rejected, .status-expired { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); background: var(--red-soft); }

/* Request progress */
.progress-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.progress-steps li { position: relative; display: grid; gap: 10px; color: var(--text-3); font-size: 13px; font-weight: 500; }
.progress-steps li::before { content: ""; height: 4px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); }
.progress-steps li.is-done, .progress-steps li.is-current { color: var(--text); }
.progress-steps li.is-done::before { background: var(--accent); border-color: var(--accent); }
.progress-steps li.is-current::before { background: linear-gradient(90deg, var(--accent) 50%, var(--surface-2) 50%); border-color: var(--accent-line); }
.progress-steps .dot { display: none; }

.quote { display: grid; gap: 14px; padding: 18px 20px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.quote.is-old { opacity: 0.65; }
.quote-amount { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.file-list { display: grid; gap: 0; }
.file-list li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.file-list li:first-child { border-top: 0; padding-top: 0; }

.thread { display: grid; gap: 12px; }
.msg { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.msg p { white-space: pre-wrap; font-size: 14.5px; line-height: 1.55; margin-top: 4px; }
.msg-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--text-3); }
.msg-meta strong { color: var(--text); font-weight: 500; }
.msg-staff { border-color: var(--accent-line); background: var(--accent-soft); }
.msg-system { background: transparent; border-style: dashed; }
.msg-system p { color: var(--text-2); font-size: 13.5px; }
.msg-internal { border-color: var(--amber-line); background: var(--amber-soft); }

.kv { display: grid; gap: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.kv > div:first-child { border-top: 0; }
.kv dt { color: var(--text-3); }
.kv dd { color: var(--text); text-align: right; font-weight: 500; }

/* Account */
.secret-box { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--amber-line); border-radius: var(--radius); background: var(--amber-soft); }
.secret-box code { user-select: all; }
.disclosure > summary { cursor: pointer; color: var(--text-2); font-size: 14px; font-weight: 500; list-style: none; display: inline-flex; align-items: center; gap: 8px; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: "+"; display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--border-strong); border-radius: 6px; font-size: 13px; }
.disclosure[open] > summary::before { content: "–"; }
a.saved-row { color: inherit; transition: background-color 0.15s; }
a.saved-row:hover { background: var(--surface-2); }
a.saved-row .i { color: var(--text-3); }
#reqList a.saved-row { grid-template-columns: minmax(0, 1fr) auto 18px; }

/* Admin */
.count-badge:not(:empty) { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 600 11px/1 var(--font-mono); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
.stat { display: grid; gap: 6px; }
.stat-value { font-size: 30px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; }
.admin-split { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: var(--s6); align-items: start; }
.admin-split > .card:last-child { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow: auto; }
#reqList { max-height: 70vh; overflow: auto; }
.req-item {
  display: grid; gap: 4px; width: 100%; padding: 14px 18px; border: 0; border-top: 1px solid var(--border);
  background: transparent; color: inherit; text-align: left; cursor: pointer; transition: background-color 0.15s;
}
.req-item:first-child { border-top: 0; }
.req-item:hover { background: var(--surface-2); }
.req-item.is-active { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.dialog {
  width: min(460px, calc(100vw - 32px)); padding: var(--s6); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface-strong); color: var(--text); box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(2px); }

/* 404 */
.not-found { display: grid; justify-items: center; gap: var(--s4); padding: var(--s24) 0; text-align: center; }
.not-found .code-num { font: 600 72px/1 var(--font-mono); letter-spacing: -0.04em; color: var(--text-3); }

@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-split { grid-template-columns: 1fr; }
  .admin-split > .card:last-child { position: static; max-height: none; }
}
@media (max-width: 680px) {
  .progress-steps { grid-template-columns: 1fr; }
  .filter-bar { padding: 14px 16px 0; }
  .filter-field { min-width: 0; flex: 1 1 140px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .file-list li { flex-wrap: wrap; }
}

/* ==========================================================================
   Live vs fixed datasets
   ========================================================================== */
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tag-live::before { animation: nd-pulse 2s ease-out infinite; }
@keyframes nd-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.tag-fixed { border-color: color-mix(in srgb, var(--blue) 35%, transparent); background: color-mix(in srgb, var(--blue) 9%, transparent); color: var(--blue); }
.tag-stale { border-color: var(--amber-line); background: var(--amber-soft); color: var(--amber); }
.tag-stale::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.dataset-card.is-flash { animation: nd-flash 1.6s var(--ease); }
@keyframes nd-flash {
  0% { box-shadow: 0 0 0 2px var(--accent), var(--shadow-sm); }
  100% { box-shadow: 0 0 0 0 transparent, var(--shadow-sm); }
}

/* Admin: agents */
.agent-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 20px; align-items: center; padding: 18px 22px; border-top: 1px solid var(--border); }
.agent-row:first-child { border-top: 0; }
.agent-row .i { color: var(--accent); }
.agent-err { color: var(--red); }
.agent-row .tag { height: 20px; font-size: 11px; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; }
.count-badge.count-warn:not(:empty) { background: var(--amber); }
.dialog-wide { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; }
@media (max-width: 680px) {
  .agent-row { grid-template-columns: 1fr; }
  .agent-row > :nth-child(2) { text-align: left !important; }
  .agent-row > :last-child { justify-content: flex-start !important; }
  .check-grid { grid-template-columns: 1fr; }
  .tag-row { justify-content: flex-start; }
}

.table td.is-provisional { color: var(--amber); }

/* Chart area when only one day exists */
.single-point { display: grid; gap: 14px; justify-items: start; padding: 32px 8px 24px; }
.single-values { display: flex; flex-wrap: wrap; gap: 12px 40px; }
.single-values > div { display: grid; gap: 2px; }
.single-values strong { font-size: 32px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.single-point p { max-width: 560px; }

.plan-price .from { align-self: flex-end; margin-bottom: 6px; color: var(--text-3); font-size: 14px; }

/* Bangla text: taller lines so conjuncts and vowel signs do not clip. */
:lang(bn), .bn { font-family: "Noto Sans Bengali", var(--font-sans); line-height: 1.75; }

.chart:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.md p { margin: 0 0 8px; } .md ul { margin: 0 0 8px; padding-left: 18px; list-style: disc; } .md li { margin: 0 0 4px; }

/* Chart footer: legend + "Save chart as PNG" */
.chart-foot { padding: 0 20px 16px; gap: 12px; flex-wrap: wrap; }
.chart-foot .legend { padding: 0; }
.segmented-sm button { height: 28px; padding: 0 10px; font-size: 12.5px; }
#citeStyle { margin: 8px 0 10px; }

/* Key-figure cards (reports) */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s4); margin-top: var(--s8); }
.kpi { display: grid; gap: 6px; }
.kpi .value { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.nowrap { white-space: nowrap; }
.chg-up { color: var(--red); } .chg-down { color: var(--accent); } .chg-flat { color: var(--text-3); }
.movers { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.mover-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.mover-row:first-of-type { border-top: 0; }
@media (max-width: 680px) { .movers { grid-template-columns: 1fr; } }

/* Long-form pages: terms, privacy, refunds, sources */
.prose { max-width: 760px; display: grid; gap: var(--s4); color: var(--text-2); line-height: 1.7; }
.prose h2 { color: var(--text); font-size: 20px; margin-top: var(--s6); letter-spacing: -0.01em; }
.prose h3 { color: var(--text); font-size: 16px; margin-top: var(--s3); }
.prose ul, .prose ol { padding-left: 20px; display: grid; gap: 6px; margin: 0; list-style: disc; }
.prose ol { list-style: decimal; }
.prose p { margin: 0; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose strong { color: var(--text); }
.prose .fact-table { width: 100%; border-collapse: collapse; }
.prose .fact-table th, .prose .fact-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose .fact-table th { color: var(--text-3); font-weight: 500; width: 40%; }
.missing { color: var(--amber); font-style: italic; }
.embed-body { padding: 16px; display: grid; gap: 10px; background: var(--bg); min-height: 100vh; align-content: start; }

@media print {
  .site-header, .footer, .no-print, .skip-link, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border: 0; box-shadow: none; background: #fff; }
}

/* Signed-in header: who you are and your role, on every page */
.button-staff { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.button-staff:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.account-chip { gap: 8px; }
.role-chip {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font: 600 11px/1 var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase;
}

/* Reports */
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 220px) 1fr 70px; gap: 12px; align-items: center; font-size: 14px; }
.bar-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar { display: block; height: 100%; border-radius: 999px; }
.bar-up { background: var(--red); } .bar-down { background: var(--accent); }
.bar-val { text-align: right; font-family: var(--font-mono); font-size: 13px; }
.report .table tr.cat-row th { background: var(--surface-2); color: var(--text-2); font-weight: 600; text-transform: none; letter-spacing: 0; }
@media (max-width: 680px) { .bar-row { grid-template-columns: 1fr 70px; } .bar-track { grid-column: 1 / -1; order: 3; } }
@media print {
  .report .card { break-inside: avoid; border: 1px solid #ddd; }
  .bar-up { background: #c0392b !important; } .bar-down { background: #1e8449 !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
