:root {
  --bg: #101114;
  --bg-soft: #16181d;
  --panel: #e8decc;
  --panel-top: #f3eadc;
  --panel-alt: #ddd0bb;
  --border: #bda98a;
  --border-soft: rgba(31, 35, 41, 0.1);
  --text: #1d2228;
  --muted: #65707c;
  --faint: #8e959c;
  --gold: #b46f22;
  --gold-hi: #df9a3f;
  --violet: #2c7c7b;
  --violet-soft: rgba(44, 124, 123, 0.13);
  --danger: #b94242;
  --danger-soft: rgba(185, 66, 66, 0.12);
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 18px 48px rgba(16, 17, 20, 0.16);
  --maxw: 1560px;
}

html {
  color-scheme: light;
}

.codex-body {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(180deg, #25282e 0%, #191b20 36%, #111216 100%);
  background-size: 44px 44px, auto;
  color: var(--text);
}

.codex-topbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(19, 21, 25, 0.92);
  backdrop-filter: blur(14px);
}

.codex-topbar-inner {
  padding: 12px 24px;
}

.codex-brand {
  gap: 12px;
  color: #f8f3e8;
}

.codex-brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, #2c7c7b, #1e5554);
  color: #fff7e7;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

.codex-brand .brand-icon {
  display: none;
}

.codex-brand-title {
  display: block;
  font-size: 1rem;
  line-height: 1.1;
}

.codex-brand-sub {
  display: block;
  color: #b8c1c4;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.codex-badge {
  color: #ffe4b8;
  background: rgba(180, 111, 34, 0.2);
  border-color: rgba(223, 154, 63, 0.44);
}

.codex-actions .tb-login {
  color: #d7dde0;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255,255,255,.03);
}

.codex-actions .tb-login:hover {
  color: #fff;
  border-color: rgba(255,255,255,.34);
  background: rgba(255,255,255,.08);
}

.codex-actions .tb-subscribe {
  color: #1f2527;
  background: linear-gradient(135deg, #f2c36f, #df9a3f);
  border-color: rgba(255, 228, 184, 0.7);
  box-shadow: 0 8px 24px rgba(223, 154, 63, 0.18);
}

.codex-page {
  padding: 26px 24px 54px;
}

.codex-command {
  min-height: 210px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 28px;
  align-items: end;
  padding: 34px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(44, 124, 123, 0.28), transparent 52%),
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  box-shadow: 0 22px 60px rgba(0,0,0,.22);
}

.codex-kicker,
.codex-section-label {
  display: inline-flex;
  color: #df9a3f;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.codex-command h1 {
  max-width: 820px;
  margin: 10px 0 12px;
  color: #fff8ea;
  font-size: clamp(2rem, 4vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.codex-command p {
  max-width: 680px;
  margin: 0;
  color: #c9d1d1;
  font-size: 1.02rem;
}

.codex-command-panel {
  display: grid;
  gap: 10px;
}

.codex-icon-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.codex-icon-strip img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  padding: 15px;
  border: 1px solid rgba(223, 154, 63, .24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(44,124,123,.24), rgba(180,111,34,.1)),
    rgba(255,250,240,.08);
  filter:
    brightness(0) saturate(100%)
    invert(77%) sepia(54%) saturate(624%) hue-rotate(344deg) brightness(95%) contrast(88%)
    drop-shadow(0 8px 16px rgba(0,0,0,.28));
  opacity: .94;
}

.codex-meter {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(8, 10, 12, .34);
  color: #e9eee9;
}

.codex-meter span {
  color: #aebabd;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.codex-meter strong {
  text-align: right;
  font-size: .9rem;
}

.codex-workbench {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.codex-rail {
  align-self: start;
  position: sticky;
  top: 82px;
  display: grid;
  gap: 12px;
}

.codex-tabbar {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 8px;
  overflow: visible;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(19, 21, 25, .72);
  box-shadow: 0 18px 44px rgba(0,0,0,.18);
}

.codex-tabbar .tab-btn {
  width: 100%;
  justify-content: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px 12px;
  color: #c6ced0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
}

.codex-tabbar .tab-btn i {
  width: 18px;
  color: #df9a3f;
}

.codex-tabbar .tab-btn:hover:not(:disabled) {
  color: #fff;
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
}

.codex-tabbar .tab-btn.active {
  color: #fff;
  border-color: rgba(69, 161, 159, .55);
  background: rgba(44, 124, 123, .26);
}

.codex-tabbar .tab-btn:disabled {
  opacity: .46;
}

.codex-rail-note {
  padding: 14px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background: rgba(255,255,255,.045);
  color: #b8c1c4;
  font-size: .82rem;
}

.codex-panel {
  padding: 0;
  overflow: hidden;
  border-color: rgba(255, 250, 240, .94);
  background: #e8decc;
  box-shadow: var(--shadow);
}

.codex-panel-head {
  margin: 0;
  padding: 22px 24px;
  border-bottom: 1px solid #c8b693;
  background:
    linear-gradient(90deg, rgba(44,124,123,.1), transparent 56%),
    #f2e8d8;
}

.codex-panel-head h2 {
  margin-top: 2px;
  color: #1d2228;
  font-size: 1.65rem;
  letter-spacing: 0;
}

.codex-controls {
  margin: 0;
  padding: 18px 24px;
  border-bottom: 1px solid #c8b693;
  background: #dfd2bd;
}

.codex-control {
  min-width: 0;
}

.codex-control label {
  color: #4d5860;
  letter-spacing: .08em;
}

.codex-control-action {
  justify-content: end;
}

.codex-stage .select,
.codex-stage input[type="number"],
.codex-stage input[type="search"],
.codex-stage .sim-batch-count {
  color: #1d2228;
  border-color: #b19d7c;
  background: #f6eddf;
}

.codex-stage input[type="range"] {
  accent-color: #2c7c7b;
}

.codex-stage .pill {
  color: #fff8ea;
  background: #2c7c7b;
  border-color: rgba(44, 124, 123, .45);
}

.codex-stage .btn,
.codex-stage .tb-btn {
  border-radius: 6px;
}

.codex-stage .btn-ghost {
  color: #293037;
  border-color: #bcae95;
  background: rgba(255,255,255,.3);
}

.codex-stage .btn-ghost:hover {
  color: #111519;
  border-color: #2c7c7b;
  background: rgba(44,124,123,.1);
}

.codex-stage .btn-primary {
  color: #fffaf0;
  border-color: #226867;
  background: #2c7c7b;
}

.codex-stage .seg-control {
  border-color: #cabb9f;
  background: #e8dcc8;
  border-radius: 8px;
}

.codex-stage .seg {
  border-radius: 6px;
}

.codex-stage .seg.active {
  color: #102525;
  background: rgba(44, 124, 123, .18);
  box-shadow: inset 0 0 0 1px rgba(44,124,123,.4);
}

.codex-party-grid {
  padding: 24px;
}

.codex-stage .party-2col {
  gap: 16px;
}

.codex-stage .pc-mini,
.codex-stage .pc-detail,
.codex-stage .m-row,
.codex-stage .monster-queue,
.codex-stage .queue-item {
  border-radius: 8px;
  border-color: #bfae8e;
  background: #f1e7d7;
  color: #1d2228;
  box-shadow: none;
}

.codex-stage .pc-mini.is-selected,
.codex-stage .m-row.is-selected {
  border-color: #2c7c7b;
  box-shadow: inset 4px 0 0 #2c7c7b;
}

.codex-stage .pc-mini:hover,
.codex-stage .m-row:hover {
  border-color: #2c7c7b;
  background: #fffdf6;
}

.codex-stage .pc-mini-icon,
.codex-stage .pc-detail-icon {
  border-radius: 8px;
  border: 1px solid #c6b695;
  background:
    linear-gradient(135deg, rgba(44,124,123,.16), rgba(180,111,34,.1)),
    #e7dbc7;
}

.codex-stage .pc-mini-icon img,
.codex-stage .pc-detail-icon img {
  filter: brightness(0) saturate(100%) invert(33%) sepia(20%) saturate(1115%) hue-rotate(130deg) brightness(89%) contrast(91%);
}

.codex-stage .pc-mini-pill {
  color: #205b59;
  border: 1px solid rgba(44,124,123,.32);
  background: rgba(44,124,123,.12);
}

.codex-stage .pc-mini.is-custom .pc-mini-pill,
.codex-stage .pc-detail .pc-mini-pill {
  color: #7a4a14;
  border-color: rgba(180,111,34,.32);
  background: rgba(180,111,34,.12);
}

.codex-stage .stat-card,
.codex-stage .pc-build-card,
.codex-stage .resource-card,
.codex-stage .spellbook-card,
.codex-stage .inventory-card,
.codex-stage .m-stat,
.codex-stage .m-trait {
  border-radius: 8px;
  border-color: #bfae8e;
  background: #e5d8c4;
}

.codex-stage .spell-chip,
.codex-stage .inv-item,
.codex-stage .chip,
.codex-stage .m-tag,
.codex-stage .tac-preset,
.codex-stage .tac-target,
.codex-stage .tac-chip,
.codex-stage .atk-pill,
.codex-stage .feat-pill,
.codex-stage .spell-tag {
  border-radius: 6px;
}

.codex-stage .tac-preset,
.codex-stage .tac-target,
.codex-stage .tac-chip,
.codex-stage .atk-pill,
.codex-stage .feat-pill,
.codex-stage .spell-tag {
  color: #33414a;
  border: 1px solid #c6b695;
  background: rgba(255,250,240,.62);
}

.codex-stage .tac-preset {
  color: #102525;
  border-color: rgba(44,124,123,.32);
  background: rgba(44,124,123,.1);
}

.codex-stage .tac-target {
  color: #205b59;
  border-color: rgba(44,124,123,.26);
  background: rgba(44,124,123,.08);
}

.codex-stage .tac-chip {
  color: #5f471f;
  border-color: rgba(180,111,34,.28);
  background: rgba(180,111,34,.08);
}

.codex-stage .atk-pill,
.codex-stage .feat-pill {
  color: #7a4a14;
  border-color: rgba(180,111,34,.34);
  background: rgba(180,111,34,.1);
}

.codex-stage .spell-tag,
.codex-stage .spell-tag.spell-dmg {
  color: #205b59;
  border-color: rgba(44,124,123,.26);
  background: rgba(44,124,123,.08);
}

.codex-stage .slot-pip {
  color: #102525;
  border-color: rgba(44,124,123,.34);
  background: rgba(44,124,123,.12);
}

.codex-stage .spell-chip {
  border-color: #bfae8e;
  border-left-color: #2c7c7b;
  background: #f1e7d7;
}

.codex-stage .spell-chip.school-evocation { border-left-color: #b46f22; }
.codex-stage .spell-chip.school-abjuration { border-left-color: #2c7c7b; }
.codex-stage .spell-chip.school-conjuration { border-left-color: #6a7662; }
.codex-stage .spell-chip.school-divination { border-left-color: #b68a2e; }
.codex-stage .spell-chip.school-enchantment { border-left-color: #8f6b45; }
.codex-stage .spell-chip.school-illusion { border-left-color: #60716f; }
.codex-stage .spell-chip.school-necromancy { border-left-color: #4f6541; }
.codex-stage .spell-chip.school-transmutation { border-left-color: #a6622e; }

.codex-stage .inv-item {
  color: #3f4a51;
  border-color: #bfae8e;
  background: #f1e7d7;
}

.codex-stage .inv-item.rarity-common,
.codex-stage .inv-item.rarity-uncommon,
.codex-stage .inv-item.rarity-rare,
.codex-stage .inv-item.rarity-very-rare,
.codex-stage .inv-item.rarity-legendary {
  color: #3f4a51;
  border-color: #c6b695;
  background: rgba(255,250,240,.7);
}

.codex-stage .inv-item.rarity-uncommon,
.codex-stage .inv-item.rarity-rare {
  color: #205b59;
  border-color: rgba(44,124,123,.34);
  background: rgba(44,124,123,.08);
}

.codex-stage .inv-item.rarity-very-rare,
.codex-stage .inv-item.rarity-legendary {
  color: #7a4a14;
  border-color: rgba(180,111,34,.36);
  background: rgba(180,111,34,.1);
}

.codex-stage .chip {
  color: #39444c;
  border-color: #cabb9f;
  background: rgba(255,255,255,.3);
}

.codex-stage .chip:hover {
  color: #102525;
  border-color: rgba(44,124,123,.38);
  background: rgba(44,124,123,.08);
}

.codex-stage .chip.is-on {
  color: #102525;
  border-color: #2c7c7b;
  background: rgba(44,124,123,.16);
}

.codex-stage .m-tag {
  color: #44515a;
  border-color: #bfae8e;
  background: rgba(246,237,223,.72);
}

.codex-stage .m-tag.m-tag-type {
  color: #205b59;
  border-color: rgba(44,124,123,.3);
  background: rgba(44,124,123,.1);
}

.codex-stage .m-add-btn {
  color: #205b59;
  border-color: rgba(44,124,123,.36);
  background: rgba(44,124,123,.1);
}

.codex-stage .m-add-btn:hover {
  color: #102525;
  border-color: #2c7c7b;
  background: rgba(44,124,123,.18);
}

.codex-stage .m-count-badge {
  color: #7a4a14;
  border-color: rgba(180,111,34,.36);
  background: rgba(180,111,34,.12);
}

.codex-stage .m-count-badge:hover {
  background: rgba(180,111,34,.2);
}

.codex-stage .queue-title,
.codex-stage .queue-count {
  color: #b46f22;
}

.codex-stage .queue-btn {
  color: #44515a;
  border-color: #bfae8e;
  background: rgba(246,237,223,.58);
}

.codex-stage .queue-btn:hover,
.codex-stage .queue-btn-add:hover {
  color: #102525;
  border-color: rgba(44,124,123,.42);
  background: rgba(44,124,123,.12);
}

.codex-stage .queue-btn-x:hover {
  color: #7a281f;
  border-color: rgba(145,64,48,.36);
  background: rgba(145,64,48,.1);
}

.codex-stage .queueClearBtn,
.codex-stage #queueClearBtn {
  color: #33414a;
  border-color: #bfae8e;
  background: rgba(246,237,223,.5);
}

.codex-stage #queueClearBtn:hover:not(:disabled) {
  color: #102525;
  border-color: #2c7c7b;
  background: rgba(44,124,123,.1);
}

.codex-monster-controls {
  grid-template-columns: minmax(220px, 1.4fr) minmax(210px, .7fr) minmax(220px, 1fr) minmax(180px, .8fr);
}

.codex-monster-layout {
  padding: 24px;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.codex-queue {
  position: sticky;
  top: 82px;
  align-self: start;
  background: #f1e7d7;
}

.codex-footer {
  border-top: 1px solid rgba(255,255,255,.1);
  color: #aebabd;
}

.codex-footer .muted {
  color: #aebabd;
}

/* ── Simulate tab — codex overrides ───────────────────────── */
.codex-stage .sim-summary-card,
.codex-stage .sim-output-card {
  background: #f1e7d7;
  border-color: #bfae8e;
  color: #1d2228;
}
.codex-stage .sim-card-label { color: #65707c; }
.codex-stage .sim-party-line, .codex-stage .sim-enc-line { color: #1d2228; }
.codex-stage .sim-party-line strong, .codex-stage .sim-enc-line strong { color: #102525; }

.codex-stage .sim-result-line strong,
.codex-stage .sim-result-meta strong { color: #7a4a14; }
.codex-stage .sim-result-meta {
  border-top: 1px dashed #c8b693;
  color: #1d2228;
}
.codex-stage .sim-result-meta .muted { color: #65707c; }

/* High-contrast result tag pills on parchment */
.codex-stage .sim-tag {
  letter-spacing: .08em;
  font-weight: 800;
}
.codex-stage .sim-tag.ok {
  background: #2c7c7b;
  color: #f1e7d7;
  border-color: #1e5554;
}
.codex-stage .sim-tag.warn {
  background: #df9a3f;
  color: #1d2228;
  border-color: #b46f22;
}
.codex-stage .sim-tag.err {
  background: #b94242;
  color: #fff4ea;
  border-color: #7d2c2c;
}

/* Battle log — keep it a proper dark "console" block on parchment */
.codex-stage .sim-log-card pre.sim-log {
  background: #14171c;
  color: #e9eee9;
  border: 1px solid #2a2d34;
  font-size: .8rem;
  line-height: 1.55;
}

/* Sample-battle chips on parchment */
.codex-stage .sim-sample-btn {
  background: #f1e7d7;
  border-color: #bfae8e;
  color: #1d2228;
}
.codex-stage .sim-sample-btn:hover {
  background: #fffdf6;
  border-color: #2c7c7b;
}
.codex-stage .sim-sample-btn.is-active {
  background: rgba(180,111,34,.12);
  border-color: #b46f22;
  box-shadow: inset 0 0 0 1px rgba(180,111,34,.5);
}
.codex-stage .sim-sample-tag.ok   { background: rgba(44,124,123,.18); color: #205b59; }
.codex-stage .sim-sample-tag.warn { background: rgba(180,111,34,.18); color: #7a4a14; }
.codex-stage .sim-sample-tag.err  { background: rgba(185,66,66,.18); color: #7d2c2c; }
.codex-stage .sim-sample-meta     { color: #65707c; }

.tippy-box[data-theme~="crcalc"] {
  border-radius: 8px;
  background: linear-gradient(180deg, #232830 0%, #1a1e23 100%);
  color: #f6e9d0;
  border: 1px solid rgba(223, 154, 63, 0.45);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, .45),
    0 0 0 1px rgba(44, 124, 123, .18) inset;
  font-family: var(--font, 'Inter', system-ui, sans-serif);
  font-size: .82rem;
  font-weight: 500;
  padding: 0;
}
.tippy-box[data-theme~="crcalc"] .tippy-content {
  padding: 8px 12px;
}
.tippy-box[data-theme~="crcalc"][data-placement^="top"]    > .tippy-arrow::before { border-top-color:    #1a1e23; }
.tippy-box[data-theme~="crcalc"][data-placement^="bottom"] > .tippy-arrow::before { border-bottom-color: #232830; }
.tippy-box[data-theme~="crcalc"][data-placement^="left"]   > .tippy-arrow::before { border-left-color:   #1f242b; }
.tippy-box[data-theme~="crcalc"][data-placement^="right"]  > .tippy-arrow::before { border-right-color:  #1f242b; }

/* Spell-tip readability fix: codex remaps :root --text/--muted/--gold to
   DARK colors for parchment panels, but tippy tooltips have a DARK
   background. Hard-code light text inside the tippy box so vars don't
   bleed in. */
.tippy-box[data-theme~="crcalc"] .tt-name      { color: #f6e9d0; }
.tippy-box[data-theme~="crcalc"] .tt-sub       { color: #df9a3f; }
.tippy-box[data-theme~="crcalc"] .tt-grid      { color: #e6dcc8; }
.tippy-box[data-theme~="crcalc"] .tt-k         { color: #b9a987; }
.tippy-box[data-theme~="crcalc"] .tt-desc      { color: #cabea4; border-top-color: rgba(223,154,63,.25); }
.tippy-box[data-theme~="crcalc"] .tt-spell-head { border-bottom-color: rgba(223,154,63,.25); }
.tippy-box[data-theme~="crcalc"] .tt-pill {
  color: #d6c8a4;
  background: rgba(255,255,255,.06);
  border-color: rgba(223,154,63,.3);
}
.tippy-box[data-theme~="crcalc"] .tt-pill.tt-prio { color: #f6e9d0; }

@media (max-width: 1180px) {
  .codex-command {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .codex-command-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .codex-workbench {
    grid-template-columns: 1fr;
  }

  .codex-rail {
    position: static;
  }

  .codex-tabbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .codex-tabbar .tab-btn {
    justify-content: center;
  }

  .codex-rail-note {
    display: none;
  }

  .codex-monster-layout {
    grid-template-columns: 1fr;
  }

  .codex-queue {
    position: static;
  }
}

@media (max-width: 760px) {
  .codex-topbar-inner,
  .codex-actions {
    align-items: stretch;
  }

  .codex-brand-sub,
  .codex-badge {
    display: none;
  }

  .codex-actions .tb-btn span {
    display: none;
  }

  .codex-page {
    padding: 16px 12px 38px;
  }

  .codex-command {
    min-height: 0;
    padding: 22px;
  }

  .codex-command h1 {
    font-size: 2.1rem;
  }

  .codex-command-panel {
    grid-template-columns: 1fr;
  }

  .codex-tabbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .codex-panel-head,
  .codex-controls,
  .codex-party-grid,
  .codex-monster-layout {
    padding-left: 14px;
    padding-right: 14px;
  }

  .codex-panel-head {
    align-items: stretch;
  }

  .codex-stage .seg-control {
    width: 100%;
  }

  .codex-stage .seg {
    flex: 1;
    justify-content: center;
  }

  .codex-control-action {
    justify-content: stretch;
  }

  .codex-control-action .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ─── Saved Encounters subsection (inside queue aside) ────────────────── */
.queue-head.saved-head {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border, rgba(139, 110, 70, 0.18));
}

.saved-encounter-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.saved-encounter-empty {
  padding: 14px;
  text-align: center;
  color: var(--muted, #8a7a5a);
  font-size: 0.82em;
  font-style: italic;
  border: 1px dashed var(--border, rgba(139, 110, 70, 0.25));
  border-radius: 6px;
}

.saved-encounter-row {
  display: flex;
  align-items: stretch;
  border-radius: 6px;
  background: var(--surface-2, rgba(139, 110, 70, 0.06));
  border: 1px solid var(--border, rgba(139, 110, 70, 0.15));
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}

.saved-encounter-row:hover {
  border-color: var(--accent, #b07a3c);
  background: var(--surface-3, rgba(139, 110, 70, 0.12));
}

.saved-encounter-load {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  padding: 7px 10px;
  color: inherit;
  font: inherit;
}

.saved-encounter-load:focus-visible {
  outline: 2px solid var(--accent, #b07a3c);
  outline-offset: -2px;
}

.saved-encounter-name {
  font-weight: 600;
  font-size: 0.85em;
  color: var(--text, #2a1f10);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.saved-encounter-meta {
  font-size: 0.72em;
  color: var(--muted, #8a7a5a);
}

.saved-encounter-del {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-left: 1px solid var(--border, rgba(139, 110, 70, 0.15));
  padding: 0 10px;
  color: var(--muted, #8a7a5a);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.saved-encounter-del:hover {
  background: rgba(176, 50, 50, 0.12);
  color: #b03232;
}
