:root {
  --bg: #edf3f7;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --panel-2: #f2f7fa;
  --line: #d6e2ea;
  --line-2: #b9cbd7;
  --text: #1b2d3a;
  --muted: #587080;
  --faint: #8aa0ae;
  --ember: #2a6fb3;
  --ember-2: #1d5a94;
  --ember-bg: rgba(var(--ember-rgb), .10);
  --blood: #c9483f;
  --blood-bg: rgba(var(--blood-rgb), .10);
  --moss: #2f9e6c;
  --moss-bg: rgba(var(--moss-rgb), .12);
  --gold: #b07d0a;
  --arcane: #0f8a7e;
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --drawer-w: 460px;
  --strip: #e3eef5;
  --track: #e6eef3;
  --row-alt: #f7fafc;
  --on-accent: #ffffff;
  --warn-bar: #e0a526;
  --warn-ink: #a87508;
  --teal-ink: #0b6b62;
  --blood-ink: #b23a31;
  --moss-ink: #23845a;
  --gold-ink: #8a6208;
  --moss-hover: #278a5d;
  --shadow-rgb: 25, 55, 85;
  --toast-bg: #ffffff;
  color-scheme: light;
}

/* ---------- Modo oscuro (azules y verdes) ---------- */
:root[data-theme="dark"] {
  --bg: #0f1b24;
  --bg-2: #142430;
  --panel: #182a37;
  --panel-2: #1f3445;
  --line: #2a4254;
  --line-2: #3b576c;
  --text: #e3edf3;
  --muted: #a0b5c4;
  --faint: #6f889a;
  --ember: #3b84ca;
  --ember-2: #82bdf0;
  --ember-bg: rgba(var(--ember-rgb), .17);
  --blood: #e2685f;
  --blood-bg: rgba(226, 104, 95, .16);
  --moss: #38b57e;
  --moss-bg: rgba(56, 181, 126, .17);
  --gold: #e3b341;
  --arcane: #3cc4b4;
  --strip: #12212c;
  --track: #0f1b24;
  --row-alt: #152734;
  --on-accent: #ffffff;
  --warn-bar: #e0a526;
  --warn-ink: #f0bb52;
  --teal-ink: #86e2d6;
  --blood-ink: #f3a199;
  --moss-ink: #86dcb2;
  --gold-ink: #ecc766;
  --moss-hover: #2fa06d;
  --shadow-rgb: 0, 0, 0;
  --toast-bg: #1f3445;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0f1b24;
    --bg-2: #142430;
    --panel: #182a37;
    --panel-2: #1f3445;
    --line: #2a4254;
    --line-2: #3b576c;
    --text: #e3edf3;
    --muted: #a0b5c4;
    --faint: #6f889a;
    --ember: #3b84ca;
    --ember-2: #82bdf0;
    --ember-bg: rgba(var(--ember-rgb), .17);
    --blood: #e2685f;
    --blood-bg: rgba(226, 104, 95, .16);
    --moss: #38b57e;
    --moss-bg: rgba(56, 181, 126, .17);
    --gold: #e3b341;
    --arcane: #3cc4b4;
    --strip: #12212c;
    --track: #0f1b24;
    --row-alt: #152734;
    --on-accent: #ffffff;
    --warn-bar: #e0a526;
    --warn-ink: #f0bb52;
    --teal-ink: #86e2d6;
    --blood-ink: #f3a199;
    --moss-ink: #86dcb2;
    --gold-ink: #ecc766;
    --moss-hover: #2fa06d;
    --shadow-rgb: 0, 0, 0;
    --toast-bg: #1f3445;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--sans);
  display: grid;
  grid-template-rows: auto auto 1fr;
  grid-template-columns: minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ember-2); }
code, kbd { font-family: ui-monospace, Consolas, monospace; font-size: .88em; }
kbd { border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 .35em; color: var(--muted); background: var(--bg-2); }
.ic { width: 18px; height: 18px; flex: none; }
.ic.huge { width: 56px; height: 56px; color: var(--line-2); }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.pad { padding: 10px; }
.spacer { flex: 1; }
[hidden] { display: none !important; }

/* ---------- Encabezado ---------- */
.top {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--bg-2); border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--ember), var(--moss)) 1;
}
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 19px; letter-spacing: .02em; flex: none; }
.brand b { color: var(--ember); font-weight: 700; margin-left: 3px; }
.brand-ic { width: 26px; height: 26px; color: var(--ember); }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex; align-items: center; gap: 7px; position: relative;
  background: none; border: 0; color: var(--muted); padding: 9px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; min-height: 40px;
}
.tab:hover { color: var(--text); background: var(--panel); }
.tab.on { color: var(--text); background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--ember); }
.badge { font-style: normal; font-size: 11px; background: var(--ember); color: var(--on-accent); border-radius: 99px; padding: 0 6px; font-weight: 700; }
.badge.dot { width: 8px; height: 8px; padding: 0; position: absolute; top: 7px; right: 6px; }
.tools { display: flex; gap: 6px; flex: none; }
.tool {
  display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel);
  border-radius: 8px; padding: 7px 11px; cursor: pointer; min-height: 40px;
}
.tool:hover { border-color: var(--line-2); background: var(--panel-2); }
.tool kbd { font-size: 11px; }
.tool.accent { border-color: rgba(var(--ember-rgb), .5); background: var(--ember-bg); color: var(--ember-2); }

/* ---------- Tira persistente ---------- */
.strip {
  display: flex; align-items: stretch; gap: 10px; padding: 8px 14px;
  background: var(--strip); border-bottom: 1px solid var(--line);
}
.party-strip { display: flex; gap: 8px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: thin; }
.pc-chip {
  display: flex; align-items: center; gap: 8px; flex: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 5px 10px; cursor: pointer; min-height: 40px;
}
.pc-chip:hover { border-color: var(--line-2); }
.pc-name { font-family: var(--serif); font-weight: 600; font-size: 15px; max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pas { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 13px; }
.pas .ic { width: 14px; height: 14px; }
.pas i { font-style: normal; font-size: 10px; letter-spacing: .04em; color: var(--faint); }
.pas b { color: var(--text); font-variant-numeric: tabular-nums; font-size: 15px; }
.pas.best b { color: var(--gold); }
.pas.ac b { color: var(--arcane); }
.strip-empty { border: 1px dashed var(--line-2); background: none; color: var(--muted); border-radius: 9px; padding: 6px 12px; display: flex; gap: 8px; align-items: center; cursor: pointer; }
.music-mini { display: flex; align-items: center; gap: 6px; flex: none; max-width: 48%; }
.mm-scenes { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.scene-pill { flex: none; border: 1px solid var(--line); background: var(--panel); border-radius: 99px; padding: 5px 11px; cursor: pointer; font-size: 13px; color: var(--muted); min-height: 34px; display: flex; align-items: center; gap: 5px; }
.scene-pill.on { color: var(--on-accent); background: var(--ember); border-color: var(--ember); font-weight: 600; }
.scene-pill.ghost { border-style: dashed; }
.vol { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.vol input { width: 80px; accent-color: var(--ember); }
.now { font-size: 12px; color: var(--muted); max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 8px; padding: 8px 14px; cursor: pointer; min-height: 40px; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--faint); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--ember); border-color: var(--ember); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--ember-2); }
.btn.danger { background: var(--blood-bg); border-color: rgba(var(--blood-rgb), .5); color: var(--blood-ink); }
.btn.ghost { background: none; border-color: var(--line); color: var(--muted); }
.btn.sm { padding: 5px 10px; min-height: 34px; font-size: 13px; }
.btn.big { min-height: 48px; padding: 10px 20px; font-size: 16px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--muted); flex: none; }
.icon-btn:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }
.icon-btn:disabled { opacity: .3; }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.play { border-color: var(--line-2); background: var(--panel); color: var(--text); }
.icon-btn.play.on { background: var(--ember-bg); border-color: var(--ember); color: var(--ember-2); }
.icon-btn.add { color: var(--ember-2); border-color: var(--line); }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 0; position: relative; }
#view { flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: env(safe-area-inset-bottom); }
.page { padding: 18px 20px 60px; max-width: 1180px; margin: 0 auto; }
.page.narrow { max-width: 760px; }
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.page-head h1, .turn-info h1 { font-family: var(--serif); font-weight: 600; font-size: 26px; margin: 0; letter-spacing: .01em; }
.empty { color: var(--muted); padding: 24px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); margin: 12px 0; }
.big-empty { padding: 48px 20px; }
.big-empty p { margin: 8px 0; }
.notice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--radius); background: var(--ember-bg); border: 1px solid rgba(var(--ember-rgb), .4); margin-bottom: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 4px 11px; }
.pill.ok { color: var(--moss); border-color: rgba(var(--moss-rgb), .4); background: var(--moss-bg); }
.pill b { color: var(--text); }

/* ---------- Drawer ---------- */
#drawer {
  width: var(--drawer-w); max-width: 100%; flex: none; display: flex; flex-direction: column;
  background: var(--bg-2); border-left: 1px solid var(--line); min-height: 0;
}
.drawer-head { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 6px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { flex: 1; margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { overflow-y: auto; padding: 14px 18px 40px; flex: 1; overscroll-behavior: contain; }
@media (max-width: 1099px) {
  #drawer { position: absolute; inset: 0 0 0 auto; z-index: 20; box-shadow: -20px 0 40px rgba(var(--shadow-rgb), .16); }
}

/* ---------- Combate ---------- */
.combat-bar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px;
}
.round { display: flex; flex-direction: column; align-items: center; padding-right: 16px; border-right: 1px solid var(--line); }
.round span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.round b { font-family: var(--serif); font-size: 34px; line-height: 1; color: var(--ember-2); }
.turn-info { flex: 1; min-width: 180px; }
.turn-info span { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.turn-info b { font-family: var(--serif); font-size: 22px; }
.cb-btns { display: flex; gap: 8px; }
.combat-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.init-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cb {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(250px, 340px) 44px; gap: 12px; align-items: center;
  padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; border-left: 4px solid var(--line-2);
}
.cb.kind-pc { border-left-color: var(--arcane); }
.cb.kind-mon { border-left-color: var(--blood); }
.cb.kind-npc { border-left-color: var(--moss); }
.cb.current { background: linear-gradient(90deg, var(--ember-bg), var(--panel) 60%); border-color: rgba(var(--ember-rgb), .55); box-shadow: 0 0 0 1px rgba(var(--ember-rgb), .25); }
.cb.down { opacity: .5; }
.cb.down .cb-name { text-decoration: line-through; }
.cb > * { min-width: 0; }
.cb-init input {
  width: 100%; height: 48px; text-align: center; font-family: var(--serif); font-size: 24px; font-weight: 600;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
.cb-name { background: none; border: 0; padding: 0; cursor: pointer; font-family: var(--serif); font-size: 19px; font-weight: 600; text-align: left; display: flex; align-items: center; gap: 8px; }
.cb-name:hover { color: var(--ember-2); }
.turn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 10px var(--ember); flex: none; }
.cb-meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 4px; font-size: 13px; color: var(--muted); }
.cb-meta .ic { width: 14px; height: 14px; }
.meta-ac, .meta-pas { display: inline-flex; align-items: center; gap: 3px; margin-right: 4px; }
.meta-ac { color: var(--arcane); }
.tag { font-size: 10px; letter-spacing: .08em; padding: 1px 6px; border-radius: 4px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.tag.pc { color: var(--arcane); }
.chip { border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 99px; padding: 3px 10px; font-size: 12px; cursor: pointer; min-height: 28px; }
.chip.add { border-style: dashed; color: var(--faint); background: none; }
.chip.add:hover { color: var(--text); }
.chip[class*="cond-"]:not(.add) { background: rgba(var(--teal-rgb), .14); border-color: rgba(var(--teal-rgb), .4); color: var(--teal-ink); }
.chip.cond-concentration { background: rgba(176, 125, 10, .14); border-color: rgba(176, 125, 10, .45); color: var(--gold); }
.chip.cond-unconscious, .chip.cond-paralyzed, .chip.cond-stunned, .chip.cond-petrified { background: var(--blood-bg); border-color: rgba(var(--blood-rgb), .45); color: var(--blood-ink); }

.hpctl { display: flex; flex-direction: column; gap: 6px; }
.hpctl.big { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 14px; }
.hpinfo { display: flex; align-items: center; gap: 10px; }
.hpbar { flex: 1; height: 8px; border-radius: 99px; background: var(--bg); overflow: hidden; border: 1px solid var(--line); }
.hpbar span { display: block; height: 100%; background: var(--moss); transition: width .25s; }
.hpbar.bloodied span { background: var(--ember); }
.hpbar.dead span { background: var(--blood); }
.hptext { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; font-size: 14px; }
.hptext b { color: var(--text); font-size: 18px; }
.hpctl.big .hptext b { font-size: 26px; }
.temp { color: var(--arcane); font-weight: 600; }
.bl { font-size: 11px; color: var(--ember-2); text-transform: uppercase; letter-spacing: .06em; }
.bl.dead { color: var(--blood); }
.hpinput { display: flex; gap: 5px; }
.hpinput input { width: 70px; min-width: 0; height: 34px; text-align: center; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; font-size: 16px; }
.btn.dmg { color: var(--blood-ink); }
.btn.heal { color: var(--moss-ink); }

/* ---------- Grupo ---------- */
.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.pc-edit { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.pc-edit-head { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.pc-title { flex: 1; font-family: var(--serif); font-size: 20px; font-weight: 600; background: none; border: 0; border-bottom: 1px dashed var(--line-2); padding: 4px 2px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.fields.two .span2 { grid-column: span 2; }
label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
label.full { margin-top: 8px; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--text); margin: 8px 0; cursor: pointer; }
label.check input { width: 18px; height: 18px; accent-color: var(--ember); }

:where(input:not([type=checkbox]):not([type=range]):not([type=file]), select, textarea) {
  background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; font-size: 15px; color: var(--text); min-height: 38px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(var(--ember-rgb), .55); outline-offset: 0; border-color: var(--ember); }
textarea { resize: vertical; line-height: 1.45; }
.pc-card .pc-big { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.pc-big div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 6px; text-align: center; }
.pc-big span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pc-big b { font-family: var(--serif); font-size: 28px; }

/* ---------- Bestiario ---------- */
.filters { display: flex; gap: 8px; margin: 8px 0 12px; flex-wrap: wrap; }
.filters input[type=search] { flex: 1 1 260px; }
.filters select { flex: 0 1 190px; width: auto; }
.mon-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.mon-row { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-bottom: 1px solid var(--line); background: var(--panel); }
.mon-row:last-child { border-bottom: 0; }
.mon-row:nth-child(even) { background: var(--bg-2); }
.mon-open { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; text-align: left; background: none; border: 0; padding: 7px 10px; cursor: pointer; border-radius: 7px; }
.mon-open:hover { background: var(--panel-2); }
.mon-name { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.mon-meta { font-size: 12px; color: var(--muted); }
.mon-stat { width: 54px; text-align: right; font-variant-numeric: tabular-nums; font-size: 15px; flex: none; }
.mon-stat i { font-style: normal; font-size: 10px; color: var(--faint); margin-right: 4px; }

/* ---------- Bloque de estadísticas ---------- */
.sb-sub { font-style: italic; color: var(--muted); margin-bottom: 10px; }
.sb-top { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.sb-top div { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 7px 4px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.sb-top span { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sb-top b { font-family: var(--serif); font-size: 22px; line-height: 1.2; }
.sb-top small { font-size: 11px; }
.sb-line { padding: 3px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.sb-line b { color: var(--ember-2); margin-right: 4px; font-weight: 600; }
.sb-abil { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 10px 0; }
.sb-abil div { display: flex; flex-direction: column; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 5px 2px; gap: 2px; }
.sb-abil span { font-size: 10px; letter-spacing: .08em; color: var(--muted); }
.sb-abil b { font-size: 15px; }
.sb-abil i { color: var(--faint); font-size: 11px; font-style: normal; height: 22px; }
.sb-h { font-family: var(--serif); font-size: 18px; color: var(--ember-2); border-bottom: 1px solid var(--ember); padding-bottom: 2px; margin: 18px 0 6px; font-weight: 600; }
.sb-p { margin: 6px 0; font-size: 14.5px; line-height: 1.5; }
.roll {
  border: 1px solid rgba(var(--ember-rgb), .35); background: var(--ember-bg); color: var(--ember-2);
  border-radius: 5px; padding: 0 5px; font-size: inherit; cursor: pointer; line-height: 1.5; font-variant-numeric: tabular-nums;
}
.roll:hover { background: rgba(var(--ember-rgb), .28); }
.roll.save { font-size: 11px; padding: 0 4px; }
.sb-top .roll { font-family: var(--serif); font-size: 22px; padding: 0 6px; line-height: 1.2; }
.sb-top small .roll { font-family: var(--sans); font-size: 11px; }
.sb-add { display: flex; gap: 10px; align-items: flex-end; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.sb-add label { width: 100px; }
.srd-note { font-size: 11px; color: var(--faint); margin-top: 16px; }

/* ---------- Vault y markdown ---------- */
.vault-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.vault-help { text-align: left; max-width: 720px; }
.vault-help h3 { margin-top: 0; font-family: var(--serif); color: var(--text); }
.note-list { display: flex; flex-direction: column; gap: 2px; }
.note-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; text-align: left; background: none; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.note-row:hover { background: var(--panel); }
.nr-name { font-family: var(--serif); font-size: 16px; font-weight: 600; }
.nr-folder { font-size: 12px; color: var(--faint); align-self: center; }
.nr-snip { grid-column: 1 / -1; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-path { font-size: 12px; color: var(--faint); margin-bottom: 8px; }
.md { line-height: 1.6; overflow-wrap: anywhere; }
.md h1, .md h2, .md h3, .md h4 { font-family: var(--serif); line-height: 1.25; margin: 1.1em 0 .4em; font-weight: 600; }
.md h1 { font-size: 26px; } .md h2 { font-size: 21px; color: var(--ember-2); } .md h3 { font-size: 18px; } .md h4 { font-size: 16px; }
.md > :first-child { margin-top: 0; }
.md p { margin: .55em 0; }
.md ul, .md ol { padding-left: 1.3em; margin: .4em 0; }
.md li { margin: .15em 0; }
.md blockquote { margin: .6em 0; padding: .2em 0 .2em 12px; border-left: 3px solid var(--line-2); color: var(--muted); }
.md pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow-x: auto; }
.md code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.md pre code { background: none; padding: 0; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1em 0; }
.md mark { background: rgba(176, 125, 10, .3); color: inherit; padding: 0 2px; border-radius: 3px; }
.md img { max-width: 100%; border-radius: 8px; }
.table-wrap { overflow-x: auto; margin: .6em 0; }
.md table { border-collapse: collapse; font-size: 14px; }
.md th, .md td { border: 1px solid var(--line); padding: 5px 9px; text-align: left; }
.md th { background: var(--panel); }
.wl { color: var(--ember-2); text-decoration: none; border-bottom: 1px dotted rgba(var(--ember-rgb), .6); cursor: pointer; }
.wl:hover { color: var(--gold); }
.tag { white-space: nowrap; }
.md .tag { color: var(--arcane); background: rgba(var(--teal-rgb), .12); border-color: transparent; font-size: 12px; letter-spacing: 0; }
.callout { border: 1px solid var(--line-2); border-left: 4px solid var(--arcane); border-radius: 8px; padding: 8px 12px; margin: .7em 0; background: var(--panel); }
.callout-title { font-weight: 700; margin-bottom: 4px; }
.callout-warning, .callout-danger, .callout-caution { border-left-color: var(--blood); }
.callout-tip, .callout-success, .callout-example { border-left-color: var(--moss); }
.callout-quote, .callout-info, .callout-note { border-left-color: var(--arcane); }
.backlinks { margin-top: 24px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; }
.backlinks h3 { width: 100%; margin: 0 0 4px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

.inbox { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.inbox-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.inbox-head h2 { margin: 0; font-family: var(--serif); font-size: 19px; }
.inbox-actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.inbox-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.inbox-list li { display: grid; grid-template-columns: 110px minmax(0, 1fr) 34px; gap: 10px; align-items: start; padding: 6px 0; border-top: 1px solid var(--line); }
.inbox-list li.synced { opacity: .55; }
.inbox-list time { font-size: 12px; color: var(--muted); padding-top: 3px; }
.inbox-list .md p { margin: 0; }

/* ---------- Música ---------- */
.scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; }
.scene-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.scene-card.on { border-color: rgba(var(--ember-rgb), .6); }
.scene-head { display: flex; gap: 6px; }
.scene-name { font-family: var(--serif); font-size: 18px !important; font-weight: 600; background: none !important; border-color: transparent !important; }
.scene-btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.scene-btns label.btn { flex-direction: row; font-size: 13px; color: var(--text); }
.tracks { list-style: none; padding: 0; margin: 0; max-height: 220px; overflow-y: auto; }
.tracks li { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px solid var(--line); font-size: 14px; }
.tracks li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tracks li small { color: var(--faint); font-size: 11px; }
.tracks li.playing span { color: var(--ember-2); }

/* ---------- Ajustes ---------- */
.set { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.set h2 { margin: 0 0 4px; font-family: var(--serif); font-size: 19px; }
.set p { margin: 0; }
.set .row { display: flex; gap: 8px; flex-wrap: wrap; }
.set label.btn { flex-direction: row; color: var(--text); font-size: 15px; }

/* ---------- Modal ---------- */
#modal, #palette {
  position: fixed; inset: 0; z-index: 50; background: rgba(20, 45, 70, .30); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center; padding: 8vh 14px 14px;
}
.modal-card {
  width: min(520px, 100%); max-height: 84vh; display: flex; flex-direction: column;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 30px 80px rgba(var(--shadow-rgb), .22);
}
.modal-card.wide { width: min(760px, 100%); }
.modal-card header { display: flex; align-items: center; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--line); }
.modal-card h2 { flex: 1; margin: 0; font-family: var(--serif); font-size: 20px; font-weight: 600; }
.modal-body { padding: 14px 18px; overflow-y: auto; }
.modal-body p:first-child { margin-top: 0; }
.modal-card footer { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.party-init { display: flex; flex-direction: column; gap: 6px; }
.pi-row { display: grid; grid-template-columns: minmax(0, 1fr) 84px auto; gap: 8px; align-items: center; }
.pi-row label.check { margin: 0; }
.pi-row input[type=number] { text-align: center; font-size: 18px; }
.cond-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.cond-btn { border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; padding: 10px; cursor: pointer; min-height: 44px; text-align: left; }
.cond-btn.on { background: rgba(var(--teal-rgb), .18); border-color: var(--arcane); color: var(--teal-ink); font-weight: 600; }
.qn-wrap { position: relative; }
.qn-wrap textarea { min-height: 120px; font-size: 16px; }
.suggest { position: absolute; left: 8px; right: 8px; top: 100%; margin-top: 4px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 9px; z-index: 5; max-height: 240px; overflow-y: auto; box-shadow: 0 12px 30px rgba(var(--shadow-rgb), .16); }
.suggest button { display: flex; width: 100%; justify-content: space-between; background: none; border: 0; padding: 8px 12px; cursor: pointer; text-align: left; }
.suggest button:hover, .suggest button:first-child { background: var(--ember-bg); }
.suggest small { color: var(--faint); }

.dice-pad { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.die { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; font-family: var(--serif); font-weight: 600; font-size: 17px; min-height: 48px; }
.die:hover { border-color: var(--ember); color: var(--ember-2); }
.dice-mode { display: flex; gap: 4px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
.seg { border: 1px solid var(--line-2); background: var(--panel); padding: 6px 12px; cursor: pointer; border-radius: 7px; min-height: 36px; }
.seg.on { background: var(--ember); color: var(--on-accent); border-color: var(--ember); font-weight: 600; }
.dice-expr { display: flex; gap: 8px; }
.dice-hist { list-style: none; padding: 0; margin: 14px 0 0; }
.dice-hist li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 0 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.dice-hist b { grid-row: span 2; font-family: var(--serif); font-size: 26px; text-align: center; align-self: center; }
.dice-hist small { color: var(--faint); font-size: 12px; }
.crit { color: var(--gold); }
.fumble { color: var(--blood); }

/* ---------- Paleta ---------- */
.pal-card { width: min(640px, 100%); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 30px 80px rgba(var(--shadow-rgb), .22); overflow: hidden; display: flex; flex-direction: column; max-height: 76vh; }
.pal-input { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.pal-input input { border: 0 !important; background: none !important; font-size: 18px !important; outline: none !important; padding: 6px 0 !important; }
.pal-list { overflow-y: auto; padding: 6px; }
.pal-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 8px 10px 4px; }
.pal-item { display: flex; flex-direction: column; width: 100%; text-align: left; background: none; border: 0; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.pal-item span { font-family: var(--serif); font-size: 16px; font-weight: 600; }
.pal-item small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item.sel, .pal-item:hover { background: var(--ember-bg); }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(560px, calc(100% - 24px)); }
.toast { pointer-events: auto; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 14px; box-shadow: 0 12px 30px rgba(var(--shadow-rgb), .16); opacity: 0; transform: translateY(10px); transition: .2s; max-width: 100%; cursor: pointer; }
.toast.in { opacity: 1; transform: none; }
.toast.ok { border-color: rgba(var(--moss-rgb), .5); }
.toast.warn { border-color: rgba(var(--ember-rgb), .6); }
.toast.bad { border-color: rgba(var(--blood-rgb), .6); }
.toast.roll { padding: 8px 16px; }
.roll-toast { display: flex; align-items: center; gap: 14px; }
.roll-toast > b { font-family: var(--serif); font-size: 34px; line-height: 1; color: var(--ember-2); min-width: 1.5em; text-align: center; }
.roll-toast.crit > b { color: var(--gold); text-shadow: 0 0 14px rgba(176, 125, 10, .6); }
.roll-toast.fumble > b { color: var(--blood); }
.roll-toast span { display: flex; flex-direction: column; }
.roll-toast small { color: var(--muted); font-size: 12px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1280px) {
  .tool span, .tool kbd { display: none; }
  .tool { padding: 7px 10px; }
}
@media (max-width: 1099px) {
  .strip { flex-wrap: wrap; }
  .music-mini { max-width: 100%; width: 100%; }
}
@media (max-width: 900px) {
  .tab span { display: none; }
  .tab { padding: 9px 11px; }
  .cb { grid-template-columns: 56px minmax(0, 1fr) 40px; grid-template-areas: "init who act" "hp hp hp"; }
  .cb-init { grid-area: init; } .cb-who { grid-area: who; } .cb-hp { grid-area: hp; } .cb-act { grid-area: act; }
  .cb-hp:empty { display: none; }
  .hpctl { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .hpinfo { flex: 1 1 180px; }
  .page { padding: 14px 14px 60px; }
  .mon-stat:nth-of-type(3) { display: none; }
}
@media (max-width: 620px) {
  .brand span { display: none; }
  .pc-big, .sb-top { grid-template-columns: repeat(2, 1fr) !important; }
  .sb-abil { grid-template-columns: repeat(3, 1fr); }
  .dice-pad { grid-template-columns: repeat(4, 1fr); }
  .combat-bar { gap: 10px; }
  .round { padding-right: 10px; }
  .inbox-list li { grid-template-columns: minmax(0, 1fr) 34px; }
  .inbox-list time { grid-column: 1 / -1; }
  .mon-stat { width: 44px; }
}
@media (pointer: coarse) {
  .hpinput input { height: 40px; width: 76px; }
  .btn.sm { min-height: 40px; }
  .chip { min-height: 32px; padding: 4px 12px; }
}

/* ---------- Ajustes del tema claro ---------- */
.pc-chip, .cb, .combat-bar, .pc-edit, .scene-card, .set, .inbox, .mon-list, .sb-top div, .sb-abil div, .pc-big div, .hpctl.big { box-shadow: 0 1px 2px rgba(var(--shadow-rgb), .06); }
.cb-init input { background: var(--panel-2); color: var(--ember-2); }
.cb.kind-pc { border-left-color: var(--ember); }
.cb.kind-npc { border-left-color: var(--arcane); }
.tag.pc { color: var(--ember); }
.meta-ac, .pas.ac b { color: var(--ember); }
.pas.best b { color: var(--moss); }
.round b { color: var(--ember); }
.hpbar { background: var(--track); border-color: var(--line); }
.hpbar.bloodied span { background: var(--warn-bar); }
.bl { color: var(--warn-ink); }
.mon-row:nth-child(even) { background: var(--row-alt); }
.sb-h { color: var(--ember-2); border-bottom-color: var(--moss); }
.sb-line b { color: var(--ember-2); }
.md h2 { color: var(--ember-2); }
.tool.accent { background: var(--moss); border-color: var(--moss); color: var(--on-accent); }
.tool.accent:hover { background: var(--moss-hover); }
.icon-btn.play.on { background: var(--moss-bg); border-color: var(--moss); color: var(--moss); }
.scene-pill.on { background: var(--moss); border-color: var(--moss); }
.toast { background: var(--toast-bg); }
.toast.roll { border-color: var(--line-2); }
.roll-toast > b { color: var(--ember); }
.tab.on { background: var(--ember-bg); color: var(--ember-2); }
.callout { background: var(--panel-2); }
.chip.cond-concentration { color: var(--gold-ink); }

/* ---------- Selector de tema ---------- */
.theme-seg { display: inline-flex; gap: 4px; flex-wrap: wrap; }
:root[data-theme="dark"] .md mark { color: var(--text); }

/* ---------- v1.3: recursos, duraciones y daño en área ---------- */
.res-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.chip.res { background: var(--ember-bg); border-color: rgba(var(--ember-rgb), .35); color: var(--ember-2); }
:root[data-theme="dark"] .chip.res { border-color: rgba(var(--ember-rgb), .45); }
.chip.res.spent { opacity: .5; text-decoration: line-through; }
.chip.rech.ok { background: var(--moss-bg); border-color: rgba(var(--moss-rgb), .45); color: var(--moss-ink); }
.chip.rech.no { background: var(--blood-bg); border-color: rgba(var(--blood-rgb), .4); color: var(--blood-ink); }
.chip small { font-size: 10.5px; opacity: .85; }
.res-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.res-panel h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.res-ctr { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-top: 1px solid var(--line); }
.res-ctr:first-of-type { border-top: 0; }
.res-ctr > span { flex: 1; font-size: 14px; }
.res-ctr small { display: block; font-size: 11px; }
.res-ctr b { min-width: 38px; text-align: center; font-variant-numeric: tabular-nums; }
.res-ctr .icon-btn { border-color: var(--line-2); font-size: 18px; font-weight: 700; }
.reminders { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.rem { font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.rem.warn { background: rgba(224, 165, 38, .14); border-color: rgba(224, 165, 38, .5); color: var(--warn-ink); }
.rem.ok { background: var(--moss-bg); border-color: rgba(var(--moss-rgb), .4); color: var(--moss-ink); }
.rem.leg { background: var(--ember-bg); border-color: rgba(var(--ember-rgb), .35); color: var(--ember-2); }
.dur-h { font-family: var(--serif); font-size: 17px; margin: 16px 0 6px; }
.dur-list { display: flex; flex-direction: column; gap: 8px; }
.dur-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 6px 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.dur-name { font-weight: 600; }
.dur-ctl, .dur-save { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dur-save { grid-column: 2; }
.dur-ctl select, .dur-save select { width: auto; min-width: 0; flex: 0 1 auto; }
.dur-n { width: 74px !important; text-align: center; }
.dur-save label.check { margin: 0; }
.dur-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.save-roll { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); }
.save-roll > b { font-family: var(--serif); font-size: 34px; line-height: 1; }
.save-roll.pass > b { color: var(--moss); }
.save-roll.fail > b { color: var(--blood); }
.aoe-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.aoe-fields .inline { display: flex; gap: 6px; align-items: center; }
.aoe-fields .inline select { width: auto; flex: 1; }
.aoe-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 14px 0 8px; }
.aoe-list { display: flex; flex-direction: column; gap: 4px; max-height: 42vh; overflow-y: auto; }
.aoe-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 120px 110px; gap: 8px; align-items: center; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.aoe-row.on { border-color: var(--ember); background: var(--ember-bg); }
.aoe-row.down { opacity: .55; }
.aoe-row label.check { margin: 4px 0; }
.aoe-hp { font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; }
.tag.mod-imm { color: var(--muted); }
.tag.mod-res { color: var(--teal-ink); border-color: rgba(var(--teal-rgb), .4); }
.tag.mod-vuln { color: var(--blood-ink); border-color: rgba(var(--blood-rgb), .4); }
.aoe-sum { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.aoe-sum > b { font-family: var(--serif); font-size: 16px; margin-bottom: 2px; }
.warn-line { color: var(--warn-ink); margin-top: 4px; }
@media (max-width: 620px) {
  .dur-row { grid-template-columns: 1fr; }
  .dur-save { grid-column: 1; }
  .aoe-fields { grid-template-columns: 1fr; }
  .aoe-row { grid-template-columns: minmax(0, 1fr) 60px; }
  .aoe-row > .tag, .aoe-row > span:empty { display: none; }
}
.turn-info .reminders span { text-transform: none; letter-spacing: 0; font-size: 12px; }
.aoe-row > .tag { justify-self: start; }

/* ---------- v1.4: encuentros ---------- */
.enc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-top: 12px; }
.enc-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 2px rgba(var(--shadow-rgb), .06); }
.enc-head { display: flex; align-items: center; gap: 8px; }
.enc-head h3 { flex: 1; margin: 0; font-family: var(--serif); font-size: 19px; }
.enc-sum { margin: 0; }
.enc-notes { font-size: 13px; color: var(--muted); max-height: 64px; overflow: hidden; }
.enc-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: auto; padding-top: 6px; }
.diff-badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; border: 1px solid transparent; }
.d-none, .d-trivial { background: var(--panel-2); color: var(--muted); border-color: var(--line); }
.d-low { background: var(--moss-bg); color: var(--moss-ink); border-color: rgba(var(--moss-rgb), .4); }
.d-mod { background: var(--ember-bg); color: var(--ember-2); border-color: rgba(var(--ember-rgb), .4); }
.d-high { background: rgba(224, 165, 38, .16); color: var(--warn-ink); border-color: rgba(224, 165, 38, .5); }
.d-over { background: var(--blood-bg); color: var(--blood-ink); border-color: rgba(var(--blood-rgb), .45); }
.enc-title { flex: 1; min-width: 200px; font-family: var(--serif); font-size: 24px !important; font-weight: 600; background: none !important; border-color: transparent !important; border-bottom: 1px dashed var(--line-2) !important; border-radius: 0 !important; }
.enc-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; }
.sec-h { font-family: var(--serif); font-size: 18px; margin: 14px 0 8px; }
.enc-search { position: relative; margin-bottom: 10px; }
.enc-results { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-top: 4px; overflow: hidden; }
.enc-results:empty { display: none; }
.enc-res { display: flex; justify-content: space-between; gap: 10px; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 9px 12px; cursor: pointer; text-align: left; }
.enc-res:last-child { border-bottom: 0; }
.enc-res:hover { background: var(--ember-bg); }
.enc-res span { font-family: var(--serif); font-weight: 600; }
.enc-res small { color: var(--muted); }
.enc-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.enc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 64px; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.enc-name { background: none; border: 0; padding: 0; text-align: left; font-family: var(--serif); font-size: 17px; font-weight: 600; cursor: pointer; }
button.enc-name:hover { color: var(--ember-2); }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper b { min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.stepper .icon-btn { border-color: var(--line-2); font-size: 17px; font-weight: 700; }
.enc-xp { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.diff { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.diff-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.diff-top b { font-family: var(--serif); font-size: 22px; }
.diff-bar { position: relative; height: 12px; border-radius: 99px; background: var(--track); border: 1px solid var(--line); }
.diff-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; border: 0; padding: 0; }
.diff-bar .fill.d-low { background: var(--moss); } .diff-bar .fill.d-mod { background: var(--ember); } .diff-bar .fill.d-high { background: var(--warn-bar); } .diff-bar .fill.d-over { background: var(--blood); } .diff-bar .fill.d-trivial { background: var(--faint); }
.diff-bar i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); opacity: .35; }
.diff-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; gap: 8px; }
.party-guess { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.party-guess input { width: 64px !important; text-align: center; }
.linkish { background: none; border: 0; color: var(--ember-2); text-decoration: underline; cursor: pointer; padding: 0; font-size: inherit; }
.pick-list { display: flex; flex-direction: column; gap: 6px; }
.pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.pick:hover { border-color: var(--ember); background: var(--ember-bg); }
.pick span:first-child { display: flex; flex-direction: column; min-width: 0; }
.pick small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag.hid { color: var(--warn-ink); border-color: rgba(224, 165, 38, .5); }
@media (max-width: 900px) { .enc-cols { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .enc-row { grid-template-columns: minmax(0, 1fr) auto; } .enc-row > .muted, .enc-row > .enc-xp { display: none; } }
@media (max-width: 1440px) {
  .tool:not(.accent) span, .tool kbd { display: none; }
  .tool:not(.accent) { padding: 7px 10px; }
}

/* ---------- v1.5: integración con Obsidian ---------- */
.note-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.note-actions .btn { text-decoration: none; color: var(--text); }
.note-actions .btn.primary { color: var(--on-accent); }
.btn.on { background: var(--ember-bg); border-color: var(--ember); color: var(--ember-2); }
.tag.mythr { color: var(--moss-ink); background: var(--moss-bg); border-color: rgba(var(--moss-rgb), .4); font-family: var(--sans); font-weight: 600; letter-spacing: .04em; vertical-align: middle; }
.ctx { margin-top: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 8px 12px; }
.ctx summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 6px; color: var(--ember-2); }
.ctx .md { margin-top: 8px; }
.vault-img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: block; margin: 8px 0; }
.ll-list { display: flex; flex-direction: column; gap: 6px; }
.ll-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.ll-row input { width: 72px !important; text-align: center; }
.ll-row small { margin-left: 6px; }
.hub-h { font-family: var(--serif); font-size: 16px; margin: 14px 0 6px; }
.hub-h:first-child { margin-top: 0; }
.modal-body .pick { width: 100%; margin-bottom: 6px; }
.pick.ghosty { background: none; border-style: dashed; }
.pick small { display: block; }
.hub-log { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hub-log code { font-size: 12px; }
.vault-folders { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.vault-folders label.check { margin: 2px 0; }
.vault-note { margin-top: 6px; }

/* ---------- v1.5.3: tira del grupo con muchos PJs ---------- */
.party-strip { flex-wrap: wrap; overflow-x: visible; row-gap: 6px; }
.party-strip.many .pc-chip { gap: 6px; padding: 4px 9px; min-height: 36px; }
.party-strip.many .pc-name { font-size: 14px; max-width: 10ch; }
.party-strip.many .pas b { font-size: 14px; }
.party-strip.many .pas i { font-size: 9px; }
.strip { align-items: flex-start; }
.music-mini { align-self: center; }

/* ---------- v1.6: grupos de enemigos ---------- */
.tag.mob { color: var(--blood-ink); border-color: rgba(var(--blood-rgb), .4); background: var(--blood-bg); }
.mobctl { display: flex; flex-direction: column; gap: 6px; }
.mobctl.big { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 14px; }
.mob-head { font-size: 14px; color: var(--muted); }
.mob-head b { font-size: 18px; color: var(--text); }
.mob-members { display: flex; flex-wrap: wrap; gap: 4px; }
.mob-m { min-width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--moss-bg); color: var(--text); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; line-height: 1.1; padding: 2px 4px; }
.mob-m small { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mob-m.bloodied { background: rgba(224, 165, 38, .18); }
.mob-m.down { background: var(--blood-bg); opacity: .5; text-decoration: line-through; }
.mob-m.sel { outline: 2px solid var(--ember); outline-offset: 1px; background: var(--ember-bg); }
.mobctl .hpinput { flex-wrap: wrap; }
.ll-inputs { display: flex; gap: 6px; align-items: center; }
.ll-inputs select { width: auto !important; }
.enc-grp { width: auto !important; min-height: 32px !important; font-size: 13px !important; padding: 4px 6px !important; }
.enc-row { grid-template-columns: minmax(0, 1fr) auto auto 64px auto; }

.cb.kind-mob { border-left-color: var(--blood); }

/* ---------- v1.7: mapas ---------- */
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; }
.map-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.map-card.shown { border-color: var(--moss); box-shadow: 0 0 0 2px var(--moss-bg); }
.map-thumb { display: block; border: 0; padding: 0; background: #f4f0e6; cursor: pointer; aspect-ratio: 3 / 2; overflow: hidden; }
.map-thumb svg { width: 100%; height: 100%; display: block; }
.map-card-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.map-card-body b { font-family: var(--serif); font-size: 17px; }
.shown-tag { color: var(--moss-ink); font-weight: 600; }
body.map-mode #view { overflow: hidden; }
.map-editor { display: flex; flex-direction: column; height: 100%; padding: 10px 14px 0; gap: 8px; }
.map-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.map-title { font-family: var(--serif); font-size: 20px !important; font-weight: 600; width: 260px !important; background: none !important; border-color: transparent !important; border-bottom: 1px dashed var(--line-2) !important; border-radius: 0 !important; }
.map-size { flex-direction: row; align-items: center; gap: 4px; }
.map-size input { width: 64px !important; min-height: 32px !important; padding: 4px 6px !important; }
.map-top .icon-btn { border: 1px solid var(--line); font-size: 18px; font-weight: 700; color: var(--text); }
.map-tools { display: flex; gap: 4px; flex-wrap: wrap; }
.map-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 10px; padding-bottom: 10px; }
.map-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: repeating-conic-gradient(var(--panel-2) 0% 25%, var(--bg) 0% 50%) 0 0 / 24px 24px; padding: 12px; }
.map-canvas { touch-action: none; user-select: none; }
.map-canvas svg { width: 100%; height: 100%; display: block; box-shadow: 0 4px 16px rgba(var(--shadow-rgb), .2); }
.map-canvas[data-tool="select"], .map-editor:has(.seg.on[data-k="select"]) .map-canvas { cursor: grab; }
.map-editor:has(.seg.on[data-k="terrain"]) .map-canvas, .map-editor:has(.seg.on[data-k="rect"]) .map-canvas, .map-editor:has(.seg.on[data-k="wall"]) .map-canvas { cursor: crosshair; }
.map-side { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; overflow-y: auto; }
.map-side-h { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.swatches { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.swatch { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); cursor: pointer; font-size: 12.5px; text-align: left; min-height: 36px; }
.swatch span { width: 18px; height: 18px; border-radius: 4px; border: 1px solid rgba(0,0,0,.25); flex: none; }
.swatch.on { border-color: var(--ember); background: var(--ember-bg); font-weight: 600; }
.tok-list { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.tok-pick { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); cursor: pointer; text-align: left; font-size: 13.5px; }
.tok-pick i { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.tok-pick:hover { border-color: var(--ember); }
.tok-free { display: flex; flex-direction: column; gap: 4px; }
.pending { background: var(--ember-bg); border: 1px solid var(--ember); border-radius: 8px; padding: 6px 8px; font-size: 13px; }
@media (max-width: 900px) { .map-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; } .map-side { max-height: 200px; } }

/* ---------- v1.8: biblioteca de mapas y mapas de encuentros ---------- */
.page-head label.btn { flex-direction: row; color: var(--text); font-size: 15px; }
.map-card-title { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.enc-link { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; color: var(--muted); }
.enc-link .ic { width: 14px; height: 14px; }
.map-cat { width: auto !important; min-height: 32px !important; padding: 4px 8px !important; font-size: 13px !important; }
.tag.enc-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--ember-2); background: var(--ember-bg); border-color: rgba(var(--ember-rgb), .35); font-size: 12px; letter-spacing: 0; padding: 3px 8px; }
.tag.enc-tag .ic { width: 13px; height: 13px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tpl { display: flex; flex-direction: column; gap: 3px; align-items: stretch; text-align: left; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; }
.tpl:hover { border-color: var(--ember); background: var(--ember-bg); }
.tpl-img, .tpl-blank { display: block; aspect-ratio: 3 / 2; border-radius: 6px; overflow: hidden; background: #f4f0e6; }
.tpl-img svg { width: 100%; height: 100%; display: block; }
.tpl-blank { display: flex; align-items: center; justify-content: center; border: 2px dashed var(--line-2); background: var(--panel-2); color: var(--muted); }
.tpl-blank .ic { width: 32px; height: 32px; }
.tpl b { font-family: var(--serif); font-size: 15px; margin-top: 4px; }
.tpl small { color: var(--muted); font-size: 12px; }
.enc-map { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.enc-map .map-thumb { border-radius: 8px; border: 1px solid var(--line); }
.enc-map-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.enc-map-info b { font-family: var(--serif); font-size: 16px; }
.enc-map-info label.check { margin: 2px 0; }
.enc-map .row, .enc-map-empty .row { display: flex; gap: 6px; flex-wrap: wrap; }
.enc-map-empty { background: var(--panel); border: 1px dashed var(--line-2); border-radius: 12px; padding: 10px 12px; }
.enc-map-empty p { margin-top: 0; }
.enc-card-map { margin: -12px -14px 4px; border-radius: 12px 12px 0 0; aspect-ratio: 3 / 1.2 !important; border-bottom: 1px solid var(--line); }
.ok-line { color: var(--moss-ink); }
.tok-pick small { margin-left: auto; }
@media (max-width: 620px) { .enc-map { grid-template-columns: 1fr; } }

/* ---------- v2.3: Mostrar a jugadores ---------- */
.badge.dot.live { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.sc-live { display: grid; grid-template-columns: minmax(220px, 380px) 1fr; gap: 20px; padding: 14px; border-radius: 18px; background: var(--panel); border: 1px solid rgba(var(--gold-rgb, 176, 132, 42), .6); box-shadow: 0 0 0 4px rgba(var(--gold-rgb, 176, 132, 42), .08), 0 10px 30px rgba(var(--shadow-rgb, 0, 0, 0), .08); margin-bottom: 8px; }
.sc-live.idle { grid-template-columns: auto 1fr auto; align-items: center; border: 1px dashed var(--line-2); box-shadow: none; padding: 14px 18px; }
.sc-live.idle p { margin: 2px 0 0; }
.sc-idle-ic { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--panel-2); color: var(--faint); }
.sc-live-img { aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(var(--panel-2) 0 25%, transparent 0 50%) 0 0 / 18px 18px; }
.sc-live-img img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.sc-live-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; justify-content: center; }
.sc-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-ink); }
.sc-eyebrow .ic { width: 15px; height: 15px; }
.sc-live-name { font-family: var(--serif); font-size: 24px; font-weight: 400; line-height: 1.15; overflow-wrap: anywhere; }
.sc-cap { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); max-width: 520px; }
.sc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sc-lbl { font-size: 13px; color: var(--muted); min-width: 64px; }
.sc-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.sc-corners { display: flex; gap: 6px; }
.sc-corners .seg { width: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.sc-corners .ic { width: 18px; height: 18px; }
.sc-actions { margin-top: 2px; }
.sc-actions kbd { margin-left: 4px; }
.sc-sec { margin-top: 24px; }
.sc-sec-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.sc-sec-head h2 { margin: 0 auto 0 0; font-family: var(--serif); font-weight: 400; font-size: 21px; }
.sc-session { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px; background: var(--panel); }
.sc-session span { padding: 0 6px; font-size: 14px; }
.sc-guide { display: inline-flex; align-items: center; gap: 8px; }
.sc-guide select { max-width: 260px; }
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.sc-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; transition: border-color .2s, box-shadow .2s; }
.sc-card.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(var(--gold-rgb, 176, 132, 42), .2); }
.sc-thumb { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; cursor: pointer; overflow: hidden; background: repeating-conic-gradient(var(--panel-2) 0 25%, transparent 0 50%) 0 0 / 16px 16px; color: inherit; font: inherit; }
.sc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.sc-thumb:hover img { transform: scale(1.04); }
.sc-thumb.missing::before, .sc-live-img.missing::before { content: 'Archivo no disponible'; color: var(--faint); font-size: 13px; }
.sc-thumb.missing img, .sc-live-img.missing img { display: none; }
.sc-state { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--toast-bg, var(--panel)); color: var(--text); border: 1px solid var(--line); opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; }
.sc-state .ic { width: 14px; height: 14px; }
.sc-thumb:hover .sc-state, .sc-thumb:focus-visible .sc-state, .sc-card.on .sc-state { opacity: 1; transform: none; }
.sc-card.on .sc-state { background: var(--gold); color: #fff; border-color: var(--gold); }
@media (hover: none) { .sc-state { opacity: 1; transform: none; } }
.sc-card-foot { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; min-height: 40px; font-size: 13px; }
.sc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-from { font-style: normal; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; flex: none; }
.sc-drop { border: 1.5px dashed var(--line-2); border-radius: 16px; padding: 12px; transition: border-color .2s, background .2s; }
.sc-drop.over { border-color: var(--ember); background: var(--ember-bg); }
.sc-drop-hint { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0 2px; text-align: center; }
.sc-drop .sc-grid + .sc-drop-hint { margin-top: 12px; }
.sc-drop-hint .ic { width: 16px; height: 16px; }
.sc-search { margin-top: 14px; }
.sc-search input { flex: 1; max-width: 520px; }
.vimg { position: relative; display: inline-block; max-width: 100%; }
.vimg-show { position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity .2s; }
.vimg:hover .vimg-show, .vimg-show:focus-visible { opacity: 1; }
@media (hover: none) { .vimg-show { opacity: 1; } }
@media (max-width: 760px) { .sc-live { grid-template-columns: 1fr; } .sc-live.idle { grid-template-columns: auto 1fr; } .sc-live.idle > .btn { grid-column: 1 / -1; } }
/* v2.4: la barra superior se compacta según el espacio real (lo decide fitTop() en app.js) */
.top.fit1 .tool:not(.accent) span, .top.fit1 .tool kbd { display: none; }
.top.fit1 .tool { padding: 7px 10px; }
.top.fit2 .tab .ic { display: none; }
.top.fit2 .tab { padding: 9px 10px; }
.top.fit3 .tab .ic { display: inline-block; }
.top.fit3 .tab:not(.on) span { display: none; }
.top.fit3 .tab { padding: 9px 11px; }
.top.fit4 .brand > span, .top.fit4 .tab.on span, .top.fit4 .tool.accent span { display: none; }
.top.fit4 .tools { gap: 4px; }
.badge.dot { right: 3px; top: 5px; }
.sc-sec-head label.btn { flex-direction: row; color: var(--on-accent); }
@media (max-width: 900px) { .top .brand > span { display: none; } }

/* ---------- v2.5: ficha de combate en cada fila ---------- */
.cb-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.ac-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 7px; border-radius: 999px; background: var(--ember-bg); border: 1px solid rgba(var(--ember-rgb), .45); color: var(--ember-2); line-height: 1; }
.ac-badge .ic { width: 17px; height: 17px; }
.ac-badge b { font-family: var(--sans); font-size: 21px; font-weight: 700; }
.cb-kit { grid-column: 2 / -1; display: flex; flex-direction: column; gap: 6px; padding-top: 6px; border-top: 1px dashed var(--line); min-width: 0; }
.kit-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.kabs { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.kab { display: inline-flex; flex-direction: column; align-items: center; min-width: 40px; padding: 2px 4px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; line-height: 1.1; color: var(--text); font: inherit; }
.kab i { font-style: normal; font-size: 9.5px; letter-spacing: .08em; color: var(--muted); }
.kab b { font-family: var(--sans); font-size: 14px; font-weight: 600; }
.kab.prof { border-color: rgba(var(--ember-rgb), .5); }
.kab.prof b { color: var(--ember-2); }
.kab.none { cursor: default; opacity: .5; }
.kab:not(.none):hover { border-color: var(--ember); }
.kspd { font-size: 12.5px; color: var(--muted); }
.kdef { font-size: 12.5px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.kdef b { font-weight: 600; }
.kdef.res { background: rgba(var(--teal-rgb), .10); border-color: rgba(var(--teal-rgb), .4); }
.kdef.res b { color: var(--teal-ink); }
.kdef.vuln { background: var(--blood-bg); border-color: rgba(var(--blood-rgb), .4); }
.kdef.vuln b { color: var(--blood-ink); }
.kdef.imm, .kdef.cimm { background: var(--panel-2); border-color: var(--line-2); }
.kdef.imm b, .kdef.cimm b { color: var(--text); }
.kit-acts { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.ab-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); font: inherit; font-size: 13px; color: var(--text); cursor: pointer; max-width: 100%; }
.ab-chip > i, .ab-main > i { font-style: normal; color: var(--faint); font-size: 12px; }
.ab-chip small, .ab-main small { color: var(--muted); font-size: 11.5px; }
.ab-chip b, .ab-main b { font-family: var(--sans); font-weight: 700; }
.ab-chip:hover, .ab-main:hover { border-color: var(--ember); }
.ab-chip.atk { padding: 0; gap: 0; overflow: hidden; border-color: rgba(var(--blood-rgb), .45); background: var(--blood-bg); }
.ab-main { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; font: inherit; font-size: 13px; color: var(--text); padding: 3px 6px 3px 10px; cursor: pointer; min-height: 30px; }
.ab-main > i { color: var(--blood); }
.ab-main b { color: var(--blood-ink); }
.ab-more { border: 0; border-left: 1px solid rgba(var(--blood-rgb), .3); background: none; color: var(--muted); padding: 0 8px; min-height: 30px; cursor: pointer; font: inherit; }
.ab-more:hover { color: var(--text); background: rgba(var(--blood-rgb), .08); }
.ab-chip.save, .ab-chip.fx { border-color: rgba(var(--ember-rgb), .45); background: var(--ember-bg); }
.ab-chip.save > i, .ab-chip.fx > i { color: var(--ember); }
.ab-chip.spell { border-color: rgba(var(--teal-rgb), .45); background: rgba(var(--teal-rgb), .08); }
.ab-chip.spell > i { color: var(--arcane); }
.ab-chip.trait { border-style: dashed; background: none; color: var(--muted); }
.ab-chip.ready { box-shadow: 0 0 0 2px rgba(var(--moss-rgb), .25); }
.ab-chip.spent, .ab-chip.atk.spent { opacity: .55; }
.ab-chip .rb { font-style: normal; font-family: var(--sans); font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 99px; background: var(--moss-bg); color: var(--moss-ink); }
.ab-chip.spent .rb { background: var(--panel-2); color: var(--muted); }
.kit-links { display: inline-flex; gap: 5px; margin-left: auto; }
.chip.ghosty { background: none; border-style: dashed; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.chip.ghosty .ic { width: 13px; height: 13px; }
.chip.ghosty:hover { color: var(--text); border-style: solid; }
.kit-note { position: relative; font-size: 13.5px; background: rgba(var(--gold-rgb, 176, 132, 42), .08); border: 1px solid rgba(var(--gold-rgb, 176, 132, 42), .35); border-radius: 10px; padding: 6px 34px 6px 10px; }
.kit-note .md { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kit-note.full .md { display: block; -webkit-line-clamp: unset; }
.kit-note .md > :first-child { margin-top: 0; } .kit-note .md > :last-child { margin-bottom: 0; }
.kit-note .md ul, .kit-note .md ol { padding-left: 18px; margin: 2px 0; }
.kit-note-edit { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.kit-note-edit .ic { width: 14px; height: 14px; }
.kit-note-edit:hover { color: var(--text); background: var(--panel-2); }
.drawer-qn { margin-bottom: 12px; }
.ab-pop { position: fixed; z-index: 60; background: var(--toast-bg, var(--panel)); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 16px 40px rgba(var(--shadow-rgb), .25); padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; max-height: min(70vh, 520px); overflow: auto; }
.ab-pop header { display: flex; align-items: center; gap: 8px; }
.ab-pop header b { font-family: var(--serif); font-size: 18px; font-weight: 400; }
.ab-pop header .muted { margin-right: auto; }
.ab-pop .tags { display: flex; gap: 5px; flex-wrap: wrap; }
.ab-pop .tags:empty { display: none; }
.ab-pop .tag.ok { color: var(--moss-ink); border-color: rgba(var(--moss-rgb), .45); }
.ab-pop .tag.no { color: var(--blood-ink); }
.ab-text { margin: 0; font-size: 14px; line-height: 1.5; }
.ab-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.ab-btns:empty { display: none; }
.atk-toast { flex-direction: column; align-items: stretch; gap: 6px; }
.atk-toast .atk-name { font-weight: 600; }
.atk-toast .atk-name i { font-weight: 400; color: var(--muted); }
.atk-row { display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: center; gap: 4px 10px; }
.atk-row > b { font-family: var(--sans); font-size: 28px; line-height: 1; min-width: 1.4em; text-align: center; color: var(--ember-2); }
.atk-row > b.dm { color: var(--blood); }
.atk-row > b.c { color: var(--gold); }
.atk-row > b.f { color: var(--faint); }
.atk-row span { display: flex; flex-direction: column; font-size: 13px; }
.atk-row em { font-style: normal; color: var(--gold); font-weight: 700; }
@media (max-width: 900px) { .cb-kit { grid-column: 1 / -1; } .kit-links { margin-left: 0; } }
.ab-main .ic { width: 14px; height: 14px; color: var(--blood); }
.toast:has(.atk-toast) { border-radius: 16px !important; min-width: 300px; padding: 10px 16px; }
.atk-row { grid-template-columns: 2.2em minmax(70px, auto) 2.2em minmax(70px, auto); }
.atk-row span { line-height: 1.25; }

/* ---------- Recorrido de bienvenida (v2.6) ---------- */
#tour { position: fixed; inset: 0; z-index: 70; }
.tour-shade { position: absolute; inset: 0; background: rgba(14, 30, 48, .55); }
.tour-spot {
  position: fixed; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 3px var(--ember), 0 0 0 9999px rgba(14, 30, 48, .55);
  transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease;
}
.tour-card {
  position: fixed; width: min(400px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto;
  background: var(--bg-2); backdrop-filter: blur(22px) saturate(1.1); -webkit-backdrop-filter: blur(22px) saturate(1.1);
  color: var(--text); border: 1px solid var(--line-2); border-radius: 20px;
  box-shadow: 0 20px 50px rgba(var(--shadow-rgb), .35); padding: 14px 18px 12px;
  transition: left .25s ease, top .25s ease;
}
.tour-card.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(480px, calc(100vw - 24px)); }
.tour-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; }
.tour-card h2 { font-family: var(--serif); font-size: 21px; margin: 4px 0 8px; }
.tour-body { font-size: 15px; line-height: 1.5; }
.tour-body p { margin: 0 0 8px; }
.tour-body ul { margin: 0 0 8px; padding-left: 20px; }
.tour-body li { margin-bottom: 4px; }
.tour-dots { display: flex; gap: 6px; justify-content: center; margin: 10px 0 8px; flex-wrap: wrap; }
.tour-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); cursor: pointer; }
.tour-dots i.on { background: var(--ember); transform: scale(1.25); }
.tour-card footer { display: flex; align-items: center; gap: 8px; }
.tour-card footer .spacer { flex: 1; }
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-card { transition: none; } }
