/* game-features.css: later feature additions in original order: tabs, planner, treasury, approach modes, sidebar, icons, login gate, queue, topbar, a11y, utilities, right rail. Moved verbatim from css/game.css (TD-CONTENT-SPLIT-001); link order in index.html keeps the cascade. */


/* Persistent skill browsing and a non-colour-only combat target marker. */
#skill-jump { min-width: 0; max-width: 145px; flex: 0 1 145px; }
.status-nav-row .page-tabs { min-width: 0; flex: 1; }

#enemy-hp-list .attack-target { border-left: 3px solid var(--color-active); padding-left: 8px; }

/* BUG-011 / UX-009 slice 2: the eight page tabs wrapped to 3 rows at 480px,
   4 at 390px and 8 at 320px, so the fixed bar grew to 141/172/296px against
   the 150px body reserves for it and buried the title from 420px down.
   Below the breakpoint the tabs are replaced by #page-jump, a <select> with
   the same eight destinations, so the row is two short controls instead of
   eight buttons and a select. Both are always in the DOM (see
   renderPageTabs()) — these rules are the only thing that decides which one
   the player sees, so no JS anywhere reads the viewport width.

   One breakpoint, 540px, and it is measured rather than guessed: with
   #skill-jump in the row the tabs hold two rows down to 540px (110px bar,
   40px of slack), go to three at 520px (141px, 9px left) and overflow at
   420px (172px). The interim fix that shipped first dropped #skill-jump
   below 540px instead and said the phone was left without a skill picker;
   it gets one back here, because below 540px the tabs are gone and the row
   has room for both selects. Raising padding-top is still not an option —
   eight rows at 320px would need 320px of reserved space.
   `tests/e2e/status-bar-layout.e2e.test.js` and
   `tests/e2e/mobile-nav.e2e.test.js` hold the invariant. */
#page-jump { display: none; }
@media (max-width: 539px) {
  .status-nav-row .page-tabs { display: none; }
  #page-jump { display: block; min-width: 0; flex: 1 1 auto; }
  /* UX-086: the two-select bar is ~70px here, so 150px left a dead band above the
     title; the status-bar-layout e2e test still guards bar <= reserved. */
  body { padding-top: 100px; }
  /* UX-086: the running skill and its progress come first; the skill grid
     (also reachable from the skill select above) moves to the end. */
  .game { display: flex; flex-direction: column; }
  #panel-skills { order: 1; }

}


/* At the desktop breakpoint, font/emoji metrics can otherwise put the last
   tab on a third row. Five columns (nine tabs since R-01 added Collection,
   5 + 4) keep the reserved two-row height stable; update this count
   alongside PAGE_TABS in js/render.js if a page tab is ever added/removed. */
@media (min-width: 540px) and (max-width: 700px) {
  .status-nav-row .page-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .page-tab-btn { padding-inline: 3px; white-space: nowrap; }
}

/* MP-001 / IDEA-0048: Material and Recipe Planner UI */
.recipe-plan-btn {
  font-family: inherit;
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--wood);
  border-radius: 4px;
  background: var(--parchment);
  color: var(--heading);
  cursor: pointer;
  flex: 0 0 auto;
}

.recipe-plan-btn:hover {
  background: var(--wood);
  color: var(--text);
}

/* UX-015 / DEC-045 obs 2: "Make 1" quick-craft button, styled like its
   .recipe-plan-btn neighbour in the actions bar so the two read as a set. */
.recipe-make1-btn {
  font-family: inherit;
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--wood);
  border-radius: 4px;
  background: var(--parchment);
  color: var(--heading);
  cursor: pointer;
  flex: 0 0 auto;
}

.recipe-make1-btn:hover:not(:disabled) {
  background: var(--wood);
  color: var(--text);
}

.material-planner-box {
  max-width: 520px;
  width: 92%;
  text-align: left;
}

.planner-close-x {
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--heading);
  padding: 0 4px;
}

.planner-close-x:hover {
  color: var(--red-text);
}

.planner-qty-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  font-size: 13px;
  font-weight: bold;
  color: var(--heading);
}

.planner-qty-row input[type="number"] {
  font-family: inherit;
  font-size: 13px;
  width: 80px;
  padding: 3px 6px;
  border: 1px solid var(--wood);
  border-radius: 4px;
  background: #1b212a;
  color: var(--text);
}

.artisan-order-controls {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 8px 0;
}

.artisan-order-controls label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--heading);
  font-size: 13px;
  font-weight: bold;
}

.artisan-order-controls select,
.artisan-order-controls input[type="number"] {
  min-height: 32px;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--wood);
  border-radius: 4px;
  background: var(--parchment-dark);
  color: var(--heading);
  font: inherit;
}

.artisan-order-controls select {
  width: min(100%, 320px);
}

.artisan-order-controls input[type="number"] {
  width: 140px;
}

/* TS-002: Auto-Mason on/off + gold reserve in Treasury. */
.auto-mason-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 10px;
}

.auto-mason-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--heading);
  font-size: 13px;
}

.auto-mason-controls input[type="text"] {
  width: 100px;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--wood);
  border-radius: 6px;
  background: var(--parchment-dark);
  color: var(--heading);
  font: inherit;
  text-align: right;
}

.auto-mason-controls input[aria-invalid="true"] {
  border-color: var(--danger, #c0392b);
}

.artisan-order-progress {
  align-self: center;
}

.planner-banner {
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 6px;
}

.planner-status-ready {
  background: #14301c;
  border: 1px solid #81c784;
  color: #8fd694;
}

.planner-status-intermediate {
  background: #122c38;
  border: 1px solid #81d4fa;
  color: #7fc5e8;
}

.planner-status-missing {
  background: #3a2a12;
  border: 1px solid #ffb74d;
  color: #e0a44a;
}

.planner-subtext {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.planner-section {
  margin-top: 12px;
}

.planner-section-title {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--heading);
  margin-bottom: 6px;
}

.planner-empty-note {
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
}

.planner-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.planner-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.planner-chip-ok {
  background: #14301c;
  border: 1px solid #a5d6a7;
  color: #8fd694;
}

.planner-chip-missing {
  background: #3a1a1c;
  border: 1px solid #ef9a9a;
  color: #f28b82;
}

.planner-chip-deficit {
  font-weight: bold;
}

.planner-chip-reserve {
  color: var(--muted);
  font-size: 11px;
}

.planner-skill-req {
  color: var(--muted);
  font-size: 11px;
}

.planner-tree-view {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--parchment-dark);
  border-radius: 6px;
  padding: 8px 12px;
  max-height: 220px;
  overflow-y: auto;
  font-size: 12px;
}

.planner-tree-root, .planner-tree-sublist {
  list-style: none;
  margin: 0;
  padding-left: 16px;
}

.planner-tree-root {
  padding-left: 0;
}

.planner-tree-node {
  margin: 4px 0;
}

.planner-tree-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.planner-tree-label {
  font-weight: 500;
}

.planner-tree-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: bold;
}

.tree-badge-ok {
  background: #14301c;
  color: #8fd694;
  border: 1px solid #a5d6a7;
}

.tree-badge-missing {
  background: #3a1a1c;
  color: #f28b82;
  border: 1px solid #ef9a9a;
}

.planner-tree-deficit {
  font-size: 11px;
  color: var(--red-text);
  font-style: italic;
}

/* SC-001 (IDEA-0023): Aether Stability Card & Attunement */
.aether-stability-card {
  padding: 8px 12px;
  background: #1b212a;
  border: 1px solid var(--wood-light, #39424f);
  border-radius: 6px;
}

.aether-stability-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.aether-stability-title {
  font-size: 13px;
  font-weight: bold;
  color: var(--heading);
}

.aether-stability-badge {
  font-size: 11px;
  font-weight: bold;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid;
}

.badge-stable {
  background: #14301c;
  border-color: #81c784;
  color: #8fd694;
}

.badge-volatile {
  background: #241a3a;
  border-color: #9061f9;
  color: #b9a4f5;
}

.aether-stability-btn-group {
  display: flex;
  gap: 8px;
}

.aether-mode-btn {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid var(--wood-light, #39424f);
  background: #1b212a;
  color: var(--text);
  transition: all 0.15s ease;
}

.aether-mode-btn:hover {
  border-color: var(--muted);
  background: var(--parchment);
}

.aether-mode-btn.active {
  background: var(--color-active);
  border-color: var(--color-active);
  color: var(--on-accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* CG-026c: Mining Risk Card & Approach (direct forlæg the Aether Stability
   Card above — own classes so Aether's own styling stays untouched). */
.mining-risk-card {
  padding: 8px 12px;
  background: #1b212a;
  border: 1px solid var(--wood-light, #39424f);
  border-radius: 6px;
}

.mining-risk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.mining-risk-title {
  font-size: 13px;
  font-weight: bold;
  color: var(--heading);
}

.mining-risk-badge {
  font-size: 11px;
  font-weight: bold;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid;
}

.badge-careful {
  background: #14301c;
  border-color: #81c784;
  color: #8fd694;
}

.badge-reckless {
  background: #3a1a1a;
  border-color: #e57373;
  color: #f5a4a4;
}

.mining-risk-btn-group {
  display: flex;
  gap: 8px;
}

.mining-mode-btn {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid var(--wood-light, #39424f);
  background: #1b212a;
  color: var(--text);
  transition: all 0.15s ease;
}

.mining-mode-btn:hover {
  border-color: var(--muted);
  background: var(--parchment);
}

.mining-mode-btn.active {
  background: var(--color-active);
  border-color: var(--color-active);
  color: var(--on-accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* CG-026d: Fishing Patience Card & Approach (direct forlæg the Mining Risk
   Card above — own classes so Mining's own styling stays untouched). */
.fishing-patience-card {
  padding: 8px 12px;
  background: #1b212a;
  border: 1px solid var(--wood-light, #39424f);
  border-radius: 6px;
}

.fishing-patience-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.fishing-patience-title {
  font-size: 13px;
  font-weight: bold;
  color: var(--heading);
}

.fishing-patience-badge {
  font-size: 11px;
  font-weight: bold;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid;
}

.badge-quick {
  background: #14301c;
  border-color: #81c784;
  color: #8fd694;
}

.badge-patient {
  background: #1a2a3a;
  border-color: #64b5f6;
  color: #90caf9;
}

.fishing-patience-btn-group {
  display: flex;
  gap: 8px;
}

.fishing-mode-btn {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid var(--wood-light, #39424f);
  background: #1b212a;
  color: var(--text);
  transition: all 0.15s ease;
}

.fishing-mode-btn:hover {
  border-color: var(--muted);
  background: var(--parchment);
}

.fishing-mode-btn.active {
  background: var(--color-active);
  border-color: var(--color-active);
  color: var(--on-accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.fishing-bait-controls {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--wood-light, #39424f);
}

.fishing-bait-explanation {
  margin: 0 0 7px;
  line-height: 1.4;
}

.fishing-bait-mode-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.fishing-bait-status {
  margin-top: 7px;
  color: var(--heading);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* CG-026e: Woodcutting Yield Card & Approach (direct forlæg the Fishing
   Patience Card above — own classes so Fishing's own styling stays
   untouched). */
.woodcutting-yield-card {
  padding: 8px 12px;
  background: #1b212a;
  border: 1px solid var(--wood-light, #39424f);
  border-radius: 6px;
}

.woodcutting-yield-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.woodcutting-yield-title {
  font-size: 13px;
  font-weight: bold;
  color: var(--heading);
}

.woodcutting-yield-badge {
  font-size: 11px;
  font-weight: bold;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid;
}

.badge-bundle {
  background: #3a2e14;
  border-color: #e5b873;
  color: #f5c876;
}

.woodcutting-yield-btn-group {
  display: flex;
  gap: 8px;
}

.woodcutting-mode-btn {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid var(--wood-light, #39424f);
  background: #1b212a;
  color: var(--text);
  transition: all 0.15s ease;
}

.woodcutting-mode-btn:hover {
  border-color: var(--muted);
  background: var(--parchment);
}

.woodcutting-mode-btn.active {
  background: var(--color-active);
  border-color: var(--color-active);
  color: var(--on-accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* CG-026f: Foraging Focus card (Herbs / Forager's Eye). */
.foraging-focus-card,
.skinning-focus-card {
  padding: 8px 12px;
  background: #1b212a;
  border: 1px solid var(--forest-light, #526745);
  border-radius: 6px;
}

.foraging-focus-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.foraging-focus-title {
  font-size: 13px;
  font-weight: bold;
  color: var(--heading);
}

.foraging-focus-badge {
  font-size: 11px;
  font-weight: bold;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid;
}

.badge-herbs {
  background: #213326;
  border-color: #6d9b6a;
  color: #a8d7a0;
}

.badge-finds {
  background: #3a2e14;
  border-color: #e5b873;
  color: #f5c876;
}

.foraging-focus-explanation {
  margin: 2px 0 8px;
  line-height: 1.4;
}

.foraging-focus-btn-group {
  display: flex;
  gap: 8px;
}

.foraging-focus-mode-btn {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid var(--forest-light, #526745);
  background: #1b212a;
  color: var(--text);
  transition: all 0.15s ease;
}

.foraging-focus-mode-btn:hover {
  border-color: var(--muted);
  background: var(--parchment);
}

.foraging-focus-mode-btn.active {
  background: var(--color-active);
  border-color: var(--color-active);
  color: var(--on-accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.skinning-focus-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.skinning-focus-title {
  font-size: 13px;
  font-weight: bold;
  color: var(--heading);
}

.skinning-focus-badge {
  font-size: 11px;
  font-weight: bold;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid;
}

.skinning-focus-explanation {
  margin: 2px 0 8px;
  line-height: 1.4;
}

.skinning-focus-btn-group {
  display: flex;
  gap: 8px;
}

.skinning-focus-mode-btn {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid var(--forest-light, #526745);
  background: #1b212a;
  color: var(--text);
  transition: all 0.15s ease;
}

.skinning-focus-mode-btn:hover {
  border-color: var(--muted);
  background: var(--parchment);
}

.skinning-focus-mode-btn.active {
  background: var(--color-active);
  border-color: var(--color-active);
  color: var(--on-accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* DLS-001 (IDEA-0062): Desktop left sidebar UI */
.desktop-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  body {
    padding-left: 304px;
    padding-top: 52px;
    justify-content: flex-start;
  }

  .game {
    max-width: 1100px;
    width: 100%;
    margin: 0;
  }

  /* Desktop sidebar provides persistent navigation; hide redundant top nav row & central grid */
  #panel-skills,
  .status-nav-row {
    display: none;
  }

  .status-bar-inner {
    max-width: 1100px;
  }

  .desktop-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px;
    padding: 52px 8px 16px;
    background: var(--parchment-dark);
    border-right: 2px solid var(--wood);
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.08);
    overflow-y: auto;
    z-index: 90;
    font-family: inherit;
    color: var(--text);
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px 8px;
    border-bottom: 1px solid var(--wood);
    margin-bottom: 8px;
  }

  .sidebar-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--heading);
    letter-spacing: 0.5px;
  }

  .sidebar-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    font-weight: bold;
    padding: 6px 8px 4px;
  }

  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    margin-bottom: 12px;
  }

  .sidebar-nav-btn {
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 8px;
    border: 1px solid var(--wood);
    border-radius: 4px;
    background: var(--parchment);
    color: var(--text);
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    user-select: none;
  }

  .sidebar-nav-btn:hover {
    background: var(--wood);
    color: var(--text);
  }

  .sidebar-nav-btn.active {
    background: var(--surface-2);
    color: var(--color-active);
    border-color: var(--color-active);
    font-weight: bold;
  }

  .sidebar-skills {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .sidebar-category-group {
    --c: #7fae68;
    border: 1px solid var(--wood);
    border-radius: 4px;
    background: var(--parchment-dark);
    overflow: hidden;
  }

  .sidebar-category-group[data-category="production"] { --c: #d08a5e; }
  .sidebar-category-group[data-category="elite"] { --c: #9a8fd6; }
  .sidebar-category-group[data-category="township"] { --c: #c79a4a; }
  .sidebar-category-group[data-category="support"] { --c: #92a7bb; }
  .sidebar-category-group[data-category="combat"] { --c: #d4796a; }

  .sidebar-category-heading {
    font-size: 12px;
    font-weight: bold;
    color: var(--heading);
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 8px;
    cursor: pointer;
    user-select: none;
  }

  .sidebar-category-heading:hover {
    background: rgba(255, 255, 255, 0.09);
  }

  .sidebar-category-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px;
  }

  .sidebar-skill-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    transition: background 0.12s, border-color 0.12s;
  }

  .sidebar-skill-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--wood);
  }

  .sidebar-skill-btn.active-view {
    background: var(--parchment);
    border-color: var(--muted);
    font-weight: bold;
  }

  .sidebar-skill-btn.running {
    box-shadow: inset 3px 0 0 var(--green);
  }

  .sidebar-skill-btn.locked {
    opacity: 0.55;
    cursor: not-allowed;
  }

  .sidebar-skill-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar-skill-icon svg {
    width: 18px;
    height: 18px;
  }

  .sidebar-skill-info {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
  }

  .sidebar-skill-name {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sidebar-skill-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--muted);
    gap: 4px;
  }

  .sidebar-skill-running-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    margin-right: 3px;
  }
}

/* ICON-001: transparent raster item assets preserve the existing text labels. */
.game-item-icon {
  display: inline-block;
  width: 30px;
  height: 30px;
  object-fit: contain;
  vertical-align: middle;
  flex: 0 0 auto;
}

.resource-name .game-item-icon,
.resource-btn .game-item-icon {
  width: 32px;
  height: 32px;
}

.inv-item .game-item-icon,
.market-name .game-item-icon {
  width: 28px;
  height: 28px;
}

.game-item-icon-fallback {
  display: inline-block;
  min-width: 1.1em;
  text-align: center;
  vertical-align: middle;
}

.game-ui-icon-slot {
  display: inline-flex;
  width: 1.1em;
  height: 1.1em;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  vertical-align: -0.2em;
}

.game-ui-icon-fallback {
  display: inline-flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.game-ui-icon-slot.has-raster .game-ui-icon-fallback {
  display: none;
}

.game-ui-raster-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.skill-tile-icon .game-ui-icon-slot,
.sidebar-skill-icon .game-ui-icon-slot {
  width: 100%;
  height: 100%;
  vertical-align: middle;
}

/* ART-OUTFIT-001: per-skill outfit art is a full icon, not a text-sized glyph; owned pieces keep their colour. */
#equipment-skill-slot-list .equipment-slot-placeholder .game-ui-icon-slot { width: 36px; height: 36px; }
#equipment-skill-slot-list .equipment-slot-item:not(.empty) .equipment-slot-placeholder { filter: none; }

.horde-loadout-records {
  width: 100%;
  max-width: 100%;
  margin: 6px 0 10px;
}

.horde-loadout-records-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.88em;
}

.horde-loadout-records-table caption {
  padding: 3px 5px;
  text-align: left;
  font-weight: 700;
}

.horde-loadout-records-table th,
.horde-loadout-records-table td {
  padding: 4px 5px;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.horde-loadout-records-table th:first-child {
  width: 48%;
  text-align: left;
}

.horde-loadout-records-table th:nth-child(2),
.horde-loadout-records-table th:nth-child(3) {
  width: 26%;
}

.horde-loadout-records-table .horde-record-number {
  text-align: right;
}

.horde-loadout-records-table .horde-record-current {
  background-color: rgba(129, 197, 255, 0.14);
}

.horde-loadout-records-table .horde-record-current > th:first-child {
  box-shadow: inset 3px 0 0 #55a9f3;
}

.horde-records-empty {
  margin: 0;
}

/* CLOUD-005 mandatory account entry gate. */
body.auth-gated > :not(#cloud-login-gate):not(#email-verify-banner) { display: none !important; }
body.auth-gated { display: block !important; min-height: 100vh; min-height: 100dvh; padding: 0 !important; overscroll-behavior: none; }
/* UX-059: Eldervale's own palette/panel language instead of hardcoded hex,
   so the first screen a player sees matches the rest of the UI. */
.cloud-login-gate { position: relative; isolation: isolate; box-sizing: border-box; width: 100%; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; gap: 32px; place-items: center; padding: 24px; background: var(--surface-2); color: var(--text); }
/* ART-009: the gradient mask reveals the dark token beneath the image,
   acting as an overlay without painting anything when the image fails. */
.cloud-login-gate::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("../assets/art/login/eldervale-dusk-1920.webp");
  background-size: cover; background-position: center;
  -webkit-mask-image: linear-gradient(180deg, #000a 0%, #0006 45%, #0009 100%);
  mask-image: linear-gradient(180deg, #000a 0%, #0006 45%, #0009 100%);
}
@media (max-width: 767px) {
  .cloud-login-gate::before { background-image: url("../assets/art/login/eldervale-dusk-960.webp"); }
}
.cloud-login-gate[hidden] { display: none !important; }
/* BUG-LOGIN-FLASH-001: no login card while a saved session is still being checked. */
html.auth-pending .cloud-login-gate > * { visibility: hidden; }
html.auth-pending .cloud-login-gate::after { content: "Loading…"; color: var(--muted); }
/* The title remains real text, readable and responsive above the login card. */
.cloud-login-brand {
  margin: clamp(8px, 3vh, 28px) 0 0; color: var(--gold-light);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 7vw, 76px); font-weight: 700; line-height: 1.15;
  letter-spacing: .1em; text-indent: .1em; text-align: center;
  text-shadow: 0 2px 4px #000, 0 4px 24px #000;
}
.cloud-login-card { width: min(100%, 460px); padding: 28px; border: 2px solid var(--wood); border-radius: var(--radius-lg); background: var(--parchment-dark); background-image: linear-gradient(180deg, var(--parchment) 0%, var(--parchment-dark) 140px); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
.cloud-login-card h1 { margin-top: 0; }
.cloud-login-card #cloud-login-title { color: var(--gold-light); }
.cloud-login-card label { display: block; margin: 14px 0 6px; color: var(--muted); }
.cloud-login-card input { box-sizing: border-box; width: 100%; padding: 10px; border: 1px solid var(--wood); border-radius: var(--radius-md); background: var(--surface-2); color: inherit; }
.cloud-login-card .controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
/* UX-073: one obvious primary action on the gate (green = go, never gold). */
.cloud-login-card .action.primary { min-height: 44px; padding-inline: 20px; border-color: var(--color-active); background: var(--color-active); color: var(--on-accent); font-weight: bold; }
.cloud-login-card .action.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--color-active) 85%, #fff); }
.cloud-login-card [role="status"] { min-height: 1.5em; }
.cloud-login-card .gate-guest-btn { width: 100%; margin-top: 4px; }
.cloud-login-card [role="status"]:empty { min-height: 0; margin: 0; }
.cloud-login-card[hidden] { display: none; }
/* UX-086: show/hide sits inside the password field; Caps Lock hint below it. */
.cloud-login-card .password-field { position: relative; }
.cloud-login-card .password-field input { padding-right: 64px; }
.cloud-login-card .password-toggle { position: absolute; top: 0; bottom: 0; right: 4px; z-index: 1; padding: 0 10px; border: 0; border-radius: var(--radius-md); background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.cloud-login-card .password-toggle:hover { color: var(--heading); }
.cloud-login-card .password-toggle:focus-visible { outline: 2px solid var(--color-active); outline-offset: 2px; }
.cloud-login-card .gate-hint { margin: 6px 0 0; font-size: 13px; color: var(--gold-light); }
.cloud-login-card .gate-hint[hidden] { display: none; }

.cloud-login-card .link-button { margin-top: 8px; padding: 0; border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; }
@media (max-width: 520px) { .cloud-login-gate { padding: 12px; } .cloud-login-card { padding: 20px; } }
/* BUG-PHONE-SCROLL-001: on a short phone the login fits without scrolling. */
@media (max-height: 700px) { .cloud-login-gate { gap: 8px; padding: 8px 12px; } .cloud-login-brand { margin-top: 0; font-size: 30px; line-height: 1.1; } .cloud-login-card { padding: 8px 14px; } .cloud-login-card label { margin: 6px 0 4px; } .cloud-login-card .controls { margin-top: 8px; } .cloud-login-card .gate-hint, .cloud-login-card .link-button { margin-top: 4px; } .cloud-login-card #cloud-login-title { margin-bottom: 6px; } }
@media (max-height: 600px) { .cloud-login-card p { margin: 4px 0; font-size: 13px; line-height: 1.3; } .cloud-login-card h1 { font-size: 18px; } .cloud-login-card h2 { font-size: 15px; margin: 6px 0 0; } .cloud-login-card .gate-hint { font-size: 12px; } .cloud-login-card input { padding: 6px 10px; } }

/* ICON-011: large current-enemy portrait in the encounter panel. */
.enemy-portrait { display: flex; justify-content: center; margin: 8px 0; }
.enemy-portrait .game-ui-icon-slot { width: min(192px, 40vw); height: min(192px, 40vw); font-size: min(96px, 20vw); vertical-align: middle; }
/* Dev-pass 2026-10-03: fast clicking must never select text; every button shows hover + pressed state. */
button, .page-tab-btn, .skill-tile, .resource-card, [role="button"] { user-select: none; -webkit-user-select: none; }
button:not(:disabled):hover { filter: brightness(1.12); }
button:not(:disabled):active { filter: brightness(0.9); transform: translateY(1px); }
button:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
/* AUD-014: login uses the same visible ring as the game. */
.cloud-login-gate :focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

/* FEEDBACK-002: feedback dialog + status bar link */
.status-feedback-link { background: none; border: none; color: inherit; opacity: 0.75; font-size: 0.8em; text-decoration: underline; cursor: pointer; padding: 2px 4px; }
.status-feedback-link:hover, .status-feedback-link:focus-visible { opacity: 1; }
/* Phones keep the nav selects as the first Tab stops (UX-022); Settings has the button there. */
@media (max-width: 539px) { .status-feedback-link { display: none; } }
.feedback-dialog { width: min(480px, calc(100vw - 24px)); max-height: calc(100vh - 24px); box-sizing: border-box; background: var(--panel, #1f1f1f); color: inherit; border: 1px solid #555; border-radius: 8px; padding: 16px; }
.feedback-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.feedback-dialog form { display: flex; flex-direction: column; gap: 6px; }
.feedback-dialog textarea { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; }
.feedback-types { display: flex; flex-wrap: wrap; gap: 12px; border: none; padding: 0; margin: 0; }

/* CLOUD-009: discreet email-verification reminder; never blocks play. */
.email-verify-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 6px 12px; background: var(--surface-2); color: var(--text); font-size: 0.9em; border-bottom: 1px solid var(--border, rgba(127,127,127,0.3)); }
.email-verify-banner[hidden] { display: none !important; }
/* BUG-035: body is a row flexbox (centres .game), so banners became stretched side columns.
   Wrap them onto their own full-width line above the game instead. */
body { flex-wrap: wrap; align-content: flex-start; }
body > .email-verify-banner { flex: 0 0 100%; order: -1; box-sizing: border-box; margin-bottom: 8px; }
body.auth-gated > .email-verify-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 10; }

/* UX-075: unspent-points count -- reward gold text, no red dot. */
.unspent-badge {
  margin-left: 6px;
  padding: 0 6px;
  border: 1px solid var(--gold-dark);
  border-radius: 8px;
  color: var(--gold);
  font-size: 11px;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}

.offline-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
/* UX-092: Continue stays on screen however long the homecoming is; on phones the
   talent nudge takes its own row above it. */
#offline-modal .offline-footer { position: sticky; bottom: -24px; margin: 0 -24px -24px; padding: 10px 24px 24px; background: var(--parchment); border-top: 1px solid var(--wood); }
@media (max-width: 539px) { .offline-talents-nudge { flex-basis: 100%; } }
.offline-talents-nudge { display: flex; align-items: center; gap: 8px; margin-right: auto; order: -1; font-size: 13px; color: var(--gold); }
.offline-talents-nudge[hidden] { display: none; }

/* DUNG-001: Marrow Crypt room list -- the sequence is the information. */
.dungeon-rooms {
  display: grid;
  gap: 6px;
  margin: 8px 0;
  padding-left: 22px;
  font-size: 13px;
  color: var(--text);
}
.dungeon-room-tag {
  font-size: 12px;
  color: var(--heading);
}
.dungeon-room-note {
  display: block;
  color: var(--text);
  opacity: 0.85;
}
.dungeon-room-cleared strong { text-decoration: line-through; text-decoration-thickness: 1px; }
.dungeon-room-current strong, .dungeon-room-paused strong { color: var(--heading); }
.dungeon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* BOSS-RUSH-001: Gauntlet rows and the battlefield 'Boss N of M' line. */
.gauntlet-list { display: grid; gap: 8px; margin: 8px 0; padding: 0; list-style: none; font-size: 13px; }
.gauntlet-row { display: grid; gap: 3px; padding: 6px 8px; border: 1px solid var(--wood); border-radius: 6px; background: var(--parchment-dark); overflow-wrap: anywhere; }
.gauntlet-row-current { border-color: var(--color-active); border-left-width: 3px; }
.gauntlet-row-note { color: var(--text); opacity: 0.85; }
.gauntlet-live { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0; font-size: 13px; color: var(--heading); }
/* UX-098: one card per enemy on the field, HP bar above the art; wraps, never side-scrolls. */
#enemy-hp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
#enemy-hp-list .enemy-card { margin: 0; padding: 6px; background: var(--parchment-dark); border: 1px solid var(--wood); border-radius: 6px; min-width: 0; overflow-wrap: anywhere; }
#enemy-hp-list .enemy-card.attack-target { border-color: var(--color-active); border-left-width: 3px; padding-left: 6px; }
#enemy-hp-list .enemy-card-dead { opacity: .45; }
.enemy-card-art { display: flex; justify-content: center; margin: 6px 0; }
.enemy-card-art .game-ui-icon-slot { width: 96px; height: 96px; font-size: 56px; }
@media (max-width: 480px) {
  #enemy-hp-list { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .enemy-card-art .game-ui-icon-slot { width: 64px; height: 64px; font-size: 40px; }
}

/* NEWS-001: quiet "What's new" link in the nav row, not a red badge (DESIGN.md). */
.news-badge {
  flex: none;
  padding: 4px 10px;
  border: 1px solid var(--gold-light);
  border-radius: 4px;
  background: none;
  color: var(--gold-light);
  font: inherit;
  font-size: 0.85em;
  cursor: pointer;
}
.news-badge:hover { color: var(--heading); }
.news-badge:focus-visible { outline: 2px solid var(--color-active); outline-offset: 2px; }
.news-section { scroll-margin-top: 120px; }
.news-section h4 { margin: 12px 0 6px; }
.news-entry { padding: 8px 0; border-bottom: 1px solid var(--wood); }
.news-entry h5 { margin: 0 0 4px; color: var(--heading); }
.news-entry time { margin-left: 6px; font-weight: normal; font-size: 0.85em; opacity: 0.7; }
.news-entry p { margin: 0; }
.news-discord:not([hidden]) { display: inline-block; }
.news-discord { margin-bottom: 6px; color: var(--gold-light); }

/* UX-103: enemy HP numbers centred inside the enemy-card HP bar. */
.enemy-card .bar-outer { position: relative; }
.enemy-card .enemy-hp-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 2px #000, 0 1px 2px #000;
  pointer-events: none;
}

/* Phones: the status-bar Feedback link is hidden (UX-022 tab order), so the nav row carries one after the selects. */
.nav-feedback-btn { display: none; flex: none; padding: 4px 10px; border: 1px solid var(--gold-light); border-radius: 4px; background: none; color: var(--gold-light); font: inherit; font-size: 0.85em; cursor: pointer; min-height: 32px; } /* UX-TOPBAR-001: same button format as .news-badge */
.nav-feedback-btn:hover { color: var(--heading); }
.nav-feedback-btn:focus-visible { outline: 2px solid var(--color-active); outline-offset: 2px; }
@media (max-width: 539px) { .nav-feedback-btn { display: inline-block; } }

/* UX-ALPHA-001: slim alpha notice at the top of the fixed bar; body margin makes room (fixed bar is out of flow). */
:root { --alpha-h: 40px; }
.alpha-banner { box-sizing: border-box; width: calc(100% + 32px); margin: -8px -16px 6px; height: var(--alpha-h); display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 8px; background: var(--parchment-dark); border-bottom: 1px solid var(--wood); font-size: 0.8em; line-height: 1.2; }
.alpha-feedback-btn, .alpha-close-btn { flex: none; padding: 4px 10px; border: 1px solid var(--gold-light); border-radius: 4px; background: none; color: var(--gold-light); font: inherit; font-size: 1em; cursor: pointer; }
.alpha-close-btn { border-color: transparent; }
.alpha-feedback-btn:hover, .alpha-close-btn:hover { color: var(--heading); }
.alpha-feedback-btn:focus-visible, .alpha-close-btn:focus-visible { outline: 2px solid var(--color-active); outline-offset: 2px; }
body.alpha-banner-closed .alpha-banner { display: none; }
body:not(.alpha-banner-closed) { --alpha-pad: calc(var(--alpha-h) - 2px); padding-top: calc(150px + var(--alpha-pad)); }
@media (max-width: 539px) { body:not(.alpha-banner-closed) { padding-top: calc(100px + var(--alpha-pad)); } }
@media (min-width: 1024px) { body:not(.alpha-banner-closed) { padding-top: calc(52px + var(--alpha-pad)); } }
@media (min-width: 1024px) { body:not(.alpha-banner-closed) .desktop-sidebar { padding-top: calc(52px + var(--alpha-pad)); } }
@media (max-width: 480px) { :root { --alpha-h: 52px; } body:not(.alpha-banner-closed) { padding-top: calc(130px + var(--alpha-pad)); } .alpha-feedback-btn, .alpha-close-btn { min-height: 44px; min-width: 44px; } body:not(.alpha-banner-closed) .did-you-know { display: none; } /* keeps the first resource card above the fold at 375x812 while the notice is up */ }

/* UX-108: picker rows share one card width, so the last row never stretches. */
.equipment-picker .weapon-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.equipment-picker .weapon-list > .resource-btn { min-width: 0; }
/* UX-109: role ("Target", "Queue") on its own line, name kept to one line;
   HP numbers sit on a dark chip so they read on the full and the empty bar. */
.enemy-card .hp-label .enemy-role { display: block; font-size: 0.85em; font-weight: normal; }
.enemy-card .hp-label .enemy-role-sep { display: none; }
.enemy-card .hp-label .enemy-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.enemy-card .enemy-hp-text {
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(20, 14, 10, 0.82);
  text-shadow: none;
  white-space: nowrap;
}
/* UX-111: Township food status is one left-aligned line with Go to Cooking
   beside it; the Auto-Seller reserve sits underneath. Project text reads left
   like the rest of its card; Assign is the primary in a villager move row. */
.village-food-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; }
.village-food-row #village-food-status { margin: 0; text-align: left; }
.village-food-row #village-food-cook-btn[hidden] { display: none; }
#village-food-status .village-food-reserve { display: block; font-weight: normal; color: var(--muted); }
#panel-township .town-subsection > .footer-note { text-align: left; }
.npc-group-controls .action.primary { border-color: var(--color-active); background: var(--color-active); color: var(--on-accent); font-weight: bold; }
.npc-group-controls .action.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--color-active) 85%, #fff); }
/* UX-113: the Statistics jump links wrap on narrow screens instead of
   clipping the last link mid-word. */
.stats-jump { flex-wrap: wrap; overflow-x: visible; }
/* UX-107: the bulk learn reads as a real button; node labels show in full; perk cards share one layout. */
.talent-branch button.action.talent-learn-all {
  border: 1px solid var(--gold-dark);
  background: var(--gold);
  color: var(--on-accent);
  font-weight: 600;
}
.talent-branch button.action.talent-learn-all:hover,
.talent-branch button.action.talent-learn-all:focus-visible { background: var(--gold-light); }
.talent-node .talent-node-label { display: block; overflow: visible; -webkit-line-clamp: none; overflow-wrap: break-word; hyphens: auto; }
.talent-branch summary .talent-branch-count.is-own-line { flex-basis: 100%; text-align: right; }
#melee-aoe-status { white-space: pre-line; } /* COMBAT-MULTI-HINT-001 */
.prestige-shop-need { flex-basis: 100%; grid-column: 1 / -1; margin: 0 0 8px; font-size: 13px; color: var(--muted); }
/* UX-110: time-bank help is readable; the Choose resource info lines are a left-aligned icon list. */
.skip-bank-label { font-size: var(--font-size-sm); }
#resource-next-unlock, #resource-next-goal, #resource-node-state {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 4px;
  text-align: left;
}
#resource-next-unlock:empty, #resource-next-goal:empty, #resource-node-state:empty { display: none; }
.combat-next-line { margin: 0 0 6px; text-align: left; }
.combat-next-line:empty { display: none; }
/* UX-121/122 */
.combat-hint-action { padding: 2px 10px; margin-left: 6px; }
.combat-prefight-warning { margin: 6px 0; text-align: left; color: var(--red-text); }
.combat-prefight-warning .link-button { padding: 0; border: 0; background: none; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
.resource-info-icon { display: inline-flex; flex: none; width: 18px; justify-content: center; color: var(--heading); }
.resource-goal-claim { padding: 4px 12px; }
/* ONB-004: the starter chain's Next step reads as the one thing to do now. */
#resource-next-goal.starter-step, #combat-starter-step.starter-step { color: var(--heading); font-weight: 600; padding: var(--space-md); border-left: 3px solid var(--gold); background: var(--surface-2); }
#resource-next-goal .starter-go, #combat-starter-step .starter-go { min-height: 44px; min-width: 44px; }
#resource-panel #resource-search { margin-top: 8px; }
/* UX-112: level-ups from the time away lead the homecoming summary. */
.offline-levelups {
  margin-bottom: 8px;
  padding: 8px 12px;
  border: 1px solid var(--gold-dark);
  border-radius: 6px;
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  color: var(--gold-light);
  font-weight: bold;
}

/* UX-117: compact Action Queue panel directly under the current activity.
   One grid row per slot: tag | icon+name+amount | progress | actions. */
.queue-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--wood); padding-bottom: 8px; margin-bottom: 10px; }
.queue-head h2 { border: 0; margin: 0; padding: 0; }
.queue-slot-count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#queue-panel #queue-target-status:empty, #queue-panel #queue-capacity-note:empty { display: none; }
.queue-slots { list-style: none; margin: 6px 0 10px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
#queue-list .queue-row { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto auto; align-items: center; gap: 8px; margin: 0; padding: 6px 8px; min-height: 36px; box-sizing: border-box; }
#queue-list .queue-row > .queue-entry-label:first-child { grid-column: 2; }
.queue-row-tag { color: var(--muted); font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.queue-row-now { border-color: var(--color-active); }
.queue-row-now .queue-row-tag { color: var(--color-active); font-weight: bold; }
.queue-entry-label { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; }
.queue-entry-icon:empty { display: none; }
.queue-entry-name { font-weight: bold; color: var(--heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-entry-amount { color: var(--muted); font-size: 12px; }
.queue-entry-waiting { color: var(--red-text); font-size: 12px; font-style: italic; } /* QUEUE-SKIP */
#queue-panel .footer-note { text-align: left; }
/* UX-QUEUE-001 / QUEUE-UI-001: one-line queue status above the resource cards, every width. */
.queue-status-chip:not([hidden]) { display: block; width: 100%; margin: 0 0 8px; padding: 0 12px; text-align: left; font-size: 13px; min-height: 36px; line-height: 36px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-status-chip[hidden] { display: none !important; }
.queue-status-chip.blocked { border-color: var(--red); color: var(--red); }
@media (max-width: 480px) { .queue-status-chip:not([hidden]) { min-height: 44px; line-height: 44px; } }
.queue-entry-progress { color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.queue-icon-btn { min-width: 32px; min-height: 32px; padding: 2px 8px; }
#queue-list .queue-row-free, #queue-list .queue-row-locked { background: transparent; border-style: dashed; }
.queue-row-free .queue-entry-name, .queue-row-locked .queue-entry-name { font-weight: normal; color: var(--muted); }
.queue-row-locked { opacity: 0.6; }
.queue-empty-note { padding: 4px 2px; }
.queue-controls { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.queue-control-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.queue-control-row[hidden] { display: none; }
.queue-control-label { color: var(--muted); font-size: 12px; width: 3rem; }
.queue-control-row input[type="number"] { width: 9rem; }
.queue-control-row select { min-width: 0; flex: 1 1 8rem; }
/* UX-118: compact empty state for a player who has not used the queue yet. */
.queue-summary { display: none; color: var(--heading); font-weight: bold; margin: 2px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-compact .queue-summary { display: block; }
.queue-compact #queue-capacity-note, .queue-compact .queue-controls > :not(.queue-expand-btn), .queue-compact #queue-stop-after-btn { display: none; }
.queue-expand-btn[hidden],
.queue-compact #queue-target-status, .queue-compact #queue-list .queue-row,
.queue-compact #queue-now-row, .queue-compact #queue-target-error-note, .queue-compact .queue-presets { display: none; }
.queue-compact .queue-slots { margin-bottom: 4px; }
/* UX-QUEUE-1280-001: between phone and the two-column layout the folded queue is one line, so the first resource card stays on screen. */
@media (min-width: 481px) and (max-width: 1439px) {
  #queue-panel.queue-compact { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding-block: 8px; }
  #queue-panel.queue-compact .queue-head { border: 0; margin: 0; padding: 0; }
  #queue-panel.queue-compact .queue-head h2 { font-size: 15px; }
  #queue-panel.queue-compact .queue-summary { flex: 1 1 220px; margin: 0; }
  #queue-panel.queue-compact .queue-slots, #queue-panel.queue-compact .queue-controls { margin: 0; }
  #queue-panel.queue-compact .queue-empty-note { display: none; }
}
.queue-expand-btn { align-self: flex-start; }
#queue-stop-after-btn { margin: 2px 0 6px; }
#queue-stop-after-btn[hidden] { display: none; }
.queue-presets { margin-top: 10px; border-top: 1px solid var(--wood); padding-top: 8px; }
.queue-presets summary { cursor: pointer; color: var(--heading); font-weight: bold; }
.queue-presets[open] summary { margin-bottom: 6px; }
@media (max-width: 480px) {
  #queue-list .queue-row { grid-template-columns: 2rem minmax(0, 1fr) auto; }
  #queue-list .queue-entry-controls { grid-column: 2 / -1; justify-content: flex-start; }
  .queue-control-label { width: 100%; }
}

/* AUD-005: tap targets at least 44px tall on phones. */
@media (max-width: 480px) {
  #page-jump, #skill-jump, button.action.equipment-slot-action, .lock-toggle, .favorite-toggle,
  .market-sell-qty-input, #planner-target-qty, .possible-goal-pin-btn, .pin-goal-btn, #gate-forgot-link {
    min-height: 44px;
  }
}

/* UX-TOPBAR-PAUSE */
.status-pause-btn { flex: 0 0 auto; font-size: 12px; padding: 2px 10px; }
/* 44px tap target on phones; negative margin keeps the fixed bar inside its reserved height. */
@media (max-width: 600px) { .status-pause-btn { min-height: 44px; min-width: 44px; margin-block: -12px; } }
@media (max-width: 480px) { .status-pause-btn { margin-block: 0; } } /* UX-TOPBAR-001: bar has its own taller rows here */
/* UX-TOPBAR-001: paused is not "running" -- no green dot. */
.sidebar-skill-running.is-paused .sidebar-skill-running-dot { display: none; }
.status-activity:focus-visible { outline: var(--focus-ring); outline-offset: 1px; }
.pet-shelf .tooltip-panel { white-space: pre-line; }

/* SKS-002: skill equipment tab -- tool rows and 44px phone tap targets. */
#equipment-skill-tool .tool-slot-content { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0; }
#equipment-view-panel-skill .equipment-summary-row { cursor: default; }
#equipment-view-panel-skill[hidden], #equipment-view-panel-combat[hidden] { display: none !important; }
@media (max-width: 600px) {
  #equipment-view-tabs .combat-view-tab, .equipment-tool-btn, .gathering-tool-slot .action-small, .equip-tool-btn { min-height: 44px; }
}

/* TAL-010: talent reset + presets */
.talent-reset-bar { display: grid; gap: 6px; margin: 8px 0; }
.talent-reset-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.talent-preset-name { min-width: 12em; }
.talent-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 0; }
.talent-preset-slot { display: inline-flex; gap: 4px; }
.talent-presets .talent-reset-message { flex-basis: 100%; margin: 0; }
.talent-perk-picker { display: block; margin: 6px 0; }
.talent-perk-picker select { min-height: 44px; max-width: 100%; }
@media (max-width: 600px) { .talent-reset-btn { min-height: 44px; } }

/* BUG-043: fixed small item icon in activity labels so lines don't jump. */
.action-label .game-item-icon,
.status-activity-label .game-item-icon {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
}

/* UX-133: compact Skip / Bank buttons next to the topbar activity. */
.status-activity-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
  position: relative;
}
.status-activity-actions.panel-hidden { display: none; }
/* ONB-003: a new save hides not-yet-relevant controls until their rule holds. */
.onboard-hidden { display: none !important; }
.status-action-btn {
  font-size: 12px;
  padding: 2px 8px;
  min-height: 28px;
  white-space: nowrap;
}
.status-side-btn { max-width: 32ch; overflow: hidden; text-overflow: ellipsis; } /* MULTI-GATHER-002 */
.status-side-btn.blocked { color: var(--muted); }
.status-skip-help {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 50;
  width: max-content;
  max-width: min(280px, calc(100vw - 16px));
  padding: 6px 8px;
  font-size: 12px;
  background: var(--bg, #1b1b1b);
  border: 1px solid currentColor;
  border-radius: 4px;
}
.status-activity-actions:focus-within .status-skip-help,
.status-activity-actions:active .status-skip-help { display: block; }
@media (max-width: 480px) {
  .status-bar-inner { flex-wrap: wrap; }
  .status-activity { flex: 1 0 100%; order: 1; } /* UX-TOPBAR-001: full-width row so "Paused" is never cut to "Pau..." */
  .status-gold { flex: 1 1 auto; }
  .status-bar { padding-block: 4px; }
  .status-bar-inner { row-gap: 2px; }
  .status-activity-label { margin-bottom: 0; }
  .status-nav-row { margin-top: 2px; padding-top: 2px; }
  body { padding-top: 130px; } /* UX-133 + UX-TOPBAR-001: room for gold/pause, status and Skip/Bank rows */
  .status-activity-actions { flex: 1 0 100%; order: 2; }
  .status-action-btn { flex: 1 1 0; min-height: 44px; }
  #status-gather-btn { flex: 0 1 auto; order: 0; max-width: 60%; overflow: hidden; text-overflow: ellipsis; } /* UX-STOCKOUT-002: first row, beside gold/Pause */
  .status-side-btn { flex: 1 0 100%; min-width: 0; max-width: none; order: 0; min-height: 44px; padding-inline: 6px; } /* UX-SIDEHAND-CHIP-PHONE-001: own full-width line under gold/Pause so "× Side: <name>" stays readable */
  body:has(#status-side-btn:not([hidden])) { padding-top: 176px; } /* room for the extra chip line */
}

/* BUG-044: small fixed item icon in inline rows (queue, tools, set pieces, hides, keys). */
.inline-item-icon .game-item-icon {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
}

/* UI-A11Y-001: skip link, readable disabled buttons, WCAG 2.5.8 target sizes. */
.skip-link { position: absolute; left: 8px; top: -100px; z-index: 1000; padding: 10px 14px; background: var(--surface-2); color: var(--heading); border: 2px solid var(--gold); border-radius: 6px; }
.skip-link:focus { top: 8px; }
:where(button:disabled) { color: var(--muted); }
:where(input[type="checkbox"], input[type="radio"]) { min-width: 24px; min-height: 24px; }
:where(.planner-close-x) { min-width: 24px; min-height: 24px; }
:where(.resource-btn, .action-small, select, .inline-link-button) { min-height: 24px; }
@media (max-width: 480px) {
  .action-small, .resource-btn, select, summary, .npc-dismiss, .planner-close-x { min-height: 44px; }
  .planner-close-x { min-width: 44px; }
  label:has(> input[type="checkbox"]) { display: inline-flex; align-items: center; min-height: 44px; }
}
/* ONB-005: on a phone the first screen leads with the resource choice, not the
   Action Queue, and its primary controls are 44px touch targets. */
@media (max-width: 480px) {
  #queue-panel { order: 1; }
  #credit-line { order: 2; }
  .news-badge, .nav-feedback-btn, #skill-task-btn, #skill-task-autofetch-btn, #skill-task-crate-btn, [id*="-mode-"][id$="-btn"],
  #resource-search, .recipe-qty-toggle-btn, .recipe-make1-btn, .resource-goal-claim, .inline-link-button,
  #queue-add-count, #queue-add-btn, #queue-add-task-btn, #queue-expand-btn { min-height: 44px; }
}
/* UX-MOBILE-002: first resource card above the fold on a phone (375x812).
   Trim chrome above it; every control stays >= 44px. */
@media (max-width: 480px) {
  #main-content > h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #panel-activity, #resource-panel { padding: 10px 12px; margin-bottom: 10px; }
  .skip-link { min-height: 44px; display: inline-flex; align-items: center; }
  #skill-flavor-text, #resource-next-unlock, #skill-task-summary, #did-you-know-next { display: none; }
  #active-skill-title { margin-bottom: 6px; }
  #resource-list-title { margin-bottom: 4px; }
  #resource-next-goal.starter-step, #combat-starter-step.starter-step { padding: 4px 8px; margin-bottom: 4px; }
  #resource-search { margin-bottom: 4px; }
  .activity-layer-progress { margin-bottom: 4px; }
  .activity-layer-disclosure { margin-top: 0; }
  .did-you-know { line-height: 1.3; } .did-you-know p { line-height: 1.3; }
  #panel-activity { margin-bottom: 8px; }
  #panel-activity, #resource-panel { padding: 8px 12px; }
  #active-skill-title, #resource-list-title { font-size: 17px; line-height: 1.2; }
  .did-you-know { margin-bottom: 4px; }
  .activity-layer-progress { margin-top: 0; }
  .did-you-know { flex-wrap: nowrap; margin: 0 0 8px; }
  .did-you-know p { flex-basis: auto; font-size: 12px; }
  .did-you-know .action { padding: 2px 8px; }
  #resource-panel > .u-row-between-wrap { flex-wrap: nowrap !important; gap: 0 8px !important; margin-bottom: 4px !important; }
  #resource-panel > .u-row-between-wrap > label:first-child { flex: 1; min-width: 0; }
  #resource-sort-select { width: 120px; }
  #resource-next-goal.starter-step, #combat-starter-step.starter-step { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; justify-content: space-between; }
  #resource-next-goal.starter-step .resource-info-icon, #combat-starter-step.starter-step .resource-info-icon { display: none; }
}

/* Fixed topbar (+ alpha banner) must not cover elements scrolled into view (scrollIntoView, in-page jumps). */
html { scroll-padding-top: 96px; }
@media (max-width: 1023px) { html { scroll-padding-top: 190px; } }
@media (max-width: 539px) { html { scroll-padding-top: 230px; } }

.loom-skills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; width: 100%; }
.loom-skill-fold > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
/* UX-TALENTS-UNIFY-001: one balance line, three tabs (Talents, Shop, Mastery) at every width, one tile style. */
.prestige-balance { margin: 0 0 var(--space-sm); font-size: 15px; }
.prestige-balance strong { color: var(--heading); font-size: 17px; }
.talent-main-tabs { display: flex; gap: var(--space-sm); margin-bottom: var(--space-md); }
.talent-main-tabs .talent-tab {
  flex: 1 1 0; min-height: 44px; padding: var(--space-sm) 10px;
  border: 1px solid var(--wood); border-radius: var(--radius-md);
  background: var(--parchment); color: var(--text); font: inherit; font-size: 14px; cursor: pointer;
}
.talent-main-tabs .talent-tab[aria-selected="true"] { background: var(--wood); color: var(--heading); font-weight: bold; }
.talent-main-tabs .talent-tab.has-affordable::after {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 6px;
  border-radius: 50%; background: var(--gold); vertical-align: middle;
}
.talent-shop-heading { margin: var(--space-md) 0 var(--space-sm); color: var(--heading); font-size: 14px; }
.loom-skill.active { outline: 2px solid var(--accent, #c9a227); }
/* UX-TOPBAR-PHONE-001 (U-1): one compact phone bar. Skip wait, Time bank, the skill picker,
   What's new and Feedback sit behind "More"; the alpha notice is one short line. */
.status-more-btn { display: none; flex: none; padding: 4px 10px; border: 1px solid var(--gold-light); border-radius: 4px; background: none; color: var(--gold-light); font: inherit; font-size: 0.85em; cursor: pointer; }
.status-more-btn:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }
.alpha-short { display: none; }
.queue-status-chip.chip-off-page { display: none !important; }
.queue-status-chip.blocked:not(.chip-off-page) { color: var(--red); }
@media (max-width: 480px) {
  .status-more-btn { display: inline-block; min-height: 44px; }
  .alpha-long { display: none; }
  .alpha-short { display: inline; }
  body:not(.status-more-open) #active-skip-btn,
  body:not(.status-more-open) #use-bank-btn.bank-empty,
  body:not(.status-more-open) .status-nav-row #skill-jump,
  body:not(.status-more-open) .status-nav-row .news-badge,
  body:not(.status-more-open) .status-nav-row .nav-feedback-btn { display: none; }
  .status-nav-row { flex-wrap: wrap; }
  .status-nav-row #page-jump { min-height: 44px; }
  /* TOPBAR-002: Time bank is one chip in the first row, only while the bank holds time; Skip wait waits behind More. */
  body:not(.status-more-open) .status-activity-actions:not(.panel-hidden) { display: contents; }
  body:not(.status-more-open) #use-bank-btn { flex: 0 0 auto; order: 0; font-size: 12px; }
  .status-bar { padding-block: 2px; }
  .status-nav-row { margin-top: 0; padding-top: 0; }
}

.resource-locked-more-btn { min-height: 44px; margin: 6px 0; }

/* UX-RIGHT-RAIL-001: on a wide screen the right of the page is a second column.
   Skilling: #queue-panel (same node) sticks there. Inventory: the panel spans
   both columns so its existing detail aside sits in the right column. Below
   1440px nothing changes. */
@media (min-width: 1440px) {
  .game { display: grid; grid-template-columns: minmax(0, 1100px) 380px; column-gap: 16px; row-gap: 0; max-width: 1496px; align-content: start; }
  .game > * { grid-column: 1; }
  .game > .right-rail { display: flex; flex-direction: column; gap: 10px; grid-column: 2; grid-row: 1 / span 40; align-self: start; position: sticky; top: 68px; max-height: calc(100vh - 84px); overflow-y: auto; }
  .right-rail > .panel { margin: 0; }
  .game > #panel-inventory { grid-column: 1 / -1; }
  #panel-inventory .inventory-layout { grid-template-columns: minmax(0, 1100px) 380px; }
  #panel-inventory .inventory-detail-close { display: none; }
}

/* AFFIX-008b: stat breakdown, one-line picker cards, item comparison, phone bottom sheet. */
.equipment-stat-btn { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; min-height: 32px; text-decoration: underline dotted; text-underline-offset: 3px; }
.equipment-stat-btn[aria-expanded="true"] { color: var(--gold-light); }
.equipment-stat-detail { margin: 0 0 10px; padding: 6px 0; border-top: 1px solid var(--border, rgba(255, 255, 255, 0.12)); font-size: 13px; font-variant-numeric: tabular-nums; }
.equipment-stat-detail[hidden] { display: none; }
.equipment-stat-detail p { margin: 0 0 4px; }
.equipment-stat-source { display: flex; justify-content: space-between; gap: 8px; }
.equipment-stat-source.total { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border, rgba(255, 255, 255, 0.12)); color: var(--heading); }
.equipment-picker .weapon-list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.equipment-picker .weapon-list > .resource-btn { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; white-space: nowrap; overflow: hidden; min-height: 40px; }
.equipment-picker .weapon-list > .resource-btn > * { flex: none; }
.equipment-picker .weapon-list > .resource-btn > .picker-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.equipment-picker .weapon-list > .resource-btn .equipment-verdict,
.equipment-picker .weapon-list > .resource-btn .equipment-equipped-label { display: inline; width: auto; margin: 0; }
.equipment-picker .weapon-list > .resource-btn .equip-req:not(.unmet) { display: none; }
.equipment-picker .weapon-list > .resource-btn .equip-req { font-size: 11px; }
.equipment-picker .weapon-list > [hidden] { display: none; }
.equipment-picker .weapon-list > .compare-selected { outline: 2px solid var(--gold-light); outline-offset: -2px; }
.equipment-worse-toggle { margin-top: 6px; min-height: 40px; }
.equipment-compare { margin: 0 0 10px; padding: 10px 12px; background: var(--parchment-dark, var(--parchment)); border: 1px solid var(--wood); border-radius: 6px; }
.equipment-compare[hidden] { display: none; }
.equipment-compare-title { margin: 0 0 6px; font-size: var(--font-size-md); overflow-wrap: anywhere; }
.equipment-compare-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.equipment-compare-sub { margin: 8px 0 2px; font-size: 12px; color: var(--muted); }
.equipment-compare-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.equipment-compare-actions .action, .equipment-compare-actions .action-small { min-height: 44px; }
#equipment-picker-close { display: none; }
@media (max-width: 899px) {
  .equipment-picker:not(.panel-hidden) { position: fixed; left: 0; right: 0; bottom: 0; z-index: 120; max-height: 60vh; overflow-y: auto; box-sizing: border-box; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--parchment); border-top: 1px solid var(--wood); border-radius: 10px 10px 0 0; box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.3); }
  .equipment-picker:not(.panel-hidden) h3 { margin-top: 0; }
  #equipment-picker-close { display: block; min-width: 44px; min-height: 44px; margin: 0 0 6px auto; }
  .equipment-picker .weapon-list { grid-template-columns: minmax(0, 1fr); }
  #equipment-panel:has(.equipment-picker:not(.panel-hidden)) { padding-bottom: 60vh; }
}

/* AFFIX-006b: Spellsmithing workshop */
.workshop-card { margin-bottom: 12px; }
.workshop-title { font-weight: bold; color: var(--heading); }
.workshop-ladder { font-size: 12px; margin: 4px 0; }
.workshop-tier.open { color: #a8d7a0; }
.workshop-tier.shut { color: #8a8f98; }
.workshop-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.workshop-gear { width: 100%; max-width: 100%; margin-bottom: 8px; }
.workshop-affixes { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.workshop-affix { background: #1b212a; border: 1px solid #3a4452; border-radius: 6px; padding: 6px 8px; }
.workshop-affix-head { display: flex; justify-content: space-between; gap: 8px; }
.workshop-bar { height: 6px; background: #0e1217; border-radius: 3px; margin: 4px 0 6px; overflow: hidden; }
.workshop-bar-fill { height: 100%; background: #e5b873; }
.workshop-short { color: #ff6b6b; }
.workshop-reroll-one, .workshop-reroll-all { min-height: 40px; max-width: 100%; white-space: normal; }
.workshop-result { margin-top: 8px; padding: 6px 8px; border: 1px solid #6d9b6a; border-radius: 6px; font-size: 13px; }

/* UX-PHONE-HEIGHT-001: compact resource rows and Township tabs as one scrolling row at phone width. */
@media (max-width: 480px) {
  #resource-list .resource-card { padding: 8px; gap: 2px 6px; }
  #resource-list .resource-card > .resource-details { flex: 1 1 40%; }
  #resource-list .resource-card > .resource-details[open] { flex-basis: 100%; }
  #resource-list .resource-card > .recipe-qty-toggle-btn { flex: 1 1 40%; }
  #resource-list .resource-card > .resource-btn { padding-block: 4px; }
  #resource-list .resource-card > .rune-reserve-label { flex: 0 0 auto; font-size: 11px; }
  #resource-list .resource-card > .rune-target-btn { flex: 1 1 0; min-width: 0; padding-inline: 2px; }
  /* UX-TOWN-TABS-PHONE-001: four tabs as a 2x2 grid, no sideways scrolling. */
  #town-tabs { grid-template-columns: repeat(2, 1fr); }
  #town-tabs > .combat-view-tab { min-height: 44px; }
  details.inventory-group { margin-bottom: var(--space-sm); }
  details.inventory-group > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
  details.inventory-group > summary h3 { margin: 0; }
  .market-group-fold > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--heading); font-size: 12px; }
}

.skinning-hide-table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
.skinning-hide-table th, .skinning-hide-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--border, #3a3a3a); }
.skinning-uses-short { display: none; }
@media (max-width: 480px) {
  .skinning-hide-table, .skinning-hide-table tbody { display: block; }
  .skinning-hide-table thead { display: none; }
  .skinning-hide-table tr { display: flex; flex-wrap: wrap; gap: 2px 10px; padding: 6px 0; border-bottom: 1px solid var(--border, #3a3a3a); }
  .skinning-hide-table td { border: 0; padding: 0; min-width: 0; }
  .skinning-hide-table td:first-child { flex: 1 1 100%; font-weight: 600; }
  .skinning-hide-table td[data-label]::before { content: attr(data-label) ": "; opacity: 0.7; }
  .skinning-hide-table td.skinning-uses { flex: 1 1 100%; }
  .skinning-uses-full:not(:only-child) { display: none; }
  .skinning-uses-short { display: inline; }
}

/* Utility classes replacing inline style="" (SEC-HARDEN-002); same declarations, !important keeps inline precedence. */
.u-noscript-msg { padding: 24px !important; text-align: center !important; color: #e8dcc0 !important; background: #151a21 !important; }
.u-sprite-hidden { position: absolute !important; width: 0 !important; height: 0 !important; }
.u-mb-8px { margin-bottom: 8px !important; }
.u-mb-10px { margin-bottom: 10px !important; }
.u-mt-4px { margin-top: 4px !important; }
.u-mb-12px { margin-bottom: 12px !important; }
.u-row-between-wrap { display: flex; align-items: center !important; justify-content: space-between !important; flex-wrap: wrap !important; gap: 8px !important; margin-bottom: 8px !important;}
.u-inline-check-pointer { display: flex; align-items: center !important; gap: 6px !important; cursor: pointer !important; margin: 0 !important;}
.u-inline-check { display: flex; align-items: center !important; gap: 6px !important; margin: 0 !important;}
.u-mt-18px { margin-top: 18px !important; }
.u-row-wrap-gap8 { display: flex; gap: 8px !important; flex-wrap: wrap !important; margin-bottom: 8px !important;}
.u-block-btn-44 { display: block; min-height: 44px !important; margin-bottom: 10px !important;}
.u-mt-6px-mb-12px { margin-top: 6px !important; margin-bottom: 12px !important; }
.u-mb-6px { margin-bottom: 6px !important; }
.u-m-4px-0-6px { margin: 4px 0 6px !important; }
.u-m-6px-0 { margin: 6px 0 !important; }
.u-w-80px-m-0-6px-6px-0 { width: 80px !important; margin: 0 6px 6px 0 !important; }
.u-mt-0 { margin-top: 0 !important; }
.u-mb-4px { margin-bottom: 4px !important; }
.u-m-0 { margin: 0 !important; }
.u-mt-10px { margin-top: 10px !important; }
.u-mt-8px { margin-top: 8px !important; }
.u-mb-18px { margin-bottom: 18px !important; }
.u-mt-14px { margin-top: 14px !important; }
.u-mt-10px-mb-12px { margin-top: 10px !important; margin-bottom: 12px !important; }
.u-summary-heading { cursor: pointer !important; font-weight: bold !important; font-size: 13px !important; color: var(--heading) !important; }
.u-m-8px-0-10px { margin: 8px 0 10px !important; }
.u-mb-10px-ws-pre-line { margin-bottom: 10px !important; white-space: pre-line !important; }
.u-mt-0-mb-4px { margin-top: 0 !important; margin-bottom: 4px !important; }
.u-mb-16px { margin-bottom: 16px !important; }
.u-mt-6px { margin-top: 6px !important; }
.u-d-none { display: none;}
.u-ws-pre-line { white-space: pre-line !important; }
.u-credit-line { text-align: center !important; margin-top: 20px !important; opacity: 0.7 !important; }
.u-row-between-center { display: flex; justify-content: space-between !important; align-items: center !important; margin-bottom: 8px !important;}
.u-mt-14px-jc-flex-end { margin-top: 14px !important; justify-content: flex-end !important; }
.inline-icon-current { --c: currentColor; }
.footer-note-tight { margin-top: 2px; margin-bottom: 8px; }

/* UX-POLISH-006-A: one card per Challenges mode. */
.challenge-card { background: var(--parchment); padding: 10px 12px; margin-bottom: 12px; }
.challenge-card h3 { margin-top: 0; }
.challenge-card .action.primary { border-color: var(--color-active); background: var(--color-active); color: var(--on-accent); font-weight: bold; }
.challenge-card .action.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--color-active) 85%, #fff); }

/* EXPL-UI-001-A: Expedition panel (inside the Exploration view); no inline styles. */
.expedition-panel { margin-bottom: 18px; }
.expedition-grid { display: grid; gap: 12px; }
.expedition-form { display: flex; flex-direction: column; gap: 8px; }
.expedition-form select { width: 100%; min-height: 44px; }
.expedition-btn { min-height: 44px; min-width: 44px; }
#expedition-progress { width: 100%; height: 14px; }
@media (min-width: 1024px) {
  .expedition-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* RAIL-SESSION-001: session summary lives in the right rail (>=1440px only). */
.right-rail { display: contents; }
.session-summary { display: none; }
@media (min-width: 1440px) {
  .right-rail { display: flex; }
  .session-summary:not([hidden]) { display: block; }
}
.session-summary-head { display: flex; align-items: center; gap: 6px; }
.session-summary-head h2 { flex: 1 1 auto; margin: 0; }
.session-summary-head .action-small { min-height: 44px; min-width: 44px; }
.session-summary-line { margin: 2px 0; font-variant-numeric: tabular-nums; }

/* RAIL-TOAST-002: at >=1440px toasts sit at the top of the right rail instead of over the page. */
@media (min-width: 1440px) {
  #toast-container { position: relative; bottom: auto; left: auto; right: auto; z-index: auto; max-width: none; flex-direction: column; align-items: stretch; }
  #toast-container:not(:has(.toast, .status-activity-delta-visible)) { margin-bottom: -10px; } /* no empty gap in the rail */
  .status-activity-delta { order: 0; left: 0; right: auto; }
  .toast { text-align: left; }
  #toast-container .toast { pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; transform: none; }
}
