/* LSO Tracker design system.
 *
 * Hand-written, dependency-free CSS replicating the Material/Quasar look of the original
 * NiceGUI UI. Themes are driven by CSS custom properties on <html data-theme="...">:
 *   light | dark.
 */

@font-face { font-family: "Roboto"; font-style: normal; font-weight: 300; font-display: swap; src: url(../fonts/roboto-300.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/roboto-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/roboto-500.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/roboto-700.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Material Icons"; font-style: normal; font-weight: 400; font-display: block; src: url(../fonts/material-icons.woff2) format("woff2"); }

/* ── tokens ─────────────────────────────────────────────────────────────── */
:root {
  --primary: #1976d2;
  --positive: #21ba45;
  --negative: #c10015;
  --warning: #f2c037;
  --info: #31ccec;

  --bg: #ffffff;
  --card: #ffffff;
  --text: rgba(0, 0, 0, 0.87);
  --text-dim: rgba(0, 0, 0, 0.54);
  --text-faint: rgba(0, 0, 0, 0.38);
  --border: rgba(0, 0, 0, 0.12);
  --field-border: rgba(0, 0, 0, 0.24);
  --hover: rgba(0, 0, 0, 0.04);
  --th-bg: #ffffff;
  --shadow: 0 1px 5px rgba(0, 0, 0, 0.2), 0 2px 2px rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12);

  --call-row: rgba(0, 100, 50, 0.05);
  --assigned-row: rgba(255, 235, 59, 0.05);
  --itm-risk-bg: #ef9a9a;     /* red-3 */
  --itm-risk-fg: #212121;
  --itm-snoozed-bg: #eeeeee;  /* grey-3 */
  --itm-snoozed-fg: #212121;
  --horizon-bg: #fff9c4;      /* yellow-2 */
  --horizon-fg: #212121;
  --orig-missing-bg: #ffee58; /* yellow-4 */
  --dot-week: #1e88e5;        /* blue-6 */
  --plotly-paper: #ffffff;

  --btn-bg: var(--primary);
  --btn-fg: #ffffff;
  --scrim: rgba(0, 0, 0, 0.4);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #121212;
  --card: #1d1d1d;
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.7);
  --text-faint: rgba(255, 255, 255, 0.5);
  --border: rgba(255, 255, 255, 0.28);
  --field-border: rgba(255, 255, 255, 0.36);
  --hover: rgba(255, 255, 255, 0.07);
  --th-bg: #1d1d1d;
  --shadow: 0 1px 5px rgba(0, 0, 0, 0.6), 0 2px 2px rgba(0, 0, 0, 0.4), 0 3px 1px -2px rgba(0, 0, 0, 0.4);

  --call-row: rgba(0, 100, 50, 0.2);
  --assigned-row: rgba(255, 235, 59, 0.05);
  --itm-risk-bg: #b71c1c;     /* red-10 */
  --itm-risk-fg: #ffffff;
  --itm-snoozed-bg: #212121;  /* grey-9 */
  --itm-snoozed-fg: #ffffff;
  --horizon-bg: #3e2723;      /* brown-10 */
  --horizon-fg: #f5f5f5;
  --orig-missing-bg: #f9a825; /* yellow-9 */
  --dot-week: #42a5f5;        /* blue-4 */
  --plotly-paper: #1d1d1d;
  --scrim: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

/* ── base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Roboto, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }

.material-icons {
  font-family: "Material Icons"; font-weight: normal; font-style: normal; font-size: 24px;
  line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block;
  white-space: nowrap; word-wrap: normal; direction: ltr; vertical-align: middle;
  -webkit-font-feature-settings: "liga"; font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased; user-select: none;
}
.icon-xs { font-size: 16px; }
.icon-sm { font-size: 18px; }

/* typography */
.text-h4 { font-size: 2.125rem; font-weight: 400; line-height: 2.5rem; letter-spacing: 0.00735em; }
.text-h5 { font-size: 1.5rem; font-weight: 400; line-height: 2rem; }
.text-h6 { font-size: 1.25rem; font-weight: 500; line-height: 2rem; letter-spacing: 0.0125em; }
.text-subtitle2 { font-size: 0.875rem; font-weight: 500; line-height: 1.375rem; }
.text-caption { font-size: 0.75rem; font-weight: 400; line-height: 1.25rem; }
.text-grey { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.text-negative { color: var(--negative); }
.text-positive { color: var(--positive); }
.text-bold { font-weight: 500; }
.mono { font-family: Menlo, Monaco, Consolas, monospace; }

/* layout helpers */
.row { display: flex; flex-wrap: wrap; align-items: center; }
.row.nowrap { flex-wrap: nowrap; }
.col { display: flex; flex-direction: column; }
.gap-0 { gap: 0; } .gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.grow { flex: 1 1 0; min-width: 0; }
.spacer { flex-grow: 1; }
.w-full { width: 100%; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; }
.p-4 { padding: 16px; } .px-4 { padding-left: 16px; padding-right: 16px; }
.right { text-align: right; } .center { text-align: center; } .left { text-align: left; }
.wrap { flex-wrap: wrap; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.items-start { align-items: flex-start; }
.pointer { cursor: pointer; }

/* ── page shell ─────────────────────────────────────────────────────────── */
.page { padding: 16px; }
.tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 16px; }
.tab {
  background: none; border: 0; padding: 0 16px; min-height: 48px; cursor: pointer;
  font-size: 14px; font-weight: 500; letter-spacing: 0.0892857em; text-transform: uppercase;
  color: var(--text-dim); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { background: var(--hover); }
.tab.active { color: var(--text); border-bottom-color: var(--text); }
:root[data-theme="light"] .tab.active, :root:not([data-theme]) .tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { padding: 16px; background: var(--card); }

/* ── buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 4px 16px; border: 0; border-radius: 4px; cursor: pointer;
  background: var(--btn-bg); color: var(--btn-fg);
  font-size: 14px; font-weight: 500; letter-spacing: 0.0892857em; text-transform: uppercase;
  text-decoration: none; box-shadow: var(--shadow); white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; box-shadow: none; filter: none; }
.btn.flat { background: transparent; color: var(--primary); box-shadow: none; }
.btn.flat:hover { background: var(--hover); filter: none; }
.btn.flat.grey { color: var(--text-dim); }
.btn.negative { background: var(--negative); }
.btn.flat.negative { background: transparent; color: var(--negative); }
.btn.flat.negative:hover { background: var(--hover); }
.btn.dense { min-height: 28px; padding: 2px 8px; }
.btn.icon { padding: 4px; min-width: 28px; min-height: 28px; border-radius: 50%; background: transparent; color: inherit; box-shadow: none; }
.btn.icon:hover { background: var(--hover); filter: none; }
.btn.xs { padding: 2px; min-width: 24px; min-height: 24px; background: transparent; color: inherit; box-shadow: none; border-radius: 4px; }
.btn.xs:hover { background: var(--hover); filter: none; }
.btn.xs .material-icons { font-size: 18px; }

/* button group / toggle */
.toggle { display: inline-flex; border: 1px solid var(--field-border); border-radius: 4px; overflow: hidden; box-shadow: none; }
.toggle button { background: transparent; border: 0; border-right: 1px solid var(--field-border); padding: 4px 12px; min-height: 36px; cursor: pointer; font-weight: 500; letter-spacing: 0.0892857em; text-transform: uppercase; color: var(--text); }
.toggle button:last-child { border-right: 0; }
.toggle button:hover { background: var(--hover); }
.toggle button.active { background: var(--primary); color: #fff; }
.toggle.emoji button { font-size: 16px; padding: 4px 14px; }

/* ── form controls ──────────────────────────────────────────────────────── */
.field { position: relative; display: inline-flex; flex-direction: column; min-width: 0; }
.field > label { font-size: 12px; color: var(--text-dim); line-height: 1.2; margin-bottom: 2px; }
.input, .select, .textarea {
  background: transparent; border: 1px solid var(--field-border); border-radius: 4px;
  padding: 0 8px; min-height: 40px; width: 100%; outline: none;
}
.field.dense .input, .field.dense .select { min-height: 40px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.select { appearance: none; -webkit-appearance: none; padding-right: 28px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.select option { background: #1d1d1d; color: #fff; }
:root[data-theme="light"] .select option { background: #fff; color: #000; }
button.select { text-align: left; font: inherit; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; top: 100%; left: 0; min-width: 100%; margin: 2px 0 0; padding: 4px 0; list-style: none;
  background: var(--menu-bg, var(--card)); color: var(--text); border: 1px solid var(--field-border); border-radius: 4px;
  box-shadow: var(--shadow); z-index: 20; max-height: 60vh; overflow: auto; }
.dropdown-menu li { padding: 8px 12px; cursor: pointer; white-space: nowrap; }
.dropdown-menu li:hover { background: var(--hover); }
.dropdown-menu li.active { color: var(--primary); font-weight: 500; }
.textarea { padding: 8px; resize: vertical; font-family: inherit; }
/* Outlined field whose label sits inside the border (Quasar's floating label) */
.field.floating > label { position: absolute; left: 9px; top: 4px; font-size: 10px; z-index: 1; pointer-events: none; margin: 0; }
.field.floating .select, .field.floating .input { padding-top: 14px; padding-bottom: 0; }
.w-32 { width: 128px; } .w-28 { width: 112px; } .w-40 { width: 160px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 34px; height: 14px; border-radius: 7px; background: var(--field-border); position: relative; transition: background .15s; cursor: pointer; margin: 0; }
.switch input::after { content: ""; position: absolute; top: -3px; left: -2px; width: 20px; height: 20px; border-radius: 50%; background: #bdbdbd; box-shadow: var(--shadow); transition: transform .15s, background .15s; }
.switch input:checked { background: rgba(25, 118, 210, 0.5); }
.switch input:checked::after { transform: translateX(20px); background: var(--primary); }
.inline-hint { font-size: 12px; color: var(--text-dim); }

/* ── cards & expansion ──────────────────────────────────────────────────── */
.card { background: var(--card); border-radius: 4px; box-shadow: var(--shadow); padding: 16px; }
.card.outlined { box-shadow: none; border: 1px solid var(--border); }
details.expansion { width: 100%; }
details.expansion > summary { display: flex; align-items: center; gap: 16px; min-height: 48px; padding: 0 16px; cursor: pointer; list-style: none; user-select: none; }
details.expansion > summary::-webkit-details-marker { display: none; }
details.expansion > summary .chev { margin-left: auto; transition: transform .2s; }
details.expansion[open] > summary .chev { transform: rotate(180deg); }
details.expansion > summary:hover { background: var(--hover); }
details.stats-section > summary { padding: 0; }

/* ── badges ─────────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 6px; font-size: 12px; line-height: 1; min-height: 12px; border-radius: 4px; vertical-align: baseline; white-space: nowrap; }
.badge.outline { background: transparent; border: 1px solid currentColor; }
.badge.itm { font-weight: 500; }
.c-red-7 { color: #d32f2f; } .c-amber-8 { color: #ff8f00; } .c-cyan { color: #00bcd4; }
.c-green { color: #4caf50; } .c-light-green-13 { color: #76ff03; } .c-teal { color: #009688; } .c-purple { color: #9c27b0; } .c-grey { color: #9e9e9e; }
.bg-red-10 { background: #b71c1c; } .bg-orange { background: #ff9800; } .bg-green-10 { background: #1b5e20; } .bg-grey { background: #9e9e9e; }
.tc-white { color: #fff; } .tc-black { color: #000; }
.i-yellow { color: #ffeb3b; } .i-orange { color: #ff9800; } .i-week { color: var(--dot-week); }
.i-green { color: #4caf50; } .i-grey { color: #9e9e9e; } .i-grey5 { color: #9e9e9e; } .i-amber { color: #ff8f00; } .i-primary { color: var(--primary); }

/* ── tables ─────────────────────────────────────────────────────────────── */
.table-card { position: relative; background: var(--card); border-radius: 4px; box-shadow: var(--shadow); }
.table-scroll { overflow: auto; max-width: 100%; }
.lso-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.lso-table th, .lso-table td { padding: 4px 4px; height: 28px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.lso-table th { font-size: 12px; font-weight: 500; text-align: right; background: var(--th-bg); position: sticky; top: 0; z-index: 1; user-select: none; }
.lso-table th.left, .lso-table td.left { text-align: left; }
.lso-table th.center, .lso-table td.center { text-align: center; }
.lso-table th.right, .lso-table td.right { text-align: right; }
.lso-table thead th { border-bottom: 1px solid var(--border); }
/* Tracker headers are centered over their columns whatever the values' alignment, except the
   head-left ones, which sit on the left edge of their column. */
.lso-table.tracker thead th { text-align: center; }
/* The sort arrow is out of the text flow (and its room reserved on both sides) so the label
   is centered exactly; the columns holding left-aligned values shrink to fit them, so
   the centered header sits over the values rather than over slack space. */
.lso-table.tracker thead th.sortable { padding-left: 18px; padding-right: 18px; }
.lso-table.tracker thead th .sort-icon { position: absolute; left: 2px; top: 50%; margin: -8px 0 0; }
.lso-table.tracker thead th.head-left { text-align: left; }
.lso-table.tracker thead th.head-left.sortable { padding-left: 4px; }
.lso-table.tracker thead th.head-left .sort-icon { left: auto; right: 2px; }
.lso-table.tracker thead th.fit { width: 1%; }
.lso-table th.sortable { cursor: pointer; }
.lso-table th.sortable:hover { color: var(--text); }
.lso-table th .sort-icon { font-size: 16px; opacity: 0; vertical-align: text-bottom; margin: 0 2px; transition: opacity .15s, transform .15s; }
.lso-table th.sortable:hover .sort-icon { opacity: 0.5; }
.lso-table th.sorted .sort-icon { opacity: 1; }
.lso-table th.sorted.desc .sort-icon { transform: rotate(180deg); }
.lso-table tbody tr:hover td { background-color: var(--hover); }
.lso-table td.sel, .lso-table th.sel { width: 40px; text-align: center; padding: 0 4px; }
.lso-table td.call-row { background-color: var(--call-row); }
.lso-table tr.selected td { background-color: rgba(25, 118, 210, 0.15); }
.lso-table td.assigned-row { background-color: var(--assigned-row); }
.lso-table td.itm-risk { background: var(--itm-risk-bg); color: var(--itm-risk-fg); }
.lso-table td.itm-snoozed { background: var(--itm-snoozed-bg); color: var(--itm-snoozed-fg); }
.lso-table td.horizon-hl { background: var(--horizon-bg); color: var(--horizon-fg); }
/* row hover must not wipe the roll highlight (its specificity beats `.lso-table td.horizon-hl`) */
.lso-table tbody tr:hover td.horizon-hl { background: var(--horizon-bg); color: var(--horizon-fg); }
.lso-table td.orig-missing { background: var(--orig-missing-bg); }
.lso-table td.notes { max-width: 200px; width: 200px; }
.lso-table td.notes .note-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.lso-table td.notes .note-text.empty { opacity: 0.2; font-style: italic; }
.lso-table td.charts .btns { display: flex; justify-content: center; gap: 2px; }
/* Quasar's dense rows are 40px tall here because of the selection checkbox / chart buttons. */
.lso-table.tracker td { height: 40px; }
.lso-table.compact th, .lso-table.compact td { padding: 4px 8px; }
.lso-table.stats th, .lso-table.stats td { padding: 4px 8px; }
.lso-table.stats tbody tr:hover td { background: var(--hover); }
.lso-table .num-pos { color: var(--positive); } .lso-table .num-neg { color: var(--negative); }
.lso-table tr.summary td { font-weight: 700; }
.lso-table tr.summary.first td { border-top: 2px solid rgba(128, 128, 128, 0.4); }
.ticker-cell, .expiry-cell { display: flex; align-items: center; gap: 3px; }
.expiry-cell { justify-content: flex-start; }
.ticker-cell .main { display: flex; align-items: center; gap: 2px; min-width: 0; cursor: pointer; }
.itm-cell { display: flex; align-items: center; justify-content: flex-start; gap: 4px; }
.itm-cell .material-icons { margin-left: 4px; }
.price-cell { display: flex; gap: 4px; justify-content: center; }
.price-up { color: green; } .price-down { color: red; }
:root[data-theme="dark"] .price-up { color: #21ba45; }
.lso-table td.alertable { cursor: pointer; }
.lso-table td.alertable:hover .orig-alert-link, .lso-table td.alertable:hover span:first-child { text-decoration: underline; text-decoration-style: dashed; }
.orig-alert-link { cursor: pointer; text-decoration: underline; text-decoration-style: dashed; }
.orig-bar { height: 3px; background: rgba(128, 128, 128, 0.2); border-radius: 2px; margin-top: 3px; min-width: 40px; }
.orig-bar > div { height: 100%; border-radius: 2px; }
.trade-link { cursor: pointer; text-decoration: none; }
.trade-link:hover { text-decoration: underline; }
.dot { margin-left: 1px; }
.pointer-cell { cursor: pointer; }

.table-bottom { display: flex; align-items: center; gap: 16px; padding: 4px 8px; min-height: 40px; flex-wrap: wrap; }
.table-bottom .stat { font-weight: 500; font-size: 12px; }

/* ── toolbar (filters) ──────────────────────────────────────────────────── */
.filters { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.badge-fri { background: #ff9800; color: #000; }
.action-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.action-bar + .action-bar { margin-top: 8px; }

/* ── tooltip (one shared element, see app.js) ───────────────────────────── */
#lso-tooltip { position: fixed; z-index: 10000; pointer-events: none; background: #616161; color: #fff; font-size: 10px; padding: 6px 10px; border-radius: 4px; max-width: 400px; opacity: 0; transition: opacity .1s; white-space: pre-wrap; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
#lso-tooltip.show { opacity: 0.95; }
#lso-tooltip.big { width: 400px; max-height: 200px; overflow: auto; font-size: 14px; }

/* ── dialogs ────────────────────────────────────────────────────────────── */
dialog.dlg { border: 0; padding: 0; background: transparent; color: var(--text); max-width: 96vw; max-height: 96vh; overflow: visible; }
dialog.dlg::backdrop { background: var(--scrim); }
dialog.dlg > .card { padding: 16px; min-width: 400px; max-width: 96vw; max-height: 92vh; overflow: auto; background: var(--card); }
dialog.dlg.wide > .card { min-width: min(1000px, 92vw); }
dialog.dlg.med > .card { min-width: min(640px, 92vw); }
dialog.dlg.narrow > .card { min-width: min(480px, 92vw); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; align-items: center; }

/* ── toasts ─────────────────────────────────────────────────────────────── */
#toasts { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 9000; align-items: center; max-width: 92vw; }
.toast { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 16px; border-radius: 4px; box-shadow: var(--shadow); background: #323232; color: #fff; max-width: 92vw; white-space: pre-wrap; word-break: break-word; }
.toast.positive { background: var(--positive); color: rgba(0, 0, 0, 0.87); } .toast.negative { background: var(--negative); }
/* Green, yellow and cyan are light: dark text keeps the contrast readable (white on them is 1.7-2.6:1) */
.toast.warning { background: var(--warning); color: rgba(0, 0, 0, 0.87); } .toast.info { background: var(--info); color: rgba(0, 0, 0, 0.87); }
.toast .btn { color: inherit; }
#download-progress:empty { display: none; }
.toast.progress { min-width: 260px; }
.toast .spinner.small { width: 20px; height: 20px; flex: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.2); border-top-color: currentColor; }
.progress-track { height: 4px; margin-top: 6px; border-radius: 2px; background: rgba(0, 0, 0, 0.2); overflow: hidden; }
.progress-fill { height: 100%; background: currentColor; transition: width 0.3s; }

/* ── loading overlay ────────────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 9500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: #fff; }
.spinner { width: 48px; height: 48px; border: 4px solid rgba(255, 255, 255, 0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── stats ──────────────────────────────────────────────────────────────── */
.echart { width: 100%; }
/* Capital-week popup: fixed pie square + scrollable legend, identical for every week. */
.capital-week-body { display: flex; gap: 24px; align-items: flex-start; margin-top: 16px; }
.capital-week-body #capital-pie { flex: 0 0 340px; width: 340px; height: 340px; }
.capital-week-legend { flex: 1 1 auto; min-width: 0; max-height: 340px; overflow-y: auto; margin: 0; padding: 0; list-style: none; columns: 2 240px; column-gap: 24px; font-size: 0.95rem; font-weight: 500; }
.capital-week-legend li { display: flex; align-items: center; gap: 8px; padding: 2px 0; break-inside: avoid; white-space: nowrap; }
.capital-week-legend .swatch { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 3px; }
.full-bleed { width: 100vw; position: relative; left: 50%; transform: translateX(-50%); padding: 0 8px; }
.stat-card { border-left: 4px solid #4caf50; width: fit-content; padding: 16px; margin-bottom: 8px; }
.stat-card.low { border-left-color: #f44336; }
.stat-card .k { font-size: 1rem; }
.stat-card .v { font-size: 2.125rem; font-weight: 700; line-height: 2.5rem; }
.trace-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.type-cards { display: flex; gap: 16px; flex-wrap: wrap; padding: 0 16px; }
.type-cards > .card { flex: 1 1 16rem; min-width: 16rem; }
.stat-pair { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 4px; }
.lso-table.dense { width: 100%; }
.lso-table.dense th, .lso-table.dense td { padding: 2px 8px; height: 24px; }
a.ticker-link { color: inherit; text-decoration: underline; cursor: pointer; }

/* ── login ──────────────────────────────────────────────────────────────── */
.login-card { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; gap: 16px; min-width: 300px; }
