/* =========================================================================
   ONYX — portal design system (client + admin)
   Rule: no boxy buttons. Every control is a pill with depth.
   ========================================================================= */
:root {
  --bg: #0a0908;
  --bg-2: #11100e;
  --s1: #161512;
  --s2: #1d1b17;
  --s3: #26231e;
  --line: rgba(241,235,224,.08);
  --line-2: rgba(241,235,224,.14);
  --tx: #f1ebe0;
  --tx-2: rgba(241,235,224,.62);
  --tx-3: rgba(241,235,224,.4);
  --gold: #c9a45c; --gold-hi: #f3d79a; --gold-lo: #7a5c26;
  --ok: #4fc38a; --ok-hi: #8ff0c0;
  --warn: #e9a23b; --bad: #e0574f; --info: #6fa3ff;
  --g-gold: linear-gradient(135deg, #f6e2b0 0%, #d8b46c 40%, #a57d3a 75%, #f0d593 100%);
  --g-ok: linear-gradient(135deg, #8ff0c0, #3fb47e);
  --g-bad: linear-gradient(135deg, #ff9f95, #d4473f);
  --g-panel: linear-gradient(165deg, rgba(38,35,30,.92) 0%, rgba(20,19,16,.96) 100%);
  --sh-panel: 0 0 0 1px var(--line) inset, 0 1px 0 rgba(255,255,255,.04) inset, 0 24px 60px -30px rgba(0,0,0,.9), 0 8px 20px -12px rgba(0,0,0,.6);
  --sh-gold: 0 10px 28px -10px rgba(201,164,92,.6), 0 1px 0 rgba(255,255,255,.4) inset, 0 -3px 8px rgba(80,55,15,.3) inset;
  --r: 30px;
  --f: 'Archivo', system-ui, sans-serif;
  --f-serif: 'Instrument Serif', Georgia, serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.16,1,.3,1);
  --side: 264px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--tx); font-family: var(--f); font-size: 15px; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; background:
  radial-gradient(1200px 600px at 85% -10%, rgba(201,164,92,.10), transparent 60%),
  radial-gradient(900px 500px at -10% 110%, rgba(111,163,255,.05), transparent 60%), var(--bg); background-attachment: fixed; }
a { color: inherit; text-decoration: none; }
em { font-family: var(--f-serif); font-style: italic; font-weight: 400; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--gold); color: #000; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
.mono { font-family: var(--f-mono); }
.muted { color: var(--tx-2); } .dim { color: var(--tx-3); }
.gold { color: var(--gold-hi); }
.up { color: var(--ok-hi); } .down { color: #ff9f95; }
.hide { display: none !important; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 22px 16px; border-right: 1px solid var(--line); background: linear-gradient(180deg, rgba(17,16,14,.9), rgba(10,9,8,.9)); backdrop-filter: blur(20px); z-index: 20; }
.side__brand { display: flex; align-items: center; gap: 10px; padding: 6px 12px 22px; }
.side__brand svg { width: 30px; height: 30px; }
.side__brand b { font-weight: 800; letter-spacing: .14em; font-variation-settings: 'wdth' 118; }
.side__brand em { color: var(--gold-hi); margin-left: 3px; }
.side__brand small { display: block; font: 400 9px/1 var(--f-mono); letter-spacing: .2em; color: var(--tx-3); margin-top: 4px; text-transform: uppercase; }
.side__label { padding: 18px 14px 8px; font: 400 10px/1 var(--f-mono); letter-spacing: .2em; color: var(--tx-3); text-transform: uppercase; }
.nav-pill { position: relative; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 16px; border-radius: 999px; color: var(--tx-2); font-weight: 500; transition: color .3s, background .3s, box-shadow .3s; }
.nav-pill svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.nav-pill:hover { color: var(--tx); background: rgba(255,255,255,.04); }
.nav-pill.is-active { color: #1a1206; background: var(--g-gold); box-shadow: var(--sh-gold); font-weight: 600; }
.nav-pill.is-active svg { opacity: 1; }
.nav-pill .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; display: grid; place-items: center; font: 600 11px/1 var(--f-mono); color: #fff; background: var(--g-bad); box-shadow: 0 4px 12px -4px rgba(224,87,79,.7); }
.nav-pill.is-active .count { background: #1a1206; color: var(--gold-hi); box-shadow: none; }
.side__foot { margin-top: auto; display: grid; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 999px; background: rgba(255,255,255,.03); box-shadow: 0 0 0 1px var(--line) inset; }
.me__name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.me__mail { font-size: 11px; color: var(--tx-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 700 13px/1 var(--f); color: #1a1206; background: var(--g-gold); box-shadow: var(--sh-gold); }
.avatar--sm { width: 30px; height: 30px; font-size: 11px; }
.avatar--lg { width: 64px; height: 64px; font-size: 22px; }
.main { min-width: 0; padding: 26px clamp(16px, 3vw, 40px) 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.topbar h1 { font-weight: 800; font-size: clamp(28px, 3vw, 42px); line-height: 1; font-variation-settings: 'wdth' 85; }
.topbar h1 em { color: var(--gold-hi); font-size: 1.05em; }
.topbar p { margin: 8px 0 0; color: var(--tx-2); }
.topbar__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn.burger { display: none; }
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-105%); transition: transform .5s var(--ease); box-shadow: 30px 0 80px rgba(0,0,0,.6); }
  .nav-open .side { transform: none; }
  .btn.burger { display: inline-flex; }
  .topbar { flex-wrap: wrap; }
}

/* ---------- pills (buttons) ---------- */
.btn { --h: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 20px; border: 0; border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: 14px; white-space: nowrap; position: relative; overflow: hidden; isolation: isolate; transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .35s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn--sm { --h: 34px; padding: 0 14px; font-size: 13px; }
.btn--xs { --h: 28px; padding: 0 11px; font-size: 12px; }
.btn--lg { --h: 52px; padding: 0 28px; font-size: 15px; }
.btn--block { width: 100%; }
.btn--icon { width: var(--h); padding: 0; }
.btn--gold { color: #1a1206; background: var(--g-gold); box-shadow: var(--sh-gold); }
.btn--gold::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.6) 50%, transparent 70%); transform: translateX(-120%); transition: transform .8s var(--ease); }
.btn--gold:hover::before { transform: translateX(120%); }
.btn--gold:hover { box-shadow: 0 16px 36px -10px rgba(201,164,92,.75), 0 1px 0 rgba(255,255,255,.4) inset, 0 -3px 8px rgba(80,55,15,.3) inset; }
.btn--glass { color: var(--tx); background: linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,255,255,.025)); box-shadow: 0 0 0 1px var(--line-2) inset, 0 1px 0 rgba(255,255,255,.08) inset, 0 10px 24px -14px rgba(0,0,0,.8); }
.btn--glass:hover { background: linear-gradient(135deg, rgba(243,215,154,.16), rgba(255,255,255,.04)); box-shadow: 0 0 0 1px rgba(243,215,154,.35) inset, 0 12px 26px -14px rgba(201,164,92,.4); }
.btn--ok { color: #0b2016; background: var(--g-ok); box-shadow: 0 10px 24px -10px rgba(79,195,138,.6), 0 1px 0 rgba(255,255,255,.4) inset; }
.btn--bad { color: #2a0705; background: var(--g-bad); box-shadow: 0 10px 24px -10px rgba(224,87,79,.6), 0 1px 0 rgba(255,255,255,.35) inset; }
.btn--ghost { color: var(--tx-2); background: transparent; box-shadow: 0 0 0 1px var(--line) inset; }
.btn--ghost:hover { color: var(--tx); box-shadow: 0 0 0 1px var(--line-2) inset; background: rgba(255,255,255,.03); }
.btn:focus-visible, .nav-pill:focus-visible, .seg button:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }

/* ---------- segmented pill tabs ---------- */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; border-radius: 999px; background: rgba(0,0,0,.35); box-shadow: 0 0 0 1px var(--line) inset, 0 2px 8px rgba(0,0,0,.4) inset; }
.seg button { height: 34px; padding: 0 15px; border: 0; border-radius: 999px; background: transparent; color: var(--tx-2); font-size: 13px; font-weight: 500; cursor: pointer; transition: all .3s var(--ease); white-space: nowrap; }
.seg button:hover { color: var(--tx); }
.seg button.is-on { color: #1a1206; background: var(--g-gold); box-shadow: var(--sh-gold); font-weight: 600; }
.seg button .n { margin-left: 6px; font: 500 11px/1 var(--f-mono); opacity: .7; }
.seg--scroll { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }

/* ---------- panels ---------- */
.panel { position: relative; border-radius: var(--r); background: var(--g-panel); box-shadow: var(--sh-panel); padding: 24px; min-width: 0; }
.panel--flush { padding: 0; overflow: hidden; }
.panel--glow::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(600px 200px at 100% 0%, rgba(201,164,92,.13), transparent 70%); }
.panel__h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel__h h3 { font-size: 15px; font-weight: 600; letter-spacing: 0; }
.panel__h .sub { font: 400 11px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--tx-3); }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; } .span-all { grid-column: 1 / -1; }
@media (max-width: 1200px) { .g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .g-2, .g-3, .g-4 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } .panel { padding: 18px; } }

/* ---------- stats ---------- */
.stat { display: flex; flex-direction: column; gap: 10px; }
.stat__k { font: 400 10px/1 var(--f-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--tx-3); }
.stat__v { font-weight: 800; font-size: clamp(28px, 2.6vw, 40px); line-height: 1; letter-spacing: -.03em; font-variation-settings: 'wdth' 85; font-feature-settings: 'tnum'; }
.stat__d { font-size: 12px; color: var(--tx-2); }
.stat__icon { position: absolute; right: 20px; top: 20px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(201,164,92,.12); color: var(--gold-hi); box-shadow: 0 0 0 1px rgba(201,164,92,.25) inset; }
.stat__icon svg { width: 18px; height: 18px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font: 600 11px/1 var(--f-mono); letter-spacing: .04em; text-transform: capitalize; white-space: nowrap;
  color: var(--tx-2); background: rgba(255,255,255,.06); box-shadow: 0 0 0 1px var(--line) inset; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--deleted, .badge--paid, .badge--approved, .badge--active, .badge--graduated, .badge--converted { color: var(--ok-hi); background: rgba(79,195,138,.12); box-shadow: 0 0 0 1px rgba(79,195,138,.28) inset; }
.badge--in_dispute, .badge--sent, .badge--onboarding, .badge--contacted, .badge--consult { color: var(--gold-hi); background: rgba(201,164,92,.12); box-shadow: 0 0 0 1px rgba(201,164,92,.3) inset; }
.badge--verified, .badge--due, .badge--escalated, .badge--paused, .badge--pending, .badge--new { color: #ffc77a; background: rgba(233,162,59,.12); box-shadow: 0 0 0 1px rgba(233,162,59,.3) inset; }
.badge--updated, .badge--responded, .badge--identified, .badge--draft { color: #a9c6ff; background: rgba(111,163,255,.12); box-shadow: 0 0 0 1px rgba(111,163,255,.3) inset; }
.badge--rejected, .badge--void, .badge--cancelled, .badge--lost { color: #ff9f95; background: rgba(224,87,79,.12); box-shadow: 0 0 0 1px rgba(224,87,79,.3) inset; }
.badge--closed { color: var(--tx-3); }
.bureau { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font: 600 10px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; }
.bureau--equifax { color: #ff8fa3; background: rgba(193,39,72,.14); }
.bureau--experian { color: #c9a6ff; background: rgba(120,60,200,.16); }
.bureau--transunion { color: #7fd8ff; background: rgba(0,150,200,.14); }

/* ---------- forms ---------- */
.field { display: grid; gap: 7px; }
.field > span { font: 400 10px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--tx-3); padding-left: 16px; }
.input, .select, .textarea { width: 100%; height: 46px; padding: 0 18px; border: 0; border-radius: 999px; background: rgba(0,0,0,.32); color: var(--tx); outline: none;
  box-shadow: 0 0 0 1px var(--line-2) inset, 0 2px 8px rgba(0,0,0,.35) inset; transition: box-shadow .25s, background .25s; }
.textarea { height: auto; min-height: 110px; padding: 14px 18px; border-radius: 24px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c9a45c' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 18px center; cursor: pointer; }
.select option { background: #1a1815; }
.select--sm { height: 34px; font-size: 13px; padding-left: 14px; }
.input:focus, .select:focus, .textarea:focus { background-color: rgba(0,0,0,.45); box-shadow: 0 0 0 1px rgba(243,215,154,.6) inset, 0 0 0 4px rgba(201,164,92,.12); }
.search { position: relative; }
.search svg { position: absolute; left: 16px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--tx-3); }
.search .input { padding-left: 42px; }
.form { display: grid; gap: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { appearance: none; width: 20px; height: 20px; margin: 0; border-radius: 50%; background: rgba(0,0,0,.4); box-shadow: 0 0 0 1px var(--line-2) inset; cursor: pointer; transition: all .2s; display: grid; place-items: center; }
.check input:checked { background: var(--g-gold); box-shadow: var(--sh-gold); }
.check input:checked::after { content: ''; width: 6px; height: 10px; border: solid #1a1206; border-width: 0 2px 2px 0; transform: translate(0, -1px) rotate(45deg); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 999px; background: rgba(255,255,255,.04); box-shadow: 0 0 0 1px var(--line-2) inset; cursor: pointer; font-size: 13px; transition: all .25s; }
.chip input:checked + span { color: #1a1206; background: var(--g-gold); box-shadow: var(--sh-gold); font-weight: 600; }

/* ---------- list rows (pill rows instead of boxy tables) ---------- */
.rows { display: grid; gap: 8px; }
.row { display: grid; align-items: center; gap: 14px; min-height: 58px; padding: 10px 12px 10px 20px; border-radius: 999px; background: rgba(255,255,255,.025); box-shadow: 0 0 0 1px var(--line) inset;
  transition: background .25s, box-shadow .25s, transform .3s var(--ease); }
.row:hover { background: rgba(255,255,255,.05); box-shadow: 0 0 0 1px var(--line-2) inset; }
.row.is-sel { background: rgba(201,164,92,.08); box-shadow: 0 0 0 1px rgba(201,164,92,.35) inset; }
.row--link { cursor: pointer; }
.row__main { min-width: 0; }
.row__t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__s { margin-top: 3px; font-size: 12px; color: var(--tx-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-head { display: grid; gap: 14px; padding: 0 12px 6px 20px; font: 400 10px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--tx-3); }
@media (max-width: 760px) { .row { border-radius: 26px; grid-template-columns: 1fr auto !important; } .row > .opt { display: none; } .row-head { display: none; } }

.empty { padding: 40px 20px; text-align: center; color: var(--tx-3); }
.empty b { display: block; font-family: var(--f-serif); font-style: italic; font-weight: 400; font-size: 26px; color: var(--tx-2); margin-bottom: 6px; }

/* ---------- gauges ---------- */
.gauge { text-align: center; }
.gauge svg { width: 100%; max-width: 220px; overflow: visible; display: block; margin: 0 auto; }
.gauge__track, .gauge__arc { fill: none; stroke-width: 11; stroke-linecap: round; }
.gauge__track { stroke: rgba(255,255,255,.07); }
.gauge__knob { fill: #fff; filter: drop-shadow(0 0 6px rgba(255,255,255,.9)); }
.gauge__tick { font: 400 8px var(--f-mono); fill: var(--tx-3); }
.gauge__val { margin-top: -66px; font-weight: 800; font-size: 46px; line-height: 1; letter-spacing: -.03em; font-variation-settings: 'wdth' 85; font-feature-settings: 'tnum'; }
.gauge__name { margin-bottom: 12px; font: 600 11px/1 var(--f-mono); letter-spacing: .2em; text-transform: uppercase; }
.gauge__rating { margin-top: 6px; font-size: 12px; color: var(--tx-2); }
.gauge__delta { display: inline-flex; gap: 6px; margin-top: 14px; }
.delta { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 11px; border-radius: 999px; font: 600 12px/1 var(--f-mono); }
.delta--up { color: #0b2016; background: var(--g-ok); box-shadow: 0 6px 16px -8px rgba(79,195,138,.8); }
.delta--down { color: #2a0705; background: var(--g-bad); }
.delta--flat { color: var(--tx-2); background: rgba(255,255,255,.07); }
.delta--soft { color: var(--ok-hi); background: rgba(79,195,138,.1); box-shadow: none; }

/* ---------- change tiles (like the bureau re-import summary) ---------- */
.changes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.change { position: relative; padding: 18px 18px 16px 22px; border-radius: 26px; background: rgba(255,255,255,.03); box-shadow: 0 0 0 1px var(--line) inset; overflow: hidden; }
.change::before { content: ''; position: absolute; left: 0; top: 16px; bottom: 16px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c, var(--gold)); box-shadow: 0 0 14px var(--c, var(--gold)); }
.change b { display: block; font-weight: 800; font-size: 36px; line-height: 1; letter-spacing: -.03em; font-variation-settings: 'wdth' 85; }
.change span { display: block; margin-top: 6px; font-size: 12px; color: var(--tx-2); }
@media (max-width: 1100px) { .changes { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .changes { grid-template-columns: repeat(2, 1fr); } }

/* ---------- charts ---------- */
.chart { width: 100%; height: 240px; display: block; overflow: visible; }
.chart text { font: 400 10px var(--f-mono); fill: var(--tx-3); }
.chart .grid-l { stroke: rgba(255,255,255,.05); }
.legend { display: flex; flex-wrap: wrap; gap: 8px; }
.legend button { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: rgba(255,255,255,.04); box-shadow: 0 0 0 1px var(--line) inset; color: var(--tx-2); font-size: 12px; cursor: pointer; }
.legend button i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.legend button.is-off { opacity: .4; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.bars__c { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bars__b { width: 100%; max-width: 46px; border-radius: 999px; background: var(--g-gold); box-shadow: var(--sh-gold); min-height: 8px; transform-origin: bottom; }
.bars__b--ok { background: var(--g-ok); box-shadow: 0 8px 20px -10px rgba(79,195,138,.7); }
.bars__l { font: 400 10px/1 var(--f-mono); color: var(--tx-3); }
.bars__v { font: 600 11px/1 var(--f-mono); color: var(--tx-2); }
.pipeline { display: flex; height: 16px; border-radius: 999px; overflow: hidden; gap: 3px; background: rgba(0,0,0,.3); padding: 3px; }
.pipeline i { border-radius: 999px; min-width: 6px; }
.meter { height: 10px; border-radius: 999px; background: rgba(0,0,0,.35); box-shadow: 0 1px 4px rgba(0,0,0,.4) inset; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--g-ok); box-shadow: 0 0 12px rgba(79,195,138,.5); transform-origin: left; }
.ring { position: relative; width: 120px; height: 120px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.ring__c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring__c b { font-weight: 800; font-size: 30px; line-height: 1; font-variation-settings: 'wdth' 85; }
.ring__c small { font: 400 9px/1.3 var(--f-mono); letter-spacing: .14em; color: var(--tx-3); text-transform: uppercase; }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; height: min(68vh, 640px); }
.chat__log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 6px 4px 16px; }
.msg { max-width: 76%; display: grid; gap: 4px; }
.msg__b { padding: 12px 16px; border-radius: 22px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.msg__m { font: 400 10px/1 var(--f-mono); color: var(--tx-3); padding: 0 8px; }
.msg--me { align-self: flex-end; justify-items: end; }
.msg--me .msg__b { color: #1a1206; background: var(--g-gold); border-bottom-right-radius: 8px; box-shadow: var(--sh-gold); }
.msg--them { align-self: flex-start; }
.msg--them .msg__b { background: var(--s3); border-bottom-left-radius: 8px; box-shadow: 0 0 0 1px var(--line) inset; }
.chat__day { align-self: center; margin: 8px 0; padding: 6px 12px; border-radius: 999px; font: 400 10px/1 var(--f-mono); letter-spacing: .14em; color: var(--tx-3); background: rgba(255,255,255,.04); text-transform: uppercase; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 8px; border-radius: 999px; background: rgba(0,0,0,.35); box-shadow: 0 0 0 1px var(--line-2) inset; }
.composer textarea { flex: 1; min-height: 42px; max-height: 140px; padding: 11px 14px; border: 0; background: transparent; color: var(--tx); resize: none; outline: none; line-height: 1.4; }

/* ---------- dropzone ---------- */
.drop { display: grid; place-items: center; gap: 8px; padding: 34px 20px; border-radius: 30px; text-align: center; cursor: pointer; background: rgba(0,0,0,.25);
  box-shadow: 0 0 0 1.5px rgba(201,164,92,.3) inset; background-image: radial-gradient(circle at 50% 0%, rgba(201,164,92,.08), transparent 60%); transition: all .3s; }
.drop.is-over { box-shadow: 0 0 0 2px var(--gold-hi) inset, 0 0 40px -10px rgba(201,164,92,.6); transform: scale(1.01); }
.drop svg { width: 34px; height: 34px; color: var(--gold-hi); }
.drop b { font-weight: 600; }

/* ---------- timeline ---------- */
.tline { position: relative; display: grid; gap: 14px; padding-left: 22px; }
.tline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: linear-gradient(var(--gold), rgba(201,164,92,.05)); }
.tline__i { position: relative; }
.tline__i::before { content: ''; position: absolute; left: -21px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); box-shadow: 0 0 0 2px var(--gold), 0 0 10px rgba(201,164,92,.6); }
.tline__t { font-size: 14px; line-height: 1.4; }
.tline__m { font: 400 10px/1 var(--f-mono); color: var(--tx-3); margin-top: 5px; letter-spacing: .06em; }

/* ---------- tasks ---------- */
.task { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 999px; background: rgba(255,255,255,.025); box-shadow: 0 0 0 1px var(--line) inset; }
.task.is-done .task__t { color: var(--tx-3); text-decoration: line-through; }
.task__t { flex: 1; min-width: 0; font-size: 14px; }
.task__due { font: 400 11px/1 var(--f-mono); color: var(--tx-3); }

/* ---------- modal + toast ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(5,5,4,.7); backdrop-filter: blur(10px); opacity: 0; pointer-events: none; transition: opacity .35s; }
.modal.is-open { opacity: 1; pointer-events: auto; }
.modal__card { width: min(560px, 100%); max-height: 88vh; overflow: auto; padding: 30px; border-radius: 36px; background: linear-gradient(165deg, #25221d, #13120f); box-shadow: 0 0 0 1px rgba(243,215,154,.14) inset, 0 50px 120px -30px #000; transform: translateY(30px) scale(.96); transition: transform .5s var(--ease); }
.modal__card--wide { width: min(980px, 100%); }
.modal.is-open .modal__card { transform: none; }
.modal__h { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.modal__h h2 { font-size: 26px; font-weight: 800; font-variation-settings: 'wdth' 85; }
.modal__f { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px 12px 12px; border-radius: 999px; background: linear-gradient(135deg, #2a2620, #1a1814); box-shadow: 0 0 0 1px var(--line-2) inset, 0 20px 40px -15px #000; font-size: 14px; animation: tin .5s var(--ease); }
.toast i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; color: #0b2016; background: var(--g-ok); }
.toast--err i { background: var(--g-bad); color: #2a0705; }
@keyframes tin { from { transform: translateY(20px) scale(.95); opacity: 0; } }

.letter { white-space: pre-wrap; font: 400 13px/1.6 'Times New Roman', serif; color: #1b1b1b; background: #faf8f3; padding: 40px 44px; border-radius: 22px; box-shadow: 0 20px 50px -20px #000; }
.code { width: 100%; min-height: 360px; padding: 18px 20px; border: 0; border-radius: 24px; background: rgba(0,0,0,.4); color: var(--tx); font: 400 13px/1.6 var(--f-mono); box-shadow: 0 0 0 1px var(--line-2) inset; outline: none; resize: vertical; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 14px; }
.kv dt { font: 400 10px/1.8 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--tx-3); }
.kv dd { margin: 0; }
.legal { font-size: 13px; line-height: 1.7; color: var(--tx-2); max-height: 380px; overflow: auto; padding: 22px 24px; border-radius: 24px; background: rgba(0,0,0,.3); box-shadow: 0 0 0 1px var(--line) inset; }
.legal h4 { color: var(--tx); font-size: 14px; margin: 16px 0 6px; letter-spacing: 0; }
.legal h4:first-child { margin-top: 0; }
.callout { display: flex; gap: 14px; align-items: center; padding: 16px 20px; border-radius: 999px; background: linear-gradient(135deg, rgba(201,164,92,.14), rgba(201,164,92,.04)); box-shadow: 0 0 0 1px rgba(201,164,92,.3) inset; }
.callout svg { flex: none; width: 22px; height: 22px; color: var(--gold-hi); }
@media (max-width: 760px) { .callout { border-radius: 26px; align-items: flex-start; } }
.skel { border-radius: 26px; background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,.07), rgba(255,255,255,.03)); background-size: 200% 100%; animation: sk 1.3s infinite; height: 120px; }
@keyframes sk { to { background-position: -200% 0; } }
.reveal > * { opacity: 0; transform: translateY(18px); }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth__art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 40px; border-right: 1px solid var(--line); }
.auth__art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth__big { position: relative; font-weight: 900; font-size: clamp(60px, 8vw, 140px); line-height: .82; letter-spacing: -.05em; font-variation-settings: 'wdth' 62; }
.auth__big em { display: block; font-size: .6em; color: var(--gold-hi); letter-spacing: -.02em; margin-top: .1em; }
.auth__form { display: grid; place-items: center; padding: 40px 20px; }
.auth__card { width: min(420px, 100%); }
.auth__card h1 { font-weight: 800; font-size: 40px; font-variation-settings: 'wdth' 85; margin-bottom: 8px; }
.auth__demo { display: grid; gap: 8px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.auth__demo[hidden] { display: none; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth__art { min-height: 260px; } }

@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; inset: 0; }
  .letter { box-shadow: none; border-radius: 0; page-break-after: always; }
}

/* ---------- motion tokens + reduced motion (cinematic v2) ---------- */
:root { --t-press: 120ms; --t-hover: 200ms; --t-panel: 300ms; }
.btn { transition: transform var(--t-hover) var(--ease), box-shadow var(--t-hover), background var(--t-hover), color var(--t-hover); }
.btn:active { transition-duration: var(--t-press); }
.nav-pill { transition-duration: var(--t-hover); }
a:focus-visible, .input:focus-visible, .select:focus-visible, .textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
