/* De Cogan Command Center. Brand: Deep Navy, Matte Gold #8F6A2C, Crimson #980A18 (losses, alerts, kill switch),
   Stone Gray. Cormorant Garamond for names and headings, Lato for everything else. */
@font-face { font-family: "Cormorant Garamond"; src: url("/static/fonts/CormorantGaramondwght.woff") format("woff");
  font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/static/fonts/CormorantGaramond-Italicwght.woff") format("woff");
  font-weight: 300 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Lato"; src: url("/static/fonts/Lato-Regular.woff") format("woff"); font-weight: 400;
  font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("/static/fonts/Lato-Bold.woff") format("woff"); font-weight: 700;
  font-style: normal; font-display: swap; }
:root {
  --navy: #0F1E33;
  --navy-2: #172B48;
  --navy-3: #22385A;
  --gold: #8F6A2C;
  --gold-text: #7A5A23;
  --gold-soft: #C9A45C;
  --crimson: #980A18;
  --crimson-soft: #F6E3E5;
  --green: #2D6A4B;
  --green-soft: #E3EFE8;
  --stone: #8A8680;
  --bg: #F4F1EA;
  --card: #FFFFFF;
  --card-2: #FAF8F4;
  --ink: #1A2332;
  --ink-2: #4A5261;
  --muted: #7C7F86;
  --line: #E4DED3;
  --line-2: #EFEAE1;
  --focus: #C9A45C;
  --primary: #0F1E33;
  --primary-fg: #F4EFE6;
  --shadow: 0 1px 2px rgba(15, 30, 51, .06), 0 4px 16px rgba(15, 30, 51, .05);
  --radius: 10px;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Lato", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1526; --card: #12213A; --card-2: #0F1C32; --ink: #ECE7DD; --ink-2: #C4C0B8; --muted: #8F96A3;
    --line: #22344F; --line-2: #1A2B45; --gold-text: #D1AE68; --green: #6FBF94; --green-soft: #173427;
    --crimson: #E0525F; --crimson-soft: #3A1820; --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark; --primary: #A67C33; --primary-fg: #FFFFFF;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1526; --card: #12213A; --card-2: #0F1C32; --ink: #ECE7DD; --ink-2: #C4C0B8; --muted: #8F96A3;
  --line: #22344F; --line-2: #1A2B45; --gold-text: #D1AE68; --green: #6FBF94; --green-soft: #173427;
  --crimson: #E0525F; --crimson-soft: #3A1820; --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark; --primary: #A67C33; --primary-fg: #FFFFFF;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold-text); }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--green); }
.neg { color: var(--crimson); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: .2px; }
h2 { font-size: 22px; }
h3 { font-size: 19px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- header ---------- */
.top { background: var(--navy); color: #F2EDE3; position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid #0A1424; }
.top-inner { max-width: 1500px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; color: inherit; }
.medallion { width: 44px; height: 44px; border-radius: 50%; background: #F7F4EE; display: grid; place-items: center;
  box-shadow: 0 0 0 2px rgba(201, 164, 92, .55); flex: none; }
.medallion img { width: 30px; }
.brand-name { font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.1; white-space: nowrap; }
.brand-sub { font-size: 11px; letter-spacing: 2.2px; text-transform: uppercase; color: var(--gold-soft); }
.top-status { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px;
  background: rgba(255,255,255,.07); color: #E8E2D6; white-space: nowrap; border: 1px solid rgba(255,255,255,.08); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #7C8594; flex: none; }
.dot.ok { background: #5CC08A; }
.dot.warn { background: #E2B04A; }
.dot.bad { background: #E0525F; }
.kill { background: var(--crimson); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 700;
  letter-spacing: .6px; cursor: pointer; text-transform: uppercase; font-size: 12.5px; white-space: nowrap; }
:root .kill { background: #980A18; }
.kill:hover { filter: brightness(1.1); }
.kill.resume { background: transparent; border: 1px solid var(--gold-soft); color: var(--gold-soft); }
.iconbtn { background: transparent; border: 1px solid rgba(255,255,255,.15); color: #E8E2D6; border-radius: 8px;
  padding: 6px 9px; cursor: pointer; font-size: 13px; }

.halt-banner { background: var(--crimson); color: #fff; text-align: center; padding: 8px 16px; font-weight: 600; }
.halt-banner button { margin-left: 10px; }

/* ---------- tabs ---------- */
.tabs { background: var(--navy-2); }
.tabs-inner { max-width: 1500px; margin: 0 auto; padding: 0 20px; display: flex; gap: 2px; overflow-x: auto;
  scrollbar-width: none; }
.tab { background: none; border: 0; color: #B9B3A7; padding: 11px 14px; cursor: pointer; font-size: 14px;
  border-bottom: 2px solid transparent; white-space: nowrap; }
.tab[aria-selected="true"] { color: #F4EFE6; border-bottom-color: var(--gold-soft); }
.tab.rail-tab { display: none; }

/* ---------- layout ---------- */
.page { max-width: 1500px; margin: 0 auto; padding: 18px 20px 60px; display: grid;
  grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }
.main { display: grid; gap: 18px; min-width: 0; }
.rail { display: grid; gap: 18px; position: sticky; top: 118px; max-height: calc(100vh - 130px); overflow: auto;
  padding-bottom: 8px; scrollbar-width: thin; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 0; }
.card-h { display: flex; align-items: baseline; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line-2); }
.card-h .by { font-size: 12px; color: var(--muted); letter-spacing: .3px; }
.card-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-b { padding: 14px 16px; }
.card-b.flush { padding: 0; }
.eyebrow { font-size: 11px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--gold-text); font-weight: 700; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow); min-width: 0; }
.kpi .v { font-size: 24px; font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .s { font-size: 12px; color: var(--muted); }
.book-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.book-switch button { background: none; border: 0; padding: 4px 10px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); }
.book-switch button[aria-pressed="true"] { background: var(--primary); color: var(--primary-fg); }

/* ---------- staff ---------- */
.staff { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.person { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--card-2);
  display: grid; gap: 10px; min-width: 0; align-content: start; }
.person.trader { background: var(--card); }
.person-top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.portrait { width: 56px; height: 56px; border-radius: 50%; flex: none; background: var(--navy); display: grid;
  place-items: center; overflow: hidden; box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--gold); position: relative; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait span { font-family: var(--serif); color: var(--gold-soft); font-size: 22px; font-weight: 600; letter-spacing: .5px; }
.portrait.working::after { content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid transparent; border-top-color: var(--gold-soft); animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.who { min-width: 0; }
.who .name { font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.1; }
.who .title { font-size: 12.5px; color: var(--ink-2); }
.who .desk { font-size: 11.5px; color: var(--muted); letter-spacing: .3px; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.pill.active { background: var(--green-soft); color: var(--green); }
.pill.training { background: #F3EBDD; color: var(--gold-text); }
:root[data-theme="dark"] .pill.training { background: #2A2416; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.training { background: #2A2416; } }
.pill.paused { background: var(--crimson-soft); color: var(--crimson); }
.pill.code { background: var(--line-2); color: var(--ink-2); }
.person .status { margin-left: auto; align-self: flex-start; }
.meter { display: grid; gap: 4px; }
.meter-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); gap: 8px; }
.bar { height: 7px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--gold); border-radius: 99px; width: 0; transition: width .4s; }
.bar.warn > i { background: #C58A1B; }
.bar.bad > i { background: var(--crimson); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.stat .v { font-weight: 700; font-size: 15px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 6px 11px; cursor: pointer;
  font-size: 13px; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--gold); }
.btn.primary { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.btn.gold { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn.danger { color: var(--crimson); border-color: var(--crimson); }
.btn.danger.solid { background: #980A18; color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.bio { font-size: 12.5px; color: var(--ink-2); }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 700; font-size: 11px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted);
  padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--card-2); }
td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
td.r, th.r { text-align: right; }
tr:last-child td { border-bottom: 0; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: var(--line-2); color: var(--ink-2);
  text-transform: uppercase; letter-spacing: .5px; }
.tag.live { background: var(--primary); color: var(--primary-fg); }
.tag.paper { background: #F3EBDD; color: var(--gold-text); }
.tag.yes { background: var(--green-soft); color: var(--green); }
.tag.no { background: var(--crimson-soft); color: var(--crimson); }
.empty { padding: 22px 16px; color: var(--muted); text-align: center; font-size: 14px; }

/* ---------- weather ---------- */
.wx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.wx { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.wx.dim { opacity: .72; }
.wx-h { padding: 12px 14px 8px; display: flex; gap: 10px; align-items: baseline; }
.wx-h .city { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.wx-h .date { font-size: 12px; color: var(--muted); }
.wx-h .right { margin-left: auto; }
.wx-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 14px 10px; }
.wx-facts .l { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; }
.wx-facts .v { font-weight: 700; font-size: 15px; }
.ladder { border-top: 1px solid var(--line-2); }
.rung { display: grid; grid-template-columns: 92px 1fr 88px; gap: 8px; align-items: center; padding: 6px 14px;
  border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.rung:last-child { border-bottom: 0; }
.rung .lab { font-weight: 700; white-space: nowrap; }
.rung .viz { position: relative; height: 18px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.rung .viz .m { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(143, 106, 44, .55); }
.rung .viz .k { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--navy); }
:root[data-theme="dark"] .rung .viz .k { background: #ECE7DD; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rung .viz .k { background: #ECE7DD; } }
.rung .viz .band { position: absolute; top: 0; bottom: 0; background: rgba(26, 35, 50, .12); }
.rung .px { text-align: right; white-space: nowrap; }
.rung.edge { background: #FBF6EC; }
:root[data-theme="dark"] .rung.edge { background: #221E14; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rung.edge { background: #221E14; } }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ---------- board + chat ---------- */
.posts { display: grid; }
.post { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.post:last-child { border-bottom: 0; }
.post .portrait { width: 34px; height: 34px; box-shadow: 0 0 0 1.5px var(--gold); }
.post .portrait span { font-size: 14px; }
.post .meta { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.post .meta b { color: var(--ink); font-family: var(--serif); font-size: 16px; }
.post .ptitle { font-weight: 700; font-size: 13.5px; margin-top: 1px; }
.post .pbody { font-size: 13.5px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.post.alert { background: var(--crimson-soft); }
.post.settlement .ptitle { color: var(--gold-text); }
.chat { display: grid; grid-template-rows: auto 1fr auto; }
.chat-log { max-height: 380px; overflow-y: auto; padding: 12px 14px; display: grid; gap: 10px; align-content: start; }
.bubble { max-width: 88%; padding: 9px 12px; border-radius: 12px; font-size: 14px; white-space: pre-wrap;
  overflow-wrap: anywhere; }
.bubble.user { justify-self: end; background: var(--primary); color: var(--primary-fg); border-bottom-right-radius: 4px; }
.bubble.assistant { justify-self: start; background: var(--card-2); border: 1px solid var(--line);
  border-bottom-left-radius: 4px; }
.bubble.thinking { color: var(--muted); font-style: italic; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line-2); }
.chat-form textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  background: var(--card); min-height: 40px; max-height: 120px; }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 12px 10px; }
.suggest button { font-size: 12px; border: 1px solid var(--line); background: var(--card-2); border-radius: 999px;
  padding: 4px 10px; cursor: pointer; color: var(--ink-2); }

/* ---------- pending ---------- */
.pending { border: 1px solid var(--gold); background: #FBF6EC; border-radius: var(--radius); padding: 12px 14px;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
:root[data-theme="dark"] .pending { background: #221E14; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pending { background: #221E14; } }
.pending .txt { flex: 1; min-width: 200px; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; align-items: start; }
.field { display: grid; gap: 4px; }
.field label { font-size: 12px; color: var(--ink-2); font-weight: 700; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field input, .field select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--card); }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks label { display: inline-flex; gap: 5px; align-items: center; border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 10px; font-size: 12.5px; cursor: pointer; background: var(--card); }
.checks input { accent-color: var(--gold); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.health { display: grid; gap: 8px; }
.health-row { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.health-row .v { margin-left: auto; color: var(--ink-2); text-align: right; }

/* ---------- modal + toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(8, 15, 28, .55); display: grid; place-items: center; z-index: 50;
  padding: 16px; }
.modal { background: var(--card); border-radius: 12px; width: min(440px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.35);
  border-top: 4px solid var(--gold); }
.modal.danger { border-top-color: #980A18; }
.modal h3 { padding: 18px 20px 4px; }
.modal .mb { padding: 6px 20px 8px; color: var(--ink-2); font-size: 14px; }
.modal .mb input { width: 100%; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  font-size: 20px; letter-spacing: 6px; text-align: center; background: var(--card); }
.modal .mb textarea { width: 100%; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  background: var(--card); }
.modal .mf { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; }
.modal .err { color: var(--crimson); font-size: 13px; min-height: 18px; margin-top: 6px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #F4EFE6;
  padding: 10px 16px; border-radius: 10px; z-index: 60; box-shadow: 0 8px 30px rgba(0,0,0,.25); font-size: 14px;
  max-width: calc(100% - 32px); }
.toast.bad { background: #980A18; }

.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 10px 0 30px; letter-spacing: .4px; }
.footer .motto { font-family: var(--serif); font-size: 15px; color: var(--gold-text); font-style: italic; }
.spark { width: 100%; height: 120px; display: block; }

/* ---------- auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 50% -10%, #1F3458 0%, var(--navy) 60%); }
.auth { width: min(420px, 100%); background: #FBF9F5; color: #1A2332; border-radius: 14px; padding: 28px 26px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35); border-top: 4px solid var(--gold); }
.auth .logo { width: 84px; height: 84px; border-radius: 50%; background: #F4F0E7; margin: 0 auto 10px; display: grid;
  place-items: center; box-shadow: 0 0 0 2px #C9A45C; }
.auth .logo img { width: 56px; }
.auth h1 { text-align: center; font-size: 28px; }
.auth .sub { text-align: center; color: #7A5A23; font-size: 11px; letter-spacing: 2.4px; text-transform: uppercase; margin-bottom: 18px; }
.auth .field input { background: #fff; border-color: #DCD5C8; color: #1A2332; }
.auth .field label { color: #4A5261; }
.auth button.primary { width: 100%; padding: 11px; font-size: 15px; margin-top: 6px; background: #0F1E33; color: #F4EFE6;
  border: 0; border-radius: 8px; cursor: pointer; font-weight: 700; }
.auth .err { color: #980A18; min-height: 20px; font-size: 13.5px; margin-top: 8px; text-align: center; }
.auth .foot { text-align: center; font-family: var(--serif); font-style: italic; color: #7A5A23; margin-top: 16px; }
.auth .steps { font-size: 13.5px; color: #4A5261; }
.auth .qr { background: #fff; padding: 8px; border: 1px solid #E4DED3; border-radius: 8px; width: 210px; margin: 10px auto; }
.auth .qr svg { width: 100%; height: auto; display: block; }
.auth code { background: #F1ECE2; padding: 2px 6px; border-radius: 4px; font-size: 13px; word-break: break-all; }
.auth .stack { display: grid; gap: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .page { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; max-height: none; overflow: visible; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .top-inner { padding: 8px 16px; gap: 10px; flex-wrap: wrap; }
  .brand-name { font-size: 18px; }
  .brand-sub { display: none; }
  .top-status .chip.opt { display: none; }
  .tabs-inner { padding: 0 8px; }
  .tab.rail-tab { display: inline-block; }
  .page { padding: 14px 16px 50px; }
  body:not(.show-rail) .rail { display: none; }
  body.show-rail .main { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .v { font-size: 20px; }
  .staff { grid-template-columns: minmax(0, 1fr); }
  .wx-grid { grid-template-columns: minmax(0, 1fr); }
  .rung { grid-template-columns: 78px 1fr 78px; padding: 6px 10px; }
  .rail { top: 0; }
  .chat-log { max-height: 55vh; }
}

.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); font-size: 12px; cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px; justify-self: start; }
.linkbtn:hover { color: var(--gold-text); }
.dlist { display: grid; }
.ditem { padding: 11px 16px; border-bottom: 1px solid var(--line-2); display: grid; gap: 3px; }
.ditem:last-child { border-bottom: 0; }
.ditem .dl { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13.5px; }
.ditem .dl b { font-weight: 700; }
.ditem .why { font-size: 12.5px; color: var(--muted); }
.kpi.dimmed { opacity: .6; }
.kpis .kpi .s .muted { color: var(--muted); }
