:root{
  --bg:#0F1218; --surface:#171C25; --surface2:#1E2430; --line:#2C3442; --line2:#232A36;
  --text:#EEF1F6; --text2:#C9CFDB; --muted:#9AA3B5; --faint:#8790A2;
  --accent:#5EE0C1; --accent-ink:#0B2A23; --accent-bg:#163A32; --accent-text:#8BF0D6;
  --red:#E5484D; --red-text:#FF8A8E; --red-line:#FF5A60; --red-bg:#3A1518; --red-bg2:#2A1517; --red-dim:#8A3438;
  --ok-bg:#14261F; --ok-line:#275A4C;
  color-scheme:dark;
}
html{font-size:100%;-webkit-text-size-adjust:100%}
html.kompakt{font-size:87.5%}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;line-height:1.4}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer}
[hidden]{display:none!important}
.wrap{max-width:40rem;margin:0 auto;min-height:100dvh;display:flex;flex-direction:column}
main{flex:1;padding:0 1.1rem 9rem}
h1{margin:0;font-size:1.9rem;font-weight:750;letter-spacing:-.02em}
h2{margin:0;font-size:1.45rem;font-weight:700}
.top{display:flex;justify-content:space-between;align-items:center;gap:.8rem;padding:1.5rem 1.1rem .8rem}
.kicker{font-size:.9rem;color:var(--muted);font-weight:500}
.round{min-width:2.9rem;height:2.9rem;border-radius:999px;border:none;background:var(--surface2);color:var(--accent);font-weight:700;display:inline-flex;align-items:center;justify-content:center;padding:0 .6rem}
.round svg{width:1.3rem;height:1.3rem}
.stack{display:flex;flex-direction:column;gap:.75rem}
.row{display:flex;gap:.5rem;align-items:center}
.wrap-row{display:flex;flex-wrap:wrap;gap:.5rem}

/* Warnung */
.warn{background:var(--red-bg);border:1px solid var(--red-line);border-radius:1rem;padding:.85rem 1rem;display:flex;gap:.75rem;align-items:center;margin-bottom:.9rem}
.warn svg{flex-shrink:0;width:1.5rem;height:1.5rem}
.warn b{color:var(--red-text)}
.warn span{color:#E7C4C6}

/* Eingaben */
label,.label{font-size:.95rem;color:var(--muted);font-weight:500}
.field{display:flex;flex-direction:column;gap:.45rem}
.help{font-size:.82rem;color:var(--faint)}
input[type=text],input[type=search],input[type=password],input[type=number],input[type=date],select{
  width:100%;min-height:3.2rem;border-radius:.9rem;border:1px solid var(--line);background:var(--surface);
  font-size:1.05rem;padding:.6rem 1rem;outline:none;min-width:0}
input:focus,select:focus{border-color:var(--accent)}
.search{position:relative;margin-bottom:.7rem}
.search svg{position:absolute;left:.95rem;top:50%;transform:translateY(-50%);width:1.2rem;height:1.2rem;color:var(--muted);pointer-events:none}
.search input{padding-left:2.8rem}
.check{display:flex;align-items:center;gap:.6rem;color:var(--text2)}
.check input{width:1.4rem;height:1.4rem;accent-color:var(--accent)}

/* Knöpfe */
.btn{min-height:3.4rem;border-radius:1rem;border:none;background:var(--accent);color:var(--accent-ink);font-size:1.05rem;font-weight:700;padding:.6rem 1.2rem;width:100%}
.btn:disabled{background:var(--surface2);color:#6B7385;cursor:default}
.btn.ghost{background:transparent;border:1px solid #3A4252;color:var(--text)}
.btn.danger{background:transparent;border:1px solid var(--red-line);color:var(--red-text)}
.btn.small{min-height:3.2rem;width:auto;flex-shrink:0;background:transparent;border:1px solid var(--accent);color:var(--accent);font-weight:600}
.chip{min-height:2.6rem;padding:.3rem .95rem;border-radius:999px;border:1px solid var(--line);background:transparent;color:var(--text2);font-size:.95rem;font-weight:600}
.chip.on{border-color:var(--accent);background:var(--accent-bg);color:var(--accent-text)}

/* Karten */
.card{width:100%;text-align:left;border-radius:1.1rem;background:var(--surface);border:1px solid var(--line2);padding:1rem;display:flex;flex-direction:column;gap:.35rem}
.card.soon{border-color:var(--red-dim)}
.card.ex{border:2px solid var(--red)}
.card .head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-start;gap:.6rem}
.card .name{flex:1 1 9rem;font-size:1.12rem;font-weight:650;hyphens:auto;overflow-wrap:break-word;min-width:0}
.card .line{color:var(--text2)}
.card .sub{font-size:.88rem;color:var(--faint)}
.until.warnc{color:var(--red-text)}
.badge{flex-shrink:0;font-size:.85rem;font-weight:700;padding:.25rem .65rem;border-radius:999px;background:var(--surface2);color:var(--muted);white-space:nowrap}
.badge.soon{background:var(--red-bg);color:var(--red-text);border:1px solid var(--red-line)}
.badge.ex{background:var(--red);color:#fff}
.empty{text-align:center;color:var(--faint);padding:2.5rem 0}

/* Formular */
.suggest{background:var(--surface2);border:1px solid var(--line);border-radius:.9rem;overflow:hidden}
.suggest button{display:flex;width:100%;justify-content:space-between;gap:.6rem;align-items:center;min-height:3rem;border:none;border-bottom:1px solid var(--line);background:transparent;padding:.55rem 1rem;text-align:left}
.suggest button:last-child{border-bottom:none}
.suggest small{color:var(--faint);font-size:.82rem;text-align:right}
.note-new{background:var(--ok-bg);border:1px solid var(--ok-line);border-radius:.9rem;padding:.8rem 1rem;color:#BFEFE2;font-size:.95rem}
.two{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:.5rem}
.err{color:var(--red-text);font-weight:600}
.bottombar{position:sticky;bottom:0;padding:1rem 0 1.4rem;background:linear-gradient(transparent,var(--bg) 35%)}

/* Detail */
.hero{border-radius:1.25rem;padding:1.2rem;display:flex;flex-direction:column;gap:.3rem;background:var(--ok-bg);border:1px solid var(--ok-line)}
.hero.soon{background:var(--red-bg2);border-color:var(--red-line)}
.hero.ex{background:var(--red-bg);border:2px solid var(--red)}
.hero .big{font-size:2.3rem;font-weight:750;letter-spacing:-.02em}
.hero.soon .big,.hero.ex .big{color:var(--red-text)}
.facts{background:var(--surface);border-radius:1rem;padding:.2rem 1rem}
.facts div{display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap;padding:.8rem 0;border-bottom:1px solid var(--line2)}
.facts div:last-child{border-bottom:none}
.facts span{color:var(--muted)}
.facts b{text-align:right}

/* Datenbank */
.dbrow{width:100%;text-align:left;background:var(--surface);border:1px solid var(--line2);border-radius:.9rem;padding:.85rem 1rem;display:flex;justify-content:space-between;gap:.6rem;align-items:center;flex-wrap:wrap}
.dbrow b{font-size:1.05rem;overflow-wrap:anywhere}
.dbrow small{color:var(--muted);font-size:.85rem}

/* Navigation, Menü, Hinweis */
nav{position:fixed;left:0;right:0;bottom:0;background:#141821;border-top:1px solid var(--line2);display:flex;justify-content:center;padding-bottom:env(safe-area-inset-bottom)}
nav button{flex:1;max-width:20rem;min-height:4.4rem;border:none;background:transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.2rem;font-size:.82rem;font-weight:650;color:var(--faint)}
nav button.on{color:var(--accent)}
nav svg{width:1.4rem;height:1.4rem}
.sheet-bg{position:fixed;inset:0;background:rgba(0,0,0,.55);display:flex;align-items:flex-end;justify-content:center;z-index:20}
.sheet{width:100%;max-width:40rem;background:#151A23;border-radius:1.4rem 1.4rem 0 0;padding:1.3rem 1.1rem calc(1.4rem + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:.9rem;max-height:90dvh;overflow:auto}
.toast{position:fixed;left:50%;transform:translateX(-50%);top:calc(.8rem + env(safe-area-inset-top));background:#2A3140;border-radius:.9rem;padding:.6rem .7rem .6rem 1rem;display:flex;gap:.8rem;align-items:center;z-index:30;box-shadow:0 .5rem 1.5rem rgba(0,0,0,.5);max-width:calc(100% - 2rem)}
.toast button{border:none;background:transparent;color:var(--accent);font-weight:700;min-height:2.6rem;padding:0 .5rem}
.login{max-width:26rem;margin:0 auto;padding:5rem 1.6rem 2rem;display:flex;flex-direction:column;gap:1.6rem;min-height:100dvh}
.logo{width:4rem;height:4rem;border-radius:1.25rem;background:var(--accent-bg);display:flex;align-items:center;justify-content:center}
.logo svg{width:2.1rem;height:2.1rem}
.foot{margin-top:auto;text-align:center;font-size:.82rem;color:var(--faint)}
nav .addbtn{color:var(--text)}
nav .addbtn span{width:3rem;height:2.3rem;border-radius:999px;background:var(--accent);color:var(--accent-ink);display:flex;align-items:center;justify-content:center}
nav .addbtn svg{width:1.3rem;height:1.3rem}
