:root {
  --bg-page: #111216;
  --bg-surface: #191b22;
  --bg-elevated: #21242d;
  --bg-hover: #292d38;
  --border: #3a3f4e;
  --border-subtle: #2a2e39;
  --text-main: #f3f4f6;
  --text-muted: #a1a8b8;
  --text-dim: #707787;

  /* Mint Caught Sync & Amber Milestone Tokens */
  --amber-bg: rgba(252, 232, 178, 0.14);
  --amber-border: rgba(252, 232, 178, 0.42);
  --amber-text: #fce8b2;

  --mint-bg: rgba(183, 225, 205, 0.14);
  --mint-bg-strong: rgba(183, 225, 205, 0.22);
  --mint-solid: #b7e1cd;
  --mint-border: rgba(183, 225, 205, 0.52);

  /* Platinum Distortion Palette */
  --accent: #38bdf8;
  --accent-bg: rgba(56, 189, 248, 0.14);
  --accent-border: rgba(56, 189, 248, 0.44);
  --platinum-gold: #fbbf24;
  --danger: #f87171;

  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Cascadia Mono', 'Consolas', 'Courier New', monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.mint-inline {
  color: var(--mint-solid);
  font-weight: 700;
}

.amber-inline {
  color: var(--amber-text);
}

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

.app-shell {
  max-width: 1460px;
  margin: 0 auto;
  padding: 16px 20px 48px;
}

/* Header */
.app-header {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.08) 0%, var(--bg-surface) 70%);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.brand-block {
  flex: 1 1 500px;
}

.brand-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.version-switcher {
  display: flex;
  gap: 6px;
}

.version-switch-btn {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--accent-border);
  background: var(--accent-bg);
  color: #bae6fd;
}

.platform-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.hub-home-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.hub-home-link:hover {
  border-color: var(--accent-border);
  color: #bae6fd;
}

.app-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.app-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  max-width: 760px;
}

/* Progress & Profiles Panel */
.progress-panel {
  min-width: 320px;
  flex: 0 1 380px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.profile-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.profile-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.profile-select {
  flex: 1;
  min-width: 110px;
}

.progress-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.progress-count {
  font-size: 22px;
  font-weight: 800;
  color: var(--mint-solid);
  font-family: var(--font-mono);
}

.progress-sep,
.progress-total {
  font-size: 14px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.progress-caption {
  margin-left: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.progress-pct {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
}

.progress-track {
  height: 8px;
  background: var(--bg-page);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--mint-solid));
  transition: width 0.2s ease;
}

.progress-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  gap: 8px;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  gap: 6px;
}

/* Header Toolbar */
.header-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.tab-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 7px 14px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
}

.tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.tab-btn.active {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  color: #e0f2fe;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-wrap,
.movedex-search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search-input,
.movedex-search-input,
.text-input {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 26px 6px 10px;
  font-size: 13px;
  color: var(--text-main);
}

.search-input {
  width: 220px;
}

.search-clear {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  padding: 2px 4px;
}

.select-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
}

.select-sm {
  padding: 4px 6px;
  font-size: 12px;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.toggle-chip.active {
  background: var(--mint-bg);
  border-color: var(--mint-border);
  color: var(--mint-solid);
}

/* Buttons */
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.btn-sm {
  padding: 4px 8px;
  font-size: 12px;
}

.btn-xs {
  padding: 2px 7px;
  font-size: 11px;
}

.btn-danger:hover {
  border-color: rgba(248, 113, 113, 0.6);
  color: var(--danger);
}

.btn-primary {
  background: var(--accent);
  color: #0b1220;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-weight: 700;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  padding: 0;
}

.pill-btn {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.pill-btn.active {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  color: #e0f2fe;
}

/* Workspace Layout */
.workspace-grid {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 16px;
  align-items: start;
}

.workspace-grid.no-rail {
  grid-template-columns: 1fr;
}

/* Sidebar */
.milestone-rail {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}

.rail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.rail-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.milestone-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.milestone-btn {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.milestone-btn:hover {
  background: var(--bg-hover);
}

.milestone-btn.active {
  background: var(--accent-bg);
  border-color: var(--accent-border);
}

.milestone-btn.done {
  border-color: var(--mint-border);
  background: var(--mint-bg);
}

.milestone-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
  font-size: 12.5px;
}

.milestone-count {
  font-family: var(--font-mono);
  color: var(--mint-solid);
  flex-shrink: 0;
}

.milestone-sub {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.mini-bar {
  height: 4px;
  background: var(--bg-page);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.mini-bar-fill {
  height: 100%;
  background: var(--mint-solid);
}

/* Main Content */
.main-pane {
  min-width: 0;
}

.view-utility-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.view-hint {
  font-size: 12.5px;
  color: var(--text-muted);
}

.utility-actions,
.utility-right,
.dex-filter-pills {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Section Banner */
.milestone-section {
  margin-bottom: 24px;
}

.section-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.milestone-section.section-done .section-banner {
  border-left-color: var(--mint-solid);
}

.section-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.cap-badge-inline,
.cap-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  color: var(--amber-text);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.section-title {
  margin: 0 0 6px;
  font-size: 18px;
}

.section-summary {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 780px;
}

.section-counters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}

.inline-incense-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.inline-incense-toggle:hover {
  border-color: var(--mint-border);
  color: var(--text-main);
}

.inline-incense-toggle.active {
  background: var(--mint-bg);
  border-color: var(--mint-border);
  color: var(--mint-solid);
}

.inline-incense-checkbox {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #34d399;
  cursor: pointer;
}

.section-incense-toggle {
  padding: 6px 11px;
  font-size: 12px;
}

.counter-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 8px 12px;
  text-align: right;
  min-width: 110px;
}

.counter-label {
  display: block;
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.counter-val {
  font-size: 16px;
  font-weight: 800;
  font-family: var(--font-mono);
}

/* Area Card */
.areas-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.area-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.area-card.area-complete {
  border-color: var(--mint-border);
}

.area-card.is-collapsed .area-body {
  display: none;
}

.area-header {
  width: 100%;
  background: var(--bg-elevated);
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  gap: 12px;
}

.area-card.is-collapsed .area-header {
  border-bottom: none;
}

.area-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.area-chevron {
  font-size: 13px;
  color: var(--text-muted);
  width: 14px;
}

.area-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.area-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.area-status {
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}

.area-status.done {
  background: var(--mint-bg);
  border-color: var(--mint-border);
  color: var(--mint-solid);
}

.area-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Method Groups & Tables */
.method-group {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}

.method-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
}

.method-badge {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid transparent;
}

.method-tod { background: rgba(56, 189, 248, 0.14); border-color: rgba(56, 189, 248, 0.35); color: #7dd3fc; }
.method-water { background: rgba(59, 130, 246, 0.16); border-color: rgba(59, 130, 246, 0.4); color: #93c5fd; }
.method-special { background: rgba(251, 191, 36, 0.14); border-color: rgba(251, 191, 36, 0.38); color: #fde68a; }
.method-event { background: rgba(168, 85, 247, 0.16); border-color: rgba(168, 85, 247, 0.4); color: #d8b4fe; }
.method-evo { background: var(--mint-bg); border-color: var(--mint-border); color: var(--mint-solid); }

.method-note,
.egg-pool-status {
  font-size: 12px;
  color: var(--text-muted);
}

.egg-pool-status {
  color: var(--amber-text);
  font-weight: 700;
}

.encounter-table-wrap,
.dex-table-wrap,
.movedex-table-wrap {
  overflow-x: auto;
}

.encounter-table,
.dex-table,
.movedex-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  padding: 7px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.16);
}

td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

.encounter-row:hover td,
.dex-row:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.encounter-row.is-caught td,
.dex-row.is-caught td {
  background: var(--mint-bg) !important;
}

.encounter-row.is-pool-other td {
  opacity: 0.68;
}

.encounter-row.is-incense-inactive td {
  opacity: 0.72;
}

.encounter-row.is-incense-replaced td {
  opacity: 0.65;
  background: rgba(239, 68, 68, 0.05);
}

.encounter-row.is-incense-replaced .species-link {
  text-decoration: line-through;
  color: var(--text-muted);
}

.col-check,
.col-caught,
.col-caught-head {
  width: 64px;
  text-align: center;
}

.col-dex,
.col-num {
  width: 72px;
  color: var(--text-muted);
}

.col-rate {
  min-width: 118px;
  white-space: nowrap;
}

.col-levels {
  width: 115px;
  white-space: nowrap;
}

.rate-zero {
  color: #fca5a5;
  font-weight: 800;
}

.rate-reduced {
  color: var(--amber-text);
  font-weight: 800;
}

.rate-boosted {
  color: var(--mint-solid);
  font-weight: 800;
}

.rate-was-pill {
  font-size: 10.5px;
  color: var(--text-muted);
  background: var(--bg-page);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 3px;
}

.incense-status-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.incense-status-pill.is-on {
  background: var(--mint-bg);
  border: 1px solid var(--mint-border);
  color: var(--mint-solid);
}

.incense-status-pill.is-off {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.incense-status-pill.is-shifted {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: var(--amber-text);
}

.tag-replaced {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.tag-incense-off {
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.caught-checkbox {
  width: 17px;
  height: 17px;
  accent-color: #34d399;
  cursor: pointer;
}

.pkmn-cell,
.dex-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.species-link {
  background: none;
  border: none;
  padding: 0;
  font-weight: 700;
  color: var(--text-main);
  text-align: left;
}

.species-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.inline-types {
  display: inline-flex;
  gap: 4px;
}

.milestone-tag {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
}

.tag-new {
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  color: var(--amber-text);
}

.tag-earlier {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.tag-special,
.form-pill {
  background: rgba(236, 72, 153, 0.14);
  border: 1px solid rgba(236, 72, 153, 0.36);
  color: #f9a8d4;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
}

.btn-egg-pick {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--amber-border);
  background: var(--amber-bg);
  color: var(--amber-text);
  font-size: 11px;
  font-weight: 700;
}

.btn-egg-pick.picked {
  background: var(--mint-bg-strong);
  border-color: var(--mint-border);
  color: var(--mint-solid);
}

.evo-cell-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.evo-item-icon {
  object-fit: contain;
  vertical-align: middle;
}

/* Trainer & Boss Battle Cards */
.area-trainers-drawer {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.area-trainers-drawer.all-defeated {
  border-color: var(--mint-border);
}

.trainers-toggle-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: none;
  text-align: left;
  gap: 10px;
}

.trainers-toggle-btn:hover {
  background: var(--bg-hover);
}

.trainers-toggle-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.trainers-toggle-title {
  font-weight: 700;
  font-size: 13px;
}

.trainers-toggle-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.team-variant-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px 0;
}

.team-variant-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.team-variant-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.trainers-grid {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trainer-battle-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.trainer-battle-card.is-defeated {
  background: var(--mint-bg);
  border-color: var(--mint-border);
}

.trainer-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.trainer-card-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  cursor: pointer;
  flex: 1;
}

.trainer-name {
  font-weight: 700;
  font-size: 13.5px;
}

.trainer-location {
  font-size: 11.5px;
  color: var(--text-muted);
}

.role-pill,
.format-pill,
.defeated-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  border: 1px solid transparent;
}

.role-gym { background: rgba(251, 191, 36, 0.18); border-color: rgba(251, 191, 36, 0.45); color: #fde68a; }
.role-rival { background: rgba(56, 189, 248, 0.16); border-color: rgba(56, 189, 248, 0.4); color: #7dd3fc; }
.role-galactic { background: rgba(168, 85, 247, 0.18); border-color: rgba(168, 85, 247, 0.45); color: #d8b4fe; }
.role-e4 { background: rgba(244, 63, 94, 0.18); border-color: rgba(244, 63, 94, 0.45); color: #fda4af; }
.role-champion { background: rgba(234, 179, 8, 0.25); border-color: rgba(250, 204, 21, 0.65); color: #fef08a; }
.role-johto { background: rgba(16, 185, 129, 0.18); border-color: rgba(16, 185, 129, 0.45); color: #6ee7b7; }
.role-boss { background: rgba(249, 115, 22, 0.18); border-color: rgba(249, 115, 22, 0.45); color: #fdba74; }
.role-partner { background: rgba(96, 165, 250, 0.16); border-color: rgba(96, 165, 250, 0.4); color: #bfdbfe; }
.role-rematch { background: rgba(236, 72, 153, 0.16); border-color: rgba(236, 72, 153, 0.4); color: #f9a8d4; }
.role-trainer { background: var(--bg-elevated); border-color: var(--border); color: var(--text-muted); }

.format-pill {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text-muted);
}

.defeated-pill {
  background: var(--mint-bg-strong);
  border-color: var(--mint-border);
  color: var(--mint-solid);
}

.trainer-team-context,
.trainer-variant-label {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 4px 0;
}

.trainer-team-variants {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trainer-team-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
}

.team-mon-chip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 7px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

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

.team-mon-top {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
}

.team-mon-name {
  font-weight: 700;
  font-size: 12.5px;
}

.team-mon-level {
  font-size: 11px;
  color: var(--amber-text);
  font-weight: 700;
}

.team-mon-item {
  font-size: 11px;
  color: var(--accent);
}

.team-mon-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.team-mon-types {
  display: inline-flex;
  gap: 3px;
}

.team-mon-meta {
  font-size: 10.5px;
  color: var(--text-muted);
}

.team-mon-moves {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.move-chip {
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  font-size: 10.5px;
  color: #cbd5e1;
}

/* Type Badges */
.type-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

.type-normal { background: #9ca3af; color: #111; text-shadow: none; }
.type-fire { background: #ea580c; }
.type-water { background: #2563eb; }
.type-grass { background: #16a34a; }
.type-electric { background: #eab308; color: #111; text-shadow: none; }
.type-ice { background: #06b6d4; color: #111; text-shadow: none; }
.type-fighting { background: #b91c1c; }
.type-poison { background: #9333ea; }
.type-ground { background: #b45309; }
.type-flying { background: #6366f1; }
.type-psychic { background: #db2777; }
.type-bug { background: #65a30d; }
.type-rock { background: #78716c; }
.type-ghost { background: #5b21b6; }
.type-dragon { background: #4338ca; }
.type-dark { background: #374151; }
.type-steel { background: #64748b; }
.type-fairy { background: #ec4899; }

/* Sprites */
.pkmn-mini-sprite,
.pkmn-table-sprite,
.pkmn-sprite {
  object-fit: contain;
  flex-shrink: 0;
}

.sprite-broken {
  opacity: 0.2;
}

/* Pokédex View */
.sort-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  text-transform: uppercase;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sort-arrow.muted { opacity: 0.4; }
.sort-arrow.active { color: var(--accent); }

.milestone-jump-pill {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 11.5px;
  font-weight: 600;
}

.milestone-jump-pill:hover {
  border-color: var(--accent-border);
  color: var(--accent);
}

/* Guide View */
.guide-view {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.guide-heading {
  margin: 0 0 6px;
  font-size: 18px;
}

.guide-lead {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.guide-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.guide-card-title {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--accent);
}

.guide-card-body {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.ext-link {
  color: var(--accent);
}

/* External Links Control & Popup */
.ext-links-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.ext-link-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.ext-link-trigger:hover,
.ext-link-trigger.active {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-bg);
}

.ext-links-menu {
  position: fixed;
  z-index: 2000;
  width: 260px;
  background: var(--bg-surface);
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.ext-links-header {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
}

.ext-links-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-subtle);
}

.ext-links-item:last-child { border-bottom: none; }
.ext-links-item:hover { background: var(--bg-hover); }

.ext-links-item-main {
  display: flex;
  flex-direction: column;
}

.ext-links-item-label {
  font-size: 12.5px;
  font-weight: 700;
}

.ext-links-item-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.78);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: min(880px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-card-sm {
  width: min(440px, 100%);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.modal-dex-nums {
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.modal-title {
  margin: 2px 0 6px;
  font-size: 20px;
}

.modal-types {
  display: flex;
  gap: 5px;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-caught-lg {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-weight: 700;
}

.btn-caught-lg.checked {
  background: var(--mint-bg-strong);
  border-color: var(--mint-border);
  color: var(--mint-solid);
}

.modal-body {
  padding: 16px 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sprite-showcase {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.sprite-card {
  flex: 1 1 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.sprite-card-shiny {
  border-color: rgba(251, 191, 36, 0.35);
}

.shiny-label {
  color: var(--amber-text);
  font-weight: 700;
  font-size: 12px;
}

.modal-subtitle {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
}

.stats-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.abilities-inline {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.ability-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 11.5px;
  font-weight: 600;
}

.stat-bars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px 14px;
}

.stat-bar-row {
  display: grid;
  grid-template-columns: 32px 34px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.stat-bar-track {
  height: 7px;
  border-radius: 999px;
  background: var(--bg-page);
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.family-list,
.modal-locs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.family-node {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  margin-left: calc(var(--depth, 0) * 18px);
  border-radius: 7px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.family-node.current {
  border-color: var(--accent-border);
}

.family-node.is-caught {
  background: var(--mint-bg);
  border-color: var(--mint-border);
}

.family-evo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

.modal-loc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  background: var(--bg-elevated);
  font-size: 12.5px;
  flex-wrap: wrap;
}

.encounter-meta {
  display: flex;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

.rate-pill,
.level-pill {
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
}

/* Movedex */
.movedex-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.movedex-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.movedex-tab-btn {
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.movedex-tab-btn.active {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  color: #e0f2fe;
}

.movedex-table-wrap {
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.move-method-pill {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.unlock-level { background: rgba(56, 189, 248, 0.16); color: #7dd3fc; }
.unlock-tm { background: rgba(251, 191, 36, 0.16); color: #fde68a; }
.unlock-tutor { background: rgba(168, 85, 247, 0.16); color: #d8b4fe; }
.unlock-egg { background: var(--mint-bg); color: var(--mint-solid); }

.move-cat-pill {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.cat-physical { background: rgba(234, 88, 12, 0.22); color: #fdba74; }
.cat-special { background: rgba(59, 130, 246, 0.22); color: #93c5fd; }
.cat-status { background: rgba(148, 163, 184, 0.22); color: #cbd5e1; }

.move-stat-head,
.move-stat-col {
  text-align: right;
  width: 56px;
}

.inline-jump-link {
  background: none;
  border: none;
  color: var(--accent);
  text-decoration: underline;
  font-weight: 700;
}

.empty-cell,
.empty-state {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
}

/* Profile Form */
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-form-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.profile-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Toast */
.poc-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--accent-border);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 3000;
}

.poc-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 960px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .milestone-rail {
    position: static;
    max-height: none;
  }
}
