/* ============================================================================
   Regulatory Capital and Reporting Pack — main stylesheet
   Layout language blended from the two Artem templates (NOT 1:1, re-skinned
   in Erthiox colours):
   - Subly: black vertical icon sidebar, top pill nav, white rounded cards,
     big KPI numbers with delta chips, gradient bar / donut charts.
   - Finor: dark navy page background, light cards, ticker strip, line chart,
     distribution bars, asset / insight lists.
   Palette: navy #0B1F3A / #111622, gold #C5A880 / #B89047, cream #FCFBF9,
   slate #5A606C, blue #1a73e8. Status: healthy #1E7A46, warn #8A6D3B,
   breach #B3261E. Fonts: Inter (base), Outfit (headings / KPI numbers).
   ============================================================================ */
:root {
  --navy-900: #0B1F3A; --navy-800: #12233F; --ink: #111622; --body: #1A2332;
  --gold: #C5A880; --gold-dark: #B89047; --cream: #FCFBF9; --slate: #5A606C;
  --border: #E8E5DF; --divider: #F1EFEA; --surface: #F2F4F7; --line: #B9C2CF;
  --blue: #1a73e8; --steel: #143A6B; --steel-bright: #2E6DB4;
  --green: #1E7A46; --green-bg: #E5F3EA; --amber: #8A6D3B; --amber-bg: #FBF3DF;
  --red: #B3261E; --red-bg: #FBE9E7;
  --radius: 18px; --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(11, 31, 58, .14), 0 2px 8px rgba(11, 31, 58, .08);
  --shadow-sm: 0 2px 10px rgba(11, 31, 58, .08);
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Outfit', 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
html, body { overflow-x: clip; }
body {
  margin: 0; font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  color: var(--body); background: var(--navy-900);
  background-image: radial-gradient(900px 500px at 85% -10%, rgba(26, 115, 232, .22), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, rgba(184, 144, 71, .18), transparent 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--navy-900); margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 10px; }
a { color: var(--steel); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; font-size: 15px; color: var(--body); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--gold); color: var(--navy-900); }

/* --- Custom scrollbars (never the browser default) --- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,.06); border-radius: 8px; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--gold), var(--gold-dark)); border-radius: 8px; border: 2px solid var(--navy-900); }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }
.card ::-webkit-scrollbar-track { background: var(--surface); }
.card ::-webkit-scrollbar-thumb { border-color: #fff; }
* { scrollbar-width: thin; scrollbar-color: var(--gold-dark) rgba(255,255,255,.08); }

/* --- App shell: icon rail + main --- */
.rail {
  position: fixed; left: 0; top: 0; bottom: 0; width: 78px; z-index: 60;
  background: #0A0E18; display: flex; flex-direction: column; align-items: center;
  padding: 16px 0 12px; gap: 6px;
}
.rail .rail-logo { width: 46px; height: 46px; margin-bottom: 10px; display: block; }
.rail .rail-logo img { width: 100%; height: 100%; display: block; }
.rail-btn {
  width: 52px; height: 52px; border: 0; border-radius: 14px; background: transparent;
  color: #8B93A7; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 9.5px; font-weight: 600; letter-spacing: .02em; position: relative;
}
.rail-btn svg { width: 22px; height: 22px; }
.rail-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.rail-btn.active { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: #0B0F1A; }
.rail-btn .dot { position: absolute; top: 8px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.rail-spacer { flex: 1; }
.rail-user { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--gold); background: var(--steel); color: #fff; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.main { margin-left: 78px; min-height: 100vh; display: flex; flex-direction: column; }

/* --- Top bar: pill nav (Subly) + actions --- */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 14px;
  padding: 14px 26px; background: rgba(11, 31, 58, .82); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.brand-mini { display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; }
.brand-mini img { width: 34px; height: 34px; }
.brand-mini .t1 { font-family: var(--font-head); font-weight: 700; font-size: 15px; line-height: 1.1; white-space: nowrap; }
.brand-mini .t2 { font-size: 11px; color: var(--gold); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.pillnav { display: flex; gap: 4px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.10); border-radius: 999px; padding: 4px; margin: 0 auto; overflow-x: auto; max-width: 100%; }
.pillnav a {
  padding: 7px 16px; border-radius: 999px; color: #C7CEDD; font-weight: 600; font-size: 13.5px;
  white-space: nowrap; text-decoration: none;
}
.pillnav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.pillnav a.active { background: #fff; color: var(--navy-900); }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.snapshot-chip {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600;
  color: #DCE3EF; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px; padding: 7px 12px; white-space: nowrap; cursor: pointer;
}
.snapshot-chip .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(30,122,70,.25); }
.snapshot-chip.stale .pulse { background: #E8A33D; box-shadow: 0 0 0 3px rgba(232,163,61,.25); }
.btn {
  border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px; transition: transform .12s ease, box-shadow .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: #0B0F1A; box-shadow: 0 4px 14px rgba(184,144,71,.35); }
.btn-gold:hover { box-shadow: 0 6px 20px rgba(184,144,71,.5); }
.btn-navy { background: var(--navy-900); color: #fff; }
.btn-navy:hover { background: var(--navy-800); }
.btn-steel { background: var(--steel); color: #fff; }
.btn-ghost { background: #fff; color: var(--navy-900); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--gold-dark); }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.kofi-btn { background: var(--gold-dark); color: #090d16; }
.kofi-btn:hover { filter: brightness(1.08); }
.user-chip { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 13px; font-weight: 600; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 999px; padding: 5px 12px 5px 5px; cursor: pointer; }
.user-chip .av { width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: #0B0F1A; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; }

/* --- Ticker strip (Finor) --- */
.ticker {
  display: flex; gap: 10px; align-items: center; padding: 12px 26px 0; overflow-x: auto;
  scrollbar-width: none;
}
.ticker::-webkit-scrollbar { display: none; }
.ticker-label { color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
.tick {
  display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px; padding: 6px 13px; color: #E7ECF4; font-size: 13px; white-space: nowrap;
}
.tick b { font-weight: 700; }
.tick .up { color: #7BD9A0; font-weight: 700; } .tick .down { color: #F49A93; font-weight: 700; }

/* --- Content + cards --- */
.content { padding: 18px 26px 30px; flex: 1; width: 100%; max-width: 1460px; margin: 0 auto; }
.view { display: none; animation: fadein .25s ease; }
.view.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 18px; flex-wrap: wrap; }
.page-head h1 { color: #fff; font-size: 30px; font-weight: 800; }
.page-head .sub { color: #A9B4C8; font-size: 14px; margin-top: 4px; max-width: 640px; }
.page-head .head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.g-kpi { grid-template-columns: repeat(4, 1fr); }
.g-2 { grid-template-columns: 1.6fr 1fr; }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-2eq { grid-template-columns: 1fr 1fr; }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 20px 22px; min-width: 0;
}
.card h2 { font-size: 17px; font-weight: 700; }
.card h3 { font-size: 15px; font-weight: 700; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head .hint { color: var(--slate); font-size: 13px; margin-top: 2px; }
.card-head .more { border: 0; background: var(--surface); width: 30px; height: 30px; border-radius: 50%; color: var(--slate); font-size: 16px; line-height: 1; }
.card-head .more:hover { background: var(--divider); color: var(--navy-900); }

/* KPI cards (Subly big numbers) */
.kpi { position: relative; overflow: hidden; }
.kpi::after { content: ''; position: absolute; right: -22px; top: -22px; width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle, rgba(197,168,128,.22), transparent 70%); }
.kpi .k-label { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--slate); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kpi .k-value { font-family: var(--font-head); font-size: 44px; font-weight: 800; line-height: 1.05; margin: 8px 0 4px; color: var(--navy-900); font-variant-numeric: tabular-nums; }
.kpi .k-value small { font-size: 20px; font-weight: 700; color: var(--slate); }
.kpi .k-sub { font-size: 13px; color: var(--slate); }
.kpi .k-req { font-size: 12.5px; color: var(--slate); margin-top: 8px; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 9px; }
.delta.up { background: var(--green-bg); color: var(--green); }
.delta.warn { background: var(--amber-bg); color: var(--amber); }
.delta.down { background: var(--red-bg); color: var(--red); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 11px; white-space: nowrap; }
.status-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-pill.healthy { background: var(--green-bg); color: var(--green); }
.status-pill.inside_buffer { background: var(--amber-bg); color: var(--amber); }
.status-pill.breach { background: var(--red-bg); color: var(--red); }
.status-pill.neutral { background: var(--surface); color: var(--slate); }

/* Headroom bars */
.hbar { height: 10px; border-radius: 999px; background: var(--surface); overflow: hidden; margin: 8px 0 4px; }
.hbar > i { display: block; height: 100%; border-radius: 999px; }
.hbar > i.healthy { background: linear-gradient(90deg, #2E9E5B, var(--green)); }
.hbar > i.inside_buffer { background: linear-gradient(90deg, #D9B36A, var(--amber)); }
.hbar > i.breach { background: linear-gradient(90deg, #D95B52, var(--red)); }
.hbar-row { display: grid; grid-template-columns: 130px 1fr 92px; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--divider); font-size: 13.5px; }
.hbar-row:last-child { border-bottom: 0; }
.hbar-row .nm { font-weight: 700; color: var(--navy-900); }
.hbar-row .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

/* Distribution bars (Finor) */
.dist-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; margin: 10px 0 14px; background: var(--surface); }
.dist-bar > i { display: block; height: 100%; }
.dist-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--divider); font-size: 14px; }
.dist-row:last-child { border-bottom: 0; }
.dist-row .sw { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.dist-row .nm { flex: 1; font-weight: 600; }
.dist-row .amt { font-variant-numeric: tabular-nums; font-weight: 700; }
.dist-row .pct { color: var(--slate); width: 52px; text-align: right; font-variant-numeric: tabular-nums; }

/* Donut (SVG) */
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { flex: none; position: relative; width: 168px; height: 168px; }
.donut svg { transform: rotate(-90deg); }
.donut .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut .center b { font-family: var(--font-head); font-size: 24px; color: var(--navy-900); font-variant-numeric: tabular-nums; }
.donut .center span { font-size: 11.5px; color: var(--slate); font-weight: 600; }
.legend { display: grid; gap: 7px; font-size: 13.5px; }
.legend .li { display: flex; align-items: center; gap: 8px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.legend b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* Tables */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.tbl th { background: var(--navy-900); color: #fff; text-align: left; padding: 11px 14px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; position: sticky; top: 0; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--divider); font-variant-numeric: tabular-nums; }
.tbl tr:nth-child(even) td { background: var(--cream); }
.tbl tr:hover td { background: #F6F1E7; }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl td:first-child { font-weight: 600; }
.flag { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: middle; }
.flag.warn { background: var(--amber-bg); color: var(--amber); }
.flag.info { background: #E3EDFB; color: var(--steel); }
.flag.bad { background: var(--red-bg); color: var(--red); }

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--slate); margin-bottom: 5px; letter-spacing: .03em; }
.field input, .field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff;
}
.field input:focus, .field textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(26,115,232,.15); }
.field .err { color: var(--red); font-size: 12.5px; font-weight: 600; margin-top: 4px; display: none; }
.field.invalid input { border-color: var(--red); }
.field.invalid .err { display: block; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.money-input { position: relative; }
.money-input::before { content: '$'; position: absolute; left: 12px; top: 10px; color: var(--slate); font-weight: 700; }
.money-input input { padding-left: 26px; }

/* Custom dropdown (no native <select>) */
.dd { position: relative; }
.dd-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff;
  font-size: 14px; font-weight: 600; color: var(--body); text-align: left;
}
.dd-btn::after { content: ''; width: 9px; height: 9px; border-right: 2px solid var(--slate); border-bottom: 2px solid var(--slate); transform: rotate(45deg); flex: none; margin-bottom: 3px; }
.dd.open .dd-btn::after { transform: rotate(225deg); margin-bottom: -3px; }
.dd-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px;
  display: none; max-height: 260px; overflow-y: auto;
}
.dd.open .dd-menu { display: block; }
.dd-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 11px; border-radius: 8px; font-size: 14px; }
.dd-item:hover { background: var(--surface); }
.dd-item.selected { background: #F6F1E7; font-weight: 700; color: var(--navy-900); }
.dd-item small { display: block; color: var(--slate); font-size: 12px; }

/* Tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab-btn { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: 13.5px; color: var(--slate); }
.tab-btn.active { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }

/* Banner / empty / error states */
.banner { border-radius: var(--radius-sm); padding: 13px 16px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; }
.banner.amber { background: var(--amber-bg); color: #6B531F; border: 1px solid #EAD9A8; }
.banner.red { background: var(--red-bg); color: #7A1B15; border: 1px solid #F0C4C0; }
.banner.blue { background: #E3EDFB; color: var(--steel); border: 1px solid #BFD6F5; }
.banner.green { background: var(--green-bg); color: #14532D; border: 1px solid #BFE3CC; }
.banner b { font-weight: 800; }
.empty { text-align: center; padding: 34px 20px; color: var(--slate); }
.empty .big { font-size: 40px; margin-bottom: 8px; }
.empty h3 { margin-bottom: 6px; }

/* Waterfall */
.wf { display: flex; flex-direction: column; gap: 0; }
.wf-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--divider); }
.wf-row:last-child { border-bottom: 0; }
.wf-row .nm { flex: 1; font-weight: 600; }
.wf-row .amt { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 110px; text-align: right; }
.wf-bar { height: 8px; border-radius: 999px; background: var(--surface); overflow: hidden; flex: none; width: 130px; }
.wf-bar > i { display: block; height: 100%; }
.wf-total { background: var(--navy-900); color: #fff; border-radius: 10px; padding: 12px 14px; margin-top: 10px; display: flex; justify-content: space-between; font-weight: 800; }

/* Scenario rows */
.scn { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr) 130px; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--divider); font-size: 14px; }
.scn.head { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--slate); font-weight: 700; padding-top: 0; }
.scn .r { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

/* Modal + toast (custom, never alert()) */
.modal-back { position: fixed; inset: 0; background: rgba(10, 14, 24, .62); z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(3px); }
.modal-back.open { display: flex; }
.modal { background: #fff; border-radius: 20px; box-shadow: var(--shadow); width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; padding: 26px 28px; animation: fadein .2s ease; }
.modal h2 { font-size: 21px; margin-bottom: 6px; }
.modal .sub { color: var(--slate); font-size: 14px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { background: var(--navy-900); color: #fff; border-radius: 12px; padding: 13px 16px; box-shadow: var(--shadow); font-size: 14px; border-left: 4px solid var(--gold); animation: fadein .2s ease; }
.toast.error { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
.toast b { display: block; margin-bottom: 2px; }

/* Auth screen */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: #fff; border-radius: 24px; box-shadow: var(--shadow); width: 100%; max-width: 460px; padding: 34px 36px; }
.auth-card .logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.auth-card .logo-row img { width: 52px; height: 52px; }
.auth-card h1 { font-size: 23px; }
.auth-card .byline { color: var(--slate); font-size: 13.5px; margin: 4px 0 20px; }
.auth-tabs { display: flex; background: var(--surface); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.auth-tabs button { flex: 1; border: 0; background: none; border-radius: 999px; padding: 9px; font-weight: 700; font-size: 14px; color: var(--slate); }
.auth-tabs button.active { background: var(--navy-900); color: #fff; }
.glossary { font-size: 13px; color: var(--slate); }
.glossary abbr { text-decoration: underline dotted; cursor: help; color: var(--steel); font-weight: 700; }

/* Footer */
.footer { padding: 22px 26px 30px; color: #93A0B6; font-size: 12.5px; max-width: 1460px; margin: 0 auto; width: 100%; }
.footer a { color: var(--gold); }
.footer .disclaimer { border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; margin-top: 14px; line-height: 1.6; }

/* Dropzone */
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius-sm); padding: 28px 18px; text-align: center; color: var(--slate); background: var(--cream); cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--gold-dark); background: #F6F1E7; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--slate); } .kv dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.chip-list { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12.5px; }
.small { font-size: 13px; color: var(--slate); }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb16 { margin-bottom: 16px; }

/* --- Responsive --- */
@media (max-width: 1180px) {
  .g-kpi { grid-template-columns: repeat(2, 1fr); }
  .g-2, .g-3, .g-2eq { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .brand-mini .t1, .brand-mini .t2 { display: none; }
  .snapshot-chip span.txt { display: none; }
  .kofi-btn span { display: none; }
}
@media (max-width: 640px) {
  .rail { top: auto; bottom: 0; left: 0; right: 0; width: auto; height: 64px; flex-direction: row; justify-content: space-around; padding: 6px 4px; border-top: 1px solid rgba(255,255,255,.1); }
  .rail .rail-logo, .rail-spacer, .rail-user { display: none; }
  .rail-btn { width: 56px; height: 48px; font-size: 9px; }
  .main { margin-left: 0; padding-bottom: 64px; }
  .topbar { padding: 10px 14px; flex-wrap: wrap; }
  .content { padding: 14px 14px 24px; }
  .ticker { padding: 10px 14px 0; }
  .page-head h1 { font-size: 24px; }
  .g-kpi { grid-template-columns: 1fr 1fr; }
  .kpi .k-value { font-size: 32px; }
  .kpi .k-label { font-size: 11px; letter-spacing: .04em; }
  .status-pill { font-size: 11px; padding: 3px 8px; }
  .form-grid { grid-template-columns: 1fr; }
  .scn { grid-template-columns: 1.4fr 1fr 1fr; }
  .scn .hide-m { display: none; }
  .footer { padding: 18px 14px 26px; }
}
@media print {
  .rail, .topbar, .ticker, .footer, .head-actions { display: none !important; }
  body { background: #fff; }
  .main { margin-left: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}
