/* css/party-entourage.css — Party panel (hero row, resources summary), Entourage tab, Market, Arena, portraits and the first Party sub-views. Loaded after the files before it (see css/style.css). */

#party-panel h2 {
  margin-top: 0;
}

/* Hero/Classes/Equipment/etc tab row, sitting above its content (see .party-subview)
   rather than in a left-hand column beside it. Widened from 700px so the Classes
   tab's own left (name/level/growth hexagon, fixed 340px)/right (Skills, 380px)
   split (see .party-classes-split) has room to sit side by side instead of wrapping —
   every other tab's own content still caps itself narrower where it needs to (e.g.
   .skill-card's own 420px), so this is just an outer ceiling, not a target width. */
.party-detail {
  margin-top: 1rem;
}

.party-subnav {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 2px solid var(--color-border-light);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

/* Fixed rather than "flex: 1 1 0" stretching to fill the whole row — a consistent
   width regardless of label length ("Stats" vs "Exploration") or how many tabs
   happen to be showing, rather than each tab's width shifting whenever the Multiclass
   tab appears/disappears. */
.party-subnav-button {
  flex: 0 0 auto;
  width: 110px;
  padding: 0.5rem 0.5rem;
  line-height: 1.2rem;
}

/* A sub-tab's "Click to unlock" (css/overlays.css's .party-subnav-pending) in a smaller font on one line with a normal
   tab's line height, so the row never grows taller. */
.party-subnav-button.party-subnav-pending {
  font-size: 0.75rem;
  white-space: nowrap;
}

.party-subnav-active {
  font-weight: bold;
  border-color: var(--color-success-border);
  background: var(--color-success-bg);
}

/* Same greyed-out treatment as .class-select-locked — the Multiclass tab button below
   player level 40 (see party-ui.js's buildPartySubNav). */
.party-subnav-locked {
  color: var(--color-text-muted);
  border-color: var(--color-border-light);
  background: var(--color-bg-disabled);
  cursor: default;
}

/* The 1/2/3 party switcher (see dom-helpers.js's buildPartySwitcherRow) — shown atop
   the Adventure, Party, and God panels so a player can jump straight to a different
   party from wherever they already are. */
.party-switcher-row {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* One party's slot in the row: holds the selection button and, in the Party tab, the pencil /
   rename input laid over its name. */
.party-switcher-item {
  position: relative;
  width: 424px;
  /* Items stretch to the tallest one in the row (the two-line unlocked party); the flex container
     lets each button fill its item, so a one-line Locked button matches Party 1's height. */
  display: flex;
}

.party-switcher-button {
  padding: 0.4rem 0.9rem;
  font-weight: bold;
  border-width: 2px;
  /* Dimmed by default (see .party-switcher-active below fully restoring this) so the
     currently active party's button visibly pops out from the other two rather than
     all three reading as equally prominent. */
  opacity: 0.5;
  width: 100%;
}

/* An unlocked party's button: the name on the first row, location and action on the second. */
.party-switcher-two-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.party-switcher-name {
  font-size: 0.95rem;
}

.party-switcher-status {
  font-size: 0.8rem;
  font-weight: normal;
}

/* Third row: the party's Battle / Explore fatigue percentages (engine/fatigue-system.js). */
.party-switcher-fatigue {
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-size: 0.75rem;
  font-weight: normal;
}

.party-switcher-fatigue-low {
  color: var(--color-danger-border);
}

/* The pencil beside the party's name (Party tab only) — a sibling of the button, not inside it. */
.party-switcher-rename-button {
  position: absolute;
  top: 0.3rem;
  right: 0.5rem;
  padding: 0.1rem 0.3rem;
  line-height: 1;
  font-size: 0.8rem;
}

.party-switcher-rename-input {
  position: absolute;
  top: 0.3rem;
  left: 25%;
  width: 50%;
  font-size: 0.9rem;
  text-align: center;
}

/* Location colors (see dom-helpers.js's partySwitcherLocationClass) — safe/green,
   battle/red, explore/blue, same three-way scheme as the Adventure nav button's own
   safe/danger/exploring classes. Border + text colored on every button regardless of
   selection; the active one (see .party-switcher-active below) additionally gets a
   matching tinted background, full opacity, and an underline, so it's unmistakable
   which party is active independent of its location color. */
.party-switcher-safe {
  border-color: var(--color-success-border);
  color: var(--color-party-safe-text);
}

.party-switcher-battle {
  border-color: var(--color-battle-text);
  color: var(--color-battle-text);
}

.party-switcher-explore {
  border-color: var(--color-active-border);
  color: var(--color-active-border);
}

/* A War Zone's own Mission/Raid color (see dom-helpers.js's
   partySwitcherLocationClass) — same purple as .zone-box-selected-war. */
.party-switcher-war {
  border-color: var(--color-war-border);
  color: var(--color-war-border);
}

.party-switcher-active {
  opacity: 1;
  /* A clear gold ring around the selected party (border + a thin outer ring), so it never
     depends on the dimming of the other two alone. */
  border-color: var(--color-party-selected-border);
  box-shadow: 0 0 0 2px var(--color-party-selected-border);
}

.party-switcher-active.party-switcher-safe {
  background: var(--color-success-bg);
}

.party-switcher-active.party-switcher-battle {
  background: var(--color-battle-bg);
}

.party-switcher-active.party-switcher-explore {
  background: var(--color-explore-bg);
}

.party-switcher-active.party-switcher-war {
  background: var(--color-war-bg);
}

/* A not-yet-unlocked party (see dom-helpers.js's buildPartySwitcherRow/
   party-system.js's unlockParty) — dimmed grey instead of the usual safe/battle/
   explore color, since there's no location to show yet. */
.party-switcher-locked {
  border-color: var(--color-text-muted);
  color: var(--color-text-locked-party);
  opacity: 1;
}

/* Flashes the button red when a click on a locked party couldn't afford the unlock —
   same red-flash treatment as .crystal-dust-insufficient/.gear-upgrade-insufficient. */
.party-switcher-insufficient {
  border-color: var(--color-danger-border);
  background: var(--color-danger-bg);
  color: var(--color-danger-border);
}

/* Adventure panel's gathered-resources summary (see dom-helpers.js's
   buildResourcesSummary) — shown while safe or exploring. */
.resources-summary-heading {
  margin: 0.5rem 0 0.25rem;
  font-weight: bold;
}

/* A fixed 8-column grid (rather than flex-wrap, which sizes/wraps based on each
   item's own content width and the viewport's exact pixel width) so exactly 8 items
   sit per row reliably regardless of window size. Only resources the player has found are
   listed (see dom-helpers.js's buildResourcesSummary), so the grid simply grows row by row. */
.resources-summary-list {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.225rem;
  margin-bottom: 0.5rem;
  align-content: start;
}

.resources-summary-list[hidden] {
  display: none;
}

/* Clicking the Resources grid flips totals <-> rates (dom-helpers.js's toggleResourcesView), with a mouse;
   touch screens use the small button below instead, since a tap there shows an item's tooltip. */
@media (pointer: fine) {
  .resources-summary > .resources-summary-list {
    cursor: pointer;
  }
}

/* The small "↻ Show rates/min" / "↻ Show totals" button right-aligned under the grid. */
.resources-view-toggle,
.battle-view-toggle {
  display: block;
  margin: -0.25rem 0 0.5rem auto;
  padding: 1px 6px;
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  background: var(--color-bg-chip); /* the same grey as the resource cells */
  border: 1px solid var(--color-border-light);
  border-radius: 3px;
  cursor: pointer;
}

/* In the Adventure header the toggle sits in the bottom-right corner of the box's right half rather than under the
   grid (which made the fixed-height box overflow). The grid has at most 22 cells (8 per row), so the corner cell of
   its third row is always free. */
.adventure-header-right:has(> .resources-summary) {
  position: relative;
}

.adventure-header-right > .resources-summary .resources-view-toggle,
.adventure-header-right-battle > .battle-view-toggle {
  position: absolute;
  right: 0;
  bottom: 0;
  margin: 0;
}

/* A danger zone's header right half: the layer controls or the Resources grid, with the cycle button in its bottom-right corner. */
.adventure-header-right-battle {
  position: relative;
}

.resources-view-toggle[hidden] {
  display: none;
}

.resources-summary-item {
  display: flex;
  align-items: center;
  /* Emoji left, amount right (see dom-helpers.js's fillResourceSummaryItemElement's
     two child spans) rather than both sitting glued together on the left. */
  justify-content: space-between;
  gap: 0.25rem;
  /* Grid cell width (see .resources-summary-list's 8-column grid above) rather than a
     fixed rem width — every item still stays the same size as its row-mates
     regardless of its current amount's digit count, just sized by the grid instead. */
  min-width: 0;
  font-size: 0.8rem;
  padding: 2px 6px;
  border: 1px solid var(--color-border-light);
  border-radius: 3px;
  background: var(--color-bg-chip);
  box-sizing: border-box;
}

/* Plain horizontal rule separating a resources-summary block (see above) from
   whatever section follows it — currently just the Entourage tab's detail pane (see
   entourage-ui.js's buildFollowerDetail), but generic/reusable wherever else a
   resources-summary gets prepended above an existing section. */
.panel-section-divider {
  border: none;
  border-top: 1px solid var(--color-border-light);
  margin: 0.75rem 0;
}

.resources-summary-item-amount {
  /* Safety net for an amount too wide even for the item's fixed width (a very large
     stockpile) — shrinks/ellipsizes this span specifically rather than pushing the
     emoji span out of view. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.7rem;
}

/* The Entourage tab's own Entourage Level bar (see js/ui/entourage-ui.js/
   dom-helpers.js's buildEntourageLevelProgressBar) — the TRACK reuses
   .zone-level-progress-track below (identical shape), this is just the fill's own
   color, a neutral blue rather than a zone's own blue (same value today, kept as its
   own class in case they ever want to diverge). */
.entourage-progress-fill {
  height: 100%;
  background: var(--color-fill-blue);
  width: 0%;
  transition: width 0.2s linear;
}

/* Zone Battle/Exploration Level gauge (see dom-helpers.js's buildZoneLevelStatus/
   buildZoneExplorationStatus/buildZoneLevelProgressBar) — same track/fill shape as
   the Entourage progress bar above, just its own class names. */
.zone-level-progress-track {
  position: relative;
  width: 100%;
  height: 16px;
  background: var(--color-bg-disabled);
  border: 1px solid var(--color-text-muted);
  border-radius: 6px;
  overflow: hidden;
  margin: 0 0 1rem;
}

.zone-level-progress-fill {
  height: 100%;
  background: var(--color-fill-blue);
  width: 0%;
  transition: width 0.2s linear;
}

.market-trade-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.market-tier-locked-hint {
  font-size: 0.8rem;
  color: var(--color-text-quiet);
  font-style: italic;
}

.market-resource-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.market-resource-label {
  min-width: 90px;
  text-transform: capitalize;
}

.market-resource-price {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  flex: 1 1 auto;
}

.market-trade-button {
  font-size: 0.85rem;
  padding: 0.3rem 0.5rem;
}

/* The selected zone's own flavor text (data/zones.js's description), shown right
   below its name in buildZoneMenu() — same italic/muted look as a skill card's own
   .skill-flavor. */
.zone-menu-description {
  font-style: italic;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-top: -0.25rem;
}

/* Zones panel's unsafe-zone Battle/Exploration sub-tabs (see zones-ui.js's
   buildZoneMenuSubTabs) — same look as the Party panel's own sub-tabs above. */
.zone-menu-subnav {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  border-bottom: 2px solid var(--color-border-light);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.zone-menu-subnav-button {
  flex: 1 1 0;
  padding: 0.5rem 1rem;
}

.zone-menu-subnav-active {
  font-weight: bold;
  border-color: var(--color-success-border);
  background: var(--color-success-bg);
}

/* A locked sub-tab (currently just Arena before state.arenaUnlocked — see
   zones-ui.js's buildZoneMenuSubTabs) — same greyed-out treatment as a locked zone
   box (.zone-box-locked), but its label stays visible (not replaced with "???"), per
   the user's own "greyed out and cannot be clicked, but it's there" spec. */
.zone-menu-subnav-locked {
  cursor: default;
  color: var(--color-text-muted);
  border-color: var(--color-border-light);
  background: var(--color-bg-disabled);
}

/* Arena Level gauge (see dom-helpers.js's buildArenaLevelStatus) — no rule of its own
   needed: the fill element already carries .zone-level-progress-fill too (see
   dom-helpers.js's buildZoneLevelProgressBar), so it renders identically to the
   Battle/Exploration bars, same as .zone-exploration-progress-fill does. */

/* Arena challenge list (see js/ui/arena-ui.js) — same card shape as .zone-upgrade-row
   above, just its own class names. */
.arena-challenge-list {
  margin-top: 1rem;
}

/* One-time note above the list naming the (shared, across every challenge) thresholds
   the badges below are graded against — same small muted look as .zone-upgrade-description. */
.arena-challenge-hint {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin: 0 0 0.75rem;
}

/* Opaque white so an unlocked challenge row reads clearly against the page's own
   zone-art backdrop — .arena-challenge-row-locked already defines its own background
   and comes later in the cascade, so it still wins over this one. */
.arena-challenge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 2px solid var(--color-border-dark);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  background: var(--color-white);
}

/* The row itself IS the "Attempt" control (see arena-ui.js's buildArenaChallengeRow)
   — same clickable-slot-box pattern as a hero/enemy box in the Adventure panel (see
   .slot-box-clickable). A light red tint on hover signals "clicking this starts the
   fight," distinct from a hero/enemy slot's own hover (which merely selects). */
.arena-challenge-row-clickable {
  cursor: pointer;
}

.arena-challenge-row-clickable:hover {
  background: rgba(220, 50, 50, 0.08);
}

.arena-challenge-name {
  font-weight: bold;
}

/* Three read-only "button-styled squares" (see arena-ui.js's buildArenaResultBadge) —
   same border/padding weight as a real button, just never clickable, so they read as
   status chips rather than actions. */
.arena-result-badges {
  display: flex;
  gap: 0.4rem;
}

.arena-result-badge {
  box-sizing: border-box;
  /* Fixed rather than content-based so all three badges line up at the same width
     regardless of digit count ("Hits given: 8" vs "Time taken: —") — about 20% wider
     than the longest label ("Hits given: 8") would need on its own. */
  min-width: 7rem;
  border: 2px solid var(--color-border-dark);
  border-radius: 4px;
  padding: 0.35rem 0.4rem;
  font-size: 0.75rem;
  text-align: center;
  white-space: nowrap;
}

/* Best tier — a light blue, deliberately distinct from Silver's grey so the two never
   get confused at a glance despite both being fairly "cool"/neutral colors. */
.arena-result-platinum {
  border-color: var(--color-medal-platinum-border);
  background: var(--color-medal-platinum-bg);
  color: var(--color-medal-platinum-text);
}

.arena-result-gold {
  border-color: var(--color-medal-gold-border);
  background: var(--color-medal-gold-bg);
  color: var(--color-medal-gold-text);
}

.arena-result-silver {
  border-color: var(--color-text-muted);
  background: var(--color-medal-silver-bg);
  color: var(--color-text-secondary);
}

.arena-result-bronze {
  border-color: var(--color-medal-bronze-border);
  background: var(--color-medal-bronze-bg);
  color: var(--color-medal-bronze-text);
}

/* Not yet medaled (or never attempted at all) — same neutral grey as a locked box,
   just still fully readable/attemptable (the ROW itself isn't locked, only the badge). */
.arena-result-none {
  border-color: var(--color-border-light);
  background: var(--color-bg-chip);
  color: var(--color-text-muted);
}

/* The Attempts badge (see arena-ui.js's buildArenaAttemptsBadge) — informational, not
   graded, so it stays a plain neutral look regardless of the count, never coloring up
   like a medal badge would. */
.arena-result-neutral {
  border-color: var(--color-text-muted);
  background: var(--color-white);
  color: var(--color-border-dark);
}

/* Not-yet-unlocked challenge (see arena-ui.js's buildArenaChallengeRow) — same grey
   treatment as a locked zone upgrade (.zone-upgrade-row-locked). */
.arena-challenge-row-locked {
  justify-content: center;
  color: var(--color-text-muted);
  border-color: var(--color-border-light);
  background: var(--color-bg-disabled);
}

/* Arena attempt status block, shown in the Adventure panel in place of the normal
   zone level line while a challenge is in progress (see adventure-ui.js's
   buildArenaChallengeStatus) — a title line plus the same badge row/styling as the
   Zones tab's own result badges (see .arena-result-badges/.arena-result-badge above),
   just showing the CURRENT attempt's live values instead of the zone's best-ever ones. */
.arena-challenge-status-title {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

/* Party > Hero: the hero card + lifetime stats on the left, the secondary stats on the right
   (see party-ui.js's buildPartySubContent), split down the middle like the Classes tab. */
.party-hero-split {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

/* Both halves take an equal share of the row (flex-basis 0 + equal grow = 50% / 50% of the space
   left after the gap) and only wrap onto separate rows once one half would drop under 300px. */
.party-hero-left {
  flex: 1 1 0;
  min-width: 300px;
  position: relative; /* anchors the portrait picker in its top-right corner */
}

.party-hero-right {
  flex: 1 1 0;
  min-width: 300px;
  padding-left: 1.5rem;
  border-left: 2px solid var(--color-border-light);
}

/* Party > Hero: the big portrait pinned to the top-right corner of the LEFT half, with its
   ← name → picker underneath. */
.portrait-picker {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.portrait-picker-image {
  height: 162px;
  max-width: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  /* Tan halo hugging the portrait's own outline (drop-shadow follows the transparent
     shape, unlike box-shadow): a tight ring plus a wider, softer glow. */
  filter: drop-shadow(0 0 20px var(--color-portrait-halo)) drop-shadow(0 0 6px var(--color-portrait-halo));
}

.portrait-picker-arrows {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.portrait-picker-name {
  width: 6rem;
  text-align: center;
  font-size: 0.85rem;
}

/* A hero's portrait inside their box (Party row + Adventure battle): faint, bottom-anchored
   behind the name/HP, never catching clicks. Every other child is lifted above it. */
.actor-slot-box {
  position: relative;
  /* Clips the portrait at the box edges like overflow: hidden did, but leaves 14px free ABOVE the box so the hero's
     activity bubble can straddle the top border line (.activity-indicator-row below). */
  clip-path: inset(-14px 0 0 0);
}

.actor-slot-box > :not(.slot-box-portrait) {
  position: relative;
  z-index: 1;
}

.slot-box-portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  /* Nudged down so the eyes sit just below the HP bar instead of behind it (the picture is
     already top-aligned, so it can only move down; the box clips the extra at the bottom). */
  transform: translateY(16px);
  opacity: 0.3;
  image-rendering: auto;
  pointer-events: none;
  z-index: 0;
  filter: drop-shadow(0 0 20px var(--color-portrait-halo)) drop-shadow(0 0 6px var(--color-portrait-halo));
}

.party-secondary-stats h3 {
  margin-top: 0;
}

.party-secondary-stats-group {
  margin: 0.75rem 0 0.25rem;
  font-weight: bold;
  color: var(--color-text-secondary);
}

/* An enemy whose portrait rolled "facing the other way" (combat-spawn.js's portraitFlipped): mirrored left-to-right,
   keeping the same downward nudge as .slot-box-portrait. */
.slot-box-portrait.portrait-flipped {
  transform: translateY(16px) scaleX(-1);
}

.party-subview {
  width: 100%;
  box-sizing: border-box;
}

.growth-rate-heading {
  margin: 0.75rem 0 0.25rem 0;
  font-weight: bold;
}

.class-growth-list {
  font-size: 0.85rem;
}

.class-growth-line {
  padding: 1px 0;
}

/* Holds this class's 3 skill cards (see party-ui.js's buildPartySkillsView) as equal-
   height grid rows instead of a plain stack — a Locked card's short "Requires X Lv N"
   content used to make it noticeably shorter than an unlocked card's full name/
   flavor/formula stack right above or below it. Fixed total height (rather than each
   row sizing to its own tallest card) is what actually forces all 3 to match. */
.skill-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  height: 240px;
  max-width: 100%;
}

/* display:flex + align-items:center is what actually centers the Academy "Upgrade"
   button (see party-ui.js's buildSkillCard) against the card's own FULL height (name/
   flavor/formula/etc. together), not just next to the name line. height:100% fills
   its own .skill-card-grid row; overflow-y:auto is a safety net for a rare
   name+flavor+formula combination too long to fit that fixed row height, rather than
   silently clipping or spilling into the next card. */
.skill-card {
  display: flex;
  /* align-items: center; */
  gap: 0.5rem;
  border: 2px solid var(--color-border-dark);
  padding: 0.5rem;
  height: 220px;
  overflow-y: auto;
  /* Opaque white so an unselected/unlocked skill card reads clearly against the
     page's own zone-art backdrop — .skill-card-active/-locked already define their
     own background and come later in the cascade, so they still win over this one. */
  background: var(--color-white);
}

.skill-slots-heading {
  margin-block-start: 0;
  margin-top: 0;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

/* The name/flavor/formula/etc. column — takes up the remaining space so the Upgrade
   button (.skill-card's other flex child) stays pinned to the right edge. min-width:0
   lets its own text wrap/ellipsize instead of forcing the flex row wider. */
.skill-card-content {
  flex: 1 1 auto;
  min-width: 0;
  /* Column layout so the Upgrade button (its last child) can sit at the bottom of the
     card via margin-top: auto, independent of how tall the text above it is. */
  display: flex;
  flex-direction: column;
}

.skill-name {
  font-weight: bold;
  margin-bottom: 0.25rem;
}

/* Bottom-aligned block: the skill's Academy effect line(s) directly above the Upgrade button. */
.skill-card-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.skill-upgrade-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Still in the DOM while empty (so the button keeps its place), just not drawn. */
.skill-upgrade-details:empty {
  display: none;
}

.skill-upgrade-button {
  align-self: flex-start;
  flex: 0 0 auto;
  white-space: nowrap;
  height: 28px;
}

.skill-upgrade-locked {
  color: var(--color-text-muted);
  border-color: var(--color-border-light);
  background: var(--color-bg-disabled);
  cursor: default;
}

.skill-academy-level {
  font-size: 0.8rem;
  color: var(--color-success-border);
}

.skill-flavor {
  font-style: italic;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.25rem;
}

.skill-formula {
  font-size: 0.8rem;
  color: var(--color-border-dark);
  margin-bottom: 0.15rem;
}

.skill-status-effect {
  font-size: 0.8rem;
  color: var(--color-skill-status-text);
  margin-top: 0.15rem;
}

.skill-card-clickable {
  cursor: pointer;
}

.skill-card-active {
  border-color: var(--color-success-border);
  background: var(--color-success-bg);
}

.skill-card-locked {
  color: var(--color-text-muted);
  border-color: var(--color-border-light);
  background: var(--color-bg-disabled);
}

/* Six equal-width columns per row — a 7th+ class naturally spills onto a second row
   instead of squeezing every button narrower to fit. */
.class-selector {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* The Classes tab's own left (class name/level/growth hexagon)/right (Skills) split,
   sitting below .class-selector — see party-ui.js's buildPartyClassesView. Wraps on a
   narrow window rather than squeezing the hexagon down below a readable size. */
.party-classes-split {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

/* Fixed rather than flex-grow — the hexagon below it has its own fixed pixel size
   (see .class-growth-hexagon), so there's nothing on this side that benefits from
   extra width. */
.party-classes-left {
  flex: 0 0 340px;
}

.party-classes-left h3 {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

/* "LV N" and its XP bar sit inline in one row (see party-ui.js's
   buildPartyClassesLeftColumn) rather than stacked. */
.class-level-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

/* Scoped under .class-level-row (not just .class-level-text alone) so this margin
   reset actually wins — the GLOBAL Entourage Level bar (see dom-helpers.js's
   buildEntourageLevelStatus) sits directly inside .zone-list at the top of the
   Entourage tab's own left-hand list, and .zone-list p's own margin-top:0.5rem
   (higher specificity: class+element beats a single class) was overriding a bare
   .class-level-text rule here, nudging just THAT copy's "LV N" text down and out of
   vertical alignment with its own bar — the per-follower copy in the right-hand
   detail pane (not inside .zone-list) never had this problem. */
.class-level-row .class-level-text {
  margin: 0;
  white-space: nowrap;
}

/* Follower portraits (data/npc-portraits.js, ui/entourage-ui.js). */

/* The follower page's top block: name, flavour line and level bar on the left, the follower's bust on the right. */
.follower-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.follower-detail-header-text {
  flex: 1 1 auto;
  min-width: 0;
}

.follower-detail-portrait {
  flex: 0 0 auto;
  height: 162px;
  width: auto;
  max-width: 40%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 3px var(--color-portrait-halo)) drop-shadow(0 0 1px var(--color-border-dark));
}

/* A follower's list box: a faint face at the right end, behind the name. The picture is taller than the box and pulled up
   so the box shows the eyes and nose rather than just the hair. */
.zone-box-has-portrait {
  position: relative;
}

/* Clips the tall picture to the box (inset 0 = the box's own padding edge), leaving the box itself unclipped for the "!"
   bubble. */
.follower-box-portrait-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.follower-box-portrait {
  position: absolute;
  right: 0.6rem;
  top: -3.3rem;
  height: 10.5rem;
  width: auto;
  opacity: 0.4;
  image-rendering: pixelated;
  pointer-events: none;
}

.follower-box-name {
  position: relative;
}

/* A finished upgrade waiting on a follower (entourage-ui.js's buildFollowerBox): a small red "!" bubble on the box's top-right corner. */
.zone-box {
  position: relative;
}

/* "{X} citizens" at the top right of the Quartermaster's and the Matron's boxes: how many work for each. Left of the "!" corner bubble. */
.follower-box-citizens {
  position: absolute;
  z-index: 2;
  top: 3px;
  right: 14px;
  padding: 0 6px;
  font-size: 0.7rem;
  line-height: 1.1rem;
  color: var(--color-text-secondary);
  background: var(--color-bg-chip);
  border: 1px solid var(--color-border-light);
  border-radius: 999px;
}

.follower-box-bubble {
  position: absolute;
  z-index: 2; /* above the portrait and the name, and over the box's border */
  top: -8px;
  right: -8px;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--color-danger-border);
  color: var(--color-white);
  font-size: 0.7rem;
  font-weight: bold;
  line-height: 1.1rem;
  text-align: center;
}

/* The Cook's upgrades and the Quartermaster's zone bars (entourage-cook-ui.js, entourage-quartermaster-ui.js, 2026-11-03):
   a header line (name on the left, "- n citizens +" on the right), then a full-width bar that reuses the Foreman build fill
   (zone-upgrade-row-constructing + --build-progress), dashed while idle, then a description or rate line. */
.cook-upgrade-block,
.citizen-zone-block {
  margin: 0 0 0.75rem;
}

.cook-upgrade-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.cook-upgrade-name {
  font-weight: bold;
}

.cook-upgrade-bar,
.citizen-zone-bar {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}

.cook-upgrade-bar.conversion-bar-stopped,
.citizen-zone-bar.conversion-bar-stopped {
  border-style: dashed;
}

.cook-upgrade-description {
  margin-top: 0.2rem;
}

.citizen-zone-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.citizen-assign-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.citizen-assign-button {
  min-width: 1.8rem;
}

.citizen-assign-count {
  min-width: 5.5rem;
  text-align: center;
  font-weight: bold;
  font-size: 0.85rem;
}

/* The Cook's tech tree: the Cook at the top, three branch columns under it, each node joined to the one it needs by a short
   vertical line (.cook-tree-link, gold once the node above is owned). A horizontal rule joins the three branches to the root. */
.cook-tree {
  margin: 0.75rem 0;
}

.cook-tree-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.cook-tree-root {
  width: fit-content;
  margin: 0 auto;
  padding: 0.25rem 0.9rem;
  border: 2px solid var(--color-title-gold-mid);
  border-radius: 999px;
  font-weight: bold;
  background: var(--color-bg-chip);
}

.cook-tree-branches {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding-top: 1rem;
}

/* The rule under the root, from the first branch's centre to the last one's, and the stub up to the root. */
.cook-tree-branches::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  left: calc((100% - 1rem) / 6); /* the first and last branch's centre: a column is (100% - two 0.5rem gaps) / 3 wide */
  right: calc((100% - 1rem) / 6);
  border-top: 2px solid var(--color-border-dark);
}

.cook-tree-branches::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  height: 0.5rem;
  border-left: 2px solid var(--color-border-dark);
}

.cook-tree-branch {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cook-tree-branch::before {
  content: "";
  position: absolute;
  top: -0.5rem;
  left: 50%;
  height: 0.5rem;
  border-left: 2px solid var(--color-border-dark);
}

/* The branch's name is a small pill like the root: the tick from the rule above ends on its top edge and the link to the first
   node starts on its bottom edge, so the line from the Cook / Quartermaster down to each first node is unbroken. */
.cook-tree-branch-name {
  position: relative;
  padding: 0.1rem 0.8rem;
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--color-text-secondary);
  background: var(--color-bg-chip);
  border: 2px solid var(--color-border-dark);
  border-radius: 999px;
}

.cook-tree-link {
  width: 0;
  height: 0.9rem;
  border-left: 2px solid var(--color-border-dark);
}

.cook-tree-link-lit {
  border-left-color: var(--color-title-gold-mid);
}

.cook-tree-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 9rem;
  padding: 0.3rem 0.4rem;
  font-size: 0.8rem;
  border: 2px solid var(--color-border-dark);
  border-radius: 6px;
  background: var(--color-bg-chip);
  cursor: pointer;
}

.cook-tree-node:disabled {
  cursor: default;
  opacity: 0.7;
}

.cook-tree-node-owned {
  border-color: var(--color-title-gold-mid);
  background: var(--color-success-bg);
  opacity: 1;
}

.cook-tree-node-capstone {
  border-style: double;
  border-width: 3px;
}

.cook-tree-node-rank {
  font-weight: bold;
}

/* One row per depth in a branch (tech-tree-ui.js): a chain has one node per row; a fan (the Quartermaster's Logistics,
   every node hanging from Auto-max) wraps its nodes in smaller boxes. */
.cook-tree-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
  width: 100%;
}

.cook-tree-row > .cook-tree-node:not(:only-child) {
  flex: 1 1 4.5rem;
  max-width: 6rem;
  font-size: 0.75rem;
}

/* A Quartermaster bar shows its zone's background, and a Matron upgrade bar its own picture (set inline by
   entourage-cook-ui.js's applyBarBackground) under a white veil. */
.cook-upgrade-bar,
.citizen-zone-bar {
  background-size: cover;
  background-position: center;
  /* About 50% taller than a plain row (44px -> 66px), to show off the picture behind the text. */
  min-height: 4.125rem;
}
