/* Riftbound's own look, over base.css (every page loads base.css first). The whole file is in
   the game layer, so its rules win over base.css whatever their specificity. */

@layer game {

/* ---------- Filters and the card popup: Riftbound's parts ---------- */

/* The domain chips sit in the filter row like a field, with the same hidden label. */
.dom-field { display: flex; align-items: center; gap: 8px; }
.dom-field .picks { gap: 0; }
.dom-field .picks button { padding: 6px 8px 8px; }
.rar.promo, .rar.special { color: var(--text); }
.soldbox {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px;
  margin: 10px 0 0; padding: 11px 14px; border-radius: var(--r);
  border: 1px dashed var(--line-2); font-size: 13px; color: var(--muted);
}
.soldbox b { font-size: 19px; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.soldbox .note { flex-basis: 100%; margin: 0; }

/* Riot's rarity gem before the rarity's name, like the domain runes. */
.rar-ic { width: 16px; height: 16px; flex: none; object-fit: contain; }
.chip.rar { display: inline-flex; align-items: center; gap: 5px; padding-left: 5px; border-color: currentColor; }

/* ---------- Market price: the median over every source, and each source's part ---------- */

.market-panel dd small { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.src-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.src-table th { padding-left: 2px; text-align: left; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.src-table td.p { font-weight: 700; }
.src-table td.st { width: 1%; text-align: right; white-space: nowrap; font-size: 13px; color: var(--muted); }
.member-offers td a { color: var(--text); }

/* ---------- Rolling Dice: a shop's price and stock per condition ---------- */

.rd-offers { width: 100%; border-collapse: collapse; background: var(--shelf); border-radius: var(--r); font-variant-numeric: tabular-nums; }
.rd-offers th { width: 1%; padding-left: 14px; text-align: left; font-size: 13px; font-weight: 700; white-space: nowrap; }
.rd-offers td.st { width: 1%; padding-right: 14px; text-align: right; white-space: nowrap; font-size: 13px; color: var(--muted); }
.rd-offers tr.out th, .rd-offers tr.out td { color: var(--faint); font-weight: 400; }
.rd-offers tr.out td.p { text-decoration: line-through; }
.rd-finish { margin: 12px 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.rd-finish:first-of-type { margin-top: 0; }
.rd-sec .links { margin-top: 10px; }

/* ---------- KREAM: sales members submit, an admin checks ---------- */

.kream-box a { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.kream-box a .i { width: 13px; height: 13px; }
.kream-box + .kream-box { margin-top: 8px; }
.kream-sec .links { margin-top: 10px; }

.kream-form { margin: 12px 0 0; padding: 14px; border-radius: var(--r); background: var(--shelf); display: grid; gap: 12px; }
.kream-form[data-open] { animation: kf-in .2s var(--ease-out); }
@keyframes kf-in { from { opacity: 0; transform: translateY(-4px); } }
.kf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kf { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.kf input {
  width: 100%; min-width: 0; font: inherit; font-size: 15px; color: var(--text);
  background: var(--felt); border: 1px solid var(--line-2); border-radius: var(--r); padding: 9px 11px;
}
.kf input:focus-visible { outline-offset: 1px; }
.kf input[aria-invalid="true"] { border-color: var(--up); }
.kf .money { position: relative; }
.kf .money input { padding-right: 34px; font-variant-numeric: tabular-nums; }
.kf .money i { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--faint); pointer-events: none; }
.kf-finish .seg { margin: 0; }
.kf-status { margin: 0; font-size: 13px; color: var(--muted); }
.kf-status[data-kind="error"] { color: var(--up); }
.kf-status[data-kind="done"] { color: var(--text); }
@media (max-width: 520px) { .kf-row { grid-template-columns: 1fr; } }

/* ---------- Listings ---------- */

.listings td:first-child { width: 56px; }
/* The report flag at the end of every listing row, and the reasons it opens under the row. */
.listings td.rp { width: 36px; padding-left: 0; text-align: right; }
.flag {
  display: inline-grid; place-items: center; width: 30px; height: 30px; cursor: pointer;
  background: none; border: 1px solid transparent; border-radius: var(--r); color: var(--faint);
  transition: transform .16s var(--ease-out), color .15s ease, border-color .15s ease;
}
.flag .i { width: 15px; height: 15px; }
.flag:active { transform: scale(.94); }
.flag[aria-expanded="true"] { color: var(--text); border-color: var(--line-2); }
.flag.on { color: var(--up); }
@media (hover: hover) and (pointer: fine) { .flag:hover { color: var(--text); border-color: var(--line-2); } }
tr.report-row td { padding: 0 0 12px; border-top: 0; }
.rp-panel { display: grid; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--shelf); animation: kf-in .2s var(--ease-out); }
.rp-panel p { margin: 0; font-size: 14px; }
.rp-panel form { display: grid; gap: 12px; }
.rp-panel fieldset { margin: 0; padding: 0; border: 0; }
.rp-panel legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.rp-reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.list td:first-child { white-space: nowrap; }
.tag {
  font-size: 11px; font-weight: 700; padding: 0 5px; border-radius: var(--r-art); margin-right: 5px; white-space: nowrap;
  border: 1px solid var(--line-2); color: var(--muted); vertical-align: 1px;
}
.tag.kr { border-color: var(--muted); color: var(--text); }

/* Rarity names in Riot's colours. */
.rar.common { color: var(--rar-common); }
.rar.uncommon { color: var(--rar-uncommon); }
.rar.rare { color: var(--rar-rare); }
.rar.epic { color: var(--rar-epic); }
.rar.showcase { color: var(--rar-showcase); }

/* ---------- Static pages (card, set, products, movers, docs) ---------- */

.crumbs { font-size: 13px; color: var(--faint); margin: 0 0 18px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.cardpage { max-width: 1120px; }
.cardpage h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.25; letter-spacing: -0.025em; }
.cardpage h2 { margin: 36px 0 12px; font-size: 18px; letter-spacing: -0.01em; }
.cardpage .detail h2 { font-size: 16px; margin: 26px 0 10px; }
.list th { text-align: left; font-size: 12.5px; color: var(--faint); font-weight: 500; border-bottom: 1px solid var(--line); }
.list th.p { text-align: right; }
.list td a { font-weight: 600; }
.rel { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; font-size: 14px; }
.rel a { display: block; padding: 5px 0; color: var(--muted); text-decoration: none; }
.rel a:hover { color: var(--text); text-decoration: underline; }
.cardnav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.cardnav a { text-decoration: none; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.cardnav .i { width: 15px; height: 15px; }
.cardnav a:hover { color: var(--text); text-decoration: underline; }
/* Sealed products: a grid of official photos, each with its price under it; a tile opens the product's popup. */
.cardpage .ptiles-h { margin: 56px 0 16px; font-size: 22px; letter-spacing: -0.02em; }
.finish-h { margin: 18px 0 8px; font-size: 14px; color: var(--muted); font-weight: 600; }
.finish-h:first-child, h2 + .finish-h { margin-top: 0; }
.ptiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 20px; }
.ptile { display: block; text-decoration: none; color: inherit; border-radius: var(--r-sleeve); transition: transform .16s var(--ease-out); }
.ptile:active { transform: scale(.98); }
.ptile:focus-visible { outline-offset: 4px; }
.ph { aspect-ratio: 4 / 3; border-radius: var(--r-sleeve); overflow: hidden; background: var(--shelf); }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease-out); }
.ph.empty { display: flex; align-items: center; justify-content: center; }
.ph.empty .i { width: 40px; height: 40px; color: var(--line-2); }
.pt-name { margin: 12px 0 2px; font-size: 15px; font-weight: 600; color: var(--muted); line-height: 1.35; }
.pt-price { display: flex; align-items: baseline; gap: 8px; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.pt-meta { margin-top: 3px; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) {
  .ptile:hover .ph img { transform: scale(1.03); }
  .ptile:hover .pt-name { color: var(--text); }
}

/* The detail: a popup with JavaScript, plain sections below the grid without it. */
.js .pdetails { display: none; }
section.product { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 8px); }
dialog section.product { margin: 0; padding: 0; border: 0; }
section.product .d-art .ph { border-radius: var(--r-sleeve); }
/* The photo keeps its own height, as the popup's art does (base.css, .detail .d-art img). */
section.product .d-art .ph img { height: auto; }
.cardpage section.product .detail h2, dialog section.product h2 { margin: 0; font-size: 26px; padding-right: 48px; }
section.product .alt-name { margin-bottom: 18px; }
section.product h3 { margin: 22px 0 4px; font-size: 14px; color: var(--muted); font-weight: 600; }
.more summary {
  cursor: pointer; padding: 10px 6px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line);
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.more summary::-webkit-details-marker { display: none; }
.more summary .i { width: 15px; height: 15px; color: var(--faint); transform: rotate(-90deg); transition: transform .2s var(--ease-out); }
.more[open] summary .i { transform: none; }
@media (hover: hover) and (pointer: fine) { .more summary:hover { color: var(--text); } }
.method { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); max-width: 80ch; }
.movers { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }

.doc { max-width: 760px; }
.doc h1 { margin: 8px 0 14px; font-size: 32px; letter-spacing: -0.025em; }
.doc h2 { margin: 40px 0 10px; font-size: 24px; letter-spacing: -0.02em; }
.doc h3 { margin: 28px 0 6px; font-size: 19px; }
.doc p, .doc li { color: var(--prose); }
.doc p { margin: 0 0 10px; }
.doc ul { padding-left: 20px; margin: 0 0 10px; }
.doc li { margin: 0 0 8px; }
.doc li::marker { color: var(--faint); }
.doc strong { color: var(--text); }
.doc code { font-size: 13px; background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-art); padding: 1px 5px; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0 8px; }

/* Guides: the list of guide pages, the FAQ, and the way back to the list. */
.doc .crumb { margin: 8px 0 0; font-size: 14px; }
.doc .crumb a { color: var(--muted); text-decoration: none; }
.doc .crumb a::before { content: "‹ "; }
.guides h1, .guides p, .faq h1, .faq p, .faq summary { word-break: keep-all; }
.guides .lede { font-size: 16px; margin-bottom: 28px; }
.guides .note a, .faq .note a { color: var(--text); }
.doc .glist { list-style: none; padding: 0; margin: 0 0 28px; border-top: 1px solid var(--line); }
.doc .glist li { margin: 0; border-bottom: 1px solid var(--line); }
.glist a {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center;
  padding: 18px 4px; text-decoration: none;
}
.glist .gt { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.glist .gd { grid-column: 1; font-size: 14px; color: var(--muted); }
.glist .i { grid-column: 2; grid-row: 1 / span 2; width: 18px; height: 18px; color: var(--faint); transition: transform .2s var(--ease-out), color .2s var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .glist a:hover .i { color: var(--text); transform: translateX(3px); }
  .doc .crumb a:hover { color: var(--text); }
}
.faq-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.faq-toc a {
  font-size: 14px; color: var(--muted); text-decoration: none; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px;
}
.faq section { scroll-margin-top: calc(var(--header-h) + 16px); }
.faq h2 { margin: 40px 0 6px; font-size: 20px; word-break: keep-all; }
.faq > .note { margin-top: 28px; }
.qa { border-bottom: 1px solid var(--line); }
.qa summary {
  cursor: pointer; list-style: none; display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 2px; font-size: 16px; font-weight: 600; color: var(--text);
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary .i { flex: none; width: 15px; height: 15px; margin-top: 4px; color: var(--faint); transform: rotate(-90deg); transition: transform .2s var(--ease-out); }
.qa[open] summary .i { transform: none; }
.qa p { margin: 0 0 16px 25px; max-width: 64ch; font-size: 15px; }
.qa p a { color: var(--text); }
@media (hover: hover) and (pointer: fine) {
  .faq-toc a:hover { color: var(--text); border-color: var(--line-2); }
  .qa summary:hover .i { color: var(--text); }
}

/* How it works: one card followed from listings to its price. */
.walk section { margin-top: 56px; }
.walk h1, .walk h2, .walk p, .walk .lt { word-break: keep-all; }
.walk h2 { margin: 0 0 16px; }
.walk .note { font-size: 14px; color: var(--muted); max-width: 64ch; margin: 12px 0 0; }
.walk .note a, .walk p a { color: var(--text); }
.walk-hero { display: grid; grid-template-columns: 1fr 168px; gap: 40px; align-items: center; }
.walk-hero .card::before { display: none; }
.walk-hero .lede { font-size: 17px; color: var(--prose); margin: 0; }
.walk-hero .card { pointer-events: auto; }

.funnel { display: grid; gap: 8px; }
.fbar {
  position: relative; display: flex; align-items: baseline; gap: 10px; padding: 9px 12px; font-size: 14px; color: var(--muted);
  min-width: 0; white-space: nowrap; isolation: isolate;
}
.fbar::before {
  content: ""; position: absolute; inset: 0 auto 0 0; z-index: -1; width: var(--w); min-width: 4px;
  background: var(--glass); border-radius: var(--r);
}
.fbar:first-child::before { background: var(--line-2); }
.fbar:last-child::before { background: var(--sticker); }
.fbar b { font-size: 19px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

.doc .lrows { list-style: none; margin: 0; padding: 0; }
.doc .lrow { margin: 0; color: var(--text); }
.lrow {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline;
  padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px;
}
.lrow:last-child { border-bottom: 1px solid var(--line); }
.lrow .lp { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.lrow .verdict { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.lrow .verdict .i { width: 14px; height: 14px; }
.lrow .verdict.ok .i { color: var(--ink); background: var(--sticker); border-radius: var(--r-art); padding: 1px; }
.lrow .verdict.no { color: var(--muted); }
.lrow mark { background: var(--sticker); color: var(--ink); border-radius: var(--r-art); padding: 0 3px; font-weight: 600; }
.lrow.miss .lt, .lrow.out .lt, .lrow.out .lp { color: var(--faint); }
.lrow.out .lt, .lrow.out .lp { text-decoration: line-through; text-decoration-color: var(--muted); }
.lrow.gone { background: var(--glass); padding-left: 8px; padding-right: 8px; border-radius: var(--r); }
.lrow.empty { display: block; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r); padding: 9px 8px; font-size: 13px; }

.plot { margin: 0; }
.dots { width: 100%; height: auto; display: block; overflow: visible; }
.dots .zone { fill: rgb(214 220 226 / .05); }
.dots .axis, .dots .tick { stroke: var(--line-2); stroke-width: 1; }
.dots .med { stroke: var(--sticker); stroke-width: 2; }
.dots .pts circle, .dots .troll circle { fill: var(--sticker); }
.dots .troll circle { fill: none; stroke: var(--sticker); stroke-width: 2; }
.dots text { font: 600 12px "Pretendard Variable", Pretendard, sans-serif; font-variant-numeric: tabular-nums; }
.dots .tl { fill: var(--faint); text-anchor: middle; font-weight: 400; }
.dots .zl { fill: var(--faint); }
.dots .ml { fill: var(--text); }
.plot figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 14px; }
.plot .btn[aria-pressed="true"] { background: var(--sticker); border-color: var(--sticker); color: var(--ink); }
.mm { display: flex; gap: 28px; margin: 0; }
.mm dt { font-size: 12.5px; color: var(--faint); }
.mm dd { margin: 0; font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.step-lead { margin: 28px 0 10px; color: var(--muted); font-size: 14px; }

.scans { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.scan h3 { margin: 0 0 8px; font-size: 14px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.scan .note { margin-top: 8px; font-size: 13px; }
.walk .soldbox { margin-top: 16px; }

.sealed-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sealed-strip img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-sleeve); }

/* ---------- Deck builder ---------- */
/* An app screen, not a showcase page: the verdict leads, the pool is the working
   surface, and a selection is marked by a 1px sticker-white line the width of its
   label (never a fill, so twenty filter chips stay quieter than the card art). */

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Riftbound's domain runes, in Riot's own colours. The domain is the one thing players
   read by colour, so these are data and keep their hue; everything round them stays grey. */
.dom { width: 15px; height: 15px; flex: none; vertical-align: -3px; }
.doms { display: inline-flex; align-items: center; gap: 3px; vertical-align: -3px; }
.chip.dom-chip { display: inline-flex; align-items: center; gap: 5px; padding-left: 5px; }

/* The builder is a working canvas: it uses the whole window, header included. */
.deckpage { max-width: none; padding-left: 28px; padding-right: 28px; }
.deck-page .site-head .bar { max-width: none; padding: 0 28px; }
.deckpage .title-row { flex-wrap: wrap; gap: 10px 20px; margin-bottom: 18px; }
.deckpage .title-row h1 { font-size: 22px; }
.title-acts { margin-left: auto; display: flex; gap: 6px; }

.picks { display: flex; flex-wrap: wrap; gap: 1px; }
.picks button {
  position: relative; display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 0; cursor: pointer;
  padding: 6px 9px 8px; font-size: 13px; font-weight: 500; color: var(--muted);
  transition: color .15s ease, transform .16s var(--ease-out);
}
.picks button::after {
  content: ""; position: absolute; left: 9px; right: 9px; bottom: 2px; height: 1px;
  background: var(--sticker); opacity: 0; transition: opacity .15s ease;
}
.picks button i { font-style: normal; margin-left: 5px; font-size: 11.5px; color: #70737a; font-variant-numeric: tabular-nums; }
.picks button[aria-pressed="true"] { color: var(--text); font-weight: 700; }
.picks button[aria-pressed="true"] i { color: var(--muted); }
.picks button[aria-pressed="true"]::after { opacity: 1; }
.picks button:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
  .picks button[aria-pressed="false"]:hover { color: var(--text); }
}

/* The lead: one panel split by hairlines, the verdict on the shop's paper sticker. */
.verdict {
  display: grid; grid-template-columns: minmax(0, 1.5fr) auto auto;
  margin: 0 0 24px; background: var(--shelf);
  border: 1px solid var(--line); border-radius: var(--r-sleeve); overflow: hidden;
}
.v-sticker {
  display: grid; grid-template-columns: minmax(150px, auto) minmax(0, 1fr); gap: 0 26px;
  background: var(--sticker); color: var(--ink); padding: 15px 20px 16px;
}
/* Before there is a deck there is no verdict, so no paper: a plain dark lead. */
.verdict.is-start { grid-template-columns: minmax(0, 1fr) auto; }
.v-start { padding: 15px 20px 16px; }
.v-start-word { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.v-start-how { margin: 3px 0 0; font-size: 13.5px; color: var(--muted); }
.v-fmt { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.v-word { margin: 1px 0 0; font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.is-illegal .v-word { color: var(--up-ink); }
.v-body { align-self: center; border-left: 1px solid var(--sticker-2); padding-left: 26px; }
/* What the verdict rests on, beside the verdict. */
.v-checks { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 14px; margin: 0; font-size: 13px; }
.v-checks dt { color: #6a6d72; }
.v-checks dd { margin: 0; color: var(--ink); font-weight: 600; }
.v-problems { list-style: none; margin: 0; padding: 0; }
.v-problems li { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.v-problems li::before { content: "— "; color: var(--muted-2); }
.v-problems .v-more { color: var(--muted-2); }

.v-counts { display: flex; margin: 0; }
.v-slot {
  display: flex; flex-direction: column; justify-content: center;
  padding: 15px 20px; border-left: 1px solid var(--line);
}
.v-slot dt { font-size: 12.5px; color: var(--muted); }
.v-slot dd { margin: 3px 0 0; font-size: 20px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.v-slot.is-done dd { color: var(--text); }
.v-of { font-size: .68em; font-weight: 500; color: var(--faint); }

.v-price { padding: 15px 20px; border-left: 1px solid var(--line); text-align: right; min-width: 176px; }
.v-won { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.v-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--faint); }
.v-pricedl { display: flex; justify-content: flex-end; gap: 10px; margin: 8px 0 0; font-size: 13px; }
.v-pricedl dt { color: var(--muted); }
.v-pricedl dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

/* The decklist's width is the reader's: drag the rule between the two columns. */
.deck-cols {
  display: grid; grid-template-columns: minmax(0, 1fr) 11px min(var(--rail, 376px), 66%);
  gap: 0 7px; align-items: start;
}
.rail-grip { align-self: stretch; position: relative; cursor: col-resize; touch-action: none; }
.rail-grip::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px;
  margin-left: -0.5px; background: var(--line); transition: background-color .15s ease, width .15s ease;
}
.rail-grip:hover::before, .rail-grip:focus-visible::before, .rail-grip.is-dragging::before {
  width: 2px; margin-left: -1px; background: var(--sticker);
}
.rail-grip:focus-visible { outline: none; }
body.rail-dragging { cursor: col-resize; user-select: none; }

/* The tabs and the search share one rail, with the rule running under both. */
.pool-top {
  display: flex; align-items: flex-end; gap: 10px 20px; flex-wrap: nowrap;
  margin: 0 0 16px; border-bottom: 1px solid var(--line);
}
/* nowrap, because a wrapping row breaks to a second line before it shrinks:
   the tabs keep their size and the search absorbs the squeeze. */
.pool-bar-wrap { position: relative; z-index: 30; margin-left: auto; padding-bottom: 7px; flex: 0 1 auto; min-width: 0; }
.pool-bar { display: flex; align-items: center; gap: 10px; margin: 0; }
.pool-bar .search { flex: 1 1 240px; min-width: 132px; }
.pool-bar .count { white-space: nowrap; }

/* A quiet size control: a 2px rule with a sticker-white handle. */
.size-range {
  appearance: none; -webkit-appearance: none;
  flex: none; width: 86px; height: 16px; background: none; cursor: pointer;
}
.size-range::-webkit-slider-runnable-track { height: 2px; border-radius: 1px; background: var(--line-2); }
.size-range::-moz-range-track { height: 2px; border-radius: 1px; background: var(--line-2); }
.size-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 11px; height: 11px; margin-top: -4.5px;
  border-radius: 50%; background: var(--sticker);
}
.size-range::-moz-range-thumb { width: 11px; height: 11px; border: 0; border-radius: 50%; background: var(--sticker); }
.size-range:focus-visible { outline: 2px solid var(--sticker); outline-offset: 3px; }
.d-head .size-range { width: 72px; }
/* The card-size slider says what it does: a zoom glass, then the slider. */
.zoom { display: inline-flex; align-items: center; gap: 6px; flex: none; color: var(--faint); cursor: pointer; }
.zoom .i { width: 15px; height: 15px; }
@media (hover: hover) and (pointer: fine) { .zoom:hover { color: var(--muted); } }
.pool-toggles { display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* The deck's sections are the pool's tabs; the count says how full each one is. */
.sections { display: flex; flex: 0 0 auto; flex-wrap: nowrap; gap: 2px; margin: 0; }
.sections button {
  position: relative; display: inline-flex; align-items: baseline; gap: 7px;
  background: none; border: 0; cursor: pointer; padding: 8px 10px 10px;
  font-size: 14px; font-weight: 600; color: var(--muted);
  transition: color .15s ease;
}
.sections button::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 1px;
  background: var(--sticker); opacity: 0; transition: opacity .15s ease;
}
.sections button[aria-selected="true"] { color: var(--text); }
.sections button[aria-selected="true"]::after { opacity: 1; }
.sections button:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) {
  .sections button[aria-selected="false"]:hover { color: var(--text); }
}
.s-n { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.s-n.is-done { color: var(--text); }

/* Pick a Legend before anything else: it sets the domains everything else obeys. */
.no-legend .sections, .no-legend .deckside { display: none; }
.no-legend .deck-cols { grid-template-columns: minmax(0, 1fr); }
.no-legend .rail-grip { display: none; }
.no-legend .deck-bar { display: none; }

/* Filters, grouped and counted, in a panel under the bar. */
/* The panel floats over the grid, so the cards stay in view while filtering. */
.filter-panel {
  position: absolute; top: 100%; right: 0; margin-top: 7px;
  /* Its container is only as wide as the search bar, so the width is set against the
     window instead; anchored right, it opens leftward over the grid. */
  width: 900px; max-width: calc(100vw - 56px); padding: 16px 18px 18px;
  background: var(--shelf); border: 1px solid var(--line-2); border-radius: var(--r-sleeve);
  box-shadow: 0 26px 54px -22px rgb(0 0 0 / .85); /* taste-skill-ignore: a popover floats */
}
.f-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 0 24px; }
.f-grid .f-group + .f-group { border-left: 1px solid var(--line); padding-left: 26px; }
.f-wide { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.f-group h3 { margin: 0 0 10px; font-size: 12px; font-weight: 700; color: var(--faint); }
.f-row { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 4px 10px; align-items: start; margin-bottom: 6px; }
.f-key { font-size: 12.5px; color: var(--muted); padding-top: 7px; }
.f-select {
  appearance: none; -webkit-appearance: none; font: inherit; font-size: 13px; color: var(--text);
  background: var(--felt); border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 7px 12px; cursor: pointer; max-width: 280px; justify-self: start;
}
.f-status { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; }
.f-status h3 { margin: 0; }
.tick {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); cursor: pointer;
  padding: 5px 8px; margin: -5px -8px; border-radius: var(--r); transition: background-color .15s ease;
}
/* Checked is the sticker white with a dark tick in it, never a blank white square. */
.tick input {
  appearance: none; width: 15px; height: 15px; margin: 0; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: var(--r-art); background: none;
  flex: none; transition: border-color .15s ease, background-color .15s ease;
}
.tick input:checked {
  background: var(--sticker) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.4l2.9 2.9 6-6.3' fill='none' stroke='%2318191b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat;
  border-color: var(--sticker);
}
.tick input:checked + span { color: var(--text); }
.tick input:focus-visible { outline: 2px solid var(--sticker); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .tick:hover { background: var(--glass); }
  .tick:hover span { color: var(--text); }
  .tick:hover input:not(:checked) { border-color: var(--muted); }
}

/* Filter chips are buttons: outlined at rest, lit on hover, sticker white when on. */
.f-chips { gap: 6px; }
.f-chips button {
  padding: 5px 10px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--felt); color: var(--text); font-weight: 500;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .16s var(--ease-out);
}
.f-chips button::after { display: none; }
.f-chips button i { margin-left: 2px; color: var(--faint); }
.f-chips button[aria-pressed="true"] { background: var(--sticker); border-color: var(--sticker); color: var(--ink); font-weight: 700; }
.f-chips button[aria-pressed="true"] i { color: var(--ink-2); }
.f-chips button:focus-visible { outline: 2px solid var(--sticker); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .f-chips button[aria-pressed="false"]:hover { background: var(--glass); border-color: var(--muted); }
  .f-chips button[aria-pressed="true"]:hover { background: var(--sticker-2); }
}

/* Drag and drop: the place a card would land is outlined in sticker white. */
/* The drag image is drawn here, off screen: browsers copy it when a drag starts. */
#drag-ghost { position: fixed; left: -1000px; top: 0; pointer-events: none; }
.d-side-drop { display: none; }
.card-dragging .d-side-drop { display: block; }
.d-drop-hint { margin: 6px 0 0; padding: 14px 10px; border: 1px dashed var(--line-2); border-radius: var(--r); font-size: 12.5px; color: var(--faint); text-align: center; }
.d-sec.is-drop, .deckside.is-drop, .pool-grid.is-drop { outline: 1px solid var(--sticker); outline-offset: 4px; border-radius: var(--r); }
.d-sec.is-drop .d-drop-hint { border-color: var(--sticker); color: var(--text); }

/* Hide banned: a toggle beside Filters, sticker white while on. */
.ban-btn { white-space: nowrap; }
.ban-btn[aria-pressed="true"] { background: var(--sticker); border-color: var(--sticker); color: var(--ink); font-weight: 700; }
/* The shared hover outline (base.css, .btn:hover) shows on the pressed button too: in the game layer this colour would otherwise win over it. */
@media (hover: hover) and (pointer: fine) { .ban-btn[aria-pressed="true"]:not(:disabled):hover { border-color: var(--muted); } }

/* The card image already carries the name, cost and might, so the tile is the card. */
/* Both grids take their card size from a slider, one per side. */
.pool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--pool-card, 172px), 1fr)); gap: 14px 12px; align-items: start; }
.p-card {
  position: relative; display: block; padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: var(--r); line-height: 0;
  transition: transform .16s var(--ease-out);
}
.p-card img { width: 100%; height: auto; border-radius: var(--r); }
/* Battlefields are cards printed sideways. Their grids take columns about 1.56 times
   wider, so a battlefield stands nearly as tall as a card and its text stays legible
   (1.95, the ratio squared, made them as tall as a card, which read as too big). */
.pool-grid.is-landscape { grid-template-columns: repeat(auto-fill, minmax(min(calc(var(--pool-card, 172px) * 1.56), 100%), 1fr)); }
.d-thumbs.is-landscape { grid-template-columns: repeat(auto-fill, minmax(min(calc(var(--thumb-card, 94px) * 1.56), 100%), 1fr)); }
.p-card:active { transform: scale(.97); }
.p-card.in-deck { outline: 2px solid var(--sticker); outline-offset: -2px; border-radius: var(--r); }
.p-card.is-out img { opacity: .38; }
.p-card.is-maxed img { opacity: .5; }
.p-out.p-max { background: var(--sticker-2); color: var(--ink-2); }
.p-card:focus-visible { outline: 2px solid var(--sticker); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .p-card:hover { transform: translateY(-3px); }
}
.p-out {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 4px 6px;
  background: var(--sticker); color: var(--up-ink); border-radius: 0 0 var(--r) var(--r);
  font-size: 11.5px; font-weight: 700; line-height: 1.3; text-align: center;
}
.p-n {
  position: absolute; top: 7px; right: 7px; z-index: 1;
  min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center;
  background: var(--sticker); color: var(--ink); border-radius: var(--r);
  font-size: 12.5px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
}
.pool-more { margin: 20px 0 0; }

.deckside {
  position: sticky; top: calc(var(--header-h) + 20px);
  background: var(--shelf); border: 1px solid var(--line); border-radius: var(--r-sleeve);
  padding: 6px 16px 16px; max-height: calc(100dvh - var(--header-h) - 40px); overflow-y: auto;
}
/* The decklist's own header: how to look at it, and a copy button for the text view. */
.deckside .d-head { display: flex; align-items: center; justify-content: flex-start; gap: 14px; padding: 4px 0 0; }
/* The size slider sits by the view switch: it sizes the Cards view. */
.d-copy, .deckside .d-head .zoom { margin-left: auto; }
.d-copy { display: inline-flex; gap: 6px; padding: 5px 10px; font-size: 12.5px; }
.d-copy .btn { padding: 5px 10px; font-size: 12.5px; }
.d-text-note { margin: 10px 0 0; font-size: 12px; }
.d-views button { padding: 5px 8px 7px; font-size: 12.5px; }

/* The Legend and the Chosen Champion hold their own places at the top. */
.d-reserved { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.d-slot {
  position: relative; display: grid; grid-template-rows: auto auto auto;
  padding: 8px; border-radius: var(--r); background: var(--glass); min-height: 96px;
}
.d-slot img { width: 100%; height: 86px; object-fit: cover; object-position: 50% 22%; border-radius: var(--r-art); margin-bottom: 7px; }
.d-slot-k { font-size: 11px; color: var(--faint); }
.d-slot-n { display: block; font-size: 13px; font-weight: 700; text-decoration: none; line-height: 1.3; }
.d-slot-n:hover { text-decoration: underline; }
.d-slot-d { margin-top: 3px; }
.d-slot.is-empty {
  align-content: center; justify-items: center; gap: 3px; text-align: center;
  background: none; border: 1px dashed var(--line-2);
}
.d-slot-e { font-size: 12px; color: var(--muted); }
.d-slot-in { display: block; margin-top: 3px; font-size: 11px; color: var(--faint); }
.d-slot-x { position: absolute; top: 6px; right: 6px; background: rgb(var(--scrim-rgb) / .82); border-color: var(--line-2); color: var(--text); }

/* Group and sort, under the view switch. */
.d-controls { display: flex; gap: 8px; margin-top: 10px; }
.d-ctl { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 6px; }
.d-ctl > span { flex: none; font-size: 11.5px; color: var(--faint); }
.d-ctl select {
  flex: 1 1 auto; min-width: 0; appearance: none; -webkit-appearance: none;
  font: inherit; font-size: 12.5px; color: var(--text);
  background: var(--felt); border: 1px solid var(--line); border-radius: var(--r-art);
  padding: 5px 8px; cursor: pointer;
}
.d-ctl select:focus-visible { outline: 2px solid var(--sticker); outline-offset: 1px; }

/* A group inside a zone: a quiet label, not a second heading. */
.d-grp {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin: 12px 0 2px; font-size: 12px; color: var(--muted);
}
.d-grp:first-child { margin-top: 6px; }

.d-sec { margin-top: 16px; }
.d-blank h3 { border-bottom: 1px dashed var(--line); padding-bottom: 7px; }

/* Visual mode: the deck as its cards, with the count under each. */
.d-thumbs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--thumb-card, 94px), 1fr)); gap: 10px 8px; }
.d-thumb { min-width: 0; }
.d-thumb-art {
  position: relative; display: block; width: 100%; padding: 0; border: 0; background: none;
  border-radius: var(--r); overflow: hidden; line-height: 0; cursor: pointer;
  transition: transform .16s var(--ease-out);
}
.d-thumb-art:active { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) { .d-thumb-art:hover { transform: translateY(-2px); } }
.d-thumb img { width: 100%; height: auto; }
.d-thumb.is-bad .d-thumb-art { outline: 2px solid var(--up); outline-offset: -2px; }
.d-thumb .d-qty { justify-content: center; margin-top: 4px; }
.d-chosen {
  position: absolute; left: 3px; bottom: 3px; padding: 1px 5px; border-radius: var(--r-art);
  background: var(--sticker); color: var(--ink); font-size: 10.5px; font-weight: 800; line-height: 1.5;
}
.d-row .d-chosen { position: static; margin-left: 5px; }

/* Text mode: a decklist to copy, in the shape this page's importer reads back. */
.d-text {
  margin: 12px 0 0; padding: 12px 13px; border-radius: var(--r);
  background: var(--felt); border: 1px solid var(--line);
  font: 12.5px/1.65 "Pretendard Variable", Pretendard, sans-serif;
  font-variant-numeric: tabular-nums; color: var(--text);
  white-space: pre-wrap; word-break: break-word; user-select: text;
}
.d-sec h3 {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--muted);
}
.d-n { font-size: 12.5px; font-weight: 500; color: var(--faint); font-variant-numeric: tabular-nums; }
.d-rows { list-style: none; margin: 0; padding: 0; }
.d-row {
  display: grid; grid-template-columns: 17px minmax(0, 1fr) auto auto; gap: 0 9px;
  align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13.5px;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .d-row:hover { background: var(--glass); } }
.d-e { font-size: 12.5px; font-weight: 700; color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; }
.d-id { min-width: 0; }
.d-name { display: block; font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-name:hover { text-decoration: underline; }
.d-code { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.d-code .dom { width: 12px; height: 12px; vertical-align: 0; }
.d-price { font-size: 13px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
/* The row's share of the deck's price, under what its copies cost. */
.d-price small { display: block; font-size: 11px; color: var(--faint); }
.d-nop { color: var(--faint); }
/* A cheaper printing of the same name: a quiet offer beside the code. */
.d-swap {
  margin-left: 2px; padding: 0 5px; font: inherit; font-size: 11px; line-height: 17px;
  color: var(--muted); background: none; border: 1px solid var(--line-2); border-radius: var(--r-art);
  cursor: pointer; transition: transform .16s var(--ease-out);
}
.d-swap:active { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) { .d-swap:hover { color: var(--text); border-color: var(--muted); } }
.d-swap:focus-visible { outline: 2px solid var(--sticker); outline-offset: 1px; }

/* The main deck's curve: copies per energy cost, on the sticker white. */
.d-curve { margin-top: 12px; }
.d-bars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; align-items: end; }
.d-bar { display: grid; justify-items: center; gap: 3px; }
.d-bar b { font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 14px; line-height: 14px; }
.d-bar i { display: block; width: 100%; height: calc(var(--h) * 48px + 2px); border-radius: 2px 2px 0 0; background: var(--sticker); }
.d-bar.is-zero i { background: var(--line-2); }
.d-bar span { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.d-mix { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 8px 0 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.d-doms { display: inline-flex; gap: 8px; margin-left: auto; }
.d-dom { display: inline-flex; align-items: center; gap: 3px; }
.d-dom .dom { width: 13px; height: 13px; }
.d-row.is-bad .d-name { color: var(--up); }
.d-qty { display: flex; align-items: center; gap: 1px; }
.d-qty b { min-width: 17px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.d-btn {
  display: grid; place-items: center; width: 24px; height: 24px; padding: 0; cursor: pointer;
  background: none; border: 1px solid var(--line-2); border-radius: var(--r-art); color: var(--muted);
  transition: color .15s ease, border-color .15s ease, transform .16s var(--ease-out);
}
.d-btn .i { width: 13px; height: 13px; }
.d-btn:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) {
  .d-btn:hover { color: var(--text); border-color: var(--text); }
}

.deck-method { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); max-width: 90ch; }

#importer { width: min(620px, calc(100vw - 48px)); }
#importer h2 { margin: 0 0 8px; font-size: 20px; padding-right: 54px; } /* clears the 38px close button at right:12px */
#importer textarea {
  width: 100%; margin-top: 10px; padding: 14px 16px; resize: vertical;
  font: 14px/1.6 "Pretendard Variable", Pretendard, sans-serif; font-variant-numeric: tabular-nums;
  color: var(--ink); caret-color: var(--ink);
  background: var(--sticker); border: 0; border-radius: var(--r);
}
#import-result h3 { margin: 18px 0 6px; font-size: 14px; color: var(--muted); }
#import-result ul { margin: 0; padding-left: 20px; font-size: 13px; color: var(--muted); }

.deck-bar { display: none; }

/* The pool's width is what is left of the decklist, which the reader can drag to
   760px, so its header wraps by the pool's own width, not the window's. */
.pool { container: pool / inline-size; min-width: 0; }
@container pool (max-width: 1200px) {
  .pool-top { flex-wrap: wrap; }
  .sections { flex: 1 1 100%; flex-wrap: wrap; }
  .pool-bar-wrap { flex: 1 1 100%; margin-left: 0; padding-bottom: 0; }
  .pool-bar { margin-top: 10px; }
}
@container pool (max-width: 620px) {
  .pool-bar { flex-wrap: wrap; }
  .pool-bar .search { flex: 1 1 100%; }
}

@media (max-width: 1100px) {
  .deck-cols { grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; }
  .verdict { grid-template-columns: minmax(0, 1fr) auto; }
  .v-price { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); text-align: left; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
  .v-pricedl, .v-price .v-sub { margin-top: 0; }
}

@media (max-width: 768px) {
  .deckpage .title-row h1 { font-size: 20px; }
  .v-sticker { grid-template-columns: 1fr; gap: 10px; }
  .v-body { border-left: 0; padding-left: 0; border-top: 1px solid var(--sticker-2); padding-top: 10px; }
  .title-acts { margin-left: 0; width: 100%; }
  .verdict, .verdict.is-start { grid-template-columns: 1fr; }
  .v-word { font-size: 24px; }
  .v-counts { border-top: 1px solid var(--line); }
  .v-slot { flex: 1 1 0; padding: 12px 14px; }
  .v-slot:first-child { border-left: 0; }
  .v-won { font-size: 22px; }
  .deck-cols { grid-template-columns: 1fr; }
  .rail-grip { display: none; }
  .deckpage { padding-left: 16px; padding-right: 16px; }
  .deck-page .site-head .bar { padding: 0 16px; }
  .pool-top { display: block; }
  .pool-bar-wrap { margin-left: 0; padding-bottom: 0; }
  .sections { padding-bottom: 2px; }
  .pool-bar { flex-wrap: wrap; margin: 10px 0 0; }
  .pool-bar .search { flex: 1 1 100%; }
  .filter-panel { right: auto; left: 0; width: auto; max-width: none; }
  .pool-grid { grid-template-columns: repeat(auto-fill, minmax(min(var(--pool-card, 150px), 44vw), 1fr)); gap: 12px 10px; }
  .f-grid { grid-template-columns: minmax(0, 1fr); }
  .f-grid .f-group + .f-group { border-left: 0; padding-left: 0; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
  .f-row { grid-template-columns: minmax(0, 1fr); }
  .f-key { padding-top: 0; }

  /* The deck folds into a sheet; a bar above the tabs opens it and carries the count. */
  .deckside {
    position: fixed; z-index: 40; inset: auto 0 0 0; max-height: 82dvh;
    border-radius: var(--r-sleeve) var(--r-sleeve) 0 0; border-bottom: 0;
    padding: 10px 16px calc(20px + var(--safe-b));
    transform: translateY(101%); transition: transform .32s var(--ease-drawer);
  }
  .deck-open .deckside { transform: none; }
  .d-thumbs { grid-template-columns: repeat(auto-fill, minmax(min(var(--thumb-card, 84px), 22vw), 1fr)); }
  /* The filter popover owns the screen while it is open. */
  .filters-open .deck-bar { display: none; }
  .deck-bar {
    display: block; position: fixed; z-index: 26;
    left: 12px; right: 12px; bottom: calc(68px + var(--safe-b));
    padding: 11px 14px; cursor: pointer;
    background: var(--sticker); color: var(--ink); border: 0; border-radius: var(--r);
    font-size: 14px; font-weight: 800;
    border-top: 1px solid var(--sticker-2);
  }
  .deck-open .deck-bar { bottom: auto; top: 12px; }
}

/* The footer's links to every set. */
.sets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 16px 0 18px; }
.sets > span { color: var(--muted); margin-right: 4px; }
.sets a { border: 1px solid var(--line-2); border-radius: var(--r); padding: 3px 9px; font-size: 13px; }
.sets a:hover { text-decoration: none; border-color: var(--muted); color: var(--text); }

/* ---------- Phone ---------- */

@media (max-width: 768px) {
  /* In the sheet the domain chips get the full width, with the label over them. */
  .dom-field { display: block; grid-column: 1 / -1; }
  .seller-field { grid-column: 1 / -1; }
  .cardpage h1, .doc h1 { font-size: 24px; }
  .walk section { margin-top: 44px; }
  .walk-hero { grid-template-columns: 1fr 112px; gap: 16px; }
  .walk-hero .tag-price { padding: 5px 6px 6px; margin: -18px 4px 0; }
  .walk-hero .tag-price .price { font-size: 15px; }
  .walk-hero .tag-price .nm { font-size: 12px; }
  .walk-hero .lede { font-size: 15px; }
  .scans { grid-template-columns: 1fr; }
  .walk-hero .tag-price .meta { font-size: 11px; white-space: nowrap; }
  /* The plot scales to half size on a phone: larger marks and only the labels that fit. */
  .dots text { font-size: 22px; }
  .dots .zl, .dots .tl[text-anchor="middle"] { display: none; }
  .dots circle { r: 10px; }
  .rel, .movers { grid-template-columns: 1fr; }
  .ptiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .pt-name { margin-top: 8px; font-size: 13.5px; }
  .pt-price { font-size: 18px; }
  .pt-meta { font-size: 12px; }
  dialog section.product .d-art { max-width: 100%; }
  .cardpage section.product .detail h2, dialog section.product h2 { font-size: 22px; }
  .listings td:first-child { width: 46px; }
}

/* ---------- Admin: the KREAM review queue ---------- */

.admin { max-width: 980px; margin: 0 auto; padding: 32px 24px 80px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin h1 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.admin-head .seg { margin: 0; }
.admin-head .seg b { margin-left: 4px; font-variant-numeric: tabular-nums; }
.admin .empty { margin-top: 24px; font-size: 15px; }
.sub {
  display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; align-items: start;
  padding: 16px; margin-top: 12px; border-radius: var(--r); background: var(--shelf);
}
.sub h2 { margin: 0; font-size: 17px; }
.sub h2 a { text-decoration: none; }
.sub p { margin: 6px 0 0; }
.sub-price { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.sub-price b { font-size: 22px; color: var(--text); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sub-price .btn { padding: 5px 10px; font-size: 13px; }
.sub .far { color: var(--up); font-weight: 700; }
.sub-note { font-size: 14px; }
.sub-actions { display: grid; gap: 8px; width: 210px; }
.sub-actions > * { min-width: 0; }
.sub-actions .reassign { display: grid; gap: 6px; margin-top: 6px; }
.sub-actions .btn { justify-content: center; }
.sub-actions .reason {
  font: inherit; font-size: 13px; color: var(--text); background: var(--felt);
  border: 1px solid var(--line-2); border-radius: var(--r); padding: 7px 9px; width: 100%;
}
.admin h2 { font-size: 18px; margin: 36px 0 4px; }
.admin .sub h2 { margin: 0; font-size: 16px; }
.admin .sub h2 a { overflow-wrap: anywhere; }
.admin-page .tabs .count { margin-left: 6px; font-variant-numeric: tabular-nums; }
.sub > img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--r-art); }
.sub.kream-sub > img { height: auto; object-fit: contain; }
.sub .ph-none { display: grid; place-items: center; width: 72px; height: 72px; border-radius: var(--r-art); background: var(--glass); color: var(--faint); }
.sub .tag { margin-right: 8px; }
/* Members: a dense table; a row opens the member in a dialog. */
.mem-tools { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin: 18px 0 8px; }
.mem-tools .note { white-space: nowrap; }
.mem-q, .mem-field {
  font: inherit; font-size: 14px; color: var(--text); background: var(--felt);
  border: 1px solid var(--line-2); border-radius: var(--r); padding: 7px 10px; min-width: 0;
}
.mem-q { width: min(340px, 100%); }
.mem-table th { text-align: left; font-size: 12.5px; color: var(--faint); font-weight: 500; padding-top: 4px; }
.mem-table th.p { text-align: right; }
.mem-table td { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mem-table td.p { font-weight: 400; }
.mem-table tbody tr { cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .mem-table tbody tr:hover td { background: var(--shelf); } }
.mem-open {
  font: inherit; font-weight: 700; color: var(--text); background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
}
.mem-sub { display: block; font-size: 12.5px; color: var(--faint); }
.mem-mail { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem-none { color: var(--faint); }
.mem-dlg { width: min(640px, calc(100vw - 48px)); }
.mem-dlg h2 { margin: 0; padding-right: 48px; font-size: 22px; letter-spacing: -0.02em; }
.mem-dlg h2 .tag { font-size: 12px; vertical-align: 3px; margin-left: 4px; }
.mem-meta, .mem-facts { margin: 6px 0 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.mem-facts { color: var(--text); font-variant-numeric: tabular-nums; }
.mem-facts a { font-weight: 600; white-space: nowrap; }
.mem-facts a .i { width: 13px; height: 13px; margin-left: 3px; vertical-align: -1px; color: var(--muted); }
.mem-standing { margin: 14px 0 0; padding: 10px 12px; border-radius: var(--r); background: var(--glass); font-size: 14px; }
.mem-act { margin-top: 22px; }
.mem-act h3 { margin: 0; font-size: 15px; }
.mem-act .note { margin: 2px 0 0; font-size: 13px; }
.mem-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.mem-row .mem-field[type="text"] { flex: 1 1 180px; }
.mem-note { display: block; width: 100%; margin-top: 10px; resize: vertical; }
.mem-list { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13.5px; }
.mem-list li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.mem-list li + li { border-top: 1px solid var(--line); }
.mem-list span { flex: none; color: var(--faint); font-variant-numeric: tabular-nums; }
.mem-danger h3 { color: var(--up); }
.btn.mem-delete:not(:disabled) { border-color: var(--up); color: var(--up); }
@media (max-width: 720px) {
  .mem-wide { display: none; }
  .mem-dlg { width: auto; }
}

@media (max-width: 720px) {
  .sub-actions:has([data-res]) { grid-template-columns: 1fr; }
  .sub .ph-none, .sub > img { width: 56px; height: 56px; }
  .sub.kream-sub > img { height: auto; }
  .sub { grid-template-columns: 56px 1fr; }
  .sub-actions { grid-column: 1 / -1; width: auto; grid-template-columns: 1fr 1fr; }
  /* Approve and reject side by side, the reason for rejecting under them. */
  .kream-sub .sub-actions [data-act="reject"] { grid-column: 2; grid-row: 1; }
  .kream-sub .sub-actions .reason { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- My activity ---------- */

.mine h2 { font-size: 18px; margin: 36px 0 4px; }
.mine .sub { grid-template-columns: 56px 1fr; }
.mine .sub > img { width: 56px; height: auto; object-fit: contain; }
.mine .sub h3 { margin: 0; font-size: 16px; }
.mine-who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 0; color: var(--muted); }
.mine-who b { color: var(--text); }
.mine-who .btn { padding: 5px 10px; font-size: 13px; }
.mine-standing { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--r); background: var(--glass); font-size: 14px; max-width: 70ch; }
.mine-delete { margin-top: 56px; }
.mine-delete h2 { color: var(--up); }
.mine-delete .note { max-width: 70ch; }
.tag.ok { border-color: var(--muted); color: var(--text); }
.tag.no { border-color: var(--up); color: var(--up); }

/* ---------- Saved decks: the bar over the builder, sharing, history ---------- */

.deck-notice {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 10px 14px; border-radius: var(--r); background: var(--shelf);
}
.deck-notice p { margin: 0 auto 0 0; font-size: 14px; }
.deck-meta { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin: 0 0 14px; }
.deck-name {
  font: inherit; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; color: var(--text);
  background: transparent; border: 1px solid transparent; border-radius: var(--r);
  padding: 5px 8px; margin-left: -9px; min-width: 0; width: min(420px, 100%);
  transition: border-color .15s ease, background-color .15s ease;
}
input.deck-name:hover { border-color: var(--line-2); }
input.deck-name:focus { background: var(--felt); border-color: var(--line-2); }
.deck-name.is-ro { margin: 0; padding: 5px 0; width: auto; }
.deck-name.is-new { color: var(--muted); }
.deck-status, .deck-by { font-size: 13px; color: var(--faint); }
.deck-status[data-state="offline"] { color: var(--up); }
.deck-status[data-state="refused"] { color: var(--up); }
.deck-by .i, .deck-likes .i { width: 13px; height: 13px; vertical-align: -2px; margin-right: 2px; }
.deck-likes { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meta-acts { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.deck-hint { flex-basis: 100%; margin: 0; }
#like[aria-pressed="true"] .i { color: var(--up); }

.deck-dlg { width: min(560px, calc(100vw - 48px)); }
.deck-dlg h2 { margin: 0 0 12px; font-size: 20px; padding-right: 54px; }
.deck-dlg .kf { margin-top: 12px; }
.deck-dlg textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--text); resize: vertical;
  background: var(--felt); border: 1px solid var(--line-2); border-radius: var(--r); padding: 9px 11px;
}
.share-vis { margin: 0; padding: 0; border: 0; display: grid; gap: 6px; }
.share-vis legend { padding: 0; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.share-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r); background: var(--shelf); cursor: pointer; }
.share-opt input { margin-top: 3px; accent-color: var(--sticker); }
.share-opt span { display: grid; gap: 2px; }
.share-opt small { color: var(--faint); font-size: 12.5px; }
.share-opt:has(input:checked) { outline: 1px solid var(--muted); }
.share-link { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.share-img { margin-top: 16px; }
.share-img-k { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.share-img-acts { display: flex; flex-wrap: wrap; gap: 8px; }

/* A sample opening hand: the cards large, the ones picked to mulligan lifted and marked. */
.hand-dlg { width: min(760px, calc(100vw - 48px)); }
.hand-cards { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 40vw), 1fr)); gap: 10px; }
.hand-card {
  display: block; width: 100%; padding: 0; border: 0; background: none; line-height: 0; cursor: pointer;
  border-radius: var(--r); overflow: hidden; transition: transform .18s var(--ease-out);
}
.hand-card img { width: 100%; height: auto; }
.hand-card:active:not(:disabled) { transform: scale(.97); }
.hand-card.is-picked { transform: translateY(-8px); outline: 2px solid var(--sticker); outline-offset: 2px; }
.hand-card.is-picked img { opacity: .6; }
.hand-card:disabled { cursor: default; }
.hand-card:focus-visible { outline: 2px solid var(--sticker); outline-offset: 2px; }
/* On a phone every dialog is a full-width sheet; the deck's dialogs set a width above, so say it again. */
@media (max-width: 760px) {
  .deck-dlg, .hand-dlg { width: 100%; }
  .hand-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.hand-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.hand-left { margin-left: auto; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .hand-card, .hand-card.is-picked { transform: none; } }
.share-link .kf { flex: 1; margin: 0; }
.share-link input { font-size: 13px; }
.versions-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; max-height: 60vh; overflow: auto; }
.versions-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: var(--r); background: var(--shelf); }
.versions-list li span { display: grid; gap: 2px; font-size: 14px; }
.versions-list small { color: var(--faint); }
@media (max-width: 720px) {
  .deck-name { font-size: 16px; }
  .meta-acts { margin-left: 0; }
}

/* ---------- The decks page ---------- */

.decks-page h2 { font-size: 18px; margin: 36px 0 6px; }
.decks-page .admin-head .btn { padding: 9px 14px; }
.deck-list { display: grid; gap: 10px; margin-top: 12px; }
.deck-row {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center;
  padding: 12px 16px 12px 12px; border-radius: var(--r); background: var(--shelf);
}
.deck-art { display: grid; place-items: center; width: 64px; aspect-ratio: 744 / 1039; border-radius: var(--r-art); overflow: hidden; background: var(--glass); color: var(--faint); }
.deck-art img { width: 100%; height: 100%; object-fit: cover; }
.deck-body { min-width: 0; }
.deck-body h3 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.deck-body h3 a { text-decoration: none; }
.deck-body h3 a:hover { text-decoration: underline; }
.deck-sub, .deck-facts { margin: 4px 0 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.deck-price { font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; }
.verdict-chip { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: var(--r-art); border: 1px solid var(--line-2); }
.verdict-chip.is-ok { background: var(--sticker); color: var(--ink); border-color: var(--sticker); }
.verdict-chip.is-no { color: var(--muted); }
.deck-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.deck-acts .btn { padding: 6px 11px; font-size: 13px; }
.deck-acts .is-danger { border-color: var(--up); color: var(--up); }
.btn.like[aria-pressed="true"] .i { color: var(--up); }
.deck-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.deck-filters .search { flex: 1 1 220px; max-width: 320px; }
@media (max-width: 720px) {
  .deck-row { grid-template-columns: 52px 1fr; gap: 12px; }
  .deck-art { width: 52px; }
  .deck-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .deck-filters > * { flex: 1 1 100%; max-width: none; }
  .deck-filters .field select, .deck-filters .search { width: 100%; max-width: none; }
}

/* The empty "My decks": what a deck gives you, and the way to start one. */
.deck-empty {
  display: flex; align-items: center; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap;
  margin-top: 12px; padding: 22px 24px; border-radius: var(--r); background: var(--shelf);
}
.deck-empty h3 { margin: 0 0 6px; font-size: 17px; }
.deck-empty p { margin: 0; max-width: 56ch; font-size: 14px; color: var(--muted); }
.deck-empty-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.deck-empty-acts .btn { padding: 10px 16px; }
.deck-says { grid-column: 2 / -1; margin: 0; font-size: 13px; color: var(--muted); }
.deck-says:empty { display: none; }
.deck-says a { color: var(--text); }
.deck-dlg .share-deckname { margin: 0 0 14px; }
.share-deckname input { font-weight: 700; }

/* ---------- the collection and the card scanner ---------- */

.colpage { max-width: 1400px; margin: 0 auto; padding: 24px 24px 48px; }
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin: 0 0 18px; }
.col-head h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.col-acts { display: flex; flex-wrap: wrap; gap: 6px; }

/* The value: one big price sticker, then the facts beside it on felt. */
.col-value { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px 24px; margin: 0 0 18px; }
.cv-sticker { background: var(--sticker); color: var(--ink); border-radius: var(--r); padding: 12px 18px 13px; min-width: 220px; }
.cv-k { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.cv-won { margin: 2px 0 0; font-size: 32px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cv-won small { font-size: .6em; font-weight: 700; }
.cv-sub { margin: 3px 0 0; font-size: 12px; color: var(--ink-2); }
.cv-facts { margin: 0; display: grid; align-content: center; gap: 6px; font-size: 13.5px; }
.cv-facts div { display: flex; gap: 10px; }
.cv-facts dt { color: var(--muted); min-width: 92px; }
.cv-facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.cv-facts .cv-miss { font-weight: 400; color: var(--faint); font-size: 12.5px; }

.col-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0 0 12px; }
.col-tools .search { flex: 1 1 260px; max-width: 460px; }

/* Cards to add, found by the same search. */
.col-add { margin: 0 0 14px; padding: 12px 14px; background: var(--shelf); border: 1px solid var(--line); border-radius: var(--r-sleeve); }
.col-add h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.col-add ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.col-add li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.col-add img { width: 34px; border-radius: var(--r-art); }
.col-add b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-add small { font-size: 11.5px; color: var(--faint); }
.col-add .btn { padding: 5px 10px; font-size: 12.5px; }

.col-list { list-style: none; margin: 0; padding: 0; }
.cl-row {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto auto auto; gap: 0 12px; align-items: center;
  padding: 7px 0; border-top: 1px solid var(--line);
}
.cl-row img { width: 40px; border-radius: var(--r-art); }
.cl-id { min-width: 0; }
.cl-name { display: block; font-weight: 600; font-size: 14px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .cl-name:hover { text-decoration: underline; } }
.cl-code { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.cl-print select {
  appearance: none; -webkit-appearance: none; font: inherit; font-size: 11.5px; color: var(--muted);
  background: var(--felt); border: 1px solid var(--line); border-radius: var(--r-art); padding: 1px 6px; cursor: pointer;
}
.cl-print select:focus-visible { outline: 2px solid var(--sticker); outline-offset: 1px; }
.cl-price { text-align: right; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cl-price small { display: block; font-size: 11px; font-weight: 400; color: var(--faint); }
.cl-qty { display: flex; align-items: center; gap: 2px; }
.cl-qty b { min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.cl-empty { padding: 28px 0; color: var(--muted); border-top: 1px solid var(--line); }

/* Export */
.ex-block + .ex-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.ex-block h3 { margin: 0 0 2px; font-size: 15px; }
.ex-block textarea {
  width: 100%; margin-top: 8px; font: 12.5px/1.6 "Pretendard Variable", Pretendard, sans-serif; font-variant-numeric: tabular-nums;
  color: var(--text); background: var(--felt); border: 1px solid var(--line-2); border-radius: var(--r); padding: 8px 10px; resize: vertical;
}
.ex-acts { display: flex; gap: 6px; margin-top: 8px; }

/* Import from a spreadsheet: a link or a file, then the tabs and the lines to check. */
.imdlg .im-how { margin: -4px 0 16px; font-size: 14px; color: var(--muted); }
.im-link { display: flex; gap: 8px; align-items: flex-end; }
.im-link .kf { flex: 1; min-width: 0; }
.im-link .btn { padding-block: 9px; }
.im-file { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.im-or { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.im-file label.btn { position: relative; cursor: pointer; }
.im-file label.btn:active { transform: scale(.97); }
.im-file label.btn:has(input:focus-visible) { outline: 2px solid var(--sticker); outline-offset: 2px; }
.im-file label.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.im-msg { margin: 14px 0 0; font-size: 13.5px; font-weight: 600; color: var(--text); }
.im-msg:empty { display: none; }
.im-tabs .im-tab b { font-size: 15px; }
.im-tabs .im-tab small { font-variant-numeric: tabular-nums; }
.im-tabs .im-tab .im-into { color: var(--muted); }
.im-tab input { accent-color: var(--sticker); }
.im-warn { margin: 10px 0 0; }
.im-review { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.im-review h3 { margin: 0 0 2px; font-size: 15px; }
.im-review ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.im-line { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px; border-radius: var(--r); background: var(--felt); }
.im-line.is-off { opacity: .45; }
.im-thumb { display: block; width: 44px; aspect-ratio: 744 / 1039; border-radius: var(--r-art); background: var(--glass); overflow: hidden; }
.im-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.im-what { display: grid; gap: 2px; min-width: 0; }
.im-what b { font-size: 14px; overflow-wrap: anywhere; }
.im-what small { font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.im-what .field { margin-top: 6px; }
.im-what .field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }
.im-what .field select { width: 100%; max-width: none; background: var(--shelf); }
.im-what .field .caret { top: 50%; bottom: auto; transform: translateY(-50%); }

/* The scanner. On a computer it stands beside the list; on a phone it fills the screen. */
body.scanning .colpage { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr); gap: 0 28px; align-items: start; }
body.scanning .col-head { grid-column: 1 / -1; }
body.scanning #scan-start { display: none; }
.scanner { position: sticky; top: calc(var(--header-h) + 16px); }
.scan-stage {
  position: relative; overflow: hidden; background: #000; border-radius: var(--r-sleeve);
  height: min(calc(100dvh - var(--header-h) - 200px), 760px); min-height: 420px;
}
.scan-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* The guide frame is a toploader: clear edge, heavier top lip, the camera dimmed around it. */
.scan-frame {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  height: 68%; aspect-ratio: 744 / 1039; max-width: 78%;
  border-radius: var(--r-sleeve);
  box-shadow: inset 0 0 0 1.5px rgb(214 220 226 / .75), inset 0 6px 0 0 rgb(214 220 226 / .32),
    0 0 0 100vmax rgb(var(--backdrop-rgb) / .52); /* taste-skill-ignore: a scrim around the guide, not a shadow */
  touch-action: none; cursor: move;
}
/* A recognised card: its price sticker pressed onto the bottom of the sleeve. */
.scan-sticker {
  position: absolute; left: 8px; right: 8px; bottom: 10px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; align-items: baseline;
  background: var(--sticker); color: var(--ink); border-radius: var(--r); padding: 8px 10px 9px;
  box-shadow: 0 2px 3px rgb(0 0 0 / .35);
  cursor: default;
}
.scan-sticker.is-new { animation: sticker-press .24s var(--ease-out); }
@keyframes sticker-press { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.ss-name { font-size: 13px; font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-price { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ss-price small { font-size: .6em; font-weight: 700; }
.ss-meta { grid-column: 1 / -1; font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ss-prints { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ss-prints button {
  font: inherit; font-size: 11.5px; font-weight: 600; padding: 3px 8px; cursor: pointer;
  background: none; color: var(--ink-2); border: 1px solid #b9bbb6; border-radius: var(--r-art);
}
.ss-prints button[aria-pressed="true"] { background: var(--ink); color: var(--sticker); border-color: var(--ink); }

.scan-status {
  position: absolute; left: 50%; bottom: 80px; transform: translateX(-50%); margin: 0; width: max-content; max-width: calc(100% - 24px);
  padding: 6px 12px; border-radius: var(--r); background: rgb(var(--scrim-rgb) / .78); color: var(--text);
  font-size: 13px; font-weight: 600; text-align: center;
}
.scan-top { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; align-items: center; gap: 6px; }
.scan-tally { margin-right: auto; padding: 6px 10px; border-radius: var(--r); background: rgb(var(--scrim-rgb) / .78); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.scan-tally:empty { display: none; }
.scan-btn {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0; cursor: pointer;
  background: rgb(var(--scrim-rgb) / .78); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r);
  transition: transform .16s var(--ease-out);
}
.scan-btn:first-child { margin-right: 0; }
.scan-btn .i { width: 19px; height: 19px; }
.scan-btn:active { transform: scale(.95); }
.scan-btn[aria-pressed="true"] { background: var(--sticker); color: var(--ink); border-color: var(--sticker); }
.scan-btn:focus-visible { outline: 2px solid var(--sticker); outline-offset: 2px; }

/* The picker: the scanner's guesses, or the candidates of a photo, to tap. It sits centred above the status line. */
.scan-guess {
  position: absolute; left: 50%; bottom: 118px; transform: translateX(-50%); width: min(440px, calc(100% - 20px));
  padding: 8px; border-radius: var(--r); background: rgb(34 36 39 / .95); border: 1px solid var(--line-2);
}

/* This scan's cards, newest first, each with undo. */
.scan-session { margin-top: 12px; }
.ss-head {
  display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 0 0 6px; padding: 2px 0;
  background: none; border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; color: var(--muted);
  font-variant-numeric: tabular-nums; text-align: left;
}
.ss-head .i { width: 15px; height: 15px; transition: transform .16s var(--ease-out); }
.scan-session.is-open .ss-head .i { transform: rotate(180deg); }
.ss-list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; }
.ss-list li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); }
.ss-list img { width: 30px; border-radius: var(--r-art); }
.ss-list b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-list small { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.ss-list .btn { padding: 4px 9px; font-size: 12px; }

@media (max-width: 1000px) {
  body.scanning .colpage { display: block; }
}
@media (max-width: 760px) {
  .colpage { padding: 16px 16px 40px; }
  .cl-row { grid-template-columns: 36px minmax(0, 1fr) auto auto; }
  .cl-row img { width: 36px; }
  .cl-price { grid-column: 2; grid-row: 2; text-align: left; font-size: 13px; }
  .cl-price small { display: inline; margin-left: 6px; }
  .cl-qty { grid-column: 3; grid-row: 1 / 3; }
  /* The scanner fills the phone; this scan's list is a shelf sheet at the bottom. */
  body.scanning { overflow: hidden; }
  body.scanning .scanner {
    position: fixed; inset: 0; z-index: 300; display: flex; flex-direction: column; background: #000;
  }
  body.scanning .scan-stage { flex: 1; height: auto; min-height: 0; border-radius: 0; }
  body.scanning .scan-frame { height: 64%; max-width: 84%; top: 44%; }
  /* One fixed height, whatever was scanned: the camera view and its frame never move.
     Open, the list rises over the camera instead of pushing it. */
  body.scanning .scanner { padding-bottom: calc(96px + var(--safe-b)); }
  body.scanning .scan-session {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; height: calc(96px + var(--safe-b)); overflow: hidden;
    margin: 0; padding: 8px 16px calc(8px + var(--safe-b)); background: var(--shelf);
    border-top: 1px solid var(--line); border-radius: var(--r-sleeve) var(--r-sleeve) 0 0;
  }
  body.scanning .scan-session.is-open { height: min(70dvh, calc(100% - 60px)); overflow-y: auto; }
  body.scanning .scan-session:not(.is-open) .ss-list li:not(:first-child) { display: none; }
  body.scanning .ss-list { max-height: none; }
}

/* The deck builder with a collection: what you own, what the deck still needs. */
.p-own {
  position: absolute; left: 6px; top: 6px; padding: 1px 6px; border-radius: var(--r-art);
  background: rgb(var(--scrim-rgb) / .82); color: var(--text); border: 1px solid var(--line-2);
  font-size: 11px; font-weight: 700; line-height: 1.5; font-variant-numeric: tabular-nums;
}
.d-need { font-size: 11px; font-weight: 700; color: var(--text); border: 1px dashed var(--line-2); border-radius: var(--r-art); padding: 0 5px; line-height: 1.5; }
.d-thumb .d-need { position: absolute; right: 3px; top: 3px; background: rgb(var(--scrim-rgb) / .86); }
.v-own { margin-top: 6px; }
p.v-own { font-size: 13px; font-weight: 700; color: var(--text); margin: 6px 0 0; }

/* The frame can be moved (drag) and resized (its corner); the card found inside it is outlined. */
.scan-handle {
  position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; cursor: nwse-resize;
  border-right: 3px solid var(--sticker); border-bottom: 3px solid var(--sticker); border-bottom-right-radius: var(--r-sleeve);
}
.scan-found {
  position: absolute; pointer-events: none; border: 2px solid var(--sticker); border-radius: var(--r);
  transition: left .12s linear, top .12s linear, width .12s linear, height .12s linear;
}
/* The bottom of the camera view: zoom on the left, the shutter in the middle. */
.scan-bottom {
  position: absolute; left: 10px; right: 10px; bottom: 12px; height: 56px;
  display: flex; align-items: center; justify-content: center;
}
.scan-zoom {
  position: absolute; left: 0; display: flex; align-items: center; gap: 4px;
  padding: 4px; border-radius: var(--r); background: rgb(var(--scrim-rgb) / .78);
}
.scan-zoom .scan-btn { width: 36px; height: 36px; background: none; }
.scan-zoom .scan-btn:disabled { opacity: .4; }
.scan-zoom-val { min-width: 40px; text-align: center; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.scan-shot {
  display: grid; place-items: center; width: 60px; height: 56px; padding: 0; cursor: pointer;
  background: var(--sticker); color: var(--ink); border: 0; border-radius: var(--r);
  transition: transform .16s var(--ease-out);
}
.scan-shot .i { width: 26px; height: 26px; }
.scan-shot:active { transform: scale(.95); }
.scan-shot:focus-visible { outline: 2px solid var(--sticker); outline-offset: 3px; }
/* The sound switch, across from the zoom: the top row is full on a phone. */
.scan-sound { position: absolute; right: 0; }

/* The picker's head and its candidates. */
.sp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px 2px; font-size: 12.5px; color: var(--muted); }
.sp-x { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; cursor: pointer; background: none; color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r); }
.sp-x .i { width: 16px; height: 16px; }
.sp-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.sp-list button {
  display: grid; gap: 3px; width: 100%; padding: 4px; cursor: pointer; text-align: left; font: inherit; color: var(--text);
  background: var(--glass); border: 1px solid var(--line-2); border-radius: var(--r); transition: transform .16s var(--ease-out);
}
.sp-list button:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .sp-list button:hover { border-color: var(--muted); } }
.sp-list img { width: 100%; border-radius: var(--r-art); }
.sp-list b { font-size: 11.5px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sp-list small { font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
/* "Not this" on the sticker: quiet, but always there. */
.ss-prints .ss-wrong { margin-left: auto; }

/* ---------- collection folders ---------- */
/* The overview is a shelf of folders: each a stack of its best cards in their
   sleeves, fanned, with the folder's total on a price sticker pressed over the
   bottom. A folder's icon is a domain rune (Riot's colours, as data) or an emoji
   the owner chose; everything round it stays grey. */

.col-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.col-back {
  flex-basis: 100%; display: inline-flex; align-items: center; gap: 6px; width: max-content;
  font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 2px 0;
}
.col-back .i { width: 15px; height: 15px; }
@media (hover: hover) and (pointer: fine) { .col-back:hover { color: var(--text); } }
#col-h1 { display: flex; align-items: center; gap: 10px; min-width: 0; }
#col-h1 > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#col-h1 .fi { font-size: 26px; }
.col-edit { padding: 6px 10px; font-size: 13px; }

.fi { width: 1.2em; height: 1.2em; flex: none; display: inline-grid; place-items: center; vertical-align: -0.25em; }
.fi-svg { color: var(--muted); }
.fi-emo {
  font-size: 1.05em; line-height: 1; font-style: normal;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.folders { margin: 6px 0 0; }
.folders h2 { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.fgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 22px 16px; }
.ftile {
  display: flex; flex-direction: column; gap: 3px; width: 100%; min-width: 0; padding: 0; cursor: pointer;
  background: none; border: 0; font: inherit; color: inherit; text-align: left; text-decoration: none;
  transition: transform .16s var(--ease-out);
}
.ftile:active { transform: scale(.98); }
.ftile:focus-visible { outline: none; }
.ftile:focus-visible .ft-stack { box-shadow: inset 0 0 0 2px var(--sticker); } /* taste-skill-ignore: focus edge */
.ft-stack {
  position: relative; display: block; aspect-ratio: 4 / 3; margin-bottom: 7px; overflow: hidden;
  border-radius: var(--r-sleeve); background: var(--shelf);
}
/* Three sleeves: the most valuable in front, the next two behind it, turned out. */
.ft-card {
  position: absolute; left: 50%; top: 11%; height: 82%; aspect-ratio: 744 / 1039; padding: 5px 3px 3px;
  border-radius: 5px; background: #2d3034;
  box-shadow: inset 0 0 0 1px var(--sleeve-edge), inset 0 4px 0 0 rgb(214 220 226 / .2); /* taste-skill-ignore: the sleeve's plastic edge and lip */
  transition: transform .28s var(--ease-out);
}
.ft-card img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.ft-card[data-pos="l"] { transform: translateX(-50%) translateX(-36%) rotate(-7deg); }
.ft-card[data-pos="r"] { transform: translateX(-50%) translateX(36%) rotate(7deg); }
.ft-card[data-pos="c"] { z-index: 1; transform: translateX(-50%); }
@media (hover: hover) and (pointer: fine) {
  .ftile:hover .ft-card[data-pos="l"] { transform: translateX(-50%) translateX(-46%) rotate(-10deg); }
  .ftile:hover .ft-card[data-pos="r"] { transform: translateX(-50%) translateX(46%) rotate(10deg); }
  .ftile:hover .ft-card[data-pos="c"] { transform: translateX(-50%) translateY(-4px); }
}
.ft-won {
  position: absolute; z-index: 2; left: 50%; bottom: 9px; transform: translateX(-50%); white-space: nowrap;
  background: var(--sticker); color: var(--ink); border-radius: var(--r); padding: 3px 9px 4px;
  font-size: 15px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 3px rgb(0 0 0 / .35); /* taste-skill-ignore: the sticker sits on the sleeve */
}
.ft-won small { font-size: .62em; font-weight: 700; }
.ft-stack.is-empty { display: grid; place-items: center; }
.ft-big { font-size: 46px; }
.ft-big.fi-svg { color: var(--faint); }
/* The folder the scanner is filling: marked in sticker white, like any selection. */
.ftile.is-into .ft-stack { box-shadow: inset 0 0 0 2px var(--sticker); } /* taste-skill-ignore: selected edge */
.ft-into {
  position: absolute; z-index: 2; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px 3px; border-radius: var(--r-art); background: var(--sticker); color: var(--ink); font-size: 11.5px; font-weight: 700;
}
.ft-into .i { width: 12px; height: 12px; }
.ft-name { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 15px; }
.ft-name .fi { font-size: 18px; }
.ft-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-meta { font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.ft-new .ft-stack { display: grid; place-items: center; background: none; border: 1px dashed var(--line-2); transition: border-color .15s ease; }
.ft-new .ft-stack .i { width: 30px; height: 30px; color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .ft-new:hover .ft-stack { border-color: var(--muted); } }
.fgrid li.is-new .ftile { animation: ft-in .26s var(--ease-out); }
@keyframes ft-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
#col-main-in.is-in { animation: view-in .14s ease-out; }
@keyframes view-in { from { opacity: 0; } }

/* A row in a folder ends with the arrow that moves copies out; in all cards, with
   where they are. */
.cl-move { width: 28px; height: 28px; }
.cl-move .i { width: 15px; height: 15px; }
.cl-where {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 6px 4px 8px; cursor: pointer;
  background: none; border: 1px solid var(--line-2); border-radius: var(--r); color: var(--text);
  font: inherit; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: border-color .15s ease, transform .16s var(--ease-out);
}
.cl-where:active { transform: scale(.97); }
.cl-where > .i { width: 12px; height: 12px; color: var(--faint); }
.cl-in { display: inline-flex; align-items: center; gap: 3px; }
.cl-in .fi { font-size: 15px; }
@media (hover: hover) and (pointer: fine) { .cl-where:hover { border-color: var(--muted); } }

/* The pop-over: beside its button on a computer, a sheet on a phone. */
.pop {
  position: absolute; z-index: 400; width: 288px; padding: 10px;
  background: var(--shelf); border: 1px solid var(--line-2); border-radius: var(--r-sleeve);
  box-shadow: 0 18px 40px -12px rgb(0 0 0 / .8); /* taste-skill-ignore: it floats */
}
.pop.is-in { animation: pop-in .16s var(--ease-out); }
@keyframes pop-in { from { opacity: 0; transform: scale(.96); } }
.pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-left: 2px; }
.pop-head b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-sub { margin: 0 0 8px 2px; font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.pop-k { margin: 10px 0 4px 2px; font-size: 12.5px; color: var(--muted); }
.pop-seg { display: flex; gap: 2px; padding: 2px; border-radius: var(--r); background: var(--felt); }
.pop-seg button {
  flex: 1; padding: 6px 8px; cursor: pointer; border: 0; border-radius: var(--r-art); background: none;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums;
  transition: color .15s ease;
}
.pop-seg button[aria-pressed="true"] { background: var(--sticker); color: var(--ink); }
.pop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; max-height: min(52vh, 420px); overflow-y: auto; }
.pop-list button[data-to], .pop-list button[data-to-new], .scan-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px; cursor: pointer;
  background: none; border: 0; border-radius: var(--r); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 600; text-align: left;
  transition: background-color .12s ease, transform .16s var(--ease-out);
}
.pop-list button .fi, .scan-menu button .fi { font-size: 18px; }
.pop-list button > .i, .scan-menu button > .i { width: 18px; height: 18px; color: var(--muted); }
.pop-list button span, .scan-menu button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-list small { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--faint); font-variant-numeric: tabular-nums; }
.pop-list button:active, .scan-menu button:active { transform: scale(.98); }
.pop-list button:focus-visible, .scan-menu button:focus-visible { outline: 2px solid var(--sticker); outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) {
  .pop-list button[data-to]:hover, .pop-list button[data-to-new]:hover, .scan-menu button:hover { background: var(--glass); }
}
.fstep {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 8px;
  padding: 6px 2px 6px 6px; font-size: 14px; font-weight: 600;
}
.fstep .fi { font-size: 18px; }
.fstep span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fstep b { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.fstep.is-zero span, .fstep.is-zero b { color: var(--faint); }
.fstep .d-btn { width: 28px; height: 28px; }
.fstep .d-btn:disabled { opacity: .35; cursor: default; transform: none; }

/* The folder dialog: name, then the icon, a domain rune or an emoji. */
.fdlg { width: min(520px, calc(100vw - 48px)); }
.fd-top { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: end; }
.fd-prev { display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--r-sleeve); background: var(--felt); }
.fd-prev .fi { font-size: 36px; }
.fd-name > span { display: block; margin: 0 0 5px; font-size: 13px; color: var(--muted); }
.fd-name input {
  width: 100%; font: inherit; font-size: 16px; color: var(--text);
  background: var(--felt); border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px 12px;
}
.fd-name input:focus-visible, .fd-own input:focus-visible { outline: 2px solid var(--sticker); outline-offset: 1px; }
.fd-name input[aria-invalid="true"] { border-color: var(--muted); }
.fd-msg { margin: 6px 0 0; font-size: 12.5px; font-weight: 600; color: var(--text); }
.fd-msg:empty { display: none; }
.fd-icons { margin: 18px 0 0; padding: 0; border: 0; min-width: 0; }
.fd-icons legend { padding: 0; font-size: 13px; color: var(--muted); }
.fd-k { margin: 10px 0 6px; font-size: 12.5px; color: var(--faint); }
.fd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 4px; }
.fd-grid button {
  display: grid; place-items: center; aspect-ratio: 1; padding: 0; cursor: pointer;
  background: var(--glass); border: 1px solid transparent; border-radius: var(--r);
  transition: transform .16s var(--ease-out), border-color .15s ease;
}
.fd-grid .fi { font-size: 22px; }
.fd-grid button:active { transform: scale(.94); }
.fd-grid button:focus-visible { outline: 2px solid var(--sticker); outline-offset: 1px; }
.fd-grid button[aria-pressed="true"] { background: var(--sticker); border-color: var(--sticker); }
.fd-grid button[aria-pressed="true"] .fi-svg { color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .fd-grid button[aria-pressed="false"]:hover { border-color: var(--muted); } }
.fd-own { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.fd-own > span { display: block; margin: 0; font-size: 13px; color: var(--muted); }
.fd-own input {
  width: 132px; font: inherit; font-size: 16px; color: var(--text); text-align: center;
  background: var(--felt); border: 1px solid var(--line-2); border-radius: var(--r); padding: 7px 10px;
}
.fd-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 24px; }
.fd-delete { margin-right: auto; }
.fd-sure { flex: 1 1 220px; margin: 0; font-size: 13.5px; }

/* The scanner: which folder the cards go to, and the list to change it. */
.scan-into {
  display: flex; flex-direction: column; justify-content: center; min-width: 0; max-width: min(240px, 52%); height: 40px;
  padding: 2px 10px 3px; cursor: pointer; text-align: left; font: inherit; color: var(--text);
  background: rgb(var(--scrim-rgb) / .78); border: 1px solid var(--line-2); border-radius: var(--r);
  transition: transform .16s var(--ease-out), border-color .15s ease;
}
.scan-into:active { transform: scale(.97); }
.scan-into:focus-visible { outline: 2px solid var(--sticker); outline-offset: 2px; }
.scan-into[aria-expanded="true"] { border-color: var(--sticker); }
.si-k { font-size: 11px; color: var(--muted); line-height: 1.2; }
.si-v { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 13.5px; line-height: 1.25; }
.si-v b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.si-v .fi { font-size: 15px; }
.si-v > .i { width: 12px; height: 12px; flex: none; color: var(--faint); }
.scan-menu {
  position: absolute; z-index: 3; top: 56px; left: 56px; width: min(270px, calc(100% - 66px)); max-height: 60%; overflow-y: auto;
  padding: 4px; border-radius: var(--r); background: rgb(34 36 39 / .97); border: 1px solid var(--line-2);
  transform-origin: 20% 0;
}
.scan-menu.is-in { animation: pop-in .16s var(--ease-out); }
.scan-menu ul { list-style: none; margin: 0; padding: 0; }
.scan-menu button[aria-pressed="true"] { color: var(--text); }
.scan-menu button[aria-pressed="true"] > .i { margin-left: auto; color: var(--text); }
.ss-meta .fi { font-size: 13px; margin-right: 3px; }
.ss-list small .fi { font-size: 12px; margin-right: 2px; }

@media (max-width: 760px) {
  .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .ft-won { font-size: 13.5px; padding: 2px 7px 3px; bottom: 7px; }
  .ft-name { font-size: 14px; }
  #col-h1 .fi { font-size: 22px; }
  .cl-row > .cl-move { grid-column: 4; grid-row: 1 / 3; }
  .cl-row > .cl-where { grid-column: 2; grid-row: 3; justify-self: start; margin-top: 4px; }
  .pop {
    position: fixed; left: 0; right: 0; top: auto; bottom: 0; width: auto; z-index: 400;
    padding: 14px 16px calc(16px + var(--safe-b)); border-radius: var(--r-sleeve) var(--r-sleeve) 0 0;
    box-shadow: 0 0 0 100vmax rgb(var(--backdrop-rgb) / .6); /* taste-skill-ignore: a scrim behind the sheet, not a shadow */
  }
  .pop.is-in { animation: sheet-in .26s var(--ease-drawer); }
  body.scanning .scan-tally { display: none; }
  .scan-into { max-width: none; flex: 1; }
}
@keyframes sheet-in { from { transform: translateY(100%); } }

/* ---------- trading and sharing ---------- */
/* A mark is a small sticker: white with ink when a card is for sale or wanted,
   a quiet outline when it is not marked yet. Sharing says itself with a lock,
   a link or a globe; the profile is the shop wall again, with the owner's prices
   on the stickers and the market price in the line under them. */

.ft-vis { display: inline-grid; place-items: center; flex: none; color: var(--faint); }
.ft-vis .i { width: 14px; height: 14px; }

.folder-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.folder-bar:empty { display: none; }
.fb-gap { flex: 1; }
.fb-n { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fb-vis {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; cursor: pointer;
  background: none; border: 1px solid var(--line-2); border-radius: var(--r); color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 600; transition: border-color .15s ease, transform .16s var(--ease-out);
}
.fb-vis .i { width: 15px; height: 15px; color: var(--muted); }
.fb-vis[data-vis="public"], .fb-vis[data-vis="link"] { background: var(--sticker); color: var(--ink); border-color: var(--sticker); }
.fb-vis[data-vis="public"] .i, .fb-vis[data-vis="link"] .i { color: var(--ink); }
.fb-vis:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .fb-vis[data-vis="private"]:hover { border-color: var(--muted); } }

.cl-trade {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; cursor: pointer; white-space: nowrap;
  background: none; border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--muted);
  font: inherit; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  transition: border-color .15s ease, color .15s ease, transform .16s var(--ease-out);
}
.cl-trade .i { width: 14px; height: 14px; }
.cl-trade b { font-weight: 800; }
.cl-trade.is-on { background: var(--sticker); color: var(--ink); border: 1px solid var(--sticker); }
.cl-trade.is-on span { color: var(--ink-2); }
.cl-trade:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .cl-trade:not(.is-on):hover { color: var(--text); border-color: var(--muted); } }

/* The mark's pop-over: copies, price, the market price one tap away. */
.tr-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 6px; }
.tr-n { display: flex; align-items: center; gap: 6px; width: 100%; font-size: 13px; color: var(--muted); }
.tr-n > span { margin-right: auto; }
.tr-n b { min-width: 20px; text-align: center; color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.tr-n small { color: var(--faint); font-variant-numeric: tabular-nums; margin-right: 4px; }
.tr-n .d-btn { width: 28px; height: 28px; }
.tr-n .d-btn:disabled { opacity: .35; cursor: default; transform: none; }
.tr-price { flex: 1; min-width: 0; }
.tr-price span { display: block; margin: 0 0 4px; font-size: 12.5px; color: var(--muted); }
.tr-price input {
  width: 100%; font: inherit; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
  color: var(--ink); background: var(--sticker); border: 0; border-radius: var(--r); padding: 7px 10px;
}
.tr-price input:focus-visible { outline: 2px solid var(--sticker); outline-offset: 2px; }
.tr-median { padding: 9px 10px; font-size: 13px; }
.tr-cl { display: flex; gap: 10px; margin-top: 12px; align-items: flex-end; }
.tr-cond > span, .tr-lang > span { display: block; margin: 0 0 4px; font-size: 12.5px; color: var(--muted); }
.tr-cond .pop-seg button { min-width: 38px; }
.tr-lang { flex: 1; min-width: 0; }
.tr-lang select {
  width: 100%; font: inherit; font-size: 14px; color: var(--text); background: var(--felt);
  border: 1px solid var(--line-2); border-radius: var(--r); padding: 7px 8px;
}
.tr-acts { display: flex; justify-content: flex-end; gap: 6px; margin-top: 12px; }

/* Choices as rows: the folder's kind, who can see it, the profile on or off. */
.fd-opts { margin: 18px 0 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 6px; }
.fd-opts legend { padding: 0; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.fd-kind { grid-template-columns: 1fr 1fr; }
.fd-kind legend { grid-column: 1 / -1; }
.fd-opts .share-opt span { grid-template-columns: auto 1fr; column-gap: 7px; align-items: center; }
.fd-opts .share-opt .i { width: 16px; height: 16px; color: var(--muted); }
.fd-opts .share-opt small { grid-column: 1 / -1; }
.share-opt.is-off { opacity: .55; cursor: default; }
.fd-opts .note { margin: 2px 0 0; }

.pdlg { width: min(540px, calc(100vw - 48px)); }
.pdlg .note { margin: 0 0 12px; }
.pd-field { display: block; margin-top: 14px; }
.pd-field > span { display: block; margin: 0 0 5px; font-size: 13px; color: var(--muted); }
.pd-field input, .pd-field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--text); resize: vertical;
  background: var(--felt); border: 1px solid var(--line-2); border-radius: var(--r); padding: 9px 12px;
}
.pd-field input:focus-visible, .pd-field textarea:focus-visible { outline: 2px solid var(--sticker); outline-offset: 1px; }
.pd-how { margin: 5px 0 0; font-size: 12.5px; color: var(--faint); }
.pd-link { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 10px; font-size: 13px; }
.pd-link:empty { display: none; }
.pd-link > span { color: var(--muted); }
.pd-link code { font: inherit; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.pd-link .btn { padding: 5px 10px; font-size: 12.5px; }
.pd-contacts { margin: 18px 0 0; padding: 0; border: 0; min-width: 0; }
.pd-contacts legend { padding: 0; font-size: 13px; font-weight: 700; color: var(--text); }
.pd-contacts .pd-field { margin-top: 10px; }

/* The profile page. */
.pf-status { padding: 40px 0; color: var(--muted); }
.pf-mine {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 18px; padding: 10px 14px;
  border-radius: var(--r); background: var(--shelf); font-size: 13.5px;
}
.pf-mine .i { width: 16px; height: 16px; color: var(--muted); }
.pf-mine a { margin-left: auto; color: var(--text); font-weight: 600; }
.pf-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin: 0 0 28px; }
.pf-id { min-width: 0; }
.pf-head h1 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.2; overflow-wrap: anywhere; }
.pf-head h1 .fi { font-size: 30px; }
.pf-bio { margin: 6px 0 0; max-width: 60ch; font-size: 15px; white-space: pre-line; }
.pf-facts { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pf-head .col-back { margin-bottom: 8px; }
.pf-contact { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-sec { margin: 0 0 44px; }
.pf-sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 4px; }
.pf-sec-head h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.pf-sec-head h2 .count { display: inline; margin-left: 4px; font-size: 15px; font-weight: 600; }
.pf-how { margin: 0 0 16px; }
.pf-sec .grid { margin-top: 12px; }
/* A card's mark in a shared folder, pressed on the top of its sleeve. */
.pf-mark {
  position: absolute; z-index: 1; left: 8px; top: 12px; max-width: calc(100% - 16px); padding: 2px 7px 3px;
  border-radius: var(--r-art); background: var(--sticker); color: var(--ink); font-size: 12px; font-weight: 800;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 2px 3px rgb(0 0 0 / .35); /* taste-skill-ignore: the sticker sits on the sleeve */
}
.pf-mark.is-want { background: rgb(var(--scrim-rgb) / .86); color: var(--text); border: 1px solid var(--sticker); }

@media (max-width: 760px) {
  .cl-row > .cl-trade { grid-column: 2; grid-row: 3; justify-self: start; margin-top: 4px; }
  .fd-kind { grid-template-columns: 1fr; }
  .pf-head h1 { font-size: 24px; }
  .pf-sec-head h2 { font-size: 18px; }
  .folder-bar .fb-gap { display: none; }
}
.fdlg .share-opt, .pdlg .share-opt { background: var(--glass); }
.pf-sec-head .field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Accept trades: a checkbox on a mark and on the profile; a ⇄ tag where it shows. */
.tr-swap { display: flex; align-items: flex-start; gap: 9px; margin-top: 12px; cursor: pointer; }
.tr-swap input { margin: 3px 0 0; accent-color: var(--sticker); width: 16px; height: 16px; flex: none; }
.tr-swap span { display: grid; gap: 2px; }
.tr-swap b { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.tr-swap b .i { width: 15px; height: 15px; color: var(--muted); }
.tr-swap small { font-size: 12px; color: var(--faint); }
.pd-trades { margin-top: 16px; padding: 10px 12px; border-radius: var(--r); background: var(--glass); }
.cl-swap { display: inline-grid; place-items: center; }
.cl-trade.is-on .cl-swap .i { color: var(--ink); }
.pf-badge {
  display: inline-flex; align-items: center; gap: 5px; margin-right: 10px; padding: 2px 8px 3px; vertical-align: 1px;
  border-radius: var(--r-art); background: var(--sticker); color: var(--ink); font-size: 12.5px; font-weight: 700;
}
.pf-badge .i { width: 13px; height: 13px; }
.pf-swap {
  position: absolute; z-index: 1; right: 8px; top: 12px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px 3px;
  border-radius: var(--r-art); background: rgb(var(--scrim-rgb) / .86); color: var(--text); border: 1px solid var(--line-2);
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.pf-swap .i { width: 12px; height: 12px; }
.pf-swap.is-low { top: 38px; left: 8px; right: auto; }
/* The safety note: quiet, but before anyone reaches for a contact button. */
.pf-safety {
  display: flex; align-items: flex-start; gap: 9px; margin: -12px 0 28px; padding: 10px 14px;
  border-radius: var(--r); background: var(--shelf); font-size: 13px; line-height: 1.5; color: var(--muted);
}
.pf-safety .i { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--muted); }

/* The owner's tip when nothing is on show: a sticker note, since it asks for an action. */
.pf-tip { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; padding: 14px 16px; max-width: 640px;
  border-radius: var(--r); background: var(--sticker); color: var(--ink); }
.pf-tip > .i { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.pf-tip p { margin: 0 0 4px; font-size: 14px; }
.pf-tip p + p { color: var(--ink-2); font-size: 13px; }
.pf-tip .btn { margin-top: 8px; background: var(--ink); color: var(--sticker); border-color: var(--ink); }
.pf-tip .btn .i { color: var(--sticker); }
/* The shared hover outline (base.css, .btn:hover) shows on the tip's button too: in the game layer this colour would otherwise win over it. */
@media (hover: hover) and (pointer: fine) { .pf-tip .btn:not(:disabled):hover { border-color: var(--muted); } }

/* ---------- Profile pictures: the profile page and the picture dialog ---------- */

.pf-who { display: flex; align-items: center; gap: 18px; }
.pf-who > div { min-width: 0; }
.pf-by { display: flex; align-items: center; gap: 7px; }

/* The profile dialog's picture row. */
.pd-pic { display: flex; align-items: center; gap: 16px; margin: 0 0 16px; }
.pd-pic-k { margin: 0; font-size: 15px; font-weight: 700; }
.pd-pic .pd-how { margin: 2px 0 8px; }
.pd-pic-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-pic-acts .btn { padding: 6px 11px; font-size: 13px; }

/* Choosing the card, then the circle: the card large, dimmed outside the circle. */
.avdlg { width: min(720px, calc(100vw - 48px)); }
.av-search { display: block; max-width: none; margin: 0 0 12px; }
.av-k { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.av-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px;
  max-height: min(56dvh, 520px); overflow-y: auto; }
.av-grid button { display: block; width: 100%; padding: 0; cursor: pointer; border: 0; border-radius: var(--r); background: none;
  transition: transform .16s var(--ease-out); }
.av-grid img { display: block; width: 100%; border-radius: var(--r); aspect-ratio: 744 / 1039; object-fit: cover; }
.av-grid button:active { transform: scale(.97); }
.av-grid button:focus-visible { outline: 2px solid var(--sticker); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .av-grid button:hover { transform: translateY(-2px); } }
.av-crop { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 24px; align-items: start; }
.av-stage { position: relative; overflow: hidden; border-radius: 6px; touch-action: none; cursor: move; user-select: none; -webkit-user-select: none; }
.av-stage img { display: block; width: 100%; aspect-ratio: 744 / 1039; }
.av-ring {
  position: absolute; aspect-ratio: 1; border-radius: 50%; outline: none;
  box-shadow: 0 0 0 2px var(--sticker), 0 0 0 100vmax rgb(var(--backdrop-rgb) / .62); /* taste-skill-ignore: the crop circle and the dimmed card around it */
}
.av-ring:focus-visible { box-shadow: 0 0 0 3px var(--sticker), 0 0 0 6px rgb(245 245 242 / .35), 0 0 0 100vmax rgb(var(--backdrop-rgb) / .62); } /* taste-skill-ignore: focus */
.av-previews { display: flex; align-items: flex-end; gap: 14px; margin: 4px 0 6px; }
.av-zoom { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; }
.av-zoom input { flex: 1; accent-color: var(--sticker); }
.av-zoom .d-btn { width: 30px; height: 30px; }
@media (max-width: 760px) {
  /* The collection's dialogs set a width above; on a phone they are full-width sheets like the rest. */
  .fdlg, .pdlg, .avdlg { width: 100%; }
  .av-crop { grid-template-columns: 1fr; gap: 14px; }
  .av-stage { max-width: 260px; margin: 0 auto; }
  .av-xl { --av: 72px; }
  .pf-who { gap: 14px; }
}

/* ---------- Foil copies: the row toggle, choosing several rows, the scanner's box ---------- */

/* Off: a quiet outline beside the code. On: the sticker, like every chosen thing here. */
.cl-foil {
  display: inline-flex; align-items: center; gap: 3px; flex: none; white-space: nowrap;
  font: inherit; font-size: 11px; font-weight: 700; line-height: 1; padding: 3px 6px 3px 5px; cursor: pointer;
  color: var(--faint); background: none; border: 1px solid var(--line-2); border-radius: var(--r-art);
  transition: transform .16s var(--ease-out), border-color .15s ease, color .15s ease;
}
.cl-foil .i { width: 11px; height: 11px; }
.cl-foil:active { transform: scale(.95); }
.cl-foil[aria-pressed="true"] { color: var(--ink); background: var(--sticker); border-color: var(--sticker); }
@media (hover: hover) and (pointer: fine) { .cl-foil[aria-pressed="false"]:hover { color: var(--text); border-color: var(--muted); } }
.cl-foil-tag { font-size: 11px; font-weight: 700; padding: 1px 5px; border-radius: var(--r-art); background: var(--sticker); color: var(--ink); vertical-align: 1px; }

.col-select[aria-pressed="true"] { background: var(--sticker); color: var(--ink); border-color: var(--sticker); }
.col-select[aria-pressed="true"] .i { color: var(--ink); }
/* The shared hover outline (base.css, .btn:hover) shows on Select while on too: in the game layer this colour would otherwise win over it. */
@media (hover: hover) and (pointer: fine) { .col-select[aria-pressed="true"]:not(:disabled):hover { border-color: var(--muted); } }
/* In Select mode the card picture holds the checkbox, so no row changes its layout. */
.cl-pick { position: relative; display: block; cursor: pointer; }
.cl-pick img { opacity: .55; transition: opacity .15s ease; }
.cl-pick input {
  position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: 0; transform: translate(-50%, -50%);
  accent-color: var(--sticker); cursor: pointer;
}
.cl-row.is-picked .cl-pick img { opacity: 1; }
.cl-row.is-picked { background: var(--shelf); }
/* The chosen rows' actions stay in reach while the list scrolls. */
.col-selbar {
  position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 0 12px; padding: 10px 12px; border-radius: var(--r); background: var(--glass); border: 1px solid var(--line-2);
  box-shadow: 0 14px 30px -12px rgb(0 0 0 / .8); /* taste-skill-ignore: it floats over the list */
}
.sb-n { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sb-gap { flex: 1; }
@media (max-width: 760px) {
  .col-selbar { bottom: calc(76px + var(--safe-b)); }
  .col-selbar .sb-gap { flex-basis: 100%; height: 0; }
}

/* The scanner's Foil box: on until unticked. */
.scan-foil {
  display: inline-flex; align-items: center; gap: 5px; height: 40px; padding: 0 10px; cursor: pointer; flex: none;
  font-size: 13px; font-weight: 700; color: var(--text); background: rgb(var(--scrim-rgb) / .78);
  border: 1px solid var(--line-2); border-radius: var(--r); transition: transform .16s var(--ease-out);
}
.scan-foil:active { transform: scale(.97); }
.scan-foil input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.scan-foil .i { width: 14px; height: 14px; }
.scan-foil.is-on { background: var(--sticker); color: var(--ink); border-color: var(--sticker); }
.scan-foil:has(input:focus-visible) { outline: 2px solid var(--sticker); outline-offset: 2px; }
.ss-prints .ss-foil { display: inline-flex; align-items: center; gap: 3px; }
.ss-prints .ss-foil .i { width: 11px; height: 11px; }

/* ---------- Admin overview: the growth dashboard ---------- */

.dash .admin-head { margin-bottom: 14px; }
.dash-strip { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 18px; font-size: 13.5px; color: var(--muted); }
.dash-strip b { color: var(--text); font-variant-numeric: tabular-nums; margin-right: 3px; }
.dash-strip a { color: var(--muted); }
.dash-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; }
.dash-tiles > div { min-width: 0; padding: 14px 16px 12px; border-radius: var(--r); background: var(--shelf); }
.dash-tiles dt { font-size: 13px; color: var(--muted); }
.dash-tiles dd { margin: 0; }
.dash-tiles .tile-v { margin-top: 2px; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.tile-d { display: block; font-size: 12.5px; color: var(--faint); margin-top: 2px; }
.tile-d b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.dash-tiles .tile-note { font-size: 12px; color: var(--faint); margin-top: 6px; }
.tile-spark { display: block; width: 100%; height: 28px; margin-top: 8px; overflow: visible; }
.tile-spark polyline { fill: none; stroke: var(--faint); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tile-spark circle { fill: var(--sticker); }

.dash-card { margin-top: 14px; padding: 16px 18px 14px; border-radius: var(--r); background: var(--shelf); min-width: 0; }
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin .dash-card h2, .dash-head h2 { margin: 0; font-size: 17px; }
.dash-head .seg { margin: 0; }
.dash-card > .note { margin: 4px 0 10px; font-size: 13px; }
.dash-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dash-two > .dash-card { margin-top: 14px; }
.dash-sub { margin: 18px 0 6px; font-size: 14px; }

/* Charts: thin marks in the sticker white, recessive grid, a tooltip on hover and focus. */
.chart { position: relative; min-width: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart svg:focus-visible { outline: 2px solid var(--sticker); outline-offset: 4px; border-radius: 2px; }
.ch-grid { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.ch-tick { fill: var(--faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.ch-line { fill: none; stroke: var(--sticker); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-area { fill: var(--sticker); opacity: .1; }
.ch-cross { stroke: var(--muted); stroke-width: 1; }
.ch-dot { fill: var(--sticker); stroke: var(--shelf); stroke-width: 2; }
.ch-bar { fill: var(--sticker); transition: opacity .12s ease; }
.chart svg:hover .ch-bar:not(.is-on), .chart svg:focus .ch-bar:not(.is-on) { opacity: .55; }
.ch-tip {
  position: absolute; top: -6px; z-index: 2; pointer-events: none; white-space: nowrap;
  display: flex; align-items: baseline; gap: 6px; padding: 4px 8px; border-radius: var(--r);
  background: var(--sticker); color: var(--ink); font-size: 12.5px;
}
.ch-tip b { font-size: 14px; font-variant-numeric: tabular-nums; }
.ch-tip span { color: var(--ink-2); }
.ch-table { margin-top: 6px; font-size: 13px; }
.ch-table summary { cursor: pointer; color: var(--faint); font-size: 12.5px; width: max-content; }
.ch-table table { margin-top: 6px; max-width: 360px; }
.ch-table td, .ch-table th { padding: 4px 6px; font-variant-numeric: tabular-nums; }
.ch-table th { text-align: left; font-weight: 500; color: var(--faint); font-size: 12px; }

.dash-multi { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.dash-mini p { display: flex; justify-content: space-between; gap: 8px; margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.dash-mini b { color: var(--text); font-variant-numeric: tabular-nums; }

/* Retention: the share in each cell, its fill one hue that deepens with it. */
.ret { font-size: 13px; }
.ret th { font-size: 12px; font-weight: 500; color: var(--faint); text-align: left; white-space: nowrap; }
.ret th.p { text-align: right; }
.ret td { padding: 6px 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ret tr + tr td { border-top: 0; }
.ret td.p { font-weight: 500; }
.ret-cell { background: rgb(245 245 242 / calc(.06 + .78 * var(--share))); border: 2px solid var(--shelf); }
.ret-cell.is-dark { color: var(--ink); }
.ret-none { color: var(--faint); }
.ret-now { color: var(--faint); border: 2px dashed var(--line); }
#retention { overflow-x: auto; }

/* Ranked lists and the funnel: a label, the figure, a thin bar under them. */
.dash-bars { list-style: none; margin: 4px 0 0; padding: 0; }
.dash-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 2px 10px; padding: 6px 0; font-size: 13.5px; }
.dash-bars .db-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-bars b { font-variant-numeric: tabular-nums; }
.dash-bars small { min-width: 40px; text-align: right; color: var(--faint); font-variant-numeric: tabular-nums; }
.db-track { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: var(--glass); overflow: hidden; }
.db-track span { display: block; height: 100%; background: var(--sticker); }

@media (max-width: 720px) {
  .dash-tiles { grid-template-columns: 1fr 1fr; }
  .dash-tiles .tile-v { font-size: 24px; }
  .dash-two { grid-template-columns: 1fr; gap: 0; }
  .dash-multi { gap: 12px 14px; }
  .dash-card { padding: 14px 12px 12px; }
}

/* ---------- Progress: level, badges, achievements (me.html, profiles) ---------- */

.prog-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.lvl, .prog-how { padding: 16px; border-radius: var(--r); background: var(--shelf); }
.lvl { display: grid; gap: 10px; align-content: start; }
.lvl-head { display: flex; align-items: center; gap: 12px; }
.lvl-head p { display: grid; margin: 0; }
.lvl-head p b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.lvl-head .lvl-xp { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lvl .note { margin: 0; font-size: 13px; }
.lvl-bar { display: block; height: 6px; border-radius: var(--r-art); background: var(--line); overflow: hidden; }
.lvl-bar i { display: block; height: 100%; background: var(--tier, var(--rar-common)); border-radius: inherit; }
.prog-k { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.prog-how ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.prog-how li { display: grid; grid-template-columns: 64px 1fr; gap: 8px; }
.prog-how b { font-variant-numeric: tabular-nums; }
.prog-sub { margin: 24px 0 8px; font-size: 15px; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.pbadge {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 19px; height: 19px; padding: 4px 10px 4px 8px; border-radius: var(--r);
  background: var(--sticker); color: var(--ink); font-size: 13px; font-weight: 700;
}
.pbadge .i { width: 14px; height: 14px; color: #c98a1e; }
.pbadge-year .i { color: var(--ink-2); }

.achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.ach {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: var(--r); background: var(--shelf); color: var(--faint);
}
.ach-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--glass); }
.ach-ic .i { width: 18px; height: 18px; }
.ach-body { display: grid; gap: 2px; min-width: 0; }
.ach-body b { font-size: 14px; color: var(--muted); }
.ach-body small { font-size: 12.5px; }
.ach-bar { display: block; height: 4px; margin-top: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.ach-bar i { display: block; height: 100%; background: var(--muted); }
.ach-count { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.ach-xp { display: grid; justify-items: end; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ach-xp time { font-weight: 400; color: var(--faint); }
.ach.is-got { background: var(--glass); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); } /* taste-skill-ignore: a lit tile's edge */
.ach.is-got .ach-ic { background: var(--sticker); color: var(--ink); }
.ach.is-got .ach-body b, .ach.is-got .ach-xp { color: var(--text); }

.xp-log { display: grid; margin: 0; padding: 0; list-style: none; max-width: 640px; }
.xp-log li { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.xp-log b { font-variant-numeric: tabular-nums; }
.xp-log time { font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }

@media (max-width: 640px) { .prog-top { grid-template-columns: 1fr; } }

}
