/* Redux Nuzlocke — dark "Unova" theme: charcoal surfaces, Blaze Black red-orange accent. */
:root {
  --bg: #0f0f13;
  --surface: #18181e;
  --surface-2: #212129;
  --surface-3: #2b2b35;
  --line: #2f2f3a;
  --text: #f1eee9;
  --text-soft: #b9b5c0;
  --muted: #8a8696;
  --accent: #ff5a36;
  --accent-2: #ff8a3d;
  --accent-deep: #c7361c;
  --accent-bg: rgba(255, 90, 54, 0.12);
  --good: #4fd18b;
  --good-bg: rgba(79, 209, 139, 0.12);
  --bad: #ff4d6d;
  --bad-bg: rgba(255, 77, 109, 0.12);
  --gold: #ffc94a;
  --radius: 14px;
  --radius-sm: 9px;
  --font-display: 'Chakra Petch', system-ui, sans-serif;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tabbar-h: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(1200px 400px at 50% -200px, rgba(255, 90, 54, 0.10), transparent 70%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.45 var(--font);
  min-height: 100vh;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
}
body.sheet-open { overflow: hidden; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; margin: 0; letter-spacing: 0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 21px; }
h3 { font-size: 16px; }
p { margin: 0.35em 0; }
button { font: inherit; color: inherit; cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.empty { color: var(--muted); text-align: center; padding: 28px 12px; }
.note { background: var(--accent-bg); border: 1px solid rgba(255, 90, 54, 0.3); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13.5px; margin: 0 0 12px; }
.warn { color: var(--gold); font-size: 13px; margin: 4px 0 0; }

/* ------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(15, 15, 19, 0.88);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand strong { display: block; font-family: var(--font-display); font-size: 16px; line-height: 1.1; }
.brand span { font-size: 12px; color: var(--muted); }
.ball {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: linear-gradient(var(--accent) 0 46%, #111 46% 54%, #e9e5df 54%);
  box-shadow: inset 0 0 0 2px #111, 0 0 12px rgba(255, 90, 54, 0.45);
  position: relative;
}
.ball::after { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: #e9e5df; box-shadow: 0 0 0 2px #111; }
.cap-pill {
  display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 8px; align-items: baseline;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 5px 11px; text-align: left;
}
.cap-label { grid-column: 1; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.cap-num { grid-column: 2; grid-row: 1 / span 2; font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--accent); align-self: center; }
.cap-who { grid-column: 1; font-size: 12.5px; font-weight: 600; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cap-pill.over { border-color: var(--bad); background: var(--bad-bg); animation: pulse 1.6s ease-in-out infinite; }
.cap-pill.over .cap-label, .cap-pill.over .cap-num { color: var(--bad); }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(255, 77, 109, 0.15); } }

/* ------------------------------------------------------------- layout */
.screen { max-width: 760px; margin: 0 auto; padding: 18px 16px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.page-head p { margin: 2px 0 0; font-size: 13px; }

.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 11px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-soft); white-space: nowrap; }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.seg.wide { display: flex; width: 100%; margin-bottom: 14px; }
.seg.wide button { flex: 1; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------- tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(18, 18, 23, 0.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar button {
  flex: 1; max-width: 190px; border: 0; background: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
}
.tabbar .ti { font-size: 20px; line-height: 1; }
.tabbar button.on { color: var(--accent); }

/* ------------------------------------------------------------- routes */
.split { margin-bottom: 18px; }
.split-name {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-2);
  padding: 0 4px 6px; border-bottom: 1px solid var(--line); margin-bottom: 6px;
}
.slot {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--surface); border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 9px 12px; margin-bottom: 5px; min-height: 48px;
}
.slot:hover { border-color: var(--line); }
.slot-dot {
  width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 11px; border: 2px solid var(--surface-3); color: transparent;
}
.slot.is-caught .slot-dot { border-color: var(--good); background: var(--good-bg); color: var(--good); }
.slot.is-failed .slot-dot { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.slot.is-skipped .slot-dot { border-color: var(--muted); color: var(--muted); }
.slot-label { flex: 1; font-weight: 600; min-width: 0; }
.slot.is-skipped .slot-label, .slot.is-failed .slot-label { color: var(--text-soft); }
.slot-status { font-size: 12.5px; text-align: right; }
.slot-mon { display: flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; max-width: 45%; }
.slot-mon span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-mon.is-dead { opacity: 0.5; text-decoration: line-through; }
.milestone {
  font-size: 11.5px; color: var(--gold); text-align: center; margin: 8px 0; letter-spacing: 0.05em;
  display: flex; align-items: center; gap: 8px;
}
.milestone::before, .milestone::after { content: ''; flex: 1; height: 1px; background: rgba(255, 201, 74, 0.25); }

/* ------------------------------------------------------------- sprites + types */
.sprite { width: 72px; height: 72px; image-rendering: pixelated; object-fit: contain; flex: none; }
.sprite.sm { width: 52px; height: 52px; margin: -4px 0; }
.sprite.xs { width: 36px; height: 36px; }
.sprite.lg { width: 112px; height: 112px; }
.types { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.type {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 1px 7px; border-radius: 6px; color: #fff;
  background: color-mix(in srgb, var(--t) 70%, #000); border: 1px solid var(--t);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}
.shiny { color: var(--gold); }

/* ------------------------------------------------------------- sheet */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade 0.15s ease-out;
}
.sheet-backdrop[hidden] { display: none; }
.sheet {
  width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 20px 20px 0 0; padding: 6px 16px calc(24px + env(safe-area-inset-bottom));
  animation: rise 0.2s ease-out;
}
@media (min-width: 700px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 20px; border-bottom: 1px solid var(--line); max-height: 86vh; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(30px); opacity: 0.5; } }
.sheet-grip { width: 40px; height: 4px; background: var(--surface-3); border-radius: 4px; margin: 4px auto 10px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.sheet-head p { font-size: 13px; margin-top: 2px; }
.icon-btn { border: 0; background: var(--surface-2); width: 34px; height: 34px; border-radius: 50%; flex: none; color: var(--text-soft); }
.icon-btn.sm { width: 24px; height: 24px; font-size: 11px; }

.method { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-soft); margin: 16px 2px 6px; }
.enc-table { display: flex; flex-direction: column; gap: 3px; }
.enc-row {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 2px 12px 2px 4px;
}
.enc-row:hover { border-color: var(--line); }
.enc-row.picked { border-color: var(--accent); background: var(--accent-bg); }
.enc-row.is-dupe { opacity: 0.45; }
.enc-row.is-dupe:hover, .enc-row.is-dupe.picked { opacity: 0.8; }
.enc-name { flex: 1; font-weight: 600; }
.enc-lv { font-size: 12.5px; }
.enc-rate { font-family: var(--font-display); font-weight: 600; min-width: 46px; text-align: right; color: var(--accent-2); }
.tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 1px 6px; border-radius: 5px; margin-left: 6px; vertical-align: 1px; }
.tag.dupe { background: var(--surface-3); color: var(--text-soft); }

.result-card {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 12px;
}
.result-card.is-caught { border-color: rgba(79, 209, 139, 0.4); background: var(--good-bg); }
.result-card.is-failed { border-color: rgba(255, 77, 109, 0.4); background: var(--bad-bg); }
.result-card > div:nth-child(2) { flex: 1; }
.result-card p { font-size: 12.5px; margin: 2px 0 0; }
.result-actions { display: flex; gap: 6px; flex-direction: column; }
.result-card .sprite { width: 56px; height: 56px; }

.log-form {
  background: var(--surface-2); border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px; margin-bottom: 6px;
  box-shadow: 0 0 0 4px var(--accent-bg);
}
.log-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }

/* ------------------------------------------------------------- forms + buttons */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin: 8px 0; }
.form-grid.moves { grid-template-columns: 1fr 1fr; }
.form-grid label, label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-soft); font-weight: 600; }
.input {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text); font: 15px var(--font); padding: 9px 11px; min-height: 40px;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 26px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 8px 0; }
.check.compact { margin: 0; font-size: 13px; color: var(--text-soft); }
input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface-3); color: var(--text);
  border-radius: 11px; padding: 10px 16px; font-weight: 700; font-size: 14px; min-height: 42px;
}
.btn:hover { filter: brightness(1.12); }
.btn.sm { padding: 5px 10px; min-height: 30px; font-size: 12.5px; border-radius: 8px; }
.btn.primary { background: linear-gradient(180deg, var(--accent), var(--accent-deep)); border-color: transparent; color: #fff; }
.btn.danger { background: var(--bad); border-color: transparent; color: #fff; }
.btn.danger-ghost { background: var(--bad-bg); border-color: rgba(255, 77, 109, 0.4); color: var(--bad); }
.btn.ghost { background: transparent; }
.btn.full { width: 100%; margin-top: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn-row .btn { flex: 1; }

/* ------------------------------------------------------------- team */
.party-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .party-grid { grid-template-columns: repeat(3, 1fr); } }
.mon-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; display: flex; flex-direction: column; align-items: center; text-align: center; cursor: pointer;
  position: relative; overflow: hidden;
}
.mon-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 70px; background: radial-gradient(circle at 50% 100%, var(--accent-bg), transparent 70%); pointer-events: none; }
.mon-card-top { position: relative; }
.mon-card-top .shiny { position: absolute; top: 0; right: -6px; }
.mon-nick { font-family: var(--font-display); font-size: 16px; margin-top: 2px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.lv-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); font-size: 17px; font-weight: 700; }
.lv { font-family: var(--font-display); font-weight: 700; min-width: 52px; text-align: center; }
.lv.over { color: var(--bad); }

.list { display: flex; flex-direction: column; gap: 5px; }
.row {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 4px 12px 4px 4px;
}
.row:hover { border-color: var(--line); }
.row-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.row.grave .sprite { filter: grayscale(1) brightness(0.8); }
.epitaph { font-size: 12.5px; color: var(--text-soft); }

.mon-hero { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border-radius: var(--radius); padding: 6px 14px 6px 4px; }
.mon-hero.is-dead .sprite { filter: grayscale(1); }
.death-card, .death-form { margin-top: 10px; border-radius: var(--radius); padding: 10px 12px; background: var(--bad-bg); border: 1px solid rgba(255, 77, 109, 0.35); }
.death-card p { margin: 2px 0; }

/* ------------------------------------------------------------- bosses */
.boss { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; }
.boss.next { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.boss.done { opacity: 0.55; }
.boss.done.open { opacity: 1; }
.boss-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; }
.boss-cap {
  width: 50px; height: 50px; border-radius: 12px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--surface-2); font-family: var(--font-display); font-weight: 700; font-size: 21px; line-height: 1;
}
.boss-cap span { font-size: 10px; color: var(--muted); letter-spacing: 0.08em; }
.boss.next .boss-cap { background: linear-gradient(180deg, var(--accent), var(--accent-deep)); }
.boss.next .boss-cap span { color: rgba(255, 255, 255, 0.75); }
.boss-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.boss-title strong { font-family: var(--font-display); font-size: 17px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.chip { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-soft); }
.chip.opt { background: transparent; border: 1px dashed var(--muted); }
.beat { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.beat input { width: 22px; height: 22px; }
.boss-body { padding: 0 12px 12px; border-top: 1px solid var(--line); }
.variant { margin-top: 10px; font-weight: 600; }
.trainer-label { font-weight: 700; font-size: 13px; margin: 12px 0 4px; }
.trainer-label.partner { color: var(--good); }
.team { display: grid; grid-template-columns: 1fr; gap: 5px; margin-top: 8px; }
@media (min-width: 600px) { .team { grid-template-columns: 1fr 1fr; } }
.foe { display: flex; gap: 6px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 4px 10px 6px 2px; align-items: flex-start; }
.foe-main { display: flex; flex-direction: column; min-width: 0; padding-top: 4px; }
.foe-lv { font-family: var(--font-display); color: var(--accent-2); margin-left: 4px; }
.foe-moves { font-size: 12px; color: var(--text-soft); margin-top: 4px; }

/* ------------------------------------------------------------- run */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; text-align: center; }
.stat strong { display: block; font-family: var(--font-display); font-size: 26px; line-height: 1.1; }
.stat span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat:nth-child(3) strong { color: var(--bad); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card h3 { margin-bottom: 8px; }
.card summary { cursor: pointer; list-style: none; }
.card summary::-webkit-details-marker { display: none; }
.card summary h3 { display: inline; }
.card summary::after { content: '▾'; float: right; color: var(--muted); }
details.card[open] summary { margin-bottom: 8px; }
.card ul { margin: 6px 0; padding-left: 20px; }
.rules { display: flex; flex-direction: column; gap: 2px; }
.rule { display: flex; align-items: flex-start; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.rule:last-child { border-bottom: 0; }
.rule span { flex: 1; }
.rule input { margin-top: 1px; flex: none; }
.add-row { display: flex; gap: 8px; margin-top: 10px; }
.history { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.history > div:first-child { display: flex; flex-direction: column; }
.mini-team { display: flex; flex-wrap: wrap; justify-content: flex-end; }

/* ------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); transform: translateX(-50%);
  z-index: 60; background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px;
  padding: 10px 16px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); max-width: calc(100vw - 32px);
  animation: rise 0.2s ease-out;
}
.toast[hidden] { display: none; }

@media (max-width: 380px) {
  .cap-who { max-width: 96px; }
  .brand strong { font-size: 14px; }
}

/* ------------------------------------------------------------- dex */
.dex-filters { display: flex; gap: 8px; margin: 10px 0 12px; align-items: center; }
.dex-filters .seg { flex: none; }
.type-select { flex: 1; min-width: 0; }
.dexno { font-family: var(--font-display); font-weight: 600; font-size: 12.5px; }
.row-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; max-width: 42%; }
.row-tags .tag { margin-left: 0; }
.tag.chg { background: var(--accent-bg); color: var(--accent-2); }
.tag.mod { background: rgba(255, 201, 74, 0.12); color: var(--gold); }
.tag.own { background: var(--good-bg); color: var(--good); }
.tag.dead { background: var(--bad-bg); color: var(--bad); }
.was { display: inline-flex; gap: 4px; align-items: center; font-size: 11.5px; color: var(--muted); margin-left: 4px; }
.was .type { opacity: 0.55; text-decoration: line-through; }

.changelog { margin-top: 12px; border-radius: var(--radius); padding: 10px 14px; background: var(--accent-bg); border: 1px solid rgba(255, 90, 54, 0.35); }
.changelog h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-2); }
.changelog ul { margin: 6px 0 2px; padding-left: 18px; font-size: 14px; }
.changelog li { margin-bottom: 5px; }
.changelog.none { background: var(--surface-2); border-color: var(--line); font-size: 14px; }

.stat-bars { display: flex; flex-direction: column; gap: 4px; }
.stat-bar { display: grid; grid-template-columns: 40px 34px 1fr 36px; align-items: center; gap: 8px; font-size: 13px; }
.sb-name { color: var(--text-soft); font-weight: 600; }
.sb-val { font-family: var(--font-display); font-weight: 700; text-align: right; }
.sb-track { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.sb-fill { display: block; height: 100%; border-radius: 4px; background: hsl(var(--h), 75%, 52%); }
.sb-diff { font-family: var(--font-display); font-weight: 700; font-size: 12.5px; }
.sb-diff.up { color: var(--good); }
.sb-diff.down { color: var(--bad); }
.stat-bar.total { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 2px; }

.defs { display: flex; flex-direction: column; gap: 5px; }
.def-row { display: flex; align-items: flex-start; gap: 8px; }
.def-row .types { margin-top: 0; }
.def-x { font-family: var(--font-display); font-weight: 700; min-width: 30px; font-size: 13px; }
.def-x.weak { color: var(--bad); }
.def-x.resist { color: var(--good); }

.evos { display: flex; flex-direction: column; gap: 6px; }
.evo { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 2px 6px; }
.evo-mon { display: flex; align-items: center; gap: 2px; border: 0; background: none; font-weight: 600; font-size: 13.5px; min-width: 0; }
.evo-mon.cur { color: var(--accent-2); }
.evo-how { font-size: 12px; color: var(--text-soft); text-align: center; max-width: 130px; }

.locs { display: flex; flex-direction: column; gap: 4px; }
.loc { display: flex; flex-direction: column; background: var(--surface-2); border-radius: var(--radius-sm); padding: 6px 10px; }
.loc strong { font-size: 14px; }

.moves { display: flex; flex-direction: column; gap: 2px; }
.move { display: grid; grid-template-columns: 38px 1fr auto 34px; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: var(--surface-2); border-radius: 8px; padding: 7px 10px; font-size: 14px; }
.move.open { border-radius: 8px 8px 0 0; }
.mv-lv { font-family: var(--font-display); font-size: 12.5px; }
.mv-name { font-weight: 600; }
.mv-pow { font-family: var(--font-display); text-align: right; color: var(--text-soft); }
.type.mini { font-size: 9.5px; padding: 0 5px; }
.move-detail { background: var(--surface-2); border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; padding: 6px 12px 8px; margin-bottom: 4px; }
.move-detail p { margin: 2px 0; }
.mv-changes { margin: 4px 0 0; padding-left: 18px; color: var(--gold); }
.removed { margin-top: 8px; }
details.more { margin-top: 10px; }
details.more summary { cursor: pointer; font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-soft); font-weight: 700; padding: 6px 2px; }
.foe[data-foe-dex] { cursor: pointer; }
.foe[data-foe-dex]:hover { outline: 1px solid var(--line); }
.log-head .btn.sm { vertical-align: 2px; margin-left: 4px; }

/* ------------------------------------------------------------- damage calc */
.foe[data-foe-calc] { cursor: pointer; }
.foe[data-foe-calc]:hover { outline: 1px solid var(--accent); }
.calc-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.calc-pick label, .cs-row, .boost-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; color: var(--text-soft); }
.foe-chips { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 8px; scrollbar-width: thin; }
.foe-chip { flex: none; display: flex; align-items: center; gap: 2px; padding: 2px 10px 2px 2px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; font-weight: 600; }
.foe-chip.on { border-color: var(--accent); background: var(--accent-bg); }
.calc-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 520px) { .calc-sides { grid-template-columns: 1fr; } }
.calc-side { background: var(--surface-2); border-radius: var(--radius); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.cs-head { display: flex; gap: 6px; align-items: center; }
.cs-head > div { display: flex; flex-direction: column; min-width: 0; }
.cs-head .btn.sm { align-self: flex-start; margin-top: 4px; min-height: 24px; padding: 2px 8px; font-size: 11.5px; }
.cs-stats { margin: 0; }
.cs-more summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--text-soft); padding: 4px 0; }
.boost-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
.boost-grid .input, .calc-side .input { min-height: 34px; padding: 6px 8px; font-size: 14px; }
.calc-field { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 10px 0 4px; }
.calc-field select { width: auto; min-height: 34px; padding: 5px 28px 5px 10px; font-size: 13.5px; }
.speed-line { font-size: 13.5px; margin: 8px 0 0; }
.good { color: var(--good); font-weight: 700; }
.bad { color: var(--bad); font-weight: 700; }
.dmg-list { display: flex; flex-direction: column; gap: 4px; }
.dmg-row { background: var(--surface-2); border-radius: var(--radius-sm); padding: 7px 10px; }
.dmg-top { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.dmg-top .tag { margin-left: 0; }
.dmg-range { margin-left: auto; font-family: var(--font-display); font-weight: 700; color: var(--accent-2); white-space: nowrap; }
.dmg-bar { display: flex; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin: 6px 0 3px; }
.dmg-min { background: var(--accent); }
.dmg-max { background: rgba(255, 138, 61, 0.45); }
.dmg-ko { font-size: 12px; color: var(--text-soft); }
.dmg-ko.ohko { color: var(--bad); font-weight: 700; }
.calc-notes { padding-left: 18px; margin-top: 12px; }
.ivev summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text-soft); padding: 6px 0; }
.ivev-grid { display: grid; grid-template-columns: 34px repeat(6, 1fr); gap: 4px; align-items: center; }
.ivev-grid .input { padding: 6px 2px; text-align: center; min-height: 34px; font-size: 14px; }
.ivev-h, .ivev-l { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; }
.ivev-stat { font-family: var(--font-display); font-weight: 700; text-align: center; }
