:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-card-hover: #222633;
  --text: #e6e9f0;
  --text-dim: #9aa0b0;
  --accent: #f5b942;
  --accent-2: #5aa9e6;
  --border: #2a2e3a;
  --success: #4caf50;
  --warning: #ff9800;
  --error: #f44336;
  --violet: #b993e4;

  /* Region accent colors */
  --region-mondstadt: #7fdeac; /* Mint Green */
  --region-liyue: #e3cd65;     /* Sand Yellow */
  --region-inazuma: #b993e4;   /* Electro Purple */
  --region-sumeru: #b5dd47;    /* Bright Green */
  --region-fontaine: #54b0f0;  /* Sky Blue */
  --region-natlan: #e79d6c;    /* Soft Orange */
  --region-nod-krai: #d2daf1;  /* Lunar Silver */
  --region-snezhnaya: #88dbdc; /* Ice Blue */
  --region-unknown: #607d8b;

  /* Element accent colors (Ascension Gem Planner) */
  --elem-pyro: #ef7938;
  --elem-hydro: #4cc2f1;
  --elem-anemo: #74c2a8;
  --elem-electro: #af8ec1;
  --elem-dendro: #a5c83b;
  --elem-cryo: #9fd6e3;
  --elem-geo: #fab632;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.app-header {
  text-align: center;
  padding: 0;
  background: linear-gradient(180deg, #15171f 0%, var(--bg) 100%);
}

.app-header h1 { font-size: 2rem; font-weight: 700; margin-top: 2rem; }
.subtitle { color: var(--text-dim); margin-top: 0.25rem; }

/* Top toolbar: Genshin brand + route nav (full-width bar) */
.toolbar {
  width: 100%;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.toolbar-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.crumb {
  text-decoration: none;
  color: var(--text-dim);
  font-weight: 600;
  transition: color 0.12s;
}
.crumb-brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: 0.01em;
}
.crumb-category { color: var(--text-dim); }
.crumb-active { color: var(--violet); font-weight: 700; }
a.crumb:hover { color: var(--violet); }
.crumb-sep {
  color: var(--border);
  user-select: none;
}

/* Hover dropdown for a game category (e.g. Genshin) */
.dropdown {
  position: relative;
  display: inline-flex;
}
.dropdown-trigger {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.dropdown-trigger:hover,
.dropdown-trigger:focus-visible {
  color: var(--violet);
  background: var(--bg-card-hover);
  outline: none;
}
.dropdown-trigger.is-active {
  color: var(--violet);
  font-weight: 700;
}
.caret { font-size: 0.7rem; opacity: 0.7; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 210px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  display: none;
  flex-direction: column;
  gap: 0.15rem;
  z-index: 50;
}
/* Invisible bridge across the gap so the menu stays open while the
   pointer travels from the trigger down into the menu. */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -0.5rem;
  left: 0;
  right: 0;
  height: 0.5rem;
}
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu,
.dropdown.open .dropdown-menu {
  display: flex;
}
.dropdown-item {
  display: block;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.12s, color 0.12s;
}
.dropdown-item:hover { background: var(--bg-card-hover); color: var(--violet); }
.dropdown-item.is-active { color: var(--violet); background: rgba(185,147,228,0.12); }

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.step-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 0.9rem;
}

.step-desc { color: var(--text-dim); margin-bottom: 1rem; }

.hidden { display: none !important; }

/* Step 1 */
.good-textarea {
  width: 100%;
  min-height: 140px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.75rem;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  resize: vertical;
}

.button-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, filter 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--accent); color: #000; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-accent { background: var(--accent-2); color: #fff; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }

.status-bar {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
}
.status-bar.show { display: block; }
.status-bar.success { background: rgba(76,175,80,0.15); border: 1px solid var(--success); }
.status-bar.warning { background: rgba(255,152,0,0.15); border: 1px solid var(--warning); }
.status-bar.error { background: rgba(244,67,54,0.15); border: 1px solid var(--error); }

/* Step 2 */
.bulk-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.select-sm, .input-sm {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
}

.inline-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.character-groups { display: flex; flex-direction: column; gap: 1.5rem; }

/* ZZZ Roster Builder - Grid layout */
.zzz-sections { display: flex; flex-direction: column; gap: 1.75rem; margin: 1rem 0; }

.zzz-section-title {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.zzz-section-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
}

.zzz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
}

.zzz-unit {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: transform 0.1s, opacity 0.1s;
}

.zzz-unit.unowned {
  opacity: 0.4;
  filter: grayscale(0.7);
}

.zzz-unit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.zzz-avatar {
  position: relative;
  width: 72px;
  height: 72px;
  border: 2px solid var(--border);
  border-radius: 50%;
  overflow: visible;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.zzz-avatar:hover { border-color: var(--accent); }

/* S-rank gets the site's gold accent ring; A-rank stays neutral. */
.zzz-unit[data-rank="S"] .zzz-avatar {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 185, 66, 0.18);
}
.zzz-unit[data-rank="S"] .zzz-avatar:hover { box-shadow: 0 0 0 3px rgba(245, 185, 66, 0.32); }

.zzz-avatar-img {
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  object-fit: cover;
  display: block;
}
.zzz-avatar-ph {
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--text-dim);
}

.zzz-limited-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.65rem;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg-card);
  pointer-events: none;
}

.zzz-name {
  font-weight: 600;
  text-align: center;
  width: 100%;
  padding: 0 0.25rem;
  line-height: 1.3;
}

.zzz-meters {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 100%;
  padding: 0 0.5rem;
}
.zzz-meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.zzz-star-row {
  display: flex;
  gap: 0.15rem;
  justify-content: center;
}

.zzz-star {
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: var(--border);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.15s, transform 0.1s;
  padding: 0;
  line-height: 1;
}
.zzz-star:hover { color: var(--accent); transform: scale(1.15); }
.zzz-star.on { color: var(--accent); text-shadow: 0 0 4px var(--accent); }

.zzz-search {
  width: 100%;
  max-width: 400px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.zzz-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,221,0,0.2); }

/* Picker modal (still needed for future maybe) */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 1rem;
}
.modal.hidden { display: none !important; }
.modal-card {
  width: min(720px, 100%);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 1.05rem; }

.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 0.5rem;
  padding: 0.5rem 1rem 1rem;
  overflow-y: auto;
}
.picker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.75rem;
  text-align: center;
}
.picker-item:hover { border-color: var(--accent); background: var(--bg-card); }
.picker-img {
  width: 52px; height: 52px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.picker-name { line-height: 1.1; }

.boss-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.boss-group-header {
  background: var(--group-accent, var(--border));
  padding: 0.6rem 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
}

.boss-group-header .badge-beta {
  font-size: 0.65rem;
  background: var(--warning);
  color: #000;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
}

.badge-new {
  font-size: 0.65rem;
  background: var(--success);
  color: #000;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
  vertical-align: middle;
}

.character-list { display: flex; flex-direction: column; }

.char-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.char-row:last-child { border-bottom: none; }
.char-row:hover { background: var(--bg-card-hover); }
.char-row.off { opacity: 0.45; }

.char-check {
  width: 18px; height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.char-portrait {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--border);
  flex-shrink: 0;
}
.char-portrait.error { display: none; }

.char-name {
  font-weight: 600;
  min-width: 130px;
  flex-shrink: 0;
}

.char-meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.char-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  background: var(--border);
  font-weight: 600;
}
.char-badge.need { background: rgba(245,185,66,0.2); color: var(--accent); }
.char-badge.done { background: rgba(76,175,80,0.2); color: var(--success); }
.char-badge.off { background: var(--border); color: var(--text-dim); }

.char-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.talent-pills { display: flex; gap: 0.4rem; }

.pill {
  padding: 0.3rem 0.6rem;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.1s;
  white-space: nowrap;
}
.pill.active { background: var(--accent); color: #000; border-color: var(--accent); }
.pill.done { background: rgba(76,175,80,0.15); color: var(--success); border-color: var(--success); cursor: pointer; }
.pill.off { opacity: 0.45; background: var(--bg); color: var(--text-dim); border-style: dashed; cursor: pointer; }
.pill-target {
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: inherit;
  padding: 0 0.1rem;
  cursor: pointer;
}
.pill.active .pill-target { color: #000; }
.reset-btn {
  margin-left: 0.4rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-dim);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  font-size: 0.9rem;
  cursor: pointer;
  flex-shrink: 0;
}
.reset-btn:hover { color: var(--text); border-color: var(--accent); }

/* Step 3 */
.farm-controls {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
}
.toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 38px; height: 20px;
  border-radius: 12px;
  background: var(--border);
  position: relative;
  transition: background 0.15s;
  flex-shrink: 0;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform 0.15s, background 0.15s;
}
.toggle-input:checked + .toggle-track { background: var(--accent); }
.toggle-input:checked + .toggle-track::after { transform: translateX(18px); background: #000; }
.toggle-input:focus-visible + .toggle-track { outline: 2px solid var(--accent-2); }
.toggle-hint { opacity: 0.7; }

.summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--accent); }
.stat-value .stat-icon { width: 28px; height: 28px; vertical-align: -4px; border-radius: 4px; margin-right: 0.25rem; }
.stat-label { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.25rem; }
.stat-card.stat-warn { border-color: var(--accent); }
.stat-card.stat-ok { border-color: var(--success); }

.boss-cards { display: flex; flex-direction: column; gap: 1rem; }

.boss-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--card-accent, var(--border));
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

.boss-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--card-accent, var(--border));
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}
.boss-card-title { font-size: 1.1rem; font-weight: 700; }
.boss-card-sub { font-size: 0.8rem; color: var(--text-dim); }

.boss-metrics {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.metric { font-size: 0.9rem; }
.metric strong { color: var(--accent); font-weight: 700; }

.mat-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.mat-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.8rem;
}
.mat-chip img { width: 24px; height: 24px; border-radius: 4px; }
.mat-chip .need { color: var(--accent); font-weight: 600; }
.mat-chip .satisfied { color: var(--success); }
.mat-chip .convertible { color: var(--accent-2); font-weight: 600; }
.mat-note { font-size: 0.8rem; color: var(--text-dim); font-style: italic; padding: 0.2rem 0; }

.contrib-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.contrib-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.75rem;
}
.contrib-chip img { width: 20px; height: 20px; border-radius: 50%; }
.contrib-chip .count { color: var(--accent); font-weight: 600; }

.all-done {
  text-align: center;
  padding: 2rem;
  background: rgba(76,175,80,0.1);
  border: 1px solid var(--success);
  border-radius: 8px;
  font-size: 1.1rem;
  color: var(--success);
}

.app-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
.app-footer a { color: var(--accent-2); }
.data-version { margin-top: 0.5rem; opacity: 0.7; }
/* Keyword intro paragraph at the top of each tool */
.tool-intro { color: var(--text-dim); font-size: 0.95rem; line-height: 1.6; margin-bottom: 1.25rem; }
.tool-intro strong { color: var(--text); }
.app-header h1 { min-height: 2.6rem; }

/* Footer nav + not-found */
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.2rem; margin-bottom: 1rem; }
.footer-nav a { color: var(--text-dim); text-decoration: none; }
.footer-nav a:hover { color: var(--violet); }
.notfound-list { padding-left: 1.4rem; line-height: 1.9; }
.notfound-list a { color: var(--accent-2); }

/* Landing page */
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-top: 0.5rem; }
.home-card {
  display: flex; flex-direction: column; gap: 0.35rem;
  padding: 1.1rem 1.2rem; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.home-card:hover { border-color: var(--violet); background: var(--bg-card-hover); }
.home-card-icon { font-size: 1.6rem; }
.home-card-title { font-weight: 700; font-size: 1.05rem; color: var(--accent); }
.home-card-desc { color: var(--text-dim); font-size: 0.9rem; line-height: 1.5; }
#homePage .step-card + .step-card, #zzzBatteryPlanner .step-card + .step-card { margin-top: 1.5rem; }
.privacy-note { color: var(--success); font-size: 0.85rem; white-space: nowrap; }

/* FAQ / indexable copy */
.faq-card { margin-top: 1.25rem; }
.faq-inline { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.faq-heading { font-size: 1.05rem; margin-bottom: 0.5rem; }
.faq-item { border-top: 1px solid var(--border); padding: 0.6rem 0; }
.faq-item:first-of-type { border-top: none; }
.faq-item summary { cursor: pointer; font-weight: 600; color: var(--text); list-style: none; display: flex; gap: 0.5rem; align-items: baseline; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: '▸'; color: var(--accent-2); transition: transform 0.15s; flex-shrink: 0; }
.faq-item[open] summary::before { transform: rotate(90deg); }
.faq-item p { color: var(--text-dim); font-size: 0.92rem; line-height: 1.6; margin-top: 0.5rem; padding-left: 1.1rem; }
.faq-item p + p { margin-top: 0.5rem; }
.faq-item code { font-size: 0.85em; background: var(--bg); padding: 0 0.3em; border-radius: 4px; }

/* Battery Planner Step 1: the shared roster widget lives in a collapsible */
.zzz-bp-roster-details { border: 1px solid var(--border); border-radius: 10px; padding: 0.6rem 0.9rem; }
.zzz-bp-roster-details > summary { cursor: pointer; font-weight: 600; color: var(--accent-2); list-style: none; display: flex; gap: 0.5rem; align-items: baseline; }
.zzz-bp-roster-details > summary::-webkit-details-marker { display: none; }
.zzz-bp-roster-details > summary::before { content: '▸'; transition: transform 0.15s; flex-shrink: 0; }
.zzz-bp-roster-details[open] > summary::before { transform: rotate(90deg); }
.zzz-bp-roster-details[open] > summary { margin-bottom: 0.75rem; }

/* Toolbar actions (Support / Feedback) */
.toolbar-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.toolbar-link {
  font: inherit; font-size: 0.85rem; font-weight: 600;
  padding: 0.3rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-dim); cursor: pointer; text-decoration: none;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.toolbar-link:hover { color: var(--text); border-color: var(--violet); }
.toolbar-link.kofi-inline { background: #ff5e5b; border-color: #ff5e5b; color: #fff !important; }
.toolbar-link.kofi-inline:hover { filter: brightness(1.1); }

/* Post-results support strip */
.support-strip {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  margin-top: 1.25rem; padding: 0.6rem 0.9rem;
  border: 1px dashed var(--border); border-radius: 10px;
  color: var(--text-dim); font-size: 0.9rem;
}
.support-strip.hidden { display: none !important; }
.kofi-sm { padding: 0.25rem 0.7rem; font-size: 0.85rem; }
.btn-link { font: inherit; font-size: 0.85rem; background: none; border: none; color: var(--accent-2); cursor: pointer; padding: 0; }
.btn-link:hover { text-decoration: underline; }
.support-strip-close { margin-left: auto; background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 0.9rem; }
.support-strip-close:hover { color: var(--text); }

/* Feedback modal */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.modal-card {
  position: relative; width: min(640px, 100%); height: min(80vh, 720px);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 1rem; }
.modal-close { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 1rem; }
.modal-close:hover { color: var(--text); }
#feedbackFrame { flex: 1; border: none; width: 100%; background: #fff; }

/* Privacy page */
.privacy-page h3 { margin: 1.25rem 0 0.4rem; font-size: 1.05rem; }
.privacy-page p, .privacy-page li { color: var(--text-dim); font-size: 0.92rem; line-height: 1.6; }
.privacy-page ul { padding-left: 1.4rem; margin: 0.25rem 0; }
.privacy-page code { font-size: 0.85em; background: var(--bg); padding: 0 0.3em; border-radius: 4px; }

/* Footer credits are per game; mountPage() shows the relevant one(s) */
.footer-credits.hidden { display: none !important; }

.kofi-wrap { margin-top: 1rem; display: flex; justify-content: center; }
.kofi-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: #ff5e5b;
  color: #fff !important;
  font-weight: 600;
  text-decoration: none;
  transition: filter 0.15s;
}
.kofi-btn:hover { filter: brightness(1.1); }
.kofi-btn { display: inline-flex; align-items: center; gap: 0.4rem; }
.kofi-ico { flex-shrink: 0; }

@media (max-width: 640px) {
  .char-row { flex-wrap: wrap; }
  .char-controls { margin-left: 0; width: 100%; justify-content: space-between; }
  .boss-metrics { gap: 1rem; }
}

/* ============================================================
 * Ascension Gem Planner
 * ============================================================ */

.gem-loaded-note {
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.9rem;
  border-radius: 6px;
  background: rgba(90, 169, 230, 0.12);
  border: 1px solid rgba(90, 169, 230, 0.35);
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ---- Step 2: character picker ---- */
.gem-picker { display: flex; flex-direction: column; gap: 1.1rem; }

.gem-picker-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-bottom: 0.4rem;
  margin-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
}
.gem-picker-count { color: var(--text-dim); font-size: 0.8rem; }

.gem-elem-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--card-accent, var(--region-unknown));
  flex: none;
}

.gem-picker-rows {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.4rem;
}

.gem-char-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.12s, border-color 0.12s, background 0.12s;
}
.gem-char-row:hover { background: var(--bg-card-hover); }
.gem-char-row.is-on { opacity: 1; border-color: var(--accent-2); }
.gem-char-row img { width: 30px; height: 30px; border-radius: 50%; flex: none; }
.gem-char-row input[disabled] { cursor: default; }
.gem-char-row:has(input[disabled]) { cursor: default; opacity: 0.4; }
.gem-char-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
}
.gem-char-asc { color: var(--text-dim); font-size: 0.76rem; flex: none; }

/* ---- Step 3: verdict ---- */
.gem-verdict {
  padding: 0.8rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
}
.gem-verdict.ok { background: rgba(76, 175, 80, 0.12); border-color: var(--success); }
.gem-verdict.warn { background: rgba(255, 152, 0, 0.12); border-color: var(--warning); }
.gem-verdict.bad { background: rgba(244, 67, 54, 0.12); border-color: var(--error); }
.gem-verdict.muted { color: var(--text-dim); }

.gem-inline-icon { width: 18px; height: 18px; vertical-align: -4px; margin-right: 0.2rem; }

/* ---- Per-element cards ---- */
.gem-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.gem-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--card-accent, var(--region-unknown));
  border-radius: 8px;
  padding: 0.9rem;
}

.gem-card-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; }
.gem-card-icon { width: 40px; height: 40px; flex: none; }
.gem-card-titles { flex: 1; min-width: 0; }
.gem-card-title { font-weight: 600; color: var(--card-accent, var(--text)); }
.gem-card-sub { font-size: 0.75rem; color: var(--text-dim); }

.gem-pill {
  flex: none;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.gem-pill.ok { background: rgba(76, 175, 80, 0.18); border-color: var(--success); }
.gem-pill.conv { background: rgba(90, 169, 230, 0.18); border-color: var(--accent-2); }
.gem-pill.bad { background: rgba(244, 67, 54, 0.18); border-color: var(--error); }
.gem-pill.muted { color: var(--text-dim); }

.gem-tier-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; }
.gem-tier {
  text-align: center;
  padding: 0.45rem 0.2rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}
.gem-tier.is-short { border-color: var(--error); background: rgba(244, 67, 54, 0.08); }
.gem-tier img { width: 30px; height: 30px; }
.gem-tier-label { font-size: 0.66rem; color: var(--text-dim); margin-top: 0.1rem; }
.gem-tier-counts { font-size: 0.8rem; margin-top: 0.15rem; }
.gem-tier-counts span { color: var(--text-dim); margin-left: 0.15rem; }

.gem-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.7rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.gem-strand-note {
  margin-top: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 152, 0, 0.1);
  border: 1px solid rgba(255, 152, 0, 0.4);
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text-dim);
}

.gem-card .contrib-chips { margin-top: 0.7rem; }

/* ---- Conversion plan + safe list ---- */
.gem-subhead {
  margin: 1.6rem 0 0.6rem;
  font-size: 0.95rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
}

.gem-plan { display: flex; flex-direction: column; gap: 0.35rem; }
.gem-plan-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.84rem;
  flex-wrap: wrap;
}
.gem-plan-line img { width: 24px; height: 24px; flex: none; }
.gem-plan-count { font-weight: 700; color: var(--accent); min-width: 2.6rem; }
.gem-plan-arrow { color: var(--text-dim); }
.gem-plan-dust { margin-left: auto; color: var(--text-dim); font-size: 0.78rem; }

.gem-safe { display: flex; flex-direction: column; gap: 0.35rem; }
.gem-safe-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--card-accent, var(--region-unknown));
  border-radius: 6px;
  font-size: 0.84rem;
  flex-wrap: wrap;
}
.gem-safe-elem { color: var(--card-accent, var(--text)); min-width: 4.5rem; }
.gem-safe-tiers { display: flex; gap: 0.7rem; flex-wrap: wrap; flex: 1; }
.gem-safe-tier { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--text-dim); }
.gem-safe-tier img { width: 22px; height: 22px; }
.gem-safe-total { color: var(--success); font-weight: 600; margin-left: auto; }

@media (max-width: 640px) {
  .gem-cards { grid-template-columns: 1fr; }
  .gem-picker-rows { grid-template-columns: 1fr; }
  .gem-plan-dust, .gem-safe-total { margin-left: 0; }
}

/* Meta tier badges (Gem Planner picker) */
.gem-tier-badge {
  flex: none;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.2rem 0.34rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: #000;
  min-width: 1.85rem;
  text-align: center;
}
.gem-tier-badge.tsplus { background: #ff6b6b; }
.gem-tier-badge.ts     { background: #ffa64d; }
.gem-tier-badge.ta     { background: #ffd93d; }
.gem-tier-badge.tb     { background: #9ee37d; }
.gem-tier-badge.tc     { background: #7fd3e3; }
.gem-tier-badge.td     { background: #a9b3c6; }
.gem-tier-badge.tf     { background: #6b7280; color: var(--text); }
.gem-tier-badge.tnone  { background: transparent; color: var(--text-dim); }

/* ============================================================
   ZZZ Area Patrol — Battery Efficiency Planner
   Stage cards read like the Genshin boss cards: an accent stripe
   carries the verdict, and the "both discs wanted" case is the one
   that has to be visible at a glance.
   ============================================================ */
.zzz-bp-modes { display: flex; gap: 0.5rem; margin: 0.75rem 0 1rem; }
.zzz-bp-modes .btn.is-active { background: var(--accent-2); color: #fff; }

.zzz-bp-tray-wrap { margin-bottom: 0.75rem; }
.zzz-bp-tray-label { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 0.4rem; }
.zzz-bp-tray-label small { opacity: 0.7; }
.zzz-bp-tray { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.zzz-bp-slot {
  width: 110px; min-height: 64px;
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text); font: inherit; font-size: 0.8rem; text-align: left;
}
.zzz-bp-slot.filled { cursor: pointer; border-color: var(--accent-2); }
.zzz-bp-slot.filled:hover { background: var(--bg-card-hover); }
.zzz-bp-slot.empty { color: var(--text-dim); justify-content: center; border-style: dashed; }
.zzz-bp-slot img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.zzz-bp-slot span { overflow: hidden; text-overflow: ellipsis; }

.zzz-bp-picker-wrap { margin-bottom: 1.25rem; }
.zzz-bp-picker-wrap summary { cursor: pointer; color: var(--accent-2); font-size: 0.9rem; }
.zzz-bp-picker {
  display: grid; gap: 0.4rem; margin-top: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}
.zzz-bp-pick {
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  padding: 0.4rem 0.2rem; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-dim); font: inherit; font-size: 0.72rem;
}
.zzz-bp-pick img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.zzz-bp-pick:hover { background: var(--bg-card-hover); }
.zzz-bp-pick.on { border-color: var(--accent-2); color: var(--text); background: rgba(90,169,230,0.12); }

.zzz-bp-heading { margin: 1.5rem 0 0.35rem; font-size: 1rem; }
.zzz-bp-note { margin-bottom: 0.75rem; }
.zzz-bp-list { display: flex; flex-direction: column; gap: 0.6rem; }
.zzz-bp-divider {
  margin: 0.5rem 0 0.1rem; padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem; color: var(--text-dim);
}

.zzz-bp-card {
  border: 1px solid var(--border); border-left: 4px solid var(--border);
  border-radius: 10px; background: var(--bg-card); padding: 0.75rem 0.9rem;
}
.zzz-bp-card.usable-2 { border-left-color: var(--success); }
.zzz-bp-card.usable-1 { border-left-color: var(--accent); }
.zzz-bp-card.usable-0 { opacity: 0.55; }

.zzz-bp-card-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.zzz-bp-rank {
  width: 26px; height: 26px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--accent); color: #000;
  font-size: 0.8rem; font-weight: 700;
}
.zzz-bp-stage { flex: 1 1 200px; min-width: 0; }
.zzz-bp-stage-name { font-weight: 600; }
.zzz-bp-stage-meta { font-size: 0.78rem; color: var(--text-dim); }

.zzz-bp-metrics { display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; flex-shrink: 0; }
.zzz-bp-value {
  padding: 0.3rem 0.7rem; border-radius: 999px;
  font-size: 0.95rem; font-weight: 700; white-space: nowrap;
}
.zzz-bp-value.good { background: rgba(76,175,80,0.22); color: var(--success); }
.zzz-bp-value.ok { background: rgba(245,185,66,0.22); color: var(--accent); }
.zzz-bp-battery {
  padding: 0.3rem 0.6rem; border-radius: 999px;
  font-size: 0.82rem; font-weight: 600; white-space: nowrap;
}
.zzz-bp-battery small { font-weight: 400; opacity: 0.75; }
.zzz-bp-battery.good { background: rgba(76,175,80,0.16); color: var(--success); }
.zzz-bp-battery.ok { background: rgba(245,185,66,0.16); color: var(--accent); }
.zzz-bp-battery.none { background: var(--border); color: var(--text-dim); }

.zzz-bp-sets { display: grid; gap: 0.4rem; margin-top: 0.6rem; }
@media (min-width: 640px) { .zzz-bp-sets { grid-template-columns: 1fr 1fr; } }
.zzz-bp-set { display: flex; gap: 0.5rem; align-items: center; }
.zzz-bp-set.unwanted { opacity: 0.3; }
.zzz-bp-set-icon { width: 38px; height: 38px; object-fit: contain; flex-shrink: 0; }
.zzz-bp-set-body { min-width: 0; }
.zzz-bp-set-name { font-size: 0.86rem; font-weight: 600; }
.zzz-bp-set-why { font-size: 0.76rem; color: var(--text-dim); }

/* The substitution callout is the whole thesis of the tool — don't bury it. */
.zzz-bp-sub {
  margin-top: 0.55rem; padding: 0.4rem 0.6rem; border-radius: 8px;
  background: rgba(90,169,230,0.12); border: 1px solid rgba(90,169,230,0.35);
  font-size: 0.78rem; color: var(--text);
}

.zzz-bp-source { margin-top: 0.75rem; font-size: 0.75rem; color: var(--text-dim); }

/* The planner's method, spelled out on the page — the 2pc-equivalence rule in
   particular is the thing a user would otherwise have to take on faith. */
.zzz-bp-explain {
  margin: 1.25rem 0 0.5rem;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-card); padding: 0.6rem 0.9rem;
}
.zzz-bp-explain summary { cursor: pointer; color: var(--accent-2); font-size: 0.9rem; font-weight: 600; }
.zzz-bp-explain-body { font-size: 0.84rem; color: var(--text-dim); line-height: 1.55; }
.zzz-bp-explain-body p { margin: 0.7rem 0; }
.zzz-bp-explain-body ol { margin: 0.7rem 0 0.7rem 1.1rem; }
.zzz-bp-explain-body li { margin-bottom: 0.5rem; }
.zzz-bp-explain-body strong { color: var(--text); }
.zzz-bp-explain-caveat { font-size: 0.78rem; opacity: 0.8; }
.zzz-bp-sub-inline { color: var(--accent-2); white-space: nowrap; }

.zzz-bp-only {
  display: inline-block; margin-left: 0.3rem;
  padding: 0.05rem 0.4rem; border-radius: 999px;
  background: rgba(245,185,66,0.18); color: var(--accent);
  font-size: 0.7rem; font-weight: 600; white-space: nowrap;
}

/* "Do not farm" — the dead halves that make a stage 48 Battery/disc instead
   of 24. Split by whether the set is dead for this plan or dead entirely. */
.zzz-bp-avoid { display: flex; flex-direction: column; gap: 1rem; }
.zzz-bp-avoid-group {
  border: 1px solid var(--border); border-left: 4px solid var(--error);
  border-radius: 10px; background: var(--bg-card); padding: 0.75rem 0.9rem;
}
.zzz-bp-avoid-title { font-size: 0.9rem; margin-bottom: 0.2rem; }
.zzz-bp-avoid-title span {
  margin-left: 0.35rem; padding: 0.05rem 0.4rem; border-radius: 999px;
  background: var(--border); color: var(--text-dim); font-size: 0.72rem; font-weight: 600;
}
.zzz-bp-avoid-blurb { font-size: 0.78rem; color: var(--text-dim); margin-bottom: 0.6rem; }
.zzz-bp-avoid-row { display: flex; gap: 0.5rem; align-items: center; padding: 0.2rem 0; opacity: 0.75; }
.zzz-bp-avoid-used {
  margin-left: 0.3rem; padding: 0.05rem 0.4rem; border-radius: 999px;
  background: rgba(90,169,230,0.15); color: var(--accent-2);
  font-size: 0.7rem; font-weight: 600; white-space: nowrap;
}
