:root {
  --paper: #f6f1e7;
  --paper-2: #efe8da;
  --card: #fffdf8;
  --ink: #1b1913;
  --ink-2: #4a463c;
  --muted: #7a7466;
  --rule: #d8cfbd;
  --accent: #9b1c1c;
  --accent-ink: #ffffff;
  --up: #17703a;
  --down: #a3271f;
  --focus: #2457c5;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16140f; --paper-2: #1f1c16; --card: #22201a; --ink: #eee8da; --ink-2: #cfc7b5;
    --muted: #9a927f; --rule: #3a352b; --accent: #e0645a; --accent-ink: #1b0b09; --up: #5ccf86; --down: #ff7d72; --focus: #7aa2ff;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif);
  font-size: 18px; line-height: 1.55;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: .85rem; }

/* Kopf */
.masthead { text-align: center; padding: calc(14px + env(safe-area-inset-top)) 16px 8px; border-bottom: 3px double var(--ink); margin: 0 auto; max-width: 1100px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: clamp(2rem, 8vw, 3.4rem); letter-spacing: .02em; text-decoration: none; line-height: 1.1; font-variant: small-caps; }
.dateline { font-family: var(--sans); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-2); border-top: 1px solid var(--rule); margin-top: 6px; padding-top: 4px; }

main { max-width: 1100px; margin: 0 auto; padding: 16px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }

/* Tabbar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; background: var(--paper-2);
  border-top: 1px solid var(--rule); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); z-index: 10; font-family: var(--sans); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; font-size: .72rem; color: var(--muted); padding: 4px 14px; border-radius: 8px; }
.tabbar a.active { color: var(--accent); }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Buttons & Formulare */
button, .btn { font-family: var(--sans); font-size: .95rem; border: 1px solid var(--ink); background: transparent; color: var(--ink);
  padding: 9px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.ghost { border-color: var(--rule); }
button:disabled { opacity: .5; cursor: default; }
input, textarea, select { font: inherit; font-family: var(--sans); font-size: 1rem; width: 100%; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--card); color: var(--ink); }
textarea { min-height: 120px; resize: vertical; }
label { display: block; font-family: var(--sans); font-size: .85rem; color: var(--ink-2); margin: 12px 0 4px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.panel { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; }
.panel h2 { font-size: 1.15rem; font-family: var(--sans); }
.badge { font-family: var(--sans); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--rule); color: var(--ink-2); white-space: nowrap; }
.badge.red { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.badge.green { border-color: var(--up); color: var(--up); }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; min-height: 36px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Archiv */
.archive { list-style: none; padding: 0; margin: 0; }
.archive li a { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: baseline; padding: 14px 4px; border-bottom: 1px solid var(--rule); text-decoration: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; }
.dot.read { background: transparent; border: 1px solid var(--rule); }
.archive .t { font-weight: 700; font-size: 1.05rem; }
.archive .meta { font-family: var(--sans); font-size: .78rem; color: var(--muted); line-height: 1.4; }
.lead { display: block; text-decoration: none; border-bottom: 1px solid var(--ink); padding-bottom: 16px; margin-bottom: 8px; }
.lead .kicker { font-family: var(--sans); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.lead h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); margin: 4px 0 6px; }
.lead p { margin: 0; color: var(--ink-2); font-size: 1.1rem; }

/* Ausgabe – gemeinsam */
.edition-head { text-align: center; border-bottom: 1px solid var(--ink); padding-bottom: 10px; margin-bottom: 18px; }
.edition-head .kicker { font-family: var(--sans); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.edition-head h1 { font-size: clamp(1.8rem, 5.5vw, 2.8rem); margin: 6px 0; }
.extra-banner { background: var(--accent); color: var(--accent-ink); text-align: center; font-family: var(--sans); font-weight: 800; letter-spacing: .3em; padding: 6px; margin-bottom: 10px; border-radius: 4px; }
.audience { font-family: var(--sans); font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; text-align: center; color: var(--accent);
  margin: 26px 0 12px; display: flex; align-items: center; gap: 12px; }
.audience::before, .audience::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.section h2 { font-family: var(--sans); font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; border-top: 3px solid var(--ink); padding-top: 6px; margin-top: 18px; }
.article h3 { font-size: 1.3rem; }
.article p { margin: 0 0 .6em; }
.links { font-family: var(--sans); font-size: .85rem; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.links a { color: var(--accent); }
.quotes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 14px; font-family: var(--sans); }
.quote { border: 1px solid var(--rule); border-radius: 8px; padding: 10px; background: var(--card); }
.quote .l { font-size: .78rem; color: var(--muted); }
.quote .p { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.quote .c { font-size: .85rem; font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); }
.readbar { margin: 30px 0 10px; text-align: center; }

/* Layout „Zeitung“ */
.layout-zeitung .section-body { columns: 1; column-gap: 32px; column-rule: 1px solid var(--rule); }
.layout-zeitung .article { break-inside: avoid; padding: 6px 0 14px; border-bottom: 1px solid var(--rule); margin-bottom: 10px; }
.layout-zeitung .article:last-child { border-bottom: 0; }
@media (min-width: 760px) { .layout-zeitung .article p { text-align: justify; hyphens: auto; } }
@media (min-width: 760px) { .layout-zeitung .section-body { columns: 2; } }
@media (min-width: 1040px) { .layout-zeitung .section-body { columns: 3; } }

/* Layout „Feed“ */
.layout-feed { font-family: var(--sans); font-size: 17px; max-width: 680px; margin: 0 auto; }
.layout-feed .edition-head h1 { font-family: var(--sans); }
.layout-feed .section h2 { border-top: 0; color: var(--accent); }
.layout-feed .article { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.layout-feed .article h3 { font-family: var(--sans); font-size: 1.12rem; }

/* Rubriken */
.cat { border-top: 1px solid var(--rule); padding: 14px 0; }
.cat-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.cat-head h3 { font-family: var(--sans); font-size: 1.05rem; margin: 0; }
.cat .desc { white-space: pre-wrap; color: var(--ink-2); font-size: .95rem; margin: 6px 0; }
.cat .summary { font-family: var(--sans); font-size: .9rem; background: var(--paper-2); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 4px; margin: 8px 0; }
.cat details { font-family: var(--sans); font-size: .85rem; margin: 6px 0; }
.cat pre { white-space: pre-wrap; word-break: break-word; font-size: .78rem; background: var(--paper-2); padding: 8px; border-radius: 6px; }
.err { color: var(--down); font-family: var(--sans); font-size: .85rem; }

.list { list-style: none; padding: 0; margin: 0; font-family: var(--sans); font-size: .9rem; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.log { max-height: 280px; overflow: auto; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .75rem; white-space: pre-wrap; background: var(--paper-2); padding: 8px; border-radius: 6px; }

.login { max-width: 420px; margin: 8vh auto; text-align: center; }
.login p { color: var(--ink-2); }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: .9rem; padding: 10px 16px; border-radius: 8px; max-width: calc(100% - 32px); z-index: 20; }
