/* dailyletter — ruhige, warme Erdtöne. Eigenständig, nicht von kellerdota. */

:root {
  --bg:        #f7f1e7;
  --bg-soft:   #efe7d8;
  --card:      #fffdf7;
  --ink:       #2c2823;
  --ink-soft:  #4a423a;
  --muted:     #8a7e6f;
  --line:      #e3d8c3;
  --line-soft: #efe6d3;
  --accent:    #6f8d6a;       /* sage */
  --accent-d:  #557152;
  --warm:      #c08164;       /* terracotta — sparsam */
  --bad:       #b45a4a;
  --shadow:    0 1px 2px rgba(60, 50, 30, 0.04), 0 8px 24px rgba(60, 50, 30, 0.06);
  --radius:    14px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 {
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
}
h1 { font-size: 2.4rem; line-height: 1.15; margin: 0 0 .35em; }
h2 { font-size: 1.55rem; line-height: 1.2; margin: 0 0 .4em; }
h3 { font-size: 1.15rem; line-height: 1.25; margin: 0 0 .4em; }

a { color: var(--accent-d); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }

/* ── Layout ─────────────────────────────────────────────────── */

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 32px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg);
  position: sticky; top: 0; z-index: 5;
}
.brand {
  display: flex; align-items: baseline; gap: .35em;
  color: var(--ink);
  flex: 1; min-width: 0;
}
.brand-mark { font-family: 'EB Garamond', serif; font-size: 1.6rem; color: var(--accent); }
.brand-name { font-family: 'EB Garamond', serif; font-size: 1.25rem; font-style: italic; }
.brand-section {
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  font-style: italic;
  color: var(--muted);
  margin-left: .8em;
  padding-left: .8em;
  border-left: 1px solid var(--line);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
}
.brand-section.is-visible {
  opacity: 1;
  transform: translateY(0);
  max-width: 320px;
}
@media (max-width: 600px) {
  .brand-section { font-size: .85rem; margin-left: .5em; padding-left: .5em; }
  .brand-section.is-visible { max-width: 50vw; }
}
.nav { display: flex; gap: 22px; align-items: center; font-size: .95rem; }
.nav a { color: var(--ink-soft); }
.nav a.muted { color: var(--muted); font-size: .85rem; }

.page {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}

.page--wide { max-width: 1040px; }

.foot {
  text-align: center;
  color: var(--muted);
  font-size: .82rem;
  padding: 20px;
  border-top: 1px solid var(--line-soft);
}
.foot .dot { margin: 0 .5em; opacity: .5; }

/* ── Cards ──────────────────────────────────────────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.card h2 + p { margin-top: -.2em; color: var(--muted); font-size: .92rem; }

.lead {
  font-family: 'EB Garamond', serif;
  font-size: 1.18rem;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 1.4em;
}

/* ── Forms ──────────────────────────────────────────────────── */

label { display: block; font-size: .92rem; color: var(--ink-soft); margin-bottom: .35em; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }

input[type="email"], input[type="text"], input[type="number"], textarea, select {
  width: 100%;
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
  padding: 10px 13px;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(111, 141, 106, 0.15);
}
textarea { min-height: 140px; resize: vertical; line-height: 1.6; padding: 14px 16px; }

.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: var(--accent-d); text-decoration: none; }
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--bg-soft); color: var(--ink); }
.btn-danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: var(--bad); color: #fff; }

/* ── Likert / Scale Picker ─────────────────────────────────── */

.likert {
  margin: 14px 0 26px;
}
.likert-q {
  font-family: 'EB Garamond', serif;
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 10px;
}
.likert-scale {
  display: grid;
  grid-template-columns: repeat(var(--steps, 6), 1fr);
  gap: 6px;
}
.likert-step {
  position: relative;
}
.likert-step input { position: absolute; opacity: 0; pointer-events: none; }
.likert-step label {
  display: block;
  text-align: center;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  cursor: pointer;
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.25;
  transition: all .12s;
  margin: 0;
  min-height: 56px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.likert-step label .v { font-family: 'EB Garamond', serif; font-size: 1.1rem; color: var(--ink-soft); display: block; margin-bottom: 2px; }
.likert-step label:hover { border-color: var(--accent); color: var(--ink); }
.likert-step input:checked + label {
  background: var(--accent);
  border-color: var(--accent-d);
  color: #fff;
}
.likert-step input:checked + label .v { color: #fff; }

/* ── Tracking row (Schlaf/Wasser/...) ──────────────────────── */

.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
}
.track-tile {
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 14px 12px;
}
.track-tile--wide { grid-column: 1 / -1; }

/* Aufklappbare Sub-Bereiche (z.B. Akne ausführlich, Urtikaria Begleitsymptome) */
.sub-detail {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.sub-detail summary {
  cursor: pointer;
  color: var(--accent-d);
  font-size: .88rem;
  list-style: none;
}
.sub-detail summary::before { content: '▸ '; transition: transform .15s; display: inline-block; }
.sub-detail[open] summary::before { transform: rotate(90deg); }

.sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.sub-grid label { font-size: .82rem; color: var(--ink-soft); }
.sub-grid-wide { grid-column: 1 / -1; }

.sym-grid { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.sym-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.sym-lbl { color: var(--ink-soft); font-size: .9rem; flex: 1; }
.sym-pills { flex-shrink: 0; }
.sym-pills .toggle-pill { min-width: 38px; padding: 6px 10px; font-size: .82rem; }

@media (max-width: 480px) {
  .sub-grid { grid-template-columns: 1fr; }
  .sym-row { flex-direction: column; align-items: stretch; gap: 4px; }
}
.track-tile label { color: var(--ink-soft); font-weight: 500; }
.track-tile small { color: var(--muted); font-size: .78rem; }
.track-tile input, .track-tile select { padding: 7px 10px; }
.oura-hint {
  display: block; margin-top: 6px; font-size: .76rem;
  color: var(--accent-d);
  font-variant-numeric: tabular-nums;
}
.oura-hint.muted { color: var(--muted); }

/* Oura-Anzeige (read-only Werte direkt aus Oura) */
.oura-readout {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin-top: 6px;
}
.oura-readout--inline { margin-top: 8px; }
.oura-readout-num {
  font-family: 'EB Garamond', serif;
  font-size: 1.5rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.oura-readout-sub { color: var(--muted); font-size: .82rem; }
.oura-readout .link-btn { margin-left: auto; }

.manual-override { transition: opacity .15s; }
.manual-override[hidden] { display: none; }

.oura-status { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; font-size: .92rem; }
.oura-status .dot { width: 10px; height: 10px; border-radius: 50%; }
.oura-status .dot.ok  { background: var(--accent); }
.oura-status .dot.off { background: var(--muted); opacity: .4; }

.onboarding {
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 12px 16px;
}
.onboarding summary {
  cursor: pointer;
  color: var(--accent-d);
  font-weight: 500;
  list-style: none;
}
.onboarding summary::before { content: '▸ '; display: inline-block; transition: transform .15s; }
.onboarding[open] summary::before { transform: rotate(90deg); }
.onboarding ol { margin: 12px 0 4px; padding-left: 20px; line-height: 1.7; font-size: .92rem; }
.onboarding li { margin-bottom: 4px; }
.onboarding code {
  background: var(--card); padding: 1px 6px; border-radius: 4px;
  font-size: .85em; border: 1px solid var(--line);
}

.toggle-row { display: flex; gap: 8px; flex-wrap: wrap; }
.toggle-pill {
  flex: 1; min-width: 70px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-align: center;
  cursor: pointer;
  background: #fffefa;
  color: var(--muted);
  font-size: .85rem;
}
.toggle-pill input { display: none; }
.toggle-pill:hover { border-color: var(--accent); color: var(--ink); }
.toggle-pill.is-on, .toggle-row input:checked + .toggle-pill {
  background: var(--accent); border-color: var(--accent-d); color: #fff;
}

/* ── Score badges & banners ────────────────────────────────── */

.score-result {
  display: flex; align-items: baseline; gap: 14px;
  padding: 16px 20px;
  background: var(--bg-soft);
  border-radius: 10px;
  margin: 14px 0 8px;
}
.score-result .num { font-family: 'EB Garamond', serif; font-size: 2.3rem; color: var(--accent-d); }
.score-result .lbl { color: var(--ink-soft); }

.flash {
  padding: 12px 16px;
  border-radius: 8px;
  margin: 14px 0;
  background: #fff1ec;
  border: 1px solid #f4d4c5;
  color: #7a3722;
  font-size: .92rem;
}
.flash--ok { background: #eef4ed; border-color: #c8dcc4; color: var(--accent-d); }

.crisis {
  margin-top: 18px;
  padding: 14px 18px;
  border-left: 3px solid var(--bad);
  background: #fbf1ee;
  font-size: .92rem;
  color: #5e2a1f;
  border-radius: 4px;
}
.crisis a { color: #5e2a1f; text-decoration: underline; }

/* ── History / charts ──────────────────────────────────────── */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}
.kpi .v { font-family: 'EB Garamond', serif; font-size: 1.9rem; color: var(--ink); }
.kpi .l { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }

.chart-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; margin-bottom: 22px; box-shadow: var(--shadow); }
.chart-wrap h3 { margin-bottom: 14px; }
.chart-wrap canvas { width: 100% !important; height: 280px !important; }

/* GitHub-Heatmap */
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); gap: 3px; overflow-x: auto; padding-bottom: 8px; }
.heat-cell { width: 12px; height: 12px; border-radius: 3px; background: var(--line-soft); }
.heat-cell[data-l="1"] { background: #d8e4d6; }
.heat-cell[data-l="2"] { background: #aac6a3; }
.heat-cell[data-l="3"] { background: #84ad7a; }
.heat-cell[data-l="4"] { background: #5b8a55; }

.corr-list { list-style: none; padding: 0; margin: 0; }
.corr-list li {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.corr-list li:last-child { border-bottom: none; }
.corr-r { font-family: 'EB Garamond', serif; font-size: 1.15rem; color: var(--ink); }
.corr-r.pos { color: var(--accent-d); }
.corr-r.neg { color: var(--bad); }
.corr-meta { color: var(--muted); font-size: .82rem; }

/* ── Lists ─────────────────────────────────────────────────── */

/* Verlauf: Tagebuch-Einträge */
.journal-list {
  display: flex; flex-direction: column; gap: 16px;
  margin-top: 14px;
}
.je {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border-radius: 10px;
}
.je-date {
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  color: var(--ink-soft);
}
.je-text {
  white-space: pre-wrap;
  font-size: .95rem; line-height: 1.55;
  color: var(--ink-soft);
}
.je audio { width: 100%; height: 36px; }
.je-tr summary {
  cursor: pointer; color: var(--accent-d); font-size: .85rem;
  list-style: none;
}
.je-tr summary::before { content: '▸ '; transition: transform .15s; display: inline-block; }
.je-tr[open] summary::before { transform: rotate(90deg); }
.je-tr div {
  margin-top: 6px;
  font-style: italic; font-size: .9rem; color: var(--ink-soft);
  white-space: pre-wrap;
}

/* Fragebögen-Akkordeon */
.q-acc { display: flex; flex-direction: column; gap: 12px; }
.q-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow .15s;
}
.q-card[open] { box-shadow: var(--shadow); }
.q-card summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 4px;
  position: relative;
  user-select: none;
}
.q-card summary::-webkit-details-marker { display: none; }
.q-card summary::after {
  content: '+';
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; color: var(--muted);
  transition: transform .2s;
  line-height: 1;
}
.q-card[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.q-title {
  font-family: 'EB Garamond', serif; font-size: 1.15rem; color: var(--ink);
  padding-right: 28px;
}
.q-meta { color: var(--muted); font-size: .82rem; }
.q-last { color: var(--accent-d); margin-left: 4px; }
.q-card summary:hover { background: var(--bg-soft); }

.q-body {
  padding: 4px 20px 22px;
  border-top: 1px solid var(--line-soft);
}
.q-intro {
  font-family: 'EB Garamond', serif;
  font-size: 1.05rem; color: var(--ink-soft);
  margin: 14px 0 18px;
  line-height: 1.55;
}
.q-submit-row {
  display: flex; gap: 14px; align-items: center;
  margin-top: 8px;
}
.q-result { margin-top: 18px; }
.q-cta {
  text-align: center; margin: 28px 0 0;
  font-size: .88rem;
}

.q-list { list-style: none; padding: 0; margin: 0; }
.q-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line-soft);
}
.q-list li:last-child { border-bottom: none; }
.q-list .q-meta { color: var(--muted); font-size: .85rem; }

.soon-wrap {
  max-width: 540px; margin: 80px auto 0;
  text-align: center;
}
.soon-wrap h1 { margin-bottom: .2em; }
.soon-wrap .lead { font-size: 1.1rem; }
.soon-hint { margin-top: 22px; font-size: .85rem; }

/* Who-Auswahl */
.who-wrap { max-width: 520px; margin: 60px auto 0; text-align: center; }
.who-wrap h1 { margin-bottom: .15em; }
.who-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 28px;
}
.who-card {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 32px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  color: var(--ink);
  transition: all .15s;
  box-shadow: var(--shadow);
}
.who-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.who-avatar {
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px;
  background: var(--accent); color: #fff;
  border-radius: 50%;
  font-family: 'EB Garamond', serif; font-size: 1.6rem;
}
.who-name { font-family: 'EB Garamond', serif; font-size: 1.3rem; }

/* Topbar-User-Pill */
.who-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  background: var(--bg-soft);
  border-radius: 999px;
  font-size: .82rem;
  color: var(--ink-soft) !important;
}
.who-pill:hover { background: var(--card); text-decoration: none; }
.who-pill-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  background: var(--accent); color: #fff;
  border-radius: 50%;
  font-family: 'EB Garamond', serif; font-size: .85rem;
}

/* ── Tagebuch ─────────────────────────────────────────────── */

/* Eingabefeld + Diktier-Mic gehören sichtbar zusammen */
.journal-input {
  position: relative;
  margin-top: 8px;
}
.journal-input textarea {
  padding-bottom: 48px; /* Platz für den Mic-Button unten rechts */
}
.journal-mic {
  position: absolute;
  right: 8px; bottom: 8px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 8px;
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font: inherit; font-size: .82rem;
  cursor: pointer;
  transition: all .15s;
  z-index: 1;
}
.journal-mic:hover { border-color: var(--accent); color: var(--ink); }
.journal-mic.is-active {
  background: var(--bad); border-color: var(--bad); color: #fff;
  animation: rec-pulse 1.2s infinite;
}
.journal-mic.is-active .jm-label::before {
  content: '● ';
}
.journal-mic[disabled] { opacity: .4; cursor: not-allowed; }

@media (hover: none) {
  .journal-mic { padding: 8px 14px 8px 10px; min-height: 38px; }
}

/* visueller Trenner zwischen Schreibfeld und Sprachnotiz */
.journal-or {
  display: flex; align-items: center; gap: 14px;
  margin: 18px 0 12px;
  color: var(--muted); font-size: .82rem;
  text-transform: uppercase; letter-spacing: .08em;
}
.journal-or::before, .journal-or::after {
  content: ''; flex: 1; height: 1px; background: var(--line-soft);
}
.rec-start-pill {
  /* eigenständig prominent, anders als Diktier-Mic */
}

.journal-toolbar {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin: 6px 0 14px;
}
.iconbtn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 16px;
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font: inherit; font-size: .9rem;
  cursor: pointer;
  min-height: 42px;
  transition: all .15s;
}
.iconbtn:hover { border-color: var(--accent); color: var(--ink); }
.iconbtn svg { flex-shrink: 0; }
.iconbtn.is-active { background: var(--accent); border-color: var(--accent-d); color: #fff; }
.iconbtn--accent {
  background: var(--accent); border-color: var(--accent-d); color: #fff;
}
.iconbtn--accent:hover {
  background: var(--accent-d); border-color: var(--accent-d); color: #fff;
}
.iconbtn--ok  { color: var(--accent-d); }
.iconbtn--ok:hover  { background: var(--accent); border-color: var(--accent-d); color: #fff; }
.iconbtn--bad { color: var(--bad); }
.iconbtn--bad:hover { background: var(--bad); border-color: var(--bad); color: #fff; }

/* ── Audio-Recorder ────────────────────────────────────────── */

.rec {
  user-select: none;
  margin-top: 0;
}
.rec .rec-active { display: none; }
.rec[data-state="recording"] .rec-start-pill,
.rec[data-state="paused"]    .rec-start-pill { display: none; }
.rec[data-state="recording"] .rec-active,
.rec[data-state="paused"]    .rec-active { display: flex; }

/* Active: Karten-Bar mit Meter links + Aktionen rechts */
.rec-active {
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: #fff5f1;
  border: 1px solid #f1c8b8;
  border-radius: 14px;
}
.rec-meter {
  display: inline-flex; align-items: center; gap: 10px;
  flex: 1; min-width: 140px;
}
.rec-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bad); flex-shrink: 0;
  animation: rec-pulse 1.2s infinite;
}
.rec-time {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: 1rem;
  color: var(--ink);
  min-width: 42px;
}
.rec-status { color: var(--muted); font-size: .85rem; }
.rec[data-state="paused"] .rec-active { background: var(--bg-soft); border-color: var(--line); }
.rec[data-state="paused"] .rec-dot { animation: none; opacity: .35; }
.rec[data-state="paused"] .rec-time { color: var(--muted); }

/* Action-Buttons */
.rec-actions {
  display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.rec-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fffefa;
  color: var(--ink-soft);
  font: inherit; font-size: .88rem;
  cursor: pointer;
  min-height: 40px;
  transition: all .15s;
}
.rec-btn:hover { background: var(--card); color: var(--ink); }
.rec-btn--ghost:hover { border-color: var(--accent); color: var(--ink); }
.rec-btn--primary {
  background: var(--accent); border-color: var(--accent-d); color: #fff;
}
.rec-btn--primary:hover { background: var(--accent-d); }
#recCancel:hover { border-color: var(--bad); color: var(--bad); }

@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(180, 90, 74, 0.45); }
  50%      { box-shadow: 0 0 0 8px rgba(180, 90, 74, 0); }
}

@media (max-width: 480px) {
  .rec-active { padding: 12px; gap: 12px; }
  .rec-actions { width: 100%; }
  .rec-btn { flex: 1; justify-content: center; padding: 10px 8px; font-size: .85rem; }
  .rec-btn span:not(:empty) { white-space: nowrap; }
}

.audio-wrap {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border-radius: 12px;
}
.audio-wrap audio {
  width: 100%;
  height: 38px;
  display: block;
}
.audio-actions {
  display: flex; gap: 18px; flex-wrap: wrap;
  margin-top: 10px;
  justify-content: flex-end;
}
.link-btn {
  background: none; border: none; padding: 0;
  font: inherit; font-size: .85rem;
  color: var(--accent-d);
  cursor: pointer;
  text-decoration: none;
}
.link-btn:hover { text-decoration: underline; }
.link-btn--bad { color: var(--bad); }
.btn-small { padding: 7px 14px; font-size: .85rem; }

.iconbtn:disabled, .iconbtn.is-locked {
  opacity: 0.4; cursor: not-allowed;
}

.transcript-box {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border-left: 3px solid var(--line);
  border-radius: 6px;
  font-size: .92rem;
  color: var(--ink-soft);
  line-height: 1.55;
  font-style: italic;
  white-space: pre-wrap;
}

/* ── Responsive ─────────────────────────────────────────────── */

/* Snap-Pagination auf Mobile: jede Card = eine "Page" */
@media (max-width: 720px) {
  body.snap-pages {
    height: 100dvh;
    overflow: hidden;
    display: flex; flex-direction: column;
  }
  body.snap-pages main.page {
    flex: 1; min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-snap-type: y mandatory;
    padding: 0;
    max-width: 100%;
  }
  body.snap-pages main.page > section.card {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    min-height: 100%;
    margin: 0;
    border-radius: 0;
    border-left: none; border-right: none;
    box-shadow: none;
    box-sizing: border-box;
    padding: 26px 18px 36px;
    display: flex; flex-direction: column;
  }
  body.snap-pages main.page > section.card + section.card {
    border-top: 1px solid var(--line-soft);
  }
  body.snap-pages footer.foot { display: none; }

  /* Page-Punkte rechts */
  body.snap-pages .page-dots {
    position: fixed; right: 6px; top: 50%; transform: translateY(-50%);
    display: flex; flex-direction: column; gap: 7px;
    z-index: 4;
    padding: 6px 4px;
  }
  .page-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--line);
    border: none; padding: 0;
    transition: all .2s;
    cursor: pointer;
  }
  .page-dot.is-active { background: var(--accent); transform: scale(1.6); }
}
.page-dots { display: none; }
@media (max-width: 720px) { body.snap-pages .page-dots { display: flex; } }

/* Save-Card prominent */
.card--save { text-align: left; }
.btn-large { padding: 14px 28px; font-size: 1rem; min-width: 180px; }

@media (max-width: 720px) {
  .topbar { padding: 12px 16px; }
  .nav { gap: 16px; font-size: .9rem; }
  .page { padding: 24px 16px 60px; }
  .card { padding: 20px 18px; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.35rem; }

  /* Likert: bei vielen Stufen Labels kleiner und Werte prominenter machen */
  .likert-step label { padding: 8px 4px; font-size: .68rem; min-height: 56px; }
  .likert-step label .v { font-size: 1.05rem; }

  .score-result .num { font-size: 1.9rem; }
  .kpi .v { font-size: 1.6rem; }
  .chart-wrap { padding: 16px; }
  .chart-wrap canvas { height: 240px !important; }
}

@media (max-width: 480px) {
  .topbar { padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
  .brand-name { font-size: 1.1rem; }
  .nav { width: 100%; justify-content: space-between; gap: 4px; }
  .nav a { font-size: .82rem; }
  .nav a.muted { font-size: .78rem; }

  .page { padding: 18px 12px 50px; }
  .card { padding: 18px 14px; border-radius: 10px; }
  h1 { font-size: 1.55rem; }
  h2 { font-size: 1.2rem; }

  /* WHO-5 hat 6 Likert-Stufen — auf Mobile zu eng. Stapeln. */
  .likert-scale { grid-template-columns: 1fr 1fr 1fr; }

  .track-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .track-tile { padding: 12px; }

  .kpi-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi .v { font-size: 1.4rem; }

  .chart-wrap canvas { height: 220px !important; }

  .iconbtn { padding: 10px 14px; font-size: .85rem; min-height: 44px; }
  .audio-wrap audio { width: 100%; flex-basis: 100%; }
}

/* Touch-Targets generell groß genug */
@media (hover: none) {
  .toggle-pill, .iconbtn, .btn { min-height: 44px; }
  .likert-step label { min-height: 60px; }
}
