/* =============================================================================
   cookie-dex/dex.css — what the Cookie-Dex grid AND the profile share
   -----------------------------------------------------------------------------
   Linked after design-system.css on both Dex pages (proposal §2.1, §3.1):
     shared-shell.css -> design-system.css -> [styles-art-dials.css] -> dex.css
     -> grid.css | profile/profile.css
   It is built ONLY from the system's --th-* tokens and atoms. Nothing here
   copies a system value; where a value is new it is a TOKEN declared once
   below, marked PROMOTE when proposal §8.1 sends it to design-system.css.

   SECTIONS
     D1  tokens: the Dex mode line (.th-m-dex), rarity triplets and light
         washes, the "collected" state colour, the three formation lanes
     D2  atoms (proposal §8.2, page-local until a second page needs them):
         dex-meter, dex-ring, dex-step, dex-num, dex-chip, dex-table, dex-menu,
         dex-btn--danger(.is-armed), dex-switch(--own), dex-field, dex-plat,
         the Dex density icons
     D3  the COMPACT tile (.dex-tile): named square portraits, badges, the
         collected ring, the "+" disc, the open ring, focus dimming
     D4  the COMFY banner (.dex-banner): the tuned 1393/357 | 1393/280 frame
         consuming the art dials exactly as the live grid does
     D5  grids (.dex-tiles, .dex-banners): stated column counts
     D6  forced colours, reduced motion
     D7  Your progress's COMPACT form (the grid's Quick look) and the 1b
         ladder picker / candy quick-sets (lib/dex-progress.js) -- placed
         BEFORE D6 in the file, so D6's forced-colours rules still win
     L   light theme (every rule leads with :root[data-theme="light"], never
         changes a border width, names the state it styles)

   ART DIALS (styles-art-dials.css, unchanged). Each cookie block sets nine
   channels on .cookie-card[data-cookie-id]; the file's own routing blocks
   key on body[data-density], which a profile (no data-density) or a page
   showing both densities cannot use, so the compact frame reads its CHANNEL
   directly: --cookie-art-dial-{x,y,scale}-compact. The COMFY banner no
   longer reads the dials at all (owner's call, 2026-10-26): it draws the
   full-body portrait placed by the owner's art-board strip placements
   (hub-art-placements.js, see D4). The dials frame the in-game SPRITE, which
   the team pages (dex-cookie-card.css) keep drawing; they still land on the
   banner's .cookie-card, harmlessly.

   MEASURED (2026-10-26, live grid, Playwright): the live COMPACT grid does NOT
   apply its dials. Both compact rules (styles-responsive.css:364 desktop,
   :1258 phone) set `transform: none` at (0,2,2), over the dial transform at
   (0,1,1) in styles-index.css:1600. So the eight cookies with non-neutral
   compact dials (burning-spice, dark-enchantress, golden-cheese, jagae,
   pure-vanilla, shadow-milk, sherbet, silent-salt) are drawn UN-dialled today.
   To match the live grid the tile applies the compact channel through
   --dex-compact-dial-gain, which defaults to 0 (= today's grid). Set it to 1
   to apply the channel (proposal §2.7), normalised by --dex-dial-norm =
   tile width / 174 (174px is the logical compact tile at the 0.873 zoom the
   1440 grid draws at; written by a ResizeObserver, default 1).
   ========================================================================== */


/* ---------- D1 · tokens ---------- */

/* PROMOTE (§8.1): the Dex's own mode line. Gold, the house accent, so the page
   stops wearing Arena's ember (the system's default mode); no battle art. The
   values are the system's own gold family, restated as a mode. */
.th.th-m-dex {
  --th-m1: #f0cd7e;
  --th-m2: #f4ad4b;
  --th-m-rgb: 240, 205, 126;
  --th-m-ink: #f6d998;
  --th-m-btn1: #c99b46;
  --th-m-btn2: #8a5a16;
  --th-m-art: none;
}
:root[data-theme="light"] .th.th-m-dex { --th-m-ink: #855400; } /* 6.4:1 on white, the system's gold text */

/* PROMOTE (§8.1): "collected" is a named state, not upvote green. Dark is the
   measured --th-up value (9.6:1 on --th-surface-1), light #0e7450 (6.0:1 on
   white). -ink is the colour for TEXT in that state. */
.th {
  --th-own: #5fe0a5;
  --th-own-rgb: 95, 224, 165;
  --th-own-ink: #5fe0a5;
  /* PROMOTE (§8.1, with the lead): the formation's three lanes
     (team-build-page.css :172-174), so a cookie's room and the team pages
     share one blue / gold / red */
  --th-lane-rear: 82, 170, 255;
  --th-lane-middle: 255, 204, 64;
  --th-lane-front: 255, 88, 102;
  --th-lane: var(--th-lane-middle);
  /* the lanes as TEXT on ink (>= 7:1 on --th-surface-1) */
  --th-lane-ink: #ffd76a;
  /* the compact art frame: rarity edge width and the corner, as a share of
     the frame (the .th-face proportion) */
  --dex-edge: 2px;
  --dex-tile-radius: 22%;
  --dex-dial-norm: 1;
  --dex-compact-dial-gain: 0;
  --dex-banner-dial-norm: 1;
  /* the favourite star's own violet, for the Favourite tap mode's disc (the
     star artwork is purple; the system has no token for it) */
  --dex-fav: #c3a2ff;
}
.th .pos-rear { --th-lane: var(--th-lane-rear); --th-lane-ink: #8cc6ff; }
.th .pos-middle { --th-lane: var(--th-lane-middle); --th-lane-ink: #ffd76a; }
.th .pos-front { --th-lane: var(--th-lane-front); --th-lane-ink: #ff9aa4; }

/* the gilded rarities carry a second, gold stop (page-local) */
.th :is(.r-ancient, .r-beast, .r-witch) { --dex-gild: 1; }


/* ---------- D2 · atoms ---------- */

/* METER: a bar with its value carried by --v (0-100); the tone is an rgb
   triplet (--dex-tone), gold by default. role="progressbar" in the markup. */
.th .dex-meter { --dex-tone: 240, 205, 126; position: relative; display: block; height: 8px; border-radius: 99px; background: var(--th-track); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45); overflow: hidden; }
.th .dex-meter > i { display: block; height: 100%; width: calc(var(--v, 0) * 1%); min-width: 0; border-radius: inherit; background: linear-gradient(90deg, rgba(var(--dex-tone), 0.72), rgb(var(--dex-tone))); box-shadow: 0 0 10px rgba(var(--dex-tone), 0.55); }
.th .dex-meter--gold > i { background: var(--th-gold-fill); box-shadow: 0 0 10px var(--th-gold-glow); }
.th .dex-meter--own { --dex-tone: var(--th-own-rgb); }
.th .dex-meter--sm { height: 4px; }
.th .dex-meter--lg { height: 10px; }

/* RING: a conic dial with its value as TEXT inside (never colour alone).
   Default 40px; a .dex-ringbtn wraps one with its label under it. */
.th .dex-ring { --dex-tone: 240, 205, 126; --s: 40px; position: relative; display: inline-grid; place-items: center; width: var(--s); height: var(--s); flex: none; border-radius: 50%; background: conic-gradient(rgb(var(--dex-tone)) calc(var(--v, 0) * 1%), var(--th-track) 0); }
.th .dex-ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--th-surface-1); }
.th .dex-ring > b { position: relative; font-size: calc(var(--s) * 0.27); font-weight: 800; line-height: 1; color: var(--th-ink); letter-spacing: -0.02em; }
.th .dex-ring > b small { font-size: 0.64em; font-weight: 700; letter-spacing: 0; color: var(--th-ink-2); }
.th .dex-ring--own { --dex-tone: var(--th-own-rgb); }
.th .dex-ring--sm { --s: 28px; }
.th .dex-ring--sm::before { inset: 3px; }
.th .dex-ring--lg { --s: 56px; }
.th .dex-ring--lg::before { inset: 5px; }
.th .dex-ringbtn { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; min-width: 44px; padding: 4px 2px; border: 0; border-radius: 12px; background: none; color: var(--th-ink-3); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.1; }
.th .dex-ringbtn:hover { background: var(--th-btn-bg); color: var(--th-ink); }
.th .dex-ringbtn:focus-visible { outline: 3px solid var(--th-btn-focus); outline-offset: 0; }

/* STEPPER: [-10][-][value][+][+10][Max]. Round 36px buttons on desktop, 44px
   on a phone (container width); the value is a button (1b: the ladder picker). */
.th .dex-step { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 999px; background: var(--th-btn-track); }
.th .dex-step > button { display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 9px; border: 0; border-radius: 999px; background: var(--th-btn-bg); color: var(--th-ink); font-size: 13px; font-weight: 700; line-height: 1; transition: background-color 0.15s ease, transform 0.08s ease; }
.th .dex-step > button:hover { background: var(--th-btn-hover); }
.th .dex-step > button:active { background: var(--th-btn-press); transform: scale(0.97); }
.th .dex-step > button:focus-visible { outline: 3px solid var(--th-btn-focus); outline-offset: 0; }
.th .dex-step > button:disabled, .th .dex-step > button[aria-disabled="true"] { color: var(--th-ink-faint); background: transparent; cursor: default; transform: none; }
.th .dex-step > button svg { width: 16px; height: 16px; color: var(--th-btn-icon); }
.th .dex-step > button:disabled svg { color: var(--th-ink-faint); }
.th .dex-step .dex-step-val { display: inline-flex; align-items: center; gap: 7px; min-width: 76px; padding: 0 12px 0 6px; background: var(--th-surface-1); box-shadow: inset 0 0 0 1px var(--th-line-2); font-size: 14px; }
.th .dex-step .dex-step-val img { height: 22px; width: auto; max-width: 64px; object-fit: contain; }
.th .dex-step .dex-step-max { display: inline-flex; align-items: center; gap: 4px; padding: 0 12px 0 9px; }
@container th (max-width: 700px) {
  .th .dex-step > button { min-width: 44px; height: 44px; font-size: 14px; }
  .th .dex-step .dex-step-val { min-width: 84px; }
  /* the six-button candy stepper on one line at 390 (a 340px track): Max keeps
     its WORD and drops its icon, the value hugs its art, and the gaps close a
     pixel. Restated two classes deeper for the profile, whose own value rule
     (profile.css, .th .dex-prog .dex-step .dex-step-val) comes later. */
  .th .dex-step { gap: 3px; }
  .th .dex-step .dex-step-max { padding: 0 11px; }
  .th .dex-step .dex-step-max svg { display: none; }
  .th .dex-step .dex-step-val,
  .th .dex-prog .dex-prog-ctl .dex-step .dex-step-val { min-width: 0; gap: 5px; padding: 0 8px 0 5px; }
}
/* the narrowest phones: the six-button candy stepper (~350px) is wider than a
   288px column, so the track wraps into a rounded box rather than run off */
@container th (max-width: 380px) {
  .th .dex-step { flex-wrap: wrap; max-width: 100%; border-radius: 24px; }
  .th .dex-step > button { min-width: 42px; padding: 0 7px; }
  .th .dex-step .dex-step-val { min-width: 72px; }
}

/* NUMBER FIELD: the readonly-first level field with its Max inside the same
   box (the profile's trick moves into this atom unchanged). */
.th .dex-num { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 3px 0 4px; border-radius: 999px; background: var(--th-field-bg); box-shadow: inset 0 0 0 1px var(--th-line-3); }
.th .dex-num:focus-within { box-shadow: inset 0 0 0 1px transparent, 0 0 0 3px var(--th-btn-focus); }
.th .dex-num input { width: 4.2ch; height: 30px; padding: 0 0 0 8px; border: 0; outline: 0; background: none; font-size: 15px; font-weight: 700; color: var(--th-ink); }
.th .dex-num input[readonly] { caret-color: transparent; }
.th .dex-num button { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 11px 0 8px; border: 0; border-radius: 999px; background: var(--th-btn-bg); color: var(--th-ink); font-size: 13px; font-weight: 700; }
.th .dex-num button:hover { background: var(--th-btn-hover); }
.th .dex-num button svg { width: 15px; height: 15px; color: var(--th-btn-icon); }
@container th (max-width: 700px) {
  .th .dex-num { height: 44px; }
  .th .dex-num input { height: 38px; font-size: 16px; }
  .th .dex-num button { height: 38px; }
}

/* CHIP: a facet chip with icon, word and count. Selected is the system's
   selected chip; a chip whose count is 0 is QUIET but stays pressable
   (aria-disabled + "0 results" in its name, proposal §2.4). An element chip
   (.el-*) is tinted with its element. */
.th .dex-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px 0 6px; border: 1px solid transparent; border-radius: 999px; background: var(--th-btn-bg); color: var(--th-ink-2); font-size: 13.5px; font-weight: 600; line-height: 1; white-space: nowrap; transition: background-color 0.15s ease, color 0.15s ease; }
.th .dex-chip:hover { background: var(--th-btn-hover); color: var(--th-ink); }
.th .dex-chip:focus-visible { outline: 3px solid var(--th-btn-focus); outline-offset: 0; }
.th .dex-chip--text { padding-left: 13px; }
.th .dex-chip-ic { width: 24px; height: 24px; flex: none; object-fit: contain; }
.th .dex-chip-ic--ribbon { width: auto; height: 15px; max-width: 72px; }
.th .dex-chip-n { min-width: 22px; height: 20px; display: inline-grid; place-items: center; padding: 0 6px; border-radius: 999px; font-size: 12px; font-weight: 800; color: var(--th-ink-2); background: var(--th-surface-3); }
.th .dex-chip[class*="el-"]:not(.el-none):not([aria-pressed="true"]) { background: rgba(var(--th-el), 0.14); box-shadow: inset 0 0 0 1px rgba(var(--th-el), 0.32); color: var(--th-ink); }
.th .dex-chip[class*="el-"]:not(.el-none):not([aria-pressed="true"]):hover { background: rgba(var(--th-el), 0.24); }
.th .dex-chip[aria-pressed="true"] { color: var(--th-sel-ink); background: var(--th-sel-bg); box-shadow: var(--th-sel-shadow); }
.th .dex-chip[aria-pressed="true"] .dex-chip-n { color: var(--th-sel-bg); background: var(--th-sel-ink); }
.th .dex-chip[aria-disabled="true"]:not([aria-pressed="true"]) { color: var(--th-ink-3); background: transparent; box-shadow: inset 0 0 0 1px var(--th-line-2); border-style: dashed; border-color: var(--th-line-3); }
.th .dex-chip[aria-disabled="true"]:not([aria-pressed="true"]) .dex-chip-ic { opacity: 0.45; filter: grayscale(0.8); }
.th .dex-chip[aria-disabled="true"]:not([aria-pressed="true"]) .dex-chip-n { color: var(--th-ink-3); background: transparent; box-shadow: inset 0 0 0 1px var(--th-line-2); }
@container th (max-width: 700px) {
  .th .dex-chip { min-height: 44px; font-size: 14px; }
}

/* TABLE: a quiet data table (the Breakdown, the Lv.100 rows, Profile facts). */
.th .dex-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; color: var(--th-ink-2); }
.th .dex-table :is(th, td) { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--th-line); }
.th .dex-table thead th { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--th-ink-3); background: var(--th-surface-sunk); border-bottom-color: var(--th-line-2); }
.th .dex-table thead th:first-child { border-top-left-radius: 10px; }
.th .dex-table thead th:last-child { border-top-right-radius: 10px; }
.th .dex-table tbody th { font-weight: 600; color: var(--th-ink-3); white-space: nowrap; }
.th .dex-table td b { color: var(--th-ink); font-weight: 700; }
.th .dex-table tr:last-child :is(th, td) { border-bottom: 0; }
.th .dex-table .is-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@container th (max-width: 700px) {
  .th .dex-table { font-size: 13px; }
  .th .dex-table :is(th, td) { padding: 8px 6px; }
  .th .dex-table thead th { letter-spacing: 0.04em; font-size: 10.5px; }
}
/* a table wider than its column scrolls inside a wrapper rather than the page:
   wrap one in .dex-table-wrap where its columns cannot shrink */
.th .dex-table-wrap { max-width: 100%; overflow-x: auto; }

/* MENU: a popover list (Sort ▾). Anchor it inside a position: relative box. */
.th .dex-menu { position: absolute; z-index: 40; top: calc(100% + 6px); right: 0; min-width: 220px; padding: 6px; border-radius: 14px; background: var(--th-surface-1); border: 1px solid var(--th-line-3); box-shadow: var(--th-shadow-pop); }
.th .dex-menu[hidden] { display: none; }
.th .dex-menu-k { display: block; padding: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--th-ink-3); }
.th .dex-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: 9px; background: none; color: var(--th-ink); font-size: 14px; font-weight: 600; text-align: left; }
.th .dex-menu-item:hover, .th .dex-menu-item:focus-visible { background: var(--th-surface-3); outline: 0; }
.th .dex-menu-item svg { width: 16px; height: 16px; color: var(--th-btn-icon); }
.th .dex-menu-item .dex-menu-check { margin-left: auto; color: var(--th-gold); visibility: hidden; }
.th .dex-menu-item[aria-checked="true"] .dex-menu-check { visibility: visible; }
.th .dex-menu-sep { height: 1px; margin: 6px 4px; background: var(--th-line-2); }
@container th (max-width: 700px) {
  .th .dex-menu-item { min-height: 44px; font-size: 15px; }
}

/* DANGER button (Reset actions): neutral until armed; armed fills red and
   says what the second press will do. Never gold. */
.th .th-btn.dex-btn--danger { color: var(--th-down); }
.th .th-btn.dex-btn--danger svg { color: currentColor; }
.th .th-btn.dex-btn--danger.is-armed { color: #fff; background: linear-gradient(180deg, #d84a5a, #a8283c); box-shadow: 0 6px 16px -8px rgba(216, 74, 90, 0.85); }

/* SWITCH: a button with role="switch" (the profile's Collected control), the
   system switch's knob drawn without a checkbox. --own turns ON green. */
.th .dex-switch { display: inline-flex; align-items: center; gap: 9px; min-height: 36px; padding: 0 12px 0 5px; border: 0; border-radius: 999px; background: var(--th-btn-bg); color: var(--th-ink-2); font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.th .dex-switch:hover { background: var(--th-btn-hover); }
.th .dex-switch:focus-visible { outline: 3px solid var(--th-btn-focus); outline-offset: 0; }
.th .dex-switch-knob { position: relative; width: 36px; height: 21px; flex: none; border-radius: 999px; background: var(--th-btn-hover); box-shadow: inset 0 0 0 1px var(--th-line-2); transition: background-color 0.15s ease; }
.th .dex-switch-knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #ffffff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); transition: left 0.15s ease; }
.th .dex-switch[aria-checked="true"] { color: var(--th-ink); }
.th .dex-switch[aria-checked="true"] .dex-switch-knob { background: var(--th-switch-on); box-shadow: none; }
.th .dex-switch[aria-checked="true"] .dex-switch-knob::after { left: 17px; }
.th .dex-switch--own[aria-checked="true"] .dex-switch-knob { background: var(--th-own); }
.th .th-switch.dex-switch--own input:checked + .th-switch-knob { background: var(--th-own); }
@container th (max-width: 700px) {
  .th .dex-switch { min-height: 44px; font-size: 14px; }
}

/* FIELD: a search box (icon, input, clear). The hubs' .th-cf shape. */
.th .dex-field { position: relative; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 6px 0 14px; border-radius: 999px; background: var(--th-btn-track); color: var(--th-ink-3); }
.th .dex-field:focus-within { box-shadow: 0 0 0 3px var(--th-btn-focus); }
.th .dex-field > svg { width: 17px; height: 17px; flex: none; }
.th .dex-field input { flex: 1; min-width: 60px; height: 34px; border: 0; outline: 0; background: none; font-size: 14.5px; color: var(--th-ink); }
.th .dex-field input::placeholder { color: var(--th-ink-3); }
/* the FIELD carries the focus ring (:focus-within above); the system's own
   ring on the input inside it would draw a second box in the pill */
.th .dex-field input:focus-visible { outline: none; }
.th .dex-field-clear { display: grid; place-items: center; width: 30px; height: 30px; flex: none; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--th-ink-3); }
.th .dex-field-clear:hover { background: var(--th-btn-bg); color: var(--th-ink); }
.th .dex-field-clear svg { width: 15px; height: 15px; }
.th .dex-field-k { flex: none; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--th-ink-3); }
@container th (max-width: 700px) {
  .th .dex-field { min-height: 46px; }
  .th .dex-field input { height: 40px; font-size: 16px; }
  .th .dex-field-clear { width: 40px; height: 40px; }
}

/* PLATFORM: the lit ellipse a cookie stands on, in its position lane's
   colour (the formation's .th-fm-plat, as an atom for the Stage and the
   Quick look). Size it with width; the height follows. */
/* The ring's colour is the cookie's ELEMENT (owner's call, 2026-11-06; it was
   the position's lane colour): --dex-plat-rgb is resolved on the ring itself,
   so it reads the --th-el of the nearest .el-* (the profile's page, the Quick
   look's stage; a cookie with several elements takes its first, as everything
   else does), and a cookie with none takes a soft neutral white. The profile's
   stage floor glow and its promotion plate (.dexp-lip, 2026-11-06) read the
   same variable. */
.th .dex-plat, .th .dexp-stage-room, .th .dexp-lip { --dex-plat-rgb: var(--th-el); }
.th .el-none .dex-plat, .th .el-none .dexp-stage-room, .th .el-none .dexp-lip { --dex-plat-rgb: 236, 238, 246; }
:root[data-theme="light"] .th .el-none .dex-plat, :root[data-theme="light"] .th .el-none .dexp-stage-room, :root[data-theme="light"] .th .el-none .dexp-lip { --dex-plat-rgb: 196, 194, 212; }
.th .dex-plat { position: absolute; left: 50%; bottom: 6%; width: 64%; aspect-ratio: 4.2 / 1; transform: translateX(-50%); border-radius: 50%; pointer-events: none; background: radial-gradient(closest-side, rgba(255, 255, 255, 0.78), rgba(var(--dex-plat-rgb), 0.72) 38%, rgba(var(--dex-plat-rgb), 0.16) 78%, rgba(var(--dex-plat-rgb), 0) 100%); box-shadow: 0 0 0 2px rgba(var(--dex-plat-rgb), 0.85), 0 0 26px 6px rgba(var(--dex-plat-rgb), 0.42); }
.th .dex-plat::after { content: ""; position: absolute; inset: 18% 8% -40%; border-radius: 50%; background: radial-gradient(closest-side, rgba(var(--dex-plat-rgb), 0.3), rgba(var(--dex-plat-rgb), 0)); filter: blur(6px); }

/* the Dex's own density icons (20 x 20, never the hubs': SF §7). The system's
   .th-seg--density rules colour them (.df filled, .dt outlined). */
.th .dex-dens-ic { width: 20px; height: 20px; }


/* ---------- D3 · the COMPACT tile ---------- */
/* <div class="dex-tile r-* el-* [is-collected] [is-dark-art] [is-dormant]">
     <a class="dex-tile-link" href aria-label>           (1a: one link)
       <span class="dex-tile-frame">                     the collected ring's box
         <span class="cookie-card dex-art" data-cookie-id data-cookie-rarity>  the dial hook + clip
           <span class="dex-art-ini">SF</span><img class="dex-art-img">
         </span>
         <span class="dex-tile-badges" aria-hidden="true">…</span>
       </span>
       <span class="dex-tile-name">Sea Fairy</span>
     </a>
   </div>
   1b's split tile swaps the link for <button class="dex-tile-art"> holding the
   frame plus <a class="dex-tile-name">: both selectors are styled alike. */
.th .dex-tile { --dex-ring: 3px; --dex-ring-gap: 2px; --dex-ring-room: calc(var(--dex-ring) + var(--dex-ring-gap)); position: relative; container: dex-tile / inline-size; min-width: 0; }
.th .dex-tile-link, .th .dex-tile-art { display: flex; flex-direction: column; align-items: stretch; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: center; text-decoration: none; }
.th .dex-tile-link:focus-visible, .th .dex-tile-art:focus-visible { outline: 0; }
/* the frame reserves the ring's room on EVERY tile, so no tile changes size
   with its state (CLAUDE.md: the collected frame is a parent, never the card) */
.th .dex-tile-frame { position: relative; display: block; padding: var(--dex-ring-room); border-radius: calc(0.22 * (100cqw - 2 * var(--dex-ring-room)) + var(--dex-ring-room)); transition: transform 0.16s ease; }
.th .dex-tile-frame::before { content: ""; position: absolute; inset: 0; border-radius: inherit; border: var(--dex-ring) solid transparent; pointer-events: none; transition: border-color 0.18s ease, opacity 0.18s ease; }
.th .dex-tile.is-collected .dex-tile-frame::before { border-color: var(--th-own); box-shadow: inset 0 0 0 var(--dex-ring-gap) var(--th-ground), 0 0 12px -2px rgba(var(--th-own-rgb), 0.55); }
body[data-hide-collected-frames="true"] .th .dex-tile.is-collected .dex-tile-frame::before,
body[data-hide-collection-ui="true"] .th .dex-tile.is-collected .dex-tile-frame::before { border-color: transparent; box-shadow: none; }
/* the art frame: square, rounded at 22%, a 2px rarity edge drawn OVER the
   portrait (the .th-face ::after approach), clipped */
.th .dex-art { position: relative; isolation: isolate; display: block; width: 100%; aspect-ratio: 1 / 1; border-radius: var(--dex-tile-radius); overflow: hidden; background: var(--th-surface-3); box-shadow: var(--th-shadow-1); }
.th .dex-art::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 var(--dex-edge) var(--th-rc, var(--th-line-3)), inset 0 0 0 calc(var(--dex-edge) + 1px) rgba(0, 0, 0, 0.22); }
.th .dex-tile[class*="r-"]:is(.r-ancient, .r-beast, .r-witch) .dex-art::after { box-shadow: inset 0 0 0 var(--dex-edge) var(--th-rc), inset 0 0 0 calc(var(--dex-edge) + 1.5px) rgba(240, 205, 126, 0.85), inset 0 0 0 calc(var(--dex-edge) + 2.5px) rgba(0, 0, 0, 0.28); }
.th .dex-art-ini { position: absolute; inset: 0; z-index: 0; display: grid; place-items: center; font: 700 26cqw/1 "CookieRun KR", "Outfit", sans-serif; color: var(--th-ink-3); background: radial-gradient(circle at 50% 40%, rgba(var(--th-rc-rgb, 120, 128, 150), 0.32), transparent 70%); visibility: hidden; }
.th .dex-art:has(img.is-missing) .dex-art-ini, .th .dex-art:not(:has(img)) .dex-art-ini { visibility: visible; }
/* the portrait: object-fit cover, exactly the live compact card. The dial
   transform is inert at the default gain (0) - see the header. */
.th .dex-art-img { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; transform-origin: center; transform:
    translate(calc(var(--cookie-art-dial-x-compact, 0px) * var(--dex-dial-norm) * var(--dex-compact-dial-gain)),
              calc(var(--cookie-art-dial-y-compact, 0px) * var(--dex-dial-norm) * var(--dex-compact-dial-gain)))
    scale(calc(1 + (var(--cookie-art-dial-scale-compact, 1) - 1) * var(--dex-compact-dial-gain))); }
.th .dex-art-img.is-missing { opacity: 0; }
/* near-black art (DARK_ART_COOKIE_IDS): the square PNG is OPAQUE black, so a
   glow cannot sit behind it. The tile is cut from the full-body art over its
   element glow instead, centred on the face HERO_ART_FOCUS names - the
   system's own .th-face.is-dark-art treatment, at tile size. */
.th .dex-tile.is-dark-art .dex-art { background: radial-gradient(circle at 50% 42%, rgba(var(--th-el), 1) 0%, rgba(var(--th-el), 0.55) 45%, var(--th-dark-art-face) 100%); }
.th .dex-art-hero { position: absolute; z-index: 1; width: 250%; max-width: none; height: auto; left: 50%; top: 50%; transform: translate(calc(-1 * var(--th-hx, 50%)), calc(-1 * var(--th-hy, 30%))); filter: drop-shadow(0 0 1px rgba(236, 228, 255, 0.9)); }
/* the name: up to two lines, centred, and two lines reserved on every tile so
   a row of one-line names lines up with a two-line one */
.th .dex-tile-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-height: calc(2 * 1.15em); margin-top: 5px; padding: 0 2px; font: 700 14px/1.15 "CookieRun KR", "Outfit", sans-serif; color: var(--th-heading); text-wrap: balance; overflow-wrap: anywhere; }
a.dex-tile-name { text-decoration: none; }
.th .dex-tile-name.has-form { display: block; }
.th .dex-tile-main { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th .dex-tile-form { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8em; line-height: 1.4375; color: var(--th-gold); }
.th .dex-tile-link:hover .dex-tile-frame, .th .dex-tile-art:hover .dex-tile-frame { transform: translateY(-2px); }
.th .dex-tile-link:hover .dex-tile-name, .th a.dex-tile-name:hover { color: var(--th-gold); }
/* focus: the system's gold ring around the art (UXD bug 10: invisible today) */
.th .dex-tile-link:focus-visible .dex-art, .th .dex-tile-art:focus-visible .dex-art { outline: 3px solid var(--th-focus-color); outline-offset: 2px; }
.th a.dex-tile-name:focus-visible { outline: 2px solid var(--th-focus-color); outline-offset: 2px; border-radius: 4px; }

/* BADGES, all shares of the tile (cqw off the tile container) and all
   overlaid, so they cost no layout. Positions are against the frame. */
.th .dex-tile-badges { position: absolute; inset: var(--dex-ring-room); z-index: 3; pointer-events: none; }
/* the top-left column and the candy hang a little past the frame's corner on
   purpose (owner's call, 2026-10-27), like the promotion icon at the foot:
   pinned onto the tile rather than boxed inside it */
.th .dex-tile-tl { position: absolute; top: -5%; left: -5%; display: flex; flex-direction: column; align-items: flex-start; gap: 2cqw; }
.th .dex-lv { display: inline-flex; align-items: center; height: max(15px, 11.5cqw); padding: 0 max(4px, 3cqw); border-radius: 999px; font-size: max(10px, 7.4cqw); font-weight: 800; line-height: 1; letter-spacing: 0.01em; color: #eef6ff; background: rgba(8, 12, 22, 0.86); box-shadow: inset 0 0 0 1px rgba(198, 226, 255, 0.4), 0 2px 6px rgba(0, 0, 0, 0.5); }
.th .dex-lv.is-max { color: #2a1206; background: var(--th-gold-fill); box-shadow: 0 0 0 1px rgba(255, 228, 160, 0.7), 0 2px 8px rgba(240, 170, 60, 0.55); }
.th .dex-fav { width: 17cqw; height: auto; min-width: 14px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55)); }
.th .dex-new { position: absolute; top: 4%; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; height: max(15px, 11cqw); padding: 0 max(5px, 3.4cqw); border-radius: 999px; font-size: max(10px, 6.8cqw); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--th-on-gold); background: var(--th-gold-fill); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); }
.th .dex-tile:has(.dex-tile-tl > *) .dex-new { left: auto; right: 4%; transform: none; }
.th .dex-tile:has(.dex-candy) .dex-new { top: 36%; right: 4%; left: auto; }
/* Magic Candy / Crystal Jam: the tier art and the level, top-right */
.th .dex-candy { position: absolute; top: -7%; right: -7%; width: 30cqw; display: grid; justify-items: center; }
.th .dex-candy img { width: 100%; height: auto; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.55)); }
.th .dex-candy b { position: relative; z-index: 1; margin-top: -18%; min-width: 1.9em; padding: 0.12em 0.4em; border-radius: 999px; font-size: max(9.5px, 6.6cqw); font-weight: 800; line-height: 1.1; text-align: center; color: #fff; background: rgba(8, 12, 22, 0.88); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28); }
/* promotion: CENTRED along the foot (pickCardPromotionTrack's one icon),
   hanging a little past the frame's edge like the live badge; the foot is
   its own since the element moved to the top-left column */
.th .dex-promo { position: absolute; left: 50%; bottom: -5%; transform: translateX(-50%); width: 84%; height: 21cqw; display: flex; align-items: flex-end; justify-content: center; }
.th .dex-promo img { display: block; height: 100%; width: auto; max-width: 100%; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7)); }
.th .dex-promo[data-promotion-shape="star-row"] { height: 15cqw; }
/* element badge: the .th-face-el language, FIRST in the top-left column
   with the level and the star under it (owner's layout, 2026-10-27; it was
   26% of the tile in the bottom-right corner, which pushed the promotion
   icon off centre). Smaller than it was, to give the art the room. Two
   overlap; three or more show the first plus "+N" (Agar Agar). */
.th .dex-tile-el { display: flex; align-items: center; }
.th .dex-tile-el img { width: max(14px, 17cqw); height: max(14px, 17cqw); border-radius: 50%; box-shadow: 0 0 0 max(1px, 1cqw) var(--th-surface-1); background: var(--th-surface-1); }
.th .dex-tile-el img + img { margin-left: -6cqw; }
.th .dex-tile-el-more { margin-left: -3cqw; display: inline-grid; place-items: center; min-width: 12cqw; height: 12cqw; padding: 0 1.6cqw; border-radius: 999px; font-size: max(9px, 6.4cqw); font-weight: 800; color: var(--th-ink); background: var(--th-surface-3); box-shadow: 0 0 0 max(1px, 1cqw) var(--th-surface-1); }
/* dormant: levels kept on a cookie that is not collected; dimmed, counted
   nowhere (the badges carry it, the art stays full colour) */
.th .dex-tile .is-dormant { opacity: 0.45; filter: grayscale(0.85); }
/* Collection mode: a "+" disc on NOT-collected tiles only (top-right, in the
   candy's place); a collected tile shows no disc, its ring is the signal.
   No checkmark anywhere (the owner's recorded decision). */
.th .dex-disc { position: absolute; top: 4%; right: 4%; display: grid; place-items: center; width: max(24px, 18cqw); height: max(24px, 18cqw); border-radius: 50%; color: var(--th-on-gold); background: var(--th-surface-1); box-shadow: inset 0 0 0 2px var(--th-own), 0 2px 8px rgba(0, 0, 0, 0.55); }
.th .dex-disc svg { width: 62%; height: 62%; stroke-width: 2.6; color: var(--th-own); }
/* the tap modes (1b): a star on a tile the tap would favourite, the max
   chevrons on one it would max; a tile the tap would not change carries
   [data-on] and shows no disc (its ring, star or gold level is the signal) */
.th .dex-disc--favorite { box-shadow: inset 0 0 0 2px var(--dex-fav), 0 2px 8px rgba(0, 0, 0, 0.55); }
.th .dex-disc--favorite svg { color: var(--dex-fav); stroke-width: 2.2; }
.th .dex-disc--max { box-shadow: inset 0 0 0 2px var(--th-gold), 0 2px 8px rgba(0, 0, 0, 0.55); }
.th .dex-disc--max svg { color: var(--th-gold); stroke-width: 2.4; }
.th .dex-disc[data-on] { display: none; }
.th .dex-tile.is-collecting .dex-candy { display: none; }
/* a ring mid draw-in (Collection mode, the 180ms after a tap) */
.th .dex-tile.is-ring-in .dex-tile-frame::before { border-color: var(--th-own); clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 100%, 0 100%, 0 62%); }
/* the Quick look's opened tile wears a gold ring; the rest of the grid steps
   back: ART and frames dim, never the names (proposal §6.4) */
.th .dex-tile.is-open .dex-tile-frame::before { border-color: var(--th-gold); box-shadow: 0 0 0 1px rgba(240, 205, 126, 0.4), 0 0 18px -2px var(--th-gold-glow); }
.th [data-look-open] .dex-tile:not(.is-open) :is(.dex-art, .dex-tile-badges) { opacity: 0.4; filter: saturate(0.35) blur(2px); transition: opacity 0.18s ease, filter 0.18s ease; }
.th [data-look-open] .dex-tile:not(.is-open):is(:hover, :focus-within) :is(.dex-art, .dex-tile-badges) { opacity: 1; filter: none; }

@container th (max-width: 700px) {
  /* phones: CookieRun is too wide at 83px, Outfit 600 11.5px takes the name */
  .th .dex-tile { --dex-ring: 2.5px; --dex-ring-gap: 1.5px; }
  .th .dex-tile-name { margin-top: 3px; padding: 0; font: 600 11.5px/1.2 "Outfit", system-ui, sans-serif; min-height: calc(2 * 1.2em); letter-spacing: -0.005em; }
  /* the split tile (1b): its name is the profile link, so its row is a 44px
     target (two 13.8px lines + 12px + the 3px above), priced in at §2.9 */
  .th .dex-tile:has(> .dex-tile-art) a.dex-tile-name { min-height: 44px; padding-bottom: 12px; box-sizing: border-box; }
  .th .dex-tile:has(> .dex-tile-art) a.dex-tile-name.has-form { min-height: 44px; }
  .th .dex-lv { padding: 0 2px; background: none; box-shadow: none; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 6px rgba(0, 0, 0, 0.8); font-size: max(10px, 9cqw); }
  .th .dex-lv.is-max { padding: 0 4px; }
}
/* "Show names" off (Collection settings) restores today's face wall */
.th [data-names="off"] .dex-tile-name { display: none; }


/* ---------- D4 · the COMFY banner ---------- */
/* <div class="dex-banner-slot r-* el-* [is-collected] [is-dark-art]">
     <a class="cookie-card dex-banner" data-cookie-id data-cookie-rarity href aria-label>
       <span class="dex-banner-stage"><span class="dex-banner-ini">SF</span><img class="dex-banner-art" style="--th-ax;--th-ay;--th-as"></span>
       <span class="dex-banner-words">ribbon, name, facts</span>
       badges
     </a>
   </div>
   The FRAME keeps the live comfy card's geometry: 1393/357 above 699px,
   1393/280 at <=699px, switched by the VIEWPORT (the 699/700 line every Dex
   frame agrees on, SF finding 9), and .cookie-card[data-cookie-id] stays on it.

   THE ART (owner's call, 2026-10-26): the bold full-body PORTRAIT, not the
   in-game sprite. The 800px web copy (/assets/cookie-page-art/hero/{id}.webp)
   falls back to the profile portrait PNG, then to initials. It sits in an art
   window with the hub phone strip's proportions (80 wide : 58 tall,
   team-hub.css .th-strip-stage) and is drawn exactly as .th-strip-art is: 170%
   of the window's height, the head near the top, placed by the owner's
   art-board STRIP placement (hub-art-placements.js -> --th-ax/--th-ay/--th-as,
   set inline per cookie by dex-view.js). Same proportions, same formula, so
   every placement tuned for the strip carries over unchanged. The art dials
   (styles-art-dials.css) still land on .cookie-card but nothing here reads
   them: they frame the SPRITE, which the team pages keep. */
.th .dex-banner-slot { position: relative; min-width: 0; }
.th .dex-banner { --dex-banner-edge: 2px; --dex-banner-r: 16px; position: relative; display: block; width: 100%; aspect-ratio: 1393 / 357; padding: 0; border: var(--dex-banner-edge) solid rgba(var(--th-rc-rgb, 120, 128, 150), 0.62); border-radius: var(--dex-banner-r); color: inherit; font: inherit; text-align: left; text-decoration: none; isolation: isolate; container: dex-banner / inline-size;
  /* the rarity glow behind the art eases out (long, gentle tails) rather than
     ramping straight to nothing, where it drew a line half way across the
     banner (owner's call, 2026-11-06) */
  background:
    radial-gradient(58% 150% at 14% 60%, rgba(var(--th-rc-rgb, 120, 128, 150), 0.5) 0%, rgba(var(--th-rc-rgb, 120, 128, 150), 0.36) 18%, rgba(var(--th-rc-rgb, 120, 128, 150), 0.22) 36%, rgba(var(--th-rc-rgb, 120, 128, 150), 0.12) 52%, rgba(var(--th-rc-rgb, 120, 128, 150), 0.055) 68%, rgba(var(--th-rc-rgb, 120, 128, 150), 0.018) 84%, rgba(var(--th-rc-rgb, 120, 128, 150), 0) 100%),
    linear-gradient(90deg, rgba(var(--th-rc-rgb, 120, 128, 150), 0.14) 0%, rgba(var(--th-rc-rgb, 120, 128, 150), 0.09) 30%, rgba(var(--th-rc-rgb, 120, 128, 150), 0.045) 55%, rgba(var(--th-rc-rgb, 120, 128, 150), 0.015) 78%, rgba(var(--th-rc-rgb, 120, 128, 150), 0) 100%),
    var(--th-surface-1);
  box-shadow: var(--th-shadow-1); transition: transform 0.16s ease, box-shadow 0.16s ease; cursor: pointer; }
.th .dex-banner:hover { transform: translateY(-2px); }
.th .dex-banner:focus-visible { outline: 3px solid var(--th-focus-color); outline-offset: 3px; }
.th .dex-banner-slot.is-collected .dex-banner { box-shadow: 0 0 0 3px var(--th-own), 0 0 14px -2px rgba(var(--th-own-rgb), 0.6), var(--th-shadow-1); }
body[data-hide-collected-frames="true"] .th .dex-banner-slot.is-collected .dex-banner,
body[data-hide-collection-ui="true"] .th .dex-banner-slot.is-collected .dex-banner { box-shadow: var(--th-shadow-1); }
/* the art window: the full height of the frame at the strip's 80:58, its own
   lit stage (rarity light from below, the element at the feet), the right edge
   feathered into the card so the figure reads as standing in it */
/* The window is WIDER than the strip's 80:58 (owner's call, 2026-10-26: the
   banners had room to spare between the art and the words). The strip's own
   80-wide window sits inside it, --dex-win-l in from the left and --dex-win-r
   short of the right, and every placement is resolved against THAT inner
   window, so a strip placement still lands the face where the owner put it
   and the extra width only uncovers more of the art around it. */
.th .dex-banner { --dex-win-l: 24; --dex-win-r: 16; }
.th .dex-banner-stage { --dex-win-w: calc(80 + var(--dex-win-l) + var(--dex-win-r)); position: absolute; z-index: 1; top: 0; bottom: 0; left: 0; aspect-ratio: var(--dex-win-w) / 58; overflow: hidden; border-radius: calc(var(--dex-banner-r) - var(--dex-banner-edge)) 0 0 calc(var(--dex-banner-r) - var(--dex-banner-edge));
  background:
    radial-gradient(80% 70% at 50% 92%, rgba(var(--th-rc-rgb, 120, 128, 150), 0.55), rgba(var(--th-rc-rgb, 120, 128, 150), 0) 72%),
    radial-gradient(60% 50% at 50% 100%, rgba(var(--th-el), 0.32), rgba(var(--th-el), 0) 70%);
  /* the art's fade into the words side: an EASED ramp (smoothstep from 66%
     of the window to its edge, biased to fade sooner; it started at 18%
     until 2026-11-14, then 50%, when the owner asked for more of the art left clear), not a straight one,
     whose two corners read as a seam where the fade starts and a hard line
     where it ends, most of all on the dark ground (owner's call, 2026-11-06) */
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 66.0%, rgba(0, 0, 0, 0.949) 68.8%, rgba(0, 0, 0, 0.856) 71.7%, rgba(0, 0, 0, 0.745) 74.5%, rgba(0, 0, 0, 0.626) 77.3%, rgba(0, 0, 0, 0.505) 80.2%, rgba(0, 0, 0, 0.389) 83.0%, rgba(0, 0, 0, 0.282) 85.8%, rgba(0, 0, 0, 0.188) 88.7%, rgba(0, 0, 0, 0.109) 91.5%, rgba(0, 0, 0, 0.050) 94.3%, rgba(0, 0, 0, 0.013) 97.2%, rgba(0, 0, 0, 0.000) 100.0%);
  mask-image: linear-gradient(90deg, #000 0%, #000 66.0%, rgba(0, 0, 0, 0.949) 68.8%, rgba(0, 0, 0, 0.856) 71.7%, rgba(0, 0, 0, 0.745) 74.5%, rgba(0, 0, 0, 0.626) 77.3%, rgba(0, 0, 0, 0.505) 80.2%, rgba(0, 0, 0, 0.389) 83.0%, rgba(0, 0, 0, 0.282) 85.8%, rgba(0, 0, 0, 0.188) 88.7%, rgba(0, 0, 0, 0.109) 91.5%, rgba(0, 0, 0, 0.050) 94.3%, rgba(0, 0, 0, 0.013) 97.2%, rgba(0, 0, 0, 0.000) 100.0%); }
/* exactly .th-strip-art (team-hub.css): top -3px of a 58px window is -5.17% */
.th .dex-banner-art { position: absolute; z-index: 1; top: -5.17%; left: calc((var(--dex-win-l) * 100% + var(--th-ax, 50%) * 80) / var(--dex-win-w)); height: 170%; width: auto; max-width: none; transform-origin: 50% 0; transform: translate(-50%, var(--th-ay, 0%)) scale(var(--th-as, 1)); filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); }
.th .dex-banner-art.is-missing { display: none; }
.th .dex-banner-ini { position: absolute; inset: 0 calc(var(--dex-win-r) * 100% / var(--dex-win-w)) 0 calc(var(--dex-win-l) * 100% / var(--dex-win-w)); display: grid; place-items: center; font: 700 26cqw/1 "CookieRun KR", "Outfit", sans-serif; font-size: max(20px, 7cqw); color: var(--th-ink-3); visibility: hidden; }
.th .dex-banner-stage:has(.dex-banner-art.is-missing) .dex-banner-ini { visibility: visible; }
/* near-black art (Time Shadow): the hub's own treatment, an element glow
   behind the figure and a pale rim on it (.th-pi.is-dark-art) */
.th .dex-banner-slot.is-dark-art .dex-banner-stage { background: radial-gradient(70% 70% at 50% 62%, rgba(var(--th-el), 0.95), rgba(var(--th-el), 0.25) 62%, rgba(var(--th-el), 0) 82%), linear-gradient(180deg, rgba(var(--th-el), 0.3), rgba(var(--th-dark-stage-rgb, 6, 8, 14), 0.3)); }
.th .dex-banner-slot.is-dark-art .dex-banner-art { filter: drop-shadow(0 0 1px rgba(236, 228, 255, 0.95)) drop-shadow(0 0 1px rgba(236, 228, 255, 0.7)) drop-shadow(0 0 8px rgba(var(--th-el), 0.9)) brightness(1.18); }
/* the words: the right of the card, past the window */
.th .dex-banner-words { position: absolute; z-index: 3; top: 9.4%; right: 3.6%; bottom: 9.4%; left: 38%; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 2.6cqw; min-width: 0; text-align: right; }
.th .dex-banner-words > * { flex: none; max-width: 100%; }
.th .dex-banner-top { display: flex; align-items: center; justify-content: flex-end; gap: 2cqw; }
.th .dex-banner-ribbon { display: block; height: max(13px, 4.2cqw); width: auto; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); }
.th .dex-banner-promo { display: block; height: max(13px, 4.4cqw); width: auto; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.7)); }
.th .dex-banner-promo[data-promotion-shape="star-row"] { height: max(11px, 3.6cqw); }
.th .dex-banner-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; max-width: 100%; padding-bottom: 0.1em; margin-bottom: -0.1em; font: 700 19px/1.12 "CookieRun KR", "Outfit", sans-serif; letter-spacing: 0.1px; color: var(--th-heading); text-shadow: var(--th-heading-shadow); text-wrap: balance; }
.th .dex-banner-name[data-name-len="l"] { font-size: 17px; }
.th .dex-banner-name[data-name-len="xl"] { font-size: 15.5px; }
.th .dex-banner-form { margin-top: -1.6cqw; font: 700 12.5px/1.1 "CookieRun KR", "Outfit", sans-serif; color: var(--th-gold); text-shadow: var(--th-heading-shadow); }
.th .dex-banner-facts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 2px 8px; font-size: 12.5px; font-weight: 600; color: var(--th-ink-2); }
.th .dex-banner-fact { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.th .dex-banner-fact img { width: 17px; height: 17px; object-fit: contain; }
.th .dex-banner-els { display: inline-flex; align-items: center; gap: 2px; }
.th .dex-banner-els img { width: 19px; height: 19px; border-radius: 50%; }
/* badges over the art: level + star top-left, candy bottom-left (where the
   live comfy card has them) */
.th .dex-banner-tl { position: absolute; z-index: 4; top: 7%; left: 2%; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; pointer-events: none; }
.th .dex-banner-tl .dex-lv { height: 18px; padding: 0 6px; font-size: 11px; }
.th .dex-banner-tl .dex-fav { width: 22px; min-width: 0; }
.th .dex-banner-candy { position: absolute; z-index: 4; left: -1.5%; bottom: -10%; width: 12%; display: grid; justify-items: center; pointer-events: none; }
.th .dex-banner-candy img { width: 100%; height: auto; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.6)); }
.th .dex-banner-candy b { position: relative; z-index: 1; margin-top: -22%; min-width: 1.9em; padding: 1px 5px; border-radius: 999px; font-size: 11px; font-weight: 800; line-height: 1.2; text-align: center; color: #fff; background: rgba(8, 12, 22, 0.94); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28), 0 1px 4px rgba(0, 0, 0, 0.5); }
.th .dex-banner .is-dormant { opacity: 0.45; filter: grayscale(0.85); }
.th .dex-banner-new { position: absolute; z-index: 4; top: 7%; left: 46%; }
.th .dex-banner-new.th-tag { height: 20px; color: var(--th-on-gold); border-color: transparent; background: var(--th-gold-fill); letter-spacing: 0.06em; text-transform: uppercase; font-size: 10.5px; }
/* Collection mode: the "+" disc rides the art window's top-right corner */
.th .dex-banner-disc { z-index: 5; top: 8%; right: auto; left: calc(28% - 10px); }
.th .dex-banner-slot.is-collecting .dex-banner-candy { display: none; }
/* the SPLIT banner (1b, the Quick look): the card is a <div>; a button over
   the whole of it opens the look, and the name, raised above that button, is
   the profile link. Everything else on the card lets presses through. */
.th .dex-banner-look { position: absolute; inset: 0; z-index: 2; display: block; width: 100%; padding: 0; border: 0; border-radius: inherit; background: none; cursor: pointer; }
.th .dex-banner-look:focus-visible { outline: 3px solid var(--th-focus-color); outline-offset: 5px; }
.th .dex-banner-slot.is-split .dex-banner-words, .th .dex-banner-slot.is-split .dex-banner-new { pointer-events: none; }
.th .dex-banner-slot.is-split a.dex-banner-name { pointer-events: auto; position: relative; z-index: 4; text-decoration: none; }
.th .dex-banner-slot.is-split a.dex-banner-name:hover { color: var(--th-gold); }
.th .dex-banner-slot.is-split a.dex-banner-name:focus-visible { outline: 2px solid var(--th-focus-color); outline-offset: 2px; border-radius: 4px; }
/* the opened banner wears the gold ring; the rest step back, names kept */
.th .dex-banner-slot.is-open .dex-banner { box-shadow: 0 0 0 3px var(--th-gold), 0 0 18px -2px var(--th-gold-glow), var(--th-shadow-1); }
.th [data-look-open] .dex-banner-slot:not(.is-open) :is(.dex-banner-stage, .dex-banner-tl, .dex-banner-candy, .dex-banner-top, .dex-banner-facts) { opacity: 0.4; filter: saturate(0.35) blur(2px); transition: opacity 0.18s ease, filter 0.18s ease; }
.th [data-look-open] .dex-banner-slot:not(.is-open):is(:hover, :focus-within) :is(.dex-banner-stage, .dex-banner-tl, .dex-banner-candy, .dex-banner-top, .dex-banner-facts) { opacity: 1; filter: none; }
/* phone comfy: the frame's own phone proportions; the window keeps 80:58 */
@media (max-width: 699px) {
  .th .dex-banner { --dex-banner-r: 12px; --dex-win-l: 16; --dex-win-r: 10; aspect-ratio: 1393 / 280; }
  .th .dex-banner-words { top: 8%; bottom: 8%; left: 30%; right: 3.8%; gap: 3px; }
  .th .dex-banner-name { font-size: 16px; -webkit-line-clamp: 1; }
  .th .dex-banner-name[data-name-len="l"] { font-size: 14.5px; }
  .th .dex-banner-name[data-name-len="xl"] { font-size: 13px; -webkit-line-clamp: 2; line-height: 1.08; }
  .th .dex-banner-form { margin-top: -2px; font-size: 11px; }
  .th .dex-banner-ribbon { height: 12px; }
  .th .dex-banner-promo { height: 12px; }
  /* phones: the facts as icons (their words stay the accessible name) */
  .th .dex-banner-fact > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .th .dex-banner-facts { gap: 4px; }
  .th .dex-banner-fact img, .th .dex-banner-els img { width: 18px; height: 18px; }
  .th .dex-banner-tl { top: 6%; }
  .th .dex-banner-tl .dex-lv { height: 16px; font-size: 10px; padding: 0 5px; }
  .th .dex-banner-tl .dex-fav { width: 18px; }
  .th .dex-banner-candy { width: 11%; bottom: -12%; }
  .th .dex-banner-candy b { font-size: 9.5px; padding: 0 4px; }
  .th .dex-banner-new { left: 34%; }
  .th .dex-banner-disc { left: calc(21% - 12px); }
}


/* ---------- D5 · grids ---------- */
/* COMPACT: column counts are STATED per container width (the tier list's
   lesson, proposal §2.7): >=1200 8 · 1000-1199 7 · 701-999 6 · 501-700 5 ·
   341-500 4 · <=340 3. Gaps 14px desktop, 8px phone. The count is exposed as
   --dex-cols so a renderer can do the orphan arithmetic. */
.th .dex-tiles { --dex-cols: 8; display: grid; grid-template-columns: repeat(var(--dex-cols), minmax(0, 1fr)); gap: 14px 14px; align-items: start; }
@container th (max-width: 1199px) { .th .dex-tiles { --dex-cols: 7; } }
@container th (max-width: 999px) { .th .dex-tiles { --dex-cols: 6; } }
@container th (max-width: 700px) { .th .dex-tiles { --dex-cols: 5; gap: 10px 8px; } }
@container th (max-width: 500px) { .th .dex-tiles { --dex-cols: 4; } }
@container th (max-width: 340px) { .th .dex-tiles { --dex-cols: 3; } }
/* "Show names" off restores the face wall: one more column on a phone */
@container th (max-width: 500px) { .th .dex-tiles[data-names="off"] { --dex-cols: 5; } }
/* COMFY: 3 at >=1200 (430x110 at 1440, the live card's size, so the px
   dials land where the owner tuned them), 2 to 701, 1 below */
.th .dex-banners { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 26px; }
@container th (max-width: 1199px) { .th .dex-banners { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; } }
@container th (max-width: 700px) { .th .dex-banners { grid-template-columns: minmax(0, 1fr); gap: 12px; } }


/* ---------- D7 · Your progress: the COMPACT form and the ladder picker ----------
   lib/dex-progress.js's compact form (the grid's Quick look, proposal §2.9,
   §3.6) and the 1b ladder picker / candy quick-sets, which either form can
   draw. Here rather than in profile/profile.css because the grid loads this
   file and not that one; every rule is scoped .dex-prog--compact, .dex-ladder
   or .dex-candy-sets, so the profile's full form is untouched. Built from the
   system's tokens; Max all is NEUTRAL here (the Quick look's gold is "Open
   full profile", §6.1). */
.th .dex-prog--compact { display: grid; gap: 10px; min-width: 0; }
.th .dex-prog--compact .dex-prog-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.th .dex-prog--compact .dex-prog-head .dex-ring { --s: 36px; }
.th .dex-prog--compact .dex-prog-title { min-width: 0; }
.th .dex-prog--compact .dex-prog-title p { margin: 0; font-size: 12.5px; color: var(--th-ink-3); }
.th .dex-prog--compact .dex-prog-title .dex-prog-h { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--th-ink-2); }
.th .dex-prog--compact .dex-prog-acts { display: flex; gap: 6px; margin-left: auto; }
.th .dex-prog--compact .dex-prog-acts .th-btn:disabled { color: var(--th-ink-3); background: transparent; box-shadow: inset 0 0 0 1px var(--th-line-2); cursor: default; }
.th .dex-prog--compact .dex-prog-dormant { margin: 0; font-size: 12.5px; color: var(--th-ink-2); }
.th .dex-prog--compact .dex-prog-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.th .dex-prog--compact .dex-prog-chip,
.th .dex-prog--compact .dexp-fav { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 52px; height: 40px; padding: 0 8px; border: 0; border-radius: 14px; background: var(--th-btn-bg); font-size: 14px; font-weight: 800; line-height: 1; color: var(--th-ink); }
.th .dex-prog--compact .dex-prog-chip:hover, .th .dex-prog--compact .dexp-fav:hover { background: var(--th-btn-hover); }
.th .dex-prog--compact .dex-prog-chip:focus-visible, .th .dex-prog--compact .dexp-fav:focus-visible { outline: 3px solid var(--th-btn-focus); outline-offset: 0; }
.th .dex-prog--compact .dex-prog-chip small { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--th-ink-3); }
.th .dex-prog--compact .dex-prog-chip[aria-expanded="true"] { color: var(--th-sel-ink); background: var(--th-sel-bg); }
.th .dex-prog--compact .dex-prog-chip[aria-expanded="true"] small { color: inherit; }
.th .dex-prog--compact .dex-prog-chip-ic { height: 15px; width: auto; max-width: 100%; object-fit: contain; }
.th .dex-prog--compact .dex-prog-chip-ic[data-promotion-shape="six-star"] { height: 19px; margin: -2px 0; }
.th .dex-prog--compact .dex-prog-chip-candy { height: 22px; margin: -3px 0 -1px; }
.th .dex-prog--compact .dex-prog-chip-ic.is-locked { opacity: 0.45; filter: grayscale(0.8); }
.th .dex-prog--compact .dexp-fav img { width: 22px; height: 22px; object-fit: contain; }
.th .dex-prog--compact .dexp-fav[aria-pressed="false"] img { opacity: 0.55; }
.th .dex-prog--compact .dex-switch { height: 40px; min-height: 40px; border-radius: 14px; }
.th .dex-prog--compact .dex-prog-editor { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px; border-radius: 16px; background: var(--th-surface-1); border: 1px solid var(--th-line-2); }
.th .dex-prog--compact .dex-prog-editor[hidden] { display: none; }
.th .dex-prog--compact .dex-step .dex-step-val img { height: 21px; }
.th .dex-prog--compact .dex-step .dex-step-val img.is-locked { opacity: 0.45; filter: grayscale(0.8); }
.th .dex-prog--compact .dex-num .dexp-num-val::before { content: "Lv."; font-size: 11.5px; font-weight: 700; color: var(--th-ink-3); }
.th .dex-prog--compact .dexp-marks { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--th-ink-3); }
.th .dex-prog--compact .dexp-marks li.is-on { color: var(--th-ink); }
.th .dex-prog--compact .dexp-marks svg { width: 13px; height: 13px; vertical-align: -2px; }
@container th (max-width: 700px) {
  /* the head's "Your progress" label says what the chips under it already
     show; dropped, the ring's sentence keeps one line beside Undo and Max all */
  .th .dex-prog--compact .dex-prog-h { display: none; }
  .th .dex-prog--compact .dex-prog-title p { line-height: 1.3; }
  .th .dex-prog--compact .dex-prog-chip, .th .dex-prog--compact .dexp-fav, .th .dex-prog--compact .dex-switch { height: 44px; min-height: 44px; flex: 1 1 54px; }
  .th .dex-prog--compact .dexp-fav { min-width: 54px; }
}
/* the narrowest phones: Undo and Max all keep their icons and give up their
   words (still their accessible names), so the ring's sentence keeps a line */
@container th (max-width: 380px) {
  .th .dex-prog--compact .dex-prog-acts .th-btn { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .th .dex-prog--compact .dex-prog-acts .th-btn > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* LADDER PICKER: every step of one promotion track as a radio (0, 1★…5★,
   1A…5A, or the six-star set), 36px desktop / 44px phone, wrapping. The
   checked step wears the selected-chip style. */
.th .dex-ladder { display: flex; flex-wrap: wrap; gap: 4px; flex-basis: 100%; min-width: 0; }
.th .dex-ladder-step { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 40px; height: 40px; padding: 0 6px; border: 0; border-radius: 12px; background: var(--th-btn-bg); font-size: 11.5px; font-weight: 800; line-height: 1; color: var(--th-ink-2); }
.th .dex-ladder-step:hover { background: var(--th-btn-hover); }
.th .dex-ladder-step:focus-visible { outline: 3px solid var(--th-btn-focus); outline-offset: 0; }
.th .dex-ladder-step[aria-checked="true"] { color: var(--th-sel-ink); background: var(--th-sel-bg); }
.th .dex-ladder-step img { height: 16px; width: auto; max-width: 52px; object-fit: contain; }
.th .dex-ladder-step img[data-promotion-shape="star-row"] { height: 10px; }
.th .dex-ladder-step img[data-promotion-shape="six-star"] { height: 20px; margin: -2px 0; }
.th .dex-step .dex-step-pick { cursor: pointer; }
/* CANDY QUICK-SETS: [Unlock] [Lv 10] [Lv 20] [Lv 30], the current one pressed */
.th .dex-candy-sets { display: flex; flex-wrap: wrap; gap: 4px; }
.th .dex-candy-set { display: inline-flex; align-items: baseline; gap: 3px; min-width: 52px; height: 36px; padding: 0 10px; justify-content: center; align-items: center; border: 0; border-radius: 999px; background: var(--th-btn-bg); font-size: 13px; font-weight: 800; color: var(--th-ink); }
.th .dex-candy-set small { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--th-ink-3); }
.th .dex-candy-set:hover { background: var(--th-btn-hover); }
.th .dex-candy-set:focus-visible { outline: 3px solid var(--th-btn-focus); outline-offset: 0; }
.th .dex-candy-set[aria-pressed="true"] { color: var(--th-sel-ink); background: var(--th-sel-bg); }
.th .dex-candy-set[aria-pressed="true"] small { color: inherit; }
@container th (max-width: 700px) {
  .th .dex-ladder-step { min-width: 44px; height: 44px; }
  .th .dex-candy-set { height: 44px; }
}

/* ---------- D6 · forced colours, reduced motion ---------- */
@media (forced-colors: active) {
  .th .dex-tile.is-collected .dex-tile-frame::before { border-color: Highlight; }
  .th .dex-art::after { box-shadow: inset 0 0 0 2px CanvasText; }
  .th :is(.dex-meter, .dex-ring) { border: 1px solid CanvasText; }
  .th .dex-chip[aria-pressed="true"], .th .dex-switch[aria-checked="true"] .dex-switch-knob { background: SelectedItem; color: SelectedItemText; forced-color-adjust: none; }
  .th .dex-disc { border: 2px solid CanvasText; }
  .th .dex-switch-knob { border: 1px solid CanvasText; }
  .th .dex-banner-slot.is-collected .dex-banner { outline: 3px solid Highlight; }
  .th .dex-tile.is-open .dex-tile-frame::before { border-color: SelectedItem; }
  .th .dex-banner-slot.is-open .dex-banner { outline: 3px solid SelectedItem; }
  .th [data-look-open] :is(.dex-art, .dex-tile-badges, .dex-banner-stage) { filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .th .dex-tile-frame, .th .dex-banner { transition: none; }
  .th [data-look-open] :is(.dex-art, .dex-tile-badges, .dex-banner-stage, .dex-banner-tl, .dex-banner-candy, .dex-banner-top, .dex-banner-facts) { transition: none; }
  .th .dex-tile-link:hover .dex-tile-frame, .th .dex-tile-art:hover .dex-tile-frame, .th .dex-banner:hover { transform: none; }
}


/* ============================================================================
   L · LIGHT THEME
   ========================================================================== */
:root[data-theme="light"] .th {
  --th-own: #0e7450;
  --th-own-rgb: 14, 116, 80;
  --th-own-ink: #0e7450;          /* 6.0:1 on white */
}
:root[data-theme="light"] .th .pos-rear { --th-lane-ink: #1d63ad; }    /* 6.2:1 on white */
:root[data-theme="light"] .th .pos-middle { --th-lane-ink: #8a5a00; }  /* 5.9:1 */
:root[data-theme="light"] .th .pos-front { --th-lane-ink: #b8323b; }   /* 5.7:1 */
/* PROMOTE (§8.1): --th-rc-wash, the profile's ten existing light washes
   (styles-profile-page.css :14817-14826), for white banners and the Stage */
:root[data-theme="light"] .th { --th-rc-wash: #ece4f8; }
:root[data-theme="light"] .th .r-common { --th-rc-wash: #efe5da; }
:root[data-theme="light"] .th .r-rare { --th-rc-wash: #dcebf8; }
:root[data-theme="light"] .th .r-special { --th-rc-wash: #faf0c8; }
:root[data-theme="light"] .th .r-epic { --th-rc-wash: #fbe0ee; }
:root[data-theme="light"] .th .r-super-epic { --th-rc-wash: #f1dcf6; }
:root[data-theme="light"] .th .r-dragon { --th-rc-wash: #f9e0d6; }
:root[data-theme="light"] .th .r-legendary { --th-rc-wash: #d8f1ec; }
:root[data-theme="light"] .th .r-ancient { --th-rc-wash: #e8dcf8; }
:root[data-theme="light"] .th .r-witch { --th-rc-wash: #f7dbef; }
:root[data-theme="light"] .th .r-beast { --th-rc-wash: #f5d9dd; }

:root[data-theme="light"] .th .dex-meter { box-shadow: inset 0 1px 2px rgba(42, 22, 82, 0.12); }
:root[data-theme="light"] .th .dex-meter > i { box-shadow: none; }
:root[data-theme="light"] .th .dex-chip[class*="el-"]:not(.el-none):not([aria-pressed="true"]) { background: rgba(var(--th-el), 0.12); box-shadow: inset 0 0 0 1px var(--th-el-edge); }
:root[data-theme="light"] .th .dex-chip[class*="el-"]:not(.el-none):not([aria-pressed="true"]):hover { background: rgba(var(--th-el), 0.2); }
/* the selected state is the system's grape chip whatever the element */
:root[data-theme="light"] .th .dex-chip[aria-pressed="true"] { color: var(--th-sel-ink); background: var(--th-sel-bg); box-shadow: var(--th-sel-shadow); }
:root[data-theme="light"] .th .dex-step .dex-step-val { background: #ffffff; }
:root[data-theme="light"] .th .dex-lv { color: #ffffff; background: rgba(42, 22, 82, 0.86); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4), 0 2px 5px rgba(42, 22, 82, 0.3); }
:root[data-theme="light"] .th .dex-lv.is-max { color: #2a1206; background: var(--th-gold-fill); }
:root[data-theme="light"] .th .dex-art { box-shadow: 0 2px 0 var(--th-ledge), 0 6px 14px -8px rgba(60, 30, 120, 0.35); }
:root[data-theme="light"] .th .dex-art::after { box-shadow: inset 0 0 0 var(--dex-edge) var(--th-rc, var(--th-line-3)), inset 0 0 0 calc(var(--dex-edge) + 1px) rgba(255, 255, 255, 0.35); }
:root[data-theme="light"] .th .dex-tile.is-collected .dex-tile-frame::before { box-shadow: none; }
:root[data-theme="light"] .th .dex-tile-link:hover .dex-tile-name, :root[data-theme="light"] .th a.dex-tile-name:hover { color: var(--th-link); }
:root[data-theme="light"] .th .dex-tile-el img, :root[data-theme="light"] .th .dex-tile-el-more { box-shadow: 0 0 0 max(1px, 1cqw) #ffffff; background: #ffffff; }
:root[data-theme="light"] .th .dex-disc { background: #ffffff; }
:root[data-theme="light"] .th { --dex-fav: #6a3fdc; } /* the light violet, 6.6:1 on white */
:root[data-theme="light"] .th .dex-disc--max { box-shadow: inset 0 0 0 2px var(--th-gold-2), 0 2px 6px rgba(42, 22, 82, 0.25); }
:root[data-theme="light"] .th .dex-disc--max svg { color: #855400; }
:root[data-theme="light"] .th .dex-banner-slot.is-open .dex-banner { box-shadow: 0 0 0 3px var(--th-gold-2), var(--th-shadow-1); }
@container th (max-width: 700px) {
  :root[data-theme="light"] .th .dex-lv:not(.is-max) { color: #ffffff; background: none; box-shadow: none; }
}
/* light banners are WHITE cards with the pastel rarity wash behind the art
   and the lavender ledge (DIRECTION 5: "move away from the dark cards") */
:root[data-theme="light"] .th .dex-banner { border-color: var(--th-rc); background:
    radial-gradient(30% 92% at 19% 60%, rgba(var(--th-rc-rgb), 0.22) 0%, rgba(var(--th-rc-rgb), 0.15) 30%, rgba(var(--th-rc-rgb), 0.08) 55%, rgba(var(--th-rc-rgb), 0.03) 78%, rgba(var(--th-rc-rgb), 0) 100%),
    radial-gradient(62% 140% at 18% 64%, var(--th-rc-wash) 0%, color-mix(in srgb, var(--th-rc-wash) 55%, transparent) 40%, color-mix(in srgb, var(--th-rc-wash) 18%, transparent) 62%, rgba(255, 255, 255, 0) 80%),
    linear-gradient(90deg, var(--th-rc-wash) 0%, color-mix(in srgb, var(--th-rc-wash) 72%, #ffffff) 16%, color-mix(in srgb, var(--th-rc-wash) 40%, #ffffff) 32%, color-mix(in srgb, var(--th-rc-wash) 16%, #ffffff) 48%, color-mix(in srgb, var(--th-rc-wash) 4%, #ffffff) 62%, #ffffff 74%);
  box-shadow: var(--th-shadow-1); }
:root[data-theme="light"] .th .dex-banner-slot.is-collected .dex-banner { box-shadow: 0 0 0 3px var(--th-own), var(--th-shadow-1); }
:root[data-theme="light"] .th .dex-banner-stage { background: radial-gradient(80% 70% at 50% 92%, var(--th-rc-wash), rgba(255, 255, 255, 0) 78%), radial-gradient(60% 50% at 50% 100%, rgba(var(--th-el), 0.18), rgba(var(--th-el), 0) 70%); }
:root[data-theme="light"] .th .dex-banner-art { filter: drop-shadow(0 6px 10px rgba(60, 30, 110, 0.26)) drop-shadow(0 1px 1.5px rgba(60, 30, 110, 0.3)); }
:root[data-theme="light"] .th .dex-banner-slot.is-dark-art .dex-banner-stage { background: radial-gradient(70% 70% at 50% 62%, rgba(var(--th-el), 0.95), rgba(var(--th-el), 0.4) 62%, rgba(var(--th-el), 0.14) 84%); }
:root[data-theme="light"] .th .dex-banner-slot.is-dark-art .dex-banner-art { filter: drop-shadow(0 0 1px rgba(236, 228, 255, 0.95)) drop-shadow(0 0 8px rgba(var(--th-el), 0.9)) brightness(1.18); }
:root[data-theme="light"] .th .dex-banner-ribbon, :root[data-theme="light"] .th .dex-banner-promo { filter: drop-shadow(0 1px 2px rgba(60, 30, 110, 0.35)); }
:root[data-theme="light"] .th .dex-banner-facts { color: var(--th-ink-2); }
:root[data-theme="light"] .th .dex-banner-els img { box-shadow: 0 0 0 1.5px #ffffff; }


/* ---------- the Collection mode switch (card view, 2026-11-02) ----------
   One markup on the grid's toolbar, its phone binder, the Quick look and the
   profile's bar (lib/dex-view.js collectModeButtonMarkup). */
/* the switch: a pill with a knob, never gold (Done is the mode's gold) */
.th .dex-mode-btn { gap: 9px; padding-left: 9px; }
.th .dex-mode-knob { position: relative; flex: none; width: 34px; height: 20px; border-radius: 10px; background: var(--th-btn-divide); transition: background 0.15s ease; }
.th .dex-mode-knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--th-btn-icon); transition: left 0.15s ease, background 0.15s ease; }
.th .dex-mode-btn.is-on, .th .dex-mode-btn.dex-collect-btn.is-on { color: var(--th-heading); background: var(--th-gold-faint); box-shadow: inset 0 0 0 1px var(--th-gold-line); }
.th .dex-mode-btn.is-on .dex-mode-knob { background: var(--th-switch-on); }
.th .dex-mode-btn.is-on .dex-mode-knob::after { left: 16px; background: var(--th-switch-knob-on); }
@media (prefers-reduced-motion: reduce) { .th .dex-mode-knob, .th .dex-mode-knob::after { transition: none; } }

/* ---------------------------------------------------------------- the build
   answer: the in-game build as one compact frame (the topping wheel, the
   recipe, the beascuit and its effects, the three targets, a link), drawn by
   lib/build-answer.js on the profile and in the Grid's Quick look. The
   profile's narrower layouts restate parts of it in profile.css. */
.th .dexp-answer { position: relative; margin-top: 12px; display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: center; gap: 16px; padding: 11px 16px 11px 14px; border-radius: 14px; background: linear-gradient(90deg, var(--th-gold-faint), rgba(240, 205, 126, 0) 60%), var(--th-surface-sunk); border: 1px solid var(--th-line-2); box-shadow: inset 3px 0 0 var(--th-gold); }
.th .dexp-answer-art { width: 74px; height: 74px; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5)); }
.th .dexp-answer-tx { display: grid; gap: 4px; min-width: 0; }
.th .dexp-answer-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.th .dexp-answer-k.th-link { flex: none; min-height: 24px; font-size: 12.5px; }
.th .dexp-answer-k svg { width: 14px; height: 14px; }
.th .dexp-recipe { font-size: 16.5px; font-weight: 800; line-height: 1.25; color: var(--th-heading); }
.th .dexp-bea { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--th-ink-2); min-width: 0; }
.th .dexp-bea img { width: 22px; height: 22px; object-fit: contain; flex: none; }
.th .dexp-bea > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th .dexp-bea b { color: var(--th-ink); font-weight: 700; }
.th .dexp-bea .th-dot { padding: 0 6px; }
.th .dexp-targets { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13.5px; color: var(--th-ink-2); }
.th .dexp-targets li { display: inline-flex; align-items: center; gap: 6px; }
.th .dexp-targets b { color: var(--th-ink); font-weight: 800; }
/* the ranked number: the hubs' spec-table gem (gold soft fill, dark numeral) */
.th .dexp-rank { display: inline-grid; place-items: center; width: 19px; height: 19px; flex: none; border-radius: 50%; font-style: normal; font-size: 11.5px; font-weight: 800; color: var(--th-on-gold); background: var(--th-gold-soft-fill); box-shadow: inset 0 -1px 0 rgba(120, 70, 10, 0.35); }
.th .dexp-answer.is-empty { grid-template-columns: minmax(0, 1fr); color: var(--th-ink-2); }
.th .dexp-answer-art-wrap { display: block; width: 74px; height: 74px; }
.th .dexp-answer.is-empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; min-height: 0; font-size: 14px; }
.th .dexp-answer.is-failed { box-shadow: inset 3px 0 0 var(--th-down, #ff9aa0); }
:root[data-theme="light"] .th .dexp-answer { background: linear-gradient(90deg, var(--th-gold-faint), rgba(255, 255, 255, 0) 60%), var(--th-surface-1); box-shadow: inset 3px 0 0 var(--th-gold-2), 0 2px 0 var(--th-ledge); }
:root[data-theme="light"] .th .dexp-answer-art { filter: drop-shadow(0 4px 6px rgba(60, 30, 110, 0.22)); }
