/* Daily — „Tagesausgabe": Editorial/Print. Papier, Tinte, eine Akzentfarbe. */

:root {
  --paper: #f7f3ec;
  --ink: #1c1814;
  --ink-soft: #5f574d;
  --rule: #c9c0b2;
  --accent: #a32318;
  --paper-raised: #fffdf9;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Abendausgabe */
    --paper: #191613;
    --ink: #e9e3d8;
    --ink-soft: #a39588;
    --rule: #453e35;
    --accent: #d4574a;
    --paper-raised: #211d19;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: ui-serif, 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.55;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.sheet {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.25rem 1.1rem 3rem;
}

/* --- Masthead ------------------------------------------------------------ */

.masthead {
  text-align: center;
  border-bottom: 4px double var(--ink);
  padding: 0.75rem 0 0.8rem;
  margin-bottom: 1.4rem;
}

.brand {
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 0.42em;
  margin-right: -0.42em; /* optischer Ausgleich des letzten letter-spacing */
}

.dateline {
  margin-top: 0.3rem;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* --- Sektionen ------------------------------------------------------------ */

section { margin-bottom: 1.9rem; }

.kicker {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.3rem;
  margin-bottom: 0.9rem;
}

article { margin-bottom: 1.4rem; }
article:last-child { margin-bottom: 0; }

h2 { font-size: 1.35rem; line-height: 1.25; font-weight: 700; }

.meta { color: var(--ink-soft); font-size: 0.92rem; margin-top: 0.2rem; }

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  padding: 0.05rem 0.45rem;
}

.portions { font-style: italic; color: var(--ink-soft); font-size: 0.92rem; margin-top: 0.25rem; }

.empty { font-style: italic; color: var(--ink-soft); }

/* Steps / Markdown-Blöcke: Zeitungs-Beilage in Mono */
pre.steps, pre.md {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  background: var(--paper-raised);
  border-left: 2px solid var(--rule);
  padding: 0.7rem 0.8rem;
  margin: 0.6rem 0;
}

details { border-top: 1px solid var(--rule); }
details:last-of-type { border-bottom: 1px solid var(--rule); }

summary {
  cursor: pointer;
  padding: 0.55rem 0;
  font-weight: 600;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: ' +'; color: var(--accent); }
details[open] summary::after { content: ' −'; }

/* --- Übungen ---------------------------------------------------------------- */

.exercises { list-style: none; counter-reset: ex; }

.exercises li {
  counter-increment: ex;
  border-bottom: 1px solid var(--rule);
  padding: 0.6rem 0;
}
.exercises li:last-child { border-bottom: none; }

.ex-head::before {
  content: counter(ex) '.';
  color: var(--accent);
  font-weight: 700;
  margin-right: 0.45rem;
}

.ex-name { font-weight: 700; }
.ex-focus { color: var(--ink-soft); font-size: 0.88rem; margin-left: 0.4rem; font-style: italic; }
.ex-note { color: var(--ink-soft); font-size: 0.9rem; margin-top: 0.15rem; }

/* --- Ratings ------------------------------------------------------------------ */

.rate { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }

.thumb {
  font-size: 1.05rem;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  filter: grayscale(1);
  opacity: 0.65;
}
.thumb.on {
  border-color: var(--accent);
  background: var(--paper-raised);
  filter: none;
  opacity: 1;
}

.cbtn {
  background: none;
  border: none;
  font: inherit;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-decoration: underline;
  cursor: pointer;
}

.cbox { flex-basis: 100%; display: flex; gap: 0.5rem; align-items: flex-start; }
.cbox textarea { flex: 1; }

/* --- Habits ------------------------------------------------------------------- */

.habits { list-style: none; }
.habits li { border-bottom: 1px solid var(--rule); }
.habits li:last-child { border-bottom: none; }

.habits label {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0;
  cursor: pointer;
}

.habits input[type='checkbox'] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--accent);
}

/* --- Formulare ------------------------------------------------------------------ */

textarea, input[type='password'] {
  width: 100%;
  font: inherit;
  font-size: 16px; /* verhindert iOS-Zoom beim Fokus */
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  padding: 0.6rem;
}

textarea:focus, input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
}

.journal-row { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.6rem; }

.status { font-style: italic; color: var(--ink-soft); font-size: 0.9rem; }

.linklike {
  background: none;
  border: none;
  font: inherit;
  color: var(--ink-soft);
  text-decoration: underline;
  cursor: pointer;
}

/* --- Login ------------------------------------------------------------------------ */

.login { padding-top: 4rem; }
.login-form { max-width: 20rem; margin: 2rem auto 0; display: flex; flex-direction: column; gap: 0.8rem; }
.login-form label { font-weight: 600; }
.error { color: var(--accent); font-style: italic; }

/* --- Woche ------------------------------------------------------------------------- */

.wk-day { border-bottom: 1px solid var(--rule); padding: 0.8rem 0; }
.wk-day h2 { font-size: 1.05rem; }
.wk-day ul { list-style: none; margin-top: 0.3rem; color: var(--ink-soft); font-size: 0.95rem; }

/* --- Colophon / Banner / Toast --------------------------------------------------------- */

.colophon {
  border-top: 4px double var(--ink);
  margin-top: 2.2rem;
  padding-top: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}
.colophon a { color: var(--ink); }

.offline-banner {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--accent);
  color: #fff;
  text-align: center;
  font-size: 0.88rem;
  padding: 0.45rem 0.8rem;
}

.toast {
  position: fixed;
  bottom: calc(1.2rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  z-index: 20;
}

.hidden { display: none; }
