/* Schriften lokal (SIL Open Font License): Oswald, Poppins */
@font-face { font-family: 'Oswald'; font-style: normal; font-weight: 500 700; font-display: swap; src: url(fonts/oswald-latin-ext-var.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Oswald'; font-style: normal; font-weight: 500 700; font-display: swap; src: url(fonts/oswald-latin-var.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/poppins-latin-ext-400.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/poppins-latin-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/poppins-latin-ext-500.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/poppins-latin-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/poppins-latin-ext-600.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/poppins-latin-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #1c1c1c;
  --surface: #262629;
  --surface-2: #2e2e32;
  --line: #3a3a3a;
  --text: #ffffff;
  --muted: #9a9aa2;
  --accent: #cded0d;
  --accent-ink: #1c1c1c;
  --tertiary: #c3d9e7;
  --hi: #ff6b4a;
  --mid: #f5b942;
  --lo: #8a8f98;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Poppins', system-ui, sans-serif; font-size: 15px; line-height: 1.45;
}
h1, h2, h3, .brand, .num { font-family: 'Oswald', 'Arial Narrow', sans-serif; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }

.shell { max-width: 720px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }
header.top { position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--bg) 80%, transparent); padding: calc(14px + env(safe-area-inset-top)) 0 10px; }
.bar { display: flex; align-items: center; justify-content: space-between; }
.brand { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.brand img { border-radius: 50%; background: #fff; }
.brand { } .brand b { color: var(--accent); font-weight: 700; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--muted); }
.icon-btn:hover { color: var(--text); background: var(--surface); }
svg { display: block; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chip.ghost { border-style: dashed; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 14px; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.hero .date { color: var(--muted); font-size: 13px; }
.hero .num { font-size: 44px; line-height: 1; color: var(--accent); }
.hero .num small { font-size: 22px; color: var(--muted); }
.meter { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 12px; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .3s; }
.sub { color: var(--muted); font-size: 13px; margin-top: 8px; display: flex; gap: 14px; flex-wrap: wrap; }
.sub b { color: var(--text); font-weight: 600; }

.sec-head { display: flex; justify-content: space-between; align-items: baseline; margin: 26px 2px 8px; }
.sec-head h2 { font-size: 15px; color: var(--tertiary); }
.sec-head span { color: var(--muted); font-size: 13px; }
ul.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.task { display: flex; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--lo); border-radius: 12px; padding: 12px 12px 12px 10px; }
.task.p-hoch { border-left-color: var(--hi); } .task.p-mittel { border-left-color: var(--mid); }
.check { flex: none; width: 26px; height: 26px; margin-top: 1px; border: 2px solid var(--line); border-radius: 8px; display: grid; place-items: center; color: transparent; transition: .15s; }
.check:hover { border-color: var(--accent); }
.task.done .check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tbody { flex: 1; min-width: 0; cursor: pointer; }
.ttitle { font-weight: 500; word-break: break-word; }
.task.done .ttitle { color: var(--muted); text-decoration: line-through; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.tag.hi { color: var(--hi); border-color: var(--hi); } .tag.mid { color: var(--mid); border-color: var(--mid); } .tag.over { color: var(--hi); }
.note { color: var(--muted); font-size: 12.5px; margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.grp { margin-top: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 8px 8px; }
.grp .list { padding-top: 4px; }
.grp.closed .list { display: none; }
.grp.closed { padding-bottom: 4px; }
.grp-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 4px; text-align: left; }
.gcheck { flex: none; width: 24px; height: 24px; border: 2px solid var(--line); border-radius: 50%; display: grid; place-items: center; color: transparent; transition: .15s; }
.gcheck svg { width: 14px; height: 14px; }
.grp.all .gcheck { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.gname { flex: 1; font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.grp.all .gname { color: var(--accent); }
.gcount { color: var(--muted); font-size: 13px; }
.chev { color: var(--muted); transition: transform .2s; transform: rotate(90deg); }
.grp.closed .chev { transform: none; }
.sortbar { margin-top: 14px; }
.mv { flex: none; display: flex; flex-direction: column; gap: 2px; }
.mv button { width: 34px; height: 24px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--tertiary); }
.mv button:active { background: var(--accent); color: var(--accent-ink); }
.task .mv { margin-top: -2px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: rgba(28,28,28,.96); border-top: 1px solid var(--line); backdrop-filter: blur(10px); padding-bottom: env(safe-area-inset-bottom); }
nav.tabs div { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
nav.tabs button { padding: 10px 0 9px; display: grid; justify-items: center; gap: 2px; font-size: 11px; color: var(--muted); }
nav.tabs button.on { color: var(--accent); }
.fab { position: fixed; right: max(16px, calc(50% - 344px)); bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 7; width: 54px; height: 54px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 6px 24px rgba(0,0,0,.5); }

/* Kalender */
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head h2 { font-size: 18px; }
.grid7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 12px; }
.wd { text-align: center; font-size: 11px; color: var(--muted); padding-bottom: 2px; }
.day { min-height: 62px; min-width: 0; align-content: start; justify-items: stretch; text-align: left; padding: 4px 3px 3px; gap: 2px; border-radius: 9px; background: var(--surface-2); background-image: linear-gradient(rgba(205,237,13,var(--a,0)), rgba(205,237,13,var(--a,0))); display: grid; grid-auto-rows: min-content; font-size: 13px; position: relative; border: 1px solid transparent; overflow: hidden; }
.dn-num { padding-left: 2px; line-height: 1.2; }
.ev { display: block; background: var(--bg); color: var(--tertiary); border-radius: 4px; padding: 0 3px; font-size: 9.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.ev.over { color: var(--hi); } .ev.dn { color: var(--muted); text-decoration: line-through; } .ev.more { color: var(--muted); background: none; padding: 0 2px; }
.day.l4 { color: var(--accent-ink); font-weight: 600; } .day.l3 { color: var(--accent-ink); }
.day.future { opacity: .6; } .day.blank { background: none; }
.day.today { border-color: var(--text); } .day.sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.legend { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: 12px; color: var(--muted); font-size: 11px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; background: var(--surface-2); background-image: linear-gradient(rgba(205,237,13,var(--a)), rgba(205,237,13,var(--a))); }
.log-row { display: flex; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); }
.log-row:last-child { border-bottom: 0; }
.log-row .t { color: var(--muted); font-size: 12px; flex: none; width: 44px; }
.log-row .n { flex: 1; min-width: 0; word-break: break-word; }
.log-row.miss .n { color: var(--muted); }
.log-row .ok { color: var(--accent); } .log-row .no { color: var(--hi); }
.day-title { font-size: 12px; color: var(--tertiary); margin: 16px 0 2px; font-family: 'Oswald'; letter-spacing: .05em; text-transform: uppercase; }

/* Statistik */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.kpi .num { font-size: 32px; color: var(--accent); line-height: 1.1; }
.kpi .num small { font-size: 14px; color: var(--muted); margin-left: 3px; }
.kpi span { color: var(--muted); font-size: 12px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 110px; margin-top: 12px; }
.bars div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; font-size: 10px; color: var(--muted); }
.bars i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: var(--accent); min-height: 3px; }
.bars i.none { background: var(--line); }
.trow { padding: 12px 0; border-bottom: 1px solid var(--line); }
.trow:last-child { border-bottom: 0; }
.trow .top { display: flex; justify-content: space-between; gap: 10px; }
.trow .top b { font-weight: 500; word-break: break-word; }
.trow .pct { color: var(--accent); font-family: 'Oswald'; font-size: 16px; }
.trow .sub { margin-top: 6px; }

/* Verwalten */
.row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; word-break: break-word; }
.row .grow small { display: block; color: var(--muted); font-size: 12px; }
.lnk { color: var(--tertiary); font-size: 13px; padding: 4px 6px; }
.lnk.danger { color: var(--hi); }
h3.section { font-size: 14px; color: var(--tertiary); margin: 28px 2px 0; }
.btn { background: var(--accent); color: var(--accent-ink); font-weight: 600; border-radius: 12px; padding: 11px 18px; }
.btn.sec { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: none; color: var(--hi); border: 1px solid var(--hi); }
.btn:disabled { opacity: .5; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* Formulare / Modal */
label.f { display: block; margin-top: 14px; font-size: 12px; color: var(--muted); }
input[type=text], input[type=password], input[type=date], select, textarea { width: 100%; margin-top: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); }
textarea { resize: vertical; min-height: 70px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin-top: 6px; }
.seg label { text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 9px 4px; cursor: pointer; color: var(--muted); font-size: 13px; user-select: none; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span { color: var(--accent-ink); }
.seg label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg.days { grid-auto-flow: row; grid-template-columns: repeat(7, 1fr); }
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.65); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
.sheet h2 { font-size: 20px; margin-bottom: 4px; }
.err { color: var(--hi); font-size: 13px; margin-top: 10px; min-height: 18px; }
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: 20px; } }

/* Sperrbildschirm */
.lock { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.lock .box { width: 100%; max-width: 360px; }
.lock .brand { font-size: 38px; text-align: center; }
.lock p { color: var(--muted); font-size: 13px; text-align: center; margin: 8px 0 22px; }
.lock .btn { width: 100%; margin-top: 18px; }

.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--text); color: var(--accent-ink); padding: 10px 16px; border-radius: 12px; font-size: 13px; z-index: 30; }

@media (max-width: 520px) { .ev { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; font-size: 8.5px; line-height: 1.2; } .day { min-height: 64px; } }

.legal { display: flex; justify-content: center; gap: 10px; margin-top: 36px; font-size: 12px; color: var(--muted); }
.legal a { color: var(--muted); text-decoration: none; }
.legal a:hover { color: var(--accent); text-decoration: underline; }
.lock .legal { margin-top: 28px; }
#update { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 40; width: calc(100% - 32px); max-width: 420px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface-2); border: 1px solid var(--accent); border-radius: 14px; padding: 10px 10px 10px 16px; box-shadow: 0 8px 28px rgba(0,0,0,.55); font-size: 14px; }
#update .btn { padding: 8px 14px; font-size: 13px; white-space: nowrap; }

.lock-sym { display: block; margin: 0 auto; border-radius: 50%; background: #fff; }
.lock-word { display: block; margin: 18px auto 0; max-width: 80%; height: auto; }
.lock-sub { font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: .3em; text-align: center; color: var(--muted); font-size: 14px; margin-top: 10px; }
.lock .install { margin-top: 12px; }
.install .btn { width: 100%; margin: 0; }
.lock .install .sub { margin-top: 4px; }
