/* Source: styles/theme.css */
:root {
  --ink: #0a1a28;
  --ink-2: #0f2436;
  --ink-3: #13293d;
  --panel: #3a1519;
  --panel-2: #301114;
  --panel-blue: #123449;
  --panel-blue-2: #163c53;
  --brass: #c9a24b;
  --brass-dim: #8e7735;
  --brass-glow: color-mix(in srgb, var(--brass) 14%, transparent);
  --parchment: #efe6d0;
  --parchment-dim: #dccfaa;
  --danger: #b5484d;
  --success: #5c8b6e;
  --line: color-mix(in srgb, var(--brass) 20%, transparent);
  --radius: 10px;
}

:root {
  --pop-bg: #2a1216;
  --pop-line: #502a30;
  --field: #231015;
  --field-line: #4a2a30;
  --hl: rgba(170, 62, 70, 0.2);
}
/* admiral: commander red fields */

html[data-mode='commander'] {
  --pop-bg: #0f2739;
  --pop-line: #2c5070;
  --field: #102839;
  --field-line: #2c4e6c;
  --hl: rgba(64, 118, 168, 0.24);
  --panel: #123449;
  --panel-2: #163c53;
}
/* commander: admiral blue fields */

html[data-theme='light'] {
  --pop-bg: #f6e9e7;
  --pop-line: #d9bdb9;
  --field: #f7ecea;
  --field-line: #dcc4c0;
  --hl: rgba(170, 62, 70, 0.1);
}

html[data-mode='commander'][data-theme='light'] {
  --pop-bg: #e8f0f7;
  --pop-line: #b9cedf;
  --field: #eaf1f8;
  --field-line: #bfd2e2;
  --hl: rgba(64, 118, 168, 0.12);
  --panel: #edf3f9;
  --panel-2: #e3edf6;
}

html[data-mode='commander'] {
  --ink: #2a1014;
  --ink-2: #341620;
  --ink-3: #3e1822;
  --ink-deep: #1c0d10;
  --glow: rgba(170, 62, 70, 0.13);
  --line: color-mix(in srgb, var(--brass) 22%, transparent);
  --brass: #f0b94a;
  --brass-glow: color-mix(in srgb, var(--brass) 12%, transparent);
  --panel-brass: #f0b94a;
  --panel-brass-dim: #8e7735;
  --panel-brass-glow: color-mix(in srgb, var(--brass) 12%, transparent);
  --panel-parchment: #efe6d0;
  --panel-parchment-dim: #dccfaa;
  --panel-line: color-mix(in srgb, var(--brass) 22%, transparent);
}

/* ── Guild palettes ─────────────────────────────────────────────────────
   Two roles, five Magic colours each. data-main paints the INK: the page
   background, the deep covers, the body glow and the text tints. data-side
   paints the SURFACES: panels, fields, pop-ups, highlights. Any colour can
   take either role, so the ten two-colour guilds are the ten pairings
   (GUILDS in the script). Izzet — red ink, blue surfaces — is the look the
   app always had; the base block above is the pre-guild pair, so a page with
   no data-main/data-side yet paints something close without a flash. Hues
   ARE the official card colours (symbol colour per Magic colour: U 14,104,171
   · R 211,32,42 · G 0,115,62; frame tints W 248,231,185 and B's grey
   166,159,157 over its 21,11,0): the ink is the colour at ~55% brightness,
   the surfaces at ~75%, lines and highlights the frame tint; black is the
   near-black itself, its grey tint only in lines. White is the
   frame cream itself, at full brightness, with DARK text and dark gold —
   text colour is a property of whichever role (page or surface) the text
   sits on, see the surface rule below. */

html[data-main='W'] {
  --ink: #f1e0ac;
  --ink-2: #ecd8a0;
  --ink-3: #e7d195;
  --ink-deep: #e0cb92;
  --glow: rgba(255, 255, 255, 0.3);
  --brass: #7a5c18;
  --brass-dim: #6e5518;
  --brass-glow: rgba(122, 92, 24, 0.14);
  --parchment: #171310;
  --parchment-dim: #3b3429;
  --line: rgba(122, 92, 24, 0.7);
}

html[data-main='U'] {
  --ink: #08395e;
  --ink-2: #124164;
  --ink-3: #1c496b;
  --ink-deep: #062944;
  --glow: rgba(14, 104, 171, 0.3);
  --parchment: #f0ebe0;
  --parchment-dim: #d8d1c3;
  --line: color-mix(in srgb, var(--brass) 62%, transparent);
}

html[data-main='B'] {
  --ink: #15110e;
  --ink-2: #16110d;
  --ink-3: #1e1813;
  --ink-deep: #131110;
  --glow: rgba(166, 159, 157, 0.1);
  --parchment: #f0ebe0;
  --parchment-dim: #d8d1c3;
  --line: color-mix(in srgb, var(--brass) 62%, transparent);
}

html[data-main='R'] {
  --ink: #741217;
  --ink-2: #7a1b20;
  --ink-3: #7f2429;
  --ink-deep: #540d11;
  --glow: rgba(211, 32, 42, 0.3);
  --parchment: #f0ebe0;
  --parchment-dim: #d8d1c3;
  --line: color-mix(in srgb, var(--brass) 62%, transparent);
}

html[data-main='G'] {
  --ink: #003f22;
  --ink-2: #0a472b;
  --ink-3: #144e34;
  --ink-deep: #002d18;
  --glow: rgba(0, 115, 62, 0.3);
  --parchment: #f0ebe0;
  --parchment-dim: #d8d1c3;
  --line: color-mix(in srgb, var(--brass) 62%, transparent);
}

html[data-side='W'] {
  --hl: rgba(122, 92, 24, 0.12);
  --panel: #eedba5;
  --panel-2: #e9d499;
  --panel-brass: #7a5c18;
  --panel-brass-dim: #6e5518;
  --panel-brass-glow: rgba(122, 92, 24, 0.14);
  --panel-parchment: #171310;
  --panel-parchment-dim: #3b3429;
  --panel-line: rgba(122, 92, 24, 0.7);
}

html[data-side='U'] {
  --hl: rgba(179, 206, 234, 0.25);
  --panel: #0b4e80;
  --panel-2: #155586;
  --panel-brass: #f0b94a;
  --panel-brass-dim: #8e7735;
  --panel-brass-glow: color-mix(in srgb, var(--brass) 12%, transparent);
  --panel-parchment: #f0ebe0;
  --panel-parchment-dim: #d8d1c3;
  --panel-line: color-mix(in srgb, var(--brass) 62%, transparent);
}

html[data-side='B'] {
  --hl: rgba(166, 159, 157, 0.2);
  --panel: #1f1b18;
  --panel-2: #282320;
  --panel-brass: #f0b94a;
  --panel-brass-dim: #8e7735;
  --panel-brass-glow: color-mix(in srgb, var(--brass) 12%, transparent);
  --panel-parchment: #f0ebe0;
  --panel-parchment-dim: #d8d1c3;
  --panel-line: color-mix(in srgb, var(--brass) 62%, transparent);
}

html[data-side='R'] {
  --hl: rgba(235, 159, 130, 0.25);
  --panel: #9e1820;
  --panel-2: #a32129;
  --panel-brass: #f0b94a;
  --panel-brass-dim: #8e7735;
  --panel-brass-glow: color-mix(in srgb, var(--brass) 12%, transparent);
  --panel-parchment: #f0ebe0;
  --panel-parchment-dim: #d8d1c3;
  --panel-line: color-mix(in srgb, var(--brass) 62%, transparent);
}

html[data-side='G'] {
  --hl: rgba(196, 211, 202, 0.25);
  --panel: #00562f;
  --panel-2: #0a5d37;
  --panel-brass: #f0b94a;
  --panel-brass-dim: #8e7735;
  --panel-brass-glow: color-mix(in srgb, var(--brass) 12%, transparent);
  --panel-parchment: #f0ebe0;
  --panel-parchment-dim: #d8d1c3;
  --panel-line: color-mix(in srgb, var(--brass) 62%, transparent);
}

/* Icon tints of the MAIN colour, chosen per plate polarity: light plates
   (W side) carry the DARK main tint, dark plates carry the LIGHT one. */

html[data-main='W'] {
  --main-lt: #fff6dc;
  --main-dk: #3f3722;
}
/* was #7A6A42: 4.03:1 on its own page */

html[data-main='U'] {
  --main-lt: #9cc8ea;
  --main-dk: #0a2b47;
}

html[data-main='B'] {
  --main-lt: #c9c3bc;
  --main-dk: #14110e;
}

html[data-main='R'] {
  --main-lt: #f4beb0;
  --main-dk: #4a0c10;
}
/* was #F0A896: no room to dim */

html[data-main='G'] {
  --main-lt: #a1cea1;
  --main-dk: #123a22;
}
/* was #9CCB9C: no room to dim */

/* ── Accent system ─ the gold retires. Every accent (metal rims, gilded
   text, brass headings, hairlines, glows) is now a LIGHTER TINT of the
   chosen guild's SIDE colour: --m1..--m5 are the five metal-ramp stops,
   --brass the working accent, --on-acc the engraved text on solid accent.
   On a cream (W) MAIN the same side gets a DARKER ramp instead, so accents
   stay readable on the light page. W-side panels keep their dark bronze
   panel accent for the same reason. */

html[data-side='W'] {
  --pop-bg: #f3eacf;
  --pop-line: #cbb98a;
  --field: #f4f1e3;
  --field-line: #cbb98a;
  --sel-rim: var(--panel-brass-dim);
  --plate-ink: var(--main-dk);
  --icon-pl: var(--main-dk);
  --m1: #c9b98a;
  --m2: #a8925c;
  --m3: #6e5c34;
  --m4: #b8a878;
  --m5: #8a784a;
  --panel-brass: #efe2b8;
  --brass: #a8925c;
  --brass-dim: #6e5c34;
  --field-line: #8f7842;
  --pop-line: #8f7842;
  --panel-line: #8a7440;
  --panel-brass-dim: #55420f;
  --brass-glow: color-mix(in srgb, var(--brass) 14%, transparent);
  --line: color-mix(in srgb, var(--brass) 60%, transparent);
}

html[data-side='U'] {
  --pop-bg: #0a4b7b;
  --pop-line: #3f87be;
  --field: #0a4978;
  --field-line: #3f87be;
  --sel-rim: var(--panel-brass);
  --plate-ink: color-mix(in srgb, var(--main-lt) 85%, #ffffff);
  --icon-pl: var(--main-lt);
  --m1: #4e8cbe;
  --m2: #2e6390;
  --m3: #14344e;
  --m4: #3f7cac;
  --m5: #1f4e74;
  --brass: #2e6390;
  --brass-dim: #1f4666;
  --brass-glow: color-mix(in srgb, var(--brass) 14%, transparent);
  --line: color-mix(in srgb, var(--brass) 60%, transparent);
  --panel-brass: #a6d0ee;
  --panel-brass-dim: #052236;
  --panel-brass-glow: color-mix(in srgb, #8fc3e8 14%, transparent);
  --panel-line: #052236;
  --field-line: #041d32;
  --pop-line: #041d32;
}

html[data-side='B'] {
  --pop-bg: #1d1915;
  --pop-line: #4a4441;
  --field: #1b1714;
  --field-line: #4a4441;
  --sel-rim: var(--panel-brass);
  --plate-ink: color-mix(in srgb, var(--main-lt) 85%, #ffffff);
  --icon-pl: var(--main-lt);
  --m1: #7e766e;
  --m2: #55504a;
  --m3: #211d19;
  --m4: #6a645c;
  --m5: #3a342e;
  --brass: #55504a;
  --brass-dim: #35302b;
  --brass-glow: color-mix(in srgb, var(--brass) 14%, transparent);
  --line: color-mix(in srgb, var(--brass) 60%, transparent);
  --panel-brass: #d6d1ca;
  --panel-brass-dim: #131111;
  --panel-brass-glow: color-mix(in srgb, #c9c3bc 14%, transparent);
  --panel-line: #121110;
  --field-line: #121110;
  --pop-line: #121110;
}

/* Dimir (blue page, black side): the black side's GREY accent ramp vanishes on
   the blue page (Stef, 12 Oct 2026) -- there every accent on the page goes
   BLACK: rims, pills, banners, "+" buttons, section labels, hairlines. Ink on
   a black fill stays the light --on-acc. Panels keep their own light accent;
   Orzhov's cream page keeps the grey (readable there). */

html[data-main='U'][data-side='B'] {
  --m1: #2a2522;
  --m2: #0e0a07;
  --m3: #000000;
  --m4: #1c1815;
  --m5: #070605;
  --brass: #0e0a07;
  --brass-dim: #000000;
  --brass-glow: color-mix(in srgb, #000000 22%, transparent);
  --line: color-mix(in srgb, #0e0a07 75%, transparent);
}

/* ...but LETTERS in that accent would be as faint in black as in grey on the
   dark blue: on the page they take the page's own light ink instead. */

html[data-main='U'][data-side='B']
  :is(
    .home-rule-star,
    .home-kicker,
    .section-label,
    .pin-pill,
    .pin-pill > button:not(.bk-now),
    .sr-tile .st-price,
    .pair-cell .st-price,
    .cap-note
  ) {
  color: var(--page-ink);
}

/* 1.6 (Stef, 14 Oct 2026): in Dimir the accent is black -- letters that took
   it were black on the blue page. On the page (not inside a dark panel, where
   the accent is light) they take the page's own light ink. Generated from
   every rule that colours text with the accent; :where keeps it weak, so a
   component's own stronger colour still wins. */

html[data-main='U'][data-side='B']
  :where(
    .page-cap .cap-note,
    .save-indicator.saving,
    .tw-row .tw-eur,
    .banner-tab.active,
    .salt-meta,
    .tw-poprow .tw-eur,
    .tp-val,
    .legality.warn .lg-head,
    .cp-val,
    .detail-h,
    .oracle-cost,
    .tag-chip,
    .tag-chip button,
    .cmb-res-btn,
    .tag-drop-h,
    .home-logo-txt,
    .home-rule-star,
    .hfm-k,
    .home-kicker,
    .home-callout,
    .hf-n,
    .fleet-stat,
    .tile-fav,
    .section-label,
    .folder-crumb button,
    .fp-crumb,
    .br-info,
    .br-h2,
    .ci-foil-on,
    .br-title b,
    .br-h #brPriceLab,
    .pp-foil,
    .b-tab.active,
    .lg-chip.warn,
    .deck-meter-row .count,
    .panel-h,
    .cat-head .t,
    .cat-price,
    .dpb-val,
    .vg-row .vr-p,
    .want-in .wi-eur,
    .ls-tile .ls-p,
    .leg-chip.res,
    .dk-tool.active,
    .dl-winrate b,
    .dl-leader-cat,
    .dl-bracket,
    .bkt-mini,
    .ar-set,
    .sc-hero-nm,
    .sc-byline2 strong,
    .sc-adm-price,
    .sr-tile .st-price,
    .pair-cell .st-price,
    .pr-vals,
    .hv-mov,
    .budget-star .bs-pr,
    .typal-label,
    .col-tile .col-bnd,
    .ci-nav-arrow,
    #nselPop .cselect-opt.on,
    .cselect-opt.sel,
    .tag.dupe,
    .rank-badge,
    .curve-n,
    .rules-text h4,
    .dr-steps span.on,
    .dr-dir,
    .dr-clock,
    .dr-ring-mid .dr-arrow,
    .dr-lands b,
    .dr-p.win,
    .dr-past b,
    .dr-champ,
    .xt-mini,
    .xt-ico,
    #pasteDeckFileBtn.fb-lead,
    .dpp-v,
    .dpp-eur,
    .modal-sheet h3,
    .turn-hub .th-arrow,
    .turn-hub .th-lbl,
    .deckpick h4,
    .pin-pill,
    .pin-pill button,
    .cr-title,
    .cj-hero .cj-ico,
    .cr-num,
    .cr-jump,
    .tr-eur,
    .dfc-flip.flipped,
    .edh-jump,
    .reco-theme-banner,
    .edh-rel-chip b,
    .colfold-ico,
    .trade-verdict.even,
    .glog-frow .seg button.active,
    .glog-tag,
    .glog-line2,
    .dl60-wr b,
    .cotd-h,
    .inspire-cta,
    .back-h
  ):not(
    :where(
        .app > main > .adv-toggle,
        .app > main > .adv-panel,
        .app > main > #colAdvBox,
        .tw-row,
        .brand-banner #capBack,
        .brand-banner .ov-back,
        .oracle-face,
        .tag-editor,
        .hfm-chip,
        .home-fact,
        .home-hero-banner,
        .deck-tile,
        .folder-tile,
        .ghost-btn,
        .bulk-textarea,
        .panel-card,
        .col-filter-input,
        .col-select,
        #bindersPop,
        #fabMenu,
        .pd-btn,
        .pd-panel,
        .searchbar input,
        .appoint-sheet,
        .appoint-row,
        .pair-btns .add-btn,
        .sp-jump-btn,
        .adv-toggle,
        .cmc-row select,
        .cmc-row input,
        .adv-row input[type='text'],
        .adv-row select,
        .sc-primer,
        .sc-list,
        .sr-tile .st-btns .add-btn,
        .pr-rail,
        .cselect-btn,
        .cselect-panel,
        .cselect-search,
        .cselect-search input,
        .bs-row select,
        .settings-section,
        .guild-opt,
        .menu-pop,
        .toast,
        .dp-row,
        .cr-bar input,
        .tr-qty button,
        .edh-jump,
        .edh-rel-chip,
        .glog-frow .seg button,
        .glog-sel,
        .glog-num,
        .glog-chip,
        .inspire-cta,
        .life-card-v2,
        .life-panel,
        .cut-set,
        .cut-tile,
        .ls-ai
      )
      *
  ) {
  color: var(--page-ink);
}

html[data-side='R'] {
  --pop-bg: #98171e;
  --pop-line: #da4644;
  --field: #94161d;
  --field-line: #da4644;
  --sel-rim: var(--panel-brass);
  --plate-ink: color-mix(in srgb, var(--main-lt) 85%, #ffffff);
  --icon-pl: var(--main-lt);
  --m1: #c05840;
  --m2: #8e2e1e;
  --m3: #4e140c;
  --m4: #a64432;
  --m5: #6e2418;
  --brass: #8e2e1e;
  --brass-dim: #641e12;
  --brass-glow: color-mix(in srgb, var(--brass) 14%, transparent);
  --line: color-mix(in srgb, var(--brass) 60%, transparent);
  --panel-brass: #f4b6a2;
  --panel-brass-dim: #45080b;
  --panel-brass-glow: color-mix(in srgb, #ee9e86 14%, transparent);
  --panel-line: #40070a;
  --field-line: #3c0608;
  --pop-line: #3c0608;
}

html[data-side='G'] {
  --pop-bg: #00532d;
  --pop-line: #3b9068;
  --field: #00512b;
  --field-line: #3b9068;
  --sel-rim: var(--panel-brass);
  --plate-ink: color-mix(in srgb, var(--main-lt) 85%, #ffffff);
  --icon-pl: var(--main-lt);
  --m1: #4e8a5c;
  --m2: #2f6e42;
  --m3: #123a22;
  --m4: #3f7c50;
  --m5: #205432;
  --brass: #2f6e42;
  --brass-dim: #1f4a2c;
  --brass-glow: color-mix(in srgb, var(--brass) 14%, transparent);
  --line: color-mix(in srgb, var(--brass) 60%, transparent);
  --panel-brass: #b4dab4;
  --panel-brass-dim: #002814;
  --panel-brass-glow: color-mix(in srgb, #9ccb9c 14%, transparent);
  --panel-line: #002412;
  --field-line: #00200f;
  --pop-line: #00200f;
}

html {
  --gold: #e8be58;
  --gold-deep: #8a6a1e;
}
/* plain flat gold: page names and gold-faced buttons only */

/* Scheme highlights are separate from gold icons and action buttons. Keep
   these at the root so panel-specific brass overrides cannot recolor them.
   Each secondary color has a vivid rim for dark pages and a deeper rim for
   light pages (including white-main guilds in dark mode). */
html {
  --scheme-accent-light: #ff3030;
  --scheme-accent-dark: #cb1717;
  --scheme-accent: var(--scheme-accent-light);
  --scheme-glow: color-mix(in srgb, var(--scheme-accent) 12%, transparent);
}

html[data-side='W'] {
  --scheme-accent-light: #ede3c5;
  --scheme-accent-dark: #756a4c;
}

html[data-side='U'] {
  --scheme-accent-light: #289fe6;
  --scheme-accent-dark: #245f8d;
}

html[data-side='B'] {
  --scheme-accent-light: #bbb6b2;
  --scheme-accent-dark: #4a4441;
}

html[data-side='R'] {
  --scheme-accent-light: #ff3030;
  --scheme-accent-dark: #cb1717;
}

html[data-side='G'] {
  --scheme-accent-light: #2ab969;
  --scheme-accent-dark: #246d47;
}

html[data-main='W'],
html[data-theme='light'] {
  --scheme-accent: var(--scheme-accent-dark);
}

/* Text roles are resolved to neutral white, black and gray by
   overrides/text.css. Surface aliases below keep labels paired with their
   own page or panel. Solid accent buttons also need an opposite ink color. */

html {
  --acc-fill: var(--panel-brass-dim);
  --on-acc: #fff;
}

html {
  --page-ink: var(--main-lt);
}

html[data-main='W'] {
  --page-ink: var(--main-dk);
}
/* the one light page */

html[data-theme='light'] {
  --page-ink: var(--main-dk);
  --plate-ink: var(--main-dk);
}

html {
  --ink-text: var(--page-ink);
  --sub-text: color-mix(in srgb, var(--page-ink) 88%, var(--ink));
  --sub-text-2: color-mix(in srgb, var(--page-ink) 76%, var(--ink));
  --panel-text: var(--plate-ink);
  --panel-sub: color-mix(in srgb, var(--plate-ink) 95%, var(--panel));
  --panel-sub-2: color-mix(in srgb, var(--plate-ink) 95%, var(--panel));
}

html {
  --head-ink: var(--panel-brass, var(--gold));
}

html[data-main='W'] {
  --head-ink: var(--m3);
}
/* light ink: the side DARK accent carries contrast */

/* Surfaces carry their OWN text. Every element painted with a surface token
   (panel, field, pop-up — solid or in a gradient) re-points the text and
   brass variables at the side's set, so a cream panel on a blue page gets
   dark ink and dark gold while a blue panel on a cream page gets light ink
   and bright gold — and every descendant that already says var(--ink-text)
   / var(--sub-text) / var(--brass) / var(--parchment) follows without a
   single rule of its own changing. The selector list is generated from the
   stylesheet (every rule whose background uses --panel/--panel-2/--field/
   --pop-bg, including gradients). */

.app > main > .adv-toggle,
.app > main > .adv-panel,
.app > main > #colAdvBox,
.tw-row,
.brand-banner #capBack,
.brand-banner .ov-back,
.oracle-face,
.tag-editor,
.hfm-chip,
.home-fact,
.home-hero-banner,
.deck-tile,
.folder-tile,
.ghost-btn,
.bulk-textarea,
.panel-card,
.col-filter-input,
.col-select,
#bindersPop,
#fabMenu,
.pd-btn,
.pd-panel,
.searchbar input,
.appoint-sheet,
.appoint-row,
.pair-btns .add-btn,
.sp-jump-btn,
.adv-toggle,
.cmc-row select,
.cmc-row input,
.adv-row input[type='text'],
.adv-row select,
.sc-primer,
.sc-list,
.sr-tile .st-btns .add-btn,
.pr-rail,
.cselect-btn,
.cselect-panel,
.cselect-search,
.cselect-search input,
.bs-row select,
.settings-section,
.guild-opt,
.menu-pop,
.toast,
.dp-row,
.cr-bar input,
.tr-qty button,
.edh-jump,
.edh-rel-chip,
.glog-frow .seg button,
.glog-sel,
.glog-num,
.glog-chip,
.inspire-cta,
.life-card-v2,
.life-panel,
.cut-set,
.cut-tile,
.ls-ai {
  --ink-text: var(--panel-text);
  --sub-text: var(--panel-sub);
  --sub-text-2: var(--panel-sub-2);
  --brass: var(--panel-brass);
  --brass-dim: var(--panel-brass-dim);
  --brass-glow: var(--panel-brass-glow);
  --parchment: var(--panel-parchment);
  --parchment-dim: var(--panel-parchment-dim);
  --line: var(--panel-line);
  --head-ink: var(--plate-ink);
  --acc-fill: var(--panel-brass);
  --on-acc: #111;
}

.app > main > .adv-toggle,
.app > main > .adv-panel,
.app > main > #colAdvBox,
.tw-row,
.brand-banner #capBack,
.brand-banner .ov-back,
.oracle-face,
.tag-editor,
.home-fact,
.home-hero-banner,
.deck-tile,
.folder-tile,
.panel-card,
#bindersPop,
#fabMenu,
.pd-panel,
.appoint-sheet,
.sp-jump-btn,
.sc-primer,
.sc-list,
.pr-rail,
.cselect-panel,
.cselect-search,
.settings-section,
.menu-pop,
.life-card-v2,
.life-panel {
  color: var(--ink-text);
}

/* Shared heading typography uses plain surface-appropriate text. */

.tb-titles .t1,
.brand-txt,
.page-cap .cap-note,
.save-indicator.saving,
.tw-row .tw-eur,
.salt-meta,
.tw-poprow .tw-eur,
.tp-val,
.legality.warn .lg-head,
.lg-item.warn .lg-label::before,
.cp-val,
.detail-h,
.oracle-cost,
.tag-drop-h,
.home-logo-txt,
.home-rule-star,
.home-points li::before,
.home-desc strong,
.hfm-k,
.home-kicker,
.home-callout,
.hf-n,
.fleet-stat,
.folder-face,
.section-label,
.b-tab.active,
.deck-meter-row .count,
.panel-h,
.cat-head .t,
.cat-price,
.dpb-val,
.ls-tile .ls-p,
.dl-winrate b,
.dl-leader-cat,
.dl-bracket,
.bkt-mini,
.ar-set,
.sc-hero-nm,
.sc-byline2 strong,
.sc-adm-price,
.sr-tile .st-price,
.pair-cell .st-price,
.sr-tile .st-btns .add-btn:not(:disabled):hover,
.pr-vals,
.hv-mov,
.budget-star .bs-pr,
.typal-label,
.rank-badge,
.curve-n,
.rules-text h4,
.guild-cur,
.modal-sheet h3,
.life-toolbar button.active,
.turn-hub .th-arrow,
.turn-hub .th-lbl,
.deckpick h4,
.cr-title,
.cr-num,
.tr-eur,
.reco-theme-banner,
.edh-rel-chip b,
.colfold-ico,
.trade-verdict.even,
.glog-line2,
.cotd-h,
.back-h,
.life-panel h4,
.folder-name,
.deck-tile .dt-bracket {
  -webkit-text-stroke: 0;
  paint-order: stroke fill;
  background: none;
  color: var(--ink-text);
  -webkit-text-fill-color: currentColor;
}

/* Controls keep clear, unembossed text over their own backgrounds. */

.icon-btn:hover,
.banner-tab:hover,
.banner-tab.active,
.otag-pop button:hover,
.searchbar .otag-pop button:hover,
.tag-chip,
.tag-chip button,
.cmb-res-btn,
.tag-drop button:active,
.tag-sugg:hover,
.inline-link,
.tile-fav,
.folder-crumb button,
.fp-crumb,
.pp-foil,
.lg-chip.warn,
.leg-chip.res,
.dk-tool.active,
.tile-info:active,
.ci-nav-arrow,
.cselect-opt.sel,
.tag.dupe,
.add-btn,
.ban-item:hover,
.guild-opt.sel,
.life-toolbar button:hover,
.pin-pill,
.pin-pill button,
.cr-jump,
.edh-jump,
.glog-frow .seg button.active,
.glog-tag,
.inspire-cta,
.undo-btn:hover,
.hist-more {
  text-shadow: none;
}

/* White-main pages keep solid text on their light surfaces. */

html[data-main='W'] .tb-titles .t1,
html[data-main='W'] .brand-txt,
html[data-main='W'] .page-cap .cap-note,
html[data-main='W'] .save-indicator.saving,
html[data-main='W'] .tw-row .tw-eur,
html[data-main='W'] .salt-meta,
html[data-main='W'] .tw-poprow .tw-eur,
html[data-main='W'] .tp-val,
html[data-main='W'] .legality.warn .lg-head,
html[data-main='W'] .lg-item.warn .lg-label::before,
html[data-main='W'] .cp-val,
html[data-main='W'] .detail-h,
html[data-main='W'] .oracle-cost,
html[data-main='W'] .tag-drop-h,
html[data-main='W'] .home-logo-txt,
html[data-main='W'] .home-rule-star,
html[data-main='W'] .home-points li::before,
html[data-main='W'] .home-desc strong,
html[data-main='W'] .hfm-k,
html[data-main='W'] .home-kicker,
html[data-main='W'] .home-callout,
html[data-main='W'] .hf-n,
html[data-main='W'] .fleet-stat,
html[data-main='W'] .folder-face,
html[data-main='W'] .section-label,
html[data-main='W'] .b-tab.active,
html[data-main='W'] .deck-meter-row .count,
html[data-main='W'] .panel-h,
html[data-main='W'] .cat-head .t,
html[data-main='W'] .cat-price,
html[data-main='W'] .dpb-val,
html[data-main='W'] .ls-tile .ls-p,
html[data-main='W'] .dl-winrate b,
html[data-main='W'] .dl-leader-cat,
html[data-main='W'] .dl-bracket,
html[data-main='W'] .bkt-mini,
html[data-main='W'] .ar-set,
html[data-main='W'] .sc-hero-nm,
html[data-main='W'] .sc-byline2 strong,
html[data-main='W'] .sc-adm-price,
html[data-main='W'] .sr-tile .st-price,
html[data-main='W'] .pair-cell .st-price,
html[data-main='W'] .sr-tile .st-btns .add-btn:not(:disabled):hover,
html[data-main='W'] .pr-vals,
html[data-main='W'] .hv-mov,
html[data-main='W'] .budget-star .bs-pr,
html[data-main='W'] .typal-label,
html[data-main='W'] .rank-badge,
html[data-main='W'] .curve-n,
html[data-main='W'] .rules-text h4,
html[data-main='W'] .guild-cur,
html[data-main='W'] .modal-sheet h3,
html[data-main='W'] .life-toolbar button.active,
html[data-main='W'] .turn-hub .th-arrow,
html[data-main='W'] .turn-hub .th-lbl,
html[data-main='W'] .deckpick h4,
html[data-main='W'] .cr-title,
html[data-main='W'] .cr-num,
html[data-main='W'] .tr-eur,
html[data-main='W'] .reco-theme-banner,
html[data-main='W'] .edh-rel-chip b,
html[data-main='W'] .colfold-ico,
html[data-main='W'] .trade-verdict.even,
html[data-main='W'] .glog-line2,
html[data-main='W'] .cotd-h,
html[data-main='W'] .back-h,
html[data-main='W'] .life-panel h4,
html[data-main='W'] .folder-name,
html[data-main='W'] .deck-tile .dt-bracket {
  background: none;
  -webkit-text-fill-color: currentColor;
  -webkit-text-stroke: 0;
}
/* Light surfaces retain their own foreground color. */

html[data-mode='commander'][data-theme='light'] {
  --ink: #fbf3f1;
  --ink-2: #f3e2de;
  --line: #dcc0bc;
}

html[data-theme='light'] {
  --ink: #f2ecda;
  --ink-2: #ffffff;
  --ink-3: #fbf7ea;
  --panel: #ffffff;
  --panel-2: #f5efdc;
  --brass: #93711f;
  --brass-dim: #6e5518;
  --brass-glow: rgba(147, 113, 31, 0.12);
  --parchment: #2a2118;
  --parchment-dim: #4a3d2c;
  --danger: #a23a3f;
  --success: #3d6b4e;
  --line: rgba(147, 113, 31, 0.3);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  touch-action: pan-x pan-y;
}

button,
input,
select,
textarea,
.sr-tile,
.vg-card,
.tap-zone,
.dmg-overlay,
.chip {
  touch-action: manipulation;
}

/* overscroll-behavior-y on BOTH: Chrome grants pull-to-refresh based on the
   root scroller (html) — the old body-only guard never applied, so a swipe
   down from the top reloaded the whole app. `none` also kills the glow. */

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--ink);
  overflow-x: clip;
  max-width: 100%;
  overscroll-behavior-y: none;
  overflow-anchor: none;
}
/* clip, not hidden: hidden silently kills position:sticky. overflow-anchor off: the app runs its OWN scroll anchoring for streamed grids -- the browser's native one corrected the same inserts a second time, which was the scroll jolt. */

body {
  font-family: 'Inter', sans-serif;
  color: var(--ink-text);
  background: transparent;
  min-height: 100vh;
  overscroll-behavior-y: none;
  transition: background 0.2s;
}

html[data-mode='commander'] body {
  background: transparent;
}

/* The colour-to-black depth fade lives on a FIXED layer glued to the
   viewport: scrolling moves the content over it, never the fade itself,
   so the gradient can't visibly restart anywhere on any page. */

/* The whole palette read a touch too bright on device — a fixed 7% black
   veil above everything dims every colour uniformly (theme, art, gold)
   without touching a single token. Its own fixed layer, so no filter-on-
   body containing-block trap for the fixed bars. */

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.12);
}

html {
  --page-shade: 0.35;
  --page-backdrop:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, var(--page-shade)) 100%),
    radial-gradient(
      ellipse at 20% -10%,
      color-mix(in srgb, var(--brass) 9%, transparent),
      transparent 45%
    ),
    radial-gradient(ellipse at 100% 0%, var(--glow), transparent 40%), var(--ink);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--page-backdrop);
}

.app {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

button {
  font-family: 'Inter';
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

/* Source: styles/chrome.css */
/* ---------- chrome ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--ink) 97%, transparent),
    color-mix(in srgb, var(--ink) 92%, transparent)
  );
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
}

.tb-titles {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
  flex: 1;
}

#printOverlay main > * {
  flex: 0 0 auto;
}

#crOverlay .ov-cap {
  order: 1;
}

#crOverlay .ov-nav {
  order: 4;
  position: static;
  flex: 0 0 auto;
}

/* The judge and rules read from the top; only the body scrolls. */

#crOverlay #crBody {
  order: 2;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#crOverlay .cr-toc {
  flex-direction: column;
}

#crOverlay #crBody > * {
  flex: 0 0 auto;
}

#crOverlay #crBody > .hint:only-child {
  margin: auto 14px;
  text-align: center;
}

#crOverlay .cr-bar {
  order: 3;
  border-top: 2px solid var(--line);
  padding-bottom: 10px;
}

.tb-titles .t1 {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 15.5px;
  color: var(--ink-text);
  font-weight: 700;
  letter-spacing: 0.6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tb-titles .t1.name2 {
  font-size: 14px;
  line-height: 1.25;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.reco-admiral .ra-hint {
  font-size: 12.5px;
  color: var(--sub-text);
  margin-top: 8px;
  letter-spacing: 0.3px;
}

.reco-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 0 0 10px;
}

.rt-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid color-mix(in srgb, var(--scheme-accent) 35%, transparent);
  color: var(--ink-text);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
}

.rt-chip.on {
  background: var(--brass);
  border-color: var(--scheme-accent);
  color: #111;
  font-weight: 700;
}

.tb-titles .t2 {
  font-size: 11.5px;
  color: var(--sub-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  background: none;
  border: 2px solid var(--line);
  color: var(--ink-text);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.icon-btn svg {
  width: 21px;
  height: 21px;
}

.dl-mini-add svg {
  width: 17px;
  height: 17px;
}

.dk-tool svg,
.dk-arr svg {
  width: 19px;
  height: 19px;
}

/* Gold-on-purple buttons: the stroke icons are metallic gold (a light catch
   above, a bronze shade below) and the purple lives in the button PLATES —
   every icon button carries the app's deep purple as its ground. */

.dk-tool,
.dk-arr,
.dk-count {
  color: var(--icon-pl);
}

.compass {
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-tab svg,
.icon-btn svg,
.dk-tool svg,
.dl-bridge-btns .bi svg,
.compass svg,
#lifeCogBtn svg,
.home-search-btn svg,
.in-chev svg {
  color: var(--ink-text);
}

/* Icons grew a quarter, but their LINES did not: the 24-unit icons carry
   stroke-width="1.8" as an attribute, and 1.8 ÷ 1.25 = 1.44 set from CSS
   (which outranks the attribute) keeps the drawn weight identical. */

.banner-tab svg *,
.icon-btn svg *,
.dk-tool svg *,
.dl-bridge-btns .bi svg *,
#lifeCogBtn svg *,
.home-search-btn svg *,
.in-chev svg *,
#dockSearchBtn svg *,
.ib svg * {
  stroke-width: 1.44;
}

.icon-btn:hover {
  border-color: var(--scheme-accent);
  color: var(--ink-text);
}

.compass {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 11px;
  padding: 1px;
  box-sizing: content-box;
}

.compass.active {
  background: var(--scheme-glow);
  border-color: var(--scheme-accent);
}

.compass svg {
  width: 25px;
  height: 25px;
  animation: none;
}

.compass .compass-badge {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
}

@media (prefers-reduced-motion: reduce) {
  .compass svg {
    animation: none;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.brand-txt {
  pointer-events: none;
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 15px;
  letter-spacing: 0.6px;
  color: var(--ink-text);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
  cursor: default;
}

.page-cap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  border-bottom: 2px solid var(--line);
  padding: calc(env(safe-area-inset-top) + 6px) 46px 6px;
  box-sizing: border-box;
  min-height: 44px;
}

.page-cap .brand-txt {
  text-align: center;
  flex: 0 1 auto;
  font-size: 18px;
}

/* Page names are the exception: gold everywhere, and BOLD for legibility. */

.brand-txt {
  color: var(--ink-text);
  font-weight: 800;
}

html[data-main] .page-cap .brand-txt,
html[data-main] .ov-cap .brand-txt,
html[data-main] .overlay .topbar .brand-txt {
  background: none;
  -webkit-text-fill-color: currentColor;
}

/* A white-ink scheme paints that cap in pale parchment, where flat gold all
   but disappears — the deep gold keeps the page name legible there. */

html[data-main='W'] .page-cap .brand-txt,
html[data-main='W'] .ov-cap .brand-txt,
html[data-main='W'] .overlay .topbar .brand-txt {
  color: var(--ink-text);
  -webkit-text-fill-color: currentColor;
}

/* Back lives on the nav bar now, between Home and the tabs. On very narrow
   screens the extra button squeezes the row — tighten the gaps so all five
   tabs stay on screen. */

@media (max-width: 379px) {
  .brand-banner {
    gap: 4px;
    padding-left: 6px;
    padding-right: 6px;
  }
  .banner-tabs {
    gap: 5px;
  }
}

.page-cap .cap-note {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11.5px;
  color: var(--ink-text);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

.page-cap:has(.cap-note) .brand-txt,
.ov-cap:has(.cap-note) .brand-txt,
.overlay .topbar:has(.cap-note) .brand-txt,
.overlay .topbar:has(#csPrice) .brand-txt {
  max-width: calc(100% - 170px);
}

.app > main {
  padding-top: calc(56px + env(safe-area-inset-top)) !important;
}

.brand-txt.two-line {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.2;
  align-self: center;
  max-height: 44px;
  word-break: keep-all;
  overflow-wrap: normal;
}

.brand-txt.editable {
  pointer-events: auto;
  cursor: pointer;
  text-decoration: underline dotted color-mix(in srgb, var(--brass) 40%, transparent);
  text-underline-offset: 4px;
}

.page-cap .brand-txt.swap {
  animation: brandSwap 0.3s ease;
}

@keyframes brandSwap {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-cap .brand-txt {
    animation: none;
  }
}

.spacer {
  flex: 1;
  min-width: 0;
}

.save-indicator {
  font-size: 11px;
  color: var(--sub-text-2);
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
  flex: 0 0 auto;
}

.save-indicator.saving {
  color: var(--ink-text);
}

main {
  flex: 1;
  padding: 16px 16px calc(var(--nav-h) + 30px + env(safe-area-inset-bottom));
}

/* ---------- inverted controls: search bars & filter toggles live at the
   BOTTOM, thumb country — moved by flex ORDER, so the DOM (and all wiring)
   stays untouched. A zero-height spacer with margin-top:auto pushes the
   cluster to the screen's bottom edge even on short pages; sticky keeps it
   pinned above the nav while the results scroll beneath. Overlay sheets
   keep their own layouts (.app > main only). ---------- */

.app > main {
  display: flex;
  flex-direction: column;
}

/* FULLY REVERSED mains: Extras (credits at the top, Life Counter at the
   thumb) and My Stuff (collection/fleet on top, folders and decks at the
   bottom by the filter). The .app>main compound (0-1-1) beat a bare class,
   which is why the earlier .settings-main flip never rendered — these
   selectors out-rank it. Reversed mains pack at the bottom natively, so
   the pusher spacer must NOT apply there (it would float content up). */

.app > main.settings-main,
.app > main:has(> div > #deckFilter) {
  flex-direction: column-reverse;
}

.app > main:not(.settings-main):not(:has(> div > #deckFilter))::before {
  content: '';
  order: 97;
  margin-top: auto;
}

.app > main > .searchbar,
.app > main > div:has(> #deckFilter) {
  order: 100;
  position: sticky;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  z-index: 36;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--ink) 97%, transparent),
    color-mix(in srgb, var(--ink) 92%, transparent)
  );
  backdrop-filter: blur(8px);
  border-top: 2px solid var(--line);
  margin: 8px -16px 0 !important;
  padding: 10px 16px;
}

.app > main > .adv-toggle,
.app > main > div:has(> #colAdvToggle) {
  order: 99;
  position: sticky;
  bottom: calc(var(--nav-h) + 64px + env(safe-area-inset-bottom));
  z-index: 36;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--ink) 97%, transparent),
    color-mix(in srgb, var(--ink) 92%, transparent)
  );
  backdrop-filter: blur(8px);
  border-top: 2px solid var(--line);
  margin: 0 -16px !important;
  padding: 8px 16px;
}

/* The Advanced-filters bar is the BUTTON itself — it keeps its field face
   (the cross-fleet blue in Commander mode), not the page ink. */

.app > main > .adv-toggle {
  background: var(--field);
  border-color: var(--field-line);
  border-top: 1.5px solid var(--field-line);
  display: block;
  width: auto;
  margin-left: 0 !important;
  margin-right: 0 !important;
  border-radius: 10px;
}

/* The filter panels are DROP-UP sheets now: fixed above the toggle+search
   stack, growing upward with their own scroll. Dropdowns INSIDE a sheet
   expand in flow (a scrolling ancestor would clip absolute panels). */

.app > main > .adv-panel,
.app > main > #advSlot > .adv-panel,
.app > main > #colAdvBox {
  order: 98;
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-h) + 120px + env(safe-area-inset-bottom));
  max-height: 56vh;
  overflow-y: auto;
  z-index: 37;
  display: flex;
  flex-direction: column-reverse; /* flipped fields AND starts scrolled at the bottom */
  background: var(--panel);
  border-top: 2px solid var(--line);
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.5);
  padding: 12px 16px;
  margin: 0 !important;
  border-radius: 14px 14px 0 0;
}

.adv-panel .cselect,
#colAdvBox .cselect {
  display: flex;
  flex-direction: column-reverse;
}

/* The floating loupe: a real foot row (so at rest it covers nothing), sticky
   to the bottom edge of the scrolling sheet. The row itself lets taps fall
   through; only the button catches them. Explicit margins -- no inherited
   adv-row spacing. */

.adv-go-row {
  position: sticky;
  bottom: 0;
  z-index: 8;
  flex: 0 0 auto;
  height: 48px;
  margin: 0 !important;
  padding: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  pointer-events: none;
}

.adv-go {
  pointer-events: auto;
  flex: none;
  width: 46px;
  height: 46px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: linear-gradient(var(--gold), var(--gold));
  color: #111;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.adv-go svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.6;
}

/* The deck filter scrolls with the PAGE, whose foot is under the dock stack. */

.df-compact > .adv-go-row {
  bottom: calc(var(--nav-h) + 122px + env(safe-area-inset-bottom));
}

/* 1.35: while typing in a field the gold button stays in its own spot at
   the foot instead of floating over the labels above the keyboard */

/* 1.37 (phone): the gold button floats at the foot again (Stef: floating
   over text is fine), and the "Show everything" row stays put beside it --
   the filters scroll behind both. */

/* 1.35: "Show everything" starts where the fields start, so the gold
   button rises into the free space beside it (phone, bottom-up) */

.adv-panel > .adv-showall {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  column-gap: 10px;
}

.adv-panel > .adv-showall > div:first-child {
  grid-column: 2;
}

.adv-panel > .adv-showall > .toggle-switch {
  grid-column: 3;
}

.adv-row > label .info-i {
  margin-left: 5px;
  width: 16px;
  height: 16px;
  font-size: 11px;
}

.adv-panel .cselect-panel,
#colAdvBox .cselect-panel {
  position: static;
  margin: 0 0 4px;
  max-height: 240px;
  display: flex;
  flex-direction: column-reverse;
}

.adv-panel .cselect-panel .cselect-opt,
#colAdvBox .cselect-panel .cselect-opt {
  flex: 0 0 auto;
}

.adv-panel .cselect-panel .cselect-search,
#colAdvBox .cselect-panel .cselect-search {
  top: auto;
  bottom: 0;
  border-bottom: none;
  border-top: 1.5px solid var(--pop-line);
}

/* Spoilers: same drop-up filter, but this page has no bottom search bar --
   the toggle hugs the nav and the sheet rides just above the toggle. */

.app > main > #spAdvToggle {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom));
}

.app > main > #spAdvBox {
  bottom: calc(var(--nav-h) + 62px + env(safe-area-inset-bottom));
}

.app > main:has(> #spAdvBox) {
  padding-bottom: calc(var(--nav-h) + 64px + env(safe-area-inset-bottom));
}
/* room for the FIXED filter bar: the set-symbol row ends above it, never beneath */

.net-chip {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: min(34vw, 150px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: var(--panel);
  color: var(--ink-text);
  border: 1px solid color-mix(in srgb, var(--panel) 62%, #000);
  border-radius: 7px;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 700;
  text-shadow: none;
  -webkit-text-fill-color: currentColor;
}

.net-chip[href] {
  min-height: 32px;
  text-decoration: none;
}

/* Give the page name the room the chip takes, and step the deck counter aside. */

.page-cap:has(.net-chip) .brand-txt {
  max-width: calc(100% - 200px);
}

.page-cap:has(.net-chip) #capDeckCount {
  left: auto;
  right: 12px;
}

/* Inspiration: the dropdown stack rides at the bottom too, and its menus
   open UPWARD — drop-ups, away from the thumb and the nav. */

.app > main > .browse-selects {
  order: 99;
}

/* A drop-up is a sheet, not a hover: while one is open on the Inspiration
   or Browse page, the feed, the Week/Month/Year row and the commander grid
   behind it are hidden. They kept showing through the gaps and made the
   list unreadable. The selects and the search bar stay, so the page still
   reads as itself. */

.app
  > main.cs-open:has(> .browse-selects)
  > *:not(.browse-selects):not(.searchbar):not(.adv-panel):not(#colAdvBox):not(#advSlot) {
  display: none;
}

.app > main.cs-open:has(> .browse-selects) > .browse-selects {
  background: var(--ink);
}

/* The select you opened takes the bottom slot -- where Commander (or, on a
   deck's Inspiration, Kindred) normally sits -- so it is plain which menu is
   open. The others step out until it closes; then the stack is as it was. */

.browse-selects:has(.cselect-panel) > .bs-row:not(:has(.cselect-panel)) {
  display: none;
}

.reco-themes:has(.cselect-panel) > .cselect:has(.cselect-panel) {
  order: 9;
}

.app > main > #inspireResults {
  order: 95;
}

.app > main:has(> #inspireResults) > .hint {
  order: 98;
}

.app > main > .browse-hero {
  order: 98;
  margin: 10px 0 14px;
}

/* Room beneath the last card so nothing hides behind the sticky wants bar. */

/* The wants bar lives in a BODY-level portal: the page main carries a
   transform (swipe machinery), which hijacks fixed-position coordinates for
   anything inside it — that's why every in-main pin floated. Outside main,
   fixed means fixed: glued to the nav, no gap. */

/* Bottom-up: the whole trade stack rides the foot cluster, hugging the bar. */

.tw-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}

.tw-row img {
  width: 40px;
  border-radius: 4px;
  display: block;
}

.tw-row .tw-nm {
  flex: 1;
  min-width: 0;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tw-row .tw-eur {
  color: var(--ink-text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  flex: none;
}

/* Results replace the welcome: once either results box holds anything
   (spinner included), the hero steps aside and the cards get the room. */

.app > main:has(> #browseResults:not(:empty)) > .browse-hero,
.app > main:has(> #bsNameResults:not(:empty)) > .browse-hero {
  display: none;
}

.app > main:has(> .browse-selects) {
  padding-bottom: calc(var(--nav-h) + 6px + env(safe-area-inset-bottom));
}

/* Inspiration: the free room goes ABOVE the results, not between them and
   the pickers -- one found leader rests right on the selects (bottom-up).
   The page's pusher spacer moves to the very top for this page. */

.app > main:has(> .browse-selects)::before {
  order: -1 !important;
}

.app > main > .browse-selects {
  margin-top: 10px;
}

.browse-selects .cselect-panel {
  top: auto;
  bottom: calc(100% + 4px);
}

/* The recommendation page's Theme and Kindred lists are drop-ups too --
   they sit at the foot of the sheet, so a list that opened downward ran
   straight off the screen. */

#recoOverlay .cselect-panel,
.overlay .reco-themes .cselect-panel {
  top: auto;
  bottom: calc(100% + 4px);
}

.app > main > .pin-pill {
  order: 96;
}

/* 1.32: on Search the "Adding straight to" bar rides just above the search
   bar (where the explanation text used to be): order 99 sits between the
   results (98) and the bar (100). */

.app > main:has(> #searchResultsBox) > .pin-pill {
  order: 99;
  margin: 8px 0 0;
}

.app > main > .sp-jump {
  order: 99;
}

/* (1) Home packs downward — the foot gap closes. */

.app > main.home-page {
  justify-content: flex-end;
  padding-bottom: calc(var(--nav-h) - 14px + env(safe-area-inset-bottom));
}

/* (3/5) My Stuff: tight foot, FAB low, filter shortened clear of it,
   uniform section rhythm in the reversed column. */

.app > main:has(> div > #deckFilter) {
  padding-bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom));
  gap: 12px;
}

.app > main:has(> div > #deckFilter) > div:has(> #deckFilter) {
  order: 0;
  padding-right: 88px;
}

.app > main:has(> div > #deckFilter) > *:not(.searchbar) {
  margin-top: 0;
  margin-bottom: 0;
}

/* (4) Collection reversed: automatic folders up top, binders by the thumb;
   controls stay at the very bottom; row shortened for the low FAB. */

.app > main:has(> #colAdvBox) {
  flex-direction: column-reverse;
  padding-bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom));
}

.app > main:has(> #colAdvBox) > .searchbar {
  order: 0;
  padding-right: 88px;
}

.app > main:has(> #colAdvBox) > div:has(> #colAdvToggle) {
  order: 0;
}

/* (6) Search page: explainer just above the random card, RANDOM below it. */

/* The results box hugs the search bar at the foot; the wrap-reverse grid
   inside already reads bottom-up, so the best match sits nearest the bar. */

/* The foot-anchor spacer sits at order:97 — anything above 97 sinks to
   the foot cluster. 95 left the results stranded in the top region. */

.app > main > #searchResultsBox {
  order: 98;
  min-height: 0;
}

.app > main > #advSlot {
  order: 99;
}

.app > main > .cotd {
  order: 96;
}

/* An empty state is content too: it belongs in the foot cluster (below the
   order:97 pusher), not stranded at the top of an otherwise empty page.
   Direct children only -- on the reversed mains these live inside a wrapper
   and pack at the foot by themselves. */

.app > main > .need-deck,
.app > main > .empty-home {
  order: 98;
}

.app > main:has(> #searchResultsBox) {
  padding-bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom));
}

#cotdBox {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
}

.searchbar > button {
  min-height: 44px;
  box-sizing: border-box;
}

/* (7) Inspiration results read upward: most popular at the bottom. */

#browseResults .insp-grid,
#bsNameResults .insp-grid,
#browseResults .sr-grid,
#bsNameResults .sr-grid {
  display: flex;
  flex-wrap: wrap-reverse;
  gap: 10px;
}

#browseResults .insp-grid > *,
#bsNameResults .insp-grid > *,
#browseResults .sr-grid > *,
#bsNameResults .sr-grid > * {
  flex: 0 0 calc(50% - 5px);
  min-width: 0;
}

/* (8) Spoiler feed reads upward: newest day at the bottom. */

.sp-feed {
  display: flex;
  flex-direction: column-reverse;
}

/* Within each day: cards on top, the date shelf UNDER them — dates read at
   the bottom of their group, newest group already at the page foot. */

.sp-group {
  display: flex;
  flex-direction: column-reverse;
}

/* (9) The card sheet flips: rulings on top, oracle beneath it, the card
   with its chevrons above the buttons, buttons at the thumb. */

.overlay-inner > main.card-detail {
  display: flex;
  flex-direction: column;
}

main.card-detail > .detail-sec:has(#csRulings) {
  order: 0;
}

main.card-detail > .detail-sec:has(#sheetOracle) {
  order: 1;
}

main.card-detail > div[style*='text-align:center'] {
  order: 8;
}

main.card-detail > #csTagBox,
main.card-detail > #ciTagBox {
  order: 9;
}

/* Bottom-anchored, properly. This eats whatever room is left over, so a short
   card's content rests ON the foot: anything that opens -- the tag box -- then
   pushes the CARD up instead of shoving the buttons down. The moment the
   content overflows there is no room left, it collapses to nothing and
   scrolling is untouched. (justify-content:flex-end was measured first and
   rejected: it kills the scroll and puts the top out of reach.)
   Its own class and its own margins on purpose: a spacer that borrows an
   existing class inherits that class's margins. */

main.card-detail > .sheet-foot-spacer {
  order: -1;
  flex: 0 0 auto;
  height: 0;
  padding: 0;
  margin: auto 0 0;
}

main.card-detail > div:nth-child(2) {
  order: 10;
}

/* ---------- the complete flip ---------- */

/* Decklist tabs join the bottom stack, riding just above the dock. */

/* Tabs sit DIRECTLY on the nav; the dock rides on the tabs — fixed with
   matched heights so the two bars touch and nothing peeks through. */

.app > main > .builder-tabs {
  position: fixed;
  left: 0;
  right: 0;
  top: auto;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  z-index: 41;
  margin: 0;
  padding: 5px 14px;
  height: 44px;
  box-sizing: border-box;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--ink) 97%, transparent),
    color-mix(in srgb, var(--ink) 92%, transparent)
  );
  backdrop-filter: blur(8px);
  border-top: 2px solid var(--line);
}

/* Bottom-up: content packs at the FOOT even when a deck search leaves the
   list nearly empty — the min-height keeps the bridge (and any open tool
   panel) anchored down by the dock instead of drifting to the top. */

#builderBody {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  min-height: calc(100vh - var(--nav-h) - 290px);
  flex: 1 0 auto;
}

/* A short deck (only its leader) rests on the dock like a full one: the
   body fills the free height; the list box takes the room above the
   leader strip, and the big + sits in its middle. */

#builderBody > #decklistBox:has(> .dl-empty-add) {
  flex: 1 1 auto;
  justify-content: center;
}

.dl-empty-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  text-align: center;
}

.dl-empty-plus.deck-fab {
  position: static;
  right: auto;
  bottom: auto;
  z-index: auto;
  flex: none;
}
/* exactly the gold ＋ (size, gold, glyph, shadow), just not pinned to the corner */

.dl-empty-plus:active {
  transform: scale(0.95);
}

.dl-empty-t {
  font-family: 'Cinzel', serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink-text);
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.dl-empty-s {
  font-size: 13.5px;
  color: var(--sub-text);
}

#decklistBox {
  display: flex;
  flex-direction: column-reverse;
}

/* ---------- persistent brand banner (symbol + wordmark + tabs), same on every page ---------- */

:root {
  --nav-h: 66px;
}

.brand-banner {
  /* Navigation lives on the BOTTOM edge now — thumb country. Fixed, so DOM
     order stays untouched and the swipe-preview clone keeps working. */
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  z-index: 60;
  box-sizing: border-box;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--ink) 97%, transparent),
    color-mix(in srgb, var(--ink) 92%, transparent)
  );
  backdrop-filter: blur(8px);
  border-top: 2px solid var(--line);
  border-bottom: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px env(safe-area-inset-bottom);
  overflow: hidden;
  max-width: 100%;
}

.banner-tabs {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.banner-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 2px solid var(--line);
  color: var(--sub-text);
  width: 44px;
  height: 44px;
  border-radius: 11px;
  cursor: pointer;
  flex: 0 0 auto;
}

.banner-tab:hover {
  border-color: var(--scheme-accent);
  color: var(--ink-text);
}

.banner-tab.active {
  color: var(--ink-text);
  border-color: var(--scheme-accent);
  background: var(--scheme-glow);
}

.banner-tab svg {
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
}

.banner-tab span {
  display: inline-block;
}

.banner-tab.active {
  color: var(--ink-text);
  background: var(--scheme-glow);
  border-color: var(--line);
}

.brand-banner #capBack,
.brand-banner .ov-back {
  background: var(--field);
  border-color: var(--field-line);
}

.overlay .ov-nav {
  position: static;
  flex: 0 0 auto;
  z-index: 20;
}

.overlay .ov-cap {
  justify-content: center;
  padding-left: 54px;
  padding-right: 54px;
}

.ov-cap .brand-txt {
  font-size: 17px;
  flex: 0 1 auto;
  max-width: 100%;
  text-align: center;
}

.edh-jump-row.insp-jump {
  position: fixed;
  right: 14px;
  bottom: calc(14px + var(--nav-h) + env(safe-area-inset-bottom));
  left: auto;
  top: auto;
  justify-content: flex-end;
  z-index: 60;
  height: auto;
}

/* Deck Inspiration: room between the explanation and the Theme / Kindred
   menus -- that gap is where the \u2630 rests when the page sits at its foot. */

.app > main:has(> #inspireResults) > .browse-selects {
  margin-top: 60px;
}

/* 1.39: the ☰ rides beside the land-base button now -- no strip kept free */

.app > main:has(> #inspireResults) > .browse-selects:has(.insp-land-row) {
  margin-top: 10px;
}

/* The base .edh-jump-row is sticky — without !important the burger rode
   the content and scrolled away. Fixed for real, and lifted above the deck
   bar + tabs stack. */

.dl-jump {
  position: fixed !important;
  top: auto !important;
  right: 14px;
  bottom: calc(150px + var(--nav-h) + env(safe-area-inset-bottom));
  left: auto;
  justify-content: flex-end;
  z-index: 45;
  height: auto;
}

.pp-imghold {
  position: relative;
  display: block;
}

.pp-own {
  position: absolute;
  left: 10px;
  bottom: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1e8a4c;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.otag-wrap {
  position: relative;
}

.otag-pop[hidden] {
  display: none !important;
}

.otag-pop {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--ink);
  border: 1.5px solid var(--pop-line);
  border-radius: 10px;
  max-height: 190px;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse;
  padding: 4px;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.45);
}

.otag-pop {
  top: auto;
  bottom: calc(100% + 4px);
  display: flex;
  flex-direction: column-reverse;
  overflow-y: auto;
  max-height: min(48vh, 380px);
  z-index: 40;
}

.df-compact,
.df-compact .adv-row,
#dlPanelBox {
  overflow: visible;
}

.df-compact .cselect-panel {
  top: auto;
  bottom: calc(100% + 4px);
  display: flex;
  flex-direction: column-reverse;
}

.modal-sheet {
  overflow: visible;
}

/* Het Nieuw-deck-blad mag zijn drop-ups niet afknippen: de formatlijst
   hangt vlak boven zijn eigen knop, net als elke andere drop-up. */

.modal-sheet.nd-sheet {
  overflow: visible !important;
}

/* De spoilerkeuze is een drop-up; de instellingenkaart knipt normaal alles
   af wat buiten haar rand valt. */

.settings-section:has(#pushSpoilPop) {
  overflow: visible;
}

#pushSpoilWrap {
  min-width: 132px;
}

#pushSpoilBtn {
  width: 100%;
  text-align: left;
  white-space: nowrap;
}

#pushSpoilPop {
  min-width: 190px;
  right: 0;
  left: auto;
}

#newDeckFmtPop {
  position: absolute;
  left: 0;
  right: 0;
  top: auto;
  bottom: calc(100% + 4px);
  max-height: min(48vh, 380px);
  z-index: 400;
}

.modal-backdrop {
  overflow: visible;
}

.otag-pop button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--ink-text);
  font: inherit;
  font-size: 13.5px;
  padding: 7px 9px;
  border-radius: 7px;
  cursor: pointer;
}

.otag-pop button:hover {
  background: var(--scheme-glow);
  color: var(--ink-text);
}

.otag-pop button.on {
  color: var(--ink-text);
  font-weight: 700;
}

.otag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.otag-chips:empty {
  display: none;
}

.otag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #111 !important;
  -webkit-text-fill-color: #111;
  text-shadow: none;
  background: linear-gradient(180deg, #f2d37a, #c99a30) !important;
  border: 1.5px solid rgba(255, 244, 210, 0.75);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.otag-chip span {
  font-size: 11px;
  opacity: 0.8;
}

/* Inside .searchbar the generic button rule paints brass — override back
   to the app's dark menu rows. */

.searchbar .otag-pop button,
.tw-poprow {
  display: flex !important;
  align-items: center;
  gap: 8px;
  text-align: left;
  background: none !important;
  color: var(--ink-text) !important;
  font-weight: 400;
  border: none;
  border-radius: 7px;
  padding: 7px 9px;
}

.searchbar .otag-pop button:hover {
  background: var(--scheme-glow) !important;
  color: var(--ink-text) !important;
}

.tw-poprow img {
  width: 30px;
  height: 42px;
  object-fit: cover;
  border-radius: 4px;
  flex: none;
}

.tw-poprow .tw-nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tw-poprow .tw-eur {
  color: var(--ink-text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  flex: none;
}

.overlay .topbar {
  top: 0;
}

/* ---------- deck selector (used on decklist/search/inspiration) ---------- */

.deck-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.deck-select-row label {
  font-size: 11px;
  color: var(--sub-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex: 0 0 auto;
}

.deck-select {
  flex: 1;
  min-width: 0;
  background: var(--ink-2);
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--ink-text);
  padding: 8px 10px;
  font-size: 14px;
}

/* An app update stays available without interrupting an active screen. */
.pwa-update {
  position: fixed;
  z-index: 180;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink-2);
  color: var(--ink-text, var(--parchment));
  box-shadow: 0 3px 16px #0004;
  font: 600 13px var(--font-body, sans-serif);
  cursor: pointer;
}
.pwa-update:disabled {
  opacity: 0.65;
  cursor: default;
}

/* Source: styles/cards.css */
/* ---------- legality ---------- */

.top-price-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 0;
  border-bottom: 2px solid var(--line);
  cursor: pointer;
}

.top-price-row:last-child {
  border-bottom: none;
}

.top-price-row img {
  width: 26px;
  height: 36px;
  border-radius: 3px;
  object-fit: cover;
  flex: 0 0 auto;
  background: #0006;
}

.tp-name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tp-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--ink-text);
  font-weight: 600;
  flex: 0 0 auto;
}

.legality {
  border-radius: 8px;
  border: 2px solid var(--line);
  margin-bottom: 8px;
  overflow: hidden;
  font-size: 13.5px;
  scroll-margin-top: 80px;
  scroll-margin-bottom: calc(var(--nav-h) + 122px + env(safe-area-inset-bottom));
}

.legality.ok {
  background: rgba(92, 139, 110, 0.12);
  border-color: rgba(92, 139, 110, 0.45);
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
}

.legality.bad {
  background: rgba(181, 72, 77, 0.1);
  border-color: rgba(181, 72, 77, 0.45);
}

.legality.warn {
  background: var(--scheme-glow);
  border-color: var(--line);
}

.lg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
}

.legality.bad .lg-head {
  color: var(--danger);
}

.legality.warn .lg-head {
  color: var(--ink-text);
}

.lg-icon {
  font-weight: 700;
  flex: 0 0 auto;
}

.lg-txt {
  flex: 1;
  font-weight: 600;
}

.lg-car {
  font-size: 11px;
  transition: transform 0.2s;
  opacity: 0.7;
}

.legality.open .lg-car {
  transform: rotate(180deg);
}

.lg-body {
  display: none;
  padding: 0 12px 10px;
}

.legality.open .lg-body {
  display: block;
}

.lg-item {
  padding: 7px 0;
  border-top: 2px solid var(--line);
}

.lg-label {
  font-size: 13px;
  color: var(--ink-text);
}

.lg-item.error .lg-label::before {
  content: '✕ ';
  color: var(--danger);
  font-weight: 700;
}

.lg-item.warn .lg-label::before {
  content: '⚠ ';
  color: var(--ink-text);
  font-weight: 700;
}

.lg-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.lg-card {
  font-size: 11.5px;
  background: var(--ink-2);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 2px 8px;
  color: var(--sub-text);
}

/* ---------- card detail overlay ---------- */

.card-price {
  font-size: 13px;
  color: var(--sub-text-2);
  margin: 0 0 14px;
  min-height: 16px;
}

.cp-val {
  font-family: 'Cinzel', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-text);
}

.cp-sub {
  font-size: 11.5px;
  color: var(--sub-text-2);
}

.cp-none {
  font-size: 12.5px;
  color: var(--sub-text-2);
  font-style: italic;
}

.card-detail {
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

.detail-sec {
  margin-top: 10px;
}

.ms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 18px;
  margin-top: 12px;
  justify-items: center;
}

/* Cast-ability summary */

.cast-sum {
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.cast-score {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cast-score b {
  font-family: 'JetBrains Mono', monospace;
  font-size: 30px;
  line-height: 1;
}

.cast-score span {
  font-size: 12.5px;
  color: var(--sub-text);
}

.cast-tip {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-text);
}

.cast-tip svg {
  vertical-align: -3px;
}

.cast-tip-k {
  flex: none;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--on-acc);
  background: var(--acc-fill);
  border-radius: 4px;
  padding: 2px 6px;
  margin-top: 1px;
}

.cast-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 2px;
  background: none;
  border: none;
  border-top: 1px solid var(--line);
  color: var(--ink-text);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}

.cast-row:first-of-type {
  border-top: none;
}

.cast-mv {
  flex: none;
  width: 18px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--sub-text);
}

.cast-nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cast-pips {
  flex: none;
  display: flex;
  gap: 1px;
}

.cast-p {
  flex: none;
  min-width: 44px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
}

.cast-p.low {
  background: var(--field);
  border-radius: 6px;
  padding: 1px 6px;
  font-weight: 700;
}

.ms-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 100%;
  max-width: 150px;
  min-width: 0;
}

.ms-big {
  position: relative;
  width: 92px;
  height: 92px;
  filter: drop-shadow(0 2px 7px rgba(0, 0, 0, 0.35));
}

.ms-big svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ms-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ms-pct i {
  font-style: normal;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.03em;
  color: #17130c;
  background: rgba(255, 255, 255, 0.68);
  border-radius: 9px;
  padding: 1px 5px;
  line-height: 1.25;
}

.ms-prod-lbl {
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--sub-text);
  text-transform: uppercase;
  text-align: center;
}

.ms-prod {
  position: relative;
  width: 100%;
  height: 18px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.28);
  border: 2px solid var(--line);
  overflow: hidden;
}

.ms-prod-fill {
  height: 100%;
  border-radius: 9px;
}

.ms-prod-n {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.cb-prod {
  margin-top: -5px;
  margin-bottom: 7px;
}

.track-thin {
  height: 5px !important;
}

.cb-prod .fill {
  opacity: 0.55;
}

.n-sm {
  font-size: 11px !important;
  color: var(--sub-text) !important;
}

/* Bottom-up on the card page too: each section's content reads first,
   then its NAME, with the golden stripe closing it off underneath — flex
   order moves the header without touching any markup. */

.detail-sec {
  display: flex;
  flex-direction: column;
}

.detail-h {
  order: 99;
  font-family: 'Cinzel', serif;
  color: var(--ink-text);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin: 10px 0 0;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--line);
}

.oracle-face {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}

.oracle-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.oracle-name {
  font-weight: 700;
  font-size: 14.5px;
}

.oracle-cost {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-text);
  flex: 0 0 auto;
}

.oracle-type {
  font-size: 12px;
  color: var(--sub-text);
  margin-top: 2px;
}

.oracle-text {
  font-size: 14px;
  line-height: 1.65;
  margin-top: 9px;
  color: var(--ink-text);
  white-space: pre-wrap;
}

.oracle-flavor {
  font-size: 13px;
  line-height: 1.55;
  margin-top: 9px;
  color: var(--sub-text-2);
  font-style: italic;
  border-top: 2px solid var(--line);
  padding-top: 8px;
}

.ruling {
  background: var(--ink-2);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
}

.ruling-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--sub-text-2);
  margin-bottom: 4px;
}

.ruling-text {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--parchment-dim);
}

/* ---------- tags ---------- */

.tag-editor {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 10px auto 0;
  max-width: 330px;
}

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tag-chip.tag-scry {
  border: 2px solid var(--scheme-accent);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

span.tag-chip.tag-scry:not(:has(button)) {
  padding-right: 10px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--scheme-glow);
  border: 2px solid var(--line);
  color: var(--ink-text);
  border-radius: 14px;
  padding: 4px 6px 4px 10px;
  font-size: 12.5px;
  font-weight: 600;
}

.tag-chip button {
  background: none;
  border: none;
  color: var(--ink-text);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0 3px;
  opacity: 0.7;
}

.tag-chip button:hover {
  opacity: 1;
  color: var(--danger);
}

.tag-none {
  font-size: 12.5px;
  color: var(--sub-text-2);
}

.tag-add-row {
  display: flex;
  gap: 6px;
}

.tag-add-row input {
  flex: 1;
  min-width: 0;
  background: var(--ink-2);
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--ink-text);
  padding: 9px 10px;
  font-size: 14px;
}

.tag-add-row input:focus {
  outline: none;
  border-color: var(--scheme-accent);
}

.info-i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid var(--sub-text);
  color: var(--sub-text);
  background: none;
  font-size: 12px;
  font-style: italic;
  font-family: Georgia, serif;
  padding: 0;
  margin-left: 6px;
  vertical-align: middle;
  cursor: pointer;
  flex: none;
  line-height: 1;
}

.tag-drop {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  padding: 6px;
}

/* An author display rule beats the `hidden` attribute's built-in
   display:none — without this guard the drop-up never actually hides and
   squats on top of the tag chips. */

.tag-drop[hidden] {
  display: none;
}

.card-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: #7cb8db;
  text-decoration: underline;
  text-underline-offset: 2px;
  font: inherit;
  cursor: pointer;
}

.cmb-head {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.cmb-names {
  font-weight: 700;
  line-height: 1.35;
}

.cmb-res-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--ink-text);
  font-size: 13px;
  padding: 7px 0 0;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
}

.cmb-search-row {
  padding: 8px 0 2px;
}

.cmb-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 9px;
}

.cmb-card {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.cmb-card img {
  width: 100%;
  display: block;
  border-radius: 7px;
}

.cmb-card-txt {
  border: 1.5px solid var(--pop-line);
  border-radius: 7px;
  min-height: 56px;
  color: inherit;
  font-size: 12.5px;
  padding: 4px;
}

.cs-combos-btn {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: 12px;
  z-index: 81;
  width: auto;
  padding: 7px 11px;
}
/* rides ON the page cap: stays above it (cap is 80 now) */

.overlay[id^='cardSheetOverlay_bg'] .cs-combos-btn {
  display: none !important;
}

.tag-drop-h {
  padding: 3px 10px 7px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-text);
  pointer-events: none;
  border-bottom: 1.5px solid var(--pop-line);
}

/* 1.26: the picker = a scrolling list above its own search field; each
   group's name is a gold plate under its tags, never mistaken for a tag. */

.tag-drop:has(> .tag-drop-list) {
  overflow: hidden;
  padding: 0;
  gap: 0;
}

.tag-drop-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  padding: 6px 6px 8px;
}

.tag-drop-search {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-top: 2px solid var(--pop-line);
  background: var(--panel);
}

.tag-drop-search .tds-ico {
  flex: none;
  display: flex;
  opacity: 0.7;
}

.tag-drop-search .tds-ico svg {
  width: 18px;
  height: 18px;
}

.tag-drop-search input {
  flex: 1;
  min-width: 0;
  background: var(--ink-2);
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--ink-text);
  padding: 8px 10px;
  font-size: 14px;
}

.tag-drop-search input:focus {
  outline: none;
  border-color: var(--scheme-accent);
}

.tag-drop-none {
  padding: 12px 10px;
  font-size: 13px;
  color: var(--sub-text);
  text-align: center;
}

html .tag-drop .tag-drop-list > .tag-drop-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 2px 4px;
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(var(--gold), var(--gold)) !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  color: #111 !important;
  -webkit-text-fill-color: #111 !important;
  text-shadow: none !important;
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

html .tag-drop .tag-drop-list > .tag-drop-h * {
  font-weight: 800;
  font-size: 11px;
  color: #111 !important;
  -webkit-text-fill-color: #111 !important;
  background: none !important;
  text-shadow: none !important;
}

html .tag-drop .tag-drop-list > .tag-drop-h b {
  opacity: 0.75;
}

.tag-drop-list > .tag-drop-h:first-child {
  margin-bottom: 0;
}

@media (hover: hover) {
  .tag-drop-list button:hover {
    background: var(--hl);
  }
}

/* On deckless card pages the picker is the app's one allowed drop-DOWN:
   the editor sits under the buttons and the list opens below the input. */

#ciTagBox .tag-drop {
  bottom: auto;
  top: calc(100% + 6px);
}

/* The tag picker rides the screen foot as a POPUP over the bottom
   buttons and nav -- not clipped inside its box. */

.tag-add-row .tag-drop,
#ciTagBox .tag-drop {
  position: fixed;
  left: 10px;
  right: 10px;
  top: auto;
  bottom: calc(env(safe-area-inset-bottom) + 10px);
  max-height: 55vh;
  z-index: 130;
  box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.55);
}

.tag-drop button {
  background: none;
  border: none;
  color: var(--ink-text);
  text-align: left;
  padding: 8px 10px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
}

.tag-drop button:active {
  background: var(--scheme-glow);
  color: var(--ink-text);
}

.tag-suggest {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.tag-sugg {
  background: var(--ink-2);
  border: 1px dashed var(--line);
  color: var(--sub-text);
  border-radius: 12px;
  padding: 3px 9px;
  font-size: 12px;
  cursor: pointer;
}

.tag-sugg:hover {
  border-style: solid;
  border-color: var(--scheme-accent);
  color: var(--ink-text);
}

/* Source: styles/pages/home-decks.css */
/* ---------- home (splash) ---------- */

.home-page {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 3vh 22px 16px;
}

.home-sea {
  display: none;
}

.home-hero-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.home-glow {
  position: absolute;
  width: 142px;
  height: 142px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--brass) 30%, transparent),
    color-mix(in srgb, var(--brass) 6%, transparent) 55%,
    transparent 72%
  );
  animation: homePulse 5s ease-in-out infinite;
  pointer-events: none; /* decoration never eats a tap */
}

@keyframes homePulse {
  0%,
  100% {
    transform: scale(0.94);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-glow {
    animation: none;
  }
}

/* The badge is the app's face on Home. It shares its artwork with the launcher
   icon on purpose -- that is the brand, not a bug. (The startup flicker came
   from the APK drawing a SECOND copy behind Android's splash; that copy is
   gone as of APK 1.8, and the launcher icon now simply stays until the app is
   there.) z-index keeps it above the glow, which is positioned and would
   otherwise paint over it and swallow the tap. */

.home-logo {
  position: relative;
  width: 118px;
  height: 118px;
  object-fit: contain;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.6));
}

.home-logo-clip {
  position: relative;
  display: block;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  overflow: hidden;
  z-index: 1;
  cursor: pointer;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.6));
  animation: logoIdle 3.4s ease-in-out infinite;
}

.home-logo-clip .home-logo {
  width: 100%;
  height: 100%;
  filter: none;
  animation: none;
  transform: scale(1.24);
  transform-origin: 50% 50%;
  cursor: pointer;
}

.home-logo-txt {
  display: block;
  position: relative;
  z-index: 1;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 34px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--ink-text);
  text-shadow: 0 4px 22px color-mix(in srgb, var(--brass) 35%, transparent);
}

.crest-stack {
  display: inline-block;
}

.crest-stack .cl-base {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.crest-stack .cl-part {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.crest-stack .cl-sword-l,
.crest-stack .cl-sword-r {
  transform-origin: 50% 63%;
}

.home-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(300px, 80%);
  margin: 2px auto 6px;
  z-index: 1;
}

.home-rule-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.home-rule-star {
  color: var(--ink-text);
  font-size: 12px;
  opacity: 0.9;
}

.home-points {
  max-width: 340px;
  margin: 6px auto 10px;
  padding: 0 0 0 6px;
  list-style: none;
  text-align: left;
}

.home-points li {
  position: relative;
  padding-left: 18px;
  margin: 7px 0;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink-text);
  opacity: 0.92;
}

.home-points li::before {
  content: '✦';
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--ink-text);
  font-size: 11px;
}

.home-hero-wrap {
  position: relative;
}

.home-logo {
  cursor: default;
  animation: logoIdle 3.4s ease-in-out infinite;
}

@keyframes logoIdle {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 6px color-mix(in srgb, var(--brass) 18%, transparent));
  }
  50% {
    transform: scale(1.035);
    filter: drop-shadow(0 0 16px color-mix(in srgb, var(--brass) 42%, transparent));
  }
}

.logo-depart-swing .cl-sword-l {
  animation: swordL 0.55s ease-in-out 1 !important;
}

.logo-depart-swing .cl-sword-r {
  animation: swordR 0.55s ease-in-out 1 !important;
}

@keyframes swordL {
  0% {
    transform: rotate(0);
  }
  32% {
    transform: rotate(15deg);
  }
  62% {
    transform: rotate(-7deg);
  }
  84% {
    transform: rotate(3deg);
  }
  100% {
    transform: rotate(0);
  }
}

@keyframes swordR {
  0% {
    transform: rotate(0);
  }
  32% {
    transform: rotate(-15deg);
  }
  62% {
    transform: rotate(7deg);
  }
  84% {
    transform: rotate(-3deg);
  }
  100% {
    transform: rotate(0);
  }
}

.logo-depart-dip .cl-anchor {
  animation: logoDip 0.5s ease-in-out 1 !important;
}

@keyframes logoDip {
  0% {
    transform: translateY(0);
  }
  45% {
    transform: translateY(10px);
  }
  100% {
    transform: translateY(0);
  }
}

.logo-land-drop {
  animation:
    logoDropRise 0.8s cubic-bezier(0.3, 1.4, 0.5, 1) 1,
    logoIdle 3.4s ease-in-out 0.8s infinite;
}

@keyframes logoDropRise {
  0% {
    transform: translateY(-14px);
    opacity: 0.4;
  }
  55% {
    transform: translateY(9px);
    opacity: 1;
  }
  80% {
    transform: translateY(-3px);
  }
  100% {
    transform: translateY(0);
  }
}

.logo-land-swing {
  animation:
    logoSwingIn 0.8s ease-out 1,
    logoIdle 3.4s ease-in-out 0.8s infinite;
}

@keyframes logoSwingIn {
  0% {
    transform: rotate(-11deg) scale(0.94);
    opacity: 0.4;
  }
  55% {
    transform: rotate(7deg) scale(1.02);
    opacity: 1;
  }
  80% {
    transform: rotate(-3deg);
  }
  100% {
    transform: rotate(0) scale(1);
  }
}

.logo-gleam {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
}

.logo-gleam.sweep {
  opacity: 1;
  background: conic-gradient(
    from -90deg,
    rgba(255, 236, 180, 0.95) 0deg,
    rgba(255, 236, 180, 0.35) 14deg,
    transparent 30deg 360deg
  );
  -webkit-mask: radial-gradient(
    circle,
    transparent 0 calc(50% - 5px),
    #000 calc(50% - 4px) calc(50% - 1px),
    transparent 50%
  );
  mask: radial-gradient(
    circle,
    transparent 0 calc(50% - 5px),
    #000 calc(50% - 4px) calc(50% - 1px),
    transparent 50%
  );
  animation: gleamSweep 1s ease-in-out 0.15s 1 both;
}

@keyframes gleamSweep {
  0% {
    transform: rotate(0);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: rotate(180deg);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-logo,
  .logo-land-drop,
  .logo-land-swing {
    animation: none !important;
  }
  .logo-gleam.sweep {
    animation: none;
    opacity: 0;
  }
}

.home-formats {
  z-index: 1;
  width: min(370px, 100%);
  margin: 2px auto 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hfm-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  justify-content: center;
}

.hfm-k {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-text);
  margin-right: 2px;
}

.hfm-chip {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 2px solid var(--scheme-accent);
  color: var(--ink-text);
  background: var(--panel);
}

.hfm-chip.dim {
  opacity: 0.62;
}

.home-kicker {
  z-index: 1;
  font-family: 'Cinzel', serif;
  font-size: 11.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-text);
  margin: 0 0 6px;
  opacity: 0.95;
}

.home-tagline {
  z-index: 1;
  font-size: 13.5px;
  color: var(--sub-text);
  max-width: 350px;
  line-height: 1.5;
  margin: 0 0 6px;
}

.home-tagline-2 {
  margin-bottom: 10px;
}

.home-tagline strong {
  color: var(--ink-text);
  font-weight: 700;
}

.inline-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--head-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.inline-link:hover {
  color: var(--ink-text);
}

.home-callout {
  z-index: 1;
  font-family: 'Cinzel', serif;
  font-size: 13.5px;
  color: var(--ink-text);
  letter-spacing: 0.6px;
  margin: 0 0 9px;
  font-style: italic;
}

.home-facts {
  z-index: 1;
  display: flex;
  gap: 8px;
  width: min(370px, 100%);
  margin-bottom: 10px;
}

.home-fact {
  flex: 1;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 7px 5px;
}

.hf-n {
  font-family: 'Cinzel', serif;
  font-size: 21px;
  font-weight: 700;
  color: var(--ink-text);
  line-height: 1;
}

.hf-l {
  font-size: 10.5px;
  color: var(--ink-text);
  margin-top: 4px;
  letter-spacing: 0.3px;
}

.hf-s {
  font-size: 9.5px;
  color: var(--sub-text-2);
  margin-top: 2px;
  letter-spacing: 0.2px;
}

.home-search-btn {
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--acc-fill);
  color: var(--on-acc);
  border: none;
  border-radius: 30px;
  padding: 12px 30px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    0 10px 30px color-mix(in srgb, var(--scheme-accent) 34%, transparent),
    inset 0 1px 0 rgba(0, 0, 0, 0.35);
  transition:
    transform 0.12s,
    box-shadow 0.12s;
}

.home-search-btn svg {
  width: 21px;
  height: 21px;
  stroke: var(--on-acc);
}

.hsb-anchor {
  font-size: 18px;
  line-height: 1;
}

.home-sub {
  z-index: 1;
  font-size: 12.5px;
  color: var(--sub-text-2);
  margin: 7px 0 0;
  letter-spacing: 0.3px;
}

.home-search-btn:active {
  transform: translateY(1px);
  box-shadow:
    0 5px 16px color-mix(in srgb, var(--scheme-accent) 30%, transparent),
    inset 0 1px 0 rgba(0, 0, 0, 0.35);
}

.home-hero-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px;
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse at 15% 20%, var(--brass-glow), transparent 70%),
    linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 2px solid var(--line);
}

.home-hero-banner .seal {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.home-hero-banner .seal svg {
  width: 100%;
  height: 100%;
}

.hero-txt h1 {
  font-family: 'Cinzel', serif;
  font-size: 19px;
  margin: 0;
  color: var(--ink-text);
  font-weight: 600;
}

.hero-txt p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--sub-text);
}

.fleet-stat {
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-text);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.3px;
}

.new-deck-btn {
  background: var(--acc-fill);
  color: var(--on-acc);
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}

.new-deck-btn.full {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
}

.deck-grid {
  display: flex;
  flex-wrap: wrap-reverse;
  gap: 12px;
}

.deck-grid > * {
  flex: 0 0 calc(50% - 6px);
  min-width: 0;
}

/* the single-column tiles (other fleet, My Collection) keep full width */

.deck-grid[style*='grid-template-columns:1fr'] > * {
  flex-basis: 100%;
}

.deck-tile {
  position: relative;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}

.tile-fav,
.tile-menu {
  position: absolute;
  top: 6px;
  z-index: 5;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(6, 16, 26, 0.6);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}

.tile-fav {
  left: 6px;
  color: var(--ink-text);
}

.tile-fav.on {
  color: #ffd34d;
}

.tile-menu {
  right: 6px;
  font-size: 18px;
  line-height: 1;
}

.folder-tile {
  position: relative;
  background: var(--panel);
  border: 2px solid var(--scheme-accent);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  padding: 18px 10px 14px;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}

.folder-tile:active {
  transform: scale(0.97);
}

.folder-face {
  color: var(--ink-text);
  margin-bottom: 10px;
}

.binder-tile .folder-face {
  width: 100%;
}

.binder-tile .folder-face img {
  width: 100%;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
}

.binder-tile .folder-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: 100%;
  overflow: hidden;
}

.folder-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink-text);
  text-align: center;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

.folder-sub {
  font-size: 12px;
  color: var(--sub-text);
  margin-top: 4px;
}

.section-label {
  font-family: 'Cinzel', serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 13px;
  color: var(--ink-text);
  margin: 14px 2px 8px;
}

.folder-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  margin: 2px 0 12px;
}

.folder-crumb button {
  background: none;
  border: none;
  color: var(--ink-text);
  cursor: pointer;
  font-size: 14px;
  padding: 2px;
  font-family: 'Inter';
}

.folder-crumb .fc-cur {
  color: var(--ink-text);
}

.folder-crumb .fc-sep,
.fp-crumbs .fc-sep {
  color: var(--sub-text);
}

.fp-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  margin: 2px 0 10px;
  font-size: 13.5px;
}

/* Move picker: the page's own folder tiles, two across, bottom-up. */

.fp-scroll {
  max-height: 52vh;
  overflow-y: auto;
  margin: 0 -2px 10px;
  padding: 2px;
}

.fp-grid {
  display: flex;
  flex-wrap: wrap-reverse;
  gap: 10px;
}

.fp-grid > .fp-tile {
  flex: 0 0 calc(50% - 5px);
  min-width: 0;
  min-height: 118px;
  padding: 12px 8px 10px;
}

.fp-tile .folder-face {
  margin-bottom: 6px;
}

.fp-tile .folder-face svg {
  width: 40px;
  height: 40px;
}

.fp-tile .folder-name {
  font-size: 14px;
}

.fp-tile .folder-sub {
  font-size: 11.5px;
}

.fp-tile.fp-new {
  border-style: dashed;
  font: inherit;
  color: inherit;
}

.fp-tile.fp-new .folder-face svg {
  width: 34px;
  height: 34px;
}

.fp-crumb {
  background: none;
  border: none;
  color: var(--ink-text);
  cursor: pointer;
  font-size: 13.5px;
  padding: 2px;
  font-family: 'Inter';
}

.deck-tile:hover {
  border-color: var(--scheme-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.deck-tile .art {
  height: 96px;
  background-size: cover;
  background-position: center 20%;
  background-color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid var(--line);
}

.deck-tile .art .ph {
  font-size: 26px;
  opacity: 0.35;
}

.deck-tile .id-strip {
  height: 4px;
  width: 100%;
}

.deck-tile .body {
  padding: 10px;
}

.deck-tile .nm {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.deck-tile .meta {
  font-size: 11.5px;
  color: var(--sub-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.deck-tile .edited {
  font-size: 13px;
  color: var(--sub-text-2);
  margin-top: 1px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.deck-tile .dk-salt {
  white-space: nowrap;
  color: var(--sub-text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.as-list .deck-tile .edited {
  flex-direction: row-reverse;
}
/* list: salt LEFT of the price */

/* The price ring replaces the old "+". Spinning means this deck is being
   priced right now; standing still and dimmed means the total is still
   partial but nothing is happening for it at this moment. */

.price-ring {
  display: inline-block;
  width: 9px;
  height: 9px;
  vertical-align: -1px;
  margin-left: 3px;
  border: 1.5px solid var(--sub-text-2);
  border-top-color: var(--scheme-accent);
  border-radius: 50%;
  animation: sp 0.8s linear infinite;
}

.price-ring.idle {
  animation: none;
  opacity: 0.45;
}

.deck-tile.active-marker {
  border-color: var(--scheme-accent);
}

/* ---- List view (My Decks, collection binders): Moxfield-style rows.
   Bottom-up: the first entry is the LOWEST row, like the tiles' first. */

.deck-grid.as-list {
  flex-direction: column-reverse;
  flex-wrap: nowrap;
  gap: 0;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.deck-grid.as-list > * {
  flex: 0 0 auto;
  width: 100%;
  max-width: none;
}

.as-list .folder-tile,
.as-list .deck-tile {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 0;
  padding: 11px 14px;
  border: none;
  border-radius: 0;
  border-bottom: 1.5px solid var(--line);
  background: transparent;
  box-shadow: none;
  transform: none;
}

.as-list > :first-child {
  border-bottom: none;
}

.as-list .folder-tile:active,
.as-list .deck-tile:active {
  background: color-mix(in srgb, var(--panel) 80%, #000);
}

.as-list .folder-face {
  margin: 0;
  flex: 0 0 30px;
  width: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px !important;
}

.as-list .folder-face svg {
  width: 26px;
  height: 26px;
}

.as-list .folder-face span {
  font-size: 22px !important;
}

.as-list .binder-tile .folder-face {
  flex: 0 0 46px;
  width: 46px;
}

.as-list .binder-tile .folder-face img {
  width: 46px;
  height: 30px;
  box-shadow: none;
  border-radius: 4px;
}

.as-list .binder-glyph-row {
  order: 5;
  margin-left: auto;
  flex: none;
}

.as-list .folder-name {
  flex: 1;
  min-width: 0;
  text-align: left;
  justify-content: flex-start;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.as-list .folder-sub {
  margin: 0;
  flex: none;
  text-align: right;
  font-size: 12px;
}

.as-list .deck-tile .art {
  display: none;
}

.as-list .deck-tile .id-strip {
  order: -1;
  width: 4px;
  height: 34px;
  flex: none;
  border-radius: 2px;
}

.as-list .tile-fav {
  position: static;
  flex: none;
  width: 26px;
  height: 26px;
  background: none;
  backdrop-filter: none;
  order: -2;
}

.as-list .deck-tile .body {
  flex: 1;
  min-width: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: 'nm ed' 'meta meta';
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
}

.as-list .deck-tile .nm {
  grid-area: nm;
  -webkit-line-clamp: 1;
  margin: 0;
  font-size: 15px;
}

.as-list .deck-tile .meta {
  grid-area: meta;
}

.as-list .deck-tile .edited {
  grid-area: ed;
  margin: 0;
}

.as-list .deck-tile.active-marker {
  background: color-mix(in srgb, var(--brass) 10%, transparent);
}

.as-list .deck-tile .meta > span:last-child {
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
}

.as-list .deck-tile .meta .bkt-mini {
  font-size: 12px;
}

.as-list .binder-glyph-row {
  align-self: center;
  margin: 0 0 0 4px;
}

/* Binder rules */

.br-info {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--scheme-accent);
  background: var(--field);
  color: var(--ink-text);
  font:
    italic 700 14px/1 Georgia,
    serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.br-gl {
  padding: 6px 10px;
  min-width: 42px;
  justify-content: center;
}

.br-gl svg {
  width: 20px;
  height: 20px;
}

.br-gl .rar-dot {
  width: 14px;
  height: 14px;
}

.br-h2 {
  border-top: 1.5px solid var(--line);
  padding-top: 10px;
  margin-top: 2px;
  color: var(--ink-text);
}

.want-tile {
  position: relative;
}

.want-img {
  position: relative;
}

.want-bell {
  position: absolute;
  bottom: 12px;
  left: 54px;
  z-index: 3;
  min-width: 34px;
  height: 30px;
  padding: 0 9px;
  border-radius: 15px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: rgba(10, 10, 12, 0.78);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.want-bell.on {
  border-color: var(--scheme-accent);
  color: var(--ink-text);
}

.want-bell.hit {
  background: #1f7a3d;
  border-color: #7fe0a0;
  color: #fff;
}

.pw-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-text);
}

.pw-row span:first-child {
  flex: 1;
}

.pw-row input {
  width: 110px;
  font-size: 18px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--field-line);
  background: var(--field);
  color: var(--ink-text);
  text-align: right;
}

.pw-hint {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--sub-text);
}

.pt-ov .pt-wrap {
  max-width: 900px;
}

.pt-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 6px 12px;
  font-size: 13.5px;
  color: var(--sub-text);
}

.pt-stats b {
  color: var(--ink-text);
}

.pt-zone {
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  color: var(--sub-text);
  padding: 2px 8px;
  font-size: 13.5px;
  cursor: pointer;
}

.pt-life {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pt-life button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: none;
  color: var(--ink-text);
  font-size: 16px;
  cursor: pointer;
}

.pt-field {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 6px 10px;
}

.pt-row {
  display: flex;
  flex-wrap: wrap-reverse;
  gap: 6px;
  align-items: flex-end;
  min-height: 54px;
  padding: 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.pt-lands {
  background: rgba(0, 0, 0, 0.28);
}

.pt-empty {
  font-size: 12px;
  color: var(--sub-text);
  opacity: 0.7;
  align-self: center;
  margin: 0 auto;
}

.pt-card {
  width: 15.5%;
  max-width: 92px;
  aspect-ratio: 63/88;
  border-radius: 5px;
  overflow: hidden;
  background: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 10px;
  color: var(--ink-text);
  transition: transform 0.15s;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.pt-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.pt-card.token {
  border: 1.5px dashed var(--scheme-accent);
  padding: 3px;
}

.pt-card.tapped {
  transform: rotate(90deg) scale(0.86);
  opacity: 0.85;
}

.pt-lands .pt-card {
  width: 12.5%;
}

.pt-cz {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  border-radius: 10px;
  padding: 2px;
}

.pt-czs {
  display: flex;
  gap: 6px;
}

.pt-cz-l {
  font-size: 11px;
  color: var(--sub-text);
  white-space: nowrap;
}

.pt-cz-empty {
  height: 81px;
  border: 1.5px dashed var(--line);
  border-radius: 5px;
}

/* 1.39: command zone left, the graveyard beside it */

.pt-czrow {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 4px 10px;
}

.pt-gy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  overflow: hidden;
}

.pt-gy-cards {
  display: flex;
  gap: 5px;
  max-width: 100%;
  overflow: hidden;
}

.pt-gy-cards .pt-card {
  width: 44px;
  flex: 0 0 44px;
}

.pt-gy-l {
  font-size: 11px;
  color: var(--sub-text);
}

.add-sheet .primary-btn {
  width: 100%;
  margin: 0;
}

.add-qty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 4px 0;
}

.add-qty .ghost-btn {
  width: 48px;
  flex: none;
  margin: 0;
  font-size: 20px;
  padding: 6px 0;
}

.add-qty b {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  min-width: 36px;
  text-align: center;
  color: var(--ink-text);
}

.pt-pile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 62vh;
  overflow-y: auto;
  padding: 2px;
}

.pt-pile-grid .pt-card {
  width: 100%;
  max-width: none;
}

.pt-nc {
  flex-wrap: wrap;
}

.pt-nc .pt-art-first {
  margin-left: auto;
}

.pt-over {
  outline: 2.5px solid var(--scheme-accent);
  outline-offset: -2px;
}

.pt-armed {
  box-shadow: 0 0 0 2.5px var(--scheme-accent);
  transform: scale(1.04);
}

.pt-dragsrc {
  opacity: 0.35;
}

.pt-ghost {
  position: fixed;
  z-index: 400;
  pointer-events: none;
  opacity: 0.94;
  transform: rotate(-4deg);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.55);
  max-width: none !important;
  flex: none !important;
}

/* Smart switch in the cap, right of the title, the word under it */

.pt-ov .ov-cap {
  position: relative;
}

.pt-ov .ov-cap .ov-title {
  padding: 0 58px;
}

.pt-smart {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}

.pt-smart-l {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--ink-text);
  text-transform: uppercase;
}

.pt-czc {
  position: relative;
  width: 58px;
}

.pt-czc .pt-card {
  width: 100%;
}

.pt-czc i {
  position: absolute;
  right: -4px;
  top: -4px;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-text);
}

.pt-msg {
  text-align: center;
  font-size: 12.5px;
  color: var(--sub-text);
  padding: 4px 10px;
}

.pt-hand {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 10px;
  min-height: 120px;
  align-items: flex-end;
}

.pt-hand .pt-card {
  flex: 0 0 23%;
  width: auto;
  max-width: 120px;
}

.pt-bar {
  display: flex;
  gap: 8px;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
}

.pt-bar > button {
  flex: 1;
  margin: 0;
}

.pt-menu {
  gap: 8px;
}

.pt-menu > .ghost-btn {
  width: 100%;
}

.pt-scry {
  display: flex;
  gap: 8px;
}

.pt-scry-c {
  flex: 1;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--ink-text);
  font-size: 12px;
  cursor: pointer;
}

.pt-scry-c .pt-card {
  width: 100%;
  max-width: none;
}

.pt-scry-c.down {
  opacity: 0.55;
}

.pt-sum {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-text);
}

.bk-hint {
  font-size: 13px;
  line-height: 1.5;
  color: var(--sub-text);
}

.bk-sheet .br-title span {
  display: block;
}

.bk-sheet .br-title span + span {
  margin-top: 6px;
  font-size: 12px;
}

.bk-actions {
  flex-direction: column-reverse;
}

.bk-actions > button {
  width: 100%;
  flex: none;
}

#backupNote .bk-now {
  flex: none;
  background: var(--acc-fill);
  color: var(--on-acc);
  border: none;
  border-radius: 16px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.br-dd .br-dd-panel {
  top: auto;
  bottom: calc(100% + 4px);
  display: flex;
  flex-direction: column-reverse;
  max-height: 260px;
}

.br-dd .br-dd-panel[hidden] {
  display: none;
}

.br-dd .cselect-opt {
  flex: 0 0 auto;
}

.col-group-label {
  margin: 16px 2px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.col-group-label .cg-n {
  color: var(--sub-text);
  font-family: 'Inter';
  font-size: 12px;
  letter-spacing: 0;
}

.col-group-label svg {
  flex: none;
}

.ac-foil {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  color: var(--ink-text);
  cursor: pointer;
}

.ac-foil input {
  width: 20px;
  height: 20px;
  accent-color: var(--brass);
  margin: 0;
}

.ci-foil-on {
  color: var(--ink-text);
  border-color: var(--scheme-accent);
}

.col-tile .foil-star.col-foil {
  left: auto;
  right: 8px;
  bottom: auto;
  top: 44px;
}

.want-have {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background-image: linear-gradient(var(--gold), var(--gold));
  color: #111;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.deckpick.br-sheet {
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 84vh;
  overflow-y: auto;
  border-radius: 16px 16px 0 0;
  margin: 0 auto;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.br-title b {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--ink-text);
  margin-bottom: 4px;
}

.br-title span {
  font-size: 12.5px;
  color: var(--sub-text);
  line-height: 1.45;
}

.br-sec {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.br-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--sub-text);
}

.br-h #brPriceLab {
  font-family: 'JetBrains Mono', monospace;
  text-transform: none;
  color: var(--ink-text);
  font-size: 13px;
}

.br-pt {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  cursor: pointer;
}

.br-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.br-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
}

.br-chip.active {
  background: var(--acc-fill);
  color: var(--on-acc);
  border-color: var(--scheme-accent);
}

.br-actions {
  display: flex;
  gap: 8px;
}

.br-actions > * {
  flex: 1;
  margin: 0;
}

.br-err {
  color: #fff;
  background: var(--danger);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.deckpick.bc-sheet {
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  width: 100%;
  max-width: 560px;
  max-height: 84vh;
  overflow-y: auto;
  border-radius: 16px 16px 0 0;
  margin: 0 auto;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.bc-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  margin: 0;
  text-align: left;
}

.bc-opt small {
  font-weight: 400;
  font-size: 11.5px;
  opacity: 0.85;
}

.bc-rem {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--sub-text);
  padding: 4px 2px;
}

.bc-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.bc-head img {
  width: 64px;
  border-radius: 5px;
  flex: none;
}

.bc-head b {
  display: block;
  font-size: 15px;
}

.bc-head span {
  font-size: 13px;
  color: var(--sub-text);
}

.brs-list {
  display: flex;
  flex-direction: column;
  max-height: 52vh;
  overflow-y: auto;
}

.brs-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 2px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}

.brs-row span {
  font-size: 12.5px;
  color: var(--sub-text);
}

.pips-mini {
  display: flex;
  gap: 3px;
  align-items: center;
}

.pips-mini svg {
  display: block;
}

.mb-mini {
  color: var(--sub-text);
  font-weight: 400;
}

.pp-wrap {
  position: relative;
}

.pp-wrap .sr-tile {
  width: 100%;
}

.pp-foil {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  background: rgba(10, 22, 36, 0.88);
  border: 2.5px solid var(--scheme-accent);
  border-radius: 999px;
  color: var(--ink-text);
  font-size: 12px;
  line-height: 1;
  padding: 6px 9px;
  font-family: 'JetBrains Mono', monospace;
}

.pp-foil:active {
  transform: scale(0.94);
}

.sp-shelf-ico {
  display: inline-block;
  margin-right: 6px;
  vertical-align: -3px;
}

.sp-shelf-ico svg,
.sp-shelf-ico img {
  width: 15px;
  height: 15px;
  display: inline-block;
}

.dock-search-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

/* Searching the deck: the commander block, description and game log step
   aside -- only the matching cards remain. */

body.dl-searching .dl-bridge > :not(#dlPanelBox) {
  display: none !important;
}

body.dl-searching .dl-bridge {
  min-height: 0;
  margin-bottom: 0;
  gap: 0;
}

.dock-search-wrap .dock-search {
  padding-right: 36px;
}

/* 1.35: the chevron sits INSIDE the field; the field no longer pokes 8px
   past its wrap into the loupe beside it */

.dock-search-wrap .in-chev {
  margin-left: -32px;
  margin-right: 2px;
}

.df-compact .otag-wrap {
  width: 100%;
  min-width: 0;
}

.df-compact .otag-wrap > input {
  width: 100%;
  box-sizing: border-box;
}

.dock-search {
  flex: 1;
  min-width: 0;
  background: rgba(10, 26, 40, 0.55);
  border: 1.5px solid var(--field-line);
  border-radius: 10px;
  color: var(--text);
  padding: 8px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
}

.dock-search:focus {
  outline: none;
  border-color: var(--scheme-accent);
}

#dockSearchBtn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.pip {
  border-radius: 50%;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.3);
}

.pip.sm {
  width: 14px;
  height: 14px;
  font-size: 9px;
}

.pip.W {
  background: #f1e6c8;
  color: #5b4a1a;
}
.pip.U {
  background: #7cb8db;
  color: #0d3550;
}

.pip.B {
  background: #8b7ea8;
  color: #1a0d24;
}
.pip.R {
  background: #d98a6b;
  color: #4a1505;
}

.pip.G {
  background: #8fbd8f;
  color: #0d2e0d;
}
.pip.C {
  background: #c7c2ba;
  color: #2a2a2a;
}

.empty-home {
  text-align: center;
  padding: 50px 20px;
  color: var(--sub-text);
}

.empty-home .seal {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  opacity: 0.85;
}

.empty-home .seal.lg {
  width: 80px;
  height: 80px;
}

.empty-home p {
  font-size: 14px;
  max-width: 260px;
  margin: 0 auto 14px;
}

.empty-home button {
  background: var(--acc-fill);
  color: var(--on-acc);
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}

/* Source: styles/pages/decklist-collection.css */
/* ---------- deck header ---------- */

.deck-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.deck-title-row input {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-text);
  background: none;
  border: none;
  border-bottom: 1px dashed transparent;
  flex: 1;
  min-width: 0;
  padding: 2px 0;
}

.deck-title-row input:focus {
  outline: none;
  border-bottom-color: var(--scheme-accent);
}

.builder-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 8px;
}

.b-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--sub-text);
  padding: 8px 4px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.b-tab.active {
  color: var(--ink-text);
  border-bottom-color: var(--scheme-accent);
}

.deck-meter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0 8px;
}

.lg-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 14px;
  padding: 4px 11px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid var(--line);
  background: var(--ink-2);
  font-family: 'Inter';
}

.lg-chip.ok {
  color: var(--success);
  border-color: rgba(92, 139, 110, 0.5);
  background: rgba(92, 139, 110, 0.1);
}

.lg-chip.bad {
  color: var(--danger);
  border-color: rgba(181, 72, 77, 0.5);
  background: rgba(181, 72, 77, 0.1);
}

.lg-chip.warn {
  color: var(--ink-text);
  border-color: var(--line);
  background: var(--scheme-glow);
}

.lg-chip .lg-car {
  font-size: 10px;
  opacity: 0.7;
  transition: transform 0.2s;
}

.lg-chip.open .lg-car {
  transform: rotate(180deg);
}

.deck-meter-row .count {
  font-family: 'Cinzel', serif;
  font-size: 17px;
  color: var(--ink-text);
  font-weight: 600;
  white-space: nowrap;
}

.deck-meter-row .count.over {
  color: var(--danger);
}

.over-badge {
  font-size: 11px;
  color: var(--danger);
  font-weight: 700;
  background: rgba(165, 58, 63, 0.14);
  border: 1px solid rgba(165, 58, 63, 0.35);
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 4px;
}

.bar-fill.over {
  background: linear-gradient(90deg, var(--danger), #d9702e);
}

.bar {
  height: 5px;
  background: var(--ink-2);
  border-radius: 4px;
  overflow: hidden;
  flex: 1;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brass-dim), var(--brass));
  transition: width 0.3s;
}

.need-deck {
  text-align: center;
  padding: 50px 20px;
  color: var(--sub-text);
}

.need-deck .anchor {
  font-size: 30px;
  opacity: 0.4;
  margin-bottom: 10px;
}

.need-deck button {
  background: var(--acc-fill);
  color: var(--on-acc);
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  margin-top: 10px;
}

/* ---------- decklist actions / panels ---------- */

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ghost-btn {
  flex: 1;
  min-width: 0;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  color: var(--ink-text);
  padding: 9px 6px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}

.ghost-btn:hover {
  border-color: var(--scheme-accent);
}

/* Picked: the accent pair, ringed by the sub variant that stands out from
   the plate. The ring is what carries the state on the black scheme, where
   the accent and the plate are a hair apart. */

.ghost-btn.active {
  background: var(--acc-fill);
  color: var(--on-acc);
  border-color: var(--scheme-accent);
  border-width: 2px;
}

.bulk-textarea {
  width: 100%;
  min-height: 190px;
  max-height: 34vh;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  border-radius: 8px;
  color: var(--ink-text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  padding: 12px;
  resize: vertical;
  margin-bottom: 10px;
}

.primary-btn {
  background: var(--acc-fill);
  color: var(--on-acc);
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14.5px;
  width: 100%;
}

.primary-btn.danger-fill {
  background: var(--danger);
  color: #fff;
}

.report-list {
  margin-top: 10px;
  max-height: 260px;
  overflow-y: auto;
  border: 2px solid var(--line);
  border-radius: 8px;
}

.report-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  font-size: 13px;
  border-bottom: 2px solid var(--line);
}

.report-row:last-child {
  border-bottom: none;
}

.report-row span:first-child {
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-row span:last-child {
  flex: 0 0 auto;
  color: var(--sub-text);
  font-size: 12px;
}

.report-row.ok span:last-child {
  color: var(--success);
}

.report-row.bad span:last-child,
.report-row.notfound span:last-child {
  color: var(--danger);
}

.hint {
  color: var(--sub-text);
  font-size: 12.5px;
  margin: 0 0 10px;
  line-height: 1.5;
}

.panel-card {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}

.panel-h {
  font-family: 'Cinzel', serif;
  color: var(--ink-text);
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 10px;
}

/* ---------- categorized decklist ---------- */

.cat-group {
  margin-bottom: 6px;
  display: flex;
  flex-direction: column-reverse;
}

/* Bottom-up charter: the category stripe sits BELOW the name, closing
   off this category from the next one's cards beneath it. */

.cat-group > .cat-head {
  border-top: none;
}

.cat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 2px;
  cursor: pointer;
  border-bottom: 2px solid var(--line);
  /* The burger jump scrolls a head into view with block:'end' — this margin
     lifts its landing spot clear of the dock + tab + nav stack (same
     clearance the deck panel box uses), so the chosen category settles
     just in sight above the dock instead of hiding behind it. */
  scroll-margin-bottom: calc(var(--nav-h) + 122px + env(safe-area-inset-bottom));
}

.cat-head .t {
  font-family: 'Cinzel', serif;
  font-size: 13.5px;
  color: var(--ink-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex: 1;
}

.cat-head .n {
  font-size: 12px;
  color: var(--sub-text);
  font-family: 'JetBrains Mono', monospace;
}

.cat-price {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-text);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

.deck-price-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  margin-bottom: 10px;
  background: var(--scheme-glow);
  border: 2px solid var(--line);
  border-radius: 8px;
}

.dpb-label {
  font-size: 12px;
  color: var(--sub-text);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.dpb-val {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-text);
}

.dpb-load {
  font-family: 'Inter';
  font-size: 12px;
  font-weight: 400;
  color: var(--sub-text-2);
  font-style: italic;
}

.cat-head .car {
  transition: transform 0.2s;
  color: var(--sub-text);
  font-size: 20px;
  line-height: 1;
  transform: rotate(180deg);
}
/* open: points up */

.cat-head.collapsed .car {
  transform: none;
}
/* closed: points down */

.fold-ico {
  font-size: 20px;
  line-height: 1;
  display: inline-block;
  vertical-align: -2px;
  color: var(--sub-text);
}

.cat-body.collapsed {
  display: none;
}

.visual-grid {
  display: flex;
  flex-wrap: wrap-reverse;
  gap: 7px;
}

.visual-grid > * {
  flex: 0 0 calc(50% - 3.5px);
  min-width: 0;
}

/* Stack view: one column of cards, each peeking out by its name bar above
   the next; the group's first card sits whole at the foot. */

.visual-grid.vg-stack {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0;
  width: 62%;
  max-width: 250px;
}

.visual-grid.vg-stack > * {
  flex: 0 0 auto;
  width: 100%;
  max-width: none;
}

.visual-grid.vg-stack > .vg-card + .vg-card {
  margin-top: -121%;
}

.visual-grid.vg-stack > .vg-card {
  box-shadow: 0 -3px 8px rgba(0, 0, 0, 0.45);
}

/* Text view: quantity, name, mana cost, price -- one line per card. */

.visual-grid.vg-text {
  flex-direction: column-reverse;
  flex-wrap: nowrap;
  gap: 0;
}

.visual-grid.vg-text > * {
  flex: 0 0 auto;
  width: 100%;
  max-width: none;
}

.vg-card.vg-row {
  aspect-ratio: auto;
  overflow: visible;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
}

.vg-row .vg-hit {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  color: var(--ink-text);
  padding: 9px 4px;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  font-family: 'Inter';
}

.vg-row .vr-q {
  flex: 0 0 18px;
  color: var(--sub-text);
  font-variant-numeric: tabular-nums;
}

.vg-row .vr-n {
  flex: 1;
  min-width: 0;
}

.vg-row .vr-cost {
  flex: none;
  display: flex;
  gap: 2px;
  align-items: center;
}

.vg-row .vr-cost .mana-ic {
  flex: none;
  display: block;
}

.vg-row .vr-p {
  flex: 0 0 58px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--ink-text);
}

.vg-card.vg-row.vg-illegal {
  box-shadow: none;
}

.vg-card.vg-row.vg-illegal .vr-n {
  color: var(--danger);
}

.vg-card.vg-row.dl-msel {
  outline-offset: -1px;
  border-radius: 6px;
}

/* Collection */

.col-filter-input {
  flex: 1;
  min-width: 0;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink-text);
  font-size: 14px;
}

.col-cchip {
  background: none;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0.45;
}

.col-cchip.on {
  opacity: 1;
  border-color: var(--scheme-accent);
  background: var(--scheme-glow);
}

.col-select {
  width: 100%;
  background: var(--pop-bg);
  border: 1.5px solid var(--pop-line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink-text);
  font-size: 14.5px;
}

.col-grid {
  display: flex;
  flex-wrap: wrap-reverse;
  gap: 10px;
}

.col-grid > * {
  flex: 0 0 calc(50% - 5px);
  min-width: 0;
}

.col-tile {
  padding: 0;
  position: relative;
}

.illegal-mark {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 2;
  background: #b5484d;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 4px;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

.banned-mark {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 2;
  background: #7a0e14;
  color: #fce6c4;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 4px;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 180, 120, 0.4);
}

.col-tile-info {
  padding: 7px 8px;
  text-align: left;
}

.col-tile-info .l1 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-tile-info .l2 {
  font-size: 11.5px;
  color: var(--sub-text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 2px 0;
}

.col-tile-info .l3 {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--sub-text);
}

/* Wants: the deck names may run onto the second line, up to the price. The
   zero-width float pushes the price down to the second line's right end. */

.col-tile-info .l2.want-in {
  white-space: normal;
  text-overflow: clip;
  line-height: 1.4;
  height: 2.8em;
  overflow: hidden;
  margin: 2px 0 0;
}

.col-tile-info .l2.want-in::before {
  content: '';
  float: right;
  width: 0;
  height: 1.4em;
}

.want-in .wi-eur {
  float: right;
  clear: right;
  margin-left: 6px;
  font-size: 12.5px;
  color: var(--ink-text);
  font-family: 'JetBrains Mono', monospace;
}

.want-in .wi-k {
  color: var(--sub-text);
}

.col-addlist {
  border: 2px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

#colAddSheet .col-addlist {
  display: flex;
  flex-direction: column-reverse;
  margin-bottom: 0;
}

#colAddSheet .cas-bar {
  margin: 0;
  padding: 8px 14px 10px;
  flex: 0 0 auto;
}

.col-addrow {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  background: var(--ink-2);
  border: none;
  border-bottom: 2px solid var(--line);
  padding: 9px 12px;
  color: var(--ink-text);
  font-size: 14.5px;
  cursor: pointer;
}

.col-addrow:last-child {
  border-bottom: none;
}

.col-addrow .hint {
  font-size: 12px;
  margin: 0;
}

#bindersPop {
  position: fixed;
  z-index: 130;
  background: var(--pop-bg);
  border: 1.5px solid var(--pop-line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  min-width: 210px;
  display: flex;
  flex-direction: column;
}

#bindersPop button {
  background: none;
  border: none;
  color: var(--ink-text);
  padding: 11px 14px;
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
  border-bottom: 2px solid var(--line);
  width: 100%;
}

#bindersPop .bp-row {
  display: flex;
  border-bottom: 2px solid var(--line);
}

#bindersPop .bp-row button {
  border-bottom: none;
}

#bindersPop .bp-row .bp-edit {
  width: 44px;
  flex: none;
  color: var(--sub-text);
}

#bindersPop > button:last-child {
  border-bottom: none;
}

.binder-glyphs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  vertical-align: middle;
  margin-right: 3px;
}

.binder-glyphs svg {
  width: 14px;
  height: 14px;
}

.vg-card.dl-msel {
  outline: 2.5px solid var(--scheme-accent);
  outline-offset: -2px;
  border-radius: 10px;
}

.vg-card.dl-msel img {
  filter: brightness(0.72);
}

.vg-card.dl-msel::after {
  content: '\2713';
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 4;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  color: #111;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.ls-tile {
  width: 46%;
  max-width: 230px;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 4px;
  position: relative;
}

.ls-tile img {
  width: 100%;
  border-radius: 9px;
  display: block;
  aspect-ratio: 63/88;
  object-fit: cover;
}
/* 1.13: the height is known before the image loads, so the view opens at the foot */

.ls-why {
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink-text);
  padding: 4px 2px 2px;
}

.ls-ai {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 4px;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}

.ai-sub {
  font-size: 12px;
  color: var(--sub-text);
}

.ls-swap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-text);
  line-height: 1.35;
}

.ls-swap .ai-txt {
  flex: 1;
  min-width: 0;
}

.ls-swap-btn {
  flex: none;
  width: auto;
  font-size: 12.5px;
  padding: 6px 8px;
  white-space: nowrap;
}

.ls-noimg {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
}

.ls-tile .ls-p {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink-text);
  padding: 4px 0 0;
  font-size: 14px;
}

.ls-tile.on {
  border-color: var(--scheme-accent);
}

.ls-tile.on::after {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--brass);
  color: #1c1710;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

#dlPanelBox {
  scroll-margin-bottom: calc(var(--nav-h) + 122px + env(safe-area-inset-bottom));
}

.leg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 14px;
}

.leg-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.leg-name {
  font-size: 13.5px;
  color: var(--sub-text);
}

.leg-chip {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

.leg-chip.ok {
  background: rgba(80, 160, 90, 0.18);
  color: #7fc98b;
}

.leg-chip.no {
  background: rgba(120, 120, 120, 0.14);
  color: var(--sub-text-2);
}

.leg-chip.ban {
  background: rgba(190, 70, 70, 0.18);
  color: var(--danger);
}

.leg-chip.res {
  background: rgba(200, 150, 60, 0.2);
  color: var(--ink-text);
}

.binder-glyph-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
  min-height: 15px;
  margin: -9px 0 2px;
  flex-wrap: wrap;
}

.binder-glyphs .mana-ic {
  width: 14px;
  height: 14px;
}

.rar-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.45);
}

.rar-C {
  background: #6b665c;
}
.rar-U {
  background: #9aa6ae;
}
.rar-R {
  background: #c9a24b;
}
.rar-M {
  background: #d4602a;
}

.ac-prints {
  max-height: 200px;
  overflow-y: auto;
  border: 2px solid var(--line);
  border-radius: 10px;
}

.ac-print {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 2px solid var(--line);
  padding: 9px 12px;
  color: var(--sub-text);
  font-size: 13.5px;
  cursor: pointer;
}

.ac-print.on {
  color: var(--ink-text);
  background: var(--scheme-glow);
  border-left: 3px solid var(--scheme-accent);
}

.ac-print:last-child {
  border-bottom: none;
}

.deck-fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom));
  z-index: 41;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--brass);
  color: #0a1a28;
  font-size: 26px;
  font-weight: 700;
  border: none;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

#fabMenu {
  position: fixed;
  right: 16px;
  bottom: calc(var(--nav-h) + 74px + env(safe-area-inset-bottom));
  z-index: 42;
  background: var(--pop-bg);
  border: 1.5px solid var(--pop-line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

#fabMenu button {
  background: none;
  border: none;
  color: var(--ink-text);
  padding: 12px 18px;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  border-bottom: 2px solid var(--line);
}

#fabMenu button:last-child {
  border-bottom: none;
}

.ghost-btn:active {
  background: var(--hl);
}
/* :active = held down, not selected */

.pd {
  position: relative;
}

.pd-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--pop-bg);
  border: 1.5px solid var(--pop-line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink-text);
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
}

.pd-l {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pd-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 4px);
  top: auto;
  z-index: 8;
  background: var(--pop-bg);
  border: 1.5px solid var(--pop-line);
  border-radius: 10px;
  max-height: 230px;
  overflow-y: auto;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.pd-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 2px solid var(--line);
  padding: 9px 10px;
  color: var(--sub-text);
  font-size: 13.5px;
  cursor: pointer;
}

.pd-opt:last-child {
  border-bottom: none;
}

.pd-opt.sel {
  color: var(--ink-text);
  background: var(--scheme-glow);
}

.t1,
.tb-titles .t1,
.panel-h,
.brand-title {
  font-variant-ligatures: none;
}

.set-chip {
  display: inline-flex;
  align-items: center;
  flex: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--sub-text);
  border: 2px solid var(--line);
  border-radius: 4px;
  padding: 1px 4px;
  vertical-align: -2px;
}

img.set-ico {
  width: auto !important;
  height: 16px !important;
  max-width: 28px !important;
  flex: none;
  vertical-align: -3px;
  border-radius: 0 !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  object-fit: contain;
  display: inline-block;
}

img.set-ico.r-common {
  filter: invert(0.94);
}

img.set-ico.r-uncommon {
  filter: invert(0.62) sepia(0.08) saturate(0.9) hue-rotate(175deg) brightness(1.02);
}

img.set-ico.r-rare {
  filter: invert(0.66) sepia(0.9) saturate(2.6) hue-rotate(8deg) brightness(0.88);
}

img.set-ico.r-mythic {
  filter: invert(0.44) sepia(0.99) saturate(6.5) hue-rotate(338deg) brightness(0.92);
}

img.set-ico.r-special {
  filter: invert(0.6) sepia(0.7) saturate(4) hue-rotate(230deg) brightness(1.1);
}

img.set-ico.r-bonus {
  filter: invert(0.94);
}

html[data-theme='light'] img.set-ico.r-common,
html[data-theme='light'] img.set-ico.r-bonus {
  filter: none;
  opacity: 0.85;
}

.cs-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 330px;
  margin: 0 auto 6px;
}

.cs-actions-grid .ghost-btn {
  width: 100%;
  font-size: 12.5px;
  padding: 6px 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-actions-grid .ghost-btn:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.cs-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cs-actions-grid .ghost-btn {
  width: 100%;
  font-size: 12.5px;
  padding: 6px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-actions-grid > .ghost-btn:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.dl-bridge {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
  align-items: stretch;
}

.dl-bridge-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-content: stretch;
}

.dl-bridge {
  position: relative;
}

/* Bottom-up cover: glued to the bridge's foot, at least the bridge's height,
   growing UPWARD over the decklist as its content (textarea, buttons, the
   resolve report) needs — never boxed to the bridge and cut at the dock.
   Only past the viewport's free height does it scroll, pinned to its foot. */

.dl-cover {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  min-height: 100%;
  max-height: calc(100vh - var(--nav-h) - 250px - env(safe-area-inset-bottom));
  z-index: 6;
  overflow: auto;
  display: flex;
  flex-direction: column;
  background: var(--ink-deep);
  border: 1.5px solid var(--pop-line);
  border-radius: 14px;
}

.dl-popup {
  position: fixed;
  left: 12px;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 120;
  max-height: 82vh;
  overflow: auto;
  background: var(--ink-deep);
  border: 1.5px solid var(--pop-line);
  border-radius: 14px;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.6);
}

.dl-cover .panel-card {
  margin: 0;
  flex: 1 0 auto;
  box-sizing: border-box;
}

.df-compact {
  padding: 12px;
}

.df-compact .panel-h {
  margin: 0 0 8px;
}

.df-compact .adv-row {
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 3px 10px;
  margin-bottom: 8px;
}

.df-compact .adv-row label {
  font-size: 13.5px;
}

.df-compact .col-filter-input {
  padding: 8px 10px;
  font-size: 14.5px;
}

.df-compact .cselect-btn {
  padding: 8px 10px;
  font-size: 14.5px;
}

.df-compact .mana-check svg {
  width: 24px;
  height: 24px;
}

.df-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.df-btn-row button {
  width: 100%;
  padding: 13px 8px;
  font-size: 14px;
}

.df-compact .df-btn-row {
  margin-top: 6px;
}

.df-compact .df-btn-row button {
  padding: 11px 8px;
  font-size: 13.5px;
}

.dl-panel-x {
  flex: none;
  margin-left: auto;
}

/* A ✕ inside a gradient-text heading inherited its transparent fill and
   vanished: it wears the theme's accent, like every icon button's svg. */

.panel-h .icon-btn,
.dl-panel-x {
  -webkit-text-fill-color: currentColor !important;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: var(--ink-text) !important;
  font-size: 17px;
}

html {
  --accent-ink: var(--head-ink);
}
/* the page's own light accent, computed at the root so panels can't re-point it */

/* A panel is a light plate: the page's own plate ink lands black on it.
   Inside a panel the icon button wears the panel's ink, like its text. */

.panel-card .icon-btn,
.panel-h .icon-btn {
  color: var(--ink-text);
  border-color: var(--line);
}

.dl-bridge-btns .ghost-btn {
  width: 100%;
  padding: 7px 2px;
  font-size: 11.5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  line-height: 1.05;
  white-space: nowrap;
}

.dl-bridge-btns .bi svg {
  width: 21px;
  height: 21px;
  display: block;
  color: var(--sub-text);
}

.dl-bridge-btns .ghost-btn.active .bi svg {
  color: var(--ink-text);
}

.ib {
  display: inline-flex;
  vertical-align: -3px;
  margin-right: 7px;
}

.ib svg {
  width: 20px;
  height: 20px;
  color: currentColor;
  opacity: 0.92;
}

.dl-adm-empty {
  aspect-ratio: 63/88;
  border: 2px dashed var(--line);
  border-radius: 4.75% / 3.5%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  color: var(--sub-text-2);
  font-size: 13px;
  cursor: pointer;
}

/* Bottom dock: fixed status bar with cycling info sets */

.deck-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-h) + 44px + env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--ink) 97%, transparent),
    color-mix(in srgb, var(--ink) 92%, transparent)
  );
  backdrop-filter: blur(8px);
  border-top: 2px solid var(--line);
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.35);
}

.dk-arr {
  background: none;
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--ink-text);
  width: 30px;
  height: 34px;
  cursor: pointer;
  flex: none;
  font-size: 14px;
}

/* display:contents lifts the set's items to be the dock's own flex
   children, so the bar's space-between spreads EVERYTHING evenly —
   including the » and ⋯ at the end, per Stef's spec. Font and color
   still inherit through the contents wrapper. */

.dk-mid {
  display: contents;
  font-size: 13.5px;
  color: var(--sub-text);
  white-space: nowrap;
}

.dk-count {
  background: none;
  border: none;
  color: var(--ink-text);
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  cursor: pointer;
  padding: 0;
}

.dk-count.bad {
  color: var(--danger);
}

.dk-type {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--ink-text);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  padding: 2px 2px;
  cursor: pointer;
}

.dk-tool {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 2px solid var(--line);
  color: var(--ink-text);
  width: 33px;
  height: 33px;
  border-radius: 9px;
  flex: 0 0 auto;
  cursor: pointer;
  padding: 0;
}

.dk-tool svg {
  width: 20px;
  height: 20px;
}

.dk-tool.active {
  color: var(--ink-text);
  border-color: var(--scheme-accent);
  background: var(--scheme-glow);
}

.dk-mid:has(.dk-tool) {
  gap: 5px;
}

.dl-bridge-desc {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100%;
}

.dl-mini-add {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  flex: none;
  font-size: 17px;
  padding: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-left: 6px;
}

.dl-winrate {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 12px 46px 0 0;
  border-top: 2px solid var(--line);
  margin-top: auto;
  font-size: 14px;
  color: var(--ink-text);
}

.dl-winrate b {
  color: var(--ink-text);
}

.dl-bridge-adm {
  display: flex;
  flex-direction: column;
}

.dl-leader-cat {
  font-family: 'Cinzel', serif;
  color: var(--ink-text);
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 6px 2px 2px;
  margin-top: auto;
}

.dl-desc-text {
  cursor: pointer;
}

.dl-bracket {
  font-size: 12.5px;
  color: var(--ink-text);
  letter-spacing: 0.04em;
  margin: 0 0 6px;
}

.bkt-mini {
  color: var(--ink-text);
  font-weight: 600;
  font-size: 15px;
}

/* Deck totals use a compact raised pill with a chart mark in the page cap. */

.cap-note.cap-tap {
  height: 24px;
  box-sizing: border-box;
  line-height: 1;
  padding: 0 10px !important;
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  border: 2px solid var(--scheme-accent);
  border-radius: 999px;
  background: var(--panel);
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.45),
    0 3px 8px rgba(0, 0, 0, 0.3);
  font-weight: 700;
  color: var(--ink-text) !important;
  font-size: 12px !important;
  cursor: pointer;
}

.cap-note.cap-tap {
  padding-left: 8px !important;
}

.cap-note.cap-tap::before {
  content: '';
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12l4-4 3 3 5-6'/%3E%3Cpath d='M10 5h4v4'/%3E%3C/svg%3E")
    center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12l4-4 3 3 5-6'/%3E%3Cpath d='M10 5h4v4'/%3E%3C/svg%3E")
    center/contain no-repeat;
}

.cap-note.cap-tap:active {
  transform: translateY(calc(-50% + 2px)) !important;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0.45);
}

html.desk .page-cap .cap-note.cap-tap {
  font-size: 13px !important;
  height: 26px;
}

.page-cap .cap-note.cap-tap,
.page-cap .cap-note.cap-tap * {
  -webkit-text-fill-color: currentColor !important;
  background-clip: border-box !important;
  -webkit-background-clip: border-box !important;
  text-shadow: none !important;
}

.page-cap .cap-note.cap-tap {
  background: var(--panel) !important;
  color: var(--ink-text) !important;
}

/* Card sheet: the name bar stays on top of everything that slides, so a
   card gliding in can never show above the page name. */

#cardSheetOverlay > .overlay-inner > .topbar {
  z-index: 140;
}

/* Half-width pair in the action grid: Tags (or Share) with the ∞ combos. */

.cs-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 0;
}

.cs-pair > .ghost-btn {
  min-width: 0;
  width: 100%;
}

/* 1.38: Share · Tags · ∞ as three equal icon buttons */

.cs-pair.cs-trio {
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.cs-pair.cs-trio > .ghost-btn {
  grid-column: auto !important;
  padding: 6px 0 !important;
}

.cs-pair.cs-trio .ib {
  margin-right: 0;
}

.topbar .sheet-title {
  max-width: calc(100% - 200px);
  font-size: clamp(14px, 4.6vw, 21px);
  line-height: 1.14;
}

.dl-desc-text {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-text);
  overflow-wrap: anywhere;
}

.dk-type svg {
  width: 14px;
  height: 14px;
  opacity: 0.8;
  flex: none;
}

/* The type counts are a strip of their own between ⋯ and the chevron: it
   takes the room that is left, spreads the counts across it, and when they
   still do not fit (8 types, a narrow phone, a bigger system font) it
   scrolls sideways -- the chevron never leaves the screen again. */

.dk-mid:has(.dk-type) {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.dk-mid:has(.dk-type)::-webkit-scrollbar {
  display: none;
}

.dk-mid > .dk-type {
  flex: 0 0 auto;
  padding: 2px 1px;
}

.dk-mid > .dk-type svg {
  width: 1.08em;
  height: 1.08em;
}

.deck-dock .menu-pop {
  position: absolute;
  bottom: 56px;
  left: 8px;
  right: auto;
  top: auto;
}

main.has-dock {
  padding-bottom: 84px;
}

.admiral-tile {
  max-width: 118px;
}

.vg-card {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 4.75% / 3.5%;
  border: 2px solid var(--line);
  background: #111113;
  aspect-ratio: 63/88;
}

.vg-card.vg-illegal {
  border-color: var(--danger);
  box-shadow:
    0 0 0 1.5px var(--danger),
    0 0 10px rgba(200, 60, 60, 0.55);
}

.vg-qty {
  position: absolute;
  top: 10px;
  right: 8px;
  background: rgba(10, 10, 12, 0.85);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  padding: 3px 8px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  z-index: 2;
  pointer-events: none;
}

/* The scans carry Magic's printed border (~4% per side); zoom-crop it away so
   the art and frame fill the tile — the gold rim lives on the tile itself. */

.vg-card img {
  width: 108.5%;
  max-width: none;
  margin: -4.25% 0 0 -4.25%;
  display: block;
  border: none;
  border-radius: 0;
}

/* Offline, a card picture the phone has never fetched simply is not there.
   In its place the app draws the card itself from what it DOES have: name,
   type, colour, stats -- a skeleton in the card's own colour (gold when it
   is multicolour), in exactly the spot the picture would occupy. The moment
   the line is back the real picture takes over again.
   Pseudo-elements only render on a FAILED image, which is precisely when
   this is wanted, and the ::after covers whatever the browser drew. */

img.art-pending {
  background: var(--sk) center/cover no-repeat;
}

/* Before a picture arrives (or fails, offline) it already has a card's shape:
   an image without size collapsed to nothing for a frame, then jumped to
   full height -- the flash when opening a card offline. */

#ciImg,
#dcImg,
#cotdImg,
#ciSheetImg,
.pp-imghold img,
main.card-detail img {
  aspect-ratio: auto 488/680;
}

img.art-missing {
  position: relative;
  color: transparent;
  font-size: 0;
  aspect-ratio: 488/680;
  background: transparent;
}

img.art-missing::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--sk) center/cover no-repeat;
}

.vg-card img.art-missing,
.sc-tile img.art-missing,
.sr-tile img.art-missing {
  width: 100%;
  margin: 0;
}

/* A broken picture has no width of its own. Everywhere the card is shown
   BIG -- the card sheet, the deck sheet, the card of the day, the printing
   picker -- the frame has to fill its holder instead of collapsing to a
   sliver between the chevrons. */

#ciImg.art-missing,
#dcImg.art-missing,
#cotdImg.art-missing,
#ciSheetImg.art-missing,
.pp-imghold img.art-missing,
.glog-cimg img.art-missing,
main.card-detail img.art-missing {
  width: 100%;
  min-width: 120px;
  display: block;
}

.art-missing-holder {
  display: block !important;
  width: 100% !important;
}

.empty-note {
  color: var(--sub-text);
  font-size: 14px;
  text-align: center;
  padding: 12px 10px;
}

.status {
  text-align: center;
  color: var(--sub-text);
  font-size: 14px;
  padding: 16px;
}

#searchResultsBox > .status:only-child {
  position: fixed;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: 80vw;
  padding: 0;
  z-index: 5;
}

/* 1.2: Inspiration -- the results box fills the free space between the cap
   and the menus while it loads, and the ring sits in its middle: never on the
   menus, whatever the screen height or the number of menus. */

.app > main > :is(#browseResults, #bsNameResults):has(> .status:only-child) {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

:is(#browseResults, #bsNameResults) > .status:only-child {
  padding: 16px 0;
}

/* Set symbols in the set pickers. Scryfall ships them as black SVGs; masking
   instead of filtering means the glyph takes the INK of the label beside it,
   so it is monochrome by construction and never introduces an eighth colour. */

.set-ico {
  display: inline-block;
  width: 15px;
  height: 15px;
  flex: none;
  vertical-align: -2px;
  margin-right: 5px;
  background-color: currentColor;
  opacity: 0.92;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--line);
  border-top-color: var(--scheme-accent);
  border-bottom-color: var(--scheme-accent);
  border-radius: 50%;
  animation: sp 0.7s cubic-bezier(0.45, 0.15, 0.55, 0.85) infinite;
  margin: 0 auto 10px;
}

.status-flavor {
  font-size: 14.5px;
  color: var(--ink-text);
  font-style: italic;
  margin-top: 6px;
  animation: flavorIn 0.45s ease;
}

@keyframes flavorIn {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sp {
  to {
    transform: rotate(360deg);
  }
}

.error-note {
  color: var(--danger);
  font-size: 13.5px;
  text-align: center;
  padding: 16px;
  border: 1px solid var(--danger);
  border-radius: 8px;
  background: rgba(165, 58, 63, 0.08);
}

/* Source: styles/pages/search.css */
/* ---------- search page ---------- */

.searchbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.searchbar input {
  flex: 1;
  min-width: 0;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  border-radius: 8px;
  padding: 0 12px;
  height: 44px;
  box-sizing: border-box;
  color: var(--ink-text);
  font-size: 15px;
}

.searchbar input:focus {
  outline: none;
  border-color: var(--scheme-accent);
}

/* The Search page's box auto-focuses on arrival (the keyboard pops), so a
   brass focus ring would be its RESTING look — keep its edge the quiet
   field blue, matching the Collection bar. */

#searchName:focus {
  border-color: var(--field-line);
}

/* Appoint-a-leader popup: a live search that stays on the deck page */

#appointOverlay,
#colImportOverlay,
#cutWhyOverlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 9vh 16px 16px;
}

.appoint-sheet {
  width: 100%;
  max-width: 440px;
  background: var(--pop-bg);
  border: 1.5px solid var(--pop-line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.appoint-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: 'Cinzel', serif;
  font-size: 15.5px;
  color: var(--ink-text);
  margin-bottom: 10px;
}

.appoint-results {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.appoint-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  border-radius: 10px;
  padding: 7px 9px;
  margin-bottom: 7px;
  cursor: pointer;
  text-align: left;
  color: var(--ink-text);
  font-family: 'Inter';
}

.appoint-row img {
  width: 38px;
  height: 53px;
  border-radius: 4px;
  object-fit: cover;
  object-position: center 18%;
  flex: none;
  background: rgba(0, 0, 0, 0.35);
}

.appoint-row-txt {
  flex: 1;
  min-width: 0;
}

.leader-wrap {
  position: relative;
}

.pair-add {
  position: absolute;
  right: 6px;
  bottom: 8px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--brass);
  color: #111;
  border: 2px solid rgba(0, 0, 0, 0.4);
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 3px;
}

.pair-add:active {
  transform: scale(0.94);
}

.leader-stack {
  position: relative;
}

.leader-overlap {
  margin-top: -92%;
  position: relative;
  z-index: 2;
  transform: translateX(4%);
  filter: drop-shadow(-5px -7px 14px rgba(0, 0, 0, 0.6));
}

.pair-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 10px;
  margin: 4px 0 14px;
}

.pair-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  background: var(--ink-2);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 9px;
}

.pair-imgs {
  position: relative;
  width: 100%;
  aspect-ratio: 100/142;
}

.pair-imgs img {
  position: absolute;
  width: 88%;
  border-radius: 6px;
  display: block;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
}

.pair-imgs img:first-child {
  left: 0;
  bottom: 0;
  z-index: 2;
}

.pair-imgs img:last-child {
  right: 0;
  top: 0;
  z-index: 1;
}

.pair-use {
  width: 100%;
  font-size: 12px;
  padding: 6px 4px;
}

.pair-btns {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding: 7px 0 10px;
}

.pair-btns .add-btn {
  flex: 1;
  height: 34px;
  border-radius: 8px;
  background: var(--panel);
  border: 2px solid var(--line);
  color: var(--ink-text);
  font-size: 16px;
  cursor: pointer;
}

.cap-sel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 16px;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  vertical-align: middle;
}

.cap-sel > * {
  flex: none;
}

.cap-sel b {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 0 1 auto;
}

.cap-sel .cs-dot {
  opacity: 0.7;
}

.install-pill {
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: 10px auto 0;
  display: flex;
  gap: 8px;
  align-items: center;
}

.install-pill .ip-go {
  flex: 1;
  height: 40px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--ink-text);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
}

.install-pill .ip-x {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: none;
  color: var(--sub-text);
  font-size: 15px;
  cursor: pointer;
}

.home-news {
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: 10px auto 0;
  height: 44vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--ink-2);
  padding: 2px 12px;
  text-align: left;
}

.home-news > .l2 {
  margin: auto;
  text-align: center;
  padding: 12px;
}

.home-news .news-item:first-child {
  border-bottom: none;
}

.news-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.news-item .nw-img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 8px;
  flex: none;
  background: #0006;
  border: 1px solid var(--line);
}

.news-item .nw-body {
  min-width: 0;
  flex: 1;
}

.nw-fmt {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 7px;
  border-radius: 5px;
  border: 1px solid color-mix(in srgb, var(--panel) 62%, #000);
  background: var(--panel);
  color: var(--ink-text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  vertical-align: 1px;
  text-shadow: none;
  -webkit-text-fill-color: currentColor;
}

.nw-sheet .nw-hero {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  display: block;
}

.nw-sheet .nw-x {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-text);
  margin: 0 0 12px;
}

.nw-sheet .nw-read {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
}

.news-item:last-child {
  border-bottom: none;
}

.news-item .nw-t {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-text);
  line-height: 1.35;
}

.news-item .nw-m {
  display: block;
  font-size: 12px;
  color: var(--sub-text);
  margin-top: 2px;
}

.ar-name {
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ar-type {
  font-size: 12px;
  color: var(--sub-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.ar-set {
  font-size: 12px;
  color: var(--ink-text);
  font-weight: 700;
  flex: none;
  white-space: nowrap;
}

.searchbar button {
  background: var(--acc-fill);
  color: var(--on-acc);
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.sp-jump {
  display: flex;
  flex-wrap: wrap-reverse;
  gap: 8px;
  margin: 2px 0 8px;
}

/* Spoilers page only: bigger card art with the tiles touching, reclaiming the
   gutters so each image is as large as possible (see mythicspoiler-style grid). */

#spMainPage .sc-grid {
  gap: 2px;
}

.sc-grid > * {
  flex: 0 0 calc((100% - 16px) / 3);
  min-width: 0;
}

#spMainPage .sc-grid > * {
  flex-basis: calc((100% - 2px) / 2);
}

.sp-jump-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 56px;
  height: 56px;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  border-radius: 10px;
  cursor: pointer;
  padding: 6px 4px;
}

.sp-jump-btn:active {
  background: var(--hl);
}

.sp-jump-btn.active {
  border-color: var(--scheme-accent);
  background: var(--hl);
}

.sp-jump-btn .set-ico {
  height: 20px !important;
  max-width: 30px !important;
}

.sp-jump-code {
  font-size: 9.5px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--sub-text);
  letter-spacing: 0.4px;
}

.adv-toggle {
  background: var(--field);
  border: 1.5px solid var(--field-line);
  color: var(--sub-text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 10px;
  width: 100%;
  text-align: left;
}

.adv-toggle {
  display: none;
}

.in-chev {
  flex: none;
  width: 30px;
  margin-left: -38px;
  z-index: 2;
  background: none;
  border: none;
  color: var(--sub-text);
  font-size: 20px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.adv-toggle .car {
  float: right;
  transition: transform 0.2s;
}

.adv-toggle.open .car {
  transform: rotate(180deg);
}

.adv-panel {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}

.adv-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  margin-bottom: 6px;
}

.adv-panel select,
.adv-panel input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.adv-panel select {
  text-overflow: ellipsis;
}

.adv-row:last-child {
  margin-bottom: 0;
}

.adv-row.stacked {
  display: block;
}

.adv-row > label,
.adv-row > .collection-field-label {
  font-size: 12.5px;
  color: var(--ink-text);
  font-weight: 500;
  margin: 0;
}

.adv-row .adv-hint {
  grid-column: 2;
  font-size: 11px;
  color: var(--sub-text-2);
  margin: 0;
  line-height: 1.4;
}

.adv-row .adv-sub {
  grid-column: 2;
}

.color-check-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.rarity-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.rcheck {
  position: relative;
}

.rcheck input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
  margin: 0;
}

.rpill {
  display: inline-block;
  padding: 6px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid var(--line);
  background: var(--ink-3);
  opacity: 0.45;
  transition:
    opacity 0.15s,
    transform 0.15s;
}

.rcheck input:checked + .rpill {
  opacity: 1;
  transform: scale(1.04);
}

.rpill.r-common {
  color: #c7c2ba;
}

.rpill.r-uncommon {
  color: #8fbd8f;
}

.rpill.r-rare {
  color: #d9b24c;
}

.rpill.r-mythic {
  color: #d9702e;
}

.rcheck input:checked + .rpill.r-common {
  box-shadow: 0 0 0 1px #c7c2ba;
}

.rcheck input:checked + .rpill.r-uncommon {
  box-shadow: 0 0 0 1px #8fbd8f;
}

.rcheck input:checked + .rpill.r-rare {
  box-shadow: 0 0 0 1px #d9b24c;
}

.rcheck input:checked + .rpill.r-mythic {
  box-shadow: 0 0 0 1px #d9702e;
}

.ccheck {
  position: relative;
}

.ccheck input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
  margin: 0;
}

.ccheck .pip {
  width: 26px;
  height: 26px;
  font-size: 12px;
  opacity: 0.35;
  transition:
    opacity 0.15s,
    transform 0.15s;
}

.ccheck input:checked + .pip {
  opacity: 1;
  transform: scale(1.08);
  box-shadow: 0 0 0 2px var(--scheme-accent);
}

.seg {
  display: flex;
  border: 2px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.seg button {
  flex: 1;
  background: var(--ink-3);
  border: none;
  color: var(--sub-text);
  padding: 8px 4px;
  font-size: 12px;
  cursor: pointer;
}

.seg button.active {
  background: var(--acc-fill);
  color: var(--on-acc);
  font-weight: 700;
}

.cmc-row {
  display: flex;
  gap: 8px;
}

.cmc-row select,
.cmc-row input,
.adv-row input[type='text'],
.adv-row select {
  background: var(--field);
  border: 1.5px solid var(--field-line);
  border-radius: 8px;
  color: var(--ink-text);
  padding: 8px 10px;
  font-size: 14px;
}

.cmc-row select {
  flex: 0 0 70px;
}

.cmc-row input {
  flex: 1;
  min-width: 0;
}

.adv-row input[type='text'] {
  width: 100%;
}

.sr-row {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 8px 9px;
  background: var(--ink-2);
  border-bottom: 2px solid var(--line);
}

/* 2-column card-tile results (search / browse / inspiration), decklist-style */

.sr-grid {
  display: flex;
  flex-wrap: wrap-reverse;
  gap: 12px;
  margin-top: 12px;
}

.sr-grid > * {
  flex: 0 0 calc(50% - 6px);
  min-width: 0;
}

.sr-grid > .status {
  flex: 1 1 100%;
}

@media (min-width: 560px) {
  .sr-grid > * {
    flex: 1 0 170px;
    max-width: 230px;
  }
}

.sc-hero {
  text-align: center;
  margin: 4px 0 10px;
}

.sc-hero img {
  width: min(64%, 240px);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  aspect-ratio: 63/88;
  background: #0006;
}

.sc-hero-nm {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 17px;
  margin-top: 10px;
  color: var(--ink-text);
}

.sc-byline2 {
  text-align: center;
  font-size: 16px;
  color: var(--ink-text);
  margin: 2px 0 10px;
}

.sc-byline2 strong {
  color: var(--ink-text);
  font-weight: 700;
}

.sc-adm-price {
  text-align: center;
  color: var(--ink-text);
  font-weight: 700;
  font-size: 14.5px;
  margin-top: 8px;
}

.sc-primer {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.sc-grid {
  display: flex;
  flex-wrap: wrap-reverse;
  gap: 8px;
}

.sc-tile {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: center;
  font-family: 'Inter';
}

.sc-tile img {
  width: 100%;
  border-radius: 4.75% / 3.5%;
  aspect-ratio: 63/88;
  background: rgba(0, 0, 0, 0.35);
  display: block;
}

.sc-tile .nm {
  display: block;
  font-size: 11.5px;
  color: var(--sub-text);
  margin-top: 3px;
  line-height: 1.25;
}

.sc-list {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 4px 12px;
}

.sc-row {
  padding: 7px 0;
  border-bottom: 2px solid var(--line);
  font-size: 14px;
}

.sc-row:last-child {
  border-bottom: none;
}

.sr-tile {
  background: var(--ink-2);
  border: 2px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sr-tile img {
  width: 100%;
  display: block;
  background: #0006;
  cursor: pointer;
  aspect-ratio: 63/88;
  object-fit: cover;
  border-radius: 4.75% / 3.5%;
}

.sr-tile .st-body {
  padding: 8px 9px 4px;
}

.sr-tile .st-nm {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sr-tile .st-tl {
  font-size: 11px;
  color: var(--sub-text);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-pd-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.pair-cell .pair-prices {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 4px;
  overflow: hidden;
}

.pair-cell .pair-prices .st-price {
  margin-top: 0;
  flex: 0 1 auto;
  white-space: nowrap;
}

.pair-cell .pp-plus {
  font-size: 11px;
  color: var(--sub-text);
  flex: none;
}

.pair-cell .st-meta-row .pair-btns {
  margin-top: 0;
  padding: 0;
  flex: none;
  display: flex;
  gap: 6px;
}

.pair-cell .st-meta-row .pair-btns .add-btn {
  flex: none;
  width: auto;
  min-width: 36px;
  padding: 0 9px;
  height: 30px;
  border-radius: 9px;
}

.pair-cell .st-decks {
  margin-left: 0;
}

.reco-pair-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0 0 6px;
}

.reco-admiral .reco-pair-grid img {
  width: 100%;
  border-radius: 4.75% / 3.5%;
  display: block;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
}

.st-decks {
  font-size: 11.5px;
  color: var(--ink-text);
  font-family: 'JetBrains Mono', monospace;
  margin-left: auto;
  white-space: nowrap;
}

.sr-tile .st-meta {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.sr-tile .st-price,
.pair-cell .st-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--ink-text);
  margin-top: 4px;
  min-height: 13px;
}

.sr-tile .st-price.st-price-lg {
  font-size: 15px;
  margin-top: 0;
}

.add-btn.add-btn-slim {
  width: auto;
  min-width: 36px;
  padding: 0 9px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  font-size: 16px;
}

/* 1.21: the pairings button: a round chip on the picture's right edge, the
   double-faced flip's sibling (that one sits higher, at 28%) */

.pair-pop-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 63/88;
  pointer-events: none;
  z-index: 4;
}

.pair-pop-btn {
  position: absolute;
  right: 6%;
  top: 50%;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--scheme-accent);
  background: var(--acc-fill);
  color: var(--on-acc);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

/* 1.5: the + on a result tile was a thin glyph in the accent's dim shade --
   lost on the cream and red schemes. It takes the tile's own text colour now,
   bold and bigger, on a faint plate of that colour. */

:is(.sr-tile, .pair-cell) .st-meta-row .add-btn {
  color: var(--ink-text);
  font-weight: 800;
  font-size: 22px;
  line-height: 1;
  background: color-mix(in srgb, var(--ink-text) 12%, transparent);
  border-color: color-mix(in srgb, var(--ink-text) 45%, transparent);
}

:is(.sr-tile, .pair-cell) .st-meta-row .add-btn svg {
  color: var(--ink-text);
}

/* on the light (white-main) pages: near-black ink on a lighter plate */

html[data-main='W'] :is(.sr-tile, .pair-cell) .st-meta-row .add-btn {
  color: #111;
  background: color-mix(in srgb, #ffffff 24%, transparent);
  border-color: color-mix(in srgb, #241a04 45%, transparent);
}

html[data-main='W'] :is(.sr-tile, .pair-cell) .st-meta-row .add-btn svg {
  color: #111;
}

/* ...and the IN DECK pill there: the accent's own ink vanished on the tile
   (black on black in Dimir) -- it reads in the tile's text colour */

:is(.sr-tile, .pair-cell) .tag.dupe {
  color: var(--ink-text);
  border-color: color-mix(in srgb, var(--ink-text) 45%, transparent);
}

.tile-info {
  border-radius: 10px;
}

.sr-tile.selectable {
  cursor: pointer;
}

.sr-tile.selected {
  border-color: var(--scheme-accent);
  box-shadow: 0 0 0 2px var(--scheme-accent);
}
/* Selection follows the scheme; the tick keeps its gold action color. */

/* 1.8: the pick button and the section jump share the corner -- the jump steps up */

:is(#cardRecoOverlay, #similarOverlay):has(.ov-pick-fab:not([hidden])) .edh-jump-row.insp-jump {
  bottom: calc(86px + var(--nav-h) + env(safe-area-inset-bottom));
}

.sr-tile .sel-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  color: #111;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  pointer-events: none;
}

.sc-hero {
  text-align: center;
  margin: 4px 0 10px;
}

.sc-hero img {
  width: min(64%, 240px);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  aspect-ratio: 63/88;
  background: #0006;
}

.sc-hero-nm {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 17px;
  margin-top: 10px;
  color: var(--ink-text);
}

.sc-byline2 {
  text-align: center;
  font-size: 16px;
  color: var(--ink-text);
  margin: 2px 0 10px;
}

.sc-byline2 strong {
  color: var(--ink-text);
  font-weight: 700;
}

.sc-adm-price {
  text-align: center;
  color: var(--ink-text);
  font-weight: 700;
  font-size: 14.5px;
  margin-top: 8px;
}

.sc-primer {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.sc-grid {
  display: flex;
  flex-wrap: wrap-reverse;
  gap: 8px;
}

.sc-tile {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: center;
  font-family: 'Inter';
}

.sc-tile img {
  width: 100%;
  border-radius: 4.75% / 3.5%;
  aspect-ratio: 63/88;
  background: rgba(0, 0, 0, 0.35);
  display: block;
}

.sc-tile .nm {
  display: block;
  font-size: 11.5px;
  color: var(--sub-text);
  margin-top: 3px;
  line-height: 1.25;
}

.sc-list {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 4px 12px;
}

.sc-row {
  padding: 7px 0;
  border-bottom: 2px solid var(--line);
  font-size: 14px;
}

.sc-row:last-child {
  border-bottom: none;
}

.sr-tile {
  position: relative;
}

.sr-tile.selected .sel-check {
  display: flex;
}

/* 1.19: the Spoilers page selects too */

.sc-tile {
  position: relative;
}

.sc-tile .sel-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  color: #111;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.sc-tile.selected .sel-check {
  display: flex;
}

.sc-tile.selected img {
  box-shadow: 0 0 0 3px var(--scheme-accent);
}

#spPickFab {
  bottom: calc(var(--nav-h) + 72px + env(safe-area-inset-bottom));
}

.reco-admiral {
  text-align: center;
  margin: 4px 0 14px;
}

.reco-admiral img {
  width: min(62%, 240px);
  border-radius: 4.75% / 3.5%;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.reco-admiral .ra-nm {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 600;
  margin-top: 8px;
}

.reco-admiral .ra-sub {
  font-size: 12px;
  color: var(--sub-text);
  margin-top: 2px;
}

.reco-create {
  background: var(--acc-fill);
  color: var(--on-acc);
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}

.reco-create:disabled {
  opacity: 0.45;
  cursor: default;
}

.sr-tile .st-btns {
  padding-top: 2px;
  display: flex;
  gap: 6px;
  padding: 7px 9px 9px;
  margin-top: auto;
}

.sr-tile .st-btns .add-btn {
  flex: 1;
  height: 34px;
  border-radius: 8px;
  background: var(--panel);
  border: 2px solid var(--line);
  color: var(--ink-text);
  font-size: 16px;
  cursor: pointer;
}

.sr-tile .st-btns .add-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.sr-tile .st-btns .add-btn:not(:disabled):hover {
  border-color: var(--scheme-accent);
  color: var(--ink-text);
}

/* browse page dropdowns */

.mana-ic {
  vertical-align: middle;
  display: inline-block;
}

/* House price range slider: two overlaid thumbs on a brass-filled rail.
   The top end of the scale is open — the last stop reads ∞ and means
   "no upper limit", exactly the bol.com pattern in app dress. */

.pr-slider {
  margin: 4px 0 2px;
}

.pr-vals {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  color: var(--ink-text);
  margin-bottom: 4px;
}

.pr-track {
  position: relative;
  height: 28px;
}

.pr-track input[type='range'] {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
  height: 28px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: none;
  pointer-events: none;
}

.pr-track input[type='range']::-webkit-slider-runnable-track {
  background: none;
  border: none;
  height: 28px;
}

.pr-track input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 21px;
  height: 21px;
  margin-top: 3.5px;
  border-radius: 50%;
  background: var(--brass);
  border: 2px solid rgba(26, 18, 8, 0.9);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.pr-track input[type='range']::-moz-range-track {
  background: none;
  border: none;
}

.pr-track input[type='range']::-moz-range-thumb {
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brass);
  border: 2px solid rgba(26, 18, 8, 0.9);
  cursor: pointer;
}

.hv-add {
  color: var(--success);
}

.hv-rem {
  color: var(--danger);
}

.hv-mov {
  color: var(--ink-text);
}

.llay {
  background: none;
  border: 2px solid var(--field-line);
  border-radius: 12px;
  padding: 5px;
  cursor: pointer;
}

.llay.on {
  border-color: var(--scheme-accent);
  box-shadow: 0 0 0 1px var(--scheme-accent);
}

.llay-grid {
  display: grid;
  gap: 3px;
  width: 62px;
}

.llay-grid i {
  background: #f2ede4;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-style: normal;
}

.llay-grid b {
  font-size: 11px;
  line-height: 1;
  color: #111;
  font-family: 'JetBrains Mono', monospace;
  display: block;
}

.llay-n {
  display: block;
  text-align: center;
  font-size: 11.5px;
  color: var(--sub-text);
  margin-top: 4px;
}

.swipe-pane {
  position: fixed;
  inset: 0;
  z-index: 95;
  overflow: hidden;
  background: var(--ink);
  will-change: transform;
}

.swipe-pane .app {
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.pr-rail {
  position: absolute;
  top: 50%;
  left: 2px;
  right: 2px;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: var(--field);
  border: 1.5px solid var(--field-line);
}

.pr-fill {
  position: absolute;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: var(--brass);
}

.typal-tile {
  cursor: pointer;
}

.st-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.st-meta-row .st-price {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.budget-trio {
  margin: 16px 0 22px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--line);
}

.budget-trio:last-child {
  border-bottom: none;
}

.budget-star {
  text-align: center;
  margin-bottom: 10px;
}

.budget-star img {
  width: min(56%, 200px);
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  aspect-ratio: 63/88;
  background: #0006;
}

.budget-star .bs-nm {
  font-size: 14.5px;
  font-weight: 700;
  margin-top: 8px;
}

.budget-star .bs-pr {
  font-size: 13px;
  color: var(--ink-text);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
}

.budget-star .tag-focus-row {
  margin: 8px auto 0;
}

.budget-subs {
  margin-top: 6px;
}

.tile-info {
  background: none;
  border: 2px solid var(--line);
  border-radius: 6px;
  color: var(--sub-text);
  font-size: 11.5px;
  padding: 3px 8px;
  cursor: pointer;
  flex: 0 0 auto;
  font-family: 'Inter';
}

.tile-info:active {
  border-color: var(--scheme-accent);
  color: var(--ink-text);
}

.typal-label {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink-text);
  padding: 7px 4px 9px;
  letter-spacing: 0.06em;
}

.mana-check {
  display: inline-flex;
  border-radius: 50%;
  opacity: 0.4;
  transition:
    opacity 0.12s,
    box-shadow 0.12s;
}

.ccheck input:checked + .mana-check {
  opacity: 1;
  box-shadow: 0 0 0 2.5px var(--scheme-accent);
}

.ccheck input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mana-preview {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  flex: 0 0 auto;
}

/* custom color-combination dropdown (native <option> can't show icons) */

.cselect {
  position: relative;
  flex: 1;
  min-width: 0;
}

.cselect.cs-op {
  flex: 0 0 96px;
}

.cmc-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.cmc-row input {
  flex: 1;
  min-width: 0;
}

.cselect-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  border-radius: 8px;
  color: var(--ink-text);
  padding: 8px 10px;
  font-size: 14px;
  cursor: pointer;
  font-family: 'Inter';
  text-align: left;
}

.cselect-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.cselect-btn .cs-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Inspiration and recommendations menus: the triangle sits in its own box on
   the right, like the collection's and Search's filter button. */

.browse-selects .cselect-btn,
.reco-themes .cselect-btn {
  position: relative;
  padding-right: 54px;
  min-height: 44px;
}

.browse-selects .cselect-btn .cs-car,
.reco-themes .cselect-btn .cs-car {
  position: absolute;
  top: 3px;
  right: 3px;
  bottom: 3px;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--panel);
  border: 1.5px solid color-mix(in srgb, var(--panel) 50%, #000);
  color: var(--sub-text);
  font-size: 15px;
}

.cselect-btn .cs-car {
  font-size: 11px;
  color: var(--sub-text);
  flex: 0 0 auto;
}

.ph-movers {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.col-tile .col-bnd {
  color: var(--ink-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.name-suggest {
  position: fixed;
  z-index: 10060;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--pop-bg);
  border: 1.5px solid var(--pop-line);
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
}

.name-suggest .ns-opt {
  flex: 0 0 auto;
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-top: 1.5px solid var(--line);
  color: var(--ink-text);
  padding: 11px 14px;
  font-size: 15px;
  font-family: 'Inter';
  cursor: pointer;
}

.name-suggest .ns-opt:first-child {
  border-top: none;
}

.name-suggest .ns-opt:active {
  background: var(--hl);
}

.cselect-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 70;
  background: var(--pop-bg);
  border: 1.5px solid var(--pop-line);
  border-radius: 10px;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.cselect-panel.tall {
  max-height: none;
}

.cselect.cs-up .cselect-panel {
  top: auto;
  bottom: calc(100% + 4px);
}

/* cs-foot: the drop-up's inside is column-reverse — DOM-first sits at the
   FOOT, so the filter box lands beside the button and a reversed scroll
   container anchors its view at the bottom on open (10a). */

.cselect.cs-foot .cselect-panel {
  display: flex;
  flex-direction: column-reverse;
}

.cselect.cs-foot .cselect-panel > * {
  flex: 0 0 auto;
}

:is(
    .cselect.cs-up,
    .browse-selects .cselect,
    #recoOverlay .cselect,
    .overlay .reco-themes .cselect,
    .df-compact .cselect,
    #logGameOverlay .cselect:not(.cs-cardgrid)
  )
  > .cselect-panel:not(.cs-artgrid) {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
}

:is(
    .cselect.cs-up,
    .browse-selects .cselect,
    #recoOverlay .cselect,
    .overlay .reco-themes .cselect,
    .df-compact .cselect,
    #logGameOverlay .cselect:not(.cs-cardgrid)
  )
  > .cselect-panel:not(.cs-artgrid)
  > * {
  flex: 0 0 auto;
}

:is(
    .cselect.cs-up,
    .browse-selects .cselect,
    #recoOverlay .cselect,
    .overlay .reco-themes .cselect,
    .df-compact .cselect,
    #logGameOverlay .cselect:not(.cs-cardgrid)
  )
  > .cselect-panel:not(.cs-artgrid)
  > .cselect-search,
.cselect.cs-foot .cselect-panel > .cselect-search {
  top: auto;
  bottom: 0;
  border-bottom: none;
  border-top: 1.5px solid var(--pop-line);
}

:is(
    .cselect.cs-up,
    .browse-selects .cselect,
    #recoOverlay .cselect,
    .overlay .reco-themes .cselect,
    .df-compact .cselect,
    #logGameOverlay .cselect:not(.cs-cardgrid)
  )
  > .cselect-panel:not(.cs-artgrid)
  > .cselect-opt:last-child {
  border-bottom: 2px solid var(--line);
}

.ci-nav-wrap {
  position: relative;
  display: inline-block;
}

/* Card detail: the card is exactly as wide as the button grid below it. */

.cd-hero {
  max-width: 330px;
  margin-bottom: 10px !important;
}

/* ...and that grid is always a full 330px: centred with auto margins in the
   sheet's flex column it used to shrink to its labels. */

main.card-detail .cs-actions-grid {
  width: 100%;
  box-sizing: border-box;
}

.cd-hero .ci-nav-wrap {
  display: block;
}

.ci-nav-arrow {
  position: absolute;
  top: 63%;
  transform: translateY(-50%);
  width: 44px;
  height: 64px;
  border: none;
  background: none;
  color: var(--ink-text);
  font-size: 38px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.ci-nav-arrow.left {
  left: -42px;
}

.ci-nav-arrow.right {
  right: -42px;
}

.ci-nav-arrow:active {
  opacity: 0.6;
}

::placeholder {
  color: var(--sub-text);
  opacity: 0.85;
}
/* one step darker than before: readable on light panels too */

.cselect-search {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px;
  background: var(--pop-bg);
  border-bottom: 1.5px solid var(--pop-line);
}

.cselect-search .cs-mag {
  flex: 0 0 auto;
  font-size: 14px;
  opacity: 0.7;
}

.cselect-search input {
  flex: 1;
  min-width: 0;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  border-radius: 6px;
  color: var(--ink-text);
  padding: 6px 9px;
  font-size: 14px;
  font-family: 'Inter';
}

.cs-noresults {
  padding: 12px;
  font-size: 14px;
  color: var(--sub-text);
  text-align: center;
}

.cselect-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 2px solid var(--line);
  color: var(--ink-text);
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  font-family: 'Inter';
  text-align: left;
}

.cselect-opt:last-child {
  border-bottom: none;
}

.cselect-opt:hover {
  background: var(--hl);
}

.cselect-opt.opt-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* The app's own replacement for native pickers: field + drop-up menu. */

.nsel-btn {
  justify-content: space-between;
  min-width: 0;
}

.nsel-btn .nsel-lbl {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nsel-btn .nsel-caret {
  flex: none;
  opacity: 0.6;
  font-size: 11px;
}

#nselShield {
  position: fixed;
  inset: 0;
  z-index: 10040;
  background: transparent;
}

#nselPop {
  position: fixed;
  top: auto;
  right: auto;
  z-index: 10050;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  overflow-y: auto;
}

#nselPop .cselect-opt {
  flex: 0 0 auto;
  white-space: normal;
}

#nselPop .cselect-opt:last-child {
  border-bottom: 2px solid var(--line);
}

#nselPop .cselect-opt:first-child {
  border-bottom: none;
}

#nselPop .cselect-opt.on {
  color: var(--ink-text);
  font-weight: 700;
}

.cselect-opt.opt-disabled:hover {
  background: none;
}

.cselect-opt.sel {
  background: var(--scheme-glow);
  color: var(--ink-text);
}

.cselect-opt .co-icons {
  display: flex;
  gap: 3px;
  flex: 0 0 auto;
  min-width: 20px;
}

.browse-selects {
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  margin-bottom: 4px;
}

.bs-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bs-row label {
  font-size: 11px;
  color: var(--sub-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex: 0 0 84px;
}

.bs-row select {
  flex: 1;
  min-width: 0;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  border-radius: 8px;
  color: var(--ink-text);
  padding: 9px 10px;
  font-size: 14px;
}

.bs-row select:disabled {
  opacity: 0.45;
}

.search-results {
  border: 2px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.sr-row:last-child {
  border-bottom: none;
}

.sr-row img {
  width: 34px;
  height: 47px;
  border-radius: 4px;
  object-fit: cover;
  flex: 0 0 auto;
  background: #0006;
  cursor: pointer;
}

.sr-body {
  flex: 1;
  min-width: 0;
}

.sr-body .nm {
  font-size: 13.5px;
  font-weight: 600;
}

.sr-body .tl {
  font-size: 11.5px;
  color: var(--sub-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  display: inline-block;
  margin-top: 2px;
}

.tag.ok {
  background: rgba(92, 139, 110, 0.2);
  color: var(--success);
  border: 1px solid rgba(92, 139, 110, 0.4);
}

.tag.banned {
  background: rgba(181, 72, 77, 0.2);
  color: var(--danger);
  border: 1px solid rgba(181, 72, 77, 0.4);
}

.tag.dupe {
  background: var(--scheme-glow);
  color: var(--ink-text);
  border: 2px solid var(--line);
}

.add-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--scheme-accent);
  background: transparent;
  color: var(--ink-text);
  font-size: 17px;
  cursor: pointer;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.add-btn:disabled {
  opacity: 0.25;
}

/* Source: styles/pages/inspiration-statistics.css */
/* ---------- inspiration page ---------- */

.chip-label {
  font-size: 11px;
  color: var(--sub-text);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 4px 0 6px;
}

.chip-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 6px;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  background: var(--ink-2);
  border: 2px solid var(--line);
  color: var(--sub-text);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.chip.active {
  background: var(--acc-fill);
  color: var(--on-acc);
  border-color: var(--scheme-accent);
  font-weight: 700;
}

.rank-badge {
  font-size: 10px;
  color: var(--ink-text);
  font-family: 'JetBrains Mono', monospace;
}

/* ---------- stats ---------- */

.curve-panel {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  height: 110px;
}

.curve-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.curve-bar {
  width: 70%;
  background: linear-gradient(180deg, var(--brass), var(--brass-dim));
  border-radius: 3px 3px 0 0;
  min-height: 2px;
}

.curve-n {
  font-size: 11px;
  color: var(--ink-text);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 3px;
  height: 12px;
}

.curve-lbl {
  font-size: 10.5px;
  color: var(--sub-text);
  margin-top: 2px;
}

.color-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cb-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cb-row .lbl {
  width: 20px;
}

.cb-row .track {
  flex: 1;
  height: 8px;
  background: var(--ink-2);
  border-radius: 4px;
  overflow: hidden;
}

.cb-row .fill {
  height: 100%;
}

.cb-row .n {
  width: 22px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--sub-text);
}

.type-bars .cb-row .lbl {
  width: 90px;
  font-size: 12.5px;
  color: var(--sub-text);
  flex: 0 0 auto;
  text-align: left;
}

/* ---------- primer / rules ---------- */

.rules-text {
  font-size: 14px;
  color: var(--parchment-dim);
  line-height: 1.7;
}

.rules-text h4 {
  font-family: 'Cinzel', serif;
  color: var(--ink-text);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 16px 0 6px;
}

.rules-text h4:first-child {
  margin-top: 0;
}

.rules-text ul {
  margin: 4px 0;
  padding-left: 18px;
}

.rules-text p {
  margin: 6px 0;
}

/* Bottom-up: the first name (A) sits bottom-left, the list climbs upward;
   each list's heading sits at its foot, nearest the format's name. */

.banlist-grid {
  display: flex;
  flex-wrap: wrap-reverse;
  column-gap: 10px;
  margin-top: 6px;
}

.banlist-grid .ban-item {
  width: calc(50% - 5px);
  box-sizing: border-box;
}

.acc-up [data-banbox] > div:has(> .banlist-grid) {
  display: flex;
  flex-direction: column-reverse;
}

.ban-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--sub-text);
  font-size: 13px;
  padding: 4px 6px;
  margin-bottom: 2px;
  border-radius: 6px;
  cursor: pointer;
  break-inside: avoid;
  font-family: 'Inter';
}

.ban-item:hover {
  background: var(--scheme-glow);
  color: var(--ink-text);
}

.ban-item:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Source: styles/pages/settings-draft.css */
/* ---------- settings ---------- */

.settings-section {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.settings-main {
  background: transparent;
}

/* ---- Draft tools ---- (column-reverse main: first block = foot) */

.dr-row-chev {
  font-size: 22px;
  color: var(--sub-text);
  line-height: 1;
}

.draft-main .panel-card {
  margin-bottom: 12px;
}

.dr-top {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.dr-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 6px;
  font-size: 12px;
  color: var(--sub-text);
}

.dr-steps span.on {
  color: var(--ink-text);
  font-weight: 700;
}

.dr-steps span.done {
  color: var(--ink-text);
}

.dr-steps i {
  font-style: normal;
  opacity: 0.5;
}

.dr-new {
  flex: none;
  align-self: center;
  padding: 7px 16px;
  font-size: 12.5px;
}

.dr-foot {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.dr-foot .primary-btn {
  flex: 1;
  padding: 14px 16px;
  font-size: 15.5px;
}

.dr-foot .ghost-btn {
  flex: 0 0 auto;
  padding: 0 18px;
}

.dr-foot .primary-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.dr-center {
  text-align: center;
}

.dr-big {
  font-family: 'Cinzel', serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink-text);
  margin: 2px 0 4px;
}

.dr-sub {
  color: var(--sub-text);
  font-size: 13.5px;
}

.dr-dir {
  color: var(--ink-text);
  font-size: 18px;
  font-weight: 700;
}

.dr-clock {
  font-family: 'JetBrains Mono', monospace;
  font-size: 68px;
  font-weight: 600;
  color: var(--ink-text);
  line-height: 1.05;
  margin: 6px 0 2px;
  letter-spacing: -1px;
}

.dr-clock.low {
  color: var(--danger);
}

.dr-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
  margin: 6px 0 10px;
}

.dr-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brass);
  transition: width 0.25s linear;
}

.dr-over {
  color: var(--danger);
}

.dr-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.dr-row > .ghost-btn {
  flex: 1;
  padding: 11px 6px;
  font-size: 14px;
}

.dr-set {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.dr-set:first-of-type {
  border-top: none;
}

.dr-set .l1 {
  font-size: 14px;
  font-weight: 600;
}

.dr-set .l2 {
  font-size: 11.5px;
  color: var(--sub-text);
  margin-top: 1px;
}

.dr-seg {
  flex: none;
  min-width: 116px;
}

.dr-seg button {
  padding: 8px 10px;
  font-size: 13px;
}

.dr-step {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.dr-step button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1.5px solid var(--field-line);
  background: var(--field);
  color: var(--ink-text);
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.dr-step span {
  min-width: 54px;
  text-align: center;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
}

.dr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 10px;
}

.dr-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  color: var(--ink-text);
  border-radius: 16px;
  padding: 5px 4px 5px 12px;
  font-size: 14px;
}

.dr-chip button {
  background: none;
  border: none;
  color: var(--sub-text);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
}

.dr-chip.recent {
  padding: 6px 12px;
  cursor: pointer;
  color: var(--sub-text);
  border-style: dashed;
}

.dr-recent-h {
  font-size: 11.5px;
  color: var(--sub-text);
  margin: 2px 0 4px;
}

.dr-add {
  display: flex;
  gap: 8px;
}

.dr-add input {
  flex: 1;
  min-width: 0;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  color: var(--ink-text);
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 15px;
}

.dr-add .primary-btn {
  flex: none;
  width: auto;
  padding: 0 16px;
}

.dr-ring {
  position: relative;
  width: min(300px, 78vw);
  aspect-ratio: 1;
  margin: 8px auto 14px;
}

.dr-ring::before {
  content: '';
  position: absolute;
  inset: 20%;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: color-mix(in srgb, var(--brass) 6%, transparent);
}

.dr-seat {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 84px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.15;
  word-break: break-word;
}

.dr-seat b {
  display: flex;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--acc-fill);
  color: var(--on-acc);
  font-size: 12px;
  margin-bottom: 3px;
}

.dr-ring-mid {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11.5px;
  color: var(--sub-text);
  pointer-events: none;
  line-height: 1.35;
}

.dr-ring-mid .dr-arrow {
  font-size: 34px;
  color: var(--ink-text);
  line-height: 1;
  margin-bottom: 2px;
}

.dr-pairs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14.5px;
}

.dr-pairs i {
  color: var(--sub-text);
  font-style: normal;
  font-size: 12px;
  margin: 0 4px;
}

.dr-mana {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.dr-lands {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  font-size: 14px;
  text-align: center;
}

.dr-lands b {
  color: var(--ink-text);
  font-size: 16px;
}

.dr-match {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.dr-matches .dr-match:first-child {
  border-top: none;
}

.dr-tbl {
  flex: none;
  width: 22px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  color: var(--sub-text);
  font-size: 12px;
}

.dr-vs {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink-text);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.dr-p {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 14.5px;
}

.dr-p > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dr-p > span:last-child {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}

.dr-p.win {
  color: var(--ink-text);
  font-weight: 700;
}

.dr-tap {
  font-size: 11.5px;
  color: var(--sub-text);
}

.dr-life {
  flex: none;
  width: 42px;
  align-self: stretch;
  border-radius: 8px;
  border: 1.5px solid var(--field-line);
  background: var(--field);
  color: var(--danger);
  font-size: 19px;
  cursor: pointer;
  padding: 0;
}

.dr-stand {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dr-stand th,
.dr-stand td {
  padding: 7px 3px;
  text-align: right;
  white-space: nowrap;
}

.dr-stand th:nth-child(2),
.dr-stand td:nth-child(2) {
  text-align: left;
  white-space: normal;
}

.dr-stand th {
  color: var(--sub-text);
  font-weight: 600;
  font-size: 10.5px;
}

.dr-stand tr + tr td {
  border-top: 1px solid var(--line);
}

.dr-stand tr[data-dr] {
  cursor: pointer;
}

.dr-stand tr.dropped td {
  opacity: 0.45;
  text-decoration: line-through;
}

.dr-past {
  font-size: 13.5px;
}

.dr-past > div + div {
  margin-top: 4px;
}

.dr-past b {
  color: var(--ink-text);
  margin: 0 4px;
  font-family: 'JetBrains Mono', monospace;
}

.dr-champ {
  font-family: 'Cinzel', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink-text);
  margin: 4px 0;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  cursor: pointer;
}

/* 1.35: Extras as tiles, three to a row, read from the foot up (wrap-reverse:
   the first tile in the markup sits bottom-left). A tile that unfolds (About,
   Format rules, Ban lists, Color scheme, Notifications, Backup) spans the
   whole row while open; About always does, as the banner on top. */

.app > main.settings-main.xt-tiles {
  flex-direction: row;
  flex-wrap: wrap-reverse;
  align-content: flex-start;
  gap: 12px;
}

/* 1.36: two square tiles to a row; the credits sit loose beside About. */

.xt-tiles > .settings-section {
  flex: 0 0 calc((100% - 12px) / 2);
  min-width: 0;
  margin: 0;
  aspect-ratio: 1 / 1;
  display: flex;
}

/* 1.1: a tile stays square even when the credits cell beside it is taller
   (credits + What's new + feedback); it no longer stretches to that row */

.xt-tiles > .settings-section:not(.xt-note) {
  align-self: center;
}

.xt-tiles > .settings-section > .settings-row.xt-tile {
  flex: 1 1 auto;
  min-width: 0;
}

/* 1.41: the credits cell -- no tile, just the text and a small What's new button */

.xt-tiles > .settings-section.xt-note {
  aspect-ratio: auto;
  align-self: center;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: none;
  background-image: none;
  border: none;
  box-shadow: none;
  overflow: visible;
}

.xt-note > #appFootNote {
  margin: 0;
  padding: 0 4px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.xt-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--scheme-accent);
  background: transparent;
  color: var(--ink-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* the changelog lists (start-up note and the Extras sheet) */

.cl-scroll {
  max-height: min(58vh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: left;
  margin: 8px 0 4px;
}

.cl-entry + .cl-entry {
  border-top: 1.5px solid var(--line);
  margin-top: 8px;
  padding-top: 8px;
}

.cl-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  color: var(--head-ink);
  font-size: 14.5px;
}

button.cl-head {
  background: none;
  border: none;
  padding: 10px 2px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.cl-head .cl-date {
  font-size: 12px;
  color: var(--sub-text);
}

.cl-head .fold-ico {
  margin-left: auto;
}

.cl-notes {
  margin: 4px 0 2px;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-text);
}

.cl-notes[hidden] {
  display: none;
}

.settings-changelog .cl-head {
  align-items: center;
  min-height: 44px;
  color: var(--main-text);
}

.settings-changelog .cl-entry + .cl-entry {
  border-top-width: 1px;
}

.settings-changelog .cl-head[aria-expanded='true'] .fold-ico {
  transform: rotate(180deg);
}

.cl-apk .cl-head {
  gap: 6px;
}

/* 1.41: an odd tile above the credits row (Install alone, in a browser) gets
   an empty half-width partner, so the credits never slide in beside it --
   zero height, explicit margins, no gap of its own */

.xt-tiles > .xt-spacer {
  flex: 0 0 calc((100% - 12px) / 2);
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.xt-tiles .settings-row.xt-tile {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 16px 8px;
  min-height: 0;
}

.settings-row.xt-tile .l1 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  hyphens: manual;
  overflow-wrap: normal;
}

.xt-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: auto;
  min-width: 38px;
  height: 38px;
  color: var(--ink-text);
}

.xt-ico svg {
  width: 38px;
  height: 38px;
}

/* A tile's fold floats over the tiles (placed by xtSync next to its tile,
   on the side with the most room); a dimmed scrim behind it closes it. */

.xt-tiles .xt-body:not([hidden]) {
  position: fixed;
  z-index: 1201;
  margin: 0;
  padding: 0 12px 10px !important;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--panel);
  border: 2px solid var(--scheme-accent);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  box-sizing: border-box;
}

/* 1.37: the sheet carries its tile's name on top (stays put while it scrolls);
   in a column-reverse fold the last flex item is the top, in the colour grid
   the first */

.xt-tiles .xt-body:not([hidden])::before {
  content: attr(data-xt-title);
  display: block;
  order: 99;
  grid-column: 1 / -1;
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 -12px 6px;
  padding: 12px 14px 9px;
  background: var(--panel);
  border-bottom: 1.5px solid var(--line);
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--head-ink);
}

.xt-tiles .guild-list.xt-body:not([hidden])::before {
  order: -1;
}

.xt-tiles .guild-list.xt-body:not([hidden]) {
  align-content: start;
}

.xt-tiles > .xt-scrim {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.45);
  touch-action: none;
}

.xt-tile .seg-inline button {
  padding: 5px 9px;
  font-size: 12.5px;
}

.xt-tiles .xt-tile .seg-inline {
  margin-left: auto;
  margin-right: auto;
  align-self: center;
}

.xt-tile #apkNote:empty {
  display: none;
}

.settings-row .l1 {
  font-size: 14.5px;
  font-weight: 600;
}

.settings-row .l2 {
  font-size: 12px;
  color: var(--sub-text);
  margin-top: 2px;
}

/* New! -- flat gold, dark ink (kleurenwet: gold is the seventh colour). */

.new-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px 2px;
  border-radius: 999px;
  background: var(--gold);
  color: #111;
  -webkit-text-fill-color: #111;
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  line-height: 1.4;
  vertical-align: 2px;
  text-transform: none;
}

.folder-tile .folder-new {
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0;
  z-index: 2;
}

.about-txt {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-text);
  padding: 0 2px 12px;
}

.about-txt p {
  margin: 0 0 6px;
}

.about-txt ul {
  margin: 0 0 12px;
  padding-left: 18px;
}

.about-txt li {
  margin: 5px 0;
}

.about-txt .about-h {
  font-family: 'Cinzel', serif;
  font-size: 13.5px;
  color: var(--head-ink);
  margin: 14px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#pasteDeckFileBtn.fb-lead {
  border-color: var(--scheme-accent);
  color: var(--ink-text);
  border-width: 2px;
}

.cut-list {
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
  margin: 6px 0;
}

/* Cuts: the top row of the Inspiration menus (above Theme). Bottom-up: the
   button at the foot, its body opens UPWARD -- settings, then the list. */

.bs-row.cut-slot {
  display: block;
}

.bs-row.insp-land-row {
  padding-right: 56px;
}

.bs-row.insp-land-row .ghost-btn {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  margin: 0;
}

html.desk .bs-row.insp-land-row {
  padding-right: 0;
}

.cut-block {
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
  width: 100%;
}

.cut-body {
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
}

.cut-body > .cut-list {
  margin: 0;
}

.cut-set {
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}

.cut-basis {
  font-size: 12.5px;
  color: var(--sub-text);
  line-height: 1.35;
}

.cut-lands {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cut-lands-l {
  flex: 1;
  font-size: 14px;
  color: var(--ink-text);
}

.cut-lands-n {
  min-width: 26px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink-text);
  font-size: 16px;
  font-weight: 700;
}

.cut-step {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.cut-lands-h {
  flex: none;
  font-size: 12px;
  color: var(--sub-text);
}

.cut-reset {
  background: none;
  border: none;
  padding: 0;
  color: var(--ink-text);
  font-family: inherit;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

.cut-more {
  width: 100%;
}

/* 1.13 AI advisor: a gold star badge (gold face, dark ink -- readable on every theme) */

.cut-ai {
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
}

.ai-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ai-star {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  color: #111;
  font-size: 13px;
  line-height: 1;
}

.ai-hint {
  font-size: 12px;
  color: var(--sub-text);
  text-align: center;
}

.ai-err {
  font-size: 12.5px;
  color: var(--ink-text);
  line-height: 1.35;
  border-left: 3px solid var(--scheme-accent);
  padding-left: 8px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.ai-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-text);
  line-height: 1.35;
}

.ai-row .ai-txt {
  flex: 1;
  min-width: 0;
}

.ai-via {
  display: block;
  font-size: 11.5px;
  color: var(--sub-text);
  margin-top: 2px;
}

.ai-badge {
  flex: none;
  display: inline-block;
  background: var(--gold);
  color: #111;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  padding: 2px 6px;
  line-height: 1.3;
  white-space: nowrap;
}

.cut-ai-tag {
  align-self: flex-start;
}

.ai-spin {
  flex: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--scheme-accent);
  border-radius: 50%;
  animation: sp 0.7s linear infinite;
}

.cut-grid {
  display: flex;
  flex-wrap: wrap-reverse;
  gap: 10px;
}

.cut-grid > .cut-tile {
  flex: 0 0 calc(50% - 5px);
  min-width: 0;
}

.cut-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 6px;
}

.cut-tile img {
  width: 100%;
  display: block;
  aspect-ratio: 63/88;
  object-fit: cover;
  border-radius: 4.75% / 3.5%;
  background: var(--field);
  cursor: pointer;
}

.cut-reason {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  background: none;
  border: none;
  padding: 2px 2px;
  text-align: left;
  cursor: pointer;
  color: var(--sub-text);
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  min-height: calc(3 * 1.35em + 4px);
}

.cut-reason-t {
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.cut-reason-i {
  flex: none;
  color: var(--ink-text);
  font-size: 15px;
  line-height: 1;
}

.cut-act {
  width: 100%;
  font-size: 13px;
  padding: 8px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cut-act .ib {
  margin-right: 6px;
}

.cut-why-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cut-why-list li {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-left: 3px solid var(--line);
  padding-left: 10px;
}

.cut-why-list b {
  font-size: 14px;
  color: var(--ink-text);
}

.cut-why-list span {
  font-size: 13.5px;
  color: var(--sub-text);
  line-height: 1.45;
}

.cut-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
}

.cut-row img {
  width: 44px;
  border-radius: 4px;
  aspect-ratio: 63/88;
  object-fit: cover;
  flex: none;
  cursor: pointer;
  background: var(--field);
}

.cut-txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cut-txt b {
  font-size: 14px;
  color: var(--ink-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cut-txt span {
  font-size: 12px;
  color: var(--sub-text);
  line-height: 1.35;
}

.cut-btn {
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cut-btn svg {
  width: 19px;
  height: 19px;
}

.about-txt .about-gh {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 10px 8px;
}

/* 1.0: feedback */

.about-txt .about-fb-hint {
  font-size: 13px;
  color: var(--sub-text);
  margin: 0 0 8px;
}

.about-txt .about-fb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin: 0 0 10px;
}

.fb-sheet {
  gap: 8px;
}

.fb-sheet h4 {
  margin: 0;
}

.fb-sheet .fb-hint {
  font-size: 13px;
  line-height: 1.45;
  color: var(--sub-text);
  margin: 0;
}

.fb-sheet textarea,
.fb-sheet input[type='email'] {
  width: 100%;
  box-sizing: border-box;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  border-radius: 8px;
  color: var(--ink-text);
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
}

.fb-sheet textarea {
  resize: none;
  min-height: 110px;
}

.fb-shots {
  display: flex;
  gap: 8px;
}

.fb-shot {
  position: relative;
  flex: 0 0 74px;
  height: 96px;
  border-radius: 8px;
  border: 1.5px dashed var(--line);
  background: var(--ink-2);
  color: var(--sub-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
}

.fb-shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fb-shot .fb-x {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 13px;
  line-height: 22px;
  text-align: center;
  z-index: 2;
}

.fb-sheet .fb-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.fb-sheet .fb-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.fb-sheet .fb-actions button {
  flex: 1;
  margin: 0;
}

.fb-sheet .fb-count {
  font-size: 11px;
  color: var(--sub-text);
  text-align: right;
  margin-top: -4px;
}

.settings-body {
  padding: 0 14px 14px;
  border-top: 2px solid var(--line);
}

.settings-body.collapsed {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
  margin: 0;
}

.toggle-switch .track {
  position: absolute;
  inset: 0;
  background: var(--ink-2);
  border: 2px solid var(--line);
  border-radius: 14px;
  transition: background 0.2s;
}

.toggle-switch .knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--sub-text);
  border-radius: 50%;
  transition:
    transform 0.2s,
    background 0.2s;
}

.toggle-switch input:checked + .track {
  background: var(--scheme-glow);
  border-color: var(--scheme-accent);
}

.toggle-switch input:checked + .track + .knob {
  transform: translateX(18px);
  background: var(--brass);
}

.danger-row {
  color: var(--danger);
}

.theme-seg {
  padding: 0 14px 14px;
}

/* Colour-scheme drop-up: the guild grid sits ABOVE its row in the DOM and on
   screen, unfolding upward out of the row like every other sheet. */

.guild-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px 10px 8px;
  border-bottom: 2px solid var(--line);
}

.guild-list[hidden] {
  display: none;
}

#guildRow:not(.xt-tile) {
  justify-content: space-between;
}

#guildRow .guild-cur {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.guild-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink-text);
  font-family: 'Inter';
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}

.guild-opt .mana-ic {
  flex: none;
}

.guild-opt span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-opt.sel {
  border-color: var(--scheme-accent);
  background: var(--scheme-glow);
  color: var(--ink-text);
}

.guild-opt.sel,
.guild-opt.sel svg {
  -webkit-text-fill-color: var(--ink-text);
}

.guild-swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex: none;
  background: linear-gradient(135deg, var(--gm) 0 50%, var(--gs) 50% 100%);
  border: 1px solid rgba(0, 0, 0, 0.4);
}

.guild-cur {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--head-ink);
  font-size: 13.5px;
  flex: none;
}

.seg-inline {
  flex: 0 0 auto;
  margin-left: auto;
}

.seg-inline button {
  padding: 7px 16px;
  font-size: 13px;
}

/* Source: styles/overlays.css */
/* ---------- overlays / modals ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.35) 100%), var(--ink);
  display: flex;
  flex-direction: column;
}

.overlay-inner {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.overlay main {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 24px;
}

#recoOverlay main,
#pairPopOverlay main,
#colAddSheet main,
#addCollOverlay main,
#budgetOverlay main,
#cardRecoOverlay main,
#metaDeckOverlay main {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
}

/* Similar cards read from the source card down through the ranked results. */
[id^='similarOverlay'] main {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-anchor: none;
}

[id^='similarOverlay'] main > * {
  flex: 0 0 auto;
}

/* Meta-deck tiles: the key card's art, the deck's name, its colours, its
   share of the metagame and its style. */

.meta-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-family: 'Inter';
  color: var(--panel-text);
}

.meta-tile:active {
  transform: scale(0.98);
}

.meta-tile .mt-art {
  display: block;
  aspect-ratio: 626/457;
  background: rgba(0, 0, 0, 0.35) center/cover no-repeat;
}

.meta-tile .mt-body {
  display: block;
  padding: 7px 9px 9px;
}

.meta-tile .mt-nm {
  display: block;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  color: var(--panel-text);
}

.meta-tile .mt-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--panel-sub);
  margin-top: 4px;
}

.meta-tile .mt-share {
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink-text);
}

.meta-tile .mt-extra {
  display: block;
  font-size: 11.5px;
  color: var(--panel-sub);
  margin-top: 3px;
}

#mdBody {
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
}

#mdBody .md-sec .section-label {
  margin: 0 0 6px;
}

.md-hero .md-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.md-hero .md-actions .add-btn,
.md-hero .md-actions .ghost-btn {
  width: auto;
  padding: 9px 14px;
  font-size: 13.5px;
  text-decoration: none;
}

.md-missing {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.md-missing span {
  font-size: 12.5px;
  padding: 4px 8px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  color: var(--sub-text);
}

.dl-fmt-seat {
  line-height: 1.5;
  font-size: 13px;
}

.acc-up:not([hidden]) {
  display: flex;
  flex-direction: column-reverse;
}

/* Drop-down folds in Extras: long reading, top to bottom. */

.acc-down[hidden] {
  display: none;
}

.acc-down:not([hidden]) {
  display: block;
  border-top: 1.5px solid var(--line);
}

.acc-down [data-fmtruletxt]:not([hidden]),
.acc-down [data-banbox]:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0 4px;
}

.acc-down .ban-sub {
  font-size: 12px;
  color: var(--sub-text);
  margin: 8px 0 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.acc-down .banlist-grid {
  flex-wrap: wrap;
}

.acc-down .ub-wrap,
.acc-down .ub-switches {
  flex-direction: column;
}

.acc-down .settings-row {
  padding-left: 2px;
  padding-right: 2px;
}

.acc-down .settings-row + .settings-row {
  border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}

.sub-fold {
  display: flex;
  align-items: center;
  gap: 0;
}

.sub-fold .fold-ico {
  margin-left: auto;
  padding-left: 10px;
  font-size: 13px;
  color: var(--sub-text);
}

.inl-ico {
  display: inline-flex;
  vertical-align: -2px;
  margin-right: 6px;
}

.ib.ib-t {
  width: 20px;
  justify-content: center;
  font-size: 16px;
  line-height: 20px;
}

.cselect-search .cs-mag {
  display: inline-flex;
}

.cselect-search .cs-mag svg {
  width: 16px;
  height: 16px;
}

.iac-ico {
  display: flex;
  justify-content: center;
  color: var(--head-ink);
  margin: 2px 0 8px;
}

.iac-ico svg {
  width: 30px;
  height: 30px;
}

.big-ico {
  display: inline-flex;
}

.big-ico svg {
  width: 46px;
  height: 46px;
}

.tok-ico {
  display: inline-flex;
}

.tok-ico svg {
  width: 1em;
  height: 1em;
}

.dk-tool#dlSelDel svg {
  width: 20px;
  height: 20px;
}

.inl-ico svg {
  width: var(--ii, 15px);
  height: var(--ii, 15px);
}

.want-bell svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.want-bell.on svg {
  margin-right: 4px;
}

.acc-up [data-fmtrule] > div,
.acc-up [data-banfmt] > div {
  display: flex;
  flex-direction: column-reverse;
}

input,
textarea,
[contenteditable] {
  caret-color: var(--caret, currentColor);
}

.ub-wrap {
  display: flex;
  flex-direction: column-reverse;
}

.banwhy-wrap {
  display: flex;
  flex-direction: column;
}
/* reads top to bottom: the button, then the notes BELOW it */

/* Cover-art picker: first card at the foot-left, the rest climbing (wrap-reverse). */

.cover-grid {
  display: flex;
  flex-wrap: wrap-reverse;
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 2px;
}

.cover-opt {
  flex: 0 0 calc(33.333% - 6px);
  padding: 0;
  border: 2.5px solid transparent;
  border-radius: 9px;
  background: none;
  cursor: pointer;
  overflow: hidden;
}

.cover-opt img {
  width: 100%;
  display: block;
  border-radius: 6px;
}

.cover-opt.on {
  border-color: var(--head-ink);
}

.life-fmt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 0 0 12px;
}

.life-fmt-row .chip small {
  display: block;
  font-size: 10.5px;
  opacity: 0.75;
  line-height: 1.1;
}

.ub-switches {
  display: flex;
  flex-direction: column-reverse;
  margin: 4px 0 8px;
}

.ub-switches[hidden] {
  display: none;
}
/* bottom-up: its heading at the foot, the first set right above it */

.acc-up [data-fmtruletxt]:not([hidden]),
.acc-up [data-banbox]:not([hidden]) {
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
  margin: 0 0 6px;
}

.acc-up .ban-sub {
  font-size: 12px;
  color: var(--sub-text);
  margin: 8px 0 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dl-fmt-seat b {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  color: var(--head-ink);
}

.overlay .topbar {
  position: relative;
  justify-content: center;
  padding-left: 54px;
  padding-right: 54px;
  box-sizing: border-box;
  min-height: 50px;
}

.overlay .topbar > .icon-btn:first-child {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.overlay .topbar > button:not(:first-child) {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.overlay .topbar .brand-txt {
  flex: 0 1 auto;
  max-width: 100%;
  text-align: center;
}

.overlay .topbar .tb-titles {
  flex: 0 1 auto;
  max-width: 100%;
  text-align: center;
  align-items: center;
}

.overlay .topbar .sheet-title {
  font-size: 18px;
}

/* Card sheets stop ABOVE the app's own bottom nav: the real navigation —
   back button in its usual place — stays visible and tappable beneath the
   sheet, and the card's name caps the sheet up top like any page name.
   Stacked background sheets (cardSheetOverlay_bg…) get the same window. */

[id^='cardSheetOverlay'] {
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

/* Over another overlay there is no reachable nav bar beneath — the sheet
   covers the full height so the page below can't peek through at the foot. */

[id^='cardSheetOverlay'].sheet-over-overlay {
  bottom: 0;
}

#bgBody {
  display: flex;
  flex-direction: column-reverse;
}

.budget-trio {
  display: flex;
  flex-direction: column-reverse;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 640px) {
  .modal-backdrop {
    align-items: center;
  }
}

.modal-sheet {
  background: var(--ink-3);
  border: 2px solid var(--line);
  border-radius: 14px 14px 0 0;
  width: 100%;
  max-width: 420px;
  padding: 18px;
  max-height: 80vh;
  overflow-y: auto;
}

@media (min-width: 640px) {
  .modal-sheet {
    border-radius: 14px;
  }
}

.modal-sheet h3 {
  font-family: 'Cinzel', serif;
  color: var(--ink-text);
  font-size: 16px;
  margin: 0 0 12px;
}

.modal-sheet input {
  width: 100%;
  background: var(--ink-2);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink-text);
  font-size: 15px;
  margin-bottom: 12px;
}

.modal-actions {
  display: flex;
  gap: 8px;
}

.modal-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}

.modal-actions .cancel {
  background: none;
  border: 2px solid var(--line);
  color: var(--sub-text);
}

.modal-actions .confirm {
  background: var(--brass);
  border: none;
  color: var(--on-acc);
}

.modal-actions .confirm.danger {
  background: var(--danger);
  color: #fff;
}

.menu-pop {
  position: absolute;
  top: 52px;
  right: 14px;
  background: var(--pop-bg);
  border: 1.5px solid var(--pop-line);
  border-radius: 10px;
  overflow: hidden;
  z-index: 80;
  min-width: 170px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.menu-pop button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--ink-text);
  padding: 11px 14px;
  font-size: 14px;
  cursor: pointer;
}

.menu-pop button:hover {
  background: var(--scheme-glow);
}

.menu-pop button.danger {
  color: var(--danger);
}

.menu-pop hr {
  border: none;
  border-top: 2px solid var(--line);
  margin: 2px 0;
}

.toast {
  position: fixed;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-2);
  border: 2px solid var(--scheme-accent);
  color: var(--ink-text);
  padding: 9px 16px;
  border-radius: 20px;
  font-size: 13.5px;
  z-index: 200;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s,
    transform 0.25s;
  white-space: pre-line;
  max-width: min(86vw, 420px);
  text-align: left;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

.card-preview-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

/* 1.36: a card opened from the judge page (z 9600) or from a floating
   Extras panel (z 1201) shows on top of them */

body:has(#crOverlay) .card-preview-backdrop,
body:has(main.xt-tiles > .xt-scrim) .card-preview-backdrop {
  z-index: 9700;
}

.card-preview-backdrop img {
  max-width: 96vw;
  max-height: 90vh;
  border-radius: 4.75% / 3.5%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.card-preview-backdrop .pv-card {
  position: relative;
  display: inline-block;
  line-height: 0;
}

.card-preview-backdrop .pv-card > img {
  display: block;
}

.card-preview-backdrop .dfc-flip {
  width: 52px;
  height: 52px;
}

.card-preview-backdrop .dfc-flip svg {
  width: 26px;
  height: 26px;
}

/* Source: styles/pages/life.css */
/* ---------- life counter v2 ---------- */

.player-count {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.player-count button {
  flex: 1;
  background: var(--ink-2);
  border: 2px solid var(--line);
  color: var(--sub-text);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.player-count button.active {
  background: var(--acc-fill);
  color: var(--on-acc);
  border-color: var(--scheme-accent);
  font-weight: 700;
}

.life-toolbar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.life-toolbar::-webkit-scrollbar {
  display: none;
}

.life-toolbar button {
  flex: 0 0 auto;
  background: var(--ink-2);
  border: 2px solid var(--line);
  color: var(--sub-text);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.life-toolbar button:hover,
.life-toolbar button.active {
  border-color: var(--scheme-accent);
  color: var(--ink-text);
}

.life-grid-v2 {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 12px;
  margin-top: 4px;
  height: calc(100dvh - 118px - var(--nav-h) - env(safe-area-inset-bottom));
  min-height: 0;
}

.life-grid-v2.single-col {
  grid-template-columns: 1fr;
  min-height: 0;
}

.life-card-v2.spin-active {
  box-shadow:
    0 0 0 3px #fff,
    0 0 34px 8px rgba(255, 255, 255, 0.55);
  filter: brightness(1.35);
  z-index: 5;
}

.life-card-v2.active-turn {
  box-shadow:
    0 0 0 2px var(--scheme-accent),
    0 0 20px 3px color-mix(in srgb, var(--scheme-accent) 45%, transparent);
}

.turn-badge {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  background: var(--acc-fill);
  color: var(--on-acc);
  border: none;
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.turn-badge:active {
  filter: brightness(0.9);
}

.life-cell {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}

/* central turn hub — a square carved out of the middle of the table */

.life-grid-wrap {
  position: relative;
}

.lval-row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
}

.ldelta {
  width: 58px;
  flex: 0 0 auto;
  font-size: 26px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  opacity: 0;
  transition: opacity 0.25s;
  text-align: center;
  pointer-events: none;
}

.ldelta.show {
  opacity: 0.95;
}

.ldelta.pop {
  animation: deltaPop 0.18s ease;
}

.ldelta.minus {
  color: #ff9d9d;
  text-align: right;
  padding-right: 4px;
}

.ldelta.plus {
  color: #a7ecb4;
  text-align: left;
  padding-left: 4px;
}

@keyframes deltaPop {
  from {
    transform: scale(0.7);
  }
  to {
    transform: scale(1);
  }
}

.turn-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 8;
  width: 92px;
  height: 92px;
  border-radius: 16px;
  background: linear-gradient(160deg, var(--ink-2), var(--ink-3));
  border: 2.5px solid var(--scheme-accent);
  box-shadow:
    0 6px 22px rgba(0, 0, 0, 0.55),
    inset 0 0 14px color-mix(in srgb, var(--scheme-accent) 18%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Rounded plate behind the hub, in the table's own background color — it sits
   over the sharp inner corners of the notch cuts so the carved opening reads
   with the same rounded corners as the player cards themselves. */

.turn-hub::before {
  content: '';
  position: absolute;
  inset: -14px;
  z-index: -1;
  background: var(--ink);
  border-radius: 18px;
}

.turn-hub:active {
  filter: brightness(1.15);
}

.turn-hub .th-arrow {
  font-size: 24px;
  line-height: 1;
  color: var(--ink-text);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
  transition: transform 0.35s cubic-bezier(0.4, 1.5, 0.5, 1);
}

.turn-hub .th-num {
  font-family: 'Cinzel', serif;
  font-size: 21px;
  font-weight: 700;
  color: var(--ink-text);
  line-height: 1.05;
}

.turn-hub .th-lbl {
  font-size: 10.5px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--ink-text);
  font-weight: 600;
}

.turn-hub.idle .th-arrow {
  color: var(--sub-text-2);
}

/* square notches cut from the center-facing corner/edge of each player rectangle */

.life-cell.notch-br {
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 46px),
    calc(100% - 46px) calc(100% - 46px),
    calc(100% - 46px) 100%,
    0 100%
  );
}

.life-cell.notch-bl {
  clip-path: polygon(
    0 0,
    100% 0,
    100% 100%,
    46px 100%,
    46px calc(100% - 46px),
    0 calc(100% - 46px)
  );
}

.life-cell.notch-tr {
  clip-path: polygon(
    0 0,
    calc(100% - 46px) 0,
    calc(100% - 46px) 46px,
    100% 46px,
    100% 100%,
    0 100%
  );
}

.life-cell.notch-tl {
  clip-path: polygon(46px 0, 100% 0, 100% 100%, 0 100%, 0 46px, 46px 46px);
}

.life-cell.notch-b {
  clip-path: polygon(
    0 0,
    100% 0,
    100% 100%,
    calc(50% + 46px) 100%,
    calc(50% + 46px) calc(100% - 42px),
    calc(50% - 46px) calc(100% - 42px),
    calc(50% - 46px) 100%,
    0 100%
  );
}

.life-cell.notch-t {
  clip-path: polygon(
    0 0,
    calc(50% - 46px) 0,
    calc(50% - 46px) 42px,
    calc(50% + 46px) 42px,
    calc(50% + 46px) 0,
    100% 0,
    100% 100%,
    0 100%
  );
}

.life-cell.notch-r {
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(50% - 46px),
    calc(100% - 42px) calc(50% - 46px),
    calc(100% - 42px) calc(50% + 46px),
    100% calc(50% + 46px),
    100% 100%,
    0 100%
  );
}

.life-cell.notch-l {
  clip-path: polygon(
    0 0,
    100% 0,
    100% 100%,
    0 100%,
    0 calc(50% + 46px),
    42px calc(50% + 46px),
    42px calc(50% - 46px),
    0 calc(50% - 46px)
  );
}

/* Source: styles/pickers-judge.css */
/* ---------- add-to-deck popup ---------- */

.deckpick-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.deckpick {
  width: 100%;
  max-width: 440px;
  background: var(--ink-2);
  border: 2px solid var(--line);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.deckpick h4 {
  font-family: 'Cinzel', serif;
  color: var(--ink-text);
  font-size: 14px;
  margin: 0 0 4px;
  letter-spacing: 0.5px;
}

.deckpick .dp-sub {
  font-size: 12.5px;
  color: var(--sub-text);
  margin: 0 0 10px;
}

.deckpick-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  color: var(--ink-text);
  font-size: 14.5px;
  font-weight: 600;
}

.dp-row:hover {
  border-color: var(--scheme-accent);
}

.dp-row .dp-meta {
  font-size: 11.5px;
  color: var(--sub-text);
  font-weight: 400;
  margin-top: 1px;
}

.dp-row .dp-txt {
  flex: 1;
  min-width: 0;
}

.dp-row .dp-pips {
  flex: none;
  margin-left: auto;
}

.dp-cancel {
  margin-top: 10px;
  background: none;
  border: 2px solid var(--line);
  color: var(--sub-text);
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  cursor: pointer;
}

/* ---------- pinned-deck pill (search page) ---------- */

.pin-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--scheme-glow);
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 6px 8px 6px 14px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--ink-text);
  font-weight: 600;
}

.pin-pill .pp-txt {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pin-pill button {
  background: none;
  border: none;
  color: var(--ink-text);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  opacity: 0.8;
}

/* ---------- card of the day ---------- */

.cotd {
  margin-top: 8px;
  text-align: center;
}

#crOverlay {
  position: fixed;
  inset: 0;
  z-index: 9600;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  max-width: none;
}

.cr-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 6px;
}

.cr-title {
  font-family: 'Cinzel', serif;
  font-size: 17px;
  color: var(--ink-text);
  letter-spacing: 0.04em;
}

.cr-bar {
  display: flex;
  gap: 8px;
  padding: 8px 14px 10px;
  position: relative;
}

/* 1.33: the judge */

.cr-bar textarea {
  flex: 1;
  min-width: 0;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  border-radius: 8px;
  color: var(--ink-text);
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.35;
  resize: none;
  font-family: inherit;
}

/* 1.36: tagged cards underlined IN the field -- a mirror of the text behind
   the (transparent) field draws only the underlines. */

.cr-qwrap {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  border-radius: 8px;
}

.cr-qwrap textarea,
.cr-qmirror {
  margin: 0;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.35;
  font-family: inherit;
  letter-spacing: normal;
  word-spacing: normal;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  box-sizing: border-box;
}

.cr-bar .cr-qwrap textarea {
  background: transparent;
  border: none;
  border-radius: 8px;
  position: relative;
  z-index: 1;
  scrollbar-width: none;
}

.cr-qwrap textarea::-webkit-scrollbar {
  display: none;
}

.cr-qmirror {
  position: absolute;
  inset: 0;
  overflow: hidden;
  color: transparent;
  pointer-events: none;
}

.cr-qmirror .cr-tagu {
  text-decoration: underline;
  text-decoration-color: var(--brass);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.cr-count.cr-left {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-text);
  white-space: nowrap;
}

/* 1.37: the page behind the judge never scrolls along (no wobble) */

html:has(#crOverlay) {
  overflow: hidden;
}

#crOverlay #crBody {
  overscroll-behavior: contain;
}

.cj-hero .cj-ico[hidden],
.cj-try .cj-ex[hidden] {
  display: none;
}

.cj-notice {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
}

.cj-notice .deckpick {
  border-radius: 16px;
  max-width: 320px;
  width: 100%;
  margin: auto;
  text-align: center;
}

.cr-tagpop .cr-tagnote {
  padding: 10px 12px;
  font-size: 13.5px;
  font-style: italic;
  color: var(--sub-text);
}

.cj-card {
  text-decoration: underline;
  text-decoration-color: var(--brass);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.cja-whyt {
  display: block;
  margin: 10px 0 0;
  padding: 8px 0 2px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-top: 1.5px solid var(--line);
  color: var(--ink-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.cja-whyt .fold-ico {
  font-size: 12px;
  margin-left: 4px;
}

.cja .cja-why {
  margin: 6px 0 0;
}

.cja .cja-why[hidden] {
  display: none;
}

.cr-side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.cr-judge {
  flex: none;
  width: 56px;
  height: 56px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cr-judge svg {
  width: 28px;
  height: 28px;
}

.cr-count {
  font-size: 11px;
  color: var(--sub-text);
  font-family: 'JetBrains Mono', monospace;
}

#crOverlay.cr-mode-rules .cr-side {
  display: none;
}

.cj-hero {
  text-align: center;
  padding: 8px 16px 2px;
}

.cj-hero .cj-ico {
  display: inline-flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--scheme-accent);
  border-radius: 50%;
  color: var(--ink-text);
}

.cj-hero .cj-ico svg {
  width: 28px;
  height: 28px;
}

.cj-hero h3 {
  margin: 8px 0 4px;
  font-size: 21px;
  color: var(--head-ink);
}

.cj-hero p {
  margin: 3px 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-text);
}

.cj-hero p.cj-sub {
  color: var(--sub-text);
  font-size: 12.5px;
}

.cj-try {
  padding: 2px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cj-try .cj-ex {
  text-align: left;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--ink-2);
  color: var(--ink-text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.35;
  font-style: italic;
  cursor: pointer;
}

.cj-try .cj-lab {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sub-text);
  margin: 2px 2px 0;
}

.cj-rules {
  margin: 6px 12px 2px;
}

.cr-tagpop {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(100% + 4px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--pop-bg);
  border: 1.5px solid var(--pop-line);
  border-radius: 10px;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.45);
}

.cr-tagpop[hidden] {
  display: none;
}

.cr-tagpop button {
  flex: none;
  text-align: left;
  padding: 10px 12px;
  background: none;
  border: none;
  border-top: 1px solid var(--line);
  color: var(--ink-text);
  font-family: inherit;
  font-size: 14.5px;
  cursor: pointer;
}

.cr-tagpop button:last-child {
  border-top: none;
}

.cja {
  margin: 8px 8px 4px;
  padding: 12px 14px;
  border: 2px solid var(--scheme-accent);
  border-radius: 12px;
  background: var(--ink-2);
}

.cja-a {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink-text);
}

.cja-meta {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--sub-text);
}

.cja-why {
  margin: 6px 12px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-text);
}

.cja-q {
  margin: 12px 12px 4px;
  font-size: 13.5px;
  font-style: italic;
  color: var(--sub-text);
}

.cja > .cja-q {
  margin: 0 0 8px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--line);
  font-size: 14px;
}

.cja-h {
  margin: 10px 12px 2px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sub-text);
}

.cr-bar input {
  flex: 1;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  border-radius: 8px;
  color: var(--ink-text);
  padding: 10px 12px;
  font-size: 15px;
  min-width: 0;
}

#crBody {
  padding: 0 6px 30px;
}

.cr-rule {
  display: flex;
  gap: 10px;
  padding: 10px 10px;
  border-bottom: 2px solid var(--line);
}

.cr-num {
  flex: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--ink-text);
  min-width: 52px;
  padding-top: 2px;
}

.cr-txt {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-text);
  white-space: pre-wrap;
  word-break: break-word;
}

.cr-txt mark {
  background: color-mix(in srgb, var(--brass) 32%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

.cr-jump {
  background: none;
  border: none;
  padding: 0;
  color: var(--ink-text);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}

.cr-toc {
  display: flex;
  flex-direction: column;
}

.cr-toc-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 2px solid var(--line);
  padding: 11px 10px;
  color: var(--ink-text);
  font-size: 14.5px;
  cursor: pointer;
}

#logGameOverlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* Pickers in the log form are DROP-UPs, options bottom-up. Plain lists
   reverse via flex; the CARD pickers stay a two-column grid of full images
   (the id-scoped flex was flattening them into strips) — their bottom-up
   comes from the options array itself arriving Z→A, so A lands at the
   grid's foot. The filter field sinks to the panel foot in both. */

#logGameOverlay .cselect-panel {
  top: auto;
  bottom: calc(100% + 4px);
}

#logGameOverlay .cselect:not(.cs-cardgrid) .cselect-panel {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
}

#logGameOverlay .cs-cardgrid .cselect-panel .cselect-search {
  order: 999;
  grid-column: 1 / -1;
}

.cselect:has(> .cselect-panel.inline) {
  display: flex;
  flex-direction: column-reverse;
}

.cselect-panel.inline {
  position: static;
  max-height: 44vh;
  overflow-y: auto;
  margin: 0 0 6px;
  box-shadow: none;
  display: flex;
  flex-direction: column-reverse;
}

.glog-csbox {
  flex: 1;
  min-width: 0;
}

.glog-csbox .cselect {
  width: 100%;
}

.glog-copt {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  text-align: left;
}

.glog-copt img {
  width: 32px;
  height: 45px;
  object-fit: cover;
  border-radius: 4px;
  flex: none;
  background: #101418;
}

.cs-cardgrid .cselect-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  max-height: 340px;
}

.cs-cardgrid .cselect-search,
.cs-cardgrid .cs-noresults {
  grid-column: 1 / -1;
}

.cs-cardgrid .cselect-opt {
  border: none;
  border-radius: 8px;
  padding: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-cardgrid .cselect-opt.sel {
  outline: 2.5px solid var(--scheme-accent);
  background: none;
}

/* ---- Art-tile drop-ups (Inspiration page): every option is a square, two
   per row -- the most-played leader's art on top, the name in a bar of the
   app's main color along the foot. ---- */

.cselect-panel.cs-artgrid {
  display: flex;
  flex-direction: column;
  padding: 0;
  max-height: min(360px, 48vh);
  overflow: hidden;
}

.cs-artscroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 158px;
  align-content: start;
  gap: 8px;
  padding: 8px;
}

.cs-artgrid .cselect-search {
  position: relative;
  flex: 0 0 auto;
  top: auto;
  border-top: 1.5px solid var(--pop-line);
  border-bottom: none;
  margin: 0;
  padding: 10px 12px;
  box-shadow: 0 -8px 14px rgba(0, 0, 0, 0.45);
  z-index: 1;
}

.cs-artgrid .cselect-search,
.cs-artgrid .cs-noresults {
  grid-column: 1 / -1;
}

.cs-artgrid .cselect-opt.art-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  height: 158px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--ink-deep);
}

.cs-artgrid .cselect-opt.art-tile:last-child {
  border-bottom: 2px solid var(--line);
}

.cs-artgrid .cselect-opt.art-tile:hover {
  background: var(--ink-deep);
}

.art-tile .at-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 25%;
  background-repeat: no-repeat;
  background-color: color-mix(in srgb, var(--ink) 55%, #000);
}

.art-tile .at-label {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--ink);
  color: var(--main-text);
  border-top: 2px solid var(--line);
  min-height: 42px;
  padding: 6px 8px;
  text-shadow: none;
}

.art-tile .at-label .at-txt {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.art-tile .at-label .co-icons {
  flex: 0 0 auto;
}

.art-tile .at-img.at-gen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  align-content: center;
  gap: 4px;
  font-size: 56px;
  opacity: 0.92;
  padding: 8px 8px 52px;
}

.mana-pentagon {
  position: relative;
  display: block;
  flex: 0 0 auto;
}

.cs-artgrid .cselect-opt.art-tile.sel {
  outline: 2.5px solid var(--scheme-accent);
  outline-offset: -2px;
  background: var(--ink-deep);
  color: var(--main-text);
}

/* The engraved brass text-shadow (meant for brass-on-glow rows) doubled the
   letters on selected tiles -- flat text on the tiles, every scheme. */

.cs-artgrid .cselect-opt.art-tile,
.cs-artgrid .cselect-opt.art-tile.sel {
  text-shadow: none;
}

.glog-cimg {
  display: block;
  width: 100%;
  position: relative;
}

.glog-cimg img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #101418;
}

.glog-cimg .glog-cname {
  display: block;
  padding: 10px 6px;
  font-size: 13px;
  text-align: center;
}

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

.dp-sect {
  margin: 6px 0 0;
  padding-top: 8px;
  border-top: 2px solid var(--line);
  font-size: 11.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--sub-text);
}

/* Bottom-left badge rail — replaces the corner ribbons and the old ✓ dot.
   Right padding keeps the rail away from the power/toughness corner even
   with all three badges showing. */

.card-badges {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 63/88;
  pointer-events: none;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 4px;
  padding: 0 30px 5px 5px;
  box-sizing: border-box;
}

.cb {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
  font-style: normal;
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.cb-ub {
  background: linear-gradient(135deg, #7b5cd6, #4a2f96);
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

.cb-sp {
  background: none;
  box-shadow: none;
  font-size: 17px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.85));
}

.cb-own {
  background: linear-gradient(135deg, #1f9a63, #0e5c3a);
  font-size: 13px;
}

.swipe-ghost {
  position: fixed;
  top: 50%;
  left: 50%;
  margin-left: -34vw;
  width: 68vw;
  aspect-ratio: 63/88;
  object-fit: cover;
  border-radius: 4.75%/3.5%;
  z-index: 130;
  pointer-events: none;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translate(200vw, -50%);
  background: #111113;
}

.edge-flash {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 4px;
  z-index: 135;
  background: var(--brass);
  pointer-events: none;
  animation: edgeFlash 0.32s ease-out forwards;
}

.edge-flash.left {
  left: 0;
}

.edge-flash.right {
  right: 0;
}

@keyframes edgeFlash {
  from {
    opacity: 0.85;
  }
  to {
    opacity: 0;
  }
}

.foil-star {
  position: absolute;
  left: 8%;
  bottom: 47%;
  font-size: 19px;
  font-style: normal;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.9));
}

*:has(> .card-badges) {
  position: relative;
}

*:has(> .vg-qty) {
  position: relative;
}

/* Source: styles/pages/trade.css */
/* Trade calculator */

.trade-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 2px solid var(--line);
}

.trade-row:last-of-type {
  border-bottom: none;
}

.trade-row img {
  width: 38px;
  border-radius: 4px;
  background: #101418;
  cursor: pointer;
  flex: none;
}

.trade-row .tr-body {
  flex: 1;
  min-width: 0;
}

.trade-row .nm {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-row .tl {
  font-size: 12px;
  color: var(--sub-text);
}

.tr-eur {
  color: var(--ink-text);
  font-family: 'JetBrains Mono', monospace;
}

.tr-qty {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: none;
}

.tr-qty button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  color: var(--ink-text);
  font-size: 15px;
  cursor: pointer;
  line-height: 1;
}

.tr-qty span {
  font-size: 13px;
  min-width: 26px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
}

.tr-del {
  flex: none;
  color: var(--sub-text);
}

.iac-msg {
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-line;
  color: var(--ink-text);
  text-align: left;
}

.col-grid .col-tile {
  content-visibility: auto;
  contain-intrinsic-size: auto var(--col-tile-h, 330px);
}

/* The double-faced flip button: a circle on the art, Moxfield-style —
   right of center, off the name line and the text box. */

.dfc-flip-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 63/88;
  pointer-events: none;
  z-index: 4;
}

.dfc-flip {
  position: absolute;
  top: 28%;
  right: 7%;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--scheme-accent);
  background: var(--acc-fill);
  color: var(--on-acc);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  box-shadow:
    0 0 0 2px rgba(20, 14, 26, 0.55),
    0 3px 10px rgba(0, 0, 0, 0.6),
    0 0 14px rgba(233, 199, 103, 0.35);
  transition:
    transform 0.28s ease,
    background 0.2s,
    color 0.2s;
  padding: 0;
}

.dfc-flip:active {
  transform: scale(0.9);
}

.dfc-flip.flipped {
  transform: rotate(180deg);
  background: linear-gradient(145deg, #2e4a66, #152a3f);
  color: var(--ink-text);
  border-color: var(--scheme-accent);
  box-shadow:
    0 0 0 2px rgba(20, 14, 26, 0.55),
    0 3px 10px rgba(0, 0, 0, 0.6),
    0 0 14px rgba(46, 74, 102, 0.55);
}

.dfc-flip.flipped:active {
  transform: rotate(180deg) scale(0.9);
}

*:has(> .dfc-flip-box) {
  position: relative;
}

.edh-jump-row {
  position: sticky;
  top: 6px;
  z-index: 6;
  display: flex;
  justify-content: flex-end;
  height: 0;
  pointer-events: none;
}

.edh-jump {
  pointer-events: auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--field);
  border: 2.5px solid var(--scheme-accent);
  color: var(--ink-text);
  font-size: 17px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

.edh-sec {
  scroll-margin-top: 74px;
}

/* block:'end' landings from the \u2630 jumps: keep the section label clear of
   the fixed bottom nav (page-level sections only; overlays scroll inside
   their own port and need no offset). */

.app > main .edh-sec {
  scroll-margin-bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
}

/* The current section's name rides just below the top bar; the next
   section's label pushes it out — classic sticky headers, scoped per
   section. Solid backing so it stays readable over the tiles. */

.edh-sec {
  display: flex;
  flex-direction: column;
}

.edh-sec > .section-label {
  order: 10;
  position: static;
  background: var(--ink);
  padding: 8px 6px;
  border-bottom: 2px solid var(--line);
  border-top: 1px solid var(--line);
  font-size: 14px;
  -webkit-text-fill-color: currentColor;
}

/* Overlays scroll inside <main>, whose top edge already sits under the
   overlay topbar — the 66px offset above is browse-page tuning (under the
   app nav) and pins the label mid-screen there. Hug the scrollport instead. */

.overlay main .edh-sec > .section-label {
  position: sticky;
  top: auto;
  bottom: 0;
  z-index: 5;
}

#recoOverlay .edh-sec > .section-label {
  position: sticky;
  top: auto !important;
  bottom: 0;
  z-index: 6;
  background: var(--ink);
  margin-bottom: 0;
  padding: 7px 6px;
  border-bottom: 2px solid var(--line);
  -webkit-text-fill-color: currentColor;
}

#recoOverlay main {
  padding-bottom: 0;
}

#recoOverlay .ra-hint {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--ink) 97%, transparent),
    color-mix(in srgb, var(--ink) 92%, transparent)
  );
  backdrop-filter: blur(8px);
  border-top: 2px solid var(--line);
  margin: 0;
  padding: 8px 0;
}

#recoOverlay .edh-jump-row {
  position: fixed !important;
  top: auto !important;
  bottom: calc(52px + var(--nav-h) + env(safe-area-inset-bottom));
  right: 14px;
  left: auto;
  justify-content: flex-end;
  z-index: 140;
  height: auto;
  transition: bottom 0.2s;
}

/* While the selection + fab is visible, the burger steps up to make room —
   and steps back down the moment the last selection is dropped. */

#recoOverlay:has(.reco-fab:not([hidden])) .edh-jump-row {
  bottom: calc(96px + var(--nav-h) + env(safe-area-inset-bottom));
}

.edh-jump-row {
  top: 70px;
}

.reco-fab {
  position: fixed;
  right: 16px;
  bottom: calc(18px + var(--nav-h) + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--acc-fill);
  color: var(--on-acc);
  font-size: 26px;
  font-weight: 800;
  border: none;
  z-index: 140;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.reco-theme-banner {
  width: fit-content;
  margin: 0 auto 8px;
  padding: 6px 14px;
  border: 2.5px solid var(--scheme-accent);
  border-radius: 999px;
  color: var(--ink-text);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

#tileMenuPop {
  max-height: 70vh;
  overflow-y: auto;
}

.edh-rel {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  margin-top: 10px;
  -webkit-overflow-scrolling: touch;
}

.edh-rel-chip {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1.5px solid var(--field-line);
  background: var(--field);
  color: var(--ink-text);
  font-size: 13.5px;
  font-family: Inter;
}

.edh-rel-chip b {
  color: var(--ink-text);
  font-weight: 700;
}

.colfold-ico {
  color: var(--ink-text);
}

.colfold-ico svg {
  width: 46px;
  height: 46px;
  display: block;
}

.col-tile.csel {
  outline: 2.5px solid var(--scheme-accent);
  outline-offset: -2px;
}

.csel-mark {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold);
  color: #111;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* The selection button TAKES the ＋'s place (it used to sit half over it). */

body:has(#colSelFab) #binderFab,
body:has(#colSelFab) #colFab {
  display: none !important;
}

/* Gold selection buttons: ＋ for one pick, the count itself from two up. */

.fp-newsub {
  display: block;
  width: 100%;
  flex: none;
  min-height: 46px;
  margin-top: 10px;
  font-size: 15px;
  white-space: normal;
}

.fp-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: stretch;
}

.fp-actions > button {
  margin: 0;
  min-height: 50px;
  white-space: normal;
  line-height: 1.2;
}

.fp-actions #fpCancel {
  flex: 1;
}

.fp-actions #fpHere {
  flex: 2;
}

.fab-count {
  font-family: 'Inter', sans-serif;
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.5px;
}

.fab-count.long {
  font-size: 16px;
}

.searchbar .sel-fab {
  flex: none;
  width: 48px;
  height: 48px;
  min-height: 0;
  align-self: center;
  padding: 0;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.searchbar > button[hidden] {
  display: none !important;
}

.acm-fan {
  display: flex;
  justify-content: center;
  margin: 6px 0 10px;
}

.acm-fan img {
  width: 74px;
  border-radius: 5px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.acm-fan img + img {
  margin-left: -44px;
}

.fw-wrap {
  position: fixed;
  inset: 0;
  z-index: 210;
  pointer-events: none;
}

.fw-p {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 8px rgba(255, 220, 140, 0.8);
}

.trade-verdict {
  font-size: 15.5px;
  font-weight: 700;
}

.trade-verdict.even {
  color: var(--ink-text);
}

.ta-tile {
  cursor: pointer;
  text-align: left;
  padding: 0;
  font-family: 'Inter';
  color: var(--ink-text);
}

.ta-tile .st-body {
  width: 100%;
  box-sizing: border-box;
}

.tp-set {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
}

.tp-sub {
  font-size: 11.5px;
  color: var(--sub-text);
  margin: 1px 0 2px;
}

.glog-cname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.glog-sheet {
  width: 100%;
  max-width: 560px;
  min-height: min(94vh, 940px);
  max-height: 94vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--ink);
  border: 2px solid var(--line);
  border-radius: 16px 16px 0 0;
  padding: 10px 12px 16px;
  -webkit-overflow-scrolling: touch;
}

.glog-form {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 6px;
}

.glog-frow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.glog-lbl {
  flex: 0 0 84px;
  font-size: 13px;
  color: var(--sub-text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.glog-frow .seg {
  flex: 1;
  display: flex;
  gap: 6px;
}

.glog-frow .seg button {
  flex: 1;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  color: var(--ink-text);
  border-radius: 8px;
  padding: 9px 4px;
  font-size: 14px;
  cursor: pointer;
}

.glog-frow .seg button.active {
  border-color: var(--scheme-accent);
  color: var(--ink-text);
  background: color-mix(in srgb, var(--scheme-accent) 8%, transparent);
}

.glog-sel,
.glog-num {
  flex: 1;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  color: var(--ink-text);
  border-radius: 8px;
  padding: 10px;
  font-size: 15px;
  min-width: 0;
}

.glog-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.glog-chip {
  background: var(--field);
  border: 1.5px solid var(--field-line);
  border-radius: 10px;
  padding: 7px 11px;
  font-size: 12px;
  color: var(--sub-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.glog-chip b {
  font-size: 16px;
  color: var(--ink-text);
}

.glog-tally {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.glog-tally-h {
  font-size: 12px;
  color: var(--sub-text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-right: 2px;
}

.glog-tag {
  background: color-mix(in srgb, var(--brass) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--scheme-accent) 40%, transparent);
  color: var(--ink-text);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 13px;
}

.glog-tag.weak {
  background: rgba(200, 90, 90, 0.1);
  border-color: rgba(200, 90, 90, 0.45);
  color: #d98c8c;
}

.glog-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column-reverse;
}

.glog-row {
  cursor: pointer;
}

.glog-detail {
  display: none;
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--sub-text);
  line-height: 1.6;
}

.glog-row.open .glog-detail {
  display: block;
}

.glog-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 7px 2px;
  border-top: 2px solid var(--line);
}

.glog-res {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}

.glog-res.w {
  background: rgba(120, 190, 120, 0.15);
  color: #8fd08f;
  border: 1px solid rgba(120, 190, 120, 0.4);
}

.glog-res.l {
  background: rgba(200, 90, 90, 0.12);
  color: #d98c8c;
  border: 1px solid rgba(200, 90, 90, 0.4);
}

.glog-mid {
  flex: 1;
  min-width: 0;
}

.glog-line1 {
  font-size: 13.5px;
  color: var(--ink-text);
}

.glog-line2 {
  font-size: 13px;
  color: var(--ink-text);
  margin-top: 1px;
}

.glog-note {
  font-size: 13px;
  color: var(--sub-text);
  margin-top: 2px;
  white-space: pre-wrap;
}

.glog-del {
  flex: none;
  opacity: 0.6;
}

/* Source: styles/pages/matchups.css */
/* The 60s' deck header: description left, play log right. */

.dl60-log {
  gap: 8px;
}

.dl60-form {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.dl60-form .glog-res {
  width: 22px;
  height: 22px;
  font-size: 12px;
  border-radius: 6px;
}

.dl60-wr {
  font-size: 14px;
  color: var(--ink-text);
}

.dl60-wr b {
  color: var(--ink-text);
}

.dl60-mu {
  width: 100%;
  padding: 7px 8px;
  font-size: 12.5px;
  text-align: left;
}

.dl60-logrow {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 46px 0 0;
  background: none;
  border: 0;
  border-top: 2px solid var(--line);
  color: var(--ink-text);
  font: inherit;
  font-size: 14px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.dl60-logrow .dl-mini-add {
  margin-left: 0;
  pointer-events: none;
}

/* Matchups: chips wrap-reverse (best pick bottom-left), rows open upward. */

#muOverlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.opp-chips {
  display: flex;
  flex-wrap: wrap-reverse;
  gap: 6px;
}

.opp-chips:empty {
  display: none;
}

.opp-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--field);
  border: 1.5px solid var(--field-line);
  color: var(--ink-text);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12.5px;
  cursor: pointer;
  max-width: 100%;
}

.opp-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opp-chip small {
  color: var(--sub-text);
  font-size: 11px;
}

.opp-chip.plan {
  border-color: var(--scheme-accent);
  font-weight: 600;
}

.opp-chip svg {
  flex: none;
}

.mu-quick-h {
  font-size: 12px;
  color: var(--sub-text);
  margin: 0 0 6px;
}

#muQuick {
  margin-bottom: 6px;
}

.mu-list {
  display: flex;
  flex-direction: column-reverse;
}

.mu-row {
  display: flex;
  flex-direction: column-reverse;
  border-top: 2px solid var(--line);
}

.mu-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 2px;
  cursor: pointer;
}

.glog-res.mu-rec {
  width: auto;
  min-width: 34px;
  padding: 0 6px;
  font-size: 13px;
}

.glog-res.none {
  background: var(--field);
  color: var(--sub-text);
  border: 1px solid var(--field-line);
}

.mu-name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--ink-text);
}

.mu-name b {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mu-name small {
  color: var(--sub-text);
  font-size: 11.5px;
  flex: none;
}

.mu-name svg {
  flex: none;
}

.mu-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--sub-text);
  flex: none;
}

.mu-chev {
  color: var(--sub-text);
  flex: none;
  font-size: 20px;
  line-height: 1;
}

.mu-detail {
  display: none;
  padding: 6px 2px 2px;
}

.mu-row.open .mu-detail {
  display: block;
}

/* The open plan and its head read as one block: the plan sits ABOVE its head. */

.mu-row.open {
  background: color-mix(in srgb, var(--brass) 9%, transparent);
  border-radius: 10px;
  padding: 0 8px;
  margin: 0 -8px;
}

.mu-sec {
  margin: 0 0 9px;
}

.mu-sec-h {
  font-size: 12px;
  color: var(--sub-text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 3px;
}

.mu-txt {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-text);
  overflow-wrap: anywhere;
}

.mu-sbline,
.mu-sbtags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mu-sb {
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 12.5px;
}

.mu-sb.in {
  background: rgba(120, 190, 120, 0.13);
  border: 1px solid rgba(120, 190, 120, 0.4);
  color: #8fd08f;
}

.mu-sb.out {
  background: rgba(200, 90, 90, 0.1);
  border: 1px solid rgba(200, 90, 90, 0.45);
  color: #d98c8c;
}

.mu-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}

.mu-btns .danger-ghost {
  color: var(--danger);
  border-color: var(--danger);
}

.mu-ta {
  font-family: inherit;
  min-height: 64px;
  margin-bottom: 0;
}

.mu-sbh {
  font-size: 13px;
  color: var(--sub-text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 4px;
}

.mu-sbh .bad {
  color: var(--danger);
  text-transform: none;
  letter-spacing: 0;
}

.mu-sbblock {
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
}

.mu-sbrow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mu-sbrow .mu-sbtags {
  flex: 1;
  min-width: 0;
}

.mu-pickbtn {
  flex: none;
  padding: 7px 10px;
  font-size: 12.5px;
}

.mu-pick {
  display: flex;
  flex-direction: column-reverse;
  max-height: 38vh;
  overflow-y: auto;
  border: 1.5px solid var(--field-line);
  border-radius: 10px;
  padding: 2px 8px;
  background: var(--field);
}

.mu-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-top: 1px solid var(--line);
}

.mu-step-nm {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: var(--ink-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mu-step b {
  min-width: 18px;
  text-align: center;
  color: var(--sub-text);
}

.mu-step.on b,
.mu-step.on .mu-step-nm {
  color: var(--ink-text);
  font-weight: 700;
}

.mu-step .icon-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  flex: none;
}

/* GEEN background:none hier. De .cotd-h-regel schildert de gouden letter
   met een gradient ACHTERGROND en een doorzichtige letterkleur; de
   achtergrond weghalen maakte de knop letterlijk onzichtbaar. */

.cotd-h-btn {
  border: 1px solid transparent;
  cursor: pointer;
  border-radius: 8px;
  padding: 4px 12px;
  transition: border-color 0.15s;
}

.cotd-h-btn:active {
  border-color: var(--scheme-accent);
}

.cotd-h {
  font-family: 'Cinzel', serif;
  color: var(--ink-text);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 10px;
}

.cotd img {
  width: min(78%, 280px);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  background: #0006;
  aspect-ratio: 63/88;
}

.cotd .cotd-nm {
  font-size: 14.5px;
  font-weight: 700;
  margin-top: 10px;
}

.cotd .cotd-tl {
  font-size: 12px;
  color: var(--sub-text);
  margin-top: 2px;
}

.cotd .cotd-add {
  margin-top: 10px;
  background: var(--acc-fill);
  color: var(--on-acc);
  border: none;
  border-radius: 8px;
  padding: 9px 22px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
}

/* Source: styles/pages/browse-life-tools.css */
/* ---------- browse (Inspiration) page ---------- */

.browse-hero {
  text-align: center;
  margin: 4px 0 22px;
}

#inspFeed {
  text-align: left;
}

.if-winrow {
  order: 5;
  display: flex;
  gap: 8px;
  margin: 8px 0 6px;
}

.if-winrow .if-win {
  flex: 1;
  padding: 8px 0;
  font-size: 13.5px;
}

.if-winrow .if-win.active {
  font-weight: 700;
}
/* colour comes from the one shared selected state */

#inspFeed .if-sec {
  margin-top: 14px;
}

#inspFeed .sr-grid {
  margin-top: 0;
  margin-bottom: 8px;
}

.if-tile {
  padding: 0;
  cursor: pointer;
}

.bh-logo {
  width: 92px;
  height: 92px;
  cursor: pointer;
  margin: 0 auto 8px;
  animation: logoIdle 3.4s ease-in-out infinite;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.5));
}

.browse-hero h2 {
  font-family: 'Cinzel', serif;
  font-size: 17px;
  color: var(--ink-text);
  margin: 0;
}

.browse-hero p {
  font-size: 12.5px;
  color: var(--sub-text);
  margin: 4px auto 0;
  max-width: 340px;
  line-height: 1.5;
}

.inspire-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--panel);
  border: 2px solid var(--line);
  color: var(--ink-text);
  padding: 11px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 12px;
}

.inspire-cta:hover {
  border-color: var(--scheme-accent);
}

/* ---------- deck history ---------- */

.hist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 2px solid var(--line);
  font-size: 13px;
  min-width: 0;
}

.hist-txt {
  min-width: 0;
  flex: 1;
}

.ht-n {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ht-n.card-link {
  cursor: pointer;
  text-decoration: underline dotted color-mix(in srgb, var(--brass) 45%, transparent);
  text-underline-offset: 3px;
}

.hist-row:last-child {
  border-bottom: none;
}

.hist-ico {
  flex: 0 0 auto;
  width: 18px;
  text-align: center;
}

.hist-txt {
  flex: 1;
  min-width: 0;
}

.hist-txt .ht-n {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hist-txt .ht-s {
  font-size: 11px;
  color: var(--sub-text-2);
  margin-top: 1px;
}

.hist-row.undone .ht-n {
  text-decoration: line-through;
  opacity: 0.5;
}

.undo-btn {
  flex: 0 0 auto;
  background: none;
  border: 2px solid var(--line);
  color: var(--sub-text);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
  cursor: pointer;
  font-weight: 600;
}

.undo-btn:hover {
  border-color: var(--scheme-accent);
  color: var(--ink-text);
}

.hist-more {
  width: 100%;
  margin-top: 8px;
  background: none;
  border: 2px solid var(--line);
  color: var(--head-ink);
  border-radius: 8px;
  padding: 8px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}

.life-card-v2 {
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--panel);
  border: none;
  border-radius: inherit;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.life-face {
  width: 100%;
  height: 100%;
  padding: 14px;
  text-align: center;
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.life-face.front {
  padding-bottom: 66px;
}

.life-face.sub {
  justify-content: space-between;
  padding: 10px 9px;
  overflow: hidden;
}

.sub-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 56px;
}

.life-face.front.defeated .lval2 {
  opacity: 0.25;
}

.lval2.ghosted {
  pointer-events: none;
}

.pname-input {
  position: relative;
  z-index: 2;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 16.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  margin: 0 auto 4px;
  font-family: 'Inter';
  width: auto;
  max-width: 85%;
  min-width: 30px;
  field-sizing: content;
  display: block;
  padding: 2px 4px;
}

.pname-input:focus {
  outline: none;
  color: #fff;
}

.lval2 {
  position: relative;
  font-family: 'Cinzel', serif;
  font-size: 44px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  cursor: pointer;
  padding: 2px 10px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#lifeMenuShield {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: transparent;
}

.tap-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.tap-zone.left {
  left: 0;
  justify-content: flex-start;
  padding-left: 10px;
}

.tap-zone.right {
  right: 0;
  justify-content: flex-end;
  padding-right: 10px;
}

.tap-zone:active {
  background: rgba(0, 0, 0, 0.12);
}

.tap-glyph {
  font-size: 34px;
  color: rgba(255, 255, 255, 0.65);
  pointer-events: none;
}

.lbtn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--scheme-accent);
  background: var(--ink-2);
  color: var(--ink-text);
  font-size: 17px;
  cursor: pointer;
}

.lbtn.sm {
  width: 60px;
  height: 60px;
  font-size: 28px;
}

.submenu-toggle {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: 26px;
  padding: 15px 36px;
  font-size: 20px;
  cursor: pointer;
  margin-top: 10px;
  -webkit-tap-highlight-color: transparent;
}

.submenu-toggle.back {
  position: static;
  transform: none;
  align-self: flex-start;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 10px;
  background: none;
  border: none;
  padding: 2px 4px;
}

/* 1.46 monarch, dungeons, judge popup, restore */

.lmonarch {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  width: clamp(30px, 17cqmin, 60px);
  color: var(--ink-text);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
  pointer-events: none;
  line-height: 0;
}

.lmonarch svg {
  width: 100%;
  height: auto;
  display: block;
}

.ldungeon {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 70%;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
  white-space: nowrap;
}

.ldungeon svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.ldungeon span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.lf-extras {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: 12px;
  justify-content: center;
  pointer-events: none;
}

.lf-x {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  cursor: pointer;
}

.lf-x svg {
  width: 22px;
  height: 22px;
  flex: none;
}

.lf-x span {
  display: none;
}

.lf-x.on {
  border-color: var(--scheme-accent);
  color: var(--ink-text);
  background: rgba(0, 0, 0, 0.45);
}

.dg-sheet {
  gap: 10px;
  max-height: 88vh;
  overflow-y: auto;
}

.dg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dg-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.dg-card.big {
  cursor: default;
  width: min(100%, 380px);
  margin: 0 auto;
}

.dg-pic {
  position: relative;
  aspect-ratio: 488/680;
  border-radius: 4.75% / 3.5%;
  overflow: hidden;
  background: #111;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.dg-pic img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dg-noimg-name {
  display: none;
}

.dg-pic.noimg img {
  display: none;
}

.dg-pic.noimg .dg-noimg-name {
  display: block;
  position: absolute;
  top: 4%;
  left: 0;
  right: 0;
  text-align: center;
  font-weight: 800;
  color: var(--ink-text);
  font-size: 13px;
}

.dg-spot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 14px;
  min-height: 14px;
  padding: 0;
  border: none;
  background: none;
}

.dg-card.big .dg-spot {
  width: 30%;
  height: 9%;
  border-radius: 8px;
  cursor: pointer;
}

.dg-card.big .dg-spot.next {
  box-shadow:
    0 0 0 2.5px var(--scheme-accent),
    0 0 14px color-mix(in srgb, var(--scheme-accent) 55%, transparent);
  background: rgba(240, 200, 90, 0.12);
}

.dg-spot-name {
  display: none;
}

.dg-pic.noimg .dg-spot {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.dg-card.big .dg-pic.noimg .dg-spot-name {
  display: block;
  font-size: 9.5px;
  color: #fff;
  line-height: 1.1;
  text-align: center;
}

.dg-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--pc) 75%, white);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  flex: none;
}

.dg-card:not(.big) .dg-dot {
  width: 11px;
  height: 11px;
  border-width: 1.5px;
}

.dg-dot.me {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 1px;
}

.dg-card.big .dg-dot {
  width: 18px;
  height: 18px;
}

.dg-done {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

.dg-donechip {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: color-mix(in srgb, var(--pc) 70%, black);
  border-radius: 999px;
  padding: 2px 8px;
}

.dg-players {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.dg-pl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink-text);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.dg-pl.on {
  border-color: var(--scheme-accent);
  box-shadow: 0 0 0 1px var(--scheme-accent);
}

.dg-pl .dg-dot {
  width: 12px;
  height: 12px;
}

.dg-actions {
  display: flex;
  gap: 8px;
}

.dg-actions > * {
  flex: 1 1 0;
  margin: 0;
}

.br-title b svg {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
}

.life-set-pair {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.life-set-pair .ghost-btn {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  font-size: 13px;
  padding: 10px 6px;
}

.lr-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  text-align: left;
  width: 100%;
  margin: 0;
}

.lr-row span {
  font-size: 12px;
  color: var(--sub-text);
  font-weight: 500;
  white-space: normal;
}

.lr-row.cur {
  border-color: var(--scheme-accent);
}

#crScrim {
  position: fixed;
  inset: 0;
  z-index: 9599;
  background: rgba(0, 0, 0, 0.55);
}

#crOverlay.cr-popup {
  inset: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, 94vw);
  height: min(78vh, 680px);
  border: 2px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* 1.48 the winner's card */

.life-card-v2.winner {
  box-shadow:
    0 0 0 3px var(--scheme-accent),
    0 0 28px color-mix(in srgb, var(--scheme-accent) 75%, transparent);
  animation: winGlow 1.6s ease-in-out infinite;
}

@keyframes winGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 3px var(--scheme-accent),
      0 0 18px color-mix(in srgb, var(--scheme-accent) 50%, transparent);
  }
  50% {
    box-shadow:
      0 0 0 4px var(--scheme-accent),
      0 0 42px color-mix(in srgb, var(--scheme-accent) 95%, transparent);
  }
}

.win-banner {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  padding: 5px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f6da82, #c9982e);
  color: #111;
  font-weight: 900;
  font-size: clamp(13px, 6cqmin, 20px);
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  animation:
    winPop 0.9s cubic-bezier(0.2, 1.6, 0.4, 1) both,
    winBob 2.4s 0.9s ease-in-out infinite;
  pointer-events: none;
}

@keyframes winPop {
  from {
    transform: translateX(-50%) scale(0.2);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
}

@keyframes winBob {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-5px);
  }
}

.win-fx {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
}

.win-fx i {
  position: absolute;
  bottom: -12px;
  left: calc(4% + var(--i) * 6.7%);
  width: 7px;
  height: 12px;
  border-radius: 2px;
  background: hsl(calc(var(--i) * 47), 85%, 62%);
  opacity: 0;
  animation: winRise calc(2.2s + var(--i) * 0.13s) calc(var(--i) * 0.17s) linear infinite;
}

@keyframes winRise {
  0% {
    transform: translateY(0) rotate(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translateY(-110cqh) rotate(540deg);
    opacity: 0;
  }
}

.medal-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 27px;
  line-height: 1;
  z-index: 2;
  color: var(--ink-text);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.life-card-v2.medal-alt .medal-badge {
  right: auto;
  left: 10px;
}

.defeat-banner {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  z-index: 3;
}

.defeat-banner .dtxt {
  font-size: 12.5px;
  color: #ffb3b8;
  text-align: center;
  font-style: italic;
}

.revive-btn {
  background: none;
  border: 2px solid var(--line);
  color: var(--sub-text);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

.back-h {
  width: 100%;
  text-align: left;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 4px 0 3px;
}

.focus-name {
  font-size: 11px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* One size for the status pill and the Done pill: the same absolute spot at
   the card's foot, the same height and minimum width. */

.submenu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 58px;
  min-width: 132px;
  padding: 0 18px;
  box-sizing: border-box;
  white-space: nowrap;
  margin-top: 0;
}

.submenu-toggle.back {
  height: auto;
  min-width: 0;
  display: inline-block;
}

.submenu-toggle.done {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.45);
  font-weight: 700;
  font-size: 19px;
}

.lb-grp {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 21px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.8);
}

.lb-grp svg {
  flex: none;
}

.lb-grp.cd.hit {
  color: color-mix(in srgb, var(--lbc, #fff) 72%, #fff);
}

.lb-grp.danger b {
  color: #ff8a8a;
}

.pz-face .focus-name {
  position: relative;
  z-index: 2;
  pointer-events: none;
  font-size: 13px;
  margin: 0 0 6px;
}

.pz-label {
  position: relative;
  z-index: 2;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  text-align: center;
  margin: 0 auto 2px;
}

.lval2.pz-val {
  pointer-events: none;
  cursor: default;
}

.lval2.pz-val.danger {
  color: #ff8a8a;
}

.life-face.sub .mini-row {
  margin-bottom: 2px;
}

.lval2.ghosted {
  opacity: 0.18;
}

.dmg-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(6, 16, 26, 0.74);
  backdrop-filter: blur(1px);
  cursor: pointer;
  border: 2px dashed rgba(255, 255, 255, 0.28);
  border-radius: inherit;
  -webkit-tap-highlight-color: transparent;
}

.dmg-overlay:active {
  background: rgba(6, 16, 26, 0.62);
}

.dmg-overlay.lethal {
  border-color: #ff8a8a;
  box-shadow: inset 0 0 0 2px rgba(255, 138, 138, 0.35);
}

.dmg-ov-label {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  padding: 0 6px;
  line-height: 1.3;
}

.dmg-ov-val {
  font-family: 'Cinzel', serif;
  font-size: 40px;
  font-weight: 700;
  color: #fff;
  line-height: 1.05;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.dmg-overlay.lethal .dmg-ov-val {
  color: #ff8a8a;
}

.dmg-ov-hint {
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.45);
}

.dmg-hint {
  width: 100%;
  text-align: left;
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.6);
  margin: 4px 0 4px;
  line-height: 1.35;
}

.dmg-hint strong {
  color: #fff;
}

.back-h {
  font-size: 11px;
  color: var(--ink-text);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 6px 0 6px;
  text-align: left;
}

.mini-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.mini-row .dmg-lbl {
  flex: 1;
  font-size: 12px;
  color: var(--sub-text);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-val {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 34px;
  min-width: 52px;
  text-align: center;
  color: #fff;
}

.mini-val.danger {
  color: var(--danger);
  font-weight: 700;
}

.dmg-list {
  max-height: 120px;
  overflow-y: auto;
}

#lifeMenuShield {
  position: fixed;
  inset: 0;
  z-index: 255;
  background: rgba(0, 0, 0, 0.55);
}

.life-grid-v2 {
  position: relative;
}

#lifeCogBtn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 8;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ink-deep);
  border: 2px solid var(--brass);
  color: var(--ink-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
}

#lifeCogBtn svg {
  width: 34px;
  height: 34px;
}

.life-nav {
  flex: 0 0 auto;
}

.life-panel {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 0;
}

.life-panel h4 {
  font-family: 'Cinzel', serif;
  color: var(--ink-text);
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 8px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 2px solid var(--line);
  font-size: 13.5px;
  gap: 10px;
}

.toggle-row:last-child {
  border-bottom: none;
}

.history-list {
  max-height: 220px;
  overflow-y: auto;
  font-size: 12.5px;
  color: var(--sub-text);
  display: flex;
  flex-direction: column-reverse;
}

.history-list div {
  padding: 5px 0;
  border-bottom: 2px solid var(--line);
}

.history-list div:last-child {
  border-bottom: none;
}

/* Source: styles/interaction.css */
/* Long-press text selection only where it has a use: card text, rulings,
   and editable fields. Everywhere else a long-press is never meant as
   "select this label", so selection is off app-wide by default. */

html,
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Nothing in the app is dragged the browser's way. On Android a long-press on
   a card image could start a system drag; when that drag never finished, no
   tap reached the app any more (the "frozen after a long-press" bug). */

img,
a {
  -webkit-user-drag: none;
  user-drag: none;
}

input,
textarea,
[contenteditable='true'] {
  -webkit-user-select: text;
  user-select: text;
}

.sel-text,
.sel-text * {
  -webkit-user-select: text;
  user-select: text;
}

/* Every card image everywhere — grids, tiles, previews, the detail view —
   gets the authentic rounded card corner. One rule, keyed on Scryfall's image
   host, so no component can ever ship square white corners again. The ratio
   matches a real card's corner (Scryfall's own recommendation). */

img[src*='scryfall.io'] {
  border-radius: 4.75% / 3.43%;
  background: #111112;
}

/* Universes Beyond marker on card views */

.gc-mark {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 24px 24px 0 0;
  border-color: #e07818 transparent transparent transparent;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.45));
}

.gc-mark span {
  position: absolute;
  top: -22px;
  left: 1px;
  transform: rotate(-45deg);
  transform-origin: center;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #fff;
  font-family: 'Inter', sans-serif;
}

.gc-inline {
  display: inline-block;
  background: #e07818;
  color: #fff;
  border-radius: 3px;
  padding: 0 4px;
  font-size: 11px;
  font-weight: 800;
  vertical-align: 1px;
}

.ub-mark {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 2;
  background: linear-gradient(135deg, #7b5cd6, #4a2f96);
  color: #fff;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 1px 3px;
  border-radius: 4px;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.col-mark {
  position: absolute;
  bottom: 4px;
  left: 4px;
  z-index: 2;
  background: linear-gradient(135deg, #1f9a63, #0e5c3a);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

*:has(> .col-mark) {
  position: relative;
}

.pv-mark {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  background: linear-gradient(135deg, #c77b22, #8f5313);
  color: #fff;
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 1px 3px;
  border-radius: 4px;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

*:has(> .pv-mark) {
  position: relative;
}

img[src*='cards.scryfall.io'] {
  border-radius: 4.75% / 3.5%;
}

img.wb-card {
  border-radius: 0 !important;
  background: #fff !important;
}

*:has(> .ub-mark) {
  position: relative;
}

/* Corner ribbons (GC-style): UB folds over the top-left card corner, SPOILER
   over the top-right — a diagonal sliver instead of a pill, so the card name
   and the mana cost stay readable underneath. */

.ub-corner {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 32px 32px 0 0;
  border-color: #5b3fb8 transparent transparent transparent;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.45));
}

.ub-corner span {
  position: absolute;
  top: -29px;
  left: 2px;
  transform: rotate(-45deg);
  transform-origin: center;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #fff;
  font-family: 'Inter', sans-serif;
}

*:has(> .ub-corner) {
  position: relative;
}

.pv-corner {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 34px 34px 0;
  border-color: transparent #c77b22 transparent transparent;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(-1px 1px 2px rgba(0, 0, 0, 0.45));
}

.pv-corner span {
  position: absolute;
  top: 6px;
  left: 5px;
  transform: rotate(45deg);
  transform-origin: center;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #fff;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}

*:has(> .pv-corner) {
  position: relative;
}

/* Source: styles/responsive.css */
/* ---------- Large screens (tablet / desktop): full-width, Moxfield-style.
   Content spans up to 1200px; card grids multiply into many columns on their
   own (auto-fill rules above), while forms and text keep readable widths.
   Purely automatic by screen size — phones never see any of this. */

@media (min-width: 760px) {
  html {
    background:
      radial-gradient(
        ellipse at 20% -10%,
        color-mix(in srgb, var(--brass) 9%, transparent),
        transparent 45%
      ),
      radial-gradient(ellipse at 100% 0%, rgba(92, 139, 158, 0.1), transparent 40%), var(--ink);
  }
  body {
    max-width: 1200px;
    margin: 0 auto;
    background: transparent;
  }
  main {
    padding-left: 24px;
    padding-right: 24px;
  }
  .brand-banner {
    width: 100%;
    margin-left: 0;
    padding: 0 20px;
  } /* undo the full-bleed 100vw trick */
  .deck-dock {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    padding-left: 20px;
    padding-right: 20px;
  }
  .deck-fab {
    right: max(16px, calc(50vw - 600px + 20px));
  }
  #fabMenu {
    right: max(16px, calc(50vw - 600px + 20px));
  }
  /* Wide where width helps, narrow where reading matters */
  .settings-main {
    max-width: 760px;
    margin: 0 auto;
  }
  .adv-panel {
    max-width: 820px;
  }
  .searchbar {
    max-width: 820px;
  }
  .adv-toggle {
    max-width: 820px;
    display: block;
  }
  .cotd img {
    max-width: 340px;
  }
  /* Every card list: fixed phone-sized tiles, columns grow with the window,
     capped at six by the 1200px shell (a 7th would need ~1344px). */
  .sr-grid,
  .sc-grid,
  .visual-grid,
  .col-grid,
  .deck-grid {
    justify-content: flex-start;
  }
  .sr-grid > *,
  .sc-grid > *,
  .visual-grid > *,
  .col-grid > *,
  .deck-grid > * {
    flex: 0 0 180px;
    max-width: 180px;
  }
  .pair-grid {
    grid-template-columns: repeat(auto-fill, 236px);
    justify-content: flex-start;
  }
}

/* ---------- 1.23: wide screens (>= 1000px: PC, laptop, tablet in landscape) ----------
   The navigation becomes a SIDEBAR on the left; every page and overlay uses
   the full width beside it. Still bottom-up: Home and Back sit at the foot of
   the sidebar (where the thumb found them on the phone), the page tabs above.
   --nav-h drops to 0, so everything that stood on the bottom bar now stands
   on the bottom edge. Every left-anchored fixed bar starts after the sidebar. */

/* 1.23-1.27 sidebar layout replaced by desk mode (1.28), at the end of the styles. */

/* Source: styles/surfaces.css */
/* Depth fade: every solid surface — panels, tiles, fields, pop-ups — runs
   from its colour at the top into a slight black at its foot, and the page
   itself does the same (see body). Sits at the END of the stylesheet so its
   background-image outranks the components' own shorthands; states with
   higher specificity (hover, .sel) intentionally paint flat. Generated from
   the same scan as the surface-text rule. */

.app > main > .adv-toggle,
.app > main > .adv-panel,
.app > main > #colAdvBox,
.tw-row,
.brand-banner #capBack,
.brand-banner .ov-back,
.oracle-face,
.tag-editor,
.hfm-chip,
.home-fact,
.deck-tile,
.folder-tile,
.ghost-btn,
.bulk-textarea,
.panel-card,
.col-filter-input,
.col-select,
#bindersPop,
#fabMenu,
.pd-btn,
.pd-panel,
.searchbar input,
.appoint-sheet,
.appoint-row,
.pair-btns .add-btn,
.sp-jump-btn,
.adv-toggle,
.cmc-row select,
.cmc-row input,
.adv-row input[type='text'],
.adv-row select,
.sc-primer,
.sc-list,
.sr-tile .st-btns .add-btn,
.pr-rail,
.cselect-btn,
.cselect-panel,
.cselect-search,
.cselect-search input,
.bs-row select,
.settings-section,
.guild-opt,
.menu-pop,
.toast,
.dp-row,
.cr-bar input,
.tr-qty button,
.edh-jump,
.edh-rel-chip,
.glog-frow .seg button,
.glog-sel,
.glog-num,
.glog-chip,
.inspire-cta,
.life-card-v2,
.life-panel {
  background-image: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.25) 100%);
}

/* Scheme rims: the accent gradient is clipped to the border-box,
   which covers the WHOLE element — so each element repaints its interior
   opaquely in its own surface token as the middle layer, and the metal
   survives only in the border ring. Grouped by token, generated from the
   sheet; elements with translucent or no background keep flat borders. */

.tw-row,
.oracle-face,
.tag-editor,
.home-fact,
.home-hero-banner,
.deck-tile,
.panel-card,
.pair-btns .add-btn,
.sc-primer,
.sc-list,
.sr-tile .st-btns .add-btn,
.settings-section,
.dp-row,
.inspire-cta,
.life-panel {
  border-color: transparent;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.25) 100%),
    linear-gradient(var(--panel), var(--panel)),
    linear-gradient(var(--scheme-accent), var(--scheme-accent));
  background-origin: padding-box, padding-box, border-box;
  background-clip: padding-box, padding-box, border-box;
}

.deck-select,
.lg-card,
.ruling,
.tag-add-row input,
.tag-sugg,
.lg-chip,
.pair-cell,
.adv-panel,
.sr-tile,
.chip,
.toggle-switch .track,
.modal-sheet input,
.player-count button,
.life-toolbar button,
.turn-hub,
.deckpick {
  border-color: transparent;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.25) 100%),
    linear-gradient(var(--ink-2), var(--ink-2)),
    linear-gradient(var(--scheme-accent), var(--scheme-accent));
  background-origin: padding-box, padding-box, border-box;
  background-clip: padding-box, padding-box, border-box;
}

.rpill,
.modal-sheet {
  border-color: transparent;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.25) 100%),
    linear-gradient(var(--ink-3), var(--ink-3)),
    linear-gradient(var(--scheme-accent), var(--scheme-accent));
  background-origin: padding-box, padding-box, border-box;
  background-clip: padding-box, padding-box, border-box;
}

.edh-jump {
  border-color: transparent;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.25) 100%),
    linear-gradient(var(--field), var(--field)),
    linear-gradient(var(--scheme-accent), var(--scheme-accent));
  background-origin: padding-box, padding-box, border-box;
  background-clip: padding-box, padding-box, border-box;
}

.glog-sheet {
  border-color: transparent;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.25) 100%),
    linear-gradient(var(--ink), var(--ink)),
    linear-gradient(var(--scheme-accent), var(--scheme-accent));
  background-origin: padding-box, padding-box, border-box;
  background-clip: padding-box, padding-box, border-box;
}

/* Solid accent buttons: one flat, uniform colour — the sheen retired. */

.new-deck-btn,
.empty-home button,
.need-deck button,
.ghost-btn.active,
.primary-btn,
.deck-fab,
.pair-add,
.searchbar button,
.seg button.active,
.reco-create,
.chip.active,
.modal-actions .confirm,
.player-count button.active,
.reco-fab,
.cotd .cotd-add,
.rt-chip.on {
  background-image: linear-gradient(var(--brass), var(--brass));
}

/* Purple button plates — at the sheet's END so they outrank every component's
   own background:none/var() declared above. */

.banner-tab,
.icon-btn,
.dk-tool,
.dk-arr,
.dk-count,
#lifeCogBtn,
.compass,
.edh-jump,
.brand-banner #capBack,
.brand-banner .ov-back,
.in-chev,
.home-search-btn {
  border-color: transparent;
  background-color: var(--panel);
  background-image:
    linear-gradient(var(--panel), var(--panel)),
    linear-gradient(
      color-mix(in srgb, var(--panel) 50%, #000),
      color-mix(in srgb, var(--panel) 50%, #000)
    );
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
}

.banner-tab.active,
.icon-btn.active,
.dk-tool.active,
.compass.active {
  background-color: var(--ink);
  background-image: none;
  border-color: transparent;
  box-shadow: inset 0 0 0 2.5px var(--head-ink);
}

.banner-tab.active svg,
.icon-btn.active svg,
.dk-tool.active svg,
.compass.active svg {
  color: var(--head-ink);
}

/* Button ICONS read in plain gold everywhere (the accents stay the dark
   side tint for rims and fills); the round + fab and the burger jump wear
   a flat gold face with engraved dark marks. */

/* Button icons wear the MAIN colour of the chosen pairing — main ink on
   side-coloured plates, the same contrast logic as everywhere else. */

.banner-tab svg,
.icon-btn svg,
.dk-tool svg,
.compass svg {
  color: var(--icon-pl);
}

.deck-fab,
.reco-fab,
.searchbar .sel-fab {
  background-image: linear-gradient(var(--gold), var(--gold));
  color: #111;
}

/* Field faces flip to the MAIN colour when they sit on a SECONDARY surface:
   a button inside a panel wears the page ink, standing off its card exactly
   as the secondary plates stand off the main-coloured bars. The main-role
   aliases are frozen at the html element — custom properties inherit their
   COMPUTED value, so panel-level re-points can't reach them. */

html {
  --main-field: var(--ink-2);
  --main-field-line: var(--line);
  --main-hl: var(--glow);
  --main-text: var(--ink-text);
  --main-sub: var(--sub-text);
  --main-sub-2: var(--sub-text-2);
  --main-brass: var(--brass);
  --main-brass-dim: var(--brass-dim);
  --main-brass-glow: var(--brass-glow);
  --main-parchment: var(--parchment);
  --main-parchment-dim: var(--parchment-dim);
  --main-acc-fill: var(--acc-fill);
  --main-on-acc: var(--on-acc);
}

:is(
    .panel-card,
    .settings-section,
    .adv-panel,
    #colAdvBox,
    .dl-cover,
    .pd-panel,
    .cselect-panel,
    .sc-primer,
    .sc-list,
    .life-panel,
    .life-card-v2,
    .deck-tile,
    .folder-tile,
    .pr-rail,
    .home-fact,
    .oracle-face,
    .tag-editor,
    .appoint-sheet
  )
  :is(
    .ghost-btn,
    .icon-btn,
    .dk-tool,
    .rt-chip,
    .chip,
    .col-filter-input,
    .col-select,
    .pd-btn,
    .adv-toggle,
    .cselect-btn,
    .cselect-search,
    .dp-row,
    .tr-qty button,
    .edh-rel-chip,
    .edh-jump,
    .glog-sel,
    .glog-num,
    .glog-chip,
    .hfm-chip,
    .sp-jump-btn,
    .inspire-cta,
    .appoint-row,
    .bulk-textarea,
    select,
    input,
    textarea,
    .seg button,
    .add-btn
  ) {
  --field: var(--main-field);
  --field-line: var(--main-field-line);
  --hl: var(--main-hl);
  --ink-text: var(--main-text);
  --sub-text: var(--main-sub);
  --sub-text-2: var(--main-sub-2);
  --brass: var(--main-brass);
  --brass-dim: var(--main-brass-dim);
  --brass-glow: var(--main-brass-glow);
  --parchment: var(--main-parchment);
  --parchment-dim: var(--main-parchment-dim);
  --line: var(--main-field-line);
  /* a chosen seg / chip / button inside a panel is filled with the PAGE accent,
     so its letters take the page's ink too (was the panel's dark ink: dark on
     dark, e.g. the language switch in Extras) */
  --acc-fill: var(--main-acc-fill);
  --on-acc: var(--main-on-acc);
}

/* ...except on a white side: its tan accent reads best with the dark ink */

html[data-side='W'] {
  --main-on-acc: #111;
}

:is(
    .panel-card,
    .settings-section,
    .adv-panel,
    #colAdvBox,
    .dl-cover,
    .pd-panel,
    .cselect-panel,
    .sc-primer,
    .sc-list,
    .life-panel,
    .life-card-v2,
    .deck-tile,
    .folder-tile,
    .pr-rail,
    .home-fact,
    .oracle-face,
    .tag-editor,
    .appoint-sheet
  )
  :is(.icon-btn, .dk-tool, .banner-tab) {
  background-color: var(--main-field);
  background-image:
    linear-gradient(var(--main-field), var(--main-field)),
    linear-gradient(var(--brass), var(--brass));
}

:is(
    .panel-card,
    .settings-section,
    .adv-panel,
    #colAdvBox,
    .dl-cover,
    .pd-panel,
    .cselect-panel,
    .sc-primer,
    .sc-list,
    .life-panel,
    .life-card-v2,
    .deck-tile,
    .folder-tile,
    .pr-rail,
    .home-fact,
    .oracle-face,
    .tag-editor,
    .appoint-sheet
  )
  .rt-chip:not(.on) {
  background: var(--main-field);
  border-color: var(--main-field-line);
  color: var(--main-text);
}

/* The table's centre cog wears flat gold with an engraved dark gear. */

html[data-main='W'] .folder-face,
html[data-main='W'] .folder-name,
html[data-main='W'] .deck-tile .dt-bracket,
html[data-main='W'] .life-panel h4,
html[data-main='W'] .life-toolbar button.active {
  -webkit-text-fill-color: currentColor;
}
/* dark tiles under the light theme: gold stays the readable choice */

html[data-main='W'] .dice-opt {
  color: var(--ink-text);
}
/* dice grid rides the light ink there */

#lifeCogBtn {
  background-color: var(--gold);
  background-image:
    linear-gradient(var(--gold), var(--gold)), linear-gradient(var(--main-dk), var(--main-dk));
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
  color: #111;
}

#lifeCogBtn svg,
#lifeCogBtn svg * {
  color: #111;
}

#diceShield,
#lifePanelShield {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: transparent;
}

#dicePop {
  z-index: 261;
}

#diceResultPop {
  width: min(80vw, 320px);
  text-align: center;
  z-index: 262;
  cursor: pointer;
}

.dice-result {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 58px;
  color: #fff;
  line-height: 1.15;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.dice-result.small {
  font-size: 26px;
}

.dice-result-sub {
  font-size: 14px;
  color: var(--sub-text);
  margin-top: 4px;
}

.dice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.dice-opt {
  background: var(--ink-2);
  border: 2px solid color-mix(in srgb, var(--ink-2) 45%, #000);
  border-radius: 12px;
  color: var(--ink-text);
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.dice-opt:active {
  transform: translateY(1px);
}

.home-search-btn svg {
  color: var(--on-acc);
}

#lifeOverlay {
  box-sizing: border-box;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

/* The table fills main to the pixel: main becomes a flex column and the grid
   takes flex:1, replacing the old fixed-height calc that guessed the topbar
   size and left a dead strip above the nav bar. */

#lifeOverlay main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: 10px;
}

#lifeOverlay .life-grid-v2 {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

/* History & Settings float as centred popups over the table (inset+margin
   auto centres inside any containing block, transformed or not); a huge
   spread shadow dims the table behind them; long histories scroll. */

.life-panel {
  position: fixed;
  inset: 0;
  margin: auto;
  z-index: 257;
  width: min(92vw, 520px);
  height: max-content;
  max-height: 72vh;
  overflow-y: auto;
  box-shadow:
    0 0 0 100vmax rgba(0, 0, 0, 0.45),
    0 12px 40px rgba(0, 0, 0, 0.6);
}

main.card-detail {
  zoom: 0.9;
}

/* The card page only ever scrolls up and down. On a phone with a bigger
   system font something on it could poke out a few pixels, which gave the
   page a sideways scrollbar -- the "thicker" green line above the nav bar
   (with a white square where the two scrollbars met). */

.overlay main.card-detail,
main.card-detail {
  overflow-x: hidden;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* 1.27 Deck versions: the newest version nearest the thumb. */

.dv-list {
  display: flex;
  flex-direction: column-reverse;
  max-height: 52vh;
  overflow-y: auto;
  gap: 6px;
  margin: 0 0 8px;
}

.dv-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border-bottom: 1.5px solid var(--line);
}

.dv-row .dv-txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dv-row .dv-txt b {
  font-size: 14px;
  color: var(--ink-text);
}

.dv-row .dv-txt span {
  font-size: 12px;
  color: var(--sub-text);
}

.dv-row .ghost-btn {
  width: auto;
  flex: none;
  padding: 7px 10px;
  font-size: 12.5px;
}

/* 1.26 Sync: the link code, big and easy to read off another screen. */

.sync-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 12px 8px;
  margin: 4px 0 6px;
  border: 2px dashed var(--scheme-accent);
  border-radius: 10px;
  color: var(--ink-text);
  user-select: all;
}

/* 1.26 Right-click popup (PC): the card page's buttons and text in a small
   window by the mouse -- no picture; Legality and Rulings folded. */

.overlay.cs-pop {
  position: fixed;
  inset: auto;
  height: auto;
  z-index: 300;
  border: 2px solid var(--scheme-accent);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
}

.overlay.cs-pop .overlay-inner {
  margin: 0 !important;
  max-width: none !important;
  min-height: 0;
}

.overlay.cs-pop .topbar {
  min-height: 40px;
  padding-left: 12px;
  padding-right: 12px;
}

.overlay.cs-pop .cs-combos-btn {
  position: absolute;
  top: 5px;
  right: 8px;
}

.overlay.cs-pop main.card-detail {
  display: flex !important;
  flex-direction: column;
  max-width: none;
  padding: 6px 12px 10px !important;
  zoom: 0.86;
}

.overlay.cs-pop main.card-detail > div:nth-child(1),
.overlay.cs-pop main.card-detail > .sheet-foot-spacer {
  display: none !important;
}

.overlay.cs-pop main.card-detail > div:nth-child(2) {
  max-width: none !important;
}

.overlay.cs-pop main.card-detail > .detail-sec:not(:has(#sheetOracle)) > .detail-h {
  cursor: pointer;
  user-select: none;
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  margin: 6px 0 0;
  padding: 8px 2px;
  border-top: 1.5px solid var(--line);
}

.overlay.cs-pop main.card-detail > .detail-sec:not(:has(#sheetOracle)) > .detail-h:hover {
  color: var(--ink-text);
}

.overlay.cs-pop main.card-detail > .detail-sec:not(:has(#sheetOracle)) > .detail-h::after {
  content: ' \25B8';
}

.overlay.cs-pop.leg-open
  main.card-detail
  > .detail-sec:not(:has(#sheetOracle)):not(:has(#csRulings))
  > .detail-h::after,
.overlay.cs-pop.rul-open main.card-detail > .detail-sec:has(#csRulings) > .detail-h::after {
  content: ' \25BE';
}

.overlay.cs-pop:not(.leg-open)
  main.card-detail
  > .detail-sec:not(:has(#sheetOracle)):not(:has(#csRulings))
  > :not(.detail-h),
.overlay.cs-pop:not(.rul-open) main.card-detail > .detail-sec:has(#csRulings) > :not(.detail-h) {
  display: none !important;
}

/* 1.25 Tag focus drop-up under the card (Similar cards, card Recommendations). */

.tag-focus-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 340px;
  margin: 2px auto 10px;
  flex: 0 0 auto;
}

.tag-focus-row[hidden] {
  display: none;
}

.tag-focus-row .tf-lbl {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--sub-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-focus-row .nsel-btn {
  flex: 1 1 auto;
}

/* The mouse hover preview: a big card beside the pointer, clicks pass through. */

#hoverPrevBox {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 400;
  display: none;
  pointer-events: none;
  border-radius: 4.75% / 3.5%;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  background: #111;
}

#hoverPrevBox img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

@media (hover: none) {
  #hoverPrevBox {
    display: none !important;
  }
}

.nopr {
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Surfaces the heading tint was never meant for ──────────────────────
   The heading treatment paints text in the page-ink tint. Two places do not
   sit on page ink: the binder GLYPH is printed over cover ART (only a
   near-white halo reads on an arbitrary picture), and the guild label sits
   on a field plate (its panel text colour is the one designed for that).
   Both need -webkit-text-fill-color to outrank the clip-gradient.
   The binder NAME is a third case: it sits on the plate BELOW the art, so
   it takes --plate-ink -- lighter than the page tint on a dark plate,
   darker on the cream one -- and an ordinary shadow. A halo there only
   smeared the letters. */

.binder-tile .folder-face,
.binder-tile .folder-face span {
  color: var(--ink-text);
  -webkit-text-fill-color: currentColor;
  background: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.binder-tile .folder-name {
  color: var(--ink-text);
  -webkit-text-fill-color: currentColor;
  background: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.guild-cur,
.guild-cur svg {
  color: var(--ink-text);
  -webkit-text-fill-color: var(--ink-text);
  background: none;
}

/* Source: styles/desktop.css */
/* ===================== 1.28 DESK MODE (html.desk, 1000 px and wider) =====================
   A PC, a laptop or a tablet on its side reads like a web page: navigation
   at the top, every page opening at its top, lists starting with their best
   item at the top, menus dropping DOWN, dialogs in the middle with a cross.
   The width is calmer too: the content stands in a column of at most
   1240 px (Moxfield-like), and text is a size bigger. The phone keeps its
   bottom-up design -- nothing here applies below 1000 px. */

html.desk {
  --nav-h: 0px;
  --top-nav: 58px;
  --cap-h: 46px;
  --top-h: calc(var(--top-nav) + var(--cap-h));
  --dw: min(1240px, calc(100vw - 48px));
  --dl: max(16px, calc((100vw - var(--dw)) / 2));
}

html.desk body {
  max-width: none;
  margin: 0;
  font-size: 15px;
}

html.desk .app {
  max-width: var(--dw);
}

html.desk main {
  padding-left: 16px;
  padding-right: 16px;
}

html.desk .app > main {
  padding-top: calc(var(--top-h) + 18px) !important;
  padding-bottom: 48px !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
}

html.desk .app > main > * {
  order: 0 !important;
}

html.desk .app > main::before {
  display: none !important;
}

/* ---- the top: navigation row, then the page's title row ---- */

html.desk .brand-banner,
html.desk .overlay .brand-banner.ov-nav {
  position: fixed;
  top: 0;
  bottom: auto;
  left: 0;
  right: 0;
  width: auto;
  height: var(--top-nav);
  max-width: none;
  margin: 0;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  padding: 0 var(--dl);
  border-top: none;
  border-bottom: 2px solid var(--line);
  z-index: 85;
  overflow: visible;
}

html.desk .overlay .brand-banner.ov-nav {
  position: static;
  flex: 0 0 auto;
  order: -10 !important;
}

html.desk .brand-banner .spacer {
  flex: 1 1 auto;
}

html.desk .brand-banner .banner-tabs {
  flex-direction: row;
  gap: 8px;
}

html.desk .brand-banner .banner-tab,
html.desk .brand-banner .compass {
  width: auto;
  height: 40px;
  padding: 0 14px 0 10px;
  gap: 8px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

html.desk .brand-banner .banner-tab svg,
html.desk .brand-banner .compass svg {
  width: 22px;
  height: 22px;
}

html.desk .brand-banner .banner-tab::after,
html.desk .brand-banner .compass::after {
  content: attr(title);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

html.desk .brand-banner .compass {
  border: 2px solid var(--line);
  color: var(--sub-text);
  cursor: pointer;
}

html.desk .brand-banner .compass.active {
  color: var(--ink-text);
  border-color: var(--scheme-accent);
  background: var(--scheme-glow);
}

html.desk #capDeckCount {
  left: var(--dl) !important;
  font-size: 14px !important;
}

html.desk .page-cap .net-chip {
  left: var(--dl);
}

html.desk .page-cap:has(.net-chip) #capDeckCount {
  left: calc(var(--dl) + 96px) !important;
}

html.desk .page-cap .cap-note {
  right: var(--dl);
  font-size: 13px;
}

html.desk .page-cap > span[style*='left:12px'] {
  left: var(--dl) !important;
}

/* ---- overlays: the nav row on top, then their title, the content in the column ---- */

html.desk .overlay .overlay-inner {
  max-width: none !important;
  margin: 0 !important;
}

html.desk .overlay .ov-cap,
html.desk .overlay .overlay-inner > .topbar {
  order: -9 !important;
}

html.desk .overlay main {
  width: 100%;
  max-width: var(--dw);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  padding-bottom: 40px;
}

html.desk [id^='cardSheetOverlay']:not(.sheet-over-overlay):not(.cs-pop) {
  top: var(--top-nav);
  bottom: 0;
  left: 0;
}

html.desk #crOverlay #crBody {
  flex-direction: column;
}

/* ---- every bottom-up list and stack reads top-down ---- */

html.desk
  :where(
    #crOverlay .cr-toc,
    .app > main.settings-main,
    .app > main:has(> div > #deckFilter),
    .adv-panel,
    #colAdvBox,
    .adv-panel .cselect,
    #colAdvBox .cselect,
    .adv-panel .cselect-panel,
    #colAdvBox .cselect-panel,
    .app > main:has(> #colAdvBox),
    #cotdBox,
    .sp-feed,
    .sp-group,
    #builderBody,
    #decklistBox,
    .otag-pop,
    .df-compact .cselect-panel,
    .tag-drop,
    .tag-drop-list,
    .deck-grid.as-list,
    .scan-list,
    .br-dd .br-dd-panel,
    .cat-group,
    .visual-grid.vg-text,
    #colAddSheet .col-addlist,
    .home-news,
    .name-suggest,
    .cselect.cs-foot .cselect-panel,
    .cselect.cs-up > .cselect-panel,
    .browse-selects .cselect > .cselect-panel,
    #recoOverlay .cselect > .cselect-panel,
    .overlay .reco-themes .cselect > .cselect-panel,
    .df-compact .cselect > .cselect-panel,
    #logGameOverlay .cselect > .cselect-panel,
    #nselPop,
    .browse-selects,
    .acc-up [data-banbox] > div:has(> .banlist-grid),
    #recoOverlay main,
    #similarOverlay main,
    #pairPopOverlay main,
    #colAddSheet main,
    #addCollOverlay main,
    #budgetOverlay main,
    #cardRecoOverlay main,
    #metaDeckOverlay main,
    #mdBody,
    .acc-up:not([hidden]),
    .acc-up [data-fmtrule] > div,
    .acc-up [data-banfmt] > div,
    .ub-wrap,
    .ub-switches,
    .acc-up [data-fmtruletxt]:not([hidden]),
    .acc-up [data-banbox]:not([hidden]),
    #bgBody,
    .budget-trio,
    .cj-try,
    .cr-tagpop,
    .cselect:has(> .cselect-panel.inline),
    .cselect-panel.inline,
    .glog-list,
    .mu-list,
    .mu-sbblock,
    .mu-pick,
    .history-list,
    .dv-list,
    [style*='flex-direction:column-reverse']
  ) {
  flex-direction: column !important;
}

html.desk
  :where(
    #browseResults .insp-grid,
    #bsNameResults .insp-grid,
    #browseResults .sr-grid,
    #bsNameResults .sr-grid,
    .deck-grid,
    .fp-grid,
    .pt-row,
    .visual-grid,
    .col-grid,
    .sp-jump,
    .sr-grid,
    .sc-grid,
    .banlist-grid,
    .app > main.settings-main.xt-tiles,
    .cover-grid,
    .opp-chips,
    .cut-grid,
    [style*='flex-wrap:wrap-reverse']
  ) {
  flex-wrap: wrap !important;
}

/* sections the app wrote best-last (for the foot) stand best-first again */

html.desk :has(> .edh-sec) {
  display: flex;
  flex-direction: column-reverse;
}

html.desk :has(> .edh-sec) > .hint,
html.desk :has(> .edh-sec) > p {
  order: 99;
}

html.desk .edh-sec > .section-label {
  order: -1 !important;
}

html.desk .edh-sec > .edh-more {
  order: 5;
  margin: 6px 0 0 !important;
}

html.desk .overlay main .edh-sec > .section-label,
html.desk #recoOverlay .edh-sec > .section-label {
  top: 0 !important;
  bottom: auto !important;
}

/* headings above what they head */

html.desk .detail-h {
  order: -1;
}

html.desk .sp-group > .sp-shelf,
html.desk .sp-group > .chip-label {
  order: -1;
}

/* ---- search bars and filters at the top ---- */

html.desk .app > main > .searchbar,
html.desk .app > main > div:has(> #deckFilter) {
  position: sticky;
  top: var(--top-h);
  bottom: auto;
  margin: 0 -16px 10px !important;
  padding: 10px 16px;
  border-top: none;
  border-bottom: 2px solid var(--line);
}

html.desk .app > main > .adv-toggle,
html.desk .app > main > div:has(> #colAdvToggle) {
  position: static;
  margin: 0 0 10px !important;
}

html.desk .app > main > #spAdvToggle {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  margin: 0 0 10px;
}

html.desk .adv-go-row {
  position: sticky;
  bottom: 0;
  order: 99 !important;
}

/* filter panels: a side panel to the right of the results */

html.desk .app > main > .adv-panel,
html.desk .app > main > #advSlot > .adv-panel,
html.desk .app > main > #colAdvBox,
html.desk .app > main > #spAdvBox {
  position: fixed;
  left: auto !important;
  right: 0;
  top: var(--top-h);
  bottom: 0;
  width: 400px;
  max-height: none;
  border-radius: 0;
  border-top: none;
  border-left: 2px solid var(--line);
  box-shadow: -12px 0 30px rgba(0, 0, 0, 0.4);
  box-sizing: border-box;
}

html.desk .app > main:has(> #advSlot > .adv-panel),
html.desk .app > main:has(> #colAdvBox),
html.desk .app > main:has(> #spAdvBox) {
  padding-right: calc(400px + 16px);
}

html.desk .browse-selects .cselect-panel,
html.desk #recoOverlay .cselect-panel,
html.desk .overlay .reco-themes .cselect-panel,
html.desk .cselect-panel:not(#nselPop) {
  top: calc(100% + 4px) !important;
  bottom: auto !important;
}

html.desk .otag-pop {
  top: calc(100% + 4px);
  bottom: auto;
}

html.desk
  .app
  > main.cs-open:has(> .browse-selects)
  > *:not(.browse-selects):not(.searchbar):not(.adv-panel):not(#colAdvBox):not(#advSlot) {
  display: revert;
}

html.desk
  .app
  > main.cs-open:has(> .browse-selects)
  > :is(#inspireResults, #browseResults, #bsNameResults, .browse-hero) {
  display: block;
}

/* the tag picker drops down under its field */

html.desk .tag-add-row .tag-drop,
html.desk #ciTagBox .tag-drop {
  position: absolute;
  top: calc(100% + 6px);
  bottom: auto;
  left: 0;
  right: 0;
  width: auto;
  max-height: min(60vh, 520px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}

html.desk .tag-drop-search {
  border-top: none;
  border-bottom: 2px solid var(--pop-line);
}

/* ---- the deck page: its tabs and tools under the title row ---- */

html.desk .app > main > .builder-tabs {
  top: var(--top-h);
  bottom: auto;
  left: var(--dl);
  right: auto;
  width: 330px;
  height: 50px;
  padding: 6px 0;
  border-top: none;
  border-bottom: 2px solid var(--line);
  background: var(--ink);
  z-index: 41;
}

html.desk .deck-dock {
  top: var(--top-h);
  bottom: auto;
  left: calc(var(--dl) + 330px);
  right: var(--dl);
  width: auto;
  transform: none;
  max-width: none;
  box-shadow: none;
  height: 50px;
  box-sizing: border-box;
  border-top: none;
  border-bottom: 2px solid var(--line);
  background: var(--ink);
  justify-content: flex-end;
  gap: 8px;
}

html.desk .deck-dock .menu-pop {
  top: 54px;
  bottom: auto;
  left: auto;
  right: 0;
}

html.desk .deck-dock .dk-tool,
html.desk .deck-dock #menuBtn {
  width: auto;
  height: 36px;
  padding: 0 10px 0 8px;
  gap: 6px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

html.desk .deck-dock .dk-tool::after,
html.desk .deck-dock #menuBtn::after {
  content: attr(title);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* 1.44: a narrower window keeps the toolbar's icons, drops their words */

@media (max-width: 1320px) {
  html.desk .deck-dock .dk-tool::after,
  html.desk .deck-dock #menuBtn::after {
    content: none;
  }
  html.desk .deck-dock .dk-tool,
  html.desk .deck-dock #menuBtn {
    padding: 0;
    width: 36px;
    justify-content: center;
  }
}

/* 1.44: the search / filter bar runs the full page width on PC */

html.desk .app > main > .searchbar {
  max-width: none;
  width: auto;
}

/* ===== 1.45 desk: the page's name sits in the top bar, between Back and
   the page buttons -- no second bar unless it carries tools (deck tabs).
   --capL / --capR are measured from the bar itself (deskCapFit). ===== */

html.desk {
  --cap-h: 0px;
}

html.desk .page-cap > * {
  position: static !important;
  transform: none !important;
  flex: 0 0 auto;
  margin: 0 !important;
}

html.desk .page-cap > .cap-note {
  order: 9;
}

html.desk #capDeckCount {
  padding: 0 !important;
}

html.desk .overlay-inner:has(> .ov-nav) {
  position: relative;
}

/* a narrower window: the page buttons keep their icons, drop their words */

@media (max-width: 1500px) {
  html.desk .brand-banner .banner-tab::after {
    content: none;
  }
  html.desk .brand-banner .banner-tabs .banner-tab {
    padding: 0 10px;
  }
}

/* the filter panel opens centred under the search bar, not at the side */

html.desk .app > main > .adv-panel,
html.desk .app > main > #advSlot > .adv-panel,
html.desk .app > main > #colAdvBox,
html.desk .app > main > #spAdvBox {
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%);
  top: calc(var(--top-h) + 64px) !important;
  bottom: auto !important;
  width: min(720px, calc(100vw - 32px)) !important;
  max-height: calc(100vh - var(--top-h) - 84px) !important;
  overflow-y: auto;
  border: 2px solid var(--line) !important;
  border-radius: 12px !important;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55) !important;
}

html.desk .app > main:has(> #advSlot > .adv-panel),
html.desk .app > main:has(> #colAdvBox),
html.desk .app > main:has(> #spAdvBox) {
  padding-right: 16px !important;
}

/* the gold + sits top-left, at the start of the search bar */

html.desk .deck-fab:not(.col-sel-fab):not(.dl-empty-plus) {
  position: fixed;
  top: calc(var(--top-h) + 6px);
  left: calc(var(--dl) + 10px);
  right: auto;
  bottom: auto;
  width: 46px;
  height: 46px;
  font-size: 22px;
  z-index: 42;
}

html.desk .app > main:has(> .deck-fab:not(.col-sel-fab):not(.dl-empty-plus)) > .searchbar {
  padding-left: 70px !important;
}

html.desk .deck-dock .dk-mid:has(.dk-type) {
  justify-content: flex-end;
  gap: 14px;
}

html.desk #builderBody {
  min-height: 0;
  justify-content: flex-start;
}

html.desk .dl-bridge-desc {
  justify-content: flex-start;
}

html.desk .dl-leader-cat {
  margin-top: 0;
}

html.desk .dl-bridge:not(.dl-bridge-60) {
  grid-template-columns: minmax(0, 260px) minmax(0, 620px);
}

html.desk #decklistBox:has(.vg-stack),
html.desk #decklistBox:has(.vg-text) {
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 16px 18px;
}

html.desk #decklistBox:has(.vg-stack) > .cat-group {
  flex: 0 0 220px;
  width: 220px;
  margin: 0;
}

html.desk #decklistBox:has(.vg-text) > .cat-group {
  flex: 0 0 290px;
  width: 290px;
  margin: 0;
}

html.desk #decklistBox .cat-group .visual-grid.vg-stack {
  width: 100%;
  max-width: none;
  flex-direction: column !important;
}

html.desk #decklistBox:has(.vg-stack) > :not(.cat-group),
html.desk #decklistBox:has(.vg-text) > :not(.cat-group) {
  flex: 1 0 100%;
}

html.desk .cat-group > .cat-head {
  border-bottom: 2px solid var(--line);
}

html.desk .cat-head .t {
  font-size: 15px;
}

html.desk #builderBody:has(> .panel-card) {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}

/* ---- tiles: as many as fit, centred ---- */

html.desk
  :is(
    .sr-grid,
    .sc-grid,
    .visual-grid:not(.vg-stack):not(.vg-text),
    .col-grid,
    .deck-grid:not(.as-list)
  )
  > * {
  flex: 0 0 200px;
  max-width: 200px;
}

html.desk :is(.sr-grid, .sc-grid, .visual-grid, .col-grid, .deck-grid) {
  justify-content: center;
}

html.desk #spMainPage .sc-grid > * {
  flex-basis: 200px;
}

html.desk .pair-grid {
  grid-template-columns: repeat(auto-fill, 250px);
  justify-content: center;
}

/* ---- Extras: four tiles a row; folds drop under the title row ---- */

html.desk .xt-tiles > .settings-section,
html.desk .xt-tiles > .xt-spacer {
  flex-basis: calc((100% - 36px) / 4);
}

html.desk .app > main.settings-main.xt-tiles {
  flex-direction: row !important;
  align-content: flex-start;
}

html.desk .xt-tiles .xt-body:not([hidden])::before {
  order: -1;
}

/* ---- Home: logo, then the news, wide and roomy ---- */

html.desk .app > main.home-page {
  justify-content: flex-start !important;
}

html.desk .home-news {
  max-width: 100%;
  width: 100%;
  height: auto !important;
  max-height: none;
  padding: 6px 20px;
  margin-top: 18px;
}

html.desk .home-news .news-item {
  padding: 14px 4px;
  gap: 16px;
}

html.desk .home-news .news-item .nw-img {
  width: 92px;
  height: 92px;
  border-radius: 10px;
}

html.desk .home-news .news-item .nw-t {
  font-size: 16.5px;
  line-height: 1.35;
}

html.desk .home-news .news-item .nw-m {
  font-size: 13.5px;
  margin-top: 4px;
}

html.desk .home-news.news-grid > .news-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 26px;
  border-bottom: 1px solid var(--line);
}

html.desk .home-news.news-grid > .news-row:last-child {
  border-bottom: none;
}

html.desk .home-news.news-grid > .news-row:first-child {
  border-bottom: 1px solid var(--line);
}

html.desk .home-news.news-grid .news-item {
  border-bottom: none;
}

/* ---- the card page (wide): picture and buttons left, text right, centred ---- */

html.desk .overlay-inner > main.card-detail {
  display: grid;
  max-width: 1180px;
  grid-template-columns: minmax(280px, 400px) minmax(340px, 640px);
  grid-template-rows: min-content min-content auto min-content min-content;
  column-gap: 44px;
  justify-content: center;
  align-content: safe center;
}

html.desk main.card-detail > div:nth-child(1) {
  grid-column: 1;
  grid-row: 1 / 4;
  align-self: start;
}

html.desk main.card-detail > #csTagBox,
html.desk main.card-detail > #ciTagBox {
  grid-column: 1;
  grid-row: 4;
}

html.desk main.card-detail > div:nth-child(2) {
  grid-column: 1;
  grid-row: 5;
}

html.desk main.card-detail > .detail-sec:has(#sheetOracle) {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
}

html.desk main.card-detail > .detail-sec:not(:has(#csRulings)):not(:has(#sheetOracle)) {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
}

html.desk main.card-detail > .detail-sec:has(#csRulings) {
  grid-column: 2;
  grid-row: 3 / 6;
  align-self: start;
}

html.desk main.card-detail > .sheet-foot-spacer {
  display: none;
}

html.desk main.card-detail .cd-hero {
  max-width: 400px;
}

/* the card menu by the mouse, top-down: text, buttons, then the folds */

html.desk .overlay.cs-pop main.card-detail {
  display: flex !important;
}

html.desk .overlay.cs-pop main.card-detail > .detail-sec:has(#sheetOracle) {
  order: 1 !important;
}

html.desk .overlay.cs-pop main.card-detail > div:nth-child(2) {
  order: 2 !important;
  margin-top: 10px;
}

html.desk .overlay.cs-pop main.card-detail > #csTagBox,
html.desk .overlay.cs-pop main.card-detail > #ciTagBox {
  order: 3 !important;
}

html.desk
  .overlay.cs-pop
  main.card-detail
  > .detail-sec:not(:has(#sheetOracle)):not(:has(#csRulings)) {
  order: 4 !important;
}

html.desk .overlay.cs-pop main.card-detail > .detail-sec:has(#csRulings) {
  order: 5 !important;
}

html.desk .overlay.cs-pop main {
  max-width: none;
  margin: 0;
}

html.desk .overlay.cs-pop .topbar {
  padding-right: 52px;
}

/* ---- dialogs in the middle, with a cross ---- */

html.desk .deckpick-scrim {
  align-items: center !important;
}

html.desk .deckpick-scrim > .deckpick {
  border-radius: 14px;
  max-width: 560px;
  width: calc(100% - 48px);
}

.desk-x {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 20;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--ink-text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.desk-x:hover {
  border-color: var(--scheme-accent);
  color: var(--ink-text);
}

.overlay.cs-pop > .cs-pop-x {
  top: 6px;
  right: 8px;
  z-index: 150;
}

html.desk .toast {
  bottom: 28px;
}

/* ---- buttons say what they do ---- */

html.desk .searchbar > button[title]:not(.in-chev):not(.sel-fab) {
  gap: 7px;
  padding: 0 13px !important;
  display: inline-flex;
  align-items: center;
}

html.desk .searchbar > button[title]:not(.in-chev):not(.sel-fab)::after {
  content: attr(title);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---- a size bigger to read ---- */

html.desk .hint {
  font-size: 14px;
}

html.desk .ghost-btn,
html.desk .primary-btn {
  font-size: 15px;
}

html.desk .panel-h {
  font-size: 14.5px;
}

html.desk .menu-pop button,
html.desk .cselect-opt,
html.desk #nselPop .cselect-opt,
html.desk .tag-drop button {
  font-size: 15px;
}

html.desk .searchbar input,
html.desk .col-filter-input,
html.desk .tag-add-row input {
  font-size: 15.5px;
}

html.desk .oracle-text {
  font-size: 15px;
  line-height: 1.5;
}

html.desk .settings-row.xt-tile .l1 {
  font-size: 18px;
}

html.desk .sr-tile .st-price {
  font-size: 14px;
}

html.desk .dl-desc-text {
  font-size: 14.5px;
}

/* ---- the big card on a click ---- */

#cardZoomBox {
  position: fixed;
  z-index: 400;
  display: none;
  border-radius: 4.75% / 3.5%;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.75);
  background: #111;
  cursor: zoom-out;
}

#cardZoomBox img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 4.75% / 3.5%;
}

#cardZoomBox .cz-x {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--scheme-accent);
  background: var(--panel);
  color: var(--ink-text);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

html.desk :is(.sr-tile, .sc-tile, .vg-card, .col-tile) img {
  cursor: zoom-in;
}

/* ---- tablet (portrait) news: wider and easier to read ---- */

@media (min-width: 700px) and (max-width: 999px) {
  .home-news {
    max-width: 680px;
  }
  .home-news .news-item .nw-img {
    width: 72px;
    height: 72px;
  }
  .home-news .news-item .nw-t {
    font-size: 15.5px;
  }
}

/* Source: styles/refinements.css */
/* ===== 1.29 Life counter: full screen, the Deckhand logo in the middle ===== */

#lifeOverlay {
  padding-bottom: env(safe-area-inset-bottom) !important;
}

#lifeOverlay main {
  padding: env(safe-area-inset-top) 0 0 !important;
}
/* 1.48: no outer margin -- the cards run to the edge */

#lifeOverlay .life-grid-v2 {
  gap: 10px;
  margin-top: 0;
}

#lifeCogBtn {
  width: 92px;
  height: 92px;
  padding: 0;
  overflow: hidden;
  border: 3px solid var(--gold);
  background: #000 !important;
  background-image: none !important;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.6);
}

#lifeCogBtn img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  transform: scale(1.24);
  transform-origin: 50% 50%;
  pointer-events: none;
}

/* the life total grows with its card */

.life-card-v2 {
  container-type: size;
}

.life-face.front .lval2:not(.pz-val) {
  font-size: clamp(42px, 33cqmin, 110px);
}

.life-face.front .tap-glyph {
  font-size: clamp(30px, 15cqmin, 52px);
}

/* a thin status pill, the player's name under it */

.life-face.front {
  padding-bottom: 100px;
}

.life-face.front > .submenu-toggle.lbadge {
  bottom: 40px;
  height: 50px;
  min-width: 140px;
  padding: 0 22px;
  gap: 14px;
  border-radius: 999px;
}

.life-face.front > .submenu-toggle.lbadge .lb-grp {
  font-size: 21px;
}

.life-face.front > .submenu-toggle.lbadge .lb-grp svg {
  width: 19px !important;
  height: 19px !important;
}

.life-face.front > .pname-input {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  margin: 0;
  z-index: 3;
  font-size: clamp(14px, 7cqmin, 19px);
}

.submenu-toggle.done {
  height: 44px;
}

/* New game: the table shapes read clearly, with a scheme-colored selection. */

.llay {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 7px;
  transition: transform 0.12s;
}

.llay.on {
  border: 3px solid var(--scheme-accent);
  background: color-mix(in srgb, var(--scheme-accent) 22%, transparent);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--scheme-accent) 35%, transparent),
    0 6px 16px rgba(0, 0, 0, 0.45);
  transform: scale(1.06);
}

.llay-grid {
  width: 70px;
}

.llay-grid i {
  background: #f6f1e7;
}

.llay.on .llay-grid i {
  background: #fff6d8;
}

.llay-n {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-text);
}

.llay.on .llay-n {
  color: var(--ink-text);
}

/* ===== 1.30 Result tiles: plus green, minus red =====
   Solid plates with a light rim, so they read on every scheme; on a red
   scheme the minus turns a brighter coral, on a green one the plus a
   brighter green (with dark ink), so neither melts into its tile. */

:is(.sr-tile, .pair-cell) .st-meta-row .add-btn[data-name]:not([data-admiral]),
:is(.sr-tile, .pair-cell) .st-meta-row .add-btn-rm {
  background: var(--pm-bg) !important;
  color: var(--pm-ink) !important;
  border: 2px solid color-mix(in srgb, #ffffff 65%, var(--pm-bg)) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  font-weight: 800;
}

:is(.sr-tile, .pair-cell) .st-meta-row .add-btn[data-name]:not([data-admiral]) {
  --pm-bg: #2e9b57;
  --pm-ink: #ffffff;
}

:is(.sr-tile, .pair-cell) .st-meta-row .add-btn-rm {
  --pm-bg: #c93c34;
  --pm-ink: #ffffff;
}

html[data-main='G'] :is(.sr-tile, .pair-cell) .st-meta-row .add-btn[data-name]:not([data-admiral]) {
  --pm-bg: #6ee597;
  --pm-ink: #0b2a15;
}

html[data-main='R'] :is(.sr-tile, .pair-cell) .st-meta-row .add-btn-rm {
  --pm-bg: #ff8a7a;
  --pm-ink: #3a0906;
}

:is(.sr-tile, .pair-cell) .st-meta-row .add-btn[data-name]:not([data-admiral]):disabled {
  filter: grayscale(1);
  opacity: 0.38;
  box-shadow: none;
}

:is(.sr-tile, .pair-cell) .st-meta-row .add-btn svg {
  color: inherit !important;
}

/* 1.31 Color distribution: the percentages on a solid dark chip with a light
   rim -- readable over any symbol or bar colour, only a touch bigger. */

.ms-pct i {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  color: #fff;
  background: rgba(14, 11, 8, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 2px 8px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.ms-prod {
  height: 22px;
}

.ms-prod-n b {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: rgba(14, 11, 8, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  padding: 0 8px;
  line-height: 16px;
  text-shadow: none;
  font-variant-numeric: tabular-nums;
}

/* Source: styles/navigation.css */
/* Shared mobile navigation. Loaded after the legacy styles below. */
:root {
  --nav-h: 60px;
}
html.desk {
  --nav-h: 60px;
  --top-nav: 64px;
  --cap-h: 0px;
  --top-h: 64px;
}
html .app > .app-header.page-cap {
  position: fixed;
  inset: 0 0 auto !important;
  z-index: 86;
}
.header-menu {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid transparent;
  padding: 3px;
  border-radius: 13px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.header-menu img {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 9px;
}
.header-menu .menu-alert {
  position: absolute;
  top: -2px;
  right: -2px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--gold);
  color: #111;
  font:
    800 12px/1 'Inter',
    system-ui,
    sans-serif;
  pointer-events: none;
}
.header-menu:hover,
.header-menu.active {
  background: var(--scheme-glow);
  border-color: var(--line);
}
html .app-header > .brand-txt,
.app-overlay-header > .brand-txt {
  display: block;
  pointer-events: auto;
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 8px 0;
  margin: 0 !important;
  min-width: 0;
  max-width: 100% !important;
  width: 100%;
  font:
    800 17px/1.2 'Cinzel',
    serif;
  letter-spacing: 0.08em;
  color: var(--ink-text) !important;
  -webkit-text-fill-color: currentColor !important;
  text-align: center;
  max-height: none;
  white-space: normal;
}
.app-header .cap-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}
.app-header .cap-tools > * {
  position: static !important;
  transform: none !important;
  margin: 0 !important;
}
.app-header .cap-tools .net-chip {
  font-size: 10px;
}
.app-header .cap-tools .cap-note {
  font-size: 11px;
}
.app-header #spoilersBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 22px;
  cursor: pointer;
}
.app-header .header-filter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink-text);
  cursor: pointer;
}
.app-header .header-filter svg {
  width: 24px;
  height: 24px;
}
.app-header .header-filter:focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}
html .app > main,
html.desk .app > main {
  padding-top: var(--app-header-h) !important;
}
html .app > .app-navigation,
html .overlay .app-navigation {
  position: fixed !important;
  inset: auto 0 0 !important;
  width: 100%;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 4px max(6px, env(safe-area-inset-left)) calc(4px + env(safe-area-inset-bottom))
    max(6px, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--ink) 97%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  border-bottom: 0;
  z-index: 85;
}
html .app-navigation .banner-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: 100%;
  max-width: 560px;
  gap: 4px;
  margin: 0 auto;
}
html .app-navigation .banner-tab,
html.desk .app-navigation .banner-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  min-width: 0;
  height: 50px;
  margin: 0;
  padding: 4px 2px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  color: var(--sub-text);
  font:
    500 10px/1.15 'Inter',
    system-ui,
    sans-serif;
}
html .app-navigation .banner-tab::after {
  content: none !important;
}
html .app-navigation .banner-tab svg {
  width: 22px;
  height: 22px;
  color: currentColor;
}
html .app-navigation .tab-label {
  display: block;
  line-height: 1.15;
  white-space: nowrap;
  font-size: 10px;
  letter-spacing: 0.015em;
}
html .app-navigation .banner-tab:hover {
  background: var(--scheme-glow);
}
html .app-navigation .banner-tab.active {
  color: var(--ink-text);
  background: color-mix(in srgb, var(--scheme-accent) 8%, transparent);
  border-color: color-mix(in srgb, var(--scheme-accent) 18%, transparent);
  box-shadow: none;
  font-weight: 700;
}
html .app-navigation .banner-tab.active svg {
  color: var(--scheme-accent);
}
html .app-navigation .banner-tab.active::before {
  content: '';
  width: 18px;
  height: 3px;
  background: var(--scheme-accent);
  border-radius: 3px;
  position: absolute;
  top: 0;
}
.header-menu:focus-visible,
[data-app-home]:focus-visible,
.app-navigation button:focus-visible,
.hub-card:focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}
/* Keep header buttons in their grid cells instead of the legacy overlay positions. */
.app-overlay-header > button {
  position: static !important;
  transform: none !important;
}
.overlay .overlay-inner:has(> .app-navigation) {
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
html .overlay .overlay-inner:has(> .app-navigation) > .app-overlay-header {
  position: relative !important;
  inset: auto !important;
  width: 100%;
  order: -9 !important;
}
html .app > main.hub-page {
  justify-content: flex-start !important;
  gap: 28px;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding-left: 22px;
  padding-right: 22px;
}
html .app > main.hub-page::before {
  display: none;
}
.hub-intro {
  margin-top: 28px;
}
.hub-eyebrow {
  display: block;
  color: var(--sub-text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.19em;
}
.hub-intro h1 {
  margin: 13px 0 12px;
  font:
    600 clamp(26px, 7vw, 36px)/1.2 'Cinzel',
    serif;
  color: var(--ink-text);
  letter-spacing: -0.025em;
}
.hub-intro p {
  margin: 0;
  color: var(--sub-text);
  font-size: 14px;
  line-height: 1.8;
  max-width: 36ch;
}
.hub-actions {
  display: grid;
  gap: 12px;
}
.hub-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px 16px;
  border: 1px solid color-mix(in srgb, var(--ink-text) 18%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--ink-text) 5%, var(--ink));
  color: var(--ink-text);
  text-align: left;
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
}
.hub-card:hover {
  border-color: var(--scheme-accent);
}
.hub-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 43px;
  height: 43px;
  border-radius: 13px;
  color: var(--ink-text);
  background: color-mix(in srgb, var(--accent-ink) 7%, transparent);
}
.hub-icon svg {
  width: 24px;
  height: 24px;
}
.hub-card strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
}
.hub-card small {
  display: block;
  margin-top: 7px;
  color: var(--sub-text);
  font-size: 11px;
  line-height: 1.6;
}
.menu-page .hub-actions {
  gap: 12px;
}
.menu-page .menu-tools + .menu-settings {
  margin-top: -16px;
}
.menu-tools > .settings-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  margin: 0;
  border: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
  --ink-text: var(--main-text);
  --sub-text: var(--main-sub);
  --sub-text-2: var(--main-sub-2);
  --line: var(--main-field-line);
  --brass: var(--main-brass);
}
.menu-tools .hub-copy {
  flex: 1;
  min-width: 0;
}
.menu-tools .hub-icon {
  gap: 2px;
}
.menu-tools .hub-icon #guildCur {
  display: flex;
}
.menu-tools .hub-icon #guildCur svg {
  width: 20px;
  height: 20px;
}
.menu-tools .hub-copy .l2 {
  color: var(--sub-text);
  font-size: 11px;
}
.menu-tools .guild-list {
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
}
.menu-tools .hub-card[aria-expanded='true'] .hub-arrow {
  transform: rotate(90deg);
}
.menu-tools .xt-body:not([hidden]),
.menu-tools .menu-tool-body:not([hidden]) {
  position: static;
  width: 100%;
  max-height: none;
  margin: 0;
  padding: 16px !important;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.menu-tools [hidden] {
  display: none !important;
}
.menu-tools #appFootCell {
  order: 99;
  gap: 12px;
}
.menu-tools #appFootNote {
  order: 99;
  margin: 12px 0 0;
}
.hub-arrow {
  margin-left: auto;
  color: var(--sub-text);
  font-size: 26px;
}
.hub-primary {
  border-color: color-mix(in srgb, var(--scheme-accent) 60%, transparent);
}
.hub-footnote {
  margin: 0;
  color: var(--sub-text-2);
  font-size: 11px;
  line-height: 1.7;
}
@media (max-width: 359px) {
  html .app-navigation .tab-label {
    font-size: 9px;
  }
  html .app > .app-header.page-cap {
    padding-left: 8px !important;
    padding-right: 8px !important;
    gap: 5px;
  }
}

/* Source: styles/overrides/viewports.css */
/* Read from the top. Controls lead, results follow in document order. */

:root {
  --app-header-h: calc(64px + env(safe-area-inset-top));
}

html:has(.tab-viewport),
body:has(.tab-viewport) {
  overflow: hidden;
}

html .app > main.page-frame,
html.desk .app > main.page-frame {
  position: fixed;
  top: var(--app-header-h);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  width: 100%;
  max-width: var(--dw, 900px);
  min-height: 0;
  margin: 0 auto;
  padding: 0 16px !important;
  gap: 0 !important;
  overflow: hidden;
}

html .app > main.page-frame > :not(.page-content) {
  flex-shrink: 0;
}

html .app > main.page-frame.hub-page {
  max-width: 680px;
  padding: 0 22px !important;
}

html .app > main.page-frame:has(#advancedSearchScreen),
html .app > main.search-page:has(#advancedSearchScreen) {
  z-index: 200;
  overflow: hidden;
}

html .app > main.page-frame > .page-content {
  flex: 1;
  min-height: 0;
  width: calc(100% + 32px);
  margin: 0 -16px;
  padding: 12px 16px 24px;
  overflow: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  overflow-anchor: none;
}

html .app > main.page-frame.hub-page > .page-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: calc(100% + 44px);
  margin: 0 -22px;
  padding: 0 22px 24px;
}

html .app > main.page-frame.hub-page > .page-content > * {
  flex-shrink: 0;
}

html .app > main.search-page,
html.desk .app > main.search-page {
  position: fixed;
  top: var(--app-header-h);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  width: 100%;
  max-width: var(--dw, 900px);
  min-height: 0;
  margin: 0 auto;
  padding: 0 16px !important;
  overflow: hidden;
}

html .app > main.search-page > .search-content {
  flex: 1;
  min-height: 0;
  width: calc(100% + 32px);
  margin: 0 -16px;
  padding: 12px 16px 24px;
  overflow: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  overflow-anchor: none;
}

html .app > main {
  flex-direction: column !important;
  justify-content: flex-start !important;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px) !important;
}

html .app > main::before {
  display: none !important;
}

html .app > main > * {
  order: 0 !important;
}

html.desk .app > main.has-dock:has(#builderBody) {
  padding-top: 0 !important;
}

html .app > main > .searchbar,
html .app > main > div:has(> #deckFilter) {
  order: -30 !important;
  position: sticky;
  top: var(--app-header-h) !important;
  bottom: auto !important;
  margin: 0 -16px 12px !important;
  padding: 10px 16px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  background: var(--ink);
  z-index: 40;
}

html .app > main > .browse-selects,
html .app > main > .reco-themes {
  order: -20 !important;
}

html .app > main > #advSlot,
html .app > main > #colAdvBox,
html .app > main > #spAdvBox,
html .app > main > .adv-toggle,
html .app > main > #spAdvToggle,
html .app > main > div:has(> #colAdvToggle) {
  order: -10 !important;
  position: relative !important;
  inset: auto !important;
  margin: 0 0 12px !important;
}

html .app > main > #advSlot:empty,
html .app > main > #spAdvSlot:empty,
html .app > main > #colAdvSlot:empty,
html .app > main > #bsAdvSlot:empty {
  display: none;
}

#cotdBox #cotdImg {
  display: block;
  margin: 0 auto;
}

#cotdBox #cotdReroll {
  display: block;
  margin: 14px auto 0;
}

#cotdBox .cotd-refresh-status {
  padding: 8px;
  color: var(--sub-text);
  font-size: 13px;
}

html .searchbar > .search-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 !important;
}

html .searchbar > .search-tool svg {
  width: 21px;
  height: 21px;
}

html.desk .searchbar > .search-tool::after {
  content: none !important;
}

html:has(#advancedSearchScreen),
body:has(#advancedSearchScreen) {
  overflow: hidden;
}

html #advancedSearchScreen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--ink-text);
  overflow: hidden;
  isolation: isolate;
}

#advancedSearchScreen.entering {
  animation: advanced-search-enter 0.24s ease-out;
}

@keyframes advanced-search-enter {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

#advancedSearchScreen .advanced-search-header {
  flex: none;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px
    max(12px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: var(--ink);
}

#advancedSearchScreen h1 {
  min-width: 0;
  margin: 0;
  text-align: center;
  font:
    800 17px/1.2 'Cinzel',
    serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-text);
}

#advancedSearchScreen .advanced-search-header button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  margin: 0;
  padding: 6px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink-text);
  cursor: pointer;
}

#advancedSearchScreen .advanced-search-header button svg {
  width: 32px;
  height: 32px;
  color: inherit;
}

#advancedSearchScreen #advancedSearchReset svg {
  width: 24px;
  height: 24px;
}

#advancedSearchScreen .advanced-search-header button:hover {
  color: var(--ink-text);
}

#advancedSearchScreen button:focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}

#advancedSearchBody {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px max(16px, env(safe-area-inset-right)) calc(90px + env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

#advancedSearchBody .browse-selects {
  width: 100%;
  margin: 0;
}

html #advancedSearchBody .browse-selects .cselect > .cselect-panel {
  position: static !important;
  width: 100%;
  margin: 4px 0 0;
  max-height: min(50dvh, 400px);
}

html #advancedSearchScreen .adv-panel {
  position: static !important;
  display: flex;
  flex-direction: column !important;
  width: 100% !important;
  max-width: none !important;
  max-height: none !important;
  padding: 0;
  margin: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  transform: none !important;
  box-shadow: none;
  background: transparent;
}

#advancedSearchScreen .adv-row {
  width: 100%;
}

#advancedSearchScreen #advGo {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  min-height: 54px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--gold);
  color: #111;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

#advancedSearchScreen #advGo svg {
  width: 26px;
  height: 26px;
  color: inherit;
}

@media (prefers-reduced-motion: reduce) {
  #advancedSearchScreen.entering {
    animation: none;
  }
}

html .app > main > #advSlot > .adv-panel,
html .app > main > .adv-panel,
html .app > main > #colAdvBox,
html .app > main > #spAdvBox {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  max-width: none !important;
  transform: none !important;
  max-height: 60dvh;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: none;
}

html .app > main:has(> #advSlot > .adv-panel),
html .app > main:has(> #colAdvBox) {
  padding-right: 16px !important;
}

html
  :where(
    .settings-main,
    .browse-selects,
    .reco-themes,
    .cselect,
    .adv-panel,
    #colAdvPanel,
    #builderBody,
    #decklistBox,
    .cat-group,
    .deck-grid.as-list,
    .visual-grid.vg-text,
    .sp-feed,
    .sp-group,
    #cotdBox,
    .home-news,
    .tag-drop,
    .tag-drop-list,
    .cselect-panel,
    .cs-artscroll,
    .otag-pop,
    .name-suggest,
    #nselPop,
    .br-dd-panel,
    .acc-up,
    .ub-wrap,
    .ub-switches,
    #mdBody,
    #bgBody,
    .budget-trio,
    .cut-list,
    .cut-block,
    .cut-body,
    .cut-set,
    .cut-ai,
    [style*='flex-direction:column-reverse']
  ) {
  flex-direction: column !important;
}

html
  :where(
    .deck-grid,
    .fp-grid,
    .visual-grid,
    .col-grid,
    .sr-grid,
    .sc-grid,
    .insp-grid,
    .sp-jump,
    .cover-grid,
    .cs-artscroll,
    .art-grid,
    [style*='flex-wrap:wrap-reverse']
  ) {
  flex-wrap: wrap !important;
}

html :where(.cat-head, .detail-h, .sp-shelf, .chip-label) {
  order: -1 !important;
}

html .app > main.inspiration-page #inspFeed {
  margin: 0 0 12px;
}

html .app > main.inspiration-page #inspFeed .if-sec {
  margin: 0;
}

html .app > main.inspiration-page #inspFeed .section-label {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
}

html .inspiration-page :is(#bsNameResults, #browseResults) > .sr-grid {
  margin-top: 0;
}

#advancedSearchBody .inspiration-period .if-winrow {
  margin: 8px 0 0;
}

html .app > main > .page-content:has(> #browseResults:not(:empty)) > .browse-hero,
html .app > main > .page-content:has(> #bsNameResults:not(:empty)) > .browse-hero {
  display: none;
}

html .browse-selects .bs-row {
  display: block !important;
}

html .app > main.cs-open:has(> .browse-selects) > :not(.searchbar) {
  display: revert;
}

html .app > main.cs-open:has(> .browse-selects) > .browse-selects {
  display: flex;
}

html .cselect > .cselect-panel:not(.inline),
html .br-dd > .br-dd-panel,
html .otag-pop {
  top: calc(100% + 4px) !important;
  bottom: auto !important;
  max-height: min(50dvh, 400px);
  margin: 0;
  border-radius: 10px;
}

html .cselect > .cselect-panel.inline {
  position: static !important;
}

html .cselect-panel .cselect-search {
  order: -1;
  top: 0;
  bottom: auto;
  border-top: 0;
}

html .adv-go-row {
  order: 99 !important;
  position: sticky;
  bottom: 0;
}

html .deck-controls {
  order: -40 !important;
  position: sticky;
  top: var(--app-header-h);
  z-index: 42;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  margin: 0 -16px 14px;
}

html .app .deck-controls > .builder-tabs,
html .app .deck-controls > .deck-dock {
  position: relative !important;
  inset: auto !important;
  transform: none !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  margin: 0 !important;
  border-top: 0;
  box-shadow: none;
}

html .app .deck-controls .deck-dock {
  padding: 8px 10px;
}

html .app .deck-controls .deck-dock .menu-pop {
  top: 100%;
  bottom: auto;
}

html .app #builderBody {
  padding-top: 0 !important;
}

html .app .cat-body,
html .app .cat-group {
  scroll-margin-top: 150px;
}

html .app .edh-sec > .section-label {
  position: static !important;
  order: -1 !important;
}

/* Bars take their natural height; only the remaining content area scrolls. */

html .app > main.page-frame > .page-controls {
  flex: none;
  position: relative !important;
  top: auto !important;
  bottom: auto !important;
  margin-bottom: 0 !important;
}

html .app > main.page-frame > .searchbar,
html .app > main.page-frame > div:has(> #deckFilter) {
  position: relative;
  top: auto !important;
  bottom: auto !important;
  margin: 0 -16px !important;
}

html .app > main.page-frame > #colAdvBox,
html .app > main.page-frame > .adv-panel {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  flex-direction: column !important;
  transform: none !important;
  box-shadow: none !important;
  max-height: min(45dvh, 360px) !important;
  margin: 0 !important;
  overflow: auto;
}

html .app > main .page-searchbar {
  position: static;
  width: 100%;
  max-width: none;
  margin: 0 0 16px !important;
  padding: 0 !important;
  border: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
}

html .app > main .page-searchbar input {
  width: 100%;
  min-width: 0;
}

html .folder-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--main-field-line);
  border-radius: 8px;
  background: transparent;
  color: var(--main-text);
  font:
    600 12px/1.4 'Inter',
    system-ui,
    sans-serif;
  cursor: pointer;
  white-space: nowrap;
}

.folder-view-toggle .ib,
.folder-view-toggle svg {
  display: block;
  width: 18px;
  height: 18px;
}

.folder-view-toggle:hover {
  border-color: var(--scheme-accent);
}

.folder-view-toggle:focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}

html .app > main .page-searchbar.sticky-searchbar {
  position: sticky;
  top: 0;
  z-index: 40;
  isolation: isolate;
  background: none;
}

html .app > main .page-searchbar.sticky-searchbar::before {
  content: '';
  position: absolute;
  /* Cover the field border and subpixel rounding at the title-bar edge. */
  inset: -14px -16px -16px;
  z-index: -1;
  background: var(--ink);
}

/* Clip scrolling cards below the search field's top margin on every edge. */

html .tab-viewport:has(> .sticky-searchbar) {
  clip-path: inset(12px 0 0);
  background: linear-gradient(var(--ink), var(--ink)) right top / 6px 100% no-repeat;
}

/* Search and Inspiration share one viewport-aligned background fade. */

html .app > main:is(.search-page, .inspiration-page),
html .app > main:is(.search-page, .inspiration-page) .page-searchbar.sticky-searchbar::before,
html :is(#recoOverlay, #cardRecoOverlay, #metaDeckOverlay) {
  background: var(--page-backdrop);
  background-attachment: fixed;
}

html :is(.search-page, .inspiration-page) .tab-viewport {
  background: none;
}

html :is(.search-page, .inspiration-page) .section-label,
html :is(#recoOverlay, #cardRecoOverlay, #metaDeckOverlay) .section-label {
  background: none;
  color: var(--ink-text);
  -webkit-text-fill-color: currentColor;
}

html :is(#recoOverlay, #cardRecoOverlay, #metaDeckOverlay) main,
html .inspiration-page :has(> .edh-sec),
html :is(#recoOverlay, #cardRecoOverlay, #metaDeckOverlay) :has(> .edh-sec) {
  flex-direction: column !important;
  justify-content: flex-start;
}

html :is(#recoOverlay, #cardRecoOverlay, #metaDeckOverlay) .edh-sec > .section-label {
  position: static !important;
  top: auto !important;
  bottom: auto !important;
  order: -1 !important;
  background: none;
  color: var(--ink-text);
  -webkit-text-fill-color: currentColor;
}

html :is(#recoOverlay, #cardRecoOverlay, #metaDeckOverlay) .ra-hint {
  background: none;
  backdrop-filter: none;
}

html :is(#recoOverlay, #cardRecoOverlay, #metaDeckOverlay) :has(> .edh-sec) > :is(.hint, p) {
  order: 0 !important;
}

html .inspiration-page .edh-more,
html :is(#recoOverlay, #cardRecoOverlay) .edh-more {
  order: 5;
  margin: 8px 0 0 !important;
}

/* Card sheets start with the image and actions, followed by the rules text. */

html main.card-detail > * {
  order: 0 !important;
}

html main.card-detail > .sheet-foot-spacer {
  display: none;
}

html.desk .overlay-inner > main.card-detail {
  align-content: start;
}

html .app > main:is(.decks-page, .collection-page) .deck-fab {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  top: auto !important;
  left: auto !important;
  right: max(16px, calc((100vw - var(--dw, 900px)) / 2 + 16px)) !important;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px) !important;
  width: 54px !important;
  height: 54px !important;
  padding: 0;
  font-size: 26px !important;
  line-height: 1;
}

html .collection-page .collection-value {
  flex: none;
  max-width: 42%;
  min-height: 44px;
  margin: 0;
  padding: 0 6px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink-text);
  font:
    600 12px/1.2 'JetBrains Mono',
    monospace;
  white-space: nowrap;
  cursor: pointer;
}

#advancedSearchScreen #colAdvPanel {
  gap: 0;
  width: 100%;
}

.reference-page .reference-list {
  padding-top: 12px;
  border-top: 0;
}

.reference-page .settings-row > div {
  min-width: 0;
}

.reference-page [data-fmtruletxt],
.reference-page [data-banbox] {
  overflow-wrap: anywhere;
}

html .app > main#spMainPage > .sp-jump {
  margin-top: 12px;
  margin-bottom: 12px !important;
}

/* Source: styles/overrides/card-details.css */
/* Card details use the app header, menu surfaces and a dedicated content viewport. */

html [id^='cardSheetOverlay'].overlay.card-details-page:not(.cs-pop) {
  inset: 0;
  height: 100dvh;
  box-sizing: border-box;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  overflow: hidden;
  background: var(--page-backdrop);
  background-attachment: fixed;
}

html .overlay.card-details-page > .overlay-inner {
  max-width: none;
  padding-bottom: 0;
  overflow: hidden;
}

html .card-details-page > .overlay-inner > .card-details-header {
  position: relative !important;
  inset: auto !important;
  width: 100%;
  flex: none;
}

.card-details-header > .header-menu {
  position: relative !important;
}

html .overlay.card-details-page > .overlay-inner > .app-navigation {
  width: 100%;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 4px max(6px, env(safe-area-inset-left)) calc(4px + env(safe-area-inset-bottom))
    max(6px, env(safe-area-inset-right));
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: center;
}

.card-details-metrics {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.card-details-metric {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-height: 22px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--ink-text);
  cursor: pointer;
  white-space: nowrap;
}

.card-details-metric:disabled {
  opacity: 1;
  cursor: default;
}

.card-details-metric-label {
  color: var(--sub-text);
  font:
    600 9px/1.4 'Inter',
    system-ui,
    sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-details-metric .cp-val {
  color: var(--ink-text);
  font:
    600 12px/1.4 'JetBrains Mono',
    monospace;
}

.card-details-metric:focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.card-details-subtitle {
  flex: none;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.card-details-subtitle .sheet-title {
  max-width: 900px;
  margin: 0 auto;
  color: var(--ink-text);
  font:
    600 18px/1.4 'Cinzel',
    serif;
  overflow-wrap: anywhere;
}

html .card-details-page main.card-detail {
  min-height: 0;
  padding: 18px 22px 28px;
  gap: 18px;
  zoom: 1;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  overflow-anchor: none;
}

.card-details-page main.card-detail > * {
  flex-shrink: 0;
}

.card-details-page .cd-hero {
  max-width: 400px;
}

.card-details-actions,
.card-details-page .cs-actions-grid {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.card-details-page .cs-actions-grid .ghost-btn {
  min-height: 44px;
  padding: 10px 8px;
  border: 1px solid color-mix(in srgb, var(--ink-text) 18%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--ink-text) 5%, var(--ink));
  color: var(--ink-text);
  font:
    600 12px/1.5 'Inter',
    system-ui,
    sans-serif;
  white-space: normal;
}
.card-quantity,
.card-editing-actions,
.card-action-wide,
.card-discovery-actions,
.card-secondary-actions {
  grid-column: 1 / -1;
}
.card-discovery-actions,
.card-editing-actions,
.card-secondary-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}
.card-editing-actions > .ghost-btn:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}
html
  .card-details-page
  .cs-actions-grid
  :is(.card-discovery-actions, .card-secondary-actions)
  > .ghost-btn {
  grid-column: auto;
}
.card-quantity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--main-text) 18%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--main-text) 5%, var(--ink));
  color: var(--main-text);
  font:
    500 12px/1.5 'Inter',
    sans-serif;
}
.card-quantity strong {
  margin-left: 8px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.card-quantity > div {
  display: flex;
  gap: 6px;
}
.card-quantity button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--main-text) 24%, transparent);
  border-radius: 9px;
  background: var(--ink);
  color: var(--ink-text);
  font-size: 22px;
  line-height: 1;
}
.card-quantity button svg {
  width: 20px;
  height: 20px;
}
.card-quantity button:disabled {
  color: var(--main-sub);
  background: color-mix(in srgb, var(--main-text) 8%, var(--ink));
  opacity: 0.5;
  cursor: not-allowed;
}
/* Keep both arrows inside the hero's bounds, including on narrow phones. */
.card-details-page .ci-nav-arrow {
  top: 50%;
  height: 48px;
  border: 1px solid rgb(255 255 255 / 0.25);
  border-radius: 12px;
  background: rgb(0 0 0 / 0.65);
  color: #fff;
  text-shadow: none;
}
.card-details-page .ci-nav-arrow.left {
  left: 6px;
}
.card-details-page .ci-nav-arrow.right {
  right: 6px;
}

html .card-tags-dialog {
  position: fixed;
  inset: auto;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
html .card-tags-dialog > .card-tags-sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 440px;
  max-height: 100%;
  margin: 0;
  padding: 22px;
  gap: 18px;
  overflow: hidden;
}
.card-tags-sheet > header {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
}
.card-tags-sheet header p {
  margin: 6px 0 0;
  color: var(--main-sub);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.card-tags-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.card-tags-dialog .tag-editor {
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--main-text);
}
.card-tags-dialog .tag-editor .detail-h {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  color: var(--main-sub);
  font:
    600 10px/1.5 'Inter',
    sans-serif;
  letter-spacing: 0.1em;
}
.card-tags-dialog .tag-chip {
  border-width: 1px;
  border-color: color-mix(in srgb, var(--main-text) 24%, transparent);
  color: var(--main-text);
  background: color-mix(in srgb, var(--main-text) 5%, var(--ink));
  box-shadow: none;
}
.card-tags-dialog .tag-chip.tag-scry {
  border-color: var(--scheme-accent);
}
.card-tags-dialog .tag-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
}
html .card-tags-dialog .tag-add-row input {
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--main-text) 24%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  color: var(--main-text);
  font:
    400 16px/1.4 'Inter',
    sans-serif;
}
.card-tags-dialog .tag-chip button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
}
.card-tags-dialog .tag-add-row > button {
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--main-text) 24%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  color: var(--main-text);
}
.card-tags-dialog .tag-drop {
  position: static;
  grid-column: 1 / -1;
  order: 1;
  width: 100%;
  max-height: 240px;
  border: 1px solid color-mix(in srgb, var(--main-text) 24%, transparent);
  background: var(--ink);
  color: var(--main-text);
}
.card-tags-dialog > .card-tags-sheet > #cardTagsDone {
  flex: none;
}

.card-details-page :is(#ciTagBox, #csTagBox):empty {
  display: none;
}

.card-details-page .detail-sec {
  margin: 0;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--ink-text) 18%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--ink-text) 5%, var(--ink));
  color: var(--ink-text);
}

.card-details-page .detail-h {
  order: -1;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  color: var(--sub-text);
  font:
    700 10px/1.5 'Inter',
    system-ui,
    sans-serif;
  letter-spacing: 0.15em;
}

.card-details-page .oracle-face {
  --ink-text: var(--main-text);
  --sub-text: var(--main-sub);
  --sub-text-2: var(--main-sub-2);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-text);
}

.card-details-page .oracle-face + .oracle-face,
.card-details-page .ruling + .ruling {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.card-details-page .ruling {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

.card-details-page .ruling-text {
  color: var(--ink-text);
}

html .card-details-page.cs-pop > .overlay-inner > .card-details-header {
  padding-top: 8px !important;
  padding-right: 50px !important;
}

.overlay.card-details-page.cs-pop > .cs-pop-x {
  left: auto;
  right: 8px;
}

:root {
  --card-panel-width: min(460px, 44vw);
}

html.desk [id^='cardSheetOverlay'].overlay.card-details-panel,
html.desk #printOverlay.card-printing-panel {
  inset: var(--app-header-h) 0 calc(var(--nav-h) + env(safe-area-inset-bottom)) auto;
  width: var(--card-panel-width);
  height: auto;
  padding: 0;
  border-left: 1px solid var(--line);
  box-shadow: -10px 0 28px rgb(0 0 0 / 0.2);
  animation: card-details-panel-enter 180ms ease-out;
}

.card-details-panel-heading {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  flex: none;
  gap: 6px;
  padding: 10px 12px 4px;
}

.card-details-panel-heading h1 {
  margin: 0;
  text-align: center;
  color: var(--main-text);
  font:
    600 17px/1.4 'Cinzel',
    serif;
  overflow-wrap: anywhere;
}

.card-details-panel-heading .header-filter {
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--main-text);
}

.card-details-panel-metrics {
  flex: none;
  padding: 0 12px 8px;
}

.card-details-panel-metrics .card-details-metrics {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.deck-printing-card-name {
  flex: none;
  padding: 0 16px 8px;
  text-align: center;
  color: var(--main-sub);
  font-size: 13px;
}

html.desk #printOverlay.card-printing-panel > .overlay-inner {
  width: 100%;
  max-width: none;
}

html.desk #printOverlay.card-printing-panel .app-navigation {
  display: none !important;
}

html.desk #printOverlay.card-printing-panel .pp-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

html.desk .card-details-panel > .overlay-inner > main.card-detail {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 16px 16px 24px;
  overflow-x: hidden;
}

html.desk .card-details-panel > .overlay-inner > main.card-detail > * {
  grid-area: auto;
  align-self: center;
  width: 100%;
  max-width: 400px;
  margin-inline: auto;
}
html.desk .card-details-panel main.card-detail .cd-hero {
  max-width: 280px;
}

html.desk #root .app > main.card-panel-source:is(.page-frame, .search-page) {
  width: calc(100% - var(--card-panel-width));
  right: var(--card-panel-width);
  left: 0;
  margin-inline: 0;
}

html.desk .card-panel-source.overlay > .overlay-inner > main {
  width: calc(100% - var(--card-panel-width));
  max-width: none;
  margin-inline: 0 auto;
}

html.desk #root .card-panel-source :is(#dockAddCards, #deckFab, #colFab, #binderFab, #colSelFab) {
  right: calc(var(--card-panel-width) + 14px) !important;
}

@keyframes card-details-panel-enter {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  html.desk [id^='cardSheetOverlay'].overlay.card-details-panel,
  html.desk #printOverlay.card-printing-panel {
    animation: none;
  }
}

/* Source: styles/overrides/printing-picker.css */
/* The printing picker uses the app's header, menu surfaces and one scroller. */
html #printOverlay {
  --ink-text: var(--main-text);
  --sub-text: var(--main-sub);
  --line: color-mix(in srgb, var(--main-text) 18%, transparent);
  background: var(--page-backdrop);
  color: var(--main-text);
}

html #printOverlay > .overlay-inner {
  padding-bottom: 0;
  overflow: hidden;
}

html #printOverlay .app-navigation {
  position: relative !important;
  inset: auto !important;
  order: 1 !important;
  flex: none;
}

html #printOverlay .printing-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 16px;
  width: 100%;
  max-width: 900px;
  min-height: 0;
  margin: 0 auto;
  padding: 16px 16px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  overflow-anchor: none;
}

html #printOverlay .printing-action {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  color: var(--main-text);
  font:
    600 14px/1.4 'Inter',
    system-ui,
    sans-serif;
  cursor: pointer;
}

.printing-action .inl-ico {
  display: inline-flex;
  width: 22px;
  height: 22px;
  color: var(--ink-text);
}

.printing-action .inl-ico svg {
  width: 22px;
  height: 22px;
}

.printing-empty {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  text-align: center;
}

.printing-empty p {
  margin: 0 0 16px;
  color: var(--main-text);
  font-size: 14px;
  line-height: 1.5;
}

html #printOverlay .pp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}

.pp-section {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
  color: var(--main-text);
  font:
    600 15px/1.4 'Cinzel',
    serif;
}

html #printOverlay .pp-wrap {
  min-width: 0;
}

html #printOverlay .ta-tile {
  --ink-text: var(--main-text);
  --sub-text: var(--main-sub);
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  color: var(--main-text);
}

#printOverlay .pp-imghold {
  width: 100%;
}

html #printOverlay .st-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 5px;
  padding: 12px;
}

#printOverlay .tp-set {
  overflow-wrap: anywhere;
  line-height: 1.4;
}

html #printOverlay .st-price {
  margin-top: auto;
  padding-top: 3px;
  background: none;
  color: var(--ink-text);
  -webkit-text-fill-color: currentColor;
  font:
    600 14px/1.4 'JetBrains Mono',
    monospace;
}

html #printOverlay .pp-foil {
  top: 8px;
  right: 8px;
  min-height: 36px;
  padding: 8px;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--main-text);
  -webkit-text-fill-color: currentColor;
  text-shadow: none;
  font:
    600 11px/1.3 'Inter',
    system-ui,
    sans-serif;
}

#printOverlay span.pp-foil {
  pointer-events: none;
}

html #printOverlay .pp-own {
  background: var(--gold);
  color: #111;
}

#printOverlay :is(.printing-action, .ta-tile, button.pp-foil):focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 3px;
}

@media (min-width: 700px) {
  html #printOverlay .pp-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Source: styles/overrides/saltiest-cards.css */
/* Salt rankings use the app's surfaces and read from rank one downward. */
html #saltOverlay {
  --ink-text: var(--main-text);
  --sub-text: var(--main-sub);
  --line: color-mix(in srgb, var(--main-text) 18%, transparent);
  background: var(--page-backdrop);
  color: var(--main-text);
}

html #saltOverlay > .overlay-inner {
  padding-bottom: 0;
  overflow: hidden;
}

html #saltOverlay .app-navigation {
  position: relative !important;
  inset: auto !important;
  order: 1 !important;
  flex: none;
}

html #saltOverlay .salt-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  max-width: 900px;
  min-height: 0;
  margin: 0 auto;
  padding: 16px 16px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  overflow-anchor: none;
}

.salt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: none;
  gap: 16px;
}

.salt-tile,
.salt-empty {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  color: var(--main-text);
  text-align: left;
  font-family: 'Inter', system-ui, sans-serif;
}

.salt-tile {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.salt-art {
  display: block;
  flex: none;
  width: 100%;
  aspect-ratio: 63 / 88;
  overflow: hidden;
  border-radius: 12px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
}

.salt-art img,
.salt-noimg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.salt-noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--main-sub);
}

.salt-noimg svg {
  width: 48px;
  height: 48px;
}

html #saltOverlay .salt-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: none;
  color: var(--main-text);
  -webkit-text-fill-color: currentColor;
  text-shadow: none;
}

.salt-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.salt-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  font:
    600 12px/1.4 'JetBrains Mono',
    monospace;
}

.salt-rank {
  color: var(--main-sub);
  -webkit-text-fill-color: currentColor;
}

.salt-score {
  color: var(--ink-text);
  -webkit-text-fill-color: currentColor;
}

.salt-empty {
  flex: none;
  padding: 20px;
  text-align: center;
}

.salt-empty p {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
}

.salt-retry {
  width: 100%;
  min-height: 44px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink);
  color: var(--main-text);
  font:
    600 14px/1.4 'Inter',
    system-ui,
    sans-serif;
  cursor: pointer;
}

#saltOverlay :is(.salt-tile, .salt-retry):focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 3px;
}

@media (min-width: 700px) {
  .salt-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Source: styles/overrides/judge.css */
/* The judge owns a scrolling body above its question bar and fixed navigation. */

html #crOverlay:not(.cr-popup) {
  height: 100dvh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  box-sizing: border-box;
  overflow: hidden;
}

html #crOverlay > .app-overlay-header {
  position: relative !important;
  inset: auto !important;
  flex: none;
  width: 100%;
}

html #crOverlay #crBody {
  scrollbar-gutter: stable;
  overflow-anchor: none;
}

html #crOverlay .cr-bar {
  flex: none;
  margin: 0;
}

/* The judge and its rules browser share the menu's cards and typography. */

html #crOverlay {
  background: var(--page-backdrop);
}

html #crOverlay #crBody {
  width: 100%;
  max-width: 680px;
  align-self: center;
  padding: 0 22px 24px;
}

html #crOverlay .hub-intro {
  margin: 28px 0;
  padding: 0;
  text-align: left;
}

html #crOverlay .hub-intro p {
  margin: 0;
  color: var(--sub-text);
  font-size: 14px;
  line-height: 1.8;
}

html #crOverlay .cj-try {
  padding: 0;
  gap: 12px;
}

html #crOverlay .cj-lab,
html #crOverlay .cja-h {
  margin: 0 0 4px;
  color: var(--sub-text);
  font:
    700 10px/1.5 'Inter',
    system-ui,
    sans-serif;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

html #crOverlay :is(.cj-ex, .cr-toc-row) {
  align-items: center;
  gap: 15px;
  padding: 20px 16px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--ink-text) 18%, transparent);
  background: color-mix(in srgb, var(--ink-text) 5%, var(--ink));
  color: var(--ink-text);
  font:
    normal 14px/1.6 'Inter',
    system-ui,
    sans-serif;
}

html #crOverlay .hub-copy {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

html #crOverlay .hub-copy strong {
  font-size: 14px;
  line-height: 1.6;
}

html #crOverlay .cr-toc {
  gap: 12px;
}

html #crOverlay .cr-num {
  -webkit-text-fill-color: currentColor;
}

html #crOverlay .cr-toc-row .cr-num {
  min-width: 43px;
  padding: 0;
  color: var(--ink-text);
}

html #crOverlay :is(.cja, .cr-rule) {
  margin: 16px 0 0;
  padding: 20px 16px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--ink-text) 18%, transparent);
  background: color-mix(in srgb, var(--ink-text) 5%, var(--ink));
}

html #crOverlay .cja-a {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.75;
}

html #crOverlay .cja-stream-status {
  margin-bottom: 12px;
  color: var(--sub-text);
  font-size: 12px;
}

html #crOverlay .cja-stream-answer,
html #crOverlay .cja-stream-reasoning {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

html #crOverlay .cja-stream-reasoning {
  margin: 12px 0 0;
  line-height: 1.8;
}

html #crOverlay .cja-h {
  margin: 24px 0 0;
}

html #crOverlay .cr-rule {
  flex-wrap: wrap;
  gap: 8px;
}

html #crOverlay .cr-rule .cr-num {
  width: 100%;
  padding: 0;
  color: var(--ink-text);
}

html #crOverlay .cr-txt {
  font-size: 14px;
  line-height: 1.8;
}

html #crOverlay .cr-jump {
  color: var(--ink-text);
}

html #crOverlay .cr-bar {
  width: 100%;
  max-width: 680px;
  align-self: center;
  padding: 12px 22px 16px;
  border-top: 1px solid var(--line);
  gap: 10px;
}

html #crOverlay .cr-qwrap {
  background: var(--main-field);
  border: 1px solid var(--line);
  border-radius: 14px;
}

html #crOverlay .cr-qwrap:focus-within {
  border-color: var(--scheme-accent);
}

html #crOverlay #crQ {
  border-radius: 14px;
  color: var(--main-text);
}

html #crOverlay #crJudge {
  position: relative;
  width: 50px;
  height: 50px;
  min-height: 50px;
  margin: 0;
  border: 0;
  border-radius: 14px;
  background: var(--gold);
  color: #111;
  text-shadow: none;
}

html #crOverlay #crJudge .judge-button-progress {
  position: absolute;
  inset: -3px;
  width: calc(100% + 6px);
  height: calc(100% + 6px);
  overflow: visible;
  display: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  transform: rotate(-90deg);
  pointer-events: none;
}

.judge-progress-track {
  opacity: 0.2;
}
.judge-progress-arc {
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--judge-progress, 0));
}

html
  #crOverlay
  #crJudge:is([data-state='busy'], [data-state='working'], .judge-waiting)
  .judge-button-progress {
  display: block;
}

html #crOverlay #crJudge:is([data-state='busy'], [data-state='working']) .judge-button-progress {
  animation: judge-button-spin 1s linear infinite;
}

html #crOverlay #crJudge:is([data-state='busy'], [data-state='working']) .judge-progress-arc {
  stroke-dashoffset: 0.7;
}

.judge-button-timer {
  position: absolute;
  bottom: 3px;
  left: 0;
  width: 100%;
  font:
    700 9px/1 'Inter',
    system-ui,
    sans-serif;
}

.judge-waiting .judge-button-icon {
  transform: translateY(-5px);
}
.judge-button-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes judge-button-spin {
  to {
    transform: rotate(270deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  html #crOverlay #crJudge .judge-button-progress {
    animation: none !important;
  }
}

html #crOverlay #crJudge:disabled {
  opacity: 0.5;
  cursor: wait;
}

html #crOverlay #crJudge svg {
  width: 24px;
  height: 24px;
}

html #crOverlay > .app-navigation {
  width: 100%;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  margin: 0;
  justify-content: center;
  padding: 4px max(6px, env(safe-area-inset-left)) calc(4px + env(safe-area-inset-bottom))
    max(6px, env(safe-area-inset-right));
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

#crOverlay #crOpenRules {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink-text);
  cursor: pointer;
}

#crOverlay #crOpenRules svg {
  width: 24px;
  height: 24px;
}

#crOverlay #crOpenRules:focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}

#crOverlay.cr-mode-rules #crOpenRules {
  visibility: hidden;
}

.startup-hint {
  margin: 0 0 12px;
}

.startup-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.startup-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 48px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-text);
  font-size: 13px;
  cursor: pointer;
}

.startup-option:has(input:checked) {
  border-color: var(--scheme-accent);
  background: var(--scheme-glow);
}

.startup-option input {
  flex: none;
  margin: 0;
  accent-color: var(--gold);
}

.startup-icon {
  display: flex;
  flex: none;
  color: var(--ink-text);
}

.startup-icon svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 359px) {
  .startup-options {
    grid-template-columns: 1fr;
  }
}

/* Source: styles/overrides/settings.css */
.settings-page .hub-card:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Source: styles/overrides/draft-trade.css */
/* Draft and Trade use the same surfaces and spacing as the menu. */

html .tools-page .tool-sections {
  min-width: 0;
  gap: 12px;
}

html .tools-page .panel-card {
  --ink-text: var(--main-text);
  --sub-text: var(--main-sub);
  --sub-text-2: var(--main-sub-2);
  --line: var(--main-field-line);
  --brass: var(--main-brass);
  --brass-glow: var(--main-brass-glow);
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 20px 16px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--ink-text) 18%, transparent);
  background: color-mix(in srgb, var(--ink-text) 5%, var(--ink));
  box-shadow: none;
  color: var(--ink-text);
  font-family: 'Inter', system-ui, sans-serif;
}

.tool-panel-heading {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 16px;
}

.tool-heading-copy {
  flex: 1;
  min-width: 0;
}

.tool-panel-heading h2 {
  margin: 0;
  font:
    600 15px/1.3 'Inter',
    system-ui,
    sans-serif;
}

.tool-panel-heading p {
  margin: 7px 0 0;
  color: var(--sub-text);
  font-size: 11px;
  line-height: 1.6;
}

.tools-page .hub-copy {
  flex: 1;
  min-width: 0;
}

html .tools-page .panel-h {
  margin: 0 0 16px;
  font:
    600 15px/1.3 'Inter',
    system-ui,
    sans-serif;
}

.tools-page .hint {
  font-size: 12px;
  line-height: 1.7;
}

.tools-page .hub-card {
  min-width: 0;
}

.draft-main .dr-top {
  margin: 0;
  gap: 12px;
}

.draft-main .dr-steps {
  justify-content: flex-start;
  gap: 6px;
  font-size: 11px;
}

.draft-main .dr-steps button {
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink-text);
  font: inherit;
  cursor: pointer;
}

.draft-main .dr-steps button.on {
  color: var(--ink-text);
  border-color: var(--scheme-accent);
  background: var(--scheme-glow);
  font-weight: 700;
}

.draft-main .dr-steps button:disabled {
  color: var(--sub-text);
  opacity: 0.65;
  cursor: default;
}

.draft-main .dr-steps button:focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}

.draft-main .dr-steps i {
  display: none;
}

.draft-main .dr-set {
  gap: 12px;
  padding: 14px 0;
}

.draft-main .dr-set > div:first-child {
  min-width: 0;
}

.draft-main .dr-set .l2 {
  line-height: 1.6;
  margin-top: 5px;
}

.draft-main .dr-foot {
  flex-wrap: wrap;
  margin: 0;
}

.draft-main .dr-foot > .hub-card {
  flex: 1 1 100%;
}

.draft-main .dr-foot > .ghost-btn {
  min-height: 44px;
  padding: 12px 16px;
}

.draft-main .dr-foot button:disabled {
  opacity: 0.45;
  cursor: default;
}

.draft-main .dr-add {
  margin-top: 12px;
}

.draft-main .dr-step button {
  width: 40px;
  height: 40px;
}

.draft-main .dr-ring {
  width: min(280px, 100%);
}

.draft-main .dr-stand {
  display: block;
  overflow-x: auto;
}

/* Dimir's dark accent fill needs its matching light text inside Draft cards. */

html[data-main='U'][data-side='B']
  .draft-main
  :is(.primary-btn, .seg button.active, .ghost-btn.active) {
  background: var(--main-acc-fill);
  color: var(--main-on-acc);
  text-shadow: none;
}

html[data-main='U'][data-side='B'] .draft-main .seg button:not(.active) {
  color: var(--main-text);
}

html[data-main='U'][data-side='B']
  .draft-main
  :is(.dr-dir, .dr-clock, .dr-ring-mid .dr-arrow, .dr-lands b, .dr-p.win, .dr-past b, .dr-champ) {
  color: var(--main-text);
}

.trade-page .trade-total {
  flex: none;
  color: var(--ink-text);
  font:
    600 16px/1.2 'JetBrains Mono',
    monospace;
  white-space: nowrap;
}

.trade-page .trade-add {
  margin-top: 16px;
  padding: 14px 12px;
}

.trade-page .trade-add .hub-icon {
  width: 36px;
  height: 36px;
}

.trade-page .trade-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 44px;
  gap: 8px 10px;
  padding: 14px 0;
}

.trade-page .trade-row img {
  width: 42px;
  grid-row: 1 / 3;
}

.trade-page .trade-row .tr-body {
  grid-column: 2 / 4;
}

.trade-page .trade-row .nm {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.trade-page .trade-row .tl {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 4px;
}

.trade-page .trade-row .tr-eur {
  color: var(--ink-text);
  background: none;
  -webkit-text-fill-color: currentColor;
}

.trade-page .tr-market {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: none;
  min-height: 36px;
  margin-left: auto;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--ink-text) 22%, transparent);
  border-radius: 8px;
  color: var(--ink-text);
  background: transparent;
  font:
    600 12px/1.4 'Inter',
    system-ui,
    sans-serif;
  text-decoration: none;
}

.trade-page .tr-market svg {
  width: 15px;
  height: 15px;
}

.trade-page .tr-market:hover {
  border-color: var(--scheme-accent);
}

.trade-page .tr-market:focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}

.trade-page .tr-qty {
  grid-column: 2;
  gap: 8px;
}

.trade-page .tr-qty button,
.trade-page .tr-del {
  width: 36px;
  height: 36px;
}

.trade-page .tr-del {
  grid-column: 3;
  justify-self: end;
}

html .app > main.trade-page > .page-content {
  gap: 16px;
}

/* Match the cards' scrollbar gutter while keeping the summary outside their scroll area. */
html .app > main.trade-page > .trade-toolbar-shell {
  width: calc(100% + 44px);
  margin: 0 -22px;
  padding: 16px 22px;
  overflow: hidden;
  scrollbar-gutter: stable;
}

html .trade-page .trade-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 12px;
}

.trade-page .trade-confirm {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex: none;
  min-height: 44px;
  margin: 0;
  padding: 6px 2px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink-text);
  font:
    600 13px/1.4 'Inter',
    system-ui,
    sans-serif;
  text-align: left;
  cursor: pointer;
}

.trade-page .trade-confirm svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--ink-text);
}

.trade-page .trade-confirm:focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}

.trade-page .trade-confirm:disabled {
  opacity: 0.45;
  cursor: default;
}

html .trade-page .trade-verdict {
  min-width: 0;
  color: var(--ink-text);
  font-size: 14px;
  line-height: 1.6;
  text-align: right;
}

html .trade-page .trade-verdict .tr-eur {
  color: var(--ink-text);
  white-space: nowrap;
}

html .trade-page :is(.trade-verdict, .trade-verdict .tr-eur) {
  background: none;
  -webkit-text-fill-color: currentColor;
}

.app-header .header-filter:disabled {
  opacity: 0.35;
  cursor: default;
}

@media (max-width: 359px) {
  .draft-main .dr-set {
    flex-wrap: wrap;
  }
  .draft-main .dr-set > div:first-child {
    flex: 1 1 100%;
  }
  .trade-page .tool-panel-heading {
    flex-wrap: wrap;
  }
  .trade-page .trade-total {
    margin-left: 58px;
  }
}

/* Source: styles/overrides/trade-history.css */
.trade-toolbar-actions {
  display: flex;
  align-items: center;
  flex: none;
  gap: 4px;
}

html .trade-page .trade-clear {
  justify-content: center;
  width: 44px;
  padding: 0;
}

html .trade-page .trade-clear svg {
  color: var(--danger-ink);
}

.trade-verdict-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-page .trade-partner-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-width: 100%;
  margin: -6px 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.trade-partner-name svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--ink-text);
}

.trade-partner-name:focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 4px;
}

html #tradeHistoryOverlay {
  z-index: 200;
  background: var(--page-backdrop);
  color: var(--main-text);
  animation: trade-history-enter 240ms ease-out both;
}

html #tradeHistoryOverlay > .overlay-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

html #tradeHistoryOverlay .app-titlebar {
  order: 0 !important;
  flex: none;
}

html #tradeHistoryOverlay .trade-history-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  order: 1 !important;
  gap: 16px;
  width: 100%;
  max-width: 900px;
  min-height: 0;
  margin: 0 auto;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

html #tradeHistoryOverlay .app-navigation {
  position: relative !important;
  inset: auto !important;
  order: 2 !important;
  flex: none;
}

.trade-history-entry {
  flex: none;
  margin: 0;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--main-text) 20%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  color: var(--main-text);
}

html .trade-history-entry > summary {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 16px;
  background: none;
  list-style: none;
  cursor: pointer;
}

.trade-history-entry > summary::-webkit-details-marker {
  display: none;
}

.trade-history-entry .hub-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

html #tradeHistoryOverlay :is(.hub-copy > strong, .hub-arrow) {
  color: var(--main-text);
  -webkit-text-fill-color: currentColor;
}

.trade-history-entry :is(time, small) {
  display: block;
  margin-top: 4px;
  color: var(--main-text);
  font:
    400 12px/1.5 'Inter',
    system-ui,
    sans-serif;
}

.trade-history-details {
  padding: 16px;
  border-top: 1px solid color-mix(in srgb, var(--main-text) 18%, transparent);
}

.trade-history-details section + section {
  margin-top: 22px;
}

html .trade-history-details h2 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--main-text);
  font:
    600 15px/1.5 'Inter',
    system-ui,
    sans-serif;
}

.trade-history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--main-text) 12%, transparent);
}

.trade-history-row img {
  width: 34px;
  max-height: 48px;
  object-fit: contain;
  border-radius: 4px;
}

.trade-history-row > span:first-of-type {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.trade-history-row strong {
  color: var(--main-text);
  font-size: 13px;
}

.trade-history-row :is(.trade-history-quantity, .trade-history-value) {
  flex: none;
  color: var(--main-text);
  font-size: 12px;
  white-space: nowrap;
}

.trade-history-difference {
  margin: 18px 0 0;
  color: var(--main-text);
  font-size: 13px;
  text-align: right;
}

html #tradeHistoryOverlay.leaving {
  pointer-events: none;
  animation: trade-history-leave 240ms ease-in both;
}

@keyframes trade-history-enter {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes trade-history-leave {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  html #tradeHistoryOverlay {
    animation: none;
  }
}

/* Source: styles/overrides/dialogs.css */
/* Shared popup surfaces follow the menu, including older sheets and menus. */

html :is(.deckpick-scrim, .modal-backdrop, .cj-notice) {
  background: rgb(0 0 0 / 0.55);
  backdrop-filter: blur(6px);
}

html :is(.deckpick, .modal-sheet, .menu-pop, .transfer-dialog) {
  --ink-text: var(--main-text);
  --sub-text: var(--main-sub);
  --sub-text-2: var(--main-sub-2);
  --line: var(--main-field-line);
  --brass: var(--main-brass);
  --brass-glow: var(--main-brass-glow);
  border: 1px solid color-mix(in srgb, var(--ink-text) 22%, transparent);
  background: color-mix(in srgb, var(--ink-text) 5%, var(--ink));
  color: var(--ink-text);
  box-shadow: 0 20px 64px rgb(0 0 0 / 0.35);
  font-family: 'Inter', system-ui, sans-serif;
}

html :is(.deckpick, .modal-sheet) {
  border-radius: 22px 22px 0 0;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
}

/* New decks float in the visible area, including above the phone keyboard. */
html .new-deck-backdrop {
  top: var(--nd-viewport-top, 0px);
  left: var(--nd-viewport-left, 0px);
  right: auto;
  bottom: auto;
  width: var(--nd-viewport-width, 100%);
  height: var(--nd-viewport-height, 100dvh);
  align-items: center;
  padding: 16px;
  box-sizing: border-box;
  z-index: 270;
}

html .new-deck-backdrop .nd-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 420px;
  max-height: 100%;
  padding: 20px;
  border-radius: 22px;
  overflow: visible !important;
  box-sizing: border-box;
  gap: 20px;
  background: var(--page-backdrop);
}

html .nd-sheet > .nd-heading,
html .nd-sheet > .modal-actions {
  flex: none;
}
.nd-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}
html .nd-sheet .nd-heading h3 {
  margin: 0;
  color: var(--main-text);
  font:
    600 22px/1.35 'Cinzel',
    serif;
}
.nd-heading p {
  margin: 5px 0 0;
  color: var(--main-sub);
  font-size: 12px;
  line-height: 1.5;
}
.nd-heading .hub-icon {
  border: 1px solid color-mix(in srgb, var(--main-text) 18%, transparent);
  background: color-mix(in srgb, var(--main-text) 5%, var(--ink));
}
.nd-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.nd-field + .nd-field {
  margin-top: 16px;
}
.nd-field > label {
  color: var(--main-text);
  font:
    500 12px/1.4 'Inter',
    sans-serif;
}
.nd-field > label span {
  margin-left: 6px;
  color: var(--main-sub);
  font-weight: 400;
}
html .nd-sheet .nd-field :is(input, #newDeckFmtBtn) {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  box-sizing: border-box;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--main-text) 26%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  color: var(--main-text);
  text-align: left;
  font:
    400 16px/1.4 'Inter',
    sans-serif;
}
html .nd-sheet .nd-field input::placeholder {
  color: var(--main-sub);
  opacity: 1;
}
html .nd-sheet .nd-field :is(input, #newDeckFmtBtn):focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: -2px;
}
html .nd-sheet .nd-actions {
  margin: 0;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid color-mix(in srgb, var(--main-text) 18%, transparent);
}
.nd-sheet [hidden] {
  display: none !important;
}

.nd-fields {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

html .nd-sheet > .nd-popover {
  position: absolute !important;
  top: var(--nd-pop-top, 0px) !important;
  left: var(--nd-pop-left, 0px) !important;
  right: auto !important;
  bottom: auto !important;
  width: var(--nd-pop-width, 100%);
  max-height: var(--nd-pop-height, 200px) !important;
  margin: 0;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  background: color-mix(in srgb, var(--ink-text) 5%, var(--ink));
  border: 1px solid color-mix(in srgb, var(--ink-text) 22%, transparent);
  box-shadow: 0 10px 24px #0005;
}

html .nd-sheet .otag-pop button {
  flex: none;
  min-height: 44px;
  padding: 10px 12px;
}

html :is(.deckpick h4, .modal-sheet h3) {
  background: none;
  color: var(--ink-text);
  -webkit-text-fill-color: currentColor;
  font:
    600 22px/1.4 'Cinzel',
    serif;
  letter-spacing: 0;
}

html .menu-pop {
  padding: 6px;
  border-radius: 16px;
}

html .menu-pop button {
  min-height: 44px;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
}

html .menu-pop hr {
  border-top-width: 1px;
  margin: 5px 6px;
}

html :is(.deckpick .dp-row, .deckpick .dp-cancel, .modal-actions .cancel) {
  border: 1px solid color-mix(in srgb, var(--ink-text) 18%, transparent);
  border-radius: 12px;
  background: transparent;
  color: var(--ink-text);
  min-height: 44px;
}

/* Give cancellation a distinct red tint in the card destination picker. */
html :is(#deckPickScrim, #deckPickPopup) .dp-cancel {
  background: color-mix(in srgb, var(--danger-ink) 6%, var(--ink));
  border-color: color-mix(in srgb, var(--danger-ink) 55%, transparent);
  color: color-mix(in srgb, var(--danger-ink) 70%, var(--main-text));
  -webkit-text-fill-color: currentColor;
}

html :is(#deckPickScrim, #deckPickPopup) .dp-cancel:is(:hover, :focus-visible) {
  background: color-mix(in srgb, var(--danger-ink) 10%, var(--ink));
  border-color: var(--danger-ink);
}

.deckpick .dp-collection {
  flex-shrink: 0;
  margin-top: 10px;
}

html :is(.deckpick .primary-btn, .modal-actions .confirm) {
  background: var(--gold);
  color: #111;
  border: 0;
  border-radius: 12px;
  min-height: 44px;
  text-shadow: none;
}

html :is(.deckpick button, .modal-actions button) {
  font-family: 'Inter', system-ui, sans-serif;
}

html :is(.deckpick .primary-btn.danger, .modal-actions .confirm.danger) {
  background: var(--danger);
  color: #fff;
}

html .deckpick-scrim > .deckpick.app-dialog {
  width: calc(100% - 32px);
  max-width: 400px;
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 24px;
  border-radius: 22px;
  gap: 16px;
  overflow: auto;
}

html .app-dialog .dialog-icon {
  width: 48px;
  height: 48px;
  margin: 0;
}

html .app-dialog h2 {
  margin: 0;
  color: var(--ink-text);
  font:
    600 24px/1.3 'Cinzel',
    serif;
  overflow-wrap: anywhere;
}

html .app-dialog .iac-msg {
  margin: 0;
  color: var(--sub-text);
  font-size: 14px;
  line-height: 1.8;
}

.app-dialog .install-steps {
  padding-left: 22px;
}

.app-dialog .install-steps li + li {
  margin-top: 8px;
}

html .app-dialog input:not([type='checkbox'], [type='radio']) {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 12px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--main-field);
  color: var(--ink-text);
  font:
    400 16px/1.5 'Inter',
    system-ui,
    sans-serif;
}

html .app-dialog input:focus {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}

.app-dialog .dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

html .app-dialog .dialog-actions button {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 12px;
  font-size: 14px;
  line-height: 1.4;
}

html .app-dialog.dialog-danger .dialog-icon {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}

html .app-dialog.dialog-danger .dialog-primary {
  background: var(--danger);
  color: #fff;
}

html :is(.app-dialog button, .deckpick .dp-row, .menu-pop button):focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-transparency: reduce) {
  html :is(.deckpick-scrim, .modal-backdrop, .cj-notice) {
    backdrop-filter: none;
  }
}

/* Source: styles/overrides/transfers.css */
/* Deck and collection transfers share the app's menu and dialog surfaces. */

html .app > main.page-frame:has(#dlPanelBox.dl-popup) {
  z-index: 200;
  overflow: visible;
}

html #dlPanelBox.dl-popup {
  width: calc(100% - 32px);
  max-width: 480px;
  max-height: calc(100dvh - 40px);
  left: 50%;
  right: auto;
  top: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  background: none;
  box-shadow: 0 20px 64px rgb(0 0 0 / 0.35);
}

html :is(#colImportOverlay, #syncSheet, #accountSheet, #appointOverlay.deck-import-overlay) {
  align-items: center;
  padding: 20px 16px;
  backdrop-filter: blur(6px);
}

html :is(#syncSheet, #accountSheet) {
  z-index: 205;
}

html #syncSheet .sync-dialog {
  width: 100%;
  margin: auto;
  padding: 0;
  border-radius: 22px;
}

.sync-actions {
  display: grid;
  gap: 10px;
  margin-block: 18px;
}

.sync-actions button {
  width: 100%;
  min-height: 44px;
}

.sync-dialog .sync-code {
  width: 100%;
  box-sizing: border-box;
  font-size: clamp(12px, 3.6vw, 16px);
  letter-spacing: 0.025em;
  padding-inline: 10px;
  text-align: center;
  cursor: text;
  -webkit-user-select: text;
  user-select: text;
}

.sync-dialog .sync-status:empty {
  display: none;
}

.sync-code-entry {
  position: relative;
  min-width: 0;
}

html .app-dialog .sync-code-entry input,
.sync-code-entry .sync-code-mask {
  font:
    500 clamp(11px, 3.2vw, 14px) / 1.6 ui-monospace,
    monospace;
  letter-spacing: 0;
}

.sync-code-entry .sync-code-mask {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  border: 1px solid transparent;
  padding: 12px;
  overflow: hidden;
  white-space: pre;
  color: var(--sub-text-2);
  pointer-events: none;
}

html .transfer-dialog {
  --transfer-line: color-mix(in srgb, var(--main-text) 18%, transparent);
  --line: var(--transfer-line);
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  max-height: calc(100dvh - 40px);
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 22px;
  box-sizing: border-box;
}

/* Older field classes redeclare panel colors; keep them on this dialog's surface. */
.transfer-dialog
  :is(.ghost-btn, .bulk-textarea, .cselect-btn, .hub-card, .primary-btn, .seg button) {
  --ink-text: inherit;
  --sub-text: inherit;
  --line: inherit;
  --brass: inherit;
}

.transfer-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex: none;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--transfer-line);
}

.transfer-heading > div {
  min-width: 0;
}

html .transfer-heading h2 {
  margin: 0;
  color: var(--ink-text);
  background: none;
  -webkit-text-fill-color: currentColor;
  font:
    600 22px/1.4 'Cinzel',
    serif;
  overflow-wrap: anywhere;
}

.transfer-heading p {
  margin: 8px 0 0;
  color: var(--ink-text);
  font-size: 13px;
  line-height: 1.7;
}

html .transfer-dialog .transfer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin: -4px -8px 0 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  box-shadow: none;
  color: var(--ink-text);
  cursor: pointer;
}

.transfer-close svg {
  width: 22px;
  height: 22px;
}

.transfer-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 20px;
  overflow: auto;
  overscroll-behavior: contain;
}

.transfer-body > * {
  flex-shrink: 0;
}

.transfer-dialog .hub-card {
  gap: 12px;
  padding: 18px 14px;
}

.transfer-dialog .hub-copy {
  min-width: 0;
  flex: 1;
}

.transfer-dialog .hub-copy small {
  color: var(--ink-text);
}

.transfer-label {
  color: var(--ink-text);
  font-size: 12px;
  font-weight: 600;
}

html .transfer-dialog input[type='text'] {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 12px;
  box-sizing: border-box;
  font:
    400 16px/1.5 'Inter',
    system-ui,
    sans-serif;
}

.transfer-help code {
  font-family: 'JetBrains Mono', monospace;
}

html .transfer-dialog .bulk-textarea {
  min-height: 160px;
  max-height: 32dvh;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--transfer-line);
  border-radius: 12px;
  background: var(--main-field);
  color: var(--ink-text);
  font:
    400 13px/1.7 'JetBrains Mono',
    monospace;
  resize: vertical;
  box-sizing: border-box;
}

/* Keep field borders independent of legacy panel and form color aliases. */
html
  .transfer-dialog
  :is(
    textarea,
    select,
    input:not([type='hidden'], [type='file'], [type='checkbox'], [type='radio'])
  ) {
  border: 1px solid var(--transfer-line);
  border-radius: 12px;
  background: var(--main-field);
  color: var(--main-text);
  box-shadow: none;
}

html .transfer-dialog :where(.ghost-btn, .primary-btn, .cselect-btn, .seg button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--transfer-line);
  border-radius: 12px;
  background: transparent;
  color: var(--ink-text);
  font:
    600 13px/1.4 'Inter',
    system-ui,
    sans-serif;
  white-space: normal;
  text-align: center;
}

html .transfer-dialog .primary-btn,
html .transfer-dialog .seg button.active {
  border-color: var(--scheme-accent);
  background: var(--gold);
  color: #111;
  -webkit-text-fill-color: currentColor;
  text-shadow: none;
}

html .transfer-dialog .primary-btn.transfer-danger {
  border-color: var(--danger-ink);
  background: transparent;
  color: var(--danger-ink);
}

.transfer-dialog .transfer-formats,
.transfer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.transfer-dialog .transfer-formats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

html .transfer-dialog .transfer-formats button {
  padding-left: 6px;
  padding-right: 6px;
  font-size: 12px;
}

.transfer-dialog .nsel-caret {
  opacity: 1;
}

.transfer-actions > :last-child {
  grid-column: 1 / -1;
}

.transfer-report,
.transfer-help {
  margin: 0;
  color: var(--ink-text);
  font-size: 12px;
  line-height: 1.7;
}

.transfer-report:empty {
  display: none;
}

/* Progress updates replace the spinner before its rotating message returns. */
.transfer-report > .status {
  box-sizing: border-box;
  height: 168px;
  overflow: auto;
  overflow-wrap: anywhere;
  scrollbar-gutter: stable;
}

.transfer-export {
  display: flex;
  flex-direction: column;
  padding-top: 16px;
  border-top: 1px solid var(--transfer-line);
}

.transfer-dialog a.ghost-btn {
  text-decoration: none;
}

.transfer-dialog :is(button, a, input, textarea):focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}

/* Source: styles/overrides/life.css */
/* New Life games use a full page, with only its settings area scrolling. */

html #lifeSetupScreen {
  inset: 0;
  width: 100%;
  height: 100dvh;
  z-index: 9600;
  max-width: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  background: var(--page-backdrop);
}

html #lifeSetupScreen > .app-overlay-header {
  position: relative !important;
  inset: auto !important;
  flex: none;
  width: 100%;
}

html #lifeSetupScreen > .app-navigation {
  width: 100%;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  margin: 0;
  padding: 4px max(6px, env(safe-area-inset-left)) calc(4px + env(safe-area-inset-bottom))
    max(6px, env(safe-area-inset-right));
}

.life-setup-body {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 680px;
  align-self: center;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

html #lifeSetupScreen .life-setup-page {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
  margin: 0;
  padding: 0 22px 28px;
  overflow: visible;
}

.life-setup-page .hub-intro {
  margin-top: 28px;
}

.life-format-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.life-setup-page .life-format-card {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  min-height: 86px;
  padding: 14px 12px;
}

.life-format-card strong {
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.life-format-card small {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--sub-text);
}

.life-layout-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

html .life-setup-page .llay {
  min-width: 0;
  padding: 10px 6px;
  border: 1px solid color-mix(in srgb, var(--ink-text) 18%, transparent);
  border-radius: 14px;
  background: transparent;
}

html .life-setup-page .llay-grid {
  width: min(70px, 100%);
  margin: 0 auto;
}

html .life-setup-page .llay-n {
  color: var(--ink-text);
  font:
    500 11px/1.5 'Inter',
    system-ui,
    sans-serif;
  margin-top: 8px;
}

html .life-setup-page :is(.life-format-card.active, .llay.on) {
  border-color: var(--scheme-accent);
  box-shadow: inset 0 0 0 1px var(--scheme-accent);
  background: color-mix(in srgb, var(--scheme-accent) 8%, transparent);
  transform: none;
}

.life-setup-footer {
  flex: none;
  width: 100%;
  max-width: 680px;
  align-self: center;
  padding: 12px 22px 16px;
  border-top: 1px solid var(--line);
}

html .life-setup-footer .life-start-button {
  padding: 14px 16px;
  background: var(--gold);
  color: #111;
  border-color: transparent;
}

.life-start-button .hub-icon {
  color: inherit;
  background: rgb(36 26 4 / 0.08);
}

.life-start-button .hub-copy {
  flex: 1;
  min-width: 0;
}

.life-start-button :is(small, .hub-arrow) {
  color: inherit;
}

.life-start-button small {
  font-size: 11px;
}

@media (min-width: 520px) {
  .life-layout-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* The center controls use four diagonal buttons; panels share the app's surfaces. */

#lifeMenuPop.life-radial {
  position: fixed;
  inset: 0;
  z-index: 260;
  pointer-events: none;
}

.life-radial .lm-opt {
  position: fixed;
  left: var(--x, 50%);
  top: var(--y, 50%);
  transform: translate(-50%, -50%) rotate(var(--a, 0deg)) scale(var(--scale, 1));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: max-content;
  min-height: 44px;
  padding: 9px 12px;
  border: 2px solid var(--scheme-accent);
  border-radius: 999px;
  background: var(--ink-deep);
  color: var(--ink-text);
  font:
    700 16px/1.3 'Cinzel',
    serif;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.45);
  pointer-events: auto;
  cursor: pointer;
}

.life-radial .lm-opt > span:first-child,
.life-radial .lm-opt svg {
  display: block;
  width: 18px;
  height: 18px;
  flex: none;
}

#lifeOverlay:has(.life-radial) #lifeCogBtn {
  z-index: 261;
}

.life-radial .lm-opt:focus-visible {
  outline: 2px solid var(--ink-text);
  outline-offset: 3px;
}

.life-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.life-tools-grid .life-tool {
  flex-direction: column;
  justify-content: center;
  min-height: 120px;
  padding: 16px 10px;
  text-align: center;
}

.life-tool strong {
  font:
    600 14px/1.5 'Inter',
    system-ui,
    sans-serif;
  overflow-wrap: anywhere;
}

html :is(.life-panel, .deckpick.life-sheet) {
  --ink-text: var(--main-text);
  --sub-text: var(--main-sub);
  --sub-text-2: var(--main-sub-2);
  --line: var(--main-field-line);
  --brass: var(--main-brass);
  --brass-glow: var(--main-brass-glow);
  --field: var(--main-field);
  --field-line: var(--main-field-line);
  background: color-mix(in srgb, var(--ink-text) 5%, var(--ink));
  color: var(--ink-text);
  border: 1px solid color-mix(in srgb, var(--ink-text) 22%, transparent);
  border-radius: 22px;
  font-family: 'Inter', system-ui, sans-serif;
}

html .life-panel.life-popup,
html .deckpick-scrim > .deckpick.life-sheet {
  position: fixed;
  inset: 16px;
  width: calc(100% - 32px);
  max-width: 520px;
  height: max-content;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: 0 20px 64px rgb(0 0 0 / 0.35);
}

html :is(#lifeMenuShield, #diceShield, #lifePanelShield) {
  background: rgb(0 0 0 / 0.55);
  backdrop-filter: blur(6px);
}

.life-popup-head {
  display: flex;
  flex: none;
  align-items: flex-start;
  gap: 12px;
  padding: 22px 20px 18px;
}

.life-popup-head > div {
  flex: 1;
  min-width: 0;
}

.life-popup-head .hub-eyebrow {
  text-transform: uppercase;
}

.life-popup-head h2 {
  margin: 8px 0 0;
  color: var(--ink-text);
  font:
    600 24px/1.3 'Cinzel',
    serif;
}

.life-popup-head p {
  margin: 10px 0 0;
  color: var(--sub-text);
  font-size: 12px;
  line-height: 1.7;
}

.life-popup-close {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-text);
  cursor: pointer;
}

.life-popup-close svg {
  width: 24px;
  height: 24px;
}

.life-popup-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 0 20px 22px;
}

.life-popup-body > * {
  flex-shrink: 0;
}

:is(.life-popup, .life-sheet) .hub-copy {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

:is(.life-popup, .life-sheet) .hub-card {
  min-width: 0;
}

.life-popup .hub-copy strong {
  font-size: 14px;
}

.life-popup .hub-copy small {
  font-size: 11.5px;
}

.life-popup .life-toggle {
  cursor: default;
}

.life-popup .toggle-switch input {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.life-popup .toggle-switch input:checked + .track {
  background: var(--gold);
  border-color: var(--scheme-accent);
}

.life-popup .toggle-switch input:checked + .track + .knob {
  background: #241a04;
}

.life-bright input[type='range'] {
  width: 100%;
  margin-top: 12px;
  accent-color: var(--gold);
}

.life-popup .dice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 12px;
}

html .life-popup .dice-opt {
  display: flex;
  align-items: center;
  padding: 14px 12px;
  gap: 10px;
  color: var(--ink-text);
  font-family: inherit;
  white-space: normal;
}

.life-popup .dice-opt .hub-icon {
  width: 28px;
  height: 32px;
  background: none;
}

.life-popup .dice-opt .hub-icon svg {
  width: 24px;
  height: 24px;
}

.life-popup .dice-opt strong {
  font-size: 13px;
  line-height: 1.5;
}

html .life-popup .history-list {
  display: flex;
  flex-direction: column;
  max-height: none;
  gap: 12px;
}

html .life-popup .life-history-row {
  padding: 16px;
  font-size: 13px;
  line-height: 1.7;
  cursor: default;
}

.life-popup-footer {
  flex: none;
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.life-popup-footer button {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.life-sheet .hub-card.cur {
  border-color: var(--scheme-accent);
}

.life-sheet .dg-players {
  margin-bottom: 16px;
}

html .life-sheet .ghost-btn {
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--main-text);
  font:
    600 12px/1.5 'Inter',
    system-ui,
    sans-serif;
}

html .life-panel h4 {
  color: var(--ink-text);
  background: none;
  -webkit-text-fill-color: currentColor;
  font:
    600 22px/1.4 'Cinzel',
    serif;
}

html #diceResultPop .dice-result {
  color: var(--ink-text);
  text-shadow: none;
}

html #setLifePopup #setLifeInput {
  font:
    600 34px/1.4 'Cinzel',
    serif;
  text-align: center;
}

:is(.life-setup-screen, .life-popup, .life-sheet) button:focus-visible,
.life-popup .toggle-switch:has(:focus-visible) {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-transparency: reduce) {
  html :is(#lifeMenuShield, #diceShield, #lifePanelShield) {
    backdrop-filter: none;
  }
}

/* Symmetric side columns keep the name centered in the player panel.
   Extra counters scroll in their own column, including in rotated seats. */
.life-player-footer {
  position: absolute;
  inset: auto 8px 6px;
  z-index: 4;
  --life-name-width: clamp(32px, 28cqw, 180px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--life-name-width) minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 40px;
  pointer-events: none;
}
.life-player-footer:has(.life-extra-counters > :nth-child(1)) {
  --life-name-width: clamp(32px, 24cqw, 120px);
}
.life-player-footer:has(.life-extra-counters > :nth-child(3)) {
  --life-name-width: clamp(32px, 16cqw, 80px);
}
.life-player-footer:has(.life-extra-counters > :nth-child(6)) {
  --life-name-width: clamp(32px, 12cqw, 60px);
}
.life-player-name {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  max-width: calc(100% - 20px);
  color: rgb(255 255 255 / 0.92);
  font:
    400 clamp(13px, 5cqmin, 18px)/1.4 'Inter',
    system-ui,
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  pointer-events: none;
}
.life-player-footer .life-player-name {
  position: static;
  transform: none;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  max-width: 100%;
  min-height: 36px;
}
.life-player-name .pname-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 4px 0;
  color: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-overflow: ellipsis;
  text-align: center;
  pointer-events: auto;
}
.life-leading-counters {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}
.life-role-corner {
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  flex: none;
  align-items: flex-end;
  min-width: 0;
  text-align: left;
}
.life-role-corner:empty {
  display: none;
}
.life-extra-counters {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  width: 100%;
  gap: 5px;
  min-width: 0;
  padding: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  touch-action: none;
  pointer-events: auto;
  scrollbar-width: none;
}
.life-extra-counters:empty {
  display: none;
}
.life-counter-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 40px;
  min-height: 36px;
  padding: 5px 7px;
  border: 1px solid rgb(255 255 255 / 0.4);
  border-radius: 20px;
  background: rgb(0 0 0 / 0.3);
  color: #fff;
  font:
    600 12px/1.3 'Inter',
    system-ui,
    sans-serif;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.life-counter-chip.commander-casts {
  color: #ffda76;
}
.life-counter-chip > span {
  display: inline-flex;
  flex: none;
}
.life-counter-chip svg {
  width: 20px;
  height: 20px;
}
.life-counter-chip:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -3px;
}
html .life-face.front.life-total-face {
  padding: min(40px, 20cqh) 14px min(104px, 55cqh);
}
html .life-total-face .lval2 {
  font-size: clamp(32px, 27cqmin, 100px);
}
.life-total-face .ldungeon {
  top: 8px;
  max-width: calc(100% - 32px);
}
html .life-face.front.life-total-face > .submenu-toggle.lbadge {
  bottom: 52px;
  height: 44px;
  min-width: 132px;
  padding: 0 18px;
  gap: 12px;
}

/* Done has its own centered anchor, independent of the side tools. */
.life-card-v2 {
  --life-options-bottom: 10px;
  --life-option-size: clamp(34px, 12cqw, 52px);
  --life-done-width: clamp(88px, 32cqw, 152px);
  --life-done-height: clamp(44px, 32cqh, 64px);
}
html .life-face .lf-extras {
  bottom: var(--life-options-bottom);
  left: 8px;
  right: 8px;
  height: var(--life-done-height);
  transform: none;
  display: block;
}
.life-role-actions {
  position: absolute;
  bottom: calc((var(--life-done-height) - var(--life-option-size)) / 2);
  left: 0;
  display: flex;
  gap: 5px;
}
html .lf-extras .lf-x {
  flex: none;
  width: var(--life-option-size);
  height: var(--life-option-size);
  border-width: 1px;
}
html .lf-extras .lf-x svg {
  width: 28px;
  height: 28px;
}
html .lf-extras .life-hash {
  display: inline;
  font:
    600 32px/1 'Inter',
    system-ui,
    sans-serif;
}
html .lf-extras [data-lcounters] {
  position: absolute;
  left: auto;
  right: 0;
  bottom: calc((var(--life-done-height) - var(--life-option-size)) / 2);
  color: #ffda76;
  border-color: currentColor;
}
html .lf-extras .submenu-toggle.done {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  min-width: 0;
  width: var(--life-done-width);
  height: var(--life-done-height);
  padding: 0 10px;
  border-width: 1px;
  font:
    600 clamp(16px, 5cqw, 22px)/1.2 'Inter',
    system-ui,
    sans-serif;
  gap: 5px;
  pointer-events: auto;
}
@container (max-width: 260px) {
  .life-role-actions {
    bottom: calc(var(--life-done-height) + 4px);
  }
}
@container (max-width: 220px) {
  html .lf-extras [data-lcounters] {
    bottom: calc(var(--life-done-height) + 4px);
  }
  html .life-counter-picker {
    bottom: calc(
      var(--life-options-bottom) + var(--life-done-height) + var(--life-option-size) + 12px
    );
  }
}
@container (max-width: 300px) {
  .life-player-footer:has(.commander-casts) .life-role-corner {
    bottom: calc(100% + 4px);
  }
}
.life-bottom-notch {
  --life-options-bottom: 68px;
}
.life-bottom-notch .life-player-footer {
  bottom: 68px;
}
html .life-bottom-notch .life-face.front.life-total-face > .submenu-toggle.lbadge {
  bottom: 112px;
}
.life-bottom-corner {
  --life-options-bottom: max(10px, calc(76px - 50cqw + var(--life-done-width) / 2));
}
.life-card-v2[data-life-cut='corner-3'] .life-role-actions {
  bottom: max(60px, calc(var(--life-done-height) + 4px));
}

/* Symbol pickers belong to the player's rotated card. */
.life-counter-picker {
  position: absolute;
  z-index: 7;
  left: auto;
  right: 8px;
  bottom: calc(var(--life-options-bottom) + var(--life-done-height) + 8px);
  transform-origin: right bottom;
  width: max-content;
  max-width: calc(100% - 16px);
  padding: 5px;
  border: 1px solid rgb(255 255 255 / 0.45);
  border-radius: 28px;
  background: rgb(0 0 0 / 0.72);
  backdrop-filter: blur(12px);
  box-sizing: border-box;
}
.life-counter-picker-scroll {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  touch-action: none;
  overscroll-behavior-x: contain;
}
.life-counter-picker .life-counter-choice {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: clamp(34px, 12cqw, 48px);
  height: clamp(34px, 12cqw, 48px);
  min-height: 0;
  margin: 0;
  padding: 4px;
  border: 1px solid rgb(255 255 255 / 0.45);
  border-radius: 50%;
  background: rgb(255 255 255 / 0.04);
  color: #fff;
  cursor: pointer;
}
.life-counter-choice svg {
  width: 28px;
  height: 28px;
}
.life-counter-choice.on {
  color: #ffda76;
  border-color: currentColor;
  background: rgb(255 218 118 / 0.12);
}
.life-counter-choice:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -3px;
}
.life-focus-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.life-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.life-roles {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}
.life-roles .life-role-icon {
  position: static;
  transform: none;
  width: clamp(20px, 8cqmin, 28px);
  color: var(--ink-text);
  filter: drop-shadow(0 2px 3px rgb(0 0 0 / 0.55));
  line-height: 0;
}
.life-role-icon svg {
  display: block;
  width: 100%;
  height: auto;
}
.dg-card-name {
  color: var(--ink-text);
  font:
    600 13px/1.5 'Inter',
    system-ui,
    sans-serif;
  text-align: center;
}

/* The dungeon action stays with the selected player's dungeon controls. */
.dg-toolbar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 4px;
}
.dg-toolbar [data-life-close] {
  margin-left: auto;
}
html .dg-actions.life-popup-footer {
  flex-wrap: wrap;
}
html .dg-actions .dg-initiative {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.dg-initiative svg {
  width: 22px;
  height: 22px;
  flex: none;
}
html .dg-actions .dg-initiative.on {
  color: var(--ink-text);
  border-color: var(--scheme-accent);
  background: color-mix(in srgb, var(--scheme-accent) 10%, transparent);
}

/* Source: styles/overrides/readability.css */
/* Foreground accents follow surface brightness; solid gold buttons keep dark ink. */
html {
  --accent-ink: #e8be58;
  --danger-ink: #ffbdc1;
  --success-ink: #a4deb1;
}

html[data-main='W'],
html[data-theme='light'] {
  --accent-ink: #523700;
  --danger-ink: #84242a;
  --success-ink: #164723;
  --page-shade: 0.08;
  --sub-text: color-mix(in srgb, var(--page-ink) 94%, var(--ink));
  --sub-text-2: color-mix(in srgb, var(--page-ink) 90%, var(--ink));
}

/* Titles and active tabs must use the ink of their own header surface. */
html .app-header #brandTitleInner {
  color: var(--main-text);
  -webkit-text-fill-color: currentColor;
}

html :is(.header-filter, .life-popup-close, #advancedSearchClose, #advancedSearchReset),
html #advancedSearchScreen .advanced-search-header button,
html #crOverlay #crOpenRules,
html .trade-page .trade-total,
html .trade-page .trade-verdict .tr-eur {
  color: var(--ink-text);
}

html .app-header #tradeBtn,
html #capNoteBtn.collection-value {
  color: var(--main-text) !important;
  -webkit-text-fill-color: currentColor;
}

.hub-footnote,
html #appFootNote {
  color: var(--main-text);
  opacity: 1;
}

html #appFootNote a {
  color: var(--main-text) !important;
}

html .pin-pill {
  color: var(--main-text);
  background: color-mix(in srgb, var(--main-text) 5%, var(--ink));
  border-color: color-mix(in srgb, var(--main-text) 30%, transparent);
}

html .pin-pill button {
  color: var(--main-text);
  opacity: 1;
}

html #backupNow {
  color: #111;
  background: var(--gold);
}

/* Selected scheme buttons keep the same readable label as unselected choices. */
html .guild-opt.sel {
  color: var(--main-text);
  -webkit-text-fill-color: currentColor;
  background: color-mix(in srgb, var(--main-text) 8%, var(--ink));
  border-color: var(--scheme-accent);
}

html .guild-opt.sel span {
  color: inherit;
  -webkit-text-fill-color: currentColor;
}

/* Opacity previously dimmed an unchecked rarity's label along with its border. */
html .rcheck .rpill {
  opacity: 1;
  color: var(--ink-text);
}

html .rcheck input:checked + .rpill {
  background: var(--ink-2);
  border-color: var(--scheme-accent);
}

html #advancedSearchScreen .adv-hint {
  color: var(--main-text);
  opacity: 1;
}

html :is(input, textarea)::placeholder {
  color: var(--ink-text);
  opacity: 1;
}

/* Metadata belongs to the card tile's surface, rather than the page's accent. */
html .col-tile-info {
  --ink-text: var(--main-text);
  --sub-text: var(--main-text);
  --sub-text-2: var(--main-text);
  --brass: var(--main-text);
  background: var(--ink);
  color: var(--ink-text);
}

html .col-tile-info .l1 {
  color: var(--ink-text);
}

html .col-tile-info .l2 {
  color: var(--sub-text);
}

html[data-theme='light'] .folder-tile {
  background: var(--ink-2);
  background-image: none;
}

html[data-theme='light'] :is(.folder-name, .folder-sub) {
  background: none;
  color: var(--main-text);
  -webkit-text-fill-color: currentColor;
  opacity: 1;
}

html[data-side='W'] .folder-sub {
  color: var(--panel-text);
  background: var(--panel);
  border-radius: 4px;
  opacity: 1;
}

/* These controls use page-colored surfaces, even inside a side-colored panel. */
html .card-details-page .cs-actions-grid .ghost-btn {
  --ink-text: var(--main-text);
  --brass: var(--accent-ink);
  --danger: var(--danger-ink);
  color: var(--ink-text);
}

html .card-details-page .leg-chip.no {
  color: var(--main-text);
}

html .card-details-page .leg-chip.ok {
  color: var(--success-ink);
}

html .draft-main :is(.dr-seg button, .dr-step button) {
  color: var(--main-text);
  -webkit-text-fill-color: currentColor;
  background: var(--ink-2);
  background-image: none;
}

html .draft-main :is(.dr-seg button.active, .dr-add > .primary-btn) {
  color: #111;
  -webkit-text-fill-color: currentColor;
  background: var(--gold);
  background-image: none;
}

html .draft-main .dr-steps button.on {
  color: var(--ink-text);
  background: color-mix(in srgb, var(--scheme-accent) 8%, transparent);
  border-color: var(--scheme-accent);
}

html #crCount {
  color: var(--main-text);
  opacity: 1;
}

html .life-radial .lm-opt {
  color: var(--ink-text);
  background: var(--ink);
  border-color: var(--scheme-accent);
}

html .life-setup-page .llay.on .llay-n {
  color: var(--main-text);
  -webkit-text-fill-color: currentColor;
}

html .app-dialog.dialog-danger .dialog-icon {
  color: var(--danger-ink);
  background: color-mix(in srgb, var(--danger-ink) 8%, transparent);
}

/* Source: styles/overrides/decklist.css */
/* Deck editing shares the menu's surfaces, spacing, and theme ink. */

.deck-workspace,
.deck-actions-page {
  --ink-text: var(--main-text);
  --sub-text: var(--main-sub);
  --sub-text-2: var(--main-sub-2);
  --line: var(--main-field-line);
  --brass: var(--main-brass);
  --brass-glow: var(--main-brass-glow);
  color: var(--main-text);
}

html .app > main.deck-workspace.page-frame {
  max-width: none;
  padding-inline: var(--page-gutter, 8px) !important;
  background: var(--page-backdrop);
  background-attachment: fixed;
}

/* Deck Log actions keep their label and surface colors paired in every scheme. */
html .deck-workspace .deck-log :is(.primary-btn, .ghost-btn, .opp-chip, .glog-del) {
  -webkit-text-fill-color: currentColor;
  text-shadow: none;
}

html .deck-workspace .deck-log .primary-btn {
  background: var(--gold);
  color: #111;
}

html .deck-workspace .deck-log :is(.ghost-btn, .opp-chip, .glog-del) {
  --ink-text: var(--main-text);
  --sub-text: var(--main-sub);
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  border: 1px solid color-mix(in srgb, var(--main-text) 24%, transparent);
  color: var(--main-text);
  opacity: 1;
}

html .deck-workspace .deck-log :is(.danger-ghost, .glog-del) {
  color: var(--danger-ink);
}

html .deck-workspace .deck-log :is(.ghost-btn, .opp-chip, .glog-del):is(:hover, :focus-visible),
html .deck-workspace .deck-log .opp-chip.plan {
  border-color: var(--scheme-accent);
}

html .deck-workspace .deck-log button:disabled {
  color: var(--main-sub);
  border-style: dashed;
  cursor: not-allowed;
}

html .app > main.deck-workspace.page-frame > .page-content {
  padding-top: 16px;
  padding-bottom: max(96px, var(--deck-stack-tail, 0px));
  overflow-x: hidden;
}

html .app .deck-workspace .deck-controls {
  padding: 0;
  margin-block: 0;
  gap: 0;
  border: 0;
  background: var(--ink);
}

html .app .deck-workspace .builder-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0;
  gap: 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--main-text) 18%, transparent);
  border-radius: 0;
  background: transparent;
}

.deck-workspace .builder-tabs::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: calc(100% / 3);
  height: 2px;
  background: var(--scheme-accent);
  transform: translateX(calc(var(--deck-tab-index, 0) * 100%));
  transition: transform 180ms ease-out;
  pointer-events: none;
}

html .deck-workspace .b-tab {
  min-height: 46px;
  min-width: 0;
  padding: 8px 6px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--main-text);
  -webkit-text-fill-color: currentColor;
  background-clip: border-box;
  text-transform: none;
  font:
    600 13px/1.3 'Inter',
    system-ui,
    sans-serif;
  box-shadow: none;
}

html .deck-workspace .b-tab.active {
  background: transparent;
  color: var(--ink-text);
  box-shadow: none;
}

html .app .deck-workspace .deck-controls > .deck-dock {
  display: block;
  padding: 10px var(--page-gutter, 8px);
  border: 0;
  background: none;
}

.deck-selection {
  display: flex;
  align-items: center;
  min-width: 0;
  width: 100%;
  min-height: 46px;
  padding: 0 4px 0 12px;
  gap: 4px;
  border: 1px solid color-mix(in srgb, var(--main-text) 22%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
}

.deck-selection button,
.deck-sort {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--main-text);
  cursor: pointer;
}

.deck-selection button svg,
.deck-sort svg {
  width: 22px;
  height: 22px;
}

.deck-selection strong {
  flex: 1;
  min-width: 0;
  font-size: 12px;
}

.deck-selection .deck-danger {
  color: var(--danger-ink);
}

.deck-overview {
  position: relative;
  display: grid;
  grid-template-columns: clamp(88px, 28vw, 150px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--main-text) 18%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--main-text) 5%, var(--ink));
}

.deck-overview-constructed {
  grid-template-columns: minmax(0, 1fr);
}

.deck-overview-leaders,
.deck-overview-info {
  min-width: 0;
}

.deck-companion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.deck-overview-leaders .vg-card {
  width: 100%;
  margin: 0;
}

/* Keep each leader's badges behind the card overlapping it. The first
   leader's status belongs in its exposed top band, above the partner. */
.deck-overview-leaders .leader-stack .vg-card {
  isolation: isolate;
}

.deck-overview-leaders .leader-stack > .leader-wrap:first-child .card-badges {
  aspect-ratio: auto;
  align-items: flex-start;
  padding: 5px;
}

.deck-overview-leaders .dl-leader-cat {
  margin: 8px 0 0;
  padding: 0;
  color: var(--main-text);
  font:
    600 10px/1.4 'Inter',
    system-ui,
    sans-serif;
  text-align: center;
  letter-spacing: 0.04em;
}

.deck-overview-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deck-format {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-text);
  font:
    600 13px/1.5 'Inter',
    system-ui,
    sans-serif;
}

.deck-format svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.deck-overview .dl-bracket {
  margin: 0;
  color: var(--main-text);
  font:
    500 12px/1.5 'Inter',
    system-ui,
    sans-serif;
}

.deck-issue-preview {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  color: var(--main-text);
  font:
    400 12px/1.6 'Inter',
    system-ui,
    sans-serif;
  overflow-wrap: anywhere;
  white-space: pre-line;
  -webkit-text-fill-color: currentColor;
}

.deck-overview.has-issues .deck-issue-preview,
.deck-issue-flag {
  color: var(--danger-ink);
}

.deck-overview.has-issues .deck-format {
  padding-right: 28px;
}

.deck-issue-flag {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
}

.deck-issue-flag svg {
  width: 22px;
  height: 22px;
}
.deck-issue-flag[hidden] {
  display: none;
}

#capDeckCount.deck-toolbar-metric {
  cursor: default;
}

.deck-overview .dl-desc-text {
  color: var(--main-text);
  font:
    400 12px/1.6 'Inter',
    system-ui,
    sans-serif;
  overflow-wrap: anywhere;
}

html .deck-workspace .dl-bridge,
html .deck-workspace .cat-group,
html .deck-workspace .panel-card:not(.transfer-dialog) {
  border: 1px solid color-mix(in srgb, var(--main-text) 18%, transparent);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 16px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  --ink-text: var(--main-text);
  --sub-text: var(--main-sub);
  --brass: var(--main-brass);
}

html .app > main.deck-workspace:has(#dlPanelBox.dl-cover) {
  z-index: 200;
  overflow: visible;
}

html .app > main.deck-workspace:has(#dlPanelBox.dl-cover) > :is(.deck-controls, #dockAddCards) {
  visibility: hidden;
}

html .deck-workspace #dlPanelBox.dl-cover {
  position: fixed;
  z-index: 250;
  inset: 0;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  max-height: none;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--page-backdrop);
}

.deck-editor-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.deck-editor-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 16px 16px 96px;
}

html .deck-editor-body > .panel-card {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 20px;
}

html .deck-editor-body .df-compact {
  display: flex;
  flex-direction: column !important;
  gap: 16px;
}

.deck-editor-body .adv-row {
  margin: 0;
}

.deck-curve-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--main-text);
  font:
    400 13px/1.4 'Inter',
    system-ui,
    sans-serif;
}

.deck-curve-filter input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-ink);
}

html .deck-workspace :is(.curve-col, .ms-big) {
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

html .deck-workspace .curve-col:disabled {
  cursor: default;
}

html .deck-workspace .curve-bar {
  background: linear-gradient(
    180deg,
    var(--accent-ink),
    color-mix(in srgb, var(--accent-ink) 75%, var(--ink))
  );
}

html .deck-workspace .ms-prod {
  padding: 0;
  cursor: pointer;
}

.ms-prod-fill {
  display: block;
}

html .deck-workspace :is(.undo-btn, .hist-more),
html #historyOverlay .undo-btn {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--main-text) 32%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  color: var(--main-text);
  font:
    600 12px/1.4 'Inter',
    system-ui,
    sans-serif;
  text-shadow: none;
}

html .deck-workspace :is(.undo-btn, .hist-more):is(:hover, :focus-visible),
html #historyOverlay .undo-btn:is(:hover, :focus-visible) {
  border-color: var(--scheme-accent);
  color: var(--ink-text);
}

.deck-editor-body .adv-go-row {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  margin: 0;
}

.deck-editor-body .adv-go {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--gold);
  color: #111;
}

.deck-workspace .deck-note,
.deck-workspace .deck-game-summary {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  gap: 8px;
  color: var(--main-text);
  font-size: 12px;
  line-height: 1.5;
}

.deck-workspace .deck-note-action {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--main-text);
  text-align: left;
  font:
    500 12px/1.5 'Inter',
    system-ui,
    sans-serif;
  cursor: pointer;
}

.deck-note-action svg {
  flex: none;
  width: 18px;
  height: 18px;
}

html .deck-workspace .dl-bridge .dl-desc-text {
  padding: 0;
  border: 0;
  min-height: 0;
  font-size: 12px;
  line-height: 1.6;
}

html .deck-workspace .dl-bridge-desc,
html .deck-workspace .dl-bridge-adm {
  background: none;
  border: 0;
}

.deck-workspace .dl-desc-text,
.deck-workspace .dl-winrate,
.deck-workspace .dl60-wr {
  color: var(--main-text);
}

html .deck-workspace .cat-head {
  min-height: 44px;
  gap: 8px;
  padding: 0 0 12px;
  margin: 0 0 12px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--main-text) 18%, transparent);
  background: none;
  scroll-margin: 12px 0;
}

html .deck-workspace .cat-head .t {
  min-width: 0;
  color: var(--main-text);
  font:
    600 14px/1.4 'Inter',
    system-ui,
    sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

html .deck-workspace .cat-head :is(.cat-price, .n) {
  color: var(--main-text);
  font-size: 11px;
  background: none;
  -webkit-text-fill-color: currentColor;
}

html .deck-workspace .vg-row {
  margin: 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--main-text) 12%, transparent);
  border-radius: 0;
  background: none;
}

html .deck-workspace .vg-row .vg-hit {
  min-height: 48px;
  color: var(--main-text);
}

html .deck-workspace .vg-row :is(.vr-n, .vr-q, .vr-p) {
  color: var(--main-text);
  background: none;
  -webkit-text-fill-color: currentColor;
}

html .deck-workspace .vg-row .vr-n {
  font:
    500 13px/1.45 'Inter',
    system-ui,
    sans-serif;
}

.deck-list-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--main-text) 18%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
}

.deck-list-tools h2 {
  flex: none;
  margin: 0 auto 0 2px;
  color: var(--main-text);
  font:
    600 14px/1.4 'Inter',
    system-ui,
    sans-serif;
}

.deck-toolbar-metrics {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.deck-toolbar-metric {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  padding: 4px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--main-text);
  cursor: pointer;
}

.deck-toolbar-metric strong {
  color: inherit;
  font:
    500 12px/1.4 'Inter',
    system-ui,
    sans-serif;
  white-space: nowrap;
}

.deck-toolbar-metric .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.deck-view-picker {
  flex: none;
  margin-left: 0;
  min-width: 0;
}

.deck-view-picker summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--main-text) 18%, transparent);
  border-radius: 9px;
  color: var(--main-text);
  background: none;
  font:
    500 12px/1.4 'Inter',
    system-ui,
    sans-serif;
  cursor: pointer;
  list-style: none;
}

.deck-view-picker summary::-webkit-details-marker {
  display: none;
}

.deck-view-picker :is(.ib, svg) {
  display: block;
  width: 16px;
  height: 16px;
  flex: none;
}

.deck-view-caret {
  margin-left: auto;
}

.deck-view-menu {
  position: fixed;
  z-index: 200;
  display: flex;
  flex-direction: column;
  width: 156px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--main-text) 22%, transparent);
  border-radius: 12px;
  background: var(--ink);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.3);
}

.deck-view-picker:not([open]) .deck-view-menu {
  display: none;
}

.deck-view-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--main-text);
  font:
    500 13px/1.4 'Inter',
    system-ui,
    sans-serif;
  cursor: pointer;
  text-align: left;
}

.deck-view-menu button[aria-checked='true'] {
  color: var(--ink-text);
  background: color-mix(in srgb, var(--accent-ink) 8%, transparent);
}

.deck-view-menu button > span:last-child:not(:nth-child(2)) {
  margin-left: auto;
}

.deck-view-picker summary:focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}

html .app .deck-workspace #dockAddCards {
  position: fixed;
  top: auto;
  left: auto;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--gold);
  color: #111;
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.25);
}

#dockAddCards svg {
  width: 28px;
  height: 28px;
}

html #menuPop.deck-actions-page {
  height: 100dvh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  overflow: hidden;
  background: var(--page-backdrop);
}

html #menuPop.deck-actions-page > .overlay-inner {
  max-width: none;
  margin: 0;
  padding-bottom: 0;
  overflow: hidden;
}

html #deckLogOverlay {
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  overflow: hidden;
  background: var(--page-backdrop);
}

html #deckLogOverlay > .overlay-inner {
  max-width: none;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.deck-log-body {
  flex: 1;
  min-height: 0;
  padding: 16px var(--page-gutter, 8px) 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#deckLogBody {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.deck-inspiration {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  --ink-text: var(--main-text);
  --sub-text: var(--main-sub);
  --line: var(--main-field-line);
}

.deck-inspiration > .deck-title-row {
  display: none;
}

html .deck-inspiration :is(.browse-selects, .need-deck, .edh-sec) {
  position: static;
  margin: 0;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--main-text) 18%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  color: var(--main-text);
}

html .deck-inspiration .browse-selects {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.deck-inspiration .bs-row {
  margin: 0;
  width: 100%;
}
.deck-inspiration .cselect {
  width: 100%;
}

html .deck-inspiration :is(.ghost-btn, .cselect-btn) {
  min-height: 44px;
  border: 1px solid var(--main-field-line);
  color: var(--main-text);
  -webkit-text-fill-color: currentColor;
  background-color: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  border-radius: 12px;
  font:
    500 14px/1.4 'Inter',
    system-ui,
    sans-serif;
}

html .deck-inspiration .cselect-btn .cs-label {
  font: inherit;
  color: inherit;
  -webkit-text-fill-color: currentColor;
}

html .deck-inspiration .cselect-btn .cs-car {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--main-sub);
  box-shadow: none;
}

html .deck-inspiration .need-deck button {
  min-height: 44px;
  border-radius: 12px;
  background: var(--gold);
  color: #111;
}

.deck-inspiration #inspireResults {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
html .deck-inspiration .edh-sec {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
html .deck-inspiration .section-label {
  order: 0;
  margin: 0 !important;
  border: 0 !important;
  color: var(--main-text);
  background: none;
  -webkit-text-fill-color: currentColor;
  font:
    600 12px/1.4 'Inter',
    system-ui,
    sans-serif;
  letter-spacing: 0.08em;
}
html .deck-inspiration .sr-grid {
  order: 1;
  flex-wrap: wrap;
}
html .deck-inspiration .edh-more {
  order: 2;
}
html .deck-inspiration .deck-inspiration-category {
  display: block;
  padding: 0;
  overflow: hidden;
}
html .deck-inspiration .deck-inspiration-category > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}
.deck-inspiration-category > summary::-webkit-details-marker {
  display: none;
}
.deck-inspiration-category > summary > span:first-child {
  flex: 1;
}
.deck-inspiration-category > summary:focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: -3px;
  border-radius: 18px;
}
.inspiration-category-count {
  color: var(--main-sub);
  font-variant-numeric: tabular-nums;
}
.inspiration-category-chevron {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 24px;
  transform: rotate(0deg);
  transition: transform 160ms ease;
}
.deck-inspiration-category[open] .inspiration-category-chevron {
  transform: rotate(90deg);
}
.inspiration-category-chevron svg {
  width: 20px;
  height: 20px;
}
.inspiration-category-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px 16px;
}
@media (prefers-reduced-motion: reduce) {
  .inspiration-category-chevron {
    transition: none;
  }
}
.deck-inspiration > .hint {
  margin: 0;
  color: var(--main-sub);
}

html .deck-inspiration .nopr {
  color: var(--main-sub);
  -webkit-text-fill-color: currentColor;
}

html .deck-inspiration .edh-jump {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--gold);
  color: #111;
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.2);
}

.deck-actions-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

html .deck-actions-body > main {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 22px;
}

.deck-menu-intro {
  margin-bottom: 28px;
}

.deck-menu-intro > span,
.deck-menu-group > h2 {
  color: var(--main-text);
  font:
    600 11px/1.4 'Inter',
    system-ui,
    sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

html .deck-menu-intro h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--main-text);
  font:
    600 24px/1.4 'Cinzel',
    serif;
  overflow-wrap: anywhere;
}

.deck-menu-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.deck-menu-rename {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--ink-text);
  cursor: pointer;
}

.deck-menu-rename svg {
  width: 22px;
  height: 22px;
}

.deck-menu-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 26px;
}

.deck-menu-group > h2 {
  margin: 0 0 2px;
}

.deck-type-links {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.deck-type-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 48px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--main-text) 18%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  color: var(--main-text);
  font:
    500 11px/1.4 'Inter',
    system-ui,
    sans-serif;
  cursor: pointer;
}

.deck-type-link svg {
  flex: none;
  width: 18px;
  height: 18px;
}

.deck-type-link strong {
  margin-left: auto;
}

.deck-danger-group :is(strong, .hub-icon) {
  color: var(--danger-ink);
}

.deck-workspace button:focus-visible,
.deck-actions-page button:focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}

@media (max-width: 379px) {
  .deck-overview {
    gap: 12px;
    padding: 12px;
  }
}

/* Clip badges to their own card; only fully revealed cards expose controls. */
html.desk #decklistBox.deck-stack-columns {
  display: grid;
  grid-template-columns: repeat(var(--deck-category-columns), minmax(0, 1fr));
  align-items: start;
}
html.desk #decklistBox.deck-stack-columns > .deck-stack-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  width: auto;
}
html.desk #decklistBox.deck-stack-columns > :not(.deck-stack-column) {
  grid-column: 1 / -1;
}
html.desk #decklistBox .deck-stack-column > .cat-group {
  width: 100%;
  min-width: 0;
  margin: 0;
}
html #decklistBox .visual-grid.vg-stack {
  --stack-card-height: 300px;
  --stack-peek: 36px;
  flex-direction: column !important;
  justify-content: flex-start;
  isolation: isolate;
}

html #decklistBox .vg-stack > .vg-card {
  flex: none;
  height: var(--stack-peek);
  min-height: 0;
  margin: 0;
  aspect-ratio: auto;
  isolation: isolate;
  overflow: hidden;
  border-radius: 8px;
}

html #decklistBox .vg-stack.stack-ready > .vg-card {
  transition: height 160ms ease-out;
}

/* The uncovered bottom card stays fully visible on mouse devices. */
html #decklistBox .vg-stack > .vg-card:is(.stack-active, .stack-base) {
  height: var(--stack-card-height);
}

html
  #decklistBox
  .vg-stack
  > .vg-card:not(.stack-active):not(.stack-base)
  > :is(.card-badges, .dfc-flip-box, .foil-star, .gc-mark) {
  visibility: hidden;
  pointer-events: none;
}

html #decklistBox .vg-stack > .vg-card:not(.stack-active):not(.stack-base) > .vg-qty {
  top: 4px;
  right: 4px;
  padding: 1px 4px;
  font-size: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .deck-workspace .builder-tabs::after,
  html #decklistBox .vg-stack.stack-ready > .vg-card {
    transition: none;
  }
}

/* Direct access to the deck's cards outside the main deck. */
.deck-maybeboard-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 8px;
  border: 1px solid var(--main-field-line);
  border-radius: 9px;
  background: transparent;
  color: var(--main-text);
  font:
    500 12px/1.4 'Inter',
    sans-serif;
  cursor: pointer;
}
.deck-maybeboard-link span {
  color: var(--main-sub);
}
.deck-maybeboard-link:is(:hover, :focus-visible) {
  border-color: var(--scheme-accent);
}
#deckMaybeboardGroup {
  scroll-margin-block: 12px;
}
#deckMaybeboardHeading {
  scroll-margin-block: 12px;
}
#deckMaybeboardHeading:focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}

/* Source: styles/overrides/bulk-editor.css */
/* Full-screen bulk editing uses the menu's surfaces and a pinned save action. */

.deck-bulk-screen .deck-editor-body {
  padding-bottom: 20px;
}

html .deck-bulk-screen .bulk-editor-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bulk-editor-intro h2 {
  margin: 0;
  color: var(--main-text);
  font:
    600 22px/1.4 'Cinzel',
    serif;
  overflow-wrap: anywhere;
}

.bulk-editor-intro p {
  margin: 10px 0 0;
  color: var(--main-sub);
  font:
    400 13px/1.7 'Inter',
    system-ui,
    sans-serif;
}

.bulk-editor-label {
  color: var(--main-text);
  font:
    600 12px/1.5 'Inter',
    system-ui,
    sans-serif;
}

html .deck-bulk-screen #bulkText {
  width: 100%;
  height: clamp(280px, 50dvh, 560px);
  min-height: 240px;
  max-height: none;
  margin: 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--main-text) 24%, transparent);
  border-radius: 12px;
  background: var(--main-field);
  color: var(--main-text);
  -webkit-text-fill-color: currentColor;
  box-shadow: none;
  font:
    400 14px/1.65 'JetBrains Mono',
    monospace;
  resize: vertical;
  box-sizing: border-box;
}

html .deck-bulk-screen #bulkText:focus {
  outline: none;
  border-color: var(--scheme-accent);
}

.deck-bulk-screen .deck-editor-footer {
  flex: none;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid color-mix(in srgb, var(--main-text) 18%, transparent);
  background: var(--ink);
}

.bulk-editor-actions {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

html .deck-bulk-screen #applyBulkBtn {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--gold);
  color: #111;
  -webkit-text-fill-color: currentColor;
  text-shadow: none;
  font:
    600 14px/1.4 'Inter',
    system-ui,
    sans-serif;
}

.bulk-editor-report:empty {
  display: none;
}

.bulk-editor-report .report-list {
  border: 1px solid color-mix(in srgb, var(--main-text) 18%, transparent);
  border-radius: 12px;
}

.bulk-editor-report .report-row {
  border-bottom-width: 1px;
}

.bulk-editor-report .report-row.ok span:last-child {
  color: var(--success-ink);
}

.bulk-editor-report .report-row:is(.bad, .notfound) span:last-child {
  color: var(--danger-ink);
}

@media (max-width: 379px) {
  html .deck-bulk-screen .bulk-editor-card {
    padding: 16px;
  }
}

/* Source: styles/overrides/deck-prices.css */
/* Deck prices read downward through one viewport, using the menu's surfaces. */

html #deckPriceOverlay {
  --ink-text: var(--main-text);
  --sub-text: var(--main-sub);
  --line: color-mix(in srgb, var(--main-text) 18%, transparent);
  background: var(--page-backdrop);
  color: var(--main-text);
}

html #deckPriceOverlay > .overlay-inner {
  padding-bottom: 0;
  overflow: hidden;
}

html #deckPriceOverlay .app-navigation {
  position: relative !important;
  inset: auto !important;
  order: 1 !important;
  flex: none;
}

html #deckPriceOverlay .deck-prices-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 16px;
  width: 100%;
  max-width: 720px;
  min-height: 0;
  margin: 0 auto;
  padding: 16px 16px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  overflow-anchor: none;
}

html #deckPriceOverlay .panel-card {
  --ink-text: var(--main-text);
  --sub-text: var(--main-sub);
  --line: color-mix(in srgb, var(--main-text) 18%, transparent);
  --brass: var(--accent-ink);
  display: block;
  flex: none;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  color: var(--main-text);
}

.dpp-grid,
.dpp-budget-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dpp-metric,
.dpp-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 8px;
}

.dpp-metric {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--main-text) 3%, transparent);
}

.dpp-k {
  color: var(--main-sub);
  font:
    600 12px/1.5 'Inter',
    system-ui,
    sans-serif;
}

.dpp-metric .dpp-k {
  display: flex;
  align-items: center;
  min-height: 36px;
}

.dpp-v {
  color: var(--main-text);
  font:
    600 clamp(18px, 5.8vw, 26px)/1.3 'JetBrains Mono',
    monospace;
  overflow-wrap: anywhere;
}

.dpp-note {
  min-height: 18px;
  color: var(--main-sub);
  font:
    400 12px/1.5 'Inter',
    system-ui,
    sans-serif;
}

.dpp-note.over {
  color: var(--main-text);
  font-weight: 600;
}

.dpp-v.over::before,
.dpp-row.over .dpp-eur::before,
.dpp-note.over::before {
  content: '\26A0  ';
}

html #deckPriceOverlay h2 {
  margin: 0;
  color: var(--main-text);
  font:
    600 18px/1.4 'Cinzel',
    serif;
}

html #deckPriceOverlay .dpp-budget-heading {
  margin: 22px 0 12px;
}

html #deckPriceOverlay .dpp-in {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--main-text) 24%, transparent);
  border-radius: 12px;
  background: var(--main-field);
  color: var(--main-text);
  -webkit-text-fill-color: currentColor;
  box-shadow: none;
  font:
    400 16px/1.5 'JetBrains Mono',
    monospace;
  box-sizing: border-box;
}

.dpp-in::placeholder {
  color: var(--main-sub);
  opacity: 1;
}

html #deckPriceOverlay #dppAlt {
  width: 100%;
  margin-top: 16px;
}

.dpp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dpp-cnt {
  flex: none;
  color: var(--main-sub);
  font:
    400 12px/1.5 'JetBrains Mono',
    monospace;
}

.dpp-filter-label {
  margin-top: 16px;
  color: var(--main-text);
  font:
    600 12px/1.5 'Inter',
    system-ui,
    sans-serif;
}

html #deckPriceOverlay .pr-slider {
  margin: 8px 0 16px;
}

html #deckPriceOverlay .pr-vals {
  background: none;
  color: var(--main-text);
  -webkit-text-fill-color: currentColor;
  text-shadow: none;
}

html #deckPriceOverlay .pr-rail {
  border: 1px solid var(--line);
  background: var(--main-field);
  box-shadow: none;
}

html #deckPriceOverlay .pr-fill {
  background: var(--accent-ink);
}

html #deckPriceOverlay .pr-track input {
  --brass: var(--accent-ink);
}

.dpp-box {
  display: flex;
  flex-direction: column;
  max-height: none;
  overflow: visible;
}

html #deckPriceOverlay .dpp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  color: var(--main-text);
  text-align: left;
  font:
    400 13px/1.5 'Inter',
    system-ui,
    sans-serif;
  cursor: pointer;
}

html #deckPriceOverlay .dpp-row:last-child {
  border-bottom: 0;
}

.dpp-nm {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.dpp-q {
  margin-right: 6px;
  color: var(--main-sub);
}

.dpp-eur {
  flex: none;
  color: var(--main-text);
  font:
    600 13px/1.5 'JetBrains Mono',
    monospace;
}

#deckPriceOverlay :is(button, input):focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}

@media (max-width: 379px) {
  html #deckPriceOverlay .panel-card {
    padding: 16px;
  }

  .dpp-metric {
    padding: 10px;
  }
}

/* Source: styles/overrides/game-log.css */
/* Game logging shares the rounded, themed transfer-dialog surface. */

html #logGameOverlay {
  --game-log-top: max(16px, env(safe-area-inset-top));
  --game-log-bottom: max(16px, env(safe-area-inset-bottom));
  align-items: center;
  padding: var(--game-log-top) 16px var(--game-log-bottom);
  backdrop-filter: blur(6px);
}

html #logGameOverlay .game-log-dialog {
  max-width: 520px;
  min-height: 0;
  max-height: calc(100dvh - var(--game-log-top) - var(--game-log-bottom));
  justify-content: flex-start;
  padding: 0;
  overflow: hidden;
}

html #logGameOverlay .glog-form {
  flex: 1;
  gap: 14px;
  margin: 0;
}

html #logGameOverlay .glog-frow {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
}

html #logGameOverlay .glog-lbl {
  color: var(--main-text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  text-transform: none;
  letter-spacing: 0;
}

html #logGameOverlay .seg {
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
}

html #logGameOverlay .seg button {
  padding: 10px 6px;
  text-shadow: none;
}

html #logGameOverlay :is(.seg button, .cselect-btn, .opp-chip, input, textarea) {
  --ink-text: var(--main-text);
  --sub-text: var(--main-sub);
  border: 1px solid var(--transfer-line);
  background: var(--main-field);
  color: var(--main-text);
  -webkit-text-fill-color: currentColor;
}

html #logGameOverlay :is(input, textarea)::placeholder {
  color: var(--main-sub);
  opacity: 1;
}

html #logGameOverlay .seg button.active {
  border-color: var(--scheme-accent);
  background: var(--gold);
  color: #111;
}

html #logGameOverlay .glog-num {
  width: 100%;
  min-height: 44px;
  font:
    400 16px/1.4 'Inter',
    system-ui,
    sans-serif;
}

html #logGameOverlay #lgNote {
  min-height: 100px;
  max-height: none;
  font:
    400 14px/1.6 'Inter',
    system-ui,
    sans-serif;
}

html #logGameOverlay .cselect-btn {
  justify-content: space-between;
  width: 100%;
  text-align: left;
}

html #logGameOverlay .glog-form .cselect > .cselect-panel {
  --ink-text: var(--main-text);
  --sub-text: var(--main-sub);
  --line: var(--transfer-line);
  position: static !important;
  inset: auto !important;
  transform: none !important;
  max-height: min(38dvh, 320px) !important;
  min-width: 0;
  margin-top: 8px;
  padding: 6px;
  border: 1px solid var(--transfer-line);
  border-radius: 12px;
  background: var(--main-field);
  box-shadow: none;
}

html #logGameOverlay .cselect:not(.cs-cardgrid) .cselect-panel {
  flex-direction: column !important;
}

html #logGameOverlay .cs-cardgrid .cselect-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

html #logGameOverlay .cselect-panel .cselect-search {
  order: -1 !important;
  top: 0;
  bottom: auto;
}

html #logGameOverlay .cselect-opt {
  color: var(--main-text);
  background: none;
}

html #logGameOverlay .cselect-opt.sel {
  color: var(--ink-text);
  outline-color: var(--scheme-accent);
  background: color-mix(in srgb, var(--scheme-accent) 8%, transparent);
}

html #logGameOverlay .opp-chips:empty {
  display: none;
}

.game-log-actions {
  flex: none;
  padding: 16px 20px;
  border-top: 1px solid var(--transfer-line);
}

.game-log-actions button {
  width: 100%;
}

#logGameOverlay :is(button, input, textarea):focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}

@media (max-width: 379px) {
  html #logGameOverlay .glog-frow {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  html #logGameOverlay :is(.transfer-heading, .transfer-body, .game-log-actions) {
    padding: 16px;
  }
}

/* Source: styles/overrides/search-fields.css */
/* Shared deck-style search fields, including fields created by popup widgets. */
html .app-search-field,
html .app .page-searchbar.app-search-field {
  --search-field-line: color-mix(in srgb, var(--main-text) 26%, transparent);
  --search-field-fill: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 4px 0 12px !important;
  box-sizing: border-box;
  border: 1px solid var(--search-field-line) !important;
  border-radius: 12px !important;
  background: var(--search-field-fill) !important;
  box-shadow: none !important;
  color: var(--main-text);
}

html .app-search-field:focus-within,
html .app .page-searchbar.app-search-field:focus-within {
  --search-field-line: var(--scheme-accent);
}

/* Reserve matching scrollbar space so fields and results stay centered. */
html .app .tab-viewport:has(> .page-searchbar.app-search-field) {
  scrollbar-gutter: stable both-edges;
}

html .app-search-field > input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 10px 6px !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: none;
  background: none !important;
  box-shadow: none !important;
  color: var(--main-text) !important;
  font:
    400 14px/1.4 'Inter',
    system-ui,
    sans-serif;
}

html .app-search-field > input::placeholder {
  color: var(--main-sub);
  opacity: 1;
}

.app-search-field > input::-webkit-search-cancel-button {
  display: none;
}

.app-search-icon {
  display: flex;
  align-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--main-text);
}

.app-search-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

html .app-search-field > button:not(.sel-fab) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: auto;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  gap: 6px;
  padding: 8px !important;
  border: 0 !important;
  border-radius: 9px;
  background: none !important;
  box-shadow: none !important;
  color: var(--main-text) !important;
  font:
    600 12px/1.4 'Inter',
    system-ui,
    sans-serif;
  white-space: nowrap;
}

html .app-search-field > button::after {
  content: none !important;
}

html.desk .app-search-field.searchbar > button[title]:not(.in-chev):not(.sel-fab) {
  padding: 8px !important;
}

html .app-search-field > button[hidden] {
  display: none !important;
}

.app-search-field > button svg {
  width: 22px;
  height: 22px;
}

html .cr-qwrap.app-search-field {
  padding: 0 !important;
  align-items: stretch;
}

/* Every pinned search surface uses the same viewport-aligned page fade. */
html .app > main:has(.app-search-field),
html .overlay:has(.app-search-field),
html .app .deck-workspace .deck-controls,
html #crOverlay .cr-bar,
html .app .page-searchbar.app-search-field.sticky-searchbar::before {
  background: var(--page-backdrop);
  background-attachment: fixed;
}

html #crOverlay .cr-bar {
  border-top: 0;
}

/* Paint the sticky field above its full-width fading backdrop. */
html .app .page-searchbar.app-search-field.sticky-searchbar::before {
  z-index: -2;
}

html .app .page-searchbar.app-search-field.sticky-searchbar::after {
  content: '';
  position: absolute;
  inset: -1px;
  z-index: -1;
  pointer-events: none;
  border: 1px solid var(--search-field-line);
  border-radius: inherit;
  background: var(--search-field-fill);
}

/* Source: styles/overrides/headers.css */
/* One visual header for main pages, full-screen tools, and filter panels. */

:root {
  --app-titlebar-h: calc(64px + env(safe-area-inset-top));
  --app-header-h: var(--app-titlebar-h);
  --app-titlebar-line: color-mix(in srgb, var(--ink) 70%, #000);
}

html .app-titlebar {
  --ink-text: var(--main-text);
  --sub-text: var(--main-sub);
  --line: var(--main-field-line);
  display: grid !important;
  grid-template-columns: 44px minmax(0, 1fr) minmax(44px, auto);
  align-items: center;
  flex: none;
  width: 100%;
  height: var(--app-titlebar-h) !important;
  min-height: var(--app-titlebar-h) !important;
  margin: 0;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px !important;
  gap: 10px;
  box-sizing: border-box;
  border: 0;
  border-bottom: 1px solid var(--app-titlebar-line) !important;
  background: var(--ink) !important;
  box-shadow: none !important;
  color: var(--main-text);
}

html .app-titlebar > .brand-txt,
html #advancedSearchScreen .app-titlebar > h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  height: 44px;
  max-height: none;
  margin: 0 !important;
  padding: 0;
  border: 0;
  background: none;
  color: var(--main-text) !important;
  -webkit-text-fill-color: currentColor !important;
  font:
    800 18px/1.2 'Cinzel',
    serif;
  letter-spacing: 0.08em;
  text-align: center;
  white-space: normal;
}

html .app-titlebar > .header-menu {
  position: relative !important;
}

.app-title-text {
  display: block;
  width: 100%;
  min-width: 0;
}

html .app-titlebar .header-filter {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  box-shadow: none;
  color: var(--ink-text);
  cursor: pointer;
}

.app-titlebar .header-filter svg {
  width: 24px;
  height: 24px;
}

.app-titlebar .header-filter:focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}

/* The content may be constrained; its title bar always spans the screen. */
html .overlay > .overlay-inner:has(> .app-titlebar) {
  max-width: none;
  padding-inline: 0;
}

html #advancedSearchScreen > .app-titlebar {
  grid-template-columns: 48px minmax(0, 1fr) 48px;
}

.app-page-subtitle {
  flex: none;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-text);
  font:
    400 13px/1.5 'Inter',
    system-ui,
    sans-serif;
  text-align: center;
  overflow-wrap: anywhere;
}

@media (max-width: 359px) {
  html .app-titlebar {
    padding-left: 8px !important;
    padding-right: 8px !important;
    gap: 5px;
  }
}

/* Source: styles/overrides/collection.css */
/* Collection folders and the full-screen binder editor share the menu palette. */

.collection-folder-section {
  margin: 10px 0 24px;
}

.collection-folder-section > .section-label,
.collection-unsorted-title {
  margin: 0 0 12px;
  font-size: 12px;
}

.collection-folder-section > .deck-grid {
  margin: 0;
}

.collection-page .binder-no-art {
  min-height: 110px;
  gap: 8px;
  padding: 20px 12px;
}

.collection-page .binder-no-art .binder-glyph-row {
  margin: 0;
}

.collection-page .as-list .binder-no-art {
  min-height: 52px;
  padding: 11px 14px;
}

.collection-page .col-group-label {
  display: block;
  font-size: 12px;
}

.col-group-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-align: left;
  cursor: pointer;
}

.col-group-toggle:focus-visible {
  border-radius: 6px;
  outline: 2px solid var(--scheme-accent);
  outline-offset: 3px;
}

.col-group-chevron {
  flex: none;
  width: 18px;
  height: 18px;
}

.col-group-toggle[aria-expanded='false'] .col-group-chevron {
  transform: rotate(-90deg);
}

html .collection-page .col-group[hidden] {
  display: none;
}

.col-group-colors {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 3px;
}

.col-group-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.col-group-label .cg-n {
  flex: none;
}

html .collection-page:has(#colSelFab) :is(#colFab, #binderFab) {
  display: none !important;
}

html #binderRulesSheet {
  --ink-text: var(--main-text);
  --sub-text: var(--main-sub);
  --line: color-mix(in srgb, var(--main-text) 18%, transparent);
  --brass: var(--accent-ink);
  z-index: 205;
  height: 100dvh;
  overflow: hidden;
  background: var(--page-backdrop);
  color: var(--main-text);
  font-family: 'Inter', system-ui, sans-serif;
  animation: binder-settings-enter 0.24s ease-out;
}

html #binderRulesSheet.leaving {
  pointer-events: none;
  animation: binder-settings-exit 0.24s ease-in forwards;
}

html #binderRulesSheet > .overlay-inner {
  max-width: none;
  height: 100%;
  padding: 0;
  overflow: hidden;
}

html #binderRulesSheet .binder-settings-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 20px;
  width: 100%;
  max-width: 720px;
  min-height: 0;
  margin: 0 auto;
  padding: 20px 16px 24px;
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

#binderRulesSheet .binder-settings-body > * {
  flex: none;
}

.binder-settings-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
}

.binder-settings-card h2 {
  margin: 0;
  color: var(--main-text);
  font:
    600 18px/1.4 'Cinzel',
    serif;
}

.binder-settings-card p {
  margin: 0;
  color: var(--main-sub);
  font-size: 13px;
  line-height: 1.6;
}

#binderRulesSheet .br-h {
  color: var(--main-sub);
}

#binderRulesSheet :is(.br-chip, .br-dd-btn) {
  border: 1px solid color-mix(in srgb, var(--main-text) 18%, transparent);
  background: color-mix(in srgb, var(--main-text) 5%, var(--ink));
  color: var(--main-text);
  font-family: inherit;
}

#binderRulesSheet .br-chip.active {
  border-color: var(--scheme-accent);
  background: var(--gold);
  color: #111;
}

#binderRulesSheet .br-chip svg {
  flex: none;
}

#binderRulesSheet .br-dd-panel {
  flex-direction: column;
  z-index: 3;
}

#binderRulesSheet .br-actions {
  flex: none;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  box-sizing: border-box;
  border-top: 1px solid var(--line);
}

#binderRulesSheet .br-actions > button {
  min-height: 46px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
}

#binderRulesSheet #brNone {
  border: 1px solid color-mix(in srgb, var(--main-text) 18%, transparent);
  background: color-mix(in srgb, var(--main-text) 5%, var(--ink));
  color: var(--main-text);
}

#binderRulesSheet #brSave {
  border: 1px solid var(--scheme-accent);
  background: var(--gold);
  color: #111;
}

#binderRulesSheet button:focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 3px;
}

html #root[data-render-suspended='price-history'] {
  content-visibility: hidden;
  contain-intrinsic-size: auto 100vh;
}

#phOverlay {
  contain: layout style paint;
}

.ph-loading {
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--sub-text);
}

.ph-loading.ph-refresh {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-height: 0;
  padding: 12px;
  border: 1px solid var(--pop-line);
  border-radius: 12px;
  background: var(--pop-bg);
  white-space: nowrap;
}

.ph-movers-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 0;
  color: var(--sub-text);
  font-size: 13px;
}

.ph-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  color: var(--ink-text);
  font-size: 12px;
}

.ph-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ph-legend i {
  width: 22px;
  border-top: 2px solid var(--accent-ink);
}

.ph-legend .ph-count-key {
  border-top: 2px dashed var(--ink-text);
}

.collection-stats-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 520px;
  margin: 0 auto 20px;
  color: var(--main-text);
}

.collection-stats-summary > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--main-text) 18%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
}

.collection-stats-summary span {
  color: var(--main-sub);
  font-size: 12px;
}

.collection-stats-summary strong {
  font:
    600 clamp(18px, 5vw, 26px)/1.3 'JetBrains Mono',
    monospace;
  overflow-wrap: anywhere;
}

@keyframes binder-settings-enter {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes binder-settings-exit {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  html #binderRulesSheet,
  html #binderRulesSheet.leaving {
    animation: none;
  }
}

/* Source: styles/overrides/playing.css */
.playing-proxy-option {
  display: flex;
  grid-column: 1 / -1;
  flex: none;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--main-text) 18%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  color: var(--main-text);
  font:
    500 12px/1.5 'Inter',
    system-ui,
    sans-serif;
  cursor: pointer;
}

.playing-proxy-option input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  accent-color: var(--gold);
}

.playing-proxy-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.playing-proxy-option:focus-within {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}

.playing-decks {
  white-space: normal;
  overflow-wrap: anywhere;
}

.cb.cb-proxy {
  width: auto;
  min-width: 0;
  padding: 3px 6px;
  color: #111;
  background: var(--gold);
  font:
    700 10px/1.3 'Inter',
    system-ui,
    sans-serif;
}

.deck-proxy-label {
  flex: none;
  padding: 2px 5px;
  border-radius: 5px;
  color: #111;
  background: var(--gold);
  font:
    700 10px/1.3 'Inter',
    system-ui,
    sans-serif;
}

/* Source: styles/overrides/wants.css */
.wants-select-tools {
  display: flex;
  justify-content: flex-end;
  margin: 0 16px 12px;
}

html .wants-select-tools button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--main-text) 20%, transparent);
  border-radius: 12px;
  background: transparent;
  color: var(--main-text);
  font:
    500 13px/1.4 'Inter',
    system-ui,
    sans-serif;
}

.wants-select-tools svg,
.wants-selection-bar svg {
  width: 22px;
  height: 22px;
}

html .wants-selection-bar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 4px;
  width: min(480px, calc(100% - 32px));
  padding: 8px;
  box-sizing: border-box;
  transform: translateX(-50%);
  border: 1px solid color-mix(in srgb, var(--main-text) 22%, transparent);
  border-radius: 18px;
  background: var(--page-backdrop);
  box-shadow: 0 8px 32px rgb(0 0 0 / 0.3);
  color: var(--main-text);
}

html .wants-selection-bar[hidden],
.wants-selecting :is(#binderFab, .want-have) {
  display: none;
}

.wants-selecting .wants-select-tools {
  visibility: hidden;
}

.wants-page.wants-selecting {
  padding-bottom: 100px;
}

#wantSelectionCount {
  flex: 1;
  min-width: 0;
  padding-left: 4px;
  font:
    600 13px/1.4 'Inter',
    system-ui,
    sans-serif;
}

html .wants-selection-bar button {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--main-text) 18%, transparent);
  border-radius: 12px;
  background: transparent;
  color: var(--main-text);
}

html .wants-selection-bar #wantSelectionAdd {
  border: 0;
  background: var(--gold);
  color: #111;
}

html .wants-selection-bar #wantSelectionRemove {
  border-color: color-mix(in srgb, var(--danger-ink) 40%, transparent);
  color: var(--danger-ink);
}

.wants-selection-bar button:focus-visible,
.want-tile:focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}

.wants-page .want-tile {
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: pan-y;
}

.wants-page .want-tile .csel-mark {
  left: 8px;
  right: auto;
}

/* Source: styles/overrides/card-transfers.css */
/* Card transfers share the menu's surfaces, with fixed headings and actions. */
html .card-transfer-backdrop {
  z-index: 1300;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  background: rgb(0 0 0 / 0.55);
  backdrop-filter: blur(6px);
}

html
  :is(
    #addCollOverlay,
    #csAddSheet,
    #binderConflict,
    #collectionCardMove,
    #dvSheet,
    #scannerSettingsDialog,
    #scannerDestinationPicker
  )
  > .card-transfer-dialog {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  width: 100%;
  max-width: 440px;
  max-height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--transfer-line);
  border-radius: 22px;
  background: var(--page-backdrop);
}

.deck-versions-backdrop :is(.dv-description, .dv-empty) {
  margin: 0;
  color: var(--main-sub);
  font:
    400 13px/1.6 'Inter',
    system-ui,
    sans-serif;
}
.deck-versions-backdrop .dv-list {
  flex: none;
  flex-direction: column;
  max-height: none;
  overflow: visible;
  gap: 10px;
  margin: 0;
}
.deck-versions-backdrop .dv-row {
  flex-wrap: wrap;
  padding: 14px;
  border: 1px solid var(--transfer-line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
}
.deck-versions-backdrop .dv-txt {
  flex-basis: 100%;
  gap: 6px;
  overflow-wrap: anywhere;
}
.deck-versions-backdrop .dv-txt b {
  color: var(--main-text);
  font:
    600 14px/1.5 'Inter',
    system-ui,
    sans-serif;
}
.deck-versions-backdrop .dv-txt span {
  color: var(--main-sub);
  font:
    400 12px/1.5 'Inter',
    system-ui,
    sans-serif;
}
.dv-actions {
  display: flex;
  justify-content: flex-end;
  flex: 1;
  gap: 8px;
}
html .deck-versions-backdrop .dv-actions button {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 13px;
}

.card-transfer-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 16px;
  min-height: 0;
  padding: 18px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.card-transfer-preview,
.card-transfer-dialog .acm-fan {
  flex: none;
  margin: 0;
  text-align: center;
}

.card-transfer-preview img {
  display: inline-block;
  width: 80px;
  max-height: 112px;
  object-fit: contain;
  border-radius: 6px;
}

.card-transfer-dialog .collection-add-fields .adv-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--transfer-line);
}

.card-transfer-dialog .collection-add-fields .adv-row:last-child {
  border-bottom: 0;
}

.card-transfer-dialog :is(.adv-row > label, .collection-field-label, .card-transfer-amount) {
  color: var(--main-text);
  font:
    500 13px/1.5 'Inter',
    system-ui,
    sans-serif;
}

html .card-transfer-dialog :is(.ghost-btn, .col-filter-input, .nsel-btn, .pd-btn) {
  min-width: 0;
  min-height: 44px;
  box-sizing: border-box;
  margin: 0;
  border: 1px solid var(--transfer-line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  color: var(--main-text);
  -webkit-text-fill-color: currentColor;
  font:
    400 16px/1.4 'Inter',
    system-ui,
    sans-serif;
}

.card-transfer-dialog .collection-add-quantity {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

html .card-transfer-dialog .collection-add-quantity .ghost-btn {
  flex: none;
  width: 44px;
  padding: 0;
}

html .card-transfer-dialog #acQty {
  flex: 1;
  width: 60px;
  max-width: 70px;
  padding: 8px 2px;
  text-align: center;
}

html .card-transfer-dialog .pd-panel {
  border: 1px solid var(--transfer-line);
  background: var(--page-backdrop);
}

html .card-transfer-dialog .pd-opt {
  min-height: 44px;
  color: var(--main-text);
}

/* Printing labels carry their own older surface colors and inline prices. */
html .card-transfer-dialog :is(.pd-btn, .pd-opt) :is(.set-chip, .pd-l, .pd-l > span) {
  color: var(--main-text) !important;
  -webkit-text-fill-color: currentColor;
}

.card-transfer-dialog .ac-foil {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

html .card-transfer-dialog input[type='checkbox'] {
  flex: none;
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--accent-ink);
}

.card-transfer-amount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-transfer-dialog .add-qty {
  gap: 8px;
  padding: 0;
}

html .card-transfer-dialog .add-qty .ghost-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
}

.card-transfer-dialog .ghost-btn svg {
  width: 20px;
  height: 20px;
}

.card-transfer-dialog .hub-card {
  flex: none;
  width: 100%;
  margin: 0;
  border: 1px solid var(--transfer-line);
  border-radius: 14px;
}

.card-transfer-dialog .hub-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

.card-transfer-dialog .hub-copy strong {
  color: var(--main-text);
  font-size: 14px;
}

.card-transfer-dialog .hub-copy small {
  color: var(--main-text);
  font-size: 12px;
}

.binder-choice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.binder-printing-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: none;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--main-text);
  font:
    400 13px/1.5 'Inter',
    system-ui,
    sans-serif;
}

.binder-printing-preview img {
  width: 136px;
  max-height: 190px;
  object-fit: contain;
  border-radius: 8px;
}

.binder-printing-preview small {
  color: var(--ink-text);
  font-size: 12px;
}

.binder-choice-remember {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--main-text);
  font-size: 13px;
  line-height: 1.6;
}

.card-transfer-actions {
  display: flex;
  flex: none;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--transfer-line);
}

html .card-transfer-dialog :is(.card-transfer-actions button, .primary-btn) {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  padding: 12px;
  font:
    600 14px/1.5 'Inter',
    system-ui,
    sans-serif;
  white-space: normal;
  overflow-wrap: anywhere;
}

html .card-transfer-dialog .card-transfer-body > .primary-btn {
  flex: none;
}

html .card-transfer-dialog .card-transfer-cancel {
  border-color: color-mix(in srgb, var(--danger-ink) 45%, transparent);
  background: color-mix(in srgb, var(--danger-ink) 6%, var(--ink));
  color: var(--danger-ink);
}

@media (max-width: 379px) {
  .card-transfer-dialog .collection-add-fields .adv-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .card-transfer-dialog :is(.transfer-heading, .card-transfer-body, .card-transfer-actions) {
    padding: 16px;
  }
}

@media (prefers-reduced-transparency: reduce) {
  html .card-transfer-backdrop {
    backdrop-filter: none;
  }
}

/* Source: styles/overrides/scanner.css */
/* Live camera, newest-first detection log, and optional card review. */
.scanner-setting-field,
.scanner-setting-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  min-height: 48px;
  cursor: pointer;
  border-bottom: 1px solid color-mix(in srgb, var(--main-text) 20%, transparent);
}
.scanner-setting-field > span:first-child,
.scanner-setting-toggle > span {
  flex: 1;
  min-width: 0;
}
.scanner-settings strong {
  display: block;
  font:
    600 14px/1.5 'Inter',
    sans-serif;
  color: var(--main-text);
}
.scanner-settings small {
  display: block;
  margin-top: 5px;
  font:
    400 12px/1.6 'Inter',
    sans-serif;
  color: var(--main-sub);
}
.scanner-setting-number {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.scanner-setting-number input {
  box-sizing: border-box;
  width: 100px;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--main-text) 28%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  color: var(--main-text);
  font:
    400 16px/1.4 'Inter',
    sans-serif;
}
.scanner-setting-number > span {
  color: var(--main-sub);
  font:
    400 11px/1.4 'Inter',
    sans-serif;
}
.scanner-setting-toggle input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--gold);
}
.scanner-settings-note {
  margin: 14px 0 0;
  color: var(--main-sub);
  font:
    400 11px/1.7 'Inter',
    sans-serif;
}
#scannerDestinationPicker .card-transfer-body {
  gap: 10px;
}
#scannerDestinationPicker h3 {
  margin: 12px 0 0;
  color: var(--main-text);
  font:
    600 13px/1.5 'Inter',
    system-ui,
    sans-serif;
}
#scannerDestinationPicker .hub-card {
  margin: 0;
  min-height: 48px;
}
html #scannerSettingsDialog .scanner-setting-number input {
  width: 100px;
}
html #scannerSettingsDialog .scanner-setting-toggle input {
  width: 24px;
  height: 24px;
  padding: 0;
}
@media (max-width: 359px) {
  .scanner-setting-field {
    flex-direction: column;
    align-items: stretch;
  }
  .scanner-setting-number {
    flex-direction: row;
    align-items: center;
  }
}
html #cardScannerOverlay {
  z-index: 230;
}
html #cardScannerOverlay > .scanner-screen {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
  background: var(--page-backdrop);
  color: var(--main-text);
  --ink-text: var(--main-text);
  --sub-text: var(--main-sub);
  --scanner-line: color-mix(in srgb, var(--main-text) 24%, transparent);
}
.scanner-screen > .app-titlebar {
  position: relative !important;
  flex: none;
}
html #cardScannerOverlay .scanner-body {
  display: block;
  flex: 1;
  min-height: 0;
  overflow: auto;
  width: 100%;
  max-width: 760px;
  margin: auto;
  padding: 20px 16px 28px !important;
  box-sizing: border-box;
  overscroll-behavior: contain;
}
.scanner-intro p {
  margin: 0 0 16px;
}
.scanner-intro p,
.scanner-credits {
  font:
    400 13px/1.7 'Inter',
    sans-serif;
  color: var(--main-sub);
}
.scanner-badge {
  display: inline-block;
  border: 1px solid var(--scheme-accent);
  border-radius: 20px;
  padding: 4px 10px;
  color: var(--ink-text);
  font:
    600 11px/1.5 'Inter',
    sans-serif;
}
html :is(#cardScannerOverlay, #cardScannerCamera) [hidden] {
  display: none !important;
}
.scanner-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--scanner-line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
}
.scanner-review-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}
.scanner-review-images:not(:has(.scanner-review-capture)) {
  grid-template-columns: minmax(0, 1fr);
  max-width: 180px;
}
.scanner-review-images figure {
  margin: 0;
  min-width: 0;
}
.scanner-review-images img {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 7;
  object-fit: contain;
  border-radius: 7px;
}
.scanner-review-images figcaption {
  margin-top: 5px;
  text-align: center;
  font:
    400 11px/1.5 'Inter',
    sans-serif;
  color: var(--main-sub);
}
.scanner-result h2 {
  margin: 6px 0;
  font:
    600 17px/1.4 'Cinzel',
    serif;
  overflow-wrap: anywhere;
}
.scanner-result p,
.scanner-result small {
  display: block;
  color: var(--main-sub);
  font:
    400 12px/1.6 'Inter',
    sans-serif;
}
.scanner-eyebrow {
  color: var(--ink-text);
  font:
    600 10px/1.4 'Inter',
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.scanner-footer {
  flex: none;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--scanner-line);
  background: var(--ink);
}
html .scanner-screen .primary-btn {
  width: 100%;
  max-width: 728px;
  display: block;
  min-height: 46px;
  padding: 12px 16px;
  margin: 0 auto;
  border: 0;
  border-radius: 12px;
  background: var(--gold);
  color: #111;
  font:
    600 14px/1.5 'Inter',
    sans-serif;
}
.scanner-secondary {
  min-height: 44px;
  padding: 8px 12px;
  margin-top: 10px;
  border: 1px solid color-mix(in srgb, var(--main-text) 24%, transparent);
  border-radius: 10px;
  background: transparent;
  color: var(--main-text);
  font:
    500 12px/1.4 'Inter',
    sans-serif;
}
.scanner-collection {
  margin-top: 16px;
  padding: 6px 16px;
  border: 1px solid var(--scanner-line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
}
.scanner-collection .adv-row {
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--scanner-line);
}
.scanner-collection .adv-row:last-child {
  border-bottom: 0;
}
.scanner-collection :is(.adv-row > label, .collection-field-label) {
  color: var(--main-text);
  font:
    500 12px/1.5 'Inter',
    sans-serif;
}
html
  #cardScannerOverlay
  .scanner-collection
  :is(.col-select, .cselect-btn, .pd-btn, #acQty, .ghost-btn) {
  box-sizing: border-box;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--scanner-line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  color: var(--main-text);
  font:
    400 16px/1.4 'Inter',
    sans-serif;
}
.scanner-collection .collection-add-quantity {
  display: flex;
  gap: 6px;
}
.scanner-collection .ac-foil {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.scanner-collection #acFoil {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--gold);
}
.scanner-collection .pd-panel {
  top: calc(100% + 4px);
  bottom: auto;
  max-height: min(230px, 40dvh);
  border: 1px solid var(--scanner-line);
  background: var(--ink);
  color: var(--main-text);
}
.scanner-collection .pd-opt {
  min-height: 44px;
}
html:has(#cardScannerOverlay) #nselPop {
  --ink-text: var(--main-text);
  --sub-text: var(--main-sub);
  --line: color-mix(in srgb, var(--main-text) 24%, transparent);
  --brass: var(--accent-ink);
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ink);
  color: var(--main-text);
}
html:has(#cardScannerOverlay) #nselPop .cselect-opt {
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  color: var(--main-text);
  font:
    400 14px/1.5 'Inter',
    sans-serif;
}
html:has(#cardScannerOverlay) #nselPop .cselect-opt.on {
  background: color-mix(in srgb, var(--main-text) 8%, var(--ink));
  color: var(--ink-text);
}
.scanner-credits {
  margin-top: 20px;
}
.scanner-credits p {
  margin: 10px 0 0;
}
@media (max-width: 359px) {
  .scanner-collection .adv-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
}
:is(.scanner-screen, .scanner-camera-screen) button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.scanner-credits a {
  color: var(--ink-text);
}
html #cardScannerCamera {
  position: fixed;
  inset: 0;
  z-index: 220;
  width: 100%;
  height: 100dvh;
  max-width: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #080b0d;
  animation: scanner-camera-enter 0.24s ease-out;
}
@keyframes scanner-camera-enter {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}
html #cardScannerCamera.leaving {
  animation: scanner-camera-exit 0.24s ease-in forwards;
  pointer-events: none;
}
@keyframes scanner-camera-exit {
  from {
    transform: var(--scanner-exit-start, translateX(0));
  }
  to {
    transform: translateX(100%);
  }
}
html #cardScannerCamera .scanner-camera-header {
  position: relative !important;
  flex: none;
  width: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 88px;
  align-items: center;
  padding-inline: 12px;
  background: var(--ink);
  color: var(--head-ink);
}
.scanner-camera-header .brand-txt {
  text-align: center;
  justify-self: center;
}
.scanner-camera-header > button {
  justify-self: start;
}
.scanner-camera-header .scanner-badge {
  justify-self: end;
  padding: 3px 7px;
  font-size: 9px;
}
.scanner-camera-header #scannerCameraSettings {
  min-height: 44px;
  background: transparent;
  cursor: pointer;
}
.scanner-camera-header #scannerCameraSettings:focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}
html #cardScannerCamera .scanner-camera-stage {
  position: absolute;
  inset: 0;
  height: 100%;
  min-height: 0;
  touch-action: none;
  padding: 0 !important;
  margin: 0;
  overflow: hidden;
  isolation: isolate;
}
.scanner-camera-scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  background: #080b0d;
}
#scannerVideo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scanner-camera-focus {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: crosshair;
  -webkit-tap-highlight-color: transparent;
}
.scanner-camera-focus:focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: -4px;
}
.scanner-camera-border {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.scanner-camera-border polygon {
  fill: rgb(241 206 98 / 0.04);
  stroke: #f1ce62;
  stroke-width: 3px;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px #000);
}
.scanner-ignored {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  width: fit-content;
  max-width: calc(100% - 24px);
  box-sizing: border-box;
  margin: 0 auto;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgb(0 0 0 / 0.8);
  color: #f1ce62;
  text-align: center;
  font:
    500 11px/1.5 'Inter',
    sans-serif;
  pointer-events: none;
}
.scanner-framerate {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 9px;
  border-radius: 8px;
  background: rgb(0 0 0 / 0.7);
  color: #fff;
  font:
    500 12px/1.5 'Inter',
    sans-serif;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  max-width: 70%;
}
.scanner-framerate small {
  display: block;
  font-size: 10px;
  text-align: right;
  white-space: pre-line;
}
.scanner-camera-statusbar {
  position: relative;
  z-index: 2;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  min-height: 61px;
  box-sizing: border-box;
  background: var(--ink);
  border-top: 1px solid color-mix(in srgb, var(--main-text) 24%, transparent);
  color: var(--main-text);
}
.scanner-log-actions {
  display: flex;
  flex: none;
  gap: 10px;
  margin-left: auto;
}
.scanner-log-actions button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--main-text) 24%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  color: var(--main-text);
}
.scanner-log-actions button.scanner-log-add {
  border: 0;
  background: var(--gold);
  color: #111;
}
.scanner-log-actions button.scanner-log-add:disabled {
  border: 1px solid color-mix(in srgb, var(--main-text) 24%, transparent);
  background: color-mix(in srgb, var(--main-text) 8%, var(--ink));
  color: var(--main-sub);
  opacity: 1;
  cursor: not-allowed;
}
.scanner-log-actions svg {
  width: 24px;
  height: 24px;
}
.scanner-selection-count {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--main-text);
  font:
    500 12px/1.5 'Inter',
    sans-serif;
}
.scanner-selection-count svg {
  width: 16px;
  height: 16px;
}
#scannerCameraStatus {
  flex: 1;
  min-width: 0;
  min-height: 18px;
  margin: 0;
  text-align: center;
  font:
    400 12px/1.5 'Inter',
    sans-serif;
  color: #fff;
}
.scanner-camera-statusbar .scanner-secondary {
  flex: none;
  margin-top: 0;
}
.scanner-log-section {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
  background: var(--page-backdrop);
  color: var(--main-text);
  border-top: 1px solid color-mix(in srgb, var(--main-text) 24%, transparent);
}
.scanner-log-header {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}
.scanner-log-header h2 {
  margin: 0;
  font:
    600 14px/1.4 'Inter',
    sans-serif;
}
#scannerLogCount {
  color: var(--main-sub);
  font:
    400 12px/1.4 'Inter',
    sans-serif;
}
.scanner-log-scroll {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 900px;
  align-self: center;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom));
}
#scannerLogEmpty {
  margin: 8px 4px;
  color: var(--main-sub);
  font:
    400 13px/1.6 'Inter',
    sans-serif;
}
#scannerDetections {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.scanner-detection-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 80px;
  box-sizing: border-box;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--main-text) 24%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--main-text) 4%, var(--ink));
  color: var(--main-text);
  font-family: 'Inter', sans-serif;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: pan-y;
}
.scanner-detection.selected .scanner-detection-button {
  border-color: var(--scheme-accent);
  background: color-mix(in srgb, var(--scheme-accent) 10%, var(--ink));
  box-shadow: inset 0 0 0 1px var(--scheme-accent);
}
.scanner-detection-owned {
  display: block;
  margin-top: 5px;
  color: var(--main-sub);
  font-size: 11px;
  line-height: 1.4;
}
.scanner-detection-owned.owned {
  color: var(--main-text);
}
html .scanner-deck-picker {
  z-index: 250;
  align-items: center;
}
html .scanner-deck-picker > .scanner-deck-sheet {
  display: flex;
  flex-direction: column;
  max-width: 440px;
  gap: 16px;
}
.scanner-deck-sheet .nd-heading p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--main-sub);
}
.scanner-deck-sheet .hub-card {
  padding: 14px 12px;
  gap: 12px;
  border-radius: 14px;
}
.scanner-deck-copy {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.scanner-deck-list {
  display: grid;
  flex: 0 1 auto;
  min-height: 0;
  gap: 8px;
  max-height: min(44dvh, 400px);
  overflow: auto;
  overscroll-behavior: contain;
}
.scanner-deck-empty {
  margin: 0;
  color: var(--main-sub);
  font-size: 12px;
}
.scanner-detection-button:disabled {
  opacity: 0.8;
}
.scanner-detection-button img,
.scanner-detection-art {
  width: 43px;
  height: 60px;
  border-radius: 4px;
  object-fit: contain;
}
.scanner-detection-images {
  display: flex;
  align-items: center;
  gap: 6px;
}
.scanner-detection-art {
  display: grid;
  place-items: center;
  color: var(--ink-text);
}
.scanner-detection-details {
  min-width: 0;
}
.scanner-detection-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
}
.scanner-detection-set {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 4px;
  color: var(--main-sub);
  font-size: 11px;
  line-height: 1.4;
}
.scanner-detection-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.scanner-detection-meta time {
  font-size: 10px;
  color: var(--main-sub);
}
.scanner-detection-meta > span {
  color: var(--ink-text);
  font-size: 20px;
  line-height: 1;
}
@media (prefers-reduced-motion: reduce) {
  html #cardScannerCamera,
  html #cardScannerCamera.leaving {
    animation: none;
  }
}
/* Camera workspace: only the title and navigation sit outside the live image. */
html #cardScannerCamera > .app-navigation {
  position: relative !important;
  inset: auto !important;
  flex: none;
  width: 100%;
  order: 2 !important;
  height: calc(60px + env(safe-area-inset-bottom));
}
html #cardScannerCamera > .scanner-camera-header {
  order: 0 !important;
}
html #cardScannerCamera > .scanner-camera-scroll {
  order: 1 !important;
}
.scanner-floating-controls {
  position: absolute;
  z-index: 6;
  right: 12px;
  top: 12px;
  display: flex;
  padding: 4px;
  gap: 4px;
  border: 1px solid rgb(255 255 255 / 0.4);
  border-radius: 16px;
  background: rgb(5 9 14 / 0.42);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.scanner-floating-controls button {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.scanner-floating-controls svg {
  width: 24px;
  height: 24px;
}
.scanner-floating-controls button[aria-pressed='true'] {
  background: rgb(255 255 255 / 0.2);
  color: var(--gold);
}
#scannerHistoryCount {
  position: absolute;
  top: 0;
  right: 0;
  border-radius: 12px;
  padding: 1px 4px;
  background: var(--gold);
  color: #111;
  font:
    600 10px/1.3 'Inter',
    sans-serif;
}
.scanner-scan-toast {
  position: absolute;
  z-index: 5;
  bottom: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 440px;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid rgb(255 255 255 / 0.4);
  border-radius: 18px;
  background: rgb(5 9 14 / 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fff;
  pointer-events: none;
  font:
    500 14px/1.5 'Inter',
    sans-serif;
}
.scanner-scan-toast img {
  width: 48px;
  height: 67px;
  object-fit: contain;
  border-radius: 4px;
}
.scanner-scan-toast span {
  min-width: 0;
}
.scanner-scan-toast strong {
  display: block;
  overflow-wrap: anywhere;
}
.scanner-scan-toast small {
  display: block;
  color: #ddd;
  font-size: 12px;
}
.scanner-camera-health {
  position: absolute;
  z-index: 5;
  bottom: 12px;
  left: 12px;
  right: 12px;
  color: #fff;
  font:
    500 13px/1.5 'Inter',
    sans-serif;
  text-align: center;
  pointer-events: none;
}
.scanner-camera-health p:not([hidden]),
.scanner-camera-health button {
  padding: 10px;
  border: 1px solid rgb(255 255 255 / 0.3);
  border-radius: 12px;
  background: rgb(0 0 0 / 0.65);
  backdrop-filter: blur(12px);
  color: #fff;
  pointer-events: auto;
}
html #cardScannerCamera .scanner-framerate {
  z-index: 5;
  top: 12px;
  left: 8px;
  right: auto;
  bottom: auto;
  max-width: calc(100% - 128px);
  padding: 7px;
  border-radius: 10px;
  background: rgb(0 0 0 / 0.5);
  color: #fff;
  text-align: left;
}
html #cardScannerCamera .scanner-framerate small {
  text-align: left;
  color: #ddd;
}
.scanner-focus-ring {
  position: absolute;
  z-index: 3;
  width: 54px;
  height: 54px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}
.scanner-history-panel {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--page-backdrop);
  color: var(--main-text);
}
.scanner-history-panel .scanner-log-scroll {
  padding-bottom: 24px;
  overscroll-behavior-y: contain;
}
html #cardScannerCamera.scanner-wide .scanner-camera-scroll {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 38%);
  grid-template-rows: minmax(0, 1fr);
}
html #cardScannerCamera.scanner-wide .scanner-camera-stage {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}
html #cardScannerCamera.scanner-wide .scanner-history-panel {
  position: relative;
  inset: auto;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--main-field-line);
}
html #cardScannerCamera.scanner-wide #scannerHistoryButton {
  display: none;
}
.scanner-detection-score {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--main-sub);
}
.scanner-detection-score[hidden] {
  display: none;
}

/* Set exclusions share the scanner preferences in Settings and quick settings. */
.scanner-set-filters {
  min-width: 0;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.scanner-set-filters legend {
  color: var(--main-text);
  font-weight: 700;
  padding: 0 6px;
}
.scanner-set-search {
  display: flex;
  width: 100%;
  min-width: 0;
}
.scanner-set-search input {
  flex: 1;
  width: 0;
  min-width: 0;
}
.scanner-set-search button {
  flex: 0 0 42px;
}
.scanner-set-search button svg,
.scanner-set-selected svg {
  width: 18px;
  height: 18px;
}
.scanner-set-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.scanner-set-selected button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  white-space: normal;
}
.scanner-set-results {
  max-height: 240px;
  overflow-y: auto;
  color: var(--main-sub);
}

/* Source: styles/overrides/accounts.css */
.account-warning {
  margin: 12px 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--ink-2);
  color: var(--ink-text);
  font-size: 13px;
  line-height: 1.5;
}
.account-warning p {
  margin: 6px 0 10px;
}
.account-warning > div,
.account-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.account-warning button,
.account-links button {
  min-height: 44px;
  padding: 9px 12px;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
}
.account-warning-slot:empty {
  display: none;
}
.account-dialog .account-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.account-dialog .transfer-heading {
  align-items: center;
  padding: 14px 16px;
}
.account-dialog .transfer-body {
  gap: 8px;
  padding: 14px 16px;
}
.account-dialog .transfer-body > p {
  margin: 0;
}
.account-dialog h3 {
  margin: 0;
  font-family: 'Cinzel', serif;
}
.account-dialog input:not([type='checkbox']) {
  width: 100%;
  min-height: 44px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--field-line);
  border-radius: 12px;
  background: var(--field);
  color: var(--field-text, var(--ink-text));
  font: inherit;
}
.account-dialog input:focus-visible {
  outline: 2px solid var(--scheme-accent);
  outline-offset: 2px;
}
.account-include {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
  font-size: 13px;
}
.account-include input {
  flex: 0 0 auto;
  margin-top: 4px;
  accent-color: var(--brass);
}
.account-status {
  line-height: 1.5;
  margin: 0;
  overflow-wrap: anywhere;
}
.account-dialog .account-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.account-dialog .account-links button {
  padding: 8px 10px;
}
.account-dialog .account-links button:last-child {
  grid-column: 1 / -1;
}
.account-email {
  overflow-wrap: anywhere;
}
.account-dialog .sync-actions {
  display: grid;
  gap: 10px;
}
.account-dialog button {
  min-height: 44px;
}

@media (max-height: 550px) {
  #accountSheet[data-account-view='login'] .transfer-heading {
    padding-block: 10px;
  }
  #accountSheet[data-account-view='login'] .transfer-body {
    gap: 6px;
    padding-block: 8px;
  }
  #accountSheet[data-account-view='login'] .account-form {
    gap: 6px;
  }
}

/* Source: styles/overrides/library-tiles.css */
/* One artwork tile for decks, their folders, binders and automatic folders. */
html :is(.deck-grid:not(.as-list), .fp-grid) .library-tile {
  position: relative;
  display: block;
  aspect-ratio: 1.1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
  box-sizing: border-box;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 16px;
  background: linear-gradient(145deg, var(--main-dk), var(--ink));
  color: #fff;
}

html .library-tile-art {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

html .library-tile-art[hidden] {
  display: none;
}

.library-tile-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(255 255 255 / 0.24);
  pointer-events: none;
}

.library-tile-placeholder > svg {
  width: 48px;
  height: 48px;
}

html :is(.deck-grid:not(.as-list), .fp-grid) .library-tile-body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
  pointer-events: none;
}

html :is(.deck-grid:not(.as-list), .fp-grid) .library-tile-heading,
html :is(.deck-grid:not(.as-list), .fp-grid) .library-tile-details {
  padding: 9px 10px;
  background: rgb(9 13 18 / 0.62);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  color: #fff;
  text-shadow: 0 1px 3px rgb(0 0 0 / 0.75);
}

html :is(.deck-grid:not(.as-list), .fp-grid) .deck-tile .library-tile-heading {
  padding-right: 35px;
}

html .library-tile :is(.nm, .folder-name) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  font:
    700 14px/1.22 'Inter',
    system-ui,
    sans-serif;
  text-align: left;
  overflow-wrap: anywhere;
}

html .library-tile :is(.folder-name, .folder-sub, .nm, .meta, .edited, .dk-salt) {
  background: none;
  color: #fff;
  -webkit-text-fill-color: currentColor;
  opacity: 1;
}

html .library-tile .folder-sub,
.library-tile-format {
  margin: 3px 0 0;
  font:
    400 11px/1.35 'Inter',
    system-ui,
    sans-serif;
  text-align: left;
}

html .library-tile .meta,
html .library-tile .edited {
  gap: 5px;
  font-size: 10px;
  line-height: 1.3;
}

html .library-tile .edited:has(> span:empty + span:empty) {
  display: none;
}

.library-deck-identity {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: none;
}

html .library-tile .bkt-mini {
  background: none;
  color: #fff;
  -webkit-text-fill-color: currentColor;
}

html .library-tile .library-count-bad {
  color: #ffc8bd;
}

html :is(.deck-grid:not(.as-list), .fp-grid) .library-tile .tile-fav {
  left: auto;
  right: 5px;
  top: 5px;
  width: 26px;
  height: 26px;
  background: rgb(0 0 0 / 0.2);
  color: #fff;
  font-size: 19px;
}

html .deck-grid .library-tile .tile-fav.on {
  color: #ffdc6a;
}

html .library-tile .binder-glyph-row {
  justify-content: flex-end;
  min-height: 15px;
  margin: 0;
  color: #fff;
}

html .library-tile .binder-glyph-row > svg {
  max-width: 20px;
  max-height: 20px;
}

html .library-tile .br-info {
  top: 8px;
  right: 8px;
  bottom: auto;
  z-index: 2;
  color: #fff;
  border-color: rgb(255 255 255 / 0.5);
  background: rgb(9 13 18 / 0.6);
}

html :is(.deck-grid:not(.as-list), .fp-grid) .library-tile .library-binder-symbols {
  align-self: stretch;
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.85));
}

html :is(.deck-grid:not(.as-list), .fp-grid) .library-tile:has(.br-info) .library-tile-heading {
  padding-right: 40px;
}

html :is(.deck-grid:not(.as-list), .fp-grid) .library-tile.active-marker {
  border-color: var(--scheme-accent);
}

html .deck-grid.as-list .library-tile {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  height: 94px;
  min-height: 94px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-sizing: border-box;
}

html .deck-grid.as-list .library-tile-art,
html .deck-grid.as-list .library-tile-placeholder {
  position: static;
  grid-column: 1;
  grid-row: 1;
  width: 64px;
  height: 72px;
  border-radius: 7px;
}

html .deck-grid.as-list .library-tile-body {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 0;
  gap: 3px;
}

html .deck-grid.as-list .library-tile .tile-fav {
  position: absolute;
  right: 7px;
  top: 7px;
  color: var(--main-text);
}

html .deck-grid.as-list .deck-tile .library-tile-heading {
  padding-right: 24px;
}

html .deck-grid.as-list .library-tile :is(.nm, .folder-name, .folder-sub, .meta, .edited, .dk-salt),
html .deck-grid.as-list .library-tile-format {
  color: var(--main-text);
}

html .library-cover-picker {
  align-items: center;
  padding: 16px;
  box-sizing: border-box;
}

html .library-cover-dialog {
  display: flex;
  flex-direction: column;
  width: min(100%, 540px);
  height: min(680px, 82dvh);
  min-height: 0;
  margin: auto;
  padding: 18px;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--main-text) 20%, transparent);
  border-radius: 20px;
  background: var(--ink);
  color: var(--main-text);
}

.library-cover-dialog > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex: none;
}

.library-cover-dialog h2 {
  margin: 0;
  font:
    600 20px/1.3 'Cinzel',
    serif;
}

.library-cover-dialog header p {
  margin: 5px 0 12px;
  color: var(--main-sub);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.library-cover-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  padding: 6px;
  border: none;
  background: none;
  color: var(--main-text);
}

.library-cover-close svg {
  width: 22px;
  height: 22px;
}

html .library-cover-dialog .page-searchbar {
  position: static;
  flex: none;
  margin: 0 0 12px;
}

.library-cover-results {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

html .library-cover-dialog .cover-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: none;
  padding: 0;
  overflow: visible;
}

html .library-cover-dialog .cover-opt {
  position: relative;
  aspect-ratio: 1.38;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--panel);
  color: #fff;
}

html .library-cover-dialog .cover-opt.on {
  border-color: var(--scheme-accent);
}

html .library-cover-dialog .cover-opt img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.library-cover-dialog .cover-opt span {
  position: absolute;
  inset: auto 0 0;
  padding: 6px;
  background: rgb(9 13 18 / 0.72);
  font:
    500 11px/1.3 'Inter',
    system-ui,
    sans-serif;
  text-align: left;
}

.library-cover-dialog footer {
  display: flex;
  gap: 10px;
  flex: none;
  padding-top: 14px;
}

html .library-cover-dialog footer > button {
  flex: 1;
  min-height: 44px;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--main-text) 20%, transparent);
  border-radius: 10px;
  background: var(--panel);
  color: var(--main-text);
}

.library-cover-empty {
  color: var(--main-sub);
  line-height: 1.5;
}

@media (min-width: 600px) {
  html .library-tile :is(.nm, .folder-name) {
    font-size: 17px;
  }
  html .library-tile .folder-sub,
  .library-tile-format {
    font-size: 12px;
  }
}

@media (max-width: 359px) {
  html :is(.deck-grid:not(.as-list), .fp-grid) .library-tile {
    aspect-ratio: 1;
  }

  html .library-tile :is(.nm, .folder-name) {
    font-size: 13px;
  }

  html :is(.deck-grid:not(.as-list), .fp-grid) .library-tile-heading,
  html :is(.deck-grid:not(.as-list), .fp-grid) .library-tile-details {
    padding: 7px 8px;
  }

  html .library-tile .folder-sub,
  .library-tile-format {
    font-size: 10px;
  }
}

/* Source: styles/overrides/news.css */
/* News shares the page's scroll viewport; the branding leaves with the page. */
html .home-page .home-branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 14px 0 4px;
  transform: translateY(var(--home-brand-offset, 0));
}

html .home-page .home-rule {
  flex: none;
  min-height: 18px;
  margin: 6px auto;
}

html .home-page .home-kicker {
  margin: 6px 0 10px;
}

html .home-page .home-news,
html.desk .home-page .home-news {
  width: 100%;
  max-width: none;
  height: auto;
  max-height: none;
  margin: 14px 0 0;
  padding: 0;
  overflow: visible;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

html .home-page .home-news .news-item {
  padding-top: 14px;
  padding-bottom: 14px;
}

@media (prefers-reduced-motion: reduce) {
  html .home-page .home-branding {
    transform: none;
  }
}

/* Source: styles/overrides/scroll-feedback.css */
/* Keep scrolling, keyboard navigation and touch gestures; hide only the chrome. */
* {
  scrollbar-width: none !important;
  scrollbar-gutter: auto !important;
}

*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.scroll-boundary-feedback {
  position: fixed;
  z-index: 1000;
  height: 28px;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

.scroll-boundary-feedback::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 0 0 50% 50%;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--scheme-accent) 36%, transparent),
    transparent
  );
  transform-origin: center top;
  animation: scroll-boundary-pulse 460ms ease-out both;
}

.scroll-boundary-feedback[data-edge='bottom']::before {
  border-radius: 50% 50% 0 0;
  background: linear-gradient(
    to top,
    color-mix(in srgb, var(--scheme-accent) 36%, transparent),
    transparent
  );
  transform-origin: center bottom;
}

@keyframes scroll-boundary-pulse {
  0% {
    transform: scaleY(0.15);
    opacity: 0;
  }
  28% {
    transform: scaleY(1);
    opacity: 1;
  }
  100% {
    transform: scaleY(0.2);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-boundary-feedback {
    display: none;
  }
}

/* Source: styles/overrides/deck-library.css */
.deck-format-group {
  margin: 20px 0 0;
}

.deck-format-group > .section-label {
  margin: 0 0 8px;
}

html .app .decks-page :is(.section-label, .deck-group-toggle, .col-group-name) {
  background: none;
  color: var(--main-text);
  -webkit-text-fill-color: currentColor;
}

.deck-group-toggle .col-group-name {
  flex: 0 1 auto;
}

html .deck-format-grid[hidden] {
  display: none !important;
}

html .decks-searchbar #deckSortBtn {
  flex: none;
  padding: 0 11px;
}

/* Source: styles/overrides/light-tiles.css */
/* Light schemes keep the artwork visible through pale information overlays. */
html[data-theme='light'] .app .collection-page .section-label {
  background: none;
  color: var(--main-text);
  -webkit-text-fill-color: currentColor;
}

html[data-theme='light'] .library-tile :is(.library-tile-heading, .library-tile-details) {
  background: rgb(255 255 255 / 0.76);
  color: #111;
  text-shadow: none;
}

html[data-theme='light']
  .library-tile
  :is(
    .nm,
    .folder-name,
    .folder-sub,
    .meta,
    .edited,
    .dk-salt,
    .bkt-mini,
    .library-tile-format,
    .binder-glyph-row
  ) {
  background: none;
  color: #111;
  -webkit-text-fill-color: currentColor;
  text-shadow: none;
}

html[data-theme='light'] .library-tile .library-count-bad {
  color: #7b1a1a;
}

html[data-theme='light'] .deck-grid .library-tile .library-binder-symbols {
  background: none;
  filter: drop-shadow(0 1px 1px rgb(255 255 255 / 0.8));
}

html[data-theme='light'] .deck-grid:not(.as-list) .library-tile .tile-fav,
html[data-theme='light'] .library-tile .br-info {
  background: rgb(255 255 255 / 0.8);
  color: #111;
  -webkit-text-fill-color: currentColor;
}

html[data-theme='light'] .deck-grid .library-tile .tile-fav.on {
  color: #714500;
}

/* Source: styles/overrides/fab-menu.css */
/* Primary add controls and floating, separate speed-dial actions. */
html .app > main :is(#dockAddCards, #deckFab, #colFab, #binderFab, #colSelFab) {
  position: fixed;
  top: auto !important;
  left: auto !important;
  right: max(12px, calc((100vw - var(--dw, 100vw)) / 2 + 12px)) !important;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px !important;
  height: 54px !important;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--gold);
  color: #111;
  -webkit-text-fill-color: currentColor;
  line-height: 1;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.25);
}

html .deck-fab svg,
html #dockAddCards svg {
  width: 26px;
  height: 26px;
}

html #fabMenu.fab-speed-dial {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: block;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: hidden;
}

.fab-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.5);
  animation: fab-backdrop-in 160ms ease-out both;
}

.fab-menu-options {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  max-width: calc(100vw - 20px);
  padding: 4px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

html #fabMenu .fab-action {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  width: max-content;
  max-width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: #111;
  -webkit-text-fill-color: currentColor;
  text-shadow: none;
  cursor: pointer;
  animation: fab-action-in 220ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--fab-order) * 30ms);
  transform-origin: calc(100% - var(--fab-anchor-size) / 2) center;
}

.fab-action-label {
  min-width: 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--fab-action-background, var(--gold));
  color: var(--fab-action-ink, #111);
  box-shadow: 0 3px 12px rgb(0 0 0 / 0.15);
  font:
    600 14px/1.3 'Inter',
    system-ui,
    sans-serif;
  text-align: right;
}

.fab-action-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin-inline: calc((var(--fab-anchor-size) - 44px) / 2);
  border-radius: 50%;
  background: var(--fab-action-background, var(--gold));
  color: var(--fab-action-ink, #111);
  box-shadow: 0 3px 12px rgb(0 0 0 / 0.15);
  font-size: 26px;
}

.fab-action-icon svg {
  width: 22px;
  height: 22px;
}

html #fabMenu .fab-action-danger {
  --fab-action-background: #b42332;
  --fab-action-ink: #fff;
}

html #fabMenu .fab-menu-close {
  position: absolute;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--gold);
  color: #111;
  -webkit-text-fill-color: currentColor;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.25);
}

.fab-menu-close svg {
  width: 26px;
  height: 26px;
}

html #fabMenu button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

html #fabMenu.leaving {
  pointer-events: none;
  animation: fab-backdrop-in 150ms ease-in reverse both;
}

@keyframes fab-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes fab-action-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.85);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fab-menu-backdrop,
  html #fabMenu .fab-action,
  html #fabMenu.leaving {
    animation: none;
  }
}

/* Source: styles/overrides/page-spacing.css */
/* A shared narrow page gutter keeps controls and content on the same edges. */
:root {
  --page-gutter: 8px;
}
html.desk {
  --dw: min(1600px, calc(100vw - 24px));
}

html .app > main:is(.page-frame, .search-page):not(.deck-workspace),
html.desk .app > main:is(.page-frame, .search-page):not(.deck-workspace),
html .app > main.page-frame.hub-page {
  max-width: var(--dw, 100%);
  padding-inline: var(--page-gutter) !important;
}

html .app > main.page-frame > .page-content,
html .app > main.page-frame.hub-page > .page-content,
html .app > main.search-page > .search-content {
  width: calc(100% + 2 * var(--page-gutter));
  margin-inline: calc(-1 * var(--page-gutter));
  padding-inline: var(--page-gutter);
}

html .app .deck-workspace .deck-controls {
  margin-inline: calc(-1 * var(--page-gutter));
  padding-inline: 0;
}

html .app > main .page-searchbar.sticky-searchbar::before {
  left: calc(-1 * var(--page-gutter));
  right: calc(-1 * var(--page-gutter));
}

html .app > main.page-frame > .page-controls {
  margin-inline: calc(-1 * var(--page-gutter)) !important;
}

html #crOverlay #crBody,
html #crOverlay .cr-bar {
  max-width: var(--dw, 100%);
  padding-inline: var(--page-gutter);
}

html :is(.binder-settings-body, .life-setup-body, .trade-history-body, .card-detail-scroll) {
  padding-inline: var(--page-gutter);
}

/* Source: styles/overrides/text.css */
/* Guild colors paint surfaces and highlights. Text stays neutral, choosing
   its brightness from the surface it belongs to rather than the guild hue.
   White-main pages and white-side panels remain light in dark mode. */
html,
html[data-theme] {
  --page-ink: #fff;
  --ink-text: var(--page-ink);
  --head-ink: var(--page-ink);
  --parchment: #fff;
  --parchment-dim: #ccc;
  --sub-text: #ccc;
  --sub-text-2: #c2c2c2;
  --plate-ink: #fff;
  --panel-text: #fff;
  --panel-sub: #ddd;
  --panel-sub-2: #d0d0d0;
  --panel-parchment: #fff;
  --panel-parchment-dim: #ddd;
}

html[data-main='W'],
html[data-theme='light'] {
  --page-ink: #111;
  --parchment: #111;
  --parchment-dim: #373737;
  --sub-text: #373737;
  --sub-text-2: #3f3f3f;
}

html[data-side='W'],
html[data-theme='light'] {
  --plate-ink: #111;
  --panel-text: #111;
  --panel-sub: #373737;
  --panel-sub-2: #3f3f3f;
  --panel-parchment: #111;
  --panel-parchment-dim: #373737;
}

/* Toolbar and menu icons remain gold independently of their labels. */
html :is(.header-filter, .life-popup-close, #advancedSearchClose, #advancedSearchReset),
html .hub-icon {
  color: var(--accent-ink);
}

/* Tile metadata and placeholders follow the same gray hierarchy as the page. */
html .col-tile-info {
  --sub-text: var(--main-sub);
  --sub-text-2: var(--main-sub-2);
}
html :is(input, textarea)::placeholder {
  color: var(--sub-text);
}

html .life-counter-chip b {
  color: #fff;
}

html .library-tile :is(.folder-sub, .meta, .edited, .dk-salt, .library-tile-format) {
  color: #ddd;
  -webkit-text-fill-color: currentColor;
}

/* Gray metadata must remain readable even when the cover artwork is white. */
html:not([data-theme='light']) .library-tile :is(.library-tile-heading, .library-tile-details) {
  background: rgb(9 13 18 / 0.72);
}

html[data-theme='light']
  .library-tile
  :is(.folder-sub, .meta, .edited, .dk-salt, .library-tile-format) {
  color: #373737;
}

/*# sourceMappingURL=app.css.map */
