.viz-root {
  color-scheme: light;
  --surface-0: #f6f6f4;
  --surface-1: #ffffff;
  --border: #e3e3df;
  --grid: #ececec;
  --text-primary: #191919;
  --text-secondary: #666666;
  --series-1: #257de0;
  --series-2: #f47230;
  --pos: #257de0;
  --neg: #ec4647;
  --neutral: #efefef;
  --accent: #1b64be;
}
@media (prefers-color-scheme: dark) {
  .viz-root {
    color-scheme: dark;
    --surface-0: #111111;
    --surface-1: #191919;
    --border: #2c2c2c;
    --grid: #2a2a2a;
    --text-primary: #efefef;
    --text-secondary: #9c9c9c;
    --series-1: #338ced;
    --series-2: #e76624;
    --pos: #338ced;
    --neg: #eb6263;
    --neutral: #383838;
    --accent: #519ced;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.viz-root {
  min-height: 100vh; background: var(--surface-0); color: var(--text-primary);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
  padding: 14px 24px; background: var(--surface-1); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.top h1 { font-size: 18px; margin: 0; flex: 1; }
#logout { order: 2; }
nav { order: 3; flex-basis: 100%; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav button {
  background: none; border: 0; padding: 8px 12px; border-radius: 8px; cursor: pointer;
  color: var(--text-secondary); font: inherit;
}
nav button.active { background: var(--neutral); color: var(--text-primary); font-weight: 600; }
main { max-width: 1100px; margin: 0 auto; padding: 20px; }
.card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px; margin-bottom: 18px;
}
.card h2 { font-size: 16px; margin: 0 0 6px; }
.narrow { max-width: 380px; margin: 60px auto; }
.hint { color: var(--text-secondary); font-size: 13.5px; margin: 0 0 12px; }
.error { color: var(--neg); min-height: 1.2em; }
form label, .filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-secondary); }
form label { margin-bottom: 12px; }
input, select {
  font: inherit; color: var(--text-primary); background: var(--surface-1);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px;
}
button, .button {
  font: inherit; background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 8px 14px; cursor: pointer; text-decoration: none; display: inline-block;
}
button.link, a.link { background: none; color: var(--text-secondary); padding: 4px; font-size: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 8px 0 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.tile .label { color: var(--text-secondary); font-size: 13px; }
.tile .value { font-size: 28px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tile .sub { color: var(--text-secondary); font-size: 12.5px; }
.chart { width: 100%; overflow: hidden; }
.chart svg { display: block; width: 100%; height: auto; }
.chart text { fill: var(--text-secondary); font-size: 15px; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-secondary); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--text-secondary); font-size: 12.5px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
td { padding: 7px 8px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar { position: relative; height: 14px; min-width: 160px; }
.bar .mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--text-secondary); opacity: .5; }
.bar .fill { position: absolute; top: 0; height: 14px; }
.bar .fill.pos { left: 50%; background: var(--pos); border-radius: 0 4px 4px 0; }
.bar .fill.neg { right: 50%; background: var(--neg); border-radius: 4px 0 0 4px; }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 10px; background: var(--neutral); color: var(--text-secondary); margin-left: 4px; }
.plan { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.day { border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.day h3 { margin: 0 0 8px; font-size: 14px; }
.day .role { font-size: 11.5px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .03em; margin-top: 6px; }
.day .exp { margin-top: 10px; font-size: 12.5px; color: var(--text-secondary); }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.steps li { margin-bottom: 10px; }
.drop {
  display: flex; align-items: center; justify-content: center; min-height: 110px; cursor: pointer;
  border: 2px dashed var(--border); border-radius: 12px; color: var(--text-secondary); text-align: center; padding: 12px;
}
.drop.over { border-color: var(--accent); color: var(--text-primary); }
.tooltip {
  position: fixed; pointer-events: none; z-index: 20; max-width: 320px;
  background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; font-size: 12.5px; box-shadow: 0 4px 14px rgba(0,0,0,.15);
}
.tooltip b { font-variant-numeric: tabular-nums; }
.tooltip .muted { color: var(--text-secondary); }
.empty { color: var(--text-secondary); padding: 20px 0; }
