/* ============================================================
   Εταιροσκόπιο — design tokens
   Two styles × two themes:
   - classic (default): ledger aesthetic, paper & ink, a vermilion "seal" accent,
     serif display, mono for identifiers & figures.
   - modern: cool slate neutrals, cobalt accent, Inter throughout, no grain.
   ============================================================ */
:root {
  --font-display: "Literata", "Iowan Old Style", Georgia, serif;
  --font-body: "Geologica", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --r-sm: 8px; --r: 12px; --r-lg: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --rail-w: 232px;
}

:root, [data-theme="light"] {
  --bg: #f4f1ea;
  --bg-glow: rgba(217, 72, 15, .07);
  --surface: #fffdf9;
  --surface-2: #f9f6f0;
  --surface-3: #efebe2;
  --line: #e5e0d4;
  --line-2: #d6cfbf;
  --ink: #17191e;
  --ink-2: #4b505b;
  --ink-3: #8b8f98;
  --accent: #d9480f;
  --accent-ink: #fff;
  --accent-soft: rgba(217, 72, 15, .09);
  --ok: #0f7a6c; --ok-soft: rgba(15, 122, 108, .1);
  --warn: #a8670a; --warn-soft: rgba(168, 103, 10, .1);
  --err: #c0271d; --err-soft: rgba(192, 39, 29, .09);
  --info: #2457a6; --info-soft: rgba(36, 87, 166, .09);
  --shadow-1: 0 1px 0 rgba(23, 25, 30, .04), 0 1px 2px rgba(23, 25, 30, .04);
  --shadow-2: 0 2px 4px rgba(23, 25, 30, .04), 0 12px 32px -8px rgba(23, 25, 30, .14);
  --shadow-3: 0 24px 80px -12px rgba(23, 25, 30, .35);
  --code-bg: #1b1d22; --code-ink: #e4dfd3;
  --grain-opacity: .35;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0b0d11;
  --bg-glow: rgba(255, 122, 61, .08);
  --surface: #12151b;
  --surface-2: #161a21;
  --surface-3: #1d222b;
  --line: #222832;
  --line-2: #2e3542;
  --ink: #eceae4;
  --ink-2: #a8adb7;
  --ink-3: #6a717d;
  --accent: #ff7a3d;
  --accent-ink: #160a03;
  --accent-soft: rgba(255, 122, 61, .12);
  --ok: #3ccfb4; --ok-soft: rgba(60, 207, 180, .12);
  --warn: #f2b84b; --warn-soft: rgba(242, 184, 75, .12);
  --err: #ff6b5e; --err-soft: rgba(255, 107, 94, .12);
  --info: #7aa7ff; --info-soft: rgba(122, 167, 255, .12);
  --shadow-1: 0 1px 0 rgba(0, 0, 0, .3);
  --shadow-2: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 16px 40px -12px rgba(0, 0, 0, .6);
  --shadow-3: 0 30px 90px -10px rgba(0, 0, 0, .8);
  --code-bg: #07090c; --code-ink: #d8d4ca;
  --grain-opacity: .5;
  color-scheme: dark;
}

/* ---------- modern style ---------- */
[data-style="modern"] {
  --font-display: "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --r-sm: 6px; --r: 10px; --r-lg: 14px;
}
[data-style="modern"][data-theme="light"] {
  --bg: #f5f7fa;
  --bg-glow: rgba(37, 99, 235, .045);
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f7;
  --line: #e3e8ef;
  --line-2: #cdd5e0;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #7b8799;
  --accent: #2563eb;
  --accent-ink: #fff;
  --accent-soft: rgba(37, 99, 235, .08);
  --ok: #0f8a7e; --ok-soft: rgba(15, 138, 126, .1);
  --warn: #b45309; --warn-soft: rgba(180, 83, 9, .09);
  --err: #dc2626; --err-soft: rgba(220, 38, 38, .08);
  --info: #0369a1; --info-soft: rgba(3, 105, 161, .08);
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-2: 0 1px 3px rgba(15, 23, 42, .06), 0 12px 28px -10px rgba(15, 23, 42, .14);
  --shadow-3: 0 24px 64px -12px rgba(15, 23, 42, .3);
  --code-bg: #0f172a; --code-ink: #dbe4f0;
  --grain-opacity: 0;
  color-scheme: light;
}
[data-style="modern"][data-theme="dark"] {
  --bg: #090e18;
  --bg-glow: rgba(96, 165, 250, .06);
  --surface: #0f1522;
  --surface-2: #131a29;
  --surface-3: #1a2334;
  --line: #1f2a3c;
  --line-2: #2c3a52;
  --ink: #e5ebf3;
  --ink-2: #9aa8bc;
  --ink-3: #66748a;
  --accent: #60a5fa;
  --accent-ink: #061226;
  --accent-soft: rgba(96, 165, 250, .12);
  --ok: #2dd4bf; --ok-soft: rgba(45, 212, 191, .12);
  --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .12);
  --err: #f87171; --err-soft: rgba(248, 113, 113, .12);
  --info: #38bdf8; --info-soft: rgba(56, 189, 248, .12);
  --shadow-1: 0 1px 0 rgba(0, 0, 0, .3);
  --shadow-2: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 16px 40px -12px rgba(0, 0, 0, .6);
  --shadow-3: 0 30px 90px -10px rgba(0, 0, 0, .8);
  --code-bg: #060a12; --code-ink: #d6deea;
  --grain-opacity: 0;
  color-scheme: dark;
}

/* ============================ base ============================ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font: 400 14px/1.5 var(--font-body);
  color: var(--ink); background: var(--bg);
  font-feature-settings: "ss01", "tnum" 0;
  -webkit-font-smoothing: antialiased;
}
/* atmosphere: corner glow + paper grain */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 500px at 12% -10%, var(--bg-glow), transparent 60%),
    radial-gradient(700px 400px at 100% 0%, var(--bg-glow), transparent 55%);
}
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
[data-theme="dark"] body::after { mix-blend-mode: screen; }

a { color: inherit; text-decoration: none; }
a.link, .prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
svg.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--font-mono); font-feature-settings: "zero"; letter-spacing: -.01em; }
.serif { font-family: var(--font-display); }
.muted { color: var(--ink-3); }
.ink2 { color: var(--ink-2); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ============================ layout ============================ */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }

.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px; border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  backdrop-filter: blur(12px);
}
.logo { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.seal {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  font: 700 21px/1 var(--font-display); color: var(--accent-ink); background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 6px 18px -6px var(--accent);
  transform: rotate(-4deg); transition: transform .5s var(--spring);
}
.logo:hover .seal { transform: rotate(4deg) scale(1.05); }
.logo-text { font: 650 19px/1.05 var(--font-display); letter-spacing: -.01em; display: flex; flex-direction: column; }
.logo-text small { font: 500 10.5px/1.6 var(--font-mono); color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 2px; position: relative; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px;
  color: var(--ink-2); font-weight: 450; transition: color .2s, background .2s;
}
.nav a:hover { color: var(--ink); background: var(--surface-3); }
.nav a.active { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.nav a.active svg { color: var(--accent); }
.nav a .count { margin-left: auto; font: 600 11px var(--font-mono); padding: 1px 7px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); }
.nav-label { font: 500 10.5px var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); padding: 14px 11px 6px; }

.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.meter { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r); border: 1px dashed var(--line-2); }
.meter svg { width: 36px; height: 36px; transform: rotate(-90deg); flex: none; }
.meter circle { fill: none; stroke-width: 3.5; }
.meter .track { stroke: var(--surface-3); }
.meter .val { stroke: var(--ok); stroke-linecap: round; stroke-dasharray: 100 100; transition: stroke-dasharray .6s var(--ease), stroke .3s; }
.meter.low .val { stroke: var(--warn); }
.meter.empty .val { stroke: var(--err); }
.meter b { font: 600 15px var(--font-mono); }
.meter span { font-size: 12px; color: var(--ink-3); }
.meter i { font-style: normal; }
.meter small { display: block; font: 500 10.5px var(--font-mono); color: var(--ink-3); letter-spacing: .02em; }


.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 14px;
  padding: 12px 32px; min-height: 64px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.crumbs b { color: var(--ink); font-weight: 550; overflow: hidden; text-overflow: ellipsis; }
.crumbs .sep { opacity: .5; }
.search-trigger {
  display: flex; align-items: center; gap: 10px; width: min(420px, 40vw); padding: 8px 10px 8px 12px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); cursor: pointer; box-shadow: var(--shadow-1);
  transition: border-color .2s, box-shadow .25s, transform .2s;
}
.search-trigger:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.search-trigger span:nth-child(2) { flex: 1; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
kbd { font: 500 11px var(--font-mono); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-3); }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; transition: color .2s, border-color .2s; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.bell b { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font: 600 10.5px/18px var(--font-mono); text-align: center; animation: pop .5s var(--spring); }
.bell.ring svg { animation: ring .9s var(--ease); transform-origin: 50% 10%; }

.view { padding: 8px 32px 40px; max-width: 1440px; width: 100%; margin: 0 auto; }
.foot { padding: 20px 32px 28px; font-size: 11.5px; color: var(--ink-3); text-align: center; }
.foot a { text-decoration: underline; text-underline-offset: 2px; }

/* ============================ motion ============================ */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

.enter > * { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
.stagger > * { animation: rise .5s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: 30ms; } .stagger > *:nth-child(2) { animation-delay: 80ms; }
.stagger > *:nth-child(3) { animation-delay: 130ms; } .stagger > *:nth-child(4) { animation-delay: 180ms; }
.stagger > *:nth-child(5) { animation-delay: 230ms; } .stagger > *:nth-child(6) { animation-delay: 280ms; }
.stagger > *:nth-child(n+7) { animation-delay: 320ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}

::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ============================ primitives ============================ */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; box-shadow: var(--shadow-1); min-width: 0;
}
.card.hover { transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s; }
.card.hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.eyebrow { display: flex; align-items: center; gap: 8px; font: 500 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 0; }
.eyebrow svg { width: 14px; height: 14px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.015em; margin: 0; }
.display { font: 600 clamp(26px, 3.2vw, 40px)/1.08 var(--font-display); letter-spacing: -.025em; text-wrap: balance; }
.h2 { font-size: 20px; }

.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3-2 { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.mt { margin-top: 16px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 500; font-size: 13px;
  transition: transform .15s var(--ease), border-color .2s, background .2s, box-shadow .2s, color .2s;
}
.btn:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); }
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { box-shadow: 0 8px 20px -8px var(--ink); }
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.accent:hover { box-shadow: 0 8px 24px -8px var(--accent); }
.btn.watching { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.btn.watching svg { fill: currentColor; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--ink); box-shadow: none; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.icon { padding: 7px; }
.btn:disabled { opacity: .45; pointer-events: none; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ink-2); font-weight: 500; }
.input, .field input, .field select {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  font-size: 14px; font-weight: 400; transition: border-color .2s, box-shadow .2s, background .2s;
}
.input:focus, .field input:focus, .field select:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
select { appearance: none; 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='%238b8f98' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right 12px center !important; padding-right: 32px !important; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.err { background: var(--err-soft); color: var(--err); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.solid { background: var(--accent); color: var(--accent-ink); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok .dot { animation: pulse 2.4s infinite; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2); font: 500 12.5px var(--font-mono); cursor: pointer; transition: border-color .2s, background .2s;
}
.chip small { font-family: var(--font-body); color: var(--ink-3); font-weight: 400; }
.chip svg { width: 13px; height: 13px; color: var(--ink-3); }
.chip:hover { border-color: var(--line-2); background: var(--surface); }
.chip.copied { border-color: var(--ok); }
.chip.copied svg { color: var(--ok); }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font: 500 10.5px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; transition: background .15s; }
tr.click:hover { background: var(--surface-2); }
tr.click:hover .name { color: var(--accent); }
.name { font-weight: 550; transition: color .2s; }
.num { font-family: var(--font-mono); text-align: right; white-space: nowrap; }

/* definition lists */
.dl { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; margin: 0; }
.dl dt { color: var(--ink-3); font-size: 12.5px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.dl dd { margin: 0; padding: 9px 0 9px 12px; border-bottom: 1px dashed var(--line); word-break: break-word; }
.dl > :nth-last-child(-n+2) { border-bottom: 0; }

/* skeleton */
.skel { border-radius: 8px; background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 40%, var(--surface-3) 80%) 0 0 / 200% 100%; animation: shimmer 1.4s linear infinite; }
.skel.line { height: 12px; margin: 8px 0; }
.skel.block { height: 100%; min-height: 120px; }
.spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }

.empty { text-align: center; padding: 36px 20px; color: var(--ink-3); }
.empty svg { width: 28px; height: 28px; margin-bottom: 8px; color: var(--ink-3); }
.error-box { padding: 14px 16px; border-radius: var(--r); background: var(--err-soft); color: var(--err); }
pre.code { margin: 0; background: var(--code-bg); color: var(--code-ink); padding: 16px; border-radius: var(--r); overflow: auto; max-height: 640px; font: 12px/1.55 var(--font-mono); }

/* ============================ dashboard ============================ */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 18px 0 22px; flex-wrap: wrap; }
.hero .date { font: 500 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { padding: 18px 20px; overflow: hidden; }
.kpi .v { font: 600 34px/1.1 var(--font-mono); letter-spacing: -.04em; margin: 8px 0 2px; }
.kpi .v small { font-size: 16px; color: var(--ink-3); letter-spacing: 0; }
.kpi .l { color: var(--ink-3); font-size: 12.5px; }
.kpi .spark { position: absolute; right: 16px; top: 18px; color: var(--ink-3); }
.kpi.accent { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.kpi.accent .l, .kpi.accent .eyebrow { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.kpi.accent .v { color: var(--accent); }

.map { height: 440px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--surface-3); position: relative; z-index: 0; }
.map.sm { height: 280px; }
/* map tiles themed to the palette */
.leaflet-tile-pane { filter: grayscale(.85) sepia(.18) contrast(.92) brightness(1.04); }
[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) grayscale(.75) brightness(.78) contrast(.92); }
.leaflet-container { font-family: var(--font-body) !important; background: var(--surface-3) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface) !important; color: var(--ink) !important; box-shadow: var(--shadow-2) !important; border: 1px solid var(--line); }
.leaflet-popup-content-wrapper { border-radius: 12px !important; }
.leaflet-popup-content { margin: 12px 14px !important; font-size: 13px; line-height: 1.45; }
.leaflet-popup-content a { color: var(--accent); }
.leaflet-bar a { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 80%, transparent) !important; color: var(--ink-3) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--ink-2) !important; }
.marker { width: 16px; height: 16px; border-radius: 50%; background: var(--c, var(--accent)); border: 2.5px solid var(--surface); box-shadow: 0 0 0 1px var(--c), 0 4px 12px -2px var(--c); color: var(--c); transition: transform .25s var(--spring); }
.marker.live { animation: pulse 2.2s infinite; }
.leaflet-marker-icon:hover .marker { transform: scale(1.35); }

/* feed timeline */
.feed { position: relative; }
.feed .item { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 12px 8px; margin: 0 -8px; border-radius: 12px; transition: background .2s; }
.feed .item:hover { background: var(--surface-2); }
.feed .item:not(:last-child)::before { content: ""; position: absolute; left: 24px; top: 46px; bottom: -12px; width: 1px; background: var(--line); }
.feed .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); position: relative; z-index: 1; }
.feed .ico svg { width: 16px; height: 16px; }
.feed .item.unread .ico { background: var(--accent-soft); color: var(--accent); }
.feed .item.unread .title::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.feed .meta { font-size: 12px; color: var(--ink-3); display: flex; gap: 6px; flex-wrap: wrap; }
.feed .meta a { color: var(--ink-2); font-weight: 500; }
.feed .meta a:hover { color: var(--accent); }
.feed .title { font-weight: 500; margin-top: 1px; }
.feed .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.feed .item[data-ev] { cursor: pointer; }

/* bars */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bars .b i { display: block; width: 100%; max-width: 34px; min-height: 3px; border-radius: 6px 6px 3px 3px; background: linear-gradient(to top, color-mix(in srgb, var(--accent) 65%, transparent), var(--accent)); transform-origin: bottom; animation: grow-y .8s var(--ease) both; position: relative; }
.bars .b i:hover::after { content: attr(data-n); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); font: 600 11px var(--font-mono); padding: 2px 6px; border-radius: 6px; background: var(--ink); color: var(--bg); }
.bars .b span { font: 500 10px var(--font-mono); color: var(--ink-3); }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; margin: 10px 0; font-size: 12.5px; }
.hbar .lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.hbar .n { font: 600 12px var(--font-mono); }
.hbar .track { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 99px; background: var(--ink); transform-origin: left; animation: grow-x .9s var(--ease) both; }
[data-theme="dark"] .hbar .fill { background: var(--ink-2); }
.hbar:first-of-type .fill { background: var(--accent); }

/* ============================ company ============================ */
.co-hero { padding: 26px 28px; overflow: hidden; }
.co-hero::after {
  content: attr(data-mono); position: absolute; right: -10px; bottom: -48px; font: 700 190px/1 var(--font-display);
  color: var(--ink); opacity: .035; pointer-events: none; letter-spacing: -.05em;
}
.co-hero .titles { font-size: 13px; color: var(--ink-3); margin-top: 8px; max-width: 900px; }
.co-hero .chips { margin-top: 16px; }
.co-actions { display: flex; gap: 8px; align-items: flex-start; }

.tabs { position: sticky; top: 64px; z-index: 40; display: flex; gap: 2px; margin: 16px 0; padding: 4px; border-radius: 13px; background: color-mix(in srgb, var(--surface-3) 85%, transparent); backdrop-filter: blur(12px); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { position: relative; z-index: 1; border: 0; background: none; padding: 7px 14px; border-radius: 9px; cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap; display: flex; gap: 7px; align-items: center; transition: color .25s; }
.tabs button svg { width: 15px; height: 15px; }
.tabs button.active { color: var(--ink); }
.tabs button .n { font: 600 10.5px var(--font-mono); padding: 0 6px; border-radius: 99px; background: var(--surface-3); color: var(--ink-3); }
.tabs button.active .n { background: var(--accent-soft); color: var(--accent); }
.tabs .ind { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; border-radius: 9px; background: var(--surface); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); transition: transform .45s var(--ease), width .45s var(--ease); }

.timeline .year { position: sticky; top: 124px; z-index: 2; display: inline-block; margin: 22px 0 8px; padding: 3px 10px; border-radius: 8px; font: 600 12px var(--font-mono); background: var(--ink); color: var(--bg); }
.timeline .doc { display: grid; grid-template-columns: 96px 1fr auto; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.timeline .doc:last-child { border-bottom: 0; }
.timeline .doc .d { font: 500 12.5px var(--font-mono); }
.timeline .doc .t { font-weight: 550; }


/* ============================ palette ============================ */
.palette { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: start center; padding-top: 12vh; }
.palette-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(8px); animation: fade .2s both; }
.palette-box { position: relative; width: min(640px, calc(100vw - 32px)); border-radius: 18px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-3); overflow: hidden; animation: rise .28s var(--ease) both; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.palette-input input { flex: 1; border: 0; outline: none; background: none; font-size: 17px; color: var(--ink); }
.palette-list { max-height: min(420px, 55vh); overflow-y: auto; padding: 8px; }
.palette-group { font: 500 10.5px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 10px 10px 6px; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; cursor: pointer; }
.palette-item .ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); flex: none; }
.palette-item .ico svg { width: 16px; height: 16px; }
.palette-item .tx { min-width: 0; flex: 1; }
.palette-item .tx b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item .tx small { color: var(--ink-3); font-size: 12px; }
.palette-item kbd { opacity: 0; }
.palette-item.sel { background: var(--surface-3); }
.palette-item.sel .ico { background: var(--accent); color: var(--accent-ink); }
.palette-item.sel kbd { opacity: 1; }
.palette-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); background: var(--surface-2); }
.palette-foot .muted { margin-left: auto; }
mark { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 1px; }

/* ============================ toasts ============================ */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 4000; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  position: relative; display: flex; gap: 12px; width: 360px; max-width: calc(100vw - 40px); padding: 14px 16px; border-radius: 14px; cursor: pointer; overflow: hidden;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-3); animation: toast-in .5s var(--spring) both;
}
.toast.out { animation: toast-out .3s var(--ease) both; }
.toast .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex: none; }
.toast .ico svg { width: 15px; height: 15px; }
.toast small { display: block; opacity: .7; font-size: 12px; margin-top: 2px; }
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--accent); transform-origin: left; animation: grow-x 7s linear reverse both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.95); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

/* ============================ responsive ============================ */
@media (max-width: 1180px) {
  .g-3-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .rail {
    position: fixed; z-index: 100; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; align-items: center;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
  }
  .logo, .nav-label, .meter { display: none; }
  .nav { flex-direction: row; flex: 1; justify-content: space-around; }
  .nav a { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 3px; padding: 6px 2px; font-size: 10.5px; }
  .nav a > span:not(.count) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav a .count { position: absolute; top: 0; right: 4px; margin: 0; }
  .rail-foot { margin: 0; }
  .topbar { padding: 10px 16px; }
  .crumbs { display: none; }
  .search-trigger { flex: 1; width: auto; }
  .search-trigger kbd { display: none; }
  .view { padding: 4px 16px 100px; }
  .foot { padding-bottom: 96px; }
  .g-2 { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { border-bottom: 0; padding-bottom: 0; }
  .dl dd { padding-left: 0; }
  .timeline .doc { grid-template-columns: 1fr; gap: 4px; }
  .co-hero { padding: 20px; }
  .tabs { top: 58px; }
  .table-wrap { margin: 0 -20px; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .v { font-size: 26px; }
}
@media (max-width: 640px) {
  .co-hero > .row { flex-wrap: wrap !important; flex-direction: column-reverse; }
  .co-hero .co-actions { align-self: stretch; }
  .co-hero .co-actions #watch { flex: 1; justify-content: center; }
  .co-hero::after { font-size: 120px; bottom: -30px; }
}

/* ============================ auth ============================ */
.auth { position: fixed; inset: 0; z-index: 5000; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); background: var(--bg); overflow: auto; }
.auth-art { position: relative; overflow: hidden; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; background: var(--ink); color: var(--bg); }
.auth-art::before {
  content: ""; position: absolute; inset: 0; opacity: .09;
  background: repeating-linear-gradient(to bottom, transparent 0 31px, currentColor 31px 32px);
  mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
}
/* opacity sits on the svg: the rise animation ends at opacity 1 on its own element */
.auth-art .bg-mark { position: absolute; right: -90px; bottom: -110px; width: 520px; height: 520px; color: var(--accent); pointer-events: none; animation: rise 1.2s var(--ease) both; }
.auth-art .bg-mark svg { width: 100%; height: 100%; opacity: .14; }
.auth-art .logo-text small { color: inherit; opacity: .5; }
.auth-art .logo-text .wm i { color: inherit; opacity: .75; }
.auth-form { position: relative; }
.auth-prefs { position: absolute; top: 20px; right: 20px; z-index: 1; }
.auth-prefs .seg button { padding: 5px 12px; font-size: 12.5px; }
.auth-art .seal { box-shadow: 0 0 0 4px rgba(255,255,255,.06), 0 10px 30px -10px var(--accent); }
.auth-art h1 { font: 600 clamp(34px, 4.2vw, 60px)/1.04 var(--font-display); letter-spacing: -.03em; max-width: 560px; position: relative; z-index: 1; }
.auth-art h1 em { font-style: italic; color: var(--accent); }
.auth-art ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; position: relative; z-index: 1; }
.auth-art li { display: flex; gap: 12px; align-items: center; opacity: .82; animation: rise .7s var(--ease) both; }
.auth-art li:nth-child(2) { animation-delay: .1s; } .auth-art li:nth-child(3) { animation-delay: .2s; } .auth-art li:nth-child(4) { animation-delay: .3s; }
.auth-art li svg { color: var(--accent); }
.auth-art .fine { font: 500 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; opacity: .5; position: relative; z-index: 1; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(400px, 100%); animation: rise .6s var(--ease) both; }
.auth-card h2 { font-size: 30px; margin-bottom: 6px; }
.auth-card form { display: grid; gap: 14px; margin-top: 26px; }
.auth-card .btn.accent { justify-content: center; padding: 11px; font-size: 14px; }
.auth-switch { margin-top: 18px; font-size: 13px; color: var(--ink-3); }
.auth-switch button { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-weight: 500; }
.auth-err { min-height: 20px; font-size: 13px; color: var(--err); }
.auth-err:not(:empty) { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 32px 24px; min-height: auto; }
  .auth-art ul, .auth-art .fine { display: none; }
  .auth-art h1 { font-size: 30px; margin-top: 24px; }
  .auth-art::after { font-size: 260px; bottom: -80px; right: -30px; }
}

/* user chip in rail */
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; transition: background .2s; }
.user-chip:hover { background: var(--surface-3); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 600 12px var(--font-mono); background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.user-chip .who { min-width: 0; flex: 1; line-height: 1.25; }
.user-chip .who b { display: block; font-weight: 550; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .who small { color: var(--ink-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.feed .sub a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; }
.feed .sub a:hover { color: var(--accent); }
.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
@media (max-width: 860px) { .user-chip .who { display: none; } .user-chip { padding: 4px; } }
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .user-chip { display: none; } }

/* ============================ brand ============================ */
.seal.mark { padding: 5px; color: var(--accent-ink); }
.seal .mark-svg { width: 100%; height: 100%; display: block; }
.logo-text .wm { white-space: nowrap; }
.logo-text .wm i { font-style: normal; font-weight: 400; color: var(--ink-2); }
.logo-text .o svg { display: inline-block; width: .62em; height: .62em; vertical-align: -.02em; margin: 0 .01em 0 .03em; color: var(--accent); }

/* ============================ modern style: components ============================ */
[data-style="modern"] body::before { opacity: .8; }
[data-style="modern"] .seal { transform: none; border-radius: 10px; box-shadow: 0 1px 2px rgba(15, 23, 42, .2), 0 6px 16px -8px var(--accent); }
[data-style="modern"] .logo:hover .seal { transform: scale(1.05); }
[data-style="modern"] .logo-text { font-weight: 700; letter-spacing: -.025em; font-size: 18px; }
[data-style="modern"] .logo-text .wm i { font-weight: 400; color: var(--ink-3); }
[data-style="modern"] h1, [data-style="modern"] h2, [data-style="modern"] h3 { font-weight: 650; letter-spacing: -.02em; }
[data-style="modern"] .display { font-weight: 700; letter-spacing: -.035em; }
[data-style="modern"] .eyebrow,
[data-style="modern"] th,
[data-style="modern"] .nav-label,
[data-style="modern"] .palette-group,
[data-style="modern"] .hero .date { font-family: var(--font-body); font-weight: 600; letter-spacing: .06em; }
[data-style="modern"] .hero .date { color: var(--ink-3); }
[data-style="modern"] .kpi .v { font-family: var(--font-body); font-weight: 650; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
[data-style="modern"] .kpi.accent { background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #0b1f5c)); border-color: transparent; color: #fff; }
[data-style="modern"][data-theme="dark"] .kpi.accent { color: var(--accent-ink); }
[data-style="modern"] .kpi.accent .v { color: inherit; }
[data-style="modern"] .kpi.accent .l, [data-style="modern"] .kpi.accent .eyebrow { color: color-mix(in srgb, currentColor 72%, transparent); }
[data-style="modern"] .dl dt, [data-style="modern"] .dl dd { border-bottom-style: solid; }
[data-style="modern"] .meter { border-style: solid; }
[data-style="modern"] .co-hero::after { font-family: var(--font-body); font-weight: 800; opacity: .03; }
[data-style="modern"] .timeline .year { background: var(--accent-soft); color: var(--accent); }
[data-style="modern"] .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
[data-style="modern"] .btn.primary:hover { box-shadow: 0 8px 20px -8px var(--accent); }
[data-style="modern"] .leaflet-tile-pane { filter: grayscale(1) sepia(.2) hue-rotate(180deg) saturate(1.4) brightness(1.04) contrast(.94); }
[data-style="modern"][data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) grayscale(.7) brightness(.72) contrast(.95); }
[data-style="modern"] .auth-art::before { background: radial-gradient(800px 500px at 0% 100%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 60%); mask-image: none; opacity: .6; }

/* ============================ preferences (rail) ============================ */
.prefs { display: flex; gap: 6px; }
.seg { display: flex; flex: 1; padding: 3px; border-radius: 10px; background: var(--surface-3); }
.seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: none; border-radius: 7px; padding: 5px 0; cursor: pointer; color: var(--ink-3); font-size: 13px; line-height: 1.2; transition: background .2s, color .2s; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg button[data-set-style="classic"] { font-family: "Literata", Georgia, serif; font-weight: 600; }
.seg button[data-set-style="modern"] { font-family: "Inter", system-ui, sans-serif; font-weight: 600; }
.pref-btn { width: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; font: 600 11.5px var(--font-mono); transition: color .2s, border-color .2s; }
.pref-btn:hover { color: var(--ink); border-color: var(--line-2); }
.pref-btn svg { width: 16px; height: 16px; }
/* on phones the bottom bar is navigation only; appearance & language live in Settings */
@media (max-width: 860px) { .prefs { display: none; } }

.seg button svg { width: 14px; height: 14px; }
.pref-rows { display: flex; flex-direction: column; }
.pref-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 0; border-top: 1px solid var(--line); }
.pref-row:first-child { border-top: 0; padding-top: 0; }
.pref-row b { font-weight: 550; display: block; }
.pref-row small { color: var(--ink-3); font-size: 12px; display: block; margin-top: 2px; max-width: 340px; }
.pref-row .seg { flex: 0 0 auto; min-width: 210px; }
.pref-row .seg button { padding: 6px 12px; }
@media (max-width: 520px) { .pref-row { flex-direction: column; align-items: stretch; } .pref-row .seg { min-width: 0; } }
.brand-hero { display: flex; justify-content: center; margin: 0 auto 18px; }
.brand-hero .seal { width: 60px; height: 60px; border-radius: 16px; font-size: 32px; }
.brand-hero .seal.mark { padding: 9px; }

/* ============================ other sources ============================ */
.src-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.src-bar > span { display: inline-flex; align-items: center; gap: 6px; }
.src-bar svg { width: 14px; height: 14px; }
.src { container-type: inline-size; }
/* 6 tiles: one row when there is room, otherwise 3 × 2 or 2 × 3 (never a lone orphan) */
.src-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@container (max-width: 560px) { .src-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.src-tile {
  display: flex; align-items: center; gap: 12px; padding: 14px; text-align: left; cursor: pointer; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1);
  transition: transform .25s var(--ease), border-color .2s, box-shadow .25s;
}
.src-tile:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow-2); }
.src-tile .tx { display: flex; flex-direction: column; min-width: 0; }
.src-tile small { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-tile b { font: 600 22px/1.15 var(--font-mono); letter-spacing: -.03em; white-space: nowrap; }
.src-tile b.long { font-size: 17px; }
.src-tile em { font-style: normal; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-tile.empty b, .src-tile.empty .logo-m { color: var(--ink-3); }
.src-tile.error em, .src-tile.rate-limited em { color: var(--warn); }
.src-tile.error b, .src-tile.rate-limited b { color: var(--ink-3); }
.logo-m { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font: 700 12.5px var(--font-mono); background: var(--surface-3); color: var(--ink-2); flex: none; }
.src-tile.ok .logo-m, .src-card .logo-m { background: var(--accent-soft); color: var(--accent); }
.src-quiet .logo-m { background: var(--surface-3); color: var(--ink-3); }
[data-style="modern"] .src-tile b { font-family: var(--font-body); font-weight: 650; font-variant-numeric: tabular-nums; }

.src-card { padding: 22px 24px; scroll-margin-top: 130px; }
.src-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.src-title { flex: 1; min-width: 0; }
.src-title h3 { font-size: 18px; line-height: 1.25; }
.src-title p { margin: 4px 0 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; max-width: 72ch; }
.src-period { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 99px; background: var(--surface-3); color: var(--ink-2); font-size: 11.5px; white-space: nowrap; }
.src-right { display: flex; gap: 22px; align-items: flex-start; flex: none; }
.src-stat { display: flex; flex-direction: column; align-items: flex-end; }
.src-stat b { font: 600 26px/1.1 var(--font-mono); letter-spacing: -.03em; }
.src-stat small { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
[data-style="modern"] .src-stat b { font-family: var(--font-body); font-weight: 650; font-variant-numeric: tabular-nums; }
.src-card .dl { grid-template-columns: minmax(150px, 32%) 1fr; font-size: 14px; }
.src-card .dl dt { font-size: 13px; padding: 11px 0; }
.src-card .dl dd { padding: 11px 0 11px 14px; line-height: 1.5; }
.src-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.src-foot a { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.src-foot svg { width: 14px; height: 14px; }

.src-table td { padding: 14px 12px; line-height: 1.5; }
.src-table th { padding: 10px 12px; }
.src-table td:first-child, .src-table th:first-child { padding-left: 0; }
.src-table td:last-child, .src-table th:last-child { padding-right: 0; }
.src-table th.num, .src-table td.num { text-align: right; }
.src-table .src-main { min-width: 280px; }
.src-table .src-main > a { font-weight: 550; color: var(--ink); transition: color .2s; }
.src-table .src-main > a:hover { color: var(--accent); }
.src-table .src-main .small { margin-top: 3px; }
.src-table td:nth-child(3) { min-width: 170px; }
.src-table td .tiny.mono { white-space: nowrap; }
.src-table .src-go { width: 1%; }
.src-table .btn.icon.sm { padding: 5px; }
.src-table tbody tr { transition: background .15s; }
.src-table tbody tr:hover { background: var(--surface-2); }
.nowrap { white-space: nowrap; }

.src-quiet { display: grid; gap: 0; padding: 6px 24px; }
.src-quiet > div { padding: 16px 0; border-top: 1px solid var(--line); scroll-margin-top: 130px; }
.src-quiet > div:first-child { border-top: 0; }
.src-quiet .src-head { margin-bottom: 0; align-items: center; }
.src-quiet .src-title h3 { font-size: 15px; }
.src-quiet .src-title p { font-size: 13px; }
.src-quiet .src-err { margin: 8px 0 0 52px; }

.src-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.src-links a { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 14px 40px 14px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); transition: border-color .2s, background .2s; }
.src-links a:hover { border-color: var(--line-2); background: var(--surface); }
.src-links a:hover b { color: var(--accent); }
.src-links b { font-weight: 550; transition: color .2s; }
.src-links small { color: var(--ink-3); font-size: 12.5px; line-height: 1.45; }
.src-links svg { position: absolute; top: 14px; right: 14px; width: 15px; height: 15px; color: var(--ink-3); }

@media (max-width: 860px) {
  .src-card { padding: 18px; }
  .src-card .dl { grid-template-columns: 1fr; }
  .src-card .dl dd { padding-left: 0; }
  .src-head { flex-wrap: wrap; }
  .src-right { width: 100%; justify-content: flex-start; padding-left: 52px; }
  .src-stat { align-items: flex-start; }
  /* tables become stacked rows: main cell full width, the rest underneath */
  .src-table thead { display: none; }
  .src-table, .src-table tbody { display: block; }
  .src-table tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .src-table tr:last-child { border-bottom: 0; }
  .src-table td { display: block; padding: 0 !important; border: 0; min-width: 0 !important; }
  .src-table td.src-main { grid-column: 1 / -1; grid-row: 2; }
  .src-table td.nowrap { grid-row: 1; grid-column: 1; }
  .src-table td.num { grid-row: 1; grid-column: 2; }
  .src-table td:nth-child(3):not(.num) { grid-column: 1 / -1; grid-row: 3; }
  .src-table .src-go { display: none; }
  .src-quiet { padding: 6px 18px; }
  .src-quiet .src-err { margin-left: 0; }
}

/* ============================ source notes, exports, reset ============================ */
.src-note { display: flex; align-items: flex-start; gap: 6px; margin-top: 12px; font-size: 11.5px; line-height: 1.45; color: var(--ink-3); }
.src-note svg { width: 12px; height: 12px; flex: none; margin-top: 2px; opacity: .8; }
.src-note a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; }
.src-note a:hover { color: var(--accent); text-decoration-color: currentColor; }
.src-foot .src-note { margin-top: 0; }
.src-foot > div:first-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sub-bar { padding: 0 2px; }
.auth-eyebrow { font: 500 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
[data-style="modern"] .auth-eyebrow { font-family: var(--font-body); font-weight: 600; letter-spacing: .06em; }
.auth-forgot { justify-self: end; margin-top: -6px; border: 0; background: none; padding: 0; color: var(--ink-3); font-size: 12.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.auth-forgot:hover { color: var(--accent); }
.auth-note { display: flex; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.auth-note svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.auth-note code { display: block; margin-top: 6px; font: 12px var(--font-mono); color: var(--ink); word-break: break-all; }
.user-list { display: flex; flex-direction: column; }
.user-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.user-row .who { flex: 1 1 220px; min-width: 0; }
.user-row:first-child { border-top: 0; padding-top: 0; }
.user-row .who small { display: block; color: var(--ink-3); font-size: 12px; overflow-wrap: anywhere; }
.user-row .reset-row { flex: 1 0 100%; margin-top: 4px; padding: 12px; border-radius: var(--r); background: var(--surface-2); }
.reset-link { display: flex; gap: 8px; }
.reset-link .input { font-size: 12px; }
.auth-card > .auth-note { margin: 22px 0 16px; }

/* ΑΑΔΕ debtors */
.src-debts.listed { border-color: color-mix(in srgb, var(--err) 45%, var(--line)); box-shadow: 0 0 0 3px var(--err-soft), var(--shadow-1); }
.src-debts.listed .logo-m { background: var(--err-soft); color: var(--err); }
.src-debts.listed .src-stat b { color: var(--err); }
.src-debts.clear { padding: 16px 24px; }
.src-debts.clear .src-head { margin-bottom: 0; align-items: center; }
.src-debts.clear .logo-m { background: var(--ok-soft); color: var(--ok); }
.src-debts.clear .src-title h3 { font-size: 15px; }
.src-debts .logo-m svg { width: 18px; height: 18px; }
.co-hero a.pill.err { text-decoration: none; }
.co-hero a.pill.err svg { width: 13px; height: 13px; }

/* ============================ Διασταύρωση ============================ */
.sel-col { width: 1%; padding-right: 0 !important; }
.sel-col input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.x-pick { padding: 14px 16px; }
.x-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.x-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 5px 6px 5px 12px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 550; font-size: 13px; }
.x-chip a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px; }
.x-chip button { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.x-chip button:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.x-chip svg { width: 13px; height: 13px; }
.x-add { display: flex; gap: 6px; flex: 1 1 320px; min-width: 0; }
.x-add .input { padding: 7px 12px; font-size: 13px; }
#xAddMsg:not(:empty) { margin-top: 8px; }

.x-summary { padding: 18px 20px 10px; }
.x-verdict { display: flex; gap: 12px; align-items: flex-start; }
.x-verdict > svg { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.x-verdict b { font-size: 16px; display: block; }
.x-verdict small { color: var(--ink-3); font-size: 12.5px; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.x-verdict.strong > svg { color: var(--err); }
.x-verdict.medium > svg { color: var(--warn); }
.x-verdict.none > svg { color: var(--ok); }
.xg { display: block; width: 100%; height: auto; margin-top: 8px; overflow: visible; }
.xg-co text { font-size: 12.5px !important; }
.xg-edge { fill: none; stroke: var(--line-2); stroke-width: 1.6; }
.xg-edge.strong { stroke: color-mix(in srgb, var(--err) 70%, transparent); stroke-width: 2.2; }
.xg-edge.medium { stroke: color-mix(in srgb, var(--warn) 70%, transparent); stroke-dasharray: 5 4; }
.xg-co rect { fill: var(--surface-2); stroke: var(--line-2); }
.xg-co text { fill: var(--ink); font: 600 13px var(--font-body); }
.xg-co a:hover rect { stroke: var(--accent); }
.xg-node { cursor: pointer; outline: none; }
.xg-node circle { fill: var(--surface); stroke-width: 2; stroke: var(--line-2); transition: r .2s; }
.xg-node.strong circle { stroke: var(--err); fill: var(--err-soft); }
.xg-node.medium circle { stroke: var(--warn); fill: var(--warn-soft); }
.xg-node .xg-ic { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.xg-node text { fill: var(--ink-2); font: 500 12px var(--font-body); }
.xg-node:hover circle, .xg-node:focus-visible circle { r: 18; }
.xg-empty { display: flex; gap: 8px; align-items: center; padding: 14px 0 8px; color: var(--ink-2); }
.xg-empty svg { width: 16px; height: 16px; color: var(--ok); }

.x-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.xf-group { margin: 18px 0 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.xf-group:first-of-type { margin-top: 0; }
.xf { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 14px 10px; margin: 0 -10px; border-radius: 12px; border-top: 1px solid var(--line); transition: background .3s; }
.xf.flash { background: var(--accent-soft); }
.xf-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); }
.xf.strong .xf-ic { background: var(--err-soft); color: var(--err); }
.xf.medium .xf-ic { background: var(--warn-soft); color: var(--warn); }
.xf-ic svg { width: 16px; height: 16px; }
.xf-body { min-width: 0; }
.xf-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.xf-kind { font-size: 12px; color: var(--ink-3); }
.xf-value { font-weight: 600; margin-top: 4px; overflow-wrap: anywhere; }
.xf-members { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.xf-members li { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.xf-members a { font-weight: 550; color: var(--ink); }
.xf-members a:hover { color: var(--accent); }
.xf-members span { color: var(--ink-2); }
.xf-note { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.xf-note a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); }
.xf .src-note { margin-top: 6px; }
.x-sig { padding: 12px 0; border-top: 1px solid var(--line); }
.x-sig:first-of-type { border-top: 0; padding-top: 0; }
.x-sig .name { display: block; margin-bottom: 6px; }
.x-sig .pill svg { width: 12px; height: 12px; }
.xt th[scope="row"] { font: 500 12.5px var(--font-body); text-transform: none; letter-spacing: 0; color: var(--ink-3); white-space: normal; min-width: 150px; border-bottom: 1px solid var(--line); vertical-align: top; padding-top: 12px; }
.xt thead th a { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.xt thead th { white-space: normal; min-width: 180px; vertical-align: bottom; text-transform: none; letter-spacing: 0; font: 600 13px var(--font-body); color: var(--ink); }
.xt thead th a:hover { color: var(--accent); }
.xt-orgs { margin: 0; padding-left: 18px; font-size: 12.5px; display: grid; gap: 3px; }
.xt-orgs li.shared, .xt-key { background: var(--accent-soft); border-radius: 4px; }
.xt-orgs li.shared { padding: 0 4px; margin-left: -4px; }
.xt-key { display: inline-block; width: 14px; height: 10px; vertical-align: middle; }
.x-disclaimer { display: flex; gap: 8px; margin: 18px 2px 0; font-size: 12px; color: var(--ink-3); max-width: 900px; line-height: 1.55; }
.x-disclaimer svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }
@media (max-width: 1100px) { .x-main { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .nav a[data-nav="tools"] { display: none; }
}

/* linked companies */
.rel-list { display: flex; flex-direction: column; }
.rel-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.rel-row:first-child { border-top: 0; padding-top: 0; }
.rel-who { flex: 1 1 260px; min-width: 0; }
.rel-who .tiny-ic { width: 13px; height: 13px; color: var(--accent); fill: currentColor; vertical-align: -1px; }
.rel-why { flex: 2 1 300px; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.rel-why .pill { white-space: normal; }
.x-sugg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.x-sugg-btn { display: inline-flex; align-items: center; gap: 5px; max-width: 320px; padding: 4px 10px 4px 8px; border-radius: 99px; border: 1px dashed var(--line-2); background: none; color: var(--ink-2); font-size: 12.5px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-sugg-btn.strong { border-color: color-mix(in srgb, var(--err) 50%, var(--line)); }
.x-sugg-btn:hover { border-style: solid; color: var(--ink); }
.x-sugg-btn svg { width: 12px; height: 12px; flex: none; }
@media (max-width: 1280px) { #crossBtn .lbl { display: none; } #crossBtn { padding: 7px; } }

/* Μητρώο Φερεγγυότητας */
.src-ins.err { border-color: color-mix(in srgb, var(--err) 45%, var(--line)); box-shadow: 0 0 0 3px var(--err-soft), var(--shadow-1); }
.src-ins.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.src-ins.err .logo-m { background: var(--err-soft); color: var(--err); }
.src-ins.warn .logo-m { background: var(--warn-soft); color: var(--warn); }
.src-ins.clear, .src-ins.quiet { padding: 16px 24px; }
.src-ins.clear .src-head, .src-ins.quiet .src-head { margin-bottom: 0; align-items: center; }
.src-ins.clear .src-title h3, .src-ins.quiet .src-title h3 { font-size: 15px; }
.src-ins.clear .logo-m { background: var(--ok-soft); color: var(--ok); }
.src-ins .pill svg { width: 12px; height: 12px; }
.ins-stage { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: -4px 0 12px 52px; }
@media (max-width: 860px) { .ins-stage { margin-left: 0; } }

.src-tile.alarm { border-color: color-mix(in srgb, var(--err) 45%, var(--line)); }
.src-tile.alarm .logo-m { background: var(--err-soft); color: var(--err); }
.src-tile.alarm em { color: var(--err); }
.src-tile.skipped b { color: var(--ink-3); }
/* ESEF */
.src-esef.quiet { padding: 16px 24px; }
.src-esef.quiet .src-head { margin-bottom: 0; align-items: center; }
.src-esef.quiet .src-title h3 { font-size: 15px; }
.esef-table th[scope="row"] { font: 500 13px var(--font-body); color: var(--ink-2); text-transform: none; letter-spacing: 0; white-space: normal; border-bottom: 1px solid var(--line); padding-left: 0; }
.esef-table thead th.num { text-align: right; }
.esef-table td.num { white-space: nowrap; }
.delta { font: 600 11px var(--font-mono); }
.delta.up { color: var(--ok); }
.delta.down { color: var(--err); }
.neg { color: var(--err); }
@media (max-width: 860px) {
  .esef-table thead { display: table-header-group; }
  .esef-table, .esef-table tbody { display: table; width: 100%; }
  .esef-table tbody { display: table-row-group; }
  .esef-table tr { display: table-row; padding: 0; border: 0; }
  .esef-table td, .esef-table th { display: table-cell; padding: 8px 6px !important; border-bottom: 1px solid var(--line); }
}
/* payments */
.pay-extra { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 28px; margin: 0 0 16px; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); }
@media (max-width: 860px) { .pay-extra { grid-template-columns: 1fr; } }
