/* ════════════════════════════════════════════════════════════════════
   GameMaster Tool — zentrales Stylesheet (theme-neutral)
   ────────────────────────────────────────────────────────────────────
   Enthält ALLE Style-Definitionen der Anwendung. Farbwerte kommen
   ausschließlich aus den Theme-Variablen (static/css/theme-*.css).
   In den HTML-Templates dürfen keine <style>-Blöcke oder statischen
   style="…"-Attribute mehr stehen.
   ════════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════
   D&D-Fonts
══════════════════════════════════════════════════ */
@font-face {
  font-family: "Bookinsanity";
  src: url("/static/fonts/Bookinsanity.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bookinsanity";
  src: url("/static/fonts/Bookinsanity%20Bold.otf") format("opentype");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bookinsanity";
  src: url("/static/fonts/Bookinsanity%20Italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Bookinsanity";
  src: url("/static/fonts/Bookinsanity%20Bold%20Italic.otf") format("opentype");
  font-weight: 600 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Mr Eaves Small Caps";
  src: url("/static/fonts/Mr%20Eaves%20Small%20Caps.otf") format("opentype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nodesto Caps Condensed";
  src: url("/static/fonts/Nodesto%20Caps%20Condensed.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nodesto Caps Condensed";
  src: url("/static/fonts/NodestoCapsCondensed-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nodesto Caps Condensed";
  src: url("/static/fonts/NodestoCapsCondensed-Italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Nodesto Caps Condensed";
  src: url("/static/fonts/NodestoCapsCondensed-Bold%20Italic.otf") format("opentype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Scaly Sans";
  src: url("/static/fonts/Scaly%20Sans.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Scaly Sans";
  src: url("/static/fonts/Scaly%20Sans%20Bold.otf") format("opentype");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Scaly Sans";
  src: url("/static/fonts/Scaly%20Sans%20Italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Scaly Sans";
  src: url("/static/fonts/Scaly%20Sans%20Bold%20Italic.otf") format("opentype");
  font-weight: 600 700;
  font-style: italic;
  font-display: swap;
}

/* ══════════════════════════════════════════════════
   Typografie
══════════════════════════════════════════════════ */
body {
  font-family: var(--font-ui);
  font-size: var(--text-md);
  background: var(--background);
  color: var(--foreground);
}
h1,
h2,
h3,
h4,
h5,
.sidebar-title {
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.01em;
}
h3,
h4,
h5 {
  letter-spacing: 0.01em;
}
.book-title,
.cover-title {
  font-family: "Nodesto Caps Condensed", var(--font-ui);
  letter-spacing: 0.02em;
}
table.table-dnd,
.table-dnd table {
  font-family: "Scaly Sans", "Bookinsanity", serif;
  width: 100%;
  border-collapse: collapse;
}
.table-dnd th {
  font-family: var(--font-ui);
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 0.3rem 0.5rem;
}
.table-dnd td {
  border-bottom: 1px solid var(--border);
  padding: 0.3rem 0.5rem;
}

/* ══════════════════════════════════════════════════
   Dekorative Elemente
══════════════════════════════════════════════════ */
.dnd-divider {
  height: 3px;
  border: none;
  background: linear-gradient(
    to right,
    transparent,
    var(--primary) 20%,
    var(--primary) 80%,
    transparent
  );
  margin: 0.6rem 0;
  opacity: 0.75;
}
.dnd-divider-sm {
  height: 1px;
  border: none;
  background: linear-gradient(
    to right,
    transparent,
    var(--border) 30%,
    var(--border) 70%,
    transparent
  );
  margin: 0.4rem 0;
}
.surface {
  background: var(--card);
  border: 1px solid var(--border);
}
.statblock {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  position: relative;
}
.statblock::before,
.statblock::after {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    to right,
    transparent,
    var(--primary) 15%,
    var(--primary) 85%,
    transparent
  );
  opacity: 0.8;
}
.statblock::before {
  top: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}
.statblock::after {
  bottom: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ══════════════════════════════════════════════════
   Navigation
══════════════════════════════════════════════════ */
.muted {
  color: var(--muted-foreground);
}
.nav-link {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  min-height: var(--tap-min);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--foreground);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover {
  background: var(--muted);
}
.nav-link.active {
  background: var(--primary);
  color: var(--primary-foreground);
}
.nav-link.disabled {
  color: var(--muted-foreground);
  cursor: not-allowed;
  opacity: 0.5;
}

/* ══════════════════════════════════════════════════
   Diverses
══════════════════════════════════════════════════ */
.ref-link {
  color: var(--primary);
  text-underline-offset: 3px;
  cursor: pointer;
}
.ref-link:hover {
  text-decoration: underline;
}
.dice {
  background: var(--muted);
  border-radius: 0.25rem;
  padding: 0 0.3rem;
  font-weight: 600;
  cursor: pointer;
  font-family: "Bookinsanity", serif;
  transition: background 0.12s, color 0.12s;
}
.dice:hover {
  background: var(--surface-3);
  color: var(--foreground);
}

/* ── Querverweis-Popover (Chips → schwebendes Detail) ───────── */
.refpop {
  position: fixed;
  z-index: 1200;
  width: 340px;
  max-width: calc(100vw - 24px);
  max-height: min(62vh, 560px);
  display: flex;
  flex-direction: column;
  background: var(--popover);
  color: var(--popover-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  animation: refpop-in 0.12s ease-out;
}
@keyframes refpop-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.refpop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.4rem 0.35rem 0.65rem;
  border-bottom: 1px solid var(--border);
  background: var(--muted);
  flex: 0 0 auto;
}
.refpop-kind {
  font-size: var(--text-xs);
  text-transform: none;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--muted-foreground);
}
.refpop-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--popover-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.refpop-close {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 1.2rem;
  line-height: 1;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 0.3rem;
  cursor: pointer;
}
.refpop-close:hover {
  background: var(--surface-3);
  color: var(--foreground);
}
.refpop-body {
  padding: 0.6rem 0.8rem;
  overflow: auto;
  flex: 1 1 auto;
}
.refpop-kind-tag {
  display: inline-block;
  font-size: var(--text-xs);
  text-transform: none;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--muted-foreground);
  background: var(--muted);
  padding: 0.05rem 0.4rem;
  border-radius: 0.25rem;
  margin-bottom: 0.35rem;
}
.refpop-glossary p {
  font-family: var(--font-read);
  margin: 0;
  line-height: 1.55;
  font-size: 0.9rem;
}
.refpop-empty {
  text-align: center;
}
.refpop-empty .refpop-kind-tag {
  display: block;
}
.refpop .panel-statblock,
.refpop .panel-spell-detail {
  font-size: 0.88rem;
}
@media (max-width: 640px) {
  .refpop {
    left: 50% !important;
    top: 50% !important;
    right: auto !important;
    transform: translate(-50%, -50%) !important;
    width: calc(100vw - 32px);
    max-height: 80vh;
    animation: none;
  }
}

.entry-list {
  list-style: disc;
  padding-left: 1.25rem;
}
.prose p {
  font-family: var(--font-read);
  margin: 0.5rem 0;
  line-height: 1.65;
}
.entry-table-wrap {
  overflow-x: auto;
  margin: 0.75rem 0;
}
.entry-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.entry-table caption {
  font-style: italic;
  font-size: 0.8rem;
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
  caption-side: top;
  text-align: left;
}
.entry-table th {
  font-family: var(--font-ui);
  color: var(--primary);
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--primary);
  padding: 0.2rem 0.5rem;
  text-align: left;
  white-space: nowrap;
}
.entry-table td {
  padding: 0.2rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.entry-table tbody tr:last-child td {
  border-bottom: none;
}
.htmx-indicator {
  opacity: 0;
  transition: opacity 0.2s;
}
.htmx-request .htmx-indicator {
  opacity: 1;
}

/* ══════════════════════════════════════════════════
   Buttons – D&D 5e Stil
══════════════════════════════════════════════════ */
.btn-dnd {
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--tap-min);
  padding: 0.45rem 0.9rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none;
}
.btn-dnd svg,
.btn-dnd i {
  font-size: 15px;
}
.btn-dnd-lg {
  padding: 0.6rem 1.2rem;
  font-size: 0.82rem;
}
.btn-dnd-sm {
  padding: 0.3rem 0.7rem;
  font-size: var(--text-xs);
}
.btn-dnd-sm svg,
.btn-dnd-sm i {
  font-size: 13px;
}
.btn-dnd-pr {
  background: var(--btn-strong-bg);
  color: var(--btn-strong-fg);
  border-color: var(--btn-strong-border);
}
.btn-dnd-pr:hover {
  background: var(--btn-strong-bg-hover);
}
.btn-dnd-ol {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-dnd-ol:hover {
  background: var(--muted);
}
.btn-dnd-sf {
  background: var(--muted);
  color: var(--primary);
  border-color: var(--border);
}
.btn-dnd-sf:hover {
  border-color: var(--primary);
}
.btn-dnd-gh {
  background: transparent;
  color: var(--primary);
  border-color: transparent;
}
.btn-dnd-gh:hover {
  background: var(--muted);
}
.btn-dnd-dg {
  background: transparent;
  color: var(--destructive);
  border-color: var(--destructive);
}
.btn-dnd-dg:hover {
  background: var(--muted);
}

/* Querverweis-/Zustands-Chip (Basis-Variante, base.html) */
.condition-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: 0.01em;
  text-transform: none;
  background: var(--muted);
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 30px;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.condition-chip:hover {
  border-color: var(--destructive);
  color: var(--destructive);
}

/* ══════════════════════════════════════════════════
   Form-Elemente
══════════════════════════════════════════════════ */
.input {
  font-family: var(--font-ui);
  font-size: var(--text-md);
  background: var(--input);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.3rem 0.65rem;
  height: auto;
  min-height: var(--tap-min);
  line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  box-shadow: none;
}
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--focus-ring);
}
.input::placeholder {
  color: var(--muted-foreground);
  opacity: 1;
}
.input[type="number"]::-webkit-inner-spin-button,
.input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.input[type="number"] {
  -moz-appearance: textfield;
}
.select {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--btn-strong-bg);
  color: var(--btn-strong-fg);
  border: 1px solid var(--btn-strong-border);
  border-radius: 3px;
  padding: 0.3rem 1.8rem 0.3rem 0.65rem;
  height: auto;
  min-height: var(--tap-min);
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 0.15s;
  outline: none;
  box-shadow: none;
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 13px;
}
.select:hover {
  background-color: var(--btn-strong-bg-hover);
}
.select:focus {
  box-shadow: 0 0 0 2px var(--focus-ring-strong);
}
.select option {
  background: var(--btn-strong-bg-hover);
  color: var(--btn-strong-fg);
}
input[type="checkbox"] {
  accent-color: var(--primary);
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

/* Theme-Toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  font-size: var(--text-xs);
  font-family: var(--font-ui);
  letter-spacing: 0.04em;
  transition: color 0.15s, border-color 0.15s;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.theme-toggle:hover {
  color: var(--foreground);
  border-color: var(--primary);
}

/* ══════════════════════════════════════════════════
   MOBILE TOP BAR
══════════════════════════════════════════════════ */
.mobile-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--primary);
  color: var(--primary-foreground);
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: max(10px, env(safe-area-inset-left, 0px));
  padding-right: max(10px, env(safe-area-inset-right, 0px));
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}
.mobile-topbar-btn {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  flex-shrink: 0;
  line-height: 1;
  font-size: 1.1rem;
  transition: background 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mobile-topbar-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.mobile-topbar-adv {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-topbar-adv small {
  display: block;
  font-size: var(--text-xs);
  opacity: 0.7;
  font-family: "Bookinsanity", serif;
  letter-spacing: 0.02em;
}
/* Logout-Button in der Top-Bar (war inline style="color:var(--destructive)") */
.mobile-topbar-btn--logout {
  color: var(--destructive);
}

/* ══════════════════════════════════════════════════
   DRAWER (mobile slide-in Sidebar)
══════════════════════════════════════════════════ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  transition: background 0.2s ease;
}
.drawer-overlay.open {
  background: rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}
.drawer-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(260px, 82vw);
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  padding-top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom, 0px));
}
.drawer-overlay.open .drawer-panel {
  transform: translateX(0);
}
.drawer-close-area {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: min(260px, 82vw);
  background: transparent;
  border: none;
  cursor: default;
  width: auto;
}
/* Abenteuer-Link im Drawer (war inline: serif + max-width) */
.drawer-adv-link {
  font-family: "Bookinsanity", serif;
  max-width: 220px;
}
.drawer-meta {
  font-family: "Bookinsanity", serif;
}

/* ══════════════════════════════════════════════════
   BOTTOM TAB BAR
══════════════════════════════════════════════════ */
.bottom-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--card);
  border-top: 2px solid var(--border);
  display: flex;
  align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  height: calc(var(--bottombar-h) + env(safe-area-inset-bottom, 0px));
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.bottom-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 2px;
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: none;
  color: var(--muted-foreground);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  letter-spacing: 0.01em;
  transition: color 0.15s, background 0.12s;
  border-top: 2px solid transparent;
  margin-top: -2px;
}
.bottom-tab:hover {
  color: var(--foreground);
  background: var(--muted);
}
.bottom-tab.active {
  color: var(--primary);
  border-top-color: var(--primary);
}
.bottom-tab-icon {
  font-size: 1.35rem;
  line-height: 1;
}
.bottom-tab[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}
.bottom-tab[disabled]:hover {
  color: var(--muted-foreground);
  background: none;
}

/* ══════════════════════════════════════════════════
   COMPENDIUM SLIDE-OVER PANEL
══════════════════════════════════════════════════ */
.comp-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  transition: background 0.2s ease;
}
.comp-overlay.open {
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.35);
}
.comp-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(var(--comp-panel-w), 88vw);
  background: var(--card);
  border-left: 2px solid var(--primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(102%);
  transition: transform 0.25s ease;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.comp-overlay.open .comp-panel {
  transform: translateX(0);
}
@media (min-width: 768px) {
  .comp-panel {
    width: min(var(--comp-panel-w), 50vw);
  }
}
.comp-panel-header {
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.6rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.comp-panel-title {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.comp-panel-close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 1rem;
  border-radius: 3px;
  transition: background 0.12s;
}
.comp-panel-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ══════════════════════════════════════════════════
   COMPENDIUM PANEL INHALTE
══════════════════════════════════════════════════ */
.comp-tabs {
  display: flex;
  flex-shrink: 0;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.comp-tab-btn {
  flex: 1;
  min-height: var(--tap-min);
  padding: 0.55rem 0.5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted-foreground);
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: color 0.12s, border-color 0.12s;
}
.comp-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.comp-tab-btn:hover:not(.active) {
  color: var(--foreground);
}
.comp-search-area {
  flex-shrink: 0;
  padding: 0.5rem 0.6rem 0.4rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.comp-search-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.comp-search-input {
  flex: 1;
  min-width: 0;
  min-height: var(--tap-min);
  padding: 0.35rem 0.6rem;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--foreground);
  font-size: var(--text-md);
}
.comp-search-input:focus {
  outline: 1px solid var(--primary);
}
.comp-filter-select {
  min-height: var(--tap-min);
  padding: 0.3rem 0.4rem;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--foreground);
  font-size: var(--text-sm);
  min-width: 0;
}
.comp-filter-select:focus {
  outline: 1px solid var(--primary);
}
/* Breiten-Modifier (waren inline style="flex:1" / style="width:5.5rem") */
.comp-filter-select--grow {
  flex: 1;
}
.comp-filter-select--cr {
  width: 5.5rem;
}
.comp-clear-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
}
.comp-clear-btn:hover {
  color: var(--foreground);
}
.comp-results-wrap {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.panel-results-count {
  padding: 0.35rem 0.7rem;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
  font-style: italic;
}
.panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2.5rem 1rem;
  color: var(--muted-foreground);
  font-size: 0.8rem;
  text-align: center;
}
.panel-empty span:first-child {
  font-size: 2rem;
}
/* Ergebnis-Container Mindesthöhe (war inline style="min-height:4rem") */
.panel-results {
  min-height: 4rem;
}
.panel-list-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.panel-list-item:hover {
  background: var(--surface-2);
}
.panel-item-info {
  flex: 1;
  min-width: 0;
}
.panel-item-name {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.panel-item-sub {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cr-badge,
.level-badge {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: var(--text-xs);
  font-weight: 700;
  background: var(--primary);
  color: var(--primary-foreground);
  min-width: 2rem;
  text-align: center;
}
.panel-spinner {
  display: none;
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.panel-spinner.htmx-request {
  display: block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.panel-back-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.7rem;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  flex-shrink: 0;
}
.panel-back-btn:hover {
  background: var(--surface-2);
}
.panel-statblock {
  padding: 0.6rem 0.75rem;
  font-size: 0.78rem;
  line-height: 1.45;
}
.psb-header {
  margin-bottom: 0.3rem;
}
.psb-name {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.1rem;
}
.psb-name-en {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  margin-bottom: 0.15rem;
}
.psb-meta {
  font-style: italic;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.psb-label {
  font-weight: 700;
  margin-right: 0.3rem;
}
.psb-stats > div {
  margin-bottom: 0.2rem;
}
.psb-ability-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-xs);
  text-align: center;
  margin: 0.3rem 0;
}
.psb-ability-table th {
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 2px 4px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.psb-ability-table td {
  padding: 2px 4px;
}
.psb-properties > div {
  margin-bottom: 0.2rem;
}
.psb-section-title {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0.4rem 0 0.25rem;
  letter-spacing: 0.04em;
}
.psb-trait {
  margin: 0 0 0.35rem;
}
.panel-spell-detail {
  padding: 0.6rem 0.75rem;
}
.panel-spell-detail article {
  font-family: var(--font-read);
  font-size: var(--text-sm);
}
.panel-spell-detail h2 {
  font-size: 0.95rem;
}

/* ══════════════════════════════════════════════════
   WÜRFEL-LOG
══════════════════════════════════════════════════ */
.dice-log {
  flex-shrink: 0;
  border-top: 2px solid var(--primary);
  background: var(--card);
  max-height: 185px;
  display: flex;
  flex-direction: column;
}
.dice-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.28rem 0.65rem;
  background: var(--primary);
  color: var(--primary-foreground);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.dice-log-header-btns {
  display: flex;
  gap: 4px;
}
.dice-log-hbtn {
  background: none;
  border: none;
  color: var(--primary-foreground);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 1px 5px;
  border-radius: 3px;
  opacity: 0.75;
  transition: opacity 0.12s;
}
.dice-log-hbtn:hover {
  opacity: 1;
}
#dice-log-entries {
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
.dice-log-empty {
  padding: 0.7rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-align: center;
  font-style: italic;
}
.dice-log-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0.3rem 0.6rem;
  border-bottom: 1px solid var(--border);
  animation: diceIn 0.18s ease;
}
.dice-log-row:last-child {
  border-bottom: none;
}
@keyframes diceIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.dice-log-expr {
  font-family: "Courier New", monospace;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  flex-shrink: 0;
  min-width: 3.5rem;
}
.dice-log-dice {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  flex: 1;
  align-items: center;
}
.dice-log-die {
  width: 19px;
  height: 19px;
  border: 1px solid var(--border);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  background: var(--muted);
  color: var(--foreground);
  flex-shrink: 0;
}
.dice-log-die.max {
  background: var(--die-max-bg);
  border-color: var(--die-max-border);
  color: var(--die-max-fg);
}
.dice-log-die.min {
  background: var(--die-min-bg);
  border-color: var(--die-min-border);
  color: var(--die-min-fg);
}
.dice-log-mod {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  flex-shrink: 0;
}
.dice-log-total {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--foreground);
  min-width: 2rem;
  text-align: right;
  flex-shrink: 0;
}
.dice-log-reroll {
  background: none;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 1px 4px;
  border-radius: 3px;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.12s;
}
.dice-log-reroll:hover {
  color: var(--primary);
}

/* ══════════════════════════════════════════════════
   COMBAT TRACKER — 3-Spalten-Layout (vormals combat.html)
══════════════════════════════════════════════════ */
.ct-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem 2rem;
  text-align: center;
}
.ct-empty-icon {
  font-size: 3rem;
  opacity: 0.25;
}
.ct-empty-msg {
  color: var(--muted-foreground);
  font-size: 0.95rem;
}
.ct-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.6rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.ct-header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
}
.ct-header-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.ct-round-badge {
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}
.ct-active-label {
  font-size: 0.82rem;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ct-diff-badge {
  font-family: var(--font-ui);
  color: #fff;
  border-radius: 4px;
  padding: 1px 8px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}
.ct-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}
@media (min-width: 768px) {
  .ct-grid {
    grid-template-columns: 200px 1fr;
  }
  .ct-col-action {
    max-height: calc(100vh - 180px);
  }
}
@media (min-width: 1100px) {
  .ct-grid {
    grid-template-columns: 230px minmax(360px, 1fr);
  }
}
@media (min-width: 1400px) {
  .ct-grid {
    grid-template-columns: 230px minmax(380px, 1.3fr) minmax(280px, 1fr);
  }
  .ct-col-reserved {
    display: block;
  }
}
.ct-col-reserved {
  display: none;
}
.ct-panel.ct-detail-embed {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.ct-col-init {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 180px);
}
.ct-col-title {
  padding: 0.4rem 0.65rem;
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--muted-foreground);
  text-transform: none;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ct-init-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  overflow-y: auto;
  flex: 1;
}
.ct-init-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.1s;
}
.ct-init-row:hover {
  background: var(--surface-2);
}
.ct-init-row--active {
  border-left-color: var(--primary);
  background: var(--init-active-tint);
}
.ct-init-row--selected {
  background: var(--muted);
  border-left-color: var(--primary);
}
.ct-side-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: transform 0.1s;
}
.ct-side-dot:hover {
  transform: scale(1.25);
}
.ct-side-dot--friend {
  background: var(--friend);
  border-color: var(--friend);
}
.ct-side-dot--foe {
  background: var(--foe);
  border-color: var(--foe);
}
.ct-init-badge {
  min-width: 1.6rem;
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 700;
  font-family: var(--font-ui);
  color: var(--primary);
  flex-shrink: 0;
}
.ct-init-info {
  flex: 1;
  min-width: 0;
}
.ct-init-name {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.ct-pc-tag {
  font-size: var(--text-xs);
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: 3px;
  padding: 0 3px;
  flex-shrink: 0;
}
.ct-cond-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warn);
  flex-shrink: 0;
  display: inline-block;
}
.ct-hp-bar-wrap {
  height: 5px;
  background: var(--muted);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 3px;
}
.ct-hp-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.ct-hp-nums {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  tabular-nums: true;
  margin-top: 1px;
}
.ct-col-action {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 0;
  overflow: hidden;
}
.ct-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 auto;
}
.ct-action-section {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
.ct-action-section:last-child {
  border-bottom: none;
}
.ct-sel-name {
  font-weight: 700;
  font-size: 1rem;
  font-family: "Nodesto Caps Condensed", var(--font-ui);
  color: var(--primary);
  letter-spacing: 0.02em;
  margin-bottom: 0.1rem;
}
.ct-sel-meta {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}
.ct-hp-bar-lg-wrap {
  height: 20px;
  background: var(--muted);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.3rem;
  position: relative;
}
.ct-hp-bar-lg {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
}
.ct-hp-bar-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: #fff;
  padding-right: 5px;
  mix-blend-mode: luminosity;
  white-space: nowrap;
}
.ct-hp-text {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  font-family: "Nodesto Caps Condensed", serif;
}
.ct-hp-current {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}
.ct-hp-sep {
  font-size: 1rem;
  color: var(--muted-foreground);
}
.ct-hp-max {
  font-size: 1rem;
  color: var(--muted-foreground);
}
.ct-hp-temp {
  font-size: var(--text-xs);
  color: var(--friend);
  margin-left: 0.3rem;
}
.ct-action-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}
.ct-amt-input {
  width: 4.5rem;
  text-align: center;
}
.ct-action-btn {
  flex-shrink: 0;
}
.ct-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.ct-action-sep {
  width: 1px;
  align-self: stretch;
  min-height: 1.6rem;
  background: var(--border);
  margin: 0 0.1rem;
}
.ct-cond-add {
  flex: 1 1 8rem;
  min-width: 7rem;
  font-size: 0.8rem;
}
.ct-section-label {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
  text-transform: none;
  margin-bottom: 0.4rem;
}
.ct-cond-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}
.ct-cond-select {
  width: 100%;
  font-size: 0.8rem;
}
/* Zustands-Chip — Combat-Variante (überschreibt die Basis-Variante;
   Reihenfolge in der Datei = höhere Kaskadenpriorität, wie zuvor durch
   die Lade-Reihenfolge combat.html nach base.html). */
.ct-cond-chips .condition-chip,
.ct-action-bar .condition-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn);
  font-size: var(--text-xs);
  letter-spacing: normal;
  text-transform: none;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: background 0.1s;
}
.ct-cond-chips .condition-chip:hover,
.ct-action-bar .condition-chip:hover {
  background: var(--warn-bg-hover);
  border-color: var(--warn-border);
  color: var(--warn);
}
.ct-action-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.82rem;
}
.ct-add-section {
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.ct-add-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.8rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted-foreground);
  transition: color 0.1s;
}
.ct-add-toggle:hover {
  color: var(--foreground);
}
.ct-add-body {
  padding: 0 0.8rem 0.8rem;
}
.ct-add-from-comp .ct-add-comp-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.35rem;
}
.ct-manual-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.ct-check-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
}
.ct-col-statblock {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
}
.statblock-card {
  padding: 0.85rem 1rem;
}
.statblock-header {
  text-align: left;
  padding-bottom: 0.3rem;
}
.statblock-name {
  font-family: "Nodesto Caps Condensed", var(--font-ui);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  letter-spacing: 0.02em;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.statblock-cr-badge {
  font-size: var(--text-xs);
  font-weight: 700;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: 4px;
  padding: 1px 6px;
  flex-shrink: 0;
  font-family: sans-serif;
}
.statblock-subtitle {
  font-family: "Bookinsanity", serif;
  font-style: italic;
  font-size: 0.78rem;
  color: var(--foreground);
  margin: 0.1rem 0 0;
}
.statblock-divider {
  height: 2px;
  border: none;
  margin: 0.4rem 0;
  background: linear-gradient(
    to right,
    transparent,
    var(--primary) 5%,
    var(--primary) 95%,
    transparent
  );
  opacity: 0.8;
}
.statblock-property-line {
  font-size: 0.8rem;
  line-height: 1.5;
  margin: 0.08rem 0;
}
.statblock-property-line strong {
  font-family: var(--font-ui);
  color: var(--primary);
  letter-spacing: 0.02em;
  margin-right: 0.2rem;
}
.statblock-abilities {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  margin: 0.3rem 0;
  font-size: 0.75rem;
}
.statblock-abilities th {
  font-family: var(--font-ui);
  color: var(--primary);
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  padding: 0.1rem 0.2rem;
  border-bottom: 1px solid var(--border);
}
.statblock-abilities td {
  padding: 0.1rem 0.2rem;
}
.statblock-section-title {
  font-family: var(--font-ui);
  color: var(--primary);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  margin: 0.15rem 0 0;
  border-bottom: 1px solid var(--primary);
  padding-bottom: 0.05rem;
}
.statblock-entry {
  font-family: var(--font-read);
  font-size: var(--text-sm);
  line-height: 1.5;
  margin: 0.28rem 0;
}
.statblock-entry p {
  display: inline;
  margin: 0;
}
.statblock-entry-name {
  font-style: italic;
  font-weight: 700;
}
.ct-statblock-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.82rem;
  opacity: 0.7;
}

/* ══════════════════════════════════════════════════
   DASHBOARD (vormals adventures/dashboard.html)
══════════════════════════════════════════════════ */
.combat-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  background: var(--combat-banner-bg);
  border: 1px solid var(--combat-banner-border);
}
.combat-banner-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--combat-banner-accent);
  flex-shrink: 0;
  animation: blink 1.4s ease-in-out infinite;
}
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}
.combat-banner-text {
  flex: 1;
  min-width: 0;
}
.combat-banner-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--combat-banner-accent);
}
.combat-banner-sub {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}
.module-card {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: box-shadow 0.15s;
}
.module-card:hover {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.module-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.module-card-num {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--muted-foreground);
  min-width: 1.4rem;
}
.module-status-badge {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 7px;
  border-radius: 20px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.module-card-body {
  flex: 1;
}
.module-card-title {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.3;
  margin-bottom: 0.2rem;
}
.module-card-desc {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.module-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.module-enc-count {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}
.module-card-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}
.notes-toggle {
  cursor: pointer;
  user-select: none;
}
.notes-body {
  display: none;
}
.notes-body.open {
  display: block;
}

/* ══════════════════════════════════════════════════
   PLAYER-EDITOR (vormals players/edit.html)
══════════════════════════════════════════════════ */
.ed-section {
  margin-bottom: 0.75rem;
}
.ed-section > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.85rem 1rem;
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ed-section[open] > summary {
  border-radius: 10px 10px 0 0;
}
.ed-section > summary::-webkit-details-marker {
  display: none;
}
.ed-section > summary::after {
  content: "▾";
  color: var(--muted-foreground);
}
.ed-section[open] > summary::after {
  content: "▴";
}
.ed-body {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.ed-field label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: none;
  color: var(--muted-foreground);
  margin-bottom: 0.3rem;
}
.ed-field input.input,
.ed-field textarea.input,
.ed-field select.select {
  width: 100%;
}
.ed-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.ed-grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}
.stepper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  justify-content: center;
}
.step-btn {
  width: 2.4rem;
  height: 2.4rem;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.step-btn:active {
  background: var(--primary);
  color: #fff;
}
.step-input {
  width: 3.4rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
}
.abil-cell {
  text-align: center;
}
.abil-cell .cap {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  font-weight: 700;
}
.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chip {
  cursor: pointer;
}
.chip > span {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  user-select: none;
}
.chip > input:checked + span {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.ed-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 0.6rem;
  padding: 0.6rem 0;
  background: linear-gradient(to top, var(--background) 70%, transparent);
  z-index: 5;
}
.ed-actions .btn-dnd {
  flex: 1;
}

/* ══════════════════════════════════════════════════
   MONSTER-PICKER-DIALOG (vormals partials/_monster_picker.html)
══════════════════════════════════════════════════ */
.monster-picker-dialog {
  border: none;
  background: transparent;
  padding: 0;
  max-width: none;
  max-height: none;
}
.monster-picker-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}
.monster-picker-dialog li button.selected-row {
  outline: 2px solid var(--primary);
  background: var(--muted);
}

/* ══════════════════════════════════════════════════
   STANDALONE-SEITEN (Login / Passwort / Abenteuer-Auswahl)
══════════════════════════════════════════════════ */
.page-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}
.login-card--wide {
  max-width: 380px;
}
.login-title {
  font-family: var(--font-ui);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--primary);
  margin-bottom: 0.25rem;
}
.login-subtitle {
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.85rem;
  margin-bottom: 1.75rem;
}
.login-card .dnd-divider {
  height: 3px;
  background: linear-gradient(
    to right,
    transparent,
    var(--primary) 20%,
    var(--primary) 80%,
    transparent
  );
  margin: 0 auto 1.75rem;
  width: 80%;
  opacity: 1;
}
.login-card label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--muted-foreground);
  margin-bottom: 0.3rem;
}
.field {
  margin-bottom: 1rem;
}
.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  font-family: "Bookinsanity", serif;
  font-size: 1rem;
  background: var(--input);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.45rem 0.75rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login-card input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--focus-ring);
}
.btn-login {
  width: 100%;
  margin-top: 0.5rem;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: none;
  background: var(--btn-strong-bg);
  color: var(--btn-strong-fg);
  border: 1px solid var(--btn-strong-border);
  border-radius: 3px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-login:hover {
  background: var(--btn-strong-bg-hover);
}
.error-msg {
  background: rgba(192, 57, 43, 0.12);
  border: 1px solid var(--destructive);
  border-radius: 3px;
  color: var(--destructive);
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  text-align: center;
}
.note {
  background: rgba(139, 26, 26, 0.1);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--muted-foreground);
  font-size: 0.82rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  text-align: center;
}
.d20-icon {
  display: block;
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.skip {
  display: block;
  text-align: center;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

/* ── Abenteuer-Auswahl ── */
.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
}
.subtitle {
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}
.adv-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: box-shadow 0.15s, border-color 0.15s;
  position: relative;
}
.adv-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.adv-name {
  font-family: var(--font-ui);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}
.adv-desc {
  font-size: 0.9rem;
  color: var(--muted-foreground);
  margin-top: 0.3rem;
}
.adv-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-family: var(--font-ui);
  letter-spacing: 0.04em;
}
.badge {
  background: var(--muted);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.1rem 0.4rem;
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: none;
}
.btn-open {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.07em;
  text-transform: none;
  background: var(--btn-strong-bg);
  color: var(--btn-strong-fg);
  border: 1px solid var(--btn-strong-border);
  border-radius: 3px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-open:hover {
  background: var(--btn-strong-bg-hover);
}
.btn-new {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.07em;
  text-transform: none;
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 3px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-new:hover {
  background: var(--primary);
  color: #fff;
}
.new-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
}
.adv-page label {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}
.adv-page input[type="text"],
.adv-page textarea,
.adv-page select.fld {
  width: 100%;
  box-sizing: border-box;
  font-family: "Bookinsanity", serif;
  font-size: 0.95rem;
  background: var(--input);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.4rem 0.7rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.adv-page input[type="text"]:focus,
.adv-page textarea:focus,
.adv-page select.fld:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--focus-ring);
}
.adv-page select.fld {
  appearance: none;
  background-image: var(--select-arrow-dark);
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 13px;
  padding-right: 2rem;
}
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted-foreground);
}
.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}
.caps {
  font-family: var(--font-ui);
  letter-spacing: 0.04em;
}

/* ══════════════════════════════════════════════════
   UTILITIES (Ersatz für inline style="…"-Attribute)
══════════════════════════════════════════════════ */
.u-contents {
  display: contents;
}
.u-flex-row-2 {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.u-relative {
  position: relative;
}
.u-hidden {
  display: none;
}
.u-inline {
  display: inline;
}
.u-flex-shrink-0 {
  flex-shrink: 0;
}
.u-resize-v {
  resize: vertical;
}
.u-my-1 {
  margin: 0.4rem 0;
}

/* Schriftbild-Utilities (ersetzen wiederkehrende inline font-family/letter-spacing) */
.u-serif-body {
  font-family: "Bookinsanity", serif;
}
/* Mr-Eaves-Kapitälchen in zwei Laufweiten (waren als inline-style dutzendfach gesetzt) */
.u-caps {
  font-family: var(--font-ui);
  letter-spacing: 0.04em;
}
.u-caps-label {
  font-family: var(--font-ui);
  letter-spacing: 0.05em;
  text-transform: none;
}
/* nur die Transform-Variante (ohne Font-Wechsel) */
.u-caps-sm {
  text-transform: none;
  letter-spacing: 0.05em;
}

/* Schriftgrößen-/Abstands-Einzelfälle, die als inline-style auftauchten */
.u-fs-sm {
  font-size: var(--text-xs);
}
.u-fs-md {
  font-size: 1.1rem;
}
.u-fs-2xl {
  font-size: 2.5rem;
}
.u-icon-faded {
  font-size: 2.5rem;
  opacity: 0.2;
}

/* Erfolgsmeldung (grüne Box) — analog zu .error-msg, jetzt theme-variabel */
.success-msg {
  background: var(--ok-bg);
  border: 1px solid var(--ok);
  border-radius: 3px;
  color: var(--ok);
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  text-align: center;
}
/* grüner Akzent (Text/Border) als Chip/Badge-Variante */
.ok-accent {
  color: var(--ok);
}

/* Modale Dialog-Karte (war inline width:min(90vw, …rem)) */
.dialog-card {
  width: min(90vw, 36rem);
}
.dialog-card--sm {
  width: min(90vw, 32rem);
}
.dialog-scroll {
  max-height: 60vh;
  overflow-y: auto;
}

/* PC-Detail (Combatant): Sprachenzeile + Attribut-Grid (waren inline) */
.pc-inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
}
.pc-abil-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.3rem;
  text-align: center;
}

/* Editor: Attributs-Stepper-Zeile (war inline display:flex/align-items) */
.ed-abil-row {
  display: flex;
  align-items: flex-end;
}

/* ── Letzte Einzelfall-Utilities (vormals statische inline-styles) ── */
.u-caps-plain {
  font-family: var(--font-ui);
}
.u-fw-bold {
  font-weight: 700;
}
.u-faded {
  opacity: 0.55;
}
.u-w-60 {
  width: 60px;
}
.u-maxh-50vh {
  max-height: 50vh;
}
.u-mb-1 {
  margin-bottom: 1rem;
}
.u-mb-quarter {
  margin-bottom: 0.2rem;
}
/* Hinweistext der leeren Abenteuer-Liste */
.u-hint {
  font-size: 0.85rem;
  margin-top: 0.3rem;
}
/* PC-Detail Rettungswurf-Label (klein, fett) */
.pc-save-lbl {
  font-size: var(--text-xs);
  font-weight: 700;
}
/* Großes Symbol im leeren Aktionspanel */
.u-icon-lg {
  font-size: 1.8rem;
}
/* Zustands-Chips dichter an HP-Balken (war margin-top:0.5rem;margin-bottom:0) */
.ct-cond-chips--tight {
  margin-top: 0.5rem;
  margin-bottom: 0;
}
