:root {
  --bg: #ebe4d6;
  --paper: #fffaf3;
  --ink: #1c1916;
  --muted: #5c5348;
  --line: #d7ccb8;
  --accent: #3d3428;
  --ok: #1f6b3a;
  --bad: #8b1e1e;
}
* { box-sizing: border-box; }
body {
  font-family: Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--ink);
  margin: 0;
  min-height: 100vh;
}
.site {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--accent);
  color: #f4efe6;
  padding: 0.85rem 1.2rem;
}
.site .inner {
  max-width: 68rem;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}
.site .brand {
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: inherit;
}
.site .tag { margin: 0; font-size: 0.9rem; opacity: 0.85; }
.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0 0;
}
.app-nav a {
  color: #f4efe6;
  text-decoration: none;
  padding: 0.25rem 0.55rem;
  border: 1px solid transparent;
  font-size: 0.92rem;
  opacity: 0.85;
}
.app-nav a:hover { opacity: 1; border-color: rgba(244, 239, 230, 0.35); }
.app-nav a.aktiv {
  opacity: 1;
  background: rgba(244, 239, 230, 0.12);
  border-color: rgba(244, 239, 230, 0.45);
}
.wrap { max-width: 68rem; margin: 1.25rem auto; padding: 0 1rem 6rem; }
body.karte-seite {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}
body.karte-seite .site { flex: 0 0 auto; }
body.karte-seite main.wrap.karte-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0.3rem 0.65rem 0.4rem;
  box-sizing: border-box;
}
body.karte-seite .topbar { margin: 0 0 0.3rem; }
body.karte-seite .topbar h1 { margin: 0; font-size: 1.2rem; }
body.karte-seite .karte-frame {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #142028;
  border: 1px solid var(--line);
}
body.karte-seite .karte-frame img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  object-fit: contain;
  object-position: center;
}
@media (max-width: 48rem) {
  body.karte-seite main.wrap.karte-wrap {
    margin: 0;
    padding-top: 0.15rem;
    padding-bottom: max(0.3rem, env(safe-area-inset-bottom));
    padding-left: max(0.35rem, env(safe-area-inset-left));
    padding-right: max(0.35rem, env(safe-area-inset-right));
  }
}
.char-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}
.char-card h3 { margin: 0 0 0.25rem; }
.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--line);
  color: var(--muted);
  margin-left: 0.35rem;
}
.badge.haupt { border-color: var(--accent); color: var(--accent); }
.badge.entwurf { border-color: #a67c2a; color: #a67c2a; }
.badge.fertig { border-color: var(--ok); color: var(--ok); }
tr.ausb-row td:first-child { font-weight: bold; }
.bogen-neu {
  background: #e8f2ea;
  border: 1px solid #b7d4be;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0 1rem;
}
.bogen-toolbar { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.bogen-wrap { max-width: 52rem; }

/* —— Charakterbogen (2 Seiten) —— */
.blatt {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.blatt-seite {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 1rem 1.15rem 0.75rem;
  box-shadow: 0 1px 0 rgba(28, 25, 22, 0.04);
}
.blatt-kopf {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.35rem;
  margin-bottom: 0.65rem;
}
.blatt-kopf-klein { border-bottom-width: 1px; }
.blatt-marke {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.blatt-kampagne { font-size: 0.82rem; color: var(--muted); text-align: right; }
.blatt-ident { margin-bottom: 0.75rem; }
.blatt-name-zeile {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}
.blatt-name {
  margin: 0;
  font-size: 1.85rem;
  line-height: 1.1;
  letter-spacing: 0.02em;
}
.blatt-herkunft {
  margin: 0.25rem 0 0;
  font-size: 1.02rem;
}
.blatt-meta-zeile {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.blatt-box {
  border: 1px solid var(--line);
  padding: 0.55rem 0.65rem 0.65rem;
  margin: 0;
  background: #fffcf7;
}
.blatt-box h3 {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.25rem;
}
.blatt-h3-hint {
  font-weight: normal;
  letter-spacing: 0;
  text-transform: none;
  margin-left: 0.35rem;
  opacity: 0.85;
}
.blatt-top3 {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 11rem minmax(13rem, 15rem) 1fr;
  align-items: start;
}
.blatt-abil-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 0.55rem;
}
.blatt-waffen-box { margin-top: 0.55rem; }
.blatt-kampf-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.2rem;
}
.blatt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.blatt-table th {
  text-align: left;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding: 0.12rem 0.2rem 0.2rem;
}
.blatt-table td {
  border-bottom: 1px solid #eee;
  padding: 0.18rem 0.2rem;
  vertical-align: middle;
}
.blatt-table-skills td { padding: 0.14rem 0.2rem; }
.blatt-table-skills td:nth-child(n+2),
.blatt-table-waffen td:nth-child(n+3) { white-space: nowrap; }
.blatt-num { text-align: right; font-variant-numeric: tabular-nums; }
.blatt-mini { font-size: 0.72rem; color: var(--muted); }
.blatt-row-gef { background: #f3eee4; }
.blatt-dmg-sum {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
}
.blatt-dmg-form {
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: 0.25rem;
}
.blatt-legende {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}
.blatt-trait-gloss {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--line);
}
.blatt-trait-gloss h4 {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.blatt-gloss-item {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.2rem 0;
  line-height: 1.35;
}
.blatt-gloss-item strong { color: var(--ink); }
.blatt-kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px dotted var(--line);
  padding: 0.15rem 0;
}
.blatt-kv-lab { font-size: 0.82rem; color: var(--muted); }
.blatt-kv-val { font-size: 1.05rem; font-weight: bold; line-height: 1.25; word-break: break-word; }
.blatt-kampf-block {
  display: grid;
  gap: 0;
  margin-bottom: 0.35rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--line);
}
.blatt-kampf-neben {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 0.75rem;
  margin-bottom: 0.15rem;
}
.blatt-kampf-neben .blatt-stat-num { font-size: 1.15rem; }
.blatt-stat {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 0.5rem;
  padding: 0.32rem 0;
  border-bottom: 1px solid #efe8dc;
}
.blatt-kampf-block .blatt-stat:last-child,
.blatt-kampf-neben .blatt-stat { border-bottom: none; }
.blatt-stat-lab {
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  align-self: end;
}
.blatt-stat-num {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  align-self: end;
}
.blatt-stat-detail {
  grid-column: 1 / -1;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.25;
  margin-top: 0.08rem;
}
.blatt-tracks { margin-top: 0.45rem; padding-top: 0.35rem; border-top: 1px solid var(--line); }
.blatt-track-row { margin: 0.35rem 0; }
.blatt-track-lab { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 0.15rem; }
.blatt-track { display: flex; flex-wrap: wrap; gap: 0.2rem; }
.blatt-boxchen {
  width: 0.85rem;
  height: 0.85rem;
  border: 1.5px solid var(--accent);
  background: #fff;
}
.blatt-boxchen.voll-wunde { background: #8b1e1e; border-color: #8b1e1e; }
.blatt-boxchen.voll-bel { background: #a67c2a; border-color: #a67c2a; }
/* Fertigkeiten: voll lesbar; Rang 0 nur sekundär, Pool bleibt klar */
tr.blatt-skill-leer td:first-child,
tr.blatt-skill-leer td.blatt-num:nth-child(2) {
  color: var(--muted);
  font-weight: normal;
}
tr.blatt-skill-rang td:first-child {
  color: var(--ink);
}
.blatt-skill-attr {
  color: var(--muted);
  font-weight: normal;
}
.blatt-skill-pool,
.blatt-skill-pool strong {
  color: var(--ink);
  font-weight: bold;
}
tr.blatt-skill-leer .blatt-skill-pool,
tr.blatt-skill-leer .blatt-skill-pool strong {
  color: var(--ink);
  font-weight: bold;
}

.blatt-grid-2 {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 1fr 1fr;
}
.blatt-faeh-box { grid-column: 1 / -1; }
.blatt-item {
  padding: 0.35rem 0;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}
.blatt-item:last-child { border-bottom: none; }
.blatt-item.gefuehrt { background: #f3eee4; margin: 0 -0.35rem; padding-left: 0.35rem; padding-right: 0.35rem; }
.blatt-item-sub { font-size: 0.82rem; color: var(--muted); margin-top: 0.1rem; }
.blatt-tag {
  display: inline-block;
  font-size: 0.68rem;
  border: 1px solid var(--line);
  padding: 0 0.3rem;
  color: var(--muted);
  vertical-align: middle;
}
.blatt-silber {
  margin: 0.5rem 0 0;
  font-weight: bold;
  font-size: 0.95rem;
}
.blatt-faeh {
  padding: 0.4rem 0;
  border-bottom: 1px solid #eee;
}
.blatt-faeh:last-child { border-bottom: none; }
.blatt-faeh-kopf { font-size: 0.95rem; }
.blatt-faeh-text {
  margin: 0.2rem 0 0;
  font-size: 0.86rem;
  color: var(--ink);
  line-height: 1.4;
}
.blatt-faeh-text em { color: var(--muted); }
.blatt-notizlinien {
  margin-top: 0.5rem;
  height: 4.5rem;
  background: repeating-linear-gradient(
    transparent,
    transparent 1.35rem,
    var(--line) 1.35rem,
    var(--line) calc(1.35rem + 1px)
  );
}
.blatt-fuss {
  margin-top: 0.65rem;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: right;
}

@media (max-width: 52rem) {
  .blatt-top3,
  .blatt-abil-grid,
  .blatt-grid-2 { grid-template-columns: 1fr; }
  .blatt-table-waffen { font-size: 0.8rem; }
}

@media print {
  @page {
    size: A4;
    margin: 8mm;
  }
  body.bogen-seite {
    background: #fff;
  }
  .no-print, .site, .topbar, #err, #neuBanner, #aktionen, #anpBox {
    display: none !important;
  }
  .bogen-wrap {
    max-width: none;
    margin: 0;
    padding: 0;
  }
  .blatt {
    gap: 0;
  }
  .blatt-seite {
    border: none;
    box-shadow: none;
    padding: 0;
    break-after: page;
    page-break-after: always;
    min-height: auto;
  }
  .blatt-seite:last-child {
    break-after: avoid;
    page-break-after: avoid;
  }
  .blatt-box { background: #fff; margin: 0; }
  .blatt-notiz-leer,
  .blatt-box[hidden] { display: none !important; }
  .blatt-notizlinien { display: none; }
  .blatt-name { font-size: 1.35rem; }
  .blatt-ident { margin-bottom: 0.45rem; }
  .blatt-kopf { margin-bottom: 0.4rem; padding-bottom: 0.25rem; }
  .blatt-box { font-size: 0.84rem; padding: 0.4rem 0.5rem 0.45rem; }
  .blatt-box h3 { margin-bottom: 0.3rem; font-size: 0.68rem; }
  .blatt-faeh { padding: 0.28rem 0; }
  .blatt-faeh-text { font-size: 0.74rem; line-height: 1.3; }
  .blatt-item { padding: 0.22rem 0; font-size: 0.82rem; }
  .blatt-item-sub { font-size: 0.74rem; }
  .blatt-top3 {
    grid-template-columns: 10.5rem 11.5rem 1fr;
    gap: 0.4rem;
  }
  .blatt-abil-grid,
  .blatt-grid-2 { gap: 0.4rem; margin-bottom: 0.4rem; }
  .blatt-waffen-box { margin-top: 0.4rem; }
  .blatt-table { font-size: 0.76rem; }
  .blatt-table-waffen { font-size: 0.72rem; }
  .blatt-trait-gloss { margin-top: 0.35rem; padding-top: 0.3rem; }
  .blatt-gloss-item { font-size: 0.72rem; margin: 0.12rem 0; }
  .blatt-fuss { margin-top: 0.35rem; }
}
.dash-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.anp-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.anp-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid #eee;
  font-size: 0.92rem;
}
.roster-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}
.regeln-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(12rem, 18rem) 1fr;
}
@media (max-width: 40rem) {
  .regeln-layout { grid-template-columns: 1fr; }
}
.regeln-nav {
  max-height: 70vh;
  overflow: auto;
}
.regeln-nav a {
  display: block;
  padding: 0.28rem 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.3;
}
.regeln-nav a.aktiv { font-weight: bold; color: var(--accent); }
@media (max-width: 40rem) {
  .regeln-nav { max-height: 14rem; }
}
.regeln-body { font-size: 0.95rem; line-height: 1.5; }
.regeln-body h2, .regeln-body h3, .regeln-body h4, .regeln-body h5 {
  margin: 1.1rem 0 0.4rem;
  font-size: 1.05rem;
}
.regeln-body h2 { font-size: 1.2rem; }
.regeln-body p { margin: 0.4rem 0; }
.regeln-body ul, .regeln-body ol { margin: 0.35rem 0 0.6rem 1.2rem; padding: 0; }
.regeln-body li { margin: 0.2rem 0; }
.regeln-body code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.88em;
  background: var(--bg);
  padding: 0.05rem 0.25rem;
}
.regeln-body pre {
  background: var(--bg);
  padding: 0.7rem 0.85rem;
  overflow: auto;
  font-size: 0.85rem;
}
.regeln-body pre code { background: none; padding: 0; }
.regeln-body hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.regeln-body .md-table-wrap {
  overflow-x: auto;
  margin: 0.55rem 0 0.9rem;
  -webkit-overflow-scrolling: touch;
}
.regeln-body table {
  border-collapse: collapse;
  width: 100%;
  min-width: 28rem;
  font-size: 0.86rem;
}
.regeln-body th,
.regeln-body td {
  border-bottom: 1px solid var(--line);
  padding: 0.32rem 0.45rem;
  text-align: left;
  vertical-align: top;
}
.regeln-body th {
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}
.katalog-tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.5rem 0 1rem; }
.katalog-tabs button.aktiv { background: var(--accent); color: #f4efe6; border-color: var(--accent); }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 1.1rem 1.15rem;
  margin: 0.7rem 0;
}
.hero { padding: 1.4rem 1.2rem; }
.hero h1 { margin: 0 0 0.4rem; font-size: 1.85rem; }
.hero p { margin: 0; color: var(--muted); }
label { display: block; margin: 0.45rem 0; }
input, select, textarea, button { font: inherit; padding: 0.35rem 0.5rem; }
textarea { width: 100%; min-height: 3.2rem; }
.bad { color: var(--bad); }
.ok { color: var(--ok); }
.waffen-bedarf-box {
  margin: 0.6rem 0 0.9rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.03);
}
.waffen-bedarf-box ul { margin: 0.35rem 0 0; padding-left: 1.2rem; }
.waffen-bedarf-box li { margin: 0.15rem 0; }
.waffe-bedarf { margin: 0.15rem 0 0.35rem 1.4rem; color: var(--muted); }
.waffe-bedarf strong { color: var(--ink); }
button {
  margin-top: 0.35rem;
  margin-right: 0.35rem;
  cursor: pointer;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}
button.primary, nav.tabs button.aktiv, .steps button.aktiv {
  background: var(--accent);
  color: #f4efe6;
  border-color: var(--accent);
}
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
td, th { text-align: left; border-bottom: 1px solid #ddd; padding: 0.2rem 0.3rem; }
.muted { color: var(--muted); }
nav.tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.8rem 0; }
nav.tabs button { margin-top: 0; }
.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.6rem 0 1rem;
}
.steps button { margin: 0; font-size: 0.88rem; }
.step[hidden] { display: none !important; }
.wuerfel { letter-spacing: 0.15em; font-size: 1.15rem; }
.komp { color: var(--bad); font-weight: bold; }
.krit { color: var(--ok); font-weight: bold; }
.topbar { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: baseline; }
.livezahl { font-size: 1.4rem; }
.hint { font-size: 0.9rem; color: var(--muted); }
/* Attribute / Fertigkeiten Stepper (sichtbar auf Mobile) */
.wert-cell {
  vertical-align: middle;
  min-width: 9.5rem;
}
.wert-step {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: nowrap;
  white-space: nowrap;
  max-width: 100%;
}
.wert-step input[type="number"] {
  width: 3.2rem;
  min-width: 2.75rem;
  text-align: center;
  margin: 0;
  -moz-appearance: textfield;
  appearance: textfield;
}
.wert-step input[type="number"]::-webkit-outer-spin-button,
.wert-step input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.wert-btn {
  margin: 0;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  font-size: 1.15rem;
  line-height: 1;
  flex: 0 0 auto;
  touch-action: manipulation;
}
.wert-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.wert-rest {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.82rem;
  line-height: 1.2;
  white-space: normal;
}
.gepaeck-block {
  margin: 1rem 0 1.25rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  background: #faf6ee;
}
.gepaeck-block h3 { margin: 0; font-size: 1.05rem; }
.gepaeck-sub {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.95rem;
}
.gepaeck-status {
  margin: 0.75rem 0 0;
  padding: 0.45rem 0.55rem;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 0.9rem;
}
.waffen-liste { display: flex; flex-direction: column; gap: 0.35rem; }
.waffe-zeile-kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
}
.waffe-gewaehlt { background: #fff; border: 1px solid var(--line); padding: 0.45rem 0.55rem; }
.aus-zeile { display: block; margin: 0.35rem 0; }
.lu-zeile {
  margin: 0.65rem 0 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}
.lu-zeile:last-child { border-bottom: 0; }
.lu-zeile label { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin-right: 0.35rem; }
.lu-zeile .hint { margin: 0.35rem 0 0; }
.lu-zeile .hint .text { display: block; margin-top: 0.2rem; }
details.backup summary { cursor: pointer; color: var(--muted); }
.sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 0.45rem 1.2rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: stretch;
  max-height: min(55vh, 28rem);
}
.sticky-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: space-between;
}
.sticky-toggle {
  flex: 1 1 12rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.4rem 0.55rem;
  text-align: left;
  background: #f7f1e6;
  border: 1px solid var(--line);
  cursor: pointer;
  min-height: 2.5rem;
}
.sticky-toggle:hover, .sticky-toggle:focus {
  border-color: var(--accent);
  outline: none;
}
.sticky-toggle-chevron {
  flex: 0 0 auto;
  font-size: 0.85rem;
  color: var(--muted);
}
.sticky-summary {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.92rem;
}
.sticky-toggle-action {
  flex: 0 0 auto;
  font-size: 0.82rem;
  color: var(--muted);
}
.sticky-bar-actions {
  display: none;
  flex: 0 0 auto;
  gap: 0.35rem;
  align-items: center;
}
.sticky-bar-actions button {
  margin: 0;
  min-height: 2.5rem;
}
.sticky.collapsed .sticky-bar-actions { display: flex; }
.sticky.collapsed .sticky-body { display: none; }
.sticky.collapsed {
  padding-bottom: max(0.45rem, env(safe-area-inset-bottom, 0px));
  max-height: none;
}
.sticky-body {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
}
.sticky-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  flex: 0 0 auto;
  position: relative;
  z-index: 5;
  padding-top: 0.2rem;
  background: var(--paper);
}
.sticky-actions button { margin: 0; touch-action: manipulation; }
.sticky-actions .sticky-save-main {
  flex: 1 1 calc(50% - 0.35rem);
  min-height: 2.5rem;
  font-size: 1rem;
}
.sticky-msg {
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
  padding: 0.35rem 0.5rem;
  font-size: 0.92rem;
  border: 1px solid var(--line);
  background: #f7f1e6;
  box-sizing: border-box;
}
.sticky-msg.ok { color: var(--ok); border-color: #9cba8a; background: #eef5e8; }
.sticky-msg.bad { color: var(--bad); border-color: #c99; background: #f8ecec; }
/* Eingeklappt: Aktionszeile bleibt — sonst ist Fertig auf dem Handy oft nicht erreichbar */
.sticky.collapsed .sticky-actions { display: flex; }
.sticky.collapsed #stepPrev { display: none; }
.sticky.collapsed #stepNext { display: none; }
.save-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0.35rem;
}
.save-step-actions button {
  flex: 1 1 10rem;
  min-height: 2.75rem;
  font-size: 1.05rem;
}
body.schaffen-leiste-klein .wrap { padding-bottom: 5.5rem; }
#tab-bogen[hidden] .sticky { display: none; }
.ol-quiet { color: var(--muted); padding-left: 1.2rem; }
.step-intro { margin: 0 0 0.85rem; color: var(--muted); font-size: 0.95rem; }
.step-warn { margin: 0 0 0.75rem; color: var(--bad); font-size: 0.92rem; }
.soft-warn {
  margin: 0 0 0.75rem;
  padding: 0.45rem 0.65rem;
  background: #f3e6c8;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.92rem;
}
.feld { margin: 0.65rem 0; }
.feld-kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}
.feld-kopf label { margin: 0; }
.feld-meta {
  font-size: 0.8rem;
  margin-left: 0.35rem;
  color: var(--muted);
  font-weight: normal;
}
.feld-meta.pflicht { color: var(--accent); }
.feld-meta.optional { color: var(--muted); font-style: italic; }
.detail-karte {
  margin-top: 0.35rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  background: #f7f1e6;
  font-size: 0.9rem;
}
.detail-karte strong { display: block; margin-bottom: 0.15rem; }
.detail-karte .kurz { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.25rem; }
.detail-karte .text { margin: 0; }
.btn-katalog {
  margin: 0;
  font-size: 0.82rem;
  padding: 0.15rem 0.45rem;
}
#checks {
  max-height: 9rem;
  overflow: auto;
  min-width: 0;
}
.checks-list { margin: 0; padding-left: 1.1rem; font-size: 0.9rem; }
.checks-list li { margin: 0.15rem 0; list-style: none; }
.check-goto {
  display: block;
  width: 100%;
  text-align: left;
  margin: 0;
  padding: 0.2rem 0.35rem;
  background: transparent;
  border: 1px dashed transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.check-goto:hover, .check-goto:focus {
  border-color: var(--accent);
  background: #f7f1e6;
  outline: none;
}
.abbr-box {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  flex: 0 1 11rem;
}
.abbr-box summary { cursor: pointer; color: var(--muted); }
.sticky-abbr {
  position: relative;
}
.sticky-abbr[open] {
  position: absolute;
  right: 0.5rem;
  bottom: 100%;
  z-index: 25;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0.5rem 0.7rem;
  max-width: min(22rem, 92vw);
  box-shadow: 0 -4px 16px rgba(28, 25, 22, 0.12);
}
.abbr-list { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.abbr-list li { margin: 0.2rem 0; }
#attrTable .wert-cell { white-space: normal; }
#attrTable th:nth-child(2),
#attrTable td:nth-child(2) { width: 3.5rem; text-align: center; }
#katalogDlg,
#luKatalogDlg,
dialog.katalog-dlg {
  border: 1px solid var(--line);
  padding: 0;
  max-width: min(36rem, 96vw);
  width: 100%;
  max-height: min(90vh, 90dvh, 40rem);
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
}
#katalogDlg[open],
#luKatalogDlg[open],
dialog.katalog-dlg[open] {
  display: flex;
  flex-direction: column;
}
#katalogDlg::backdrop,
#luKatalogDlg::backdrop,
dialog.katalog-dlg::backdrop { background: rgba(28, 25, 22, 0.45); }
html:has(#katalogDlg[open]),
html:has(#luKatalogDlg[open]),
html:has(dialog.katalog-dlg[open]) { overflow: hidden; }
.katalog-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  background: var(--paper);
}
.katalog-head h3 { margin: 0; flex: 1 1 auto; font-size: 1.05rem; min-width: 0; }
.katalog-head input { flex: 1 1 10rem; min-width: 0; width: 100%; }
#katalogListe,
.katalog-liste {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0.5rem 0.75rem 1rem;
}
.katalog-karte {
  display: block;
  width: 100%;
  text-align: left;
  margin: 0.35rem 0;
  padding: 0.75rem 0.85rem;
  background: #fff;
  border: 1px solid var(--line);
  cursor: pointer;
  word-break: break-word;
}
.katalog-karte:hover, .katalog-karte:focus {
  border-color: var(--accent);
  outline: none;
}
.katalog-karte strong { display: block; }
.katalog-karte .kurz { color: var(--muted); font-size: 0.85rem; }
.katalog-karte .text { margin: 0.25rem 0 0; font-size: 0.88rem; line-height: 1.4; }
.waffen-mehr { margin: 0.6rem 0; border: 1px solid var(--line); padding: 0.4rem 0.6rem; background: #f7f1e6; }
.waffen-mehr summary { cursor: pointer; color: var(--muted); }
.waffe-zeile { margin: 0.35rem 0; padding-bottom: 0.35rem; border-bottom: 1px solid #eee; }
.waffe-detail { margin: 0.15rem 0 0 1.4rem; }
.waffe-detail summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; }
.waffe-detail .hint { margin: 0.25rem 0 0; }
.wrap { padding-bottom: 10rem; }
.table-scroll,
.blatt-waffen-box,
.blatt-box:has(.blatt-table),
.card:has(> table),
#attrTable {
  max-width: 100%;
  min-width: 0;
}
img, svg, video, canvas { max-width: 100%; height: auto; }
input, select, textarea { max-width: 100%; }

/* Spielen: sticky Live + Tisch/Bogen-Wechsel */
.spielen-seite .site { position: relative; z-index: 20; }
.spielen-wrap { max-width: 58rem; }
.spiel-sticky {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  padding: 0.65rem 0.85rem;
  margin: 0 0 0.85rem;
  box-shadow: 0 6px 14px rgba(28, 25, 22, 0.08);
}
.spiel-sticky-kopf {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.spiel-modus {
  display: flex;
  gap: 0.25rem;
}
.spiel-modus button {
  margin: 0;
  min-width: 5.5rem;
}
.spiel-modus button.aktiv {
  background: var(--accent);
  color: #f4efe6;
  border-color: var(--accent);
}
.spiel-sticky-live {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  align-items: center;
}
.spiel-live-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.35rem;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 0.92rem;
}
.spiel-live-chip button {
  margin: 0;
  padding: 0.1rem 0.4rem;
  min-width: 1.6rem;
}
.spiel-live-lab {
  color: var(--muted);
  font-size: 0.8rem;
  margin-right: 0.15rem;
}
.spiel-ko { margin: 0.4rem 0 0; }
.takt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.takt-actions button { margin: 0; }
.kniff-gruppe { margin: 0.65rem 0 0.2rem; }
.kniff-gruppe h3 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}
.kniff-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  margin: 0.3rem 0;
  padding: 0.45rem 0.65rem;
  text-align: left;
  line-height: 1.35;
}
.kniff-btn .kniff-name { font-weight: 700; }
.kniff-btn .kniff-text {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.88rem;
}
.kniff-btn.ist-verbraucht {
  opacity: 0.62;
  background: var(--bg);
}
.kniff-btn.ist-verbraucht .kniff-name { text-decoration: line-through; }
.spiel-pane textarea {
  width: 100%;
  min-height: 6rem;
  font: inherit;
}
.bogen-kompakt-kopf {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
}
.bogen-kompakt-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0.75rem 0;
}
.bogen-kompakt-2 {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
  margin: 0.5rem 0;
}
.bogen-kompakt h3 {
  margin: 0.7rem 0 0.3rem;
  font-size: 0.95rem;
}
.bogen-notiz-pre {
  white-space: pre-wrap;
  font: inherit;
  margin: 0;
  padding: 0.5rem 0.65rem;
  background: var(--bg);
  border: 1px solid var(--line);
  min-height: 3rem;
}
@media (max-width: 50rem) {
  .bogen-kompakt-grid,
  .bogen-kompakt-2 { grid-template-columns: 1fr; }
}
.spiel-bogen-link { margin: 0 0 0.35rem; }
.spiel-bogen-frame {
  display: block;
  width: 100%;
  height: calc(100dvh - 13rem);
  min-height: 28rem;
  border: 1px solid var(--line);
  background: #fff;
}
html.bogen-embed .site,
html.bogen-embed .topbar,
html.bogen-embed #neuBanner,
html.bogen-embed #aktionen,
html.bogen-embed #freigabeBox,
html.bogen-embed #stufeBox,
html.bogen-embed #levelUpBox,
html.bogen-embed #anpBox,
html.bogen-embed #praegBox { display: none !important; }
html.bogen-embed body { background: #fff; }
html.bogen-embed .bogen-wrap {
  margin: 0 auto;
  padding: 0.2rem 0.15rem 1rem;
  max-width: none;
}

/* —— Mobil: volle Breite, kein Quer-Scroll, nichts abschneiden —— */
@media (max-width: 48rem) {
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }
  .site {
    padding: 0.55rem 0.65rem;
    padding-left: max(0.65rem, env(safe-area-inset-left));
    padding-right: max(0.65rem, env(safe-area-inset-right));
    padding-top: max(0.55rem, env(safe-area-inset-top));
  }
  .site .inner {
    max-width: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }
  .site .inner > div {
    width: 100%;
    min-width: 0;
  }
  .site .brand { font-size: 1.05rem; }
  .site .tag {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.3;
    width: 100%;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .app-nav {
    width: 100%;
    margin-top: 0.4rem;
    flex-wrap: wrap;
    overflow: visible;
    gap: 0.25rem;
  }
  .app-nav a {
    flex: 1 1 auto;
    text-align: center;
    padding: 0.45rem 0.5rem;
    font-size: 0.86rem;
    border-radius: 2px;
    border-color: rgba(244, 239, 230, 0.2);
  }
  .wrap,
  .bogen-wrap,
  .spielen-wrap {
    max-width: none;
    width: 100%;
    margin: 0.5rem 0 0;
    padding-top: 0;
    padding-left: max(0.65rem, env(safe-area-inset-left));
    padding-right: max(0.65rem, env(safe-area-inset-right));
    padding-bottom: calc(11rem + env(safe-area-inset-bottom));
  }
  .card {
    padding: 0.8rem 0.75rem;
    margin: 0.5rem 0;
    max-width: 100%;
    min-width: 0;
  }
  .hero h1 { font-size: 1.4rem; }
  .topbar {
    gap: 0.5rem;
    align-items: flex-start;
  }
  .topbar h1 { font-size: 1.3rem; margin: 0; min-width: 0; overflow-wrap: anywhere; }
  .grid { grid-template-columns: 1fr; gap: 0.65rem; }
  .roster-grid { grid-template-columns: 1fr; }

  input, select, textarea, button { font-size: 16px; }
  button, .btn-katalog, .spiel-modus button, .steps button, nav.tabs button {
    min-height: 2.5rem;
    padding: 0.45rem 0.65rem;
  }
  .btn-katalog { min-height: 2.25rem; margin-top: 0.25rem; }

  /* Schritte / Tabs: umbrechen, nicht seitlich scrollen */
  .steps,
  .katalog-tabs,
  nav.tabs {
    flex-wrap: wrap;
    overflow: visible;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
  }
  .steps button,
  .katalog-tabs button,
  nav.tabs button {
    flex: 1 1 auto;
    white-space: normal;
    text-align: center;
  }
  #checks { max-height: min(28vh, 7.5rem); flex: 1 1 100%; }
  .sticky {
    padding: 0.4rem max(0.65rem, env(safe-area-inset-left));
    padding-right: max(0.65rem, env(safe-area-inset-right));
    padding-bottom: max(1.35rem, env(safe-area-inset-bottom, 0px));
    gap: 0.3rem;
    max-height: min(48vh, 22rem);
  }
  .sticky.collapsed {
    padding-bottom: max(1.35rem, env(safe-area-inset-bottom, 0px));
  }
  body.schaffen-leiste-klein .wrap {
    padding-bottom: calc(8rem + env(safe-area-inset-bottom, 0px));
  }
  .sticky-toggle { flex: 1 1 auto; min-width: 0; }
  .sticky-toggle-action { display: none; }
  .sticky .abbr-box { flex: 1 1 100%; }
  .sticky-actions { flex: 1 1 100%; }
  .sticky-actions button,
  .sticky-actions .sticky-save-main { flex: 1 1 calc(50% - 0.35rem); min-height: 2.5rem; }
  .sticky-abbr[open] {
    left: 0.5rem;
    right: 0.5rem;
    max-width: none;
  }
  .feld-kopf { gap: 0.35rem; }
  .detail-karte { padding: 0.65rem 0.7rem; font-size: 0.92rem; }
  .treffer-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
  }
  .treffer-row button {
    margin: 0;
    min-width: 2.75rem;
    min-height: 2.75rem;
    font-size: 1.05rem;
  }
  #paneTisch > .card > p {
    line-height: 1.45;
    overflow-wrap: anywhere;
  }
  table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    word-break: break-word;
  }
  td, th { overflow-wrap: anywhere; }
  /* Attribute: Platz für − Wert + (4. Spalte entfällt) */
  #attrTable th:nth-child(1),
  #attrTable td:nth-child(1) { width: 32%; }
  #attrTable th:nth-child(2),
  #attrTable td:nth-child(2) { width: 14%; }
  #attrTable th:nth-child(3),
  #attrTable td:nth-child(3) { width: 54%; }
  #attrTable .wert-step {
    display: flex;
    width: 100%;
    justify-content: flex-start;
  }
  #attrTable .wert-btn {
    min-width: 2.5rem;
    min-height: 2.5rem;
  }
  #skillTable .wert-step {
    display: flex;
    width: 100%;
    justify-content: flex-start;
  }

  /* Katalog fullscreen */
  #katalogDlg,
  #luKatalogDlg,
  dialog.katalog-dlg {
    inset: 0;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    margin: 0;
    border: none;
    border-radius: 0;
  }
  .katalog-head {
    gap: 0.45rem;
    padding: max(0.7rem, env(safe-area-inset-top)) max(0.65rem, env(safe-area-inset-right)) 0.7rem max(0.65rem, env(safe-area-inset-left));
  }
  .katalog-head h3 { flex: 1 1 100%; }
  .katalog-head input { flex: 1 1 auto; min-width: 0; }
  .katalog-head #katalogSchliessen,
  .katalog-head [data-lu-kat-close] { flex: 0 0 auto; }
  #katalogListe,
  .katalog-liste {
    padding: 0.5rem max(0.65rem, env(safe-area-inset-right)) max(1.2rem, env(safe-area-inset-bottom)) max(0.65rem, env(safe-area-inset-left));
  }
  .katalog-karte {
    padding: 0.8rem 0.75rem;
    margin: 0.4rem 0;
    min-height: 2.75rem;
  }

  /* Spielen */
  .spiel-sticky {
    top: 0;
    width: 100%;
    max-width: 100%;
    padding: 0.55rem 0.55rem;
    margin: 0 0 0.75rem;
  }
  .spiel-sticky-kopf { margin-bottom: 0.4rem; }
  .spiel-modus { width: 100%; }
  .spiel-modus button { flex: 1; min-width: 0; }
  .spiel-live-chip {
    flex: 1 1 calc(50% - 0.4rem);
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 0.35rem 0.4rem;
    min-height: 2.6rem;
    min-width: 0;
  }
  .spiel-live-chip:has(input),
  .spiel-live-chip:has(select) { flex: 1 1 100%; }
  .spiel-live-chip button {
    min-width: 2.4rem;
    min-height: 2.4rem;
    font-size: 1.15rem;
    padding: 0;
  }
  .spiel-live-chip input,
  .spiel-live-chip select { font-size: 16px; max-width: 4.5rem; }

  /* Bogen: volle Breite, Tabellen umbrechen statt Quer-Scroll */
  .blatt { gap: 1rem; max-width: 100%; }
  .blatt-seite {
    padding: 0.7rem 0.55rem;
    max-width: 100%;
    overflow: visible;
  }
  .blatt-kopf {
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .blatt-kampagne {
    text-align: left;
    width: 100%;
    overflow-wrap: anywhere;
  }
  .blatt-name { font-size: 1.4rem; overflow-wrap: anywhere; }
  .blatt-top3,
  .blatt-abil-grid,
  .blatt-grid-2,
  .blatt-kampf-neben { grid-template-columns: 1fr; }
  .blatt-stat-num { font-size: 1.25rem; }
  .blatt-table {
    font-size: 0.86rem;
    table-layout: auto;
    width: 100%;
  }
  .blatt-table th,
  .blatt-table td {
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    padding: 0.16rem 0.28rem;
    vertical-align: baseline;
  }
  .blatt-table-skills th:nth-child(n+2),
  .blatt-table-skills td:nth-child(n+2) {
    white-space: nowrap;
    text-align: right;
    width: 1%;
  }
  .blatt-table-skills th:first-child,
  .blatt-table-skills td:first-child {
    text-align: left;
    width: auto;
  }
  .blatt-table-waffen,
  .blatt-table-waffen tbody { display: block; width: 100%; }
  .blatt-table-waffen tr {
    display: grid;
    grid-template-columns: auto auto auto minmax(0, 1fr);
    grid-template-areas: "name name name name" "dmg dice ap art" "props props props props";
    column-gap: 0.55rem;
    row-gap: 0.12rem;
    align-items: baseline;
    width: 100%;
    margin: 0;
    padding: 0.4rem 0 0.45rem;
    border-bottom: 1px solid #eee;
  }
  .blatt-table-waffen tr:first-child { display: none; }
  .blatt-table-waffen th,
  .blatt-table-waffen td {
    display: block;
    width: auto !important;
    min-width: 0;
    border-bottom: none;
    padding: 0;
    white-space: normal;
    text-align: left;
  }
  .blatt-table-waffen td:nth-child(1) { grid-area: name; font-weight: 700; font-size: 0.95rem; }
  .blatt-table-waffen td:nth-child(2) { grid-area: dmg; white-space: nowrap; }
  .blatt-table-waffen td:nth-child(3) { grid-area: dice; white-space: nowrap; }
  .blatt-table-waffen td:nth-child(4) { grid-area: ap; white-space: nowrap; }
  .blatt-table-waffen td:nth-child(5) { grid-area: art; justify-self: end; white-space: nowrap; }
  .blatt-table-waffen td:nth-child(6) {
    grid-area: props;
    font-weight: 400;
    font-size: 0.84rem;
  }
  .blatt-table-waffen td:nth-child(3)::before,
  .blatt-table-waffen td:nth-child(4)::before {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-right: 0.2rem;
  }
  .blatt-table-waffen td:nth-child(3)::before { content: "Würfel"; }
  .blatt-table-waffen td:nth-child(4)::before { content: "Durchschlag"; }
  .blatt-track { max-width: 100%; }
  .blatt-boxchen { flex: 0 0 auto; }
  .blatt-legende,
  .blatt-gloss-item,
  .blatt-faeh-text { overflow-wrap: anywhere; }
}

/* Druck gewinnt gegen das Handy-Layout, auch wenn das Telefon schmal ist. */
@media print {
  html, body {
    overflow: visible;
    max-width: none;
  }
  .blatt-seite {
    overflow: visible;
    max-width: none;
    padding: 0;
  }
  .blatt-kampagne {
    text-align: right;
    width: auto;
  }
  .blatt-name { font-size: 1.35rem; }
  .blatt-top3 { grid-template-columns: 10.5rem 11.5rem 1fr; }
  .blatt-abil-grid,
  .blatt-grid-2,
  .blatt-kampf-neben { grid-template-columns: 1fr 1fr; }
  .blatt-table {
    table-layout: auto;
    font-size: 0.76rem;
  }
  .blatt-table th,
  .blatt-table td {
    display: table-cell;
    width: auto;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    padding: 0.12rem 0.2rem;
  }
  .blatt-table-skills td:nth-child(n+2),
  .blatt-table-waffen td:nth-child(n+3) { white-space: nowrap; }
  .blatt-table-waffen { display: table; width: 100%; }
  .blatt-table-waffen thead { display: table-header-group; }
  .blatt-table-waffen tbody { display: table-row-group; }
  .blatt-table-waffen tr {
    display: table-row;
    margin: 0;
    padding: 0;
    border-bottom: none;
  }
  .blatt-table-waffen th,
  .blatt-table-waffen td {
    display: table-cell !important;
    width: auto !important;
    border-bottom: 1px solid #eee;
    font-size: 0.72rem;
  }
  .blatt-table-waffen td:first-child { font-weight: 700; }
  .blatt-table-waffen tr:first-child { display: table-row; }
  .blatt-table-waffen td::before { content: none !important; }
  .blatt-faeh { padding: 0.12rem 0; }
  .blatt-grid-2 { display: block; }
  #blattGeraet,
  #blattMagie {
    column-count: 2;
    column-gap: 0.7rem;
  }
  .blatt-faeh,
  .blatt-gloss-item {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* Schmale Bildschirme: dasselbe Blatt wie die PDF, auf die Breite passen. */
@media screen and (max-width: 52rem) {
  .bogen-seite .blatt {
    width: 46rem;
    max-width: none;
    gap: 1.15rem;
    zoom: min(1, (100vw - 1.5rem) / 46rem);
  }
  .bogen-seite .blatt-seite {
    max-width: none;
    overflow: visible;
    padding: 0.75rem 0.85rem 0.6rem;
  }
  .bogen-seite .blatt-kopf { flex-wrap: nowrap; }
  .bogen-seite .blatt-kampagne { text-align: right; width: auto; }
  .bogen-seite .blatt-name { font-size: 1.65rem; }
  .bogen-seite .blatt-top3 { grid-template-columns: 10.5rem 11.5rem 1fr; }
  .bogen-seite .blatt-abil-grid,
  .bogen-seite .blatt-kampf-neben { grid-template-columns: 1fr 1fr; }
  .bogen-seite .blatt-grid-2 { display: block; }
  .bogen-seite #blattGeraet,
  .bogen-seite #blattMagie {
    column-count: 2;
    column-gap: 0.7rem;
  }
  .bogen-seite .blatt-faeh { padding: 0.12rem 0; }
  .bogen-seite .blatt-legende,
  .bogen-seite .blatt-gloss-item,
  .bogen-seite .blatt-faeh-text { overflow-wrap: break-word; }
  .bogen-seite .blatt-table {
    table-layout: auto;
    font-size: 0.78rem;
  }
  .bogen-seite .blatt-table-waffen { display: table !important; width: 100%; }
  .bogen-seite .blatt-table-waffen tbody { display: table-row-group !important; }
  .bogen-seite .blatt-table-waffen tr,
  .bogen-seite .blatt-table-waffen tr:first-child {
    display: table-row !important;
    margin: 0;
    padding: 0;
    border-bottom: none;
  }
  .bogen-seite .blatt-table-waffen th,
  .bogen-seite .blatt-table-waffen td {
    display: table-cell !important;
    width: auto !important;
    grid-area: auto !important;
    border-bottom: 1px solid #eee;
    padding: 0.12rem 0.2rem;
    font-size: 0.74rem;
    font-weight: 400;
    text-align: left;
    white-space: normal;
  }
  .bogen-seite .blatt-table-waffen td:first-child { font-weight: 700; }
  .bogen-seite .blatt-table-waffen td:nth-child(n+3),
  .bogen-seite .blatt-table-skills td:nth-child(n+2) { white-space: nowrap; }
  .bogen-seite .blatt-table-waffen td.blatt-num { text-align: right; }
  .bogen-seite .blatt-table-waffen td::before { content: none !important; }
}

/* Abenteuer-Tisch */
.abenteuer-aktion {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
  background: var(--bg, #f7f4ef);
}
.abenteuer-aktion--compact {
  box-shadow: 0 4px 14px rgba(40, 30, 16, 0.12);
}
.abenteuer-quickbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  align-items: center;
  margin: 0.35rem 0 0.5rem;
}
.abenteuer-quick-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}
.abenteuer-quick-group input[type="number"] {
  width: 3.4rem;
  margin: 0;
}
.abenteuer-quick-group select {
  width: auto;
  min-width: 3rem;
  margin: 0;
}
.abenteuer-party-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
  margin-top: 0.25rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(80, 60, 30, 0.15);
}
.abenteuer-party-strip .abenteuer-chips {
  flex: 1 1 12rem;
}
.abenteuer-brett-kopf {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.abenteuer-brett-kopf h2 { margin: 0; }
.abenteuer-brett-hint { margin: 0.25rem 0 0.65rem; }
.abenteuer-ziel-banner {
  margin: 0.35rem 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 4px;
  font-size: 0.95rem;
  line-height: 1.35;
  border: 1px solid rgba(80, 60, 30, 0.2);
  background: rgba(255, 255, 255, 0.55);
}
.abenteuer-ziel-banner.ok {
  border-color: rgba(40, 110, 60, 0.35);
  background: rgba(40, 110, 60, 0.08);
}
.abenteuer-ziel-banner.bad {
  border-color: rgba(140, 40, 30, 0.4);
  background: rgba(140, 40, 30, 0.08);
}
.abenteuer-kat-treffer button { margin-top: 0.25rem; white-space: normal; text-align: left; }
.abenteuer-sep {
  border: 0;
  border-top: 1px solid rgba(80, 60, 30, 0.15);
  margin: 0.85rem 0;
}
.roster-gear {
  margin-top: 0.45rem;
  padding-top: 0.35rem;
  border-top: 1px dashed rgba(80, 60, 30, 0.2);
}
.roster-gear-sum {
  cursor: pointer;
  font-size: 0.9rem;
  list-style: none;
  padding: 0.2rem 0;
}
.roster-gear-sum::-webkit-details-marker { display: none; }
.roster-gear-sum::before {
  content: "+ ";
  opacity: 0.55;
  font-family: Consolas, monospace;
}
.roster-gear[open] > .roster-gear-sum::before { content: "- "; }
.roster-gear-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.35rem;
}
.roster-geld,
.roster-geben {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.4rem;
  padding: 0.35rem 0.45rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line, #d7ccb8);
  font-size: 0.88rem;
}
.roster-geld-stand { margin-right: 0.25rem; }
.roster-geld .sil-frei { width: 3.4rem; margin: 0; }
.roster-geld .sil-einheit { width: auto; min-width: 2.6rem; margin: 0; }
.roster-geben .char-gib-suche { flex: 1 1 9rem; min-width: 8rem; margin: 0; }
.roster-geben .char-gib-frei { flex: 1 1 7rem; min-width: 6rem; margin: 0; }
.char-gib-hits {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.char-gib-hit {
  font-size: 0.82rem;
  padding: 0.15rem 0.4rem;
  text-align: left;
}
.gear-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.gear-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.15rem 0;
  border-bottom: 1px solid rgba(80, 60, 30, 0.08);
  font-size: 0.86rem;
  line-height: 1.25;
}
.gear-name { min-width: 0; flex: 1 1 auto; }
.gear-acts {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.15rem;
  flex: 0 0 auto;
}
.gear-acts button {
  padding: 0.1rem 0.3rem;
  font-size: 0.78rem;
  min-width: 1.6rem;
}
.gear-empty { padding: 0.15rem 0; font-size: 0.85rem; }
.roster-gear .abenteuer-pool { margin: 0; padding-left: 0; font-size: 0.88rem; }
.roster-stats { font-size: 0.95rem; }
.roster-meta { font-size: 0.85rem; }
.abenteuer-fokus-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  margin-bottom: 0.45rem;
}
.abenteuer-fokus-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-weight: 700;
}
.abenteuer-fokus-label select {
  min-width: 10rem;
  font-weight: 600;
}
.roster-card.fokus-an {
  border-color: var(--accent, #6b5a3e);
  box-shadow: 0 0 0 2px rgba(107, 90, 62, 0.25);
}
button.roster-name {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: var(--link, #2a4a6e);
  cursor: pointer;
  text-align: left;
}
button.roster-name:hover { text-decoration: underline; }
.abenteuer-aktion h2 { margin-top: 0; }
.abenteuer-ziel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  align-items: center;
  margin-bottom: 0.65rem;
}
.abenteuer-ziel-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  font-weight: 600;
}
.abenteuer-gear-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.75rem;
  margin-top: 0;
}
.abenteuer-gear-grid h3 { margin: 0 0 0.25rem; font-size: 0.92rem; }
@media (max-width: 720px) {
  .abenteuer-gear-grid { grid-template-columns: 1fr; }
}

.abenteuer-aktion-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12.5rem), 1fr));
}
.abenteuer-aktion-grid > div {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.abenteuer-aktion-grid label { margin: 0; }
.abenteuer-aktion-grid input,
.abenteuer-aktion-grid select { width: 100%; max-width: 100%; }
.abenteuer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0 0.75rem;
}
.abenteuer-chip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid #cfc6b8;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  line-height: 1.25;
  font-size: 0.92rem;
}
.abenteuer-chip.an {
  border-color: var(--accent, #6b5a3e);
  background: #f0ebe3;
  box-shadow: inset 0 0 0 1px var(--accent, #6b5a3e);
}
.abenteuer-chip.entwurf {
  opacity: 0.5;
  cursor: not-allowed;
}
.abenteuer-chip:disabled { cursor: not-allowed; }
.roster-card {
  margin: 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.92rem;
}
.roster-card.party-an {
  border-color: var(--accent, #6b5a3e);
  box-shadow: inset 3px 0 0 var(--accent, #6b5a3e);
}
.roster-card.entwurf { opacity: 0.55; }
.roster-card.kompakt { padding: 0.5rem 0.65rem; }
.roster-card h3 { margin: 0.15rem 0 0.25rem; font-size: 1.05rem; }
.roster-card p { margin: 0.25rem 0; }
.roster-kopf {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.roster-expand {
  margin: 0;
  padding: 0.2rem 0.45rem;
  font-size: 0.8rem;
}
.roster-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted, #666);
}
.roster-controls { margin-top: 0.35rem; padding-top: 0.35rem; border-top: 1px solid #eee; }
.roster-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}
.roster-quick button { margin: 0; padding: 0.25rem 0.4rem; font-size: 0.85rem; }
.roster-quick .sil-frei { width: 3.2rem; margin: 0; }
.roster-quick .sil-einheit { width: auto; margin: 0; }
.abenteuer-kat-treffer ul,
.abenteuer-pool {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
}
.abenteuer-kat-treffer li,
.abenteuer-pool li {
  padding: 0.4rem 0;
  border-bottom: 1px solid #eee;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: baseline;
}
.abenteuer-neben { margin: 0.75rem 0; }
.abenteuer-neben > summary {
  cursor: pointer;
  list-style: disclosure-closed;
}
.abenteuer-neben[open] > summary { list-style: disclosure-open; }
.abenteuer-neben > summary h2 {
  display: inline;
  margin: 0;
  font-size: 1.1rem;
}
.abenteuer-tisch #okHint:empty,
.abenteuer-tisch #err:empty { display: none; }
@media (max-width: 40rem) {
  .abenteuer-aktion {
    position: static;
    box-shadow: none;
  }
  .abenteuer-aktion-grid { grid-template-columns: 1fr; }
}

/* Story-Tool SL */
.story-layout {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr) minmax(14rem, 22rem);
  align-items: start;
}
@media (max-width: 60rem) {
  .story-layout { grid-template-columns: 1fr; }
}
.story-strang-list,
.story-event-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.story-strang-btn,
.story-event-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.55rem;
  border: 1px solid #cfc6b8;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1.3;
  font-size: 0.92rem;
}
.story-strang-btn.aktiv,
.story-event-btn.aktiv {
  border-color: var(--accent, #6b5a3e);
  background: #f0ebe3;
  box-shadow: inset 3px 0 0 var(--accent, #6b5a3e);
}
.story-event-btn.archiv { opacity: 0.85; border-style: dashed; }
.story-text {
  white-space: pre-wrap;
  margin: 0.5rem 0 0.85rem;
  line-height: 1.45;
  font-size: 0.95rem;
}
.story-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.story-archiv-toggle { font-weight: 600; }
.story-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #eee;
}
.story-filter label { margin: 0; font-size: 0.88rem; }
.story-filter input,
.story-filter select { width: 100%; max-width: 100%; }
.story-filter #filterHint { margin: 0.15rem 0 0; font-size: 0.82rem; }
.story-side .story-strang-list {
  max-height: min(55vh, 28rem);
  overflow: auto;
  padding-right: 0.15rem;
}
.story-tool #okHint:empty,
.story-tool #err:empty { display: none; }

.npc-layout {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr) minmax(14rem, 22rem);
  align-items: start;
}
@media (max-width: 60rem) {
  .npc-layout { grid-template-columns: 1fr; }
}
.npc-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 0.55rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid #eee;
}
.npc-filter label { margin: 0; font-size: 0.88rem; }
.npc-filter input,
.npc-filter select { width: 100%; max-width: 100%; }
.npc-add-row {
  display: flex;
  gap: 0.4rem;
  align-items: end;
  margin-bottom: 0.55rem;
}
.npc-add-row label { margin: 0; flex: 0 0 4.5rem; font-size: 0.88rem; }
.npc-add-row input { width: 100%; }
.npc-add-row button { flex: 1; }
.npc-kat-list,
.npc-kampf-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: min(60vh, 32rem);
  overflow: auto;
  padding-right: 0.15rem;
}
.npc-kat-item,
.npc-einheit {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.55rem;
  border: 1px solid #cfc6b8;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1.3;
  font-size: 0.9rem;
}
.npc-kat-item.an,
.npc-einheit.an {
  border-color: var(--accent, #6b5a3e);
  background: #f0ebe3;
  box-shadow: inset 3px 0 0 var(--accent, #6b5a3e);
}
.npc-einheit.tot { opacity: 0.65; border-style: dashed; }
.npc-kat-name,
.npc-einheit-name { display: block; font-weight: 600; }
.npc-kat-meta,
.npc-einheit-meta,
.npc-einheit-hp {
  display: block;
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.15rem;
}
.npc-kat-tags { display: block; margin-top: 0.2rem; }
.npc-tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.05rem 0.3rem;
  margin: 0 0.2rem 0.15rem 0;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #faf8f5;
}
.npc-hp {
  display: block;
  height: 4px;
  background: #e8e2d8;
  border-radius: 2px;
  margin-top: 0.35rem;
  overflow: hidden;
}
.npc-hp > span {
  display: block;
  height: 100%;
  background: #6b8f71;
}
.npc-einheit.tot .npc-hp > span { background: #a66; }
.npc-kampf-kopf {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
  margin-bottom: 0.5rem;
}
.npc-kampf-kopf label { flex: 1 1 12rem; margin: 0; }
.npc-kampf-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.npc-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  margin: 0.45rem 0;
}
.npc-stat-grid label { margin: 0; font-size: 0.85rem; }
.npc-stat-grid input { width: 100%; }
.npc-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}
.npc-text {
  white-space: pre-wrap;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #444;
}
.npc-tool #okHint:empty,
.npc-tool #err:empty { display: none; }
.story-related {
  margin: 0.65rem 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid #e0d8cc;
  border-radius: 4px;
  background: #faf8f5;
}
.story-related h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}
.story-related-links { margin: 0.25rem 0 0.5rem; }
.story-chip {
  display: inline-block;
  margin: 0 0.25rem 0.3rem 0;
  padding: 0.2rem 0.45rem;
  border: 1px solid #cfc6b8;
  border-radius: 3px;
  background: #fff;
  font-size: 0.85rem;
  text-decoration: none;
  color: inherit;
}
.story-chip:hover { border-color: var(--accent, #6b5a3e); background: #f0ebe3; }
.npc-links { margin: 0 0.5rem 0 auto; }
.npc-tool .topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.npc-tool .topbar h1 { margin: 0; flex: 1 1 auto; }
.npc-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  margin: 0.4rem 0 0.6rem;
}
.npc-quick button { font-size: 0.85rem; padding: 0.25rem 0.45rem; }
.npc-einheit-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem;
  align-items: stretch;
}
.npc-einheit-wrap.an .npc-einheit { /* selection via child */ }
.npc-einheit-btns {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.npc-einheit-btns button {
  min-width: 2.2rem;
  padding: 0.2rem 0.35rem;
  font-size: 0.8rem;
}
.npc-einheit-wrap.tot { opacity: 0.7; }


/* ——— SL Layout System ——— */
body.sl-web {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
body.sl-web .site {
  flex: 0 0 auto;
  padding: 0.35rem 0.75rem;
}
body.sl-web .site .inner {
  max-width: min(96rem, 100%);
  align-items: center;
  gap: 0.65rem;
}
body.sl-web .site .brand { font-size: 1rem; }
body.sl-web .site-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
}
body.sl-web .site .tag {
  font-size: 0.78rem;
  opacity: 0.8;
  white-space: nowrap;
  margin: 0;
}
body.sl-web .site-out {
  font-size: 0.78rem;
  padding: 0.2rem 0.45rem;
  background: transparent;
  border: 1px solid rgba(244, 239, 230, 0.35);
  color: inherit;
  cursor: pointer;
}
body.sl-web .app-nav {
  margin: 0.25rem 0 0;
  gap: 0.15rem;
}
body.sl-web .app-nav a {
  padding: 0.12rem 0.35rem;
  font-size: 0.82rem;
}

body.sl-web main.wrap.sl-tool {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  max-width: min(96rem, 100%);
  width: 100%;
  margin: 0 auto;
  padding: 0.4rem 0.75rem 0.5rem;
  min-height: 0;
  height: calc(100dvh - 3.6rem);
  box-sizing: border-box;
}
body.sl-web main.wrap.sl-hub {
  max-width: min(96rem, 100%);
  margin: 0.5rem auto;
  padding: 0 0.75rem 1.5rem;
}
body.sl-web .sl-tool-note { margin: 0 0 0.4rem; font-size: 0.85rem; }
body.sl-web .npc-links { display: none; }
.site-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
}
.site-out {
  font-size: 0.78rem;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
}

body.sl-web .sl-filterbar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.35rem 0.55rem;
  padding: 0.35rem 0.45rem;
  margin: 0 0 0.4rem;
  background: var(--paper);
  border: 1px solid var(--line);
}
body.sl-web .sl-filterbar label {
  margin: 0;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
body.sl-web .sl-filterbar input,
body.sl-web .sl-filterbar select {
  font-size: 0.88rem;
  max-width: 100%;
}
body.sl-web .sl-filterbar-suche { flex: 1 1 12rem; min-width: 10rem; }
body.sl-web .sl-filterbar-suche input { width: 100%; }
body.sl-web .story-chipbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  align-items: center;
}
body.sl-web .story-chipbar button {
  padding: 0.22rem 0.5rem;
  font-size: 0.82rem;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}
body.sl-web .story-chipbar button.aktiv {
  background: var(--accent);
  color: #f4efe6;
  border-color: var(--accent);
}
body.sl-web .story-archiv-toggle {
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  flex-direction: row;
}
body.sl-web .story-mehr-filter {
  flex: 1 1 100%;
  font-size: 0.85rem;
}
body.sl-web .story-mehr-filter > summary {
  cursor: pointer;
  color: var(--muted);
  user-select: none;
}
body.sl-web .story-mehr-filter[open] > summary { margin-bottom: 0.25rem; }
body.sl-web .story-mehr-filter > label {
  display: inline-flex;
  flex-direction: column;
  margin-right: 0.75rem;
  margin-top: 0.2rem;
}
body.sl-web .sl-filterbar #btnArchiv.aktiv,
body.sl-web .sl-filterbar #btnEinzel.aktiv {
  background: var(--accent);
  color: #f4efe6;
  border-color: var(--accent);
}
body.sl-web .story-strang-btn.story-tisch .sl-row-title::before {
  content: "● ";
  color: var(--accent);
  font-size: 0.7em;
}
body.sl-web .story-event-btn.archiv {
  opacity: 0.72;
}
body.sl-web .story-volltext-hinweis {
  margin: 0.15rem 0 0.35rem;
  font-size: 0.8rem;
}
body.sl-web .story-volltext-hinweis code {
  font-size: 0.85em;
}
body.sl-web .story-text .story-abs {
  margin: 0 0 0.55rem;
}
body.sl-web .story-text .story-abs strong {
  display: inline;
  color: var(--ink, #2a241c);
}
body.sl-web .story-text .story-dialog {
  margin: 0.35rem 0 0.55rem;
  padding: 0.35rem 0.55rem;
  border-left: 3px solid var(--accent);
  background: rgba(61, 52, 40, 0.04);
  font-size: 0.92rem;
}
body.sl-web .story-related-fold {
  margin: 0.35rem 0;
  font-size: 0.88rem;
}
body.sl-web .story-related-fold > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
}

body.sl-web .sl-workspace {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr);
  gap: 0.45rem;
  min-height: 0;
  align-items: stretch;
}

body.sl-web .sl-rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 0.35rem;
}
body.sl-web .sl-rail-head {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.3rem;
}
body.sl-web .sl-rail-foot {
  flex: 0 0 auto;
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}
body.sl-web .sl-row-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-height: none !important;
}
body.sl-web .sl-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  width: 100%;
  text-align: left;
  padding: 0.28rem 0.4rem;
  border: 1px solid transparent;
  border-bottom-color: var(--line);
  background: transparent;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.25;
  border-radius: 0;
}
body.sl-web .sl-row:hover { background: rgba(61, 52, 40, 0.05); }
body.sl-web .sl-row.aktiv,
body.sl-web .sl-row.an {
  background: #f0ebe3;
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}
body.sl-web .sl-row-title {
  font-weight: 700;
  font-size: 0.9rem;
}
body.sl-web .sl-row-meta {
  font-size: 0.78rem;
  color: var(--muted);
}
body.sl-web .story-group {
  margin: 0.4rem 0 0.1rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
body.sl-web .story-group:first-child { margin-top: 0; }

body.sl-web .sl-stage,
body.sl-web .story-stage,
body.sl-web .npc-stage {
  display: flex;
  min-height: 0;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--paper);
}
body.sl-web .story-stage {
  display: grid;
  grid-template-columns: 1fr;
}
body.sl-web .sl-workspace--split .story-stage {
  grid-template-columns: minmax(11rem, 16rem) minmax(0, 1fr);
}
body.sl-web .story-index {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  overflow: hidden;
}
body.sl-web .sl-workspace--split .story-index {
  border-right: 1px solid var(--line);
}
body.sl-web .story-strang-kopf { flex: 0 0 auto; margin-bottom: 0.35rem; }
body.sl-web .story-strang-title { font-size: 0.95rem; margin-bottom: 0.15rem; }
body.sl-web .story-kurz {
  margin: 0.15rem 0 0.25rem;
  font-size: 0.88rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
body.sl-web .story-strang-notiz { font-size: 0.85rem; margin: 0.2rem 0; }
body.sl-web .story-strang-notiz summary { cursor: pointer; color: var(--muted); }
body.sl-web .story-index .story-event-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
body.sl-web .story-reader {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  overflow: auto;
}
body.sl-web .story-reader h2 { margin: 0 0 0.25rem; font-size: 1.15rem; }
body.sl-web .story-text {
  flex: 1 1 auto;
  margin: 0.35rem 0;
  font-size: 0.95rem;
  line-height: 1.4;
}
body.sl-web .story-reader-foot {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  padding-top: 0.45rem;
  margin-top: 0.35rem;
}
body.sl-web .story-detail-actions { margin: 0.35rem 0 0; }

body.sl-web .npc-stage {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
}
body.sl-web .sl-workspace--split .npc-stage {
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
}
body.sl-web .npc-kampf {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0.45rem 0.55rem;
  overflow: auto;
}
body.sl-web .sl-workspace--split .npc-kampf {
  border-right: 1px solid var(--line);
}
body.sl-web .npc-detail {
  min-height: 0;
  overflow: auto;
  padding: 0.45rem 0.55rem;
}
body.sl-web .npc-kampf-notiz { margin-top: auto; padding-top: 0.45rem; }
body.sl-web .npc-add-row input { width: 3.2rem; }

body.sl-web .sl-dash-grid {
  display: grid;
  grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
body.sl-web .sl-dash-chars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.35rem;
}
body.sl-web .sl-dash-chars li {
  margin: 0;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 0.9rem;
}
body.sl-web .sl-dash-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
body.sl-web .dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
body.sl-web .dash-actions a { text-decoration: none; }
body.sl-web .card {
  padding: 0.65rem 0.8rem;
  margin-bottom: 0.55rem;
}
body.sl-web details.card > summary {
  cursor: pointer;
  list-style: none;
}
body.sl-web details.card > summary::-webkit-details-marker { display: none; }
body.sl-web details.card > summary h2 { display: inline; margin: 0; }
body.sl-web details.card > summary::before {
  content: "+ ";
  opacity: 0.55;
  font-family: Consolas, monospace;
}
body.sl-web details.card[open] > summary::before { content: "- "; }

body.sl-web .abenteuer-aktion.sl-filterbar {
  position: sticky;
  top: 0;
  z-index: 30;
  margin-bottom: 0.4rem;
}
body.sl-web .abenteuer-brett-hint { display: none; }
body.sl-web .sl-stage-card {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.45rem;
}
body.sl-web .abenteuer-party-details {
  flex: 1 1 100%;
  margin: 0;
  border: 0;
  padding: 0;
}
body.sl-web .abenteuer-party-details > summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
}
body.sl-web .roster-grid {
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}
body.sl-web #liste {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 0.55rem;
}
body.sl-web #liste .card { margin-bottom: 0; }
body.sl-web .katalog-tabs.sl-filterbar button { margin: 0; }

body.sl-web .story-tool #okHint:empty,
body.sl-web .story-tool #err:empty,
body.sl-web .npc-tool #okHint:empty,
body.sl-web .npc-tool #err:empty,
body.sl-web .abenteuer-tisch #okHint:empty,
body.sl-web .abenteuer-tisch #err:empty { display: none; }

@media (max-width: 56rem) {
  body.sl-web main.wrap.sl-tool { height: auto; min-height: 0; }
  body.sl-web .sl-workspace,
  body.sl-web .sl-workspace.sl-workspace--split { grid-template-columns: 1fr; }
  body.sl-web .sl-workspace--split .story-stage,
  body.sl-web .sl-workspace--split .npc-stage { grid-template-columns: 1fr; }
  body.sl-web .sl-rail { max-height: 40vh; }
  body.sl-web .sl-dash-grid { grid-template-columns: 1fr; }
  body.sl-web .topbar { display: flex; }
}
