/* DocDiff — Editorial Dark Ink
   Designprinzip: Dokument als Subjekt. Warm-dunkles Papier, Serif-Display,
   numerierte Sektionen, einzige Akzentfarbe Safran. Keine externen Assets. */

:root, [data-theme="dark"] {
  --ink:        #0e0d0b;
  --ink-2:      #16140f;
  --paper:      #f3ece1;
  --paper-dim:  #c9c0b1;
  --paper-mute: #8a8378;
  --rule:       #2a2620;
  --rule-soft:  #1d1a15;
  --saffron:    #e0a02e;
  --saffron-2:  #f3c061;
  --rouge:      #b8473b;
  --rouge-bg:   #2a1816;
  --moss:       #6b8e4e;
  --moss-bg:    #1a2113;
  --amber-bg:   #2a230f;
  --noise-alpha: .035;
  --grain-light: .95;
  --grain-r: .92;
  --grain-g: .85;
}

[data-theme="light"] {
  --ink:        #f3ece0;   /* paper background */
  --ink-2:      #ebe2d1;
  --paper:      #1c1814;   /* ink text */
  --paper-dim:  #4d4538;
  --paper-mute: #847b6c;
  --rule:       #d6cab2;
  --rule-soft:  #e3d9c2;
  --saffron:    #b8761a;
  --saffron-2:  #8a5612;
  --rouge:      #a83c30;
  --rouge-bg:   #f4dad4;
  --moss:       #4e6e35;
  --moss-bg:    #e0ead0;
  --amber-bg:   #f4e6c0;
  --noise-alpha: .045;
  --grain-light: .15;
  --grain-r: .10;
  --grain-g: .08;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "URW Palladio L",
           "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, -apple-system, "Segoe UI Variable", "Segoe UI",
          system-ui, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "SF Mono",
          "Menlo", "Consolas", monospace;

  --shadow-1: 0 1px 0 rgba(243,236,225,.04) inset, 0 0 0 1px var(--rule);
  --shadow-2: 0 30px 80px -30px rgba(0,0,0,.6),
              0 0 0 1px var(--rule);
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }

html, body { background: var(--ink); }

body {
  margin: 0;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01","cv11","kern";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  background-color: var(--ink);
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(224,160,46,.06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(184,71,59,.05), transparent 60%);
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--noise-alpha);
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .95  0 0 0 0 .92  0 0 0 0 .85  0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
[data-theme="light"] body::before {
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .25  0 0 0 0 .18  0 0 0 0 .1  0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.shell { position: relative; z-index: 1; }

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

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 4vw, 3rem) 5rem;
}

header.masthead {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 1.5rem;
  padding: 1.25rem 0 1.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 3rem;
  position: relative;
}

header.masthead::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: var(--rule-soft);
}

.wordmark {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: .9;
  color: var(--paper);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: .3rem;
}
.wordmark .dot {
  width: .42rem; height: .42rem;
  background: var(--saffron);
  border-radius: 50%;
  display: inline-block;
  transform: translateY(-.15rem);
  box-shadow: 0 0 18px var(--saffron);
}
.wordmark em {
  font-style: normal;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tagline {
  font-family: var(--sans);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .22em;
  color: var(--paper-mute);
  align-self: end;
  padding-bottom: .35rem;
  border-left: 1px solid var(--rule);
  padding-left: 1.25rem;
}

nav.utility {
  display: flex;
  gap: 1.5rem;
  align-self: end;
  padding-bottom: .25rem;
}
nav.utility a {
  font-size: .8rem;
  color: var(--paper-dim);
  text-decoration: none;
  letter-spacing: .04em;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
nav.utility a:hover {
  color: var(--saffron);
  border-bottom-color: var(--saffron);
}

main { display: block; }

/* ─── Editorial Sections ──────────────────────────────── */

.section {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 2.5rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--rule-soft);
}
.section:first-of-type { border-top: 0; padding-top: 0; }

.section-no {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--saffron);
  letter-spacing: .04em;
  padding-top: .4rem;
}
.section-no::before {
  content: "";
  display: block;
  width: 18px; height: 1px;
  background: var(--saffron);
  margin-bottom: .8rem;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.7rem, 2.6vw, 2.25rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 .4rem;
  color: var(--paper);
}
.section-title em {
  font-style: italic;
  color: var(--saffron-2);
}
.section-lede {
  color: var(--paper-dim);
  font-size: .95rem;
  max-width: 58ch;
  margin: 0 0 1.6rem;
}

/* ─── Hero (Index) ────────────────────────────────────── */

.hero {
  display: block;
  padding: 0 0 1.5rem;
}

.hero-text {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: end;
  padding-bottom: 1.6rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--rule-soft);
}

.hero-headline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}
.hero-headline .em {
  font-style: italic;
  color: var(--saffron-2);
}
.hero-headline .ampersand {
  font-family: var(--serif);
  font-style: italic;
  color: var(--saffron);
  font-weight: 400;
  margin: 0 .1em;
}

.hero-sub {
  color: var(--paper-dim);
  font-size: .95rem;
  max-width: 48ch;
  margin: 0 0 1rem;
}

.hero-meta {
  margin: 0;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.hero-meta dt {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--paper-mute);
  margin-bottom: .2rem;
}
.hero-meta dd {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: .95rem;
  color: var(--paper);
}

.hero-form {
  max-width: 760px;
}

/* ─── Formular-Karte ──────────────────────────────────── */

.card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(243,236,225,.025), rgba(243,236,225,0)),
    var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 2rem clamp(1.2rem, 2.5vw, 2rem);
  box-shadow: var(--shadow-2);
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--saffron), transparent 60%);
}

.field {
  display: block;
  margin: 0 0 1.4rem;
}
.field:last-of-type { margin-bottom: 1.8rem; }

.field-label {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .22em;
  color: var(--paper-mute);
  margin-bottom: .55rem;
}
.field-label .num {
  font-family: var(--serif);
  font-style: italic;
  font-size: .85rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--saffron);
}
.field-hint {
  font-size: .72rem;
  color: var(--paper-mute);
  margin-top: .4rem;
  font-style: italic;
  font-family: var(--serif);
}

input[type="text"],
input[type="password"],
input:not([type]),
textarea {
  width: 100%;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: .85rem 1rem;
  font: inherit;
  font-size: .98rem;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease),
              background .2s var(--ease);
}
textarea {
  font-family: var(--mono);
  font-size: .9rem;
  line-height: 1.55;
  resize: vertical;
  min-height: 110px;
}
input:focus, textarea:focus {
  outline: 0;
  border-color: var(--saffron);
  box-shadow: 0 0 0 3px rgba(224,160,46,.15);
  background: #100e0a;
}

/* Datei-Drop-Zone */
.file-drop {
  position: relative;
  display: block;
  border: 1px dashed var(--rule);
  border-radius: 3px;
  background:
    repeating-linear-gradient(45deg,
      rgba(243,236,225,.012) 0 6px,
      transparent 6px 12px),
    var(--ink);
  padding: 1.1rem 1.2rem;
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.file-drop:hover { border-color: var(--paper-mute); }
.file-drop.is-active { border-color: var(--saffron); background: var(--amber-bg); }
.file-drop.is-filled { border-style: solid; border-color: var(--moss); }
.file-drop input[type=file] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
}
.file-drop-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  pointer-events: none;
}
.file-drop-icon {
  width: 42px; height: 42px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  display: grid; place-items: center;
  color: var(--paper-mute);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.file-drop.is-filled .file-drop-icon {
  color: var(--moss);
  border-color: var(--moss);
}
.file-drop-text { min-width: 0; flex: 1; }
.file-drop-title {
  font-size: .92rem;
  color: var(--paper);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-drop-meta {
  font-size: .75rem;
  color: var(--paper-mute);
  margin: .15rem 0 0;
  font-family: var(--mono);
}

/* ─── Switch (KI-Toggle) ──────────────────────────────── */

.switch {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  cursor: pointer;
  padding: .9rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--ink);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.switch:hover { border-color: var(--paper-mute); }
.switch:has(input:checked) {
  border-color: rgba(224,160,46,.5);
  background:
    linear-gradient(180deg, rgba(224,160,46,.04), transparent),
    var(--ink);
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }

.switch-track {
  position: relative;
  width: 44px; height: 24px;
  background: var(--rule);
  border-radius: 999px;
  transition: background .25s var(--ease);
  flex-shrink: 0;
}
.switch-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: var(--paper-mute);
  border-radius: 50%;
  transition: transform .25s var(--ease), background .25s var(--ease);
}
.switch input:checked ~ .switch-track {
  background: var(--saffron);
}
.switch input:checked ~ .switch-track .switch-thumb {
  background: var(--ink);
  transform: translateX(20px);
}
[data-theme="light"] .switch input:checked ~ .switch-track .switch-thumb {
  background: #f3ece0;
}
.switch input:focus-visible ~ .switch-track {
  box-shadow: 0 0 0 3px rgba(224,160,46,.25);
}

.switch-text { display: block; }
.switch-title {
  display: block;
  font-size: .95rem;
  color: var(--paper);
}
.switch-sub {
  display: block;
  font-size: .78rem;
  color: var(--paper-mute);
  margin-top: .15rem;
  font-family: var(--serif);
  font-style: italic;
}

.notice {
  margin-top: .8rem;
  padding: .75rem 1rem;
  border-left: 2px solid var(--saffron);
  background: var(--amber-bg);
  border-radius: 0 3px 3px 0;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--paper-dim);
  transition: opacity .2s var(--ease);
}
[data-theme="light"] .notice { color: #5a3a08; }
.notice strong { color: var(--saffron-2); font-weight: 600; }
.notice em { font-style: italic; color: var(--paper); }
[data-theme="light"] .notice em { color: #1c1814; }
.notice.is-muted { opacity: .45; }

/* ─── Buttons ─────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  background: var(--saffron);
  color: #0e0d0b;
  border: 0;
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: .02em;
  padding: .85rem 1.5rem;
  border-radius: 3px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s var(--ease), background .2s var(--ease),
              box-shadow .2s var(--ease);
  box-shadow: 0 6px 24px -8px rgba(224,160,46,.6);
}
.btn:hover {
  background: var(--saffron-2);
  transform: translateY(-1px);
  box-shadow: 0 10px 30px -8px rgba(224,160,46,.7);
}
.btn:active { transform: translateY(0); }
.btn .arrow {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  transition: transform .2s var(--ease);
}
.btn:hover .arrow { transform: translateX(3px); }

.btn-ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--rule);
  box-shadow: none;
}
.btn-ghost:hover {
  background: var(--ink-2);
  border-color: var(--saffron);
  color: var(--saffron);
  box-shadow: none;
}

.actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.actions-note {
  font-size: .75rem;
  color: var(--paper-mute);
  font-style: italic;
  font-family: var(--serif);
}

/* ─── Login ───────────────────────────────────────────── */

.login-wrap {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 8rem);
  padding: 2rem 0;
}
.login-card {
  width: min(420px, 100%);
}
.login-card .card { padding: 2.4rem 2rem 2rem; }
.login-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 2rem;
  letter-spacing: -0.01em;
  margin: 0 0 .3rem;
}
.login-sub {
  font-size: .85rem;
  color: var(--paper-mute);
  margin: 0 0 1.8rem;
}

/* ─── Alerts ──────────────────────────────────────────── */

.alert {
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  padding: .85rem 1rem;
  border-radius: 3px;
  font-size: .9rem;
  margin: 0 0 1.4rem;
  border: 1px solid;
  background: var(--rouge-bg);
  border-color: rgba(184,71,59,.4);
  color: #f3c8c2;
}
.alert::before {
  content: "!";
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--rouge);
  margin-top: .05rem;
}
.alert.warn {
  background: var(--amber-bg);
  border-color: rgba(224,160,46,.35);
  color: #f3dca5;
}
.alert.warn::before { color: var(--saffron); }
.err { /* legacy fallback */
  background: var(--rouge-bg);
  border: 1px solid rgba(184,71,59,.4);
  color: #f3c8c2;
  padding: .85rem 1rem;
  border-radius: 3px;
  font-size: .9rem;
}

/* ─── Result-Layout ───────────────────────────────────── */

.prompt-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--paper);
  margin: 0;
  padding: 0 0 0 1.4rem;
  border-left: 2px solid var(--saffron);
  white-space: pre-wrap;
}

.md {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--paper);
  max-width: 72ch;
}
.md h1, .md h2, .md h3, .md h4 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--paper);
  margin: 2rem 0 .6rem;
}
.md h1 { font-size: 1.7rem; }
.md h2 { font-size: 1.35rem; }
.md h3 { font-size: 1.15rem; font-style: italic; }
.md p { margin: 0 0 1rem; }
.md strong { color: var(--saffron-2); font-weight: 600; }
.md em { color: var(--paper); font-style: italic; }
.md code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--ink-2);
  border: 1px solid var(--rule);
  padding: .05em .4em;
  border-radius: 2px;
  color: var(--saffron-2);
}
.md pre {
  background: var(--ink-2);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--saffron);
  padding: 1rem 1.2rem;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: .85rem;
  overflow-x: auto;
}
.md pre code { background: 0; border: 0; padding: 0; color: var(--paper); }
.md ul, .md ol { margin: 0 0 1rem; padding-left: 1.4rem; }
.md li { margin: .25rem 0; }
.md ul li::marker { color: var(--saffron); }
.md blockquote {
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  color: var(--paper-dim);
  font-style: italic;
  font-family: var(--serif);
}

/* Diff-Tabelle (difflib HtmlDiff) */
details.diff-wrap {
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--ink-2);
}
details.diff-wrap summary {
  cursor: pointer;
  padding: .85rem 1.1rem;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--paper-dim);
  list-style: none;
  display: flex;
  align-items: center;
  gap: .8rem;
  user-select: none;
}
details.diff-wrap summary::-webkit-details-marker { display: none; }
details.diff-wrap summary::before {
  content: "+";
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--saffron);
  transition: transform .2s var(--ease);
}
details[open].diff-wrap summary::before { content: "−"; }
details.diff-wrap summary:hover { color: var(--paper); }

.diff {
  border-top: 1px solid var(--rule);
  overflow-x: auto;
  padding: 0;
}
.diff table {
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: .8rem;
  width: 100%;
  color: var(--paper);
}
.diff td { padding: .1rem .5rem; vertical-align: top; }
.diff td.diff_header {
  background: var(--ink);
  color: var(--paper-mute);
  text-align: right;
  user-select: none;
  border-right: 1px solid var(--rule);
}
.diff .diff_add  { background: var(--moss-bg);  color: #cae5b1; }
.diff .diff_sub  { background: var(--rouge-bg); color: #f3c8c2; }
.diff .diff_chg  { background: var(--amber-bg); color: var(--saffron-2); }
.diff .diff_next { background: var(--ink); }

/* Meta-Block */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem;
  list-style: none;
  margin: 0; padding: 0;
}
.meta-grid li {
  border-top: 1px solid var(--rule);
  padding-top: .8rem;
}
.meta-key {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--paper-mute);
  display: block;
  margin-bottom: .35rem;
}
.meta-val {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--paper);
  word-break: break-all;
}
.meta-val.mono {
  font-family: var(--mono);
  font-size: .92rem;
  font-style: normal;
  color: var(--saffron-2);
}

/* ─── Loading-Overlay ────────────────────────────────── */

.loading {
  position: fixed;
  inset: 0;
  background: rgba(14,13,11,.92);
  display: none;
  place-items: center;
  z-index: 50;
  backdrop-filter: blur(6px);
}
.loading.show { display: grid; }
.loading-inner {
  text-align: center;
  max-width: 360px;
  padding: 2rem;
}
.loading-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.6rem;
  margin: 1.2rem 0 .4rem;
  color: var(--paper);
}
.loading-sub {
  font-size: .85rem;
  color: var(--paper-mute);
}
.spinner {
  width: 48px; height: 48px;
  border: 1.5px solid var(--rule);
  border-top-color: var(--saffron);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Footer ─────────────────────────────────────────── */

footer.colophon {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-soft);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .75rem;
  color: var(--paper-mute);
  font-family: var(--serif);
  font-style: italic;
}
footer.colophon .mark { color: var(--paper-dim); }

/* ─── Reveal-Animation ───────────────────────────────── */

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal { animation: rise .7s var(--ease) both; }
.reveal:nth-child(2) { animation-delay: .08s; }
.reveal:nth-child(3) { animation-delay: .16s; }
.reveal:nth-child(4) { animation-delay: .24s; }
.reveal:nth-child(5) { animation-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }
  * { transition: none !important; }
}

/* ─── Responsiv ──────────────────────────────────────── */

@media (max-width: 820px) {
  .hero-text { grid-template-columns: 1fr; gap: 1.2rem; }
  .section { grid-template-columns: 1fr; gap: 1rem; }
  .section-no { padding-top: 0; }
  header.masthead { grid-template-columns: 1fr auto; }
  .tagline { display: none; }
}

::selection { background: var(--saffron); color: #0e0d0b; }

/* ─── Light-Theme-Korrekturen ────────────────────────── */

[data-theme="light"] .alert {
  background: var(--rouge-bg);
  border-color: rgba(168,60,48,.4);
  color: #6b231b;
}
[data-theme="light"] .alert.warn {
  background: var(--amber-bg);
  border-color: rgba(184,118,26,.4);
  color: #5a3a08;
}
[data-theme="light"] .diff .diff_add { color: #2e4a18; }
[data-theme="light"] .diff .diff_sub { color: #6b231b; }
[data-theme="light"] .diff .diff_chg { color: #5a3a08; }
[data-theme="light"] .md code { color: var(--saffron-2); background: var(--ink-2); }
[data-theme="light"] .wordmark .dot { box-shadow: 0 0 14px rgba(184,118,26,.5); }
[data-theme="light"] .card {
  background:
    linear-gradient(180deg, rgba(28,24,20,.015), rgba(28,24,20,0)),
    var(--ink-2);
  box-shadow: 0 30px 80px -40px rgba(0,0,0,.18), 0 0 0 1px var(--rule);
}
[data-theme="light"] .loading { background: rgba(243,236,224,.92); }
[data-theme="light"] input:focus, [data-theme="light"] textarea:focus {
  background: #f7f0e4;
}

/* ─── User-Pill / Admin-Tabelle ───────────────────────── */

.user-pill {
  font-family: var(--mono);
  font-size: .72rem;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: var(--ink-2);
  border: 1px solid var(--rule);
  color: var(--paper);
  letter-spacing: 0;
}
nav.utility a:hover .user-pill {
  border-color: var(--saffron);
  color: var(--saffron);
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4rem 0 1rem;
  font-size: .92rem;
}
.users-table th, .users-table td {
  text-align: left;
  padding: .7rem .8rem;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: middle;
}
.users-table th {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--paper-mute);
  font-weight: 400;
  border-bottom: 1px solid var(--rule);
}
.users-table td.mono { font-family: var(--mono); font-size: .9rem; }
.users-table tr:hover td { background: var(--ink-2); }
.users-table .row-actions { text-align: right; }
.users-table .row-actions form { display: inline; margin: 0; }
.users-table .muted { color: var(--paper-mute); font-style: italic; font-family: var(--serif); }

.tag {
  display: inline-block;
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .15rem .55rem;
  border-radius: 3px;
  border: 1px solid var(--rule);
  color: var(--paper-dim);
  background: var(--ink-2);
}
.tag-admin { color: var(--saffron-2); border-color: rgba(224,160,46,.45); }
.tag-user  { color: var(--paper-dim); }
.tag-warn  { color: var(--rouge); border-color: rgba(184,71,59,.45); }

.btn-link {
  background: transparent;
  border: 0;
  color: var(--rouge);
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
  padding: .2rem .4rem;
  text-decoration: underline;
  text-decoration-color: rgba(184,71,59,.4);
  text-underline-offset: 3px;
}
.btn-link:hover { color: var(--saffron); text-decoration-color: var(--saffron); }

select {
  width: 100%;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: .8rem 1rem;
  font: inherit;
  font-size: .98rem;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--paper-mute) 50%),
                    linear-gradient(135deg, var(--paper-mute) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
select:focus {
  outline: 0;
  border-color: var(--saffron);
  box-shadow: 0 0 0 3px rgba(224,160,46,.15);
}

/* ─── Theme-Toggle ────────────────────────────────────── */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--paper-dim);
  padding: .35rem .65rem;
  border-radius: 20px;
  font: inherit;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease),
              background .2s var(--ease);
}
.theme-toggle:hover {
  border-color: var(--saffron);
  color: var(--saffron);
}
.theme-toggle .icon {
  width: 14px; height: 14px;
  display: inline-block;
  position: relative;
}
.theme-toggle .icon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--saffron);
  box-shadow: inset -4px -2px 0 0 var(--ink);
  transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
[data-theme="light"] .theme-toggle .icon::before {
  box-shadow: inset 0 0 0 0 var(--ink), 0 0 6px var(--saffron);
  transform: scale(.85);
}
.theme-toggle .lbl-dark { display: none; }
.theme-toggle .lbl-light { display: inline; }
[data-theme="light"] .theme-toggle .lbl-dark { display: inline; }
[data-theme="light"] .theme-toggle .lbl-light { display: none; }
