/* Editorial Botany — Garten-Wiki Facade
   Refined minimal reading interface. Mobile-first. */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT@9..144,300..900,0..100&family=Newsreader:opsz,wght,ital@6..72,300..700,0;6..72,300..700,1&display=swap');

:root {
  --paper:        #F6F1E7;
  --paper-raised: #FAF7F0;
  --ink:          #1F1A17;
  --ink-soft:     #4A4238;
  --ink-muted:    #8A8175;
  --ink-faint:    #B5AC9E;
  --rule:         #E3DAC8;
  --rule-soft:    #EDE5D5;
  --sage:         #5B6B4A;
  --sage-deep:    #3F4F34;
  --sage-light:   #8FA07A;
  --sage-wash:    #EAEFE0;

  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --display: 'Fraunces', 'Hoefler Text', Garamond, serif;

  --measure: 34rem;
  --gutter: 1.5rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.7;
  font-feature-settings: "kern", "liga", "onum";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12  0 0 0 0 0.10  0 0 0 0 0.07  0 0 0 0.035 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}

/* ——— Masthead ——————————————————————————— */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: transparent;
}

.masthead-inner {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1.4rem var(--gutter);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  gap: 0.55rem;
  font-family: var(--display);
  font-variation-settings: "opsz" 36, "wght" 480, "SOFT" 30;
  font-size: 1.35rem;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-decoration: none;
}

.brand .sprig {
  width: 28px;
  height: 28px;
  color: var(--sage);
  flex-shrink: 0;
}

.brand em {
  font-style: italic;
  color: var(--sage-deep);
  font-variation-settings: "opsz" 36, "wght" 420, "SOFT" 80;
}

.nav {
  display: flex;
  gap: 1.4rem;
  font-family: var(--serif);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.nav a {
  color: var(--ink-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 160ms ease, border-color 160ms ease;
}

.nav a[aria-current="page"] {
  color: var(--sage-deep);
  border-bottom-color: var(--sage);
}

.nav a:hover { color: var(--sage-deep); border-bottom-color: var(--sage); }
.nav-fragen { margin-right: 3.125rem; }

.nav-logout {
  background: none;
  border: none;
  padding: 0;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  transition: color 160ms ease, border-color 160ms ease;
}
.nav-logout:hover { color: var(--sage-deep); border-bottom-color: var(--sage); }

/* ——— Article column ———————————————————— */

.column {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3rem var(--gutter) 5rem;
  animation: rise 700ms cubic-bezier(.2,.7,.2,1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.kicker {
  font-family: var(--serif);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--sage-deep);
  margin: 0 0 0.9rem;
}

h1.title {
  font-family: var(--display);
  font-variation-settings: "opsz" 144, "wght" 380, "SOFT" 20;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.022em;
  margin: 0 0 0.75rem;
  color: var(--ink);
}

h1.title em {
  font-style: italic;
  font-variation-settings: "opsz" 144, "wght" 360, "SOFT" 100, "WONK" 1;
  color: var(--sage-deep);
}

.meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 0;
  font-family: var(--serif);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  margin: 0 0 2.4rem;
}

.meta .dot { color: var(--ink-faint); margin: 0 0.55rem; }

.ornament {
  display: block;
  margin: 2.2rem auto;
  color: var(--sage-light);
  width: 60px;
  opacity: 0.85;
}

article p { margin: 0 0 1.15rem; }

article p.lede::first-letter {
  font-family: var(--display);
  font-variation-settings: "opsz" 144, "wght" 420, "SOFT" 0;
  float: left;
  font-size: 4.2rem;
  line-height: 0.88;
  padding: 0.4rem 0.55rem 0 0;
  color: var(--sage-deep);
}

article h2 {
  font-family: var(--display);
  font-variation-settings: "opsz" 60, "wght" 460, "SOFT" 30;
  font-size: 1.55rem;
  line-height: 1.2;
  letter-spacing: -0.012em;
  margin: 2.6rem 0 0.9rem;
  color: var(--ink);
}

article h3 {
  font-family: var(--display);
  font-variation-settings: "opsz" 30, "wght" 520, "SOFT" 0;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 2rem 0 0.7rem;
  color: var(--sage-deep);
}

article ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.3rem;
}

article ul li {
  position: relative;
  padding-left: 1.4rem;
  margin: 0.35rem 0;
}

article ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--sage-light);
  font-weight: 300;
}

article a.wikilink {
  color: var(--sage-deep);
  text-decoration: none;
  border-bottom: 1px dotted var(--sage-light);
  padding-bottom: 1px;
  transition: background 160ms ease, border-color 160ms ease;
}

article a.wikilink:hover {
  background: var(--sage-wash);
  border-bottom-color: var(--sage-deep);
}

article a.wikilink::before {
  content: "⌘ ";
  color: var(--sage-light);
  font-size: 0.85em;
  margin-right: 0.05em;
}

blockquote {
  margin: 1.6rem 0;
  padding: 0.4rem 0 0.4rem 1.3rem;
  border-left: 2px solid var(--sage-light);
  color: var(--ink-soft);
  font-style: italic;
  font-family: var(--display);
  font-variation-settings: "opsz" 30, "wght" 360, "SOFT" 60;
}

code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9em;
  background: var(--paper-raised);
  padding: 0.1em 0.35em;
  border-radius: 2px;
  color: var(--ink-soft);
}

/* ——— Tabellen ——————————————————————————— */

article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6rem 0;
  font-size: 0.94rem;
}

article th {
  text-align: left;
  font-family: var(--serif);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--rule);
}

article td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--ink-soft);
  vertical-align: top;
}

article tr:last-child td { border-bottom: none; }

/* ——— See also & Footer meta ————————————— */

.see-also {
  margin: 3rem 0 0;
  padding: 1.6rem 0 0;
  border-top: 1px solid var(--rule);
}

.see-also h4 {
  font-family: var(--serif);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-muted);
  margin: 0 0 0.8rem;
  font-weight: 500;
}

.see-also ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.see-also li {
  padding: 0.35rem 0;
  border-bottom: 1px dotted var(--rule);
}

.see-also li:last-child { border-bottom: none; }

.see-also a {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-variation-settings: "opsz" 24, "wght" 440, "SOFT" 30;
  font-size: 1.02rem;
}

.see-also a:hover { color: var(--sage-deep); }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin-top: 2rem;
}

.tag-chip {
  font-size: 0.78rem;
  padding: 0.2em 0.65em;
  border-radius: 99px;
  background: var(--sage-light, #e8f0eb);
  color: var(--sage);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.tag-chip:hover {
  background: var(--sage);
  color: #fff;
}

.colophon {
  margin-top: 3.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  text-align: center;
}

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

/* ——— Index ———————————————————————————— */

.index-controls {
  display: flex;
  gap: 0.5rem;
  margin: 2rem 0 1.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.index-toggle-all {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  padding: 0.45rem 0.9rem;
  border-radius: 2px;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.index-toggle-all:hover {
  border-color: var(--sage);
  color: var(--sage-deep);
  background: var(--sage-wash);
}

.index-section {
  margin: 0;
  border-bottom: 1px solid var(--rule-soft);
}

.index-section:first-of-type {
  border-top: 1px solid var(--rule-soft);
}

details.index-section > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.4rem 0.4rem 1.4rem 0.2rem;
  transition: background 0.12s;
}

details.index-section > summary::-webkit-details-marker { display: none; }

details.index-section > summary:hover {
  background: var(--sage-wash);
}

.index-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  color: var(--sage);
  font-size: 1.35rem;
  line-height: 1;
  transition: transform 0.18s ease, color 0.15s;
  transform: rotate(0deg);
  flex-shrink: 0;
}

.index-chevron::before { content: "▸"; }

details.index-section > summary:hover .index-chevron {
  color: var(--sage-deep);
}

details.index-section[open] > summary .index-chevron {
  transform: rotate(90deg);
  color: var(--sage-deep);
}

.index-section h2 {
  font-family: var(--display);
  font-variation-settings: "opsz" 48, "wght" 460, "SOFT" 40;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--sage-deep);
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.85rem;
  flex: 1;
  min-width: 0;
  text-transform: none;
  font-variant: normal;
  line-height: 1.2;
}

.index-section h2 .count {
  font-family: var(--serif);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 400;
  align-self: center;
}

.index-section .rule {
  display: none;
}

.index-list {
  list-style: none;
  padding: 0 0 1rem 2.05rem;
  margin: 0;
}

.index-list li {
  padding: 0.85rem 0;
  border-bottom: 1px dotted var(--rule);
}

.index-list li:last-child { border-bottom: none; }

.index-list a.entry-title {
  display: inline;
  font-family: var(--display);
  font-variation-settings: "opsz" 24, "wght" 460, "SOFT" 20;
  font-size: 1.08rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.005em;
}

.index-list a.entry-title:hover { color: var(--sage-deep); }

.index-list .entry-desc {
  display: block;
  margin-top: 0.15rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.5;
}

/* ——— Ask / Fragen ————————————————————— */

.ask-form {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.2rem 1.2rem 1rem;
  margin: 2rem 0 0;
}

.ask-form textarea,
.ask-form input[type="search"] {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--display);
  font-variation-settings: "opsz" 24, "wght" 380, "SOFT" 30;
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--ink);
  outline: none;
  padding: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.ask-form textarea {
  resize: none;
  overflow: hidden;
}

.ask-form textarea::placeholder,
.ask-form input[type="search"]::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}

.ask-status {
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  color: var(--ink-faint);
  padding: 0.5rem 0 0.1rem;
}

.ask-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px dotted var(--rule);
}

.ask-actions .hint {
  font-size: 0.78rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

.btn {
  font-family: var(--serif);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--paper);
  background: var(--sage-deep);
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: 2px;
  cursor: pointer;
  transition: background 160ms ease;
}

.btn:hover:not(:disabled) { background: var(--ink); }

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--sage-deep);
  border: 1px solid var(--sage-light);
  padding: 0.5rem 1rem;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--sage-wash);
  color: var(--sage-deep);
}

.question-quote {
  border-left: 2px solid var(--sage-light);
  padding: 0.5rem 0 0.5rem 1.2rem;
  margin: 3rem 0 2rem;
  font-family: var(--display);
  font-variation-settings: "opsz" 30, "wght" 380, "SOFT" 60;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.45;
}

.question-quote::before {
  content: "Frage";
  display: block;
  font-family: var(--serif);
  font-style: normal;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
}

.answer h2.answer-heading {
  font-family: var(--display);
  font-variation-settings: "opsz" 60, "wght" 440, "SOFT" 40;
  font-size: 1.45rem;
  margin: 0 0 1rem;
  color: var(--ink);
}

.sources-line {
  margin-top: 1.8rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.82rem;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

.sources-line a {
  color: var(--sage-deep);
  text-decoration: none;
  border-bottom: 1px dotted var(--sage-light);
}

.save-row {
  margin-top: 1.4rem;
  text-align: right;
}

.usage-info {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--muted, #888);
  letter-spacing: 0.01em;
}

.fragen-error {
  color: #8B3A2A;
  font-size: 0.9rem;
  margin-top: 1rem;
  padding: 0.6rem 0.9rem;
  border-left: 3px solid #C07060;
  background: #FDF3F0;
}

.fragen-hint {
  margin-top: 2rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* ——— Inbox / Eingang ——————————————————— */

.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.8rem;
}

.tab-nav .tab {
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.tab-nav .tab:hover { color: var(--ink); }

.tab-nav .tab.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
  font-weight: 600;
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.3em;
  padding: 0 0.3em;
  height: 1.3em;
  border-radius: 999px;
  background: var(--rule);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 0.3em;
  vertical-align: middle;
}

.inbox-summary {
  display: flex;
  gap: 1.4rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  margin: 0 0 2.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--rule);
}

.inbox-summary .num {
  font-family: var(--display);
  font-variation-settings: "opsz" 36, "wght" 460, "SOFT" 30;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: block;
  text-transform: none;
  margin-top: 0.15rem;
  font-feature-settings: "onum", "lnum" 0;
}

.inbox-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.inbox-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.inbox-item:last-child { border-bottom: none; }

.item-head {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--serif);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  padding: 0.18rem 0.55rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.type-badge.link {
  background: var(--sage-wash);
  color: var(--sage-deep);
  border: 1px solid var(--sage-light);
}

.type-badge.md {
  background: var(--paper-raised);
  color: var(--ink-soft);
  border: 1px solid var(--rule);
}

.type-badge svg { width: 10px; height: 10px; }

/* Typ-Tags Inline-Popover */
.type-tags {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  vertical-align: middle;
}

.type-badge-btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--serif);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  padding: 0.18rem 0.55rem;
  border-radius: 2px;
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  color: var(--ink-soft);
  cursor: pointer;
  line-height: inherit;
}

.type-badge-btn:hover {
  border-color: var(--ink-soft);
  color: var(--ink);
}

.type-add-btn {
  font-family: var(--serif);
  font-size: 0.75rem;
  color: var(--ink-faint);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0.2rem;
  line-height: inherit;
}

.type-add-btn:hover { color: var(--ink-soft); }

.type-popover {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 200;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.6rem 0.75rem 0.75rem;
  min-width: 160px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.type-popover.open { display: block; }

.type-popover-form { display: flex; flex-direction: column; gap: 0; }

.popover-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
}

.popover-option:hover { color: var(--ink); }
.popover-option input { cursor: pointer; margin: 0; }

.popover-footer {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--rule);
}

.btn-small {
  font-family: var(--serif);
  font-size: 0.8rem;
  padding: 0.3rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper-raised);
  color: var(--ink);
  cursor: pointer;
}

.btn-small:hover { border-color: var(--ink-soft); }

.item-title {
  font-family: var(--display);
  font-variation-settings: "opsz" 30, "wght" 460, "SOFT" 20;
  font-size: 1.15rem;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-decoration: none;
  flex: 1 1 auto;
  min-width: 0;
}

.item-title:hover { color: var(--sage-deep); }

.item-origin {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin: 0 0 0.6rem;
  font-style: italic;
}

.freigabe-action {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-left: 0.6rem;
  flex-shrink: 0;
}

.item-summary {
  margin: 0 0 0.9rem;
  color: var(--ink-soft);
  font-size: 0.97rem;
  line-height: 1.55;
}

.commit-details {
  margin: 0 0 0.8rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.commit-details > summary {
  cursor: pointer;
  user-select: none;
  color: var(--ink-faint);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}

.commit-details > summary::before {
  content: '▸';
  font-size: 0.7em;
  transition: transform 120ms;
}

.commit-details[open] > summary::before {
  transform: rotate(90deg);
}

.commit-files {
  margin: 0.5rem 0 0;
  line-height: 1.7;
  word-break: break-all;
}

.item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

.item-foot .meta-line { font-variant-caps: small-caps; letter-spacing: 0.12em; }

.expiry { color: var(--ink-muted); }
.expiry.soon { color: #9a5a2a; }

.item-actions {
  display: inline-flex;
  gap: 0.45rem;
}

/* ——— Buttons / Actions ————————————————— */

.action {
  font-family: var(--serif);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 0.4rem 0.75rem;
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  transition: all 160ms ease;
}

.action:hover {
  background: var(--paper-raised);
  color: var(--ink);
}

.action.primary {
  border-color: var(--sage-deep);
  background: var(--sage-deep);
  color: var(--paper);
}

.action.primary:hover {
  background: var(--ink);
  border-color: var(--ink);
}

.action.danger:hover {
  border-color: #b25a4a;
  color: #b25a4a;
  background: transparent;
}

.action.danger-confirm {
  background: #b25a4a;
  color: var(--paper);
  border-color: #b25a4a;
}

.action.danger-confirm:hover { background: #7a3024; border-color: #7a3024; }

/* ——— Triage (Eingang-Item) ————————————— */

.triage-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.triage-btn {
  font-family: var(--serif);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 0.5em 1.2em;
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 2px;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.triage-btn:hover {
  background: var(--sage-wash);
  color: var(--sage-deep);
  border-color: var(--sage-light);
}

.triage-btn.primary {
  background: var(--sage-deep);
  color: var(--paper);
  border-color: var(--sage-deep);
}

.triage-btn.primary:hover {
  background: var(--ink);
  border-color: var(--ink);
}

/* ——— Review ————————————————————————— */

.interval-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--serif);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  padding: 0.18rem 0.55rem;
  border-radius: 2px;
  background: var(--paper-raised);
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  flex-shrink: 0;
}

.interval-badge.fresh { color: var(--sage-deep); border-color: var(--sage-light); background: var(--sage-wash); }
.interval-badge.aging { color: #8a6a2a; border-color: #d6c08a; background: #f5edd6; }
.interval-badge.stale { color: #b25a4a; border-color: #d8a89c; background: #f5e5e0; }

.review-meta {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin: 0 0 0.7rem;
  font-variant-caps: small-caps;
  letter-spacing: 0.12em;
}

.review-meta .sep { color: var(--ink-faint); margin: 0 0.5rem; }

.review-snippet {
  margin: 0 0 0.9rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
  font-style: italic;
}

.confirm-row {
  margin-top: 0.9rem;
  padding: 0.85rem 1rem;
  background: #f5e5e0;
  border: 1px solid #d8a89c;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.confirm-row .warning {
  font-size: 0.88rem;
  color: #7a3024;
  font-style: italic;
}

.confirm-row .actions {
  display: inline-flex;
  gap: 0.45rem;
}

/* ——— Delete Zone ——————————————————————— */

.delete-zone {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

/* ——— KI-Bildbeschreibung ——————————————— */

blockquote.ki-bildbeschreibung {
  margin: 1.8rem 0;
  padding: 0.85rem 1.05rem;
  background: var(--sage-wash);
  border: 1px solid var(--sage-light);
  border-left: 3px solid var(--sage);
  border-radius: 0 3px 3px 0;
  font-style: normal;
  font-family: var(--serif);
  font-variation-settings: normal;
  color: var(--ink-soft);
  font-size: 0.96rem;
  line-height: 1.6;
}

aside.ki-bildbeschreibung {
  margin: 1.8rem 0;
  padding: 0.85rem 1.05rem;
  background: var(--sage-wash);
  border: 1px solid var(--sage-light);
  border-left: 3px solid var(--sage);
  border-radius: 0 3px 3px 0;
  color: var(--ink-soft);
  font-size: 0.96rem;
  line-height: 1.6;
}

blockquote.ki-bildbeschreibung::before,
aside.ki-bildbeschreibung::before {
  content: "Automatisch erzeugte Bildbeschreibung";
  display: block;
  font-family: var(--serif);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--sage-deep);
  margin-bottom: 0.6rem;
  font-style: normal;
  font-variation-settings: normal;
}

aside.ki-bildbeschreibung blockquote {
  margin: 0.5rem 0;
  padding: 0;
  border-left: none;
  background: none;
  font-style: normal;
  font-family: inherit;
  font-variation-settings: normal;
  color: inherit;
  font-size: inherit;
}

aside.ki-bildbeschreibung p:last-child {
  margin: 0.6rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px dotted var(--sage-light);
  font-size: 0.82rem;
  color: var(--ink-muted);
}

/* ——— Ingest-Log ——————————————————————— */

.ingest-log {
  margin: 0.75rem 0 0;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: #d4cfca;
  border-radius: 6px;
  font-family: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  font-size: 0.7rem;
  line-height: 1.55;
  max-height: 280px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ——— Einstellungen ————————————————————— */

.settings-saved {
  background: var(--sage-wash);
  color: var(--sage-deep);
  border: 1px solid var(--sage-light);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
}

.settings-form { display: flex; flex-direction: column; gap: 0; }

.settings-section {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.settings-section h2 {
  font-family: var(--serif);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
  margin: 0 0 1.2rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1rem;
}

.field:last-child { margin-bottom: 0; }

.field label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.field input[type="text"],
.field input[type="number"],
.field select {
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0.4rem 0.65rem;
  font-family: var(--serif);
  font-size: 0.9rem;
  background: var(--paper-raised);
  color: var(--ink);
  max-width: 28rem;
}

.field input[type="number"] { max-width: 6rem; }

.field input:focus,
.field select:focus {
  outline: 2px solid var(--sage);
  outline-offset: 1px;
  border-color: transparent;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin: 0;
}

.field-hint-inline {
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.85rem 2rem;
}

.review-grid .field { margin-bottom: 0; }

.review-grid input[type="number"] { max-width: 5rem; }

.ri-hint {
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.settings-actions {
  padding: 1.5rem 0 0;
}

.cost-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.cost-card {
  padding: 0.75rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--bg-soft, transparent);
}

.cost-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}

.cost-value {
  font-family: var(--serif);
  font-size: 1.4rem;
  margin: 0.25rem 0;
}

.cost-meta {
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.cost-breakdown {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1rem;
  font-size: 0.85rem;
}

.cost-breakdown th,
.cost-breakdown td {
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--rule);
}

.cost-breakdown th {
  font-weight: normal;
  color: var(--ink-faint);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cost-range-form {
  display: flex;
  align-items: end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.cost-range-form .field { margin-bottom: 0; }

.cost-range-result { margin-top: 0.75rem; }

.tools-section { border-bottom: none; }

.tool-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.tool-meta { flex: 1; }
.tool-meta strong { font-size: 0.9rem; }
.tool-meta .field-hint { margin-top: 0.2rem; }

/* ——— Burger / Mobile Nav ———————————————— */

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.nav-burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.15rem;
  color: var(--ink-muted);
  line-height: 0;
}

.nav-burger .icon-close { display: none; }
.nav-burger[aria-expanded="true"] .icon-burger { display: none; }
.nav-burger[aria-expanded="true"] .icon-close { display: block; }

/* ——— Responsive ———————————————————————— */

@media (max-width: 600px) {
  body { font-size: 17px; }
  .masthead-inner { padding: 1.1rem var(--gutter); }
  .item-foot { align-items: flex-start; flex-direction: column; gap: 0.7rem; }
  .brand { font-size: 1.15rem; }
  .column { padding: 2rem var(--gutter) 3.5rem; }
  h1.title { font-size: 2rem; }
  article p.lede::first-letter { font-size: 3.4rem; }

  .nav-burger { display: flex; align-items: center; }
  .nav-fragen { margin-right: 0; }
  .nav form { display: block; width: 100%; padding: 0; }

  .nav {
    display: none;
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 0.3rem 0 0.3rem;
    z-index: 200;
    min-width: 9rem;
    box-shadow: 0 4px 20px rgba(31,26,23,0.12);
  }

  .nav.nav-open { display: flex; }

  .nav a, .nav .nav-logout {
    width: 100%;
    padding: 1.1rem 1.2rem;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-align: left;
    border-bottom: 1px solid var(--rule-soft);
    border-radius: 0;
    text-transform: none;
  }

  .nav > *:first-child { padding-top: 12px; }

  .nav > *:last-child,
  .nav > *:last-child .nav-logout { border-bottom: none; padding-bottom: 12px; }

  .nav a[aria-current="page"] { border-bottom-color: var(--rule-soft); }
}

@media (min-width: 900px) {
  .column { padding: 4.5rem var(--gutter) 6rem; }
}

/* ——— Log-Viewer ————————————————————— */

.log-page-header {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}

.log-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.log-search {
  flex: 1 1 14rem;
  min-width: 10rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper-raised);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 0.85rem;
}

.log-level-select {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper-raised);
  color: var(--ink);
  font-size: 0.85rem;
}

.log-count {
  font-size: 0.78rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.log-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 6px;
  margin-top: 2rem;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  font-family: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  font-size: 0.72rem;
  line-height: 1.45;
}

.log-table thead th {
  background: var(--paper-raised);
  color: var(--ink-muted);
  font-family: var(--serif);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

.log-table tbody tr {
  border-bottom: none;
}

.log-table tbody tr:nth-child(odd)  { background: var(--paper); }
.log-table tbody tr:nth-child(even) { background: var(--paper-raised); }

.log-table td {
  padding: 0.55rem 0.75rem;
  vertical-align: top;
  border-top: 1px solid var(--rule-soft);
}

.log-table tbody .log-row.log-error   { background: #fff0f0; }
.log-table tbody .log-row.log-warning { background: #fef9e7; }
.log-table tbody .log-row.log-debug   { color: var(--ink-muted); }

.level-badge {
  display: inline-block;
  padding: 0.1em 0.45em;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.level-error   { background: #fde8e8; color: #c0392b; }
.level-warning { background: #fef3cd; color: #7d5a00; }
.level-info    { background: var(--sage-wash); color: var(--sage-deep); }
.level-debug   { background: var(--rule-soft); color: var(--ink-muted); }

.col-ts     { white-space: nowrap; color: var(--ink-muted); width: 11rem; }
.col-level  { white-space: nowrap; width: 5.5rem; }
.col-logger { white-space: nowrap; color: var(--ink-muted); width: 9rem; }
.col-msg    { word-break: break-word; }

.exc-detail {
  margin-top: 0.3rem;
}

.exc-detail summary {
  cursor: pointer;
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.exc-detail pre {
  margin: 0.3rem 0 0;
  padding: 0.5rem;
  background: var(--ink);
  color: #d4cfca;
  border-radius: 4px;
  font-size: 0.68rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-msg-text {
  word-break: break-word;
  font-weight: 600;
}

.log-extras {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.15rem 1.5rem;
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--rule-soft);
  font-family: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  font-size: 0.68rem;
}

.log-extra-pair {
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
  overflow: hidden;
}

.log-extras dt {
  color: var(--ink-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.log-extras dd {
  margin: 0;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 120ms ease;
  border-radius: 3px;
  padding: 0 0.2em;
}

.log-extras dd[data-copy]:hover {
  background: var(--sage-wash, rgba(0, 0, 0, 0.05));
}

.log-extras dd.copied {
  color: var(--sage, #4a7c59);
  font-weight: 500;
}

.log-footer {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* Archivierte Seiten */

.banner-archiviert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--sage-wash);
  border-left: 3px solid var(--sage);
  padding: 0.75rem 1rem;
  margin-bottom: 2.5rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.archiv-liste {
  list-style: none;
  padding: 0;
  margin: 0;
}

.archiv-item {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule-soft);
}

.archiv-item:last-child { border-bottom: none; }

.archiv-item-title {
  font-family: var(--display);
  font-variation-settings: "opsz" 30, "wght" 420, "SOFT" 20;
  color: var(--ink);
  text-decoration: none;
  flex: 1;
}

.archiv-item-title:hover { color: var(--sage-deep); }

.archiv-item-meta {
  font-size: 0.8rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

article a.wikilink.wikilink-archived {
  color: #C06420;
  border-bottom-color: #C06420;
}

article a.wikilink.wikilink-archived:hover {
  background: #fdf0e6;
  border-bottom-color: #C06420;
}

.wikilink-archived .archived-marker {
  font-size: 0.78em;
  opacity: 0.7;
}

.archived-chip {
  opacity: 0.7;
  font-style: italic;
}

.suche-archiv-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.9rem;
  color: var(--ink-soft);
  cursor: pointer;
}

/* ——— Artikel-Bilder + Lightbox ————————— */

article img {
  max-width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
  border-radius: 2px;
  margin: 1.2rem 0;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 26, 23, 0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  cursor: zoom-out;
}

.lightbox-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-overlay img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.5);
  cursor: zoom-out;
}
