/* Graveyard Digger – dunkles "Friedhof bei Nacht"-Theme mit hellem Kalkstein-Theme */
:root {
  color-scheme: light;
  --bg: #E8E9E3;
  --surface: #F4F4EF;
  --surface-2: #DCDED6;
  --line: #C3C7BC;
  --ink: #1E2421;
  --ink-soft: #4E5751;
  --accent: #A45F12;
  --accent-ink: #FFFFFF;
  --moss: #4F6B4A;
  --tech-red: #B23A2E;
  --tech-green: #3F7D3A;
  --tech-blue: #2F5E9E;
  --done: #3F7D3A;
  --spoiler: #D8D2C2;
  --shadow: 0 1px 2px rgb(30 36 33 / .08);
  --f-display: "Pirata One", "UnifrakturMaguntia", Georgia, serif;
  --f-body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #171B1D; --surface: #1F2528; --surface-2: #283034; --line: #36403F;
    --ink: #DCE0D8; --ink-soft: #9AA59E; --accent: #E09B3D; --accent-ink: #1A1408; --moss: #7FA07A;
    --tech-red: #E0705F; --tech-green: #7DC274; --tech-blue: #74A3E8; --done: #7DC274; --spoiler: #2B2A24;
    --shadow: 0 1px 2px rgb(0 0 0 / .4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171B1D; --surface: #1F2528; --surface-2: #283034; --line: #36403F;
  --ink: #DCE0D8; --ink-soft: #9AA59E; --accent: #E09B3D; --accent-ink: #1A1408; --moss: #7FA07A;
  --tech-red: #E0705F; --tech-green: #7DC274; --tech-blue: #74A3E8; --done: #7DC274; --spoiler: #2B2A24;
  --shadow: 0 1px 2px rgb(0 0 0 / .4);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 17px/1.55 var(--f-body);
  padding-inline: 16px;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.2; }
h1 { font-size: 2rem; margin: .2em 0 .4em; }
h2 { font-size: 1.45rem; margin: 1.4em 0 .5em; }
h3 { font-size: 1.15rem; margin: 1.2em 0 .4em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: .88em; }

/* ---------------------------------------------------------------- Kopfzeile */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px;
  padding-block: 10px; margin-inline: -16px; padding-inline: 16px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.wordmark {
  font-family: var(--f-display); font-size: 1.9rem; line-height: 1; color: var(--ink);
  text-decoration: none; letter-spacing: .01em; white-space: nowrap;
}
.wordmark::first-letter { color: var(--accent); }
.search { flex: 1 1 260px; }
.search input {
  width: 100%; font: inherit; font-size: 1rem; padding: 7px 12px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 6px;
}
.dlc-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: 500 .82rem/1 var(--f-body); letter-spacing: .02em;
  padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--ink-soft); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------------------------------------------------------------- Layout */
.shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 32px; max-width: 1280px; margin: 0 auto; padding-block: 20px 40px; }
.sidenav { position: sticky; top: 80px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.sidenav a {
  display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 6px;
  color: var(--ink-soft); text-decoration: none; font-weight: 500;
}
.sidenav a .count { font-family: var(--f-mono); font-size: .75rem; opacity: .75; }
.sidenav a:hover { background: var(--surface-2); color: var(--ink); }
.sidenav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.sidenav .sep { height: 1px; background: var(--line); margin: 8px 0; }
main { min-width: 0; }
main:focus { outline: none; }
.footer { max-width: 1280px; margin: 0 auto; padding-block: 16px 32px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .85rem; }
.loading { color: var(--ink-soft); }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; gap: 16px; padding-block: 12px 32px; }
  .sidenav { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .sidenav a { white-space: nowrap; background: var(--surface); }
  .sidenav .sep { display: none; }
  .wordmark { font-size: 1.6rem; }
}

/* ---------------------------------------------------------------- Bausteine */
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-soft); }
.lede { color: var(--ink-soft); max-width: 65ch; margin-top: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 16px; }
.toolbar input, .toolbar select, .field input, .field select, .field textarea {
  font: inherit; font-size: .95rem; padding: 6px 10px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
}
.toolbar input[type="search"] { flex: 1 1 220px; }
.btn {
  font: 500 .9rem/1 var(--f-body); padding: 8px 14px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--tech-red); }
.muted { color: var(--ink-soft); }
.small { font-size: .85rem; }

.dlc-tag {
  display: inline-block; font: 600 .7rem/1 var(--f-body); letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 6px; border-radius: 4px; border: 1px solid currentColor; color: var(--ink-soft); white-space: nowrap;
}
.dlc-tag[data-dlc="Breaking Dead"] { color: var(--tech-green); }
.dlc-tag[data-dlc="Stranger Sins"] { color: var(--tech-red); }
.dlc-tag[data-dlc="Game of Crone"] { color: var(--accent); }
.dlc-tag[data-dlc="Better Save Soul"] { color: var(--tech-blue); }

.tp { font-family: var(--f-mono); font-size: .82em; font-weight: 600; white-space: nowrap; margin-right: .5em; }
.tp.rot { color: var(--tech-red); } .tp.grün { color: var(--tech-green); } .tp.blau { color: var(--tech-blue); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.card:hover { border-color: var(--accent); }
.card img { width: 48px; height: 48px; object-fit: contain; flex: none; image-rendering: pixelated; }
.card .t { font-weight: 700; }
.card .s { font-size: .85rem; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
table.data { border-collapse: collapse; width: 100%; font-size: .92rem; }
table.data th, table.data td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); background: var(--surface-2); position: sticky; top: 0; cursor: pointer; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data td img { width: 28px; height: 28px; object-fit: contain; image-rendering: pixelated; vertical-align: middle; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; font-size: .9rem; }

.ing { display: inline-flex; align-items: center; gap: 3px; margin: 1px 8px 1px 0; white-space: nowrap; }
.ing .q { font-family: var(--f-mono); font-size: .8rem; color: var(--ink-soft); }

/* Fortschrittsbalken */
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--done); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.stat { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 6px; text-decoration: none; color: var(--ink); }
.stat .v { font-family: var(--f-mono); font-size: 1.1rem; font-variant-numeric: tabular-nums; }

/* Story */
.chapter { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 24px; }
.chapter h2 { font-family: var(--f-display); font-weight: 400; font-size: 1.9rem; margin: .2em 0 .3em; letter-spacing: .01em; }
.chapter .intro { max-width: 70ch; }
.steps { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 4px; }
.step { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 6px 8px; border-radius: 6px; }
.step:hover { background: var(--surface); }
.step.done .label { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--line); }
.step input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--done); }

/* Quests */
details.quest { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); margin-bottom: 6px; }
details.quest > summary { display: flex; gap: 10px; align-items: center; padding: 8px 12px; cursor: pointer; list-style: none; }
details.quest > summary::-webkit-details-marker { display: none; }
details.quest > summary .name { flex: 1; font-weight: 500; }
details.quest[data-done="1"] > summary .name { color: var(--ink-soft); text-decoration: line-through; }
details.quest > summary input { width: 18px; height: 18px; accent-color: var(--done); }
details.quest .body { padding: 4px 14px 14px; border-top: 1px solid var(--line); }
.npc-group h3 { display: flex; align-items: center; gap: 8px; }
.npc-group h3 img { width: 32px; height: 32px; object-fit: contain; }

/* ---------------------------------------------------------------- Wiki-Artikel */
.article-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.article-head h1 { margin-bottom: 0; }
.article-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.wiki { max-width: 900px; }
.wiki p, .wiki li { max-width: 72ch; }
.wiki img { image-rendering: auto; vertical-align: middle; height: auto; }
.wiki table { border-collapse: collapse; max-width: 100%; }
.wiki .wikitable, .wiki table.infoboxtable { display: block; overflow-x: auto; }
.wiki .wikitable th, .wiki .wikitable td { border: 1px solid var(--line); padding: 5px 8px; vertical-align: top; }
.wiki .wikitable th { background: var(--surface-2); }
.wiki table.infoboxtable {
  float: right; clear: right; width: min(300px, 100%); margin: 0 0 12px 16px; border: 1px solid var(--line);
  background: var(--surface); border-radius: 8px; font-size: .9rem;
}
.wiki table.infoboxtable th, .wiki table.infoboxtable td { padding: 5px 10px; text-align: left; }
.wiki table.infoboxtable .infoboxname { font-size: 1.1rem; text-align: center; background: var(--surface-2); }
.wiki table.infoboxtable .infoboxdetails { background: var(--surface-2); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.wiki table.infoboxtable img { display: block; margin: 0 auto; max-height: 220px; width: auto; }
.wiki figure { margin: 12px 0; }
.wiki figure.mw-halign-right, .wiki .tright { float: right; clear: right; margin-left: 16px; }
.wiki figcaption { font-size: .85rem; color: var(--ink-soft); }
.wiki a.gi { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.wiki a.gi img { width: 24px; height: 24px; object-fit: contain; image-rendering: pixelated; }
.wiki .redlink { color: var(--ink-soft); }
.wiki blockquote { border-left: 3px solid var(--accent); margin-left: 0; padding-left: 14px; }
.wiki h2, .wiki h3 { scroll-margin-top: 80px; }
.wiki .mw-headline { scroll-margin-top: 80px; }
.wiki::after { content: ""; display: block; clear: both; }
.gk-spoiler { position: relative; border: 1px dashed var(--line); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.gk-spoiler.hidden-spoiler > :not(.spoiler-btn) { display: none; }
.spoiler-btn { margin: 4px 0; }
.related { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 8px; }

/* Spielstand */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.field { display: grid; gap: 4px; }
.field label { font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); }
.field textarea { min-height: 120px; resize: vertical; }
.money { display: flex; gap: 6px; }
.money input { width: 100%; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.notice { font-size: .9rem; color: var(--ink-soft); }
.toast { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: 6px; z-index: 20; }
.search-hit { padding: 10px 0; border-bottom: 1px solid var(--line); }
.search-hit .t { font-weight: 700; font-size: 1.05rem; }
.search-hit mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* Bauen: Projekte, Materialien, Planer */
.stepper { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn.small-btn { padding: 4px 9px; font-size: .95rem; line-height: 1; }
.btn:disabled { opacity: .45; cursor: default; }
.pill { display: inline-block; font-size: .78rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink); white-space: nowrap; margin: 1px 0; }
.ok { color: var(--done); font-weight: 600; }
.miss { color: var(--tech-red); font-weight: 600; }
tr.row-ok td { opacity: .7; }
tr[data-done="1"] b a { text-decoration: line-through; color: var(--ink-soft); }
.ing img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; }
.plan-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .plan-grid { grid-template-columns: 1fr; } }
.c-mats { display: grid; gap: 6px; margin-top: 12px; }
.c-mat { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: 6px; }
.c-mat input, input.have { font: inherit; font-size: .95rem; padding: 5px 8px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; min-width: 0; }
input.have { width: 80px; }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.article-head h1 img { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; vertical-align: middle; }

/* Layouts & Checklisten (Tabellen-Ansicht) */
.ly-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ly-leg { font: inherit; font-size: .85rem; padding: 4px 9px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.ly-leg.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.ly-sheet { display: grid; width: max-content; background: #fff; color: #222; font: 11px/1.15 Arial, "Liberation Sans", sans-serif; padding: 4px; }
.ly-sheet .x { display: flex; align-items: center; min-width: 0; overflow: visible; white-space: pre; position: relative; }
.ly-sheet .x > span { position: relative; z-index: 1; padding: 0 1px; }
.ly-sheet .x.wr { white-space: pre-wrap; overflow: hidden; }
.ly-sheet .x.wr > span { overflow-wrap: anywhere; }
.ly-sheet a { color: #1155cc; }
.ly-sheet .ck { cursor: pointer; }
.ly-sheet .ck:hover { outline: 2px solid #a45f12; outline-offset: -2px; z-index: 2; }
.ly-sheet .ck:focus-visible { outline: 2px solid #a45f12; outline-offset: -2px; z-index: 2; }
.ly-sheet .ck.done { box-shadow: inset 0 0 0 999px rgb(63 125 58 / .45); }
.ly-sheet .ck.done > span { text-decoration: line-through; }
.ly-sheet .ck.done::after { content: "✓"; position: absolute; right: 1px; top: -1px; font-size: 10px; font-weight: 700; color: #1d4d1a; z-index: 3; }
.ly-sheet .hl { outline: 2px solid #d9480f; outline-offset: -2px; z-index: 2; animation: lypulse 1.2s ease-in-out 2; }
@keyframes lypulse { 50% { outline-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .ly-sheet .hl { animation: none; } }
.ly-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin: 4px 0 12px; }
.ly-tabs .chip { text-decoration: none; white-space: nowrap; }
.ly-plan { margin-bottom: 12px; }
.ly-plan .ly-leg { padding: 2px 8px; }
.ly-plan select { font: inherit; font-size: .9rem; padding: 3px 6px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; max-width: 220px; }
.ly-sheet .obj > span { font-weight: 700; letter-spacing: .02em; }
.ly-note { font: 700 10px/1 var(--f-mono); min-width: 16px; height: 16px; padding: 0 3px; border-radius: 999px; border: 0; background: #a45f12; color: #fff; cursor: pointer; }
.ly-note:focus-visible { outline: 2px solid #1e2421; }
.ly-notes { margin-top: 16px; }
.ly-notes ol { padding-left: 1.6em; display: grid; gap: 6px; max-width: 80ch; }
.ly-notes li { padding: 4px 8px; border-radius: 6px; white-space: pre-line; }
.ly-notes li.flash { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.sync-source select { font: inherit; font-size: .9rem; padding: 3px 6px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; max-width: 100%; }
.warn-note { color: var(--accent); margin: 8px 0 0; }

/* Layout-Plan im Stil der Website (nur Anzeige) */
.ly-sheet.ly-site { background: var(--surface); color: var(--ink-soft); font: 11px/1.15 var(--f-body); }
.ly-sheet.paper { background: #fff; color: #222; }
.ly-site .x.area { background: color-mix(in srgb, var(--area) 38%, var(--surface)); }
.ly-site .x.obj { background: color-mix(in srgb, var(--tile) 62%, var(--surface)); color: var(--ink); font-weight: 700; justify-content: center; text-align: center; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 25%, transparent); }
.ly-site .x.obj.done { background: color-mix(in srgb, var(--done) 55%, var(--surface)); color: var(--ink); }
.ly-site .x.obj.done::after { content: "✓"; position: absolute; right: 2px; top: 0; font-size: 10px; font-weight: 700; color: var(--ink); z-index: 3; }
.ly-site .hl { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 2; }
.ly-site a { color: var(--accent); }
/* Gebäudeliste */
.ly-list td { vertical-align: middle; }
.ly-swatch { display: inline-block; min-width: 38px; padding: 2px 6px; border-radius: 4px; text-align: center; background: color-mix(in srgb, var(--tile) 62%, var(--surface)); color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 25%, transparent); }
.ly-boxes { display: flex; flex-wrap: wrap; gap: 3px; max-width: 260px; }
.ly-box { width: 18px; height: 18px; padding: 0; border-radius: 4px; border: 1.5px solid var(--line); background: var(--bg); cursor: pointer; }
.ly-box.on { background: var(--done); border-color: var(--done); }
.ly-box.on::after { content: "✓"; color: var(--bg); font-size: 12px; font-weight: 700; line-height: 1; }
.ly-box:hover { border-color: var(--accent); }
/* Laufende Quests und Spielstand-Übersicht */
.pill-active { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); font-weight: 700; font-size: .72rem; letter-spacing: .03em; }
details.quest > summary .pill-active { margin-right: 4px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 24px; }
.save-info h3 { margin: 1em 0 .4em; }
.rel { display: grid; grid-template-columns: 120px minmax(60px, 1fr) 32px; gap: 8px; align-items: center; }
.ly-site .x.wr { overflow: hidden; }
.ly-site .x.wr > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ly-site .x.area { background: color-mix(in srgb, var(--area) 30%, var(--surface)); }

/* Aktive Quests (live) – Karten wie im Spielmenü „NPCs“ */
.live-bar { align-items: center; gap: 12px; flex-wrap: wrap; }
.live-grid { display: grid; align-items: start; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 12px; }
.live-card { display: grid; grid-template-columns: 76px 1fr; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; box-shadow: var(--shadow); }
.live-portrait { display: flex; align-items: flex-start; justify-content: center; }
.live-portrait img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; background: var(--surface-2); border-radius: 50%; padding: 4px; }
.live-body h3 { margin: 0 0 4px; font-size: 1.15rem; }
.live-rel { grid-template-columns: 70px minmax(60px, 1fr) 32px; margin-bottom: 6px; }
.live-task { display: grid; grid-template-columns: 14px 1fr; gap: 8px; align-items: start; padding: 4px 0; }
.live-dot { width: 9px; height: 9px; margin-top: .45em; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.live-txt { font-weight: 600; }
.live-sol summary { cursor: pointer; color: var(--ink-soft); }
.live-sol .body { margin-top: 6px; }
.live-done { margin-top: 16px; }
.live-done summary { cursor: pointer; }
@media (max-width: 520px) {
  .live-card { grid-template-columns: 44px 1fr; gap: 10px; padding: 12px; }
  .live-portrait img { width: 40px; height: 40px; padding: 2px; }
}

/* Bauplan-Karte: jedes Kästchen = ein Feld im Spiel, quadratisch und auf Seitenbreite skaliert */
:root { --paper: #FFFFFF; --grid: #E2E4DE; --wall: #3A413D; --obj-line: rgb(20 24 22 / .6); --tile-mix: 88%; --obj-ink: #1E2421; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --paper: #1B2022; --grid: #2B3336; --wall: #B5BEB7; --obj-line: rgb(230 235 228 / .55); --tile-mix: 42%; --obj-ink: #E6EAE2; }
}
:root[data-theme="dark"] { --paper: #1B2022; --grid: #2B3336; --wall: #B5BEB7; --obj-line: rgb(230 235 228 / .55); --tile-mix: 42%; --obj-ink: #E6EAE2; }
.ly-mapwrap { container-type: inline-size; background: var(--paper); border: 1px solid var(--line); padding: 6px; }
.ly-map { display: grid; width: 100%; margin: 0 auto;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr)); grid-template-rows: repeat(var(--m), minmax(0, 1fr));
  background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px), linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: calc(100% / var(--n)) calc(100% / var(--m));
  box-shadow: inset -1px -1px 0 var(--grid);
  font: 700 clamp(5px, min(100cqw / var(--n), 100cqh / var(--m)) * .78, 15px)/1 var(--f-body); color: var(--obj-ink); }
.ly-map .x { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; overflow: hidden; position: relative; white-space: nowrap; }
.ly-map .x > span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 0 1px; }
.ly-map .x.area { background: color-mix(in srgb, var(--area) 40%, transparent); color: var(--ink-soft); font-weight: 600; }
.ly-map .x.obj { background: color-mix(in srgb, var(--tile) var(--tile-mix), var(--paper)); box-shadow: inset 0 0 0 1px var(--obj-line); color: var(--obj-ink); cursor: pointer; z-index: 1; }
.ly-map .x.obj.done { background: color-mix(in srgb, var(--done) 72%, var(--paper)); }
.ly-map .x.obj.done::after { content: "✓"; position: absolute; right: 1px; top: 1px; font-size: .85em; line-height: 1; }
.ly-map .x.obj:hover, .ly-map .hl { box-shadow: inset 0 0 0 2px var(--accent); z-index: 2; }
.ly-map .hl { animation: lymap 1.2s ease-in-out 2; }
@keyframes lymap { 50% { box-shadow: inset 0 0 0 2px transparent; } }
@media (prefers-reduced-motion: reduce) { .ly-map .hl { animation: none; } }
.ly-map .ly-note { font-size: .8em; min-width: 1.6em; height: 1.6em; padding: 0 .2em; }
.ly-mapwrap:fullscreen, .ly-mapwrap.pseudo-full { container-type: size; display: flex; align-items: center; justify-content: center; padding: 12px; }
.ly-mapwrap.pseudo-full { position: fixed; inset: 0; z-index: 60; }
.ly-mapwrap:fullscreen .ly-map, .ly-mapwrap.pseudo-full .ly-map { width: min(100%, (100cqh) * var(--n) / var(--m)); }
.ly-key { white-space: nowrap; margin-left: 6px; }
.ly-key i { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin-right: 3px; box-shadow: inset 0 0 0 1px var(--obj-line); }
.ly-key .k-open { background: color-mix(in srgb, #CFE2F3 var(--tile-mix), var(--paper)); }
.ly-key .k-done { background: color-mix(in srgb, var(--done) 72%, var(--paper)); }
.ly-list tr.flash td { background: color-mix(in srgb, var(--accent) 18%, transparent); }
/* Tabellen und Zusatzinfos: Excel-Optik, Spalten anteilig, kein Querscrollen */
.ly-side-wrap { background: #fff; border: 1px solid var(--line); padding: 4px; margin-bottom: 12px; }
.ly-sheet.ly-side, .ly-sheet.ly-table { width: 100%; padding: 0; }
.ly-side .x, .ly-table .x { white-space: pre-wrap; overflow-wrap: normal; overflow: hidden; }
.ly-side .x.wr > span, .ly-table .x.wr > span { overflow-wrap: normal; }
.ly-side-wrap { overflow-x: auto; }  /* nur auf sehr schmalen Bildschirmen, falls die Wörter nicht mehr passen */
.ly-side .x > span, .ly-table .x > span { padding: 1px 2px; }

/* lange Wörter in Karten (z. B. „Beerenstrauchsetzling“) nicht über den Rand */
.card > div { min-width: 0; }
.card .t, .card .s { overflow-wrap: anywhere; }

/* „Zuletzt aktualisiert“ in der Kopfzeile */
.sidenav a.save-stamp { display: flex; align-items: flex-start; gap: 8px; font-size: .8rem; line-height: 1.3; color: var(--ink-soft); text-decoration: none;
  padding: 7px 10px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.save-stamp .dot { margin-top: .35em; }
@media (max-width: 820px) { .sidenav a.save-stamp { margin-bottom: 0; align-items: center; white-space: nowrap; } .save-stamp .dot { margin-top: 0; } }
.sidenav a.save-stamp[hidden] { display: none; }
.save-stamp .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-soft); flex: none; }
.save-stamp[data-state="ok"] .dot { background: var(--done); }
.save-stamp[data-state="ok"][data-live="1"] .dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--done) 25%, transparent); }
.save-stamp[data-state="new"] .dot, .save-stamp[data-state="busy"] .dot { background: var(--accent); }
.sidenav a.save-stamp[data-state="new"] { color: var(--accent); border-color: var(--accent); }
.sidenav a.save-stamp:hover { border-color: var(--accent); color: var(--ink); }
.stamp-line { font-size: .88rem; color: var(--ink-soft); margin: 0 0 12px; }
.update-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 70; display: flex; gap: 12px; align-items: center;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: 0 4px 16px rgb(0 0 0 / .25); max-width: calc(100vw - 32px); }
.starter-box { display: grid; gap: 4px; margin: 8px 0; }
.sync-opts { display: grid; gap: 8px; margin-top: 10px; }
.sync-opts select { font: inherit; font-size: .9rem; padding: 3px 6px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
.lan-box { margin-top: 6px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 6px; display: grid; gap: 4px; }

/* Bauplaner: Voraussetzungen und Herstellungs-Reihenfolge */
.prereq { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: 10px 12px; margin: 8px 0 12px; background: var(--bg); }
.prereq li { padding: 4px 0; }
.prereq .pre-note { color: var(--ink-soft); }
.flow-h { margin-top: 22px; }
.flow { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; counter-reset: none; }
.flow > li { border-left: 3px solid var(--line); padding-left: 12px; }
.flow-stage { font: 600 .78rem/1.2 var(--f-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; }
.flow-step { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.flow-step:last-child { border-bottom: 0; }
.flow-step.done { opacity: .6; }
.flow-runs { display: inline-block; min-width: 4.2em; font-family: var(--f-mono); font-weight: 600; color: var(--accent); }
.flow-ratio { font-family: var(--f-mono); font-size: .8rem; color: var(--ink); margin: 2px 0; }
.spare { color: var(--accent); font-weight: 600; }
.remote-form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.remote-form input { flex: 1 1 200px; font: inherit; font-size: .9rem; padding: 4px 8px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
.login-box { max-width: 460px; margin: 40px auto; }
.login-box input { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); }
.mac-setup { margin: 6px 0; }
.mac-setup summary { cursor: pointer; font-weight: 600; }
pre.cmd { white-space: pre-wrap; word-break: break-all; font: .8rem/1.4 var(--f-mono); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px; margin: 6px 0; user-select: all; }
