/* Creator choices: approved story-lab geometry, with the existing BTH catalogs. */
.bth-generator .bth-choice-section { min-width: 0; padding: 21px 0 0; }
.bth-generator .bth-choice-section h2 { margin: 0 0 8px; font: 600 14px/1.5 var(--bth-font-body); letter-spacing: 0; }
.bth-generator .bth-choice-help { margin: 0 0 12px; color: var(--bth-muted); font-size: 13px; line-height: 1.6; }
.bth-generator .bth-support-note { margin: 18px 0; padding: 12px 14px; border-left: 2px solid var(--bth-leaf); background: var(--bth-surface-soft); color: var(--bth-ink); font-size: 13px; line-height: 1.65; }
.bth-generator .bth-choice-grid, .bth-generator .bth-choice-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.bth-generator .bth-choice {
    position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 22px; align-items: center; gap: 12px;
    width: 100%; min-width: 0; min-height: 57px; padding: 13px 14px; border: 1px solid var(--bth-line); border-radius: 11px;
    background: var(--bth-surface); color: var(--bth-ink); font-size: 14px; font-weight: 600; line-height: 1.5;
    text-align: left; overflow-wrap: anywhere; cursor: pointer; touch-action: manipulation;
}
.bth-generator .bth-choice > span:first-child { min-width: 0; }
.bth-generator .bth-choice strong, .bth-generator .bth-choice small { display: block; }
.bth-generator .bth-choice strong { font-size: 14px; font-weight: 600; line-height: 1.5; }
.bth-generator .bth-choice small { margin-top: 4px; color: var(--bth-muted); font-size: 12px; font-weight: 400; line-height: 1.65; }
.bth-generator .bth-choice[aria-pressed="true"] { border-color: var(--bth-plum); background: var(--bth-plum-soft); }
.bth-generator .bth-choice-mark {
    display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: 0 0 22px;
    border: 1px solid var(--bth-line-strong); border-radius: 50%; background: var(--bth-surface); color: var(--bth-on-plum);
}
.bth-generator .bth-choice[aria-pressed="true"] .bth-choice-mark { border-color: var(--bth-plum); background: var(--bth-plum); }
.bth-generator .bth-choice[aria-pressed="true"] .bth-choice-mark::after {
    content: ""; width: 6px; height: 10px; margin-bottom: 3px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
}
/* Domains lead to topics; only the final topic uses a selection check. */
.bth-generator .bth-category-navigation { grid-template-columns: 36px minmax(0, 1fr) 18px; gap: 10px; }
.bth-generator .bth-choice-category-icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; color: var(--bth-plum); background: var(--bth-plum-soft); }
.bth-generator .bth-choice-category-icon svg { display: block; width: 24px; height: 24px; }
.bth-generator .bth-choice-category-arrow, .bth-generator .bth-choice-return-icon { display: inline-flex; align-items: center; flex: 0 0 18px; width: 18px; height: 18px; color: var(--bth-muted); }
.bth-generator .bth-choice-category-arrow svg, .bth-generator .bth-choice-return-icon svg { width: 18px; height: 18px; }
.bth-generator .bth-choice-return-icon { transform: rotate(180deg); color: inherit; }
.bth-generator .bth-category-navigation > span { min-width: 0; }
.bth-generator .bth-choice-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; margin: 8px 0 12px; }
.bth-generator .bth-choice-current { margin: 0; color: var(--bth-plum); font-size: 14px; font-weight: 600; }
.bth-generator .bth-choice-current strong { display: block; margin-top: 3px; color: var(--bth-ink); font-weight: 600; }
.bth-generator .bth-choice-heading .bth-choice-current { font-size: 12px; font-weight: 400; line-height: 1.5; }
.bth-generator .bth-choice-back {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 48px; padding: 10px 0; border: 0; background: none; color: var(--bth-plum); font-size: 12px; font-weight: 600;
    line-height: 1.4; text-align: left; text-decoration: underline; text-decoration-color: var(--bth-line-strong);
    text-underline-offset: 4px; cursor: pointer; touch-action: manipulation;
}
.bth-generator .bth-support-mood { margin-bottom: 0; color: var(--bth-muted); font-size: 12px; }
.bth-generator .bth-generator-moods { min-width: 0; margin: 0; padding: 0; border: 0; }
.bth-generator .bth-generator-moods legend { margin-bottom: 10px; padding: 0; font: 600 14px/1.5 var(--bth-font-body); }
.bth-generator .bth-mood-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bth-generator .bth-mood-grid .bth-choice { min-height: 50px; padding: 10px 11px; font-size: 13px; }

/* Illustrated worlds retain their real enum labels; artwork is decorative. */
.bth-generator .bth-world-disclosure { min-width: 0; border-bottom: 1px solid var(--bth-line); }
.bth-generator .bth-world-disclosure > summary {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 76px; padding: 15px 0;
    list-style: none; cursor: pointer; touch-action: manipulation;
}
.bth-generator .bth-world-disclosure > summary::-webkit-details-marker { display: none; }
.bth-generator .bth-world-disclosure > summary::marker { content: ""; }
.bth-generator .bth-world-disclosure > summary strong { display: block; font: 600 14px/1.45 var(--bth-font-body); }
.bth-generator .bth-world-disclosure > summary small { display: block; margin-top: 4px; color: var(--bth-muted); font-size: 12px; line-height: 1.4; }
.bth-generator .bth-world-current { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bth-generator .bth-world-current > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.bth-generator .bth-world-thumb { display: block; width: 59px; height: 43px; flex: 0 0 59px; border-radius: 8px; overflow: hidden; background: var(--bth-surface); }
.bth-generator .bth-world-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.bth-generator .bth-world-chevron { width: 20px; height: 20px; flex: 0 0 20px; color: var(--bth-muted); }
.bth-generator .bth-world-disclosure[open] > summary .bth-world-chevron { transform: rotate(180deg); }
.bth-generator .bth-world-disclosure-body { padding-bottom: 19px; }
.bth-generator .bth-world-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bth-generator .bth-world-toolbar > p { margin: 0; color: var(--bth-muted); font-size: 12px; line-height: 1.4; }
.bth-generator .bth-world-browse {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex-shrink: 0; min-height: 48px;
    padding: 8px 0; border: 0; background: transparent; color: var(--bth-plum); font-size: 12px; font-weight: 600;
    line-height: 1.4; cursor: pointer; touch-action: manipulation;
}
.bth-generator .bth-world-browse .bth-kit-icon { width: 16px; height: 16px; }
.bth-generator .bth-world-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 15px; }
.bth-generator .bth-world-toolbar + .bth-world-grid { margin-top: 7px; }
.bth-generator .bth-world-card {
    position: relative; display: block; min-width: 0; padding: 0; border: 1px solid var(--bth-line); border-radius: 15px;
    overflow: hidden; background: var(--bth-surface); color: var(--bth-ink); text-align: left; cursor: pointer; touch-action: manipulation;
}
.bth-generator .bth-world-card[aria-pressed="true"] { border-color: var(--bth-plum); box-shadow: 0 0 0 1.5px var(--bth-plum); }
.bth-generator .bth-world-art { display: block; position: relative; aspect-ratio: 200 / 95; overflow: hidden; }
.bth-generator .bth-world-art img { display: block; position: absolute; top: 50%; left: 0; width: 100%; height: auto; transform: translateY(-50%); }
.bth-generator .bth-world-label { display: block; padding: 9px 11px 10px; font-size: 14px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.bth-generator .bth-world-check {
    position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
    border: 1px solid var(--bth-line-strong); border-radius: 50%; background: var(--bth-surface); color: var(--bth-on-plum);
}
.bth-generator .bth-world-card[aria-pressed="true"] .bth-world-check { border-color: var(--bth-plum); background: var(--bth-plum); }
.bth-generator .bth-world-check svg { width: 13px; height: 13px; }

/* Native modality provides focus trapping and background inertness on Web and MAUI. */
.bth-generator .bth-learning-art { display: block; width: 100%; height: 100%; }
.bth-generator .bth-learning-card { display: flex; flex-direction: column; }
.bth-generator .bth-learning-card .bth-world-art { width: 100%; flex-shrink: 0; }
.bth-generator .bth-learning-card .bth-world-label { min-height: 0; padding-bottom: 5px; }
.bth-generator .bth-learning-description { display: block; padding: 0 11px 13px; color: var(--bth-muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.bth-generator .bth-learning-topics { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--bth-line); }
.bth-generator .bth-learning-topics h2 { margin: 0 0 8px; font: 600 14px/1.5 var(--bth-font-body); letter-spacing: 0; }
.bth-generator .bth-world-dialog {
    position: fixed; inset: auto 0 0; width: min(100%, 540px); max-width: 100%;
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top, 0px))); margin: 0 auto; padding: 0;
    border: 1px solid var(--bth-line); border-bottom: 0; border-radius: 24px 24px 0 0; background: var(--bth-paper); color: var(--bth-ink); overflow: hidden;
}
.bth-generator .bth-world-dialog:not([open]) { display: none; }
.bth-generator .bth-world-dialog[open] { display: flex; flex-direction: column; }
.bth-generator .bth-world-dialog::backdrop { background: rgb(35 27 43 / 48%); }
.bth-generator .bth-world-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 22px 8px; flex-shrink: 0; }
.bth-generator .bth-world-dialog-head .bth-eyebrow { margin: 0 0 6px; }
.bth-generator .bth-world-dialog-head h2 { margin: 0; font-size: 29px; }
.bth-generator .bth-world-close {
    display: inline-flex; align-items: center; justify-content: center; width: 48px; min-height: 48px; flex: 0 0 48px;
    margin: -8px -8px 0 0; padding: 8px; border: 0; border-radius: 50%; background: transparent; color: var(--bth-plum); cursor: pointer;
}
.bth-generator .bth-world-close svg { width: 24px; height: 24px; }
.bth-generator .bth-world-dialog-hint { margin: 0; padding: 0 22px 16px; border-bottom: 1px solid var(--bth-line); color: var(--bth-muted); font-size: 13px; line-height: 1.5; flex-shrink: 0; }
.bth-generator .bth-world-dialog-scroll {
    min-height: 0; padding: 4px 22px calc(16px + env(safe-area-inset-bottom, 0px)); overflow-y: auto;
    overscroll-behavior: contain; scrollbar-width: none; scroll-padding-block: 10px;
}
.bth-generator .bth-world-dialog-scroll::-webkit-scrollbar { display: none; }
.bth-generator .bth-world-dialog .bth-world-card { align-self: stretch; }
.bth-generator .bth-world-dialog .bth-world-label { display: flex; align-items: center; min-height: 49px; }
.bth-generator .bth-world-dialog-end { margin: 0; padding-top: 18px; color: var(--bth-muted); font-size: 12px; text-align: center; }
html:has(.bth-generator .bth-world-dialog[open]), body:has(.bth-generator .bth-world-dialog[open]) { overflow: hidden; }
.bth-generator:has(.bth-world-dialog[open]) .bth-ambient-stars { visibility: hidden; }
.bth-generator:has(.bth-world-dialog[open]) .bth-ambient-star, .bth-generator:has(.bth-world-dialog[open]) .bth-ambient-star svg { animation-play-state: paused; }

@media (min-width: 600px) {
    .bth-generator .bth-world-dialog { inset: 0; margin: auto; max-height: min(820px, calc(100dvh - 48px)); border-bottom: 1px solid var(--bth-line); border-radius: 24px; }
}
@media (max-width: 350px) {
    .bth-generator .bth-choice { gap: 9px; padding-inline: 12px; }
    .bth-generator .bth-world-dialog-head, .bth-generator .bth-world-dialog-hint, .bth-generator .bth-world-dialog-scroll { padding-inline: 18px; }
    .bth-generator .bth-world-toolbar > p, .bth-generator .bth-world-browse { font-size: 11px; }
}
@media (hover: hover) {
    .bth-generator .bth-choice:hover, .bth-generator .bth-world-card:hover { border-color: var(--bth-plum); }
    .bth-generator .bth-world-close:hover { background: var(--bth-surface-soft); }
}
@media (prefers-reduced-motion: reduce) {
    .bth-generator .bth-world-disclosure *, .bth-generator .bth-choice, .bth-generator .bth-choice-mark { animation: none; transition: none; scroll-behavior: auto; }
}
@media (forced-colors: active) {
    .bth-generator .bth-choice[aria-pressed="true"], .bth-generator .bth-world-card[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
}
