/* Basecamp · Erholung: Schiefer-Nacht, Wegweiser-Typo, Alpenglühen für die Erholung, Violett für den Schlaf */
@font-face{font-family:"Barlow SC";src:url(/fonts/bsc-500.woff2) format("woff2");font-weight:500;font-display:swap}
@font-face{font-family:"Barlow SC";src:url(/fonts/bsc-600.woff2) format("woff2");font-weight:600;font-display:swap}
@font-face{font-family:"Barlow SC";src:url(/fonts/bsc-700.woff2) format("woff2");font-weight:700;font-display:swap}

:root{
  color-scheme:light;
  --bg:#eef2f3; --surface:#fbfcfc; --surface-2:#e6ebed; --line:#d9e0e3; --grid:#e3e8ea;
  --text:#12202a; --text-2:#44545e; --text-3:#66757e;
  --s1:#2a78d6; --s2:#eb6834; --s3:#1baf7a; --s4:#eda100; --s5:#e87ba4; --s7:#6250d6; --s8:#e34948;
  --s5-ink:#b8336f; /* Form-Farbe als große Ziffer: dunklere Stufe für Kontrast auf Hell */
  --good:#0ca30c; --warn:#fab219; --serious:#ec835a; --critical:#d03b3b;
  --display:"Barlow SC","DIN Alternate","Arial Narrow",system-ui,sans-serif;
  --r-panel:18px; --r-ctl:12px;
}
@media (prefers-color-scheme:dark){
  :root{
    color-scheme:dark;
    --bg:#0e1418; --surface:#141c21; --surface-2:#1d272e; --line:#253139; --grid:#1f2a31;
    --text:#eef2f3; --text-2:#b9c4c9; --text-3:#8796a0;
    --s1:#3987e5; --s2:#d95926; --s3:#199e70; --s4:#c98500; --s5:#d55181; --s7:#9085e9; --s8:#e66767; --s5-ink:#e0709a;
  }
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--text);
  font:16px/1.5 -apple-system,"SF Pro Text",system-ui,"Segoe UI",Roboto,sans-serif;font-variant-numeric:tabular-nums;
  padding:max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(40px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}
.wrap{max-width:1080px;margin:0 auto}
button,input{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--s1);outline-offset:2px;border-radius:6px}
.num{font-family:var(--display);font-variant-numeric:tabular-nums;letter-spacing:-.01em}

/* Kopf */
.top{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:28px}
.place{font-family:var(--display);font-weight:600;font-size:15px;color:var(--text-3);margin:0}
.date{font-family:var(--display);font-weight:600;font-size:26px;line-height:1.1;margin:2px 0 0}
.sync{display:flex;flex-direction:column;align-items:flex-end;gap:6px;font-size:13px;color:var(--text-3);text-align:right}
.btn{background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:7px 15px;cursor:pointer;font-size:14px;min-height:38px;white-space:nowrap}
.btn:hover{border-color:var(--text-3)}
.btn:disabled{opacity:.6;cursor:default}
.btn.primary{background:var(--text);color:var(--bg);border-color:var(--text);font-weight:600}
.syncerr{color:var(--text);max-width:280px}
.syncerr b{color:var(--warn)}

/* Hero: Lagebericht */
.hero{display:grid;gap:28px;margin-bottom:32px}
@media(min-width:820px){.hero{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:48px;align-items:start}}
.verdict{font-family:var(--display);font-weight:700;font-size:clamp(30px,7.4vw,46px);line-height:1.02;letter-spacing:-.01em;margin:0 0 16px;max-width:16ch;text-wrap:balance}
.verdict span{display:block;font-weight:500;color:var(--text-2)}
.readout{display:flex;align-items:flex-end;gap:18px;flex-wrap:wrap}
.score{font-family:var(--display);font-weight:700;font-size:clamp(88px,26vw,148px);line-height:.78;letter-spacing:-.03em;color:var(--s5-ink)}
.score-meta{padding-bottom:6px;font-size:14px;color:var(--text-2);line-height:1.4}
.score-meta b{display:block;font-family:var(--display);font-size:20px;font-weight:600;color:var(--text)}
.zones{display:grid;grid-template-columns:repeat(5,1fr);gap:3px;position:relative;margin-top:22px;padding-top:12px}
.zones i{display:block;height:8px;background:var(--surface-2);border-radius:2px}
.zones i:first-child{border-radius:5px 2px 2px 5px}.zones i:last-child{border-radius:2px 5px 5px 2px}
.zones i.on{background:var(--s5)}
.zones .mk{position:absolute;top:0;width:2px;height:22px;background:var(--text);border-radius:1px;transform:translateX(-1px)}
.zl{display:grid;grid-template-columns:repeat(5,1fr);gap:3px;font-size:12px;color:var(--text-3);margin-top:6px}
.zl span.on{color:var(--text);font-weight:600}
.gfb{font-size:14px;color:var(--text-3);margin:14px 0 0}

.facs h2,.panel h2,.sec h2{font-family:var(--display);font-weight:600;font-size:21px;line-height:1.2;margin:0}
.facs h2{margin-bottom:4px}
.facs p{margin:0 0 12px;font-size:14px;color:var(--text-2)}
.fac{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;padding:9px 0;border-top:1px solid var(--line)}
.fac:first-of-type{border-top:0}
.fac .n{font-size:15px}
.fac .v{text-align:right;font-size:14px;color:var(--text-2);white-space:nowrap}
.fac .v .num{font-size:17px;color:var(--text);font-weight:600}
.fac .bar{grid-column:1/-1;height:6px;background:var(--surface-2);border-radius:3px;overflow:hidden}
.fac .bar i{display:block;height:100%;border-radius:3px}
.st{display:inline-flex;align-items:center;gap:4px}
.st::before{content:"";width:8px;height:8px;border-radius:50%;background:currentColor;flex:none}
.st-good{--c:var(--good)}.st-warn{--c:var(--warn)}.st-serious{--c:var(--serious)}
.st-good::before{background:var(--good)}.st-warn::before{background:var(--warn)}.st-serious::before{background:var(--serious)}

/* Panels Nacht / Tag */
.duo{display:grid;gap:12px;margin-bottom:12px}
@media(min-width:820px){.duo{grid-template-columns:1.25fr 1fr}}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-panel);padding:18px 18px 8px;min-width:0}
.panel-h{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin-bottom:6px}
.panel-h small{font-size:13px;color:var(--text-3)}
.m{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:2px 16px;padding:12px 0;border-top:1px solid var(--line)}
.m:first-of-type{border-top:0}
.m .k{font-size:15px}
.m .c{font-size:13px;color:var(--text-2);grid-column:1}
.m .v{grid-row:1/3;grid-column:2;text-align:right;font-family:var(--display);font-weight:600;font-size:38px;line-height:1}
.m .v small{font-size:15px;font-weight:500;color:var(--text-3);margin-left:3px}
.m .extra{grid-column:1/-1;margin-top:8px}
.stages{display:flex;gap:2px;height:12px}
.stages i{display:block;border-radius:2px;background:var(--s7);min-width:2px}
.stage-l{display:flex;gap:12px;flex-wrap:wrap;font-size:12px;color:var(--text-2);margin-top:6px}
.stage-l span{display:inline-flex;align-items:center;gap:5px}
.stage-l i{width:10px;height:10px;border-radius:2px;background:var(--s7);display:inline-block}
.track{position:relative;height:12px;background:var(--surface-2);border-radius:6px}
.track i{position:absolute;top:0;bottom:0;background:var(--s3);border-radius:6px}
.track-l{display:flex;justify-content:space-between;font-size:12px;color:var(--text-3);margin-top:4px}

.notes{list-style:none;margin:0 0 32px;padding:0;display:grid;gap:6px}
.notes li{display:grid;grid-template-columns:18px 1fr;gap:8px;font-size:15px;color:var(--text);padding:2px 0}
.notes .ic{font-size:12px;line-height:1.9;text-align:center}
.notes .good .ic{color:var(--good)}.notes .warn .ic{color:var(--warn)}.notes .info .ic{color:var(--text-3)}

/* Claude-Analyse */
.ai{margin-bottom:32px;padding:20px}
.ai .panel-h{margin-bottom:14px;flex-wrap:wrap}
.ai-actions{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.ask{display:flex;gap:8px;margin-bottom:8px}
.ask input{flex:1;min-width:0;font-size:16px;padding:10px 14px;border-radius:var(--r-ctl);border:1px solid var(--line);background:var(--bg)}
.chips{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:16px}
@media(max-width:600px){.chips{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin-right:-20px;padding-right:20px}.chips::-webkit-scrollbar{display:none}.chip{white-space:nowrap;flex:none}}
.chip{text-align:left;background:none;border:1px dashed var(--line);border-radius:999px;padding:5px 11px;font-size:13px;color:var(--text-2);cursor:pointer}
.chip:hover{border-color:var(--text-3);color:var(--text)}
.answer{border-top:1px solid var(--line);padding-top:16px}
.answer .meta{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:13px;color:var(--text-3);margin-bottom:8px}
.answer .q{font-family:var(--display);font-weight:600;font-size:19px;margin:0 0 8px}
.md{font-size:15.5px;line-height:1.6;max-width:72ch}
.md p{margin:0 0 10px}.md ul{margin:0 0 10px;padding-left:20px}.md li{margin:3px 0}
.md b{font-weight:650}
.answer .foot{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:10px 0 4px;font-size:13px;color:var(--text-3)}
.working{display:flex;align-items:center;gap:12px;color:var(--text-2);font-size:15px;padding:6px 0 10px}
.working i{width:56px;height:4px;border-radius:2px;background:linear-gradient(90deg,var(--surface-2),var(--s5),var(--surface-2));background-size:200% 100%;animation:scan 1.4s linear infinite}
@keyframes scan{to{background-position:-200% 0}}
.err{color:var(--text)}.err b{color:var(--serious)}
.hist{margin-top:10px}.hist summary{cursor:pointer;color:var(--text-2);font-size:14px;padding:6px 0}
.hist button{display:block;width:100%;text-align:left;background:none;border:0;border-top:1px solid var(--line);padding:8px 0;font-size:14px;cursor:pointer;color:var(--text-2)}
.hist button span{color:var(--text-3);margin-right:8px}

/* Verlauf: synchronisierte Zeilen */
.sec{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 12px}
.seg{display:inline-flex;background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:2px}
.seg button{background:none;border:0;padding:5px 12px;border-radius:999px;cursor:pointer;font-size:13px;color:var(--text-2);min-height:32px}
.seg button[aria-pressed=true]{background:var(--surface-2);color:var(--text);font-weight:600}
.trend{padding:14px 14px 10px;margin-bottom:12px}
.trend-day{font-family:var(--display);font-weight:600;font-size:18px;margin:0 0 4px;min-height:24px}
.trend-hint{font-size:12px;color:var(--text-3);margin:0 0 6px}
.row{position:relative;padding-top:8px;border-top:1px solid var(--line);margin-top:6px}
.row:first-of-type{border-top:0;margin-top:0}
.row-h{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-size:14px}
.row-h .nm{display:inline-flex;align-items:center;gap:7px;font-weight:600}
.row-h .nm::before{content:"";width:10px;height:10px;border-radius:3px;background:var(--c)}
.row-h .rv{color:var(--text-2);text-align:right}
.row-h .rv b{font-family:var(--display);font-size:19px;font-weight:600;color:var(--text);margin-right:2px}
.row svg{display:block;width:100%;overflow:visible;touch-action:pan-y;cursor:crosshair}
.row text,.week text{fill:var(--text-3);font-size:10.5px;font-family:inherit}
.legend{display:flex;gap:14px;flex-wrap:wrap;font-size:12px;color:var(--text-2);margin-top:10px}
.legend span{display:inline-flex;align-items:center;gap:6px}
.legend svg{width:18px;height:10px}

.grid2{display:grid;gap:12px;margin-bottom:12px;align-items:start}
@media(min-width:820px){.grid2{grid-template-columns:1fr 1fr}}
.week{position:relative}
.week svg{display:block;width:100%}
.wtip{font-size:13px;color:var(--text-2);min-height:20px;margin:2px 0 4px}
.acts{list-style:none;margin:0;padding:0}
.acts li{display:grid;grid-template-columns:1fr auto;gap:0 12px;padding:10px 0;border-top:1px solid var(--line);font-size:14px}
.acts li:first-child{border-top:0}
.acts .t{font-weight:600}.acts .r{color:var(--text-2);text-align:right}.acts .d{color:var(--text-3);font-size:13px}
details.tbl{margin-top:4px}details.tbl summary{cursor:pointer;color:var(--text-2);font-size:14px;padding:8px 0}
table{border-collapse:collapse;width:100%;font-size:13px;margin-top:6px}
th,td{text-align:right;padding:6px 8px;border-top:1px solid var(--line);white-space:nowrap}th:first-child,td:first-child{text-align:left}th{color:var(--text-2);font-weight:600}
.tw{overflow-x:auto}
footer{font-size:12px;color:var(--text-3);margin-top:24px;display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
footer button{background:none;border:0;color:var(--text-3);text-decoration:underline;cursor:pointer;font-size:12px;padding:0}
.empty{padding:56px 0;text-align:center;color:var(--text-2)}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* ---- Erholung ---- */
.zones.z4,.zl.z4{grid-template-columns:repeat(4,1fr)}
.now{display:flex;gap:6px 18px;flex-wrap:wrap;margin-top:16px;font-size:14px;color:var(--text-2)}
.now b{font-size:22px;color:var(--text);font-weight:600;margin-right:4px}
.fac .n small{color:var(--text-3);font-size:13px;margin-left:4px}
.fac .note{grid-column:1/-1;font-size:13px;color:var(--text-2);margin-top:-1px}
.small{font-size:13px;color:var(--text-2);line-height:1.45;margin:8px 0}
.small.lead{margin:0 0 12px}
.muted{color:var(--text-3)}
.link{background:none;border:0;padding:0;color:var(--s1);text-decoration:underline;cursor:pointer;font-size:inherit}
.st-none::before{display:none}

/* Schlafkonto */
.konto{margin-bottom:12px;padding:18px 18px 12px}
.debt{display:grid;gap:18px}
@media(min-width:820px){.debt{grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:36px}}
.debt-n{display:flex;align-items:baseline;gap:8px;margin-top:4px}
.debt-n .big{font-size:clamp(56px,16vw,76px);font-weight:700;line-height:.9;color:var(--text)}
.debt-n .u{font-family:var(--display);font-size:20px;font-weight:600;color:var(--text-2)}
.debt-l{margin:6px 0 14px;font-size:14px;color:var(--text-2)}
.batt{display:flex;align-items:center;gap:3px}
.batt .cells{flex:1;display:grid;grid-template-columns:repeat(10,1fr);gap:3px;padding:4px;border:2px solid var(--text-3);border-radius:10px}
.batt .cells i{display:block;height:26px;background:var(--surface-2);border-radius:3px;overflow:hidden}
.batt .cells b{display:block;height:100%;background:var(--s7)}
.batt .cap{width:5px;height:14px;background:var(--text-3);border-radius:0 3px 3px 0}
.batt-l{display:flex;justify-content:space-between;font-size:12px;color:var(--text-3);margin:4px 8px 0 0}
.needf{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:14px}
.needf input{width:90px;font-size:16px;padding:6px 10px;border-radius:var(--r-ctl);border:1px solid var(--line);background:var(--bg)}
.plan{background:var(--bg);border-radius:14px;padding:14px 16px 6px;align-self:start}
.plan .k{margin:0;font-size:13px;color:var(--text-3);font-weight:600;text-transform:uppercase;letter-spacing:.04em}
.plan .bed{margin:2px 0 8px;font-family:var(--display);font-size:20px;font-weight:600;color:var(--text-2)}
.plan .bed .num{font-size:44px;font-weight:700;color:var(--text);margin-right:4px}
.calc{list-style:none;margin:0;padding:0;font-size:14px}
.calc li{display:flex;justify-content:space-between;gap:12px;padding:5px 0;border-top:1px solid var(--line)}
.calc li:first-child{border-top:0}.calc b{font-weight:600;white-space:nowrap}
.deltas svg,.rhythm svg{display:block;width:100%;touch-action:pan-y}
.deltas text,.rhythm text{fill:var(--text-3);font-size:10.5px;font-family:inherit}
.konto .wtip{margin-top:14px}
.sw{display:inline-block;width:12px;height:12px;border-radius:3px}

/* Letzte Nacht */
.night{margin-bottom:16px;padding:18px}
.night-top{display:grid;gap:12px;margin:6px 0 12px}
@media(min-width:560px){.night-top{grid-template-columns:auto minmax(0,1fr);gap:18px;align-items:center}}
.ns{display:flex;align-items:flex-end;gap:8px;font-size:13px;color:var(--text-2);line-height:1.3}
.ns .num{font-size:58px;font-weight:700;line-height:.85;color:var(--text)}
.nstage .fb{margin:0 0 6px;font-size:14px;color:var(--text)}
.flag{font-size:14px;margin:0 0 10px}
.tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;background:var(--line);border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
@media(min-width:620px){.tiles{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(min-width:960px){.tiles{grid-template-columns:repeat(5,minmax(0,1fr))}}
.tile{background:var(--surface);padding:12px 12px 12px 0;display:flex;flex-direction:column;gap:2px;min-width:0}
.tiles .tile:nth-child(2n){padding-left:12px}
@media(min-width:620px){.tiles .tile{padding-left:12px}}
.tile .k{font-size:13px;color:var(--text-2)}
.tile .v{font-family:var(--display);font-weight:600;font-size:32px;line-height:1.05}
.tile .v small{font-size:14px;font-weight:500;color:var(--text-3);margin-left:3px}
.tile .st{font-size:13px}
.tile .c{font-size:12px;color:var(--text-3)}

/* Einflussfaktoren */
.grid2.wide{margin-bottom:32px}
@media(min-width:820px){.grid2.wide{grid-template-columns:1.35fr 1fr}}
.facp,.logp{padding:18px}
.seg.outs{display:flex;flex-wrap:wrap;border-radius:14px;margin-bottom:4px}
@media(max-width:600px){.seg.outs{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;border-radius:999px}.seg.outs::-webkit-scrollbar{display:none}.seg.outs button{white-space:nowrap;flex:none}}
.frs{list-style:none;margin:6px 0 4px;padding:0}
.fr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;padding:10px 0;border-top:1px solid var(--line)}
.fr:first-child{border-top:0}
.fn{font-size:15px}
.fv{font-size:13px;color:var(--text-2);text-align:right;white-space:nowrap}
.fv b{font-family:var(--display);font-size:18px;color:var(--text);font-weight:600}
.fb2{grid-column:1/-1;position:relative;height:10px;background:var(--surface-2);border-radius:5px}
.fb2::after{content:"";position:absolute;left:50%;top:-3px;bottom:-3px;width:2px;margin-left:-1px;background:var(--text-3);border-radius:1px}
.fb2 i{position:absolute;top:0;bottom:0;border-radius:5px}
.fb2 i.b{background:var(--s1)}.fb2 i.w{background:var(--s8)}
.fm{grid-column:1/-1;font-size:12px;color:var(--text-3)}
.fr.c-d .conf{color:var(--text);font-weight:600}
.fr.c-u{opacity:.7}
.applied{display:flex;gap:6px;flex-wrap:wrap;align-items:center;font-size:13px;color:var(--text-2);margin:10px 0 4px}
.chip.on,.chip[aria-pressed=true]{border-style:solid;border-color:var(--s7);color:var(--text);background:color-mix(in srgb,var(--s7) 14%,transparent)}
details.more{margin:6px 0}details.more summary{cursor:pointer;color:var(--text-2);font-size:14px;padding:6px 0}

/* Abendprotokoll */
.tags{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 4px}
.tags .chip{font-size:14px;padding:8px 13px;min-height:38px;border-style:solid}
.why{margin:4px 0;padding-left:18px;font-size:13px;color:var(--text-2)}.why li{margin:4px 0}
.why b{color:var(--text);font-weight:600}

/* Rhythmus */
.rh{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:8px 0 6px}
.rh div{display:flex;flex-direction:column}
.rh .k{font-size:13px;color:var(--text-2)}
.rh .v{font-size:30px;font-weight:600;line-height:1.1}
.rh .st{font-size:12.5px;color:var(--text-2)}

/* Login */
.login{min-height:92vh;display:grid;place-items:center}
.login form{width:min(340px,100%);display:grid;gap:12px}
.login h1{font-family:var(--display);font-size:34px;font-weight:700;line-height:1;margin:0 0 8px}
.login h1 span{display:block;font-size:17px;font-weight:500;color:var(--text-3);margin-top:6px}
.login input{font-size:17px;padding:12px 14px;border-radius:var(--r-ctl);border:1px solid var(--line);background:var(--surface)}
.login .btn{border-radius:var(--r-ctl);padding:12px;min-height:46px}
.login .err{min-height:20px;font-size:14px}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
