/* Minimal dashboard styles. Colors are roles (CSS variables) so light/dark swap in one place. */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --link: #1c5cab;
  --up: #006300;
  --down: #d03b3b;
  --warn: #fab219;
  --series-1: #2a78d6;   /* blue   */
  --series-2: #eb6834;   /* orange */
  --series-3: #1baf7a;   /* aqua   */
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781;
    --grid: #2c2c2a; --axis: #383835; --border: rgba(255, 255, 255, 0.10); --link: #86b6ef;
    --up: #0ca30c; --down: #e66767;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781;
  --grid: #2c2c2a; --axis: #383835; --border: rgba(255, 255, 255, 0.10); --link: #86b6ef;
  --up: #0ca30c; --down: #e66767;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font-size: 14px; line-height: 1.4; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

.top {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between;
  padding: 14px 20px; max-width: 1500px; margin: 0 auto;
}
.top h1 { font-size: 18px; margin: 0; font-weight: 600; }
.top-actions { display: flex; gap: 8px; align-items: center; font-size: 12px; }
button {
  font: inherit; font-size: 12px; color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; cursor: pointer;
}
button:hover { color: var(--ink); }

#grid {
  display: grid; gap: 14px; padding: 0 20px 28px; max-width: 1500px; margin: 0 auto;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
}
@media (max-width: 480px) {
  .top, #grid { padding-left: 10px; padding-right: 10px; }
  .card { padding: 12px; }
}
@media (min-width: 820px) { .card.wide { grid-column: span 2; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; min-width: 0; display: flex; flex-direction: column; gap: 8px;
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-head h2 { font-size: 14px; font-weight: 600; margin: 0; }
.card-meta { font-size: 11px; color: var(--muted); white-space: nowrap; }
.card-body { min-width: 0; }
.notice {
  font-size: 12px; color: var(--ink-2); border-left: 3px solid var(--warn); padding: 2px 8px; margin: 0;
}
.notice.err { border-left-color: var(--down); }

/* lists */
.groups { display: grid; gap: 4px 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.group h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin: 4px 0 2px; }
.items { list-style: none; margin: 0; padding: 0; }
.items li { padding: 6px 0; border-top: 1px solid var(--grid); }
.items li:first-child { border-top: 0; }
.items .t { display: block; color: var(--ink); }
.items .t:hover { color: var(--link); }
.items .s { font-size: 11px; color: var(--muted); }
.wide .items.cols { column-count: 2; column-gap: 24px; }
.wide .items.cols li { break-inside: avoid; }
@media (max-width: 819px) { .wide .items.cols { column-count: 1; } }

/* tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 5px 8px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { font-size: 11px; font-weight: 600; color: var(--ink-2); }
td .sub { display: block; font-size: 11px; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tag { font-size: 10px; border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; margin-left: 4px; color: var(--ink-2); }

/* stock */
.quote { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.quote .price { font-size: 28px; font-weight: 600; }
.up { color: var(--up); }
.down { color: var(--down); }

table.quotes td { padding-top: 4px; padding-bottom: 4px; }
.group-row td { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); padding-top: 10px; }
.spark { display: block; margin-left: auto; }
@media (max-width: 480px) { .spark-col { display: none; } }

/* charts */
.chart { position: relative; height: 230px; }
.chart.short { height: 170px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; color: var(--ink-2); }
.legend .sw { display: inline-block; width: 16px; height: 0; border-top: 2px solid; margin-right: 5px; vertical-align: 3px; }
.legend .sw.dash { border-top-style: dashed; }
pre.raw { font-size: 11px; overflow: auto; max-height: 260px; margin: 0; color: var(--ink-2); }
