:root {
  --bg: #070b12;
  --panel: #10151f;
  --panel-raised: #182131;
  --line: #24334a;
  --text: #eef3f8;
  --text-dim: #85a0bd;
  --text-faint: #4c6079;

  --orange: #e15a24;
  --orange-dim: #8a3814;

  --blue-bright: #4fa8e8;
  --blue-mid: #2e6fbd;
  --blue-pale: #9ad6ec;

  --red: #e1544b;

  --red-node: #ff5c6c;
  --blue-node: #4fa8e8;
  --green-node: #4ade80;
  --yellow-node: #facc15;

  --perf: var(--blue-bright);
  --tech: var(--blue-mid);
  --sense: var(--blue-pale);

  --attr-pure: #6fe3d9;
  --attr-happy: #ffb84d;
  --attr-cute: #ff6f91;

  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
}

body {
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(225, 90, 36, 0.09), transparent 60%),
    radial-gradient(ellipse 700px 400px at 90% 0%, rgba(79, 168, 232, 0.10), transparent 60%);
  background-attachment: fixed;
}

::selection { background: var(--orange); color: #070b12; }

a { color: var(--blue-bright); }

/* ---------- Layout ---------- */

.app-shell {
  max-width: 1680px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

header.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.masthead-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0;
  color: var(--text);
}

.masthead-title .spark { color: var(--orange); }

.masthead-sub {
  font-size: 12.5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

.masthead-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.presets-btn {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
}
.presets-btn:hover {
  border-color: var(--orange-dim);
  color: var(--orange);
}

.tools-dropdown {
  position: relative;
}
.tools-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  min-width: 160px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  padding: 4px;
}
.tools-dropdown-menu[hidden] {
  display: none;
}
.tools-dropdown-item {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: left;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.tools-dropdown-item:hover {
  background: var(--panel);
  color: var(--orange);
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  align-items: start;
}

.selection-header { margin-bottom: 8px; }
.selection-header-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.selection-header-label.leader {
  grid-column: 1;
  color: var(--orange);
  border-bottom-color: var(--orange-dim);
}
.selection-header-label.members {
  grid-column: 2 / -1;
  color: var(--text-faint);
}

.selection-row { margin-bottom: 12px; }
.info-row { margin-bottom: 16px; }

.member-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.member-col.leader-col .panel,
.member-col.leader-col .slot { border-color: var(--orange-dim); }

.info-subrow { margin-bottom: 12px; }
.info-subrow:last-child { margin-bottom: 0; }
.row-stretch { align-items: stretch; }
.row-top { align-items: start; }

.leader-accent.panel-sm { border-color: var(--orange-dim); }

#coverage-row { margin-bottom: 16px; }

@media (max-width: 1200px) {
  .member-grid { grid-template-columns: repeat(3, 1fr); }
  .member-col:nth-child(1) { order: -1; grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  /* Selection row becomes a horizontal swipe carousel instead of wrapping -
     keeps each card at a readable width and Leader visually first. */
  .selection-row {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .selection-row .member-col {
    flex: 0 0 78vw;
    max-width: 300px;
    scroll-snap-align: start;
  }
  .selection-header { display: flex; }
  .selection-header-label.leader { flex: 0 0 78vw; max-width: 300px; }
  .selection-header-label.members { flex: 1; }

  /* Coverage table scrolls horizontally with Time(+Total Score+Notes, when
     present) frozen on the left, since the per-second detail table can't
     meaningfully reflow. Column 2 is Total Score when those columns exist,
     but the first MEMBER column when they don't - every rule below must be
     scoped to .has-notes-column so it never mis-targets a member column. */
  .coverage-table-wrap { overflow-x: auto; }
  .coverage-table { table-layout: auto; }
  .coverage-table col { width: auto !important; min-width: 90px; }
  .coverage-table col:first-child { min-width: 64px; }
  .coverage-table.has-notes-column col:nth-child(2) { min-width: 68px; } /* Total Score (cumulative) - room for large numbers */
  .coverage-table.has-notes-column col:nth-child(3) { min-width: 48px; } /* Notes */
  .coverage-table th:nth-child(1),
  .coverage-table td:nth-child(1) {
    position: sticky;
    left: 0;
    background: var(--panel);
    z-index: 2;
  }
  .coverage-table.has-notes-column th:nth-child(2),
  .coverage-table.has-notes-column td:nth-child(2) {
    position: sticky;
    left: 64px;
    background: var(--panel);
    z-index: 2;
  }
  .coverage-table tr.fever-row td:nth-child(1),
  .coverage-table tr.fever-window td:nth-child(1) {
    background: #2a1810;
  }
  .coverage-table.has-notes-column tr.fever-row td:nth-child(2),
  .coverage-table.has-notes-column tr.fever-window td:nth-child(2) {
    background: #2a1810;
  }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
}

.panel + .panel { margin-top: 18px; }

.info-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.accordion-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.accordion-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  cursor: pointer;
}

.accordion-portrait {
  width: 40px;
  height: 40px;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
}

.accordion-header-info { flex: 1; min-width: 0; }
.accordion-header-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.accordion-chevron {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--orange);
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.accordion-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 12px 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.panel-sm {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  min-width: 0;
}

.panel-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- Roster slots ---------- */

.slot {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-raised);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  margin-bottom: 8px;
  min-width: 0;
  position: relative;
}
.slot:not(.empty) { padding-bottom: 44px; }

.slot:last-child { margin-bottom: 0; }
.slot:hover { border-color: var(--orange-dim); background: #1f2230; }
.slot.leader-slot { border-color: var(--orange); }
.slot.empty { border-style: dashed; color: var(--text-faint); }

.slot-badge {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  color: #0a0b0f;
}

.slot-portrait {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--bg);
}

.picker-item-portrait {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--bg);
}

.slot-badge.attr-pure { background: var(--attr-pure); }
.slot-badge.attr-happy { background: var(--attr-happy); }
.slot-badge.attr-cute { background: var(--attr-cute); }
.slot-badge.attr-empty { background: var(--line); color: var(--text-faint); }

.attr-chip {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: #0a0b0f;
  padding: 2px 8px;
  border-radius: 5px;
}
.attr-chip.attr-pure { background: var(--attr-pure); }
.attr-chip.attr-happy { background: var(--attr-happy); }
.attr-chip.attr-cute { background: var(--attr-cute); }

.slot-chip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.gen-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--panel-raised);
  border: 1px solid var(--line);
  padding: 2px 9px;
  border-radius: 5px;
}

.song-singer-chip {
  background: var(--panel-raised);
  color: var(--blue-pale);
  border: 1px solid var(--line);
}

.rarity-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--orange);
  background: rgba(225, 90, 36, 0.12);
  border: 1px solid rgba(225, 90, 36, 0.3);
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: middle;
}

.slot-info { flex: 1; min-width: 0; }
.slot-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-sub { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.slot-stats {
  display: flex;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  flex-shrink: 0;
}

.slot-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.slot-stats-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.slot-attr-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.slot-attr-row .slot-sub {
  width: 40px;
  flex-shrink: 0;
}

.slot-board-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  margin-left: 0;
}

.slot-swap-row {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  gap: 4px;
}
.slot-swap-btn {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 12px;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  cursor: pointer;
  line-height: 1;
}
.slot-swap-btn:hover:not(:disabled) { border-color: var(--orange-dim); color: var(--orange); }
.slot-swap-btn:disabled { opacity: 0.3; cursor: default; }

.mini-input {
  width: 44px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 4px;
  text-align: center;
}

.mini-input:focus { outline: 1px solid var(--orange); border-color: var(--orange); }

.board-btn {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text-dim);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  cursor: pointer;
  margin-left: auto;
}
.board-btn:hover:not(:disabled) { border-color: var(--orange-dim); color: var(--orange); }
.board-btn:disabled { opacity: 0.35; cursor: default; }

.connect-slot-head .board-btn {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-editor-box { max-width: 640px; }

.presets-box { max-width: 520px; }

.cost-calc-box { max-width: 620px; }
.cost-calc-body { padding: 4px 0; overflow-y: auto; }
.cost-calc-section {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.cost-calc-section:last-child { border-bottom: none; }

.cost-calc-pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.cost-calc-pill {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 7px;
  cursor: pointer;
}
.cost-calc-pill:hover { color: var(--text); border-color: var(--text-faint); }
.cost-calc-pill-active-rar { background: var(--orange); border-color: var(--orange); color: #0a0b0f; }
.cost-calc-pill-active { color: #0a0b0f; border-color: transparent; font-weight: 700; }
.cost-calc-pill-active.attr-cute { background: var(--attr-cute); }
.cost-calc-pill-active.attr-pure { background: var(--attr-pure); }
.cost-calc-pill-active.attr-happy { background: var(--attr-happy); }

.cost-calc-range-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 8px; }
.cost-calc-range-field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.cost-calc-range-field input[type=range] { width: 100%; accent-color: var(--orange); }
.cost-calc-range-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}

.cost-calc-bloom-row { display: flex; gap: 6px; margin-top: 4px; }
.cost-calc-bloom-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel-raised);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.cost-calc-bloom-dot:hover { border-color: var(--text-faint); color: var(--text); }
.cost-calc-bloom-active { background: var(--orange); border-color: var(--orange); color: #0a0b0f; }

.cost-calc-note { font-size: 12px; color: var(--text-dim); line-height: 1.5; margin-top: 10px; }

.cost-calc-hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.cost-calc-hero-grid-single { grid-template-columns: 1fr; }
.cost-calc-stat {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}
.cost-calc-stat-num { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--orange); }
.cost-calc-stat-lbl { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.cost-calc-step-caption {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 16px;
  margin-bottom: 4px;
}
.cost-calc-mat-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 13px; margin-top: 6px; }
.cost-calc-mat-table th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  font-weight: 600;
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
}
.cost-calc-mat-table td { padding: 7px 4px; border-bottom: 1px solid var(--line); color: var(--text); }
.cost-calc-mat-table td.qty { text-align: right; color: var(--orange); font-weight: 600; }
.cost-calc-mat-table tr:last-child td { border-bottom: none; }
.cost-calc-exchange-row td {
  font-size: 11px;
  color: var(--text-faint);
  font-style: italic;
  padding-top: 0;
  padding-bottom: 10px;
}

.cost-calc-exchange-slider-wrap {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.cost-calc-exchange-slider-wrap b { color: var(--text); }
.cost-calc-exchange-slider {
  width: 100%;
  margin: 10px 0 8px;
  accent-color: var(--orange);
}
.cost-calc-exchange-readout {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.cost-calc-exchange-readout span:first-child { color: var(--text); font-weight: 600; }
.cost-calc-exchange-readout span:last-child { color: var(--orange); }

@media (max-width: 520px) {
  .cost-calc-range-grid,
  .cost-calc-hero-grid { grid-template-columns: 1fr; }
}

.compare-page-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  overflow-y: auto;
  padding: 20px 28px 60px;
}

.compare-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 20px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 2;
}
.compare-page-close {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 7px;
  cursor: pointer;
}
.compare-page-close:hover { border-color: var(--orange-dim); color: var(--orange); }

.mv-list { display: flex; flex-direction: column; }
.mv-list-row {
  display: grid;
  grid-template-columns: 1.6fr 0.7fr 1.8fr 0.9fr 1fr 1fr 0.6fr;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.mv-list-header {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--line);
}
.mv-list-header { cursor: default; }
.mv-sortable-header {
  cursor: pointer;
  user-select: none;
}
.mv-sortable-header:hover { color: var(--text); }

.mv-title { font-weight: 600; }
.mv-yt-link {
  color: var(--orange);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11px;
}
.mv-yt-link:hover { text-decoration: underline; }

.cv-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
}
.cv-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 4px;
}
.cv-search-wrap input {
  width: 100%;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
}
.cv-search-wrap input:focus { outline: none; border-color: var(--orange-dim); }

.cv-tile-clickable { cursor: pointer; transition: border-color 0.15s; }
.cv-tile-clickable:hover { border-color: var(--orange-dim); }

.cv-details-box { max-width: 640px; }
.cv-details-header { display: flex; gap: 16px; align-items: flex-start; }
.cv-details-portrait {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.cv-details-body { padding: 4px 20px 16px; max-height: 60vh; overflow-y: auto; }
.cv-details-section {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.cv-details-section:last-child { border-bottom: none; }
.cv-details-stat-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 3px 0;
}
.cv-details-stat-row span { color: var(--text-dim); }
.cv-details-note { font-size: 12.5px; color: var(--text-dim); margin-bottom: 4px; }
.cv-details-effect { font-size: 13px; padding: 2px 0; }
.cv-details-connect-row { display: flex; align-items: center; gap: 12px; }

.cv-section-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.cv-pattern-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  max-width: 175px;
}
.cv-pattern-cell {
  width: 22px;
  height: 22px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  padding: 0;
}
.cv-pattern-cell:hover { border-color: var(--text-faint); }
.cv-pattern-cell-anchor { border-color: var(--orange-dim); }
.cv-pattern-cell-active { background: var(--orange); border-color: var(--orange); }

.cv-filter-group {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}
.cv-filter-group-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--orange);
  margin-bottom: 8px;
}
.cv-filter-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.cv-filter-range-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}
.cv-filter-range-row input[type=number] {
  width: 56px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 5px;
  padding: 4px 6px;
  font-size: 11px;
  text-align: center;
}
.cv-tri-row {
  display: flex;
  gap: 6px;
}
.cv-tri-btn {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-mono);
}
.cv-tri-btn:hover { border-color: var(--text-faint); color: var(--text); }
.cv-tri-btn-active { background: var(--orange); border-color: var(--orange); color: #0a0b0f; font-weight: 600; }

.cv-main { min-width: 0; }
.cv-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.cv-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

/* --- Character Activity view --- */
.ca-disclaimer {
  margin: 16px 24px 0;
  padding: 12px 16px;
  border: 1px solid var(--orange-dim);
  border-radius: 8px;
  background: rgba(225, 90, 36, 0.08);
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.5;
}
.ca-disclaimer strong { color: var(--orange); }
.ca-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-end;
  margin: 16px 24px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-raised);
}
.ca-control-group { min-width: 200px; flex: 1; }
.ca-control-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.ca-control-label span:last-child { color: var(--orange); font-weight: 600; }
.ca-control-group input[type='range'] { width: 100%; accent-color: var(--orange); }
.ca-main { padding: 16px 24px 24px; min-width: 0; }

.song-ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.song-ranking-table thead th {
  position: sticky;
  top: 0;
  background: var(--panel-raised);
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.song-ranking-table thead th:first-child { width: 40px; }
.song-ranking-table tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text-dim);
}
.song-ranking-table tbody tr:hover { background: var(--panel-raised); }
.song-ranking-table td.num {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text);
}
.song-rank-diff-expert, .song-rank-diff-hard {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
}
.song-rank-diff-expert { background: rgba(225, 90, 36, 0.15); color: var(--orange); }
.song-rank-diff-hard { background: rgba(46, 111, 189, 0.15); color: var(--blue-bright); }

.ca-list { display: flex; flex-direction: column; }
.ca-list-row {
  display: grid;
  grid-template-columns: 40px 1.6fr 1.6fr 0.9fr 1fr 1.6fr;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.ca-list-header {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--line);
  cursor: default;
}
.ca-rank { color: var(--text-faint); font-family: var(--font-mono); }
.ca-name { font-weight: 600; }
.ca-sat-cell { display: flex; align-items: center; gap: 8px; }
.ca-sat-bar-track {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.ca-sat-bar-fill { display: block; height: 100%; border-radius: 3px; }
.ca-sat-num { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); min-width: 32px; text-align: right; }
.cv-view-toggle { display: flex; gap: 8px; }
.cv-view-btn {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
}
.cv-view-btn-active { color: var(--orange); border-color: var(--orange-dim); }

.cv-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.cv-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.cv-tile-portrait {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  margin: 0 auto 8px;
  display: block;
  border: 1px solid var(--line);
}
.cv-tile-name { font-size: 12.5px; font-weight: 600; }
.cv-tile-sub {
  font-size: 10.5px;
  color: var(--text-faint);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cv-tile-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.cv-tile-stat {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
}

.cv-list { display: flex; flex-direction: column; }
.cv-list-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.cv-list-header {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--line);
}
.cv-list-name { display: flex; flex-direction: column; }
.cv-list-sub { font-size: 10.5px; color: var(--text-faint); }

.compare-3col-layout {
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  gap: 24px;
  align-items: start;
  max-width: 1400px;
  margin: 0 auto;
}

.compare-team-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 90px;
}
.compare-choose-btn { width: 100%; }
.compare-change-btn {
  background: none;
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 6px;
  align-self: flex-start;
}
.compare-side-b .compare-change-btn { align-self: flex-end; }
.compare-change-btn:hover { border-color: var(--orange-dim); color: var(--orange); }

.compare-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.compare-side-b .compare-member-row { justify-content: flex-end; }
.compare-member-portrait {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.compare-member-info { min-width: 0; }
.compare-side-b .compare-member-info { text-align: right; }
.compare-member-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.compare-member-role {
  font-size: 10.5px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.compare-team-divider {
  border-top: 1px solid var(--line);
  margin: 4px 0;
}

.compare-middle-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.compare-mid-panel { padding: 16px; }

.compare-song-row { margin-bottom: 10px; }
.compare-song-btn-a,
.compare-song-btn-b {
  font-size: 11px;
  padding: 6px 10px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-family: var(--font-mono);
  font-size: 12px;
}
.compare-row-total {
  font-size: 20px;
  font-weight: 600;
  padding: 8px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.compare-row-value {
  color: var(--text-dim);
}
.compare-row-value-a { text-align: right; }
.compare-row-value-b { text-align: left; }
.compare-row-value-winner { color: var(--orange); font-weight: 600; }
.compare-row-label {
  color: var(--text-faint);
  font-size: 10.5px;
  text-align: center;
  white-space: nowrap;
}
.compare-member-stats-header {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.compare-member-stat-group {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.compare-member-stat-group:first-of-type {
  border-top: none;
  padding-top: 0;
}

.compare-secbysec-panel {
  max-width: 1400px;
  margin: 20px auto 0;
  padding: 16px;
}

.compare-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.compare-tab {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 7px 7px 0 0;
  cursor: pointer;
}
.compare-tab:hover { color: var(--text); }
.compare-tab-active {
  color: var(--orange);
  border-color: var(--orange-dim);
  background: var(--panel);
}
.compare-performer-header {
  text-align: center;
  margin-bottom: 4px;
}
.compare-performer-slot {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.compare-performer-names {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.compare-performer-vs {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-faint);
  text-transform: uppercase;
  margin: 0 2px;
}

.preset-save-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.preset-save-row input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}
.preset-save-row input:focus {
  outline: none;
  border-color: var(--orange-dim);
}

.preset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.preset-row:last-child { border-bottom: none; }
.preset-row-info { min-width: 0; }
.preset-row-name {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 2px;
}
.preset-row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.preset-row-actions .board-btn {
  padding: 6px 12px;
  font-size: 11px;
}
.board-editor-title {
  font-family: var(--font-display);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text);
}
.board-editor-subtitle {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 6px;
  line-height: 1.4;
}

.info-icon-wrap {
  position: relative;
  display: inline-block;
  margin-left: 6px;
}
.info-icon {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid var(--text-faint);
  background: none;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  font-style: italic;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  vertical-align: middle;
}
.info-icon:hover {
  border-color: var(--orange);
  color: var(--orange);
}
.info-popup {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 260px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: normal;
  z-index: 30;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.info-popup-with-image {
  width: 280px;
  max-height: 70vh;
  overflow-y: auto;
}
.info-popup-image {
  display: block;
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
}
.board-editor-list { padding: 10px 14px; }

.board-group-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--orange);
  margin: 14px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.board-group-label:first-child { margin-top: 0; }
.board-group-hint {
  color: var(--text-faint);
  text-transform: none;
  font-weight: 400;
  letter-spacing: normal;
}
.board-info-icon {
  display: inline-block;
  color: var(--text-faint);
  text-transform: none;
  font-weight: 400;
  letter-spacing: normal;
  cursor: help;
  font-size: 12px;
  vertical-align: 1px;
}
.board-info-icon:hover { color: var(--text-dim); }

.board-row {
  display: grid;
  grid-template-columns: 1fr 70px 84px 56px;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  font-size: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.board-row-label { color: var(--text-dim); }
.board-row-value {
  font-family: var(--font-mono);
  color: var(--orange);
  text-align: right;
  font-size: 11.5px;
}
.board-row-cost {
  font-family: var(--font-mono);
  color: var(--text-faint);
  text-align: right;
  font-size: 10.5px;
}

.board-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.stepper-btn {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--panel-raised);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stepper-btn:hover:not(:disabled) { border-color: var(--orange); color: var(--orange); }
.stepper-btn:disabled { opacity: 0.3; cursor: default; }
.stepper-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  min-width: 34px;
  text-align: center;
}

.board-diagram {
  display: block;
  margin: 8px 0 4px;
}

.board-diagram-center {
  fill: var(--panel-raised);
  stroke: var(--text-faint);
  stroke-width: 1;
}

.board-diagram-node {
  fill: var(--panel-raised);
  stroke: var(--node-color, var(--text-faint));
  stroke-width: 1.5;
  cursor: pointer;
  transition: fill 0.1s ease, r 0.1s ease;
}
.board-diagram-node:hover {
  stroke-width: 2.5;
}
.board-diagram-node.unlocked {
  fill: var(--node-color, var(--blue-mid));
  filter: drop-shadow(0 0 3px var(--node-color, var(--blue-mid)));
}

.board-diagram-node-singer {
  stroke-dasharray: 2.5 1.5;
}

.board-diagram-icon {
  opacity: 0.5;
  transition: opacity 0.1s ease;
}
.board-diagram-icon.unlocked {
  opacity: 1;
}

.board-diagram-legend {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  text-align: center;
  margin-bottom: 10px;
}

.pattern-icon-wrap {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.pattern-icon-wrap.inline { margin-left: 6px; }
.pattern-cell-bg { fill: var(--bg); stroke: var(--line); stroke-width: 0.5; }
.pattern-cell-fill { fill: var(--node-color, var(--orange)); }
.pattern-cell-anchor { fill: none; stroke: var(--text); stroke-width: 0.8; }

.board-total {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  padding: 10px;
  border-top: 1px solid var(--line);
}

.connect-section {
  padding: 4px 14px 14px;
  border-top: 1px solid var(--line);
}

.gy-manager-page {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 20px 28px 20px;
}
.gy-manager-layout {
  display: grid;
  grid-template-columns: 260px 1fr 320px;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.gy-char-panel {
  padding: 12px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}
.gy-char-search,
.gy-gen-filter {
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}
.gy-char-list-items {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gy-char-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
}
.gy-char-item:hover { background: var(--panel-raised); color: var(--text); }
.gy-char-item.active {
  background: rgba(225, 90, 36, 0.12);
  color: var(--orange);
  font-weight: 600;
}
.gy-char-configured {
  color: var(--green-node);
  font-size: 8px;
}
.gy-diagram-panel {
  padding: 12px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}
.gy-tabs {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.gy-tab-btn {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
}
.gy-tab-btn:hover { border-color: var(--orange-dim); color: var(--orange); }
.gy-tab-btn.active {
  border-color: var(--orange);
  color: var(--orange);
  background: rgba(225, 90, 36, 0.1);
  font-weight: 700;
}
.gy-diagram-container { flex: 1; min-height: 0; overflow: auto; }
.gy-summary-panel {
  padding: 14px;
  overflow-y: auto;
  min-height: 0;
}
.gy-summary-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--orange);
  margin-bottom: 8px;
}

.connect-slot-row {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.connect-slot-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.connect-slot-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.connect-bloom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.connect-info {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--orange);
  margin-left: auto;
}

.connect-alloc-list { margin-top: 8px; }
.connect-alloc-row {
  display: grid;
  grid-template-columns: 1fr 84px;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 11.5px;
}
.connect-alloc-empty {
  font-size: 11px;
  color: var(--text-faint);
  font-style: italic;
  padding: 6px 0;
}

.connect-budget-line {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
  text-align: right;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* ---------- Picker overlay ---------- */

.picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 10, 0.75);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 20px;
  z-index: 100;
}

.picker-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 76vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.picker-search {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-raised);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-group-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.filter-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
}
.filter-checkbox input { accent-color: var(--orange); cursor: pointer; }
.filter-checkbox.attr-pure { color: var(--attr-pure); }
.filter-checkbox.attr-happy { color: var(--attr-happy); }
.filter-checkbox.attr-cute { color: var(--attr-cute); }

.filter-group-dropdown { position: relative; }
.filter-dropdown-btn {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text-dim);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
}
.filter-dropdown-btn:hover { border-color: var(--orange-dim); color: var(--orange); }

.filter-dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  min-width: 220px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.filter-dropdown-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  padding: 5px 6px;
  border-radius: 5px;
  cursor: pointer;
}
.filter-dropdown-option:hover { background: var(--panel-raised); }
.filter-dropdown-option input { accent-color: var(--orange); cursor: pointer; }

.filter-clear-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.filter-clear-btn:hover { color: var(--orange); }

.picker-search input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
}

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

.picker-list { overflow-y: auto; padding: 8px; }

.picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  cursor: pointer;
}

.picker-item:hover { background: var(--panel-raised); }

.picker-item-name { font-size: 13px; font-weight: 600; }
.picker-item-sub { font-size: 11px; color: var(--text-dim); }

.picker-close {
  padding: 10px 14px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  cursor: pointer;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.picker-close:hover { color: var(--text); }

.green-bonus-box {
  padding: 18px;
  gap: 12px;
  max-width: 420px;
}
.green-bonus-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.green-bonus-reference-image {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.green-bonus-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}
.green-bonus-current {
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}
.green-bonus-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 10px;
}
.green-bonus-input:focus { outline: 1px solid var(--orange); border-color: var(--orange); }
.green-bonus-btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.green-bonus-ok {
  border-color: var(--orange);
  color: var(--orange);
}
.green-bonus-ok:hover { background: rgba(225, 90, 36, 0.1); }

/* ---------- Stat meters ---------- */

.stat-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.stat-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.stat-table td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.stat-table tr:last-child td { border-bottom: none; }
.stat-table .num { font-family: var(--font-mono); text-align: right; }

.meter {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
  width: 100%;
  min-width: 60px;
}
.meter > span { display: block; height: 100%; border-radius: 3px; }
.meter.perf > span { background: var(--perf); }
.meter.tech > span { background: var(--tech); }
.meter.sense > span { background: var(--sense); }

.totals-row td { font-weight: 700; color: var(--text); background: var(--panel-raised); }

/* ---------- Effect cards ---------- */

.effect-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--panel-raised);
}
.effect-card:last-child { margin-bottom: 0; }
.effect-card.inactive { opacity: 0.45; }

.effect-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.effect-name { font-weight: 600; font-size: 13px; }
.effect-value { font-family: var(--font-mono); color: var(--orange); font-size: 13px; }

.effect-detail { font-size: 11.5px; color: var(--text-dim); margin-top: 4px; }

.passive-effect-block + .passive-effect-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  margin-right: 4px;
}
.pill.met { border-color: var(--blue-bright); color: var(--blue-bright); }
.pill.unmet { border-color: var(--red); color: var(--red); }
.pill.situational { border-color: var(--orange-dim); color: var(--orange); }

/* ---------- Setlist timeline (signature element) ---------- */

.timeline-wrap { position: relative; padding: 30px 6px 46px; }

.timeline-track {
  position: relative;
  height: 3px;
  background: var(--line);
  border-radius: 2px;
}

.timeline-track .played {
  position: absolute; left: 0; top: 0; height: 100%;
  background: linear-gradient(90deg, var(--orange-dim), var(--orange));
  border-radius: 2px;
}

.fever-mark {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 3px rgba(225,90,36,0.20), 0 0 16px rgba(225,90,36,0.55);
  cursor: default;
}

.fever-label {
  position: absolute;
  top: -26px;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--orange);
  white-space: nowrap;
}

.fever-member {
  position: absolute;
  top: 20px;
  transform: translateX(-50%);
  font-size: 10.5px;
  color: var(--text-dim);
  white-space: nowrap;
  text-align: center;
  max-width: 90px;
}

.timeline-ends {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* ---------- Power estimate ---------- */

.power-total {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 600;
  color: var(--orange);
  letter-spacing: 0.01em;
}

.unit-score-wrap { display: flex; flex-direction: column; gap: 16px; }

.unit-score-hero {
  align-self: center;
  text-align: center;
  padding: 16px 32px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-raised);
}
.unit-score-hero-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.unit-score-hero-value {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: 0.01em;
}

.unit-score-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) {
  .unit-score-panels { grid-template-columns: 1fr; }
}

.power-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg);
  margin: 10px 0 4px;
}
.power-bar-segment { height: 100%; }

.power-breakdown {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 10px;
}
.power-breakdown .num { text-align: right; }
.power-row-indent {
  padding-left: 16px;
  color: var(--text-faint);
  font-size: 10.5px;
}
.power-row-header-value {
  font-weight: 700;
  color: var(--text);
}

.power-percent-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}
.power-percent-sign {
  color: var(--text-faint);
  font-size: 11px;
}
.power-percent-computed {
  min-width: 72px;
  color: var(--text-dim);
}
.power-manual-input {
  width: 56px;
  text-align: right;
}

.estimate-note {
  font-size: 11px;
  color: var(--text-faint);
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 10px;
  line-height: 1.5;
}

/* ---------- Bonus coverage (second-by-second simulation) ---------- */

.coverage-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.coverage-stat {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.coverage-stat .stat-num {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--orange);
  font-weight: 500;
}
.coverage-stat .stat-label {
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 2px;
}
.stat-num-sub {
  font-size: 13px;
  color: var(--text-faint);
}

.member-coverage-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.member-coverage-card {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.member-coverage-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.member-coverage-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  padding: 2px 0;
}
.member-coverage-row .num {
  color: var(--text);
  font-weight: 500;
}

.coverage-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.coverage-layout .coverage-table-wrap {
  flex: 1;
  min-width: 0;
}

.coverage-table-wrap {
  max-height: 480px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.coverage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.coverage-table thead th {
  position: sticky;
  top: 0;
  background: var(--panel-raised);
  z-index: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.coverage-table thead th:first-child { text-align: left; padding-left: 12px; }

.coverage-table td {
  padding: 5px 6px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  color: var(--text-faint);
  white-space: nowrap;
}
.coverage-table td:first-child {
  text-align: left;
  padding-left: 12px;
  color: var(--text-dim);
}

.coverage-table td.cell-active {
  color: var(--blue-pale);
  background: rgba(46, 111, 189, 0.15);
  border: 2px solid transparent;
  box-sizing: border-box;
}

.coverage-table td.cell-winner {
  color: var(--text);
  font-weight: 700;
  background: rgba(46, 111, 189, 0.28);
}

.coverage-table td.cell-suppressed {
  color: var(--text-faint);
  background: rgba(46, 111, 189, 0.06);
  opacity: 0.65;
}

.coverage-table td.cell-notes {
  color: var(--text-dim);
  font-weight: 600;
}
.coverage-table td.cell-notes-loading {
  color: var(--text-faint);
  opacity: 0.5;
}
.cell-member-score {
  display: block;
  font-size: 9.5px;
  font-weight: 400;
  color: var(--text-faint);
  margin-top: 2px;
}
.cell-member-score-loading { opacity: 0.5; }
.coverage-table td.cell-cumulative {
  color: var(--text-dim);
  font-weight: 600;
}
.coverage-table td.cell-cumulative-loading {
  color: var(--text-faint);
  opacity: 0.5;
}
.note-count {
  display: inline-block;
  min-width: 14px;
}
.note-glyph {
  display: flex;
  width: 32px;
  height: 6px;
  margin: 3px auto 0;
  border-radius: 2px;
  overflow: hidden;
  background: var(--bg);
}
.note-glyph span { display: block; height: 100%; }

.difficulty-picker {
  display: flex;
  gap: 6px;
  margin: 4px 0 12px;
}
.difficulty-btn {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text-dim);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
}
.difficulty-btn:hover { border-color: var(--orange-dim); color: var(--orange); }
.difficulty-btn.active {
  border-color: var(--orange);
  color: var(--orange);
  background: rgba(225, 90, 36, 0.1);
  font-weight: 700;
}

.coverage-toggles {
  display: flex;
  gap: 16px;
  margin: 0 0 12px;
}
.coverage-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
}
.coverage-toggle input { accent-color: var(--orange); cursor: pointer; }

.coverage-table tr.fever-row td:first-child {
  color: var(--orange);
  font-weight: 700;
}
.coverage-table tr.fever-row {
  background: rgba(225, 90, 36, 0.22);
}
.coverage-table tr.fever-window {
  background: rgba(225, 90, 36, 0.11);
}
.coverage-table tr.fever-window td:first-child {
  color: var(--orange);
}

.coverage-table tr.no-bonus-row td.cell-cumulative {
  color: var(--red);
}

/* ---------- Song select ---------- */

.song-select-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.song-select-row select {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 13px;
}

.empty-state {
  color: var(--text-faint);
  font-size: 12.5px;
  text-align: center;
  padding: 30px 10px;
  font-family: var(--font-mono);
}

.section-title {
  font-family: var(--font-display);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 12px;
  color: var(--text);
}

/* ---------- Per-member column cards (new grid layout) ---------- */

.member-stat-row {
  display: grid;
  grid-template-columns: 34px 1fr 40px;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}
.member-stat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-faint);
}
.member-stat-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  text-align: right;
}

.active-skill-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 8px;
  font-size: 11px;
  color: var(--text-dim);
}
.active-skill-grid .num {
  font-family: var(--font-mono);
  color: var(--text);
  text-align: right;
}

.coverage-summary-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.coverage-grid { align-items: start; }

.coverage-axis-legend {
  font-size: 10.5px;
  color: var(--text-dim);
  padding-top: 4px;
}
.legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: middle;
}
.legend-swatch.fever { background: rgba(225, 90, 36, 0.35); border: 1px solid var(--orange); }
.legend-swatch.active { background: var(--blue-mid); }

.member-coverage-wrap { width: 100%; }
.member-coverage-track {
  position: relative;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.coverage-fever-block {
  position: absolute;
  left: 0;
  width: 100%;
  background: rgba(225, 90, 36, 0.22);
  border-top: 2px solid var(--orange);
  border-bottom: 2px solid var(--orange);
}
.coverage-segment {
  position: absolute;
  left: 0;
  width: 100%;
  border: 2px solid transparent;
  box-sizing: border-box;
  cursor: default;
}
.coverage-segment.winner {
  background: rgba(46, 111, 189, 0.4);
  z-index: 2;
}
.coverage-segment.suppressed {
  background: rgba(46, 111, 189, 0.12);
  opacity: 0.7;
}
.member-coverage-fever-info {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-faint);
  margin-top: 6px;
  text-align: center;
  line-height: 1.6;
}

.coverage-ruler {
  position: relative;
  margin-top: 8px;
}
.coverage-ruler-mark {
  position: absolute;
  left: 0;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-faint);
  white-space: nowrap;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } }

/* ---------------- Materials Tracker (js/materialsPage.js) ---------------- */
.materials-layout { grid-template-columns: 260px 1fr 420px; }
.mat-char-progress {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--green-node);
}
.mat-area-tab.active {
  border-color: var(--node-color);
  color: var(--node-color);
  background: color-mix(in srgb, var(--node-color) 12%, transparent);
}
.mat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
  margin: 4px 0 8px;
}
.mat-actions .presets-btn { font-size: 11px; padding: 5px 10px; }
.mat-danger { border-color: var(--red) !important; color: var(--red) !important; }
.board-diagram-node.mat-connector { stroke-dasharray: 2 2; }
.mat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  margin: 4px 0 6px;
}
.mat-table th {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  color: var(--text-faint);
  text-align: right;
  padding: 3px 4px;
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mat-table th:first-child { text-align: left; }
.mat-table td {
  padding: 4px;
  border-bottom: 1px solid var(--line);
  color: var(--text-dim);
  vertical-align: top;
}
.mat-table td.num { text-align: right; font-family: var(--font-mono); }
.mat-color-cell {
  color: var(--node-color) !important;
  font-weight: 600;
  white-space: nowrap;
}
.mat-held-input {
  width: 74px;
  text-align: right;
  padding: 2px 4px;
}
.mat-short { font-size: 9.5px; color: var(--red); }
.mat-enough { font-size: 9.5px; color: var(--green-node); }
.mat-presets { margin-top: -2px; align-items: center; }
.mat-presets-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 2px;
}
.mat-preset-done { opacity: 0.45; }
.mat-sort-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.mat-sort-btn { flex: 1; font-size: 11px; padding: 4px 6px; }

/* ---------------- Holomem Rank Calculator (js/rankPage.js) ---------------- */
.rank-layout { grid-template-columns: 260px 1fr 340px; }
.rank-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--blue-pale);
}
.rank-ach-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}
.rank-cat-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.rank-cat-exp { color: var(--text-faint); font-size: 10px; }
.rank-row {
  display: grid;
  grid-template-columns: 1fr auto 52px;
  gap: 10px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 6px;
}
.rank-row:hover { background: var(--panel-raised); }
.rank-row-label { font-size: 12.5px; color: var(--text); line-height: 1.35; }
.rank-row-meta { font-size: 10.5px; color: var(--text-faint); margin-top: 2px; }
.rank-row-control { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.rank-tier-select { width: 210px; font-size: 11.5px; padding: 3px 4px; text-align: left; }
.rank-row-exp {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-align: right;
}
.rank-row-done .rank-row-exp { color: var(--green-node); }
.rank-auto {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--blue-pale);
}
.rank-use-btn { white-space: nowrap; }
.rank-big {
  text-align: center;
  padding: 10px 0 8px;
}
.rank-big-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}
.rank-big-num {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  color: var(--orange);
  margin: 4px 0;
}
.rank-big-exp { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }
.rank-bar {
  height: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0 6px;
}
.rank-bar-fill { height: 100%; background: var(--orange); }
.rank-next { font-size: 11.5px; color: var(--text-dim); line-height: 1.5; }
.rank-ceiling {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.rank-ceiling-val { font-family: var(--font-mono); color: var(--text); }
@media (max-width: 1100px) {
  .rank-layout { grid-template-columns: 220px 1fr; }
  .rank-layout .gy-summary-panel { grid-column: 1 / -1; border-top: 1px solid var(--line); }
}

/* ---------------- Sync from Materials Tracker ---------------- */
.tracker-sync-btn { font-size: 11px; padding: 4px 10px; margin-top: 6px; }
.tracker-sync-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.tracker-sync-row { display: flex; gap: 6px; flex-shrink: 0; margin: 4px 0 6px; }
.tracker-sync-all { width: 100%; margin: 0 0 6px; flex-shrink: 0; }

/* ---------------- Green / Yellow source switch ---------------- */
.source-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin: 0 4px; vertical-align: middle; }
.source-toggle-btn { background: transparent; border: 0; color: var(--text-faint); font-size: 10px; padding: 2px 6px; cursor: pointer; font-family: var(--font-mono); }
.source-toggle-btn + .source-toggle-btn { border-left: 1px solid var(--line); }
.source-toggle-btn.active { background: color-mix(in srgb, var(--green-node) 18%, transparent); color: var(--green-node); }
.source-note { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); margin-left: 4px; cursor: help; }
.source-note.incomplete { color: var(--orange, #f59e0b); }

/* ---------- Player FAQ (js/faqPage.js, content in data/faq.json) ---------- */
.faq-body { max-width: 900px; margin: 0 auto; }
.faq-tools { position: sticky; top: 58px; z-index: 1; background: var(--bg); padding: 4px 0 12px; }
.faq-search {
  width: 100%; font: 15px var(--font-body); color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; min-height: 42px;
}
.faq-search:focus { outline: 2px solid var(--orange-dim); border-color: var(--orange); }
.faq-chips { display: flex; gap: 8px; overflow-x: auto; padding-top: 10px; scrollbar-width: none; }
.faq-chip {
  flex: none; background: transparent; border: 1px solid var(--line); color: var(--text-dim);
  font: 12.5px var(--font-body); padding: 6px 12px; border-radius: 999px; cursor: pointer; min-height: 34px;
}
.faq-chip:hover { color: var(--text); }
.faq-chip.on { background: var(--orange); border-color: var(--orange); color: #070b12; font-weight: 600; }
.faq-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); margin: 2px 0 8px; }
.faq-group {
  font-family: var(--font-display); font-weight: 600; font-size: 12.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-dim); margin: 26px 0 10px;
}
.faq-card { scroll-margin-top: 200px; }
.faq-card { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; margin-bottom: 10px; }
.faq-card.open { border-color: #33496a; }
.faq-q {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; background: none;
  border: 0; color: var(--text); font: 600 15px/1.4 var(--font-body); padding: 14px 16px; cursor: pointer;
}
.faq-q:focus-visible { outline: 2px solid var(--blue-bright); border-radius: 11px; }
.faq-q-text { flex: 1; }
.faq-caret { flex: none; color: var(--text-faint); transition: transform 0.2s; margin-top: 1px; font-size: 12px; }
.faq-card.open .faq-caret { transform: rotate(90deg); color: var(--orange); }
.faq-short { padding: 0 16px 14px; margin-top: -4px; font-size: 14px; line-height: 1.55; }
.faq-short b { color: var(--orange); font-weight: 600; }
.faq-more { display: none; margin: 0 16px; padding-bottom: 16px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.55; }
.faq-card.open .faq-more { display: block; }
.faq-h {
  font-family: var(--font-display); font-weight: 600; font-size: 11.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-dim); margin: 14px 0 4px;
}
.faq-part { color: #cfdbe8; }
.faq-part p { margin: 6px 0; }
.faq-part a { color: var(--blue-bright); }
.faq-part ul, .faq-part ol { padding-left: 20px; margin: 6px 0; }
.faq-part .scroll { overflow-x: auto; }
.faq-part table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.faq-part th, .faq-part td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.faq-part th { color: var(--text-dim); font-weight: 500; }
.faq-part td.n, .faq-part th.n { text-align: right; white-space: nowrap; }
.faq-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.faq-badge {
  flex: none; font: 500 10.5px var(--font-mono); padding: 2px 7px; border-radius: 5px; border: 1px solid;
  white-space: nowrap; margin-top: 2px;
}
.faq-b-confirmed { color: var(--green-node); border-color: #24603d; }
.faq-b-data { color: var(--blue-bright); border-color: #24476b; }
.faq-b-estimate { color: #ffb84d; border-color: #6b5124; }
.faq-b-writing { color: var(--text-faint); border-color: var(--line); }
.faq-empty { color: var(--text-dim); text-align: center; padding: 40px 0; }
.faq-footnote { font-size: 11.5px; color: var(--text-faint); margin-top: 18px; }
.faq-calc { background: var(--panel-raised); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 12px 0 4px; }
.faq-calc-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.faq-calc-label { display: block; font-size: 11.5px; color: var(--text-dim); margin-bottom: 4px; }
.faq-calc-select {
  width: 100%; min-height: 38px; font: 14px var(--font-body); background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 7px; padding: 0 8px;
}
.faq-calc-range { width: 100%; min-height: 38px; accent-color: var(--orange); }
.faq-verdict { font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1.15; margin: 14px 0 10px; }
.faq-bars { display: grid; gap: 8px; }
.faq-bar { display: grid; grid-template-columns: 10em minmax(0, 1fr) 4.5em; gap: 10px; align-items: center; font-size: 12.5px; }
.faq-track { display: block; height: 12px; background: var(--panel); border-radius: 4px; overflow: hidden; }
.faq-fill { display: block; height: 100%; border-radius: 4px; transition: width 0.3s; }
.faq-fill-easy { background: var(--blue-mid); }
.faq-fill-hard { background: var(--blue-bright); }
.faq-fill-broken { background: var(--orange); }
.faq-bar-value { text-align: right; font-family: var(--font-mono); }
.faq-calc-note { font-size: 11.5px; color: var(--text-faint); margin: 10px 0 0; }
.faq-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--panel-raised);
  border: 1px solid var(--orange-dim); color: var(--text); padding: 9px 14px; border-radius: 8px; font-size: 13px;
  opacity: 0; transition: opacity 0.2s; pointer-events: none; z-index: 101;
}
.faq-toast.show { opacity: 1; }
.faq-calc-row-2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.faq-act-table { display: grid; gap: 2px; font-size: 13px; }
.faq-act-row {
  display: grid; grid-template-columns: 3em 4em 8em 4em minmax(0, 1fr); gap: 10px; align-items: center;
  padding: 6px 8px; border-radius: 6px;
}
.faq-act-head { color: var(--text-dim); font-size: 11.5px; padding-bottom: 2px; }
.faq-act-best { background: color-mix(in srgb, var(--orange) 10%, transparent); }
.faq-act-low { color: #ffb84d; }
.faq-act-value { display: grid; grid-template-columns: minmax(0, 1fr) 3.5em; gap: 8px; align-items: center; }
.faq-map-hint { font-size: 12.5px; color: var(--text-dim); margin: 12px 0 6px; }
.faq-map { position: relative; height: 170px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; cursor: crosshair; }
.faq-map > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.faq-map-cost { fill: var(--orange); }
.faq-map-bar { fill: var(--blue-bright); opacity: 0.85; }
.faq-map-zone { fill: #ffb84d; }
.faq-map-point { stroke: var(--text-dim); stroke-width: 1; stroke-dasharray: 3 3; }
.faq-map-point-label { fill: var(--text-dim); font: 600 11px var(--font-mono); }
.faq-map-axis { fill: var(--text-faint); font: 10px var(--font-mono); }
.faq-map-break { cursor: pointer; }
.faq-map-break line { stroke: #ff5d5d; stroke-width: 2; }
.faq-map-break circle { fill: #ff5d5d; }
.faq-map-break text { fill: #070b12; font: 700 11px var(--font-mono); pointer-events: none; }
.faq-map-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; color: var(--text-dim); margin-top: 8px; }
.faq-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.faq-key-notes { background: var(--blue-bright); }
.faq-key-cost { background: color-mix(in srgb, var(--orange) 45%, transparent); }
.faq-key-zone { background: #ffb84d; height: 4px; vertical-align: 2px; }
.faq-key-point { width: 0; height: 10px; border-left: 1px dashed var(--text-dim); border-radius: 0; }
.faq-great-row { margin-top: 12px; }
.faq-map-summary { font-size: 13px; color: var(--text-dim); margin: 0 0 10px; }
@media (max-width: 600px) {
  .faq-page { padding: 14px 14px 60px; }
  .faq-page .compare-page-close { white-space: nowrap; padding: 8px 10px; }
  .faq-tools { top: 0; position: static; }
  .faq-card { scroll-margin-top: 90px; }
  .faq-calc-row, .faq-calc-row-2 { grid-template-columns: 1fr; }
  .faq-map { height: 150px; }
  .faq-act-row { grid-template-columns: 2.4em 4.6em 3em minmax(0, 1fr); gap: 6px; font-size: 12px; }
  .faq-act-row > :nth-child(2) { display: none; }
  .faq-bar { grid-template-columns: 7.5em minmax(0, 1fr) 4em; }
  .faq-q .faq-badge { display: none; }
  .faq-card.open .faq-q .faq-badge { display: inline-block; }
}
@media (prefers-reduced-motion: reduce) {
  .faq-caret, .faq-fill, .faq-toast { transition: none; }
}

/* ---------- Event Points panel (Builder, under the score cards) ---------- */
.event-panel {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.ev-event { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 4px 0 12px; }
.ev-event-name { font-family: var(--font-display); font-size: 18px; color: var(--text); letter-spacing: 0.02em; }
.ev-event-meta { font-size: 12px; color: var(--text-dim); }
.ev-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr); gap: 14px; }
@media (max-width: 760px) { .ev-grid { grid-template-columns: 1fr; } }
.ev-bonus, .ev-controls {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.ev-cards { display: flex; flex-direction: column; gap: 4px; }
.ev-card { display: grid; grid-template-columns: 90px 1fr auto; gap: 8px; font-size: 12px; align-items: baseline; }
.ev-card-name { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-card-parts { color: var(--text-dim); }
.ev-card-total { font-family: var(--font-mono); color: var(--blue-pale); }
.ev-bonus-total { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-dim); }
.ev-bonus-total b { font-family: var(--font-mono); color: var(--orange); font-size: 16px; margin-left: 6px; }
.ev-controls { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--text-dim); }
.ev-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; align-self: flex-start; }
.ev-mode { background: transparent; color: var(--text-dim); border: 0; padding: 5px 14px; font: inherit; cursor: pointer; }
.ev-mode.on { background: var(--orange); color: #fff; }
.ev-field { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ev-field select, .ev-event select { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px; font: inherit; }
.ev-check, .ev-radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ev-radio b, .ev-field-note b { font-family: var(--font-mono); color: var(--text); font-weight: 500; }
.ev-custom { width: 110px; }
.ev-warn { margin-top: 10px; font-size: 12px; color: var(--yellow-node); }
.ev-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.ev-table th { text-align: left; font-weight: 500; color: var(--text-dim); font-size: 11px; border-bottom: 1px solid var(--line); padding: 6px 8px; }
.ev-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); color: var(--text); }
.ev-table .n { text-align: right; font-family: var(--font-mono); }
.ev-table .ev-pts { color: var(--orange); }
.ev-none { margin-top: 6px; padding: 14px 16px; background: var(--panel-raised); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--text-dim); }

/* Unit Score in the leader column, under the Song (Row C of the info row). */
.unit-score-hero.in-slot { align-self: stretch; padding: 14px 12px; }
.unit-score-hero.in-slot .unit-score-hero-value { font-size: 34px; }
#power-row { margin: 16px 0; }
.unit-score-panels { align-items: stretch; }
.unit-score-panels > .panel { margin-top: 0; }

/* --- Challenge Live page (js/challengePage.js) --- */
.challenge-controls { gap: 20px; }
.challenge-control { display: flex; flex-direction: column; gap: 6px; }
.challenge-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.challenge-input {
  width: 80px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-mono);
  padding: 6px 8px;
  border-radius: 6px;
}
.challenge-check { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 4px; }
.challenge-status { margin: 12px 24px 0; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim); }
.challenge-table { display: flex; flex-direction: column; font-size: 12.5px; }
.challenge-row {
  display: grid;
  grid-template-columns: 90px 100px minmax(180px, 1.4fr) 110px minmax(160px, 1.3fr) minmax(170px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  color: var(--text-dim);
}
.challenge-row:hover, .challenge-row.is-open { background: var(--panel-raised); }
.challenge-row.is-cleared { opacity: 0.5; }
.challenge-head {
  position: sticky;
  top: 58px;
  z-index: 1;
  cursor: default;
  background: var(--panel-raised);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.challenge-stage { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.challenge-stage-num { font-family: var(--font-display); font-size: 18px; color: var(--text); min-width: 28px; }
.challenge-mandatory {
  font-size: 9px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  color: #fff;
  background: linear-gradient(90deg, #ff6f91, #ffb84d, #4ade80, #4fa8e8, #a78bfa);
}
.challenge-num { font-family: var(--font-mono); font-weight: 700; color: var(--text); }
.challenge-bonus { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.challenge-holomem {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--text-faint);
}
.challenge-holomem.in-unit { border-color: var(--green-node); color: var(--green-node); background: rgba(74, 222, 128, 0.08); }
.challenge-holomem.is-leader { border-style: dashed; color: var(--text-dim); }
.challenge-bonus-total { font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--green-node); }
.challenge-bonus-total.none { color: var(--text-faint); font-weight: 400; }
.challenge-rating { display: flex; align-items: center; gap: 6px; }
.challenge-sub { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint); }
.challenge-grade {
  font-family: var(--font-display);
  font-size: 13px;
  min-width: 22px;
  text-align: center;
  padding: 0 5px;
  border-radius: 4px;
}
.cg-S { background: rgba(250, 204, 21, 0.18); color: var(--yellow-node); }
.cg-A { background: rgba(79, 168, 232, 0.18); color: var(--blue-bright); }
.cg-B { background: rgba(133, 160, 189, 0.18); color: var(--text-dim); }
.cg-none { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); border: 1px solid var(--line); }
.challenge-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--text); }
.challenge-diff {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.cd-easy { background: rgba(74, 222, 128, 0.15); color: var(--green-node); }
.cd-normal { background: rgba(154, 214, 236, 0.15); color: var(--blue-pale); }
.cd-hard { background: rgba(46, 111, 189, 0.18); color: var(--blue-bright); }
.cd-expert { background: rgba(225, 90, 36, 0.15); color: var(--orange); }
.challenge-verdict {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.challenge-margin { font-family: var(--font-mono); font-weight: 400; font-size: 10.5px; opacity: 0.85; }
.cv-auto { background: rgba(74, 222, 128, 0.15); color: var(--green-node); }
.cv-fc { background: rgba(79, 168, 232, 0.15); color: var(--blue-bright); }
.cv-lucky { background: rgba(225, 90, 36, 0.15); color: var(--orange); }
.cv-no { background: rgba(225, 84, 75, 0.12); color: var(--red); }
.challenge-detail { padding: 12px 14px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.challenge-detail-info { display: flex; flex-wrap: wrap; gap: 18px; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.challenge-detail-info strong { color: var(--text); font-family: var(--font-mono); }
.challenge-rewards { font-size: 11.5px; color: var(--text-faint); margin-bottom: 10px; }
.challenge-songs td.num.meets { color: var(--green-node); }
.challenge-songs tr.is-best td { background: rgba(74, 222, 128, 0.06); }
.challenge-song-cell { color: var(--text) !important; vertical-align: top; min-width: 160px; }
.challenge-row { scroll-margin-top: 120px; }
@media (max-width: 800px) {
  .challenge-head { display: none; }
  .challenge-row { grid-template-columns: 70px 1fr 1fr; row-gap: 6px; }
  .challenge-bonus { grid-column: 1 / -1; }
  .challenge-pick { grid-column: 1 / 3; }
  .challenge-songs { font-size: 11.5px; }
  .challenge-detail { overflow-x: auto; }
}

.challenge-row.is-mandatory { box-shadow: inset 3px 0 0 0 #a78bfa; background: rgba(167, 139, 250, 0.05); }
.challenge-row.is-mandatory.is-cleared { box-shadow: none; }
.challenge-mandatory-note { color: #c4b5fd; }

/* FAQ: board node types table */
.faq-node-table td { vertical-align: top; }
.faq-node-icons { white-space: nowrap; }
.faq-node-icon { width: 28px; height: 28px; vertical-align: middle; margin-right: 2px; background: #2a2f3d; border-radius: 6px; padding: 3px; box-sizing: border-box; }
.faq-node-board { margin-top: 14px; }

/* Event Points panel - countdown + Live Boosts until the end (2026-11-28) */
.ev-clock { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: -4px 0 12px; font-size: 12px; color: var(--text-dim); }
.ev-countdown { font-family: var(--font-mono); font-size: 18px; color: var(--orange); letter-spacing: 0.02em; }
.ev-countdown.ended { color: var(--text-dim); font-size: 14px; }
.ev-boostplan { margin-top: 12px; padding: 10px 12px; background: var(--panel-raised); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; color: var(--text-dim); }
.ev-boostplan-inputs { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.ev-boostplan-inputs .mini-input { width: 70px; }
.ev-boostplan-inputs .ev-sofar { width: 100px; }
.ev-boostplan-total { margin-top: 8px; }
.ev-boostplan-total b { font-family: var(--font-mono); color: var(--orange); font-size: 16px; margin: 0 6px; }
.ev-dim { color: var(--text-dim); }
.ev-table .ev-end { color: var(--blue-pale); font-weight: 600; }

/* Builder picker - "Event Holomems" filter (2026-11-28) */
.filter-checkbox.is-disabled { opacity: 0.45; cursor: not-allowed; }
.event-banner-badge { margin-left: 4px; padding: 1px 6px; border-radius: 4px; font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; background: var(--orange); color: #fff; vertical-align: middle; }
/* Event Points panel - target columns (2026-11-28) */
.ev-boostplan-inputs .ev-target { width: 110px; }
.ev-table .ev-ahead { color: var(--green-node); }
.ev-table .ev-short { color: var(--yellow-node); }
