/* LiveStory – Stylesheet (mobile first, hell/dunkel, ohne externe Ressourcen) */

:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --surface-2: #f3eee6;
  --text: #1d2433;
  --muted: #5b6475;
  --primary: #1f2a44;
  --primary-contrast: #ffffff;
  --accent: #d9661a;
  --accent-soft: #fbe7d6;
  --border: #e4ddd2;
  --danger: #b3261e;
  --danger-soft: #fbe3e1;
  --success: #2e7d4f;
  --success-soft: #e0f2e7;
  --warning: #8a5a00;
  --warning-soft: #fff1d1;
  --info-soft: #e5ecf8;
  --shadow: 0 1px 2px rgb(20 25 40 / 6%), 0 4px 16px rgb(20 25 40 / 6%);
  --radius: 14px;
  --radius-small: 8px;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-read: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --reader-size: 1.15rem;
  --topbar-h: 60px;
  --bottomnav-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151c;
    --surface: #1b2029;
    --surface-2: #232937;
    --text: #e8e6e1;
    --muted: #a3a9b5;
    --primary: #a9bbe6;
    --primary-contrast: #12151c;
    --accent: #f0a050;
    --accent-soft: #3a2a1c;
    --border: #2f3644;
    --danger: #ff8a80;
    --danger-soft: #3b1f1f;
    --success: #7fd3a0;
    --success-soft: #17301f;
    --warning: #f5c26b;
    --warning-soft: #352a12;
    --info-soft: #1e2a40;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 4px 16px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #12151c;
  --surface: #1b2029;
  --surface-2: #232937;
  --text: #e8e6e1;
  --muted: #a3a9b5;
  --primary: #a9bbe6;
  --primary-contrast: #12151c;
  --accent: #f0a050;
  --accent-soft: #3a2a1c;
  --border: #2f3644;
  --danger: #ff8a80;
  --danger-soft: #3b1f1f;
  --success: #7fd3a0;
  --success-soft: #17301f;
  --warning: #f5c26b;
  --warning-soft: #352a12;
  --info-soft: #1e2a40;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 4px 16px rgb(0 0 0 / 30%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
}

img { max-width: 100%; height: auto; }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4.5vw, 2.3rem); letter-spacing: -.01em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .9em; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 4px; font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--border); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--primary); color: var(--primary-contrast); padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 1rem 16px 2rem; flex: 1; }
.narrow { max-width: 560px; margin: 0 auto; }
.narrow-wide { max-width: 760px; margin: 0 auto; }
.wide-form { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.1rem; color: var(--muted); }
.accent { color: var(--accent); }

/* --- Kopfzeile ---------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner { max-width: 1120px; margin: 0 auto; height: var(--topbar-h); display: flex; align-items: center; gap: .5rem; padding: 0 16px; }
.brand { flex: none; }
.topbar .topbar-login, .topbar .install-btn { display: none; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 750; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.brand img { border-radius: 8px; }
.topnav { display: none; gap: 1.2rem; }
.topnav a { color: var(--text); text-decoration: none; font-weight: 550; }
.topnav a:hover { color: var(--accent); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

.icon-btn { background: transparent; border: 1px solid transparent; color: var(--text); border-radius: 999px; min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font: inherit; font-weight: 650; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:disabled { opacity: .35; cursor: default; }

.user-menu { position: relative; }
.user-menu summary { list-style: none; width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: var(--primary-contrast); display: flex; align-items: center; justify-content: center; font-weight: 700; cursor: pointer; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu-panel { position: absolute; right: 0; top: 48px; min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: .5rem; display: flex; flex-direction: column; z-index: 40; }
.user-menu-panel a, .user-menu-panel .linklike { padding: .55rem .75rem; border-radius: var(--radius-small); color: var(--text); text-decoration: none; text-align: left; }
.user-menu-panel a:hover, .user-menu-panel .linklike:hover { background: var(--surface-2); }
.user-menu-name { font-weight: 700; padding: .4rem .75rem; margin: 0; border-bottom: 1px solid var(--border); }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; width: 100%; }

/* --- Navigation unten (App-Gefühl auf dem Handy) ------------------------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--border);
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; }
.bottomnav svg { width: 24px; height: 24px; fill: currentColor; }
.bottomnav a.active { color: var(--accent); }

@media (min-width: 860px) {
  body { padding-bottom: 0; }
  .bottomnav { display: none; }
  .topnav { display: flex; }
  .topbar-inner { gap: 1rem; }
  .topbar .topbar-login, .topbar .install-btn { display: inline-flex; }
}
@media (max-width: 859px) {
  /* Auf dem Handy übernimmt die untere Leiste Anmelden; Installation über den Hinweis */
  .topbar .install-btn { display: inline-flex; min-height: 34px; padding: .25rem .7rem; font-size: .82rem; }
}

/* --- Buttons ------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .6rem 1.15rem; border-radius: 999px; border: 1px solid var(--primary); background: var(--primary); color: var(--primary-contrast); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; transition: transform .05s ease, background .15s ease; }
.btn:hover { color: var(--primary-contrast); filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--surface-2); color: var(--primary); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-small { min-height: 36px; padding: .35rem .85rem; font-size: .9rem; }
.btn-block { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.danger-link { color: var(--danger); }

/* --- Karten, Hinweise --------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.flashes { margin-bottom: 1rem; display: grid; gap: .5rem; }
.flash { padding: .75rem 1rem; border-radius: var(--radius-small); background: var(--info-soft); border: 1px solid var(--border); }
.flash-success { background: var(--success-soft); }
.flash-error { background: var(--danger-soft); }
.warning-box { background: var(--warning-soft); border-radius: var(--radius-small); padding: .75rem 1rem; }
.success-box { background: var(--success-soft); border-radius: var(--radius-small); padding: .75rem 1rem; }
.offline-banner { background: var(--warning-soft); padding: .5rem 1rem; border-radius: var(--radius-small); margin-bottom: 1rem; }
.empty { text-align: center; padding: 2.5rem 1rem; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); }
.install-hint { display: flex; gap: .5rem; align-items: center; justify-content: space-between; background: var(--accent-soft); padding: .6rem 16px; }
.install-hint p { margin: 0; font-size: .9rem; }

.chip { display: inline-block; padding: .12rem .6rem; border-radius: 999px; background: var(--accent-soft); color: var(--text); font-size: .78rem; font-weight: 600; vertical-align: middle; }
.chip-muted { background: var(--surface-2); color: var(--muted); }
.chip-bad { background: var(--danger-soft); color: var(--danger); }
.status { display: inline-block; padding: .1rem .55rem; border-radius: 6px; font-size: .78rem; font-weight: 650; background: var(--surface-2); color: var(--muted); }
.status-ok { background: var(--success-soft); color: var(--success); }
.status-pending { background: var(--warning-soft); color: var(--warning); }
.status-bad { background: var(--danger-soft); color: var(--danger); }

/* --- Altersfreigabe-Badges (FSK-Farben) ---------------------------------- */
.rating { display: inline-flex; align-items: baseline; justify-content: center; gap: 1px; min-width: 2.4em; height: 2.4em; padding: 0 .3em; border-radius: 6px; font-weight: 800; font-size: .95rem; line-height: 2.4em; border: 2px solid transparent; vertical-align: middle; }
.rating-ab { font-size: .55em; font-weight: 700; margin-right: 1px; }
.rating-0 { background: #fff; color: #111; border-color: #111; }
.rating-6 { background: #f7d117; color: #111; }
.rating-12 { background: #00a651; color: #fff; }
.rating-16 { background: #0071bc; color: #fff; }
.rating-18 { background: #e2001a; color: #fff; }
.rating-small { font-size: .72rem; }
.rating-large { font-size: 1.5rem; border-radius: 10px; }

/* --- Startseite ---------------------------------------------------------- */
.hero { display: grid; gap: 1.5rem; padding: 1.5rem 0 1rem; }
.hero h1 { font-size: clamp(2rem, 7vw, 3.2rem); }
.hero-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.hero-points li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; display: grid; gap: .15rem; }
.hero-points span { color: var(--muted); font-size: .92rem; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.3fr 1fr; align-items: center; padding: 3rem 0 2rem; } }

.section { margin: 2rem 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.page-head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.age-note { margin-top: 1rem; }

.poll-teasers { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.poll-teaser { display: grid; gap: .35rem; padding: 1rem; background: var(--accent-soft); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.poll-teaser:hover { color: var(--text); outline: 2px solid var(--accent); }
.poll-teaser-story { font-size: .85rem; color: var(--muted); }

/* --- Geschichten-Karten -------------------------------------------------- */
.story-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.story-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .12s ease; }
.story-card:hover { transform: translateY(-2px); }
.story-card-link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.story-card-link:hover { color: inherit; }
.story-card .cover { aspect-ratio: 3 / 2; width: 100%; object-fit: cover; }
.story-card-body { padding: .8rem 1rem 1rem; display: grid; gap: .35rem; }
.story-card-meta { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.story-card-title { margin: 0; font-size: 1.1rem; }
.story-card-author { margin: 0; color: var(--muted); font-size: .85rem; }
.story-card-summary { margin: 0; color: var(--muted); font-size: .9rem; }

.cover { display: block; background: var(--surface-2); border-radius: 0; object-fit: cover; }
.cover-placeholder { display: flex; align-items: center; justify-content: center; aspect-ratio: 3 / 2; color: rgb(255 255 255 / 90%); font-family: var(--font-read); font-size: 3rem; font-weight: 700; }
.cover-hue-0 { background: linear-gradient(135deg, #1f2a44, #3e5c8a); }
.cover-hue-1 { background: linear-gradient(135deg, #7a2e1d, #d9661a); }
.cover-hue-2 { background: linear-gradient(135deg, #1d5e4a, #4aa57d); }
.cover-hue-3 { background: linear-gradient(135deg, #4b2a6b, #9561b8); }
.cover-hue-4 { background: linear-gradient(135deg, #6b5a1d, #c9a43a); }
.cover-hue-5 { background: linear-gradient(135deg, #2b3a4a, #6b8aa6); }
.cover-large { width: 100%; max-width: 360px; aspect-ratio: 3 / 2; border-radius: var(--radius); object-fit: cover; }

/* --- Filter / Formulare ------------------------------------------------- */
.filters { display: grid; gap: .6rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .filters { grid-template-columns: 2fr repeat(4, 1fr) auto; align-items: center; } }

.form { display: grid; gap: .55rem; }
.form label { font-weight: 600; font-size: .92rem; }
input[type="text"], input[type="email"], input[type="search"], input[type="date"], input[type="datetime-local"], input[type="file"], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-small); padding: .6rem .75rem; min-height: 44px;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 500 !important; }
.check input { width: 20px; height: 20px; margin-top: .15rem; flex: none; accent-color: var(--accent); }
.hint { color: var(--muted); font-size: .85rem; margin: -.2rem 0 .3rem; }
.field-error { color: var(--danger); font-size: .88rem; margin: -.2rem 0 .3rem; font-weight: 600; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-small); padding: .8rem 1rem; margin: .5rem 0; }
legend { font-weight: 700; padding: 0 .3rem; }
.grid-2 { display: grid; gap: .8rem; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.descriptor-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: .5rem; }
.descriptor-grid label { display: grid; gap: .25rem; font-size: .85rem; }
.radio-row { border: 0; padding: 0; margin: 0; display: grid; gap: .35rem; }
.inline-form { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.inline-form input[type="text"] { flex: 1; min-width: 140px; }
.stack { display: grid; gap: .5rem; }
.publish-box .button-row { margin-top: .5rem; }

/* --- Anmeldung ------------------------------------------------------------ */
.mail-illustration { font-size: 3rem; margin: 1rem 0 0; }
.match-code { text-align: center; max-width: 280px; margin: 1rem auto; }
.match-code p { margin: 0; }
.match-code-value { font-size: 2.6rem; font-weight: 800; letter-spacing: .1em; color: var(--accent); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0 0 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.confirm-card .match-code-value { font-size: 1.6rem; }
.code-input { font-size: 1.8rem; letter-spacing: .4em; text-align: center; max-width: 9rem; }
.confirm-alt { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--border); }

/* --- Geschichte ----------------------------------------------------------- */
.story-head { display: grid; gap: 1.25rem; margin-bottom: 1.5rem; }
@media (min-width: 760px) { .story-head { grid-template-columns: 360px 1fr; align-items: start; } }
.story-meta { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.story-author { color: var(--muted); }
.summary { font-family: var(--font-read); font-size: 1.05rem; }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.story-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.two-col { display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .two-col { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }

.chapter-list { list-style: none; padding: 0; margin: 0; counter-reset: ch; display: grid; gap: .5rem; }
.chapter-list li { counter-increment: ch; }
.chapter-list a { display: grid; gap: .1rem; padding: .85rem 1rem .85rem 3rem; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-small); color: var(--text); text-decoration: none; }
.chapter-list a::before { content: counter(ch); position: absolute; left: 1rem; top: .85rem; font-weight: 800; color: var(--accent); }
.chapter-list a:hover { border-color: var(--accent); }
.chapter-title { font-weight: 650; }

.rating-panel-head { display: flex; gap: .9rem; align-items: center; margin-bottom: .6rem; }
.rating-panel-head h2 { margin: 0 0 .2rem; font-size: 1.1rem; }
.rating-panel-head p { margin: 0; }
.rating-sources summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.rating-breakdown { padding-left: 1.1rem; }
.descriptors { list-style: none; padding: 0; margin: .4rem 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.descriptor { background: var(--surface-2); border-radius: 999px; padding: .15rem .65rem; font-size: .8rem; }
.descriptor em { font-style: normal; color: var(--muted); }
.descriptor.level-3, .descriptor.level-4 { background: var(--danger-soft); }
.descriptor.level-2 { background: var(--warning-soft); }
.rating-legend { list-style: none; padding: 0; display: grid; gap: .6rem; }
.rating-legend li { display: flex; gap: .8rem; align-items: center; }

/* --- Lesemodus ----------------------------------------------------------- */
.reader-container { width: 100%; max-width: 760px; margin: 0 auto; padding: .5rem 18px 2rem; flex: 1; }
.reader-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top)); background: var(--bg); padding: .4rem 0; z-index: 5; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.reader-back { font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-tools { display: flex; gap: .2rem; }
.chapter-head h1 { font-family: var(--font-read); font-size: clamp(1.7rem, 5vw, 2.4rem); }
.chapter-body { font-family: var(--font-read); font-size: var(--reader-size); line-height: 1.75; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
[data-reader-font="sans"] .chapter-body { font-family: var(--font-ui); }
.chapter-body p { margin: 0 0 1.1em; }
.chapter-body h3 { font-family: var(--font-ui); margin-top: 2rem; }
.chapter-body blockquote { margin: 1.2em 0; padding: .2em 1.2em; border-left: 3px solid var(--accent); color: var(--muted); }
.scene-break { border: 0; text-align: center; margin: 2rem 0; }
.scene-break::after { content: "⁂"; color: var(--muted); font-size: 1.3rem; }
.story-figure { margin: 1.5rem 0; text-align: center; }
.story-figure img { border-radius: var(--radius-small); }
.story-figure figcaption { color: var(--muted); font-size: .88rem; margin-top: .4rem; }
.author-note { background: var(--surface-2); padding: 1rem; border-radius: var(--radius-small); font-size: .95rem; margin-top: 2rem; }
.choice-banner { background: var(--accent-soft); padding: .6rem .9rem; border-radius: var(--radius-small); font-size: .95rem; }
.chapter-nav { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin: 2rem 0 1rem; }
.reader-footer { text-align: center; color: var(--muted); }

/* --- Abstimmungen -------------------------------------------------------- */
.poll { border: 2px solid var(--accent); margin-top: 2rem; }
.poll-label { color: var(--accent); font-weight: 750; text-transform: uppercase; font-size: .8rem; letter-spacing: .06em; margin: 0; }
.poll-form { display: grid; gap: .5rem; }
.poll-option { display: flex; gap: .7rem; align-items: center; padding: .75rem .9rem; border: 1px solid var(--border); border-radius: var(--radius-small); cursor: pointer; background: var(--surface); }
.poll-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.poll-option input { width: 20px; height: 20px; accent-color: var(--accent); }
.poll-results { display: grid; gap: .7rem; margin-top: 1rem; }
.poll-result-label { display: flex; justify-content: space-between; gap: .5rem; font-size: .95rem; }
.poll-result.chosen .poll-result-label { font-weight: 750; }
progress { width: 100%; height: 12px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }

/* --- Autor:innen-Bereich ------------------------------------------------- */
.author-stories, .library-list, .device-list, .task-list, .image-review, .author-chapters, .flag-list, .event-list, .analysis-list, .feedback-list, .link-list { list-style: none; padding: 0; margin: 0; }
.author-story, .library-item { display: grid; grid-template-columns: 96px 1fr; gap: 1rem; align-items: center; }
.author-story .cover, .library-item .cover { width: 96px; aspect-ratio: 3/2; border-radius: var(--radius-small); font-size: 1.6rem; }
.author-story h2, .library-item h2 { font-size: 1.1rem; margin: .2rem 0; }
.author-story.is-indexed { border-color: var(--danger); }
.author-chapter { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .7rem .9rem; }
.author-chapter p { margin: .2rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.author-chapter-actions { display: flex; gap: .15rem; }
.index-banner { border: 2px solid var(--danger); background: color-mix(in srgb, var(--danger-soft) 60%, var(--surface)); }
.flag { border-left: 4px solid var(--warning); background: var(--surface); padding: .6rem .8rem; border-radius: 0 var(--radius-small) var(--radius-small) 0; margin-bottom: .6rem; }
.flag-high { border-left-color: var(--danger); }
.flag-low { border-left-color: var(--muted); }
.flag-closed { opacity: .6; }
.flag-head { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .3rem; }
.flag-excerpt { margin: .4rem 0; padding: .4rem .7rem; background: var(--surface-2); border-radius: 6px; font-family: var(--font-read); font-size: .95rem; }
.editor-toolbar { display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; }
.editor-toolbar button { min-width: 38px; height: 36px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 6px; cursor: pointer; font: inherit; }
.editor-toolbar button:hover { border-color: var(--accent); }
.editor-count { margin-left: auto; }
.chapter-editor textarea[data-editor] { font-family: var(--font-read); font-size: 1.05rem; min-height: 50vh; }
.image-list { list-style: none; padding: 0; display: grid; gap: .75rem; }
.image-list li { display: grid; grid-template-columns: 96px 1fr; gap: .75rem; align-items: start; }
.image-list img { border-radius: 6px; }
.copyable { cursor: copy; }
.danger-zone { border-color: var(--danger); }
.inline-confirm { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

/* --- Moderation ---------------------------------------------------------- */
.subnav, .tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.subnav a, .tabs a { padding: .4rem .8rem; border-radius: 999px; text-decoration: none; color: var(--text); background: var(--surface-2); font-weight: 600; font-size: .9rem; }
.subnav a.active, .tabs a.active { background: var(--primary); color: var(--primary-contrast); }
.stat-row { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.stat { display: grid; text-align: center; }
.stat strong { font-size: 1.8rem; }
.stat span { color: var(--muted); font-size: .85rem; }
.task { display: grid; gap: .6rem; }
@media (min-width: 760px) { .task { grid-template-columns: 1fr auto; align-items: start; } }
.task p { margin: .15rem 0; }
.image-review { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-small); overflow: hidden; display: block; overflow-x: auto; }
.table th, .table td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { background: var(--surface-2); font-size: .85rem; }
.event-list li, .analysis-list li, .feedback-list li { padding: .35rem 0; border-bottom: 1px solid var(--border); }

/* --- Profil / Diverses --------------------------------------------------- */
.profile { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.5rem; }
.avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--primary); color: var(--primary-contrast); display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800; flex: none; }
.pagination { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1.5rem 0; }
.prose { font-size: 1.02rem; }
.prose h2 { margin-top: 1.8rem; }
.prose li { margin-bottom: .4rem; }
.error-page { padding: 3rem 0; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--accent); margin: 0; }

.footer { border-top: 1px solid var(--border); margin-top: 2rem; background: var(--surface); }
.footer-inner { display: grid; gap: .6rem; padding: 1.25rem 16px; font-size: .88rem; flex: none; }
.footer nav { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }
.footer a { color: var(--muted); }
.footer-brand { margin: 0; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .topbar, .bottomnav, .footer, .reader-top, .poll, .chapter-nav, .reader-footer { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
}
