:root {
  --bg: #f6f5f2; --fg: #1d1d1b; --muted: #5f5f58; --card: #ffffff; --line: #dcdad2;
  --rot: #b3261e; --gelb: #9a6700; --accent: #1f4fd1; --accent-fg: #ffffff; --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211; --fg: #ecebe6; --muted: #a3a29a; --card: #1c1c1a; --line: #33332f;
    --rot: #ff8a80; --gelb: #f2c14e; --accent: #8fb0ff; --accent-fg: #0b1633;
  }
}
:root[data-theme="dark"] {
  --bg: #121211; --fg: #ecebe6; --muted: #a3a29a; --card: #1c1c1a; --line: #33332f;
  --rot: #ff8a80; --gelb: #f2c14e; --accent: #8fb0ff; --accent-fg: #0b1633;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
body.stale main { filter: saturate(0.15); opacity: 0.75; }
header { position: sticky; top: 0; z-index: 2; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
header h1 { font-size: 1rem; margin: 0; }
nav { display: flex; gap: 4px; }
nav button { min-height: 44px; padding: 0 14px; border: 0; background: none; color: var(--muted); font: inherit; border-bottom: 3px solid transparent; cursor: pointer; }
nav button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--fg); font-weight: 600; }
.strip { padding: 8px 16px; font-weight: 600; border-bottom: 1px solid var(--line); }
.strip.offline { background: repeating-linear-gradient(135deg, transparent 0 8px, var(--line) 8px 16px); }
main { padding: 16px; max-width: 1400px; margin: 0 auto; }
section[hidden] { display: none; }
h2 { font-size: 0.95rem; margin: 20px 0 8px; color: var(--muted); font-weight: 600; }
h2 small { font-weight: 400; margin-left: 8px; }
.card, .row { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.card.rot, .row.rot { border-left-color: var(--rot); }
.card.gelb, .row.gelb { border-left-color: var(--gelb); }
.card h3 { margin: 0 0 4px; font-size: 1rem; }
.task { color: var(--muted); font-weight: 400; margin-right: 6px; }
.grund { margin: 4px 0; font-size: 0.9rem; }
.grund.rot { color: var(--rot); font-weight: 600; }
.grund.gelb { color: var(--gelb); font-weight: 600; }
.schritt { margin: 6px 0 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
button.act { min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--fg); font: inherit; cursor: pointer; }
button.act.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
button.act:focus-visible, nav button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pending { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.bar { height: 10px; background: var(--line); border-radius: 5px; margin: 6px 0; overflow: hidden; }
.fill { position: relative; height: 100%; background: var(--fg); border-radius: 5px; }
.fill::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 6px; background: var(--accent); animation: puls 1.4s ease-in-out infinite; }
.fill.over { background: var(--rot); }
.fill.still { background: repeating-linear-gradient(135deg, var(--muted) 0 6px, transparent 6px 12px); }
.fill.still::after { animation: none; }
@keyframes puls { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .fill::after { animation: none; } }
.muted { color: var(--muted); font-size: 0.9rem; }
.leer { color: var(--muted); padding: 8px 0; }
.chip { display: block; margin: 6px 0; font-size: 0.9rem; }
.chip .bar { height: 6px; }
a { color: var(--accent); }
.login { max-width: 420px; margin: 20vh auto 0; padding: 16px; }
.login button { width: 100%; }
#msg { margin-top: 12px; min-height: 1.4em; }
@media (min-width: 960px) {
  nav { display: none; }
  main { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
  section[hidden] { display: block; }
}
input { min-height: 44px; width: 100%; padding: 0 10px; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); }
