:root{--bg:#f3f4f8;--card:#fff;--text:#12151c;--muted:#5b6472;--line:#e3e6ee;--accent:#5157c6;--accent-text:#fff;--soft:#ecebff;--soft-text:#2d2e9a;--chip:#fff;--danger:#b3261e;--shadow:0 1px 2px rgba(20,24,40,.06),0 10px 28px rgba(20,24,40,.06)}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]){--bg:#0e1015;--card:#171a22;--text:#eceef3;--muted:#98a1b0;--line:#272c37;--accent:#9b9dff;--accent-text:#10121a;--soft:#25274a;--soft-text:#d6d7ff;--chip:#1d212b;--danger:#ff8a80;--shadow:0 1px 2px rgba(0,0,0,.4)}}
:root[data-theme=dark]{--bg:#0e1015;--card:#171a22;--text:#eceef3;--muted:#98a1b0;--line:#272c37;--accent:#9b9dff;--accent-text:#10121a;--soft:#25274a;--soft-text:#d6d7ff;--chip:#1d212b;--danger:#ff8a80;--shadow:0 1px 2px rgba(0,0,0,.4)}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,'Segoe UI',sans-serif;line-height:1.4}
button,input,textarea{font:inherit;color:inherit}
a{color:inherit;text-decoration:none}
.page{max-width:430px;margin:0 auto;padding:max(24px,env(safe-area-inset-top)) 18px 110px;display:flex;flex-direction:column;gap:20px}
h1{margin:0;font-size:28px;font-weight:700;letter-spacing:-.02em}
h2{margin:0;font-size:17px;font-weight:700}
h2.plain{margin:0 4px 8px}
.sub{font-weight:500;color:var(--muted);font-size:13px}
.hint{font-size:12px;color:var(--muted);margin:0;padding:0 4px}
.brand{font-weight:800;letter-spacing:.02em;color:var(--accent);font-size:20px}
.sr{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none}
.card{background:var(--card);border-radius:24px;padding:18px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:12px}
.card.stack{gap:16px}
.stack{display:flex;flex-direction:column;gap:14px}
.stack.big{gap:20px}
.center{align-items:center;text-align:center}
.dashedcard{border:1px dashed var(--muted);box-shadow:none}
.msg{margin:0;padding:12px 14px;border-radius:14px;background:var(--soft);color:var(--soft-text);font-size:14px}
.msg.error{background:rgba(229,72,77,.14);color:var(--danger)}
.msg.help{background:var(--soft);font-weight:600}

.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:-6px}
.date{font-size:13px;color:var(--muted)}
.topright{display:flex;align-items:center;gap:2px}
.scorering{width:44px;height:44px;display:flex;align-items:center;justify-content:center}
.avatar{width:40px;height:40px;border-radius:50%;border:2px solid var(--accent);background:var(--soft);color:var(--soft-text);font-size:17px;font-weight:700;display:flex;align-items:center;justify-content:center}
.titlerow{display:flex;justify-content:space-between;align-items:center;gap:8px}
.switcher{display:flex;gap:2px;padding:4px;border-radius:999px;background:var(--card);box-shadow:var(--shadow)}
.sw{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--muted);opacity:.6}
.sw.on{background:var(--accent);color:var(--accent-text);opacity:1}
.slots{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;border-radius:16px;background:var(--card);box-shadow:var(--shadow)}
.slot{min-height:44px;border-radius:12px;display:flex;align-items:center;justify-content:center;color:var(--muted);font-weight:650}
.slot.on{background:var(--accent);color:var(--accent-text);font-weight:700}

.moods{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.moodwrap{position:relative}
.m0{--c:229,72,77}.m1{--c:240,138,36}.m2{--c:232,177,0}.m3{--c:76,175,80}.m4{--c:24,160,88}
.mood{min-height:84px;border-radius:18px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:12px 2px;font-size:10.5px;line-height:1.15;text-align:center;font-weight:650;cursor:pointer;background:linear-gradient(180deg,rgba(var(--c),0),rgba(var(--c),.26))}
.sr:checked+.mood{background:linear-gradient(180deg,rgba(var(--c),0),rgba(var(--c),.5));box-shadow:0 0 0 2px rgb(var(--c))}
.sr:focus-visible+label{outline:3px solid var(--accent);outline-offset:2px}

.tags{display:flex;flex-wrap:wrap;gap:8px}
.tagwrap{position:relative}
.tag{min-height:44px;padding:0 14px 0 11px;border-radius:999px;border:1px solid var(--line);background:var(--chip);font-size:14px;display:inline-flex;align-items:center;gap:7px;cursor:pointer}
.tag.dashed{border:1px dashed var(--muted);background:transparent}
.sr:checked+.tag{border-color:transparent;background:var(--soft);color:var(--soft-text);box-shadow:inset 0 0 0 2px var(--accent);font-weight:700}

.scale{border:0;margin:0;padding:0;display:flex;flex-direction:column;gap:8px;min-width:0}
.scale legend{padding:0;margin-bottom:8px;font-size:14px;font-weight:650}
.steps,.grid2{display:grid;gap:6px}
.steps{grid-template-columns:repeat(5,minmax(0,1fr))}
.grid2{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.stepwrap{position:relative;display:block}
.step,.choice{min-height:44px;border-radius:14px;border:1px solid var(--line);background:var(--chip);display:flex;align-items:center;justify-content:center;font-size:15px;font-weight:600;cursor:pointer;text-align:center;padding:0 6px}
.choice{min-height:50px}
.sr:checked+.step,.sr:checked+.choice{background:var(--accent);color:var(--accent-text);border-color:transparent;font-weight:700}
.ends{display:flex;justify-content:space-between;font-size:12px;color:var(--muted)}
.picked{font-weight:700;color:var(--accent)}

.panel{display:flex;flex-direction:column;gap:8px;background:var(--bg);border-radius:16px;padding:14px}
.panel.soft{background:var(--soft);color:var(--soft-text);font-size:13px;line-height:1.45}
.ptitle{font-size:14px;font-weight:650}
.checklist{background:var(--chip);border-radius:14px;border:1px solid var(--line)}
.check{display:flex;align-items:center;gap:12px;min-height:48px;padding:6px 14px;border-bottom:1px solid var(--line);font-size:15px;line-height:1.25}
.check:last-child{border-bottom:0}
.check input{flex:none;width:22px;height:22px;accent-color:#6e70f0;margin:0}
.check input:checked+span{font-weight:700}

.field{display:flex;flex-direction:column;gap:6px;font-size:14px;font-weight:650}
.field input,textarea{width:100%;min-height:48px;border-radius:14px;border:1px solid var(--line);background:var(--chip);padding:10px 14px;font-weight:400;font-size:16px}
textarea{min-height:96px;border-radius:18px;resize:vertical;display:block}
.field .hint{font-weight:400;padding:0}
.customfield{margin-top:4px}
button.primary,button.secondary{min-height:54px;border:0;border-radius:18px;font-size:16px;font-weight:700;cursor:pointer;padding:0 20px}
button.primary{background:var(--accent);color:var(--accent-text)}
button.secondary{background:var(--soft);color:var(--soft-text);min-height:48px;border-radius:14px}
.row{display:flex;flex-wrap:wrap;gap:4px 12px;align-items:baseline}
code{font-family:ui-monospace,monospace;font-size:13px}
.secret{word-break:break-all;letter-spacing:.06em}
.qr{background:#fff;padding:14px;border-radius:12px}
.qr svg{width:220px;height:auto;display:block}
details{font-size:13px}

.bottombar{position:fixed;left:0;right:0;bottom:0;background:var(--card);border-top:1px solid var(--line);padding:10px 12px max(14px,env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(3,minmax(0,1fr));max-width:430px;margin:0 auto}
.bottombar a{display:flex;flex-direction:column;align-items:center;gap:4px;padding:6px 0;color:var(--muted);font-size:11px;font-weight:650}
.bottombar a.on{color:var(--accent)}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px}

/* Körper und Medikamente */
a.sw{cursor:pointer}
.sw.off{opacity:.35}
.titlerow.wrap{flex-wrap:wrap}
.grid2.one{grid-template-columns:1fr}
.tempvalue{text-align:center;font-size:17px;font-weight:700;color:var(--accent)}
.temprange{-webkit-appearance:none;appearance:none;width:100%;height:36px;background:transparent;margin:0;padding:0}
.temprange::-webkit-slider-runnable-track{height:12px;border-radius:999px;background:linear-gradient(90deg,#e5484d,#f08a24,#9aa3b2,#4cc9f0,#4a6cf0)}
.temprange::-moz-range-track{height:12px;border-radius:999px;background:linear-gradient(90deg,#e5484d,#f08a24,#9aa3b2,#4cc9f0,#4a6cf0)}
.temprange::-webkit-slider-thumb{-webkit-appearance:none;width:32px;height:32px;margin-top:-10px;border-radius:50%;background:var(--card);border:4px solid var(--accent);box-shadow:0 2px 6px rgba(0,0,0,.3)}
.temprange::-moz-range-thumb{width:24px;height:24px;border-radius:50%;background:var(--card);border:4px solid var(--accent);box-shadow:0 2px 6px rgba(0,0,0,.3)}
.panel.inline{flex-direction:row;align-items:center;flex-wrap:wrap;gap:10px}
.panel input,.row2 input,#prn-form>input{min-height:46px;border-radius:12px;border:1px solid var(--line);background:var(--chip);padding:8px 12px;font-size:16px;width:100%}
.panel.inline input{width:auto;flex:1;min-width:110px;max-width:160px}
.panel.soft{gap:2px}
button.primary.small{min-height:48px;border-radius:14px;font-size:15px}
.spaced{margin-top:6px}
.dropdown summary{min-height:52px;display:flex;align-items:center;justify-content:space-between;padding:0 16px;border-radius:16px;border:2px solid var(--line);background:var(--chip);font-size:15px;font-weight:600;cursor:pointer;list-style:none}
.dropdown summary::-webkit-details-marker{display:none}
.dropdown[open] summary{border-color:var(--accent)}
.dropdown .scroll{max-height:300px;overflow-y:auto;margin-top:10px}
.chosen{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.muted{font-size:13px;color:var(--muted)}
.pill{padding:7px 12px;border-radius:999px;background:var(--soft);color:var(--soft-text);font-size:13px;font-weight:700}
.tag.block,.dashedbtn{min-height:46px;border-radius:14px;border:1px dashed var(--muted);background:transparent;font-size:14px;justify-content:center;width:100%;cursor:pointer}
.dashedbtn{min-height:54px;border-radius:18px;font-size:15px;font-weight:650}
.pillnote{align-self:flex-start;padding:8px 14px;border-radius:999px;background:var(--soft);color:var(--soft-text);font-size:13px;font-weight:700}
.stack.tight{gap:8px}
.caps{margin:0 4px;font-size:13px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.medrow,.planrow{display:flex;align-items:center;gap:14px;background:var(--card);border-radius:20px;padding:14px 16px;box-shadow:var(--shadow)}
.planrow{background:var(--bg);box-shadow:none;border-radius:16px;padding:10px 12px;gap:8px}
.medbox{width:46px;height:46px;flex:none;border-radius:14px;border:2px solid var(--muted);background:transparent;color:var(--text);font-size:22px;cursor:pointer;padding:0}
.medrow.done .medbox{border-color:transparent;background:var(--accent);color:var(--accent-text);font-weight:700}
.medtext{flex:1;display:flex;flex-direction:column;min-width:0}
.medtext span{font-size:13px;color:var(--muted)}
.medtime{font-size:13px;color:var(--muted);white-space:nowrap}
.linkbtn{border:0;background:transparent;color:var(--accent);font-size:13px;font-weight:700;padding:8px 6px;cursor:pointer}
.linkbtn.danger{color:var(--danger)}
.row2{display:grid;grid-template-columns:1fr 120px;gap:8px}
.field.small{font-size:12px;font-weight:500;color:var(--muted)}
.field.small input{min-height:44px;font-size:14px;color:var(--text)}

/* Tag und Soziales */
.optrow{display:grid;gap:6px}
.optrow.cols2{grid-template-columns:repeat(2,minmax(0,1fr))}
.optrow.cols3{grid-template-columns:repeat(3,minmax(0,1fr))}
.optrow.cols4{grid-template-columns:repeat(4,minmax(0,1fr))}
.opt{min-height:44px;border-radius:12px;border:1px solid var(--line);background:var(--chip);display:flex;align-items:center;justify-content:center;font-size:13.5px;font-weight:600;text-align:center;padding:0 6px;cursor:pointer}
.sr:checked+.opt{background:var(--accent);color:var(--accent-text);border-color:transparent;font-weight:700}
.row2eq{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.field.small input[type=time],.field.small input[type=date]{min-height:44px}
.inlinefield{max-width:200px}
.kv{display:flex;justify-content:space-between;font-size:14px}
.spread{display:flex;justify-content:space-between;align-items:center;gap:8px}
.state{font-size:12px;color:var(--muted)}
.state.on{color:var(--accent);font-weight:700}
.sliderrow{display:flex;flex-direction:column;gap:8px}
.rastrow{display:grid;position:relative;padding-top:2px}
.rastrow.cols2{grid-template-columns:repeat(2,minmax(0,1fr))}
.rastrow.cols3{grid-template-columns:repeat(3,minmax(0,1fr))}
.rast{position:relative}
.rast label{display:flex;flex-direction:column;align-items:center;gap:6px;cursor:pointer;font-size:12.5px;color:var(--muted);text-align:center;padding:2px 0;position:relative}
.rast label::before{content:"";position:absolute;top:11px;left:0;right:0;height:3px;background:var(--line)}
.rast:first-child label::before{left:50%}
.rast:last-child label::before{right:50%}
.rast label i{position:relative;z-index:1;width:22px;height:22px;border-radius:50%;background:var(--card);border:3px solid var(--muted);opacity:.7}
.sr:checked+label{color:var(--accent);font-weight:700}
.sr:checked+label i{background:var(--accent);border-color:var(--accent);opacity:1;box-shadow:0 0 0 4px var(--soft)}
.counter{display:flex;align-items:center;gap:10px}
.cbtn{width:44px;height:44px;border-radius:14px;border:1px solid var(--line);background:var(--chip);font-size:22px;cursor:pointer;line-height:1}
.cnum{width:52px!important;min-height:44px!important;text-align:center;padding:0 4px!important;-moz-appearance:textfield;appearance:textfield}
.cnum::-webkit-outer-spin-button,.cnum::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.actrow{min-height:52px;display:flex;align-items:center;gap:12px;padding:0 14px 0 16px;border-radius:14px;border:1px solid var(--line);background:var(--chip);font-size:15px;font-weight:600;cursor:pointer}
.actrow .box{width:28px;height:28px;border-radius:8px;border:2px solid var(--muted);display:flex;align-items:center;justify-content:center;font-size:17px;font-weight:700;flex:none}
.sr:checked+.actrow{border-color:transparent;background:var(--soft);box-shadow:inset 0 0 0 2px var(--accent);font-weight:700}
.sr:checked+.actrow .box{background:var(--accent);border-color:var(--accent);color:var(--accent-text)}
.sr:checked+.actrow .box::after{content:"✓"}
.faces{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px}
.facewrap{position:relative}
.f0{--c:24,160,88}.f1{--c:76,175,80}.f2{--c:232,177,0}.f3{--c:240,138,36}.f4{--c:229,72,77}.f5{--c:130,138,152}
.face{height:62px;border-radius:14px;display:flex;align-items:center;justify-content:center;cursor:pointer;background:linear-gradient(180deg,rgba(var(--c),0),rgba(var(--c),.22))}
.sr:checked+.face{background:linear-gradient(180deg,rgba(var(--c),0),rgba(var(--c),.5));box-shadow:0 0 0 2px rgb(var(--c))}

/* Gesamtscore */
.scorering{width:44px;height:44px;display:flex;align-items:center;justify-content:center}
.back{font-size:13px;color:var(--muted)}
.bigring{position:relative;width:132px;height:132px}
.bigring .corner{position:absolute;display:flex}
.corner.tl{top:-4px;left:-8px}.corner.tr{top:-4px;right:-8px}.corner.bl{bottom:-4px;left:-8px}.corner.br{bottom:-4px;right:-8px}
.scorelabel{font-size:20px;font-weight:700}
.scorelabel .prov{font-size:13px;font-weight:500;color:var(--muted)}
.scoretext{display:flex;flex-direction:column;gap:2px;margin-top:6px}
.legend{display:flex;gap:12px;flex-wrap:wrap;justify-content:center;font-size:12px;color:var(--muted)}
.dot{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:5px}
.dot.c1{background:#e5484d}.dot.c2{background:#f08a24}.dot.c3{background:#4cae4f}.dot.c4{background:#12875a}
.weekbars{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;align-items:end}
.weekcol{display:flex;flex-direction:column;align-items:center;gap:4px}
.barbox{height:76px;display:flex;align-items:flex-end}
.wv{font-size:12px;font-weight:700}
.wd{font-size:12px;color:var(--muted)}.wd.today{color:var(--accent);font-weight:700}
.evdot{height:8px;display:flex}.evdot i,.evrow i{width:8px;height:8px;border-radius:50%;background:var(--accent);display:inline-block}
.evrow{display:flex;align-items:center;gap:10px;font-size:14px}
.partrow{display:flex;flex-direction:column;gap:6px}
.partline{display:flex;align-items:baseline;gap:8px;font-size:14px}
.pname{flex:1;font-weight:650}
.partline b{min-width:28px;text-align:right}
.delta{min-width:34px;text-align:right;font-size:12px;color:#4cae4f;font-weight:700}.delta.neg{color:#d9710b}
.tracksvg{display:block;border-radius:999px}
.symlegend{display:grid;grid-template-columns:auto 1fr;gap:10px 12px;align-items:center;font-size:14px}
.symlegend>span:nth-child(odd){display:flex;gap:6px}
.wrow{display:flex;flex-direction:column;gap:6px}
.wrow label{font-size:14px;font-weight:650}
.wrange{width:100%;accent-color:var(--accent);height:28px}
select{width:100%;min-height:44px;border-radius:12px;border:1px solid var(--line);background:var(--chip);padding:0 12px;font-size:15px;color:var(--text)}
.card p{margin:0;font-size:14px;line-height:1.5}
.card p.hint{font-size:12px}
.scorelink{flex-direction:row;align-items:center;gap:14px}

/* Einstellungen und Konto */
.modes{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;padding:4px;border-radius:16px;background:var(--bg)}
.mode{min-height:42px;border-radius:12px;border:0;background:transparent;color:var(--muted);font-size:14px;font-weight:600;cursor:pointer}
.mode.on{background:var(--accent);color:var(--accent-text);font-weight:700}
.navrow{display:flex;align-items:center;gap:12px;min-height:56px;padding:0 4px;border-bottom:1px solid var(--line)}
.navrow:last-child{border-bottom:0}
.avatar.big{width:72px;height:72px;font-size:30px}
button.secondary.wide{width:100%}
.codes{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:10px 16px}
.codes code{font-size:16px;letter-spacing:.06em}
.linkprimary{display:flex;align-items:center;justify-content:center;min-height:54px;border-radius:18px;background:var(--accent);color:var(--accent-text);font-weight:700}

.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
