@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,700;1,9..40,400&family=DM+Mono:wght@500&family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap');
/*
  card.css — D&D Reference Card Design System
  Shared by the builder preview and any future hosted version.
  All sizes match the retired Tiktik demo card (see CHANGELOG, B26) (×1.15 scaled typography).
*/


/* ── CSS variables — set by the renderer on .card ───────── */
.card {
  --accent:  #0f766e;
  --hdr-bg:  #1e293b;
  --str: #9b1c1c;  --dex: #3a7d44;  --con: #a07830;
  --int: #1d4ed8;  --wis: #6d28d9;  --cha: #be4b8a;
  --adv: #16a34a;  --dis: #dc2626;
  --dmg-acid:#65a30d; --dmg-bludgeoning:#78716c; --dmg-cold:#0ea5e9; --dmg-fire:#ea580c;
  --dmg-force:#7c3aed; --dmg-lightning:#ca8a04; --dmg-necrotic:#4b5563; --dmg-piercing:#57534e;
  --dmg-poison:#16a34a; --dmg-psychic:#c026d3; --dmg-radiant:#d97706; --dmg-slashing:#6b7280;
  --dmg-thunder:#4f46e5; --cond:#9f1239;
  --border: #e2e8f0;
  --text:   #0f172a;
  --sub:    #334155;
  --muted:  #64748b;
}

/* W-E (WT-48, Sam picked write-in): on screen Hit Dice keep clickable bubbles; PRINT swaps
   them for a pencil-friendly "used ___ / N" line. */
.card .hd-writein { display: none; font-size: 10px; color: #64748b; align-items: baseline; gap: 4px; }
.card .hd-writein .wline { display: inline-block; width: 34px; border-bottom: 1.2px solid #94a3b8; height: 10px; }
@media print {
  .card .hb-track .hd-bubbles { display: none !important; }
  .card .hd-writein { display: flex !important; }
}
/* W-E (WT-42): 3-4 column flow — sections stay whole. display:block is REQUIRED: .col is a
   flex column and column-count is silently ignored on flex containers (the one-big-row bug). */
.card .col.col-flow { display: block; }
.card .col-flow > * { break-inside: avoid; -webkit-column-break-inside: avoid; display: inline-block; width: 100%; }
/* WT-44: drag feel — sections grab from the whole block; entries show they're armed.
   (DES-49 2026-07-26: the duplicate "AFFORDANCE ANIMATIONS" pass was merged in here — ONE
   definition per rule, the values that were live kept: rest=default, hover=grab.) */
.card .sec-drag { cursor: default; }
.card .sec-drag:hover { cursor: grab; }
.card .sec-drag:active { cursor: grabbing; }
/* SCALING_SPEC: canonical Core/Spells sections aren't reorderable — no grab cursor, no drag grip.
   (:hover included — before DES-49 the duplicate pass's later :hover rule beat this and showed a
   grab cursor on canonical sections, a lie fixed in-pass.) */
.card .col-canonical > .sec-drag, .card .col-canonical > .sec-drag:hover { cursor: default; }
.card .col-canonical > .sec-drag > .drag-grip { display: none; }
.card .drag-armed { outline: 2px dashed rgba(124,58,237,0.55); outline-offset: 1px; cursor: grabbing; }
/* W-E (WT-45): upcast marker — teal arrow on spells with a higher-slot rider */
/* TECH-1: how a spell scales with a higher slot - one short string, printed. Quiet by design:
   it sits after the name and before the C/R/arrow markers, and it is absent (not blank) whenever
   the rule could not be read from the SRD text. */
.card .sp-sc { font-size: 5.6pt; font-family: 'DM Mono', monospace; color: #6d6580;
  white-space: nowrap; margin-left: 3px; flex-shrink: 0; }
.card.compact .sp-sc { display: none; }

.card .sp-mark.sp-up { color: var(--accent); font-weight: 700; }

/* Sam 2026-07-25 (approved mockup): spell quick-reference entry treatment — solid
   action-economy pill on the title row (teal Action · amber Reaction · purple Bonus
   Action), C marker, then a row of neutral outline chips for range/components/duration. */
.card .sr-act { display: inline-block; color: #fff; font-weight: 700; font-size: 8px;
  letter-spacing: 0.03em; border-radius: 3px; padding: 0.5px 5px; margin-left: 5px;
  vertical-align: 1px; }
.card .sr-action { background: #0f766e; }
.card .sr-reaction { background: #b45309; }
.card .sr-bonus-action { background: #6d28d9; }
/* Sam 2026-07-25: ONE concentration marker everywhere — the circled C (matches the Spells
   column and panel); the old square variant is retired. */
.card .sr-conc { display: inline-flex; align-items: center; justify-content: center;
  width: 11px; height: 11px; border-radius: 50%; font-size: 7px; font-weight: 700;
  color: #6d28d9; border: 1px solid #6d28d9; margin-left: 4px; vertical-align: 1px; }
.card .sr-chips { display: flex; flex-wrap: wrap; gap: 3px; margin: 1px 0 2px; }
.card .sr-chip { border: 1px solid #cbd5e1; color: #475569; font-size: 7.5px; font-weight: 600;
  border-radius: 999px; padding: 0.5px 6px; line-height: 1.5; }
.card.compact .sr-chips { gap: 2px; } .card.compact .sr-chip { font-size: 7px; }

/* Sam 2026-07-25 (approved mockup): damage-cantrip attack cards — weapon anatomy plus a
   damage-type colored left edge + faint wash. No color-mix (html2canvas hazard). */
.card .wb-cantrip { padding-left: 7px; background: rgba(15,23,42,0.02); border-radius: 4px;
  border-left: 3px solid var(--accent); }   /* real border (NOT ::before) — html2canvas exports it */
.card .wb-cantrip.dmgedge-acid { border-left-color: var(--dmg-acid); }
.card .wb-cantrip.dmgedge-bludgeoning { border-left-color: var(--dmg-bludgeoning); }
.card .wb-cantrip.dmgedge-cold { border-left-color: var(--dmg-cold); }
.card .wb-cantrip.dmgedge-fire { border-left-color: var(--dmg-fire); }
.card .wb-cantrip.dmgedge-force { border-left-color: var(--dmg-force); }
.card .wb-cantrip.dmgedge-lightning { border-left-color: var(--dmg-lightning); }
.card .wb-cantrip.dmgedge-necrotic { border-left-color: var(--dmg-necrotic); }
.card .wb-cantrip.dmgedge-piercing { border-left-color: var(--dmg-piercing); }
.card .wb-cantrip.dmgedge-poison { border-left-color: var(--dmg-poison); }
.card .wb-cantrip.dmgedge-psychic { border-left-color: var(--dmg-psychic); }
.card .wb-cantrip.dmgedge-radiant { border-left-color: var(--dmg-radiant); }
.card .wb-cantrip.dmgedge-slashing { border-left-color: var(--dmg-slashing); }
.card .wb-cantrip.dmgedge-thunder { border-left-color: var(--dmg-thunder); }

/* W-D: weapon subtitle (WT-26) + custom-tracker hover steppers (WT-23, screen only) */
.card .w-sub { font-size: 9px; font-style: italic; color: #64748b; margin: -1px 0 1px; }
.card .col-badge { position: relative; }
.card .cb-step { position: absolute; top: 50%; transform: translateY(-50%); width: 16px; height: 16px;
  border-radius: 4px; border: 1px solid #cbd5e1; background: #f8fafc; color: #334155; font-size: 11px;
  line-height: 1; padding: 0; cursor: pointer; opacity: 0; transition: opacity .12s; z-index: 2; }
.card .col-badge:hover .cb-step { opacity: 1; }
.card .cb-step:hover { border-color: #7c3aed; color: #7c3aed; }
.card .cb-dn { left: 2px; } .card .cb-up { right: 2px; }
@media print { .card .cb-step { display: none !important; } }

/* ── CARD SHELL ─────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid #94a3b8;
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 3px 20px rgba(0,0,0,0.18);
  font-family: 'DM Sans', system-ui, sans-serif;
}

/* SCALING_SPEC (Option 1 editor): in the editor the .card IS the artboard — authored at REF_W,
   at least a full A4 page tall, growing with content (min-height set inline by the renderer). It
   keeps the base flex column layout; print_size never reshapes it. The physical page + letterbox
   + cut marks live only in the print/PDF OUTPUT path, never in the editor. (.card-fit is retained
   for any output-only wrapper.) */
.card.page { display: flex; }
.card .card-fit { display: flex; flex-direction: column; transform-origin: top left; overflow: visible; }

/* ── HEADER ─────────────────────────────────────────────── */
/* WT-55 (Sam-approved A+C V2 mix, 2026-07-21): the dark bar is GONE. Two tiers on paper —
   an ink identity row (serif name + accent level pill + small-caps subtitle) over a
   full-width light stat strip. The accent top edge ties the header to the section rules. */
.card .hdr {
  background: #fff;
  border-top: 5px solid var(--accent);
  padding: 11px 21px 9px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.card .hdr-id { display: flex; flex-direction: column; justify-content: center; }
.card .hdr-name-row { display: flex; align-items: center; gap: 11px; }
.card .hdr-name { font-family: 'Fraunces', Georgia, serif; font-size: 29px; font-weight: 700; color: var(--text); letter-spacing: 0.3px; line-height: 1.05; }
.card .hdr-lvl { border: 1.5px solid var(--accent); color: var(--accent); font-family: 'DM Mono', monospace;
  font-size: 11px; font-weight: 500; border-radius: 99px; padding: 2px 9px; line-height: 1.3; white-space: nowrap; flex-shrink: 0; }
.card .hdr-sub { font-size: 11px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; color: #64748b; margin-top: 4px; }

/* DES-20: active-state toggles. Screen-only chip bar top-right of the name row + inline deltas. */
.card .hdr-ae { display: none; margin-left: auto; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.card .hdr-ae.has { display: flex; }
.card .hdr-ae .ae-lbl { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: #94a3b8; margin-right: 1px; }
.card .ae-chip { font-size: 11px; font-weight: 600; line-height: 1; padding: 4px 10px; border-radius: 999px;
  border: 1.5px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer; font-family: inherit; }
.card .ae-chip.on { background: var(--accent); color: #fff; }
.card .hdr-ae-note { font-size: 10.5px; font-weight: 600; letter-spacing: 0.2px; text-transform: none; color: var(--accent); margin-top: 5px; }
.card .ae-slot { color: var(--accent); font-weight: 700; }
.card .hdr-badge.ae-boosted .bv { color: var(--accent); }
@media print { .card .hdr-ae, .card .hdr-ae-note { display: none !important; } }
/* Stat strip: one continuous ruled row of cells — ink values, hairline dividers; the
   coloured base edge on ability cells uses border-bottom (box-shadow drops in print). */
.card .hdr-stats { background: #f8fafc; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  display: flex; align-items: stretch; flex-shrink: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.card .hdr-badge {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4px 8px 5px;
  border-left: 1px solid var(--border);
  border-bottom: 2px solid transparent;
}
.card .hdr-badge:first-child { border-left: none; }
.card .hdr-badge .bv { font-size: 19px; font-weight: 700; color: var(--text); font-family: 'DM Mono', monospace; line-height: 1;
  white-space: nowrap; max-width: 100%; overflow: hidden; }
.card .hdr-badge .bl { font-size: 8px; color: #64748b; text-transform: uppercase; letter-spacing: 0.4px; margin-top: 2px; white-space: nowrap; }
/* DES-12: shrink long composed values (HP "42 / 52 (10)", 3-digit AC) so they stay inside the
   chip instead of wrapping past the border. render.js bvFit() tags by string length. */
.card .hdr-badge .bv.bv-s   { font-size: 16px; }
.card .hdr-badge .bv.bv-xs  { font-size: 13px; letter-spacing: -0.2px; }
.card .hdr-badge .bv.bv-xxs { font-size: 11px; letter-spacing: -0.4px; }

/* ── BODY GRID ──────────────────────────────────────────── */
.card .body {
  display: grid;
  /* grid-template-columns set inline by renderer */
  flex: 1;
  overflow: hidden;
}

.card .vdiv { background: var(--border); }
.card .vdiv[data-vdiv] { cursor: col-resize; position: relative; z-index: 2; }
.card .vdiv[data-vdiv]::after { content: ''; position: absolute; top: 0; bottom: 0; left: -3px; right: -3px; }
.card .vdiv[data-vdiv]:hover { background: var(--accent); }
.card.resizing, .card.resizing * { cursor: col-resize !important; user-select: none; }
.card .col { padding: 11px 15px; overflow: hidden; display: flex; flex-direction: column; }
/* B30: drop-target highlight when dragging an Add-Element result over a column (screen only). */
.card .col.add-drop-over { outline: 2px dashed rgba(124,58,237,0.55); outline-offset: -3px; }
@media print { .card .col.add-drop-over { outline: none !important; } }

/* ── SECTION HEADER (.sh) ───────────────────────────────── */
.card .sh {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--accent);
  border-bottom: 1px solid rgba(15,118,110,0.22);
  padding-bottom: 3.5px; margin-bottom: 7px;
  display: flex; align-items: center; gap: 5px;
  flex-shrink: 0;
}
.card .sh.n { color: #475569; border-bottom-color: var(--border); }

/* Tracker bubbles */
.card .bbl {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--accent); background: transparent; flex-shrink: 0;
}
.card .bbl.sr { border-color: #0284c7; }
.card .bbl.lr { border-color: var(--accent); }

/* A1d/C6: Training block (proficiencies) — quiet reference-tier rows */
/* Sam 2026-07-25: SMART DENSITY steps for the canonical columns — applied by app.js
   _densityFit() only when the chosen page size overflows, one step at a time. */
.card .col-canonical.dense-1 .sk-row, .card .col-canonical.dense-1 .sns-row,
.card .col-canonical.dense-1 .pr-row, .card .col-canonical.dense-1 .sp-row,
.card .col-canonical.dense-1 .slot-row { padding-top: 1.5px; padding-bottom: 1.5px; }
.card .col-canonical.dense-2 .sk-row, .card .col-canonical.dense-2 .sns-row,
.card .col-canonical.dense-2 .pr-row, .card .col-canonical.dense-2 .sp-row,
.card .col-canonical.dense-2 .slot-row { padding-top: 0.5px; padding-bottom: 0.5px; }
.card .col-canonical.dense-2 { font-size: 95%; }
.card .col-canonical.dense-3 .sk-row, .card .col-canonical.dense-3 .sns-row,
.card .col-canonical.dense-3 .pr-row, .card .col-canonical.dense-3 .sp-row,
.card .col-canonical.dense-3 .slot-row { padding-top: 0; padding-bottom: 0; }
.card .col-canonical.dense-3 { font-size: 90%; line-height: 1.25; }

/* Sam 2026-07-25: Proficiencies rows mirror the Senses rows (core-column treatment) */
.card .pr-row { display: flex; gap: 6px; padding: 2.5px 6px; align-items: baseline;
  justify-content: space-between; }
.card .pr-lbl { font-size: 10.5px; font-weight: 600; color: var(--sub); flex-shrink: 0; line-height: 1.15; }
.card .pr-val { font-size: 10px; color: var(--text); text-align: right; line-height: 1.3; min-width: 0; }

.card .gap { margin-bottom: 9px; }
.card .rule { border: none; border-top: 1px solid var(--border); margin: 8px 0; flex-shrink: 0; }

/* ── ABILITY SCORES ─────────────────────────────────────── */
.card .ab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5px; }
.card .ab-row {
  display: flex; flex-direction: row; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 3.5px;
  border: 1px solid var(--border); background: #f8fafc;
}
.card .ab-left { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.card .ab-row .al { font-size: 9.5px; font-weight: 700; letter-spacing: 0.3px; }

.card .ab-row.str { border-color: var(--str); background: #fef2f2; }
.card .ab-row.str .al, .card .ab-row.str .av { color: var(--str); }
.card .ab-row.dex { border-color: var(--dex); background: #f0fdf4; }
.card .ab-row.dex .al, .card .ab-row.dex .av { color: var(--dex); }
.card .ab-row.con { border-color: var(--con); background: #fffbeb; }
.card .ab-row.con .al, .card .ab-row.con .av { color: var(--con); }
.card .ab-row.int { border-color: var(--int); background: #eff6ff; }
.card .ab-row.int .al, .card .ab-row.int .av { color: var(--int); }
.card .ab-row.wis { border-color: var(--wis); background: #f5f3ff; }
.card .ab-row.wis .al, .card .ab-row.wis .av { color: var(--wis); }
.card .ab-row.cha { border-color: var(--cha); background: #fdf2f8; }
.card .ab-row.cha .al, .card .ab-row.cha .av { color: var(--cha); }

/* ── SAVING THROWS ──────────────────────────────────────── */
.card .sv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 3.5px; }
.card .sv-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2.5px 6px; border-radius: 3px;
}
/* DES-11 #6: proficient saves get a leading dot (like skills), not a green fill. */
.card .sv-row .sv-left { display: flex; align-items: center; gap: 4px; min-width: 0; }
.card .sv-row .sv-lead { font-size: 8px; line-height: 1; flex-shrink: 0; display: inline-block; width: 9px; text-align: center; }
.card .sv-row .sv-lead.sv-prof { color: #0f172a; }
.card .sv-row .sv-lead.sv-none { color: #cbd5e1; }
.card .sv-row.p .svl { font-weight: 800; }
.card .sv-row .svl { font-size: 11px; font-weight: 700; letter-spacing: 0.3px; }
.card .sv-row .svv { font-family: 'DM Mono', monospace; font-size: 14px; font-weight: 500; }

/* C1: defense indicators under the saves grid (Resist / Immune / Adv / notes). */
.card .sv-defs { margin-top: 3px; padding-top: 3px; border-top: 1px solid #e2e8f0; display: flex; flex-direction: column; gap: 1.5px; }
.card .df-row { display: flex; align-items: baseline; gap: 4px; font-size: 8.5px; line-height: 1.3; color: #475569; }
.card .df-k { flex-shrink: 0; font-size: 7px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.5px 3px; border-radius: 2px; }
.card .df-resist .df-k { color: #9a3412; background: #ffedd5; }
.card .df-immune .df-k { color: #166534; background: #dcfce7; }
.card .df-adv .df-k { color: #1e40af; background: #dbeafe; }
.card .df-items { display: inline; }
.card .df-i { font-weight: 600; color: #334155; }
.card .df-sep { margin: 0 2.5px; color: #94a3b8; }
.card .df-note { color: #64748b; }
.card .df-note .df-i { font-weight: 500; font-style: italic; color: #64748b; }

/* ── SKILLS ─────────────────────────────────────────────── */
.card .sk-list { display: flex; flex-direction: column; gap: 1px; }
.card .sk-row {
  display: grid; grid-template-columns: 9px 1fr 17px 25px; align-items: center; gap: 3px;
  padding: 2.5px 5px; border-radius: 3px;
}
/* W-E (WT-41): dot-column encoding — filled = proficient, star = expertise, faint ring = none */
.card .sk-lead { font-size: 8px; line-height: 1; text-align: center; }
.card .sk-lead.sk-prof { color: #0f172a; }
.card .sk-lead.sk-exp  { color: #0f172a; font-size: 9.5px; }
.card .sk-lead.sk-none { color: #cbd5e1; }
.card .sk-row.prof .sk-name { font-weight: 700; }
.card .sk-row:nth-child(odd) { background: #f8fafc; }
.card .sk-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
/* Skill names never break mid-word (word-break/​overflow-wrap normal); sized to fit the longest
   name ("Investigation") on one line at the default column width. Multi-word names wrap at spaces. */
.card .sk-name { font-size: 10.5px; font-weight: 600; color: var(--text); min-width: 0; overflow-wrap: normal; word-break: normal; hyphens: none; line-height: 1.15; }
.card .sk-tag { font-size: 8.5px; font-weight: 700; letter-spacing: 0.1px; text-align: right; }
.card .sk-val { font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 500; color: var(--text); text-align: right; }

/* ── NOTE ───────────────────────────────────────────────── */
.card .note { font-size: 11.5px; color: #059669; line-height: 1.6; }

/* ── FEATURES SPLIT COLUMN ──────────────────────────────── */
.card .feat-col { display: grid; grid-template-columns: 1fr 1px 1fr; overflow: hidden; }
.card .feat-sub { padding: 11px 14px; display: flex; flex-direction: column; overflow: hidden; }
.card .hdiv { background: var(--border); }

/* ── FEATURE BLOCKS ─────────────────────────────────────── */
.card .fb { margin-bottom: 7px; flex-shrink: 0; }
.card .fb:last-child { margin-bottom: 0; }
.card .fn {
  font-size: 14.5px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; margin-bottom: 2px; line-height: 1.2;
}
.card .ft { font-size: 11.5px; font-weight: 400; color: var(--muted); font-style: italic; position: relative; top: 1px; }
.card .tg-plain { font-style: italic; color: var(--muted); }
/* Tag pills: action economy + D&D item rarities (colour-coded), inline on the name row */
.card .tg, .card .w-mastery { display: inline-block; font-size: 8px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.3px; border-radius: 999px; padding: 1px 7px; font-style: normal; line-height: 1.5; color: #fff; vertical-align: middle; }
.card .ft-pills { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }   /* ONLY the pills right-align; plain tag text stays put */
.card .cust-dot.cust-inline { margin-left: 4px; }
.card .tg.tg-action   { background: #334155; }
.card .tg.tg-bonus    { background: #0d7a5f; }
/* Recharge pill (Sam 2026-07-25): resource resets ("1/LR", "13d6/LR", "2/SR") read as a
   right-aligned pill beside the action cost — outline style so it stays quieter than the
   action-economy pills. Not uppercase: "13d6" must keep its dice case. */
.card .tg.tg-rech     { background: #fff; color: #475569; border: 1px solid #cbd5e1;
  text-transform: none; }
.card .tg.tg-reaction { background: #a15c00; }
.card .tg.tg-free     { background: #475569; }
.card .tg.tg-common    { background: #6b7280; }
.card .tg.tg-uncommon  { background: #1a9e3f; }
.card .tg.tg-rare      { background: #2563eb; }
.card .tg.tg-veryrare  { background: #9333ea; }
.card .tg.tg-legendary { background: #d97706; }
.card .tg.tg-artifact  { background: #b45309; }
.card .fd { font-size: 12.5px; color: var(--sub); line-height: 1.35; }
.card .fd b { color: var(--text); font-weight: 700; }
.card .bsm {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--accent); background: transparent; flex-shrink: 0;
}
/* DES-19: link chip on a feature whose bubbles are the shared pool of another feature */
.card .pool-link {
  display: inline-flex; align-items: center; font-size: 8.5px; line-height: 1;
  letter-spacing: 0.3px; text-transform: uppercase; font-weight: 700;
  color: var(--accent); border: 1px solid var(--accent);
  border-radius: 8px; padding: 1px 5px; margin-left: 1px; white-space: nowrap;
  opacity: 0.75; flex-shrink: 0;
}
.card .pool-link::before { content: "\21F2"; margin-right: 2px; font-weight: 400; }

/* ── WEAPONS ────────────────────────────────────────────── */
.card .wb { margin-bottom: 5px; flex-shrink: 0; }
.card .wn { font-size: 13px; font-weight: 700; color: var(--text); }
.card .wd { font-size: 12px; color: var(--muted); line-height: 1.3; }

/* ── CHORUS ─────────────────────────────────────────────── */
.card .ch-hdr {
  font-size: 14.5px; font-weight: 700; color: var(--text);
  display: flex; align-items: baseline; gap: 7px;
  margin-bottom: 6px; flex-shrink: 0;
}
.card .ch-entries {
  padding-left: 10px;
  border-left: 2px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
  flex-shrink: 0;
}
.card .ce-name { font-size: 12.5px; font-weight: 700; color: var(--int); margin-bottom: 1px; }
.card .ce-desc { font-size: 12px; color: var(--sub); line-height: 1.3; }
.card .ce-desc b { color: var(--text); font-weight: 700; }

/* ── SPELLS ─────────────────────────────────────────────── */
.card .slot-row { display: flex; align-items: center; gap: 7px; }
.card .slot-lbl { font-size: 13px; font-weight: 700; color: var(--text); min-width: 28px; }
.card .slot-bbl {
  width: 23px; height: 23px; border-radius: 50%;
  border: 1.5px solid #94a3b8; background: transparent; flex-shrink: 0;
}
.card .sp-list { display: flex; flex-direction: column; gap: 1px; }
.card .sp-row {
  display: flex; align-items: center; gap: 5px;
  padding: 2.5px 6px; border-radius: 3px;
}
.card .sp-row:nth-child(odd) { background: #f8fafc; }
.card .sp-dot { width: 5px; height: 5px; border-radius: 50%; background: #94a3b8; flex-shrink: 0; }
.card .sp-name { font-size: 12.5px; color: var(--text); font-weight: 500; flex: 1; min-width: 0; }
/* Sam 2026-07-25: the C/R/↑ cluster right-aligns in fixed slots so markers line up
   vertically across rows; .sp-empty holds the slot open. */
.card .sp-marks { display: inline-flex; gap: 2px; margin-left: auto; flex-shrink: 0; }
.card .sp-marks .sp-mark { margin-left: 0; }
/* ⚠ named sp-mk-empty, NOT sp-empty — the Spells PANEL owns a global .sp-empty (its
   empty-state box) and the collision once blew these 12px slots up to 32px (Sam's fat
   column bug, 2026-07-25). */
.card .sp-mark.sp-mk-empty { border: none; visibility: hidden; }
/* C7: red Disadvantage pill on the Stealth row (Heavy armor). Part of the printed reference. */
.card .sk-disadv { display: inline-block; margin-left: 5px; padding: 0 3px; border-radius: 3px;
  font-size: 7.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em;
  color: #dc2626; border: 1px solid #dc2626; vertical-align: middle; line-height: 1.4; }
/* C20: Concentration (C) / Ritual (R) markers beside a spell name — part of the printed reference. */
.card .sp-mark { display: inline-flex; align-items: center; justify-content: center;
  width: 12px; height: 12px; margin-left: 4px; border-radius: 50%;
  font-size: 8px; font-weight: 700; line-height: 1; flex-shrink: 0;
  font-family: 'DM Sans', system-ui, sans-serif; }
.card .sp-conc { color: #7c3aed; border: 1px solid #7c3aed; }
.card .sp-rit  { color: #0369a1; border: 1px solid #0369a1; }
.card.compact .sp-mark { width: 10px; height: 10px; font-size: 7px; }

/* ── COLOR HELPERS ──────────────────────────────────────── */
.card .str { color: var(--str); font-weight: 700; }
.card .dex { color: var(--dex); font-weight: 700; }
.card .con { color: var(--con); font-weight: 700; }
.card .int { color: var(--int); font-weight: 700; }
.card .wis { color: var(--wis); font-weight: 700; }
.card .cha { color: var(--cha); font-weight: 700; }
/* In-body token pills — match the editor: abilities, damage types, conditions */
.card .abil, .card .dnd-dmg, .card .dnd-cond {
  display: inline-block; color: #fff; font-weight: 700; font-size: 0.8em; line-height: 1.35;
  border-radius: 4px; padding: 0 4px; vertical-align: baseline; }
.card .abil-str { background: var(--str); } .card .abil-dex { background: var(--dex); } .card .abil-con { background: var(--con); }
.card .abil-int { background: var(--int); } .card .abil-wis { background: var(--wis); } .card .abil-cha { background: var(--cha); }
.card .dnd-dmg.dmg-acid { background: var(--dmg-acid); } .card .dnd-dmg.dmg-bludgeoning { background: var(--dmg-bludgeoning); }
.card .dnd-dmg.dmg-cold { background: var(--dmg-cold); } .card .dnd-dmg.dmg-fire { background: var(--dmg-fire); }
.card .dnd-dmg.dmg-force { background: var(--dmg-force); } .card .dnd-dmg.dmg-lightning { background: var(--dmg-lightning); }
.card .dnd-dmg.dmg-necrotic { background: var(--dmg-necrotic); } .card .dnd-dmg.dmg-piercing { background: var(--dmg-piercing); }
.card .dnd-dmg.dmg-poison { background: var(--dmg-poison); } .card .dnd-dmg.dmg-psychic { background: var(--dmg-psychic); }
.card .dnd-dmg.dmg-radiant { background: var(--dmg-radiant); } .card .dnd-dmg.dmg-slashing { background: var(--dmg-slashing); }
.card .dnd-dmg.dmg-thunder { background: var(--dmg-thunder); }
.card .dnd-skill { font-weight: 700; }
.card .dnd-spell { font-style: italic; }
.card .dnd-dice { display: inline-block; font-family: 'DM Mono', monospace; font-weight: 500; font-size: 0.88em;
  background: #e2e8f0; color: #1e293b; padding: 0.5px 5px; border-radius: 5px; line-height: 1.35; letter-spacing: 0.2px; }
.card .dnd-term { font-weight: 700; }
.card .dnd-cond { background: var(--cond); }   /* conditions: pill (matches the editor) */
.card .dnd-cond[data-gloss], .card .dnd-term[data-gloss] { cursor: help; }   /* #29/B31 glossary: hover to read the rule */
.card .ed-badge { display: inline-block; font-size: 7.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  color: #92400e; background: #fef3c7; border: 1px solid #fde68a; border-radius: 3px; padding: 0 3px; margin-left: 5px;
  vertical-align: middle; }
.card .sk-pin { color: #f59e0b; font-size: 8px; margin-right: 3px; vertical-align: middle; }
/* Play trackers (#24): death saves, concentration, inspiration */
.card .pt-block { display: flex; flex-direction: column; gap: 4px; padding: 1px 0; }
.card .pt-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card .pt-lbl { font-size: 11px; font-weight: 600; color: var(--sub); }
.card .pt-ds { display: inline-flex; align-items: center; gap: 8px; }
.card .pt-ds-g, .card .pt-ds-b { display: inline-flex; gap: 3px; }
.card .trk.pt-dss.used { background: #16a34a !important; border-color: #16a34a !important; }
.card .trk.pt-dsf.used { background: #dc2626 !important; border-color: #dc2626 !important; }
.card .sp-name { font-style: italic; }
.card .adv { color: var(--adv); font-weight: 700; }
.card .dis { color: var(--dis); font-weight: 700; }

/* ── DRAG-AND-DROP ──────────────────────────────────────────
   DES-49 2026-07-26: the second "AFFORDANCE ANIMATIONS" pass that re-declared these rules
   with different values is GONE — one definition each, the values that were live kept
   (grip 13px @ .55, dragging .28 + scale, drag-over glow). Section cursors live with the
   WT-44 block near the top of this file. */
.card .sec-drag { position: relative; transition: opacity 0.15s; }
.card .drag-grip {
  position: absolute; top: 7px; right: 8px;
  font-size: 13px; color: var(--muted);
  opacity: 0; cursor: grab;
  user-select: none; z-index: 6; transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.card .sec-drag:hover > .drag-grip { opacity: 0.55; }
.card .sec-drag.dragging {
  opacity: 0.28;
  transition: opacity 0.1s;
}
.card .sec-drag.dragging > .drag-grip { opacity: 0; }
/* DES-50 §6f/5: the insertion mark is ONE accent bar — no glow, no background wash. */
.card .sec-drag.drag-over { box-shadow: inset 0 3px 0 var(--accent); }
.card .sec-drag.drag-over-bottom { box-shadow: inset 0 -3px 0 var(--accent); }

/* Editing is panel-only: clicking text selects the element (no inline editing; the retired
   inline-edit hover/focus washes were deleted by DES-49 — see index.html's card block too). */
.card .editable { cursor: pointer; }
.card .editable:empty::before { content: attr(data-placeholder); color: var(--muted); font-style: italic; opacity: 0.6; pointer-events: none; }

.card .sh[data-select-type] { cursor: pointer; }

/* ── Feature name / weapon name: edit cursor ────────────────── */
.card .fn[data-select-type], .card .wn[data-select-type] { cursor: pointer; }

/* ── Header badges (DES-50 §6f: the generic hover ring / selection ring cover badges too —
   the bespoke hover tint + bespoke .sel style are gone; three outline words, not five). ── */
.card .hdr-badge[data-select-type] { cursor: pointer; }
/* (W-E: the divider-column look is gone — plates carry their own borders.) */
.card .hdr-badge[draggable="true"] { cursor: grab; }
.card .hdr-badge.badge-dragging { opacity: 0.3; cursor: grabbing; }
.card .hdr-badge.badge-over { box-shadow: inset 3px 0 0 0 var(--accent); }
/* Very subtle "customized" dot next to an edited feature's name */
.card .cust-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); opacity: 0.45; margin-left: auto; vertical-align: middle; }
/* ── Permissions backbone batch 6: the mark on an element the rules disagree with ──
   Sam: the sheet does what you tell it, but a rule-breaking sheet must not look identical to a
   legal one weeks later. SCREEN ONLY — the printed card is the artifact and stays clean, the
   same rule the active-states bar and the edited-from-original dot follow. Quiet on purpose:
   it is a note to the owner, not an error. */
.card .rule-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 12px; height: 12px; margin-left: 5px; flex: none;
  border-radius: 50%; border: 1px solid rgba(180, 83, 9, 0.55);
  background: rgba(245, 158, 11, 0.16); color: #b45309;
  font-size: 9px; font-weight: 800; line-height: 1; cursor: help; vertical-align: middle;
}
.card .rule-broken { box-shadow: inset 2px 0 0 rgba(245, 158, 11, 0.55); }
@media print { .card .rule-mark { display: none !important; }
               .card .rule-broken { box-shadow: none !important; } }

/* DES-23: over-limit spell dot is clickable (revert) and slightly bolder on screen */
.card .sp-row .cust-dot.sp-ol { margin-left: 4px; cursor: pointer; opacity: 0.65; }
.card .sp-row .cust-dot.sp-ol:hover { opacity: 1; }
/* DES-25: the spell row's dot doubles as the drag-to-copy handle (screen only).
   DES-50 §6f/3: content never moves on hover — the dot turns accent instead of growing. */
@media screen { .card .sp-row .sp-dot { cursor: grab; }
  .card .sp-row:hover .sp-dot { background: var(--accent); }
  .card .sp-row.dragging { opacity: 0.5; } }
/* WT-55: ghost icons retired (light strip). Spell Atk / Save DC keep the CASTING-ABILITY
   colour as a soft tint + coloured base edge; type stays ink — black-on-solid INT blue or
   STR red would be unreadable, so Sam picked ink-on-tint (2026-07-21). */
.card .hdr-badge { position: relative; overflow: hidden; }
.card .hdr-badge .bg-icon { display: none; }
.card .hdr-badge.ab-str { background: color-mix(in srgb, var(--str) 13%, #fff); border-bottom-color: var(--str); }
.card .hdr-badge.ab-dex { background: color-mix(in srgb, var(--dex) 13%, #fff); border-bottom-color: var(--dex); }
.card .hdr-badge.ab-con { background: color-mix(in srgb, var(--con) 13%, #fff); border-bottom-color: var(--con); }
.card .hdr-badge.ab-int { background: color-mix(in srgb, var(--int) 13%, #fff); border-bottom-color: var(--int); }
.card .hdr-badge.ab-wis { background: color-mix(in srgb, var(--wis) 13%, #fff); border-bottom-color: var(--wis); }
.card .hdr-badge.ab-cha { background: color-mix(in srgb, var(--cha) 13%, #fff); border-bottom-color: var(--cha); }
/* Stat badges placed inside a column (auto-fit so they resize to the column width) */
.card .col-badges { display: grid; grid-template-columns: repeat(auto-fit, minmax(56px, 1fr)); gap: 6px; }
.card .col-badge { border: 1px solid var(--border); border-radius: 6px; padding: 6px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; }
.card .col-badge .cb-v { font-family: 'DM Mono', monospace; font-size: 18px; font-weight: 700; color: var(--text); line-height: 1;
  white-space: nowrap; max-width: 100%; overflow: hidden; }
/* DES-12: same length-based shrink for column stat badges. */
.card .col-badge .cb-v.bv-s   { font-size: 15px; }
.card .col-badge .cb-v.bv-xs  { font-size: 12px; letter-spacing: -0.2px; }
.card .col-badge .cb-v.bv-xxs { font-size: 11px; letter-spacing: -0.4px; }
.card .col-badge .cb-l { font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); text-align: center; }
/* Weapon: name row with a mastery chip + a stat line (to-hit, damage dice pill, range) */
.card .wn-row { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.card .w-mastery { background: var(--accent); flex-shrink: 0; }
.card .wd .w-atk { font-weight: 700; }
.card .wd .w-sep { color: var(--border); margin: 0 1px; }
/* Feature sub-column divider: draggable to resize the two centre columns */
.card .hdiv { background: var(--border); position: relative; z-index: 2; cursor: col-resize; }
.card .hdiv::after { content: ''; position: absolute; top: 0; bottom: 0; left: -3px; right: -3px; }
.card .hdiv:hover { background: var(--accent); }
/* Entry (feature/weapon) drag: insertion line + ghost; empty-column drop highlight */
.card .fb.drag-over, .card .wb.drag-over { box-shadow: inset 0 3px 0 var(--accent); }
.card .fb.drag-over-bottom, .card .wb.drag-over-bottom { box-shadow: inset 0 -3px 0 var(--accent); }
.card .fb.dragging, .card .wb.dragging { opacity: 0.35; }
.card .col.col-drop, .card .feat-sub.col-drop { outline: 2px dashed rgba(124,58,237,0.55); outline-offset: -2px; border-radius: 4px; }

/* Element-level hover: whole features / weapons / spell rows read as clickable */
.card .fb, .card .wb { border-radius: 4px; transition: background 0.12s, box-shadow 0.12s; }

.card .sec-drag .drag-grip { cursor: grab; }
.card .sec-drag .drag-grip:active { cursor: grabbing; }
/* Panel <-> card hover link (#65): same word as the hover ring — "this one" (DES-50 §6f/5) */
.card .hl-link { outline: 1.5px solid rgba(124,58,237,0.38); outline-offset: 1px; border-radius: 4px; }

/* ── Tracker bubbles (DES-50 §6f/3: no motion on hover — a fill PREVIEW inside the exact
   bubble you would spend answers "which one will I click?" better than growth did; the
   click pop below stays: motion is feedback on action). Scoped to .trk — a bubble that
   is not a tracker is print content and gets no affordance at all. ── */
.card .trk:hover:not(.used) {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}
/* Checked/used tracker bubble — filled with the sheet accent */
.card .trk { cursor: pointer; position: relative; }
/* B6 · Tap-to-spend polish: invisible halo enlarges the touch target (screen only) */
.card .trk::after { content: ""; position: absolute; inset: -4px -2px; border-radius: 50%; }
@media print { .card .trk::after { content: none; } }
/* B6: quick pop when a bubble is toggled (reduce-motion setting disables all animation) */
@keyframes trk-pop { 0% { transform: scale(0.9); } 55% { transform: scale(1.3); } 100% { transform: scale(1); } }
.card .trk.popped { animation: trk-pop 0.22s ease; }
.card .trk.used { background: var(--accent) !important; border-color: var(--accent) !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35); }
@media print { .card .trk.used { background: #000 !important; border-color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* B26: Ghost "Add ..." affordance for an empty block (e.g. Attacks with no weapon). */
/* Screen-only editing hint: hidden in print + PNG so real sheets carry no auto-content. */
.card .ghost-add {
  display: block; margin: 3px 0 2px; padding: 5px 8px;
  border: 1px dashed var(--muted, #64748b); border-radius: 6px;
  color: var(--muted, #94a3b8); font-size: 11px; line-height: 1.2;
  cursor: pointer; user-select: none; transition: border-color .12s, color .12s, background .12s;
}
.card .ghost-add::before { content: "+ "; font-weight: 700; }
.card .ghost-add:hover, .card .ghost-add:focus-visible {
  border-color: var(--accent); color: var(--accent);
  background: rgba(124, 58, 237, 0.08); outline: none;
}
@media print { .card .ghost-add { display: none !important; } }


/* ── Section select: flash animation ────────────────────────── */
@keyframes sel-flash {
  0%   { outline-color: rgba(124,58,237,0.9); background: rgba(124,58,237,0.12); }
  100% { outline-color: rgba(124,58,237,0.0); background: transparent; }
}
.card .sel-flash {
  animation: sel-flash 0.45s ease-out forwards !important;
}


/* ── Compact mode: denser card, one-line feature descriptions ─────────────── */
.card.compact .fd { display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.card.compact .feature-row, .card.compact .fb { margin-bottom: 2px; }
.card.compact .sp-row { line-height: 1.15; }
.card.compact .section, .card.compact .sh { margin-bottom: 3px; }
.card.compact .fd, .card.compact .sp-name { font-size: 9.5px; }
/* ── Ability score + modifier: modifier is the bold coloured number, score is muted/smaller ── */
.card .ab-row .asc { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 600; color: #94a3b8; }
.card .ab-row .av  { font-family: 'DM Mono', monospace; font-size: 16px; font-weight: 700; flex: 0 0 auto; text-align: right; }

/* ── Saving-throw values coloured by ability ── */
.card .sv-row .svv.str { color: var(--str); }
.card .sv-row .svv.dex { color: var(--dex); }
.card .sv-row .svv.con { color: var(--con); }
.card .sv-row .svv.int { color: var(--int); }
.card .sv-row .svv.wis { color: var(--wis); }
.card .sv-row .svv.cha { color: var(--cha); }

/* ── Skills: coloured by ability; proficient = green box, expertise = darker border ── */
.card .sk-row { border: 1px solid transparent; }
.card .sk-row.str .sk-name, .card .sk-row.str .sk-val, .card .sk-row.str .sk-tag { color: var(--str); }
.card .sk-row.dex .sk-name, .card .sk-row.dex .sk-val, .card .sk-row.dex .sk-tag { color: var(--dex); }
.card .sk-row.con .sk-name, .card .sk-row.con .sk-val, .card .sk-row.con .sk-tag { color: var(--con); }
.card .sk-row.int .sk-name, .card .sk-row.int .sk-val, .card .sk-row.int .sk-tag { color: var(--int); }
.card .sk-row.wis .sk-name, .card .sk-row.wis .sk-val, .card .sk-row.wis .sk-tag { color: var(--wis); }
.card .sk-row.cha .sk-name, .card .sk-row.cha .sk-val, .card .sk-row.cha .sk-tag { color: var(--cha); }
/* (W-E WT-41: the green proficiency fill + expertise border are retired — the lead column
   carries the encoding now; ability hues keep the text coloring only.) */
.card .sk-tag { text-transform: uppercase; }

/* ── Senses (passive perception / investigation / insight) ── */
.card .sns-list { display: flex; flex-direction: column; gap: 1px; }
/* Sam 2026-07-25: every sense fits ONE row — nowrap + gap; the value never shrinks and
   the label ellipsizes if a name ever runs long. Source tags are gone (they wrapped rows). */
.card .sns-row { display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 2.5px 6px; white-space: nowrap; }
.card .sns-l { font-size: 10.5px; font-weight: 600; color: var(--sub); line-height: 1.15;
  overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.card .sns-v { font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 500;
  color: var(--text); flex-shrink: 0; }
/* the unit ("ft") in the card's sans — DM Mono's serify letterforms read inconsistent (Sam) */
.card .sns-u { font-family: 'DM Sans', system-ui, sans-serif; font-size: 9px; font-weight: 600;
  color: var(--sub); }
/* ================================================================
   HIERARCHY PASS (2026-07) — the card reads in table order:
   1. AC/HP  2. Attacks  3. spendable trackers  4. features
   5. stats rail  6. reference text (traits/mastery/inventory)
   Sections carry weight "hi" (DO/SPEND) or "lo" (reference).
   ================================================================ */

/* Attacks: the most-used block on the card — boxed, accent-edged, bold to-hit */
.card .wb { background: #f8fafc; border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 5px; padding: 5px 8px 6px; margin-bottom: 6px; }
.card .wn { font-size: 15px; }
.card .wd .w-atk { font-size: 13.5px; font-weight: 700; color: var(--text); }

/* Spendable resources: bubbles are the second-loudest element on the card */
.card .bsm { width: 16px; height: 16px; border-width: 2px; }
/* Sam 2026-07-25: pools >8 keep every bubble, smaller, so the row never orphans */
.card .bsm.bsm-sm { width: 11px; height: 11px; border-width: 1.5px; }
.card .bbl { border-width: 2px; }

/* Header: AC & HP are the most-checked numbers at the table — let them lead (size only) */
.card .hdr-badge.has-icon .bv { font-size: 22px; }

/* hi = DO/SPEND tier: stronger section header */
.card .w-hi .sh { font-size: 11px; letter-spacing: 1.8px; border-bottom-width: 2px; }

/* lo = reference tier: muted header, smaller & quieter body text */
.card .w-lo .sh { color: #94a3b8; border-bottom-color: #eef2f7; }
.card .w-lo .fn { font-size: 12.5px; }
.card .w-lo .ft { font-size: 10.5px; }
.card .w-lo .fd { font-size: 11px; color: var(--muted); line-height: 1.3; }
.card .w-lo .fb { margin-bottom: 5px; }
/* WT-55: no chips, no ghost icons — cells stay uniform; ability labels keep a touch more
   size so "Spell Attack" doesn't shrink below its siblings. */
.card .hdr-badge.ab-str .bl, .card .hdr-badge.ab-dex .bl, .card .hdr-badge.ab-con .bl,
.card .hdr-badge.ab-int .bl, .card .hdr-badge.ab-wis .bl, .card .hdr-badge.ab-cha .bl {
  font-size: 8.5px; letter-spacing: 0.4px; white-space: nowrap; }
/* Play trackers as header badges (#24 rework): small clickable bubbles in the top bar */
.card .hdr-badge.hb-track .bv.hb-row { display: flex; align-items: center; gap: 5px; }
.card .hdr-badge .hb { width: 13px; height: 13px; border-width: 1.5px; border-color: rgba(15,23,42,.4); }
.card .hdr-badge .hb-grp { display: inline-flex; gap: 3px; align-items: center; }
.card .hdr-badge .hb-grp + .hb-grp { margin-left: 4px; }
/* DND-23: the per-die label inside the Hit Dice badge ("d10 oooo  d8 ooooo") */
.card .hdr-badge .hd-die { font-size: 8px; font-weight: 700; color: rgba(15,23,42,.55); margin-right: 2px; }
/* C19 Hit Dice badge: one bubble per level, wrapping into rows of ~10 at high level */
.card .hdr-badge .bv.hb-wrap { flex-wrap: wrap; max-width: 102px; row-gap: 3px; justify-content: center; }
/* DND-19: Beast Master Primal Companion mini-statblock (pet-subclass framework v1). Scoped under .card. */
.card .companion{font-size:11px;line-height:1.42;padding:2px 0}
.card .cmp-name{font-weight:700;font-size:12.5px}
.card .cmp-meta{color:#64748b;font-size:10px;margin-bottom:3px}
.card .cmp-line{font-size:10.5px}
.card .cmp-abils{display:flex;gap:4px;flex-wrap:wrap;margin:5px 0}
.card .cmp-ab{flex:1 1 30%;min-width:50px;text-align:center;border:1px solid rgba(0,0,0,.14);border-radius:4px;padding:2px 1px;font-size:9.5px}
.card .cmp-ab-n{display:block;font-weight:700;letter-spacing:.03em}
.card .cmp-ab-m{display:block;font-weight:700;font-size:12px}
.card .cmp-ab-sv{display:block;color:#64748b;font-size:8.5px}
.card .cmp-ab.str .cmp-ab-m{color:var(--str)} .card .cmp-ab.dex .cmp-ab-m{color:var(--dex)}
.card .cmp-ab.con .cmp-ab-m{color:var(--con)} .card .cmp-ab.int .cmp-ab-m{color:var(--int)}
.card .cmp-ab.wis .cmp-ab-m{color:var(--wis)} .card .cmp-ab.cha .cmp-ab-m{color:var(--cha)}
.card .cmp-strike,.card .cmp-trait{font-size:10.5px;margin-top:3px}

/* ── TECH-9: element detail levels (line / card / full) ─────────────────────
   Sam-approved 2026-07-25. Loudness follows how often you touch a thing: a LINE is a
   menu row you scan, a CARD is the default working shape, FULL is the verbatim text.
   Every level PRINTS exactly as set — there is no screen-only affordance here, and
   nothing is ever auto-demoted to make a page fit (see SCALING_SPEC). */
.card .el-lines { display: flex; flex-direction: column; gap: 0; margin-bottom: 6px; }
.card .el-lines.el-2up { display: block; column-count: 2; column-gap: 12px; }
.card .el-lines.el-2up > .el-line { break-inside: avoid; -webkit-column-break-inside: avoid; display: block; }
.card .el-line { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap;
  font-size: 10.5px; line-height: 1.35; padding: 1.5px 0; margin-bottom: 0; }
.card .el-line .el-n { font-weight: 700; color: var(--text); flex-shrink: 0; }
.card .el-line .el-c { color: var(--muted); min-width: 0; }
.card .el-line .bsm { width: 7px; height: 7px; }
.card .el-line .el-lp { display: inline-flex; gap: 3px; }
.card .el-line .tg { font-size: 7px; padding: 0 3px; }
.card .w-lo .el-line { font-size: 10px; }

/* FULL — a left accent edge so a long block is never mistaken for section body text. */
.card .el-full { border-left: 2.5px solid var(--accent); padding-left: 8px;
  background: color-mix(in srgb, var(--accent) 3%, transparent); border-radius: 4px; margin-bottom: 7px; }
.card .el-fs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px;
  font-size: 9.5px; color: #475569; margin: 2px 0 4px; }
.card .el-fs span b { color: var(--text); font-weight: 700; }
.card .el-fb { font-size: 10.5px; color: var(--sub); line-height: 1.42; }
.card .el-fb p { margin: 0 0 4px; }
.card .el-fb p:last-child { margin-bottom: 0; }

/* Spell shapes: a level label + a concentration ring that survives every detail level. */
.card .el-lvl { font-family: 'DM Mono', monospace; font-size: 9px; font-weight: 500; color: #5b21b6;
  background: #ede9fe; border-radius: 3px; padding: 1px 5px; flex-shrink: 0; }
.card .el-conc { display: inline-flex; align-items: center; justify-content: center;
  width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--accent);
  color: var(--accent); font-size: 8px; font-weight: 800; flex-shrink: 0; }
.card .el-spell { border-left: 2.5px solid var(--accent); padding-left: 7px;
  background: color-mix(in srgb, var(--accent) 3%, transparent); border-radius: 4px; }
.card .el-spell .wn-row { gap: 5px; }

/* ── TECH-11: attack rider line, ammo write-in ──────────────────────────────
   Riders are the numbers players forget mid-turn (Sneak Attack, Rage, Hunter's Mark), so
   they print under the stat line rather than living only in a feature paragraph. */
.card .w-riders { font-size: 9.5px; color: #64748b; line-height: 1.3; margin-top: 1px;
  font-variant-numeric: tabular-nums; }
/* the dice read as data without becoming a pill — one step down from the stat line */
.card .w-riders { font-family: 'DM Sans', system-ui, sans-serif; }
.card .w-riders .w-sep { color: #cbd5e1; }
.card .w-ammo { display: flex; align-items: baseline; gap: 4px; font-size: 9px; color: #64748b;
  text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }
.card .w-ammo .wline { display: inline-block; width: 30px; border-bottom: 1.2px solid #94a3b8; height: 9px; }

/* ── TECH-11: note emphasis + printable ruled lines ─────────────────────────── */
.card .note-q { font-size: 10.5px; color: #64748b; }
.card .note-l { font-size: 12.5px; font-weight: 700; color: var(--text); }
.card .note-lines { display: flex; flex-direction: column; gap: 9px; margin-top: 6px; }
.card .note-lines .nl { display: block; border-bottom: 1px solid #cbd5e1; height: 1px; }

/* TECH-11 (Sam-approved option B): the magical glyph. Small, ink-only, never wraps the title. */
.card .w-magic { color: var(--accent); font-size: 10px; line-height: 1; flex-shrink: 0;
  position: relative; top: -1px; }
.card .w-props { font-size: 8.5px; text-transform: uppercase; letter-spacing: .4px;
  color: #94a3b8; margin-top: 1px; }
