:root {
  --bg: #f6f3ee; --flaeche: #ffffff; --flaeche2: #efebe4; --text: #22201c; --leise: #6f6a62; --linie: #e2ddd4;
  --akzent: #b45309; --akzent-text: #fff; --gefahr: #b91c1c; --warn-bg: #fef3c7; --warn-text: #7c4a03;
  --laura: #0f766e; --victor: #4f46e5; --andere: #9a6b2f;
  --radius: 14px; --schatten: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a18; --flaeche: #252421; --flaeche2: #2f2d29; --text: #ece8e1; --leise: #a19b91; --linie: #3a3833;
    --akzent: #f59e0b; --akzent-text: #1b1a18; --gefahr: #f87171; --warn-bg: #3d2f0d; --warn-text: #fcd38d;
    --laura: #2dd4bf; --victor: #a5b4fc; --andere: #e0b273;
    --schatten: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 1.05rem; margin-bottom: .6rem; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%; padding: .65rem .75rem; border: 1px solid var(--linie); border-radius: 10px; background: var(--flaeche);
}
textarea { min-height: 5rem; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--akzent); outline-offset: 1px; }
label { display: grid; gap: .3rem; font-size: .9rem; color: var(--leise); }
label > input, label > select, label > textarea { color: var(--text); }
button { cursor: pointer; border: 0; background: none; }
.haupt { background: var(--akzent); color: var(--akzent-text); padding: .7rem 1.1rem; border-radius: 10px; font-weight: 600; }
.zweit { background: var(--flaeche2); padding: .55rem .9rem; border-radius: 10px; }
.klein { padding: .35rem .7rem; font-size: .88rem; }
.gefahr-text { color: var(--gefahr); }
.leise { color: var(--leise); font-size: .9rem; }
.fehler { color: var(--gefahr); min-height: 1.2em; margin: 0; }

.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-karte { width: min(380px, 100%); display: grid; gap: .9rem; }

.kopf {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 14px) 16px 12px; background: var(--bg);
}
.kopf h1 { font-size: 1.5rem; }
.badge { font-size: .8rem; padding: .25rem .6rem; border-radius: 99px; background: var(--flaeche2); color: var(--leise); }

main { max-width: 760px; margin: 0 auto; padding: 0 16px calc(90px + env(safe-area-inset-bottom)); display: grid; gap: 14px; }
.karte { background: var(--flaeche); border-radius: var(--radius); padding: 16px; box-shadow: var(--schatten); border: 1px solid var(--linie); }
.zeile { display: flex; align-items: center; gap: .6rem; }
.zwischen { justify-content: space-between; }
.umbruch { flex-wrap: wrap; }
.stapel { display: grid; gap: .6rem; }
.raster2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }

.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 10; display: grid; grid-template-columns: repeat(6, 1fr);
  background: var(--flaeche); border-top: 1px solid var(--linie); padding-bottom: env(safe-area-inset-bottom);
}
.tabs button { display: grid; justify-items: center; gap: 2px; padding: 8px 0 9px; font-size: .68rem; color: var(--leise); }
.tabs .ico { font-size: 1.2rem; line-height: 1; }
.tabs button.aktiv { color: var(--akzent); font-weight: 600; }
@media (min-width: 900px) {
  .tabs { inset: 0 auto 0 0; width: 96px; grid-template-columns: 1fr; grid-auto-rows: min-content; padding-top: 80px; border-top: 0; border-right: 1px solid var(--linie); }
  .tabs button { padding: 12px 0; font-size: .75rem; }
  .kopf, main { margin-left: 96px; }
  main { margin-left: max(96px, calc((100vw - 760px) / 2)); padding-bottom: 40px; }
  .kopf { padding-left: max(112px, calc((100vw - 760px) / 2 + 16px)); margin-left: 0; }
}

.punkt { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--andere); }
.p-laura { --p: var(--laura); } .p-victor { --p: var(--victor); } .p-andere { --p: var(--andere); }
.punkt[class*="p-"] { background: var(--p); }

.keen-heute { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.keen-feld { border-radius: 12px; padding: .8rem; background: var(--flaeche2); }
.keen-feld .wer { font-size: 1.25rem; font-weight: 700; color: var(--p, var(--leise)); }
.keen-feld .wann { font-size: .8rem; color: var(--leise); }

.streifen { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; }
.streifen div { aspect-ratio: 1 / 1.6; border-radius: 6px; background: var(--flaeche2); display: grid; place-items: center; font-size: .7rem; color: var(--leise); position: relative; }
.streifen div[class*="p-"] { background: var(--p); color: var(--flaeche); }
.streifen div.heute { outline: 2px solid var(--text); outline-offset: 1px; }
.streifen div.halb::after { content: ""; position: absolute; inset: 50% 0 0 0; background: var(--p2); border-radius: 0 0 6px 6px; opacity: .9; }
.streifen-legende { display: flex; gap: .9rem; font-size: .8rem; color: var(--leise); margin-top: .5rem; flex-wrap: wrap; }

.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { display: flex; gap: .7rem; align-items: flex-start; padding: .65rem 0; border-top: 1px solid var(--linie); }
.liste > li:first-child { border-top: 0; }
.liste .haupttext { flex: 1; min-width: 0; }
.liste .titel { font-weight: 550; overflow-wrap: anywhere; }
.liste .sub { font-size: .82rem; color: var(--leise); }
.tag-kopf { font-weight: 700; font-size: .95rem; padding: .2rem 0 .3rem; display: flex; justify-content: space-between; }
.tag-kopf.heute { color: var(--akzent); }
.termin { display: flex; gap: .55rem; align-items: baseline; padding: .3rem 0 .3rem .6rem; border-left: 3px solid var(--p, var(--linie)); margin: .2rem 0; }
.termin .zeit { font-variant-numeric: tabular-nums; font-size: .82rem; color: var(--leise); min-width: 5.6em; }
.termin.ferien { --p: var(--akzent); }
.termin.keen { background: var(--flaeche2); border-radius: 0 8px 8px 0; }
.leer { color: var(--leise); font-size: .88rem; padding: .2rem 0 .2rem .6rem; }

.check { width: 26px; height: 26px; flex: none; border-radius: 8px; border: 2px solid var(--linie); display: grid; place-items: center; font-size: .9rem; margin-top: 1px; }
.check.an { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
.erledigt .titel { text-decoration: line-through; color: var(--leise); }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { padding: .35rem .8rem; border-radius: 99px; background: var(--flaeche2); font-size: .88rem; }
.chip.an { background: var(--text); color: var(--bg); }
.pill { font-size: .72rem; padding: .15rem .5rem; border-radius: 99px; background: var(--flaeche2); color: var(--leise); white-space: nowrap; }
.pill.gebucht { background: var(--laura); color: #fff; }
.pill.geplant { background: var(--akzent); color: var(--akzent-text); }
.pill.ueberfaellig { background: var(--gefahr); color: #fff; }
.warnung { background: var(--warn-bg); color: var(--warn-text); border-radius: 8px; padding: .35rem .6rem; font-size: .82rem; margin-top: .35rem; }
.zahl { font-size: 2rem; font-weight: 750; line-height: 1; }
.schnell { display: grid; grid-template-columns: 1fr auto auto; gap: .5rem; }
.schnell select { width: auto; }
.fortschritt { height: 6px; border-radius: 3px; background: var(--flaeche2); overflow: hidden; }
.fortschritt div { height: 100%; background: var(--akzent); }
.code { font-family: ui-monospace, monospace; font-size: .78rem; word-break: break-all; background: var(--flaeche2); padding: .5rem; border-radius: 8px; }
details summary { cursor: pointer; color: var(--leise); font-size: .9rem; }

dialog { border: 0; border-radius: 18px; padding: 0; width: min(480px, calc(100vw - 32px)); background: var(--flaeche); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(0,0,0,.4); }
dialog form { padding: 18px; display: grid; gap: .8rem; max-height: 85dvh; overflow: auto; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom)); background: var(--text); color: var(--bg); padding: .6rem 1rem; border-radius: 10px; z-index: 20; font-size: .9rem; max-width: calc(100vw - 32px); }
.fab { position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 9; width: 54px; height: 54px; border-radius: 50%; background: var(--akzent); color: var(--akzent-text); font-size: 1.8rem; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
@media (min-width: 900px) { .fab { bottom: 24px; right: 24px; } }
.raster2 > *, label { min-width: 0; }
input, select, textarea { min-width: 0; max-width: 100%; }
dialog form { overflow-x: hidden; }
@media (max-width: 480px) { dialog .raster2 { grid-template-columns: 1fr; } }
[data-aktion="keen-tag"] { cursor: pointer; }
.streifen div[data-aktion]:hover, .keen-feld:hover { filter: brightness(.95); }
.termin.offen { color: var(--leise); font-size: .9rem; }
.wahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .5rem; }
.wahl-knopf { padding: .9rem .6rem; border-radius: 12px; font-weight: 650; font-size: 1.05rem; background: var(--p); color: var(--flaeche); }
.wahl-knopf.p-andere { background: var(--flaeche2); color: var(--text); }
