/* NOESIS v2 — Cinematic design system (shared by client app and admin console) */
:root {
  --ink-0: #050609; --ink-1: #0A0C11; --ink-2: #10131A; --ink-3: #171B24; --ink-4: #212633;
  --line: rgba(236, 231, 221, .08); --line-2: rgba(236, 231, 221, .14);
  --ivory: #ECE7DD; --ivory-2: #C9C3B8; --mute: #8C9099; --dim: #5F646E;
  --gold: #D4A84B; --gold-2: #F0CE85; --gold-a: rgba(212, 168, 75, .16);
  --cyan: #59C3E6; --cyan-a: rgba(89, 195, 230, .14);
  --rose: #E0728F; --green: #4FC48E; --amber: #E9A23B; --red: #E5615B;
  --r-s: 10px; --r: 16px; --r-l: 24px;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
  --f-display: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --f-body: 'Be Vietnam Pro', system-ui, -apple-system, Segoe UI, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink-0); color: var(--ivory); }
body { font: 15px/1.6 var(--f-body); -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden; }
body::before { /* vignette + light leaks */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(212, 168, 75, .10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(89, 195, 230, .07), transparent 60%),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .55) 100%);
}
body::after { /* film grain */
  content: ''; position: fixed; inset: -50%; pointer-events: none; z-index: 100; opacity: .055;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%{transform:translate(0,0)} 25%{transform:translate(-3%,2%)} 50%{transform:translate(2%,-3%)} 75%{transform:translate(-2%,-1%)} 100%{transform:translate(1%,3%)} }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; letter-spacing: .01em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(34px, 5vw, 64px); }
h2 { font-size: clamp(26px, 3vw, 36px); }
h3 { font-size: 22px; }
p { margin: 0 0 .6em; }
.mono { font-family: var(--f-mono); }
.muted { color: var(--mute); }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }
.eyebrow { font: 600 11px/1 var(--f-mono); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.i { width: 18px; height: 18px; flex: none; }
.i.s { width: 14px; height: 14px; }
.i.l { width: 22px; height: 22px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.grow { flex: 1; min-width: 0; }
.hide { display: none !important; }
@media (max-width: 640px) { .hide-sm { display: none; } }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* ── Buttons & inputs ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2);
  background: rgba(255,255,255,.03); color: var(--ivory); font: 500 14px var(--f-body); cursor: pointer; transition: .2s var(--ease); white-space: nowrap; }
.btn:hover { border-color: rgba(236,231,221,.3); background: rgba(255,255,255,.06); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1A1305; border-color: transparent; font-weight: 600; box-shadow: 0 10px 30px -10px rgba(212,168,75,.6); }
.btn.gold:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: #FFB4AE; border-color: rgba(229,97,91,.4); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.icon { width: 40px; padding: 0; }
.btn.sm.icon { width: 32px; }
input, textarea, select { width: 100%; background: var(--ink-2); color: var(--ivory); border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 10px 12px; font: 14px var(--f-body); transition: .2s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-a); }
textarea { resize: vertical; min-height: 44px; }
label.f { display: block; font-size: 12px; color: var(--mute); margin-bottom: 6px; letter-spacing: .02em; }
.field + .field { margin-top: 12px; }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.grid2 > * { min-width: 0; }

/* ── Chips, tags, badges ── */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--ivory-2); font: 500 13px var(--f-body); cursor: pointer; white-space: nowrap; transition: .2s; }
.chip:hover { color: var(--ivory); border-color: rgba(236,231,221,.3); }
.chip.on { background: var(--ivory); color: var(--ink-0); border-color: var(--ivory); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font: 500 11px/1.4 var(--f-mono); border: 1px solid var(--line-2); color: var(--ivory-2); white-space: nowrap; }
.badge.gold { color: var(--gold-2); border-color: rgba(212,168,75,.4); background: var(--gold-a); }
.badge.cyan { color: var(--cyan); border-color: rgba(89,195,230,.35); background: var(--cyan-a); }
.badge.green { color: var(--green); border-color: rgba(79,196,142,.35); background: rgba(79,196,142,.1); }
.badge.red { color: #FFB4AE; border-color: rgba(229,97,91,.4); background: rgba(229,97,91,.1); }
.badge.amber { color: var(--amber); border-color: rgba(233,162,59,.4); background: rgba(233,162,59,.1); }
.tag { font: 600 10px var(--f-mono); padding: 1px 6px; border-radius: 5px; letter-spacing: .04em; vertical-align: 1px; }
.tag-FACT { background: rgba(79,196,142,.15); color: var(--green); }
.tag-PRIMARY_VIEW { background: var(--gold-a); color: var(--gold-2); }
.tag-INFERENCE { background: var(--cyan-a); color: var(--cyan); }
.cite { font: 500 11px var(--f-mono); color: var(--mute); border-bottom: 1px dotted var(--dim); }

/* ── Panels ── */
.panel { position: relative; background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.012)); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.panel.tight { padding: 14px; }
.panel h3 { font-size: 20px; margin-bottom: 12px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.empty { padding: 40px 20px; text-align: center; color: var(--mute); border: 1px dashed var(--line-2); border-radius: var(--r); }
.chart-empty { padding: 24px; text-align: center; color: var(--dim); font-size: 13px; }
.skeleton { background: linear-gradient(90deg, var(--ink-2), var(--ink-3), var(--ink-2)); background-size: 200% 100%; animation: sk 1.4s infinite; border-radius: var(--r); }
@keyframes sk { to { background-position: -200% 0; } }

/* ── App shell (client) ── */
.shell { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px; padding: 14px clamp(16px, 4vw, 40px);
  background: linear-gradient(180deg, rgba(5,6,9,.92), rgba(5,6,9,.6)); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ivory); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; flex: none; display: block; box-shadow: 0 0 28px -8px rgba(212,168,75,.6); }
.brand-name { font: 600 22px/1 var(--f-display); letter-spacing: .28em; }
.brand-sub { font: 500 10px/1 var(--f-mono); letter-spacing: .2em; color: var(--mute); margin-top: 4px; text-transform: uppercase; }
.nav { display: none; gap: 4px; margin-left: 12px; }
.nav a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; color: var(--ivory-2); font-size: 14px; }
.nav a:hover { color: var(--ivory); text-decoration: none; background: rgba(255,255,255,.04); }
.nav a.on { color: var(--ivory); background: rgba(255,255,255,.07); }
.topbar .spacer { flex: 1; }
.credits { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(212,168,75,.35); background: var(--gold-a); color: var(--gold-2); font: 500 12px var(--f-mono); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(8,9,13,.94); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--mute); font-size: 10.5px; }
.tabbar a.on { color: var(--gold-2); }
.tabbar a:hover { text-decoration: none; }
main.view { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px) 110px; }
@media (min-width: 960px) { .nav { display: flex; } .tabbar { display: none; } main.view { padding-bottom: 60px; } }

/* ── Hero (letterboxed scene) ── */
.hero { position: relative; border-radius: var(--r-l); overflow: hidden; min-height: 420px; display: grid; align-items: end; border: 1px solid var(--line); isolation: isolate; margin-bottom: 28px; }
.hero::before, .hero::after { content: ''; position: absolute; left: 0; right: 0; height: 26px; background: #000; z-index: 3; }
.hero::before { top: 0; } .hero::after { bottom: 0; }
.hero-bg { position: absolute; inset: -40px; z-index: -2; background-size: cover; background-position: center 30%; filter: blur(34px) saturate(.75) brightness(.55); transform: scale(1.2); }
.hero-portrait { position: absolute; right: clamp(24px, 6vw, 90px); top: 50%; transform: translateY(-50%); width: clamp(220px, 26vw, 330px); aspect-ratio: 4/5; margin: 0; z-index: 1;
  border-radius: 200px 200px 18px 18px; overflow: hidden; border: 1px solid rgba(212,168,75,.45); box-shadow: 0 40px 90px -30px rgba(0,0,0,.9), 0 0 0 8px rgba(212,168,75,.05); }
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; animation: kenburns 22s var(--ease) infinite alternate; }
.hero-portrait::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5,6,9,.55), transparent 45%); }
@keyframes kenburns { from { transform: scale(1.02); } to { transform: scale(1.12) translate(-2%, -2%); } }
@media (max-width: 860px) { .hero-portrait { display: none; } .hero-bg { filter: blur(22px) saturate(.8) brightness(.5); } .timecode { display: none; } }
.hero-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(5,6,9,.96) 0%, rgba(5,6,9,.75) 45%, rgba(5,6,9,.25) 100%), linear-gradient(0deg, rgba(5,6,9,.9), transparent 50%); }
.hero-body { position: relative; z-index: 2; padding: 56px clamp(20px, 5vw, 56px) 60px; max-width: 700px; }
@media (min-width: 861px) { .hero-body { max-width: calc(100% - clamp(280px, 32vw, 440px)); } }
.hero h1 { margin: 12px 0 10px; }
.hero h1 em { font-style: italic; color: var(--gold-2); }
.hero .lead { font-size: 17px; color: var(--ivory-2); max-width: 560px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 22px; }
.reel { position: absolute; right: clamp(16px, 3vw, 36px); bottom: 40px; display: flex; gap: 6px; z-index: 4; }
.reel button { width: 28px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.25); border: 0; cursor: pointer; padding: 0; }
.reel button.on { background: var(--gold); }
.timecode { position: absolute; bottom: 52px; right: clamp(16px, 3vw, 36px); font: 500 10.5px var(--f-mono); color: var(--ivory-2); letter-spacing: .14em; z-index: 4; text-shadow: 0 1px 8px #000; }

/* ── Filters ── */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; align-items: center; }
.toolbar .searchbox { flex: 1 1 260px; }
.toolbar select { flex: 0 0 auto; width: auto; }
.toolbar .chips { order: 3; flex: 1 1 100%; }
.searchbox { position: relative; }
.searchbox .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--mute); }
.searchbox input { padding-left: 42px; height: 46px; border-radius: 999px; background: rgba(255,255,255,.03); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 960px) { .toolbar .searchbox { flex: 0 1 420px; } .chips { flex-wrap: wrap; overflow: visible; } }

/* ── Expert cards ── */
.cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.xcard { position: relative; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--ink-1); display: flex; flex-direction: column; transition: .35s var(--ease); }
.xcard:hover { transform: translateY(-4px); border-color: rgba(212,168,75,.35); box-shadow: var(--shadow); }
.xcard-media { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--ink-2); }
.xcard-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; transition: transform 1.2s var(--ease); filter: saturate(.85); }
.xcard:hover .xcard-media img { transform: scale(1.06); }
.xcard-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, var(--ink-1) 2%, transparent 55%); }
.xcard-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; z-index: 2; }
.xcard-body { padding: 0 18px 18px; margin-top: -40px; position: relative; z-index: 2; display: flex; flex-direction: column; flex: 1; }
.xcard h3 { font-size: 26px; }
.xcard .role { color: var(--ivory-2); font-size: 13px; margin: 2px 0 10px; }
.xcard .summary { color: var(--mute); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 12px; }
.models { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.models span { font-size: 11.5px; padding: 3px 8px; border-radius: 6px; background: rgba(255,255,255,.04); color: var(--ivory-2); border: 1px solid var(--line); }
.xcard-foot { margin-top: auto; display: flex; gap: 8px; }
.xcard-foot .btn { flex: 1; }
.fav { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(5,6,9,.6); border: 1px solid var(--line-2); color: var(--ivory-2); cursor: pointer; backdrop-filter: blur(6px); }
.fav.on { color: var(--rose); border-color: rgba(224,114,143,.5); }
.fav.on svg { fill: currentColor; }
.avatar-fallback { width: 100%; height: 100%; display: grid; place-items: center; font: 600 64px var(--f-display); color: var(--gold-2); background: radial-gradient(circle at 30% 20%, #2A2416, var(--ink-2)); }
.lockveil { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5,6,9,.45); z-index: 1; color: var(--gold-2); }

/* ── Expert profile ── */
.profile { display: grid; gap: 24px; }
.profile > * { min-width: 0; }
.starter-links a { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.starter-links a:last-child { border-bottom: 0; }
@media (min-width: 1000px) { .profile { grid-template-columns: 380px 1fr; align-items: start; } .profile-side { position: sticky; top: 90px; } }
.portrait { border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4/5; position: relative; background: var(--ink-2); }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.portrait::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5,6,9,.85), transparent 50%); }
.portrait-cap { position: absolute; left: 20px; right: 20px; bottom: 18px; z-index: 2; }
.modtabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.modtabs button { flex: none; }
.dlist { display: grid; gap: 10px; }
.dl-item { padding: 12px 14px; border-radius: var(--r-s); background: rgba(255,255,255,.025); border: 1px solid var(--line); }
.dl-item b { color: var(--ivory); font-weight: 600; }
.upsell { padding: 18px; border-radius: var(--r); border: 1px solid rgba(212,168,75,.35); background: linear-gradient(135deg, rgba(212,168,75,.12), transparent); }

/* ── Chat ── */
.chat { display: grid; gap: 16px; height: calc(100vh - 170px); min-height: 520px; }
@media (min-width: 1000px) { .chat { grid-template-columns: 280px 1fr; height: calc(100vh - 120px); } }
.convlist { display: none; overflow: auto; }
@media (min-width: 1000px) { .convlist { display: block; } }
.convlist a { display: block; padding: 10px 12px; border-radius: var(--r-s); color: var(--ivory-2); font-size: 13px; border: 1px solid transparent; }
.convlist a:hover { background: rgba(255,255,255,.04); text-decoration: none; }
.convlist a.on { border-color: var(--line-2); background: rgba(255,255,255,.05); color: var(--ivory); }
.stage { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); border-radius: var(--r-l); background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.005)); overflow: hidden; }
.stage-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.stage-head img, .mini-av { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; object-position: 50% 18%; border: 1px solid var(--line-2); flex: none; }
.disclose { font-size: 12px; color: var(--ivory-2); padding: 8px 16px; background: rgba(212,168,75,.07); border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.msgs { flex: 1; overflow-y: auto; padding: 20px 16px; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }
.msg { max-width: 820px; }
.msg.user { align-self: flex-end; background: var(--ivory); color: var(--ink-0); padding: 10px 16px; border-radius: 18px 18px 4px 18px; white-space: pre-wrap; }
.msg.ai { align-self: flex-start; display: flex; gap: 12px; }
.msg.ai .bubble { background: var(--ink-2); border: 1px solid var(--line); padding: 14px 18px; border-radius: 4px 18px 18px 18px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 0 0 .6em; padding-left: 22px; }
.bubble h4 { font: 600 14px var(--f-body); color: var(--gold-2); margin: .8em 0 .3em; }
.bubble code { font: 12.5px var(--f-mono); background: rgba(255,255,255,.06); padding: 1px 5px; border-radius: 4px; }
.msg-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-size: 11.5px; }
.caret::after { content: '▍'; color: var(--gold); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.composer { border-top: 1px solid var(--line); padding: 12px; }
.starters { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 10px; scrollbar-width: none; }
.starters::-webkit-scrollbar { display: none; }
.starters button { flex: none; max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer form { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { border-radius: 22px; padding: 11px 16px; max-height: 160px; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,.02); }
.seg button { border: 0; background: transparent; color: var(--mute); padding: 5px 12px; border-radius: 999px; font: 500 12px var(--f-body); cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.seg button.on { background: var(--ivory); color: var(--ink-0); }
.seg button:disabled { opacity: .45; cursor: not-allowed; }

/* ── Council ── */
.picker { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.pick { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r); border: 1px solid var(--line); background: var(--ink-1); cursor: pointer; text-align: left; color: var(--ivory); font: inherit; transition: .2s; }
.pick:hover { border-color: var(--line-2); }
.pick.on { border-color: var(--gold); background: var(--gold-a); }
.pick:disabled { opacity: .45; cursor: not-allowed; }
.pick img, .pick .mini-av { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; object-position: 50% 18%; }
.timeline { position: relative; display: grid; gap: 18px; margin-top: 24px; }
.act { border-left: 2px solid var(--line-2); padding-left: 20px; position: relative; }
.act::before { content: ''; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--ink-0); border: 2px solid var(--gold); }
.act.wait::before { border-color: var(--dim); }
.act-title { font: 600 11px var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.positions { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* ── Plans ── */
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.plan { display: flex; flex-direction: column; gap: 12px; padding: 22px; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--ink-1); }
.plan.feature { border-color: rgba(212,168,75,.5); background: linear-gradient(180deg, rgba(212,168,75,.12), var(--ink-1) 40%); box-shadow: 0 20px 60px -30px rgba(212,168,75,.5); }
.plan .price { font: 600 30px var(--f-display); }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 13.5px; color: var(--ivory-2); }
.plan li { display: flex; gap: 8px; }
.plan li .i { color: var(--gold); margin-top: 3px; }
.plan .btn { margin-top: auto; }
.qr { width: 220px; height: 220px; border-radius: 12px; background: #fff; padding: 8px; margin: 0 auto; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--mute); }
.kv dd { margin: 0; word-break: break-word; }
.meter { height: 6px; background: var(--ink-3); border-radius: 3px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: 3px; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font: 600 10.5px var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--mute); padding: 12px 14px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.02); white-space: nowrap; }
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t td.row { display: table-cell; white-space: nowrap; }
table.t td.row > * + * { margin-left: 6px; }
table.t tr.click:hover td { background: rgba(255,255,255,.025); }

/* ── Modal & toasts ── */
.modal-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(2,3,5,.72); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.modal-wrap.out { opacity: 0; transition: .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { position: relative; width: 100%; max-width: 460px; max-height: 92vh; overflow: auto; background: var(--ink-1); border: 1px solid var(--line-2); border-radius: var(--r-l); padding: 28px; box-shadow: var(--shadow); animation: rise .3s var(--ease); }
.modal.wide { max-width: 920px; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.modal-x { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--ivory-2); font-size: 20px; cursor: pointer; }
#toasts { position: fixed; z-index: 120; right: 16px; bottom: 86px; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
@media (min-width: 960px) { #toasts { bottom: 24px; } }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--ink-3); border: 1px solid var(--line-2); font-size: 13.5px; box-shadow: var(--shadow); animation: rise .3s var(--ease); }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }
.toast-success { border-color: rgba(79,196,142,.5); }
.toast-error { border-color: rgba(229,97,91,.6); }

/* ── Section headers ── */
.sect { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 36px 0 16px; flex-wrap: wrap; }
.sect h2 em { font-style: italic; color: var(--gold-2); }

/* ── Admin console ── */
.adm { position: relative; z-index: 1; display: grid; min-height: 100vh; }
@media (min-width: 1100px) { .adm { grid-template-columns: 250px 1fr; } }
.adm-side { position: sticky; top: 0; height: 100vh; overflow: auto; display: none; flex-direction: column; gap: 4px; padding: 18px 12px; border-right: 1px solid var(--line); background: rgba(5,6,9,.75); backdrop-filter: blur(10px); }
.adm-side.open { display: flex; position: fixed; z-index: 60; width: 260px; }
@media (min-width: 1100px) { .adm-side { display: flex; } }
.adm-side a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--ivory-2); font-size: 14px; }
.adm-side a:hover { background: rgba(255,255,255,.04); text-decoration: none; color: var(--ivory); }
.adm-side a.on { background: rgba(212,168,75,.12); color: var(--gold-2); }
.adm-side .count { margin-left: auto; font: 600 11px var(--f-mono); color: var(--ink-0); background: var(--gold); border-radius: 999px; padding: 1px 7px; }
.adm-side .grp { font: 600 10px var(--f-mono); letter-spacing: .2em; color: var(--dim); padding: 14px 12px 6px; text-transform: uppercase; }
.adm-main { min-width: 0; padding: 20px clamp(14px, 3vw, 36px) 60px; }
.adm-top { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.adm-top h1 { font-size: clamp(28px, 3.4vw, 42px); }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.kpi { padding: 16px 18px; border-radius: var(--r); border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.03), transparent); }
.kpi .k { font: 600 10px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }
.kpi .v { font: 600 30px/1.2 var(--f-display); margin-top: 6px; }
.kpi .s { font-size: 12px; color: var(--mute); }
.cols { display: grid; gap: 16px; }
@media (min-width: 1100px) { .cols.c2 { grid-template-columns: 1fr 1fr; } .cols.c3 { grid-template-columns: 2fr 1fr; } }
.spark { width: 100%; height: 90px; display: block; }
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 160px) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.hbar-l { color: var(--ivory-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-t { height: 8px; border-radius: 4px; background: var(--ink-3); overflow: hidden; }
.hbar-f { display: block; height: 100%; border-radius: 4px; }
.hbar-v { font: 500 12px var(--f-mono); color: var(--mute); }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--dim); }
.status-dot.ok { background: var(--green); box-shadow: 0 0 10px var(--green); }
.status-dot.warn { background: var(--amber); }
.status-dot.bad { background: var(--red); }
.stages { display: flex; gap: 3px; }
.stages span { width: 18px; height: 6px; border-radius: 3px; background: var(--ink-4); }
.stages span.done { background: var(--gold); }
.stages span.cur { background: var(--cyan); }
pre.code { font: 12px/1.5 var(--f-mono); background: var(--ink-0); border: 1px solid var(--line); border-radius: var(--r-s); padding: 12px; overflow: auto; max-height: 420px; white-space: pre-wrap; word-break: break-word; }
textarea.code { font: 12px/1.5 var(--f-mono); min-height: 360px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(880px, 100vw); z-index: 80; background: var(--ink-1); border-left: 1px solid var(--line-2); box-shadow: var(--shadow); overflow: auto; padding: 24px; animation: slide .3s var(--ease); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer-x { position: sticky; top: 0; float: right; }
.vline { display: grid; gap: 8px; }
.vrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; border-radius: var(--r-s); border: 1px solid var(--line); }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; z-index: 1; }

/* v2.1 two-level catalogue */
.toolbar .chips.groups { order: 3; flex: 1 1 100%; }
.toolbar .chips.sub { order: 4; flex: 1 1 100%; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.025); border: 1px solid var(--line); }
.chips.sub .chip { height: 28px; font-size: 12.5px; }
.chip .n { font: 500 11px var(--f-mono); opacity: .6; }
.chip.on .n { opacity: .75; }
.chip.soon { color: var(--mute); border-style: dashed; }
.chip.soon .n { opacity: 1; color: var(--gold-2); }
.gold-t { color: var(--gold-2); font-weight: 600; }
[hidden] { display: none !important; }

/* v2.1 admin: daily pipeline */
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.flow-step { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); min-width: 0; }
.flow-step b { font-size: 13px; }
.note { padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(212,168,75,.35); background: var(--gold-a); font-size: 13.5px; color: var(--ivory-2); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--gold-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font: inherit; }
.t.compact td, .t.compact th { padding: 8px 10px; }
.chip.on.soon { color: var(--ink-0); border-style: solid; } .chip.on.soon .n { color: var(--ink-0); opacity: .6; }
.t.compact td:first-child { min-width: 190px; }
@media (max-width: 700px) { .flow { display: flex; overflow-x: auto; scrollbar-width: none; } .flow::-webkit-scrollbar { display: none; } .flow-step { flex: 0 0 150px; } }
.t.cands td:first-child { min-width: 0; width: 32px; }
.t.cands td:nth-child(2) { min-width: 220px; }
.nowrap { white-space: nowrap; }
/* council roundtable */
.council { margin-top: 20px; }
.council-thread { display: flex; flex-direction: column; gap: 14px; }
.council-note { align-self: center; font: 600 11px var(--f-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); margin: 6px 0 -2px; }
.council-foot { margin: 4px 0 0; }
.council form.composer { display: flex; gap: 8px; align-items: flex-end; margin-top: 16px; padding: 12px 0 0; }
.council form.composer textarea { border-radius: 22px; padding: 11px 16px; max-height: 160px; }
/* profile poster — a fixed 1024px sheet scaled to its container */
.pp-tools { margin-bottom: 10px; }
.pp-fit { position: relative; width: 100%; overflow: hidden; border-radius: 14px; }
.pp { --pp-accent: #D4A84B; position: absolute; top: 0; left: 0; width: 1024px; transform-origin: 0 0; padding: 40px 36px 26px; color: #E9E4D8;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(255,255,255,.07), transparent 60%), linear-gradient(180deg, #0E1424, #0A0E19 70%, #090C15);
  font: 15px/1.5 var(--f-body); }
.pp h1 { font: 700 76px/0.95 var(--f-display); letter-spacing: .02em; text-transform: uppercase; color: var(--pp-accent); margin: 6px 0 8px;
  background: linear-gradient(180deg, #F7E3AE, var(--pp-accent) 60%, #9C7630); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.pp-head { text-align: center; margin-bottom: 22px; }
.pp-kicker { font: 600 12px var(--f-mono); letter-spacing: .3em; text-transform: uppercase; color: #9AA3B5; }
.pp-tag { font: 600 19px var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: #F3EEE2; }
.pp-grid { display: grid; grid-template-columns: 270px 1fr 300px; gap: 18px; align-items: start; }
.pp-grid.two { grid-template-columns: 1fr 1fr; margin-top: 16px; }
.pp-col { display: grid; gap: 16px; }
.pp-box { border: 1px solid rgba(212,168,75,.32); border-radius: 14px; padding: 16px 16px 14px; background: rgba(10,14,25,.72); }
.pp-box.flat { margin-top: 16px; }
.pp-box h4, .pp-band h4 { font: 700 13px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--pp-accent); margin: 0 0 12px; text-align: center; }
.pp-time { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid rgba(212,168,75,.45); display: grid; gap: 11px; }
.pp-time li { position: relative; display: grid; }
.pp-time li::before { content: ''; position: absolute; left: -23px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--pp-accent); box-shadow: 0 0 0 3px rgba(212,168,75,.2); }
.pp-time b { font: 700 18px var(--f-display); color: var(--pp-accent); line-height: 1.1; }
.pp-time span { font-size: 13px; color: #D8D2C4; }
.pp-center { display: grid; gap: 14px; justify-items: center; }
.pp-portrait { position: relative; width: 100%; aspect-ratio: 4 / 4.6; border-radius: 16px; overflow: hidden; border: 1px solid rgba(212,168,75,.35); background: #121828; }
.pp-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; display: block; }
.pp-mono { display: grid; place-items: center; width: 100%; height: 100%; font: 700 120px var(--f-display); color: var(--pp-accent); }
.pp-life { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px; text-align: center; font: 600 14px var(--f-mono); letter-spacing: .2em; color: #F3EEE2; background: linear-gradient(180deg, transparent, rgba(5,8,15,.85)); }
.pp-quote { margin: 0; text-align: center; font: italic 600 21px/1.35 var(--f-display); color: #F3E3B8; }
.pp-quote cite, .pp-q cite { display: block; margin-top: 6px; font: 400 11.5px/1.4 var(--f-body); font-style: normal; color: #8E97A8; }
.pp-intro { margin: 0; text-align: center; color: #CFC9BC; font-size: 14.5px; }
.pp-intro.wide { margin: 18px auto 0; max-width: 820px; }
.pp-ach { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.pp-ach:last-child { border-bottom: 0; }
.pp-ach b { font-size: 13.5px; color: #F3E3B8; text-transform: uppercase; letter-spacing: .04em; }
.pp-ach span { font-size: 13px; color: #CFC9BC; }
.pp-nums { display: grid; gap: 10px; }
.pp-nums div { display: grid; }
.pp-nums b { font: 700 28px/1 var(--f-display); color: var(--pp-accent); }
.pp-nums span { font-size: 12.5px; color: #B9B3A6; }
.pp-band { margin-top: 18px; border: 1px solid rgba(212,168,75,.32); border-radius: 14px; padding: 16px; background: rgba(10,14,25,.72); }
.pp-pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.pp-pillars div { padding: 4px 16px; border-left: 1px solid rgba(212,168,75,.25); display: grid; gap: 4px; }
.pp-pillars div:first-child { border-left: 0; }
.pp-pillars b { color: #F3E3B8; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.pp-pillars span { color: #CFC9BC; font-size: 13px; }
.pp-q { margin: 0 0 12px; font: italic 500 16px/1.4 var(--f-display); color: #EFE6CF; }
.pp-q:last-child { margin-bottom: 0; }
.pp-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pp-check li { position: relative; padding-left: 26px; font-size: 14px; color: #E2DCCF; }
.pp-check li::before { content: '✓'; position: absolute; left: 0; top: -1px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: #0A0E19; background: var(--pp-accent); }
.pp-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pp-chips span { padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(212,168,75,.35); color: #EDE3C8; font-size: 12.5px; background: rgba(212,168,75,.08); }
.pp-foot { display: flex; justify-content: space-between; gap: 16px; margin-top: 18px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11px; color: #7F889A; }
/* admin quick review */
.qr-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink-1, #0E1320); }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.qr-card { position: relative; display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--ink-2); color: inherit; cursor: pointer; font: inherit; }
.qr-card:hover { border-color: var(--line-2); }
.qr-card.on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-a); }
.qr-tick { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); color: transparent; }
.qr-card.on .qr-tick { background: var(--gold); border-color: var(--gold); color: #1A1305; }
.qr-top { display: flex; gap: 10px; align-items: center; padding-right: 28px; }
.qr-mono { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font: 600 15px var(--f-display); color: var(--gold-2); background: var(--gold-a); }
.qr-score { font: 600 14px var(--f-mono); }
.qr-bars { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.06); }
.qr-bars i { display: block; height: 100%; }
.qr-bars i.d { background: #59C3E6; }
.qr-bars i.p { background: var(--gold); }
.qr-why { color: var(--muted, #B9B3A6); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.qr-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.qr-risk { color: #FFB4AE; }
/* v2.7 quick review: publish queue */
.btn.xs { height: 26px; padding: 0 10px; font-size: 12px; }
.qr-add { gap: 8px; align-items: center; padding: 10px; margin-bottom: 10px; border: 1px dashed var(--line-2); border-radius: 12px; }
.qr-card.nosel { cursor: default; }
.qr-face { flex: none; width: 56px; height: 70px; object-fit: cover; object-position: 50% 20%; border-radius: 10px; background: #0B0F1A; cursor: zoom-in; }
.qr-gate { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.qr-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.qr-acts:empty { display: none; }
.pp-portrait img { background: #0B0F1A; }

/* ── v2.8: flexible library views, customer dashboard, wider screens ── */
@media (min-width: 1680px) { main.view { max-width: 1560px; } }
@media (max-width: 640px) { .hero { min-height: 360px; } .hero-body { padding: 44px 20px 54px; } .sect { margin: 28px 0 12px; } }
.nowrap { white-space: nowrap; }
.clamp1 { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-seg button { padding: 6px 10px; }
.icon-seg button .i { width: 15px; height: 15px; }
@media (max-width: 640px) { .toolbar .searchbox { flex: 1 1 100%; } .toolbar select { flex: 1 1 auto; max-width: none !important; } }
.fav.sm { width: 30px; height: 30px; }

/* compact portrait grid */
.cards.compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
@media (min-width: 960px) { .cards.compact { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; } }
.ccard { position: relative; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--ink-1); transition: .3s var(--ease); }
.ccard:hover { border-color: rgba(212,168,75,.35); transform: translateY(-3px); box-shadow: var(--shadow); }
.ccard-media { display: block; aspect-ratio: 4/5; position: relative; overflow: hidden; background: var(--ink-2); }
.ccard-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; transition: transform 1s var(--ease); }
.ccard:hover .ccard-media img { transform: scale(1.05); }
.ccard-media .avatar-fallback { font-size: 44px; }
.ccard-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5,6,9,.95) 4%, rgba(5,6,9,.25) 45%, transparent 70%); }
.ccard-lock { position: absolute; top: 10px; left: 10px; z-index: 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(5,6,9,.65); color: var(--gold-2); }
.ccard .fav { position: absolute; top: 10px; right: 10px; z-index: 3; }
.ccard-new { position: absolute; top: 12px; left: 44px; z-index: 2; }
.ccard-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.ccard-name { font: 600 19px/1.15 var(--f-display); color: var(--ivory); }
.ccard-name:hover { text-decoration: none; color: var(--gold-2); }
.ccard-dom { font: 500 10.5px/1.3 var(--f-mono); letter-spacing: .04em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ccard-go { margin-top: 8px; align-self: flex-start; }

/* list rows */
.cards.list { grid-template-columns: 1fr; gap: 8px; }
.lrow { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--ink-1); transition: border-color .2s; }
@media (min-width: 900px) { .lrow { grid-template-columns: 64px 1fr auto auto; padding: 12px 16px; } }
.lrow:hover { border-color: rgba(212,168,75,.35); }
.lrow-av { width: 56px; height: 56px; border-radius: 14px; overflow: hidden; display: block; background: var(--ink-2); }
@media (min-width: 900px) { .lrow-av { width: 64px; height: 64px; } }
.lrow-av img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.lrow-av .avatar-fallback { font-size: 24px; }
.lrow-main { min-width: 0; }
.lrow-name { font: 600 20px/1.2 var(--f-display); color: var(--ivory); }
.lrow-meta { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lrow-act { display: flex; gap: 8px; align-items: center; }

/* customer dashboard */
.dash-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin: 8px 0 22px; }
.dash-head h2 em { font-style: italic; color: var(--gold-2); }
.dash-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) { .dash-actions { width: 100%; } .dash-actions .btn { flex: 1 1 auto; justify-content: center; } }
.dash-kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
@media (min-width: 760px) { .dash-kpis { grid-template-columns: 1.3fr 1fr 1fr 1fr; } }
@media (min-width: 1000px) { .dash-kpis { gap: 16px; } }
.kpi-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: var(--r); border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01)); color: var(--ivory); min-width: 0; }
a.kpi-card:hover { text-decoration: none; border-color: rgba(212,168,75,.35); }
.kpi-card.accent { background: linear-gradient(160deg, rgba(212,168,75,.16), rgba(212,168,75,.03) 60%); border-color: rgba(212,168,75,.3); }
.kpi-label { display: inline-flex; align-items: center; gap: 7px; font: 500 11px/1.2 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.kpi-card.accent .kpi-label { color: var(--gold); }
.kpi-value { font: 600 clamp(28px, 4vw, 40px)/1 var(--f-display); color: var(--ivory); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-value.sm { font-size: clamp(22px, 2.6vw, 30px); white-space: normal; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kpi-of { font-size: .5em; color: var(--dim); margin-left: 2px; }
.kpi-sub { font-size: 12px; color: var(--mute); }
.dash-alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r); margin-bottom: 16px; border: 1px solid rgba(233,162,59,.4); background: rgba(233,162,59,.08); color: #F3C77E; font-size: 13.5px; }
.dash-alert:hover { text-decoration: none; background: rgba(233,162,59,.12); }
.dash-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.dash-grid > * { min-width: 0; }
@media (min-width: 1000px) { .dash-grid { grid-template-columns: 1.7fr 1fr; } .dash-grid.two { grid-template-columns: 1fr 1fr; } }
@media (min-width: 640px) and (max-width: 999px) { .dash-grid.two { grid-template-columns: 1fr 1fr; } .dash-side { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .dash-side > .panel + .panel { margin-top: 0; } }
.dash-side > .panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head h3 { margin: 0; }
.recent-list { display: grid; gap: 6px; }
@media (min-width: 1200px) { .recent-list { grid-template-columns: 1fr 1fr; gap: 8px; } }
.recent-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-s); border: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--ivory); min-width: 0; }
.recent-item:hover { text-decoration: none; border-color: rgba(212,168,75,.35); background: rgba(255,255,255,.04); }
.recent-item .grow { min-width: 0; }
.spark-bars { display: flex; align-items: flex-end; gap: 4px; height: 96px; padding-top: 6px; }
.spark-bars span { flex: 1; border-radius: 3px 3px 1px 1px; background: linear-gradient(180deg, var(--gold-2), var(--gold)); min-height: 3px; }
.spark-bars span.zero { background: var(--ink-4); }
.top-list { display: grid; gap: 6px; }
.top-item { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: var(--r-s); color: var(--ivory); }
.top-item:hover { text-decoration: none; background: rgba(255,255,255,.03); }
.top-item .mini-av { width: 36px; height: 36px; border-radius: 10px; }
.dash-fold { margin-top: 16px; }
.dash-fold > summary { list-style: none; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; cursor: pointer; }
.dash-fold > summary::-webkit-details-marker { display: none; }
.dash-fold > summary h3 { margin: 0; }
.dash-fold > summary::after { content: '▾'; color: var(--mute); margin-left: 8px; transition: transform .2s; }
.dash-fold[open] > summary::after { transform: rotate(180deg); }
.dash-account { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; padding: 14px 18px; border-radius: var(--r); border: 1px solid var(--line); }
@media (min-width: 1000px) { .dash-grid { align-items: start; } }
@media (max-width: 640px) {
  .kpi-card { padding: 14px; }
  .kpi-value.sm { white-space: normal; font-size: 22px; line-height: 1.15; }
  .kpi-label { letter-spacing: .08em; }
  .dash-account .grow { flex-basis: 100%; }
  .dash-account .btn { flex: 1 1 auto; justify-content: center; }
  /* tables that read as cards on phones */
  table.t.stack-sm thead { display: none; }
  table.t.stack-sm, table.t.stack-sm tbody, table.t.stack-sm tr, table.t.stack-sm td { display: block; width: 100%; }
  table.t.stack-sm tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  table.t.stack-sm td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.t.stack-sm td[data-l]::before { content: attr(data-l); color: var(--mute); font: 500 11px var(--f-body); text-align: left; }
  table.t.stack-sm td:empty { display: none; }
  table.t.stack-sm td:last-child:not(:empty) { justify-content: flex-end; padding-top: 6px; }
}
