:root {
  --bg:         #0c0d0e;
  --surface:    #14161a;
  --surface-2:  #1a1d22;
  --row-alt:    #16191d;
  --border:     #262a30;
  --border-2:   #353a42;
  --text:       #e8eaed;
  --text-dim:   #a8b0bb;
  --muted:      #6c747e;
  --muted-2:    #4a5058;
  --accent:     #e85d3c;
  --accent-dim: #b04025;
  --warn:       #f5b041;
  --danger:     #ef4444;

  /* WCL parse percentile colors */
  --p100: #ffd45e;
  --p99:  #ff5cb0;
  --p95:  #ff8000;
  --p75:  #c574ff;
  --p50:  #2ea7ff;
  --p25:  #1eff00;
  --p0:   #6c747e;

  /* WoW class colors — applied via .cc-<slug> */
  --cc-death-knight: #C41E3A;
  --cc-demon-hunter: #A330C9;
  --cc-druid:        #FF7C0A;
  --cc-evoker:       #33937F;
  --cc-hunter:       #AAD372;
  --cc-mage:         #3FC7EB;
  --cc-monk:         #00FF98;
  --cc-paladin:      #F48CBA;
  --cc-priest:       #FFFFFF;
  --cc-rogue:        #FFF468;
  --cc-shaman:       #0070DD;
  --cc-warlock:      #8788EE;
  --cc-warrior:      #C69B6D;

  --sans: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent-dim); color: var(--text); }

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.brand {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand .dot { color: var(--accent); }
.brand .tagline-inline { color: var(--muted); font-weight: 400; margin-left: 0.6rem; font-size: 0.78rem; }
@media (max-width: 720px) {
  .brand .tagline-inline { display: none; }
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.quota {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.quota .label { text-transform: uppercase; letter-spacing: 0.08em; }
.quota .val   { color: var(--text-dim); font-feature-settings: 'tnum'; }
.quota .bar {
  width: 80px;
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.quota .bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--accent);
  transition: width 0.4s ease;
}

/* Submit button */
button.submit {
  align-self: end;
  height: 34px;
  padding: 0 1rem;
  background: var(--accent);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--accent);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
button.submit:hover:not(:disabled) {
  background: #d4502f;
  border-color: #d4502f;
}
button.submit:disabled { opacity: 0.5; cursor: wait; }

/* Loading bar */
.progress {
  position: absolute;
  inset: auto auto 0 0;
  width: 100%;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
}
.progress i {
  position: absolute;
  height: 100%;
  width: 30%;
  background: var(--accent);
  animation: slide 1.1s ease-in-out infinite;
}
@keyframes slide {
  0%   { left: -30%; }
  100% { left: 100%; }
}

/* Layout — tray + main */
.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 49px);
}
@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .tray { border-right: 0; border-bottom: 1px solid var(--border); }
}

.tray {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tray-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.tray-section-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem 0.4rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.tray-section-h .count {
  color: var(--text-dim);
  font-feature-settings: 'tnum';
}
.tray-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  padding: 0 0.4rem 1rem;
  gap: 0.1rem;
  overflow-y: auto;
  flex: 1;
}
.tray-list .empty-tray {
  padding: 0.6rem 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
}

/* Tray nav entries — one per analysis. Click to activate (future: switch
   views). Visual model lifted from parses-net's .tray-tab. */
.tray-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.7rem 0.5rem 0.7rem;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--sans);
  color: var(--text-dim);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.tray-tab-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.tray-tab-name {
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  line-height: 1.2;
}
.tray-tab-meta {
  font-family: var(--mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tray-tab:hover { background: var(--bg); }
.tray-tab.active {
  background: var(--bg);
  border-left-color: var(--accent);
}
.tray-tab.active .tray-tab-meta { color: var(--text-dim); }
.tray-tab-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.02rem 0.32rem;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  vertical-align: 1px;
}
.tray-tab-tag.tag-alpha {
  color: var(--danger, #e85d3c);
  background: rgba(232, 93, 60, 0.12);
}
.tray-tab-tag.tag-beta {
  color: var(--accent);
  background: rgba(125, 211, 252, 0.12);
}

/* Inspect page */
.tool-main {
  padding: 1.75rem 1.5rem 3rem;
  min-width: 0;
}
.tool-main > * { max-width: 1100px; }

.tool-intro h1 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.tool-intro p {
  color: var(--text-dim);
  margin-top: 0.4rem;
  font-size: 0.9rem;
  max-width: 64ch;
}

.tool-form {
  display: flex;
  gap: 0.5rem;
  margin: 1.25rem 0 0.75rem 0;
  position: relative;
  align-items: stretch;
}
.tool-form input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 0.8rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  border-radius: 3px;
  min-width: 0;
}
.tool-form input:focus {
  outline: none;
  border-color: var(--accent);
}
.tool-form .submit { width: auto; padding: 0 1.25rem; }
.tool-form .progress { bottom: -1px; }

.tool-error {
  margin: 0.75rem 0;
  padding: 0.7rem 0.9rem;
  background: rgba(239, 68, 68, 0.08);
  border-left: 2px solid var(--danger);
  color: var(--danger);
  font-size: 0.88rem;
  font-family: var(--mono);
  border-radius: 0 3px 3px 0;
}

/* Report header */
.report-header { margin: 1.5rem 0 1rem 0; }
.report-header h2 {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.report-meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.25rem;
}
.report-meta a { color: var(--text-dim); text-decoration: none; }
.report-meta a:hover { color: var(--accent); }
.report-meta .sep { margin: 0 0.4rem; color: var(--muted-2); }

.report-summary {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}
.summary-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.3rem 0.65rem;
  border-radius: 3px;
  font-size: 0.82rem;
  color: var(--text-dim);
  font-family: var(--mono);
}
.summary-pill b { color: var(--text); font-weight: 500; }
.summary-pill.pass b { color: var(--p25); }
.summary-pill.fail b { color: var(--danger); }
.summary-pill.ungraded b { color: var(--muted); }
.summary-pill.muted { color: var(--muted); }

/* Empty / errors */
.empty {
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 3px;
  font-size: 0.88rem;
}
.empty-small {
  padding: 0.6rem 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Fight list */
.fight-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 1rem;
}

/* Group sections — only shown when there are 2+ raid groups in the report */
.group-section {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.4rem;
}
.group-section + .group-section { margin-top: 1.25rem; }
.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 0.85rem;
}
.group-title { display: flex; gap: 0.7rem; align-items: baseline; min-width: 0; }
.group-num {
  font-family: var(--mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.group-tanks {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.group-counts {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.group-pulls {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  margin-left: 0.4rem;
}
.group-fights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.fight-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
}
.fight-card.has-fails { border-left: 2px solid var(--danger); }
.fight-card.expanded { border-color: var(--border-2); }

.fight-top {
  display: flex;
  align-items: stretch;
}

.fight-summary {
  flex: 1;
  display: grid;
  grid-template-columns:
    minmax(70px, auto)
    minmax(60px, auto)
    minmax(60px, auto)
    minmax(60px, auto)
    1fr
    auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0.85rem;
  background: transparent;
  border: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
}
.fight-summary:hover { background: var(--surface-2); }
.fight-summary:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }

.fight-pull { font-weight: 500; }
.fight-status {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.1rem 0.45rem;
  border-radius: 2px;
  text-align: center;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.fight-kill { background: rgba(30, 255, 0, 0.1); color: var(--p25); }
.fight-wipe { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.fight-diff, .fight-duration {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
}
.fight-counts {
  display: flex;
  gap: 0.3rem;
  justify-self: end;
}
.fight-chevron {
  color: var(--muted);
  transition: transform 0.15s ease;
  font-size: 1rem;
  width: 1rem;
  text-align: center;
}
.fight-card.expanded .fight-chevron { transform: rotate(90deg); }

.fight-link {
  display: flex;
  align-items: center;
  padding: 0 0.7rem;
  color: var(--muted);
  text-decoration: none;
  border-left: 1px solid var(--border);
  font-size: 0.95rem;
}
.fight-link:hover { color: var(--accent); background: var(--surface-2); }

/* Per-judgement table */
.fight-details {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  padding: 0.4rem 0.5rem 0.5rem 0.5rem;
}

.judgement-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.judgement-table th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  padding: 0.4rem 0.6rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}
.judgement-table th.th-time { width: 5rem; }
.judgement-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.judgement-table tbody tr:last-child td { border-bottom: none; }
.judgement-table .time {
  font-family: var(--mono);
  color: var(--text-dim);
  white-space: nowrap;
}
.judgement-table .boss { color: var(--text-dim); }
.judgement-table .notes {
  color: var(--text-dim);
  font-size: 0.8rem;
}
.judgement-table tr.verdict-fail .notes .culprit {
  color: var(--danger);
  font-weight: 500;
}
.judgement-table .taunt-note { color: var(--muted); font-family: var(--mono); }
.judgement-table .taunt-note.muted { color: var(--muted-2); }

/* Tank death rows — visually distinct, span the rest of the table */
.judgement-table tr.death-row td {
  background: rgba(239, 68, 68, 0.06);
  color: var(--danger);
  font-size: 0.82rem;
}
.judgement-table tr.death-row .death-cell { font-family: var(--sans); }
.judgement-table tr.death-row b { color: var(--text); font-weight: 500; }
.judgement-table tr.death-row .death-marker {
  display: inline-block;
  margin-right: 0.4rem;
  color: var(--danger);
  font-size: 0.95rem;
}
.judgement-table tr.death-row .death-cause {
  color: var(--text-dim);
  font-weight: 500;
}
.judgement-table tr.death-row .death-killer { color: var(--muted); }

/* Battle-rez rows — symmetric to deaths, but green */
.judgement-table tr.rez-row td {
  background: rgba(30, 255, 0, 0.05);
  color: var(--p25);
  font-size: 0.82rem;
}
.judgement-table tr.rez-row .rez-cell { font-family: var(--sans); }
.judgement-table tr.rez-row b { color: var(--text); font-weight: 500; }
.judgement-table tr.rez-row .rez-marker {
  display: inline-block;
  margin-right: 0.4rem;
  color: var(--p25);
  font-size: 0.95rem;
}

/* Threat-shift rows — narrative rows whenever boss aggro changes hands. Two
   variants: passive ("out-threat") is a problem signal in yellow; taunt is
   intentional, treated as muted info. */
.judgement-table tr.threat-shift-row td { font-size: 0.82rem; }
.judgement-table tr.threat-shift-row .threat-shift-cell { font-family: var(--sans); }
.judgement-table tr.threat-shift-row b { color: var(--text); font-weight: 500; }
.judgement-table tr.threat-shift-row .threat-shift-marker {
  display: inline-block;
  margin-right: 0.4rem;
  font-size: 0.95rem;
}
.judgement-table tr.threat-shift-row .threat-shift-boss { color: var(--text-dim); }

/* Mistakes — yellow (warn) tint. */
.judgement-table tr.threat-shift-row.via-threat td,
.judgement-table tr.threat-shift-row.via-self-taunt td,
.judgement-table tr.threat-shift-row.via-wrong-boss td,
.judgement-table tr.threat-shift-row.via-double-tank td {
  background: rgba(245, 176, 65, 0.06);
  color: var(--warn);
}
.judgement-table tr.threat-shift-row.via-threat .threat-shift-marker,
.judgement-table tr.threat-shift-row.via-self-taunt .threat-shift-marker,
.judgement-table tr.threat-shift-row.via-wrong-boss .threat-shift-marker,
.judgement-table tr.threat-shift-row.via-double-tank .threat-shift-marker {
  color: var(--warn);
}

/* Info — muted, no tint (pull-start, intentional taunts, pre-taunts). */
.judgement-table tr.threat-shift-row.via-initial td,
.judgement-table tr.threat-shift-row.via-taunt td,
.judgement-table tr.threat-shift-row.via-pretaunt td {
  color: var(--muted);
}
.judgement-table tr.threat-shift-row.via-initial .threat-shift-marker,
.judgement-table tr.threat-shift-row.via-taunt .threat-shift-marker,
.judgement-table tr.threat-shift-row.via-pretaunt .threat-shift-marker {
  color: var(--muted-2);
}

/* WoW class colors — applied to tank names via class="cc-<slug>" */
.cc-death-knight  { color: var(--cc-death-knight); }
.cc-demon-hunter  { color: var(--cc-demon-hunter); }
.cc-druid         { color: var(--cc-druid); }
.cc-evoker        { color: var(--cc-evoker); }
.cc-hunter        { color: var(--cc-hunter); }
.cc-mage          { color: var(--cc-mage); }
.cc-monk          { color: var(--cc-monk); }
.cc-paladin       { color: var(--cc-paladin); }
.cc-priest        { color: var(--cc-priest); }
.cc-rogue         { color: var(--cc-rogue); }
.cc-shaman        { color: var(--cc-shaman); }
.cc-warlock       { color: var(--cc-warlock); }
.cc-warrior       { color: var(--cc-warrior); }

/* Verdict badges */
.badge,
.verdict-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.74rem;
  padding: 0.1rem 0.45rem;
  border-radius: 2px;
  background: var(--surface-2);
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  min-width: 1.5rem;
  text-align: center;
}
.badge-pass, .verdict-badge-pass {
  background: rgba(30, 255, 0, 0.1);
  color: var(--p25);
}
.badge-fail, .verdict-badge-fail {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}
.badge-ungraded, .verdict-badge-ungraded {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}

@media (max-width: 720px) {
  .fight-summary {
    grid-template-columns: auto auto 1fr auto;
    gap: 0.6rem;
  }
  .fight-diff { display: none; }
  .judgement-table th:nth-child(3),
  .judgement-table td:nth-child(3),
  .judgement-table th:nth-child(4),
  .judgement-table td:nth-child(4) { display: none; }
  .judgement-table .notes { font-size: 0.78rem; }
}

/* ============================================================
   Applicant lookup view
   ============================================================ */

.applicants-form {
  flex-direction: column;
  align-items: stretch;
}
.applicants-form textarea {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.7rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.45;
  border-radius: 3px;
}
.applicants-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.applicants-form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.7rem;
  position: relative;
}
.applicants-form-row .submit { width: auto; padding: 0 1.25rem; }
.applicants-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.applicants-toggle input {
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
}
.applicants-toggle:hover { color: var(--text); }
.applicants-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Unified filter visibility. applyFilters() in app.js sets `.filtered` on
   cards (Hide-No-Comment + role-toggle composition) and on groups whose
   every card is filtered, so the chain-header doesn't sit alone. */
.applicant-card.filtered,
.applicant-group.filtered {
  display: none;
}

/* Display-filter bar sitting just above the applicant list. Pill-styled
   toggles so the on/off state reads from across the page, unlike the small
   inline checkboxes used for "Auto-lookup" inside the form row. */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0.55rem 0 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
}
.filter-bar-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  margin-right: 0.3rem;
}
.filter-bar-sep {
  width: 1px;
  height: 1.3rem;
  background: var(--border);
  margin: 0 0.2rem;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.filter-pill input {
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
}
.filter-pill:hover {
  color: var(--text);
  border-color: var(--muted-2);
}
.filter-pill:has(input:checked) {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--p75);
}

/* Push the sort group to the right edge of the filter bar so filters and
   sort are visually disambiguated even without a separator. */
.filter-bar-spacer {
  margin-left: auto;
  width: 0;
}

/* Sort pills — same shape as filter pills but real <button>s. The arrow
   glyph carries the current state; muted dash means "off". */
.sort-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem 0.35rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.sort-pill:hover {
  color: var(--text);
  border-color: var(--muted-2);
}
.sort-pill.active {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--p75);
}
.sort-arrow {
  display: inline-block;
  width: 0.8rem;
  text-align: center;
  font-size: 0.65rem;
  color: var(--muted-2);
  font-feature-settings: 'tnum';
}
.sort-pill.active .sort-arrow { color: var(--text); }

/* Filter bar — buttons for each comment token that recurs in this paste.
   Click toggles a filter: matching cards stay lit, others fade to .dimmed. */
.comment-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 0.25rem;
}
.comment-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.55rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 3px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.74rem;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.comment-filter:hover { background: var(--surface-2); border-color: var(--border-2); }
.comment-filter.active {
  background: rgba(232, 93, 60, 0.12);
  border-color: var(--accent);
  color: var(--text);
}
.cf-token { letter-spacing: 0.02em; }
.cf-count {
  color: var(--muted);
  font-feature-settings: 'tnum';
}
.comment-filter.active .cf-count { color: var(--accent); }

.applicant-card.dimmed { opacity: 0.22; }

/* Sticky column-label row above the list. Renders once instead of per-card,
   stays visible while scrolling. Grid columns mirror .ps-row inside cards so
   labels line up over their data cells; left/right padding matches card
   padding so the alignment carries through the visual gap. */
.parse-strip-header {
  display: grid;
  grid-template-columns: 2.4rem 2.5rem 1fr 4rem;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  margin: 0.5rem 0 0.4rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.parse-strip-header .ph-tag {
  text-align: right;
  padding-right: 0.4rem;
  color: var(--muted-2);
}
.parse-strip-header .ph-tag-tier {
  text-align: center;
  padding-right: 0;
}
.parse-strip-header .ph-cells {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 0.25rem;
}
.parse-strip-header .ph-label {
  display: block;
  text-align: center;
  cursor: help;
}

/* Compact group-composition strip above the applicants list. Class-colored
   squares grouped by role on the left (tanks · DPS · heals, each its own
   horizontal run), raid-buff coverage chips on the right. Vertical-rule
   separators between role blocks (and between roles and buffs) carry the
   "this is a new section" cue without needing labels to do it. */
.group-comp {
  display: flex;
  align-items: stretch;
  margin: 0.6rem 0 0.5rem;
  padding: 0.55rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow-x: auto;
}
.gc-roles {
  display: flex;
  align-items: stretch;
}
.gc-role {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0 0.9rem;
}
.gc-role:first-child { padding-left: 0; }
.gc-role + .gc-role { border-left: 1px solid var(--border); }
.gc-role-label {
  font-family: var(--mono);
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
}
.gc-chips {
  display: flex;
  flex-direction: row;
  gap: 3px;
  align-items: center;
  flex: 1;
}
.gc-chip {
  display: block;
  width: 22px;
  height: 22px;
  background: currentColor;
  border-radius: 2px;
  cursor: help;
  flex-shrink: 0;
}

.gc-buffs {
  display: flex;
  gap: 0.3rem;
  margin-left: auto;
  align-items: center;
  padding-left: 0.9rem;
  border-left: 1px solid var(--border);
}
.gc-buff {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 1.7rem;
  padding: 0 0.45rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: 2px;
  border: 1px solid var(--border);
  cursor: help;
}
.gc-buff.has {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--p75);
}
.gc-buff.missing {
  background: transparent;
  color: var(--muted-2);
  border-style: dashed;
  text-decoration: line-through;
  text-decoration-color: var(--muted-2);
  opacity: 0.55;
}

/* List of applicant cards (or grouped premades). */
.applicant-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0;
}

.applicant-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.applicant-group.is-premade {
  padding: 0.6rem;
  background: rgba(232, 93, 60, 0.04);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 3px;
}
.premade-header {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding: 0 0.2rem 0.3rem;
}
.premade-marker { margin-right: 0.3rem; }

.applicant-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.5rem 0.8rem;
  transition: opacity 0.15s;
}

.ac-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem 0.85rem;
  font-size: 0.88rem;
}
.ac-name {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
}
.ac-spec {
  color: var(--text-dim);
  font-size: 0.8rem;
}
.ac-role {
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.08rem 0.35rem;
  border-radius: 2px;
  background: var(--surface-2);
  color: var(--text-dim);
}
.ac-role.role-TANK   { color: var(--p50); }
.ac-role.role-HEALER { color: var(--p25); }
.ac-role.role-DAMAGER{ color: var(--warn); }
.ac-ilvl {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}
.ac-tier {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.ac-tier .tier-tag {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-left: 0.25rem;
}
.ac-tier .tier-tag:first-child { margin-left: 0; }
.ac-link {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.85rem;
  text-decoration: none;
  margin-left: 0.2rem;
}
.ac-link:hover { color: var(--accent); }

.ac-comment {
  color: var(--text-dim);
  font-size: 0.78rem;
  font-style: italic;
  /* Cap width so a chatty free-text comment doesn't push ↗ off-screen — the
     header is flex-wrap so it'll spill to a second line if needed. */
  max-width: 32ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ac-body {
  margin-top: 0.6rem;
}
.ac-empty {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--mono);
  padding: 0.3rem 0;
}

/* Horizontal per-boss parse strip — one row per difficulty, columns line up
   between H and M so a vertical scan reads cleanly. */
.parse-strip {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.ps-row {
  display: grid;
  grid-template-columns: 2.4rem 2.5rem 1fr 4rem;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.ps-prog {
  text-align: right;
  padding-right: 0.4rem;
  font-feature-settings: 'tnum';
  font-size: 0.74rem;
}
.ps-prog .prog       { color: var(--text-dim); }
.ps-prog .prog.full  { color: var(--p25); }
.ps-prog .prog.zero  { color: var(--muted); }
.ps-prog .prog-empty { color: var(--muted-2); }
.ps-diff {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-align: right;
  padding-right: 0.2rem;
  border-right: 1px solid var(--border);
}
.ps-tier {
  font-feature-settings: 'tnum';
  text-align: center;
  border-left: 1px solid var(--border);
  padding-left: 0.5rem;
}
.ps-tier .parse {
  font-size: 1.15rem;
  font-weight: 700;
  min-width: 2.4rem;
  text-align: center;
}
.ps-cells {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 0.25rem;
}
.ps-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.2rem 0.3rem;
  background: var(--surface-2);
  border-radius: 2px;
  font-feature-settings: 'tnum';
  min-width: 0;
  white-space: nowrap;
}
.ps-cell.empty {
  background: transparent;
  color: var(--muted-2);
}
/* When the cell carries parse data it's a <button>; reset native chrome and
   add a hover/active affordance so the click target reads as interactive. */
button.ps-cell {
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 0.1s, outline-color 0.1s;
}
button.ps-cell:hover { background: var(--surface-3, #1f2024); }
button.ps-cell.active {
  outline: 1.5px solid var(--p75);
  outline-offset: -1px;
}

/* Per-cell parse-history drawer. Renders below the parse-strip when a cell
   is clicked; one drawer per card, replaces itself when the target changes. */
.ac-drawer {
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
}
.acd-header {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.acd-loading,
.acd-empty,
.acd-error {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.2rem 0;
}
.acd-error { color: var(--accent, #e85d3c); }
.acd-table {
  display: flex;
  flex-direction: column;
}
.acd-row {
  display: grid;
  grid-template-columns: 3.4rem 2.2rem 2.4rem 2.4rem 6.5rem 4rem 3.6rem 1.2rem;
  align-items: center;
  gap: 0.45rem;
  width: max-content;
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.3rem;
  border-radius: 2px;
}
.acd-row:hover { background: var(--surface-2); }
.acd-row.locked { background: rgba(232, 93, 60, 0.04); }
.acd-row.acd-row-head {
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  padding-bottom: 0.15rem;
  margin-bottom: 0.1rem;
  border-bottom: 1px solid var(--border);
}
.acd-row.acd-row-head:hover { background: transparent; }
.acd-date { color: var(--muted); }
.acd-pct { text-align: right; }
.acd-bracket-pct { opacity: 0.92; }
.acd-ilvl { text-align: right; color: var(--text-dim); font-feature-settings: 'tnum'; }
.acd-spec {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acd-amount,
.acd-dur { text-align: right; font-feature-settings: 'tnum'; }
.acd-link { text-align: right; }
.acd-link a { color: var(--muted); text-decoration: none; }
.acd-link a:hover { color: var(--accent, #e85d3c); }
.ps-cell .spec-icon { margin-left: 0; }
.ps-kills {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.66rem;
  color: var(--muted);
  font-feature-settings: 'tnum';
}
.ps-skull {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  opacity: 0.85;
}

/* WCL parse percentile coloring — shared between tier-avg and per-boss. */
.parse {
  display: inline-block;
  min-width: 1.6rem;
  text-align: right;
  font-feature-settings: 'tnum';
  font-weight: 600;
}
.parse-100 { color: var(--p100); }
.parse-99  { color: var(--p99);  }
.parse-95  { color: var(--p95);  }
.parse-75  { color: var(--p75);  }
.parse-50  { color: var(--p50);  }
.parse-25  { color: var(--p25);  }
.parse-0,
.parse-na  { color: var(--muted); }

@media (max-width: 720px) {
  .ac-tier { margin-left: 0; width: 100%; }
  .ps-row { grid-template-columns: 2rem 2.6rem 1fr 3.2rem; gap: 0.3rem; font-size: 0.72rem; }
  .ps-tier .parse { font-size: 1rem; min-width: 2rem; }
  .parse-strip-header { grid-template-columns: 2rem 2.6rem 1fr 3.2rem; gap: 0.3rem; }
}

/* WCL spec sprite — single sheet from the RPGLogs CDN, sliced via
   object-position. The class names are fixed by the sheet's column layout,
   so don't rename them. Keep this block in sync with parses-net's copy. */
.sprite { object-fit: cover; }
.spec-icon {
  width: 12px;
  height: 12px;
  --size: 12;
  vertical-align: -1px;
  border-radius: 2px;
  border: 1px solid var(--muted-2);
  box-sizing: content-box;
}
.actor-sprite-Boss{object-position:calc(0px*var(--size))0}
.actor-sprite-DeathKnight-Blood{object-position:calc(-1px*var(--size))0}
.actor-sprite-DeathKnight-BloodDPS{object-position:calc(-2px*var(--size))0}
.actor-sprite-DeathKnight-Frost{object-position:calc(-3px*var(--size))0}
.actor-sprite-DeathKnight-Lichborne{object-position:calc(-4px*var(--size))0}
.actor-sprite-DeathKnight-Melee{object-position:calc(-5px*var(--size))0}
.actor-sprite-DeathKnight-Runeblade{object-position:calc(-6px*var(--size))0}
.actor-sprite-DeathKnight-Unholy{object-position:calc(-7px*var(--size))0}
.actor-sprite-DeathKnight{object-position:calc(-8px*var(--size))0}
.actor-sprite-DemonHunter-Devourer{object-position:calc(-9px*var(--size))0}
.actor-sprite-DemonHunter-Havoc{object-position:calc(-10px*var(--size))0}
.actor-sprite-DemonHunter-Vengeance{object-position:calc(-11px*var(--size))0}
.actor-sprite-DemonHunter{object-position:calc(-12px*var(--size))0}
.actor-sprite-Druid-Balance{object-position:calc(-13px*var(--size))0}
.actor-sprite-Druid-Dreamstate{object-position:calc(-14px*var(--size))0}
.actor-sprite-Druid-Feral{object-position:calc(-15px*var(--size))0}
.actor-sprite-Druid-Guardian{object-position:calc(-16px*var(--size))0}
.actor-sprite-Druid-Restoration{object-position:calc(-17px*var(--size))0}
.actor-sprite-Druid-Warden{object-position:calc(-18px*var(--size))0}
.actor-sprite-Druid{object-position:calc(-19px*var(--size))0}
.actor-sprite-Evoker-Augmentation{object-position:calc(-20px*var(--size))0}
.actor-sprite-Evoker-Devastation{object-position:calc(-21px*var(--size))0}
.actor-sprite-Evoker-Preservation{object-position:calc(-22px*var(--size))0}
.actor-sprite-Evoker-Ranged{object-position:calc(-23px*var(--size))0}
.actor-sprite-Evoker{object-position:calc(-24px*var(--size))0}
.actor-sprite-Hunter-BeastMastery{object-position:calc(-25px*var(--size))0}
.actor-sprite-Hunter-Marksmanship{object-position:calc(-26px*var(--size))0}
.actor-sprite-Hunter-Melee{object-position:calc(-27px*var(--size))0}
.actor-sprite-Hunter-Ranged{object-position:calc(-28px*var(--size))0}
.actor-sprite-Hunter-Survival{object-position:calc(-29px*var(--size))0}
.actor-sprite-Hunter{object-position:calc(-30px*var(--size))0}
.actor-sprite-Mage-Arcane{object-position:calc(-31px*var(--size))0}
.actor-sprite-Mage-Fire{object-position:calc(-32px*var(--size))0}
.actor-sprite-Mage-Frost{object-position:calc(-33px*var(--size))0}
.actor-sprite-Mage-Healer{object-position:calc(-34px*var(--size))0}
.actor-sprite-Mage-Ranged{object-position:calc(-35px*var(--size))0}
.actor-sprite-Mage{object-position:calc(-36px*var(--size))0}
.actor-sprite-Monk-Brewmaster{object-position:calc(-37px*var(--size))0}
.actor-sprite-Monk-Mistweaver{object-position:calc(-38px*var(--size))0}
.actor-sprite-Monk-Windwalker{object-position:calc(-39px*var(--size))0}
.actor-sprite-Monk{object-position:calc(-40px*var(--size))0}
.actor-sprite-NPC{object-position:calc(-41px*var(--size))0}
.actor-sprite-Paladin-Holy{object-position:calc(-42px*var(--size))0}
.actor-sprite-Paladin-Justicar{object-position:calc(-43px*var(--size))0}
.actor-sprite-Paladin-Protection{object-position:calc(-44px*var(--size))0}
.actor-sprite-Paladin-Retribution{object-position:calc(-45px*var(--size))0}
.actor-sprite-Paladin{object-position:calc(-46px*var(--size))0}
.actor-sprite-Pet{object-position:calc(-47px*var(--size))0}
.actor-sprite-Priest-Discipline{object-position:calc(-48px*var(--size))0}
.actor-sprite-Priest-Healing{object-position:calc(-49px*var(--size))0}
.actor-sprite-Priest-Holy{object-position:calc(-50px*var(--size))0}
.actor-sprite-Priest-Shadow{object-position:calc(-51px*var(--size))0}
.actor-sprite-Priest-Smiter{object-position:calc(-52px*var(--size))0}
.actor-sprite-Priest{object-position:calc(-53px*var(--size))0}
.actor-sprite-Rogue-Assassination{object-position:calc(-54px*var(--size))0}
.actor-sprite-Rogue-Combat{object-position:calc(-55px*var(--size))0}
.actor-sprite-Rogue-Melee{object-position:calc(-56px*var(--size))0}
.actor-sprite-Rogue-Outlaw{object-position:calc(-57px*var(--size))0}
.actor-sprite-Rogue-Subtlety{object-position:calc(-58px*var(--size))0}
.actor-sprite-Rogue-Tank{object-position:calc(-59px*var(--size))0}
.actor-sprite-Rogue{object-position:calc(-60px*var(--size))0}
.actor-sprite-Shaman-Elemental{object-position:calc(-61px*var(--size))0}
.actor-sprite-Shaman-Enhancement{object-position:calc(-62px*var(--size))0}
.actor-sprite-Shaman-Restoration{object-position:calc(-63px*var(--size))0}
.actor-sprite-Shaman-Tank{object-position:calc(-64px*var(--size))0}
.actor-sprite-Shaman{object-position:calc(-65px*var(--size))0}
.actor-sprite-TricksOfTheTrade{object-position:calc(-66px*var(--size))0}
.actor-sprite-UnholyFrenzy{object-position:calc(-67px*var(--size))0}
.actor-sprite-Warlock-Affliction{object-position:calc(-68px*var(--size))0}
.actor-sprite-Warlock-Demonology{object-position:calc(-69px*var(--size))0}
.actor-sprite-Warlock-Destruction{object-position:calc(-70px*var(--size))0}
.actor-sprite-Warlock-Ranged{object-position:calc(-71px*var(--size))0}
.actor-sprite-Warlock-Tank{object-position:calc(-72px*var(--size))0}
.actor-sprite-Warlock{object-position:calc(-73px*var(--size))0}
.actor-sprite-Warrior-Arms{object-position:calc(-74px*var(--size))0}
.actor-sprite-Warrior-Champion{object-position:calc(-75px*var(--size))0}
.actor-sprite-Warrior-Fury{object-position:calc(-76px*var(--size))0}
.actor-sprite-Warrior-Gladiator{object-position:calc(-77px*var(--size))0}
.actor-sprite-Warrior-Melee{object-position:calc(-78px*var(--size))0}
.actor-sprite-Warrior-Protection{object-position:calc(-79px*var(--size))0}
.actor-sprite-Warrior-Warden{object-position:calc(-80px*var(--size))0}
.actor-sprite-Warrior{object-position:calc(-81px*var(--size))0}

/* --- Belo'ren CD audit ----------------------------------------------------
   Pull cards reuse .fight-card (border + surface). The header and player
   list are dedicated to this tool. Each player gets one row with name,
   role, flagged-CD chips, and a potion verdict pill. */
.fight-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.8rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  /* Reset native <button> styles so the clickable variant matches the static one. */
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  border-left: none;
  border-right: none;
  border-top: none;
  cursor: pointer;
}
.fight-card-header.static { cursor: default; }
button.fight-card-header:hover { background: var(--surface-3, var(--surface-2)); }
button.fight-card-header:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}
/* When the pull is collapsed there's no body below; drop the redundant
   border to avoid a double rule visually. */
.fight-card:not(.expanded) > .fight-card-header { border-bottom-color: transparent; }
.fight-card-details {
  /* Body keeps its own background; header border-bottom provides the divider. */
}
.fight-card-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.85rem;
}
.fight-card-title .fight-num {
  font-weight: 600;
  color: var(--text);
}
.fight-card-title .fight-dur,
.fight-card-title .fight-egg {
  color: var(--muted);
  font-size: 0.74rem;
  font-feature-settings: 'tnum';
}
.fight-card-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.fight-card-pills {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.belo-player-list {
  list-style: none;
  margin: 0;
  padding: 0.3rem 0;
}
.belo-player {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) 3.5rem 1fr minmax(7rem, auto);
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.8rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border);
}
.belo-player:last-child { border-bottom: 0; }
.belo-player.clean { opacity: 0.55; }
.belo-player-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.belo-player-role {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
}
.belo-player-flagged {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.belo-cd-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.45rem;
  background: rgba(232, 93, 60, 0.08);
  color: var(--text);
  border: 1px solid var(--danger, #e85d3c);
  border-radius: 2px;
  font-size: 0.7rem;
  white-space: nowrap;
}
.belo-cd-time {
  color: var(--muted-2);
  font-style: normal;
  font-feature-settings: 'tnum';
  font-size: 0.65rem;
}
.belo-clean { color: var(--muted-2); }
.belo-player.ungraded { opacity: 0.6; }
.belo-ungraded {
  color: var(--muted);
  font-style: italic;
  font-size: 0.74rem;
}
.belo-player-potion { justify-self: end; }
.belo-potion {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 2px;
  font-size: 0.72rem;
  font-feature-settings: 'tnum';
  border: 1px solid var(--border);
}
.belo-potion.pass {
  background: rgba(86, 156, 86, 0.08);
  color: var(--p75, #c574ff);
  border-color: var(--p75, #c574ff);
}
.belo-potion.wasted {
  background: rgba(232, 93, 60, 0.06);
  color: var(--danger, #e85d3c);
  border-color: var(--danger, #e85d3c);
}
.belo-potion.skipped {
  background: transparent;
  color: var(--muted-2);
  border-style: dashed;
}

/* ---- M+ applicants ---- */

.mplus-card { display: grid; gap: 0.4rem; }

/* M+ card header: 3-column grid so the score sits centered between the
   left-aligned name group and the right-aligned badges. Overrides the
   default .ac-header flex layout (raid applicants still use flex). */
.mplus-card .ac-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}
.mplus-header-info {
  justify-self: start;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem 0.85rem;
}
.mplus-card .ac-header .mplus-scores {
  justify-self: center;
}
.mplus-card .ac-header .mplus-raid {
  justify-self: end;
  margin-left: 0; /* grid handles alignment; auto-margin no longer needed */
}

.mplus-scores {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--mono);
  font-feature-settings: 'tnum';
}
.mplus-score-chips {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}
.mplus-score-role {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}
.mplus-score-role .role-icon {
  width: 1.1em;
  height: 1.1em;
}
.mplus-scores.empty {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: italic;
}
.mplus-score-all {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.mplus-score-role {
  font-size: 0.78rem;
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
}
.mplus-score-role.dim {
  color: var(--muted-2) !important;
  opacity: 0.55;
}

.mplus-raid {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
  align-self: center;
}
.mplus-raid-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.45rem 1rem;
  border-radius: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-feature-settings: 'tnum';
  min-width: 5.5rem;
}
.mplus-raid-badge.dim { opacity: 0.45; }

.mplus-raid-diff {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.mplus-raid-parse {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.mplus-raid-prog {
  font-size: 0.66rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---- M+ group-comp (collapsible per-member rows) ---- */

.mplus-group-comp {
  margin: 0.6rem 0 1rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
}
.mplus-group-comp-h {
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.45rem 0.8rem 0.3rem;
  border-bottom: 1px solid var(--border);
}
.mplus-group-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mplus-group-row {
  border-bottom: 1px solid var(--border);
}
.mplus-group-row:last-child { border-bottom: none; }

.mplus-group-row-head {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.45rem 0.8rem;
  user-select: none;
}
.mplus-group-row.expandable .mplus-group-row-head { cursor: pointer; }
.mplus-group-row.expandable .mplus-group-row-head:hover { background: var(--surface-2); }
.mplus-group-row.disabled .mplus-group-row-head { opacity: 0.55; }

.mplus-group-realm {
  color: var(--muted);
  font-size: 0.78rem;
}
.mplus-group-chevron {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  transition: transform 0.1s;
}
.mplus-group-hint {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-2);
  font-style: italic;
}

.mplus-group-row-body {
  padding: 0.6rem 0.8rem 0.7rem;
  background: var(--surface-2);
  display: grid;
  gap: 0.4rem;
}
.mplus-group-loading,
.mplus-group-error {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}
.mplus-group-error { color: var(--danger, #e85d3c); }

/* ---- M+ per-dungeon strip ---- */

.mplus-dungeon-strip {
  display: grid;
  /* Eight dungeons in the current rotation. If WCL ever adds a ninth this
     will need to become auto-flow or compute the count from the data. */
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.25rem;
  margin-top: 0.4rem;
}
.mplus-dungeon-strip.empty {
  display: block;
  text-align: center;
  color: var(--muted);
  font-style: italic;
  font-size: 0.78rem;
  padding: 0.3rem;
}
.mplus-dungeon-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.25rem 0.2rem;
  border-radius: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-feature-settings: 'tnum';
  min-width: 0;
}
.mplus-dungeon-cell.empty {
  color: var(--muted-2);
  font-size: 0.78rem;
  align-items: center;
  justify-content: flex-start;
}
.mplus-cell-empty-dash {
  font-size: 1rem;
  color: var(--muted-2);
  margin: auto 0;
}
.mplus-cell-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
}
.mplus-cell-label-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding-bottom: 0.1rem;
  border-bottom: 1px solid var(--border);
  width: 100%;
}
.mplus-cell-label-row .spec-icon {
  /* Default 12x12 size from the base .spec-icon rule — keeps the parse
     number as the visual focus. `--size` is unit-less elsewhere (the
     sprite positioning math multiplies it by -1px), so don't override. */
  flex: 0 0 auto;
}
.mplus-cell-parse {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
}
.mplus-cell-key {
  font-size: 0.68rem;
  color: var(--text-dim);
}
.mplus-cell-key.untimed { color: var(--muted-2); }
.mplus-cell-key.dim { color: var(--muted-2); }
.mplus-cell-amount {
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
