:root {
  --bg: #f4f1ea;
  --karte: #ffffff;
  --text: #1d1f23;
  --leise: #6a6d73;
  --linie: #e4dfd4;
  --akzent: #c0631c;
  --akzent-weich: #f7e6d6;
  --gut: #2f7d4f;
  --schlecht: #b3372f;
  --warn-bg: #fff1d6;
  --warn-text: #7a4a00;
  --radius: 16px;
  --schatten: 0 1px 2px rgba(0, 0, 0, .05), 0 2px 10px rgba(0, 0, 0, .04);
  color-scheme: light dark;
}
body[data-typ="abend"] { --akzent: #4b52b8; --akzent-weich: #e5e6f7; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --karte: #1e2127;
    --text: #eceae6;
    --leise: #9a9ea6;
    --linie: #2d3139;
    --akzent: #f0995a;
    --akzent-weich: #3a2a1e;
    --gut: #5cc48a;
    --schlecht: #f0776d;
    --warn-bg: #3b2f14;
    --warn-text: #f3cf86;
    --schatten: none;
  }
  body[data-typ="abend"] { --akzent: #9aa0ff; --akzent-weich: #262a4a; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.kopf {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--linie);
  padding-top: env(safe-area-inset-top);
  margin-top: calc(-1 * env(safe-area-inset-top));
}
.kopf-zeile { display: flex; align-items: center; gap: 8px; max-width: 680px; margin: 0 auto; padding: 10px 16px; }
.kopf-titel { flex: 1; min-width: 0; text-align: center; }
.kopf h1 { font-size: 17px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stand { margin: 0; font-size: 12px; color: var(--leise); }
.nav {
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: transparent; color: var(--akzent); font-size: 30px; line-height: 1; cursor: pointer;
}
.nav:disabled { color: var(--linie); cursor: default; }

main { max-width: 680px; margin: 0 auto; padding: 12px 16px 8px; }
.laden, .fehler-box { text-align: center; color: var(--leise); padding: 48px 0; }
.fehler-box button { margin-top: 12px; }

.begruessung { font-size: 20px; font-weight: 600; margin: 8px 2px 14px; }
.banner {
  background: var(--warn-bg); color: var(--warn-text);
  border-radius: 12px; padding: 10px 14px; font-size: 14px; margin-bottom: 12px;
}

.karte {
  background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten);
  border: 1px solid var(--linie); margin-bottom: 12px; overflow: hidden;
}
.karte > summary {
  list-style: none; cursor: pointer; padding: 14px 16px;
  display: flex; align-items: center; gap: 10px; font-weight: 600;
}
.karte > summary::-webkit-details-marker { display: none; }
.karte > summary::after { content: "›"; margin-left: auto; color: var(--leise); transform: rotate(90deg); transition: transform .15s; font-size: 20px; }
.karte:not([open]) > summary::after { transform: rotate(0deg); }
.karte .zaehler {
  background: var(--akzent-weich); color: var(--akzent); font-size: 12px; font-weight: 700;
  border-radius: 999px; padding: 1px 8px;
}
.karte-inhalt { padding: 0 16px 14px; }
.karte.todo { border-color: var(--akzent); }

.gruppe { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--leise); margin: 12px 0 4px; font-weight: 700; }
.gruppe:first-child { margin-top: 0; }

ul.liste { list-style: none; margin: 0; padding: 0; }
ul.liste > li { padding: 10px 0; border-top: 1px solid var(--linie); display: flex; gap: 12px; align-items: flex-start; }
ul.liste > li:first-child { border-top: 0; }
.eintrag { flex: 1; min-width: 0; }
.eintrag .zeile1 { font-weight: 600; }
.eintrag .zeile2 { color: var(--leise); font-size: 14px; }
.eintrag .aktion { font-size: 14px; color: var(--akzent); margin-top: 2px; }
.eintrag .frist { font-variant-numeric: tabular-nums; }
li.erledigt .eintrag { opacity: .45; }
li.erledigt .eintrag .zeile1 { text-decoration: line-through; }

.haken {
  flex: none; width: 28px; height: 28px; margin-top: 1px; border-radius: 50%;
  border: 2px solid var(--linie); background: transparent; cursor: pointer; padding: 0;
  display: grid; place-items: center; color: transparent; font-size: 16px; font-weight: 700;
}
.haken[aria-pressed="true"] { background: var(--gut); border-color: var(--gut); color: #fff; }
.haken::before { content: "✓"; }

.zeit { flex: none; width: 52px; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--akzent); }
.zeit.ganz { font-size: 12px; font-weight: 700; text-transform: uppercase; padding-top: 2px; }
.marke { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 0 6px; margin-left: 6px; vertical-align: 1px; background: var(--akzent-weich); color: var(--akzent); }
.marke.arbeit { background: color-mix(in srgb, var(--leise) 18%, transparent); color: var(--leise); }

.wetter { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wetter-ort { border: 1px solid var(--linie); border-radius: 12px; padding: 10px 12px; }
.wetter-ort .ort { font-weight: 700; }
.wetter-ort .temp { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wetter-ort .temp small { font-size: 15px; color: var(--leise); font-weight: 600; }
.wetter-ort .txt { font-size: 14px; color: var(--leise); }
.warnung { background: var(--warn-bg); color: var(--warn-text); border-radius: 8px; padding: 4px 8px; font-size: 13px; margin-top: 6px; }
.tipp { font-size: 14px; margin-top: 6px; }
@media (max-width: 360px) { .wetter { grid-template-columns: 1fr; } }

.code-knopf {
  font: 600 14px ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .04em;
  border: 1px dashed var(--akzent); color: var(--akzent); background: var(--akzent-weich);
  border-radius: 8px; padding: 4px 10px; cursor: pointer; margin-top: 4px;
}

table.krypto { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.krypto th, table.krypto td { padding: 8px 0; border-top: 1px solid var(--linie); text-align: right; }
table.krypto tr:first-child th, table.krypto tr:first-child td { border-top: 0; }
table.krypto th { text-align: left; }
table.krypto thead th { font-size: 12px; color: var(--leise); font-weight: 600; border-top: 0; }
table.krypto thead th:not(:first-child) { text-align: right; }
.plus { color: var(--gut); }
.minus { color: var(--schlecht); }
.markt { font-size: 14px; color: var(--leise); margin-top: 10px; }
.text { margin: 8px 0 0; font-size: 15px; }

.leer { color: var(--leise); font-size: 15px; margin: 0; }
.fuss { text-align: center; padding: 4px 16px 28px; }
.link-knopf { background: none; border: 0; color: var(--akzent); font: inherit; font-size: 15px; padding: 10px; cursor: pointer; }
.schluss { text-align: center; color: var(--leise); margin: 16px 0 4px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 8px 16px; border-radius: 999px; font-size: 14px;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.zeigen { opacity: 1; }
