:root {
  color-scheme: dark;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #ebedf4;
  background: #0d1118;
  font-synthesis: none;
  --muted: #acb6c8;
  --green: #1a263a;
  --line: #303847;
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
[hidden] { display: none !important; }
a { color: inherit; }
.shell { width: min(1250px, calc(100% - 64px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid #313c4e; background: var(--green); color: #fff; }
.header-inner { display: flex; justify-content: space-between; align-items: center; min-height: 48px; gap: 16px; }
.brand { color: #fff; font-size: 1.15rem; font-weight: 800; text-decoration: none; letter-spacing: -.035em; }
.brand span { color: #78c7ff; }
.source { color: #c4cee0; font-size: .875rem; text-align: right; margin: 0; }
main { padding-block: 26px 48px; }
.page-intro { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 3vw, 2.7rem); line-height: 1.05; letter-spacing: -.065em; }
.page-intro p { color: var(--muted); margin-top: 13px; }
button, select, input { font: inherit; }
button, select, input { min-height: 43px; border: 1px solid #475267; border-radius: 4px; }
button { padding: .55rem .9rem; font-size: .875rem; font-weight: 700; background: var(--green); border-color: #e2eafa; color: #fff; cursor: pointer; white-space: nowrap; }
button:hover { background: #2d4260; }
button.quiet { border-color: #475267; background: #181e29; color: #e2eafa; }
button.quiet:hover { background: #273349; }
button:disabled { cursor: default; opacity: .5; }
:focus-visible { outline: 3px solid #7cceff; outline-offset: 3px; }
.notice { border: 1px solid #344057; border-radius: 4px; padding: 12px 16px; background: #171f2d; margin-bottom: 18px; font-size: .9rem; }
.filters { display: grid; grid-template-columns: repeat(2, minmax(135px, 1fr)) repeat(3, minmax(115px, 1fr)) auto; align-items: end; gap: 14px; padding: 18px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 5px; background: #151b25; }
label { display: grid; gap: 5px; color: #c6d0df; font-size: .875rem; font-weight: 700; }
select, input { width: 100%; min-width: 0; padding: .53rem .72rem; background-color: #111722; color: #ebedf4; font-weight: 500; }
select { text-overflow: ellipsis; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.card { min-width: 0; border: 1px solid var(--line); border-radius: 5px; background: #181e29; }
.kpi { padding: 19px 20px; }
.kpi h2 { font-size: .875rem; font-weight: 700; }
.kpi p { font-size: clamp(1.4rem, 2.9vw, 2.45rem); font-weight: 800; letter-spacing: -.06em; margin-top: 7px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.kpi small { display: block; font-size: .8125rem; color: var(--muted); }
.kpi.primary { background: var(--green); color: #fff; border-color: #e2eafa; }
.kpi.primary small { color: #b7c7da; }
.detail-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 10px; margin-bottom: 10px; }
.panel { padding: 21px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.panel h2 { font-size: 1.14rem; letter-spacing: -.025em; }
.panel-head p, .empty { color: var(--muted); font-size: .875rem; }
.trend { display: grid; gap: 10px; }
.trend-row { display: grid; grid-template-columns: 5rem minmax(0, 1fr) minmax(5.4rem, auto); align-items: center; gap: 8px; font-size: .875rem; }
.trend-row strong { text-align: right; }
meter { appearance: none; display: block; width: 100%; height: 12px; border: 0; background: #252e3e; border-radius: 5px; }
meter::-webkit-meter-bar { background: #252e3e; border: 0; border-radius: 5px; }
meter::-webkit-meter-optimum-value { background: #61b6f1; border-radius: 5px; }
meter::-moz-meter-bar { background: #61b6f1; border-radius: 5px; }
.markets { display: grid; gap: 16px; }
.market-title { display: flex; justify-content: space-between; gap: 8px; font-size: .925rem; margin-bottom: 4px; }
.market-detail { color: var(--muted); font-size: .8125rem; margin-bottom: 6px; }
.market meter::-webkit-meter-optimum-value { background: #75d4ac; }
.market meter::-moz-meter-bar { background: #75d4ac; }
.pagination { display: flex; gap: 6px; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; text-align: left; }
th, td { padding: 11px 12px; border-bottom: 1px solid #303746; vertical-align: top; }
th { background: #202735; color: #c2cee0; font-size: .875rem; }
td:nth-child(n+6), th:nth-child(n+6) { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td:nth-child(4), th:nth-child(4) { white-space: nowrap; }
td:first-child { overflow-wrap: anywhere; min-width: 135px; }
.view-switch { display: flex; gap: 8px; margin-bottom: 16px; }
.stock-filters { grid-template-columns: 1.4fr 1fr 1fr .7fr; }
.stock-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stock-table th:nth-child(n+6), .stock-table td:nth-child(n+6) { text-align: left; white-space: normal; }
.stock-table td:nth-child(3), .stock-table td:nth-child(4) { white-space: nowrap; }
.stock-table td:nth-child(5), .stock-table td:nth-child(6), .stock-table td:nth-child(7) { text-align: right; }
.stock-table td:last-child { min-width: 210px; }
.stock-meta { display: block; color: var(--muted); font-size: .8125rem; }
.flag { display: block; width: fit-content; margin-top: .2rem; padding: .1rem .4rem; border-radius: 4px; background: #453719; color: #ffd881; font-size: .8125rem; font-weight: 700; }
@media (max-width: 900px) {
  .shell { width: calc(100% - 40px); }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .shell { width: calc(100% - 28px); }
  main { padding-block: 30px; }
  .page-intro { align-items: start; flex-direction: column; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi, .panel { padding: 14px; }
  .transactions .panel-head { align-items: flex-start; flex-direction: column; }
}

.kpi { border-top: 2px solid #46546b; }
.kpi.primary { background: linear-gradient(120deg,#192b34,#18202b); border: 1px solid var(--line); border-top: 2px solid #69d7b4; }
.kpi.primary p { color: #83ebc4; }
.kpi p, .market-title strong:last-child, .trend-row strong, td:nth-child(n+6) { font-family: "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
#stock-stale { color: #f5bc6d; }
.view-switch { border-bottom: 1px solid var(--line); gap: 0; }
.view-switch button { background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; }
.view-switch button[aria-pressed="true"] { color: #96d9ff; border-bottom-color: #74c8ff; }
tr:hover td { background: #1f2835; }
.timeline { display: block; width: 100%; height: auto; }
details { color: var(--muted); font-size: .875rem; }
summary { cursor: pointer; padding: 5px 0; }
.view-switch { flex-wrap: wrap; gap: 2px; }
.ops-head { display:flex; align-items:center; justify-content:space-between; gap:14px; margin:20px 0; }
.ops-head h2 { font-size:1.65rem; letter-spacing:-.04em; }
.ops-head p, #edit-context, #edit-status {color:var(--muted);font-size:.9rem;}
.ops-filters {grid-template-columns:1.4fr 1fr 1fr 1fr}
#filters { grid-template-columns:repeat(auto-fit,minmax(125px,1fr)); }
.ops-table td:nth-child(n+6), .ops-table th:nth-child(n+6) {text-align:left;white-space:normal;font-family:inherit}
.ops-table td:first-child {min-width:160px}
.ops-table td {vertical-align:middle}
.ops-table button {min-height:32px}
dialog { width:min(520px,94vw); max-height:90vh; padding:24px; border:1px solid #51617a; border-radius:8px; color:#e2eafa; background:#171d28; }
dialog::backdrop { background:#060a14c9; }
#edit-fields {display:grid; gap:12px; margin:18px 0;}
#edit-fields textarea {background:#111722;color:#ebedf4;border:1px solid #475267;border-radius:4px;font:inherit;padding:8px;resize:vertical;}
.dialog-actions {display:flex;justify-content:flex-end;gap:10px;margin-top:16px}
@media(max-width:800px){.ops-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}
.work-queue { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
.work-queue:empty {display:none;}
.work-queue button { display:flex; align-items:center; gap:10px; color:#dce7fa; background:#1b2330; border:1px solid #374255; padding:7px 12px; }
.work-queue strong {font-size:1.12rem;color:#f7ca7c;font-variant-numeric:tabular-nums}
.stock-filters {grid-template-columns:repeat(auto-fit,minmax(135px,1fr));}
.week-market {max-width:240px;margin:0 0 14px}
#weekly-panel .panel {margin-bottom:16px}
#weekly-panel h3 {margin:0 0 6px}
#weekly-panel .panel > p, .week-row p, #week-context, #week-status {color:var(--muted);font-size:.9rem}
.week-group {color:#99cfff;margin:22px 0 6px}
.week-row {display:grid;grid-template-columns:minmax(150px,1fr) minmax(180px,1.6fr) auto;align-items:center;gap:16px;border-top:1px solid var(--line);padding:13px 0}
.week-row p {margin:4px 0}
.week-row strong {overflow-wrap:anywhere}
#week-fields {display:grid;gap:12px;margin:16px 0}
@media(max-width:700px){.week-row{grid-template-columns:1fr;gap:4px}.week-row button{justify-self:start}}

.family-guide {margin:0 0 16px;max-width:72ch}
.family-guide summary {color:var(--text);width:fit-content}

.family-login {max-width:25rem;margin-bottom:1rem}.family-login button {margin-top:.75rem}
