/* Shared document views for Community Guides and embeds. The host supplies a
   .th ancestor and design-system.css. Geometry is local; token values stay in
   the shared system. New documents never inherit legacy canvas transforms. */
.th .gd-document { box-sizing: border-box; width: 100%; min-width: 0; color: var(--th-ink); overflow-wrap: anywhere; }
.th .gd-document *, .th .gd-fields *, .th .gd-block-fields * { box-sizing: border-box; }
.th .gd-graphic { container: gd-graphic / inline-size; --gd-accent: var(--th-gold); }
.th .gd-accent-violet { --gd-accent: var(--th-rc-ink, var(--th-rc)); }
.th .gd-accent-forest { --gd-accent: var(--th-up); }
.th .gd-board { position: relative; isolation: isolate; display: flex; flex-direction: column; gap: 3.6cqw; width: 100%; min-width: 0; min-height: 125cqw; margin: 0; padding: 6cqw 6cqw 4cqw; border: 1px solid color-mix(in srgb, var(--gd-accent) 45%, var(--th-line-2)); border-radius: 10px; background: radial-gradient(ellipse at 10% 45%, color-mix(in srgb, var(--gd-accent) 12%, transparent), transparent 57%), var(--th-surface-1); box-shadow: var(--th-shadow-1); }
.th .gd-board-frame { position: absolute; z-index: -1; pointer-events: none; inset: 1.6cqw; border: 1px solid color-mix(in srgb, var(--gd-accent) 16%, transparent); border-radius: 6px; }
.th .gd-layout-square .gd-board { min-height: 100cqw; }
.th .gd-layout-wide .gd-board { min-height: 56.25cqw; padding: 3.5cqw 4.5cqw 3cqw; gap: 2cqw; }
.th .gd-graphic-heading { min-width: 0; position: relative; z-index: 1; }
.th .gd-eyebrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 3cqw; color: var(--gd-accent); font-size: clamp(10px, 2.1cqw, 17px); font-weight: 700; line-height: 1.4; letter-spacing: .1em; text-transform: uppercase; }
.th .gd-eyebrow > span { font-size: .8em; flex: none; }
.th .gd-graphic-title { margin: 0; color: var(--th-heading); font-family: 'CookieRun KR', sans-serif; font-size: clamp(25px, 7.1cqw, 76px); font-weight: 700; line-height: 1.15; letter-spacing: -.025em; text-wrap: balance; }
.th .gd-graphic-title.gd-title-long { font-size: clamp(23px, 5.8cqw, 62px); }
.th .gd-graphic-subtitle { max-width: 90%; margin: 2cqw 0 0; color: var(--th-ink-3); font-size: clamp(13px, 2.8cqw, 24px); line-height: 1.5; white-space: pre-line; }
.th .gd-cookie-body { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 2cqw; min-height: 48cqw; flex: 1; }
.th .gd-art-stage { display: grid; place-items: center; position: relative; min-width: 0; height: 53cqw; margin-left: -4cqw; }
.th .gd-cookie-art { display: block; width: 100%; height: 100%; object-fit: contain; filter: var(--th-art-drop); }
.th .gd-art-stage > .gd-cookie-art { position: absolute; inset: 0; z-index: 1; min-width: 0; min-height: 0; }
.th .gd-art-orbit { position: absolute; width: 35cqw; height: 35cqw; border: 1px solid color-mix(in srgb, var(--gd-accent) 23%, transparent); border-radius: 50%; box-shadow: 0 0 0 3cqw color-mix(in srgb, var(--gd-accent) 3%, transparent), 0 0 0 7cqw color-mix(in srgb, var(--gd-accent) 2%, transparent); }
.th .gd-cookie-empty { display: grid; justify-items: center; gap: 10px; padding: 20px 8px; color: var(--th-ink-3); text-align: center; font-size: clamp(12px, 2.4cqw, 20px); }
.th .gd-cookie-empty svg { width: 38px; height: 38px; }
.th .gd-build-info { min-width: 0; padding: 1cqw 0; }
.th .gd-label { display: block; margin: 0; color: var(--gd-accent, var(--th-gold)); font-size: clamp(10px, 2cqw, 16px); line-height: 1.5; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.th .gd-cookie-identity h3 { margin: 1.4cqw 0 0; color: var(--th-heading); font-family: 'CookieRun KR', sans-serif; font-size: clamp(18px, 4.5cqw, 43px); line-height: 1.2; text-wrap: balance; }
.th .gd-cookie-traits { display: flex; flex-wrap: wrap; align-items: center; gap: 1cqw 1.6cqw; padding: 0; list-style: none; }
.th .gd-cookie-trait { display: inline-flex; flex: none; align-items: center; gap: .7cqw; min-width: 0; white-space: nowrap; }
.th .gd-cookie-trait > img { flex: none; width: clamp(16px, 3cqw, 30px); height: clamp(16px, 3cqw, 30px); object-fit: contain; }
.th .gd-cookie-trait[data-cookie-trait="position"] > img { width: clamp(22px, 4.2cqw, 42px); }
.th .gd-equipment { margin-top: 3.8cqw; padding-top: 3cqw; border-top: 1px solid var(--th-line-2); }
.th .gd-equipment > .gd-label { color: var(--th-ink-3); }
.th .gd-recipe { display: flex; gap: 1.4cqw; align-items: center; margin-top: 1.5cqw; }
.th .gd-recipe > img { width: 10cqw; height: 10cqw; flex: none; object-fit: contain; filter: var(--th-art-drop); }
.th .gd-recipe > span { min-width: 0; }
.th .gd-recipe strong { display: block; color: var(--th-heading); font-family: 'CookieRun KR', sans-serif; font-size: clamp(22px, 5cqw, 47px); line-height: 1; }
.th .gd-recipe b { display: block; margin-top: .8cqw; color: var(--th-ink-2); font-size: clamp(12px, 2.3cqw, 21px); font-weight: 500; line-height: 1.4; }
.th .gd-graphic-notes { padding: 3.2cqw 3.8cqw; border: 1px solid var(--th-line-2); border-left: 3px solid var(--gd-accent); border-radius: 0 8px 8px 0; background: var(--th-wash); }
.th .gd-graphic-copy { margin-top: 1.5cqw; color: var(--th-ink-2); font-size: clamp(14px, 2.7cqw, 24px); line-height: 1.65; }
.th .gd-graphic-copy p { margin: 0 0 1em; }
.th .gd-graphic-copy p:last-child { margin-bottom: 0; }
.th .gd-graphic-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding-top: 2.7cqw; margin-top: auto; border-top: 1px solid var(--th-line-2); color: var(--th-ink-3); font-size: clamp(10px, 1.8cqw, 16px); line-height: 1.5; }
.th .gd-graphic-footer strong { color: var(--gd-accent); font-size: inherit; letter-spacing: .1em; font-weight: 700; }
.th .gd-layout-square .gd-board { gap: 2.5cqw; padding: 5cqw 5cqw 3.5cqw; }
.th .gd-layout-square .gd-eyebrow { margin-bottom: 2cqw; }
.th .gd-layout-square .gd-graphic-title { font-size: clamp(25px, 6.2cqw, 66px); }
.th .gd-layout-square .gd-graphic-title.gd-title-long { font-size: clamp(23px, 5.4cqw, 58px); }
.th .gd-layout-square .gd-graphic-subtitle { margin-top: 1.5cqw; font-size: clamp(13px, 2.5cqw, 22px); }
.th .gd-layout-square .gd-cookie-body { min-height: 34cqw; }
.th .gd-layout-square .gd-art-stage { height: 37.5cqw; }
.th .gd-layout-square .gd-art-orbit { width: 29cqw; height: 29cqw; }
.th .gd-layout-square .gd-graphic-notes { padding: 2.3cqw 3cqw; }
.th .gd-layout-square .gd-graphic-copy { margin-top: 1cqw; font-size: clamp(14px, 2.3cqw, 22px); }
.th .gd-layout-square .gd-graphic-footer { padding-top: 2cqw; }
.th .gd-layout-wide .gd-board { padding: 3cqw 4.5cqw 2.4cqw; gap: 1.5cqw; }
.th .gd-layout-wide .gd-eyebrow { margin-bottom: 1cqw; font-size: clamp(10px, 1.4cqw, 16px); }
.th .gd-layout-wide .gd-graphic-title { font-size: clamp(24px, 4.1cqw, 52px); }
.th .gd-layout-wide .gd-graphic-title.gd-title-long { font-size: clamp(22px, 3.8cqw, 48px); }
.th .gd-layout-wide .gd-graphic-subtitle { margin-top: 1cqw; font-size: clamp(13px, 1.8cqw, 22px); }
.th .gd-layout-wide .gd-cookie-body { grid-template-columns: 1fr 1.5fr; min-height: 21cqw; gap: 3cqw; }
.th .gd-layout-wide .gd-art-stage { height: 23cqw; margin: 0; }
.th .gd-layout-wide .gd-art-orbit { width: 18cqw; height: 18cqw; }
.th .gd-layout-wide .gd-build-info { display: grid; grid-template-columns: 1fr 1fr; gap: 2cqw; align-items: center; }
.th .gd-layout-wide .gd-cookie-identity h3 { font-size: clamp(18px, 2.7cqw, 34px); }
.th .gd-layout-wide .gd-equipment { margin: 0; padding: 0 0 0 2cqw; border-top: 0; border-left: 1px solid var(--th-line-2); }
.th .gd-layout-wide .gd-recipe > img { width: 6cqw; height: 6cqw; }
.th .gd-layout-wide .gd-recipe strong { font-size: clamp(22px, 3.5cqw, 40px); }
.th .gd-layout-wide .gd-recipe b { font-size: clamp(12px, 1.6cqw, 19px); }
.th .gd-layout-wide .gd-graphic-notes { padding: 1.4cqw 2.2cqw; }
.th .gd-layout-wide .gd-graphic-notes > .gd-label { font-size: clamp(10px, 1.5cqw, 15px); }
.th .gd-layout-wide .gd-graphic-copy { margin-top: .7cqw; font-size: clamp(14px, 1.6cqw, 19px); line-height: 1.55; }
.th .gd-layout-wide .gd-graphic-footer { padding-top: 1.8cqw; font-size: clamp(10px, 1.2cqw, 14px); }

/* Compact is deliberately a thumbnail composition, never a clipped full page. */
.th .gd-compact { height: 100%; min-height: 0; max-height: 100%; }
.th .gd-compact .gd-board { display: grid; grid-template-columns: 42% minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); align-items: center; width: 100%; min-height: 0; height: 100%; max-height: 100%; aspect-ratio: 1.7; padding: 3.8cqw; gap: 2cqw; overflow: hidden; box-shadow: none; }
.th .gd-compact .gd-graphic-heading { grid-column: 2; grid-row: 1; }
.th .gd-compact .gd-cookie-body { display: contents; }
.th .gd-compact .gd-art-stage { grid-column: 1; grid-row: 1 / 3; align-self: stretch; min-height: 0; height: 100%; margin: 0 -1.5cqw 0 -3.5cqw; }
.th .gd-compact .gd-art-orbit { width: 29cqw; height: 29cqw; }
.th .gd-compact .gd-build-info { display: block; grid-column: 2; grid-row: 2; padding: 0; align-self: end; }
.th .gd-compact .gd-cookie-identity, .th .gd-compact .gd-graphic-notes, .th .gd-compact .gd-graphic-footer { display: none; }
.th .gd-compact .gd-eyebrow { margin-bottom: 1.7cqw; font-size: 1.75cqw; letter-spacing: .1em; }
.th .gd-compact .gd-graphic-title, .th .gd-compact .gd-graphic-title.gd-title-long { font-size: 4.9cqw; line-height: 1.15; }
.th .gd-compact .gd-graphic-subtitle { max-width: 100%; margin-top: 1.5cqw; font-size: 2.35cqw; line-height: 1.4; }
.th .gd-compact .gd-equipment { margin: 0; padding: 2.2cqw 0 0; border-left: 0; border-top: 1px solid var(--th-line-2); }
.th .gd-compact .gd-equipment > .gd-label { font-size: 1.75cqw; }
.th .gd-compact .gd-recipe { margin-top: 1.2cqw; gap: 1.5cqw; }
.th .gd-compact .gd-recipe > img { width: 8.5cqw; height: 8.5cqw; }
.th .gd-compact .gd-recipe strong { font-size: 4.2cqw; }
.th .gd-compact .gd-recipe b { font-size: 2.15cqw; margin-top: .5cqw; }

/* Page guides are semantic flowing content. Text never depends on a frame. */
.th .gd-page { container: gd-page / inline-size; max-width: 820px; margin: 0 auto; padding: clamp(18px, 4%, 42px); border: 1px solid var(--th-line-2); border-radius: var(--th-radius); background: var(--th-surface-1); box-shadow: var(--th-shadow-1); }
.th .gd-page-heading { margin-bottom: 28px; padding-bottom: 25px; border-bottom: 1px solid var(--th-gold-line); }
.th .gd-page-heading > .gd-label { font-size: 11px; }
.th .gd-page-heading h2 { max-width: 24ch; margin: 9px 0 0; color: var(--th-heading); font-family: 'CookieRun KR', sans-serif; font-size: 34px; line-height: 1.22; text-wrap: balance; }
.th .gd-page-subtitle { margin: 14px 0 0; color: var(--th-ink-2); font-size: 17px; line-height: 1.65; white-space: pre-line; }
.th .gd-page-flow { display: grid; gap: 30px; }
.th .gd-block { min-width: 0; scroll-margin-top: var(--th-sticky-top, 100px); }
.th .gd-block-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 13px; }
.th .gd-block-heading h3, .th .gd-empty h3 { margin: 0; color: var(--th-heading); font-family: 'CookieRun KR', sans-serif; font-size: 23px; line-height: 1.35; }
.th .gd-prose { color: var(--th-ink-2); font-size: 16px; line-height: 1.8; }
.th .gd-prose p { margin: 0 0 1em; }
.th .gd-prose p:last-child { margin-bottom: 0; }
.th .gd-step-number { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border: 1px solid var(--th-gold-line); border-radius: 50%; background: var(--th-gold-faint); color: var(--th-gold); font-size: 14px; font-weight: 700; }
.th .gd-block-step > .gd-prose { padding-left: 44px; }
.th .gd-block-build { padding: 20px; border: 1px solid var(--th-line-2); border-radius: 14px; background: var(--th-wash); }
.th .gd-inline-cookie { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.th .gd-inline-cookie > div { flex: 0 0 80px; width: 80px; height: 80px; }
.th .gd-inline-cookie > span { min-width: 0; }
.th .gd-inline-cookie small { display: block; margin-bottom: 5px; color: var(--th-ink-3); font-size: 12px; line-height: 1.5; }
.th .gd-inline-cookie strong { display: block; color: var(--th-heading); font-family: 'CookieRun KR', sans-serif; font-size: 20px; line-height: 1.3; }
.th .gd-image-stage { position: relative; aspect-ratio: 4 / 3; max-height: 430px; display: grid; place-items: center; min-height: 180px; margin-bottom: 14px; padding: 20px; border: 1px solid var(--th-line-2); border-radius: var(--th-radius); background: radial-gradient(ellipse at 50% 75%, var(--th-gold-faint), transparent 65%), var(--th-surface-sunk); }
.th .gd-image-stage > img { position: absolute; inset: 14px; display: block; width: calc(100% - 28px); height: calc(100% - 28px); object-fit: contain; }
.th .gd-block-image > .gd-prose { font-size: 14px; line-height: 1.7; }
.th .gd-placeholder, .th .gd-empty p { margin: 0; color: var(--th-ink-3); font-size: 14px; line-height: 1.6; }
.th .gd-empty { padding: 24px 0; }
.th .gd-empty p { margin-top: 10px; }
.th .gd-page-thumbnail { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 180px; height: 100%; padding: 20px; border: 1px solid var(--th-gold-line); border-radius: 10px; background: var(--th-surface-1); overflow: hidden; }
.th .gd-page-thumbnail > .gd-label { font-size: 10px; }
.th .gd-page-thumbnail h2 { position: relative; z-index: 1; max-width: 76%; margin: 0; color: var(--th-heading); font-family: 'CookieRun KR', sans-serif; font-size: 23px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.th .gd-page-thumbnail > p:not(.gd-label) { position: relative; z-index: 1; max-width: 70%; margin: 0; color: var(--th-ink-3); font-size: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.th .gd-page-thumbnail > .gd-cookie-art { position: absolute; right: -16px; bottom: -8px; width: 45%; height: 145px; opacity: .75; }
.th .gd-thumbnail-count { margin-top: auto; color: var(--th-ink-3); font-size: 11px; }

/* Delegated editor fields. No global input/button rules. */
.th .gd-fields, .th .gd-block-fields { display: grid; gap: 18px; min-width: 0; }
.th .gd-field { display: grid; gap: 8px; min-width: 0; margin: 0; }
.th .gd-field > span { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: var(--th-ink-2); font-size: 13px; line-height: 1.5; font-weight: 600; }
.th .gd-field small { color: var(--th-ink-3); font-size: 11px; font-weight: 400; }
.th .gd-field input, .th .gd-field textarea, .th .gd-field select { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 11px 13px; border: 1px solid var(--th-line-2); border-radius: 12px; background: var(--th-field-bg); color: var(--th-ink); font: inherit; font-size: 14px; line-height: 1.5; }
.th .gd-field textarea { resize: vertical; min-height: 108px; }
.th .gd-field select { cursor: pointer; }
.th .gd-field select option { background: var(--th-surface-1); color: var(--th-ink); }
.th .gd-field input::placeholder, .th .gd-field textarea::placeholder { color: var(--th-ink-3); opacity: 1; }
.th :is(.gd-fields, .gd-block-fields, .gd-block-actions, .gd-add-inline) :is(input, textarea, select, button, summary):focus-visible { outline: 2px solid var(--th-focus-color); outline-offset: 3px; }
.th .gd-check { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--th-ink-2); font-size: 13px; cursor: pointer; }
.th .gd-check input { width: 18px; height: 18px; accent-color: var(--th-focus-color); }
.th .gd-look-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 16px; border-top: 1px solid var(--th-line-2); }
.th :is(.gd-cookie-picker, .gd-library-picker) { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 76px; padding: 10px 12px; border: 1px solid var(--th-line-2); border-radius: 12px; background: var(--th-wash); color: var(--th-ink-2); font: inherit; text-align: left; cursor: pointer; }
.th :is(.gd-cookie-picker, .gd-library-picker):hover { background: var(--th-btn-hover); border-color: var(--th-line-3); }
.th .gd-picker-art { display: grid; place-items: center; height: 54px; width: 54px; }
.th .gd-picker-art > svg { width: 26px; height: 26px; }
.th :is(.gd-cookie-picker, .gd-library-picker) strong { display: block; color: var(--th-heading); font-size: 13px; font-weight: 600; line-height: 1.4; }
.th :is(.gd-cookie-picker, .gd-library-picker) small { display: block; margin-top: 4px; color: var(--th-ink-3); font-size: 11px; }
.th :is(.gd-cookie-picker, .gd-library-picker) > b { color: var(--th-link); font-size: 11px; font-weight: 600; }
.th .gd-add-section { padding-top: 18px; border-top: 1px solid var(--th-line-2); }
.th .gd-fields-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.th .gd-fields-heading h3 { margin: 0; color: var(--th-heading); font-size: 17px; }
.th .gd-fields-heading > span { color: var(--th-ink-3); font-size: 11px; }
.th .gd-block-choices { display: grid; gap: 8px; }
.th .gd-block-choices button { display: grid; grid-template-columns: 22px minmax(0, 1fr) 18px; align-items: center; gap: 12px; min-height: 64px; padding: 12px; border: 1px solid var(--th-line-2); border-radius: 12px; background: var(--th-wash); color: var(--th-ink-2); font: inherit; text-align: left; cursor: pointer; }
.th .gd-block-choices button:hover { background: var(--th-btn-hover); }
.th .gd-block-choices strong { display: block; color: var(--th-heading); font-size: 13px; font-weight: 600; }
.th .gd-block-choices small { display: block; color: var(--th-ink-3); margin-top: 4px; font-size: 11px; }
.th .gd-block-choices svg { width: 20px; height: 20px; }
.th .gd-block-editing { padding: 14px; border: 1px solid var(--th-line-2); border-radius: var(--th-radius); background: var(--th-surface-1); }
.th .gd-block-editing:focus-within { border-color: var(--th-focus-color); }
.th .gd-block-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--th-line-2); }
.th .gd-block-bar > span { display: flex; align-items: center; gap: 7px; color: var(--th-ink-3); font-size: 12px; font-weight: 600; }
.th .gd-block-bar > span svg { width: 16px; height: 16px; }
.th .gd-block-actions { display: flex; gap: 4px; }
.th .gd-block-actions button { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--th-btn-bg); color: var(--th-ink-2); cursor: pointer; }
.th .gd-block-actions svg { width: 17px; height: 17px; }
.th .gd-block-actions button:hover:not(:disabled) { background: var(--th-btn-hover); }
.th .gd-block-actions button:disabled { opacity: .35; cursor: default; }
.th .gd-add-inline { margin-top: 22px; }
.th .gd-add-inline > summary { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; padding: 12px 18px; border: 1px dashed var(--th-line-3); border-radius: 999px; background: var(--th-wash); color: var(--th-link); font: inherit; font-size: 14px; font-weight: 600; list-style: none; cursor: pointer; }
.th .gd-add-inline > summary::-webkit-details-marker { display: none; }
.th .gd-add-inline > summary:hover { background: var(--th-btn-hover); }
.th .gd-add-inline > summary svg { width: 18px; height: 18px; }
.th .gd-add-inline > .gd-add-section { padding-top: 12px; border-top: 0; }

@container gd-graphic (max-width: 480px) {
  .th .gd-layout-wide:not(.gd-compact) .gd-build-info { grid-template-columns: 1fr; gap: 12px; }
  .th .gd-layout-wide:not(.gd-compact) .gd-equipment { padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--th-line-2); }
  .th .gd-layout-wide:not(.gd-compact) .gd-art-stage { height: 42cqw; }
  .th .gd-layout-wide:not(.gd-compact) .gd-recipe > img { width: 10cqw; height: 10cqw; }
}
@container gd-page (max-width: 480px) {
  .th .gd-page-heading h2 { font-size: 28px; }
  .th .gd-page-subtitle { font-size: 16px; }
  .th .gd-block-heading h3 { font-size: 21px; }
  .th .gd-block-step > .gd-prose { padding-left: 0; }
  .th .gd-block-build { padding: 15px; }
  .th .gd-block-editing { padding: 12px; }
  .th .gd-block-bar { flex-wrap: wrap; }
  .th .gd-block-actions { margin-left: auto; }
  .th .gd-image-stage { padding: 14px; min-height: 140px; }
  .th .gd-inline-cookie > div { flex-basis: 66px; width: 66px; height: 66px; }
}
@container th (max-width: 700px) {
  .th .gd-field input, .th .gd-field textarea, .th .gd-field select { font-size: 16px; }
}

/* Complete cookie equipment shares one composition across preview, reader,
   export and page-guide build sections. Empty choices never invent a build. */
.th .gd-has-build:not(.gd-compact) .gd-cookie-body { min-height: 30cqw; flex: none; }
.th .gd-has-build:not(.gd-compact) .gd-art-stage { height: 35cqw; }
.th .gd-has-build:not(.gd-compact) .gd-art-orbit { width: 25cqw; height: 25cqw; }
.th .gd-layout-wide:not(.gd-compact) .gd-build-info { display: block; }
.th .gd-layout-wide.gd-has-build:not(.gd-compact) .gd-cookie-body { min-height: 19cqw; }
.th .gd-layout-wide.gd-has-build:not(.gd-compact) .gd-art-stage { height: 22cqw; }
.th .gd-layout-wide.gd-has-build:not(.gd-compact) .gd-art-orbit { width: 17cqw; height: 17cqw; }
.th .gd-build-equipment { --gd-eq-font: 13px; --gd-eq-art: 46px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; min-width: 0; }
.th .gd-graphic .gd-build-equipment { --gd-eq-font: clamp(11px, 1.9cqw, 21px); --gd-eq-art: clamp(28px, 6.5cqw, 80px); gap: 2cqw; }
.th .gd-build-equipment > section { min-width: 0; padding: 16px; border: 1px solid var(--th-line-2); border-radius: 12px; background: var(--th-wash); }
.th .gd-graphic .gd-build-equipment > section { padding: 2.4cqw; }
.th .gd-build-equipment > section:only-child, .th .gd-build-equipment > .gd-stat-goals { grid-column: 1 / -1; }
.th .gd-build-equipment .gd-label { font-size: var(--gd-eq-font); }
.th .gd-topping-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.th .gd-topping-cell { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 5px; min-width: 0; padding: 8px 3px; border: 1px solid var(--th-line); border-radius: 8px; background: var(--th-surface-1); text-align: center; }
.th .gd-topping-cell small { display: block; align-self: stretch; color: var(--th-ink-3); font-size: calc(var(--gd-eq-font) * .8); line-height: 1.4; }
.th .gd-topping-cell > img { width: var(--gd-eq-art); height: var(--gd-eq-art); object-fit: contain; }
.th .gd-topping-cell > span { display: block; align-self: stretch; max-width: 100%; color: var(--th-ink-2); font-size: calc(var(--gd-eq-font) * .83); line-height: 1.35; }
.th .gd-tart-cell { border-color: var(--th-gold-line); background: var(--th-gold-faint); }
.th .gd-topping-cell > .gd-equipment-empty { display: grid; place-items: center; flex: 1; min-height: var(--gd-eq-art); color: var(--th-ink-3); }
.th .gd-topping-summary { margin: 10px 0 0; color: var(--th-ink-3); font-size: calc(var(--gd-eq-font) * .85); line-height: 1.5; }
.th .gd-beascuit-identity { display: flex; align-items: center; gap: 12px; margin: 12px 0; min-width: 0; }
.th .gd-beascuit-identity > img { width: calc(var(--gd-eq-art) * 1.25); height: calc(var(--gd-eq-art) * 1.25); object-fit: contain; flex: none; }
.th .gd-beascuit-identity > strong { flex: 1; min-width: 0; font-size: var(--gd-eq-font); color: var(--th-heading); line-height: 1.4; }
.th .gd-beascuit-effects { display: grid; gap: 7px; }
.th .gd-beascuit-effects > li { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 8px 10px; border-radius: 7px; background: var(--th-surface-1); color: var(--th-ink-2); font-size: var(--gd-eq-font); line-height: 1.4; }
.th .gd-beascuit-effects small { color: var(--th-ink-3); font-size: .8em; flex: none; }
.th .gd-beascuit-effects > li > span { flex: 1; min-width: 0; }
.th .gd-beascuit-panel-graphic { display: flex; flex-direction: column; }
.th .gd-beascuit-panel-graphic .gd-beascuit-identity { flex: 1; justify-content: center; margin: 2cqw 0; }
.th .gd-beascuit-panel-graphic .gd-beascuit-identity > img { width: min(100%, 22cqw); height: 22cqw; }
.th .gd-beascuit-panel-graphic .gd-beascuit-effects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.th .gd-layout-wide .gd-beascuit-panel-graphic .gd-beascuit-identity > img { width: min(100%, 18cqw); height: 18cqw; }
@container gd-graphic (max-width: 480px) {
  .th .gd-graphic .gd-beascuit-panel-graphic .gd-beascuit-identity > img { width: min(100%, 44cqw); height: 44cqw; }
}
.th .gd-equipment-unavailable { margin: 10px 0; color: var(--th-ink-3); font-size: var(--gd-eq-font); line-height: 1.5; }
.th .gd-stat-goals > ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.th .gd-stat-goals li { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 10px; border-radius: 8px; background: var(--th-surface-1); font-size: var(--gd-eq-font); line-height: 1.4; }
.th .gd-stat-goals li > strong { color: var(--th-ink-2); font-size: .9em; font-weight: 500; }
.th .gd-stat-goals li > span { color: var(--gd-accent, var(--th-gold)); font-weight: 700; font-size: 1.3em; }
.th .gd-block-build > .gd-build-equipment { margin-bottom: 18px; }
.th .gd-equipment-mini { display: flex; flex-wrap: wrap; align-items: center; gap: 1cqw; padding-top: 2cqw; }
.th .gd-equipment-mini > img { flex: none; width: 5.5cqw; height: 5.5cqw; object-fit: contain; }

/* Six touch targets keep individual toppings and the tart visible. Pickers
   contain the full illustrated catalog; the editor itself stays compact. */
.th .gd-build-fields { display: grid; gap: 22px; min-width: 0; padding-top: 18px; border-top: 1px solid var(--th-line-2); }
.th .gd-equipment-fields { display: grid; gap: 12px; min-width: 0; }
.th .gd-equipment-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.th .gd-equipment-heading h3 { margin: 0; color: var(--th-heading); font: 600 15px/1.4 'Outfit', sans-serif; }
.th .gd-fill-toppings { min-height: 44px; padding: 8px 10px; border: 1px solid var(--th-line-2); border-radius: 9px; background: var(--th-btn-bg); color: var(--th-link); font: inherit; font-size: 12px; cursor: pointer; }
.th .gd-fill-toppings:hover { background: var(--th-btn-hover); }
.th .gd-equipment-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.th .gd-equipment-slot { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; min-height: 112px; padding: 10px 5px; border: 1px solid var(--th-line-2); border-radius: 12px; background: var(--th-wash); color: var(--th-ink-2); font: inherit; text-align: center; cursor: pointer; }
.th .gd-equipment-slot:hover { background: var(--th-btn-hover); border-color: var(--th-line-3); }
.th .gd-equipment-slot > small { color: var(--th-ink-3); font-size: 10px; line-height: 1.4; }
.th .gd-equipment-slot > strong { font-size: 11px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.th .gd-slot-art { display: grid; place-items: center; width: 40px; height: 40px; }
.th .gd-slot-art > img { width: 100%; height: 100%; object-fit: contain; }
.th .gd-slot-art > svg { width: 22px; height: 22px; }
.th .gd-equipment-slot-tart { border-color: var(--th-gold-line); background: var(--th-gold-faint); }
.th .gd-beascuit-picker { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 76px; padding: 10px 12px; border: 1px solid var(--th-line-2); border-radius: 12px; background: var(--th-wash); color: var(--th-ink-2); font: inherit; text-align: left; cursor: pointer; }
.th .gd-beascuit-picker:hover:not(:disabled) { background: var(--th-btn-hover); border-color: var(--th-line-3); }
.th .gd-beascuit-picker:disabled { opacity: .65; cursor: default; }
.th .gd-beascuit-picker .gd-picker-art > img { width: 100%; height: 100%; object-fit: contain; }
.th .gd-beascuit-picker strong { display: block; color: var(--th-heading); font-size: 13px; font-weight: 600; line-height: 1.4; }
.th .gd-beascuit-picker small { display: block; margin-top: 4px; color: var(--th-ink-3); font-size: 11px; }
.th .gd-beascuit-picker > b { color: var(--th-link); font-size: 11px; font-weight: 600; }
.th .gd-beascuit-effect-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 8px; }
.th .gd-beascuit-effect-fields .gd-field > span { flex-wrap: wrap; gap: 2px 8px; }
.th .gd-equipment-hint { margin: 0; color: var(--th-ink-3); font-size: 12px; line-height: 1.6; }
.th .gd-build-details { min-width: 0; border-top: 1px solid var(--th-line-2); }
.th .gd-build-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 10px 0; color: var(--th-ink-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.th .gd-build-details > summary::after { content: '+'; color: var(--th-link); margin-left: auto; font-size: 20px; font-weight: 400; }
.th .gd-build-details[open] > summary::after { content: '−'; }
.th .gd-build-details > summary > span { color: var(--th-ink-3); font-size: 10px; font-weight: 400; }
.th .gd-build-details > .gd-build-fields { border-top: 0; padding-top: 4px; }
.th .gd-stat-fields { display: grid; gap: 12px; min-width: 0; padding: 5px 0 0; }
.th .gd-stat-field-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 44px; align-items: end; gap: 6px; min-width: 0; }
.th .gd-field > .gd-percent-input { display: flex; align-items: center; justify-content: stretch; gap: 0; min-width: 0; }
.th .gd-percent-input > input { padding-right: 23px; }
.th .gd-percent-input > span { width: 22px; flex: none; margin-left: -22px; color: var(--th-ink-3); font-size: 12px; pointer-events: none; }
.th .gd-stat-field-row > button { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 8px; background: var(--th-btn-bg); color: var(--th-ink-3); cursor: pointer; }
.th .gd-stat-field-row > button > svg { width: 16px; height: 16px; }
.th .gd-add-stat { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 12px; border: 1px dashed var(--th-line-3); border-radius: 10px; background: var(--th-wash); color: var(--th-link); font: inherit; font-size: 13px; cursor: pointer; }
.th .gd-add-stat:disabled { opacity: .45; cursor: default; }
@container gd-graphic (max-width: 480px) {
  .th .gd-build-equipment { grid-template-columns: minmax(0, 1fr); }
}
@container gd-page (max-width: 480px) {
  .th .gd-build-equipment { grid-template-columns: minmax(0, 1fr); }
  .th .gd-stat-goals > ul { grid-template-columns: minmax(0, 1fr); }
  .th .gd-stat-goals li { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}

/* Equipment-only formats share the graphic frame, with no Cookie identity. */
.th .gd-standalone { --gd-eq-font: clamp(12px, 2.3cqw, 24px); }
.th .gd-topping-body { display: grid; grid-template-columns: 1.15fr minmax(0, 1fr); gap: 4cqw; align-items: center; flex: 1; min-width: 0; }
.th .gd-topping-wheel { min-width: 0; width: 100%; aspect-ratio: 1; position: relative; }
/* Geometry mirrors the site's existing wheel, scoped to document graphics. */
.th .gd-topping-wheel .tb-wheel { position: relative; width: 100%; height: 100%; aspect-ratio: 1; overflow: visible; --tb-topping-width: 34%; --tb-topping-radius: 24.4%; --tb-star-center-y: 49.4%; }
.th .gd-topping-wheel .tb-wheel-tart { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.th .gd-topping-wheel .tb-wheel-tart--empty { inset: 8%; width: auto; height: auto; border: 2px dashed var(--th-line-3); border-radius: 50%; background: var(--th-wash); }
.th .gd-topping-wheel .tb-wheel-slot { position: absolute; inset: 0; transform-origin: 50% var(--tb-star-center-y); transform: rotate(calc(var(--tb-slot-base, 0deg) + var(--tb-slot-rotate, 0deg))); pointer-events: none; }
.th .gd-topping-wheel .tb-wheel-slot img { position: absolute; left: calc(50% + var(--tb-slot-shift, 0%)); top: calc(var(--tb-topping-radius) - var(--tb-slot-lift, 0%)); width: calc(var(--tb-topping-width) * var(--tb-slot-scale, 1)); height: auto; transform: translate(-50%, -50%); }
.th .gd-topping-wheel .tb-wheel-slot[data-tb-slot="0"] { --tb-slot-base: 0deg; --tb-slot-lift: -1.4%; --tb-slot-shift: -0.2%; }
.th .gd-topping-wheel .tb-wheel-slot[data-tb-slot="1"] { --tb-slot-base: -72deg; --tb-slot-lift: -1.6%; --tb-slot-shift: 1.4%; }
.th .gd-topping-wheel .tb-wheel-slot[data-tb-slot="2"] { --tb-slot-base: -144deg; --tb-slot-lift: -3.6%; --tb-slot-shift: 0.7%; }
.th .gd-topping-wheel .tb-wheel-slot[data-tb-slot="3"] { --tb-slot-base: 144deg; --tb-slot-lift: -3.4%; --tb-slot-shift: -1.0%; }
.th .gd-topping-wheel .tb-wheel-slot[data-tb-slot="4"] { --tb-slot-base: 72deg; --tb-slot-lift: -1.8%; --tb-slot-shift: -1.4%; }
.th .gd-toppings-panel-wheel .gd-topping-wheel { max-width: 30cqw; margin: 1.5cqw auto 0; }
.th .gd-toppings-panel-wheel .gd-topping-summary { font-size: clamp(11px, 1.6cqw, 18px); text-align: center; }
.th .gd-wheel-tart-label { margin: 1.5cqw 0 0; padding-top: 1.5cqw; border-top: 1px solid var(--th-line-2); color: var(--th-heading); font-size: var(--gd-eq-font); font-weight: 600; line-height: 1.4; text-align: center; }
.th .gd-layout-wide .gd-toppings-panel-wheel .gd-topping-wheel { max-width: 23cqw; }
@container gd-graphic (max-width: 480px) {
  .th .gd-graphic .gd-toppings-panel-wheel .gd-topping-wheel { max-width: 60cqw; }
}
.th .gd-topping-selection { min-width: 0; padding: 3cqw; border: 1px solid var(--th-line-2); border-radius: 12px; background: var(--th-wash); }
.th .gd-topping-list { display: grid; gap: 1.2cqw; margin-top: 2cqw; }
.th .gd-topping-list > li { display: flex; align-items: center; gap: 1.4cqw; min-width: 0; padding: 1.1cqw; border-radius: 8px; background: var(--th-surface-1); font-size: clamp(12px, 2.1cqw, 22px); line-height: 1.35; }
.th .gd-topping-list img { flex: none; width: 6cqw; height: 6cqw; object-fit: contain; }
.th .gd-topping-list strong { flex: none; color: var(--gd-accent); font-weight: 700; }
.th .gd-topping-list li > span { flex: 1; min-width: 0; color: var(--th-ink-2); }
.th .gd-selection-empty { margin: 2cqw 0 0; color: var(--th-ink-3); font-size: clamp(12px, 2.1cqw, 20px); line-height: 1.5; }
.th .gd-tart-selection { margin-top: 2.7cqw; padding-top: 2.5cqw; border-top: 1px solid var(--th-line-2); }
.th .gd-tart-selection > div { display: flex; align-items: center; gap: 1.4cqw; margin-top: 1.4cqw; min-width: 0; }
.th .gd-tart-selection img { flex: none; width: 7cqw; height: 7cqw; object-fit: contain; }
.th .gd-tart-selection strong { flex: 1; min-width: 0; font-size: clamp(12px, 2.2cqw, 23px); line-height: 1.4; font-weight: 600; }
.th .gd-standalone .gd-board > .gd-stat-goals { padding: 3cqw; border: 1px solid var(--th-line-2); border-radius: 12px; background: var(--th-wash); }
.th .gd-beascuit-body { display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: 4cqw; min-width: 0; flex: 1; }
.th .gd-beascuit-art-stage { position: relative; display: grid; place-items: center; width: 100%; min-width: 0; height: 52cqw; }
.th .gd-beascuit-art-stage > img { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; object-fit: contain; filter: var(--th-art-drop); }
.th .gd-beascuit-halo { position: absolute; width: 35cqw; height: 35cqw; border: 1px solid color-mix(in srgb, var(--gd-accent) 22%, transparent); border-radius: 50%; box-shadow: 0 0 0 3cqw color-mix(in srgb, var(--gd-accent) 5%, transparent), 0 0 0 7cqw color-mix(in srgb, var(--gd-accent) 2%, transparent); }
.th .gd-beascuit-build-card { min-width: 0; }
.th .gd-standalone-beascuit-name { margin: 1.6cqw 0 3.5cqw; font-family: 'CookieRun KR', sans-serif; font-size: clamp(20px, 4.2cqw, 44px); color: var(--th-heading); line-height: 1.25; }
.th .gd-beascuit-graphic .gd-beascuit-effects { gap: 1.5cqw; }
.th .gd-beascuit-graphic .gd-beascuit-effects > li { padding: 1.6cqw 2cqw; border: 1px solid var(--th-line-2); background: var(--th-wash); font-size: clamp(14px, 2.6cqw, 28px); }
.th .gd-standalone-empty { display: grid; place-items: center; gap: 2cqw; padding: 4cqw; text-align: center; color: var(--th-ink-3); font-size: clamp(14px, 2.7cqw, 24px); }
.th .gd-standalone-empty svg { width: 9cqw; height: 9cqw; }
.th .gd-layout-wide.gd-standalone .gd-topping-body { grid-template-columns: .9fr 1.5fr; gap: 4cqw; }
.th .gd-layout-wide.gd-standalone .gd-topping-wheel { width: 100%; max-width: 32cqw; margin: 0 auto; }
.th .gd-layout-wide.gd-standalone .gd-topping-selection { padding: 2cqw; }
.th .gd-layout-wide.gd-standalone .gd-topping-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1cqw; }
.th .gd-layout-wide.gd-standalone .gd-topping-list img { width: 3.6cqw; height: 3.6cqw; }
.th .gd-layout-wide.gd-standalone .gd-topping-list li { font-size: clamp(12px, 1.5cqw, 21px); }
.th .gd-layout-wide.gd-standalone .gd-tart-selection { margin-top: 1.5cqw; padding-top: 1.5cqw; }
.th .gd-layout-wide.gd-standalone .gd-tart-selection img { width: 4cqw; height: 4cqw; }
.th .gd-layout-wide.gd-standalone .gd-tart-selection strong { font-size: clamp(12px, 1.5cqw, 20px); }
.th .gd-layout-wide.gd-standalone .gd-beascuit-body { grid-template-columns: .8fr 1.3fr; }
.th .gd-layout-wide.gd-standalone .gd-beascuit-art-stage { height: 30cqw; }
.th .gd-layout-wide.gd-standalone .gd-beascuit-halo { width: 23cqw; height: 23cqw; }
.th .gd-layout-wide.gd-standalone .gd-beascuit-effects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.th .gd-layout-wide.gd-standalone .gd-standalone-beascuit-name { font-size: clamp(20px, 3.4cqw, 40px); margin-bottom: 2cqw; }
.th .gd-layout-wide.gd-standalone .gd-beascuit-effects > li { font-size: clamp(14px, 1.8cqw, 24px); }
@container gd-graphic (max-width: 480px) {
  .th .gd-standalone:not(.gd-compact) .gd-topping-body, .th .gd-standalone:not(.gd-compact) .gd-beascuit-body { grid-template-columns: minmax(0, 1fr); }
  .th .gd-standalone:not(.gd-compact) .gd-topping-wheel { max-width: 68cqw; margin: 0 auto; }
  .th .gd-standalone:not(.gd-compact) .gd-beascuit-art-stage { height: 52cqw; }
  .th .gd-standalone:not(.gd-compact) .gd-topping-list img { width: 9cqw; height: 9cqw; }
  .th .gd-standalone:not(.gd-compact) .gd-tart-selection img { width: 10cqw; height: 10cqw; }
  .th .gd-standalone:not(.gd-compact) .gd-topping-list { grid-template-columns: minmax(0, 1fr); }
}
/* Small library cards show the format's art rather than a squeezed full build. */
.th .gd-standalone.gd-compact .gd-topping-body, .th .gd-standalone.gd-compact .gd-beascuit-body { display: contents; }
.th .gd-standalone.gd-compact .gd-graphic-heading { grid-row: 1 / 3; align-self: center; }
.th .gd-standalone.gd-compact .gd-topping-wheel, .th .gd-standalone.gd-compact .gd-beascuit-art-stage { grid-column: 1; grid-row: 1 / 3; width: 100%; max-width: none; height: auto; aspect-ratio: 1; margin: 0; }
.th .gd-standalone.gd-compact .gd-beascuit-halo { width: 24cqw; height: 24cqw; }
.th .gd-standalone.gd-compact .gd-topping-selection, .th .gd-standalone.gd-compact .gd-beascuit-build-card { display: none; }
