/* PogoRev design system.
   1. Tokens (light + dark)   2. Base   3. App shell   4. Public pages (home, sign-in)
   5. Components (cards, buttons, forms, chips, tables, avatars, IV bars, stats)
   6. Page specifics   7. Motion   8. Responsive
   No external fonts or images (the CSP allows 'self' only); no inline styles, so widths that
   depend on data come from classes (.v-0…15 for IV bars, .w-0…100 for shares). */

/* --- 1. tokens ------------------------------------------------------------------------- */
:root {
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --r-sm: 8px; --r: 12px; --r-lg: 18px; --r-xl: 28px;

  --bg: #f3f5fb; --surface: #ffffff; --surface-2: #f6f8fd; --surface-3: #edf1f9;
  --border: #e1e6f0; --border-strong: #c9d1e3;
  --text: #121836; --muted: #5a6382; --faint: #8a92ad;
  --accent: #0b8579; --accent-hi: #13a796; --accent-text: #ffffff;
  --btn-bg: linear-gradient(135deg, #12a393 0%, #0a7d72 100%);
  --brand: #5254e6; --brand-hi: #7c5cf0; --gold: #e9a524; --gold-hi: #ffd166;
  --danger: #d33b48; --success: #13875a; --warn: #b7741a;
  --build: #13875a; --keep: #2f66d6; --raid: #b5357c; --redundant: #b7741a; --collect: #0f7f8c; --transfer: #737b94;
  --pct-top: #13875a; --pct-good: #2f66d6; --pct-ok: #4f5878; --pct-low: #9aa1b8; --xl: #b7741a;
  --iv: #f0a43a; --iv-max: #e4566a; --iv-track: #e7ebf3;
  --row-hover: #f3f6fc;
  --night-1: #0c1130; --night-2: #18205a; --night-3: #2b2f86;
  --shadow-sm: 0 1px 2px rgb(18 24 54 / .06);
  --shadow: 0 1px 2px rgb(18 24 54 / .05), 0 6px 20px -8px rgb(18 24 54 / .10);
  --shadow-lg: 0 2px 6px rgb(18 24 54 / .06), 0 28px 60px -24px rgb(18 24 54 / .32);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent-hi) 32%, transparent);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%235a6382' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --sidebar-w: 252px; --tabbar-h: 62px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090d1f; --surface: #11182f; --surface-2: #151d38; --surface-3: #1b2444;
    --border: #222c4c; --border-strong: #323d66;
    --text: #e8ecfa; --muted: #9ba5c6; --faint: #6c7598;
    --accent: #2dd4bf; --accent-hi: #5eead4; --accent-text: #032824;
    --btn-bg: linear-gradient(135deg, #5eead4 0%, #2dd4bf 55%, #14b8a6 100%);
    --brand: #8b8ff9; --brand-hi: #a78bfa; --gold: #f5c050;
    --danger: #f77b84; --success: #4ad295; --warn: #f0b45a;
    --build: #4ad295; --keep: #7aa7ff; --raid: #f080c0; --redundant: #f0b45a; --collect: #4fd0dc; --transfer: #959dbb;
    --pct-top: #4ad295; --pct-good: #7aa7ff; --pct-ok: #c4cbe3; --pct-low: #6c7598; --xl: #f0b45a;
    --iv: #f4ad4a; --iv-max: #f2667a; --iv-track: #232d4f;
    --row-hover: #18213f;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .3);
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -10px rgb(0 0 0 / .5);
    --shadow-lg: 0 30px 70px -24px rgb(0 0 0 / .7);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%239ba5c6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}

/* --- 2. base --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body { margin: 0; min-height: 100vh; color: var(--text); font: 15px/1.5 var(--font);
  background:
    radial-gradient(1100px 520px at 100% -8%, color-mix(in srgb, var(--accent-hi) 9%, transparent), transparent 70%),
    radial-gradient(900px 480px at -10% -12%, color-mix(in srgb, var(--brand) 8%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.015em; line-height: 1.2; }
h1 { font-size: 1.75rem; font-weight: 750; margin: 0 0 .75rem; }
h2 { font-size: 1.08rem; font-weight: 700; margin: 0 0 .8rem; }
h3 { font-size: .98rem; font-weight: 700; margin: 0 0 .5rem; }
h1 .muted, h2 .muted { font-weight: 600; }
p { margin: 0 0 .8rem; }
ul, ol { padding-left: 1.25rem; }
li { margin: .2rem 0; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-3); padding: .08em .4em;
  border-radius: 6px; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
::selection { background: color-mix(in srgb, var(--accent-hi) 30%, transparent); }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); } .small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.mt { margin-top: .9rem; }
.w-9 { width: 9rem; }
.right { text-align: right; }
.warn { color: var(--danger); }
.legacy { color: var(--redundant); font-weight: 700; margin-left: 1px; }
.xl { color: var(--xl); font-weight: 650; font-size: .85em; }
.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: -999px; top: .5rem; z-index: 100; background: var(--surface);
  padding: .5rem .9rem; border-radius: var(--r); box-shadow: var(--shadow); }
.skip:focus { left: .5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- 3. app shell ---------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  gap: 1rem; padding: 1.1rem .85rem .9rem; color: #fff; z-index: 40;
  background:
    radial-gradient(420px 260px at 0% 0%, rgb(46 230 197 / .14), transparent 70%),
    radial-gradient(380px 300px at 100% 100%, rgb(124 92 240 / .22), transparent 70%),
    linear-gradient(180deg, var(--night-2), var(--night-1));
  scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / .15) transparent; }
.side-brand, .brand { display: inline-flex; align-items: center; gap: .6rem; color: inherit;
  font: 800 1.2rem/1 var(--font-display); letter-spacing: -.02em; }
.side-brand { padding: .2rem .5rem; color: #fff; }
.side-brand:hover, .brand:hover { text-decoration: none; }
.side-brand img, .brand img { width: 34px; height: 34px; border-radius: 10px;
  box-shadow: 0 4px 14px -4px rgb(46 230 197 / .5); }
.add-btn { width: 100%; justify-content: center; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-label { margin: 1rem .75rem .3rem; font-size: .76rem; font-weight: 600; color: rgb(255 255 255 / .45); }
.side-label:first-child { margin-top: 0; }
.side-link { position: relative; display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem;
  border-radius: 11px; color: rgb(255 255 255 / .74); font-weight: 550;
  transition: background-color .15s, color .15s; }
.side-link .i { width: 1.2rem; height: 1.2rem; color: rgb(255 255 255 / .55); transition: color .15s; }
.side-link:hover { background: rgb(255 255 255 / .07); color: #fff; text-decoration: none; }
.side-link:hover .i { color: rgb(255 255 255 / .85); }
.side-link[aria-current="page"] { background: rgb(255 255 255 / .11); color: #fff;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06); }
.side-link[aria-current="page"] .i { color: #5eead4; }
.side-link[aria-current="page"]::before { content: ""; position: absolute; left: -.85rem; top: 22%; bottom: 22%;
  width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(#5eead4, #2dd4bf); }
.side-link .count { margin-left: auto; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: .4rem; padding: .55rem;
  border-radius: 14px; background: rgb(255 255 255 / .06); }
.side-user { display: flex; align-items: center; gap: .6rem; min-width: 0; flex: 1; color: #fff; padding: .15rem; border-radius: 10px; }
.side-user:hover { text-decoration: none; background: rgb(255 255 255 / .06); }
.side-user[aria-current="page"] { background: rgb(255 255 255 / .1); }
.side-user > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.side-user strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.side-user small { color: rgb(255 255 255 / .55); font-size: .75rem; }
.user-dot { flex: none; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%;
  font: 750 .95rem/1 var(--font-display); color: #0c1130; background: linear-gradient(135deg, #5eead4, #a78bfa); }
.icon-btn { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0; flex: none;
  border-radius: 11px; border: 1px solid transparent; background: transparent; color: inherit; cursor: pointer;
  box-shadow: none; }
.icon-btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); transform: none; box-shadow: none; }
.icon-btn .i { width: 1.25rem; height: 1.25rem; }
.side-foot .icon-btn { color: rgb(255 255 255 / .7); }
.side-foot .icon-btn:hover { color: #fff; }
.nav-form { display: inline; margin: 0; }
.shell-main { min-width: 0; display: flex; flex-direction: column; }
.appbar { display: none; }
.tabbar, .scrim { display: none; }
main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 2rem 2.25rem 2.5rem; flex: 1; }
footer { color: var(--faint); font-size: .78rem; text-align: center; padding: 1.25rem 1.5rem 2rem; }
footer a { color: var(--muted); }
.stale-banner { display: flex; align-items: center; gap: .8rem; justify-content: center; flex-wrap: wrap;
  background: color-mix(in srgb, var(--redundant) 13%, var(--surface)); color: var(--text);
  border-bottom: 1px solid color-mix(in srgb, var(--redundant) 40%, transparent);
  padding: .5rem 1rem; font-size: .88rem; }
.stale-banner form { margin: 0; }

/* --- 4. public pages ------------------------------------------------------------------- */
.public-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .8rem max(1.25rem, calc((100% - 1180px) / 2)); color: var(--text);
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.public-top nav { display: flex; align-items: center; gap: .35rem; }
.public-top nav > a:not(.btn) { color: var(--muted); font-weight: 550; padding: .45rem .7rem; border-radius: 999px; }
.public-top nav > a:not(.btn):hover { color: var(--text); background: var(--surface-3); text-decoration: none; }
body.on-home .public-top { position: absolute; left: 0; right: 0; background: transparent; border: 0;
  backdrop-filter: none; -webkit-backdrop-filter: none; color: #fff; }
body.on-home .public-top nav > a:not(.btn) { color: rgb(255 255 255 / .78); }
body.on-home .public-top nav > a:not(.btn):hover { color: #fff; background: rgb(255 255 255 / .1); }
main.bare { max-width: none; padding: 0; }
main.narrow { max-width: 960px; }

/* home */
.hero { position: relative; overflow: hidden; color: #fff; padding: 8.5rem 1.25rem 6rem;
  background:
    radial-gradient(800px 420px at 85% 15%, rgb(124 92 240 / .45), transparent 65%),
    radial-gradient(700px 420px at 5% 95%, rgb(46 230 197 / .28), transparent 65%),
    linear-gradient(165deg, #1d2470 0%, var(--night-2) 40%, var(--night-1) 100%); }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgb(255 255 255 / .16) 1px, transparent 1.4px); background-size: 26px 26px;
  mask-image: radial-gradient(ellipse at 60% 30%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 60% 30%, #000 10%, transparent 70%); }
.hero::after { content: ""; position: absolute; width: 760px; height: 760px; right: -260px; bottom: -420px;
  border-radius: 50%; border: 56px solid rgb(255 255 255 / .035); pointer-events: none;
  box-shadow: inset 0 0 0 150px rgb(255 255 255 / .015); }
.hero-inner { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 3.5rem; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; font-weight: 650;
  color: var(--accent); margin-bottom: .9rem; }
.hero .eyebrow { color: #5eead4; padding: .35rem .75rem; border-radius: 999px;
  background: rgb(94 234 212 / .1); box-shadow: inset 0 0 0 1px rgb(94 234 212 / .25); }
.hero h1 { font-size: clamp(2.3rem, 4.8vw, 3.7rem); line-height: 1.04; letter-spacing: -.035em; font-weight: 800;
  margin-bottom: 1.6rem; text-wrap: balance; }
.hero .lede { font-size: 1.14rem; line-height: 1.6; color: rgb(255 255 255 / .78); max-width: 34rem; margin-bottom: 1.8rem; }
.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; }
.hero-note { margin-top: 1.4rem; font-size: .86rem; color: rgb(255 255 255 / .6); display: flex; gap: 1.1rem; flex-wrap: wrap; }
.hero-note span { display: inline-flex; align-items: center; gap: .4rem; }
.hero-note .i { color: #5eead4; }
.btn.glass { background: rgb(255 255 255 / .1); color: #fff; border-color: rgb(255 255 255 / .22); box-shadow: none; }
.btn.glass:hover { background: rgb(255 255 255 / .16); }
.btn.lg { padding: .85rem 1.5rem; font-size: 1.02rem; }

/* home: an appraisal card, the game's most familiar screen, read the way PogoRev reads it */
.appraisal { position: relative; color: var(--text); background: var(--surface); border-radius: 26px;
  padding: 1.6rem 1.6rem 1.2rem; box-shadow: 0 40px 80px -30px rgb(0 0 0 / .7), 0 0 0 1px rgb(255 255 255 / .1); }
.appraisal-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.3rem; }
.appraisal-head h2 { margin: 0; font-size: 1.45rem; font-weight: 800; }
.appraisal-head .muted { font-size: .88rem; }
.appraisal .ivbars.labeled { gap: .85rem; }
.appraisal .ivbars.labeled .ivbar-track { height: 12px; }
.appraisal-result { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.3rem;
  padding-top: 1.1rem; border-top: 1px dashed var(--border-strong); }
.appraisal-result strong { display: block; font: 800 1.9rem/1 var(--font-display); letter-spacing: -.03em; color: var(--pct-top); }
.appraisal-result span.muted { font-size: .86rem; }
.stamp { display: inline-block; padding: .4rem .9rem; border-radius: 10px; border: 3px solid currentColor;
  font: 800 1.15rem/1 var(--font-display); letter-spacing: .06em; transform: rotate(-4deg); }
.appraisal-list { display: flex; flex-direction: column; gap: .4rem; margin-top: 1.1rem; }
.mon-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: .75rem; align-items: center;
  padding: .5rem .65rem; background: var(--surface-2); border-radius: 14px; }
.mon-row strong { display: block; font-size: .9rem; }
.mon-row .muted { font-size: .76rem; }
.appraisal-search { display: flex; align-items: center; gap: .6rem; margin-top: .9rem; font-size: .82rem; color: var(--muted); }
.appraisal-search code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: .35rem .6rem; border-radius: 9px; background: var(--surface-2); border: 1px dashed var(--border-strong); }

.section { max-width: 1180px; margin: 0 auto; padding: 5rem 1.25rem; }
.section-head { max-width: 42rem; margin: 0 auto 2.6rem; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: .7rem; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.steps-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; counter-reset: hstep; }
.step-card { position: relative; padding: 1.5rem 1.4rem 1.4rem; border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); counter-increment: hstep; }
.step-card::after { content: "0" counter(hstep); position: absolute; right: 1.2rem; top: 1rem;
  font: 800 2.4rem/1 var(--font-display); color: var(--surface-3); letter-spacing: -.04em; }
.step-card h3 { font-size: 1.1rem; margin: .9rem 0 .4rem; }
.step-card p { color: var(--muted); margin: 0; }
.feature-icon { display: inline-grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: 14px;
  color: #fff; background: linear-gradient(135deg, var(--fi-1, #2dd4bf), var(--fi-2, #0b8579));
  box-shadow: 0 10px 22px -10px var(--fi-2, #0b8579); }
.feature-icon .i { width: 1.35rem; height: 1.35rem; }
.fi-indigo { --fi-1: #8b8ff9; --fi-2: #4f46e5; } .fi-pink { --fi-1: #f48fc8; --fi-2: #c02f7f; }
.fi-gold { --fi-1: #ffd166; --fi-2: #e08a12; } .fi-blue { --fi-1: #7cc4ff; --fi-2: #2f66d6; }
.fi-green { --fi-1: #6ee7a8; --fi-2: #13875a; } .fi-violet { --fi-1: #c4b5fd; --fi-2: #7c3aed; }
.fi-slate { --fi-1: #a5b0cc; --fi-2: #4b5575; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.feature { padding: 1.3rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, border-color .2s; }
.feature:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.feature h3 { margin: .9rem 0 .35rem; font-size: 1.02rem; }
.feature p { color: var(--muted); font-size: .9rem; margin: 0; }
.feature.wide { grid-column: span 2; }
.feature-grid.three { grid-template-columns: repeat(3, 1fr); }
.section.trust { padding-top: 0; }
.verdict-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: .7rem; margin-top: 1.4rem; }
.verdict-card { padding: 1rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border);
  border-top: 3px solid currentColor; }
.verdict-card strong { display: block; font: 800 .95rem/1.2 var(--font-display); letter-spacing: .04em; margin-bottom: .3rem; }
.verdict-card span { display: block; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.cta-band { position: relative; overflow: hidden; max-width: 1180px; margin: 0 auto 4rem; padding: 3rem 2rem;
  border-radius: var(--r-xl); text-align: center; color: #fff;
  background: radial-gradient(600px 300px at 90% 0%, rgb(124 92 240 / .5), transparent 70%),
    radial-gradient(500px 300px at 0% 100%, rgb(46 230 197 / .3), transparent 70%),
    linear-gradient(135deg, var(--night-2), var(--night-1)); }
.cta-band h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; margin-bottom: .6rem; }
.cta-band p { color: rgb(255 255 255 / .74); max-width: 36rem; margin: 0 auto 1.5rem; }
.cta-band .hero-actions { justify-content: center; }

/* sign-in, invite: a brand panel beside the form */
.auth-wrap { min-height: calc(100vh - 9rem); display: grid; place-items: center; padding: 1rem 0 2rem; }
.auth-card { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); width: min(100%, 920px);
  border-radius: var(--r-xl); overflow: hidden; background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); }
.auth-side { position: relative; padding: 2.4rem 2.2rem; color: #fff; display: flex; flex-direction: column; gap: 1.2rem;
  background: radial-gradient(420px 300px at 100% 0%, rgb(124 92 240 / .45), transparent 70%),
    radial-gradient(380px 300px at 0% 100%, rgb(46 230 197 / .3), transparent 70%),
    linear-gradient(160deg, var(--night-2), var(--night-1)); }
.auth-side h2 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.03em; margin: .6rem 0 0; }
.auth-side p { color: rgb(255 255 255 / .72); margin: 0; }
.auth-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.auth-side li { display: flex; gap: .65rem; align-items: flex-start; color: rgb(255 255 255 / .85); font-size: .92rem; margin: 0; }
.auth-side li .i { color: #5eead4; margin-top: .15rem; }
.auth-side .brand { color: #fff; }
.auth-main { padding: 2.4rem 2.4rem 2rem; }
.auth-main h1 { font-size: 1.6rem; margin-bottom: .35rem; }
.auth-main > .muted:first-of-type { margin-bottom: 1.3rem; }
.auth-main .form { display: grid; gap: .9rem; margin: 1.2rem 0; }
.auth-main .form > label { margin: 0; }
.auth-main .form button[type=submit] { width: 100%; justify-content: center; padding: .75rem 1rem; }
.auth-box { max-width: 30rem; margin: 3rem auto; }
.auth-box .form button { width: 100%; }
.auth-providers { display: grid; gap: .55rem; margin: 1rem 0; }
.auth-providers .btn { justify-content: center; }
.divider { display: flex; align-items: center; gap: .8rem; color: var(--faint); font-size: .8rem; margin: 1rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* --- 5. components --------------------------------------------------------------------- */
/* page header */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end;
  gap: .9rem 1rem; margin-bottom: 1.4rem; }
.page-head h1, .page-head h2 { margin: 0; }
.page-head .eyebrow { margin-bottom: .35rem; }
.page-title { min-width: 0; }
.lede { color: var(--muted); max-width: 52rem; margin: -.6rem 0 1.4rem; }
.page-title .lede { margin: .4rem 0 0; }
.crumb { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; font-weight: 550; color: var(--muted);
  margin-bottom: .6rem; }
.crumb:hover { color: var(--text); text-decoration: none; }
.actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
form.inline { display: inline; }
.count-pill { display: inline-block; vertical-align: .25em; margin-left: .4rem; padding: .12rem .55rem; border-radius: 999px;
  font: 700 .85rem/1.3 var(--font); background: var(--surface-3); color: var(--muted); letter-spacing: 0; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 1.25rem 1.4rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); overflow-x: auto; }
.card > h2:first-child, .card > .card-head:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .9rem; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: .55rem; }
.card-head h2 .i { color: var(--accent); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .tbl-wrap { margin: 0; padding: 0; }
.card > :last-child { margin-bottom: 0; }
details.card > summary { list-style: none; font-weight: 650; color: var(--text); font-size: .95rem; display: flex;
  align-items: center; gap: .5rem; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: ""; width: .5rem; height: .5rem; border: solid var(--muted);
  border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform .15s; margin-right: .2rem; }
details.card[open] > summary::before { transform: rotate(45deg); }
details.card[open] > summary { margin-bottom: .8rem; }

/* buttons */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: 650 .92rem/1.2 var(--font); letter-spacing: .005em; border: 1px solid transparent;
  background: var(--btn-bg); color: var(--accent-text); padding: .6rem 1.15rem; border-radius: 999px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: 0 1px 0 rgb(255 255 255 / .25) inset, 0 6px 16px -8px color-mix(in srgb, var(--accent) 80%, transparent);
  transition: transform .15s, box-shadow .15s, filter .15s, background-color .15s, border-color .15s, color .15s; }
button:hover, .btn:hover { text-decoration: none; filter: brightness(1.06);
  box-shadow: 0 1px 0 rgb(255 255 255 / .25) inset, 0 10px 22px -10px color-mix(in srgb, var(--accent) 90%, transparent); }
button:active, .btn:active { transform: translateY(0); filter: brightness(.97); }
button:focus-visible, .btn:focus-visible { outline: none; box-shadow: var(--ring); }
button .i, .btn .i { width: 1.05rem; height: 1.05rem; }
button.secondary, .btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong);
  box-shadow: var(--shadow-sm); }
button.secondary:hover, .btn.secondary:hover { border-color: var(--accent); color: var(--accent); filter: none;
  box-shadow: var(--shadow-sm); }
button.danger, .btn.danger { background: transparent; color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 55%, transparent); box-shadow: none; }
button.danger:hover, .btn.danger:hover { background: color-mix(in srgb, var(--danger) 9%, transparent); filter: none; box-shadow: none; }
.btn.small, .small-btn { padding: .36rem .8rem; font-size: .82rem; }
.btn.small { color: var(--accent-text); }
.btn.secondary.small { color: var(--text); }
button:disabled, .btn.disabled { opacity: .45; cursor: default; pointer-events: none; transform: none; }
.link-btn { background: none; border: none; padding: 0; color: var(--muted); cursor: pointer; box-shadow: none;
  font-weight: 550; border-radius: 4px; }
.link-btn:hover { color: var(--text); filter: none; transform: none; box-shadow: none; text-decoration: underline; }

/* forms */
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); width: 100%;
  border: 1px solid var(--border-strong); border-radius: var(--r); padding: .58rem .8rem;
  transition: border-color .15s, box-shadow .15s, background-color .15s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input:user-invalid, textarea:user-invalid { border-color: var(--danger); }
input:user-invalid:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); }
/* Replace the native arrow (Windows draws a light square button on hover) with a chevron. */
select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 2.2rem;
  background-image: var(--chevron); background-repeat: no-repeat;
  background-position: right .8rem center; background-size: 12px 12px; }
select::-ms-expand { display: none; }
/* Checkboxes and radios: one look everywhere, in both themes. The tick is a clip-path. */
input:is([type=checkbox], [type=radio]):not([hidden]) {
  appearance: none; -webkit-appearance: none; flex: none; width: 1.2rem; height: 1.2rem;
  margin: 0; padding: 0; display: inline-grid; place-content: center; vertical-align: -.22em;
  border: 1.5px solid var(--border-strong); border-radius: 6px; background: var(--surface);
  cursor: pointer; transition: background-color .12s, border-color .12s, box-shadow .12s; }
input[type=radio]:not([hidden]) { border-radius: 50%; }
input[type=checkbox]:not([hidden])::before { content: ""; width: .72rem; height: .72rem;
  background: var(--accent-text); transform: scale(0); transition: transform .12s ease-out;
  clip-path: polygon(14% 44%, 0 62%, 42% 100%, 100% 22%, 84% 6%, 40% 66%); }
input[type=radio]:not([hidden])::before { content: ""; width: .58rem; height: .58rem;
  border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .12s ease-out; }
input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
input[type=radio]:checked { border-color: var(--accent); }
input:is([type=checkbox], [type=radio]):checked::before { transform: scale(1); }
input:is([type=checkbox], [type=radio]):hover { border-color: var(--accent); }
input:is([type=checkbox], [type=radio]):focus { box-shadow: none; }
input:is([type=checkbox], [type=radio]):focus-visible { box-shadow: var(--ring); }
input:is([type=checkbox], [type=radio]):disabled { opacity: .5; cursor: default; }
label:has(> input:is([type=checkbox], [type=radio])) { cursor: pointer; }
label { display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; font-weight: 600; color: var(--text); }
label .hint, .label-line .hint { color: var(--muted); font-size: .78rem; font-weight: 450; }
label .muted { font-weight: 450; }
.form .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem; margin-bottom: .9rem;
  align-items: end; }      /* inputs in a row line up, however long each label is */
.form > label { margin-bottom: .9rem; }
.checks { display: flex; gap: .6rem 1.4rem; flex-wrap: wrap; margin-bottom: .9rem; }
.checks label { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
.checks label select { width: auto; }
.checks input { width: auto; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .45rem .8rem; }
.check-grid .inline-check { padding: .55rem .7rem; border: 1px solid var(--border); border-radius: var(--r);
  margin: 0; transition: border-color .15s, background-color .15s; }
.check-grid .inline-check:hover { border-color: var(--accent); }
.check-grid .inline-check:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, transparent); }
.inline-check { display: inline-flex; flex-direction: row; align-items: center; gap: .5rem; margin-right: .6rem; font-weight: 500; }
.inline-check input { width: auto; }
.inline-label { display: inline-flex; flex-direction: row; align-items: center; gap: .5rem; }
.inline-form { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-top: 1rem; }
.inline-form input:not([type=checkbox]):not([type=hidden]) { flex: 1 1 220px; width: auto; }
.inline-form.tight { margin-top: 0; gap: .5rem; }
input.num { width: 5.5rem; display: inline-block; }
.confirm-input { width: 10rem; }
.label-line { margin: 1rem 0 .5rem; font-weight: 600; font-size: .9rem; }
.check-drop { margin: 1rem 0 0; }
.sticky-actions { position: sticky; bottom: 1rem; z-index: 5; display: flex; justify-content: flex-end; gap: .6rem;
  padding: .7rem; margin-top: .4rem; border-radius: 999px; background: color-mix(in srgb, var(--surface) 85%, transparent);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.sticky-actions .muted { margin-right: auto; padding-left: .7rem; align-self: center; }

/* toolbar of filters */
.filters { display: flex; gap: .55rem; margin-bottom: 1.1rem; flex-wrap: wrap; align-items: center;
  padding: .55rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.filters input[type=search], .filters .search-field { flex: 1 1 260px; }
.filters select { width: auto; }
.filters > input, .filters select, .filters .search-field input { border-color: transparent; background-color: var(--surface-2); }
.filters > input:focus, .filters select:focus, .filters .search-field input:focus { border-color: var(--accent); background-color: var(--surface); }
.filters .chips { flex-wrap: wrap; }
.search-field { position: relative; display: flex; align-items: center; }
.search-field .i { position: absolute; left: .8rem; color: var(--faint); pointer-events: none; }
.search-field input { padding-left: 2.35rem; }

/* notices */
.alert, .notice { display: block; border-radius: var(--r); padding: .75rem 1rem;
  margin-bottom: 1.1rem; font-size: .92rem; border: 1px solid; }
.alert { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); color: var(--text);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent); box-shadow: inset 4px 0 0 var(--danger); }
.notice { background: color-mix(in srgb, var(--success) 8%, var(--surface)); color: var(--text);
  border-color: color-mix(in srgb, var(--success) 35%, transparent); box-shadow: inset 4px 0 0 var(--success); }
.notice-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.notice-row form { margin: 0; }

/* tables */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th, .tbl td { text-align: left; padding: .62rem .75rem; border-bottom: 1px solid var(--border); white-space: nowrap;
  vertical-align: middle; }
.tbl thead th { font-size: .78rem; color: var(--muted); font-weight: 650;
  background: var(--surface-2); border-bottom-color: var(--border); }
.tbl thead th:first-child { border-top-left-radius: 10px; } .tbl thead th:last-child { border-top-right-radius: 10px; }
.card.flush .tbl thead th { border-radius: 0; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl td:first-child { white-space: normal; }
.tbl td { font-variant-numeric: tabular-nums; }
.tbl td.wrap { white-space: normal; }
.tbl td.nowrap { white-space: nowrap; }
.tbl td.target { min-width: 9rem; max-width: 14rem; }
.tbl tbody tr { transition: background-color .12s; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--row-hover); }
tr.dim td { opacity: .5; }
tr.top-band td:first-child { box-shadow: inset 3px 0 0 var(--raid); }
tr.owned td { background: color-mix(in srgb, var(--raid) 7%, transparent); }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.card > .tbl-wrap { margin: 0 -.4rem; padding: 0 .4rem; }
.kv th { width: 6rem; text-transform: none; font-size: .82rem; letter-spacing: 0; color: var(--muted); font-weight: 600;
  background: none; vertical-align: top; }
.kv td { white-space: normal; }
.kv tr:last-child th, .kv tr:last-child td { border-bottom: none; }
.pct-top { color: var(--pct-top); font-weight: 700; } .pct-good { color: var(--pct-good); font-weight: 600; }
.pct-ok { color: var(--pct-ok); } .pct-low { color: var(--pct-low); }

/* chips & badges */
.chips { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .65rem; border-radius: 999px;
  font-size: .74rem; font-weight: 700; letter-spacing: .03em; line-height: 1.5; white-space: nowrap;
  color: var(--muted); border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
  background: color-mix(in srgb, currentColor 8%, transparent); }
a.chip { transition: background-color .15s, border-color .15s, color .15s, transform .15s; }
a.chip:hover { text-decoration: none; border-color: currentColor; background: color-mix(in srgb, currentColor 14%, transparent); }
.chip.active { border-color: currentColor; background: color-mix(in srgb, currentColor 18%, transparent);
  box-shadow: 0 0 0 1px currentColor inset; }
.chip.active:not([class*="verdict-"]):not([class*="scan-"]):not([class*="type-"]):not([class*="kind-"]) { color: var(--text); }
.verdict-build { color: var(--build); } .verdict-keep { color: var(--keep); } .verdict-raid { color: var(--raid); }
.verdict-redundant { color: var(--redundant); } .verdict-collect { color: var(--collect); } .verdict-transfer { color: var(--transfer); }
.chip[class*="verdict-"]::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.verdict-head { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: .7rem; }
.verdict-head .chip { font-size: .85rem; padding: .3rem .85rem; }
.nick { font-size: .88rem; color: var(--muted); }
.reasons { margin: 0 0 .9rem; padding-left: 1.2rem; }
.reasons li::marker { color: var(--faint); }
.badge { display: inline-flex; align-items: center; gap: .2rem; font-size: .68rem; font-weight: 700; padding: .1rem .5rem;
  border-radius: 999px; margin-left: .3rem; vertical-align: .12em; color: var(--k, var(--muted));
  background: color-mix(in srgb, var(--k, var(--muted)) 13%, transparent); text-transform: capitalize; letter-spacing: .02em; }
.kind-shiny { --k: #c88700; } .kind-lucky { --k: #d2761b; } .kind-shadow { --k: #7b3fd0; } .kind-purified { --k: #2286b3; }
.kind-hundo { --k: #d1364b; } .kind-legendary, .kind-mythical { --k: #4559c9; } .kind-costume { --k: #1f8a4c; }
.kind-mega { --k: #8a4fd0; } .kind-dynamax { --k: #c0306f; } .kind-gigantamax { --k: #b02424; }
@media (prefers-color-scheme: dark) {
  .kind-shiny { --k: #ffcf5a; } .kind-lucky { --k: #ffaa5c; } .kind-shadow { --k: #c39bff; } .kind-purified { --k: #7cd0f5; }
  .kind-hundo { --k: #ff8193; } .kind-legendary, .kind-mythical { --k: #9fb0ff; } .kind-costume { --k: #6fdc9c; }
  .kind-mega { --k: #d1a8ff; } .kind-dynamax { --k: #ff8fc0; } .kind-gigantamax { --k: #ff8f8f; }
}
.kind-shiny::before { content: "✦"; font-size: .9em; }
.badge.kind-shiny, .chip.kind-shiny { color: var(--k); }
.kind-verdict { color: var(--keep); } .kind-meta_up, .kind-new_cup { color: var(--build); }
.kind-meta_down { color: var(--redundant); }
.count { display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .38rem; border-radius: 999px;
  background: linear-gradient(135deg, #ff8a5c, #f2556a); color: #fff; font: 750 .7rem/1 var(--font); letter-spacing: 0;
  box-shadow: 0 2px 8px -2px rgb(242 85 106 / .6); }

/* Pokémon types: moves, chips, avatars */
.type-normal { --type: #9099a1; } .type-fighting { --type: #ce4069; } .type-flying { --type: #8fa8dd; }
.type-poison { --type: #ab6ac8; } .type-ground { --type: #d97746; } .type-rock { --type: #c5b78c; }
.type-bug { --type: #90c12c; } .type-ghost { --type: #5269ac; } .type-steel { --type: #5a8ea1; }
.type-fire { --type: #ff9c54; } .type-water { --type: #4d90d5; } .type-grass { --type: #63bb5b; }
.type-electric { --type: #f3d23b; } .type-psychic { --type: #f97176; } .type-ice { --type: #74cec0; }
.type-dragon { --type: #0a6dc4; } .type-dark { --type: #5a5366; } .type-fairy { --type: #ec8fe6; }
.chip[class*="type-"] { color: var(--text); font-weight: 650; letter-spacing: .01em;
  border-color: color-mix(in srgb, var(--type) 45%, transparent); background: color-mix(in srgb, var(--type) 14%, transparent); }
.chip[class*="type-"]::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--type); }
a.chip[class*="type-"]:hover { border-color: var(--type); background: color-mix(in srgb, var(--type) 22%, transparent); }
.chip.active[class*="type-"] { border-color: var(--type); background: color-mix(in srgb, var(--type) 30%, transparent);
  box-shadow: 0 0 0 1px var(--type) inset; }
.type-chips { margin-bottom: 1.1rem; gap: .45rem; }
.type-chips .chip { padding: .32rem .8rem; font-size: .8rem; }
.type-chips .count { height: 1.15rem; min-width: 1.15rem; font-size: .66rem; }
.moveset { display: inline-flex; flex-wrap: wrap; gap: .2rem .3rem; align-items: center; }
.move { font-size: .82rem; padding: .05rem .45rem; border-radius: 6px; border-left: 3px solid var(--type, var(--muted));
  background: color-mix(in srgb, var(--type, var(--muted)) 13%, transparent); white-space: nowrap; }
.moveset .sep { color: var(--faint); font-size: .8rem; }

/* avatars: a type-coloured token per species (no artwork is hot-linked: the CSP is 'self') */
.avatar { --t1: #9099a1; --t2: var(--t1); position: relative; flex: none; display: inline-grid; place-items: center;
  width: 2.6rem; height: 2.6rem; border-radius: 50%; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, var(--t1) 0%, var(--t1) 45%, var(--t2) 55%, var(--t2) 100%);
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / .35), 0 4px 12px -6px color-mix(in srgb, var(--t1) 80%, #000); }
.avatar::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, transparent 0 17%, rgb(255 255 255 / .22) 17.5% 23%, transparent 23.5%),
    linear-gradient(180deg, transparent 47%, rgb(255 255 255 / .22) 47% 53%, transparent 53%),
    radial-gradient(circle at 30% 25%, rgb(255 255 255 / .35), transparent 55%); }
.avatar-ini { position: relative; font: 800 .95rem/1 var(--font-display); letter-spacing: -.02em;
  text-shadow: 0 1px 2px rgb(0 0 0 / .35); }
.avatar.sm { width: 2.1rem; height: 2.1rem; } .avatar.sm .avatar-ini { font-size: .78rem; }
.avatar.lg { width: 5.5rem; height: 5.5rem; box-shadow: inset 0 0 0 3px rgb(255 255 255 / .4), 0 18px 34px -16px color-mix(in srgb, var(--t1) 90%, #000); }
.avatar.lg .avatar-ini { font-size: 1.9rem; }
.avatar.shiny::after { content: "✦"; position: absolute; top: 2%; right: 8%; font-size: .7rem; color: #fff6c9;
  text-shadow: 0 0 6px #ffd166; }
.avatar.lg.shiny::after { font-size: 1.2rem; }
.t1-normal { --t1: #9099a1; } .t1-fighting { --t1: #ce4069; } .t1-flying { --t1: #8fa8dd; } .t1-poison { --t1: #ab6ac8; }
.t1-ground { --t1: #d97746; } .t1-rock { --t1: #c5b78c; } .t1-bug { --t1: #90c12c; } .t1-ghost { --t1: #5269ac; }
.t1-steel { --t1: #5a8ea1; } .t1-fire { --t1: #ff9c54; } .t1-water { --t1: #4d90d5; } .t1-grass { --t1: #63bb5b; }
.t1-electric { --t1: #e8c522; } .t1-psychic { --t1: #f97176; } .t1-ice { --t1: #5fc4b5; } .t1-dragon { --t1: #0a6dc4; }
.t1-dark { --t1: #5a5366; } .t1-fairy { --t1: #ec8fe6; }
.t2-normal { --t2: #9099a1; } .t2-fighting { --t2: #ce4069; } .t2-flying { --t2: #8fa8dd; } .t2-poison { --t2: #ab6ac8; }
.t2-ground { --t2: #d97746; } .t2-rock { --t2: #c5b78c; } .t2-bug { --t2: #90c12c; } .t2-ghost { --t2: #5269ac; }
.t2-steel { --t2: #5a8ea1; } .t2-fire { --t2: #ff9c54; } .t2-water { --t2: #4d90d5; } .t2-grass { --t2: #63bb5b; }
.t2-electric { --t2: #e8c522; } .t2-psychic { --t2: #f97176; } .t2-ice { --t2: #5fc4b5; } .t2-dragon { --t2: #0a6dc4; }
.t2-dark { --t2: #5a5366; } .t2-fairy { --t2: #ec8fe6; }
.mon-cell { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.mon-cell > span:last-child { min-width: 0; }
.mon-name { font-weight: 650; color: var(--text); }
a.mon-name:hover { color: var(--accent); }
.mon-sub { display: block; font-size: .78rem; color: var(--muted); }

/* IV bars: the appraisal's three bars (Attack / Defense / HP), segmented in fifths like the game */
.ivbars { display: inline-flex; flex-direction: column; gap: 3px; width: 4.6rem; vertical-align: middle; }
.ivbar { display: flex; align-items: center; gap: .6rem; }
.ivbar-track { position: relative; flex: 1; height: 5px; border-radius: 999px; background: var(--iv-track); overflow: hidden; }
.ivbar-track::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent calc(33.33% - 1px), var(--surface) calc(33.33% - 1px) calc(33.33% + 1px),
    transparent calc(33.33% + 1px) calc(66.66% - 1px), var(--surface) calc(66.66% - 1px) calc(66.66% + 1px), transparent calc(66.66% + 1px)); }
.ivbar-fill { display: block; height: 100%; border-radius: inherit; background: var(--iv); }
.ivbar-fill.v-15 { background: var(--iv-max); }
.v-0 { width: 0; } .v-1 { width: 6.67%; } .v-2 { width: 13.33%; } .v-3 { width: 20%; } .v-4 { width: 26.67%; }
.v-5 { width: 33.33%; } .v-6 { width: 40%; } .v-7 { width: 46.67%; } .v-8 { width: 53.33%; } .v-9 { width: 60%; }
.v-10 { width: 66.67%; } .v-11 { width: 73.33%; } .v-12 { width: 80%; } .v-13 { width: 86.67%; } .v-14 { width: 93.33%; }
.v-15 { width: 100%; }
.ivbars.labeled { width: 100%; gap: .7rem; }
.ivbars.labeled .ivbar-track { height: 10px; }
.ivbar-label { width: 4.3rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
.ivbar-val { width: 1.6rem; text-align: right; font: 750 .95rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.iv-cell { display: flex; align-items: center; gap: .7rem; }
.iv-cell .iv-text { line-height: 1.25; font-variant-numeric: tabular-nums; }
.iv-cell .iv-text small { display: block; color: var(--muted); font-size: .76rem; }

/* stat tiles (counts with a share bar) */
.stat-tiles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1.1rem; }
.stat { position: relative; display: flex; flex-direction: column; gap: .15rem; padding: .8rem .9rem .85rem;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text);
  box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; overflow: hidden; }
a.stat:hover { text-decoration: none; box-shadow: var(--shadow); border-color: var(--border-strong); }
.stat-label { font-size: .8rem; font-weight: 650; color: var(--muted); }
.stat[class*="verdict-"] .stat-label { color: inherit; }
.stat.verdict-build { color: var(--build); } .stat.verdict-keep { color: var(--keep); } .stat.verdict-raid { color: var(--raid); }
.stat.verdict-redundant { color: var(--redundant); } .stat.verdict-collect { color: var(--collect); } .stat.verdict-transfer { color: var(--transfer); }
.stat-num { font: 800 1.55rem/1.1 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat-sub { font-size: .78rem; color: var(--muted); }
.stat-bar { display: block; height: 4px; border-radius: 999px; background: var(--surface-3); margin-top: .4rem; overflow: hidden; }
.stat-bar > span { display: block; height: 100%; border-radius: inherit; background: currentColor; }
.stat.active { border-color: currentColor; box-shadow: 0 0 0 1px currentColor inset, var(--shadow); }
.stat.active:not([class*="verdict-"]) { color: var(--text); }
.stat.all .stat-bar > span { background: linear-gradient(90deg, var(--accent-hi), var(--brand)); }
.w-0 { width: 0; } .w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; }
.w-25 { width: 25%; } .w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; }
.w-50 { width: 50%; } .w-55 { width: 55%; } .w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; }
.w-75 { width: 75%; } .w-80 { width: 80%; } .w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; } .w-100 { width: 100%; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .7rem; margin-bottom: 1.1rem; }
.stat-grid .stat .i { position: absolute; right: .9rem; top: .85rem; width: 1.3rem; height: 1.3rem; color: var(--accent); opacity: .8; }

/* facts: label above value */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem 1.4rem; }
.facts > div { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.facts .label { display: block; font-size: .78rem; font-weight: 550; color: var(--muted); margin-bottom: .1rem; }
.facts .wide { grid-column: 1 / -1; }
.facts .muted { font-weight: 450; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem; }
.tile { display: flex; flex-direction: column; gap: .2rem; padding: .8rem .9rem; border: 1px solid var(--border);
  border-radius: 14px; color: var(--text); background: var(--surface);
  transition: transform .15s, box-shadow .15s, border-color .15s; }
.tile:hover { border-color: var(--border-strong); text-decoration: none; box-shadow: var(--shadow); }
.mon-tiles .tile { flex-direction: row; align-items: center; gap: .75rem; }
.mon-tiles .mon-tile-body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.mon-tiles strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mon-tiles .ivbars { margin-top: .25rem; }

/* segmented control */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 3px;
  background: var(--surface); box-shadow: var(--shadow-sm); }
.seg a { padding: .4rem 1.05rem; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: .9rem;
  transition: background-color .15s, color .15s; }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a[aria-current="true"] { background: var(--btn-bg); color: var(--accent-text); box-shadow: 0 4px 12px -6px var(--accent); }
.seg.small-seg a { padding: .25rem .8rem; font-size: .82rem; }
.switch-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 0 0 1.1rem; }

/* tabs (chip rows used as sub-navigation) */
.tabs { display: flex; gap: .25rem; margin: -.3rem 0 1.3rem; padding: 4px; border-radius: 999px; width: fit-content;
  background: var(--surface-3); flex-wrap: wrap; }
.tabs .chip { border: 0; background: transparent; color: var(--muted); font-size: .86rem; letter-spacing: 0;
  padding: .38rem 1rem; font-weight: 650; box-shadow: none; }
.tabs .chip:hover { color: var(--text); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.tabs .chip.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* search strings */
.search-string { display: flex; align-items: center; gap: .5rem .7rem; flex-wrap: wrap; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; padding: .6rem .7rem .6rem .9rem; margin-bottom: .75rem;
  box-shadow: var(--shadow-sm); }
.search-string .label { font-size: .84rem; font-weight: 650; color: var(--text); white-space: nowrap; }
.search-string .q { flex: 1 1 240px; overflow-x: auto; white-space: nowrap; padding: .35rem .6rem; border-radius: 9px;
  background: var(--surface-2); border: 1px dashed var(--border-strong); font-size: .84rem; scrollbar-width: thin; }
.search-string .hint { flex-basis: 100%; }
.scan-searches { margin-bottom: 1rem; }
.scan-searches > summary { cursor: pointer; padding: .4rem 0; font-size: .9rem; font-weight: 600; color: var(--text); }
.scan-searches[open] > summary { margin-bottom: .5rem; }
.mark-form { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: -.2rem 0 1rem; }

/* pagination */
.pager { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: .9rem 0; }
.pager .disabled { opacity: .4; pointer-events: none; }

/* empty states */
.empty { text-align: center; padding: 2.5rem 1.5rem; }
.empty-icon { display: inline-grid; place-items: center; width: 4rem; height: 4rem; border-radius: 50%; margin-bottom: 1rem;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.empty-icon .i { width: 1.8rem; height: 1.8rem; }
.empty h2 { font-size: 1.25rem; }
.empty .actions { justify-content: center; }

/* lists */
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .7rem; padding: .7rem 0;
  border-bottom: 1px solid var(--border); margin: 0; }
.plain-list li:last-child { border-bottom: none; }
.person { display: inline-flex; align-items: center; gap: .65rem; font-weight: 650; margin-right: auto; }
.person .user-dot { width: 2.2rem; height: 2.2rem; }
.log-list, .job-list { list-style: none; margin: 0; padding: 0; }
.log-list li { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .45rem 0;
  border-bottom: 1px solid var(--border); font-size: .88rem; margin: 0; }
.log-list li:last-child { border-bottom: none; }
.log-list .file { max-width: 100%; }
.job-list li { padding: .45rem 0; border-bottom: 1px solid var(--border); margin: 0; }
.job-list li:last-child { border-bottom: none; }
.job-list summary { display: flex; flex-wrap: wrap; gap: .45rem; align-items: baseline; color: var(--text); }
.job-result { flex-basis: 100%; color: var(--muted); font-size: .85rem; }
pre.log { margin: .4rem 0 0; padding: .7rem .8rem; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; font: .78rem/1.5 var(--mono); white-space: pre-wrap; word-break: break-word;
  max-height: 22rem; overflow-y: auto; }
details summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
details[open] > summary { margin-bottom: .5rem; }
.danger-zone summary { color: var(--danger); font-weight: 600; }

/* status chips (scans, jobs, workers) */
.scan-pending { color: var(--redundant); } .scan-confirmed { color: var(--build); }
.scan-rejected, .scan-all { color: var(--transfer); }
.chip.active.scan-all { color: var(--text); }
.state-watching, .job-done, .scan-added, .scan-updated { color: var(--build); }
.state-catching-up, .state-stopping, .job-running, .scan-review { color: var(--redundant); }
.state-error, .job-failed, .scan-error { color: var(--danger); }
.state-stopped, .scan-unchanged, .scan-ignored, .scan-skipped { color: var(--transfer); }
.chip.scan-info { color: var(--transfer); }
.job-running::before, .chip.job-running::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%;
  background: currentColor; animation: pulse 1.2s ease-in-out infinite; }

/* --- 6. page specifics ----------------------------------------------------------------- */
/* collection */
.tbl.collection td { padding-top: .7rem; padding-bottom: .7rem; }
.tbl.collection .c-pct { font: 700 .98rem/1 var(--font-display); }
.m-label { display: none; }
.mon-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(240px, 320px); gap: 1.6rem; align-items: center;
  padding: 1.5rem 1.6rem; position: relative; overflow: hidden; }
.mon-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 100%; pointer-events: none; opacity: .14;
  background: radial-gradient(520px 220px at 0% 0%, var(--t1), transparent 70%), radial-gradient(420px 220px at 100% 100%, var(--t2, var(--t1)), transparent 70%); }
.mon-hero > * { position: relative; }
.mon-hero h1 { margin: 0 0 .35rem; font-size: 1.9rem; }
.mon-hero .chips { margin-bottom: .7rem; }
.mon-hero .dex { font: 700 .82rem/1 var(--font-display); color: var(--muted); letter-spacing: .04em; }
.mon-hero .facts { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); margin-top: .9rem; }
.iv-panel { padding: 1rem 1.1rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.iv-panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .8rem; }
.iv-panel-head strong { font: 800 1.5rem/1 var(--font-display); }
.iv-panel-head span { font-size: .84rem; font-weight: 600; color: var(--muted); }
.raid-list { margin: 0; padding-left: 1.1rem; }
.raid-list li { margin: .35rem 0; }
.raid-estimate { margin: 1rem 0 0; padding: .8rem 1rem; border-radius: 12px; background: var(--surface-2); }

/* scans */
.dropzone { padding: 0; overflow: visible; }
.drop { display: flex; flex-direction: column; align-items: center; gap: .55rem; padding: 2.2rem 1.4rem; text-align: center;
  cursor: pointer; border: 2px dashed var(--border-strong); border-radius: var(--r-lg); color: var(--muted);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 4%, transparent), transparent);
  transition: border-color .15s, background-color .15s, color .15s; }
.card.dropzone .drop { border-radius: calc(var(--r-lg) - 1px); border-color: transparent;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent 80%); }
.card.dropzone { border: 2px dashed var(--border-strong); }
.card.dropzone:hover, .card.dropzone:has(.drop.over) { border-color: var(--accent); }
.drop:hover { color: var(--text); }
.drop strong { color: var(--text); font-size: 1rem; }
.drop-icon { display: inline-grid; place-items: center; width: 3.3rem; height: 3.3rem; border-radius: 16px; color: #fff;
  background: var(--btn-bg); box-shadow: 0 10px 22px -10px var(--accent); transition: transform .2s; }
.drop:hover .drop-icon { transform: translateY(-3px); }
.drop-icon .i { width: 1.5rem; height: 1.5rem; }
.drop-formats { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; }
.drop input { display: none; }
.drop.over { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 9%, transparent); }
.drop.busy { pointer-events: none; color: var(--text); }
.drop.busy .drop-icon { animation: pulse 1.2s ease-in-out infinite; }
.dropzone .recheck { padding: .2rem 1.2rem 1rem; display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; }
.skipped-count { align-self: center; margin-left: .4rem; cursor: help; }
.scan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .8rem; }
.scan-card { display: flex; gap: .85rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: .65rem; color: var(--text); box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s, border-color .15s; }
.scan-card:hover { border-color: var(--border-strong); text-decoration: none; box-shadow: var(--shadow); }
.scan-card.status-pending { box-shadow: inset 4px 0 0 var(--redundant), var(--shadow-sm); }
.scan-card img { width: 84px; height: 168px; object-fit: cover; object-position: top; border-radius: 10px;
  background: var(--surface-3); flex: none; }
.scan-info { display: flex; flex-direction: column; gap: .25rem; min-width: 0; padding-top: .1rem; }
.scan-top { display: flex; justify-content: space-between; align-items: center; }
.file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue progress { width: 7rem; height: .5rem; accent-color: var(--accent); }
.queue-result { flex-basis: 100%; color: var(--text); }
.review { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 1.2rem; align-items: start; }
.review-image img { width: 100%; border-radius: 12px; display: block; }
.review-image { position: sticky; top: 1.2rem; }
.options { display: flex; flex-direction: column; gap: .45rem; }
.option { display: flex; align-items: center; gap: .7rem; border: 1px solid var(--border); border-radius: 12px;
  padding: .7rem .85rem; color: var(--text); touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none; user-select: none; transition: border-color .15s, background-color .15s; }
.option:hover { border-color: var(--accent); text-decoration: none; }
.option-mark { flex: none; width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid var(--border-strong); }
.option.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.option.selected .option-mark { border-color: var(--accent); background: radial-gradient(var(--accent) 45%, transparent 50%); }
.actions-card { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.scan-tile img { width: 100%; height: 140px; object-fit: cover; object-position: top; border-radius: 10px; }
fieldset.suggestion { border: 1px solid color-mix(in srgb, var(--redundant) 50%, transparent); border-radius: 14px;
  padding: .7rem 1rem .9rem; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .5rem;
  background: color-mix(in srgb, var(--redundant) 5%, transparent); }
fieldset.suggestion legend { font-weight: 700; padding: 0 .35rem; }

/* admin */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 0 1.1rem; align-items: start; }
.admin-grid .card { overflow-x: visible; }
.admin-grid .page-head { margin-bottom: .7rem; align-items: center; }
code.path { word-break: break-all; white-space: normal; }
.kv-list { margin-top: .9rem; }
.kv-list form { display: inline; }
details.events { margin-top: .9rem; }
.backup-row form { margin-left: auto; }
.actions-cell { white-space: nowrap; }
.actions-cell form, .inline-details { display: inline-block; margin: .1rem .15rem; vertical-align: top; }
.inline-details summary { cursor: pointer; font-size: .82rem; }
.inline-details[open] { display: block; white-space: normal; max-width: 22rem; }

/* feed */
.feed { list-style: none; margin: 0; padding: 0 0 0 1.1rem; position: relative; }
.feed::before { content: ""; position: absolute; left: .3rem; top: .6rem; bottom: .6rem; width: 2px; border-radius: 2px;
  background: var(--border); }
.feed li { position: relative; padding: .55rem 0; display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; margin: 0; }
.feed li::before { content: ""; position: absolute; left: -1.05rem; top: 1rem; width: .55rem; height: .55rem; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border-strong); }
.feed li.unread { font-weight: 650; }
.feed li.unread::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.feed-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }

/* raids */
.raid-now .reasons { margin: 0; padding-left: 1rem; }
.raid-now .chips { margin-top: .3rem; }
.raid-now meter { width: 5rem; height: .6rem; vertical-align: middle; }
meter { border-radius: 999px; background: var(--surface-3); border: 0; }
meter::-webkit-meter-bar { background: var(--surface-3); border: 0; border-radius: 999px; height: .6rem; }
meter::-webkit-meter-optimum-value { background: linear-gradient(90deg, var(--accent-hi), var(--accent)); border-radius: 999px; }
meter::-webkit-meter-suboptimum-value { background: var(--gold); border-radius: 999px; }
meter::-webkit-meter-even-less-good-value { background: var(--danger); border-radius: 999px; }
meter::-moz-meter-bar { background: linear-gradient(90deg, var(--accent-hi), var(--accent)); border-radius: 999px; }

/* trades */
.chip.reason { font-size: .74rem; margin-left: .25rem; }
.reason-shiny { color: var(--redundant); } .reason-new { color: var(--collect); } .reason-pvp { color: var(--build); }
.plain-list li.offer { flex-direction: column; align-items: flex-start; }
.offer-copies { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .85rem; }
.offer-copies .copy { display: inline-flex; gap: .45rem; align-items: center; padding: .2rem .55rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); }

/* welcome wizard */
.wizard { max-width: 46rem; margin: 0 auto; }
.wizard-steps { display: flex; gap: 0; list-style: none; padding: 0; margin: 0 0 1.4rem; counter-reset: step; }
.wizard-steps li { counter-increment: step; flex: 1; position: relative; margin: 0; }
.wizard-steps li:not(:last-child)::after { content: ""; position: absolute; top: 1rem; left: calc(50% + 1.2rem);
  right: calc(-50% + 1.2rem); height: 2px; border-radius: 2px; background: var(--border); }
.wizard-steps li.done::after { background: var(--accent); }
.wizard-steps a { display: flex; flex-direction: column; align-items: center; gap: .4rem; color: var(--muted);
  font-size: .8rem; font-weight: 600; text-align: center; }
.wizard-steps a:hover { text-decoration: none; color: var(--text); }
.wizard-steps a::before { content: counter(step); display: grid; place-items: center; width: 2rem; height: 2rem;
  border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); font: 750 .85rem/1 var(--font-display);
  transition: background-color .15s, border-color .15s; }
.wizard-steps .done a { color: var(--text); }
.wizard-steps .done a::before { content: "✓"; background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.wizard-steps .current a { color: var(--text); }
.wizard-steps .current a::before { border-color: var(--accent); color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.wizard .card { padding: 1.8rem 1.9rem; }
.wizard h1 { font-size: 1.6rem; }
.steps-list { counter-reset: sl; list-style: none; padding: 0; }
.steps-list li { counter-increment: sl; position: relative; padding-left: 2.6rem; margin: .9rem 0; }
.steps-list li::before { content: counter(sl); position: absolute; left: 0; top: -.05rem; display: grid; place-items: center;
  width: 1.8rem; height: 1.8rem; border-radius: 50%; font: 750 .82rem/1 var(--font-display);
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* help */
.help { max-width: 54rem; margin: 0 auto; }
.help-toc { margin-bottom: 1.2rem; position: sticky; top: .75rem; z-index: 5; padding: .45rem; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 85%, transparent); border: 1px solid var(--border);
  box-shadow: var(--shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); width: fit-content; max-width: 100%; }
.help-toc .chip { border: 0; background: transparent; color: var(--muted); font-size: .82rem; letter-spacing: 0; }
.help-toc .chip:hover { background: var(--surface-3); color: var(--text); }
.glossary { display: grid; grid-template-columns: max-content 1fr; gap: .7rem 1.2rem; margin: 0; align-items: baseline; }
.glossary dt { font-weight: 650; }
.glossary dd { margin: 0; color: var(--muted); }

/* page tours */
.tour-target { outline: 3px solid var(--accent-hi); outline-offset: 5px; border-radius: 12px;
  position: relative; z-index: 21; box-shadow: 0 0 0 9999px rgb(9 13 31 / .28); }
.tour-box { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  bottom: max(1rem, env(safe-area-inset-bottom)); width: min(34rem, calc(100% - 1.5rem));
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 1rem 1.1rem; box-shadow: var(--shadow-lg); animation: tour-in .25s ease-out both; }
.tour-box::before { content: ""; position: absolute; left: 1.1rem; right: 1.1rem; top: -1px; height: 3px; border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--accent-hi), var(--brand)); }
.tour-box p { margin: 0 0 .8rem; }
.tour-actions { display: flex; align-items: center; gap: .5rem; }
.tour-actions .muted { margin-right: auto; }
body.touring main { padding-bottom: 12rem; }

/* --- 7. motion ------------------------------------------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes tour-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes stamp { from { opacity: 0; transform: scale(1.6) rotate(-8deg); } to { opacity: 1; transform: rotate(-4deg); } }
/* home: the appraisal bars fill once, one after another, as in the game */
.appraisal .ivbar-fill { transform-origin: left; animation: fill .9s cubic-bezier(.3, .8, .3, 1) both; }
.appraisal .ivbar:nth-child(2) .ivbar-fill { animation-delay: .25s; }
.appraisal .ivbar:nth-child(3) .ivbar-fill { animation-delay: .5s; }
.appraisal .stamp { animation: stamp .4s 1.25s cubic-bezier(.3, 1.6, .5, 1) both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* --- 8. responsive --------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .stat-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .verdict-strip { grid-template-columns: repeat(3, 1fr); }
  .mon-hero { grid-template-columns: auto minmax(0, 1fr); }
  .mon-hero .iv-panel { grid-column: 1 / -1; }
}

/* Below 1024px the sidebar becomes a drawer; a bottom tab bar holds the main pages. */
@media (max-width: 1023px) {
  .shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(84vw, 300px); transform: translateX(-105%);
    transition: transform .25s cubic-bezier(.2, .7, .3, 1); box-shadow: 30px 0 60px -30px rgb(0 0 0 / .6);
    padding-top: max(1.1rem, env(safe-area-inset-top)); padding-bottom: max(.9rem, env(safe-area-inset-bottom)); }
  .nav-toggle:checked ~ .shell .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgb(9 13 31 / .5);
    opacity: 0; pointer-events: none; transition: opacity .25s; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
  .nav-toggle:checked ~ .shell .scrim { opacity: 1; pointer-events: auto; }
  .appbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .4rem;
    padding: .55rem max(.9rem, env(safe-area-inset-right)) .55rem max(.9rem, env(safe-area-inset-left));
    padding-top: max(.55rem, env(safe-area-inset-top));
    background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent); }
  .appbar .brand { margin-right: auto; font-size: 1.1rem; }
  .appbar .brand img { width: 30px; height: 30px; border-radius: 9px; }
  .appbar .icon-btn { color: var(--text); position: relative; }
  .appbar .icon-btn .count { position: absolute; top: -2px; right: -4px; }
  .tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr);
    padding: .3rem max(.4rem, env(safe-area-inset-right)) max(.35rem, env(safe-area-inset-bottom)) max(.4rem, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.6) blur(16px);
    -webkit-backdrop-filter: saturate(1.6) blur(16px); border-top: 1px solid var(--border); }
  .tabbar a, .tabbar label { position: relative; display: flex; flex-direction: column; align-items: center; gap: .15rem;
    padding: .35rem 0 .2rem; font-size: .68rem; font-weight: 650; color: var(--muted); cursor: pointer;
    -webkit-tap-highlight-color: transparent; border-radius: 12px; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar .i { width: 1.4rem; height: 1.4rem; }
  .tabbar [aria-current="page"] { color: var(--accent); }
  .tabbar [aria-current="page"] .i { filter: drop-shadow(0 3px 6px color-mix(in srgb, var(--accent) 50%, transparent)); }
  .tabbar .count { position: absolute; top: 0; left: calc(50% + .3rem); height: 1.1rem; min-width: 1.1rem; font-size: .62rem; }
  main { padding: 1.4rem max(1.1rem, env(safe-area-inset-right)) 1.5rem max(1.1rem, env(safe-area-inset-left)); }
  .app footer { padding-bottom: calc(var(--tabbar-h) + 1.5rem + env(safe-area-inset-bottom)); }
  .tour-box { bottom: calc(var(--tabbar-h) + max(.6rem, env(safe-area-inset-bottom))); }
  .hero-inner { grid-template-columns: 1fr; gap: 3rem; }
  .appraisal { max-width: 520px; margin: 0 auto; width: 100%; }
  .steps-row { grid-template-columns: 1fr; }
  .auth-card { grid-template-columns: 1fr; }
  .auth-side { padding: 1.8rem; }
  .auth-side ul { display: none; }
}

@media (max-width: 800px) {
  .review { grid-template-columns: 1fr; } .review-image { position: static; }
  .feature-grid, .feature-grid.three { grid-template-columns: 1fr; } .feature.wide { grid-column: auto; }
  .verdict-strip { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 7rem 1.1rem 4.5rem; }
  .section { padding: 3.5rem 1.1rem; }
  .cta-band { margin: 0 1rem 3rem; padding: 2.4rem 1.3rem; }
  .public-top nav .hide-sm { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  h1 { font-size: 1.45rem; }
  .card { padding: 1rem 1rem; border-radius: 16px; }
  .card.flush { padding: 0; }
  /* iOS zooms into inputs smaller than 16px */
  input, select, textarea { font-size: 16px; }
  .page-head { align-items: flex-start; margin-bottom: 1.1rem; }
  .page-head .actions { width: 100%; }
  .stat-tiles { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 1.1rem; margin: 0 -1.1rem 1rem; padding: .1rem 1.1rem .4rem;
    scrollbar-width: none; }
  .stat-tiles::-webkit-scrollbar { display: none; }
  .stat-tiles .stat { flex: 0 0 auto; min-width: 7.2rem; scroll-snap-align: start; }
  .filters { border-radius: 16px; }
  .filters input[type=search], .filters .search-field { flex-basis: 100%; }
  .filters select { flex: 1 1 40%; }
  .filters button { flex: 1 1 100%; }
  /* Search strings: one line each (Copy copies the whole string), label above; hints fold
     to one line — tap to read them (app.js). Keeps the list near the top of the page. */
  .search-string { padding: .5rem .6rem; gap: .35rem .5rem; margin-bottom: .55rem; }
  .search-string .label { flex-basis: 100%; }
  .search-string .q { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .search-string .hint, .mark-form .muted { display: -webkit-box; -webkit-box-orient: vertical;
    -webkit-line-clamp: 1; overflow: hidden; cursor: pointer; }
  .search-string .hint.open, .mark-form .muted.open { -webkit-line-clamp: unset; }
  .mark-form { gap: .3rem .5rem; margin-bottom: .7rem; }
  .tbl th, .tbl td { padding: .5rem .5rem; }
  .facts { grid-template-columns: 1fr 1fr; }
  .form .grid { grid-template-columns: 1fr 1fr; }
  .review-image img { max-height: 62vh; object-fit: contain; }
  .scan-grid { grid-template-columns: minmax(0, 1fr); gap: .55rem; }
  .scan-card img { width: 64px; height: 128px; }
  .glossary { grid-template-columns: 1fr; }
  .glossary dd { margin-bottom: .5rem; }
  .mon-hero { grid-template-columns: 1fr; text-align: left; gap: 1rem; padding: 1.2rem; }
  .mon-hero .avatar.lg { width: 4.4rem; height: 4.4rem; }
  .mon-hero h1 { font-size: 1.5rem; }
  .wizard-steps a { font-size: 0; gap: 0; }
  .wizard-steps .current a { font-size: .74rem; gap: .3rem; }
  .wizard .card { padding: 1.2rem; }
  .sticky-actions { bottom: calc(var(--tabbar-h) + .6rem); border-radius: 16px; }
  .help-toc { border-radius: 16px; position: static; }
  .auth-wrap { min-height: 0; padding: 0; }
  .auth-main { padding: 1.6rem 1.3rem; }
  .auth-side { padding: 1.4rem 1.3rem; }
  .auth-side p { display: none; }
  .hero h1 { font-size: 2.15rem; }
  .hero .lede { font-size: 1.02rem; }
  .verdict-strip { grid-template-columns: 1fr 1fr; }
  .mon-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .mon-row .ivbars { display: none; }
  .appraisal { padding: 1.2rem 1.1rem 1rem; }

  /* Collection: one card per Pokémon instead of a seven-column table. */
  .card.flush:has(.tbl.collection) { background: none; border: 0; box-shadow: none; overflow: visible; }
  .tbl.collection, .tbl.collection tbody { display: block; border: none; background: none; }
  .tbl.collection thead { display: none; }
  .tbl.collection tr { display: grid; grid-template-columns: 1fr auto; gap: .35rem .75rem;
    grid-template-areas: "name verdict" "ivs lvl" "use use" "rank pct";
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
    padding: .75rem .85rem; margin-bottom: .55rem; box-shadow: var(--shadow-sm); }
  .tbl.collection td { border: none; padding: 0; white-space: normal; }
  .tbl.collection .c-name { grid-area: name; font-weight: 600; }
  .tbl.collection .c-verdict { grid-area: verdict; justify-self: end; align-self: start; }
  .tbl.collection .c-ivs { grid-area: ivs; }
  .tbl.collection .c-lvl { grid-area: lvl; justify-self: end; align-self: center; color: var(--muted); }
  .tbl.collection .c-use { grid-area: use; font-size: .86rem; color: var(--muted); }
  .tbl.collection .c-rank { grid-area: rank; font-size: .84rem; color: var(--muted); }
  .tbl.collection .c-pct { grid-area: pct; justify-self: end; font-size: .9rem; }
  .tbl.collection .c-rank:empty, .tbl.collection .c-pct:empty { display: none; }
  .m-label { display: inline; }

  .raid-now thead { display: none; }
  .raid-now tr { display: grid; grid-template-columns: 1fr auto; gap: .3rem .6rem; padding: .7rem 0;
    border-bottom: 1px solid var(--border); }
  .raid-now td { border: 0; padding: 0; }
  .raid-now td.wrap { grid-column: 1 / -1; }
}
