/* ============================================================
   TERMINAL — Design System (system.css)
   Bloomberg Terminal + Dieter Rams + NASA Mission Control
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Surface palette */
  --bg-root:       #0a0a0a;
  --bg-surface:    #111111;
  --bg-raised:     #1a1a1a;
  --bg-overlay:    #222222;

  /* Text palette */
  --text-primary:  #e0e0e0;
  --text-secondary:#888888;
  --text-muted:    #555555;
  --text-inverse:  #0a0a0a;

  /* Borders */
  --border-subtle: #1e1e1e;
  --border-default:#2a2a2a;
  --border-strong: #444444;

  /* Element accents (set via data-element attribute) */
  --accent:        #e0e0e0;
  --accent-dim:    rgba(224, 224, 224, 0.15);

  /* Element colors */
  --solar:     #f2a93b;
  --arc:       #7dbde8;
  --void:      #b388eb;
  --strand:    #4ae88d;
  --stasis:    #4dc4e8;
  --prismatic: #e25fb5;

  /* Status */
  --success: #4ae88d;
  --warning: #f2a93b;
  --error:   #e85454;
  --info:    #7dbde8;

  /* Typography */
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', monospace;
  --font-size-xs:   0.6875rem;  /* 11px */
  --font-size-sm:   0.75rem;    /* 12px */
  --font-size-base: 0.8125rem;  /* 13px */
  --font-size-md:   0.875rem;   /* 14px */
  --font-size-lg:   1rem;       /* 16px */
  --font-size-xl:   1.25rem;    /* 20px */
  --font-size-2xl:  1.5rem;     /* 24px */
  --font-size-3xl:  2rem;       /* 32px */

  /* Spacing scale (4px base) */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */

  /* Radii */
  --radius-none: 0;
  --radius-sm:   2px;
  --radius-md:   4px;
  --radius-lg:   6px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;

  /* Ambient bottom status line */
  --status-line-height: 28px;
}

/* --- Element Accent Theming --- */
[data-element="solar"]  { --accent: var(--solar);  --accent-dim: rgba(242, 169, 59, 0.15); }
[data-element="arc"]    { --accent: var(--arc);    --accent-dim: rgba(125, 189, 232, 0.15); }
[data-element="void"]   { --accent: var(--void);   --accent-dim: rgba(179, 136, 235, 0.15); }
[data-element="strand"] { --accent: var(--strand); --accent-dim: rgba(74, 232, 141, 0.15); }
[data-element="stasis"] { --accent: var(--stasis); --accent-dim: rgba(77, 196, 232, 0.15); }
[data-element="prismatic"] { --accent: var(--prismatic); --accent-dim: rgba(226, 95, 181, 0.15); }

/* --- Global --- */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-mono);
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-root);
  min-height: 100vh;
  /* Reserve room for the fixed ambient status line (see .status-line) so page
     content is never hidden behind it. */
  padding-bottom: var(--status-line-height);
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* --- Typography --- */
.t-xs   { font-size: var(--font-size-xs); }
.t-sm   { font-size: var(--font-size-sm); }
.t-base { font-size: var(--font-size-base); }
.t-md   { font-size: var(--font-size-md); }
.t-lg   { font-size: var(--font-size-lg); }
.t-xl   { font-size: var(--font-size-xl); }
.t-2xl  { font-size: var(--font-size-2xl); }
.t-3xl  { font-size: var(--font-size-3xl); }

.t-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.t-accent { color: var(--accent); }
.t-muted  { color: var(--text-muted); }
.t-secondary { color: var(--text-secondary); }
.t-success { color: var(--success); }
.t-warning { color: var(--warning); }
.t-error   { color: var(--error); }

/* --- Layout --- */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.stack {
  display: flex;
  flex-direction: column;
}
.stack > * + * {
  margin-top: var(--space-4);
}
.stack-sm > * + * { margin-top: var(--space-2); }
.stack-lg > * + * { margin-top: var(--space-6); }

/* Debug panels — hidden until debug mode (backtick) is toggled on */
/* "Other active missions" — collapsible non-campaign quest section on the
   Campaign page (below the campaign track). */
.other-missions {
  margin-top: var(--space-5);
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  padding-top: var(--space-3);
}
.other-missions > summary {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
.other-missions__row {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.06));
}
.other-missions__row:last-child { border-bottom: none; }

.debug-panel { display: none; margin-top: var(--space-4); }
body.debug-mode .debug-panel { display: block; }
.debug-panel > summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  user-select: none;
}
.debug-json {
  max-height: 380px;
  overflow: auto;
  margin: var(--space-2) 0 0;
  padding: var(--space-3);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.6875rem;
  line-height: 1.5;
  white-space: pre;
  color: var(--text-secondary);
}

/* How to Play — numbered, scannable gameplay steps */
.how-to-play {
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: htp;
}
.how-to-play > li {
  position: relative;
  counter-increment: htp;
  padding-left: var(--space-6);
  line-height: 1.6;
}
.how-to-play > li + li { margin-top: var(--space-3); }
.how-to-play > li::before {
  content: counter(htp);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
}

.row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.grid-activities {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

@media (max-width: 640px) {
  .grid-activities {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Surfaces --- */
.surface {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.surface-raised {
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.surface-accent {
  background: var(--bg-surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
}

/* --- Card --- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

/* Build flavor switcher — curated playstyle leans (Optimal / Gunplay / Ability). */
.flavor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.flavor-tab {
  font-family: inherit;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.flavor-tab:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

.flavor-tab.is-active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.flavor-panel {
  display: none;
}

.flavor-panel.is-active {
  display: block;
}

.flavor-angle {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  line-height: 1.4;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-4);
}

.card-header__type {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
}

.card-header__name {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Suggested Build Name --- */
/* A short, human-readable name for the recommendation, shown as a title above
   the WEAPONS section. Accent-themed by the subclass element, monospace, with a
   leading marker to read like a terminal label. Computed at the display layer. */
.build-name {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
  padding-left: var(--space-3);
  border-left: 3px solid var(--accent);
  line-height: 1.3;
}
.build-name::before {
  content: "▸ ";
  color: var(--accent);
}

/* --- Weapon Row --- */
.weapon-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
}
/* Clickable vault rows with an expandable encyclopedic detail panel. */
.weapon-row--clickable { cursor: pointer; }
.weapon-row--clickable:hover { background: var(--bg-raised); }
.weapon-row__chev {
  font-size: 0.6rem;
  color: var(--text-muted);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  margin-left: var(--space-1);
}
.weapon-row-wrap.is-open .weapon-row__chev { transform: rotate(180deg); }
.item-detail-slot { display: none; }
.weapon-row-wrap.is-open .item-detail-slot,
.cull-row-wrap.is-open .item-detail-slot { display: block; }
/* Slick expand: fade + slight rise when the detail panel reveals. */
.weapon-row-wrap.is-open .item-detail-slot,
.cull-row-wrap.is-open .item-detail-slot { animation: detailReveal 0.16s var(--ease-out); }
@keyframes detailReveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
/* Loading affordance: the chevron spins while the lazy detail is in flight, so
   the click feels instant even before the panel arrives. */
.weapon-row--clickable.htmx-request .weapon-row__chev,
.cull-row__lead.htmx-request .cull-row__chev {
  animation: spin 0.6s linear infinite;
  color: var(--accent, var(--arc));
}
.item-detail {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3) 0 var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}
.item-detail__icon { width: 64px; height: 64px; flex-shrink: 0; }
.item-detail__body { min-width: 0; flex: 1 1 auto; }
.item-detail__head { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.item-detail__title { font-size: var(--font-size-sm); font-weight: 700; }
.item-detail__sub { font-size: 0.625rem; color: var(--text-muted); text-transform: capitalize; margin-top: 2px; }
.item-detail__verdict {
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
}
.item-detail__verdict--god { color: var(--strand); border-color: var(--strand); }
.item-detail__verdict--recommended { color: var(--arc); border-color: var(--arc); }
.item-detail__verdict--offmeta { color: var(--text-muted); }
.item-detail__verdict--exotic { color: var(--warning); border-color: var(--warning); }
.item-detail__tier { color: var(--text-primary); font-weight: 700; }
.item-detail__quality { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.item-detail__qscore { font-size: 0.6875rem; font-weight: 700; }
.item-detail__qgrade { font-size: 0.5rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 1px 5px; border-radius: var(--radius-sm); border: 1px solid var(--border-default); color: var(--text-secondary); }
.item-detail__qgrade--keeper { color: var(--strand); border-color: var(--strand); }
.item-detail__qgrade--exotic { color: var(--warning); border-color: var(--warning); }
.item-detail__qgrade--low { color: var(--text-muted); }
.item-detail__note { font-size: 0.625rem; color: var(--text-secondary); margin-top: var(--space-2); }
.item-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: 0.5625rem;
  color: var(--text-muted);
  margin-top: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.item-detail__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: var(--space-1) var(--space-3);
  margin-top: var(--space-2);
}
.item-detail__stat { display: flex; justify-content: space-between; gap: var(--space-2); font-size: 0.625rem; }
.item-detail__stat-name { color: var(--text-muted); }
.item-detail__stat-val { color: var(--text-secondary); font-weight: 600; }
.item-detail__stat--total .item-detail__stat-name,
.item-detail__stat--total .item-detail__stat-val { color: var(--text-primary); font-weight: 700; }

.weapon-row:last-child {
  border-bottom: none;
}

.weapon-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.weapon-icon__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.weapon-icon--exotic {
  border-color: var(--warning);
}

.weapon-info {
  flex: 1;
  min-width: 0;
}

.weapon-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.weapon-slot {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --- Stat Bars --- */
.stat-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 24px;
}

.stat-bar__label {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: 80px;
  flex-shrink: 0;
}

.stat-bar__track {
  position: relative;
  flex: 1;
  height: 4px;
  background: var(--bg-raised);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* Armor 3.0: the track spans 0–200, so the 100-point base cap sits at 50%.
   A faint tick marks the boundary above which a stat is overcharged (101–200). */
.stat-bar__track--basecap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--border-subtle);
  pointer-events: none;
}

.stat-bar__fill {
  height: 100%;
  background: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: width var(--duration-base) var(--ease-out);
}

.stat-bar__fill--max {
  background: var(--success);
}

/* Overcharged stat (101–200): distinct accent so the over-base portion reads
   as a bonus, not a maxed base stat. */
.stat-bar__fill--overcharge {
  background: var(--accent, var(--success));
}

.stat-bar__value {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

.stat-bar__value--max {
  color: var(--success);
  font-weight: 600;
}

.stat-bar__value--overcharge {
  color: var(--accent, var(--success));
  font-weight: 600;
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-raised);
  color: var(--text-secondary);
}

.badge--covered {
  border-color: var(--success);
  color: var(--success);
}

.badge--gap {
  border-color: var(--warning);
  color: var(--warning);
}

.badge--info {
  border-color: var(--info);
  color: var(--info);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* --- Buttons --- */
.btn {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--accent-dim);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-default);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* --- Activity Tile --- */
.activity-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-4) var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  text-align: center;
  min-height: 80px;
}

.activity-tile:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.activity-tile__label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--text-primary);
}

.activity-tile--active {
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* --- Nav --- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.nav__wordmark {
  font-size: var(--font-size-lg);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.nav__status {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Nav links (primary items: OPTIMIZE, VAULT) */
.nav__link {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  transition: color var(--duration-fast) var(--ease-out);
}

.nav__link:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.nav__link--active {
  color: var(--text-primary);
}

/* MANAGE dropdown */
.nav__dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav__dropdown-toggle {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  transition: color var(--duration-fast) var(--ease-out);
}

.nav__dropdown-toggle:hover,
.nav__dropdown:focus-within .nav__dropdown-toggle {
  color: var(--text-primary);
}

.nav__dropdown-toggle--active {
  color: var(--text-primary);
}

.nav__dropdown-arrow {
  font-size: 0.5rem;
  opacity: 0.6;
  transition: transform var(--duration-fast) var(--ease-out);
}

.nav__dropdown:focus-within .nav__dropdown-arrow,
.nav__dropdown:hover .nav__dropdown-arrow {
  transform: rotate(180deg);
}

.nav__dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 140px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-1) 0;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

/* CSS-driven open via focus-within; JS adds .nav__dropdown--open for click/keyboard */
.nav__dropdown:focus-within .nav__dropdown-menu,
.nav__dropdown--open .nav__dropdown-menu {
  display: block;
}

.nav__dropdown-item {
  display: block;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--space-2) var(--space-4);
  transition: color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.nav__dropdown-item:hover {
  color: var(--text-primary);
  background: var(--bg-raised);
  text-decoration: none;
}

.nav__dropdown-item--active {
  color: var(--text-primary);
}

/* Global character switcher — persistent Guardian picker in the nav. */
.char-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.char-chip {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: var(--space-1) var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}

.char-chip:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

.char-chip__arrow {
  font-size: 0.5rem;
  opacity: 0.6;
  transition: transform var(--duration-fast) var(--ease-out);
}

.char-switch--open .char-chip__arrow {
  transform: rotate(180deg);
}

.char-switch__menu {
  display: none;
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-1);
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.char-switch--open .char-switch__menu {
  display: block;
}

.char-switch__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  text-align: left;
  font-family: var(--font-mono);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  color: var(--text-secondary);
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}

button.char-switch__row:hover {
  background: var(--bg-raised);
  color: var(--text-primary);
}

.char-switch__row.is-active {
  background: var(--accent-dim);
  cursor: default;
}

.char-switch__emblem {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-subtle);
}

.char-switch__emblem--blank {
  display: inline-block;
  background: var(--bg-raised);
}

.char-switch__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.char-switch__class {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.char-switch__sub {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.char-switch__dot {
  margin: 0 var(--space-1);
}

.char-switch__marker {
  margin-left: auto;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.char-switch__empty {
  padding: var(--space-3);
  font-size: var(--font-size-xs);
}

.char-switch__detail {
  display: block;
  margin-top: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.char-switch__detail:hover {
  color: var(--accent);
}

/* Per-character detail page */
.card-detail-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
}

.card-detail-header__emblem {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-subtle);
}

.card-detail-header__meta {
  flex: 1 1 auto;
  min-width: 0;
}

.detail-inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-2);
}

.detail-inv-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.detail-inv-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
}

.detail-inv-meta {
  min-width: 0;
}

.detail-inv-meta > div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Optimize sub-nav strip */
.subnav {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-6);
}

.subnav__item {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}

.subnav__item:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.subnav__item--active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

/* --- Sync Status --- */
.sync-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sync-status__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.sync-status__dot--live {
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* --- Ambient Status Line ---
   A thin, always-visible bar pinned to the bottom of every page. Low-key by
   design: it reflects background state (link, rate budget, in-flight work,
   manifest warmth) without demanding attention. Subtle when idle; a slow pulse
   on the dot/arrow when Bungie requests are in flight. */
.status-line {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--status-line-height);
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 var(--space-3);
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.status-line__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: var(--space-2);
  background: var(--text-muted); /* idle/unlinked */
}

.status-line__dot--live {
  background: var(--success);
}

/* When work is in flight, the dot breathes slowly — calm, not flashy. */
.status-line__dot--busy {
  background: var(--accent);
  animation: status-pulse 1.8s ease-in-out infinite;
}

.status-line__label {
  text-transform: uppercase;
  color: var(--text-secondary);
}

.status-line__label--idle {
  color: var(--text-muted);
}

.status-line__seg {
  color: var(--text-muted);
}

.status-line__seg--active {
  color: var(--accent);
}

.status-line__key {
  text-transform: uppercase;
  color: var(--text-muted);
}

.status-line__val {
  color: var(--text-secondary);
}

/* Rate budget running low — gentle warning tint, no alarm. */
.status-line__val--low {
  color: var(--warning);
}

.status-line__sep {
  color: var(--border-strong);
}

/* The in-flight segment shares the busy pulse so motion reads as "active". */
.status-line__inflight {
  color: var(--accent);
  text-transform: uppercase;
  animation: status-pulse 1.8s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* Respect reduced-motion: drop the pulse, keep the color cue. */
@media (prefers-reduced-motion: reduce) {
  .status-line__dot--busy,
  .status-line__inflight {
    animation: none;
  }
}

/* The status line doubles as the SYSTEM MONITOR toggle. The bar lays out its
   live content on the left and a chevron "handle" on the right. */
.status-line {
  cursor: pointer;
  gap: var(--space-2);
  transition: background var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}
.status-line__content {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.status-line:hover,
.status-line:focus-visible {
  background: var(--bg-raised);
  border-top-color: var(--border-default);
  outline: none;
}
.status-line__handle {
  flex-shrink: 0;
  margin-left: auto;
  padding: 0 var(--space-1);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  line-height: 1;
  transition: transform var(--duration-base) var(--ease-out), color var(--duration-fast);
}
/* Deployed-build chip — pinned to the right edge, just left of the handle.
   Shows which release is live; links to the commit when known. */
.status-line__build {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4ch;
  padding: 0 var(--space-2);
  color: var(--text-muted);
  text-decoration: none;
  border-left: 1px solid var(--border-subtle);
  transition: color var(--duration-fast);
}
a.status-line__build:hover {
  color: var(--text-primary);
}
.status-line:hover .status-line__handle { color: var(--text-secondary); }
/* Chevron flips to point down when the panel is open. */
body.sysmon-open .status-line__handle {
  transform: rotate(180deg);
  color: var(--accent);
}

/* ============================================================
   SYSTEM MONITOR — the expanded "machine is alive" overlay.
   Cracked-open htop view that slides up from the status line.
   Hidden unless body.sysmon-open. Monospace, caps, glowing
   accents on live elements, animated fill bars, a faint CRT
   scanline wash. Premium, not gaudy — reuses design tokens only.
   ============================================================ */
.sysmon {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--status-line-height);
  z-index: 49; /* just under the status line so the bar stays clickable */
  margin: 0 auto;
  max-width: 920px;
  font-family: var(--font-mono);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  /* Soft accent glow + lift off the page. */
  box-shadow: 0 0 0 1px var(--border-subtle),
              0 -2px 24px rgba(0, 0, 0, 0.5),
              0 0 40px -8px var(--accent-dim);
  overflow: hidden;
  /* Hidden + collapsed by default; slides up + fades in when open. */
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  visibility: hidden;
  transition: opacity var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out),
              visibility 0s linear var(--duration-base);
}
body.sysmon-open .sysmon {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
  transition: opacity var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out),
              visibility 0s;
}

/* --- Activity log: a live terminal feed of every HTMX request, below the metric
   panel inside the system monitor. Ambient polls read dimmer so real
   navigations/actions pop. Client-populated by the activity-log script. --- */
.sysmon__log {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-subtle);
}
.sysmon__log-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-xs);
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}
.sysmon__log-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: term-blink 1.6s steps(2, start) infinite;
}
/* COPY button on the activity-log header — low-key terminal chip, pushed to
   the right edge of the header row. */
.sysmon__log-copy {
  margin-left: auto;
  padding: 2px var(--space-2);
  font: inherit;
  font-size: var(--font-size-xs);
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.sysmon__log-copy:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.sysmon__log-copy.is-flash {
  color: var(--success);
  border-color: var(--success);
}
.activity-log {
  max-height: 168px;
  overflow-y: auto;
  padding: 0 var(--space-4) var(--space-3);
  font-size: 0.6875rem;
  line-height: 1.7;
}
.activity-log:empty::before {
  content: "waiting for requests…";
  color: var(--text-muted);
  opacity: 0.6;
}
.activity-log__line {
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr) auto auto;
  gap: var(--space-2);
  align-items: baseline;
  white-space: nowrap;
  cursor: pointer;
}
.activity-log__line:hover { background: var(--surface-raised, rgba(255, 255, 255, 0.04)); }
.activity-log .al-caret {
  color: var(--text-muted);
  font-size: 0.625rem;
  transition: transform 0.12s ease;
  display: inline-block;
}
.activity-log__row.is-open .al-caret { transform: rotate(90deg); }
.activity-log .al-ts { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.activity-log .al-verb { color: var(--text-secondary); font-weight: 600; }
.activity-log .al-path { color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; }
.activity-log .al-status { font-variant-numeric: tabular-nums; }
.activity-log .al-ms { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.activity-log__line.is-ok .al-status { color: var(--success); }
.activity-log__line.is-warn .al-status { color: var(--warning); }
.activity-log__line.is-err .al-status { color: var(--error); }
.activity-log__line.is-poll { opacity: 0.5; }
.activity-log__line.is-poll .al-path { color: var(--text-secondary); }

/* Collapsible per-request detail panel, nested under each line. Hidden until
   the row carries .is-open (toggled by clicking the line). */
.activity-log__detail { display: none; }
.activity-log__row.is-open .activity-log__detail {
  display: block;
  margin: 2px 0 var(--space-2) calc(var(--space-2) + 0.625rem);
  padding-left: var(--space-3);
  border-left: 1px solid var(--border-subtle);
}
.activity-log .al-detail-head {
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.625rem;
  margin-top: var(--space-1);
}
.activity-log .al-kv {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  white-space: nowrap;
}
.activity-log .al-kv .al-k { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; }
.activity-log .al-kv .al-v { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.activity-log .al-kv.al-timing .al-v { color: var(--accent); }
.activity-log .al-desc { color: var(--text-muted); }
@media (prefers-reduced-motion: reduce) {
  .sysmon__log-dot { animation: none; }
}

/* Faint CRT scanline wash over the whole panel — very low opacity so it reads as
   texture, not noise. Sits above the surface, below the content. */
.sysmon__inner {
  position: relative;
  padding: var(--space-4) var(--space-5) var(--space-5);
}
.sysmon__inner::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.018) 0px,
    rgba(255, 255, 255, 0.018) 1px,
    transparent 1px,
    transparent 3px
  );
}
.sysmon__inner > * { position: relative; z-index: 1; }

/* --- Header --- */
.sysmon__header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}
.sysmon__ascii {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.05;
  color: var(--accent);
  opacity: 0.85;
  text-shadow: 0 0 8px var(--accent-dim);
  white-space: pre;
}
.sysmon__header-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sysmon__title {
  font-size: var(--font-size-md);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-primary);
}
.sysmon__build {
  font-size: var(--font-size-xs);
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.sysmon__header-state {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
  font-size: var(--font-size-xs);
  letter-spacing: 0.06em;
}
.sysmon__statedot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}
.sysmon__statedot--live {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}
.sysmon__statedot--busy {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: sysmon-pulse 1.4s ease-in-out infinite;
}
.sysmon__statelabel { color: var(--text-secondary); text-transform: uppercase; }
.sysmon__statelabel--idle { color: var(--text-muted); }
.sysmon__health { text-transform: lowercase; color: var(--text-muted); }
.sysmon__health--healthy { color: var(--success); }
.sysmon__health--expiring { color: var(--warning); }
.sysmon__health--expired { color: var(--error); }

/* --- Layout grid: cache column (wide) + api/jobs column --- */
.sysmon__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-5);
}
.sysmon__col { display: flex; flex-direction: column; gap: var(--space-5); }
@media (max-width: 720px) {
  .sysmon__grid { grid-template-columns: 1fr; }
}

/* --- Block (section) chrome --- */
.sysmon__block-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.sysmon__block-label {
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
  text-transform: uppercase;
}
.sysmon__block-hint {
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.sysmon__empty {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  padding: var(--space-2) 0;
}

/* --- Manifest cache resolver rows --- */
.sysmon__rows { display: flex; flex-direction: column; gap: var(--space-3); }
.sysmon__resolver { display: flex; flex-direction: column; gap: 5px; }
.sysmon__resolver-top {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  letter-spacing: 0.04em;
}
.sysmon__resolver-name {
  color: var(--text-secondary);
  font-weight: 600;
  min-width: 96px;
}
.sysmon__resolver-count { color: var(--text-primary); }
.sysmon__resolver-unit { color: var(--text-muted); margin-left: 4px; }
.sysmon__resolver-hit { margin-left: auto; color: var(--text-secondary); }
.sysmon__resolver-hit--hot {
  color: var(--success);
  text-shadow: 0 0 6px var(--accent-dim);
}
.sysmon__resolver-hit--cold { color: var(--text-muted); }

/* Fill bar: an empty track with two tiled segments (embedded seed + live cache).
   The width transition + grow keyframe make the bar read as the cache "warming". */
.sysmon__bar {
  display: flex;
  height: 8px;
  width: 100%;
  background: var(--bg-root);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.sysmon__bar-seg {
  height: 100%;
  transform-origin: left center;
  animation: sysmon-grow var(--duration-slow) var(--ease-out);
  transition: width var(--duration-base) var(--ease-out);
}
/* Seed = embedded/frozen → solid accent. Live = resolved at runtime → a hatched
   accent-dim so the two segments are visually distinct without a new color. */
.sysmon__bar-seg--seed {
  background: var(--accent);
  box-shadow: 0 0 8px -1px var(--accent);
}
.sysmon__bar-seg--live {
  background-color: var(--accent-dim);
  background-image: repeating-linear-gradient(
    45deg,
    var(--accent) 0px,
    var(--accent) 1px,
    transparent 1px,
    transparent 5px
  );
  opacity: 0.9;
}

/* --- Bungie API block --- */
.sysmon__livedot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  margin-left: auto;
}
.sysmon__livedot--on {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: sysmon-pulse 1.2s ease-in-out infinite;
}
.sysmon__block--pulse { /* hook for future whole-block emphasis when busy */ }
.sysmon__gauge-line,
.sysmon__inflight-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: var(--font-size-xs);
  letter-spacing: 0.04em;
  margin-bottom: 5px;
}
.sysmon__inflight-line { margin-top: var(--space-3); margin-bottom: 0; }
.sysmon__gauge-label { color: var(--text-muted); text-transform: uppercase; }
.sysmon__gauge-val { color: var(--text-primary); }
.sysmon__gauge-val--low { color: var(--warning); }
.sysmon__gauge {
  height: 10px;
  width: 100%;
  background: var(--bg-root);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.sysmon__gauge-fill {
  display: block;
  height: 100%;
  background: var(--success);
  box-shadow: 0 0 8px -1px var(--success);
  animation: sysmon-grow var(--duration-slow) var(--ease-out);
  transition: width var(--duration-base) var(--ease-out),
              background var(--duration-base);
}
.sysmon__gauge[data-level="warn"] .sysmon__gauge-fill {
  background: var(--warning);
  box-shadow: 0 0 8px -1px var(--warning);
}
.sysmon__gauge[data-level="crit"] .sysmon__gauge-fill {
  background: var(--error);
  box-shadow: 0 0 8px -1px var(--error);
}
.sysmon__inflight-num {
  color: var(--accent);
  font-weight: 600;
  text-shadow: 0 0 6px var(--accent-dim);
  animation: sysmon-pulse 1.4s ease-in-out infinite;
}
.sysmon__inflight-num--idle {
  color: var(--text-muted);
  font-weight: 400;
  text-shadow: none;
  animation: none;
}

/* --- Jobs block --- */
.sysmon__jobs-idle {
  font-size: var(--font-size-xs);
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.sysmon__jobs-active {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  letter-spacing: 0.04em;
}
.sysmon__job-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: sysmon-pulse 1.4s ease-in-out infinite;
}
.sysmon__job-num {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--text-primary);
}
.sysmon__job-desc { color: var(--text-secondary); text-transform: uppercase; }

@keyframes sysmon-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@keyframes sysmon-grow {
  from { width: 0 !important; }
}

/* Reduced-motion: kill pulses, glows-as-motion, and the grow animation. The
   color + width cues remain, so the panel still reads at a glance. */
@media (prefers-reduced-motion: reduce) {
  .sysmon {
    transition: opacity var(--duration-fast) linear, visibility 0s;
    transform: none;
  }
  body.sysmon-open .sysmon { transform: none; }
  .sysmon__statedot--busy,
  .sysmon__livedot--on,
  .sysmon__inflight-num,
  .sysmon__job-dot { animation: none; }
  .sysmon__bar-seg,
  .sysmon__gauge-fill { animation: none; }
}

/* --- Rationale Panel --- */
.rationale-panel {
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-top: var(--space-3);
  font-size: var(--font-size-sm);
  line-height: 1.7;
  color: var(--text-secondary);
}

.rationale-panel__title {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

/* --- Subclass Row --- */
.subclass-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.subclass-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.subclass-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--accent);
}

.exotic-label {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

/* --- Sync Animation --- */
.sync-sweep {
  overflow: hidden;
}

.sync-sweep__line {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translateY(4px);
  animation: sweepIn var(--duration-base) var(--ease-out) forwards;
}

@keyframes sweepIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Element Swatch --- */
.element-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.element-swatch:hover,
.element-swatch--active {
  border-color: var(--text-primary);
}

.element-swatch--solar  { background: var(--solar); }
.element-swatch--arc    { background: var(--arc); }
.element-swatch--void   { background: var(--void); }
.element-swatch--strand { background: var(--strand); }
.element-swatch--stasis { background: var(--stasis); }

/* --- Utility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-6) 0;
}

.section-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-4);
}

/* --- Build Card --- */
.build-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.build-card:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.build-card__name {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.build-card__pitch {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

.build-card__meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: var(--space-2);
}

/* --- Filter Tabs --- */
.filter-tabs {
  display: flex;
  gap: var(--space-1);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-1);
}

.filter-tab {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.filter-tab:hover {
  color: var(--text-primary);
}

.filter-tab--active {
  background: var(--bg-raised);
  color: var(--text-primary);
}

/* --- Detail Grid --- */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 640px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

.detail-section {
  display: flex;
  flex-direction: column;
}

.detail-item {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-item:last-child {
  border-bottom: none;
}

/* --- Activity Build Links --- */
.activity-builds-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.activity-build-link {
  display: flex;
  flex-direction: column;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
}

.activity-build-link:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* --- Loading --- */
.loading-bar {
  height: 2px;
  background: var(--accent);
  animation: loadingSlide 1.5s var(--ease-out) infinite;
  transform-origin: left;
}

@keyframes loadingSlide {
  0%   { transform: scaleX(0); }
  50%  { transform: scaleX(0.7); }
  100% { transform: scaleX(1); opacity: 0; }
}

/* --- Terminal "grind" loader (the living-terminal loading aesthetic) ---------
   A monospace block that narrates the work the machine is grinding through: a
   blinking-cursor header over a streaming log whose "current step" sweeps down
   the list. Scanline-washed + soft accent glow. See components/shared/
   terminal_loader.templ. Reuses theme tokens only. */
.term-loader {
  position: relative;
  overflow: hidden;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border-default);
  border-left: 2px solid var(--accent);
  border-radius: 6px;
  background:
    radial-gradient(120% 140% at 0% 0%, var(--accent-dim, rgba(242,169,59,0.10)), transparent 60%),
    var(--bg-surface);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 0 24px -8px var(--accent);
  font-family: var(--font-mono);
  animation: term-loader-in 0.18s var(--ease-out) both;
}
/* A slow vertical sheen sweep — the "scanning" pass. */
.term-loader__scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 48%,
    transparent 52%
  );
  background-size: 100% 220%;
  animation: term-scan 2.6s linear infinite;
}
/* Faint CRT line texture over the whole block. */
.term-loader::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg, transparent 0 2px, rgba(255, 255, 255, 0.018) 2px 3px
  );
}
.term-loader__head {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
}
.term-loader__prompt { color: var(--accent); }
.term-loader__label {
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}
.term-loader__cursor {
  color: var(--accent);
  animation: term-blink 1s steps(2, start) infinite;
}
.term-loader__log {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}
.term-loader__line {
  display: flex;
  gap: var(--space-2);
  padding: 1px 0;
  opacity: 0.32;
  /* The "active step" sweep: each line brightens in turn, looping. Cycle length
     scales with the number of lines (--n) so every step gets an even slot, and
     each line's slot is offset by its index (--i). */
  animation: term-stream calc(var(--n, 5) * 0.82s) ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.82s);
}
.term-loader__tick { color: var(--accent); opacity: 0.7; }

@keyframes term-loader-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
@keyframes term-scan {
  from { background-position: 0 -120%; }
  to   { background-position: 0 120%; }
}
@keyframes term-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes term-stream {
  0%   { opacity: 0.32; }
  5%   { opacity: 1; color: var(--accent); }
  16%  { opacity: 0.55; color: var(--text-secondary); }
  100% { opacity: 0.32; }
}
@media (prefers-reduced-motion: reduce) {
  .term-loader,
  .term-loader__scan,
  .term-loader__cursor,
  .term-loader__line { animation: none; }
  .term-loader__line { opacity: 0.7; }
  .term-loader__cursor { opacity: 1; }
}

/* Ghost cold-load loader — JS-driven staged progress (see the ghost-loader script
   in layout.templ). Steps move pending → active → done; the elapsed counter + the
   reassurance note make a long first vault read read as "working", not "hung". */
/* Geometric sweep grid — the monochrome 5×5 hero. Cells are built + opacity-driven
   by the driver as it walks a wavefront through each pattern's per-cell order. */
.ghost-loader__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  width: 132px;
  margin: var(--space-1) auto var(--space-4);
}
.ghost-loader__gcell {
  aspect-ratio: 1;
  background: var(--accent);
  opacity: 0.14;
  border-radius: 1px;
  transition: opacity 0.11s linear;
}
@media (prefers-reduced-motion: reduce) {
  .ghost-loader__gcell { opacity: 0.4; transition: none; }
}
.ghost-loader__elapsed {
  margin-left: auto;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.ghost-loader__steps { display: grid; gap: 3px; }
.ghost-loader__step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  opacity: 0.32;
  transition: opacity 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
/* tick glyph: pending dot · active spinner · done check */
.ghost-loader__tick {
  display: inline-flex;
  justify-content: center;
  width: 10px;
  color: var(--text-muted);
}
.ghost-loader__tick::before { content: "·"; }
.ghost-loader__step.is-active {
  opacity: 1;
  color: var(--accent);
}
.ghost-loader__step.is-active .ghost-loader__tick {
  color: var(--accent);
}
.ghost-loader__step.is-active .ghost-loader__tick::before {
  content: "▸";
  animation: term-blink 1s steps(2, start) infinite;
}
.ghost-loader__step.is-done {
  opacity: 0.6;
  color: var(--text-secondary);
}
.ghost-loader__step.is-done .ghost-loader__tick {
  color: var(--success);
}
.ghost-loader__step.is-done .ghost-loader__tick::before { content: "✓"; }
.ghost-loader__note {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  line-height: 1.6;
  animation: term-loader-in 0.3s var(--ease-out) both;
}
@media (prefers-reduced-motion: reduce) {
  .ghost-loader__step.is-active .ghost-loader__tick::before { animation: none; }
  .ghost-loader__note { animation: none; }
}

/* The optimizer grind-loader is collapsed until /api/recommend is in flight.
   htmx adds .htmx-request to the hx-indicator target (#recommend-loader) for the
   duration of the request, so it appears only while the build is computing and
   is replaced by the loadout when it lands. */
.recommend-loader { display: none; margin-top: var(--space-4); }
.recommend-loader.htmx-request { display: block; }

/* --- Vault Filter Bar --- */
.vault-filter-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-root);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

/* Subtle separator rule between filter bar and list */
.vault-filter-bar + * {
  margin-top: var(--space-4);
}

/* Search input */
.vault-filter-search {
  flex: 0 0 auto;
}

.vault-search-input {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  background: var(--bg-raised);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-3);
  width: 180px;
  transition: border-color var(--duration-fast) var(--ease-out);
  /* Remove browser search chrome */
  -webkit-appearance: none;
  appearance: none;
}

.vault-search-input::placeholder {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.vault-search-input:focus {
  outline: none;
  border-color: var(--border-strong);
}

/* Cancel button in search (WebKit) */
.vault-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* Chip group */
.vault-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  border-left: 1px solid var(--border-subtle);
  padding-left: var(--space-3);
}

/* Individual chip */
.vault-chip {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-raised);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.vault-chip:hover {
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

/* Active state — generic */
.vault-chip--active {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-overlay);
}

/* Element chips use their element colour when active */
.vault-chip--element.vault-chip--active {
  color: var(--chip-accent, var(--text-primary));
  border-color: var(--chip-accent, var(--border-strong));
  background: color-mix(in srgb, var(--chip-accent, var(--border-strong)) 15%, transparent);
}

/* Clear / meta strip */
.vault-filter-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.vault-chip--clear {
  color: var(--text-secondary);
  border-color: var(--border-default);
}

/* Cull filter <select> dropdowns reuse the chip look but render native options. */
.cull-filter-select {
  appearance: none;
  -webkit-appearance: none;
  text-transform: none;
  letter-spacing: 0.04em;
  padding-right: var(--space-3);
}

.cull-filter-select:hover {
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

/* --- Pursuit chips (advisor GET: line) --- */
.pursuit-chip {
  display: inline-flex;
  align-items: center;
  font-size: var(--font-size-xs);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  padding: 1px var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-raised);
  color: var(--text-secondary);
  white-space: nowrap;
}

.pursuit-chip--exotic {
  border-color: var(--warning);
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 10%, transparent);
  font-weight: 600;
}

.pursuit-chip--sm {
  font-size: calc(var(--font-size-xs) * 0.9);
  padding: 0 var(--space-1);
}

/* --- Build-led headline (advisor top rec when #1 pursuit anchors a curated build) --- */
.build-headline {
  margin-top: var(--space-1);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--font-size-md);
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.build-headline__verb {
  color: var(--text-secondary);
  font-weight: 400;
}

.build-headline__activity {
  color: var(--text-primary);
}

.build-headline__archetype {
  color: var(--warning); /* exotic gold — same as pursuit-chip--exotic */
  font-weight: 800;
  letter-spacing: 0.08em;
}

/* Italic pitch quote under the headline */
.build-pitch {
  font-size: var(--font-size-xs);
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.6;
  border-left: 2px solid var(--warning);
  padding-left: var(--space-3);
  opacity: 0.85;
}

/* "Needs [exotic] ✦ — you don't own it" line */
.build-requirement {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------------------
 * Advisor lazy-load skeleton: rotating border spinner
 * --------------------------------------------------------------------------- */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
 * Advisor control chips: "FEELING LIKE" mood + "I'VE GOT" time-budget rows.
 * Consistent sizing, aligned label columns, comfortable spacing.
 * --------------------------------------------------------------------------- */
.advisor-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

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

/* Fixed-width label so the chip groups line up across both rows. */
.chip-row__label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  min-width: 5rem;
  flex-shrink: 0;
}

.chip {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-raised);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.chip:hover:not(.chip--active) {
  border-color: var(--accent);
  color: var(--text-primary);
}

.chip--active {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
}

/* Compact archetype tag in alternate rows: "→ THE UNKILLABLE" */
.alt-build-tag {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--warning);
  letter-spacing: 0.06em;
  margin-left: var(--space-2);
  opacity: 0.85;
}

/* ---------------------------------------------------------------------------
 * Equip progress — step-by-step build equip UI
 * --------------------------------------------------------------------------- */

/* Entrance animation for the progress panel */
@keyframes equipFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* One-shot glow pulse on the fanfare heading */
@keyframes equipGlowPulse {
  0%   { text-shadow: 0 0 0px var(--accent); }
  40%  { text-shadow: 0 0 18px var(--accent), 0 0 6px var(--accent); }
  100% { text-shadow: 0 0 0px var(--accent); }
}

.equip-progress {
  animation: equipFadeIn var(--duration-base) var(--ease-out) both;
}

/* Progress bar track + fill for the equip job */
.equip-progress-bar {
  height: 3px;
  background: var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: var(--space-3);
}

.equip-progress-bar__fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-md);
  transition: width var(--duration-base) var(--ease-out);
}

/* Step checklist rows */
.equip-step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-1) 0;
}

.equip-step__icon {
  flex-shrink: 0;
  width: 14px;
  text-align: center;
  line-height: 1.4;
}

/* Sub-result rows (per-plug under sockets step) */
.equip-sub {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-left: var(--space-5);
  padding-top: 2px;
}

.equip-sub__icon {
  flex-shrink: 0;
  width: 10px;
  text-align: center;
}

/* Fanfare — BUILD EQUIPPED panel */
.equip-fanfare {
  animation: equipFadeIn var(--duration-slow) var(--ease-out) both;
}

.equip-fanfare__heading {
  font-size: var(--font-size-xl);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  animation: equipGlowPulse 1.2s var(--ease-out) 0.1s both;
}

/* Inline spinner sized for step rows (inherits .spinner keyframes) */
.equip-step-spinner {
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--border-default);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
  display: inline-block;
}

/* ---------------------------------------------------------------------------
 * Item hover tooltip (wishlist verdict + role + synergy). Positioned by JS.
 * --------------------------------------------------------------------------- */
.item-tt {
  position: absolute;
  z-index: 1000;
  max-width: 280px;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  font-size: var(--font-size-xs);
  line-height: 1.5;
}
.item-tt[hidden] { display: none; }
.item-tt__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}
.item-tt__title { font-weight: 600; color: var(--text-primary); }
.item-tt__verdict {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 1px var(--space-1);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.item-tt__verdict--god    { background: var(--strand); color: var(--text-inverse); }
.item-tt__verdict--rec    { color: var(--strand); border: 1px solid var(--strand); }
.item-tt__verdict--off    { color: var(--text-muted); border: 1px solid var(--border-default); }
.item-tt__verdict--exotic { color: var(--solar); border: 1px solid var(--solar); }
.item-tt__sub  { color: var(--text-secondary); margin-bottom: var(--space-2); }
.item-tt__note { color: var(--text-primary); }
.item-tt__tags { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-2); }
.item-tt__tag {
  font-size: 0.625rem;
  color: var(--text-secondary);
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-1);
}
[data-tt] { cursor: help; }

/* ---------------------------------------------------------------------------
 * Cull Mode — build-aware vault triage.
 * --------------------------------------------------------------------------- */
.cull-summary {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.cull-stat {
  flex: 1;
  min-width: 110px;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
}
.cull-stat__value { font-size: var(--font-size-xl); font-weight: 700; }
.cull-stat__label { font-size: var(--font-size-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.cull-stat--cull   { border-color: var(--warning); }
.cull-stat--cull   .cull-stat__value { color: var(--warning); }
.cull-stat--keep   { border-color: var(--strand); }
.cull-stat--keep   .cull-stat__value { color: var(--strand); }
.cull-stat--review .cull-stat__value { color: var(--text-secondary); }

.cull-bucket { margin-top: var(--space-6); }
.cull-list { display: flex; flex-direction: column; gap: 2px; }
.cull-row-wrap {
  background: var(--bg-raised);
  border-left: 2px solid var(--border-default);
  border-radius: 0;
}
.cull-row-wrap.cull-row--cull { border-left-color: var(--warning); }
.cull-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
}
.cull-row__lead {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  flex: 1 1 auto;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cull-row__lead:hover .cull-row__name { color: var(--accent, var(--text-primary)); }
.cull-row__icon { width: 40px; height: 40px; }
.cull-row__chev {
  font-size: 0.6rem;
  color: var(--text-muted);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.cull-row-wrap.is-open .cull-row__chev { transform: rotate(180deg); }
.cull-row__panel { display: none; padding: 0 var(--space-3) var(--space-3) var(--space-3); }
.cull-row-wrap.is-open .cull-row__panel { display: block; }
.cull-tile { display: flex; gap: var(--space-3); align-items: flex-start; }
.cull-tile__icon { width: 64px; height: 64px; flex-shrink: 0; }
.cull-tile__body { min-width: 0; flex: 1 1 auto; }
.cull-perks { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.cull-perk {
  font-size: 0.625rem;
  padding: 2px 6px;
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  color: var(--text-secondary);
}
/* The traits (and exotic catalysts) are what define a roll — make them pop;
   hardware columns and intrinsic/origin stay muted so the eye lands on traits. */
.cull-perk--trait {
  color: var(--text-primary);
  border-color: var(--accent, var(--border-strong));
  font-weight: 600;
}
.cull-perk--origin { color: var(--text-primary); border-color: var(--border-strong); }
.cull-perk--intrinsic { font-style: italic; }
.cull-tile__note { font-size: 0.625rem; color: var(--text-secondary); margin-top: var(--space-2); }
.cull-tile__meta { font-size: 0.5625rem; color: var(--text-muted); margin-top: var(--space-2); text-transform: capitalize; }
.cull-row__main { display: flex; flex-direction: column; min-width: 0; }
.cull-row__name { font-size: var(--font-size-xs); font-weight: 600; }
.cull-row__type { font-size: 0.625rem; color: var(--text-muted); text-transform: capitalize; }
.cull-row__meta { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.cull-row__reason { font-size: 0.625rem; color: var(--text-secondary); text-align: right; }
.cull-badge {
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-1);
}
.cull-badge--exotic { color: var(--solar); border-color: var(--solar); }
.cull-badge--dup { color: var(--warning); border-color: var(--warning); }
/* ⚡ high-power guardrail flag — arc-blue, distinct from the warning dup badge. */
.cull-badge--power { color: var(--arc); border-color: var(--arc); }

/* Junk summary card: collapsed blue/green roll-up. */
.cull-junk-card > summary::-webkit-details-marker { display: none; }
.cull-junk-card[open] > summary { margin-bottom: var(--space-2); }

.cull-act {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 1px var(--space-2);
  transition: all var(--duration-fast) var(--ease-out);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}
/* Bulk selection: per-row checkbox, group select-all, sticky action bar. */
.cull-check { flex-shrink: 0; cursor: pointer; accent-color: var(--accent, var(--arc)); margin-right: var(--space-1); }
.cull-bucket__all { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.cull-bucket__all input { cursor: pointer; accent-color: var(--accent, var(--arc)); }
.cull-bulk-bar {
  position: sticky;
  bottom: var(--space-3);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: opacity var(--duration-fast) var(--ease-out);
}
.cull-bulk-bar[hidden] { display: none; }
.cull-bulk-bar__count { font-size: 0.6875rem; font-weight: 600; margin-right: auto; }

/* Cull Prep */
.cull-prep { background: var(--bg-raised); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: var(--space-3); }
.cull-prep-card { margin-top: var(--space-3); }
.cull-prep-card:empty { margin-top: 0; }

/* Inventory janitor */
.janitor-controls { display: flex; gap: var(--space-2); align-items: center; }
.janitor-card { background: var(--bg-raised); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: var(--space-3); }
.janitor-card__head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.janitor-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.janitor-dot--on { background: var(--strand); box-shadow: 0 0 6px var(--strand); animation: janitorPulse 2s ease-in-out infinite; }
@keyframes janitorPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.janitor-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: var(--space-2); }
.janitor-stat { text-align: center; }
.janitor-stat__value { font-size: var(--font-size-sm); font-weight: 700; }
.janitor-stat__label { font-size: 0.5625rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
.janitor-preview { margin-top: var(--space-3); border-top: 1px solid var(--border-subtle); padding-top: var(--space-2); }
.janitor-move { display: flex; align-items: center; gap: var(--space-2); font-size: 0.625rem; padding: 1px 0; }
.janitor-move__kind { font-size: 0.5rem; font-weight: 700; letter-spacing: 0.04em; padding: 1px 4px; border-radius: var(--radius-sm); border: 1px solid var(--border-default); color: var(--text-muted); flex-shrink: 0; }
.janitor-move__kind--pull_postmaster { color: var(--arc); border-color: var(--arc); }
.janitor-move__kind--transfer_to_vault { color: var(--text-secondary); }
.janitor-move__name { font-weight: 600; }
.janitor-move__reason { font-size: 0.5625rem; }

.cull-act--keep { background: transparent; color: var(--strand); border: 1px solid var(--strand); }
.cull-act--keep:hover { background: var(--strand); color: var(--text-inverse); }
.cull-act--undo { background: transparent; color: var(--text-muted); border: 1px solid var(--border-default); }
.cull-act--undo:hover { color: var(--text-primary); border-color: var(--text-secondary); }
.cull-row--kept { border-left-color: var(--strand); opacity: 0.85; }

.cull-act--cull { background: transparent; color: var(--warning); border: 1px solid var(--warning); }
.cull-act--cull:hover { background: var(--warning); color: var(--text-inverse); }
.cull-row--locked { border-left-color: var(--stasis); }
.cull-row--culled { border-left-color: var(--warning); opacity: 0.85; }

/* Armor 3.0 set bonuses (loadout card SET BONUSES section) */
.set-bonus {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  margin-top: var(--space-2);
}
.set-bonus__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}
.set-bonus__name {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}
.set-bonus__count { font-size: var(--font-size-xs); }
.set-bonus__tier { font-size: var(--font-size-xs); margin-top: var(--space-1); }
.set-bonus__tier--active .set-bonus__tier-label { color: var(--success); }
.set-bonus__tier--inactive .set-bonus__tier-label { color: var(--text-muted); }
.set-bonus__tier--inactive { opacity: 0.7; }
.set-bonus__tier-desc { margin-top: 1px; }

/* ============================================================
   Click-feedback layer
   Global motion-within-a-frame so no click ever looks frozen:
   a top progress bar (HTMX-driven), an engaged active nav tab,
   and a button-busy spinner convention.
   ============================================================ */

/* --- Global top progress bar -------------------------------
   A slim fixed accent bar the layout script drives via HTMX
   lifecycle events. Default state: hidden (scaleX 0, opacity 0).
   The script sets --tp-progress (0..1) and toggles .is-active. */
#top-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 9999;
  transform-origin: left center;
  transform: scaleX(0);
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  opacity: 0;
  pointer-events: none;
  /* Width (scaleX) eases smoothly toward 90%; opacity fades fast. */
  transition: transform 200ms var(--ease-out), opacity 150ms linear;
}

#top-progress.is-active {
  opacity: 1;
}

/* The script writes the current fraction into --tp-progress. */
#top-progress {
  transform: scaleX(var(--tp-progress, 0));
}

@media (prefers-reduced-motion: reduce) {
  #top-progress { transition: opacity 150ms linear; }
}

/* --- Active nav engagement ---------------------------------
   Make the current/clicked tab visibly engage with an accent
   underline (the text-color shift alone reads too subtly). */
.nav__link--active,
.nav__dropdown-toggle--active {
  color: var(--text-primary);
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* --- Button-busy convention --------------------------------
   Pattern: an action <button> gets hx-disabled-elt="this" plus a
   trailing <span class="btn-spinner htmx-indicator"></span>. HTMX
   adds .htmx-request to the in-flight element; we use that to swap
   in the spinner and dim the label so the click is felt instantly. */
.btn-spinner {
  /* Fully hidden at rest: out of flow (no layout shift) AND zero opacity
     so the ring never renders on idle buttons. HTMX's own .htmx-indicator
     rule keeps opacity:0 by default; we add display:none so the spinner
     also takes no inline space until the owning request is in flight. */
  display: none;
  opacity: 0;
  width: 0.85em;
  height: 0.85em;
  margin-left: var(--space-1);
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: -0.1em;
}

/* Reveal + spin ONLY while the owning element is actually requesting.
   HTMX adds .htmx-request to the in-flight element; the spinner is either a
   descendant (`.htmx-request .btn-spinner`) or carries the class itself. */
.htmx-request .btn-spinner,
.btn-spinner.htmx-request {
  display: inline-block;
  opacity: 1;
  animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .btn-spinner { animation: none; }
}

/* --- POWER gauge band (REQS header) ------------------------------------------
   Two gauges giving the active Guardian a sense of "how powerful I am vs what I
   could be." On-brand: monospace, dense, dark; the current fill sits over a faint
   "potential" ghost track so the headroom reads at a glance. */
.power-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.power-gauge {
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-left: 2px solid var(--accent, var(--text-secondary));
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  text-decoration: none;
  color: inherit;
  display: block;
}
.power-gauge:hover { border-color: var(--accent, var(--border-strong)); }
.power-gauge__label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.power-gauge__headline {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-top: var(--space-1);
  font-variant-numeric: tabular-nums;
}
.power-gauge__headline .power-gauge__now { color: var(--text-primary); }
.power-gauge__headline .power-gauge__arrow { color: var(--text-muted); margin: 0 var(--space-1); }
.power-gauge__headline .power-gauge__max { color: var(--accent, var(--success)); }
/* The ghost track is the potential (max); the fill is the current. */
.power-gauge__track {
  position: relative;
  height: 6px;
  margin-top: var(--space-3);
  background: var(--bg-base);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.power-gauge__ghost {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  background: color-mix(in srgb, var(--accent, var(--success)) 28%, transparent);
}
.power-gauge__fill {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  background: var(--accent, var(--text-secondary));
  border-radius: var(--radius-sm);
}
.power-gauge__sub {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: var(--space-2);
}
.power-gauge__sub--accent { color: var(--accent, var(--success)); }

/* ---------------------------------------------------------------------------
   GHOST front door (/ghost) — goal picker + get-me-ready view. Reuses the
   shared tokens, .card, .chip, .badge, and .surface-raised styles; these
   ghost-* rules only add the goal-card grid + the compact REQS peek layout.
   --------------------------------------------------------------------------- */

/* Goal cards: a responsive grid of pickable activity goals. */
.ghost-goals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}

.ghost-goal {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--accent, var(--border-default));
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition: border-color 0.12s ease, transform 0.06s ease;
}
.ghost-goal:hover {
  border-color: var(--accent, var(--text-secondary));
}
.ghost-goal:active { transform: translateY(1px); }

/* The first card is GHOST SUGGESTS — a touch more prominent. */
.ghost-goal--suggested {
  background: var(--bg-raised, var(--bg-surface));
  border-left-width: 4px;
}
.ghost-goal__flag {
  font-size: var(--font-size-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent, var(--text-secondary));
  margin-bottom: var(--space-2);
}

.ghost-goal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.ghost-goal__family {
  font-size: var(--font-size-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent, var(--text-secondary));
}
.ghost-goal__name {
  font-size: var(--font-size-md);
  font-weight: 600;
  margin-top: var(--space-1);
}
.ghost-goal__badges {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  align-items: flex-end;
  flex-shrink: 0;
}
.ghost-goal__reason {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: var(--space-2);
  font-style: italic;
  line-height: 1.5;
}

/* Get-me-ready target: a little breathing room above the loaded view. */
.ghost-ready { margin-top: var(--space-2); }
.ghost-ready__loaded { margin-top: var(--space-4); }

/* Compact REQS peek: dense rows of label + count + why. */
.ghost-peek {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.ghost-peek__row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.ghost-peek__label {
  font-size: var(--font-size-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  flex-shrink: 0;
}
.ghost-peek__why {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  min-width: 0;
}

/* Ghost front-door header: title block + a quiet link to the relocated home
   overview (equipped + saved loadouts at /home). */
.ghost-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--space-4);
}
.ghost-header__home {
	flex-shrink: 0;
	margin-top: var(--space-1);
	color: var(--text-secondary);
	text-decoration: none;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	white-space: nowrap;
}
.ghost-header__home:hover {
	color: var(--accent);
}

/* Ghost ambient watch strip — a thin, dense status line at the top of the front
   door (postmaster fill, free vault slots, current activity). Computed
   request-driven; calm by default, warns only when something is tight. */
.ghost-ambient {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--space-2) var(--space-3);
	padding: var(--space-2) var(--space-3);
	border: 1px solid var(--border-default);
	border-radius: var(--radius-md);
	background: var(--bg-surface);
	font-size: var(--font-size-xs);
	color: var(--text-secondary);
}
.ghost-ambient__label {
	font-weight: 700;
	letter-spacing: 0.12em;
	color: var(--text-muted);
}
.ghost-ambient__stat b {
	color: var(--text-primary);
	font-weight: 600;
}
.ghost-ambient__stat--warn,
.ghost-ambient__stat--warn b {
	color: var(--warning);
}
.ghost-ambient__stat--live b {
	color: var(--accent);
}
.ghost-ambient__flag {
	margin-left: var(--space-1);
	padding: 0 var(--space-1);
	border-radius: var(--radius-sm);
	background: var(--warning);
	color: var(--bg-base);
	font-weight: 700;
	font-size: 0.7em;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.ghost-ambient__sep { color: var(--border-strong); }

/* Ghost ambient HUD — live polish. The strip polls every 20s; these styles make
   it feel alive: a gently pulsing "watching" dot, a bump-flash when the
   postmaster count climbs, a calm "in orbit" / accented "in <activity>" state. */
.ghost-ambient__dot {
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-right: var(--space-1);
	border-radius: 50%;
	background: var(--strand, #4ae88d);
	vertical-align: middle;
	animation: ghost-watch-pulse 2.4s ease-in-out infinite;
}
@keyframes ghost-watch-pulse {
	0%, 100% { opacity: 0.35; box-shadow: 0 0 0 0 rgba(74, 232, 141, 0.0); }
	50%      { opacity: 1;    box-shadow: 0 0 0 3px rgba(74, 232, 141, 0.18); }
}
/* When actively in an activity, warm the strip border so "you're playing" reads
   at a glance. */
.ghost-ambient--active {
	border-color: var(--accent);
}
.ghost-ambient__idle { color: var(--text-muted); }
.ghost-ambient__delta {
	margin-left: var(--space-1);
	color: var(--warning);
	font-weight: 600;
}
/* Bump-flash applied by the layout script when postmaster climbs between polls. */
.ghost-ambient__stat.is-bump {
	animation: ghost-pm-bump 0.9s ease-out;
}
@keyframes ghost-pm-bump {
	0%   { color: var(--warning); transform: scale(1.12); }
	100% { transform: scale(1); }
}
.ghost-ambient__stat { display: inline-block; transition: color 0.3s ease; }
@media (prefers-reduced-motion: reduce) {
	.ghost-ambient__dot { animation: none; opacity: 0.8; }
	.ghost-ambient__stat.is-bump { animation: none; }
}

/* Ghost ambient sparkline — a tiny session trend of postmaster fill, drawn by the
   layout poller. Sits inline next to the postmaster count; accent-colored. */
.ghost-ambient__spark {
	display: inline-flex;
	align-items: center;
	margin-left: var(--space-1);
	color: var(--accent);
	vertical-align: middle;
	opacity: 0.85;
}
.ghost-ambient__spark svg { display: block; }

/* Ghost ambient CLEAR NOW button — appears in the ambient strip when the
   postmaster is near full. Pushed to the right end of the flex strip via
   margin-left: auto. Compact primary action, not a full-size btn. */
.ghost-ambient__sweep {
	margin-left: auto;
	padding: 2px var(--space-3);
	font-family: var(--font-mono);
	font-size: 0.65rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	background: var(--accent);
	color: var(--text-inverse);
	border: none;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: opacity var(--duration-fast) var(--ease-out);
	flex-shrink: 0;
}
.ghost-ambient__sweep:hover { opacity: 0.8; }
.ghost-ambient__sweep:active { opacity: 0.6; }
.ghost-ambient__sweep.htmx-request {
	opacity: 0.5;
	cursor: wait;
}

/* Ghost auto-clear toggle — a subtle pill at the right of the strip showing
   whether Ghost auto-clears the postmaster while the page is open. ON glows
   strand-green with a pulsing dot (matches the GHOST WATCH dot); OFF is muted.
   margin-left:auto right-aligns it; a following CLEAR NOW button (shown only
   when OFF) sits beside it. */
.ghost-ambient__auto {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 2px var(--space-2);
	font-family: var(--font-mono);
	font-size: 0.6rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	background: transparent;
	color: var(--text-muted);
	border: 1px solid var(--border-default);
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
	flex-shrink: 0;
}
.ghost-ambient__auto:hover { color: var(--text-secondary); border-color: var(--border-strong); }
.ghost-ambient__auto--on { color: var(--strand); border-color: var(--strand); }
.ghost-ambient__auto-dot {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--text-muted);
}
.ghost-ambient__auto--on .ghost-ambient__auto-dot {
	background: var(--strand);
	animation: ghost-watch-pulse 2.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
	.ghost-ambient__auto--on .ghost-ambient__auto-dot { animation: none; }
}

/* Ghost sweep result notification — a small bar below the ambient strip that
   confirms the sweep outcome (success summary or error). Fades in on swap. */
.ghost-sweep-result {
	display: flex;
	align-items: center;
	padding: var(--space-1) var(--space-3);
	font-size: var(--font-size-xs);
	background: var(--bg-surface);
	border-left: 2px solid var(--success);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	animation: ghost-sweep-appear var(--duration-base) var(--ease-out);
}
.ghost-sweep-result--err { border-left-color: var(--warning); }
.ghost-sweep-result__msg { color: var(--text-secondary); }
@keyframes ghost-sweep-appear {
	from { opacity: 0; transform: translateY(-4px); }
	to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
	.ghost-sweep-result { animation: none; }
}

/* Ghost "JUMP BACK IN" — one-tap shortcuts to recently-played activities (no
   typing). A wrap row of compact tappable chips, element-accented. */
.ghost-recents {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
}
.ghost-recent {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: var(--space-2) var(--space-3);
	min-width: 0;
	text-align: left;
	cursor: pointer;
	background: var(--bg-surface);
	border: 1px solid var(--border-default);
	border-left: 2px solid var(--accent, var(--border-strong));
	border-radius: var(--radius-md);
	color: var(--text-primary);
	transition: border-color 0.15s ease, background 0.15s ease, transform 0.05s ease;
}
.ghost-recent:hover {
	border-color: var(--accent, var(--border-strong));
	background: var(--bg-surface-raised, var(--bg-surface));
}
.ghost-recent:active { transform: translateY(1px); }
.ghost-recent__name {
	font-size: var(--font-size-sm);
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 22ch;
}
.ghost-recent__meta {
	display: flex;
	gap: var(--space-2);
	font-size: var(--font-size-xs);
	color: var(--text-muted);
	letter-spacing: 0.04em;
}
.ghost-recent__fam { color: var(--accent, var(--text-secondary)); font-weight: 600; }
