/* Self-hosted variable fonts (SIL OFL, see fonts/): no third-party round trips before the
   first paint, and "optional" keeps a late font from reflowing the page. */
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: optional;
  src: url("fonts/source-sans-3-latin.9ef356ea553a.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: optional;
  src: url("fonts/source-sans-3-latin-ext.c6ba61588d7d.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: optional;
  src: url("fonts/jetbrains-mono-latin.b636a65da4f0.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: optional;
  src: url("fonts/jetbrains-mono-latin-ext.bd4781a31b42.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --bg: #0f0f0e;
  --bg-2: #151513;
  --panel: #1a1916;
  --panel-2: #22211e;
  --ink: #e6e2d8;
  --muted: #8d897e;
  --accent: #f0c040;
  --accent-ink: #0f0f0e;
  --warn: #ff9f43;
  --line: #2a2926;
  --overlay: rgba(15, 15, 14, 0.82);
  --radius: 6px;
  --cat-icon: 64px;     /* a cat's icon in Collection tiles and Resources cards */
  --cat-icon-row: 48px; /* the same icon inline in a roll-table line */
  --pill: 6px; /* buttons and chips: square-ish, like the rest of the ledger */

  /* The header bar is the ledger's own in both themes. */
  --head-bg: #0f0f0e;
  --head-ink: #e6e2d8;
  --head-muted: #8d897e;
  --head-line: #2a2926;
  --head-accent: #f0c040;

  /* Battle Cats rarity colours, as text */
  --r-normal: #c9c2b6;
  --r-rare: #57b4ff;
  --r-super: #ffd24a;
  --r-uber: #c779ff;
  --r-legend: #ff6060;
  --new: #6fcf8f;  /* Uber/Legend cats not yet in your collection */

  /* ...and as filled badges, white text on each, the same in both themes */
  --badge-normal: #5c5b56;
  --badge-rare: #1d6fc4;
  --badge-super: #8a6400;
  --badge-uber: #7b35c4;
  --badge-legend: #b3261e;

  /* Capsule ticket colours: platinum uses the Super Rare gold, legend uses the Legend red. */
  --tkt-platinum: var(--r-super);
  --tkt-legend: var(--r-legend);

  /* Tier-list bands (S..F), one colour per letter */
  --band-s: #ff5d5d;
  --band-a: #ff9f43;
  --band-b: #e8c33d;
  --band-c: #34d399;
  --band-d: #57b4ff;
  --band-e: #b58cff;
  --band-f: #a09a8e;

  --head-font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --body-font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Light theme: the same ledger on paper - cool neutral, near-black ink, the gold deepened
   to read on white - under the dark header bar both themes share. Applied via
   data-theme, which the header toggle sets to the choice (or to the device's on "system"). */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f6f4;
  --bg-2: #eeeeeb;
  --panel: #fcfcfb;
  --panel-2: #e9e9e6;
  --ink: #121211;
  --muted: #5c5b56;
  --accent: #7d5a00;
  --accent-ink: #ffffff;
  --warn: #9a4a00;
  --line: #d3d2cd;
  --overlay: rgba(246, 246, 244, 0.82);

  --r-normal: #5c5b56;
  --r-rare: #1d6fc4;
  --r-super: #8a6400;
  --r-uber: #7b35c4;
  --r-legend: #b3261e;
  --new: #0a6e44;

  --band-s: #d13a3a;
  --band-a: #c76a10;
  --band-b: #a67a00;
  --band-c: #0b8a5c;
  --band-d: #1d74c9;
  --band-e: #7a3fd1;
  --band-f: #7c7466;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--body-font);
}

h1, h2, h3, h4, legend, .brand {
  font-family: var(--head-font);
  font-weight: 600;
  letter-spacing: 0.2px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* A link inside running text needs more than its color to stand out. */
p a { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 0.15em; }
p a:hover { text-decoration-color: currentColor; }

/* ---- Header / nav ---------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  /* The bar keeps the dark ledger in both themes: everything in it reads these. */
  --ink: var(--head-ink);
  --muted: var(--head-muted);
  --line: var(--head-line);
  --accent: var(--head-accent);
  --accent-ink: #0f0f0e;
  --panel: #1a1916;
  background: var(--head-bg);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.site-header .bar {
  /* Wider than the 760px content column so the brand, every nav link and the two
     controls (settings menu, account) sit on one row on a desktop screen. */
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  /* Brand | nav | controls: the equal side columns keep the nav centred on the bar. */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.6rem 1rem;
}

.brand {
  justify-self: start;
  font-size: 1.05rem;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.brand:hover { text-decoration: none; }

.site-header nav {
  display: flex;
  justify-content: center;
  gap: 0.15rem;
}

.header-tools {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* The header's two drop-downs (settings, account): a <details> whose panel hangs under
   its summary at the right edge. */
.header-menu { position: relative; }
.header-menu summary { display: flex; align-items: center; list-style: none; cursor: pointer; }
.header-menu summary::-webkit-details-marker { display: none; }
.header-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 20;
  display: grid;
  gap: 0.1rem;
  min-width: 11rem;
  padding: 0.6rem 0.75rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.header-pop .muted { font-size: 0.78rem; }

/* Settings: the game version's code under a globe, opening version / language / theme. */
.prefs-button {
  gap: 0.3rem;
  height: 1.9rem;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.prefs-button:hover, .prefs-menu[open] .prefs-button { color: var(--ink); border-color: var(--accent); }
.prefs-button .chevron { transition: transform 0.15s; }
.prefs-menu[open] .chevron { transform: rotate(180deg); }
.prefs-pop { gap: 0.3rem; justify-items: start; min-width: 12.5rem; }
.pop-label { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.pop-label:not(:first-child) { margin-top: 0.35rem; }
.prefs-pop .lang-switch, .prefs-pop .lang-switch select { width: 100%; }

/* Nav links and the account links share one size. */
.site-header nav a, .account > a {
  padding: 0.35rem 0.65rem;
  font-size: 1rem;
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
}

/* Hover lifts a link onto a soft pill; the page you're on is underlined in gold. */
.site-header nav a:hover {
  color: var(--ink);
  text-decoration: none;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}
.site-header nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 7px;
}

/* Theme switch: light / dark / follow the device. */
.theme-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  overflow: hidden;
}
.theme-toggle button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 1.7rem;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle button + button { border-left: 1px solid var(--line); }
.theme-toggle button:hover { color: var(--ink); filter: none; }
.theme-toggle button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}
.theme-toggle button:focus-visible { outline-offset: -2px; }
.theme-toggle svg { display: block; }

/* The game-version switcher, styled as the theme toggle's sibling. */
.region-switch {
  display: inline-flex;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  overflow: hidden;
}
.region-switch button {
  padding: 0 0.45rem;
  height: 1.7rem;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
}
.region-switch button + button { border-left: 1px solid var(--line); }
.region-switch button:hover { color: var(--ink); filter: none; }
.region-switch button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}
.region-switch button:focus-visible { outline-offset: -2px; }

/* Log in as a nav link and sign up as the one accent pill; logged in, the cat avatar
   opening a small menu. */
.account { display: flex; align-items: center; gap: 0.3rem; }
.account > a:not(.signup):hover {
  color: var(--ink);
  text-decoration: none;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}
.account > a.signup {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  padding: 0.3rem 0.95rem;
}
.account > a.signup:hover { text-decoration: none; filter: brightness(1.1); }
/* A cat icon is a 104x79 framed sprite with the cat off-centre, so a circle would cut
   it off: the avatar shows the whole sprite at its own shape. */
.avatar {
  display: block;
  width: 40px;
  height: 30px;
  border-radius: 6px;
  background: var(--panel) center / contain no-repeat;
  border: 1px solid var(--line);
}
.account-menu summary:hover .avatar, .account-menu[open] .avatar { border-color: var(--accent); }
.account-pop form { margin: 0; }
.account-pop strong { margin-bottom: 0.35rem; }
.pop-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.35rem 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pop-item:hover { color: var(--ink); filter: none; text-decoration: none; }

.account-form { display: grid; gap: 0.6rem; max-width: 22rem; margin: 1rem 0; }
.account-form label { display: grid; gap: 0.25rem; }
.account-form .errorlist { margin: 0; padding-left: 1.1rem; color: var(--r-legend); font-size: 0.82rem; }

/* ---- Layout ---------------------------------------------------------- */
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 4rem;
}
/* The footer: the disclaimer and the links on one line where it fits, the links wrapping
   below as a group where it doesn't. A touch wider than the text column, since it's page
   chrome rather than reading matter. */
.site-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
}
.site-footer p { margin: 0; }
.footer-links { white-space: nowrap; }
/* A page with a wide board (the Rolls tables, Resources) widens its tail to match, so the
   Elsewhere links and the footer line up under it instead of sitting in a thin column. */
main:has(.results-region) > .tool-links {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: min(1500px, calc(100vw - 2rem));
}
body:has(.results-region) .site-footer { max-width: min(1500px, calc(100vw - 2rem)); }

h1 { color: var(--accent); margin: 0.25rem 0 0.5rem; font-size: 1.9rem; }
h2 { margin: 1.75rem 0 0.5rem; font-size: 1.3rem; }

form { margin: 1.25rem 0; }

input, button, select {
  font: inherit;
  color: var(--ink);
}

input[type="number"], input[type="search"], input[type="text"], select {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  max-width: 100%;
}

input[type="search"] { width: 100%; border-radius: 999px; padding-inline: 1rem; }
input[type="search"]::-webkit-search-cancel-button { appearance: none; -webkit-appearance: none; }

/* Collection heading: the owned count and a progress bar beside the title. */
.collection-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.9rem; }
.collection-head h1 { margin-right: 0.2rem; }
.collection-total { font-weight: 600; white-space: nowrap; color: var(--muted); }
.owned-bar { flex: 0 1 10rem; height: 6px; border-radius: var(--pill); background: color-mix(in srgb, var(--muted) 35%, transparent); overflow: hidden; }
.owned-bar i { display: block; width: 0; height: 100%; background: var(--accent); transition: width 0.2s; }
.head-tools { display: inline-flex; gap: 0.5rem; margin-left: auto; }
/* The same bar, smaller, beside each section's own owned count. */
.section-bar { flex: 1 1 2rem; max-width: 7rem; height: 5px; }

/* The cat toolbar (Collection, avatar picker): search, then labeled drop-downs, each
   showing what it's set to. A set filter turns the button accent. The facet panel opens
   under the whole bar, the rest under their own button. */
.cat-toolbar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.9rem; }
.cat-toolbar input[type="search"] { flex: 1 1 240px; width: auto; }
.pick-btn {
  gap: 0.35rem;
  height: 2.1rem;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}
.pick-btn b { color: var(--ink); font-weight: 600; }
.pick-btn .btn-icon { flex: none; }
.pick-btn:hover, .header-menu[open] > .pick-btn { color: var(--ink); border-color: var(--accent); }
.pick-btn .chevron { font-size: 0.7rem; transition: transform 0.15s; }
.header-menu[open] > .pick-btn .chevron { transform: rotate(180deg); }
.is-set > .pick-btn { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: var(--accent); }
.is-set > .pick-btn b, .is-set > .pick-btn #facetCount { color: var(--accent); }
.pick-pop { left: 0; right: auto; min-width: 10rem; gap: 0.1rem; padding: 0.35rem; }
.pick-pop.flip { left: auto; right: 0; }
.pick-pop button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.35rem 0.6rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
}
.pick-pop button:hover { background: var(--bg-2); filter: none; }
.pick-pop button[aria-pressed="true"], .pick-pop button.is-active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-weight: 700;
}
.cat-toolbar .facet-panel { position: static; }
.facet-pop { left: 0; right: 0; top: calc(100% + 0.4rem); display: block; padding: 0.7rem 0.9rem; }

/* The Display and Import / export drop-downs: labeled fields stacked in a panel. */
.tool-pop { gap: 0.35rem; justify-items: start; width: max-content; max-width: min(19rem, 90vw); }
.tool-pop select { width: 100%; }
.tool-pop .muted { white-space: normal; }
.tool-pop-row { display: inline-flex; gap: 0.4rem; }

/* Back up / restore the marks: quiet secondary actions, like the plan "Copy link". */
.io-btn {
  display: inline-block;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 0.3rem 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}
.io-btn:hover { color: var(--accent); border-color: var(--accent); filter: none; }
.io-msg { color: var(--muted); font-weight: 600; margin: 0 0 0.75rem; }
.io-msg ul { margin: 0.25rem 0 0; padding-left: 1.2rem; font-weight: 400; }

/* Resources page: a running total that stays on screen while you tick, then one card
   per cat and per base upgrade. Every row wraps rather than clipping - the cost lists
   are as long as the game makes them. */
/* The running total rides along in its own column so it can stay put without eating the
   screen: cards on the left, totals pinned on the right. Both sit in row 1, which makes
   the sidebar's grid area as tall as the cards - that's what lets it stick the whole way
   down. Under 1100px the column is gone and it folds back above the cards, unpinned. */
#resBoard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 21rem);
  gap: 1rem;
  align-items: start;
}
.res-lists { grid-column: 1; grid-row: 1; min-width: 0; }
.res-overview {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: calc(var(--header-h, 52px) + 0.5rem);
  max-height: calc(100vh - var(--header-h, 52px) - 1.5rem);
  overflow: auto;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg-2);
  padding: 0.6rem 0.9rem;
}
.res-overview > h2 { margin: 0 0 0.3rem; font-size: 0.95rem; color: var(--muted); }
.res-overview > .muted { margin: 0; }
.res-sub { font-size: 0.78rem; opacity: 0.8; }

@media (max-width: 1100px) {
  #resBoard { grid-template-columns: minmax(0, 1fr); }
  .res-lists, .res-overview { grid-column: 1; grid-row: auto; }
  .res-overview { position: static; max-height: none; margin-bottom: 1rem; }
}
/* The sidebar is narrow, so a family table that outgrows it scrolls on its own rather
   than pushing the column wider. */
.res-block { min-width: 0; overflow-x: auto; }
.res-block h3 { margin: 0 0 0.3rem; font-size: 0.85rem; font-weight: 700; }
.res-overview .item-icon { width: 20px; }
/* A family per row, a kind per column: the members of a family level in step, so lining
   them up says at a glance which colour is holding you back. */
.res-grid { border-collapse: collapse; font-size: 0.9rem; }
.res-grid th, .res-grid td { padding: 0.1rem 0.5rem 0.1rem 0; text-align: left; }
.res-grid thead th { color: var(--muted); font-family: var(--head-font); font-weight: 600; font-size: 0.75rem; }
.res-grid tbody th { color: var(--muted); font-weight: 600; padding-right: 0.7rem; white-space: nowrap; }
.res-grid .res-item b { font-family: var(--head-font); }
.res-nil { color: var(--muted); opacity: 0.45; }
/* A leftover the family table doesn't place: a plain wrapping row of tiles. */
.res-tally { display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; margin-top: 0.3rem; }
/* XP/NP and build time/engineers are counters the whole grind draws on, not something
   you farm a stage for - a separate strip under their own table. */
.res-counters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.2rem;
  list-style: none;
  margin: 0.4rem 0 0.6rem;
  padding: 0.4rem 0 0;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}
.res-counter-n { color: var(--ink); font-weight: 700; font-family: var(--head-font); font-size: 1rem; }
.res-counter { white-space: nowrap; }

.res-section { margin-bottom: 1.4rem; }
.res-section > h2 { display: flex; align-items: center; gap: 0.5rem; font-size: 1.05rem; margin: 0 0 0.5rem; }
.res-note { font-size: 0.82rem; margin: -0.3rem 0 0.5rem; }
.res-empty { margin: 0.4rem 0 0; }

/* Picker: type, and up to a couple of dozen matches appear as chips. Ones already on
   the list stay listed but read as taken. */
.res-picker { margin-bottom: 0.7rem; }
.res-picker input[type="search"] { width: 100%; }
.res-matches { margin-top: 0.4rem; max-height: 9rem; overflow-y: auto; }
.res-match.on { opacity: 0.45; }
.res-match:disabled { opacity: 0.45; border-style: dashed; cursor: not-allowed; }
.res-hint { font-size: 0.78rem; margin: 0.25rem 0 0; }

/* The eight Cat Base developments: a row of switches, like the rarity/facet pills -
   click one on to track it, click it again to drop it. */
.res-switches { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.7rem; }
.res-switch {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  padding: 0.18rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
}
.res-switch:hover { color: var(--ink); border-color: var(--accent); filter: none; }
.res-switch[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.res-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}
.res-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.6rem; }
.res-name { font-weight: 700; }
button.res-name { background: none; border: 0; padding: 0; margin: 0; font: inherit; font-weight: 700; color: var(--ink); }
.res-card-cost {
  flex: 1 1 12rem;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.res-card-cost b { color: var(--ink); font-weight: 700; }
.res-all {
  margin: 0 0 0 auto;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
}
.res-all:hover { color: var(--accent); border-color: var(--accent); filter: none; }
.res-remove {
  background: none; border: none; color: var(--muted);
  font-size: 1rem; line-height: 1; padding: 0.1rem 0.3rem; margin: 0;
}
.res-remove:hover { color: var(--accent); filter: none; }

/* One tickable line (an evolution) or one base part: label, then its price, both free
   to wrap onto the next line rather than run past the card's edge. */
.res-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1rem 0.6rem;
  padding: 0.22rem 0;
  border-top: 1px solid var(--line);
  margin-top: 0.35rem;
}
label.res-pick { cursor: pointer; }
.res-pick-label { font-weight: 600; flex: 0 0 auto; min-width: 5.5rem; }
/* An add-on the development doesn't have switched on: listed, so you can see it's there
   to add, but dimmed and priceless. */
.res-pick.off { opacity: 0.6; }
.res-addon { display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.res-pick-level { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.res-pick-level select { padding: 0.1rem 0.2rem; margin-right: 0.35rem; }
.res-pick-cost {
  flex: 1 1 12rem;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.res-pick.on .res-pick-cost, .res-pick.on .res-pick-label { color: var(--ink); }

/* A material, wherever it's listed: its picture with the count beside it (the name is
   the hover title). Items the source publishes no picture for keep their name instead -
   app.js marks those .no-icon when the image 404s. */
.res-item { display: inline-flex; align-items: center; gap: 0.25rem; white-space: nowrap; }
.res-item .item-icon { width: 22px; height: auto; }
.res-item .item-name { display: none; }
.res-item.no-icon .item-icon { display: none; }
.res-item.no-icon .item-name { display: inline; }

/* A cat's evolutions and talents: one row each - name, control, price - wrapping onto a
   second line when the card narrows. Yes-or-no picks are tick boxes; a talent with levels
   is a slider from 0 (skip) to its max. */
.res-group { margin-top: 0.55rem; }
.res-group > .pop-label { display: block; margin-bottom: 0.15rem; }
.res-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.75rem;
  padding: 0.2rem 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
}
.res-row.on { color: var(--ink); }
.res-row-name { flex: 1 1 7rem; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.res-row-cost {
  flex: 1 1 10rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 0.55rem;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.res-lv { min-width: 2.6rem; }
/* A slider or a tick box fills the same control column, so every row's price lines up. */
.res-level, .res-tick { flex: 1 1 6rem; max-width: 10rem; }
.res-level { margin: 0; accent-color: var(--accent); cursor: pointer; }
.res-tick { display: flex; }

/* Resources, softened to the site's newer look: rounder cards and sidebar, pill buttons
   and search, and evolution / talent / part rows that light up under the pointer. */
.res-section, .res-overview { border-radius: 12px; }
.res-overview { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); padding: 0.8rem 1rem; }
.res-card { border-radius: 12px; padding: 0.7rem 0.95rem; margin-bottom: 0.6rem; transition: border-color 0.15s; }
.res-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.res-card-head .res-name { font-size: 1rem; }
.res-picker input[type="search"] { border-radius: 999px; padding-inline: 1rem; }
.res-matches .chip, .res-switch, .count-pill { border-radius: 999px; }
.res-all { border-radius: 999px; padding: 0.2rem 0.75rem; }
.res-remove {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border-radius: 50%;
}
.res-remove:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.res-pick-level select { border-radius: 999px; padding-inline: 0.5rem; }
.res-row, .res-pick { border-top-color: color-mix(in srgb, var(--line) 70%, transparent); }
.res-row { padding-inline: 0.4rem; border-radius: 8px; }
.res-row:hover { background: color-mix(in srgb, var(--panel-2) 70%, transparent); }
.res-grid th, .res-grid td { padding-block: 0.2rem; }
.res-grid tbody tr + tr > * { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }

/* Facet panel: multi-select pills per group. */
.facet-controls { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-bottom: 0.5rem; }
.facet-filter { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: baseline; margin-bottom: 0.4rem; }
.facet-label { min-width: 5.5rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.facet-filter button {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.15rem 0.55rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
}
.facet-filter button:hover { color: var(--ink); border-color: var(--accent); filter: none; }
.facet-filter button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* The whole header bar folds the card (bulk buttons excepted), so it takes the
   pointer and shouldn't select its text on a click. */
.collection-section > h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; cursor: pointer; user-select: none; }
.collection-section > h3:hover .section-toggle { color: var(--accent); }
.collection-section .set-name { min-width: 0; }
.collection-section .owned-count { font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.collection-section .section-note { margin: -0.3rem 0 0.5rem; font-size: 0.82rem; }

/* Collapse toggle: a chevron that points down when open, right when folded. The
   collapsed card hides its cats (and note) until a filter needs to reveal a match. */
.section-toggle {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.15rem 0.3rem;
  margin: 0;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.section-toggle:hover { color: var(--accent); filter: none; }
.collection-section.collapsed .section-toggle { transform: rotate(-90deg); }
.cat-browser:not(.filtering) .collection-section.collapsed :is(.rarity-row, .section-note, .alpha-jump) { display: none; }

/* A-Z: each letter's cats in a row, labelled with the gold letter and its owned count,
   and a row of letters on top that jumps to one. */
/* Even columns, so the letters spread over the row and wrap in whole rows. */
.alpha-jump { display: grid; grid-template-columns: repeat(auto-fill, minmax(1.5rem, 1fr)); gap: 0.15rem; margin: 0 0 0.3rem; }
.alpha-jump button {
  margin: 0;
  padding: 0.1rem 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.alpha-jump button:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); filter: none; }
.alpha-row { scroll-margin-top: calc(var(--header-h, 0px) + 0.5rem); }
.alpha-letter {
  flex: 0 0 5rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 0.2rem 0 0;
  color: var(--accent);
  font-size: 1rem;
}

/* Section-header bulk marks: own-all (✓) and wishlist-all (★) for the whole card. */
.bulk-buttons { display: inline-flex; gap: 0.3rem; margin-left: auto; }
.bulk-buttons button {
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
  line-height: 1;
  margin: 0;
}
.bulk-buttons button:hover { border-color: var(--accent); color: var(--accent); filter: none; }
/* With a mouse they wait for the header to be pointed at; touch screens keep them shown. */
@media (hover: hover) {
  .bulk-buttons { opacity: 0; transition: opacity 0.15s; }
  .collection-section > h3:hover .bulk-buttons, .bulk-buttons:focus-within { opacity: 1; }
}

/* Cat search: an explicit clear (x) + hint so it's obvious how to get back to the
   banner menu, without forcing you to delete the query (selections stay put). */
.search-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.search-wrap input[type="search"] { flex: 1 1 auto; width: auto; }
.search-clear {
  font: inherit;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--muted);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.35rem 0.6rem;
  margin: 0;
}
.search-clear:hover { color: var(--accent); border-color: var(--accent); filter: none; }
.search-hint { flex-basis: 100%; font-size: 0.78rem; color: var(--muted); }

/* Number fields are drag-to-scrub (see app.js); drop the dated native arrows. */
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"]:not(:focus) { cursor: ns-resize; }

/* Themed scrollbars: a line-coloured thumb on the page and any scroll box. */
html, .picker-scroll { scrollbar-width: thin; scrollbar-color: var(--line) var(--bg-2); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-2); border-radius: var(--radius); }
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: var(--radius);
  border: 2px solid var(--bg-2);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Every checkbox is a rounded tick box: gold with a dark tick when on. */
input[type="checkbox"] {
  appearance: none;
  flex: none;
  display: inline-grid;
  place-content: center;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  border: 1.5px solid color-mix(in srgb, var(--muted) 70%, transparent);
  border-radius: 5px;
  background: var(--bg);
  vertical-align: -0.2em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
input[type="checkbox"]::after {
  content: "";
  width: 0.3rem;
  height: 0.58rem;
  border: solid var(--accent-ink);
  border-width: 0 2px 2px 0;
  transform: translateY(-0.05rem) rotate(45deg) scale(0);
  transition: transform 0.12s;
}
input[type="checkbox"]:hover { border-color: var(--accent); }
input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::after { transform: translateY(-0.05rem) rotate(45deg) scale(1); }
input[type="checkbox"]:disabled { opacity: 0.5; cursor: not-allowed; }

button {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
  margin: 0.25rem 0.4rem 0.25rem 0;
}

button:hover { filter: brightness(1.07); }
button:active { transform: translateY(1px); }

fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  margin: 1rem 0;
  padding: 1rem;
  /* A fieldset defaults to min-content wide, so one long nowrap line (a banner tagline
     machine-translated from a short CJK one) would push it out of the column; the line
     ellipses instead. */
  min-inline-size: 0;
}

legend { color: var(--ink); padding: 0 0.4rem; }

/* Keep the target picker compact so "Find plan" stays reachable */
.picker-scroll { max-height: 55vh; overflow-y: auto; padding-right: 0.4rem; }
#targetFlat.flat { padding: 0.25rem 0; }

/* Older banners tucked behind one dropdown */
details.group-drop { margin-top: 1rem; }
details.group-drop > summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--head-font);
  color: var(--accent);
  border-bottom: 2px solid var(--line);
  padding: 0.35rem 0;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
details.group-drop > summary::-webkit-details-marker { display: none; }
details.group-drop > summary::before { content: "▸"; font-size: 0.8rem; transition: transform 0.15s ease; }
details.group-drop[open] > summary::before { transform: rotate(90deg); }
.count-pill {
  background: var(--line);
  color: var(--muted);
  border-radius: var(--pill);
  padding: 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ---- Cards / sections ------------------------------------------------ */
section, .banner-group {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1.1rem 1.1rem;
  margin: 0.9rem 0;
}

/* Banner-bar headings inside cards */
section > h3, .banner-group > summary {
  font-family: var(--head-font);
  font-weight: 600;
  margin: -0.9rem -1.1rem 0.75rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.banner-group > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.banner-group > summary::-webkit-details-marker { display: none; }

.banner-group > summary::before {
  content: "▸";
  color: var(--accent);
  font-size: 0.8rem;
  transition: transform 0.15s ease;
}

.banner-group[open] > summary::before { transform: rotate(90deg); }

.banner-group:not([open]) > summary { margin-bottom: -0.9rem; }

/* Title and dates share a line while the title keeps room to read; narrower, the dates
   drop to their own line under it instead of squeezing it. */
.banner-head {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.75rem;
}
.banner-head .dates {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Set name up front, the run's marketing text under it in full. */
.banner-name {
  flex: 1 1 16rem;
  min-width: 0;
  overflow-wrap: break-word;
}
.banner-name .banner-sub {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}
/* A closed bar keeps it to two lines; opening the banner shows it all. */
.banner-group:not([open]) .banner-sub {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
/* The units a run debuts, under its marketing text. */
.banner-name .banner-new {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}
.banner-new b { color: var(--new); font-weight: 700; }

/* Banner "include in roll" toggle */
.banner-include {
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--muted);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.banner-include:hover { border-color: var(--accent); color: var(--ink); }
.banner-include[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.banner-group.included { border-color: var(--accent); }
.banner-group.included > summary {
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-2));
}

/* "Rolling N banners." is also a locator button: each click scrolls the picker to
   the next selected banner and pulses it. */
.banner-count {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
  width: auto;
  font: inherit;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}
.banner-count:hover { text-decoration: underline; filter: none; }
@keyframes flash-locate {
  0%, 100% { box-shadow: 0 0 0 1px var(--accent); }
  35% { box-shadow: 0 0 0 5px var(--accent); }
}
.banner-group.flash-locate { animation: flash-locate 0.9s ease-out; }

/* Rejected capsule pick (a run from a different time than the selected session). */
@keyframes flash-blocked {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 96, 96, 0); }
  20% { box-shadow: 0 0 0 4px var(--r-legend); }
}
.banner-group.flash-blocked { animation: flash-blocked 0.7s ease-out; }

/* The selected banners spelled out under the hint; each chip scrolls to its banner. */
.banner-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 0.6rem; }
.banner-chip {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 999px;
  padding: 0.1rem 0.7rem;
  margin: 0;
  width: auto;
  cursor: pointer;
}
.banner-chip:hover { border-color: var(--accent); filter: none; }

.hint { font-size: 0.82rem; margin: 0 0 0.6rem; }
.hint .key {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 50%;
  width: 1.1rem;
  height: 1.1rem;
  text-align: center;
  font-weight: 700;
  line-height: 1.1rem;
}

/* ---- Tables ---------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }

th, td {
  text-align: left;
  padding: 0.5rem 0.55rem;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-family: var(--head-font);
  font-weight: 600;
  font-size: 0.85rem;
}

tr:last-child td { border-bottom: 0; }
tbody tr:hover, table tr:hover { background: var(--panel-2); }

/* ---- Rarity badges --------------------------------------------------- */
.rarity {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  color: #fff;
  background: var(--badge-normal);
}

.rarity[data-rarity="Rare"] { background: var(--badge-rare); }
.rarity[data-rarity="Super Rare"] { background: var(--badge-super); }
.rarity[data-rarity="Uber Super Rare"] { background: var(--badge-uber); }
.rarity[data-rarity="Legend Rare"] { background: var(--badge-legend); }

/* ---- Misc ------------------------------------------------------------ */
.muted, label { color: var(--muted); }

/* Plan results: an accordion of target subsets; each opens to a full-width
   Track/Steps view you flip between (no squeezing). */
/* The roll tables want more room than the 760px column - a cell stacks every selected
   banner's cat, plus the guaranteed columns - so the results break out to a wider,
   centered band (capped so a huge monitor doesn't stretch rows into unreadability). */
.results-region {
  margin-top: 0.75rem;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  /* Wide enough that a cell's one-line entries (name + tier + marks + rarity + dice)
     never wrap even with the guaranteed columns on. */
  width: min(1500px, calc(100vw - 2rem));
}
.results-h { font-size: 1rem; margin: 0; }

/* Return from a plan's solutions to browsing the rolls, without a page reload. */
.back-to-rolls {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--muted);
  margin: 0 0 0.6rem;
}
.back-to-rolls:hover { color: var(--accent); border-color: var(--accent); filter: none; }

/* The Rolls table's live display controls: title on the left, controls on the right,
   wrapping under it on narrow screens. */
.rolls-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 0.9rem;
  margin: 0 0 0.3rem;
}
.rolls-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
}
.ctrl {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  max-width: 100%;
}
.ctrl input[type="number"] { width: 4.2rem; }
/* A select as wide as its longest option (long combo names) shrinks to the row. */
.ctrl select { padding: 0.15rem 0.3rem; min-width: 0; text-overflow: ellipsis; }

/* "Find next" (godfat's Find): the browse track's summary of where each valuable cat
   lands next - name, rarity, and a position chip that scrolls the table to that cell. */
.found-cats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.7rem;
  margin: 0 0 0.5rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.found-label { font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.found-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* One pill per searched cat, laid out like a picker chip: rarity, name, its ✓/★ collection
   mark, then the position (or ⚠) and a × to drop it. */
.found-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.28rem 0.12rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--bg-2);
}
.found-item .rarity { font-size: 0.68rem; padding: 0 0.4rem; }
.found-cat { font-weight: 600; }
/* A future-uber row: italic stand-in (no popup), in the uncollected-green like its cells. */
.found-cat.future { font-style: italic; color: var(--new); cursor: default; }
/* The same ✓ owned / ★ wishlisted marks the picker chips carry, so the panel reads like the
   targets selector - just after the name. */
.found-item.owned .found-cat::after { content: " \2713"; color: var(--accent); font-weight: 700; }
.found-item.wanted:not(.owned) .found-cat::after { content: " \2605"; color: var(--r-super); }
/* Which banner a future uber pads, so two banners' "Future Uber 1" read apart. */
.found-banner {
  font-size: 0.68rem;
  color: var(--muted);
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* No selected banner carries this pick: a ⚠ in place of a position, details on hover. */
.find-warn { color: var(--warn); font-weight: 700; cursor: help; }
.found-item.is-unreachable { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.found-item.is-unreachable .found-cat { color: var(--warn); }
/* Drop this target: greys until hovered, so the pill stays about the cat. */
.found-remove {
  font: inherit;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0 0.15rem;
  cursor: pointer;
}
.found-remove:hover { color: var(--r-legend); }
.find-pos {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: var(--pill);
  padding: 0.05rem 0.5rem;
  cursor: pointer;
}
.find-pos:hover { border-color: var(--accent); filter: none; }

/* A picked cat that never turns up in the rolled window: godfat's "999+" ceiling. Muted
   and unclickable - there's no cell to jump to. */
.find-out {
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--muted) 35%, transparent);
  border-radius: var(--pill);
  padding: 0.05rem 0.5rem;
}
.found-item.is-out .catname { color: var(--muted); }

/* A found position clicked: briefly ring the cell it points to (outline, so it doesn't
   nudge layout or fight border-collapse). */
@keyframes flash-cell {
  0%, 100% { outline-color: transparent; }
  30% { outline-color: var(--accent); }
}
td.cell.flash-locate {
  outline: 2px solid transparent;
  outline-offset: -2px;
  animation: flash-cell 0.9s ease-out;
}

.solution {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  margin-bottom: 0.5rem;
}
.solution > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.55rem 0.8rem;
  font-family: var(--head-font);
  list-style: none;
}
.solution > summary::-webkit-details-marker { display: none; }
.solution > summary::before { content: "\25B8"; color: var(--muted); font-size: 0.8rem; }
.solution[open] > summary::before { content: "\25BE"; }
.solution[open] > summary { border-bottom: 1px solid var(--line); }
.sol-cats { color: var(--ink); }
.sol-cost { margin-left: auto; color: var(--accent); font-size: 0.85rem; font-weight: 600; }
.sol-cost.not-found { color: var(--muted); font-weight: 400; }
/* How many of the cats you're hunting these rolls actually hold, and - on a plan row -
   how many of them that plan gets. The same shape in both places: it's the same question. */
.found-count, .sol-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  padding: 0.02rem 0.45rem;
  white-space: nowrap;
}
/* The beam's whole-set row: honest about being the best found rather than the cheapest
   possible, so its price isn't read as a floor it never promised. */
.sol-approx {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 0 0.3rem;
  white-space: nowrap;
  cursor: help;
}
.solution-body { padding: 0.7rem 0.8rem; }

/* Apply pinned right, on its own row above the merged step-list + track. */
.view-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.view-bar .apply-plan { margin: 0; }
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  overflow: hidden;
}
.view-btn {
  font: inherit;
  font-size: 0.85rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  /* Reset the global button margin so the buttons fill the pill instead of
     floating inside it (the active highlight must reach the oval's edges). */
  margin: 0;
  padding: 0.3rem 1.1rem;
  cursor: pointer;
}
.view-toggle .view-btn + .view-btn { border-left: 1px solid var(--line); }
.view-btn.is-active { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-weight: 700; }
/* Inset the focus ring; the pill's overflow:hidden would clip an outset one into
   a stray line at the divider. */
.view-btn:focus-visible { outline-offset: -2px; }

.plan-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
}
.plan-card + .plan-card { margin-top: 0.75rem; }
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.plan-head h3 { margin: 0; font-size: 0.95rem; }
.plan-cost { color: var(--accent); font-size: 0.82rem; font-weight: 600; }

.equiv-note {
  font-family: var(--body-font);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  padding: 0 0.4rem;
  vertical-align: middle;
}
/* Follow-along: the plan's step list beside its track. Steps come first in the DOM, so
   on narrow screens they stack above the track; wide, they sit side by side. */
.plan-follow { display: flex; align-items: flex-start; gap: 0.9rem; }
/* The step list stays put while the track scrolls: pinned below the site header, so
   every step and the walk controls are always in view, and it scrolls inside itself if a
   plan has more steps than fit. */
.plan-steps {
  flex: 0 0 15rem;
  min-width: 0;
  position: sticky;
  top: calc(var(--header-h, 56px) + 0.5rem);
  max-height: calc(100vh - var(--header-h, 56px) - 1.5rem);
  overflow-y: auto;
  overflow-x: hidden;
}
/* A plan's track is the browse track minus the 15rem step list beside it, so it - and only
   it - can run short of room. It scrolls inside itself instead of widening the results band
   and dragging the whole page sideways (which also strands the site header, since that only
   paints one window wide). Same treatment as the step list next to it: a pane of its own,
   capped to the window, scrolling internally. Names are never shortened - a track you can't
   read the names in isn't a track. */
.plan-track {
  flex: 1 1 auto;
  min-width: 0;
  max-height: calc(100vh - var(--header-h, 56px) - 1.5rem);
  overflow: auto;
}
/* The browse Rolls and Normal Capsules tables are the same pane: a few banners or
   machines already outgrow a narrow window. A normal plan brings panes of its own. */
#trackHost, #normalTracks:has(> table.track) {
  max-height: calc(100vh - var(--header-h, 56px) - 1.5rem);
  overflow: auto;
}
/* Inside the pane, "under the site header" means under the pane's own top edge: the
   sticky thead is measured against --header-h, so zero it there (not for .plan-track
   itself, whose max-height still needs the real height). Without this it pins a
   site-header's height down INTO the pane and overlaps the first rows. */
.plan-track table.track, #trackHost table.track, #normalTracks table.track { --header-h: 0px; }
@media (max-width: 760px) {
  .plan-follow { flex-direction: column; }
  .plan-steps { flex-basis: auto; width: 100%; position: static; max-height: none; }
}

/* Sticky within the pinned panel, so the title + walk controls stay put even when a long
   step list scrolls inside it. */
.steps-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
  padding-bottom: 0.4rem;
  margin-bottom: 0.4rem;
}
.steps-title { font-family: var(--head-font); font-size: 0.9rem; color: var(--muted); }
.step-nav { display: inline-flex; align-items: center; gap: 0.3rem; }
.step-nav-btn {
  font: inherit;
  line-height: 1;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0;
  padding: 0.15rem 0.55rem;
  cursor: pointer;
}
.step-nav-btn:hover { border-color: var(--accent); color: var(--ink); }
.step-count { font-size: 0.76rem; color: var(--muted); min-width: 3.4rem; text-align: center; }

.step-list { margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
/* One in-game action: a numbered card that lights its cells on the track when picked. */
.step-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
}
.step-card:hover { border-color: var(--accent); }
.step-card.is-current {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel-2));
  color: var(--ink);
}
.step-card.is-done { opacity: 0.55; }
.step-card-head { display: flex; align-items: center; gap: 0.4rem; }
.step-banner { font-family: var(--head-font); font-size: 0.85rem; color: var(--ink); }
.step-meta { display: flex; flex-wrap: wrap; gap: 0.2rem 0.5rem; font-size: 0.76rem; color: var(--muted); }
.step-kind { color: var(--ink); }
.step-gets { font-size: 0.76rem; color: var(--muted); }
.step-get {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  box-shadow: inset 0 0 0 1px var(--accent);
  border-radius: var(--pill);
  padding: 0 0.4rem;
  font-weight: 600;
}
.steps-total { margin: 0.5rem 0 0; font-size: 0.78rem; color: var(--muted); }

/* The step number: one small badge shared by the card and the track cells it lights, so
   the two read as the same step. On a track cell it heads the entry line. */
.step-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.25rem;
  border-radius: var(--pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--body-font);
  font-size: 0.72rem;
  font-weight: 700;
}

/* A/B track viewer: one merged table; each cell stacks every banner's cat at that
   shared position (à la ubercarry), with the plan's path lit up. */
.track-legend {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  display: flex;
  flex-direction: column; /* one banner per line - the names are long marketing strings */
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}
/* The legend is the thead's first row (so you can see which banner is 1/2/3 while the
   rows scroll), shed of the column headers' cell styling. */
table.track .legend-row th {
  padding: 0;
  border: 0;
  background: var(--bg);
  color: inherit;
  font: inherit;
}
/* Each banner's future-ubers stepper, right-aligned so they line up in a column
   whatever the name lengths: a compact number box drag-scrubbed up/down like the
   other number fields (app.js re-wires each one as the fragment arrives). */
.track-legend li { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.track-legend .future-ctl { margin-left: auto; white-space: nowrap; }
.track-legend .future-ubers {
  width: 3.2rem;
  margin-left: 0.3rem;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  font-size: 0.75rem;
}
/* The added future ubers as toggle chips: tap one to search for it (it joins the Targets
   panel above and gilds this banner's cells). On their own line under the banner so the
   long names above stay readable. */
.track-legend .future-targets {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-left: 1.5rem;
}
.future-target {
  font: inherit;
  font-size: 0.72rem;
  font-style: italic;
  color: var(--new);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  padding: 0.05rem 0.5rem;
  cursor: pointer;
}
.future-target:hover { border-color: var(--accent); }
.future-target[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.tag {
  display: inline-block;
  min-width: 1.1rem;
  text-align: center;
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0 0.2rem;
}
/* Separate borders, not collapsed: a collapsed border belongs to the table, so it stays
   put while the sticky thead's cells ride along, and the rows scrolling under it show
   through the line it leaves behind - a strip between the legend and the header row.
   Each cell draws its own left and bottom edge instead (the row's last cell its right,
   the header row its top), so every line moves with the cell that owns it. */
table.track {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0.2rem 0 0.6rem;
  font-size: 0.9rem;
}
table.track th, table.track td {
  border: 0;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.28rem 0.5rem;
  text-align: left;
  vertical-align: top;
}
table.track tr:not(.legend-row) > :last-child { border-right: 1px solid var(--line); }
table.track thead tr:not(.legend-row) > th { border-top: 1px solid var(--line); }
/* The legend and header rows ride along under the site header while the 100 rows
   scroll, as one block so nothing shows between them (--header-h is measured by app.js
   - the site header wraps taller on phones). */
table.track thead {
  position: sticky;
  top: var(--header-h, 52px);
  z-index: 2;
}
table.track thead th {
  background: var(--panel);
  color: var(--muted);
  font-family: var(--head-font);
  font-weight: 600;
}
table.track .pos { color: var(--muted); text-align: right; width: 2.5rem; font-weight: 400; }
/* Each banner's cat is its own line in the cell; off-path lines stay dim.
   Entries span the full cell (negative margin cancels the td padding) with their
   own inner padding, so the gold highlight ring frames the line edge-to-edge
   instead of cutting across the tag box or crowding the switch arrow. */
table.track .entry {
  color: var(--muted);
  padding: 0.1rem 0.5rem;
  margin: 0 -0.5rem;
  border-radius: 2px;
  /* One line per unit, split into columns: name (with the tag and debut mark), rarity,
     tier and dice. Every cell in a column is the same width, so the fixed tracks line
     the rarities, tiers and dice up down the whole table instead of letting them drift
     with the name lengths. The dupe branch spans all four on its own row. */
  display: grid;
  grid-template-columns: minmax(min-content, 1fr);
  align-items: baseline;
  column-gap: 0.35rem;
  white-space: nowrap;
}
/* Fixed trailing tracks, so they hold the same x whatever the name's length; the name
   never drops below its own width (min-content, with nowrap = the whole name). */
table.track:not(.normal-track) .entry {
  grid-template-columns: minmax(min-content, 1fr) 4.5rem 2.8rem 1.5rem;
}
/* Items carry no rarity or tier: just the name and the same dice track. */
table.track.normal-track .entry { grid-template-columns: minmax(min-content, 1fr) 1.5rem; }
table.track .entry > .arrow { grid-column: 1 / -1; }
table.track .entry-rarity, table.track .entry-tier { justify-self: start; }
table.track .entry-dice { justify-self: end; }
/* Two-level highlight: the whole on-path cell greys out, and inside it the exact
   banner+unit you pull lights up gold (target units, below, glow brightest). */
table.track td.cell:has(.entry.on-path) { background: var(--panel-2); }
.entry.on-path {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 600;
  border-radius: 2px;
}
/* A picked target - the cats "Find next" tracks: a gold pill hugging just its name, so the
   highlight can't spill over the tag box or the cell's dice button. Left unscoped (like the
   owned/wanted/new marks below) so the Rolls legend sample reuses it verbatim. Wishlisted
   cats are marked separately, with a star (see .entry.wanted below) - a lighter "I want this"
   note, not this bright "I'm hunting this" pill. The pill sits on the exact catlink that's
   the target (``.catlink.target``), not every name in the cell - so a clean roll and its
   "if dupe" branch (each its own catlink) light up one at a time, marked separately. */
.entry.target { color: var(--ink); font-weight: 700; }
.catlink.target, .rolls-both .catlink.icon-host.target:not(.no-icon) .catname {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  box-shadow: inset 0 0 0 1.5px var(--accent);
  border-radius: var(--pill);
  padding: 0 0.45rem;
}

/* Where you land NEXT (godfat's next-position marker): the cell the seed continues on
   after a traced pick or the plan's last draw. Striped, not solid - this cat isn't part
   of the plan; it's what the first roll AFTER it would give. */
.entry.next {
  color: var(--ink);
  background: repeating-linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent) 16%, transparent) 0 6px,
    transparent 6px 12px
  );
  border-radius: 2px;
}

/* Another banner giving the identical cat at one of the plan's pulls: that step is
   interchangeable - roll it on either. A dashed echo of the on-path stripe, drawn on an
   overlay (shadows can't dash) so the line's content stays put. */
.entry.shared {
  position: relative;
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border-radius: 2px;
}
.entry.shared::before {
  content: "";
  position: absolute;
  inset: 0;
  border-left: 3px dashed color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: inherit;
  pointer-events: none;
}
/* Click-to-trace renders as ordinary plan marks (on-path + target pill + shared);
   the cell's empty space is the click target (names/dice have their own). The guaranteed
   column is clickable too - it traces the uber that column's multi would award. Only the
   browse Rolls table traces (#trackHost) - a solution's own track isn't clickable, so its
   cells keep the default cursor; the names and dice inside are buttons and stay pointer. */
#trackHost table.track td.cell .entry { cursor: pointer; }
/* Walking the plan step by step (the step list beside the track): the current step's
   cells ring bright, the steps already done fade back, and a marker pins the first cell
   you're on. After .on-path in source order so these win the equal-specificity tie. */
table.track .entry.is-here {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  box-shadow: inset 0 0 0 2px var(--accent);
  font-weight: 700;
}
table.track .entry.is-done { opacity: 0.5; }
.step-here {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  white-space: nowrap;
}
/* Rare-dupe reroll: show where the slot jumps (to the other track) on its own line.
   Dimmed accent so it reads as a branch note, not a pull of its own. */
.arrow {
  display: block;
  color: color-mix(in srgb, var(--accent) 45%, var(--muted));
  font-size: 0.78rem;
  font-weight: 400;
}
/* Collection marks, matching the picker chips: a green name is an Uber/Legend you
   don't own yet, ✓ = owned (the line dims), ★ = wishlisted. Left unscoped so the
   Rolls guide's samples reuse them verbatim and always match the cells. */
.entry.new .catlink, .cat-pill.new { color: var(--new); }
/* Brand-new Uber (first appears on an upcoming banner) - a small accent "new" pill. */
.debut {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0 0.22rem;
  vertical-align: middle;
}
/* Owned lines dim - except a searched-for target, whose gold pill must stay lit. */
.entry.owned:not(.target), .cat-pill.owned:not(.target) { opacity: 0.6; }
.entry.owned .catlink::after,
.cat-pill.owned::after { content: " \2713"; color: var(--accent); font-weight: 700; }
.entry.wanted .catlink::after,
.cat-pill.wanted::after { content: " \2605"; color: var(--r-super); }
/* "I rolled this": a dice per line, in the entry's own dice track - "jump to just after
   obtaining THIS cat/item". One per branch on dual-outcome cells (a dupe's reroll lands on
   a different seed and position than the clean roll) and one per guaranteed award. Small
   and dim so the line still reads as text first and a whole track of them doesn't shout;
   hovering lights it up. */
table.track .reseed {
  display: inline-flex;
  width: 1.35rem;
  height: 1.2rem;
  vertical-align: middle;
  margin-left: 0.05rem;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  border-radius: var(--radius);
  color: var(--muted);
  padding: 0;
  opacity: 0.55;
  transition: color 0.2s, background-color 0.2s, opacity 0.2s;
}
table.track .reseed svg { display: block; width: 13px; height: 13px; }
table.track .reseed:hover, table.track .reseed:focus-visible {
  opacity: 1;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  filter: none;
}

/* The roll tables, softened: rounded outer corners, quieter grid lines, a hover band on
   the row under the pointer, and rounder highlights. Borders stay per cell (see above),
   so the sticky header still rides clean. */
table.track { --grid: color-mix(in srgb, var(--line) 70%, transparent); }
table.track th, table.track td { border-color: var(--grid); padding: 0.34rem 0.6rem; }
table.track tr:not(.legend-row) > :last-child { border-right-color: var(--grid); }
table.track thead tr:not(.legend-row) > th { border-top-color: var(--grid); }
table.track thead tr:not(.legend-row) > th:first-child { border-top-left-radius: 12px; }
table.track thead tr:not(.legend-row) > th:last-child { border-top-right-radius: 12px; }
table.track tbody tr:last-child > :first-child { border-bottom-left-radius: 12px; }
table.track tbody tr:last-child > :last-child { border-bottom-right-radius: 12px; }
table.track tbody tr:hover > td { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
table.track .entry { margin: 0 -0.6rem; padding: 0.12rem 0.6rem; }
table.track .entry, .entry.on-path, .entry.next, .entry.shared { border-radius: 8px; }
.catlink.target, .rolls-both .catlink.icon-host.target:not(.no-icon) .catname { border-radius: 999px; }
table.track .rarity { border-radius: 999px; }
table.track .reseed { border-radius: 999px; }

/* The controls above the table: number boxes and selects as rounded fields. */
.rolls-controls .ctrl :is(input[type="number"], select) { border-radius: 999px; padding-inline: 0.6rem; }

/* Details view: each cell's raw RNG seeds (the rarity seed it rolled from and the
   slot seed that indexes the pool). Off by default; the "Show seeds" toggle adds
   .details to the results region to reveal them. Monospace and dim so the numbers
   read as a debug annotation under the cat name. */
table.track .cell-seeds { display: none; }
#resultsRegion.details table.track .cell-seeds {
  display: block;
  margin-top: 0.15rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: -0.02em;
}

/* godfat-style guaranteed columns: the uber a guaranteed multi awards when its last draw
   lands on that cell. Tinted and dash-separated so they read as auxiliary to their track. */
table.track th.guaranteed-col, table.track td.guaranteed-col {
  background: var(--bg-2);
  border-left-style: dashed;
  font-size: 0.84rem;
}

/* Guide above the track grid: how to read the tracks + a rarity legend. */
.track-guide {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  padding: 0.5rem 0.8rem;
  margin-bottom: 0.75rem;
}
.track-guide > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
/* Symbol key: compact wrapping cards instead of a paragraph nobody reads. */
.symbol-legend {
  list-style: none;
  margin: 0.6rem 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.3rem 0.9rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}
.symbol-legend li { display: flex; gap: 0.4rem; align-items: baseline; }
/* A guide sample built from the track's own entry/mark classes: give it the little
   box the table cell normally provides, and undo the arrow's block display. */
.symbol-legend .sample { display: inline-block; padding: 0 0.35rem; border-radius: 4px; }
.symbol-legend .sym {
  flex: 0 0 auto;
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}
.symbol-legend .dice-sym svg { width: 14px; height: 14px; vertical-align: -2px; }
.symbol-legend .sep { color: var(--line); }
.rarity-legend { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.banner-group + .banner-group { margin-top: 0.9rem; }

/* ---- Planner form fields --------------------------------------------- */
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem 1rem;
  margin: 0.5rem 0;
}

.field-grid label { display: flex; flex-direction: column; gap: 0.2rem; color: var(--ink); }
.field-grid input { width: 100%; }
/* Undo beside the seed field: restores the seed from before the app last changed
   it (a cell's ↻ or an applied plan); hidden while there's nothing to undo. */
.seed-row { display: flex; align-items: center; gap: 0.4rem; }
.seed-row input { min-width: 0; }
.seed-undo,
.seed-back {
  flex: 0 0 auto;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1;
  padding: 0.35rem 0.6rem;
  margin: 0;
  white-space: nowrap;
}
.seed-undo:hover,
.seed-back:not(:disabled):hover { color: var(--accent); border-color: var(--accent); filter: none; }
.seed-back:disabled { opacity: 0.5; cursor: not-allowed; }

/* "Copy link" beside Find plan: a quiet secondary action - the permalink it
   copies reproduces the current seed/banners/targets/budget. */
.share-link {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.share-link:hover { color: var(--accent); border-color: var(--accent); filter: none; }
.check-row { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink); margin: 0.5rem 0; }
.error { color: var(--r-legend); }

/* Inline validation note next to a field; collapses out of the layout when empty. */
.field-error { color: var(--r-legend); font-size: 0.8rem; font-weight: 600; }
.field-error:not(:empty) { display: block; margin-top: 0.25rem; }
.field-error:empty { display: none; }

/* Advisory (not a hard error): the capsule-run mismatch note under the banner hint. */
.field-warning { color: var(--warn); font-size: 0.8rem; font-weight: 600; margin: 0.45rem 0 0; }

/* Themed validation feedback: flash the offending field instead of the browser popup. */
@keyframes flash-error {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 96, 96, 0); }
  15% { box-shadow: 0 0 0 3px var(--r-legend); }
}
.flash-error { animation: flash-error 1s ease-out; }
.req { color: var(--r-legend); font-weight: 700; }
.label-row { display: inline-flex; align-items: baseline; gap: 0.25rem; }

/* ---- Roll options + advanced disclosure ------------------------------ */
.roll-options { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 1rem; margin: 0.75rem 0; }
.roll-options .opt,
.advanced .opt { display: flex; flex-direction: column; gap: 0.2rem; color: var(--ink); }

.advanced { align-self: flex-end; }
/* The summary is a pill button with a chevron that turns as the panel opens. */
.advanced > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: max-content;
  max-width: 100%;
  padding: 0.3rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--accent);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary::before { content: "▸"; font-size: 0.75rem; transition: transform 0.15s; }
.advanced[open] > summary::before { transform: rotate(90deg); }
.advanced > summary:hover { border-color: var(--accent); }
.advanced[open] > summary { margin-bottom: 0.6rem; }
.advanced[open] {
  flex-basis: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 1rem;
}
.advanced p { margin: 0.4rem 0 0; font-size: 0.9rem; }
.apply-plan { margin: 0.1rem 0 0.6rem; font-size: 0.9rem; padding: 0.4rem 0.85rem; }
.apply-plan:disabled { opacity: 0.6; cursor: default; }
.apply-cost { font-weight: 600; opacity: 0.85; }
/* ---- "Your resources": a standalone card (out of Advanced) that surfaces the budget
   fields when explore mode is off, and a capsule's own tickets when it's selected, so
   the inputs you must fill are visible right when they matter. ---- */
.resources {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  margin: 0.75rem 0;
  background: var(--bg-2);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: 12px;
}
.resources-title { font-family: var(--head-font); font-size: 0.95rem; color: var(--accent); }
.budget-fields,
.capsule-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem 1rem;
}
.capsule-fields { padding-top: 0.6rem; border-top: 1px solid var(--line); }
.capsule-fields .capsule-hint { grid-column: 1 / -1; margin: 0; }
.budget-fields label,
.capsule-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  color: var(--ink);
}
.resources input { width: 100%; }
/* Capsule rows get a left accent in their ticket's colour, so the field reads as
   platinum/legend at a glance. */
.capsule-row { padding-left: 0.55rem; border-left: 3px solid var(--line); }
.capsule-row.platinum { border-left-color: var(--tkt-platinum); }
.capsule-row.legend { border-left-color: var(--tkt-legend); }

/* Capsule currency badge (platinum/legend), shared by the steps and track legend. */
.capsule-tag {
  font-family: var(--head-font);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.03rem 0.35rem;
  border-radius: var(--pill);
  border: 1px solid currentColor;
  line-height: 1.35;
}
.capsule-tag.platinum { color: var(--tkt-platinum); }
.capsule-tag.legend { color: var(--tkt-legend); }
/* Per-leg cost parts joined with " + "; capsule parts wear the ticket's colour. */
.cost-part + .cost-part::before { content: " + "; color: var(--muted); }
.cost-part.platinum { color: var(--tkt-platinum); }
.cost-part.legend { color: var(--tkt-legend); }
.step-card.capsule.platinum { border-left: 3px solid var(--tkt-platinum); }
.step-card.capsule.legend { border-left: 3px solid var(--tkt-legend); }

.opt.inline { flex-direction: row; align-items: baseline; gap: 0.45rem; flex-wrap: wrap; }
.opt.inline input[type="number"] { width: 5.5rem; }
.opt-group { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: flex-end; }
.opt-group + .opt-group { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.opt-group p { flex-basis: 100%; }

/* ---- Cat browser (chips + collapsible banners) ----------------------- */
.cat-browser { margin-top: 0.75rem; }

.cat-browser .group {
  margin: 1.5rem 0 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--line);
  color: var(--accent);
  font-size: 1.05rem;
}
.cat-browser .group:first-child { margin-top: 0.25rem; }

.rarity-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
}
.rarity-row:first-of-type { border-top: 0; }
.rarity-row > .rarity { flex: 0 0 auto; margin-top: 0.15rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* Base chip - electable target buttons + collection name buttons */
.chip {
  font: inherit;
  color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  padding: 0.25rem 0.7rem;
  margin: 0;
  cursor: pointer;
  font-weight: 500;
  line-height: 1.2;
}
.chip:hover { border-color: var(--accent); }

/* Selected target (planner) - highlighted outline like ubercarry */
.chip.selected {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 0 0 1px var(--accent) inset;
}

/* Collection status on target-picker chips: owned dimmed with a check, wishlist starred. */
.chip.owned { opacity: 0.5; }
.chip.owned::after { content: " \2713"; color: var(--accent); font-weight: 700; }
.chip.wanted:not(.owned)::after { content: " \2605"; color: var(--r-super); }
.chip.owned.selected { opacity: 1; }

/* ---- Collection chips (owned / wishlist) ----------------------------- */
/* Names mode: each cat is just its name in a pill - click it to own it. Owned fills gold
   and leads with a check. The star and info buttons wait for the pointer (or focus);
   a wishlisted cat keeps its gold star showing. Touch screens can't hover, so there
   both stay visible, small and faint. */
.own-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
}
.own-chip .chip {
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 0.3rem 0.85rem;
}
.own-chip :is(.chip-star, .catinfo) {
  display: none;
  align-items: center;
  font: inherit;
  font-size: 0.85em;
  line-height: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.3rem 0.25rem;
  cursor: pointer;
}
.own-chip .catinfo { padding-right: 0.65rem; }
.own-chip :is(.chip-star, .catinfo):hover { color: var(--accent); filter: none; }
.own-chip:is(:hover, :has(:focus-visible)) :is(.chip-star, .catinfo),
.own-chip.wanted .chip-star { display: flex; }
.own-chip:is(:hover, :has(:focus-visible)) .chip,
.own-chip.wanted .chip { padding-right: 0.2rem; }
@media (hover: none) {
  .own-chip :is(.chip-star, .catinfo) { display: flex; opacity: 0.5; }
  .own-chip .chip { padding-right: 0.2rem; }
}
.own-chip:hover { border-color: var(--accent); }

.own-chip.owned {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: var(--accent);
}
.own-chip.owned .chip { color: var(--accent); font-weight: 700; }
.own-chip.owned .chip-own::before { content: "✓"; margin-right: 0.35em; }
.own-chip.wanted .chip-star { color: var(--r-super); opacity: 1; }
.own-chip.wanted:not(.owned) { border-color: var(--r-super); }
.collection-section { border-radius: 12px; }

/* Icon modes: Cat Guide tiles, all one size - icon on top, the name under it cut to two
   lines, no frame. Cats you don't own are faded; owned ones are in full colour with a
   gold name.
   The star and info buttons float in the top corner on hover; a wishlisted cat shows a
   gold star in the other corner. */
.cat-browser:is(.rolls-icons, .rolls-both) .rarity-row > .chips {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.5rem;
}
.cat-browser:is(.rolls-icons, .rolls-both) .own-chip {
  position: relative;
  display: block;
  border-radius: 12px;
}
.cat-browser:is(.rolls-icons, .rolls-both) .own-chip .chip-own {
  display: grid;
  grid-template-columns: 1fr var(--cat-icon) 1fr;
  justify-items: center;
  row-gap: 0.3rem;
  width: 100%;
  padding: 0.7rem 0.4rem 0.5rem;
  border-radius: 12px;
  text-align: center;
}
.cat-browser:is(.rolls-icons, .rolls-both) .own-chip .cat-icon { grid-area: 1 / 2; margin: 0; }
.cat-browser:is(.rolls-icons, .rolls-both) .own-chip .catname { grid-area: 2 / 1 / 3 / -1; }
.cat-browser:is(.rolls-icons, .rolls-both) .own-chip:not(.owned) .cat-icon { opacity: 0.4; filter: grayscale(0.6); }
.cat-browser:is(.rolls-icons, .rolls-both) .own-chip:not(.owned) .catname { color: var(--muted); }
.cat-browser.rolls-both .own-chip .catname {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 2.5em;
  font-size: 0.78rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
/* The tier badge shares the icon's grid cell, hung on its bottom-right corner, so ranked
   cats keep the tile size and never cover the name. It's centred on the icon's right
   edge, but a long one stops at the tile's edge (the gutter beside the icon, in cqi). */
.cat-browser:is(.rolls-icons, .rolls-both) .own-chip .chip-own { container-type: inline-size; }
.cat-browser:is(.rolls-icons, .rolls-both) .own-chip .tier-badge {
  grid-area: 1 / 2;
  place-self: end;
  margin: 0;
  transform: translateX(min(50%, (100cqi - var(--cat-icon)) / 2));
  background: color-mix(in srgb, var(--band) 14%, var(--panel));
}
.cat-browser:is(.rolls-icons, .rolls-both) .own-chip,
.cat-browser:is(.rolls-icons, .rolls-both) .own-chip:is(.owned, .wanted) {
  border-color: transparent;
  background: transparent;
}
.cat-browser:is(.rolls-icons, .rolls-both) .own-chip:hover {
  border-color: transparent;
  background: color-mix(in srgb, var(--panel-2) 70%, transparent);
}
.cat-browser:is(.rolls-icons, .rolls-both) .own-chip.owned .chip-own::before { content: none; }
.cat-browser:is(.rolls-icons, .rolls-both) .own-chip :is(.chip-star, .catinfo) {
  position: absolute;
  top: 0.3rem;
  padding: 0.25rem 0.35rem;
  border-radius: 999px;
  background: var(--panel);
  font-size: 0.85rem;
}
.cat-browser:is(.rolls-icons, .rolls-both) .own-chip .catinfo { right: 0.3rem; }
.cat-browser:is(.rolls-icons, .rolls-both) .own-chip .chip-star { right: 1.85rem; }
.cat-browser:is(.rolls-icons, .rolls-both) .own-chip.wanted:not(:hover, :has(:focus-visible)) .chip-star {
  right: auto;
  left: 0.3rem;
  background: transparent;
}

/* ---- Tier-list badges + page ------------------------------------------ */
[data-band="S"] { --band: var(--band-s); }
[data-band="A"] { --band: var(--band-a); }
[data-band="B"] { --band: var(--band-b); }
[data-band="C"] { --band: var(--band-c); }
[data-band="D"] { --band: var(--band-d); }
[data-band="E"] { --band: var(--band-e); }
[data-band="F"] { --band: var(--band-f); }

/* The little rank pill on picker/collection chips: the base placement, plus "▲SS"
   when the Ultra Form / Ultra Talents placement ranks higher (the title says which). */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  margin-left: 0.45em;
  padding: 0 0.45em;
  border-radius: var(--pill);
  font-size: 0.72em;
  font-weight: 700;
  line-height: 1.6;
  vertical-align: 0.1em;
  color: var(--band);
  background: color-mix(in srgb, var(--band) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--band) 45%, transparent);
}
.tier-up { font-weight: 600; opacity: 0.85; }

.tier-controls { display: flex; justify-content: flex-end; margin-top: 1.25rem; }
.tier-table { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.6rem; }
.tier-more { margin-top: 1.25rem; }
.tier-index { margin-top: 2rem; }
.tier-index-links { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; margin: 0.4rem 0 0; padding: 0; list-style: none; }
.tier-index-links a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.tier-row {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.tier-label {
  flex: 0 0 3.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--head-font);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--band);
  background: color-mix(in srgb, var(--band) 15%, transparent);
  border-right: 1px solid var(--line);
}
.tier-units { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.55rem; }
.tier-unit {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  padding: 0.15rem 0.6rem;
  cursor: default;
  line-height: 1.2;
}
.tier-unit[data-name] { cursor: pointer; }
.tier-unit[data-name]:hover { border-color: var(--accent); }
.tier-unit img { width: 42px; height: auto; }
/* The source list greys a cat out where its UF/UT entry ranks higher up. */
.tier-unit.dimmed { opacity: 0.45; }
.tier-unit .boost {
  font-size: 0.7em;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 5px;
  padding: 0 0.3em;
}
/* Softened like Collection: rounder rows, and each cat just its icon and name - no box,
   a soft band under the pointer. */
.tier-row { border-radius: 12px; }
.tier-units { gap: 0.25rem 0.4rem; }
.tier-unit { border-color: transparent; background: transparent; border-radius: 999px; padding: 0.2rem 0.7rem 0.2rem 0.35rem; }
.tier-unit[data-name]:hover { border-color: transparent; background: color-mix(in srgb, var(--panel-2) 80%, transparent); }
.tier-unit .boost { border-radius: 999px; padding: 0 0.45em; }
.tier-controls select { border-radius: 999px; padding-inline: 0.75rem; }

/* ---- Cat name -> forms + wiki popup ---------------------------------- */
/* A cat name in a track cell: plain text that opens the popup on click. */
.catlink {
  font: inherit;
  background: transparent;
  color: inherit;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
  width: auto;
  cursor: pointer;
  text-decoration: underline dotted transparent;
  text-underline-offset: 2px;
}
.catlink:hover { color: var(--accent); text-decoration-color: currentColor; filter: none; }

/* A future-uber placeholder: italic (not a real unit) with no popup, but its green
   uncollected colour stays - hovering mustn't fake a link. */
.catlink.future { cursor: default; font-style: italic; }
.catlink.future:hover { color: inherit; text-decoration-color: transparent; }

/* Display-mode toggle: a cat's form icon, injected by app.js only once an icon mode is
   picked. Hidden by default (names mode); the mode class the page puts on its container
   reveals every .icon-host's icon at --cat-icon. In "both" the name sits centred under
   its icon. Shared by both Rolls tables, Collection and Resources. */
.cat-icon {
  display: none;
  width: var(--cat-icon);
  max-width: 100%;
  height: auto;
}
.rolls-icons .icon-host, .rolls-both .icon-host { display: inline-block; vertical-align: middle; }
.rolls-both .icon-host { text-align: center; }
.rolls-icons .icon-host .cat-icon, .rolls-both .icon-host .cat-icon { display: block; margin: 0 auto; }
/* Icons-only: drop the name, but keep it as a fallback when the icon 404s. */
.rolls-icons .icon-host:not(.no-icon) .catname { display: none; }
.rolls-icons .icon-host.no-icon .cat-icon { display: none; }
/* In the roll tables the icon sits beside its name at row size, so each line stays one
   line and a cell grows by the icon's height only. */
table.track .cat-icon { width: var(--cat-icon-row); }
:is(.rolls-icons, .rolls-both) table.track .icon-host { display: inline-flex; align-items: center; gap: 0.4rem; }
:is(.rolls-icons, .rolls-both) table.track .icon-host .cat-icon { margin: 0; }
:is(.rolls-icons, .rolls-both) table.track .entry { align-items: center; }
/* With icons the marks move onto the icon: a target is ringed gold (its name keeps the
   pill in "both"), and in icons-only an uncollected Uber/Legend is ringed green, since
   there's no name to colour. The button itself drops the pill, which would balloon round
   the whole sprite. */
:is(.rolls-icons, .rolls-both) .catlink.icon-host.target:not(.no-icon) { background: none; box-shadow: none; padding: 0; }
.rolls-icons table.track .entry.new .cat-icon { border-radius: var(--radius); box-shadow: 0 0 0 2px var(--new); }
:is(.rolls-icons, .rolls-both) table.track .catlink.target .cat-icon { border-radius: var(--radius); box-shadow: 0 0 0 2px var(--accent); }

/* The small "ⓘ" opener on collection + picker chips (they toggle on their main click,
   so the forms/wiki popup gets its own affordance). */
.catinfo {
  font: inherit;
  line-height: 1;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: var(--pill);
  padding: 0.25rem 0.55rem;
  margin: 0;
  width: auto;
  cursor: pointer;
}
.catinfo:hover { color: var(--accent); filter: none; }

.cat-popup {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  padding: 1.1rem 1.2rem 1rem;
  max-width: min(92vw, 430px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.cat-popup::backdrop { background: rgba(10, 10, 9, 0.55); }
.cat-popup-close {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: var(--pill);
  font-size: 1.3rem;
  line-height: 1;
  padding: 0.1rem 0.45rem;
  margin: 0;
  width: auto;
  cursor: pointer;
}
.cat-popup-close:hover { color: var(--ink); filter: none; }
.cat-popup-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0 1.5rem 0.85rem 0;
}
.cat-popup-name { font-family: var(--head-font); font-weight: 700; font-size: 1.05rem; }
.cat-popup-forms { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-bottom: 0.9rem; }
.cat-popup-forms:empty { display: none; }
.cat-form { margin: 0; width: 64px; text-align: center; }
.cat-form img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.cat-form.no-icon img { visibility: hidden; }
.cat-form figcaption { margin-top: 0.25rem; font-size: 0.72rem; line-height: 1.15; color: var(--muted); }

/* Clicking a form swaps the stat block underneath to that form. */
.cat-form { cursor: pointer; }
.cat-form.selected img { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cat-form.selected figcaption { color: var(--ink); }

.cat-popup-stats { margin-bottom: 0.9rem; }
.cat-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.55rem 0.7rem;
  margin-bottom: 0.7rem;
}
.cat-stat .label {
  display: block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
}
.cat-stat .value { font-weight: 600; font-size: 0.88rem; }
.cat-popup-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.cat-popup-chips:empty { display: none; }
.cat-chip {
  font-size: 0.72rem;
  line-height: 1.5;
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--panel-2);
}
.cat-chip.target { border-color: var(--warn); color: var(--warn); }
.cat-chip.immune { color: var(--muted); }
.cat-stats-note { margin: 0.55rem 0 0; font-size: 0.7rem; color: var(--muted); }
.cat-popup-banners { margin: 0 0 0.6rem; }
.cat-popup-banners ul {
  max-height: 7.5rem;
  overflow-y: auto;
  margin: 0.2rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.8rem;
}
.cat-popup-links { display: flex; flex-wrap: wrap; gap: 0.15rem 0.9rem; font-weight: 600; }

/* ---- Outbound links to community tools -------------------------------- */
.tool-links {
  margin: 2.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.tool-links h2 { font-size: 0.95rem; margin: 0 0 0.4rem; }
.tool-links ul { margin: 0; padding-left: 1.1rem; font-size: 0.8rem; }
.tool-links li { margin: 0.25rem 0; }

/* ---- About page ------------------------------------------------------ */
.about-section { margin: 0 0 1.75rem; }
.about-section p { margin: 0 0 0.6rem; }
.about-list { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.about-list li { margin: 0.3rem 0; }
.about-group { font-size: 0.9rem; margin: 1rem 0 0; }

/* ---- Add-a-cat (secondary) ------------------------------------------- */

/* ---- Responsive ------------------------------------------------------ */

/* When brand, nav and controls don't fit on one row (base.html measures it), the nav
   drops to its own centred second row under brand (left) and controls (right). */
.site-header.stacked .bar { grid-template-columns: auto 1fr; }
.site-header.stacked nav { grid-row: 2; grid-column: 1 / -1; flex-wrap: wrap; }
/* On a phone the links stay one row that swipes sideways, so the bar keeps to two
   short rows: the page you're on is scrolled into view (base.html), and the far edge
   fades to show there's more. Log in is a link on the Sign up page. On a screen too
   narrow for brand and controls side by side, the controls wrap under the brand. */
@media (max-width: 560px) {
  .site-header.stacked .bar { display: flex; flex-wrap: wrap; padding: 0.45rem 0.9rem; gap: 0.35rem 0.5rem; }
  .site-header.stacked .header-tools { margin-left: auto; gap: 0.4rem; }
  .site-header .prefs-button { padding: 0 0.55rem; }
  .site-header .prefs-button .chevron { display: none; }
  .site-header .brand { font-size: 0.95rem; }
  .account > a.signup { padding: 0.3rem 0.75rem; }
  .site-header.stacked nav {
    order: 1;
    flex-basis: calc(100% + 1.8rem);
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: -0.9rem;
    padding-inline: 0.5rem 2.5rem;
    mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
  }
  .site-header.stacked nav::-webkit-scrollbar { display: none; }
  .site-header nav a { font-size: 0.92rem; padding: 0.3rem 0.6rem; }
  .account > a:not(.signup) { display: none; }
}

@media (max-width: 640px) {
  main { padding: 1.25rem 0.9rem 3rem; }
  .site-footer { padding: 1rem 0.9rem 1.75rem; }
  h1 { font-size: 1.6rem; }

  button[type="submit"] { width: 100%; margin: 0.3rem 0; }
  /* Icon tiles just wide enough for the icon, so a phone fits three to a row. */
  .cat-browser:is(.rolls-icons, .rolls-both) .rarity-row > .chips {
    grid-template-columns: repeat(auto-fill, minmax(calc(var(--cat-icon) + 2rem), 1fr));
  }
}

/* Full-page overlay shown while a plan computes (the form is a blocking POST). */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--overlay);
  color: var(--ink);
  font-family: var(--head-font);
}
.loading-overlay[hidden] { display: none; }
.loading-overlay .spinner {
  width: 46px;
  height: 46px;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .loading-overlay .spinner { animation: none; }
}

/* ---- Seed Finder ------------------------------------------------------- */
.seek-howto { margin: 0.4rem 0 1.2rem; }
.seek-howto ul {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.35rem;
  max-width: 44rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* The whole entry flow sits in one quiet card, a toned-down planner form. */
.seek-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem 1.25rem;
}
.seek-label { display: block; font-weight: 600; margin-bottom: 0.4rem; }

/* The banner list: the planner picker's groups and run bars, minus the openable
   cat lists - the search box filters, clicking a bar selects. */
.seek-picker {
  margin-top: 0.6rem;
  max-height: 40vh;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  padding: 0.15rem 0.75rem 0.6rem;
}
.seek-picker .group {
  margin: 0.6rem 0 0.2rem;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--line);
  color: var(--accent);
  font-size: 1.05rem;
}
.seek-picker details.group-drop { margin-top: 0.75rem; }
.seek-run {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  margin: 0.45rem 0;
  padding: 0.5rem 0.8rem;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  font-family: var(--head-font);
  font-weight: 600;
  cursor: pointer;
}
.seek-run:hover { border-color: var(--accent); filter: none; }
.seek-run.selected { outline: 2px solid var(--accent); outline-offset: -1px; }
.seek-no-match { margin: 0.6rem 0 0.2rem; }

/* Each pull: a dropdown button with a search box inside its panel. */
.roll-pick { position: relative; }
.roll-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 0.45rem 0.7rem;
  font-size: 0.95rem;
  cursor: pointer;
}
.roll-trigger:hover { border-color: var(--accent); filter: none; }
.roll-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.roll-label.roll-placeholder { color: var(--muted); }
.roll-chevron { margin-left: auto; color: var(--muted); font-size: 0.8rem; }
.combo-list {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 4px);
  z-index: 30;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
  max-height: 19rem;
  overflow-y: auto;
  padding: 0.3rem;
}
.pick-search {
  width: 100%;
  position: sticky;
  top: -0.3rem;
  z-index: 1;
  margin-bottom: 0.25rem;
}
.combo-group {
  padding: 0.45rem 0.55rem 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.combo-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.5rem;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-radius: var(--radius);
  padding: 0.4rem 0.55rem;
  font-size: 0.92rem;
  cursor: pointer;
}
.combo-row:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); filter: none; }
.combo-row .rarity { flex: 0 0 auto; }
.combo-row .combo-cat {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.combo-empty { margin: 0.3rem 0.55rem 0.4rem; font-size: 0.85rem; color: var(--muted); }

.seek-rolls {
  margin: 0.5rem 0 1rem;
  padding-left: 1.6rem;
  display: grid;
  gap: 0.45rem;
  max-width: 28rem;
}
.seek-rolls li::marker { color: var(--muted); }
.seek-actions { display: flex; gap: 0.6rem; align-items: center; margin-top: 0.9rem; }
/* A quiet secondary action beside the primary Find button, like the collection's
   backup/restore buttons. */
.seek-add {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.seek-add:hover { color: var(--ink); border-color: var(--accent); filter: none; }
/* Softened like the rest of the site: rounder panels and banner bars (the selected bar
   tinted gold rather than outlined), pill pick boxes, search and buttons. */
.seek-panel, .seek-picker, .seek-match, .combo-list { border-radius: 12px; }
.seek-run { border-left-width: 1px; border-radius: 10px; }
.seek-run.selected {
  outline: 0;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
}
.seek-panel .search-wrap input[type="search"], .pick-search { border-radius: 999px; padding-inline: 1rem; }
.roll-trigger { border-radius: 999px; padding-inline: 1rem; }
.combo-row { border-radius: 8px; }
.seek-actions button { border-radius: 999px; padding-inline: 1.1rem; }
.seek-progress { margin-top: 1.2rem; max-width: 26rem; }
.seek-progress progress { width: 100%; accent-color: var(--accent); }
.seek-results { margin-top: 1.2rem; display: grid; gap: 0.8rem; max-width: 34rem; }
.seek-match {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
}
.seek-match .seek-seed { font-family: var(--head-font); font-size: 1.05rem; }
.seek-match .seek-open { display: inline-block; margin: 0.4rem 0; }
.seek-match p { margin: 0.3rem 0 0; }
.seek-none { color: var(--muted); max-width: 34rem; }

/* ---- Normal Capsules: the normal-side tracker ---------------------------------- */
/* Items aren't cats: a cell holds a plain item chip coloured by its rate band
   (2 = the gold band, 3 = the red premium band, 4 = the aqua top band, matching
   the community tracker's reading), upgrades read blue, and the Catseye event's
   1% Dark Catseye gets the spotlight. */
.normal-machines {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  align-items: center;
}
/* Each machine a pill switch: gold while its columns are on the table. The checkbox
   stays in the label (it's what app.js reads), just out of sight. */
.normal-machines { gap: 0.4rem; }
.machine-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.machine-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.machine-toggle:hover { color: var(--ink); border-color: var(--accent); }
.machine-toggle:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.machine-toggle:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.normal-track .item[data-pool="2"] { color: var(--r-super); }
.normal-track .item[data-pool="3"] { color: var(--r-legend); }
.normal-track .item[data-pool="4"] { color: var(--r-rare); }
.normal-track .item.upgrade { color: var(--r-rare); }
.item.dark-catseye,
.normal-track .item.dark-catseye {
  color: var(--r-uber);
  font-weight: 700;
  text-shadow: 0 0 10px color-mix(in srgb, var(--r-uber) 45%, transparent);
}
.symbol-legend .item.sample { font-weight: 600; }
.symbol-legend .item.upgrade.sample { color: var(--r-rare); }

#nseekBanner {
  max-width: 22rem;
  margin-bottom: 0.6rem;
}

/* The finder's result buttons and the plan's apply button act right here on the
   page, but read like the rare finder's links. */
.seek-use {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

/* The machine toggles take their own full row under the seed controls. */
.roll-options .normal-machines { flex-basis: 100%; }

/* ---- The normal path planner ---------------------------------------------------- */
.plan-budgets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  margin: 0.5rem 0;
}
.plan-budgets .plan-budget { width: 5.5rem; }
.plan-controls { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 0.8rem; }
.normal-plan { margin: 0.9rem 0 1.1rem; }
.plan-haul { font-size: 1.05rem; }
.plan-haul .seek-use { margin-left: 0.5rem; }
.plan-legs { margin: 0.5rem 0 0; padding-left: 1.4rem; }
.plan-legs li { margin: 0.25rem 0; }

/* What a plan collects: a pill on the item itself - Dark Catseyes scream loudest. */
.normal-track .item.got,
.plan-legs .item.got {
  font-weight: 700;
  padding: 0 0.3rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 24%, transparent);
}
.normal-track .item.dark-catseye.got,
.plan-legs .item.dark-catseye.got {
  background: color-mix(in srgb, var(--r-uber) 26%, transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--r-uber) 45%, transparent);
}

/* Narrowing a big breakdown: tick the cats a plan has to get. Sits above the rows, quiet
   until something is ticked - it only matters when there are more plans than anyone reads. */
.plan-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
}
.plan-filter-label { color: var(--muted); font-family: var(--head-font); font-weight: 600; }
.plan-filter-cats { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.filter-cat {
  margin: 0;
  padding: 0.1rem 0.5rem;
  font-size: 0.8rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  color: var(--muted);
}
.filter-cat:hover { color: var(--ink); border-color: var(--accent); filter: none; }
.filter-cat[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.plan-filter-clear { margin: 0; padding: 0.1rem 0.5rem; font-size: 0.8rem; background: none; color: var(--muted); border: 0; text-decoration: underline; }
.plan-filter-count { margin-left: auto; color: var(--muted); white-space: nowrap; }

/* ---- Motion: small and quick, never on a theme switch - and none at all for anyone
   who asks for less ---- */
.theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }
/* Banners and the table legend slide open and shut (a browser without
   ::details-content just snaps). The picker's big groups and the plan rows snap on purpose:
   sliding them would re-lay out hundreds of rows a frame. Panels with a search dropdown
   stay out too - the slide clips its overflow. */
:root { interpolate-size: allow-keywords; }
.banner-group::details-content, .track-guide::details-content {
  block-size: 0;
  overflow-y: clip;
  transition: block-size 0.15s ease-out, content-visibility 0.15s allow-discrete;
}
.banner-group[open]::details-content, .track-guide[open]::details-content { block-size: auto; }
/* Closing drops [open] at once, so the closed summary's negative margin snapped in and
   pulled the still-sliding cats up over the bar: ease it with the slide, bar on top. */
@supports selector(::details-content) {
  .banner-group > summary {
    position: relative;
    z-index: 1;
    transition: margin-bottom 0.15s ease-out;
  }
}
button, .chip, .entry, .banner-group, .banner-include, .step-card, .site-header nav a {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    box-shadow 0.15s ease, transform 0.1s ease;
}
.chip:active, .banner-include:active, .step-card:active { transform: scale(0.97); }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* Freshly rendered results ease in - only the containers, never the hundreds of cells. */
#trackHost > *, #solutions > *, .solution-body > *, #normalRolls > * { animation: rise 0.18s ease-out; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Where the seed is kept: a quiet status line under the seed field, and the held note a
   shared link opens with. */
.seed-status { font-size: 0.78rem; margin: 0.3rem 0 0; }
.seed-state:not(:empty) { font-weight: 600; margin-right: 0.25rem; }
.seed-state[data-state="ok"] { color: var(--accent); }
.seed-state[data-state="error"] { color: var(--r-legend); }
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.link-btn:hover { filter: none; }
.seed-held {
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
}
.seed-held p { margin: 0 0 0.4rem; }
.seed-held button { font-size: 0.82rem; padding: 0.3rem 0.6rem; }

/* Seed Finder: the before-you-search checklist, the pre-search warnings and the saved note. */
.seek-checklist { font-size: 0.82rem; margin: 0 0 0.6rem; padding-left: 1.2rem; }
.seek-checklist li::marker { content: "\2713  "; color: var(--accent); }
.seek-check {
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  padding: 0.5rem 0.8rem;
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
}
.seek-check p { margin: 0.2rem 0; }
.seek-none ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.seek-none li { margin: 0.25rem 0; }
.seek-kept { margin: 0.4rem 0 0; font-size: 0.85rem; }

/* Guides: readable prose width, numbered steps, the "more guides" foot. */
.guide { max-width: 44rem; }
.guide-crumb { font-size: 0.85rem; margin: 0 0 0.5rem; }
.guide h2 { margin: 1.6rem 0 0.5rem; }
.guide p, .guide li { line-height: 1.6; }
.guide ol, .guide ul { padding-left: 1.3rem; }
.guide li { margin: 0.35rem 0; }
.guide .guide-cta { font-weight: 600; }
.guide-more { max-width: 44rem; margin: 2rem 0 0; border-top: 1px solid var(--line); padding-top: 1rem; }
/* The guides index: each guide a card, clickable anywhere (its link stretches over it). */
.guide-list { display: grid; gap: 0.7rem; list-style: none; padding: 0; max-width: 44rem; }
.guide-list li {
  position: relative;
  margin: 0;
  padding: 0.9rem 1.1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.15s;
}
.guide-list li:hover { border-color: var(--accent); }
.guide-list a { font-weight: 600; font-size: 1.05rem; }
.guide-list a::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.guide-list p { margin: 0.2rem 0 0; }
/* Inside a guide: the closing call to action as a gold pill, the other guides as pills. */
.guide .guide-cta a {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
}
.guide .guide-cta a:hover { filter: brightness(1.07); text-decoration: none; }
.guide-more { border-top: 0; padding-top: 0; }
.guide-more .about-list { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; }
.guide-more .about-list li { margin: 0; }
.guide-more .about-list a {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
}
.guide-more .about-list a:hover { border-color: var(--accent); text-decoration: none; }

/* The interface-language picker, sized to sit beside the version switcher. */
.lang-switch { margin: 0; }
.lang-switch select {
  height: 1.7rem;
  padding: 0 0.4rem;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}
.lang-switch select:hover { color: var(--ink); }

/* The first visit's welcome strip, and the short how-it-works intros. */
.welcome {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  max-width: calc(760px - 2.5rem);
  margin: 1rem auto 0;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.welcome[hidden] { display: none; }
@media (max-width: 800px) { .welcome { margin: 1rem 1.25rem 0; } }
.welcome p { margin: 0; flex: 1; }
.welcome-close {
  flex: 0 0 auto;
  background: none;
  border: 0;
  padding: 0 0.2rem;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.welcome-close:hover { color: var(--ink); filter: none; }
.page-intro { font-size: 0.85rem; margin: 0 0 1rem; }
.changelog { max-width: 44rem; }
.changelog h2 { font-size: 1rem; margin: 1.4rem 0 0.4rem; }
.changelog ul { padding-left: 1.2rem; }
.changelog li { margin: 0.3rem 0; line-height: 1.55; }
.terms dt { font-weight: 700; margin: 1rem 0 0.2rem; }
.terms dd { margin: 0; line-height: 1.6; }

/* A tier badge opens the tier list at its cat; that list marks the cat it opened on. */
.tier-badge[data-uid] { cursor: pointer; }
.tier-badge[data-uid]:hover { filter: brightness(1.2); }
.tier-unit.is-focused { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The cat popup's trait chips in the colours the game gives each trait. A tint behind
   ordinary text, so they read in both themes. */
.cat-chip.target[data-trait] {
  color: var(--ink);
  border-color: var(--trait);
  background: color-mix(in srgb, var(--trait) 22%, transparent);
}
.cat-chip[data-trait="Red"] { --trait: #e5484d; }
.cat-chip[data-trait="Floating"] { --trait: #3fb27f; }
.cat-chip[data-trait="Black"] { --trait: #6b6b6b; }
.cat-chip[data-trait="Metal"] { --trait: #a9b4c2; }
.cat-chip[data-trait="Angel"] { --trait: #f2c94c; }
.cat-chip[data-trait="Alien"] { --trait: #3fa9f5; }
.cat-chip[data-trait="Zombie"] { --trait: #9b59b6; }
.cat-chip[data-trait="Relic"] { --trait: #5a7d2a; }
.cat-chip[data-trait="Aku"] { --trait: #2d4a8a; }
.cat-chip[data-trait="Traitless"] { --trait: #d8d8d8; }
.cat-chip[data-trait="Witch"] { --trait: #d65db1; }
.cat-chip[data-trait="Eva Angel"] { --trait: #f2994a; }

/* The avatar picker: the current picture, a search and the Collection's filters, and
   every match with a button per form showing its full icon. The search's gap clears its
   focus ring off the pills below. */
.avatar-now { display: flex; align-items: center; gap: 0.75rem; margin: 1rem 0; }
.avatar-large { width: 104px; height: 79px; border-radius: var(--radius); }
.avatar-picker input[type="search"] { width: 100%; margin-bottom: 0.75rem; }
.avatar-grid { display: grid; gap: 0.75rem; margin-top: 0.5rem; }
.avatar-cat { display: grid; gap: 0.3rem; }
.avatar-name { font-weight: 600; }
.avatar-forms { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.avatar-pick {
  padding: 0;
  margin: 0;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}
.avatar-pick:hover, .avatar-pick:focus-visible { border-color: var(--accent); filter: none; }
.avatar-pick img { display: block; width: 104px; height: auto; }
