/* Titanenschmiede – Stil für amboss und pforte (Handy zuerst) */
:root {
  --background: #0E0F11; --text: #E8EAED; --text-muted: #9EA4AB; --rule: #25282C;
  --plate-top: #D6DADE; --plate-bottom: #BEC3C9; --raised: #D8DCE0; --sunken: #A9AFB6;
  --ink: #14161A; --ink-muted: #40464D; --line: #656C73;
  --graphit: #23262B; --on-graphit: #E8EAED; --erfolg: #24573A; --gefahr: #8A1C1C;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root { --background: #E6E8EB; --text: #14161A; --text-muted: #4A5057; --rule: #C4C9CF; color-scheme: light; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--background); color: var(--text); font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
h1, h2 { font-family: "Cinzel", "Trajan Pro", Georgia, serif; font-weight: 600; margin: 0 0 12px; }
h1 { font-size: 26px; line-height: 32px; }
h2 { font-size: 21px; line-height: 28px; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--rule); }
.wordmark { font-family: "Cinzel", Georgia, serif; font-weight: 600; font-size: 15px; letter-spacing: .08em; }
.bereich { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
.page { width: 100%; max-width: 720px; margin: 0 auto; padding: 16px 16px 32px; display: flex; flex-direction: column; gap: 20px; }
.foot { display: flex; justify-content: center; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); }

.muted { color: var(--text-muted); }
.klein { font-size: 14px; }
.abschnitt { margin: 8px 0 10px; color: var(--text); }

/* Silberne Platte */
.card, .eintrag { background: linear-gradient(180deg, var(--plate-top), var(--plate-bottom)); color: var(--ink); border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 1px 0 rgba(255,255,255,.55) inset, 0 2px 6px rgba(0,0,0,.28); }
.card { padding: 20px; }
.card .muted, .eintrag .muted { color: var(--ink-muted); }
.card.narrow { width: 100%; max-width: 440px; align-self: center; }

.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.form label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--graphit); }
input[type=email], input[type=text], input[type=password] {
  height: 48px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--raised); color: var(--ink); font: inherit; font-size: 16px; font-weight: 400; width: 100%;
}

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 6px; border: 1px solid #0E0F11; background: var(--graphit); color: var(--on-graphit); font: inherit; font-size: 16px; font-weight: 600; letter-spacing: .03em; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.button.zweit { background: var(--raised); color: var(--ink); border-color: var(--line); }
.button.gefahr { background: var(--gefahr); border-color: #4A0E0E; color: #FFFFFF; }
.link { background: none; border: 0; color: var(--text-muted); font: inherit; font-size: 14px; text-decoration: underline; min-height: 44px; padding: 0 12px; cursor: pointer; }

.meldung { margin: 0; padding: 12px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); font-size: 15px; }
.meldung.ok { border-left: 0; box-shadow: inset 4px 0 0 var(--erfolg); }
.meldung.fehler { box-shadow: inset 4px 0 0 var(--gefahr); }
.meldung.info { box-shadow: inset 4px 0 0 var(--line); }
.hinweis { padding: 12px; border-radius: 6px; background: var(--raised); }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 17px; letter-spacing: .04em; word-break: break-all; padding: 12px; border-radius: 6px; background: var(--raised); border: 1px solid var(--line); user-select: all; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stat { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: 8px; border: 1px solid var(--rule); font-size: 12px; }
.stat .zahl { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }

.liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.eintrag { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.eintrag.ist-pausiert { background: linear-gradient(180deg, #C4C9CF, #A9AFB6); }
.eintrag-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.eintrag-kopf strong { font-size: 17px; }
.badge { flex-shrink: 0; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; border-radius: 2px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); }
.badge.aktiv { background: var(--erfolg); border-color: var(--erfolg); color: #FFFFFF; }
.badge.pausiert { background: var(--graphit); border-color: var(--graphit); color: var(--on-graphit); }
.daten { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; font-size: 14px; }
.daten dt { color: var(--ink-muted); font-size: 12px; }
.daten dd { margin: 0; font-variant-numeric: tabular-nums; }
.aktionen { display: flex; gap: 8px; flex-wrap: wrap; }
.aktionen form { display: contents; }
.aktionen .button { flex: 1 1 140px; }

@media (min-width: 720px) {
  .top { padding: 18px 32px; }
  .page { padding: 32px 24px 48px; gap: 28px; }
  .card { padding: 28px; }
  h1 { font-size: 30px; line-height: 36px; }
}

/* ---------------- Palästra (App) ---------------- */
body.app { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.zentriert { text-align: center; }
.gruss { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.gruss h1 { font-size: 30px; line-height: 36px; margin: 0; }
.gruss .muted { margin: 4px 0 0; }
.eyebrow { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); }

.kachel { display: flex; flex-direction: column; gap: 14px; text-decoration: none; }
.kachel h2 { margin-bottom: 4px; }
.kachel p { margin: 0; }
.leise { background: transparent; color: var(--text); border-color: var(--rule); box-shadow: none; }
.leise .muted { color: var(--text-muted); }
progress.fortschritt { appearance: none; -webkit-appearance: none; width: 100%; height: 6px; border: 0; border-radius: 2px; background: var(--sunken); overflow: hidden; }
progress.fortschritt::-webkit-progress-bar { background: var(--sunken); }
progress.fortschritt::-webkit-progress-value { background: var(--graphit); }
progress.fortschritt::-moz-progress-bar { background: var(--graphit); }

/* Ethos-Formular */
.ethos { display: flex; flex-direction: column; gap: 16px; }
fieldset.card { margin: 0; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
legend + * { clear: both; }
.griechisch { font-family: "Cinzel", Georgia, serif; font-weight: 600; font-size: 24px; line-height: 30px; }
.deutsch { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); }
.ethos label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.ethos label .muted { font-weight: 400; }
.zweispaltig { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.einheit { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--raised); }
.einheit input { border: 0; background: transparent; min-width: 0; }
.einheit span { padding: 0 12px 0 4px; color: var(--ink-muted); font-weight: 400; }
.einheit:focus-within { outline: 2px solid var(--ink); outline-offset: 1px; }
.einheit input:focus-visible { outline: none; }
select, textarea {
  width: 100%; border-radius: 6px; border: 1px solid var(--line); background: var(--raised); color: var(--ink);
  font: inherit; font-size: 16px; font-weight: 400;
}
select { height: 48px; padding: 0 36px 0 12px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314161A' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
textarea { padding: 10px 12px; resize: vertical; min-height: 64px; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: #6A7078; }

.wahl { display: flex; flex-direction: column; gap: 8px; }
.ethos label.option { flex-direction: row; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--raised); cursor: pointer; font-weight: 400; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option span { display: flex; flex-direction: column; gap: 1px; }
.option strong { font-size: 16px; }
.option small { font-size: 13px; color: var(--ink-muted); }
.option::before { content: ""; flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); background: var(--plate-top); }
.option:has(input:checked) { background: var(--graphit); border-color: var(--graphit); color: var(--on-graphit); }
.option:has(input:checked) small { color: #B8BDC3; }
.option:has(input:checked)::before { border-color: var(--on-graphit); background: radial-gradient(circle, var(--on-graphit) 0 4px, transparent 5px); }
.option:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }

.verlauf { border-top: 1px solid var(--sunken); padding-top: 12px; }
.verlauf p { margin: 0 0 6px; }
.verlauf ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.verlauf li { display: grid; grid-template-columns: 1fr auto 56px; gap: 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
.verlauf .diff { text-align: right; color: var(--ink-muted); }

.speichern { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 2; }
.speichern .button { width: 100%; box-shadow: 0 6px 18px rgba(0,0,0,.35); }

/* Navigation unten */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--background); border-top: 1px solid var(--rule); }
.tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px;
  color: var(--text-muted); text-decoration: none; font: inherit; font-size: 12px; background: none; border: 0; cursor: pointer; width: 100%; }
.tabbar form { display: contents; }
.tabbar svg { width: 24px; height: 24px; }
.tabbar [aria-current="page"] { color: var(--text); font-weight: 600; }
body.app .foot { padding-bottom: 12px; }
.motto-de { margin: 0; font-size: 14px; font-style: italic; color: var(--text-muted); }
