/* ---------- Tokens ---------- */
/* Sky blue: steel blue for actions, sky blue lines and pale sky fills on
   white, with a deep blue header. Gain stays green and loss red. */

:root {
  color-scheme: light;
  --bg: #f6fafd;
  --surface: #ffffff;
  --surface-2: #eef6fc;
  --text: #13324a;
  --muted: #5b7489;
  --border: #d7e8f5;
  --border-strong: #b4d6ee;

  --accent: #2b7ba4;
  --accent-hover: #22678b;
  --accent-soft: #dcedf9;
  --on-accent: #ffffff;
  /* Money: a lighter blue next to the steel blue used for actions */
  --secondary: #3a8fc0;
  --secondary-soft: #e4f1fa;

  --amber: #a15c07;
  --amber-soft: #fff4dc;
  --amber-line: #f2b33d;
  /* Ready to sell: a muted sand, warm but calm next to the blues */
  --ready: #d4b77c;
  --ready-text: #8a6420;
  --ready-soft: #fbf8f2;
  --ready-tile: #f5eedf;
  --ready-border: #e8dcc4;
  --ready-chip: #f1e6cf;
  --ready-count: #e6d3a8;
  --on-ready: #6e5019;
  --gain: #13804c;
  --gain-soft: #e2f4ea;
  --loss: #c43d52;
  --loss-soft: #fde8eb;
  --lilac: var(--secondary);
  --lilac-soft: var(--secondary-soft);
  /* "In collection" status */
  --owned: #1f6a92;
  --owned-soft: #dcedf9;
  /* G1 / G2 / G3 badges, dark to light blue */
  --g1: #1d5c7c;
  --g1-soft: #dcedf9;
  --g2: #2b7ba4;
  --g2-soft: #e0eff9;
  --g3: #3f88b3;
  --g3-soft: #e7f2fa;
  /* Lists of cards sit in a tinted well so each card stands out */
  --well: #eaf3fb;
  --card: #ffffff;
  --card-shadow: 0 1px 2px rgba(20, 60, 95, 0.06), 0 4px 14px rgba(20, 60, 95, 0.05);
  --card-shadow-hover: 0 2px 4px rgba(20, 60, 95, 0.07), 0 14px 32px rgba(20, 60, 95, 0.12);
  /* Header bar */
  --bar: #1d5c7c;
  --bar-text: #ffffff;
  --bar-muted: rgba(255, 255, 255, 0.75);
  --bar-line: rgba(255, 255, 255, 0.3);
  --bar-hover: rgba(255, 255, 255, 0.12);

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 60, 95, 0.06);
  --shadow: 0 1px 2px rgba(20, 60, 95, 0.05), 0 8px 28px rgba(20, 60, 95, 0.07);
  --shadow-lg: 0 24px 64px rgba(15, 40, 65, 0.25);
  --ring: 0 0 0 3px rgba(43, 123, 164, 0.25);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b1622;
    --surface: #112131;
    --surface-2: #172b3e;
    --text: #e5eff7;
    --muted: #93abbf;
    --border: #20364b;
    --border-strong: #2e4b66;

    --accent: #7fbde6;
    --accent-hover: #a6d1ee;
    --accent-soft: rgba(127, 189, 230, 0.15);
    --on-accent: #06233a;
    --secondary: #9ccbea;
    --secondary-soft: rgba(156, 203, 234, 0.15);

    --amber: #f3b54f;
    --amber-soft: rgba(243, 181, 79, 0.1);
    --amber-line: #d9952a;
    --ready: #c9a86a;
    --ready-text: #e3c78f;
    --ready-soft: rgba(201, 168, 106, 0.08);
    --ready-tile: rgba(201, 168, 106, 0.13);
    --ready-border: rgba(201, 168, 106, 0.32);
    --ready-chip: rgba(201, 168, 106, 0.2);
    --ready-count: rgba(201, 168, 106, 0.34);
    --on-ready: #ecd3a0;
    --gain: #4ade80;
    --gain-soft: rgba(74, 222, 128, 0.13);
    --loss: #fb7185;
    --loss-soft: rgba(251, 113, 133, 0.14);
    --owned: #a6d1ee;
    --owned-soft: rgba(127, 189, 230, 0.15);
    --g1: #7fbde6;
    --g1-soft: rgba(127, 189, 230, 0.18);
    --g2: #9ccbea;
    --g2-soft: rgba(156, 203, 234, 0.18);
    --g3: #c4e1f4;
    --g3-soft: rgba(196, 225, 244, 0.14);
    --well: #08111b;
    --card: #122436;
    --card-shadow: 0 0 0 1px #20364b;
    --card-shadow-hover: 0 0 0 1px #3a5f80, 0 12px 30px rgba(0, 0, 0, 0.5);
    --bar: #071521;
    --bar-line: rgba(255, 255, 255, 0.16);
    --bar-hover: rgba(255, 255, 255, 0.08);

    --shadow-sm: none;
    --shadow: 0 0 0 1px var(--border);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
    --ring: 0 0 0 3px rgba(127, 189, 230, 0.35);
  }
}

/* ---------- Base ---------- */

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 0.9rem;
  height: 40px; padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-sm { height: 34px; padding: 0 10px; font-size: 0.85rem; gap: 6px; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover { background: var(--accent); color: var(--on-accent); }
/* Actions on a doll card: outlined, so they don't look like the status labels */
.btn-outline { background: transparent; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong)); }
.btn-outline:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-danger { background: var(--loss); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-danger-text { color: var(--loss); border-color: transparent; padding: 0 8px; }
.btn-danger-text:hover { background: var(--loss-soft); }
.btn:disabled { opacity: 0.55; cursor: wait; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--loss-soft); color: var(--loss); }

.link-btn {
  font: inherit; font-size: 0.85rem; font-weight: 600;
  background: none; border: none; padding: 0; cursor: pointer; color: var(--accent);
}
.link-btn:hover { text-decoration: underline; }

/* ---------- App bar ---------- */

.appbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--bar); color: var(--bar-text);
  box-shadow: 0 1px 0 var(--bar-line), 0 6px 20px rgba(15, 40, 65, 0.18);
}
.appbar .brand { color: var(--bar-text); }
.appbar .btn-ghost { color: var(--bar-text); border-color: var(--bar-line); background: transparent; }
.appbar .btn-ghost:hover { background: var(--bar-hover); }
.appbar .avatar { background: var(--accent); color: #fff; }
.appbar :focus-visible { box-shadow: 0 0 0 3px rgba(156, 203, 234, 0.6); }
.appbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em;
}
.logo {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #9ccbea, #348ab4);
  box-shadow: 0 4px 12px rgba(15, 50, 80, 0.35);
}
.logo svg { width: 20px; height: 20px; fill: #fff; }

.account { display: flex; align-items: center; gap: 10px; }
.avatar {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 0.85rem;
}
.username { font-size: 0.9rem; font-weight: 500; }

/* ---------- Page head + stats ---------- */

main.container { padding-top: 32px; padding-bottom: 64px; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-head .muted { margin-top: 4px; }

.stats {
  display: grid; grid-template-columns: repeat(var(--stat-count, 4), 1fr); gap: 16px;
  margin-bottom: 24px;
}
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--card-shadow);
  display: flex; align-items: center; gap: 14px; min-width: 0;
}
.stat-icon {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
}
.stat-icon .icon { width: 22px; height: 22px; }
.stat-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.stat-money .stat-icon { background: var(--secondary-soft); color: var(--secondary); }
.stat-label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.stat-value { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 0.82rem; color: var(--muted); }
.stat.ready { background: var(--ready-soft); border-color: var(--ready-border); }
.stat.ready .stat-icon { background: var(--ready-chip); color: var(--ready-text); }
.stat.gain .stat-icon { background: var(--gain-soft); color: var(--gain); }
.stat.loss .stat-icon { background: var(--loss-soft); color: var(--loss); }
.stat.ready .stat-value { color: var(--ready-text); }
.stat.gain .stat-value { color: var(--gain); }
.stat.loss .stat-value { color: var(--loss); }

/* ---------- Panel, toolbar, tabs ---------- */

.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}

.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}

.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px; }
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--muted);
  height: 34px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer;
  white-space: nowrap; transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--text); border-color: var(--border-strong); }
.tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tab[aria-selected="true"] .count { background: color-mix(in srgb, var(--on-accent) 22%, transparent); color: var(--on-accent); }
.tab .count {
  min-width: 20px; padding: 0 6px; border-radius: 999px; font-size: 0.75rem; line-height: 18px;
  background: var(--surface-2); color: var(--muted); text-align: center;
}
.tab .count.attention { background: var(--ready-count); color: var(--on-ready); }

.search { position: relative; display: flex; align-items: center; flex: 0 1 260px; }
.search .icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; width: 16px; height: 16px; }
.search input { padding-left: 36px; height: 38px; border-radius: 999px; }

/* ---------- Inputs ---------- */

input {
  font: inherit; font-size: 0.92rem; color: var(--text);
  width: 100%; height: 42px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: var(--muted); opacity: 0.7; }
input:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border-strong)); }
input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input:disabled { opacity: 0.6; }

/* ---------- Doll cards ---------- */
/* One layout at every window size: name and details top left, the status /
   condition labels top right with Missing / Has underneath, the doll's
   details in a row that wraps as the window narrows, actions at the bottom. */

table.dolls, .dolls tbody { display: block; width: 100%; }
table.dolls[hidden] { display: none; }
/* Each doll is its own card: side by side on wide screens, one per row on
   phones. Cards in a row are the same height, with the buttons at the bottom. */
.dolls tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 14px; align-items: stretch; }
.dolls tr {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--card-shadow); transition: box-shadow 0.15s, border-color 0.15s;
}
.dolls tbody tr:hover { box-shadow: var(--card-shadow-hover); border-color: var(--border-strong); }
.dolls td { display: block; padding: 0; border: none; min-width: 0; white-space: normal; }
/* Each detail (purchased, paid, sold…) is a small tinted tile */
.dolls [data-label] {
  font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 9px 12px; border-radius: 12px; background: var(--surface-2);
}
.dolls [data-label]::before {
  content: attr(data-label); display: block;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted);
  margin-bottom: 3px;
}
.dolls .is-blank { display: none; }
/* The detail tiles: --details is how many there are. They share the row
   evenly, and wrap once each would be narrower than 108px. */
.dolls td.cell-details {
  display: grid; gap: 8px; align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(max(108px, calc((100% - (var(--details, 3) - 1) * 8px) / var(--details, 3))), 1fr));
}
/* Sold dolls: the result as a full-width bar under the details */
.dolls td.cell-profit { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dolls td.cell-profit::before { margin-bottom: 0; }
.dolls .num { font-variant-numeric: tabular-nums; }

/* Past the hold period and not sold yet */
.dolls tr.row-ready { background: var(--ready-soft); border-color: var(--ready-border); box-shadow: inset 4px 0 0 var(--ready), var(--card-shadow); }
.dolls tr.row-ready:hover { box-shadow: inset 4px 0 0 var(--ready), var(--card-shadow-hover); }
/* Sold dolls step back a little */
.dolls tr.row-sold { background: color-mix(in srgb, var(--well) 45%, var(--card)); }
.dolls tr.row-sold [data-label] { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.dolls tr.row-ready [data-label] { background: var(--ready-tile); }

/* Top of the card: the doll, then a divider before its details */
.dolls td.cell-doll {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px; row-gap: 4px; align-items: start; align-content: start;
  padding-bottom: 6px;
}
.dolls td.cell-doll .doll-name { grid-column: 1; grid-row: 1; align-self: center; }
.dolls td.cell-doll .doll-meta { grid-column: 1 / -1; grid-row: 2; margin-top: 0; }
.dolls td.cell-doll .doll-pills { grid-column: 2; grid-row: 1; margin-top: 0; justify-content: flex-end; }
.dolls td.cell-doll .pill { margin-top: 0; }
/* Has / Missing sit under the labels, on the right, across the card's width */
/* Missing / Has: two lists on the left, across the card's width */
.dolls td.cell-doll .doll-accessories { grid-column: 1 / -1; grid-row: 3; margin-top: 8px; }

.doll-name { font-size: 1.06rem; font-weight: 700; letter-spacing: -0.01em; min-width: 0; color: var(--text); }
.sub { display: block; font-size: 0.8rem; font-weight: 400; color: var(--muted); margin-top: 1px; }
.row-sold .doll-name { color: var(--muted); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 600; line-height: 1; padding: 4px 8px; border-radius: 999px; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-stock { background: var(--owned-soft); color: var(--owned); }
.pill-ready { background: var(--ready-chip); color: var(--on-ready); }
.pill-sold { background: var(--surface-2); color: var(--muted); }

.amount {
  display: inline-block; font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 3px 8px; border-radius: 8px;
}
.amount.gain { color: var(--gain); background: var(--gain-soft); }
.amount.loss { color: var(--loss); background: var(--loss-soft); }
.amount.even { color: var(--muted); background: var(--surface-2); }

/* Bottom of the card: a divider, then the buttons */
.dolls td.actions { margin-top: auto; padding-top: 6px; }
/* The button row spans the whole card: Mark sold stretches, the icons sit at the right end */
.actions-inner { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.actions-inner .btn { flex: 1; margin-right: 2px; }


/* ---------- Series groups ---------- */

/* The series sit in a tinted well, so the white doll cards stand out */
/* Series sit side by side; a series with several dolls takes the full width */
.groups {
  background: var(--well); padding: 6px 18px 20px; border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 4px 14px; align-items: stretch;
}
.groups:empty { display: none; }
/* Series side by side stretch to the same height, and so do their cards */
.series-group { min-width: 0; display: flex; flex-direction: column; }
.series-group > .table-wrap, .series-group table.dolls, .series-group .dolls tbody { flex: 1; }
.series-group > .table-wrap, .series-group table.dolls { display: flex; flex-direction: column; }
/* The open series' contents box (inside <details>) has to stretch too */
.series-group[open]::details-content { flex: 1; display: flex; flex-direction: column; }
.series-group:has(.dolls tr + tr), .series-group.is-alone { grid-column: 1 / -1; }
.group-head {
  display: flex; align-items: center; align-content: flex-start; gap: 10px; flex-wrap: wrap;
  padding: 14px 2px 10px; cursor: pointer; list-style: none; user-select: none;
}
.group-head::-webkit-details-marker { display: none; }
.group-head::before {
  content: ""; width: 7px; height: 7px; flex: none; align-self: center;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform 0.15s; margin-right: 2px;
}
.series-group[open] > .group-head::before { transform: rotate(45deg); }
.group-head:hover .group-title { color: var(--accent); }
.group-head::after { content: ""; flex: 1 1 40px; height: 1px; background: var(--border-strong); margin-left: 4px; }
.group-title { font-weight: 800; font-size: 1.3rem; letter-spacing: -0.02em; }
.group-meta { font-size: 0.8rem; color: var(--muted); font-weight: 500; }

/* G1 / G2 / G3 badge next to series names */
.gen-chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 7px;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; flex: none;
}
.gen-g1 { background: var(--g1); color: var(--card); }
.gen-g2 { background: var(--g2); color: var(--card); }
.gen-g3 { background: var(--g3); color: var(--card); }
.doll-meta { font-size: 0.78rem; color: var(--muted); margin-top: 2px; white-space: normal; }
a.icon-btn { text-decoration: none; }
.field .muted { font-weight: 500; margin-left: 4px; }

/* ---------- Catalogue search ---------- */

dialog.dialog-lg { width: min(780px, calc(100vw - 32px)); }
dialog.dialog-lg[open] { display: flex; flex-direction: column; max-height: min(88vh, 920px); }
.catalog-controls {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 24px 14px; border-bottom: 1px solid var(--border);
}
.catalog-search { flex: 1 1 300px; }
.catalog-search input { height: 44px; font-size: 0.95rem; }
.chips { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; }
.chip {
  font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--muted);
  height: 32px; padding: 0 12px; border: none; border-radius: 9px; background: transparent; cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.catalog-results { flex: 1; min-height: 260px; overflow-y: auto; padding: 0 24px 16px; }
.catalog-hint { text-align: center; padding: 48px 16px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.catalog-hint .muted { max-width: 30em; }
.result-group-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: baseline; gap: 8px;
  margin: 0; padding: 14px 0 8px; font-size: 0.95rem; background: var(--surface);
}
.result-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card); box-shadow: var(--card-shadow); }
.result { display: flex; align-items: center; gap: 8px; padding: 11px 10px 11px 16px; border-top: 1px solid var(--border); }
.result:first-child { border-top: none; }
.result:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.result-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.result-name { font-weight: 700; }
.result-meta { font-size: 0.8rem; color: var(--muted); }
.add-btn { min-width: 96px; }
.wiki-btn { text-decoration: none; padding: 0 10px; color: var(--muted); }
.wiki-btn:hover { color: var(--text); }
.wiki-btn .icon { width: 15px; height: 15px; }
.result-more { text-align: center; margin: 14px 0 0; font-size: 0.85rem; }
.catalog-foot { border-top: 1px solid var(--border); justify-content: space-between; flex-wrap: wrap; padding-top: 14px; }
.credit { font-size: 0.78rem; color: var(--muted); margin: 0; }
.credit a { color: inherit; }

/* ---------- My collection / All series switch ---------- */

/* Top of the page: the two views on the left, the add search on the right */
.top-row { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 20px; }
/* The tabs reach three quarters of the way across the second stat card:
   one card (a third of the row, less gaps), a gap, then 3/4 of a card. */
.top-row .view-switch { display: flex; flex: 0 1 calc((100% - 32px) / 3 * 1.75 + 16px); }
.top-row .view-tab { flex: 1; min-width: 0; }
.add-search { flex: 0 1 300px; margin-left: auto; }
.add-search .icon { left: 16px; width: 18px; height: 18px; color: var(--accent); }
.add-search input {
  height: 52px; padding-left: 44px; border-radius: 999px; font-size: 0.98rem;
  background: var(--surface); border-color: var(--border-strong); box-shadow: var(--card-shadow); cursor: pointer;
}
.add-search input::placeholder { color: var(--muted); opacity: 1; }
.view-switch {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm);
}
.view-tab {
  font: inherit; font-size: 1rem; font-weight: 600; color: var(--muted);
  height: 44px; padding: 0 18px; min-width: 230px; border: none; border-radius: 10px; background: transparent; cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.view-tab:hover { color: var(--text); }
.view-tab[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }

/* ---------- All series ---------- */

/* G1 / G2 / G3 tabs at the top of All series */
.gen-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--border); }
.gen-tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 8px 12px; border: none; background: transparent; cursor: pointer;
  font: inherit; color: var(--muted); box-shadow: inset 0 -3px 0 transparent;
  transition: color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.gen-tab + .gen-tab { border-left: 1px solid var(--border); }
.gen-tab:hover { color: var(--text); background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.gen-tab-name { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; }
.gen-tab-meta { font-size: 0.78rem; font-weight: 500; min-height: 1.2em; }
.gen-tab[aria-selected="true"] { color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); background: var(--accent-soft); }

.series-toolbar { justify-content: flex-start; }
.series-toolbar .search { margin-left: auto; }
.series-summary { margin: 0; padding: 12px 20px; font-size: 0.88rem; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--border); }
/* Series are cards in a tinted well, like the dolls in My collection */
#series-list { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 18px; background: var(--well); }
.series-row {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--card-shadow); transition: box-shadow 0.15s, border-color 0.15s; overflow: hidden;
}
.series-row:hover { box-shadow: var(--card-shadow-hover); border-color: var(--border-strong); }
.series-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  padding: 14px 18px; cursor: pointer; list-style: none; user-select: none;
}
.series-head::-webkit-details-marker { display: none; }
.series-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.series-title::before {
  content: ""; width: 7px; height: 7px; flex: none; align-self: center;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform 0.15s;
}
.series-row[open] .series-title::before { transform: rotate(45deg); }
.series-name { font-size: 1.22rem; font-weight: 800; letter-spacing: -0.015em; }
.series-head:hover .series-name { color: var(--accent); }
.series-progress { display: flex; align-items: center; gap: 10px; flex: none; }
.progress-count { font-size: 0.85rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }
.progress { width: 110px; height: 8px; border-radius: 999px; background: var(--well); overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.progress-bar { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.series-dolls { padding: 14px 18px 18px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--well) 50%, var(--card)); }
.series-loading { padding: 8px 0; }

/* Series you've started, and completed series */
.series-started { box-shadow: inset 4px 0 0 var(--accent), var(--card-shadow); }
.series-started:hover { box-shadow: inset 4px 0 0 var(--accent), var(--card-shadow-hover); }
.series-started .progress-count { color: var(--accent); }
.series-complete { background: color-mix(in srgb, var(--gain-soft) 80%, var(--card)); border-color: color-mix(in srgb, var(--gain) 35%, transparent); box-shadow: inset 4px 0 0 var(--gain), var(--card-shadow); }
.series-complete:hover { box-shadow: inset 4px 0 0 var(--gain), var(--card-shadow-hover); }
.series-complete .progress-count { color: var(--gain); }
.series-complete .progress-bar { background: var(--gain); }
.pill-complete { background: var(--gain); color: var(--card); }
.pill-complete::before { background: var(--card); }
.series-credit { padding: 14px 20px 18px; }

/* Dolls you already have, in the search and the series list */
.result.owned { background: var(--owned-soft); box-shadow: inset 4px 0 0 var(--owned); }
.result.owned:hover { background: var(--owned-soft); }
.result.owned .result-name::after {
  content: "In your collection"; margin-left: 8px; padding: 2px 7px; border-radius: 999px; vertical-align: 1px;
  font-size: 0.7rem; font-weight: 700; background: var(--owned); color: var(--card);
}

/* ---------- Collection settings ---------- */

.settings-btn { flex: none; }
/* Phones: the header Settings button is just its icon */
@media (max-width: 720px) {
  .settings-btn { padding: 0 9px; }
  .settings-btn span { display: none; }
}
.setting-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.setting, .setting-main { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.setting { padding: 14px 16px; border-top: 1px solid var(--border); }
.setting:first-child { border-top: none; }
.setting-hold { flex-direction: column; align-items: stretch; gap: 10px; cursor: default; }
.setting-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.setting-text strong { font-size: 0.95rem; }
.setting-text span { font-size: 0.82rem; color: var(--muted); }
.setting-text .setting-needs { color: var(--amber); font-weight: 600; }
.hold-period { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.hold-period input { width: 84px; height: 38px; }
.hold-period select {
  font: inherit; font-size: 0.92rem; height: 38px; padding: 0 10px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.hold-period.is-off { opacity: 0.45; }

/* On/off switch built from a checkbox */
.switch {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 44px; height: 26px; padding: 0; margin: 0; border: none; border-radius: 999px;
  background: var(--border-strong); position: relative; cursor: pointer; transition: background-color 0.15s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.15s;
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }
.switch:disabled { opacity: 0.4; cursor: not-allowed; }
.switch:focus-visible { box-shadow: var(--ring); }

/* ---------- Condition: NIB / OOB, complete, accessories ---------- */

.condition-fields { margin: 0; padding: 12px 16px 16px; border: 1px dashed var(--border-strong); border-radius: 12px; display: flex; flex-direction: column; gap: 12px; }
.condition-fields legend { padding: 0 6px; font-size: 0.82rem; font-weight: 600; }
.condition-fields legend .muted { font-weight: 500; margin-left: 4px; }
.field-label { font-size: 0.82rem; font-weight: 600; }
.oob-fields, .accessory-fields { display: flex; flex-direction: column; gap: 10px; }

.segmented { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; }
.segmented label { flex: 1; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.segmented label span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 38px; padding: 4px 8px; border-radius: 9px;
  font-size: 0.88rem; font-weight: 600; color: var(--muted); text-align: center; transition: background-color 0.15s, color 0.15s;
}
.segmented label span small { font-size: 0.72rem; font-weight: 500; }
.segmented label:hover span { color: var(--text); }
.segmented input:checked + span { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.segmented input:focus-visible + span { box-shadow: var(--ring); }

.contents-hint { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 0.8rem; color: var(--muted); }
.accessory-list { display: flex; flex-direction: column; gap: 6px; }

/* Suggested checklist from the wiki: ticked = have, unticked = missing */
.checklist { display: flex; flex-direction: column; gap: 10px; }
.checklist-head { margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: 0.8rem; }
.checklist-groups { display: flex; flex-direction: column; gap: 10px; }
.check-group { display: flex; flex-direction: column; gap: 6px; }
.check-group-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.check-items { display: flex; flex-wrap: wrap; gap: 6px; }
/* Unmarked items are neutral; marked ones turn green (have) or red (missing). */
.check-item { display: inline-flex; align-items: center; gap: 2px; padding: 3px 3px 3px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 500; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.check-name { margin-right: 4px; }
.check-btn { width: 28px; height: 28px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer; display: grid; place-items: center; }
.check-btn:hover { background: var(--surface-2); color: var(--text); }
.check-btn.check-have[aria-pressed="true"] { background: var(--gain); color: var(--surface); }
.check-btn.check-missing[aria-pressed="true"] { background: var(--loss); color: var(--surface); }
.check-item[data-state="have"] { background: var(--gain-soft); color: var(--gain); border-color: transparent; }
.check-item[data-state="missing"] { background: var(--loss-soft); color: var(--loss); border-color: transparent; }
.check-item[data-state="missing"] .check-name { text-decoration: line-through; text-decoration-thickness: 1px; }
.tag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list:empty { display: none; }
.tag { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 500; }
.tag-have { background: var(--gain-soft); color: var(--gain); }
.tag-missing { background: var(--loss-soft); color: var(--loss); }
.tag-btn {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border: none; border-radius: 50%;
  background: transparent; color: inherit; font: inherit; font-size: 0.9rem; line-height: 1; cursor: pointer; opacity: 0.7;
}
.tag-btn:hover { opacity: 1; background: color-mix(in srgb, currentColor 14%, transparent); }
.accessory-list input { height: 38px; }

/* What an incomplete doll has and is missing, under its name in the list */
.doll-accessories {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 16px;
  margin-top: 8px; white-space: normal;
}
.acc-group { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.acc-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.acc-count { min-width: 18px; padding: 0 6px; border-radius: 999px; font-size: 0.7rem; line-height: 17px; text-align: center; letter-spacing: 0; }
.acc-missing .acc-label { color: var(--loss); }
.acc-missing .acc-count { background: var(--loss-soft); }
.acc-have .acc-label { color: var(--gain); }
.acc-have .acc-count { background: var(--gain-soft); }
.acc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.acc-list li { position: relative; padding-left: 20px; font-size: 0.82rem; font-weight: 500; line-height: 1.35; color: var(--text); }
.acc-list li::before {
  position: absolute; left: 0; top: 0.1em; display: grid; place-items: center; width: 14px; height: 14px;
  border-radius: 50%; font-size: 0.6rem; font-weight: 800; line-height: 1;
}
.acc-missing li::before { content: "✕"; background: var(--loss-soft); color: var(--loss); }
.acc-have li::before { content: "✓"; background: var(--gain-soft); color: var(--gain); }
.tag-sm { padding: 1px 8px; font-size: 0.75rem; }

/* Condition label next to the status in the list */
.doll-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.doll-pills .pill { margin-top: 0; }
.cond::before { display: none; }
.cond-nib { background: var(--gain-soft); color: var(--gain); }
.cond-oob { background: var(--surface-2); color: var(--muted); }
.cond-complete { background: var(--gain-soft); color: var(--gain); }
.cond-incomplete { background: var(--loss-soft); color: var(--loss); }

/* ---------- Empty state ---------- */

.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 56px 24px; text-align: center; }
.empty[hidden] { display: none; }
.empty-icon {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; margin-bottom: 8px;
  background: var(--accent-soft);
}
.empty-icon svg { width: 28px; height: 28px; fill: var(--accent); }
.empty-title { font-weight: 600; font-size: 1.05rem; }
.empty .btn { margin-top: 12px; }

/* ---------- Dialogs ---------- */

dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0; border: 1px solid var(--border); border-radius: 18px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.dialog-sm { width: min(400px, calc(100vw - 32px)); }
dialog[open] { animation: pop 0.18s ease-out; }
dialog::backdrop { background: rgba(14, 10, 24, 0.45); backdrop-filter: blur(3px); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

.dialog-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 20px 20px 4px 24px;
}
.dialog-head .muted { font-size: 0.88rem; margin-top: 2px; }
.dialog-body { padding: 16px 24px 8px; display: flex; flex-direction: column; gap: 16px; }
.dialog-body h2 + .muted { margin-top: -8px; }
.dialog-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px 24px 20px;
}
.dialog-foot .spacer { flex: 1; }

.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.field > span { font-size: 0.82rem; font-weight: 600; }
.field-row { display: flex; gap: 12px; }

.sale-fields {
  margin: 0; padding: 12px 16px 16px; border: 1px dashed var(--border-strong); border-radius: 12px;
}
.sale-fields legend { padding: 0 6px; font-size: 0.82rem; font-weight: 600; }
.sale-fields legend .muted { font-weight: 500; margin-left: 4px; }

.form-error { color: var(--loss); font-size: 0.88rem; }
.form-error:empty { display: none; }

.profit-preview {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 0.9rem;
}
.profit-preview[hidden] { display: none; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 12px; font-size: 0.9rem; font-weight: 500; box-shadow: var(--shadow-lg);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Sign-in page ---------- */

.auth-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(600px 400px at 15% 10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(500px 400px at 90% 90%, color-mix(in srgb, var(--secondary) 18%, transparent), transparent 70%),
    var(--bg);
}
.auth-card {
  width: min(400px, 100%);
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 32px 28px 24px; box-shadow: var(--shadow-lg);
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 24px; text-align: center; }
.auth-brand .logo { width: 48px; height: 48px; border-radius: 14px; }
.auth-brand .logo svg { width: 28px; height: 28px; }
.auth-brand p { font-size: 0.92rem; margin-top: -6px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .btn { height: 44px; margin-top: 4px; }
.hint { font-size: 0.8rem; color: var(--muted); margin-top: -8px; }
.hint[hidden] { display: none; }
.auth-switch { margin-top: 18px; text-align: center; color: var(--muted); font-size: 0.9rem; }

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

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .top-row .view-switch { flex: 1 1 auto; }
}

@media (max-width: 860px) {
  .toolbar { padding: 12px; }
  .tabs { width: 100%; }
  .search { flex: 1 1 100%; }

  .groups { padding: 4px 10px 14px; }
  #series-list { padding: 10px 10px 14px; }
  .group-head { padding: 12px 2px 8px; }
  .group-title { font-size: 1.2rem; }
  .dolls tr { padding: 14px; }
}

@media (max-width: 720px) {
  .container { padding: 0 16px; }
  main.container { padding-top: 20px; }
  h1 { font-size: 1.4rem; }
  .username { display: none; }
  .page-head { align-items: center; margin-bottom: 16px; }
  .page-head .muted { display: none; }
  .stats { gap: 10px; margin-bottom: 16px; }
  .stat { padding: 12px 14px; }
  .stat-icon { display: none; }
  .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .stat-value { font-size: 1.35rem; }
  .field-row { flex-direction: column; }
  .top-row { flex-direction: column; align-items: stretch; }
  .view-switch { display: flex; }
  .view-tab { flex: 1; min-width: 0; }
  .add-search { flex: none; max-width: none; margin-left: 0; }
  .add-search input { height: 48px; }
  .series-toolbar .search { margin-left: 0; }
  .series-head { padding: 12px 16px; }
  .series-progress { width: 100%; justify-content: flex-start; padding-left: 17px; }
  .series-dolls { padding: 0 12px 14px; }
  .catalog-controls, .catalog-results { padding-left: 16px; padding-right: 16px; }
  /* Doll rows in search and All series: name on top, buttons on their own line */
  .result { flex-wrap: wrap; row-gap: 8px; }
  .result-text { flex: 1 1 100%; }
  .result-text + * { margin-left: auto; }
  .chips { width: 100%; }
  .chip { flex: 1; }
}

/* What you paid for accessories bought after the doll */
.purchases { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 1px dashed var(--border-strong); }
.purchases-head { display: flex; flex-direction: column; gap: 2px; font-size: 0.8rem; }
.purchase-section { display: flex; flex-direction: column; gap: 6px; }
.purchase-section-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.purchase-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.purchase-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.purchase-row.is-with-doll { background: var(--surface-2); }
.purchase-row.is-with-doll .purchase-items { color: var(--muted); }
.purchase-select { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.purchase-items { flex: 1 1 60px; min-width: 0; font-size: 0.88rem; font-weight: 600; overflow-wrap: anywhere; }
.purchase-items .sub { font-weight: 400; }
.purchase-controls { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.purchase-mode {
  font: inherit; font-size: 0.82rem; height: 34px; padding: 0 6px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.purchase-mode:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.purchase-price { width: 84px; height: 34px; font-size: 0.88rem; padding: 0 8px; }
.purchase-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.purchase-tools .btn:disabled { opacity: 0.55; cursor: default; }
.purchase-date { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 600; margin-left: auto; }
.purchase-date input { height: 34px; width: auto; }

/* Paid: the total, with a breakdown of the doll and accessories on hover */
.cost { display: inline-block; cursor: help; border-radius: 6px; outline: none; }
.cost-sum { text-decoration: underline dotted color-mix(in srgb, var(--muted) 70%, transparent); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.cost:focus-visible { box-shadow: var(--ring); }
.cost-tip {
  position: fixed; z-index: 50; width: max-content; max-width: min(340px, calc(100vw - 24px));
  padding: 12px 14px; border-radius: 12px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  font-size: 0.85rem; font-weight: 400; display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.cost-tip[hidden] { display: none; }
.cost-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.cost-line { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.cost-what { display: flex; flex-direction: column; gap: 1px; font-weight: 600; min-width: 0; }
.cost-detail { font-size: 0.78rem; font-weight: 400; color: var(--muted); }
.cost-amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cost-total { padding-top: 8px; border-top: 1px solid var(--border); }
.cost-total .cost-what, .cost-total .cost-amount { font-weight: 800; }
.purchase-note { flex-basis: 100%; margin: 0; font-size: 0.78rem; color: var(--amber); }
.purchase-row.has-note { border-color: color-mix(in srgb, var(--amber-line) 60%, transparent); background: color-mix(in srgb, var(--amber-soft) 60%, var(--surface)); }
.purchase-warning { margin: 0; padding: 8px 12px; border-radius: 10px; font-size: 0.82rem; color: var(--amber); background: var(--amber-soft); }

/* Inside a generation tab, each series' G1 / G2 / G3 badge would just repeat the tab */
#series-list .series-name ~ .gen-chip, #series-list .series-title .gen-chip { display: none; }

/* Items in All series: what a doll comes with, in the floating panel */
.items-btn { cursor: help; }
.tip-group { display: flex; flex-direction: column; gap: 5px; }
.tip-group-title { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.tip-items { display: flex; flex-wrap: wrap; gap: 4px; }
.tip-item { padding: 2px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 500; background: var(--accent-soft); color: var(--text); }
.tip-note { margin: 2px 0 0; font-size: 0.75rem; color: var(--muted); }
.items-btn.is-placeholder { visibility: hidden; }

/* Items with a description: the name, with what it looks like underneath */
.check-item.has-details { border-radius: 14px; align-items: center; }
.check-label { display: flex; flex-direction: column; gap: 1px; margin-right: 4px; padding: 3px 0; }
.check-label .check-name { margin-right: 0; }
.check-detail { font-size: 0.75rem; font-weight: 400; opacity: 0.8; }
.tip-item.has-details { display: flex; flex-direction: column; gap: 1px; flex-basis: 100%; border-radius: 10px; padding: 5px 10px; }
.tip-item.has-details strong { font-weight: 600; }
.tip-detail { font-size: 0.75rem; color: var(--muted); }

/* EN | PL language switch */
.lang-switch { display: inline-flex; padding: 2px; border-radius: 9px; border: 1px solid var(--border-strong); }
.lang-switch button {
  font: inherit; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 3px 8px; border: none; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.appbar .lang-switch { border-color: var(--bar-line); }
.appbar .lang-switch button { color: var(--bar-muted); }
.appbar .lang-switch button[aria-pressed="true"] { background: var(--bar-text); color: var(--bar); }
.landing-bar .lang-switch { border-color: var(--border-strong); }
.landing-bar .lang-switch button { color: var(--muted); }
.landing-bar .lang-switch button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.auth-card { position: relative; }
.auth-lang { position: absolute; top: 16px; right: 16px; }
