/* Approved story-lab composition; opt-in shared Blazor Creator only. */
html:has(.bth-generator) { scrollbar-width: none; scroll-padding-top: 24px; }
html:has(.bth-generator)::-webkit-scrollbar { display: none; }
.bth-generator { position: relative; min-height: 100dvh; background: var(--bth-paper); font-size: 14px; }
.bth-generator-main { position: relative; z-index: 1; width: min(100%, 540px); margin: 0 auto; padding: calc(8px + env(safe-area-inset-top, 0px)) 24px calc(150px + env(safe-area-inset-bottom, 0px)); }
.bth-generator-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 -4px 5px; }
.bth-generator-brand { display: flex; align-items: center; min-height: 48px; text-decoration: none; color: var(--bth-plum); }
.bth-generator-brand .bth-kit-brand { gap: 7px; color: var(--bth-plum); }
.bth-generator-brand .bth-kit-brand > svg { width: 27px; height: 31px; }
.bth-generator-brand .bth-kit-brand-name { font: 550 19px var(--bth-font-display); letter-spacing: -.03em; }
.bth-generator .bth-generator-motion { width: 48px; height: 48px; color: var(--bth-plum); border: 0; background: transparent; }
.bth-generator-motion svg { width: 20px; height: 20px; }
.bth-generator-back { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; margin: 0 0 7px; color: var(--bth-plum); font-size: 13px; font-weight: 600; text-decoration: none; }
.bth-generator-back svg { width: 18px; height: 18px; transform: rotate(180deg); }
.bth-generator-header { margin-bottom: 18px; }
.bth-generator-header .bth-eyebrow { margin: 0 0 7px; color: var(--bth-clay); font-size: 11px; letter-spacing: .12em; }
.bth-generator-header h1 { max-width: 320px; margin: 0; font-size: 35px; line-height: 1.1; letter-spacing: -.035em; }
.bth-generator-header > p:last-child { margin: 10px 0 0; max-width: 340px; font-size: 14px; line-height: 1.5; }
.bth-generator h2 { font-size: 23px; margin: 0 0 12px; }
.bth-generator :is(button, summary, select) { touch-action: manipulation; }
.bth-generator :where(button, summary) { -webkit-tap-highlight-color: transparent; }
.bth-generator :where(button:disabled) { cursor: not-allowed; }
.bth-generator :is(button, summary, label, h1, h2, p) { overflow-wrap: anywhere; }
.bth-generator :is(input, textarea, select, button, summary) { scroll-margin-block: 24px 160px; }
.bth-generator-context { padding-top: 22px; }
.bth-generator-context > label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0; font: 550 23px/1.2 var(--bth-font-display); letter-spacing: -.02em; }
.bth-generator-context > label span { flex-shrink: 0; font: 400 11px var(--bth-font-body); letter-spacing: 0; }
.bth-generator-context-intro { color: var(--bth-muted); font-size: 13px; line-height: 1.5; margin: 8px 0 12px; }
.bth-generator textarea, .bth-generator select { border: 1px solid var(--bth-line-strong); background: var(--bth-surface); color: var(--bth-ink); font: 400 16px/1.5 var(--bth-font-body); }
.bth-generator textarea { display: block; width: 100%; min-height: 103px; padding: 12px; border-radius: 11px; resize: vertical; }
.bth-generator textarea::placeholder { color: var(--bth-muted); opacity: .9; }
.bth-generator-context-help { display: flex; justify-content: flex-end; margin-top: 4px; color: var(--bth-muted); font-size: 11px; }
.bth-generator-context-help span { white-space: nowrap; }
.bth-continuation { display: grid; gap: 16px; }
.bth-continuation textarea { width: 100%; min-height: 110px; padding: 14px; border: 1px solid var(--bth-line-strong); border-radius: 16px; background: var(--bth-surface); color: var(--bth-ink); font: inherit; resize: vertical; }
.bth-generator-preferences { margin-top: 25px; border-top: 1px solid var(--bth-line); border-bottom: 1px solid var(--bth-line); }
.bth-generator-preferences > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 73px; padding: 16px 0; cursor: pointer; list-style: none; }
.bth-generator-preferences > summary::-webkit-details-marker { display: none; }
.bth-generator-preferences > summary > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bth-generator-preferences > summary strong { display: block; font-size: 14px; font-weight: 600; }
.bth-generator-preferences > summary small { display: block; color: var(--bth-muted); font-size: 12px; margin-top: 2px; line-height: 1.4; }
.bth-generator-preferences-body { padding: 2px 0 18px; }
.bth-generator-duration { margin-top: 15px; }
.bth-generator-duration-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
.bth-generator-duration output { color: var(--bth-plum); font-weight: 600; white-space: nowrap; }
.bth-generator-duration input[type="range"] { display: block; width: 100%; min-height: 48px; margin: 4px 0 0; accent-color: var(--bth-plum); cursor: pointer; background: transparent; }
.bth-generator-range-labels { display: flex; justify-content: space-between; color: var(--bth-muted); font-size: 11px; }
.bth-generator-language { margin-top: 15px; }
.bth-generator-language > label { display: block; font-size: 13px; margin-bottom: 8px; }
.bth-generator select { appearance: none; -webkit-appearance: none; width: 100%; min-height: 48px; padding: 9px 38px 9px 12px; border-radius: 8px; background-image: linear-gradient(45deg, transparent 50%, var(--bth-muted) 50%), linear-gradient(135deg, var(--bth-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.bth-generator-format { border: 0; padding: 0; margin: 15px 0 0; min-width: 0; }
.bth-generator-format legend { font-size: 13px; margin-bottom: 8px; }
.bth-generator-format-options { display: flex; gap: 8px; }
.bth-generator-format-options button { display: flex; align-items: center; justify-content: center; flex: 1; gap: 7px; min-width: 0; min-height: 48px; padding: 10px; background: var(--bth-surface); border: 1px solid var(--bth-line); border-radius: 9px; color: var(--bth-ink); font-size: 14px; }
.bth-generator-format-options button[aria-pressed="true"] { background: var(--bth-plum-soft); border-color: var(--bth-plum); }
.bth-generator .bth-generator-inspiration { margin-top: 24px; border-top: 1px solid var(--bth-line); }
.bth-generator .bth-generator-inspiration .bth-generator-moods { margin-top: 24px; }
.bth-generator-inspiration + .bth-generator-preferences { margin-top: 0; border-top: 0; }
.bth-generator-submit { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 5; width: min(100%, 540px); padding: 12px 24px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--bth-line); background: var(--bth-paper); }
.bth-generator-submit-feedback { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 7px; }
.bth-generator-submit-feedback p { min-width: 0; margin: 0; color: var(--bth-muted); text-align: center; font-size: 12px; line-height: 1.4; }
.bth-generator-submit-feedback:has(button) p { flex: 1; text-align: left; }
.bth-generator-requirement-link { display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex-shrink: 0; min-height: 48px; padding: 6px 0 6px 6px; border: 0; background: transparent; color: var(--bth-plum); font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.bth-generator-requirement-link svg { width: 16px; height: 16px; }
.bth-generator :is(#generator-audience, #generator-purpose) { scroll-margin-top: 24px; }
.bth-generator-submit .bth-button { width: 100%; min-height: 52px; justify-content: center; gap: 10px; padding: 14px 16px; border-radius: 14px; font-size: 15px; }
.bth-generator-submit .bth-button svg { width: 20px; height: 20px; }
.bth-generator[data-generator-editing="true"] .bth-generator-submit { position: static; transform: none; width: auto; margin: 24px -24px 0; }
.bth-generator[data-generator-editing="true"] .bth-generator-main { padding-bottom: 24px; }
.bth-generator-loading, .bth-generator-pending { padding: 36px 20px; border: 1px solid var(--bth-line); border-radius: 19px; background: var(--bth-surface); text-align: center; }
.bth-generator-loading p, .bth-generator-pending p { margin: 16px 0; }
.bth-generator-loading-star { width: 84px; height: 84px; margin: 0 auto 24px; color: var(--bth-plum); }
/* Exact mock composition, independently scoped to preserve the accepted Home. */
.bth-generator .bth-ambient-stars { opacity: .48; color: #e8b656; }
.bth-generator .bth-ambient-star { left: var(--x); top: var(--y); right: auto; bottom: auto; width: var(--size); height: var(--size); animation: bth-home-drift var(--drift, 12s) ease-in-out var(--delay, 0s) infinite; }
.bth-generator .bth-ambient-star svg { color: inherit; animation: bth-home-breathe var(--pulse, 7s) ease-in-out var(--delay, 0s) infinite; }
.bth-generator .bth-ambient-star:nth-child(3n) { color: #c7b2d3; }
.bth-generator .bth-ambient-star:nth-child(1) { --x: 82%; --y: 4%; --size: 16px; --delay: -3s; --drift: 13s; }
.bth-generator .bth-ambient-star:nth-child(2) { --x: 94%; --y: 21%; --size: 14px; --delay: -7s; --pulse: 8s; }
.bth-generator .bth-ambient-star:nth-child(3) { --x: 3%; --y: 37%; --size: 11px; --delay: -5s; --drift: 15s; }
.bth-generator .bth-ambient-star:nth-child(4) { --x: 74%; --y: 36%; --size: 17px; --delay: -9s; --pulse: 9s; }
.bth-generator .bth-ambient-star:nth-child(5) { --x: 95%; --y: 68%; --size: 12px; --delay: -2s; --drift: 14s; }
.bth-generator .bth-ambient-star:nth-child(6) { --x: 8%; --y: 78%; --size: 15px; --delay: -11s; --pulse: 8s; }
.bth-generator .bth-ambient-star:nth-child(7) { --x: 46%; --y: 17%; --size: 12px; --delay: -6s; --drift: 16s; }
.bth-generator .bth-ambient-star:nth-child(8) { --x: 64%; --y: 73%; --size: 18px; --delay: -4s; --pulse: 9s; }
.bth-generator .bth-ambient-star:nth-child(9) { --x: 29%; --y: 52%; --size: 10px; --delay: -10s; --drift: 14s; }
.bth-generator .bth-ambient-stars.is-paused .bth-ambient-star, .bth-generator .bth-ambient-stars.is-paused svg { animation-play-state: paused; }
.bth-generator:has(input:focus, textarea:focus, select:focus, dialog[open]) .bth-ambient-stars { visibility: hidden; }
.bth-generator:has(input:focus, textarea:focus, select:focus, dialog[open]) .bth-ambient-star, .bth-generator:has(input:focus, textarea:focus, select:focus, dialog[open]) .bth-ambient-star svg { animation-play-state: paused; }
@media (min-width: 600px) {
    .bth-generator-main { padding-inline: 36px; padding-top: calc(32px + env(safe-area-inset-top, 0px)); }
    .bth-generator-header h1 { font-size: 39px; }
    .bth-generator[data-generator-editing="true"] .bth-generator-submit { margin-inline: -36px; }
}
@media (max-width: 760px) { .bth-generator .bth-ambient-star:nth-child(n+7) { display: none; } }
@media (max-width: 350px) {
    .bth-generator-main { padding-inline: 18px; }
    .bth-generator-header h1 { font-size: 31px; }
    .bth-generator-brand .bth-kit-brand-name { font-size: 17px; }
    .bth-generator[data-generator-editing="true"] .bth-generator-submit { margin-inline: -18px; }
}
@media (prefers-reduced-motion: reduce) {
    .bth-generator-motion { display: none !important; }
    .bth-generator .bth-ambient-star, .bth-generator .bth-ambient-star svg { animation: none; transform: none; }
    .bth-generator .bth-ambient-star svg { opacity: .8; }
}

.bth-generator .bth-inspiration-clear {
    min-height: 48px; margin-top: 12px; padding: 10px 14px;
    border: 1px solid var(--bth-line); border-radius: 11px;
    background: var(--bth-surface); color: var(--bth-ink); cursor: pointer;
}
.bth-generator .bth-inspiration-clear[aria-pressed="true"] {
    border-color: var(--bth-plum); background: var(--bth-plum-soft);
}
