/* cogitator/army-view-col2.css v9 */
/* Army Viewer Column 2 — Unit Datasheet panel styles (read-only) */

/* DevAgent24 - 2026-07-16
   What: v9 — Removed the .dsv--tyranids / .dsv--astartes faction colour token
         classes and their static #ffffff --dsv-faction-color-text. The datasheet
         root now carries a NEUTRAL default (--banner charcoal); the real accent
         and its contrast-derived ink arrive as inline custom properties from
         faction-colours.js (factions.accent_color). Also repointed the two
         static #ffffff declarations that sit directly on the faction gradient
         (.dsv-unit-name, .dsv-category-badge) at --dsv-faction-color-text.
         The .dsv- twin of army-builder-col2.css v76 — keep the two in step.
   Why:  Only two factions had token classes, so the other 26 fell through to
         .dsv--astartes and rendered Space Marine navy. The fallback is now
         neutral and no faction colour is a static CSS value in this file. */

/* DevAgent22 - 2026-07-15
   What: v8 — .dsv-wt__count — the muted "(n models)" per-weapon count shown
         in the datasheet weapon tables when the "Profile" filter is active.
   Why:  Indicate how many models carry each weapon (Jérôme). */

/* DevAgent22 - 2026-07-15
   What: v7 — Equipment pills recoloured by weapon type (solid): R=green #2f7d4f,
         M=light brown #a9793f, E=light violet #a98be6 (dark text). Replaces the
         surface-fill + faction-colour-letter look. The modal's unselected/outline
         variant lives in army-view-col3.css. Ranged/melee use white text/letter;
         equipment uses dark text on its light fill.
   Why:  Global wargear-pill recolour (Jérôme). Colours avoid the faction accents. */

/* DevAgent22 - 2026-07-15
   What: v6 — .dsv-wpn-filter (the RANGED/MELEE banner "All | Profile" segmented
         toggle) + .dsv-wt__empty (the "no weapons in this profile" row). Appended
         at end of file.
   Why:  Weapon-table profile filter (ArmyViewCol2 v11). */

/* DevAgent19 - 2026-06-04
   What: v5 — .dsv-cv-* and .dsv-equip-* appended at end of file: namespace
         twins of the .ds-cv-* / .ds-equip-* classes in army-builder-col2.css
         v74 (list-convention text + model_equipment pills), values identical,
         faction var --dsv-faction-color. */

/* DevAgent10 - 2026-06-01
   What: v3 — Wargear option bullets (GW style, mirror of builder v72): filled
         square markers on top-level options, hollow circle on sub-options.
         Lists switched from flex to block so markers render. */

/* DevAgent10 - 2026-06-01
   What: v2 — Mirrors army-builder-col2.css v71 datasheet styling into the viewer
         (dsv-* namespace):
         - .dsv-stat__inv-label-cell stacks label + note, align-self:center so
           "INVULNERABLE SAVE" is centred against the inv shield.
         - .dsv-stat__inv-footnote — invulnerable_save_note footnote.
         - .dsv-ability-group* — full-width parent/child ability group block.
         - .dsv-leader-block__desc — italic CORE Leader special description.
         - .dsv-wargear-condition — wargear option scope/condition prefix.
   Why:  Gate 4 — viewer datasheet parity with the builder. */

/* DevAgent8 - 2026-05-28
   What: v1 — Independently-owned datasheet styles for the Army Viewer, ported
         from army-builder-col2.css v68 with every datasheet class namespaced
         .dsv-* (and the --dsv-faction-color var) so the viewer's datasheet
         evolves separately from the builder's .ds-*. Removed: the ADD TO ARMY
         header button, its centring spacer, and the light spinner variant.
         Column body/placeholder renamed to .av-col-2__*; the column header
         reuses the shared .ab-col__header/.ab-col__title primitives.
   Why:  Gate 4 — the viewer owns its datasheet styles. */

/* ============================================================
   PLACEHOLDER
   ============================================================ */

.av-col-2__placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
}

.av-col-2__placeholder-text {
  font-size: var(--text-base);
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
}

/* ============================================================
   DATASHEET ROOT
   ============================================================ */

.dsv-datasheet {
  background: var(--surface);
  border: none;
  border-radius: 0;
  overflow: hidden;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text);
  /* Required so the draggable popup is positioned relative to the datasheet */
  position: relative;
}

/* ============================================================
   FACTION COLOUR TOKENS
   ============================================================ */

/* NEUTRAL DEFAULT ONLY. Every faction's real colour is supplied at render time
   by faction-colours.js as inline --dsv-faction-color / --dsv-faction-color-text
   custom properties on .dsv-datasheet, sourced from factions.accent_color.
   These values apply only when a faction has no accent_color in the DB — they
   are a deliberately neutral charcoal, NOT a faction colour, and must never be
   set to one. Do not reintroduce per-faction classes here: adding or changing a
   faction colour is a DB-only change. */
.dsv-datasheet {
  --dsv-faction-color:      var(--banner);
  --dsv-faction-color-text: var(--text-inv);
}

/* ============================================================
   SECTION BANNERS — faction colour
   ============================================================ */

.dsv-banner {
  background: var(--dsv-faction-color);
  color: var(--dsv-faction-color-text);
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-tracking);
  text-transform: var(--heading-transform);
  padding: var(--space-1) var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Weapon banner: title left, column headers right aligned with table columns */
.dsv-banner--weapon {
  justify-content: space-between;
  padding-right: 0; /* cols need to align flush with table */
}

.dsv-banner__weapon-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1 1 auto; /* takes up the name column space */
}

/* Column header labels in the banner — match table column widths */
.dsv-banner__weapon-cols {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.dsv-banner__col {
  width: 45px;
  min-width: 45px;
  text-align: center;
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-tracking);
  color: var(--dsv-faction-color-text);
  padding: 0 var(--space-1);
}

.dsv-banner__col--range {
  width: 55px;
  min-width: 55px;
}

.dsv-banner__col--d {
  padding-right: 14px;
}

/* PNGs are already white — no filter needed */
.dsv-banner__icon-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  opacity: 0.9;
  flex-shrink: 0;
}

/* ============================================================
   HEADER — single full-width block, image absolutely positioned
   ============================================================ */

.dsv-header {
  position: relative;
  /* Faction gradient: solid left → transparent right. The (transparent-PNG)
     unit photo sits on the right at z-index 0, behind the stats, and is masked
     to fade leftward so wide models dissolve into the faction colour. */
  background:
    linear-gradient(
      to right,
      var(--dsv-faction-color) 0%,
      var(--dsv-faction-color) 40%,
      rgba(255, 255, 255, 0) 90%
    ),
    var(--surface);
  overflow: hidden;
}

/* Unit photo: absolute, right-anchored, full height, decorative. Widened and
   set to contain so wide transparent-PNG models show whole and extend left over
   the gradient; a left-fading mask dissolves the model into the faction colour.
   Stays at z-index 0 (behind the stats). */
.dsv-unit-photo {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 55%;
  object-fit: contain;
  object-position: right center;
  display: block;
  z-index: 0;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 55%, #000 100%);
          mask-image: linear-gradient(to right, transparent 0%, #000 55%, #000 100%);
}

.dsv-unit-photo-placeholder {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 22.5%;
  background: repeating-linear-gradient(
    45deg,
    var(--surface),
    var(--surface) 6px,
    var(--surface-lo) 6px,
    var(--surface-lo) 7px
  );
  z-index: 0;
}

/* Content sits above the image (z-index 1). The model passes behind the stats,
   so only a little right padding is reserved to keep the rightmost stat box off
   the header edge. */
.dsv-header__content {
  position: relative;
  z-index: 1;
  padding: var(--space-3) var(--space-3) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-right: 10%;
}

/* ── Row 1: Unit name ── */

.dsv-unit-name {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-tracking);
  text-transform: var(--heading-transform);
  color: var(--dsv-faction-color-text);
  margin: 0;
  line-height: 1.05;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ── Row 2: category badge + base size ── */

.dsv-header__meta-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.dsv-category-badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--heading-weight);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.35);
  color: var(--dsv-faction-color-text);
  padding: 3px var(--space-2);
  border-radius: var(--radius-sm);
}

.dsv-category-badge--format {
  background: #444444;
  border: none;
}

/* .dsv-base-size removed — base size moved to admin block */

/* ── Stat block: 6-column grid ── */

/* DevAgent5a: dsv-stat-block IS the grid. 6 equal columns = 6 stats in row 1.
   Inv square in col 3 row 2, label spanning cols 4-6 row 2. */
.dsv-stat-block {
  display: grid;
  /* 6 fixed-width stat columns + 1fr for profile name label */
  grid-template-columns: repeat(6, 46px) 1fr;
  column-gap: 8px;
  row-gap: 0;
  margin-top: 2px;
  padding-bottom: var(--space-1);
  align-items: end;
}

/* Stack of stat rows for multi-profile units */
.dsv-stat-block-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Second and subsequent rows: no stat labels (shown on row 1 only) */
.dsv-stat-block--nolabels .dsv-stat__label {
  display: none;
}

/* Profile name label — col 7, row 1, vertically centred with squares */
.dsv-stat__profile-name {
  grid-column: 7;
  grid-row: 1;
  display: flex;
  align-items: center;
  padding-bottom: 2px;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--heading-weight);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

.dsv-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 40px;
}

/* Stat labels: --text-sm (13px) */
.dsv-stat__label {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--heading-weight);
  letter-spacing: 0.06em;
  /* No text-transform — Sv and Ld must render in mixed case */
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.2;
}

/* Stat squares */
.dsv-stat__value {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--heading-weight);
  color: var(--text-hi);
  line-height: 1;
  background: #ffffff;
  border: 2px solid var(--text-hi);
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px var(--space-1);
}

/* ── Invulnerable save — CSS Grid row 2, column 3 (under Sv) ── */

/* Inv square cell: grid-column 3, grid-row 2 — always under Sv */
.dsv-stat__inv-square {
  grid-column: 3;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 6px;
}

/* Inv label cell: spans cols 4–6, row 2 — stacks the label and the optional
   restriction footnote, vertically centred against the inv shield. */
.dsv-stat__inv-label-cell {
  grid-column: 4 / 8;
  grid-row: 2;
  /* Override the stat grid's align-items:end so a single-line label is centred
     against the shield rather than bottom-aligned in the row. */
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Inv save — shield shape: square top, rounded point at bottom */
.dsv-stat__value--inv {
  background: #ffffff;
  border: 2px solid var(--amber-dim);
  color: var(--amber-dim);
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--heading-weight);
  line-height: 1;
  width: 46px;
  height: 52px;   /* taller than wide to accommodate the point */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px var(--space-1) 8px; /* extra bottom padding pushes text up from point */
  /* Shield shape: flat top, sides taper to a point at bottom-centre */
  clip-path: polygon(0% 0%, 100% 0%, 100% 65%, 50% 100%, 0% 65%);
  /* Border via outline since clip-path clips the border */
  border: none;
  outline: 2px solid var(--amber-dim);
  outline-offset: -2px;
}

/* "INVULNERABLE SAVE" label */
.dsv-stat-block__inv-label {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--heading-weight);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}

/* ── Deadly Demise — small skull badge overlapping bottom edge of W square ── */

/* W cell needs position:relative so the badge can be absolute */
.dsv-stat--w {
  position: relative;
}

/* Badge: 14px circle, centred horizontally, overlapping bottom edge of W square */
.dsv-stat__dd-badge {
  position: absolute;
  bottom: -9px;   /* half of 18px — straddles the bottom edge */
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  border: 1px solid rgba(255,255,255,0.4);
}

.dsv-stat__dd-skull {
  width: 12px;
  height: 12px;
  object-fit: contain;
  /* PNG is white on transparent — no filter needed */
  display: block;
}

/* ============================================================
   WEAPON TABLES
   ============================================================ */

.dsv-section--weapons {
  border-top: 2px solid #000000;
}

.dsv-section--weapons + .dsv-section--weapons {
  /* Thin separator between ranged and melee weapon sections */
  border-top: var(--border-width) solid var(--border);
}

.dsv-weapon-table {
  width: 100%;
  border-collapse: collapse;
  /* Bumped from --text-xs (11px) to --text-sm (13px) */
  font-size: var(--text-sm);
}

.dsv-weapon-table th {
  font-family: var(--font-heading);
  /* Bumped from --text-xs to --text-sm */
  font-size: var(--text-sm);
  font-weight: var(--heading-weight);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: var(--space-1) var(--space-2);
  text-align: center;
  border-bottom: var(--border-width) solid var(--border);
}

.dsv-weapon-table th.dsv-wt__name,
.dsv-weapon-table td.dsv-wt__name {
  text-align: left;
  /* auto — fills remaining space after stat columns take their 60px each */
}

/* Stat columns: fixed 45px each — name column gets the rest */
.dsv-weapon-table th:not(.dsv-wt__name),
.dsv-weapon-table td:not(.dsv-wt__name) {
  width: 45px;
  min-width: 45px;
  max-width: 45px;
}

/* RANGE column: slightly wider than other stat columns */
.dsv-weapon-table th.dsv-wt__range,
.dsv-weapon-table td.dsv-wt__range {
  width: 55px;
  min-width: 55px;
  max-width: 55px;
}

/* D column: extra right space — !important overrides generic td padding */
.dsv-weapon-table th.dsv-wt__d,
.dsv-weapon-table td.dsv-wt__d {
  padding-right: 14px !important;
}

.dsv-weapon-table td {
  padding: var(--space-1) var(--space-2);
  text-align: center;
  border-bottom: var(--border-width) solid var(--surface-lo);
  vertical-align: middle;
}

/* Stripe applied per weapon group by JS — not nth-child */
.dsv-wt__row--stripe {
  background: #f0f0f0;
}

.dsv-wt__row--parent td {
  background: var(--amber-light) !important;
  color: var(--text-dim);
  padding: var(--space-1) var(--space-2);
}

.dsv-wt__row--sub td {
  /* No padding-left — indent is on the name cell only */
}

.dsv-wt__name--sub {
  padding-left: var(--space-5) !important;
}

.dsv-wt__name--multi {
  font-weight: 600;
}

.dsv-weapon-tags {
  font-size: var(--text-xs);
  color: var(--text-dim);
}

.dsv-weapon-select-note {
  font-size: var(--text-xs);
  color: var(--text-dim);
  font-weight: 400;
  font-style: italic;
}

/* ============================================================
   TWO-COLUMN ROW — Abilities | Unit Composition
   ============================================================ */

.dsv-two-col-row {
  display: grid;
  grid-template-columns: 7fr 4fr;
  border-top: var(--border-width) solid var(--border);
  align-items: stretch; /* full height so divider goes all the way down */
}

.dsv-two-col-row__left {
  border-right: var(--border-width) solid var(--border);
}

/* ── Abilities ── */

.dsv-abilities__body {
  padding: var(--space-2) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.dsv-ability {
  font-size: var(--text-sm);
  line-height: 1.5;
  margin: 0;
}

.dsv-ability--shared {
  color: var(--text-dim);
}

.dsv-ability__type {
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
}

.dsv-ability--unit {
  color: var(--text);
}

.dsv-ability__name {
  font-weight: 700;
}

/* ── Unit Composition + Points ── */

.dsv-composition__body {
  padding: var(--space-2) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.dsv-composition__body p {
  font-size: var(--text-sm);
  line-height: 1.5;
  margin: 0;
}

.dsv-composition__profile + .dsv-composition__profile {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: var(--border-width) solid var(--border);
}

.dsv-composition__profile p + p {
  margin-top: 4px;
}

/* .dsv-composition__equipment dim colour removed — DevAgent5a v8 */

.dsv-comp-points {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-top: var(--space-1);
  border-top: var(--border-width) solid var(--border);
  padding-top: var(--space-2);
}

.dsv-comp-points-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

/* .dsv-comp-points-row__label dim colour removed — DevAgent5a v8 */

.dsv-comp-points-row__badge {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--heading-weight);
  background: var(--amber);
  color: var(--text-inv);
  padding: 1px var(--space-2);
  border-radius: var(--radius-sm);
  min-width: 36px;
  text-align: center;
}

/* ============================================================
   WARGEAR OPTIONS
   ============================================================ */

.dsv-section--wargear {
  border-top: var(--border-width) solid var(--border);
}

.dsv-wargear-list {
  margin: 0;
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-6);
  list-style: square;
}

.dsv-wargear-list > li {
  margin-bottom: var(--space-1);
}

.dsv-wargear-list > li:last-child {
  margin-bottom: 0;
}

.dsv-wargear-list li {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text);
}

.dsv-wargear-suboptions {
  margin: var(--space-1) 0 0 var(--space-2);
  padding-left: var(--space-4);
  list-style: circle;
}

.dsv-wargear-suboptions li {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text);
}

/* ============================================================
   KEYWORDS ROW — stays charcoal
   ============================================================ */

.dsv-keywordsv-row {
  display: grid;
  grid-template-columns: 7fr 4fr;
  border-top: 2px solid var(--banner);
  background: var(--banner);
}

.dsv-keywordsv-cell {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--banner-text);
  font-family: var(--font-body);
  /* display:block — label and value are inline text nodes that wrap together */
  display: block;
}

.dsv-keywordsv-cell--faction {
  border-left: var(--border-width) solid rgba(255, 255, 255, 0.15);
}

.dsv-keywords__label {
  display: inline;
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* ============================================================
   ABILITY LINKS — dashed underline buttons
   ============================================================ */

/* DevAgent5a - 2026-05-28
   What: Ability names rendered as inline buttons with dashed underline.
         Tapping opens AbilityPopup. No default button chrome.
   Why:  Keeps the datasheet clean while making ability descriptions accessible. */

.dsv-ability__link {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: var(--text);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 3px;
  text-decoration-color: var(--text-dim);
}

.dsv-ability__link:hover {
  color: var(--amber-dim);
  text-decoration-color: var(--amber-dim);
}

.dsv-ability__link--unit {
  font-weight: 700;
}

/* ============================================================
   ABILITY POPUP — draggable floating block
   ============================================================ */

/* DevAgent5a - 2026-05-28
   What: Popup is absolute-positioned inside .dsv-datasheet (position:relative).
         No backdrop. User drags via the header. Width 380px (100px less than
         the previous 480px modal). z-index above all content but below nothing.
   Why:  Floating reference UX — user can read popup alongside datasheet content. */

.dsv-popup {
  position: absolute;
  z-index: var(--z-above);
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 280px;
  overflow: hidden;
  /* Prevent text selection while dragging */
  user-select: none;
}

.dsv-popup__header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--dsv-faction-color);
  color: var(--dsv-faction-color-text);
  padding: var(--space-2) var(--space-3);
  cursor: grab;
}

.dsv-popup__header:active {
  cursor: grabbing;
}

.dsv-popup__title {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-tracking);
  text-transform: var(--heading-transform);
}

.dsv-popup__close {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--dsv-faction-color-text);
  font-size: var(--text-xl);
  line-height: 1;
  cursor: pointer;
  padding: 0 var(--space-1);
  opacity: 0.8;
}

.dsv-popup__close:hover {
  opacity: 1;
}

.dsv-popup__body {
  padding: var(--space-4);
  font-size: var(--text-xs);
  line-height: 1.6;
  color: var(--text);
  font-style: italic;
}

/* ============================================================
   ADMIN BLOCK — dev/reference metadata, below keywords
   ============================================================ */

.dsv-admin-block {
  padding: var(--space-2) var(--space-3);
  background: var(--surface-lo);
}

.dsv-admin-block__title {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--heading-weight);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--space-1);
}

.dsv-admin-block__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px var(--space-4);
}

.dsv-admin-block__row {
  display: flex;
  gap: var(--space-2);
  font-size: var(--text-xs);
  line-height: 1.5;
}

.dsv-admin-block__label {
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 80px;
}

.dsv-admin-block__value {
  color: var(--text);
  font-family: var(--font-body);
}

/* ============================================================
   LEADER BLOCK — leads / led by, inside Unit Composition
   ============================================================ */

.dsv-leader-block {
  /* No margin or border — sits flush as direct child of dsv-composition */
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-body);
}

.dsv-leader-block__body {
  padding: var(--space-2) var(--space-3);
  color: var(--text);
  font-family: var(--font-body);
  background: var(--surface);
}

.dsv-leader-block__intro {
  font-size: var(--text-sm);
  color: var(--text);
  margin: 0 0 var(--space-1);
}

.dsv-leader-block__list {
  margin: 0;
  padding-left: var(--space-4);
  list-style: disc;
}

.dsv-leader-block__list li {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}

/* ============================================================
   SPECIAL ABILITY BLOCKS — Hunter Organism, Damaged, Transport
   Full-width banner blocks in the right (composition) column
   ============================================================ */

.dsv-special-ability-block {
  overflow: hidden;
}

.dsv-banner--special {
  display: flex;
  align-items: center;
  gap: 4px;
  /* Inherits font-family, font-size, font-weight from .dsv-banner */
}

.dsv-banner__skull {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}

.dsv-special-ability-block__body {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text);
  /* font-family inherits from .dsv-datasheet */
}

/* ── Ability bullet list (from '* ' patterns in descriptions) ── */
.dsv-ability__bullet-list {
  margin: var(--space-1) 0 0 0;
  padding-left: calc(var(--space-4) + 15px);
  list-style: disc;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dsv-ability__bullet-list li {
  font-size: inherit;
  line-height: 1.5;
  color: inherit;
}

/* ============================================================
   SCROLLABLE BODY
   DevAgent5b - 2026-05-28 (v57)
   What: Wraps the datasheet so it scrolls under the fixed header.
         Mirrors .ab-col__list from army-builder-col1.css exactly.
   Why:  Datasheet was not scrollable — header and content scrolled together.
   ============================================================ */

.av-col-2__body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* ============================================================
   COLUMN DIVIDER BORDER
   ============================================================ */
/* The .av-col--2 right border lives in army-view.css. Here we only override the
   header bottom border to match the dark column separator (parity with the
   builder's Col2). */

.av-col--2 .ab-col__header {
  border-bottom-color: #444444;
}

/* ============================================================
   DEVAGENT10 ADDITIONS — 2026-06-01 (mirror of builder v71)
   ============================================================ */

/* ── Invulnerable save footnote (under the INVULNERABLE SAVE label, light text) ── */
.dsv-stat__inv-footnote {
  margin-top: 2px;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-style: italic;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}

/* ── Ability groups (parent/child, e.g. "Author of the Codex") ── */
/* Rendered full-width after the Abilities body; header reuses .dsv-banner. */
.dsv-ability-group {
  border-top: var(--border-width) solid var(--border);
}

.dsv-ability-group__body {
  padding: var(--space-2) var(--space-3);
}

.dsv-ability-group__intro {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text);
  margin: 0 0 var(--space-1);
}

.dsv-ability-group__entries {
  margin: 0;
  padding-left: var(--space-4);
  list-style: disc;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dsv-ability-group__entry {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text);
}

.dsv-ability-group__entry-name {
  font-weight: 700;
}

/* ── Leader block special description (e.g. Apothecary Biologis) ── */
.dsv-leader-block__desc {
  font-size: var(--text-sm);
  font-style: italic;
  line-height: 1.5;
  color: var(--text);
  margin: var(--space-1) 0 0;
}

/* ── Wargear option condition/scope prefix ── */
.dsv-wargear-condition {
  font-style: italic;
  font-weight: 600;
  color: var(--text-dim);
}

/* ============================================================
   LIST-CONVENTION TEXT (DataAgent4 §3)
   ============================================================ */

.dsv-cv-section {
  border-top: var(--border-width) solid var(--border);
}

.dsv-cv-body {
  padding: var(--space-2) var(--space-3);
}

.dsv-cv-para {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text);
  margin: 0 0 var(--space-1);
}

.dsv-cv-para:last-child {
  margin-bottom: 0;
}

.dsv-cv-list {
  margin: var(--space-1) 0;
  padding-left: var(--space-4);
  list-style: square;
}

.dsv-cv-list:last-child {
  margin-bottom: 0;
}

.dsv-cv-list li {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text);
  margin-bottom: var(--space-1);
}

.dsv-cv-list li:last-child {
  margin-bottom: 0;
}

.dsv-cv-sublist {
  margin: var(--space-1) 0 0 var(--space-2);
  padding-left: var(--space-4);
  list-style: circle;
}

/* ============================================================
   EQUIPMENT PILLS (model_equipment)
   ============================================================ */

.dsv-equip-intro {
  margin: 0;
}

.dsv-equip-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

/* Type colours (DevAgent22 v7). Solid = equipped/selected; outline variant is added
   by ArmyViewCol3 for the modal's unselected toggles. Chosen to avoid the faction
   accents (e.g. the Tyranid purple) — equipment violet kept light for contrast. */
.dsv-equip-pill--ranged    { --pill-c: #2f7d4f; } /* green */
.dsv-equip-pill--melee     { --pill-c: #a9793f; } /* light brown */
.dsv-equip-pill--equipment { --pill-c: #a98be6; } /* light violet */

.dsv-equip-pill {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  line-height: 1.4;
  padding: 1px 8px;
  border-radius: 999px;
  border: var(--border-width) solid var(--pill-c, var(--border));
  background: var(--pill-c, var(--surface));
  color: #ffffff;
  white-space: nowrap;
}

/* Effective-type letter (R / M / E). White on the solid pill. */
.dsv-equip-pill__type {
  font-weight: 700;
  color: #ffffff;
  margin-right: 5px;
}

/* Light-violet equipment fill needs dark text for legibility. */
.dsv-equip-pill--equipment,
.dsv-equip-pill--equipment .dsv-equip-pill__type {
  color: #2e1f47;
}

/* ============================================================
   WEAPON-TABLE "ALL | PROFILE" FILTER (DevAgent22 v6)
   Segmented toggle in the RANGED/MELEE banner. Reads on the faction-coloured
   bar: active segment = white fill + faction-colour text; inactive = transparent
   + white text.
   ============================================================ */

.dsv-wpn-filter {
  display: inline-flex;
  margin-left: var(--space-2);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  overflow: hidden;
  flex: none;
}

.dsv-wpn-filter__seg {
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
  padding: 1px 9px;
  border: none;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
}

.dsv-wpn-filter__seg--active {
  background: #ffffff;
  color: var(--dsv-faction-color);
}

/* "No <type> weapons in this profile" row */
.dsv-wt__empty {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-style: italic;
  color: var(--text-dim);
  text-align: center;
}

/* "(n models)" per-weapon count — Profile filter mode (DevAgent22 v8).
   Sits at the right of the weapon-name cell (left of the RANGE column). */
.dsv-wt__count {
  float: right;
  margin-left: var(--space-2);
  font-weight: 400;
  font-style: italic;
  color: var(--text-dim);
  white-space: nowrap;
}
