/* =============================================================================
   guide-page.css — the reference guides on the design system
   -----------------------------------------------------------------------------
   /toppings-guide/, /beascuit-guide/ and /resonant/ (October 2026). Linked
   after shared-shell.css and design-system.css; every colour, line, shadow and
   radius is a --th-* token, so both themes come from the system and this file
   adds light rules only for its few literals (section L).

   The three are long reference pages, so most of this file is about FINDING:
     .gd-head    the framed page header (the hubs' .th-hub-head approach, with
                 a "More guides" panel where a hub has its season panels)
     .gd-jump    the section bar: one chip per band, sticky under the site
                 header, the band on screen marked (guide-page.js)
     .gd-table   reference tables: aligned columns on a wide screen, one card
                 per row in a narrow column (container query on the table)
     .gd-ck      a cookie as a link to its Cookie-Dex page (face + name), the
                 way every list of cookies on these pages links out
   and the prose pieces between them (.gd-prose, .gd-fig, .gd-facts,
   .gd-tiles, .gd-steps, .gd-cta). Sections are the system's .th-band heads
   inside .th-bands, so they alternate strips like the hubs' seasons.
   ========================================================================== */

/* ---------- 1 · page header ---------- */
.th .gd-head { position: relative; margin-top: 22px; border-radius: 22px; border: 1px solid var(--th-gold-line); box-shadow: inset 0 0 0 4px rgba(var(--th-abyss-rgb), 0.55), inset 0 0 0 5px var(--th-gold-faint), var(--th-shadow-2); }
.th .gd-head-clip { position: absolute; inset: 0; border-radius: 21px; overflow: hidden; }
/* the art is the guide's own in-game screen, blurred until its lettering reads
   as colour (the mode pages' soft-art rule) */
.th .gd-head-art { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; object-position: 50% 40%; filter: blur(14px) saturate(1.2) brightness(0.8); }
.th .gd-head-veil { position: absolute; inset: 0; background:
    linear-gradient(90deg, var(--th-veil-strong) 0%, var(--th-veil-strong) 34%, var(--th-veil) 60%, var(--th-veil-strong) 100%),
    linear-gradient(180deg, transparent 45%, var(--th-veil) 100%); }
.th .gd-head .th-orn--bl { bottom: -5px; left: 40px; }
.th .gd-head .th-orn--br { bottom: -5px; right: 40px; }
.th .gd-head-in { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) var(--th-panel-w); gap: 16px; align-items: stretch; padding: 24px 24px 24px 32px; }
.th .gd-head-copy { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 236px; padding-right: 230px; }
.th .gd-head-copy > :not(.gd-head-emblem) { position: relative; z-index: 1; }
/* the guide's cookie stands between the copy and the panel */
.th .gd-head-emblem { position: absolute; z-index: 0; right: 0; bottom: -24px; height: 270px; width: auto; max-width: 260px; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.6)); pointer-events: none; }
.th .gd-title { margin-top: 8px; font-size: 46px; line-height: 1.02; text-shadow: var(--th-heading-shadow), 0 0 30px rgba(var(--th-m-rgb), 0.3); }
.th .gd-lede { margin-top: 12px; max-width: 620px; font-size: 15.5px; line-height: 1.55; color: var(--th-ink-2); }
.th .gd-facts-line { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 2px 18px; font-size: 13.5px; color: var(--th-ink-3); }
.th .gd-facts-line b { color: var(--th-ink); font-weight: 700; }
.th .gd-head-cta { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; }

/* the "More guides" panel: the family's other pages, each a link tile */
.th .gd-panel { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 14px; border-radius: 16px; background: var(--th-glass); border: 1px solid var(--th-gold-line); box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.3), inset 0 0 0 4px var(--th-gold-faint); }
.th .gd-panel .th-label { margin-bottom: 2px; }
.th .gd-guide { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border-radius: 12px; background: var(--th-btn-bg); transition: background-color 0.15s ease; }
.th .gd-guide:hover { background: var(--th-btn-hover); }
.th .gd-guide[aria-current="page"] { background: var(--th-wash); box-shadow: inset 0 0 0 1px var(--th-line-2); cursor: default; }
.th .gd-guide img { width: 46px; height: 46px; object-fit: contain; filter: var(--th-art-drop); }
.th .gd-guide-name { display: block; font: 700 15.5px/1.15 "CookieRun KR", "Outfit", sans-serif; color: var(--th-heading); }
.th .gd-guide-sub { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.35; color: var(--th-ink-3); }
.th .gd-guide svg { width: 16px; height: 16px; color: var(--th-ink-3); }
.th .gd-guide-here { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--th-gold); }

/* ---------- 2 · section bar ---------- */
/* Sticky under the site header (the hubs' toolbar position); one chip per
   band, the band on screen marked aria-current by guide-page.js. On a narrow
   screen it stays one row and scrolls sideways, keeping the marked chip in
   view, rather than wrapping into a block that would eat the screen. */
.th .gd-jump { position: sticky; top: var(--th-sticky-top); z-index: 20; margin-top: 18px; display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 14px; border-radius: 999px; background: var(--th-surface-1); border: 1px solid var(--th-line-2); box-shadow: var(--th-shadow-1); }
.th .gd-jump-label { flex: none; }
.th .gd-jump-list { position: relative; display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.th .gd-jump-list::-webkit-scrollbar { display: none; }
.th .gd-jump-list a { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px; border-radius: 999px; font-size: 13.5px; font-weight: 600; white-space: nowrap; color: var(--th-ink-3); transition: color 0.15s ease, background-color 0.15s ease; }
.th .gd-jump-list a:hover { color: var(--th-ink); background: var(--th-btn-bg); }
.th .gd-jump-list a[aria-current="true"] { color: var(--th-sel-ink); background: var(--th-sel-bg); box-shadow: var(--th-sel-shadow); }
.th .gd-jump-list a:focus-visible { outline: 3px solid var(--th-btn-focus); outline-offset: -1px; }
.th .gd-jump-n { font-size: 11px; font-weight: 800; opacity: 0.7; }
.th .gd-jump-top { margin-left: auto; flex: none; }
/* every band clears the site header AND the bar when jumped to */
.th .gd-bands > .th-band { scroll-margin-top: calc(var(--th-sticky-top) + 64px); }
.th [id].gd-anchor { scroll-margin-top: calc(var(--th-sticky-top) + 72px); }

/* ---------- 3 · bands and prose ---------- */
.th .gd-bands { margin-top: 10px; }
/* a band's content flows with one rhythm: 16px between blocks, more above a
   subsection heading, less between a heading and its first paragraph */
.th .gd-bands > .th-band > * + *, .th .gd-stack > * + * { margin-top: 16px; }
.th .gd-stack { display: block; }
.th .gd-bands > .th-band > .th-band-head + * { margin-top: 0; }
.th .gd-prose { max-width: 76ch; font-size: 15.5px; line-height: 1.62; color: var(--th-ink-2); }
.th .gd-prose + .gd-prose { margin-top: 10px; }
.th .gd-prose strong, .th .gd-prose b { color: var(--th-ink); font-weight: 700; }
.th .gd-prose a, .th .gd-link { color: var(--th-link); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.th .gd-prose a:hover, .th .gd-link:hover { text-decoration-color: currentColor; }
.th .gd-inline-ic { display: inline-block; width: 22px; height: 22px; margin: 0 3px -5px 0; object-fit: contain; }
/* a subsection inside a band */
.th .gd-sub { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.th .gd-bands > .th-band > .gd-sub, .th .gd-stack > .gd-sub { margin-top: 30px; }
.th :is(.gd-bands > .th-band, .gd-stack) > .gd-sub + * { margin-top: 8px; }
.th .gd-sub::before { content: ""; width: 8px; height: 8px; transform: rotate(45deg); background: var(--th-gold-gem); flex: none; }
.th .gd-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.th .gd-split--fig-left { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }

/* fact cards: the short "how it works" points, always open */
.th .gd-facts { display: grid; gap: 12px; }
.th .gd-fact { padding: 14px 16px 15px; border-radius: var(--th-radius); background: var(--th-surface-1); border: 1px solid var(--th-line-2); box-shadow: var(--th-shadow-1); }
.th .gd-fact h3 { display: flex; align-items: center; gap: 9px; font-size: 17.5px; }
.th .gd-fact-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font: 800 12.5px/1 "Outfit", sans-serif; color: var(--th-on-gold); background: var(--th-gold-fill); text-shadow: none; flex: none; }
.th .gd-fact p { margin-top: 6px; font-size: 14.5px; line-height: 1.55; color: var(--th-ink-2); }
.th .gd-fact strong { color: var(--th-ink); }

/* figures: an in-game screen on a framed well, caption under it */
.th .gd-fig { display: grid; gap: 8px; justify-items: center; padding: 12px; border-radius: 16px; background: var(--th-surface-sunk); border: 1px solid var(--th-line); }
/* The box is the column's width, so its height is reserved from the image's
   width/height attributes BEFORE a lazy image loads; object-fit keeps the art
   in proportion inside the height cap. (Sized width: auto, an unloaded image
   was 0px tall, and loading it pushed everything below down: a jump from the
   section bar landed on the right band and was then shoved off it.) */
.th .gd-fig img { width: 100%; height: auto; max-height: 440px; object-fit: contain; }
.th .gd-figs .gd-fig img { max-height: 360px; }
.th .gd-fig--flat img { border-radius: 0; filter: var(--th-art-drop); }
.th .gd-fig figcaption { max-width: 60ch; font-size: 13px; line-height: 1.45; text-align: center; color: var(--th-ink-3); }
.th .gd-fig figcaption strong { color: var(--th-ink-2); }
.th .gd-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.th .gd-figs--wide-narrow { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }

/* item tiles (bites, kits, dough): art over a name and a line */
.th .gd-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.th .gd-tile { display: grid; justify-items: center; gap: 2px; padding: 12px 10px 13px; border-radius: var(--th-radius); background: var(--th-surface-1); border: 1px solid var(--th-line-2); box-shadow: var(--th-shadow-1); text-align: center; }
.th .gd-tile img { width: 76px; height: 76px; object-fit: contain; margin-bottom: 4px; filter: var(--th-art-drop); }
.th .gd-tile-name { font: 700 15px/1.2 "CookieRun KR", "Outfit", sans-serif; color: var(--th-heading); }
.th .gd-tile-sub { font-size: 13px; color: var(--th-ink-3); }
.th .gd-tile-sub b { color: var(--th-gold); }
/* a wide tile: art beside a sentence */
.th .gd-tiles--wide { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.th .gd-tiles--wide .gd-tile { grid-template-columns: 76px minmax(0, 1fr); justify-items: start; align-items: center; column-gap: 14px; padding: 14px 16px; text-align: left; }
.th .gd-tiles--wide .gd-tile img { grid-row: span 2; margin: 0; }
.th .gd-tiles--wide .gd-tile p { font-size: 14px; line-height: 1.5; color: var(--th-ink-2); }
.th .gd-tiles--wide .gd-tile strong { color: var(--th-ink); }

/* numbered steps */
.th .gd-steps { display: grid; gap: 10px; counter-reset: gd-step; max-width: 86ch; }
.th .gd-steps li { position: relative; padding: 12px 16px 12px 52px; border-radius: var(--th-radius); background: var(--th-surface-1); border: 1px solid var(--th-line-2); font-size: 14.5px; line-height: 1.55; color: var(--th-ink-2); counter-increment: gd-step; }
.th .gd-steps li::before { content: counter(gd-step); position: absolute; left: 14px; top: 12px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 800; font-size: 13px; color: var(--th-on-gold); background: var(--th-gold-fill); }
.th .gd-steps strong { color: var(--th-ink); }

/* a note set apart (an exception to a rule above it) */
.th .gd-note { display: flex; gap: 10px; align-items: flex-start; max-width: 86ch; padding: 11px 15px; border-radius: var(--th-radius); border: 1px dashed var(--th-gold-line); background: var(--th-gold-faint); font-size: 14px; line-height: 1.5; color: var(--th-ink-2); }
.th .gd-note strong { color: var(--th-ink); }
.th .gd-note svg { width: 17px; height: 17px; margin-top: 2px; color: var(--th-gold); }

/* a link out to another page, carried by its art (a cookie standing at the
   right, the copy and its button on the left) */
.th .gd-cta { position: relative; display: block; padding: 20px 260px 20px 24px; border-radius: 18px; overflow: hidden; border: 1px solid var(--th-gold-line); background: radial-gradient(420px 220px at 88% 70%, rgba(var(--th-m-rgb), 0.16), rgba(0, 0, 0, 0) 70%), var(--th-surface-1); box-shadow: var(--th-shadow-1); transition: transform 0.15s ease; }
.th .gd-cta:hover { transform: translateY(-2px); }
.th .gd-cta-art { position: absolute; right: 24px; top: 8px; height: 240px; width: auto; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.5)); pointer-events: none; }
.th .gd-cta-tx { position: relative; z-index: 1; display: grid; justify-items: start; gap: 6px; }
.th .gd-cta-tx strong { font: 700 24px/1.1 "CookieRun KR", "Outfit", sans-serif; color: var(--th-heading); }
.th .gd-cta-tx > span:not(.th-kicker):not(.th-btn) { max-width: 56ch; font-size: 14.5px; color: var(--th-ink-2); }
.th .gd-cta-tx .th-btn { margin-top: 8px; }

/* ---------- 4 · reference tables ---------- */
/* A real <table> (column headers are what make it scannable for every
   reader). Wide: aligned columns on a raised panel. Narrow (its own container
   under 716px, where the seven-column topping table stops fitting): each row
   becomes a card, its cells labelled by data-label. */
.th .gd-table-wrap { container: gd-table / inline-size; border-radius: var(--th-radius); background: var(--th-surface-1); border: 1px solid var(--th-line-2); box-shadow: var(--th-shadow-1); }
.th .gd-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.th .gd-table caption { padding: 12px 16px 0; text-align: left; font-size: 13px; color: var(--th-ink-3); caption-side: bottom; padding-bottom: 12px; }
.th .gd-table th, .th .gd-table td { padding: 10px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--th-line); }
.th .gd-table thead th { padding-top: 11px; padding-bottom: 10px; background: var(--th-surface-sunk); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--th-ink-3); white-space: nowrap; }
.th .gd-table tbody th { font-weight: 400; }
.th .gd-table thead th:first-child { border-top-left-radius: calc(var(--th-radius) - 1px); }
.th .gd-table thead th:last-child { border-top-right-radius: calc(var(--th-radius) - 1px); }
.th .gd-table tbody tr:last-child > * { border-bottom: 0; }
.th .gd-table tbody tr:not(.gd-row-more):hover > * { background: var(--th-surface-2); }
.th .gd-table .gd-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.th .gd-table thead .gd-num { text-align: right; }
.th .gd-table td.gd-num { font-weight: 700; color: var(--th-ink); }
.th .gd-table .gd-dim { color: var(--th-ink-3); font-weight: 500; }
.th .gd-table td.gd-best { color: var(--th-gold); }
/* the item cell: art, name, a line under it */
.th .gd-item { display: flex; align-items: center; gap: 12px; min-width: 0; }
.th .gd-item-art { display: flex; align-items: flex-end; flex: none; }
.th .gd-item-art img { width: 44px; height: 44px; object-fit: contain; filter: var(--th-art-drop); }
.th .gd-item-art img.gd-item-ic { width: 34px; height: 34px; filter: none; }
.th .gd-drop { font-weight: 700; color: var(--th-ink); }
.th .gd-item-art img + img { width: 30px; height: 30px; margin-left: -8px; }
.th .gd-item-name { display: block; font: 700 15.5px/1.2 "CookieRun KR", "Outfit", sans-serif; color: var(--th-heading); }
.th .gd-item-name .gd-dim { font: 500 13px/1.2 "Outfit", sans-serif; }
.th .gd-item-sub { display: block; margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--th-ink-3); }
.th .gd-stat { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; color: var(--th-gold); border: 1px solid var(--th-gold-line); background: var(--th-gold-faint); }
.th .gd-icons { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.th .gd-icons img { width: 26px; height: 26px; object-fit: contain; }
.th .gd-map { display: grid; gap: 4px; }
.th .gd-map li { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--th-ink-2); }
.th .gd-map img { width: 22px; height: 22px; flex: none; }
.th .gd-map b { font-family: "CookieRun KR", "Outfit", sans-serif; font-weight: 700; color: var(--th-ink); }
.th .gd-map-arrow { color: var(--th-ink-faint); }
/* the "who runs it" toggle and its row, opened in place under its row */
.th .gd-toggle[aria-expanded="true"] { background: var(--th-sel-bg); color: var(--th-sel-ink); }
.th .gd-toggle[aria-expanded="true"] svg { color: currentColor; transform: rotate(180deg); }
.th .gd-toggle svg { transition: transform 0.15s ease; }
.th .gd-row-more > td { padding: 8px 14px 16px; background: var(--th-surface-2); }
.th .gd-row-more[hidden] { display: none; }
.th tr:has(+ .gd-row-more:not([hidden])) > * { background: var(--th-surface-2); border-bottom-color: transparent; }
.th .gd-tag { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
/* the substat tiers: Chase (the up green), Situational (gold), Niche (muted),
   Break down (the down red, dashed: the one to get rid of) */
.th .gd-tag--chase { color: var(--th-up); background: color-mix(in srgb, var(--th-up) 14%, transparent); }
.th .gd-tag--situational { color: var(--th-gold); background: var(--th-gold-faint); }
.th .gd-tag--niche { color: var(--th-ink-3); background: var(--th-btn-bg); }
.th .gd-tag--breakdown { color: var(--th-down); border: 1px dashed color-mix(in srgb, var(--th-down) 55%, transparent); }
.th .gd-tiers { display: grid; gap: 10px; }
.th .gd-tiers li { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: baseline; gap: 12px; font-size: 14.5px; line-height: 1.55; color: var(--th-ink-2); }
.th .gd-tiers .gd-tag { justify-self: start; }
.th .gd-tiers strong { color: var(--th-ink); }
.th .gd-note--quiet { border-color: var(--th-line-3); background: var(--th-wash); font-size: 13.5px; }
.th .gd-note--quiet svg { color: var(--th-ink-3); }

/* Mid width (a tablet): the full table, tightened rather than turned into
   cards: narrower cells, headers that may wrap, the item's line clamped, and
   the short "60%" form of a share. */
@container gd-table (max-width: 900px) {
  .th .gd-table th, .th .gd-table td { padding: 9px 9px; }
  .th .gd-table thead th { white-space: normal; }
  .th .gd-table .gd-share-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .th .gd-table .gd-item-art img { width: 38px; height: 38px; }
  .th .gd-table .gd-item-art img + img { width: 26px; height: 26px; }
}

/* Narrow: a table of more than four columns becomes one card per row on a
   four-column grid. The row header (the item) takes the first line; a cell
   marked .gd-cell-half takes two columns, the rest one each, so the set
   bonuses read as one line of four. A small table (.gd-table--keep) stays a
   table down to a 420px container, where it takes the card form too. */
@container gd-table (max-width: 716px) {
  .th .gd-table:not(.gd-table--keep) :is(tbody, tr, td, th, caption) { display: block; }
  .th .gd-table:not(.gd-table--keep) { display: block; }
  .th .gd-table:not(.gd-table--keep) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .th .gd-table:not(.gd-table--keep) caption { padding: 12px 14px; border-bottom: 1px solid var(--th-line); }
  .th .gd-table:not(.gd-table--keep) tbody tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 8px; padding: 13px 14px; border-bottom: 1px solid var(--th-line); }
  .th .gd-table:not(.gd-table--keep) tbody tr:last-child { border-bottom: 0; }
  .th .gd-table:not(.gd-table--keep) tbody tr > * { padding: 0; border: 0; text-align: left; }
  .th .gd-table:not(.gd-table--keep) tbody tr > :first-child, .th .gd-table:not(.gd-table--keep) .gd-cell-wide { grid-column: 1 / -1; }
  .th .gd-table:not(.gd-table--keep) tbody tr > * { order: 2; }
  .th .gd-table:not(.gd-table--keep) tbody tr > :first-child { order: 0; }
  .th .gd-table:not(.gd-table--keep) .gd-cell-half { grid-column: span 2; order: 1; }
  .th .gd-table:not(.gd-table--keep) .gd-cell-full { grid-column: 1 / -1; }
  .th .gd-table:not(.gd-table--keep) td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 3px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--th-ink-3); }
  .th .gd-table:not(.gd-table--keep) .gd-num { text-align: left; }
  .th .gd-table:not(.gd-table--keep) tbody tr:not(.gd-row-more):hover > * { background: none; }
  .th .gd-table:not(.gd-table--keep) tr:has(+ .gd-row-more:not([hidden])) { background: var(--th-surface-2); border-bottom-color: transparent; }
  .th .gd-table:not(.gd-table--keep) tr:has(+ .gd-row-more:not([hidden])) > * { background: none; }
  .th .gd-table:not(.gd-table--keep) .gd-row-more { display: block; padding: 4px 14px 14px; background: var(--th-surface-2); }
  .th .gd-table:not(.gd-table--keep) .gd-row-more[hidden] { display: none; }
  .th .gd-table:not(.gd-table--keep) .gd-row-more > td { padding: 0; background: none; }
  .th .gd-table .gd-share-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

@container gd-table (max-width: 420px) {
  .th .gd-table.gd-table--keep :is(tbody, tr, td, th, caption) { display: block; }
  .th .gd-table.gd-table--keep { display: block; }
  .th .gd-table.gd-table--keep thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .th .gd-table.gd-table--keep caption { padding: 12px 14px; border-bottom: 1px solid var(--th-line); }
  .th .gd-table.gd-table--keep tbody tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 8px; padding: 13px 14px; border-bottom: 1px solid var(--th-line); }
  .th .gd-table.gd-table--keep tbody tr:last-child { border-bottom: 0; }
  .th .gd-table.gd-table--keep tbody tr > * { padding: 0; border: 0; text-align: left; }
  .th .gd-table.gd-table--keep tbody tr > :first-child, .th .gd-table.gd-table--keep .gd-cell-wide { grid-column: 1 / -1; }
  .th .gd-table.gd-table--keep tbody tr > * { order: 2; }
  .th .gd-table.gd-table--keep tbody tr > :first-child { order: 0; }
  .th .gd-table.gd-table--keep .gd-cell-half { grid-column: span 2; order: 1; }
  .th .gd-table.gd-table--keep .gd-cell-full { grid-column: 1 / -1; }
  .th .gd-table.gd-table--keep td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 3px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--th-ink-3); }
  .th .gd-table.gd-table--keep .gd-num { text-align: left; }
  .th .gd-table.gd-table--keep tbody tr:not(.gd-row-more):hover > * { background: none; }
  .th .gd-table.gd-table--keep tr:has(+ .gd-row-more:not([hidden])) { background: var(--th-surface-2); border-bottom-color: transparent; }
  .th .gd-table.gd-table--keep tr:has(+ .gd-row-more:not([hidden])) > * { background: none; }
  .th .gd-table.gd-table--keep .gd-row-more { display: block; padding: 4px 14px 14px; background: var(--th-surface-2); }
  .th .gd-table.gd-table--keep .gd-row-more[hidden] { display: none; }
  .th .gd-table.gd-table--keep .gd-row-more > td { padding: 0; background: none; }
  .th .gd-table .gd-share-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- 5 · cookies as links ---------- */
/* A cookie named on these pages is a link to its Cookie-Dex page: its face
   (the system's .th-face) and its name, as a soft pill. */
.th .gd-cookies { display: flex; flex-wrap: wrap; gap: 6px; }
.th .gd-ck { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 3px; border-radius: 999px; background: var(--th-btn-bg); font-size: 13.5px; font-weight: 600; color: var(--th-ink); white-space: nowrap; transition: background-color 0.15s ease; }
.th .gd-ck:hover { background: var(--th-btn-hover); }
.th .gd-ck:focus-visible { outline: 3px solid var(--th-btn-focus); outline-offset: 0; }
.th .gd-ck > .gd-ck-ic { width: 30px; height: 30px; object-fit: contain; filter: var(--th-art-drop); }
.th .gd-ck .th-face { border-radius: 50%; }
.th .gd-ck .th-face > .th-face-img, .th .gd-ck .th-face::after { border-radius: 50%; }
.th .gd-cookies-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 14px; margin: 8px 0 10px; font-size: 13px; color: var(--th-ink-3); }
.th .gd-cookies-head b { color: var(--th-ink); }
.th .gd-cookies-head:first-child { margin-top: 0; }
/* a strip of faces only (a card's preview of who runs it) */
.th .gd-faces { display: flex; align-items: center; }
.th .gd-faces > a { margin-left: -6px; border-radius: 50%; transition: transform 0.15s ease; }
.th .gd-faces > a:first-child { margin-left: 0; }
.th .gd-faces > a:hover { transform: translateY(-2px); z-index: 1; }
.th .gd-faces .th-face { border-radius: 50%; box-shadow: 0 0 0 2px var(--th-surface-1); }
.th .gd-faces .th-face > .th-face-img, .th .gd-faces .th-face::after { border-radius: 50%; }
.th .gd-faces .gd-faces-more { margin-left: 6px; font-size: 13px; font-weight: 700; color: var(--th-ink-3); white-space: nowrap; }

/* cards (the most-used builds): art, a recipe, who runs it */
.th .gd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; align-items: start; }
.th .gd-card { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 6px 16px; padding: 14px 16px 14px 12px; border-radius: 18px; background: linear-gradient(180deg, var(--th-card-1), var(--th-card-2)); border: 1px solid var(--th-line-2); box-shadow: var(--th-shadow-1); }
.th .gd-card-art { grid-row: span 3; width: 92px; height: 92px; object-fit: contain; filter: var(--th-art-drop); }
.th .gd-card h3 { align-self: end; font-size: 17px; line-height: 1.2; }
.th .gd-card-meta { font-size: 13px; color: var(--th-ink-3); }
.th .gd-card-meta b { color: var(--th-ink); }
.th .gd-card-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.th .gd-card-more { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--th-line); }
.th .gd-card-more[hidden] { display: none; }

/* ---------- 5b · search field and the finder ---------- */
/* One search field for the guides (the Resonant lookup's, the Beascuit
   finder's): a soft field with a lens, focus drawn as the system's ring. */
.th .gd-search { position: relative; display: flex; align-items: center; flex: 1 1 260px; min-width: 0; height: 44px; padding: 0 14px 0 40px; border-radius: 999px; background: var(--th-field-bg); border: 1px solid var(--th-line-2); }
.th .gd-search:focus-within { border-color: var(--th-focus-color); box-shadow: var(--th-focus-ring); }
.th .gd-search svg { position: absolute; left: 14px; width: 17px; height: 17px; color: var(--th-ink-3); }
.th .gd-search input { width: 100%; min-width: 0; height: 100%; border: 0; background: none; font-size: 15px; outline: none; }
.th .gd-search input::placeholder { color: var(--th-ink-3); opacity: 1; }
.th .gd-search input:disabled { cursor: progress; }

/* the finder: a field, the matches as cookie chips, then the answer */
.th .gd-finder { display: grid; gap: 10px; max-width: 980px; }
.th .gd-finder .gd-search { max-width: 520px; }
.th .gd-finder-hint { font-size: 13px; color: var(--th-ink-3); }
.th .gd-finder-picks:empty { display: none; }
.th button.gd-ck { border: 0; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }

/* the answer: a framed card, its cookie on top, three short columns under */
.th .gd-answer { margin-top: 6px; padding: 16px; border-radius: 18px; border: 1px solid var(--th-gold-line); background: radial-gradient(640px 200px at 0% 0%, var(--th-gold-faint), rgba(0, 0, 0, 0) 70%), var(--th-surface-1); box-shadow: var(--th-shadow-1); }
.th .gd-answer:focus { outline: none; }
.th .gd-answer:focus-visible { outline: 3px solid var(--th-btn-focus); outline-offset: 2px; }
.th .gd-answer-head { display: flex; align-items: center; gap: 12px; }
.th .gd-answer-head h3 { font-size: 21px; }
.th .gd-answer-head h3 a:hover { color: var(--th-link); }
.th .gd-answer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 3px; font-size: 13.5px; color: var(--th-ink-3); }
.th .gd-answer-meta span { display: inline-flex; align-items: center; gap: 5px; }
.th .gd-answer-meta img { width: 18px; height: 18px; object-fit: contain; }
.th .gd-answer-acts { display: flex; gap: 8px; margin-left: auto; flex: none; }
.th .gd-answer-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.1fr) minmax(0, 1.1fr); gap: 12px; margin-top: 14px; }
.th .gd-answer-card { display: grid; align-content: start; gap: 10px; padding: 12px 14px 14px; border-radius: var(--th-radius); background: var(--th-surface-sunk); border: 1px solid var(--th-line); }
.th .gd-answer-item { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 10px; }
.th .gd-answer-item img { width: 48px; height: 48px; object-fit: contain; filter: var(--th-art-drop); }
.th .gd-answer-item b { display: block; font: 700 15px/1.2 "CookieRun KR", "Outfit", sans-serif; color: var(--th-heading); }
.th .gd-answer-item span { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.4; color: var(--th-ink-3); }
.th .gd-answer-item .gd-answer-tier { display: block; margin: 0 0 2px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--th-gold); }
.th .gd-answer-gems { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.th .gd-answer-gems i { font-style: normal; display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: var(--th-ink-2); background: var(--th-btn-bg); }
.th .gd-answer-none { font-size: 13.5px; line-height: 1.5; color: var(--th-ink-3); }

/* loading and failure states for a script-drawn block */
.th .gd-loading { padding: 18px; font-size: 14px; color: var(--th-ink-3); }

/* ---------- 6 · responsive ---------- */
@container th (max-width: 1180px) {
  .th .gd-head-in { grid-template-columns: minmax(0, 1fr); }
  .th .gd-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 8px; }
  .th .gd-panel .th-label { grid-column: 1 / -1; }
}
@container th (max-width: 900px) {
  .th .gd-answer-grid { grid-template-columns: minmax(0, 1fr); }
  .th .gd-split, .th .gd-split--fig-left { grid-template-columns: minmax(0, 1fr); }
  .th .gd-figs, .th .gd-figs--wide-narrow { grid-template-columns: minmax(0, 1fr); }
}
@container th (max-width: 700px) {
  .th .gd-head { margin-top: 14px; border-radius: 20px; }
  .th .gd-head-clip { border-radius: 19px; }
  .th .gd-head-veil { background: linear-gradient(180deg, rgba(var(--th-ground-rgb), 0.55) 0%, var(--th-veil) 25%, var(--th-veil-strong) 50%, var(--th-veil-strong) 100%); }
  .th .gd-head .th-orn--tl, .th .gd-head .th-orn--bl { left: 26px; }
  .th .gd-head .th-orn--tr, .th .gd-head .th-orn--br { right: 26px; }
  .th .gd-head-in { padding: 18px 12px 12px; gap: 12px; }
  .th .gd-head-copy { display: block; min-height: 0; padding: 0 4px 2px; }
  .th .gd-head-copy::after { content: ""; display: block; clear: both; }
  .th .gd-head-emblem { position: static; float: right; height: 124px; max-width: 120px; margin: -6px -6px 0 4px; shape-outside: inset(0 0 0 14px); }
  .th .gd-head-copy .th-kicker { display: flex; font-size: 11.5px; letter-spacing: 0.12em; }
  .th .gd-title { font-size: 34px; }
  .th .gd-lede { font-size: 15px; line-height: 1.5; }
  .th .gd-head-cta { clear: both; }
  .th .gd-panel { padding: 12px; }
  .th .gd-guide { grid-template-columns: 36px minmax(0, 1fr) auto; min-height: 48px; padding: 6px 12px 6px 6px; }
  .th .gd-guide img { width: 36px; height: 36px; }
  .th .gd-guide-sub { display: none; }
  .th .gd-jump { padding: 5px 5px 5px 12px; gap: 6px; }
  .th .gd-jump-label { display: none; }
  .th .gd-jump-list a { height: 34px; padding: 0 12px; font-size: 14px; }
  .th .gd-prose { font-size: 15.5px; }
  .th .gd-sub { font-size: 19px; }
  .th .gd-card { grid-template-columns: 72px minmax(0, 1fr); padding: 12px 12px 12px 10px; }
  .th .gd-card-art { width: 72px; height: 72px; }
  .th .gd-cards { grid-template-columns: minmax(0, 1fr); }
  .th .gd-cta { padding: 16px 120px 16px 16px; }
  .th .gd-cta-art { right: -24px; top: 18px; height: 150px; }
  .th .gd-fig { padding: 8px; }
  .th .gd-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .th .gd-tiles--wide { grid-template-columns: minmax(0, 1fr); }
  .th .gd-ck { height: 40px; }
  .th .gd-answer { padding: 12px; }
  .th .gd-tiers li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .th .gd-answer-head { flex-wrap: wrap; }
  .th .gd-answer-acts { order: 3; flex-basis: 100%; }
  .th .gd-answer-acts .th-btn--gold { flex: 1; height: 40px; }
}
/* the site header is shorter on a phone; the bar follows it */
@media (max-width: 700px) {
  .th .gd-jump { top: var(--th-sticky-top); }
  .th .gd-bands > .th-band { scroll-margin-top: 124px; }
}

@media (prefers-reduced-motion: reduce) {
  .th .gd-cta:hover, .th .gd-faces > a:hover { transform: none; }
  .th .gd-jump-list { scroll-behavior: auto; }
}

/* ============================================================================
   L · LIGHT THEME (literals only; the tokens re-point themselves)
   ========================================================================== */
:root[data-theme="light"] .th .gd-head { box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.6), inset 0 0 0 5px var(--th-gold-faint), var(--th-shadow-2); }
:root[data-theme="light"] .th .gd-head-art { filter: blur(14px) saturate(1.15) brightness(1.08); }
:root[data-theme="light"] .th .gd-head-veil { background:
    radial-gradient(640px 300px at 0% 0%, rgba(var(--th-m-rgb), 0.1), rgba(var(--th-m-rgb), 0) 72%),
    linear-gradient(90deg, var(--th-veil-strong) 0%, var(--th-veil-strong) 36%, rgba(250, 247, 254, 0.55) 62%, var(--th-veil-strong) 100%); }
:root[data-theme="light"] .th .gd-head-emblem { filter: drop-shadow(0 14px 18px rgba(60, 30, 110, 0.3)); }
:root[data-theme="light"] .th .gd-title { text-shadow: 0 2px 0 rgba(255, 255, 255, 0.9); }
:root[data-theme="light"] .th .gd-panel { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.9), inset 0 0 0 4px var(--th-gold-faint), 0 3px 0 var(--th-ledge), 0 16px 28px -18px rgba(76, 40, 150, 0.4); }
:root[data-theme="light"] .th .gd-cta-art { filter: drop-shadow(0 10px 14px rgba(60, 30, 110, 0.28)); }
:root[data-theme="light"] .th .gd-fig { background: var(--th-surface-3); border-color: var(--th-line-2); }
@container th (max-width: 700px) {
  :root[data-theme="light"] .th .gd-head-veil { background: linear-gradient(180deg, rgba(250, 247, 254, 0.6) 0%, var(--th-veil) 20%, var(--th-veil-strong) 42%, var(--th-veil-strong) 100%); }
}
