:root {
  color-scheme: light;
  --page: #f9f9f7; --surface: #fcfcfb; --text: #0b0b0b; --text-2: #52514e; --muted: #6f6d68;
  --grid: #e1e0d9; --axis: #c3c2b7; --border: rgba(11,11,11,.10); --hover: rgba(11,11,11,.05);
  --accent: #256abf; --accent-ink: #fff;
  --swim: #2a78d6; --bike: #eb6834; --run: #1baf7a; --strength: #eda100; --other: #e87ba4; --brick: #6250d6; --rest: #898781;
  --good: #006300; --warning-ink: #8a5a00; --critical: #d03b3b;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --text: #f0efec; --text-2: #c3c2b7; --muted: #a09e96;
    --grid: #2c2c2a; --axis: #383835; --border: rgba(255,255,255,.10); --hover: rgba(255,255,255,.06);
    --accent: #3987e5; --accent-ink: #0b0b0b;
    --swim: #3987e5; --bike: #d95926; --run: #199e70; --strength: #c98500; --other: #d55181; --brick: #9085e9; --rest: #898781;
    --good: #0ca30c; --warning-ink: #fab219; --critical: #e66767;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
h1 { font-size: 20px; margin: 0; font-weight: 650; }
h2 { font-size: 16px; margin: 0; font-weight: 650; }
h3 { font-size: 14px; margin: 0 0 6px; font-weight: 650; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.muted { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.error { color: var(--critical); font-size: 13px; margin: 8px 0 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 11px; cursor: pointer; }
button:hover { background: var(--hover); }
button:disabled { opacity: .55; cursor: default; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--critical); margin-right: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input, select, textarea { width: 100%; background: var(--page); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; }
label { display: block; font-size: 13px; color: var(--text-2); }
label > input, label > select, label > textarea { margin-top: 3px; color: var(--text); font-size: 15px; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.greeting h1 { font-size: 21px; font-weight: 650; letter-spacing: -.01em; }
.greeting .muted { font-size: 13.5px; margin-top: 1px; }
.top-actions { display: flex; gap: 6px; align-items: center; }
.top-actions svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-button { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; border-radius: 50%; background: none; border-color: transparent; color: var(--text-2); }
.icon-button:hover, .sync-pill:hover { background: var(--hover); color: var(--text); }
.sync-pill { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px 0 11px; border-radius: 18px; color: var(--text-2); font-size: 13px; }
.sync-pill:disabled { cursor: progress; opacity: 1; }
.sync-pill:disabled svg { animation: spin 1s linear infinite; }
.sync-pill.problem { border-color: var(--critical); color: var(--critical); }
@media (prefers-reduced-motion: reduce) { .sync-pill:disabled svg { animation: none; } }
@media (max-width: 640px) { .greeting h1 { font-size: 18px; } .sync-pill span { display: none; } .sync-pill { width: 36px; padding: 0; justify-content: center; } }
.actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.actions.end { justify-content: flex-end; margin-top: 12px; }
main { container: page / inline-size; max-width: 1680px; margin: 0 auto; padding: 16px 20px 76px; display: grid; gap: 16px; }
.banner { margin: 12px 20px 0; padding: 9px 13px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--critical); font-size: 14px; }
.banner button { margin-left: 8px; flex: none; }
.banner.info { border-left-color: var(--accent); }
.alert-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.alert-row + .alert-row { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--grid); }
.key-expiry { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: end; margin: 8px 0 12px; }
.key-expiry .muted { grid-column: 1 / -1; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }

.recovery-good { color: var(--good); }
.recovery-medium { color: var(--warning-ink); }
.recovery-low { color: var(--critical); }
.meter { height: 6px; border-radius: 3px; background: var(--grid); margin-top: 7px; overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 3px; }

.columns { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 1000px) { .columns { grid-template-columns: minmax(0, 1fr); } }

/* Reiter: Übersicht, Kalender, Verlauf, Trainings */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs [role="tab"] { border: 0; border-radius: 8px 8px 0 0; background: none; padding: 9px 15px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs [role="tab"]:hover { color: var(--text); background: var(--hover); }
.tabs [role="tab"][aria-selected="true"] { color: var(--text); font-weight: 650; border-bottom-color: var(--accent); }
.panel { display: grid; gap: 16px; min-width: 0; }
.race-chip { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 13px; border: 1px solid var(--border); border-radius: 18px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.race-chip b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .tabs [role="tab"] { padding: 9px 10px; } }
@media (max-width: 640px) { .race-chip { height: 32px; padding: 0 10px; font-size: 12px; } }

.home-top { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@container page (min-width: 900px) { .home-top { grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); } }
.today-card { border-top: 3px solid var(--accent); }
.today-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.today-actions .primary { flex: 1 1 220px; padding: 8px; }

/* Diese Woche */
.week-total { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.week-total .v { font-size: 30px; font-weight: 650; letter-spacing: -.01em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.week-total .muted-inline { font-size: 13.5px; }
.meter.big { height: 8px; border-radius: 4px; margin: 8px 0 12px; }
.meter.big > span { border-radius: 4px; }
.sport-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; }
.sport-name { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.sport-row .bar { height: 10px; border-radius: 3px; background: var(--grid); overflow: hidden; }
.sport-row .bar > i { display: block; height: 100%; border-radius: 3px; background: var(--c); }
.sport-row .val { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.week-open { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

/* Woche im Blick */
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.strip-day { border: 1px solid var(--border); border-radius: 10px; padding: 7px; min-height: 92px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; min-width: 0; background: var(--surface); transition: background .12s; }
.strip-day:hover { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.strip-day.past { background: color-mix(in srgb, var(--page) 55%, var(--surface)); }
.strip-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.strip-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 550; padding: 0 2px 2px; }
.strip-day.today .strip-head { color: var(--accent); font-weight: 650; }
.strip-empty { font-size: 12px; color: var(--muted); padding: 0 2px; }
.week-strip .chip .extra { display: none; }
@container page (max-width: 760px) {
  .week-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .week-strip .chip .ico { display: none; }
}
@container page (max-width: 460px) { .week-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Beschwerde als Hinweis bei "Heute" */
.complaint-hint { margin-top: 10px; border-radius: 10px; background: color-mix(in srgb, var(--warning-ink) 12%, var(--surface)); }
.complaint-hint > summary { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; padding: 9px 12px; cursor: pointer; list-style: none; font-size: 13.5px; color: var(--warning-ink); }
.complaint-hint > summary::-webkit-details-marker { display: none; }
.complaint-hint > summary b { color: var(--text); font-weight: 600; }
.complaint-hint .warn-icon { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 11px; font-weight: 700; flex: none; }
.complaint-hint > summary > span:nth-child(3) { white-space: nowrap; }
.complaint-hint .open-label { margin-left: auto; font-size: 12.5px; text-decoration: underline; text-underline-offset: 2px; }
.complaint-hint[open] .open-label { display: none; }
.complaint-hint > .complaint { padding: 4px 12px 12px; border-top: 0; }
.complaint-hint > .complaint .complaint-head b { display: none; }
.complaint-active { margin: 0 0 8px; font-size: 14px; }

/* Wochenauswertung gekürzt, bis man sie aufklappt */
.analysis.clamped { max-height: 9.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.link { background: none; border: 0; padding: 2px 0; color: var(--accent); font-size: 13.5px; }
.link:hover { background: none; text-decoration: underline; }
.more { width: 100%; margin-top: 10px; }
.today-card .chip { margin-bottom: 5px; padding: 7px 9px; }
.today-empty { margin: 0 0 5px; color: var(--text-2); font-size: 14px; }
.today-next { margin: 7px 0 0; font-size: 13.5px; }
.muted-inline { color: var(--muted); }
.today-recovery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; padding-top: 11px; border-top: 1px solid var(--grid); }
.today-recovery.with-ring { grid-template-columns: auto repeat(3, minmax(0, 1fr)); align-items: center; }
.recovery-ring { display: grid; justify-items: center; gap: 2px; }
.recovery-ring svg { width: 62px; height: 62px; }
.recovery-ring .k { font-size: 11.5px; color: var(--muted); }
.ring-track { fill: none; stroke: var(--grid); stroke-width: 6; }
.ring-value { fill: none; stroke-width: 6; stroke-linecap: round; }
.ring-text { fill: var(--text); font-size: 15px; font-weight: 650; }
.ring-none { fill: var(--muted); font-size: 16px; }
@media (max-width: 460px) {
  .today-recovery.with-ring { gap: 8px; }
  .today-recovery.with-ring .today-stat .v { font-size: 15px; }
  .recovery-ring svg { width: 52px; height: 52px; }
}
.whoop-steps { padding-left: 20px; margin: 6px 0 10px; }
.whoop-steps li { margin: 3px 0; }
.whoop-steps code { user-select: all; word-break: break-all; }
.today-stat .k { font-size: 12px; color: var(--muted); }
.today-stat .v { font-size: 17px; font-weight: 600; white-space: nowrap; }
.today-stat .v.none { font-size: 13px; font-weight: 400; color: var(--muted); line-height: 25px; }
.today-stat .note { font-size: 11.5px; color: var(--muted); }

.knowledge-head { margin: 16px 0 6px; padding-top: 12px; border-top: 1px solid var(--grid); }
.knowledge-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--grid); font-size: 14px; }
.knowledge-row .t1 { flex: 1; min-width: 0; }
.knowledge-row .muted { margin: 0; flex: none; }
.file-button { margin: 10px 0 12px; font-size: 13px; }
.file-button input { margin-top: 4px; }
.chip[draggable="true"] { cursor: grab; }
.chip.dragging { opacity: .45; }
.day.drop-target { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent); }
.month-title { font-size: 19px; }
.calendar-card { container-type: inline-size; }
/* Ist der Kalender schmal, etwa neben dem Trainer, bekommt der Text den Platz von Symbol und Häkchen. */
@container (max-width: 980px) {
  .chip .ico, .chip.done .i, .chip .extra { display: none; }
}
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) 104px; gap: 1px; background: var(--grid); border: 1px solid var(--grid); border-radius: 12px; overflow: hidden; }
.dow { background: var(--surface); text-align: left; padding: 8px 10px; font-size: 12px; font-weight: 550; letter-spacing: .02em; color: var(--muted); }
.dow.week-head { text-align: right; }
.day { background: var(--surface); min-height: 112px; padding: 6px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; min-width: 0; transition: background .12s; }
.day.weekend { background: color-mix(in srgb, var(--page) 55%, var(--surface)); }
.day:hover { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.day.other { background: var(--page); }
.day.other .num { color: var(--muted); opacity: .65; }
.day.past .num { color: var(--muted); }
.day.today { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); box-shadow: inset 0 0 0 2px var(--accent); }
.day-top { display: flex; justify-content: space-between; align-items: center; min-height: 22px; }
.num { font-size: 13px; font-weight: 550; padding: 0 4px; border-radius: 11px; line-height: 22px; min-width: 22px; text-align: center; }
.day.today .num { background: var(--accent); color: var(--accent-ink); font-weight: 650; opacity: 1; }
.add { border: 0; background: none; padding: 0 6px; line-height: 20px; color: var(--muted); font-size: 16px; opacity: 0; transition: opacity .12s; }
.day:hover .add, .add:focus-visible { opacity: 1; }
.ico { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--c, var(--rest)); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.chip { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; padding: 4px 6px; border: 1px solid transparent; border-radius: 7px; background: color-mix(in srgb, var(--c, var(--rest)) 15%, var(--surface)); font-size: 12px; line-height: 16px; min-width: 0; transition: background .12s; }
.chip:hover { background: color-mix(in srgb, var(--c, var(--rest)) 26%, var(--surface)); }
.chip-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.t1, .t2 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chip .t1 { font-weight: 550; }
.chip .t2 { font-size: 11px; color: var(--text-2); }
.chip .i { flex: none; font-weight: 700; font-size: 11px; color: var(--text-2); }
.chip.done .i { color: var(--good); }
.chip.planned { background: transparent; border: 1px dashed color-mix(in srgb, var(--c, var(--rest)) 65%, transparent); }
.chip.planned:hover { background: color-mix(in srgb, var(--c, var(--rest)) 10%, var(--surface)); }
.chip.missed { border-color: var(--axis); }
.chip.missed .t1, .chip.missed .t2 { color: var(--muted); text-decoration: line-through; }
.chip.missed .ico { stroke: var(--muted); }
.chip.missed .i { color: var(--critical); }
.chip.rest { border-color: transparent; color: var(--muted); }
.chip.rest .t1 { font-weight: 400; }
.week-sum { background: var(--page); padding: 8px 10px; text-align: right; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.week-sum .kw { font-size: 11px; color: var(--muted); font-weight: 550; }
.week-sum .sum { font-size: 16px; font-weight: 650; }
.week-sum .of { font-size: 11px; color: var(--muted); line-height: 14px; }
.share { display: flex; gap: 2px; height: 6px; margin-top: 5px; }
.share span { min-width: 3px; border-radius: 2px; background: var(--c); }
.dots { display: none; }
.dot-mini { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--rest)); }
.dot-mini.open, .dot-mini.partial, .dot-mini.rest { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c, var(--rest)); }
.dot-mini.missed { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
.sport-swim { --c: var(--swim); } .sport-bike { --c: var(--bike); } .sport-run { --c: var(--run); }
.sport-strength { --c: var(--strength); } .sport-other { --c: var(--other); } .sport-brick { --c: var(--brick); } .sport-rest { --c: var(--rest); }
.legend { display: flex; flex-wrap: wrap; gap: 5px 14px; font-size: 12.5px; color: var(--text-2); margin-top: 11px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-sep { margin-left: auto; }
.swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--rest)); display: inline-block; flex: none; }
@media (max-width: 760px) {
  .calendar { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .week-sum, .week-head { display: none; }
  .day { min-height: 60px; padding: 4px 2px; align-items: center; }
  .day-top { justify-content: center; }
  .add, .day .chip { display: none; }
  .dow { text-align: center; padding: 6px 0; }
  .dots { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
  .legend-sep { margin-left: 0; }
}
@media (max-width: 640px) {
  main { padding: 12px 10px 76px; }
  .topbar { padding: 12px 12px; }
  .card { padding: 11px 10px; }
}

.recent-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 2px 9px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--grid); border-radius: 0; padding: 8px 2px; align-items: center; }
.recent-row:last-child { border-bottom: 0; }
.recent-row .name { font-weight: 550; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.recent-row .meta { grid-column: 2; font-size: 12.5px; color: var(--muted); }
.recent-row .state { grid-row: 1 / span 2; grid-column: 3; font-size: 12px; color: var(--text-2); }
.empty { color: var(--muted); font-size: 14px; padding: 14px 2px; }

dialog { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; width: min(620px, calc(100vw - 20px)); max-height: calc(100dvh - 20px); box-shadow: 0 12px 40px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(0,0,0,.45); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.close { border: 0; background: none; font-size: 21px; line-height: 1; padding: 2px 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.form-grid .wide { grid-column: 1 / -1; }
#plan-form, #key-form { border-top: 1px solid var(--grid); margin-top: 14px; padding-top: 12px; }
.entry { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; margin-bottom: 5px; border-left: 3px solid var(--c, var(--rest)); }
.entry .state { margin-left: auto; font-size: 12px; color: var(--text-2); white-space: nowrap; }

.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin: 12px 0; }
.metric .k { font-size: 12px; color: var(--muted); }
.metric .v { font-size: 17px; font-weight: 600; }
.plan-box { background: var(--page); border-radius: 8px; padding: 8px 11px; font-size: 14px; margin-bottom: 14px; }
.analysis { font-size: 14.5px; max-width: 75ch; }
.analysis p { margin: 0 0 6px; }
.analysis ul { margin: 0 0 8px; padding-left: 20px; }
.analysis .status { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.analysis .when { font-size: 12px; color: var(--muted); margin: 8px 0 14px; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--grid); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { padding: 4px 8px; text-align: right; border-bottom: 1px solid var(--grid); }
th:first-child, td:first-child { text-align: left; }
th { font-weight: 550; color: var(--text-2); }
.table-wrap { overflow-x: auto; margin-top: 12px; }
.table-view { margin-top: 10px; font-size: 13px; color: var(--text-2); }
.table-view summary { cursor: pointer; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.segmented button { border: 0; border-radius: 0; background: none; padding: 4px 10px; font-size: 13px; color: var(--text-2); }
.segmented button + button { border-left: 1px solid var(--border); }
.segmented button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.weekly-hero { margin-bottom: 6px; }
.weekly-hero .k { font-size: 13px; color: var(--text-2); }
.weekly-hero .value { font-size: 30px; font-weight: 650; line-height: 1.2; }
.weekly-hero .note { font-size: 13px; color: var(--muted); }
#chart-weekly { height: 220px; touch-action: pan-y; }
.weekly-area { stroke: none; fill-opacity: .13; }
.weekly-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.weekly-dot { stroke: var(--surface); stroke-width: 2; }
.note-field { margin-bottom: 2px; }
#note-state { margin-bottom: 14px; }
#day-add-activity { width: 100%; margin-top: 4px; }
.chart { width: 100%; height: 240px; position: relative; }
.chart.small { height: 130px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.grid-line { stroke: var(--grid); stroke-width: 1; }
.base-line { stroke: var(--axis); stroke-width: 1; }
.series-line { fill: none; stroke: var(--swim); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cross { stroke: var(--axis); stroke-width: 1; }
.dot { fill: var(--swim); stroke: var(--surface); stroke-width: 2; }
.hit { fill: transparent; }
.small-multiples { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tooltip { position: fixed; z-index: 50; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 22px rgba(0,0,0,.2); padding: 6px 10px; font-size: 12.5px; max-width: 220px; }
.tooltip b { display: block; margin-bottom: 2px; }
.tooltip div { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.tooltip .s { display: inline-flex; gap: 5px; align-items: center; color: var(--text-2); }

.login-page { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: min(340px, 100%); padding: 22px; }
.login-card h1 { margin-bottom: 16px; font-size: 18px; }
.login-card button { width: 100%; margin-top: 14px; padding: 9px; }
.login-card label { display: block; margin-top: 10px; }
.login-card input { width: 100%; }
.login-card p { margin: 0 0 6px; line-height: 1.45; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.trainer-fab { position: fixed; right: 20px; bottom: 20px; z-index: 30; padding: 11px 18px; border-radius: 24px; font-weight: 600; box-shadow: 0 6px 22px rgba(0,0,0,.28); }
.trainer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(460px, 100vw); display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); box-shadow: -10px 0 34px rgba(0,0,0,.16); animation: slide-in .16s ease-out; }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .trainer { animation: none; } }
@media (min-width: 1180px) { body.trainer-open { padding-right: 460px; } }
.trainer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 13px 14px; border-bottom: 1px solid var(--border); }
.trainer-head .actions { flex-wrap: nowrap; flex: none; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.bubble { font-size: 14.5px; max-width: 100%; overflow-wrap: anywhere; }
.bubble.user { align-self: flex-end; max-width: 85%; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 14px 14px 3px 14px; white-space: pre-wrap; }
.chat-empty { color: var(--text-2); font-size: 14.5px; display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.chat-empty p { margin: 0 0 6px; }
.suggestion { text-align: left; border-radius: 16px; }
.chat-error { padding: 0 14px; margin: 0 0 6px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 11px 14px calc(11px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.chat-form textarea { flex: 1; resize: none; max-height: 140px; }
.proposal { margin-top: 10px; border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; background: var(--page); }
.proposal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 7px; }
.proposal .muted { margin: 0; }
.proposal-row { display: grid; grid-template-columns: 74px 15px minmax(0, 1fr); gap: 8px; padding: 6px 0; border-top: 1px solid var(--grid); align-items: start; font-size: 13.5px; }
.proposal-row .when { color: var(--text-2); font-size: 12.5px; font-variant-numeric: tabular-nums; line-height: 19px; }
.proposal-row .ico { margin-top: 2px; }
.proposal-row .what { display: flex; flex-direction: column; min-width: 0; }
.proposal-row .t1 { font-weight: 550; white-space: normal; }
.proposal-row .t2 { font-size: 12.5px; color: var(--text-2); white-space: normal; }
.proposal-state { margin: 8px 0 0; font-size: 13.5px; font-weight: 550; }
.proposal .actions.end { margin-top: 9px; }

.complaint { padding: 11px 0; border-top: 1px solid var(--grid); }
.complaint:first-child { border-top: 0; padding-top: 0; }
.complaint-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.small { font-size: 12.5px; }
.complaint-entry textarea { resize: vertical; }
.entry-controls { display: flex; gap: 8px; margin-top: 6px; align-items: center; }
.entry-controls select { flex: 1; min-width: 0; font-size: 13.5px; padding: 5px 7px; }
.entry-list { list-style: none; margin: 10px 0 0; padding: 0; max-height: 210px; overflow-y: auto; }
.entry-row { padding: 6px 0; border-top: 1px solid var(--grid); font-size: 13.5px; }
.entry-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.entry-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.entry-remove { border: 0; background: none; padding: 0 5px; color: var(--muted); font-size: 15px; line-height: 16px; }
.cause-label { margin-top: 10px; }
.cause-state { font-size: 11.5px; margin-left: 4px; }
.resolve { width: 100%; margin-top: 9px; }
.complaints-empty { padding: 4px 0; }
.past-list { margin-top: 8px; font-size: 13.5px; }
.past-list > summary { cursor: pointer; color: var(--text-2); padding: 3px 0; }
.complaint.past { padding: 8px 0; }
.complaint.past > summary { cursor: pointer; }
.complaint.past p { margin: 6px 0 0; }
.complaint.past .actions { margin-top: 8px; }

.backup-state { margin-top: 10px; }
.settings-block { border-top: 1px solid var(--grid); margin-top: 14px; padding-top: 12px; }


.chip.planned.calendar { background: color-mix(in srgb, var(--c, var(--rest)) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c, var(--rest)) 22%, transparent); }
.dot-mini.calendar { background: color-mix(in srgb, var(--c, var(--rest)) 45%, transparent); }
.entry.google { padding: 7px 11px; border: 1px solid var(--border); border-left: 3px solid var(--c, var(--rest)); border-radius: 8px; justify-content: space-between; }
.google-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; margin-left: 10px; }
.google-side .state { margin-left: 0; }
