/* Minimal, dark, table-friendly. */
:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e2230;
  --border: #2a2f3d;
  --fg: #e6e8ee;
  --muted: #8b91a1;
  --accent: #7fb3ff;
  --accent-2: #b48dff;
  --pos: #7ad68a;
  --neg: #ff9886;
  --ready: #7ad68a;
  --close: #ffd67a;
  --partial: #ff9886;
  --missing: #8b91a1;
  --ss: #ff7ad0;
  --s: #ffb07a;
  --a: #7fb3ff;
  --b: #b4b8c6;
  --c: #8b91a1;
  --d: #555a6c;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.5 system-ui, -apple-system, "SF Pro Text", Segoe UI, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
pre { background: var(--panel-2); padding: 8px 12px; border-radius: 6px; overflow-x: auto; }

header {
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  position: sticky; top: 0; z-index: 10;
}
.bar {
  max-width: 1200px; margin: 0 auto;
  padding: 10px 20px;
  display: flex; align-items: center; gap: 28px;
}
.brand { font-weight: 700; font-size: 16px; color: var(--accent-2); }
nav a { margin-right: 18px; color: var(--muted); }
nav a:hover { color: var(--fg); text-decoration: none; }
nav a.active {
  color: var(--fg);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

main { max-width: 1200px; margin: 0 auto; padding: 24px 20px 80px; }

h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 0 0 12px; color: var(--accent-2); }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

p { margin: 8px 0; }
.muted { color: var(--muted); font-size: 13px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.btn {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--fg);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); color: #0a0c14; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { background: #a0c5ff; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 6px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.list li:last-child { border-bottom: 0; }
.list.compact li { padding: 3px 0; font-size: 13px; border-bottom: 0; }
.list a.active { color: var(--accent-2); font-weight: 600; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; background: var(--panel-2); position: sticky; top: 0; }
tr:hover td { background: rgba(127, 179, 255, 0.05); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

.two-col { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
.sidebar { position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 80px); overflow-y: auto; }
@media (max-width: 800px) {
  .two-col { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; }
}

.prose h1, .prose h2, .prose h3 { margin-top: 24px; margin-bottom: 8px; color: var(--fg); }
.prose h2 { color: var(--accent-2); }
.prose table { margin: 12px 0; }
.prose table th { background: var(--panel-2); }
.prose p { margin: 6px 0; }
.prose blockquote { border-left: 3px solid var(--accent); padding: 4px 12px; color: var(--muted); margin: 8px 0; background: rgba(127, 179, 255, 0.05); border-radius: 0 6px 6px 0; }

.status { padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.status-ready { background: rgba(122, 214, 138, 0.15); color: var(--ready); }
.status-close { background: rgba(255, 214, 122, 0.15); color: var(--close); }
.status-partial { background: rgba(255, 152, 134, 0.15); color: var(--partial); }
.status-missing { background: rgba(139, 145, 161, 0.15); color: var(--missing); }

.tier { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 12px; font-weight: 700; }
.tier-ss { background: rgba(255, 122, 208, 0.15); color: var(--ss); }
.tier-s { background: rgba(255, 176, 122, 0.15); color: var(--s); }
.tier-a { background: rgba(127, 179, 255, 0.15); color: var(--a); }
.tier-b { background: rgba(180, 184, 198, 0.15); color: var(--b); }
.tier-c { background: rgba(139, 145, 161, 0.15); color: var(--c); }
.tier-d { background: rgba(85, 90, 108, 0.15); color: var(--d); }

.params { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.params label { display: flex; flex-direction: column; gap: 2px; }
.params .pname { font-weight: 600; font-size: 13px; }
.params .pmeta { color: var(--muted); font-size: 11px; }
.params input {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--fg);
  padding: 5px 8px; border-radius: 4px; font-family: inherit;
}
.params input:focus { outline: none; border-color: var(--accent); }
.actions { margin-top: 14px; display: flex; gap: 8px; }

th.sortable-header { cursor: pointer; }
th.sortable-header::after { content: ' ⇅'; opacity: 0.4; }
th.sorted-asc::after { content: ' ↑'; opacity: 1; }
th.sorted-desc::after { content: ' ↓'; opacity: 1; }

/* Checklist styling */
.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}
.checklist li {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.checklist li:last-child { border-bottom: 0; }
.checklist .check {
  font-size: 16px;
  text-align: center;
  width: 22px;
  height: 22px;
  line-height: 22px;
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--muted);
}
.checklist .done .check { background: rgba(122, 214, 138, 0.2); color: var(--pos); }
.checklist .blocked .check { background: rgba(139, 145, 161, 0.15); color: var(--muted); }
.checklist .done .desc { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(255,255,255,0.2); }
.checklist .blocked .desc { color: var(--muted); font-style: italic; }
.checklist .detail { color: var(--muted); font-size: 12px; }
.badge { font-size: 11px; padding: 2px 7px; border-radius: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.badge-high { background: rgba(255, 152, 134, 0.15); color: var(--neg); }
.badge-medium { background: rgba(255, 214, 122, 0.15); color: var(--close); }
.badge-low { background: rgba(139, 145, 161, 0.15); color: var(--muted); }

/* Sort high-priority first visually: higher-priority items are darker-tinted. */
.priority-high { background: rgba(255, 152, 134, 0.03); }

.small { font-size: 12px; }

/* Progress bar */
.progress-bar-wrap {
  height: 10px;
  background: var(--panel-2);
  border-radius: 5px;
  overflow: hidden;
  margin: 6px 0 4px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--pos));
  border-radius: 5px;
  transition: width 0.2s;
}
.progress-mini { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; width: 80px; display: inline-block; vertical-align: middle; margin-right: 6px; }
.progress-mini .progress-bar { height: 100%; }

.lineup { display: flex; flex-wrap: wrap; gap: 4px; }
.slot {
  background: var(--panel-2);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.slot-focus { background: rgba(127, 179, 255, 0.15); border-color: var(--accent); color: var(--fg); font-weight: 600; }
.slot-sub { opacity: 0.75; border-style: dashed; }
.slot-empty { color: var(--muted); font-style: italic; }

.reaction-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 214, 122, 0.15);
  color: var(--close);
}

.legend { list-style: none; padding: 0; margin: 0; font-size: 13px; color: var(--muted); }
.legend li { padding: 3px 0; border-bottom: 1px solid var(--border); }
.legend li:last-child { border-bottom: 0; }
.legend strong { color: var(--fg); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; margin-right: 6px; }

.pity-form-table input[type="number"],
.pity-form-table input[type="text"] {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 5px 8px;
  border-radius: 4px;
  font-family: inherit;
  width: 100%;
}
.pity-form-table input:focus { outline: none; border-color: var(--accent); }
.pity-form-table td { vertical-align: middle; }

/* Banner / pity cards */
.banner-card h2 { margin-top: 0; }
.banner-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.banner-head-right { color: var(--muted); font-size: 13px; }
.pity-row { display: flex; align-items: center; gap: 16px; margin: 10px 0; }
.pity-number { min-width: 90px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pity-current { font-size: 26px; font-weight: 700; color: var(--accent); }
.pity-current.soft { color: var(--close); }
.pity-max { color: var(--muted); font-size: 14px; margin-left: 4px; }
.pity-bar-wrap {
  position: relative;
  flex: 1;
  height: 14px;
  background: var(--panel-2);
  border-radius: 7px;
  overflow: hidden;
}
.pity-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #a0c5ff);
  border-radius: 7px;
  transition: width 0.2s;
}
.pity-bar.soft {
  background: linear-gradient(90deg, var(--close), #ffb56a);
}
.pity-soft-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}
details summary {
  cursor: pointer;
  color: var(--accent);
  margin-top: 8px;
  user-select: none;
}
details summary:hover { color: #a0c5ff; }
details table { margin-top: 8px; }

.note {
  padding: 10px 14px;
  background: rgba(127, 179, 255, 0.07);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  color: var(--muted);
  margin: 12px 0 18px;
}

/* Dashboard */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.hero-main h1 { margin-bottom: 2px; }
.hero-stats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.hero-stats > div {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
}
.hero-stats strong {
  font-size: 18px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-right: 6px;
}
.hero-stats span {
  font-size: 12px;
  color: var(--muted);
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.dash-grid .card { margin-bottom: 0; }
.dash-grid .span-2 { grid-column: span 2; }
@media (max-width: 800px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid .span-2 { grid-column: span 1; }
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}
.card-head h2 { margin: 0; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.page-head h1 { margin: 0; }

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.inline-form select,
.inline-form input[type="text"] {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 6px 8px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
}
.inline-form select:focus { outline: none; border-color: var(--accent); }

.btn.btn-small {
  padding: 4px 10px;
  font-size: 12px;
}

.m0 { margin: 0 0 6px; }

.dash-subhead {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 14px 0 6px;
}

.checklist.compact li {
  padding: 4px 0;
  font-size: 13px;
}

.lineup.big .slot {
  font-size: 13px;
  padding: 5px 10px;
}

.dash-runners {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
}
.dash-runners li {
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 10px;
}
.dash-runners li:last-child { border-bottom: 0; }
.dash-runners .num {
  min-width: 44px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Best DPS runners-up: fixed-width score column + wrapping meta line +
   lineup row underneath. Two-row grid keeps everything aligned regardless
   of how long the DPS name or archetype name happens to be. */
.dps-runners {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
}
.dps-runners li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 52px 1fr;
  grid-template-rows: auto auto;
  gap: 4px 12px;
  align-items: center;
}
.dps-runners li:last-child { border-bottom: 0; }
.dps-runners .score {
  grid-row: 1 / 3;
  align-self: center;
  text-align: right;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 15px;
}
.dps-runners .meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.dps-runners .meta a { white-space: nowrap; }
.dps-runners .lineup.compact { gap: 3px; }
.dps-runners .lineup.compact .slot {
  font-size: 11px;
  padding: 2px 6px;
}

.invest-list {
  list-style: decimal inside;
  padding: 0;
  margin: 0;
}
.invest-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.invest-list li:last-child { border-bottom: 0; }

.dash-issues {
  list-style: none;
  padding: 0;
  margin: 0;
}
.dash-issues > li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.dash-issues > li:last-child { border-bottom: 0; }
.dash-issues .flags {
  list-style: disc inside;
  padding: 0;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.dash-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.dash-meta li {
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.dash-meta li:last-child { border-bottom: 0; }

.pity-mini {
  display: grid;
  grid-template-columns: 90px 1fr 60px;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.pity-mini:last-child { border-bottom: 0; }
.pity-mini-name { font-size: 12px; color: var(--muted); }
.pity-mini-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--accent);
}
.pity-mini-num.soft { color: var(--close); font-weight: 600; }
.pity-mini .pity-bar-wrap { height: 8px; }

/* DPS plans / advisory */
.advisory {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(255, 122, 208, 0.08);
  border-left: 3px solid var(--ss);
  border-radius: 0 6px 6px 0;
  font-size: 13px;
}
.advisory strong { color: var(--ss); }

.advisory-card {
  border-left: 3px solid var(--ss);
  background: linear-gradient(90deg, rgba(255, 122, 208, 0.06), var(--panel) 80%);
}
.advisory-card h2 { color: var(--ss); }

.dps-rank { font-size: 13px; }
.dps-rank td.num,
.dps-rank th.num { text-align: right; }

.dps-plan {
  scroll-margin-top: 60px;  /* anchor links don't hide under sticky header */
}
.dps-plan .lineup { margin: 12px 0; }

.quick-wins {
  list-style: none;
  padding: 0;
  margin: 0;
}
.quick-wins li {
  display: grid;
  grid-template-columns: 60px 80px 1fr 60px;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.quick-wins li:last-child { border-bottom: 0; }
.quick-wins .desc { line-height: 1.4; }
.quick-wins .num {
  text-align: right;
  color: var(--pos);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.quick-wins li.effort-high .num { color: var(--accent); }
.quick-wins .badge { text-align: center; }

/* Compact variant for the dashboard Best DPS card — drops the category
   badge so quick wins fit alongside the lineup + runners-up. */
.quick-wins.compact li {
  grid-template-columns: 60px 1fr 60px;
  font-size: 12.5px;
  padding: 4px 0;
}

/* Weapon advice — tiered lists with ownership annotations */
.weapon-tier-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.weapon-tier-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.weapon-tier-list li:last-child { border-bottom: 0; }
.weapon-tier-list li.current {
  background: rgba(127, 179, 255, 0.06);
  padding-left: 8px;
  border-radius: 4px;
}
.weapon-tier-list .weapon-name { flex: 1; font-weight: 500; }
.weapon-source {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--border);
  cursor: help;
}
/* Source-tinted accents — easy to distinguish at a glance */
.weapon-source-craftable { background: rgba(122, 214, 138, 0.12); color: var(--pos); border-color: rgba(122, 214, 138, 0.3); }
.weapon-source-event { background: rgba(180, 141, 255, 0.12); color: var(--accent-2); border-color: rgba(180, 141, 255, 0.3); }
.weapon-source-battle-pass { background: rgba(255, 152, 134, 0.10); color: var(--neg); border-color: rgba(255, 152, 134, 0.3); }
.weapon-source-starglitter { background: rgba(255, 214, 122, 0.12); color: var(--close); border-color: rgba(255, 214, 122, 0.3); }
.weapon-source-quest { background: rgba(127, 179, 255, 0.10); color: var(--accent); border-color: rgba(127, 179, 255, 0.3); }
.weapon-source-fishing { background: rgba(127, 179, 255, 0.10); color: var(--accent); border-color: rgba(127, 179, 255, 0.3); }
.weapon-source-standard-gacha { background: var(--panel-2); color: var(--muted); }
.weapon-source-limited-gacha { background: rgba(255, 122, 208, 0.10); color: var(--ss); border-color: rgba(255, 122, 208, 0.3); }

.dash-subhead.tier-ideal { color: var(--ss); }
.dash-subhead.tier-good { color: var(--accent); }
.dash-subhead.tier-niche { color: var(--close); }
.dash-subhead.tier-bad { color: var(--neg); }

/* Actions page */
.actions-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 16px;
}
.action-card { margin-bottom: 0; }
.action-card h2 { margin-top: 0; }
.action-card .btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.action-card code {
  font-size: 0.9em;
}
.action-log {
  background: #06080d;
  color: #d8dee9;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
  max-height: 360px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.job-meta { margin-bottom: 8px; }
.status-running { color: var(--accent); }
.status-pending { color: var(--muted); }
.status-done { color: var(--pos); }
.status-failed { color: var(--neg); }

/* Marker-not-fielded hint */
.marker-hint {
  background: rgba(255, 214, 122, 0.10);
  border-left: 3px solid var(--close);
  color: var(--close);
  padding: 8px 12px;
  border-radius: 4px;
  margin-top: 8px;
  font-size: 13px;
}

/* Data landing page */
.data-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 16px;
}
.data-card { margin-bottom: 0; }
.data-card h2 { margin-top: 0; }
.data-card .btn { margin-right: 6px; }

/* Resin priority card */
.resin-bar-wrap {
  height: 8px;
  background: var(--panel-2);
  border-radius: 4px;
  overflow: hidden;
  margin: 4px 0 6px;
}
.resin-bar {
  height: 100%;
  background: linear-gradient(90deg, #5a8eff, #7fb3ff);
  border-radius: 4px;
  transition: width 0.2s;
}
.resin-bar.cap {
  background: linear-gradient(90deg, var(--neg), var(--close));
}
.m0 { margin-top: 0; margin-bottom: 0; }

/* Per-source tier consensus list on /goal */
.source-tiers { padding: 14px 18px; }
.source-tiers h3 { margin: 0 0 8px; }
.source-tier-list {
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
}
.source-tier-list li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.source-tier-list .source-name {
  color: var(--muted);
}
.source-tier-list li.consensus {
  border-left: 2px solid var(--border);
  padding-left: 14px;
}

/* Pull-priority table on /wishes */
.wish-recs { font-size: 13px; }
.wish-recs td a { white-space: nowrap; }
.wish-recs .tier {
  margin-left: 4px;
  font-size: 10px;
  padding: 1px 4px;
}

/* Abyss MVP list */
.abyss-mvps {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}
.abyss-mvps li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.abyss-mvps li:last-child { border-bottom: 0; }
.abyss-mvps .num {
  text-align: right;
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Roster composition card */
.composition-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  margin-top: 8px;
}
.composition-block h3 { margin: 0 0 8px; }
.composition-rarity { margin: 6px 0; font-size: 14px; }
.histo {
  list-style: none;
  padding: 0;
  margin: 0;
}
.histo li {
  display: grid;
  grid-template-columns: 70px 1fr 28px;
  gap: 8px;
  align-items: center;
  padding: 3px 0;
  font-size: 12px;
}
.histo-label { color: var(--muted); }
.histo-bar-wrap {
  height: 6px;
  background: var(--panel-2);
  border-radius: 3px;
  overflow: hidden;
}
.histo-bar {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}
.histo-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
/* Element-tinted bars + labels */
.histo-bar.element-pyro    { background: #ff8a4d; }
.histo-bar.element-hydro   { background: #4dafff; }
.histo-bar.element-electro { background: #b48dff; }
.histo-bar.element-cryo    { background: #9ad6ff; }
.histo-bar.element-anemo   { background: #5fd6b7; }
.histo-bar.element-geo     { background: #d4a657; }
.histo-bar.element-dendro  { background: #8acc5f; }
.element-pyro    { color: #ff8a4d; }
.element-hydro   { color: #4dafff; }
.element-electro { color: #b48dff; }
.element-cryo    { color: #9ad6ff; }
.element-anemo   { color: #5fd6b7; }
.element-geo     { color: #d4a657; }
.element-dendro  { color: #8acc5f; }

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

/* Snapshot diff card on /timeline */
.snap-diff h2 { margin-bottom: 4px; }
.diff-aggregate {
  list-style: none;
  padding: 0;
  margin: 8px 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 13px;
  color: var(--muted);
}
.diff-aggregate li strong { font-variant-numeric: tabular-nums; margin-left: 4px; }
.diff-changes {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
}
.diff-changes li {
  padding: 3px 0;
  display: flex;
  gap: 10px;
  align-items: baseline;
  border-bottom: 1px solid var(--border);
}
.diff-changes li:last-child { border-bottom: 0; }

/* Artifact table on /character/<name> */
.artifact-table { font-size: 13px; }
.artifact-table tr.artifact-high { background: rgba(122, 214, 138, 0.04); }
.artifact-table tr.artifact-low { background: rgba(255, 152, 134, 0.05); }
.substat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.substat-list li {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11.5px;
  line-height: 1.4;
}
.substat-list .sub-name { font-weight: 500; }
.substat-list .sub-rolls { color: var(--muted); font-variant-numeric: tabular-nums; }
.substat-list .weight-high {
  background: rgba(122, 214, 138, 0.18);
  color: var(--pos);
}
.substat-list .weight-med {
  background: rgba(127, 179, 255, 0.15);
  color: var(--accent);
}
.substat-list .weight-low {
  background: var(--panel-2);
  color: var(--muted);
}
.substat-list .weight-none {
  background: rgba(255, 152, 134, 0.10);
  color: var(--neg);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 152, 134, 0.4);
}

/* Constellation breakpoint card on /character/<name> */
.cons-card .badge { margin-left: 4px; }
.cons-ladder {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
}
.cons-ladder li {
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.cons-ladder li:last-child { border-bottom: 0; }
.cons-ladder strong { min-width: 32px; color: var(--accent); }

/* Exploration table */
.exploration-table { font-size: 13px; }
.exploration-table tr.region-done { background: rgba(122, 214, 138, 0.06); }
.exploration-table tr.region-priority { background: rgba(255, 152, 134, 0.05); }
.exp-bar-wrap {
  height: 6px;
  background: var(--panel-2);
  border-radius: 3px;
  overflow: hidden;
  width: 140px;
}
.exp-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}
.exp-bar.mid { background: var(--close); }
.exp-bar.done { background: var(--pos); }
.sub-areas {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
}
.sub-areas li {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  border-bottom: 1px dotted var(--border);
}
.sub-areas li:last-child { border-bottom: 0; }

/* Wish lifetime stats */
.wish-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 8px 0 16px;
}
.stat-block {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
}
.stat-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.banner-stats { font-size: 13px; }

/* Stale-build list */
.stale-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
}
.stale-list li {
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr 80px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.stale-list li:last-child { border-bottom: 0; }
.stale-list .num strong { color: var(--close); font-variant-numeric: tabular-nums; }

/* Friendship ladder on /characters */
.friendship-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
}
.friendship-list li {
  display: grid;
  grid-template-columns: 200px 1fr 60px;
  gap: 12px;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.friendship-list li:last-child { border-bottom: 0; }
.friendship-bar-wrap {
  height: 6px;
  background: var(--panel-2);
  border-radius: 3px;
  overflow: hidden;
}
.friendship-bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ff7ad0, #ffb07a);
  border-radius: 3px;
}
.friendship-list .num strong {
  color: var(--ss);
  font-variant-numeric: tabular-nums;
}

/* Spiral Abyss page */
.abyss-cycle h3 { margin: 12px 0 6px; }
.abyss-stars {
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--ss);
}
.abyss-stars.max { color: var(--pos); }
.abyss-floor { margin-bottom: 16px; }
.abyss-chambers {
  list-style: none;
  padding: 0;
  margin: 0;
}
.abyss-chambers li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 110px 70px 1fr;
  gap: 12px;
  align-items: center;
}
.abyss-chambers li:last-child { border-bottom: 0; }
.abyss-chambers .chamber-id { color: var(--muted); font-size: 13px; }
.abyss-chambers .chamber-incomplete { background: rgba(255, 152, 134, 0.05); }
.chamber-battles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chamber-battle {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.suggestion-teams {
  list-style: none;
  padding: 0;
  margin: 0;
}
.suggestion-teams li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  flex-wrap: wrap;
}
.suggestion-teams li:last-child { border-bottom: 0; }
.suggestion-teams .num { min-width: 44px; color: var(--accent); font-weight: 600; }

/* Login page — standalone layout (no nav). */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
}
.login-main {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  width: 320px;
  max-width: calc(100vw - 32px);
}
.login-main h1 { margin: 0 0 4px 0; font-size: 22px; }
.login-form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.login-form label { display: flex; flex-direction: column; gap: 4px; }
.login-form input[type="password"] {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 8px 10px;
  border-radius: 4px;
  font: inherit;
}
.login-form button {
  background: var(--accent);
  color: var(--bg);
  border: 0;
  padding: 8px 12px;
  border-radius: 4px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.login-form button:hover { background: var(--accent-2); }
.login-error { color: var(--neg); margin: 0; font-size: 13px; }
