/* ============================================================
   DUOMENŲ SALA — "Pastel Ops" design system
   Palantir-inspired data-ops console, pastel palette.
   Fonts: Archivo (UI/display) + IBM Plex Mono (data/labels).
   Palette lives in :root / [data-theme="dark"] only.
   ============================================================ */

/* Self-hosted (was Google Fonts) — latin + latin-ext covers Lithuanian diacritics. */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 75% 125%;
  font-display: swap;
  src: url("../fonts/archivo-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 75% 125%;
  font-display: swap;
  src: url("../fonts/archivo-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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibmplexmono-400-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibmplexmono-400-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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibmplexmono-500-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibmplexmono-500-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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/ibmplexmono-600-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/ibmplexmono-600-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;
}

:root {
  --sans: "Archivo", -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  /* spacing scale */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  /* type scale */
  --text-xs: .66rem;
  --text-sm: .78rem;
  --text-base: .9rem;
  --text-md: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.7rem;
  --text-2xl: clamp(2rem, 4.4vw, 3rem);

  --bg: #f2f1ec;
  --grid-line: rgba(33, 43, 54, .045);
  --surface: #fbfaf7;
  --surface-2: #f5f4ef;
  --ink: #212b36;
  --muted: #5f6b76;
  --line: #d9d8cf;
  --line-strong: #b9b8ad;

  --accent: #3b6ea5;
  --accent-hover: #2f5b8a;
  --accent-ink: #f4f8fc;
  --accent-soft: #d3e5f8;

  --mint-bg: #cdeadd;  --mint-tx: #1d6f54;
  --sky-bg: #d3e5f8;   --sky-tx: #2b5e9e;
  --lilac-bg: #e2ddf6; --lilac-tx: #5b4ea8;
  --peach-bg: #fbe0cc; --peach-tx: #9c5522;
  --butter-bg: #f7ecc3;--butter-tx: #7d6314;
  --rose-bg: #f7d9dd;  --rose-tx: #a13a4e;

  --code-bg: #232b33;
  --code-tx: #d8e6dd;
  --shadow: 0 1px 0 rgba(33,43,54,.04), 0 8px 24px -18px rgba(33,43,54,.35);
}

[data-theme="dark"] {
  --bg: #1b2026;
  --grid-line: rgba(232, 236, 241, .035);
  --surface: #232931;
  --surface-2: #1f252c;
  --ink: #e8ecf1;
  --muted: #97a3b2;
  --line: #333b45;
  --line-strong: #46505c;

  --accent: #8ab4e8;
  --accent-hover: #a6c6ef;
  --accent-ink: #16202c;
  --accent-soft: #2b3b50;

  --mint-bg: #24382f;  --mint-tx: #8fd9ba;
  --sky-bg: #253849;   --sky-tx: #9cc5f0;
  --lilac-bg: #322f47; --lilac-tx: #c0b4f0;
  --peach-bg: #3d2f22; --peach-tx: #f0bd93;
  --butter-bg: #3a3419;--butter-tx: #e6d385;
  --rose-bg: #422930;  --rose-tx: #eda3b0;

  --code-bg: #161b21;
  --code-tx: #cfe0d5;
  --shadow: 0 1px 0 rgba(0,0,0,.25), 0 10px 28px -18px rgba(0,0,0,.6);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* engineered graph-paper atmosphere */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
  z-index: 0;
}
main { flex: 1; position: relative; z-index: 1; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.015em; }
h1 { font-weight: 800; font-stretch: 112%; }
h2 { font-weight: 700; font-stretch: 108%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
/* extra contrast for controls whose own background is close to --accent */
.btn-primary:focus-visible,
.chip:focus-visible,
#theme-toggle:focus-visible { outline-color: var(--ink); outline-offset: 2px; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 1.4rem; width: 100%; }

/* mono microlabel — the system's signature */
.micro {
  font-family: var(--mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
}

/* ---------- command bar ---------- */
.cmdbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.cmdbar-row { display: flex; align-items: center; gap: 1.6rem; height: 52px; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 22px; height: 22px; flex: none;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
}
.brand-mark i { border-radius: 2px; }
.brand-mark i:nth-child(1) { background: var(--mint-tx); opacity: .85; }
.brand-mark i:nth-child(2) { background: var(--sky-tx); opacity: .85; }
.brand-mark i:nth-child(3) { background: var(--peach-tx); opacity: .85; }
.brand-mark i:nth-child(4) { background: var(--lilac-tx); opacity: .85; }
.brand-name { font-weight: 800; font-stretch: 112%; font-size: .95rem; letter-spacing: .02em; text-transform: uppercase; }
.brand-sub { font-family: var(--mono); font-size: .6rem; color: var(--muted); letter-spacing: .16em; display: block; margin-top: -3px; }
/* desktop: the details/summary wrapper is transparent, nav flows inline */
.nav-toggle { display: contents; }
.nav-toggle-btn { display: none; }
.cmdbar nav { display: flex; gap: 1.15rem; flex: 1; }
.cmdbar nav a {
  font-family: var(--mono); font-size: .7rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); padding: .35rem 0;
  border-bottom: 2px solid transparent;
}
.cmdbar nav a:hover { color: var(--ink); text-decoration: none; border-bottom-color: var(--accent); }
.cmd-actions { display: flex; gap: var(--space-2); align-items: center; }
#theme-toggle {
  background: none; border: 1px solid var(--line); border-radius: 3px;
  color: var(--muted); cursor: pointer; font-size: .85rem;
  width: 30px; height: 30px; line-height: 1;
}
#theme-toggle:hover { border-color: var(--line-strong); color: var(--ink); }

/* ---------- status footer ---------- */
.statusbar {
  border-top: 1px solid var(--line);
  background: var(--surface);
  margin-top: var(--space-8);
  position: relative; z-index: 1;
}
.statusbar-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: .9rem;
  min-height: 34px; padding: .3rem 0;
  font-family: var(--mono); font-size: .64rem;
  text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
}
.statusbar-row .sep { color: var(--line-strong); }
.statusbar-row a { color: var(--muted); }
.statusbar-row a:hover { color: var(--ink); }
.footer-links { display: flex; gap: .9rem; margin-left: auto; }

/* ---------- chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: .35em;
  font-family: var(--mono); font-size: var(--text-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  border-radius: 3px; padding: .18rem .5rem;
}
.chip-mint   { background: var(--mint-bg);   color: var(--mint-tx); }
.chip-sky    { background: var(--sky-bg);    color: var(--sky-tx); }
.chip-lilac  { background: var(--lilac-bg);  color: var(--lilac-tx); }
.chip-peach  { background: var(--peach-bg);  color: var(--peach-tx); }
.chip-butter { background: var(--butter-bg); color: var(--butter-tx); }
.chip-rose   { background: var(--rose-bg);   color: var(--rose-tx); }
/* interactive chips (links/buttons wearing .chip) get hover/active affordance */
a.chip, button.chip {
  cursor: pointer; border: none; transition: filter .12s ease, transform .12s ease;
}
a.chip:hover, button.chip:hover { text-decoration: none; filter: brightness(.94); }
[data-theme="dark"] a.chip:hover, [data-theme="dark"] button.chip:hover { filter: brightness(1.16); }
a.chip:active, button.chip:active { transform: translateY(1px); }
button.chip:disabled, a.chip[aria-disabled="true"] {
  cursor: not-allowed; filter: grayscale(.4); opacity: .55; transform: none;
}

.rating-pill {
  display: inline-block; min-width: 2.1em; text-align: center;
  font-family: var(--mono); font-weight: 600; font-size: var(--text-sm);
  border-radius: 3px; padding: .08rem .4rem;
}
.rating-good { background: var(--mint-bg);   color: var(--mint-tx); }
.rating-mid  { background: var(--butter-bg); color: var(--butter-tx); }
.rating-bad  { background: var(--rose-bg);   color: var(--rose-tx); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .45em;
  font-family: var(--mono); font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  padding: .5rem .95rem; border-radius: 3px;
  border: 1px solid transparent; cursor: pointer;
  transition: background .12s ease, border-color .12s ease, transform .12s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] {
  cursor: not-allowed; opacity: .55; filter: grayscale(.3); transform: none; pointer-events: none;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); }
.btn-ghost { background: none; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { color: var(--ink); border-color: var(--line); }
.btn-lg { font-size: .8rem; padding: .7rem 1.3rem; }
/* company profile: header with a right-aligned action (watch toggle) */
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem 1.5rem; flex-wrap: wrap; }
.detail-head > div { min-width: 0; }
.detail-head .watch-form { margin: .35rem 0 0; flex: none; }
/* alert panel (sanction match, warnings) — danger-accented panel */
.panel-alert { border-color: var(--rose-tx); }

/* watch/unwatch toggle on the company profile */
.watch-form { margin: .7rem 0 0; }
.btn-outline.is-watched { background: var(--butter-bg); color: var(--butter-tx); border-color: var(--butter-tx); }
.btn-outline.is-watched:hover { background: var(--butter-bg); filter: brightness(.96); }

/* ---------- panels ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
  position: relative;
}
.panel-head {
  display: flex; align-items: center; gap: .55rem;
  padding: .55rem .9rem;
  border-bottom: 1px solid var(--line);
  background: var(--sky-bg);
  border-radius: 3px 3px 0 0;
}
.panel-head .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--sky-tx); flex: none; opacity: .85; }
.panel-head .micro { color: var(--sky-tx); }
.panel-head.mint   { background: var(--mint-bg); }
.panel-head.mint .dot { background: var(--mint-tx); }
.panel-head.mint .micro { color: var(--mint-tx); }
.panel-head.lilac  { background: var(--lilac-bg); }
.panel-head.lilac .dot { background: var(--lilac-tx); }
.panel-head.lilac .micro { color: var(--lilac-tx); }
.panel-head.peach  { background: var(--peach-bg); }
.panel-head.peach .dot { background: var(--peach-tx); }
.panel-head.peach .micro { color: var(--peach-tx); }
.panel-head.butter { background: var(--butter-bg); }
.panel-head.butter .dot { background: var(--butter-tx); }
.panel-head.butter .micro { color: var(--butter-tx); }
.panel-head.rose   { background: var(--rose-bg); }
.panel-head.rose .dot { background: var(--rose-tx); }
.panel-head.rose .micro { color: var(--rose-tx); }
.panel-head .spacer { flex: 1; }
.panel-body { padding: var(--space-4) 1.1rem; }
.panel-body > :first-child { margin-top: 0; }
.panel-body > :last-child { margin-bottom: 0; }

/* page-load stagger */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
main .panel, main .stat-tile { animation: rise .45s cubic-bezier(.2,.7,.3,1) backwards; }
main .panel:nth-of-type(2), main .stat-tile:nth-child(2) { animation-delay: .06s; }
main .panel:nth-of-type(3), main .stat-tile:nth-child(3) { animation-delay: .12s; }
main .stat-tile:nth-child(4) { animation-delay: .18s; }
@media (prefers-reduced-motion: reduce) {
  main .panel, main .stat-tile { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- grids ---------- */
.grid { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }

/* ---------- stat tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-4); }
.stat-tile {
  border: 1px solid var(--line); border-radius: 4px;
  padding: .85rem 1rem; background: var(--surface);
  border-top: 3px solid var(--sky-tx);
}
.stat-tile.mint { border-top-color: var(--mint-tx); }
.stat-tile.lilac { border-top-color: var(--lilac-tx); }
.stat-tile.peach { border-top-color: var(--peach-tx); }
.stat-tile .num {
  font-family: var(--mono); font-weight: 600; font-size: var(--text-xl);
  letter-spacing: -.02em; line-height: 1.2;
}
.stat-tile .label { font-size: var(--text-sm); color: var(--muted); margin-top: .1rem; }

/* ---------- page header block ---------- */
.page-head { padding: var(--space-6) 0 1.2rem; }
.page-head h1 { margin: .2rem 0 .4rem; font-size: clamp(1.35rem, 3.5vw, 1.7rem); }
.page-head .lede { color: var(--muted); max-width: 640px; margin: 0; }

/* ---------- hero (home) ---------- */
.hero { padding: 3.2rem 0 2.4rem; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 2.4rem; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3rem); margin: .7rem 0 1rem; }
.hero .lede { font-size: 1.05rem; color: var(--muted); max-width: 520px; }
.hero-ctas { display: flex; gap: .7rem; margin-top: 1.6rem; flex-wrap: wrap; }
.console { font-family: var(--mono); font-size: var(--text-sm); }
.console .row {
  display: flex; justify-content: space-between; gap: var(--space-4);
  padding: .5rem .2rem; border-bottom: 1px dashed var(--line);
}
.console .row:last-child { border-bottom: none; }
.console .k { color: var(--muted); text-transform: uppercase; font-size: .64rem; letter-spacing: .1em; align-self: center; }
.console .v { font-weight: 600; text-align: right; }

/* ---------- tables ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: .82rem; }
table.data th {
  font-family: var(--mono); font-size: .62rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
  text-align: left; padding: .5rem .65rem;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-2);
}
table.data td { padding: .48rem .65rem; border-bottom: 1px solid var(--line); }
table.data tr:hover td { background: var(--accent-soft); }
.num-cell { text-align: right; font-family: var(--mono); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
th.num-cell { text-align: right; }
/* sticky header: pins below the 52px cmdbar while a long results table scrolls.
   Desktop-only — the cmdbar's height goes auto below 860px, and the mobile
   data-cards layout hides this header row entirely (see ≤560px below). */
@media (min-width: 861px) {
  table.data th { position: sticky; top: 52px; z-index: 5; }
}

/* ---------- forms ---------- */
input[type="text"], input[type="number"], input[type="email"], input[type="password"],
input[type="date"], select, textarea {
  width: 100%; padding: .5rem .6rem;
  border: 1px solid var(--line-strong); border-radius: 3px;
  background: var(--surface); color: var(--ink);
  font-family: var(--mono); font-size: .8rem;
}
input::placeholder { color: var(--muted); opacity: .7; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
form.stack label { display: block; font-family: var(--mono); font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: .9rem 0 .3rem; }
form.stack .helptext, form.stack ul.errorlist { font-size: .75rem; color: var(--muted); }
form.stack ul.errorlist { color: var(--rose-tx); list-style: none; padding: 0; margin: .2rem 0; }

/* facet groups (market filter) — labeled sections of related filters */
.facet-group { margin-bottom: var(--space-5); }
.facet-group:last-of-type { margin-bottom: 0; }
.facet-group-head {
  display: block; margin: 0 0 .55rem;
  padding-bottom: .3rem; border-bottom: 1px solid var(--line);
}
.facet-availability {
  border: 1px solid var(--line); border-radius: 4px;
  background: var(--surface); margin: 0; padding: .6rem .85rem;
}
.checks-inline { display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; }
.checks-inline label { margin: .12rem 0; }

/* facet grid (market filter) */
.facets { display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: .8rem; align-items: start; }
.facets fieldset {
  border: 1px solid var(--line); border-radius: 4px;
  background: var(--surface); margin: 0; padding: .55rem .75rem .75rem;
}
.facets legend {
  font-family: var(--mono); font-size: .62rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
  padding: 0 .35rem;
}
.range-pair { display: flex; gap: .4rem; align-items: center; color: var(--muted); }
.checks label { display: flex; gap: .45rem; align-items: center; font-size: .8rem; margin: .18rem 0; }
.checks input { width: auto; accent-color: var(--accent); }
select[multiple] { font-size: .75rem; }

/* toolbar row above results */
.toolbar {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  padding: .6rem 0; margin: 1rem 0 .6rem;
}
.toolbar .micro { margin-right: auto; }

/* ---------- kv definition lists ---------- */
.kv { display: grid; grid-template-columns: 190px 1fr; gap: .28rem .9rem; margin: 0; }
.kv dt { font-family: var(--mono); font-size: .64rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); align-self: center; }
.kv dd { margin: 0; font-size: .86rem; font-weight: 500; }

/* ---------- flash messages ---------- */
.flash {
  font-family: var(--mono); font-size: .75rem;
  border: 1px solid var(--line); border-left-width: 3px;
  border-radius: 3px; padding: .6rem .9rem; margin: .9rem 0;
  background: var(--surface);
}
.flash-success { border-left-color: var(--mint-tx); color: var(--mint-tx); }
.flash-error, .flash-warning { border-left-color: var(--rose-tx); color: var(--rose-tx); }
.flash-info { border-left-color: var(--sky-tx); color: var(--sky-tx); }

/* ---------- code ---------- */
code { font-family: var(--mono); font-size: .82em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 3px; padding: .05em .3em; }
pre {
  background: var(--code-bg); color: var(--code-tx);
  border-radius: 4px; border: 1px solid var(--line);
  padding: .9rem 1.1rem; overflow-x: auto;
  font-family: var(--mono); font-size: .74rem; line-height: 1.6;
}
pre code { background: none; border: none; padding: 0; color: inherit; }

/* ---------- pagination ---------- */
.pagination { display: flex; gap: .6rem; align-items: center; margin: 1.1rem 0; font-family: var(--mono); font-size: .74rem; }

/* sortable column headers (market filter live results) */
table.data th a.sort-th {
  display: inline-flex; align-items: center; gap: .25em;
  color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit;
}
table.data th a.sort-th:hover { color: var(--ink); text-decoration: none; }
table.data th a.sort-th.sorted { color: var(--accent); }
.sort-arrow { font-size: .8em; width: .8em; display: inline-block; }
th.num-cell a.sort-th { flex-direction: row-reverse; }

/* live-refresh spinner in the filter toolbar */
.mf-spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--line-strong); border-top-color: var(--accent);
  animation: mf-spin .7s linear infinite;
}
@keyframes mf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mf-spinner { animation-duration: 2s; } }

/* results dim (not hide) while a live refetch is in flight, so stale rows stay
   readable as context instead of the panel flashing blank */
#mf-results.is-loading { opacity: .55; pointer-events: none; transition: opacity .12s ease; }
@media (prefers-reduced-motion: reduce) { #mf-results.is-loading { transition: none; } }

/* empty state: zero matches shows this instead of a blank/collapsed table */
.mf-empty { text-align: center; padding: var(--space-6) var(--space-4); }
.mf-empty .micro { display: block; font-size: var(--text-sm); margin-bottom: var(--space-2); }
.mf-empty p:last-child { max-width: 440px; margin: 0 auto; color: var(--muted); }

/* ---------- pricing ---------- */
.price {
  font-family: var(--mono); font-weight: 600; font-size: 1.45rem;
  letter-spacing: -.02em; margin: .3rem 0 .6rem;
}
.panel ul.feature { padding-left: 1.1rem; margin: .6rem 0 1rem; font-size: .84rem; color: var(--muted); }
.panel ul.feature li { margin: .22rem 0; }
.panel.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }

/* ---------- fin-chart legend (company profile) ---------- */
.fin-chart { margin: 0; padding-bottom: .4rem; }
.chart-legend { margin: .4rem 0 0; }
.chart-legend-swatch { font-style: normal; }
.chart-legend-revenue { color: var(--sky-tx); }
.chart-legend-profit { color: var(--mint-tx); }

/* ---------- misc ---------- */
.section { padding: 1.6rem 0; }
.section-title { font-size: var(--text-lg); margin: 0 0 .2rem; }
.section-sub { color: var(--muted); margin: 0 0 1.2rem; max-width: 640px; }
hr.rule { border: none; border-top: 1px solid var(--line); margin: var(--space-6) 0; }

/* ---------- utilities & extracted component styles ---------- */
.mt { margin-top: var(--space-4); }
.mb { margin-bottom: var(--space-4); }
.m0 { margin: 0; }
.text-muted { color: var(--muted); }
.text-left { text-align: left; }
/* small muted helper/annotation text (was many ad-hoc color+font-size inline styles) */
.note { color: var(--muted); font-size: .86rem; }
.note.m0 { margin: 0; }
/* horizontal row of buttons/actions that wraps on narrow screens */
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }
/* width-constrained content column (auth panels, single-column pages) */
.col-narrow { max-width: 480px; }
.col-mid { max-width: 620px; }
.col-wide { max-width: 760px; }
/* wrap long unbreakable strings (API keys) inside <pre> */
.pre-wrap { white-space: break-spaces; }
/* inline search form: input grows, button hugs its label */
.search-row { display: flex; gap: .6rem; }
.meta-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .6rem 0 0; }
.kv-tight { grid-template-columns: 1fr auto; }
/* wraps wide tables so they scroll instead of overflowing on narrow screens */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .cmdbar-row { flex-wrap: wrap; height: auto; padding: .5rem 0; gap: .7rem 1.2rem; }
  .kv, .kv-tight { grid-template-columns: 1fr; gap: .05rem; }
  .kv dt { margin-top: .5rem; }
}

/* mobile nav: collapse the link list behind a native <details> toggle */
@media (max-width: 768px) {
  .nav-toggle { display: block; order: 3; flex-basis: 100%; }
  .nav-toggle-btn {
    display: inline-flex; align-items: center; gap: .35em;
    width: fit-content; cursor: pointer; list-style: none;
    font-family: var(--mono); font-size: .7rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: .08em;
    padding: .4rem .7rem; margin-top: .2rem;
    border: 1px solid var(--line); border-radius: 3px; color: var(--muted);
  }
  .nav-toggle-btn::-webkit-details-marker { display: none; }
  .nav-toggle-btn:hover { border-color: var(--line-strong); color: var(--ink); }
  .nav-toggle > nav {
    display: flex; flex-direction: column; gap: .1rem;
    padding: .5rem 0 .2rem;
  }
  .nav-toggle[open] > .nav-toggle-btn { margin-bottom: .1rem; }
  .cmdbar nav a { padding: .5rem .1rem; border-bottom: 1px solid var(--line); }
  .cmdbar nav a:last-child { border-bottom: none; }
}

@media (max-width: 560px) {
  .container { padding: 0 var(--space-4); }
  .page-head { padding: 1.3rem 0 .9rem; }
  .hero { padding: var(--space-6) 0 1.4rem; }
  .section { padding: 1.1rem 0; }
  .toolbar .micro { margin-right: 0; width: 100%; }
  table.data { font-size: var(--text-sm); }
  .stat-tile .num { font-size: 1.45rem; }

  /* wide result tables (.data-cards) restack as one card per row so every
     field is visible without horizontal scrolling */
  .data-cards, .data-cards tbody, .data-cards tr, .data-cards td { display: block; width: 100%; }
  .data-cards tr:first-child { display: none; }            /* header row */
  .data-cards tr {
    border: 1px solid var(--line); border-radius: 5px;
    margin-bottom: .55rem; padding: .5rem .7rem; background: var(--surface);
  }
  .data-cards td {
    border: none; padding: .2rem 0; font-size: .84rem;
    display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
  }
  .data-cards td::before {
    content: attr(data-label);
    font-family: var(--mono); font-size: .58rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .1em; color: var(--muted); flex: none;
  }
  .data-cards td:first-child { display: block; font-weight: 600; font-size: .95rem; padding-bottom: .3rem; }
  .data-cards td:first-child::before { display: none; }
  .data-cards .num-cell { text-align: right; }
}

/* --- Home interactive --- */
.home-search{position:relative;display:flex;gap:.5rem;margin:1rem 0 .6rem;max-width:520px}
.home-search input{flex:1;padding:.7rem .9rem;border:1px solid var(--line);border-radius:10px;
  background:var(--surface);color:var(--ink);font:inherit}
.suggest{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:20;margin:0;padding:.25rem;
  list-style:none;background:var(--surface);border:1px solid var(--line);border-radius:10px;
  box-shadow:0 8px 24px rgba(0,0,0,.12);max-height:340px;overflow:auto}
.suggest li{display:flex;align-items:center;gap:.6rem;padding:.5rem .6rem;border-radius:7px;cursor:pointer}
.suggest li[aria-selected="true"],.suggest li:hover{background:var(--hover,rgba(0,0,0,.05))}
.suggest .s-code{font-family:var(--mono,monospace);color:var(--muted);font-size:.8rem;margin-left:auto}
.sample-row{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center}
.sample-chip{border:1px solid var(--line);background:var(--surface);color:var(--ink);
  border-radius:999px;padding:.25rem .7rem;font-size:.82rem;cursor:pointer}
.sample-chip:hover{border-color:var(--accent,#1d6f54)}
.preview-card{margin-top:1rem;display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:.8rem;padding:1rem 1.2rem;border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.preview-card .pc-metric .k{display:block;color:var(--muted);font-size:.75rem}
.preview-card .pc-metric .v{font-size:1.1rem;font-weight:600}
.rating-bars{display:flex;align-items:flex-end;gap:.4rem;height:120px}
.rating-bar{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%}
.rating-bar .rb-fill{width:100%;border-radius:5px 5px 0 0;background:var(--accent,#1d6f54);
  height:max(4px, calc(var(--n) * 1%));transition:height .5s cubic-bezier(.2,.7,.3,1)}
@media (prefers-reduced-motion: reduce){.rating-bar .rb-fill{transition:none}}
.rating-bar .rb-label{font-size:.7rem;color:var(--muted);margin-top:.25rem}
.console .stat{font-weight:600;text-align:right}
