/* Parsys Bazar. The parsyserp.com world (navy fields, glass panels, 14px corners, pill controls, Vazirmatn) in
   Operate density. Light by default (white is the brand's main background; buyers check prices in daylight);
   dark follows the system or the toggle. */

@font-face {
  font-family: "Vazirmatn";
  src: url("/assets/Vazirmatn-wght.woff2") format("woff2-variations"), url("/assets/Vazirmatn-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --navy: #1E3F7D; --blue: #0076BB; --cyan: #00B2E2; --light: #B9D8EA;
  --ground: #F4F7FB;
  --panel: #FFFFFF;
  --panel-2: #EEF4FA;
  --ink: #0B1E45;
  --ink-2: #2F4468;
  --ink-3: #4F6488;
  --line: rgba(30, 62, 124, .14);
  --line-2: rgba(30, 62, 124, .24);
  --edge: rgba(30, 62, 124, .12);
  --accent: #0068A6;          /* links and selection text: cyan is too light for text on white */
  --accent-soft: rgba(0, 178, 226, .14);
  --focus: #0068A6;           /* cyan is under 3:1 on white */
  --up: #0E7A4B; --up-soft: rgba(14, 122, 75, .10);
  --down: #B3261E; --down-soft: rgba(179, 38, 30, .09);
  --shadow: 0 18px 40px -26px rgba(30, 62, 124, .45), 0 4px 10px -6px rgba(30, 62, 124, .18);
  --r: 14px;
  --wrap: 1180px;
  --gut: clamp(16px, 4vw, 40px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0A1733; --panel: #0F2656; --panel-2: #112C5E;
    --ink: #EAF2FA; --ink-2: #C3D5EA; --ink-3: #9DB3D0;
    --line: rgba(185, 216, 234, .14); --line-2: rgba(185, 216, 234, .26); --edge: rgba(185, 216, 234, .2);
    --accent: #4CC9EE; --accent-soft: rgba(0, 178, 226, .16); --focus: #00B2E2;
    --up: #4FD39A; --up-soft: rgba(79, 211, 154, .12); --down: #FF8A80; --down-soft: rgba(255, 138, 128, .12);
    --shadow: 0 20px 44px -24px rgba(0, 0, 0, .6), 0 6px 14px -8px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0A1733; --panel: #0F2656; --panel-2: #112C5E;
  --ink: #EAF2FA; --ink-2: #C3D5EA; --ink-3: #9DB3D0;
  --line: rgba(185, 216, 234, .14); --line-2: rgba(185, 216, 234, .26); --edge: rgba(185, 216, 234, .2);
  --accent: #4CC9EE; --accent-soft: rgba(0, 178, 226, .16); --focus: #00B2E2;
  --up: #4FD39A; --up-soft: rgba(79, 211, 154, .12); --down: #FF8A80; --down-soft: rgba(255, 138, 128, .12);
  --shadow: 0 20px 44px -24px rgba(0, 0, 0, .6), 0 6px 14px -8px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: "Vazirmatn", Tahoma, sans-serif; font-size: 1rem; line-height: 1.85; font-weight: 400;
}
::selection { background: var(--cyan); color: #04122B; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
input, select, textarea { accent-color: var(--focus); }
a { color: var(--accent); text-underline-offset: .28em; text-decoration-thickness: 1px; }
h1, h2, h3 { line-height: 1.35; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 1.25rem + 1.9vw, 2.6rem); font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 700; }
/* this Vazirmatn build draws Latin digits as Persian: codes, dates and Latin fields use faces that keep them */
code, .code, pre { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
input[dir="ltr"], textarea[dir="ltr"] { font-family: "Segoe UI", Tahoma, Arial, sans-serif; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.wrap { width: min(100%, var(--wrap)); margin-inline: auto; padding-inline: var(--gut); }
[hidden] { display: none !important; }
html { scrollbar-color: var(--line-2) transparent; }

/* numbers line up in columns */
.num, .price b, .chg, .code, .mini td { font-variant-numeric: tabular-nums; }
/* single display figures: proportional, so the dot-shaped Persian zeros do not sit in wide slots */
.kind-price b, .quote-price b { font-variant-numeric: proportional-nums; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--panel) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 18px; min-height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.logo-plate { display: inline-flex; padding: 5px 8px; border-radius: 10px; }
.logo-plate img { display: block; width: 104px; height: auto; }
:root[data-theme="dark"] .logo-plate { background: #F4F7FB; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-plate { background: #F4F7FB; } }
.brand-name { font-weight: 800; font-size: 1.15rem; padding-inline-start: 12px; border-inline-start: 1px solid var(--line-2); line-height: 1.2; }
.top-nav { display: flex; gap: 4px; margin-inline-start: auto; }
.top-nav a { padding: 6px 14px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .95rem; }
.top-nav a:hover { background: var(--panel-2); }
.top-nav a.on { background: var(--accent-soft); color: var(--ink); font-weight: 700; }
.theme { inline-size: 38px; block-size: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2);
  display: grid; place-items: center; cursor: pointer; }
.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.theme .i-moon { display: none; }
:root[data-theme="dark"] .theme .i-sun { display: none; }
:root[data-theme="dark"] .theme .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .i-sun { display: none; }
  :root:not([data-theme="light"]) .theme .i-moon { display: block; }
}

/* ---------- header date ---------- */
.hdr-date { color: var(--ink-3); font-size: .86rem; white-space: nowrap; }
.hdr-date strong { color: var(--ink); font-weight: 700; }
@media (max-width: 640px) { .hdr-date { display: none; } }

/* ---------- navy band: the parsyserp.com field, carrying the intro and the kinds ---------- */
.band { background: radial-gradient(90% 140% at 85% 0%, #23488C 0%, var(--navy) 55%, #17346B 100%); color: #EAF2FA;
  padding-block: clamp(24px, 4vw, 44px) clamp(22px, 3vw, 34px); }
:root[data-theme="dark"] .band { background: radial-gradient(90% 140% at 85% 0%, #1A3A78 0%, #10285A 60%, #0C1F48 100%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .band { background: radial-gradient(90% 140% at 85% 0%, #1A3A78 0%, #10285A 60%, #0C1F48 100%); } }
.band h1 { color: #fff; }
.band .lede { color: #C9DCEE; }
.band .lede strong { color: #fff; }
.lede-date { display: none; }
@media (max-width: 640px) { .lede-date { display: inline; } }
[data-kinds] { font-size: .9rem; font-weight: 500; color: var(--ink-3); }
.band .kind { background: rgba(255, 255, 255, .07); border-color: rgba(185, 216, 234, .24); box-shadow: none; color: #fff;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.band .kind:hover { background: rgba(255, 255, 255, .11); border-color: rgba(185, 216, 234, .5); }
.band .kind.on { background: rgba(0, 178, 226, .18); border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan) inset; }
.band .kind-price small, .band .kind-count, .band .kind-meta { color: #B9D8EA; }
.band .chg { color: #DDEBF7; }
.band .chg.up { color: #7BE8B7; background: rgba(79, 211, 154, .16); }
.band .chg.down { color: #FFA59D; background: rgba(255, 138, 128, .16); }
.board-body { padding-block: 4px 56px; }
.item-page { padding-block: clamp(22px, 4vw, 44px) 56px; }
.intro { max-width: 70ch; margin-bottom: 22px; }
.lede { margin: 10px 0 0; color: var(--ink-2); font-size: 1.02rem; }
.lede strong { color: var(--ink); }

/* ---------- kinds: first decision ---------- */
.kinds { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(176px, 1fr); gap: 10px; overflow-x: auto;
  padding: 4px 2px 12px; margin-inline: -2px; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.kind { scroll-snap-align: start; display: grid; align-content: start; gap: 4px; min-height: 104px; padding: 14px 16px; border-radius: var(--r);
  background: var(--panel); border: 1px solid var(--edge); box-shadow: var(--shadow); color: var(--ink); text-decoration: none;
  transition: border-color .2s var(--ease-out), transform .2s var(--ease-out), background-color .2s; }
.kind:hover { border-color: var(--line-2); transform: translateY(-2px); }
.kind.on { border-color: var(--cyan); background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--panel); box-shadow: 0 0 0 1px var(--cyan) inset, var(--shadow); }
.kind-name { font-weight: 700; font-size: .98rem; line-height: 1.5; }
.kind-price b { font-size: 1.25rem; font-weight: 800; }
.kind-price small { display: block; line-height: 1.4; }
.kind-price small, .kind-count, .kind-meta { color: var(--ink-3); font-size: .82rem; }
.kind-meta { display: flex; gap: 10px; align-items: center; margin-top: auto; }
@media (max-width: 640px) {
  .kinds { grid-auto-columns: minmax(142px, 44vw); gap: 8px; padding-bottom: 6px; }
  .kind { min-height: 0; padding: 12px 14px; }
  .kind-price b { font-size: 1.1rem; }
}
@media (min-width: 1100px) {
  .kinds { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); overflow: visible; }
}

/* ---------- finder chips ---------- */
.finder { display: grid; gap: 10px; margin: 18px 0 8px; padding: 16px 18px; border-radius: var(--r); background: var(--panel);
  border: 1px solid var(--edge); }
.facet { display: grid; grid-template-columns: 4.6rem 1fr; align-items: start; gap: 10px; }
.facet-label { color: var(--ink-3); font-size: .88rem; font-weight: 600; padding-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: .9rem; font-variant-numeric: tabular-nums; line-height: 1.5; padding: 5px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink); transition: background-color .15s, border-color .15s, color .15s; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
:root[data-theme="dark"] .chip[aria-pressed="true"] { background: var(--cyan); border-color: var(--cyan); color: #04122B; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip[aria-pressed="true"] { background: var(--cyan); border-color: var(--cyan); color: #04122B; } }
.chip:disabled { opacity: .35; cursor: default; border-style: dashed; }
@media (max-width: 640px) {
  .facet { grid-template-columns: 1fr; gap: 4px; }
  .facet-label { padding-top: 0; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
}

/* ---------- results ---------- */
.results { margin-top: 22px; }
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.results-head h2 { font-size: 1.05rem; color: var(--ink-2); font-weight: 600; }
.results-head [data-count] { color: var(--ink); font-weight: 800; font-size: 1.3rem; }
.link-btn { font: inherit; font-size: .9rem; background: none; border: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: .28em; }

.prices { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel); border: 1px solid var(--edge);
  border-radius: var(--r); box-shadow: var(--shadow); }
.prices thead th:first-child { border-start-start-radius: var(--r); }
.prices thead th:last-child { border-start-end-radius: var(--r); }
.prices tbody tr:last-child > *:first-child { border-end-start-radius: var(--r); }
.prices tbody tr:last-child > *:last-child { border-end-end-radius: var(--r); }
.prices thead th { position: sticky; top: 62px; z-index: 2; background: var(--panel-2); color: var(--ink-3); font-size: .82rem; font-weight: 600;
  text-align: start; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.prices td, .prices tbody th { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: start; font-weight: 400; }
.prices tbody tr:last-child > * { border-bottom: 0; }
.prices tbody tr { transition: background-color .15s; }
.prices tbody tr:hover { background: var(--panel-2); }
.prices .num { text-align: end; white-space: nowrap; }
.prices tr.more { display: none; }
.board.filtering .prices tr.more:not([hidden]) { display: table-row; }
.prices tr.group th { background: var(--panel-2); padding: 9px 14px; font-weight: 700; font-size: .92rem; text-align: start;
  border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); }
.prices tr.group a { margin-inline-start: 12px; font-weight: 500; font-size: .84rem; }
.board.filtering .prices tr.group a { display: none; }
.item-name { color: var(--ink); font-weight: 600; text-decoration: none; }
.item-name:hover { color: var(--accent); text-decoration: underline; }
.item-spec { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--ink-3); font-size: .82rem; }
.code { color: var(--ink-3); font-size: .82rem; white-space: nowrap; }
.prices td.code { text-align: start; }
.prices td.code code { font-size: inherit; color: inherit; }
.price b { font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.price small { display: block; color: var(--ink-3); font-size: .76rem; }
.chg { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .84rem; font-weight: 600; white-space: nowrap; color: var(--ink-3); }
.chg.up { color: var(--up); background: var(--up-soft); }
.chg.down { color: var(--down); background: var(--down-soft); }
.spark-col { width: 120px; }
.spark { display: block; width: 110px; height: 30px; overflow: visible; }
.spark path { fill: none; stroke: var(--ink-3); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark.up path { stroke: var(--up); }
.spark.down path { stroke: var(--down); }
.spark-wait { color: var(--ink-3); font-size: .78rem; }

/* phone: each row becomes a compact block, price on the left edge */
@media (max-width: 720px) {
  .prices, .prices tbody, .prices tr, .prices td, .prices tbody th { display: block; }
  .prices thead { display: none; }
  .prices tbody tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "item price" "code chg" "spark spark";
    gap: 2px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .prices td, .prices tbody th { padding: 0; border: 0; }
  .prices tr.group { display: block; }
  .prices tr.group th { display: block; padding: 10px 14px; }
  .board.filtering .prices tr.more:not([hidden]) { display: grid; }
  .prices .nospark, .prices .nochg { display: none; }
  .prices .item { grid-area: item; }
  .prices .code { grid-area: code; align-self: center; }
  .prices .price { grid-area: price; }
  .prices td.num:not(.price) { grid-area: chg; }
  .prices .spark-col { grid-area: spark; width: auto; }
  .spark { width: 100%; height: 26px; margin-top: 4px; }
}

.empty { padding: 22px; border-radius: var(--r); border: 1px dashed var(--line-2); color: var(--ink-2); background: var(--panel); }
.empty p { margin: 0; }
.empty p + p { margin-top: 4px; }
.credit { margin: 14px 2px 0; color: var(--ink-3); font-size: .86rem; }

.method { margin-top: 44px; max-width: 72ch; }
.method ul { margin: 10px 0 0; padding-inline-start: 1.2em; color: var(--ink-2); }
.method li + li { margin-top: 4px; }

/* ---------- material page ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: .86rem; margin-bottom: 12px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs a + a::before { content: "‹"; margin-inline-end: 6px; color: var(--ink-3); }
.item-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 14px 24px; margin-bottom: 22px; }
.item-head h1 { max-width: 30ch; }
.code-box { display: inline-flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--panel);
  border: 1px solid var(--edge); padding-inline-start: 16px; }
.code-label { color: var(--ink-3); font-size: .82rem; }
.code-box code { font-size: 1rem; font-weight: 600; color: var(--ink); letter-spacing: .02em; }
.copy { font: inherit; font-size: .86rem; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  border: 0; background: var(--navy); color: #fff; }
.copy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.copy:hover { background: var(--blue); }

.item-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); gap: 16px; align-items: start; }
.item-side, .item-main { display: grid; gap: 16px; min-width: 0; }
.item-grid section { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px 22px; }
.item-grid h2 { margin-bottom: 10px; }
.quote-date { margin: 0; color: var(--ink-3); font-size: .9rem; }
.quote-price { margin: 4px 0 6px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.quote-price b { font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.3rem); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.quote-price span { color: var(--ink-2); }
.quote-change { margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--ink-3); font-size: .9rem; }
.quote-units { margin: 0 0 12px; display: grid; gap: 0; border-top: 1px solid var(--line); }
.quote-units div, .specs dl div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.quote-units dt, .specs dt { color: var(--ink-3); }
.quote-units dd, .specs dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.quote-range { margin: 0; color: var(--ink-2); font-size: .9rem; }
.specs dl { margin: 0; }
.code-note { margin: 12px 0 0; color: var(--ink-3); font-size: .86rem; }

.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); }
.seg button { font: inherit; font-size: .84rem; border: 0; background: none; color: var(--ink-2); padding: 3px 12px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); font-weight: 700; box-shadow: 0 1px 4px rgba(11, 30, 69, .14); }
.chart { position: relative; height: 240px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid line { stroke: var(--line); }
.chart .axis text { fill: var(--ink-3); font-size: 11px; font-family: "Vazirmatn", Tahoma, sans-serif; }
.chart .area { fill: var(--accent-soft); }
.chart .line { fill: none; stroke: var(--blue); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
:root[data-theme="dark"] .chart .line { stroke: var(--cyan); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chart .line { stroke: var(--cyan); } }
.chart .cursor line { stroke: var(--ink-3); stroke-dasharray: 3 3; }
.chart .cursor circle { fill: var(--panel); stroke: var(--blue); stroke-width: 2.4; }
.chart-note { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--ink-3); text-align: center; padding: 20px;
  border: 1px dashed var(--line-2); border-radius: 10px; }
.chart-readout { margin: 6px 0 0; min-height: 1.85em; color: var(--ink-2); font-size: .9rem; font-variant-numeric: tabular-nums; }

.mini { width: 100%; border-collapse: collapse; font-size: .92rem; }
.mini th { color: var(--ink-3); font-weight: 600; font-size: .8rem; text-align: start; padding: 4px 0 8px; border-bottom: 1px solid var(--line); }
.mini td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.mini .num { text-align: end; }

.related { margin-top: 30px; }
.related h2 { margin-bottom: 10px; }
.related ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.related a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--panel);
  border: 1px solid var(--edge); color: var(--ink); text-decoration: none; }
.related a:hover { border-color: var(--line-2); }
.rel-name { font-size: .9rem; }
.rel-price { display: grid; justify-items: end; gap: 2px; }
.rel-price b { font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .item-grid { grid-template-columns: 1fr; }
  /* phone order: price, chart, specs, recent days */
  .item-side, .item-main { display: contents; }
  .quote { order: 1; } .chart-panel { order: 2; } .specs { order: 3; } .recent { order: 4; }
  .chart { height: 200px; }
}

/* ---------- prose pages ---------- */
.prose { padding-block: 36px 56px; max-width: 78ch; }
.prose h2 { margin: 26px 0 8px; }
.prose pre { background: var(--panel); border: 1px solid var(--edge); border-radius: 10px; padding: 12px 16px; overflow-x: auto; font-size: .9rem; }
.defs div { padding: 8px 0; border-bottom: 1px solid var(--line); }
.defs dt { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; color: var(--ink); text-align: start; }
.defs dd { margin: 2px 0 0; color: var(--ink-2); }
.error-page { padding-top: 80px; }

/* ---------- footer ---------- */
.foot { margin-top: 30px; background: var(--navy); color: #EAF2FA; }
.foot-in { padding-block: 34px 26px; display: grid; gap: 22px; }
.erp { max-width: 70ch; }
.erp h2 { font-size: 1.2rem; color: #fff; }
.erp p { margin: 8px 0 16px; color: #C9DCEE; }
.btn { display: inline-block; font-weight: 700; padding: 9px 20px; border-radius: 999px; background: var(--cyan); color: #04122B; text-decoration: none; }
.btn:hover { background: #3CC8EE; }
.foot-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; padding-top: 16px; border-top: 1px solid rgba(185, 216, 234, .22); font-size: .86rem; color: #B9D8EA; }
.foot-meta a { color: #DDEBF7; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- admin (Operate density, same world) ---------- */
.adm { padding-block: 26px 56px; }
.adm.narrow { max-width: 760px; }
.adm h1 { font-size: 1.6rem; }
.adm .lede { margin: 6px 0 18px; }
.adm-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.adm-nav { margin-inline-start: 18px; }
.adm-site { margin-inline-start: auto; font-size: .9rem; }
.adm-out { margin: 0; }
.adm-card { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.adm-card h2 { margin-bottom: 10px; }
.adm-card h3 { font-size: 1rem; margin: 16px 0 6px; }
.adm-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.adm-cols > .adm-card { margin-bottom: 0; }
.adm-cols + .adm-card { margin-top: 16px; }
.adm-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.adm-table th { text-align: start; color: var(--ink-3); font-weight: 600; font-size: .8rem; padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.adm-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.adm-table .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.adm-table .end { text-align: end; }
.adm-table tr.off td { opacity: .55; }
.adm-table form { margin: 0; }
details summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; color: var(--accent); }
details summary::-webkit-details-marker { display: none; }
details summary svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .15s; }
details[open] summary svg { transform: rotate(-90deg); }
.msg-cell pre, .adm-pre { white-space: pre-wrap; font-size: .78rem; margin: 6px 0 0; max-width: 60ch; color: var(--ink-2); }
.adm-pre { background: var(--panel-2); padding: 10px 12px; border-radius: 10px; max-width: none; }
.status { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--panel-2); color: var(--ink-2); }
.status.OK { background: var(--up-soft); color: var(--up); }
.status.PARTIAL { background: rgba(250, 146, 17, .14); color: #A35A00; }
.status.FAILED { background: var(--down-soft); color: var(--down); }
.tag { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: .76rem; background: var(--panel-2); color: var(--ink-3); border: 1px solid var(--line); }
.muted { color: var(--ink-3); font-size: .9rem; margin: 0 0 10px; }
.btn-sm { font: inherit; font-size: .88rem; font-weight: 600; display: inline-block; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--navy);
  background: var(--navy); color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-sm:hover { background: var(--blue); border-color: var(--blue); }
.btn-sm.ghost { background: transparent; color: var(--accent); border-color: var(--line-2); }
.form { display: grid; gap: 12px; }
.form.inline { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.form label { display: grid; gap: 4px; font-size: .88rem; color: var(--ink-2); font-weight: 600; }
.form label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.form small { color: var(--ink-3); font-weight: 400; font-size: .78rem; }
.form input:not([type="checkbox"]):not([type="radio"]), .form select, .form textarea, .adm-filter input, .adm-filter select {
  font: inherit; font-size: .95rem; font-weight: 400; color: var(--ink); background: var(--ground); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 8px 12px; min-height: 40px; width: 100%; }
.form textarea { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; line-height: 1.6; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; }
.form button { justify-self: start; }
.radios { border: 0; padding: 0; margin: 0; display: flex; gap: 16px; }
.radios legend { font-size: .88rem; color: var(--ink-2); font-weight: 600; margin-bottom: 4px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.adm-filter { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.adm-filter input { width: min(280px, 100%); }
.adm-filter select { width: auto; }
.adm-dl { margin: 16px 0 0; font-size: .85rem; }
.adm-dl div { display: grid; grid-template-columns: 8rem 1fr; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.adm-dl dt { color: var(--ink-3); }
.adm-dl dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.spec-parts { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; direction: ltr; justify-content: flex-end; }
.spec-parts li { font-family: ui-monospace, Consolas, monospace; font-size: .76rem; padding: 1px 8px; border-radius: 999px; background: var(--panel-2); color: var(--ink-2); }
.adm-links { list-style: none; padding: 0; margin: 0 0 12px; }
.adm-links li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.adm-links form { margin: 0; margin-inline-start: auto; }
.adm-flash .msg, .login-card .msg { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; font-size: .92rem; }
.msg.ok { background: var(--up-soft); color: var(--up); }
.msg.err { background: var(--down-soft); color: var(--down); }
.pager { display: flex; gap: 16px; align-items: center; margin-top: 14px; font-size: .9rem; }
.adm-login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(400px, 100%); display: grid; gap: 14px; padding: 30px 26px; border-radius: 18px; background: var(--panel); border: 1px solid var(--edge); box-shadow: var(--shadow); }
.login-card h1 { font-size: 1.3rem; }
.login-card .logo-plate { justify-self: start; }
.login-card .btn { border: 0; font: inherit; font-weight: 700; cursor: pointer; justify-self: stretch; text-align: center; }
@media (max-width: 900px) {
  .adm-top .top-in { flex-wrap: wrap; padding-block: 8px; }
  .adm-nav { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .adm-table { display: block; overflow-x: auto; }
}
