/* ===========================================================================
   dialogs.css — the inside of every dialog: binder settings, preferences, the
   card details, help, share, and the little confirm / prompt boxes.
   Owned by the Panels & Dialogs engineer. DESIGN.md §3 (Dialogs) and §5.

   The shell (.modal-root, .modal — glass, radius-lg, the 180ms rise) is in
   design.css. The structural rules are in app.css and shell.css; this sheet
   loads last and is the one that dresses them in the Holo Gallery language:
   glass panes, hairline light edges, motion tokens instead of hard-coded
   durations, and a live preview that sits above what it is previewing.
   =========================================================================== */

/* ========================================================= the common shell */

/* Every dialog is a column: a head that stays, a body that scrolls, a foot that
   stays. `.dlg` is the outer box the dialog modules put around their content. */
.dlg { display: flex; flex-direction: column; min-height: 0; }

/* ------------------------------------------------------- the close button
   The one way out of every dialog: an icon-only × in the top-right corner,
   added by ui.js modal() so there is exactly one, in the same place, in every
   dialog in the app. A dialog that asks a question keeps its real answers in
   the foot (Save / Cancel, Delete / Cancel, Create / Cancel) and the × means
   cancel; an informational one has no foot buttons at all.

   It rides in a strip of no height that sticks to the top of the box, so it
   holds the corner whether the box itself scrolls (the short dialogs) or
   something inside it does (the card, help, settings and picker dialogs),
   and it is the first thing in the box, so Shift+Tab from the content lands
   on it. Every head below reserves room for it, so it never sits on a title. */
.modal { position: relative; }
/* On a touch screen the dialog itself may hold the focus when it opens (ui.js modal): no ring for that. */
.modal[tabindex="-1"]:focus { outline: none; }
.modal-x-slot { position: sticky; top: 0; z-index: 20; height: 0; flex: none; align-self: stretch; }
.modal-x {
  position: absolute; top: 10px; right: 10px;
  display: grid; place-items: center;
  width: 36px; height: 36px; padding: 0;
  border-radius: 11px; cursor: pointer;
  color: var(--ink-2);
  background: color-mix(in srgb, var(--bg-3) 80%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--glass-edge);
  transition: background var(--t-1) var(--ease-out), color var(--t-1) var(--ease-out),
    border-color var(--t-1) var(--ease-out), transform var(--t-1) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.modal-x:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 9%, var(--bg-3));
  border-color: color-mix(in srgb, var(--ink) 22%, var(--line));
}
.modal-x:active { transform: translateY(1px); }
.modal-x:focus-visible { color: var(--ink); outline: 2px solid var(--accent); outline-offset: 2px; }
.modal-x-ico { display: grid; place-items: center; line-height: 0; pointer-events: none; }
:root[data-motion="reduced"] .modal-x,
:root[data-motion="off"] .modal-x { transition: none; }

/* Room for it: every dialog head keeps its corner clear, so no title, subtitle
   or tab strip ever runs under the ×. */
.modal-head { padding: 20px 56px 13px 22px; }
.modal.modal-picker .picker-head { padding-right: 56px; }
/* Titles as the card dialog has them: larger, heavier, set tight — the dialogs
   with heads of their own (Add a card, Import, a kit, a shelf's settings, the
   Cover Studio, a 3D model) too. */
.modal-head h2 { margin: 0 0 5px; font-size: 21px; font-weight: 760; letter-spacing: -0.026em; line-height: 1.18; }
.modal :is(.picker-head, .imp-head, .kf-head, .cab-set-head, .cs-head, .im-viewer-head) h2 {
  font-size: 21px; font-weight: 760; letter-spacing: -0.026em; line-height: 1.18;
}
@media (max-width: 520px) {
  .modal-head h2, .modal :is(.picker-head, .imp-head, .kf-head, .cab-set-head, .cs-head, .im-viewer-head) h2 { font-size: 18px; }
}
.modal-head p { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
/* A dialog about one card shows it beside the title (Sold…, Send for grading): a
   small card, tilted a touch and lit from behind, as the card dialog stands its own. */
.modal-head.has-thumb { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; align-items: center; }
.modal-head.has-thumb > :not(.dlg-thumb) { grid-column: 2; }
.dlg-thumb {
  grid-row: 1 / span 2; width: 54px; aspect-ratio: var(--card-ratio); object-fit: cover;
  border-radius: 4px; transform: rotate(-4deg);
  box-shadow: 0 10px 22px -8px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .1), 0 0 28px -6px color-mix(in srgb, var(--accent) 50%, transparent);
}

.modal-body { padding: 16px 22px; display: flex; flex-direction: column; gap: var(--sp-4); }
/* An informational dialog has no foot any more (the × is the way out), so the
   body keeps the room those buttons used to take at the bottom of the box. */
.modal-body:last-child { padding-bottom: 22px; }
.modal-foot {
  padding: 6px 22px 20px; display: flex; gap: var(--sp-2); justify-content: flex-end; align-items: center;
  flex-wrap: wrap;
}
.modal-foot .btn { height: 36px; padding: 0 16px; }
.foot-spacer { flex: 1; }

/* the quiet line at the bottom of a dialog: a caveat, a source, a warning */
.dlg-fine { margin: 0; font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.form-help { margin: 0; font-size: 12px; line-height: 1.45; color: var(--ink-3); }
.form-help.is-warn { color: var(--gold-text); }

/* ------------------------------------------------------ the shared look
   What the card dialog set, for every dialog: rounded fields that glow when
   they have the keyboard, small uppercase labels, section headings with an
   accent bar, and panels with the same soft fill and corner. */
.modal .input { border-radius: 10px; background: color-mix(in srgb, var(--bg) 72%, transparent); }
.modal .input:focus, .modal .input:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent), 0 0 22px -6px color-mix(in srgb, var(--accent) 55%, transparent);
}
.modal .btn:not(.btn-primary):not(.btn-icon):not(.seg-opt) { border-radius: 10px; }
.modal .form-row > label, .modal .set-label, .modal .set-preview-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
}
/* Inside a dialog every box is a little rounder: the corners the card dialog uses. */
.modal { --radius: 14px; --radius-sm: 10px; }
/* A dialog's section heading — Binder settings, Preferences, Help, Price alerts,
   Photos, Import, Quick add, a trade's sides, a kit's photos and notes, an admin
   card's sections: the accent bar beside it, as in the card dialog. Each keeps
   its own spacing. */
.modal :is(.set-sec-head h3, .help-group h3, .dlg-sec-head, .prefs-group h3, .al-msec h3, .dp-group h3,
  .imp-h3, .qa-h, .kf-sec, .trd-side h3, .kit-sheet-notes h3, .adc-sec h4) {
  display: flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 740; letter-spacing: -0.012em; text-transform: none; color: var(--ink);
}
.modal :is(.set-sec-head h3, .help-group h3, .dlg-sec-head, .prefs-group h3, .al-msec h3, .dp-group h3,
  .imp-h3, .qa-h, .kf-sec, .trd-side h3, .kit-sheet-notes h3, .adc-sec h4)::before {
  content: ""; flex: none; width: 4px; height: 15px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 35%, transparent));
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 45%, transparent);
}
.modal .set-sec-head p { margin-left: 13px; }
/* Import's list of what it could not match keeps its warning colour, bar and all. */
.modal .imp-missing .imp-h3 { color: var(--gold-text); }
.modal .imp-missing .imp-h3::before { background: var(--gold); box-shadow: 0 0 10px color-mix(in srgb, var(--gold) 45%, transparent); }
/* panels and notes */
.modal :is(.set-note, .help-list, .card-empty) { border-radius: 14px; background: color-mix(in srgb, var(--bg-3) 72%, transparent); }
.modal .set-desk { border-radius: 14px; }
.modal .dropzone { border-radius: 14px; background: color-mix(in srgb, var(--bg) 60%, transparent); }

/* ------------------------------------------------------- confirm / prompt */
.modal.modal-ask { width: min(470px, 100%); }
.dlg-ask .modal-head { padding-bottom: 8px; }
.dlg-ask .modal-head h2 { font-size: 18px; }
.dlg-ask .modal-foot { padding-top: 16px; }
/* A question wears a badge in its own column (so a long one never runs back
   under it): "?" in the accent, and a destructive one "!" in the colour of what
   it is about to do, its title too. A prompt for a name has none. */
.dlg-ask:not(.is-prompt) .modal-head { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; }
.dlg-ask:not(.is-prompt) .modal-head > * { grid-column: 2; }
.dlg-ask:not(.is-prompt) .modal-head > h2 { margin-top: 3px; }
.dlg-ask:not(.is-prompt) .modal-head::before {
  --tone: var(--accent);
  content: "?"; grid-row: 1 / span 2; align-self: start;
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 12px; font-size: 19px; font-weight: 800; line-height: 1;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 40%, transparent), 0 8px 22px -8px color-mix(in srgb, var(--tone) 60%, transparent);
}
.dlg-ask.is-danger .modal-head h2 { color: var(--danger); }
.dlg-ask.is-danger .modal-head::before { --tone: var(--danger); content: "!"; }

/* ------------------------------------------------------------------ share */
.modal.modal-share { width: min(540px, 100%); }
.share-url { display: flex; gap: var(--sp-2); }
.share-url .input { font-family: var(--mono); font-size: 12px; letter-spacing: -0.01em; }

/* A tall dialog is a column too: the title stays put and only the middle
   scrolls (the × holds the corner above it either way). The foot rule stands
   for a tall dialog that still asks something; neither of these two does any
   more, so both are all head and body. */
.modal.modal-card,
.modal.modal-help { display: flex; flex-direction: column; overflow: hidden; }
.modal.modal-card > .dlg,
.modal.modal-help > .dlg { flex: 1; min-height: 0; }
.modal.modal-card .modal-head,
.modal.modal-help .modal-head { flex: none; }
.modal.modal-card > .dlg > .modal-body,
.modal.modal-help > .dlg > .modal-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
}
.modal.modal-card > .dlg > .modal-foot,
.modal.modal-help > .dlg > .modal-foot {
  flex: none; padding: 12px 20px 14px;
  border-top: 1px solid var(--line); box-shadow: var(--glass-edge);
}

/* The tall dialogs that ask something the same way: New binder (and the
   Sets page's), Your profile, Manage alerts, Export. Scrolled as a whole, on a
   short phone their buttons sat below the fold and the × floated over the
   rows passing under it; now only the middle scrolls, between a head and a
   foot that stay. (New shelf too: shelves.js.) */
.modal:is(.modal-form, .modal-profile, .modal-alerts, .modal-export, .shv-new-modal) { display: flex; flex-direction: column; overflow: hidden; }
.modal:is(.modal-form, .modal-profile, .modal-alerts, .modal-export, .shv-new-modal) > :not(.modal-x-slot) {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
}
.modal:is(.modal-form, .modal-profile, .modal-alerts, .modal-export, .shv-new-modal) > * > .modal-head { flex: none; }
.modal:is(.modal-form, .modal-profile, .modal-alerts, .modal-export, .shv-new-modal) > * > .modal-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
}
.modal:is(.modal-form, .modal-profile, .modal-alerts, .modal-export, .shv-new-modal) > * > .modal-foot {
  flex: none; padding-top: 12px; border-top: 1px solid var(--line);
}

/* ============================================================ card details
   The card dialog (cardinfo.js) is four tabs over one card: Overview, Prices,
   History, Details. The card leads: its own colours are washed behind the top
   of the dialog (.card-ambient), it stands on a glow of its art (.card-stage),
   and what it is worth is the largest thing beside it, with its month as a
   picture and its listings as a gauge. Facts are tiles; actions are tiles in
   the colours the card's own buttons wear in the binder. The box keeps one
   height so switching tabs does not make it jump; only the panel scrolls.
   Everything money-coloured uses --gold-text and tabular numerals. */
.modal.modal-card {
  width: min(900px, 100%); height: min(720px, 88vh); overflow: hidden;
  background: var(--glass);
}
/* On a desktop with room for it, the dialog — and the card in it — is bigger. */
@media (min-width: 1100px) and (min-height: 760px) {
  .modal.modal-card { width: min(1140px, 92vw); height: min(880px, 90vh); }
}
.card-dlg2 { flex: 1; min-height: 0; position: relative; isolation: isolate; }

/* The card's own colours behind the head and the top of the panel, fading out. */
.card-ambient {
  position: absolute; inset: 0 0 auto; height: 380px; z-index: -1; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000, rgba(0, 0, 0, .5) 50%, transparent);
          mask-image: linear-gradient(180deg, #000, rgba(0, 0, 0, .5) 50%, transparent);
}
.card-ambient img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  filter: blur(60px) saturate(1.8); opacity: .42; transform: scale(1.4);
}
:root[data-theme="light"] .card-ambient img { opacity: .28; }

/* ------------------------------------------------------------------- head */
.card-head { padding: 20px 56px 14px 22px; display: flex; align-items: flex-start; gap: 12px; }
.card-head-t { flex: 1; min-width: 0; }
.card-head h2 {
  margin: 0 0 9px; font-size: clamp(20px, 2.1vw, 27px); font-weight: 760; letter-spacing: -0.028em; line-height: 1.12;
  overflow-wrap: anywhere;
}
.card-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.card-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 25px; padding: 0 10px;
  border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
  background: color-mix(in srgb, var(--bg-3) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--ink) 11%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.card-chip-ico { display: grid; place-items: center; color: var(--accent-text); }
.card-chip-ico svg { width: 13px; height: 13px; display: block; }
.card-chip.is-rarity {
  color: var(--gold-text);
  border-color: color-mix(in srgb, var(--gold) 38%, transparent);
  background: color-mix(in srgb, var(--gold) 12%, transparent);
}
/* level with the ×, just left of it (the head keeps the ×'s corner clear) */
.card-head-tcg { flex: none; margin-top: -8px; margin-right: -6px; height: 36px; padding: 0 12px; }
@media (max-width: 520px) {
  .card-head-tcg { height: 32px; margin-top: -6px; padding: 0 10px; font-size: 12px; }
  .card-head-tcg-long { display: none; }
}

/* ------------------------------------------------------------------- tabs */
/* A segmented track: the tab showing is a raised pill, its icon lit. */
.card-tabs {
  flex: none; display: flex; gap: 3px; align-self: flex-start;
  margin: 0 22px 4px; padding: 4px; max-width: calc(100% - 44px);
  border-radius: 13px;
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .28);
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.card-tabs::-webkit-scrollbar { display: none; }
.card-tab {
  position: relative; flex: none;
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px;
  border: 0; border-radius: 9px; background: none; cursor: pointer;
  color: var(--ink-2); font-family: inherit; font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: color var(--t-1) var(--ease-out), background var(--t-1) var(--ease-out), box-shadow var(--t-1) var(--ease-out);
}
.card-tab-ico { display: grid; place-items: center; }
.card-tab-ico svg { width: 16px; height: 16px; display: block; }
@media (hover: hover) { .card-tab:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); } }
.card-tab.is-on {
  color: var(--ink); background: var(--bg-3);
  box-shadow: inset 0 1px 0 var(--hairline), 0 2px 10px rgba(0, 0, 0, .32), 0 0 0 1px color-mix(in srgb, var(--ink) 7%, transparent);
}
.card-tab.is-on .card-tab-ico { color: var(--accent-text); }
:root[data-theme="light"] .card-tabs { box-shadow: inset 0 1px 2px rgba(20, 24, 32, .08); }
:root[data-theme="light"] .card-tab.is-on { background: var(--bg-2); box-shadow: 0 1px 4px rgba(20, 24, 32, .14), 0 0 0 1px var(--line); }
/* A tab with nothing to show stays legible — it is quieter, not faded out, and
   the cursor, the tooltip and the toast on a click all say why. */
.card-tab.is-off { color: var(--ink-3); font-weight: 500; cursor: not-allowed; }
.card-tab.is-off:hover { background: none; color: var(--ink-3); }
.card-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.card-body { gap: 18px; padding-top: 18px; }
.card-panel { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
/* A panel that is not showing is hidden, and a display of its own must not undo that. */
.card-panel[hidden] { display: none; }
.card-panel:focus { outline: none; }

/* --------------------------------------------------------------- overview */
/* The art is the hero (DESIGN.md §0 — the app is a showcase for the card): it
   stands at the left on a glow of itself and stays while the side scrolls. */
.card-over {
  display: grid; grid-template-columns: minmax(230px, 38%) minmax(0, 1fr); gap: 30px; align-items: start;
}
.card-stage {
  position: sticky; top: 0; z-index: 0;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 8px 4px 6px;
}
.card-stage-glow { position: absolute; inset: 6% 2% 12%; z-index: -1; pointer-events: none; }
.card-stage-glow img {
  display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 32px;
  filter: blur(40px) saturate(2); opacity: .8; transform: translateY(6%) scale(1.06);
}
:root[data-theme="light"] .card-stage-glow img { opacity: .45; }
/* The art is the one thing in a dialog that moves: the card itself, to turn any way
   and over (card-turn.js writes its transform), its face and its back each a side. */
.card-dlg-art {
  /* As wide as fits, and never so tall that the pills under it fall out of the panel
     (the dialog's height less its head, tabs, padding and that row; 0.716 is a card's width for its height). */
  position: relative; width: 100%; max-width: min(360px, calc((min(720px, 88vh) - 340px) * 0.716)); aspect-ratio: var(--card-ratio);
  transform-style: preserve-3d; will-change: transform;
  /* Every drag on it turns it, never scrolls the dialog under it. */
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
  border-radius: 4.6% / 3.3%;
}
.card-dlg-art.is-turning { cursor: grabbing; }
.card-dlg-art:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
@media (min-width: 1100px) and (min-height: 760px) { .card-dlg-art { max-width: min(430px, calc((min(880px, 90vh) - 340px) * 0.716)); } }
.ct-face {
  position: absolute; inset: 0; border-radius: inherit; overflow: hidden;
  background: var(--pocket);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 34px 60px -22px rgba(0, 0, 0, .75), 0 14px 26px -12px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .08);
}
.ct-back { transform: rotateY(180deg); }
:root[data-theme="light"] .ct-face { box-shadow: 0 26px 44px -20px rgba(20, 24, 32, .45), 0 0 0 1px rgba(20, 24, 32, .1); }
.card-dlg-img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; -webkit-user-drag: none; }
/* A card the collection is missing never shimmers (design.css rule, said again for this shape). */
.ct-front.is-missing::after, .ct-front.is-missing::before { content: none; }
/* Under it: turn it over, put it back face on, and how to turn it by hand. */
.ct-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 6px; margin-top: -4px; }
.ct-btn { min-height: 30px; }
.ct-hint { flex-basis: 100%; text-align: center; font-size: 11.5px; color: var(--ink-3); }

/* What this copy is, under the card: a row of pills, each in its own colour (--tone). */
.card-status { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 360px; }
.card-status:empty { display: none; }
.card-pill {
  --tone: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px; height: 25px; padding: 0 11px 0 9px;
  border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 13%, var(--bg-3));
  border: 1px solid color-mix(in srgb, var(--tone) 32%, transparent);
}
.card-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.card-pill.is-owned { --tone: #4ade80; }
.card-pill.is-missing { --tone: #fbbf24; }
.card-pill.is-grade { --tone: #c084fc; }
.card-pill.is-locked { --tone: #818cf8; }
.card-pill.is-cover { --tone: #facc15; }
.card-pill.is-trade { --tone: #fb923c; }
.card-pill.is-first { color: #1a1206; border-color: transparent; background: linear-gradient(180deg, #ffe08a, #e9b949); }
.card-pill.is-first::before { display: none; }
:root[data-theme="light"] .card-pill { color: color-mix(in srgb, var(--tone) 62%, #000); }
:root[data-theme="light"] .card-pill.is-first { color: #1a1206; }

.card-dlg-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.card-dlg-flag {
  align-self: flex-start;
  font-size: var(--fs-micro); font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 10px; border-radius: var(--radius-pill);
  color: var(--ink-2); background: var(--bg-3);
  border: 1px solid var(--line); box-shadow: var(--glass-edge);
}
.card-dlg-flag.is-sell { color: #1a1408; border-color: transparent; background: linear-gradient(160deg, #f6dfa4, #d8b160); }
.card-dlg-flag.is-locked {
  color: var(--gold-text);
  border-color: color-mix(in srgb, var(--gold) 45%, var(--line));
  background: color-mix(in srgb, var(--gold) 10%, var(--bg-3));
}

/* The hero: what the card counts at, large and gold, its month drawn under it
   edge to edge, and the gauge of its listings at the foot. */
.card-hero {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 3px;
  padding: 16px 18px 15px; border-radius: 18px;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--gold) 13%, transparent), transparent 60%),
    color-mix(in srgb, var(--bg) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 24%, var(--line));
  box-shadow: var(--glass-edge), 0 16px 34px -22px color-mix(in srgb, var(--gold) 70%, transparent);
}
.card-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 24px; }
.card-worth-label {
  font-size: var(--fs-micro); font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3);
}
.card-worth-value {
  font-size: clamp(32px, 3.4vw, 42px); font-weight: 760; letter-spacing: -0.035em; line-height: 1.05;
  color: var(--gold-text); font-variant-numeric: tabular-nums;
}
.card-worth-value.is-est { font-size: clamp(28px, 3vw, 36px); opacity: .92; }
.card-worth-basis { font-size: var(--fs-sm); color: var(--ink-2); }
.card-trend-chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.card-trend-chip.is-up { color: #22c55e; background: color-mix(in srgb, #22c55e 15%, transparent); }
.card-trend-chip.is-down { color: var(--danger); background: color-mix(in srgb, var(--danger) 15%, transparent); }
.card-trend { height: 58px; margin: 8px -18px -4px; }
.card-trend svg { display: block; width: 100%; height: 100%; }
.card-trend.is-up { color: #22c55e; }
.card-trend.is-down { color: var(--danger); }
.card-trend[hidden], .card-trend-chip[hidden] { display: none; }

/* Where a price sits among its listings: low to high, the market a bead on it, the mid a tick. */
.card-range { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.card-range.is-compact { margin-top: 2px; }
.card-range-track {
  position: relative; height: 8px; border-radius: var(--radius-pill);
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--accent) 50%, transparent),
    color-mix(in srgb, var(--gold) 85%, transparent));
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35);
}
.card-range-mid {
  position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 2px;
  background: color-mix(in srgb, var(--ink) 55%, transparent);
}
.card-range-mark {
  position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 3px var(--gold), 0 2px 10px rgba(0, 0, 0, .5);
}
.card-range.is-compact .card-range-track { height: 6px; }
.card-range.is-compact .card-range-mark { width: 12px; height: 12px; margin: -6px 0 0 -6px; box-shadow: 0 0 0 2.5px var(--gold), 0 1px 6px rgba(0, 0, 0, .45); }
.card-range-ends {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 12px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.card-range-ends i {
  margin-right: 5px; font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3);
}

/* the card's own facts, as tiles */
.card-facts {
  margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px;
}
.card-fact {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding: 10px 12px 11px; border-radius: 13px;
  background: color-mix(in srgb, var(--bg-3) 78%, transparent);
  border: 1px solid var(--line); box-shadow: var(--glass-edge);
}
.card-fact.is-pick { grid-column: span 2; }
.card-facts dt {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3);
}
.card-fact-ico {
  display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 6px;
  color: var(--accent-text); background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.card-fact-ico svg { width: 13px; height: 13px; display: block; }
.card-facts dd { margin: 0; font-size: 14px; font-weight: 650; color: var(--ink); overflow-wrap: anywhere; }
.card-facts .card-printing { width: 100%; max-width: none; padding: 5px 8px; font-size: 13px; }

/* Actions as tiles: an icon in its own colour (--tone, the colour the card's
   button in the binder wears), its name under it. On: washed in the colour. */
.card-acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 8px; }
.card-act, .card-acts > .btn {
  --tone: var(--accent);
  --tone-text: var(--tone);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  height: auto; min-height: 78px; padding: 11px 6px 10px; border-radius: 13px; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600; line-height: 1.2; text-align: center; white-space: normal;
  color: var(--ink);
  background: color-mix(in srgb, var(--bg-3) 82%, transparent);
  border: 1px solid var(--line); box-shadow: var(--glass-edge);
  transition: transform var(--t-1) var(--ease-out), background var(--t-1) var(--ease-out), border-color var(--t-1) var(--ease-out);
}
.card-act-ico, .card-acts > .btn .ico {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  color: var(--tone-text); background: color-mix(in srgb, var(--tone) 16%, transparent);
  transition: background var(--t-1) var(--ease-out), color var(--t-1) var(--ease-out);
}
.card-act-ico svg, .card-acts > .btn .ico svg { width: 19px; height: 19px; display: block; }
@media (hover: hover) {
  .card-act:hover, .card-acts > .btn:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--tone) 50%, var(--line));
    background: color-mix(in srgb, var(--tone) 9%, var(--bg-3));
  }
}
.card-act:active, .card-acts > .btn:active { transform: translateY(0); }
.card-act:focus-visible, .card-acts > .btn:focus-visible { outline: 2px solid var(--tone); outline-offset: 2px; }
.card-act.is-on, .card-acts > .btn.is-on {
  border-color: color-mix(in srgb, var(--tone) 55%, var(--line));
  background: color-mix(in srgb, var(--tone) 13%, var(--bg-3));
}
.card-act.is-on .card-act-ico, .card-acts > .btn.is-on .ico { color: #0b0d12; background: var(--tone); }
.card-act[data-key="owned"] { --tone: #4ade80; }
.card-act[data-key="missing"] { --tone: #fbbf24; }
.card-act[data-key="lock"], .card-act[data-key="unlock"] { --tone: #818cf8; }
.card-act[data-key="cover"] { --tone: #facc15; }
.card-act[data-key="replace"] { --tone: #22d3ee; }
.card-act[data-key="sold"] { --tone: #f472b6; }
.card-act[data-key="grading"] { --tone: #c084fc; }
.card-act[data-key="photos"] { --tone: #60a5fa; }
.card-act.is-danger { --tone: #f87171; }
.card-acts > .card-watchlist { --tone: var(--accent); }
.card-acts > .card-want { --tone: #f472b6; }
.card-acts > .card-sell { --tone: var(--gold); }
@media (hover: hover) { .card-act.is-danger:hover { background: color-mix(in srgb, var(--danger) 16%, var(--bg-3)); } }
:root[data-theme="light"] .card-act, :root[data-theme="light"] .card-acts > .btn { --tone-text: color-mix(in srgb, var(--tone) 60%, #000); }

.card-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: 2px; }

/* What comes under the actions — your price, condition & grading, price alerts —
   reads as panels of the same kind, each headed as the sections are. */
.card-dlg-side > .card-own, .card-dlg-side > .card-grading, .card-dlg-side > .al-watch {
  margin-top: 0; padding: 14px 16px; border-radius: 16px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border: 1px solid var(--line); box-shadow: var(--glass-edge);
}
.card-dlg-side > .card-grading .card-grading-head h4,
.card-dlg-side > .al-watch .al-watch-head h3 {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 720; letter-spacing: -0.01em; text-transform: none; color: var(--ink);
}
.card-dlg-side > .card-grading .card-grading-head h4::before,
.card-dlg-side > .al-watch .al-watch-head h3::before {
  content: ""; width: 4px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 35%, transparent));
}

/* ---------------------------------------------------------------- sections */
.card-sec { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card-sec-head { display: flex; flex-direction: column; gap: 2px; }
.card-sec-head h3 {
  display: flex; align-items: center; gap: 8px;
  margin: 0; font-size: 14px; font-weight: 720; letter-spacing: -0.01em; color: var(--ink);
}
.card-sec-head h3::before {
  content: ""; width: 4px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 35%, transparent));
}
.card-sec-head p { margin: 0 0 0 12px; font-size: var(--fs-sm); color: var(--ink-3); max-width: 70ch; }
.card-fine { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--ink-3); max-width: 76ch; }
.card-empty {
  margin: 0; padding: 12px 14px; font-size: var(--fs-sm); line-height: 1.5; color: var(--ink-2);
  background: color-mix(in srgb, var(--bg-3) 80%, transparent); border: 1px solid var(--line); border-radius: 13px;
  box-shadow: var(--glass-edge);
}
.card-links { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.card-out { font-size: var(--fs-sm); color: var(--accent-text); align-self: flex-start; }

/* ----------------------------------------------------------- price tables */
/* One card per printing, side by side while they fit: its market large, its gauge, then every figure. */
.card-prints {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px;
  align-items: start;
}
.card-print {
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
  padding: 14px 16px 13px; border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-3) 80%, transparent), color-mix(in srgb, var(--bg) 80%, transparent));
  border: 1px solid var(--line); box-shadow: var(--glass-edge);
}
/* the printing the app's own values read */
.card-print.is-counted {
  border-color: color-mix(in srgb, var(--gold) 42%, var(--line));
  background:
    radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--gold) 11%, transparent), transparent 60%),
    color-mix(in srgb, var(--bg) 80%, transparent);
  box-shadow: var(--glass-edge), 0 14px 30px -22px color-mix(in srgb, var(--gold) 70%, transparent);
}
.card-print-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-print-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.card-print-tag {
  flex: none;
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--radius-pill);
  color: var(--gold-text);
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  background: color-mix(in srgb, var(--gold) 12%, transparent);
}
.card-print-pick { margin-left: auto; }
.card-print-hero { display: flex; align-items: baseline; gap: 6px; }
.card-print-hero b {
  font-size: 26px; font-weight: 760; letter-spacing: -0.03em; line-height: 1.1;
  color: var(--gold-text); font-variant-numeric: tabular-nums;
}
.card-print-hero span { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.card-prices { display: flex; flex-direction: column; }
.price-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 5px 0; font-size: 13px;
}
.price-row + .price-row { border-top: 1px solid var(--line-soft); }
.price-row span { color: var(--ink-3); min-width: 0; }
.price-row b { font-variant-numeric: tabular-nums; flex: none; }
.price-note { font-style: normal; color: var(--ink-3); opacity: .8; }
/* The figure every value in the app is counted at is the one picked out. */
.price-row.is-basis span { color: var(--ink-2); font-weight: 600; }
.price-row.is-basis b { color: var(--gold-text); font-size: 15px; font-weight: 700; }
.price-row.is-est b {
  padding: 1px 7px; border-radius: 5px; font-size: 14px; font-weight: 700;
  border: 1px dashed color-mix(in srgb, var(--gold) 60%, transparent);
  background: color-mix(in srgb, var(--gold) 8%, transparent);
}
.card-dlg-est { margin: 0; font-size: 12px; line-height: 1.5; color: var(--ink-3); }

/* -------------------------------------------------------------- history */
.card-hist {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px 18px; border-radius: 18px;
  background:
    radial-gradient(120% 100% at 100% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%),
    color-mix(in srgb, var(--bg) 80%, transparent);
  border: 1px solid var(--line); box-shadow: var(--glass-edge);
}
.hist-view { display: flex; flex-direction: column; gap: 8px; }
.hist-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.hist-change { font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.hist-change.is-up { color: #22c55e; }
.hist-change.is-down { color: var(--danger); }
.hist-change i { font-style: normal; font-weight: 500; font-size: 12px; color: var(--ink-3); }
.hist-ranges .seg-opt { height: 26px; min-height: 26px; padding: 0 11px; font-size: 12px; }
.hist-plot { position: relative; cursor: crosshair; touch-action: pan-y; border-radius: 6px; }
.hist-plot:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
/* the readout: a line at the day under the pointer, a dot on each series, and the figures */
.hist-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--ink-3); opacity: .55; pointer-events: none; }
.hist-pin {
  position: absolute; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%);
  background: var(--accent); border: 2px solid var(--bg); pointer-events: none;
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 70%, transparent);
}
.hist-pin.is-basis { background: var(--gold); box-shadow: 0 0 10px color-mix(in srgb, var(--gold) 70%, transparent); }
.hist-tip {
  position: absolute; top: 2px; z-index: 2; transform: translateX(calc(-50% + 0px));
  display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-radius: 10px;
  font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; pointer-events: none;
  background: color-mix(in srgb, var(--bg-3) 92%, transparent); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: var(--shadow-1, 0 6px 18px rgba(0,0,0,.35));
}
.hist-tip.is-left { transform: translateX(8px); }
.hist-tip.is-right { transform: translateX(calc(-100% - 8px)); }
.hist-tip b { font-size: 11px; font-weight: 650; color: var(--ink-3); }
.hist-tip-row.is-market { color: var(--accent-text); font-weight: 650; }
.hist-tip-row.is-basis { color: var(--gold-text); font-weight: 650; }
.hist-cross[hidden], .hist-pin[hidden], .hist-tip[hidden] { display: none; }
.hist-chart { display: block; width: 100%; height: auto; overflow: visible; }
.hist-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.hist-area { stroke: none; fill: color-mix(in srgb, var(--accent) 18%, transparent); }
.hist-line { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hist-line.is-market { stroke: var(--accent); filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--accent) 45%, transparent)); }
.hist-line.is-basis { stroke: var(--gold); stroke-dasharray: 4 3; }
.hist-dot.is-market { fill: var(--accent); }
.hist-dot.is-basis { fill: var(--gold); }
/* The high and low of the range, sitting on their guides (placed as a percentage
   of the chart's height, so they stay put however wide the dialog is). */
.hist-mark {
  position: absolute; right: 2px; transform: translateY(-50%);
  font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums;
  background: var(--bg); padding: 0 4px; border-radius: 4px;
}
.hist-axis {
  display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.hist-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 11.5px; color: var(--ink-2); }
.hist-key { display: inline-flex; align-items: center; gap: 6px; }
.hist-key::before {
  content: ""; width: 14px; height: 3px; border-radius: 2px; background: var(--accent);
}
.hist-key.is-basis::before { background: var(--gold); }

/* the 7- and 30-day changes, as tiles with an arrow */
.card-changes { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.card-change {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
  padding: 10px 12px 11px; border-radius: 13px;
  background: color-mix(in srgb, var(--bg-3) 80%, transparent); border: 1px solid var(--line); box-shadow: var(--glass-edge);
}
.card-change span { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.card-change b { font-size: 19px; font-weight: 750; letter-spacing: -0.02em; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.card-change i { font-style: normal; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.card-change.is-up { border-color: color-mix(in srgb, #22c55e 30%, var(--line)); }
.card-change.is-up b { color: #22c55e; }
.card-change.is-up b::before { content: "▲ "; font-size: .62em; vertical-align: .18em; }
.card-change.is-down { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.card-change.is-down b { color: var(--danger); }
.card-change.is-down b::before { content: "▼ "; font-size: .62em; vertical-align: .18em; }

/* -------------------------------------------------------------- details */
.card-details {
  margin: 0; padding: 14px 16px;
  display: grid; grid-template-columns: minmax(96px, max-content) minmax(0, 1fr); gap: 0 18px;
  font-size: var(--fs-sm); line-height: 1.5;
  background: color-mix(in srgb, var(--bg) 80%, transparent); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--glass-edge);
}
.card-details dt, .card-details dd { padding: 7px 0; border-top: 1px solid var(--line-soft); }
.card-details dt:first-of-type, .card-details dt:first-of-type + dd { border-top: 0; }
.card-details dt { color: var(--ink-3); font-weight: 650; }
.card-details dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.card-details.is-meta { font-size: 12px; }
.card-details.is-meta dd { color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* A narrow screen: the card on top, smaller, then everything else in one column. */
@media (max-width: 620px) {
  .card-head { padding: 16px 52px 12px 16px; }
  .card-over { grid-template-columns: minmax(0, 1fr); justify-items: stretch; gap: 18px; }
  .card-stage { position: relative; }
  .card-dlg-art { width: min(210px, 58vw); }
  .card-tabs { margin: 0 12px 4px; max-width: calc(100% - 24px); }
  .card-tab { padding: 0 11px; font-size: 12.5px; gap: 6px; }
  .card-acts { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .card-act, .card-acts > .btn { min-height: 72px; font-size: 11.5px; }
}
@media (max-width: 380px) {
  .card-tab-ico { display: none; }
  .card-fact.is-pick { grid-column: auto; }
}
:root[data-motion="reduced"] .card-act, :root[data-motion="off"] .card-act,
:root[data-motion="reduced"] .card-acts > .btn, :root[data-motion="off"] .card-acts > .btn { transition: none; }

/* ------------------------------------------ the shared card preview (peek.js)
   The big hover preview leads with the figure the app counts the card at, so
   that figure is marked there the same way it is in this dialog. Its own sheet
   (binder.css) belongs to another engineer this round; this is the one rule the
   price basis adds to it. */
.peek-prices .is-basis b { font-weight: 700; }
.peek-prices .is-basis span { color: var(--ink-2); font-weight: 600; }

/* =================================================================== help */
.modal.modal-help { width: min(700px, 100%); }
.help-body { gap: var(--sp-5); }
.help-group { display: flex; flex-direction: column; gap: var(--sp-2); }
.help-group h3 {
  margin: 0; font-size: var(--fs-micro); font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-text);
}
.help-list {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); box-shadow: var(--glass-edge);
  overflow: hidden;
}
.help-list li {
  display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 6px 16px; align-items: baseline;
  padding: 8px 13px; font-size: 13px;
}
.help-list li + li { border-top: 1px solid var(--line-soft); }
.help-k { min-width: 0; font-weight: 600; }
.help-v { color: var(--ink-2); min-width: 0; }
/* app.css sets the description to the right, from when a row was one line; beside a long one it reads better from the left. */
.modal .help-list .help-v { text-align: left; }
.kbd {
  display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 600;
  background: var(--bg-3); color: var(--ink);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
  padding: 1px 6px; box-shadow: var(--glass-edge);
}
@media (max-width: 560px) {
  .help-list li { grid-template-columns: minmax(0, 1fr); }
}

/* ======================================================== binder settings */
.modal.modal-settings {
  width: min(1200px, 100%); height: min(780px, 90vh); max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.settings { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.set-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 15px 56px 13px 20px;
  border-bottom: 1px solid var(--line); flex: none;
  box-shadow: var(--glass-edge);
}
.set-head h2 { font-size: 21px; font-weight: 760; letter-spacing: -0.026em; }
.set-titles { min-width: 0; }
/* The binder's name is one line, ellipsized; Preferences has a sentence there. */
.set-titles p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-prefs .set-titles p { white-space: normal; }
.set-ico { display: inline-grid; place-items: center; flex: none; line-height: 0; }

.set-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 190px minmax(0, 1fr); }
.set-nav {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 10px;
  border-right: 1px solid var(--line); overflow-y: auto;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
}
.set-tab {
  position: relative;
  display: flex; align-items: center; gap: 10px; flex: none;
  height: 40px; padding: 0 10px 0 7px; border: 1px solid transparent; border-radius: 12px;
  background: none; color: var(--ink-2); font-size: 13.5px; font-weight: 550; text-align: left; cursor: pointer;
  transition: background var(--t-1) var(--ease-out), color var(--t-1) var(--ease-out),
    border-color var(--t-1) var(--ease-out);
}
@media (hover: hover) { .set-tab:hover { background: var(--bg-3); color: var(--ink); } }
.set-tab[aria-selected="true"] {
  color: var(--ink); font-weight: 650;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--accent) 60%, transparent);
}
/* each section's icon on a small tile of its own; the chosen one lit */
.set-tab .set-ico {
  width: 26px; height: 26px; border-radius: 8px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  transition: background var(--t-1) var(--ease-out), color var(--t-1) var(--ease-out);
}
.set-tab[aria-selected="true"] .set-ico {
  color: var(--accent-ink); background: var(--accent-fill);
  box-shadow: 0 3px 10px -3px color-mix(in srgb, var(--accent) 70%, transparent);
}
.set-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.set-panels { min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 22px 24px; }

/* The preview's own panel, between the sections and their settings (settings.js
   placePreview): only where the dialog has room for three columns. Narrower,
   the preview heads the sections it helps with instead. */
.set-stage { display: none; }
@media (min-width: 1000px) {
  .set-layout { grid-template-columns: 196px minmax(300px, 360px) minmax(0, 1fr); }
  .set-stage {
    display: flex; flex-direction: column; min-width: 0; min-height: 0;
    overflow-y: auto; overscroll-behavior: contain;
    padding: 18px 18px 22px;
    border-right: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 35%, transparent);
  }
  .set-stage .set-preview-box { padding: 0; border: none; }
  /* the desk has the panel to itself: a bigger binder on it, with room to stand */
  .set-stage .set-desk { padding: 28px 18px 30px; }
  .set-stage .set-preview-binder > .bpage.set-preview-page { --pocket-w: 62px; --pocket-h: 87px; --gap: 7px; }
  .set-stage .set-preview-note { margin-top: 10px; }
}
.set-panel { display: flex; flex-direction: column; gap: 20px; }
.set-sec-head h3 { margin: 0; font-size: var(--fs-h3); font-weight: 650; letter-spacing: -0.01em; }
.set-sec-head p { margin: 3px 0 0; font-size: var(--fs-sm); color: var(--ink-3); max-width: 62ch; }

.sf-row { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.sf-row.is-off > :not(.set-label) { opacity: .5; }
.set-label {
  font-size: var(--fs-micro); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
}
.set-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.set-stack { display: grid; gap: 8px; max-width: 360px; }
.set-stack > [hidden] { display: none; }
.set-num { width: 96px; }
.set-sub {
  display: flex; flex-direction: column; gap: var(--sp-4);
  padding-left: var(--sp-4); border-left: 2px solid var(--line-soft);
}
.set-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.set-count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.set-note {
  margin: 0; font-size: var(--fs-sm); color: var(--ink-2);
  padding: 10px 13px; border-radius: var(--radius);
  background: var(--bg-3); border: 1px solid var(--line); box-shadow: var(--glass-edge);
}
.set-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.set-lock-note { color: var(--gold-text); }

/* --------------------------------------------------------------- switches */
.sf-row-switch { gap: 4px; }
.set-switch-label { position: relative; display: inline-flex; align-items: center; gap: 11px; align-self: flex-start; cursor: pointer; }
.set-switch-label .set-label { font-size: 13.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); }
.set-switch { position: absolute; left: 0; top: 50%; translate: 0 -50%; opacity: 0; width: 34px; height: 20px; margin: 0; pointer-events: none; }
.set-switch-track {
  position: relative; flex: none; width: 34px; height: 20px; border-radius: var(--radius-pill);
  background: var(--bg-3); border: 1px solid var(--line);
  box-shadow: var(--glass-edge);
  transition: background var(--t-2) var(--ease-out), border-color var(--t-2) var(--ease-out),
    box-shadow var(--t-2) var(--ease-out);
}
.set-switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--ink-3);
  transition: transform var(--t-2) var(--ease-spring), background var(--t-2) var(--ease-out);
}
.set-switch:checked + .set-switch-track {
  background: var(--accent-fill); border-color: transparent;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent),
    0 4px 14px color-mix(in srgb, var(--accent) 22%, transparent);
}
.set-switch:checked + .set-switch-track::after { transform: translateX(14px); background: var(--accent-ink); }
.set-switch:focus-visible + .set-switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.sf-row-switch .form-help { padding-left: 45px; max-width: 68ch; }

/* ------------------------------------------------------ segmented control */
.seg-choice {
  display: inline-flex; flex-wrap: wrap; align-self: flex-start; gap: 3px; padding: 4px;
  background: color-mix(in srgb, var(--bg) 62%, transparent); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .25);
}
:root[data-theme="light"] .seg-choice { box-shadow: inset 0 1px 2px rgba(20, 24, 32, .08); }
.seg-opt {
  /* relative: the hidden radio inside is placed against the option, not the
     dialog — else focusing it scrolled the whole dialog to where it hung. */
  position: relative;
  display: inline-flex; align-items: center; height: 30px; padding: 0 13px; border-radius: 9px;
  /* Some are <button>s (the card dialog's Raw / Graded): none of a button's own look. */
  border: 0; background: transparent; font-family: inherit;
  font-size: 13px; font-weight: 550; color: var(--ink-2); cursor: pointer; white-space: nowrap;
  transition: background var(--t-1) var(--ease-out), color var(--t-1) var(--ease-out);
}
@media (hover: hover) { .seg-opt:hover { color: var(--ink); background: var(--bg-3); } }
.seg-opt.is-on {
  color: var(--accent-ink); font-weight: 650;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-fill) 88%, #fff), var(--accent-fill));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 3px 12px -2px color-mix(in srgb, var(--accent) 45%, transparent);
}
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ------------------------------------------------------------ option tiles */
.opt-tiles { display: grid; grid-template-columns: repeat(var(--opt-cols, 5), minmax(0, 1fr)); gap: var(--sp-2); }
.opt-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0;
  padding: 10px 6px 11px;
  border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--bg-3) 62%, transparent);
  box-shadow: var(--glass-edge);
  text-align: center; cursor: pointer;
  transition: border-color var(--t-1) var(--ease-out), background var(--t-1) var(--ease-out),
    transform var(--t-1) var(--ease-out), box-shadow var(--t-1) var(--ease-out);
}
.opt-tile:hover {
  border-color: color-mix(in srgb, var(--ink) 20%, var(--line));
  transform: translateY(-2px); box-shadow: var(--glass-edge), var(--shadow-1);
}
.opt-tile.is-on {
  border-color: var(--accent); background: color-mix(in srgb, var(--accent) 11%, var(--bg));
  box-shadow: var(--glow-accent);
}
/* the chosen tile wears a check in its corner */
.opt-tile.is-on::after {
  content: "✓"; position: absolute; top: 6px; right: 6px; z-index: 2;
  display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  font-size: 11px; font-weight: 900; line-height: 1; color: var(--accent-ink); background: var(--accent-fill);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 55%, transparent);
}
.opt-tile:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt-tiles.is-off .opt-tile { cursor: default; opacity: .5; transform: none; }
.opt-visual { display: grid; place-items: center; width: 100%; margin-bottom: 3px; }
.opt-page {
  display: block; width: 58px; padding: 6px; border-radius: 7px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--cover, #2f6f4f) 90%, #000), var(--cover, #2f6f4f) 45%,
    color-mix(in srgb, var(--cover, #2f6f4f) 80%, #000));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14);
}
.opt-name { font-size: var(--fs-sm); font-weight: 650; color: var(--ink); }
.opt-help { font-size: var(--fs-micro); line-height: 1.35; color: var(--ink-3); }
.opt-help:empty { display: none; }
.opt-swatch {
  position: relative; display: block; width: 100%; height: 46px; overflow: hidden;
  border-radius: 7px; box-shadow: inset 0 0 0 1px var(--hairline);
}
.opt-swatch .bg-art { inset: 0; filter: none; }
/* cards in the dialog are pictures, not things to pick up */
.settings .slot-card { cursor: inherit; transition: none; }
.settings .slot-card:hover { transform: none; }

/* --------------------------------------------------------- picture input */
.dropzone {
  display: flex; align-items: center; gap: var(--sp-4); min-height: 78px; width: 100%;
  padding: 10px 14px; border: 2px dashed var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink-2); font-size: 13px; font-weight: 550; text-align: left; cursor: pointer;
  transition: border-color var(--t-1) var(--ease-out), background var(--t-1) var(--ease-out),
    color var(--t-1) var(--ease-out);
}
.dropzone:hover, .dropzone.is-over {
  border-color: var(--accent); color: var(--ink);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
}
.dropzone:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone.is-busy { opacity: .6; pointer-events: none; }
.drop-thumb {
  display: none; flex: none; width: 96px; height: 58px; border-radius: 6px;
  background: var(--bg-3) center / cover no-repeat; box-shadow: var(--shadow-1);
}
.dropzone.has-image .drop-thumb { display: block; }
.drop-body { display: flex; align-items: center; gap: 9px; }
.drop-actions { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.set-range-row { display: flex; align-items: center; gap: 12px; }
.set-range { flex: 1; max-width: 320px; accent-color: var(--accent); }
.set-out { min-width: 3.4em; font-size: var(--fs-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ live preview
   One preview, drawn with the binder's own card styles so it is the truth
   rather than an impression. It is never stuck over the settings: it has its
   own panel (.set-stage), or on a narrower dialog it heads the sections it
   helps with and scrolls away with them. */
.set-preview-box {
  /* (shell.css still has the old stuck-to-the-top rule; none of it applies now) */
  position: static; z-index: auto; margin: 0;
  padding: 0 0 16px; background: none;
  border-bottom: 1px solid var(--line-soft);
}
.set-preview-tag {
  display: block; margin-bottom: 7px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
}
/* The desk the miniature binder stands on: enough room around it that nothing
   is ever clipped, and the home of a background picture set to "Desk". The
   binder's own size and materials are binder.css's (.set-preview-binder). */
.set-desk {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 14px 16px 17px; border-radius: 10px;
  /* a lit surface rather than a void: one wash from the same top-left light */
  background:
    radial-gradient(120% 86% at 50% -14%, color-mix(in srgb, var(--ink) 7%, transparent), transparent 62%),
    var(--bg);
  border: 1px solid var(--line-soft);
  box-shadow: inset 0 1px 0 var(--hairline);
}
.set-desk > .bg-layer.is-desk { z-index: 0; border-radius: inherit; }
/* Three pocket columns, at the pitch the pocket sheet welds itself to. */
.grid.set-preview-grid { grid-template-columns: repeat(3, var(--pocket-w)); }
.set-preview-note { margin: 8px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--ink-3); }
.set-preview-note:empty { display: none; }

.settings > .modal-foot { padding: 12px 20px 14px; border-top: 1px solid var(--line); box-shadow: var(--glass-edge); }

/* ============================================================ preferences */
/* Laid out as Binder settings is (above, and prefs-dialog.js): the sections down
   the side, a live picture of what the open one changes, and its choices as
   pictures. No foot: every choice applies as it is picked. */
.modal-prefs .set-titles p.pf-saved { display: flex; align-items: center; gap: 8px; white-space: normal; }
.pf-saved-dot {
  flex: none; width: 7px; height: 7px; border-radius: 50%; background: #34d399;
  box-shadow: 0 0 0 3px color-mix(in srgb, #34d399 22%, transparent);
}
.prefs-dialog .set-panels { padding-bottom: calc(26px + env(safe-area-inset-bottom, 0px)); }
.pf-panel { gap: 24px; }
.pf-block { gap: 10px; }
.pf-block > .form-help { margin: 0; max-width: 62ch; }

/* -- the currency: its sign on a tile of its own, beside the list */
.pf-currency { display: flex; align-items: center; gap: 10px; max-width: 440px; }
.pf-currency .input { flex: 1; min-width: 0; }
.pf-currency-sign {
  flex: none; display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 8px; border-radius: 13px;
  font-size: 19px; font-weight: 800; letter-spacing: -.02em; color: var(--accent-ink);
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent-fill) 82%, #fff), var(--accent-fill));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 8px 18px -10px color-mix(in srgb, var(--accent) 80%, transparent);
}

/* -- tiles: what each basis would make the sample card worth, large */
.pf-tiles .opt-tile { padding: 12px 8px 12px; gap: 4px; }
.pf-basis-amt {
  padding: 8px 0 3px; font-size: 18px; font-weight: 780; letter-spacing: -.025em;
  color: var(--gold-text); font-variant-numeric: tabular-nums;
}
.pf-big-ico {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; margin: 2px 0 4px;
  color: var(--accent-text); background: color-mix(in srgb, var(--accent) 12%, transparent);
  transition: background var(--t-1) var(--ease-out), color var(--t-1) var(--ease-out);
}
.opt-tile.is-on .pf-big-ico {
  color: var(--accent-ink); background: var(--accent-fill);
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--accent) 75%, transparent);
}

/* -- a switch on a card of its own */
.pf-feature {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 14px;
  padding: 15px 16px; border-radius: 18px; cursor: pointer;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--bg-3) 55%, transparent);
  box-shadow: var(--glass-edge);
  transition: border-color var(--t-2) var(--ease-out), background var(--t-2) var(--ease-out), box-shadow var(--t-2) var(--ease-out);
}
@media (hover: hover) { .pf-feature:hover { border-color: color-mix(in srgb, var(--ink) 20%, var(--line)); } }
.pf-feature.is-on {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--bg));
  box-shadow: var(--glass-edge), 0 10px 26px -18px color-mix(in srgb, var(--accent) 80%, transparent);
}
.pf-feature:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pf-feature-ico {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px;
  color: var(--ink-2); background: color-mix(in srgb, var(--ink) 7%, transparent);
  transition: background var(--t-2) var(--ease-out), color var(--t-2) var(--ease-out);
}
.pf-feature.is-on .pf-feature-ico {
  color: var(--accent-ink); background: var(--accent-fill);
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--accent) 75%, transparent);
}
.pf-feature-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pf-feature-title { font-size: 14.5px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.pf-feature-help { font-size: var(--fs-sm); line-height: 1.5; color: var(--ink-3); }
.pf-feature-switch { position: relative; display: inline-flex; padding-top: 3px; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.pf-chip {
  padding: 3px 9px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 650;
  color: var(--ink-2); background: var(--bg-3); border: 1px solid var(--line);
  transition: color var(--t-2) var(--ease-out), border-color var(--t-2) var(--ease-out);
}
.pf-chip.is-warn { color: var(--gold-text); border-color: color-mix(in srgb, var(--gold) 40%, transparent); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.pf-feature.is-on .pf-chip:not(.is-warn) { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 38%, transparent); }

/* -- a card for a part with its own controls (alerts, the app) */
.pf-card-box {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 14px;
  padding: 15px 16px; border-radius: 18px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-3) 55%, transparent); box-shadow: var(--glass-edge);
}
.pf-card-box .pf-feature-ico { color: var(--accent-text); background: color-mix(in srgb, var(--accent) 13%, transparent); }
.pf-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pf-card-box .al-push { margin-top: 8px; }
.pf-card-box .al-push .form-help, .pf-card-box .al-push-text { margin: 0 0 8px; font-size: var(--fs-sm); }
.pf-install .sf-row { gap: 8px; }
.pf-install .set-label { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; text-transform: none; color: var(--ink); }

/* -- dropping a card on a pocket: four pockets, X over B, and what that leaves */
.pf-drop { --pk: 15px; --pk-gap: 3px; position: relative; display: grid; justify-items: center; gap: 4px; padding-top: 13px; }
.pf-drop-row { position: relative; display: flex; gap: var(--pk-gap); }
.pf-pk {
  display: grid; place-items: center; width: var(--pk); aspect-ratio: .714; border-radius: 3px;
  font-size: calc(var(--pk) * .55); font-weight: 800; color: #1b1f29;
  background: linear-gradient(160deg, #e9edf5, #b8c0d0);
  box-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.pf-pk.is-empty { background: none; box-shadow: none; border: 1px dashed color-mix(in srgb, var(--ink) 30%, transparent); }
.pf-pk.is-target { box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 3.5px var(--accent); }
.pf-pk.is-x, .pf-drop-x { color: var(--accent-ink); background: linear-gradient(160deg, color-mix(in srgb, var(--accent-fill) 70%, #fff), var(--accent-fill)); }
.pf-pk.is-moved { background: linear-gradient(160deg, #fbe6b2, #e2b75a); }
.pf-drop-x {
  position: absolute; z-index: 1; left: calc(var(--pk) + var(--pk-gap) + var(--pk) * .3); top: calc(var(--pk) * -.95);
  display: grid; place-items: center; width: var(--pk); aspect-ratio: .714; border-radius: 3px;
  font-size: calc(var(--pk) * .55); font-weight: 800;
  rotate: 9deg; box-shadow: 0 6px 12px -4px rgba(0,0,0,.6);
}
:root[data-motion="full"] .pf-drop-x { animation: pf-carry 1.8s var(--ease-in-out, ease-in-out) infinite alternate; }
@keyframes pf-carry { to { translate: 0 calc(var(--pk) * -.18); rotate: 4deg; } }
.pf-drop-arrow { font-size: calc(var(--pk) * .7); line-height: 1; color: var(--ink-3); }
.pf-drop.is-big { --pk: 50px; --pk-gap: 9px; gap: 12px; padding-top: 44px; }
.pf-drop.is-big .pf-pk, .pf-drop.is-big .pf-drop-x { border-radius: 7px; }
.pf-drop-note { margin-top: 2px; font-size: 11.5px; color: var(--ink-3); }

/* -- the theme, as two small screens */
.pf-shot {
  display: flex; flex-direction: column; width: 100%; max-width: 168px; aspect-ratio: 16 / 10.5; overflow: hidden;
  border-radius: 10px; box-shadow: 0 0 0 1px rgba(127,127,127,.28), 0 8px 18px -10px rgba(0,0,0,.6);
}
.pf-shot.is-dark { --s-bg: #0e1016; --s-bar: #151821; --s-ink: #e8ebf2; --s-line: rgba(255,255,255,.08); --s-card: #1d2230; }
.pf-shot.is-light { --s-bg: #f4f5f8; --s-bar: #ffffff; --s-ink: #1a1e28; --s-line: rgba(20,24,32,.1); --s-card: #ffffff; }
.pf-shot { background: var(--s-bg); }
.pf-shot-bar { display: flex; align-items: center; gap: 5px; height: 17%; padding: 0 8%; background: var(--s-bar); border-bottom: 1px solid var(--s-line); }
.pf-shot-bar i { height: 4px; width: 13%; border-radius: 2px; background: var(--s-ink); opacity: .22; }
.pf-shot-bar i:first-child { width: 7px; height: 7px; border-radius: 2px; background: var(--accent-fill); opacity: 1; margin-right: auto; }
.pf-shot-body { flex: 1; display: flex; flex-direction: column; gap: 7%; padding: 7% 8%; }
.pf-shot-body b { height: 12%; width: 46%; border-radius: 3px; background: linear-gradient(90deg, #f1c15b, #c8921f); }
.pf-shot-cards { flex: 1; display: flex; gap: 6%; }
.pf-shot-cards i { flex: 1; border-radius: 4px; background: var(--s-card); box-shadow: 0 0 0 1px var(--s-line), 0 3px 6px -3px rgba(0,0,0,.4); }
.pf-shot-btn { height: 13%; width: 34%; border-radius: var(--radius-pill); background: var(--accent-fill); }
/* a game theme's screen (skins.js shot): its own wall and ground, bar, cards and button */
.pf-shot.is-skin { background: var(--s-wall, linear-gradient(transparent, transparent)), var(--s-bg); }
.pf-shot.is-skin .pf-shot-bar { background: var(--s-bar); border-bottom-color: var(--s-line); }
.pf-shot.is-skin .pf-shot-bar i { background: var(--s-ink); opacity: .35; }
.pf-shot.is-skin .pf-shot-bar i:first-child { background: var(--s-btn); opacity: 1; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.pf-shot.is-skin .pf-shot-body b { background: var(--s-gold); }
.pf-shot.is-skin .pf-shot-cards i { background: var(--s-card); box-shadow: 0 0 0 1px var(--s-line), 0 3px 6px -3px rgba(0,0,0,.4); }
.pf-shot.is-skin .pf-shot-btn { background: var(--s-btn); }
.pf-tiles.pf-skins { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pf-tiles.pf-skins .opt-name { font-size: 13.5px; line-height: 1.15; }
.pf-tiles.pf-skins .opt-help { font-size: 10.5px; }

/* -- the accent: larger swatches */
.pf-accent .swatches { gap: 10px; }
.pf-accent .swatch.pf-swatch {
  width: 36px; height: 36px; background: var(--sw);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 6px 14px -8px var(--sw);
  transition: transform var(--t-1) var(--ease-spring), box-shadow var(--t-1) var(--ease-out);
}
@media (hover: hover) { .pf-accent .swatch.pf-swatch:hover { transform: scale(1.1); } }
.pf-accent .swatch.pf-swatch.is-on { box-shadow: 0 0 0 3px var(--bg-2), 0 0 0 5px var(--sw), 0 8px 18px -6px var(--sw); }
.pf-accent .accent-custom { width: 36px; height: 36px; }

/* ------------------------------------------------- the pictures (the stage) */
.pf-preview-box { display: flex; flex-direction: column; }
.pf-pv { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 4px 6px; width: 100%; }
.pf-card {
  position: relative; display: block; width: 100%; aspect-ratio: var(--card-ratio, .714); overflow: hidden;
  border-radius: 4.6% / 3.3%; background: var(--bg-3);
  box-shadow: 0 18px 32px -14px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.1);
}
.pf-card img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* no card in the collection to show: one drawn in the accent */
.pf-card.is-drawn { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 55%, #1b2030), color-mix(in srgb, var(--accent-2, var(--accent)) 35%, #0e1016)); }
.pf-card-drawn { position: absolute; inset: 7%; display: flex; flex-direction: column; gap: 6%; }
.pf-card-drawn i { display: block; border-radius: 4px; background: rgba(255,255,255,.16); }
.pf-card-drawn i:nth-child(1) { height: 8%; width: 70%; }
.pf-card-drawn i:nth-child(2) { flex: 1; background: radial-gradient(circle at 50% 45%, rgba(255,255,255,.4), rgba(255,255,255,.08) 55%); }
.pf-card-drawn i:nth-child(3) { height: 22%; }

/* Money */
.pf-pv-cardwrap { position: relative; width: 150px; }
.pf-badge {
  position: absolute; left: 8px; bottom: 8px; padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 760; font-variant-numeric: tabular-nums; color: #f4e3bd;
  background: rgba(5,6,10,.78); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.pf-total { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pf-total-label, .pf-app-label, .pf-live-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
}
.pf-total-amt, .pf-app-worth {
  font-size: 28px; font-weight: 780; letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1.1;
  background: linear-gradient(100deg, var(--gold), var(--gold-hi, var(--gold)) 45%, var(--gold));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.pf-ladder {
  display: grid; gap: 2px; width: 100%; max-width: 270px; padding: 6px; border-radius: 14px;
  background: color-mix(in srgb, var(--bg-3) 70%, transparent); border: 1px solid var(--line);
}
.pf-ladder-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 9px; font-size: 12.5px; color: var(--ink-3); }
.pf-ladder-row b { color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 650; }
.pf-ladder-row.is-on { color: var(--ink); background: color-mix(in srgb, var(--accent) 13%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.pf-ladder-row.is-on b { color: var(--gold-text); font-weight: 760; }
.pf-masked {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 650; color: var(--gold-text);
  background: color-mix(in srgb, var(--gold) 12%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
}
.pf-masked[hidden] { display: none; }
.pf-masked-ico { display: inline-grid; line-height: 0; }
.pf-masked-ico svg { width: 15px; height: 15px; }

/* Live data: the card dialog's price panel */
.pf-pv-live {
  align-items: stretch; gap: 10px; max-width: 290px; margin: 14px auto 0; padding: 14px; border-radius: 18px;
  background: var(--bg-2); border: 1px solid var(--line); box-shadow: var(--shadow-2);
}
.pf-live-head { display: flex; align-items: center; gap: 11px; }
.pf-card.is-sm { flex: none; width: 46px; box-shadow: 0 6px 12px -6px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.1); }
.pf-live-head > div, .pf-set-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pf-live-head b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-live-head span { font-size: 11.5px; color: var(--ink-3); }
.pf-live-rows { display: grid; gap: 4px; }
.pf-live-row {
  display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 9px;
  font-size: 12.5px; color: var(--ink-2); background: var(--bg-3);
  transition: opacity var(--t-2) var(--ease-out), box-shadow var(--t-2) var(--ease-out);
}
.pf-live-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pf-live-row.is-extra { opacity: .42; }
.pf-pv-live.is-on .pf-live-row.is-extra { opacity: 1; box-shadow: inset 3px 0 0 var(--accent); }
.pf-live-chartbox { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 9px 10px 8px; border-radius: 11px; background: var(--bg-3); }
.pf-live-chart { display: block; height: 42px; color: var(--ink-3); opacity: .35; transition: color var(--t-2) var(--ease-out), opacity var(--t-2) var(--ease-out); }
.pf-live-chart svg { display: block; width: 100%; height: 100%; }
.pf-pv-live:not(.is-on) .pf-live-chart path { stroke-dasharray: 4 5; }
.pf-pv-live.is-on .pf-live-chart { color: var(--accent); opacity: 1; }

/* Binder */
.pf-pv-title { font-size: 15px; font-weight: 750; letter-spacing: -.01em; }

/* Collections: a set, as Collections → Sets shows it */
.pf-set {
  display: flex; align-items: center; gap: 13px; width: 100%; max-width: 300px; padding: 13px 14px; border-radius: 16px;
  background: color-mix(in srgb, var(--bg-3) 60%, transparent); border: 1px solid var(--line); box-shadow: var(--glass-edge);
}
.pf-set-body { flex: 1; gap: 5px; }
.pf-set-body b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-set-kinds { font-size: 11.5px; color: var(--accent-text); font-weight: 650; }
.pf-set-meter { height: 6px; border-radius: var(--radius-pill); overflow: hidden; background: color-mix(in srgb, var(--ink) 10%, transparent); }
.pf-set-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2, var(--accent))); transition: width 420ms var(--ease-out); }
.pf-set-count { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Appearance: the app in small */
.pf-app { width: 100%; max-width: 300px; overflow: hidden; border-radius: 18px; background: var(--bg); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.pf-app-top { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.pf-app-logo { width: 15px; height: 15px; margin-right: auto; border-radius: 5px; background: var(--accent-fill); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 50%, transparent); }
.pf-app-pill { width: 24px; height: 8px; border-radius: var(--radius-pill); background: var(--bg-3); }
.pf-app-pill.is-on { background: color-mix(in srgb, var(--accent) 45%, var(--bg-3)); }
.pf-app-hero {
  display: flex; flex-direction: column; gap: 5px; padding: 13px 14px 4px;
  background: radial-gradient(120% 100% at 0% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 62%);
}
.pf-app-bar { height: 5px; margin-top: 3px; border-radius: var(--radius-pill); overflow: hidden; background: color-mix(in srgb, var(--ink) 10%, transparent); }
.pf-app-bar i { display: block; width: 62%; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2, var(--accent))); }
.pf-app-fan { position: relative; height: 118px; }
.pf-card.is-fan { position: absolute; left: 50%; top: 14px; width: 62px; margin-left: -31px; }
.pf-card.is-fan.is-a { transform: translateX(-62%) rotate(-12deg); }
.pf-card.is-fan.is-b { z-index: 1; transform: translateY(-4px); }
.pf-card.is-fan.is-c { transform: translateX(62%) rotate(12deg); }
.pf-pv-look[data-motion="full"] .pf-card.is-fan { animation: pf-bob 3.4s ease-in-out infinite alternate; }
.pf-pv-look[data-motion="full"] .pf-card.is-fan.is-b { animation-delay: -1.1s; }
.pf-pv-look[data-motion="full"] .pf-card.is-fan.is-c { animation-delay: -2.2s; }
@keyframes pf-bob { to { translate: 0 -7px; } }
.pf-app-row { display: flex; align-items: center; gap: 8px; padding: 10px 14px 14px; }
.pf-app-btn { padding: 6px 12px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 720; color: var(--accent-ink); background: var(--accent-fill); }
.pf-app-chip { padding: 4px 10px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 650; color: var(--accent-text); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.pf-app-switch.set-switch-track { margin-left: auto; background: var(--accent-fill); border-color: transparent; }
.pf-app-switch.set-switch-track::after { background: #fff; transform: translateX(14px); }

/* Bottom bar: its own big picture, stacked in the narrow panel */
.pf-pv-bar .navpick-hero { grid-template-columns: minmax(0, 1fr); width: 100%; }
.pf-pv-bar .navpick-screen { height: 170px; }

/* Alerts: a push on a phone, and the bell's inbox */
.pf-pv-alerts { align-items: stretch; max-width: 300px; margin: 0 auto; }
.pf-phone { padding: 16px 12px 20px; border-radius: 22px; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 34%, #141022), #0b0d12 75%); }
.pf-push {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; color: #f3f5fa;
  background: rgba(255,255,255,.14); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 10px 22px -12px rgba(0,0,0,.8);
}
:root[data-motion="full"] .pf-push { animation: pf-drop-in 900ms var(--ease-spring) both; }
@keyframes pf-drop-in { from { transform: translateY(-14px); opacity: 0; } }
.pf-push-app { flex: none; width: 30px; height: 30px; border-radius: 9px; background: url('/icons/icon-192.png') center / cover, var(--accent-fill); }
.pf-push > div, .pf-note > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pf-push b { font-size: 12.5px; }
.pf-push span { font-size: 11.5px; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-inbox { overflow: hidden; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.pf-inbox-head { display: flex; align-items: center; gap: 8px; padding: 10px 13px; font-size: 13px; font-weight: 720; border-bottom: 1px solid var(--line-soft); }
.pf-inbox-head .set-ico { color: var(--accent-text); }
.pf-note { display: flex; align-items: center; gap: 10px; padding: 10px 13px; }
.pf-note + .pf-note { border-top: 1px solid var(--line-soft); }
.pf-card.is-xs { flex: none; width: 30px; box-shadow: 0 0 0 1px rgba(255,255,255,.1); }
.pf-note b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-note.is-up b::before { content: "▲ "; color: #4ade80; font-size: 10px; }
.pf-note.is-down b::before { content: "▼ "; color: #f87171; font-size: 10px; }
.pf-note span { font-size: 11px; color: var(--ink-3); }
.pf-note-dot { flex: none; margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }

/* App: a home screen, with ours among the others */
.pf-home {
  display: grid; grid-template-columns: repeat(4, 42px); gap: 18px 16px; padding: 24px 20px 30px; border-radius: 28px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--accent) 38%, #1c1230), #0b0d12 80%);
  box-shadow: var(--shadow-2);
}
.pf-home-ico { position: relative; width: 42px; height: 42px; border-radius: 12px; background: hsl(var(--h, 200) 40% 42% / .5); }
.pf-home-ico.is-us { background: none; box-shadow: 0 0 0 2px color-mix(in srgb, #fff 80%, transparent), 0 10px 24px -6px var(--accent); }
.pf-home-ico.is-us img { display: block; width: 100%; height: 100%; border-radius: inherit; }
:root[data-motion="full"] .pf-home-ico.is-us { animation: pf-wiggle 2.6s ease-in-out infinite; }
@keyframes pf-wiggle { 0%, 70%, 100% { rotate: 0deg; } 76% { rotate: -5deg; } 82% { rotate: 5deg; } 88% { rotate: -3deg; } 94% { rotate: 2deg; } }
.pf-home-name {
  position: absolute; left: 50%; top: calc(100% + 4px); translate: -50% 0;
  font-size: 9.5px; font-weight: 650; color: #fff; white-space: nowrap; text-shadow: 0 1px 3px rgba(0,0,0,.6);
}

/* a phone: the picture heads its section, a size smaller */
@media (max-width: 999px) {
  .pf-preview-box { margin: 2px 0 4px; padding: 6px 12px 12px; border-radius: 16px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 40%, transparent); }
  .pf-pv { padding-top: 10px; }
  .pf-pv-cardwrap { width: 112px; }
  .pf-ladder { display: none; }
  .pf-drop.is-big { --pk: 40px; --pk-gap: 7px; padding-top: 36px; }
}
@media (max-width: 720px) {
  /* two choices side by side, whatever the width */
  .pf-tiles.pf-theme, .pf-tiles.pf-drop-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-tiles.pf-skins { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-tiles.pf-basis, .pf-tiles.pf-motion { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}
@media (max-width: 640px) {
  .pf-feature, .pf-card-box { gap: 12px; padding: 13px 14px; }
  .pf-feature-ico, .pf-card-box .pf-feature-ico { width: 36px; height: 36px; border-radius: 11px; }
}

/* -- what a set counts: each kind a toggle with a picture of it */
.pf-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 520px; }
.pf-kinds .chip {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px;
  height: auto; min-height: 104px; padding: 14px 8px 12px; border-radius: 16px;
  font-size: 13px; font-weight: 700; color: var(--ink-2);
  border: 1px solid var(--line); background: color-mix(in srgb, var(--bg-3) 62%, transparent); box-shadow: var(--glass-edge);
}
.pf-kinds .chip::before {
  content: ""; width: 44px; height: 44px; background: currentColor; opacity: .55;
  -webkit-mask: var(--kind-pic) center / contain no-repeat; mask: var(--kind-pic) center / contain no-repeat;
}
.pf-kinds .chip[data-value="card"] { --kind-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='6' y='2.5' width='12' height='17' rx='1.8' fill='none' stroke='black' stroke-width='1.6'/%3E%3Ccircle cx='12' cy='9' r='3' fill='black'/%3E%3Cpath d='M8.5 14.5h7M8.5 16.8h5' stroke='black' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
.pf-kinds .chip[data-value="sealed"] { --kind-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l8.5 4.3v10.4L12 21.5l-8.5-4.3V6.8z' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M3.5 6.8L12 11l8.5-4.2M12 11v10.5' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.pf-kinds .chip[data-value="accessory"] { --kind-pic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='5' y='4' width='14' height='18' rx='2' fill='none' stroke='black' stroke-width='1.6'/%3E%3Cpath d='M5 8h14' stroke='black' stroke-width='1.6'/%3E%3Cpath d='M9 2.5h6' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
.pf-kinds .chip[aria-pressed="true"] {
  color: var(--ink); border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, var(--bg)); box-shadow: var(--glow-accent);
}
.pf-kinds .chip[aria-pressed="true"]::before { opacity: 1; background: var(--accent-text); }
.pf-kinds .chip[aria-pressed="true"]::after {
  content: "✓"; position: absolute; top: 7px; right: 7px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  font-size: 11px; font-weight: 900; line-height: 1; color: var(--accent-ink); background: var(--accent-fill);
}

/* ============================================================== responsive */
/* The picker fills a phone's screen (search.css), and its head shrinks with it. */
@media (max-width: 640px), (max-height: 520px) {
  .modal.modal-picker .picker-head { padding-right: 50px; }
  .modal.modal-picker .modal-x { top: 7px; right: 7px; }
}
@media (max-width: 720px) {
  .modal.modal-settings { height: min(100dvh - 24px, 760px); }
  .set-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .set-nav {
    flex-direction: row; gap: 4px; overflow-x: auto; scrollbar-width: none;
    border-right: none; border-bottom: 1px solid var(--line); padding: 8px 10px;
  }
  .set-nav::-webkit-scrollbar { display: none; }
  .set-tab { flex: none; }
  .set-tab[aria-selected="true"]::before { left: 8px; right: 8px; top: auto; bottom: -1px; width: auto; height: 2px; }
  .set-panels { padding: 14px 16px 20px; }
  /* A phone's dialog is shorter, so the binder comes down a size — still the
     whole object, still every material, just less of the panel taken up. */
  .set-preview-binder > .bpage.set-preview-page { --pocket-w: 40px; --pocket-h: 56px; }
  .set-desk { padding: 11px 12px 13px; }
  .opt-tiles { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
  .set-pair { grid-template-columns: minmax(0, 1fr); }
}
/* A phone: Binder settings is the whole screen (shell.css), so the two height
   rules above must not cut it short — they left a strip of the page showing
   under it. Its buttons then sit at the very bottom, clear of the home bar. */
@media (max-width: 640px) {
  .modal.modal-settings { height: auto; max-height: none; }
  .settings > .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 480px) {
  .modal-body { padding-left: 16px; padding-right: 16px; }
  .modal-head { padding-left: 16px; padding-right: 52px; }
  .modal-foot { padding-left: 16px; padding-right: 16px; }
  .set-head { padding: 12px 52px 12px 16px; }
  .modal-x { top: 8px; right: 8px; }
}

/* =================================================================== print */
@media print {
  .modal-root { display: none !important; }
}

/* Preferences → Accent colour: the swatches, then any colour through the system picker. */
.accent-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.accent-custom {
  width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 50%;
  background: conic-gradient(from 0deg, #f87171, #fbbf24, #4ade80, #38bdf8, #a78bfa, #f472b6, #f87171);
  cursor: pointer; overflow: hidden;
}
.accent-custom::-webkit-color-swatch-wrapper { padding: 0; }
.accent-custom::-webkit-color-swatch { border: none; border-radius: 50%; opacity: 0; }
.accent-custom.is-on::-webkit-color-swatch { opacity: 1; }
.accent-custom::-moz-color-swatch { border: none; border-radius: 50%; opacity: 0; }
.accent-custom.is-on::-moz-color-swatch { opacity: 1; }
.accent-custom.is-on { box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 4px var(--accent); }
.accent-custom:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.accent-pick .swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.accent-pick .swatch { width: 30px; height: 30px; border-radius: 50%; border: none; }
.accent-pick .swatch.is-on { box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 4px var(--ink); }

/* Binder settings → Pricing: the percentage, and the quick steps beside it. */
.set-adjust { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.set-unit { color: var(--ink-2); font-weight: 600; margin-left: -4px; }

/* The card dialog → Your price. */
.card-own { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.card-own-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-own-input { width: 120px; }

/* The card dialog → Condition & grading (cardinfo.js gradingSection): raw or
   graded, then a row per thing to pick, label on the left, choices beside it. */
.card-grading {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 14px; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
  box-shadow: var(--glass-edge);
}
.card-grading-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-grading-head h4 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .01em; }
.card-grade-badge {
  font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em;
  padding: 2px 8px 2px 9px; border-radius: 6px; background: var(--bg-3); color: var(--ink);
  box-shadow: inset 3px 0 0 var(--tone, var(--accent)), inset 0 0 0 1px var(--line);
}
.card-grade-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 8px; }
.card-grade-label { font-size: 12px; font-weight: 650; color: var(--ink-2); }
.card-grade-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.card-grade-select { width: auto; min-width: 110px; max-width: 160px; }
.card-grade-cert-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-grade-cert { width: 150px; font-variant-numeric: tabular-nums; }
.card-subgrades > summary { cursor: pointer; font-size: 12px; font-weight: 650; color: var(--ink-2); padding: 2px 0; }
.card-subgrade-grid { display: grid; gap: 8px; margin-top: 8px; }
.card-grading .card-own { margin-top: 2px; }
@media (max-width: 480px) {
  .card-grade-row { grid-template-columns: minmax(0, 1fr); gap: 5px; }
}

/* ---- the card dialog's "For trade" (cardinfo.js gradingSection) */
.card-trade { display: flex; align-items: flex-start; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft, var(--line)); cursor: pointer; }
.card-trade input { flex: none; width: 17px; height: 17px; margin-top: 2px; accent-color: var(--accent); }
.card-trade > span { display: flex; flex-direction: column; gap: 2px; }
.card-trade b { font-size: 13px; }
.card-trade > span > span { font-size: 12px; color: var(--ink-3); line-height: 1.4; }

/* ---- Sold… (sales.js) */
.modal.modal-sell { width: min(520px, 100%); }
.sell-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.sell-grid .form-row { margin: 0; }
.sell-hint { display: block; font-size: 11.5px; font-weight: 400; color: var(--ink-3); }
.sell-remove { display: flex; align-items: center; gap: 10px; font-size: 13.5px; cursor: pointer; }
.sell-remove input { width: 17px; height: 17px; accent-color: var(--accent); }
@media (max-width: 420px) { .sell-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- Export (export.js exportRow): each way out of the binder a panel, its icon on a tile in its own colour. */
.exp-row {
  --tone: var(--accent);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 16px;
  background: color-mix(in srgb, var(--bg-3) 70%, transparent);
  border: 1px solid var(--line); box-shadow: var(--glass-edge);
}
.exp-row.is-print { --tone: #818cf8; }
.exp-row.is-png { --tone: #22d3ee; }
.exp-row.is-csv { --tone: #4ade80; }
.exp-ico {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 30%, transparent);
}
.exp-ico svg { width: 21px; height: 21px; display: block; }
.exp-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.exp-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.exp-desc { font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.exp-check { margin-top: 6px; font-size: 12.5px; }
.exp-go { flex: none; }
:root[data-theme="light"] .exp-ico { color: color-mix(in srgb, var(--tone) 62%, #000); }
@media (max-width: 520px) {
  .exp-row { grid-template-columns: auto minmax(0, 1fr); }
  .exp-go { grid-column: 2; justify-self: start; }
}
.modal.modal-export { width: min(600px, 100%); }

/* ---- Binder settings → Collection: every card at once (settings.js markRow).
   How the binder stands, owned against missing, over a tile for each way to mark it. */
.mk-all {
  display: flex; flex-direction: column; gap: 9px; padding: 13px 14px 14px;
  border: 1px solid var(--line); border-radius: 16px;
  background: color-mix(in srgb, var(--bg-3) 55%, transparent); box-shadow: var(--glass-edge);
}
.mk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mk-count { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.mk-count b { font-size: 14px; font-weight: 750; }
.mk-count b.is-owned { color: #34d399; }
.mk-count b.is-missing { color: var(--ink-2); }
.mk-pct { font-size: 12px; font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mk-meter {
  display: block; height: 7px; border-radius: var(--radius-pill); overflow: hidden;
  background: color-mix(in srgb, var(--ink) 9%, transparent); box-shadow: inset 0 0 0 1px var(--hairline);
}
.mk-meter-fill {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, #10b981, #34d399);
  box-shadow: 0 0 10px color-mix(in srgb, #34d399 55%, transparent);
  transition: width var(--t-3) var(--ease-out);
}
.mk-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 3px; }
.mk-tile {
  --tone: #34d399;
  display: flex; align-items: center; gap: 11px; min-width: 0; padding: 10px 12px;
  font: inherit; text-align: left; color: var(--ink); cursor: pointer;
  border: 1px solid var(--line); border-radius: 13px;
  background: color-mix(in srgb, var(--bg) 55%, transparent); box-shadow: var(--glass-edge);
  transition: border-color var(--t-1) var(--ease-out), background var(--t-1) var(--ease-out),
    transform var(--t-1) var(--ease-out), box-shadow var(--t-1) var(--ease-out);
}
.mk-tile.is-missing { --tone: #94a3b8; }
.mk-ico {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 15%, transparent);
  transition: background var(--t-1) var(--ease-out), color var(--t-1) var(--ease-out);
}
.mk-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mk-text b { font-size: 13.5px; font-weight: 650; }
.mk-sub { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) {
  .mk-tile:not(:disabled):hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--tone) 50%, var(--line));
    background: color-mix(in srgb, var(--tone) 8%, var(--bg));
    box-shadow: var(--glass-edge), 0 10px 22px -14px color-mix(in srgb, var(--tone) 80%, transparent);
  }
  .mk-tile:not(:disabled):hover .mk-ico { color: #0b0d12; background: var(--tone); }
}
.mk-tile:active:not(:disabled) { transform: translateY(0) scale(.99); }
.mk-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mk-tile:disabled { cursor: default; opacity: .5; }
:root[data-theme="light"] .mk-tile { --tone: #059669; }
:root[data-theme="light"] .mk-tile.is-missing { --tone: #64748b; }
:root[data-theme="light"] .mk-count b.is-owned { color: #059669; }
:root[data-theme="light"] .mk-tile:not(:disabled):hover .mk-ico { color: #fff; }
@media (max-width: 520px) { .mk-tiles { grid-template-columns: minmax(0, 1fr); } }
