@font-face {
    font-family: "Golos Text";
    src: url("fonts/golos-text.ttf") format("truetype");
    font-weight: 400 900;
    font-display: swap;
}

:root {
    color-scheme: light;
    --paper: #f8f7f4;
    --ink: #211e29;
    --muted: #595463;
    --line: #dfdce2;
    --accent: #283fc3;
    --accent-dark: #1e319d;
    --tint: #e9ecfb;
    --ease-out: cubic-bezier(.23, 1, .32, 1);
    font-family: "Golos Text", "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
h1, h2, p { margin: 0; }
h1, h2 { text-wrap: balance; overflow-wrap: anywhere; }
button, textarea, input { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button, a, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}
[hidden] { display: none !important; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; z-index: 5; top: 8px; left: 8px; padding: 12px; color: white; background: var(--accent); border-radius: 6px; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.shell { width: min(1200px, calc(100% - 88px)); margin: 0 auto; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 65px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 20px; letter-spacing: -.05em; font-weight: 740; }
.brand-mark { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 8px; background: var(--accent); color: white; }
.brand-mark svg { width: 22px; height: 22px; }
.header-inner nav { display: flex; align-items: center; gap: 8px; }
.nav-button { display: inline-flex; align-items: center; background: transparent; border: 0; color: var(--ink); min-height: 44px; padding: 8px 12px; border-radius: 7px; font-weight: 570; font-size: 14px; text-decoration: none; }
.nav-button[aria-current="page"] { color: var(--accent-dark); background: var(--tint); }
.nav-wallet { gap: 7px; color: var(--accent-dark); background: var(--tint); }
.nav-wallet strong { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nav-auth { color: var(--accent-dark); border: 1px solid var(--line); background: white; }
#auth-local-link { text-decoration: none; }
#auth-message { overflow-wrap: anywhere; }

.home { padding-block: clamp(30px, 5.5vw, 78px) clamp(36px, 6vw, 86px); }
.home-hero { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); align-items: center; gap: clamp(28px, 4.7vw, 68px); }
.home-intro h1 { max-width: 12ch; font-size: clamp(45px, 5.65vw, 83px); font-weight: 730; letter-spacing: -.058em; line-height: 1.01; text-wrap: wrap; }
.home-intro p { max-width: 37ch; margin-block: 23px 29px; color: var(--muted); font-size: clamp(16px, 1.5vw, 19px); line-height: 1.6; text-wrap: pretty; }
.home-intro-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 13px 22px; }
.home-intro-actions .button { min-height: 54px; padding-inline: 19px; }
.home-intro-actions a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent-dark); font-size: 14px; font-weight: 650; text-underline-offset: .3em; }
.home-workflow { min-width: 0; padding: clamp(24px, 4vw, 52px); border-radius: 18px; color: #f9f9ff;
    background: #212743; scroll-margin-top: 16px; }
.home-workflow h2 { font-size: clamp(26px, 3.2vw, 43px); font-weight: 700; letter-spacing: -.045em; line-height: 1.05; text-wrap: wrap; }
.home-steps { margin: 21px 0 0; padding: 0; list-style: none; }
.home-steps li { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 9px; padding-block: 14px; border-top: 1px solid #444a65; }
.home-steps li:last-child { padding-bottom: 0; }
.home-steps li > span { margin-top: 3px; color: #bfc9ff; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.home-steps h3 { margin: 0 0 4px; font-size: 17px; font-weight: 650; }
.home-steps p { max-width: 54ch; color: #d3d8ed; font-size: 14px; line-height: 1.5; text-wrap: pretty; }
.home-account { display: flex; align-items: center; justify-content: space-between; gap: 16px 30px; margin-top: clamp(34px, 5vw, 66px);
    padding: clamp(18px, 3.2vw, 36px); border-radius: 12px; background: var(--tint); }
.home-account h2 { font-size: 23px; letter-spacing: -.035em; }
.home-account p { margin-top: 5px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.home-account-action { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 16px; }
.home-account-action output { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.composer {
    display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr);
    gap: 30px; align-items: start; background: #f0eff8;
    padding: 23px 24px; margin-bottom: 22px; border-radius: 13px;
}
.composer h2 { font-size: clamp(27px, 3vw, 43px); font-weight: 690; letter-spacing: -.053em; line-height: 1.05; }
.composer-copy p { color: var(--muted); margin-top: 8px; font-size: 15px; line-height: 1.45; max-width: 31ch; }
.brief-form textarea {
    display: block; width: 100%; min-height: 88px; resize: vertical; padding: 12px 13px;
    border: 1px solid #d6d2e1; border-radius: 8px; background: #fff; color: var(--ink);
    font-size: 16px; line-height: 1.45;
}
.brief-form textarea::placeholder { color: #615a6d; opacity: 1; }
.brief-form textarea[aria-invalid="true"] { border-color: #ab2542; }
.form-error { color: #a71e3c; font-size: 14px; margin-top: 8px; }
.form-progress { color: var(--muted); font-size: 13px; margin-top: 8px; }
.task-progress { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.task-progress-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.task-progress-heading p { margin: 0; font-size: 14px; font-weight: 650; line-height: 1.4; }
.task-progress-heading span { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.task-progress progress { display: block; width: 100%; height: 5px; margin-block: 10px; accent-color: var(--accent); }
.task-progress [data-progress-detail] { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.project-timeline { margin-block: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.project-timeline h2 { font-size: 15px; font-weight: 700; }
.project-timeline summary { cursor: pointer; font-size: 14px; font-weight: 650; }
.project-timeline ol { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; }
.project-timeline li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 7px 8px; border-radius: 6px; overflow-wrap: anywhere; }
.project-timeline li[aria-current] { background: var(--tint); }
.project-timeline strong { font-size: 14px; font-weight: 650; }
.project-timeline span, .project-timeline p { color: var(--muted); font-size: 12px; line-height: 1.4; }
.project-timeline p { grid-column: 1 / -1; }
.project-timeline [data-status="completed"] span { color: #166343; }
.project-timeline [data-status="active"] span { color: var(--accent-dark); }
.project-timeline [data-status="failed"] span { color: #9c2443; }
.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 11px; margin-top: 11px; }
.form-note { color: var(--muted); font-size: 12px; }
.pending-generation { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.pending-generation .form-note { margin: 0 0 8px; text-align: left; }
.upload-details { margin-top: 12px; font-size: 14px; }
.upload-details summary { cursor: pointer; }
.upload-label { display: grid; gap: 7px; margin-block: 12px; }
#design-attachments { list-style: none; padding: 0; margin: 0; }
.attachment { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.attachment img { width: 48px; height: 48px; object-fit: cover; border-radius: 5px; }
.attachment span { flex: 1 1 100px; min-width: 0; overflow-wrap: anywhere; }
.attachment select, .version-controls select { max-width: 100%; padding: 8px; font: inherit; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); }
.attachment button { border: 0; padding: 8px; background: transparent; color: var(--accent-dark); }
.version-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; font-size: 14px; }
.version-controls label { font-weight: 650; }
.version-controls select { flex: 1 1 240px; min-width: 0; }
.my-projects { min-height: min(60vh, 520px); padding-block: clamp(36px, 7vw, 80px) 40px; }
.project-library-head, .project-workspace { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.project-library-head { margin-bottom: 25px; }
.project-library-head h1 { font-size: clamp(39px, 5vw, 69px); font-weight: 700; letter-spacing: -.055em; line-height: 1; }
.project-library-head .button { flex: none; }
.projects-empty { color: var(--muted); padding: 28px 21px; border: 1px dashed #cbc5d6; border-radius: 10px; }
.saved-projects { border-top: 1px solid var(--line); }
.saved-projects:empty { border: 0; }
.saved-project-card { display: grid; grid-template-columns: 52px minmax(0, 1fr) 24px; align-items: center; gap: 15px; width: 100%; min-height: 82px; padding: 12px; text-align: left; background: white; color: var(--ink); border: 0; border-bottom: 1px solid var(--line); }
.saved-project-card:hover { background: #f5f6ff; }
.saved-project-card:focus-visible { position: relative; z-index: 1; outline-offset: -3px; }
.saved-project-icon { width: 52px; height: 52px; display: grid; place-items: center; overflow: hidden; border-radius: 9px; background: var(--tint); color: var(--accent-dark); }
.saved-project-icon img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.saved-project-text { display: grid; gap: 5px; overflow-wrap: anywhere; }
.saved-project-text strong { font-weight: 650; }
.saved-project-card small { color: var(--muted); font-size: 13px; }
.saved-project-card .generation-card-status { color: var(--accent-dark); font-weight: 650; }
.saved-project-arrow { display: flex; color: var(--accent-dark); }
.project-workspace { margin-block: 24px 20px; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.project-workspace > div { min-width: 0; }
.project-workspace h1 { font-size: clamp(30px, 4vw, 49px); font-weight: 700; letter-spacing: -.06em; line-height: 1.07; }
.workspace-cost { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.workspace-cost output { margin-inline-start: 6px; color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.historical-cost { margin-top: 4px; color: var(--muted); font-size: 12px; }
.project-workspace .back-button { min-height: 35px; margin-bottom: 6px; }
.project-workspace > button { flex: none; }
.workspace-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#project-settings-fields { display: grid; gap: 16px; }
.project-setting { display: grid; gap: 5px; }
.project-setting small { color: var(--muted); overflow-wrap: anywhere; }
.project-question-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.project-question-head .button { min-height: 33px; margin: 0; padding: 5px 10px; }
.new-project-form { display: grid; gap: 11px; }
.new-project-form label { font-size: 14px; font-weight: 650; }
.new-project-form :is(input, select, textarea) { width: 100%; min-height: 45px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); }
.new-project-form .button { justify-self: end; margin-top: 4px; }
.new-project-form .form-error { color: #a71e3c; margin: 0; }
#show-checked { margin-block: 0 14px; }
#draft-progress { margin-bottom: 14px; }
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 45px;
    padding: 0 14px; border: 1px solid transparent; border-radius: 8px;
    font-size: 14px; font-weight: 650; transition: transform 140ms var(--ease-out);
}
.button:active { transform: scale(.98); }
.button:disabled { cursor: wait; opacity: .75; transform: none; }
.primary { background: var(--accent); color: white; }
.button.secondary { border-color: var(--line); background: white; color: var(--accent-dark); }
#select-element[aria-pressed="true"] { background: var(--tint); border-color: var(--accent); }
.site-footer { border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
    gap: 12px; padding: 17px 0 23px; font-size: 12px; color: var(--muted); }
.legal-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.legal-links a { color: var(--accent-dark); text-underline-offset: .23em; }
.legal-links a[aria-current] { color: var(--ink); font-weight: 650; }
.legal-page { padding-block: clamp(24px, 5vw, 70px); }
.legal-page h1 { font-size: clamp(29px, 5vw, 56px); letter-spacing: -.05em; max-width: 22ch; }
.legal-note { margin-block: 12px 24px; max-width: 64ch; color: var(--muted); line-height: 1.55; }
.legal-page .legal-links { padding-block: 13px; border-block: 1px solid var(--line); font-size: 14px; }
.legal-text { max-width: 75ch; }
.legal-text section { margin-top: 22px; }
.legal-text h2 { font-size: 19px; margin-bottom: 6px; }
.legal-text p { line-height: 1.6; overflow-wrap: anywhere; }

.result { padding: 28px 0 22px; }
.back-button { margin-left: -9px; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 9px; color: var(--accent-dark); border: 0; border-radius: 7px; background: transparent; font-size: 13px; font-weight: 650; }
.result-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin: 11px 0 21px; }
#result-title { font-size: clamp(27px, 4vw, 49px); letter-spacing: -.06em; line-height: 1.04; font-weight: 700; }
.project-workspace:not([hidden]) + .composer + .result { padding-top: 0; }
.result-head p { margin-top: 10px; line-height: 1.5; }
#result-summary { color: var(--muted); }
.result-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.editing-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(265px, .34fr); align-items: start; gap: 14px; margin-bottom: 16px; }
.revision-panel { min-width: 0; }
.revision-panel .revision-form { margin-bottom: 0; background: #fff; border-top: 3px solid var(--accent); }
.revision-panel .revision-fields textarea { flex-basis: 100%; min-height: 108px; }
.revision-panel .revision-fields button { width: 100%; }
.revision-panel #point-at-screenshot { min-height: 34px; margin: 1px 0 8px; }
.editing-workspace .preview-stage iframe { height: clamp(470px, 65vh, 820px); }
.editing-workspace .preview-toolbar { flex-wrap: wrap; }
.deployment-grid { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(92px, .5fr); gap: 10px; }
.deployment-grid label { min-width: 0; }
.new-project-form .deployment-option { display: flex; align-items: start; gap: 8px; font-weight: 500; }
.new-project-form .deployment-option input { width: auto; min-height: auto; margin-top: 3px; }
#deployment-dialog code { overflow-wrap: anywhere; }
#deployment-status[data-state="failed"] { color: #a71e3c; }
#comparison-dialog { width: min(1220px, calc(100% - 24px)); }
.comparison-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.comparison-grid h3 { font-size: 14px; margin: 10px 0; overflow-wrap: anywhere; }
.comparison-grid iframe { display: block; width: 100%; height: min(62vh, 700px); border: 1px solid var(--line); border-radius: 8px; background: #fff; }
#comparison-dialog:has(#comparison-phone:checked) iframe { width: min(100%, 390px); margin-inline: auto; }
.screenshot-route { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.screenshot-route label { display: grid; flex: 1 1 150px; gap: 3px; font-size: 14px; }
.screenshot-route input { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 7px; font: inherit; }
@media (max-width: 810px) {
    .editing-workspace, .comparison-grid { grid-template-columns: minmax(0, 1fr); }
    .editing-workspace .preview-stage iframe { height: min(64vh, 570px); }
}
.revision-form { padding: 14px 16px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--tint); }
.revision-form label { display: inline-block; margin-bottom: 7px; font-size: 14px; font-weight: 650; }
.revision-fields { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.revision-fields textarea { flex: 1 1 280px; min-height: 70px; }
.revision-fields button { white-space: nowrap; }
#revision-status:empty { display: none; }
.diagnostics { margin-bottom: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: white; font-size: 14px; }
.diagnostics summary { font-weight: 650; cursor: pointer; }
.diagnostics p { margin-top: 10px; line-height: 1.5; }
.diagnostics li { margin-top: 6px; line-height: 1.4; }
#backend-diagnostics { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
#backend-diagnostics h3 { font-size: 1rem; }
.diagnostics-table { overflow-x: auto; margin-top: 12px; }
.diagnostics table { width: 100%; border-collapse: collapse; text-align: left; }
.diagnostics caption { text-align: left; font-weight: 600; margin-bottom: 8px; }
.diagnostics :is(th, td) { padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.preview { border: 1px solid var(--line); background: #ebe9f0; border-radius: 13px; overflow: hidden; }
.preview-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 53px; padding: 7px 12px 7px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.preview-toolbar > span { min-width: 0; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.device-switch { display: flex; padding: 3px; gap: 2px; background: #f0eef4; border-radius: 7px; flex: none; }
.device-switch button, .icon-button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 9px; color: var(--muted); background: transparent; border: 0; border-radius: 5px; font-size: 12px; font-weight: 600; }
.device-switch button svg { width: 16px; height: 16px; }
.device-switch button[aria-pressed="true"] { background: var(--tint); color: var(--accent-dark); }
.preview-stage { display: grid; justify-items: center; }
#next-preview-note { padding: 32px 16px; }
#next-project-notes { margin-top: 16px; }
#next-notes { white-space: pre-line; }
.preview-stage iframe { display: block; width: 100%; height: 610px; border: 0; background: #fff; }
.preview-stage.is-phone { padding: 14px; }
.preview-stage.is-phone iframe { width: min(390px, 100%); border: 1px solid #cac5d4; border-radius: 11px; }
.asset-downloads { margin-top: 12px; font-size: 14px; }
.asset-downloads summary { cursor: pointer; font-weight: 650; }
.asset-downloads li { margin-top: 5px; overflow-wrap: anywhere; }
.asset-downloads li button { margin-left: 8px; padding: 4px 8px; }
.asset-downloads fieldset { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.asset-downloads label { display: block; margin-bottom: 8px; }
.asset-downloads label input { display: block; width: min(100%, 34rem); }

dialog { width: min(490px, calc(100% - 32px)); max-height: calc(100% - 32px); overscroll-behavior: contain; padding: 24px; border-radius: 14px; border: 1px solid var(--line); color: var(--ink); background: #fff; box-shadow: 0 16px 45px #25134326; }
dialog::backdrop { background: #231b3582; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.dialog-head h2 { font-size: 24px; line-height: 1.2; letter-spacing: -.04em; }
dialog p { color: var(--muted); line-height: 1.5; margin: 9px 0 13px; }
dialog details { border-top: 1px solid var(--line); padding: 10px 0; }
dialog details p { margin-bottom: 0; }
dialog summary { font-weight: 640; cursor: pointer; border-radius: 3px; }
.wallet-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); }
.wallet-total span { color: var(--muted); font-size: 14px; }
.wallet-total output { font-size: 29px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.wallet-payment { padding-block: 15px; border-bottom: 1px solid var(--line); }
.wallet-payment h3 { margin: 0; font-size: 16px; }
.wallet-payment p { margin: 3px 0 8px; font-size: 13px; }
.wallet-promo { margin-top: 16px; }
.wallet-promo > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.wallet-promo .button { margin: 0; }
#promo-status, #promo-redeemed { margin-bottom: 0; font-size: 14px; }
#promo-status.form-error, #wallet-unavailable { color: #a71e3c; }
#screenshot-dialog { width: min(1040px, calc(100% - 32px)); }
.screenshot-scroll { overflow: auto; max-height: 58vh; border: 1px solid var(--line); border-radius: 8px; }
#screenshot-stage { position: relative; width: fit-content; max-width: 100%; margin-inline: auto; overflow: hidden; touch-action: none; cursor: crosshair; user-select: none; }
#screenshot-image { display: block; max-width: 100%; height: auto; }
#screenshot-region { position: absolute; border: 2px solid #635bff; box-shadow: 0 0 0 9999px #15112965; pointer-events: none; }
.screenshot-actions, .revision-screenshot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.screenshot-actions { margin-top: 14px; justify-content: flex-end; }
.screenshot-actions label { margin-right: auto; display: grid; gap: 4px; font-size: 13px; }
.screenshot-actions input { max-width: 100%; }
.revision-screenshot { margin-bottom: 10px; font-size: 13px; }
.revision-screenshot img { width: 78px; height: 52px; object-fit: contain; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.revision-screenshot button { padding: 5px 10px; }

@media (hover: hover) and (pointer: fine) {
    .nav-button:hover, .back-button:hover, .icon-button:hover, .device-switch button:hover,
    .button.secondary:hover { color: var(--accent-dark); background: var(--tint); }
    .primary:not(.secondary):hover { background: var(--accent-dark); }
}
@media (prefers-reduced-motion: no-preference) {
    .result:not([hidden]) .preview, dialog[open] { animation: reveal 230ms var(--ease-out) both; }
}
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
    .button { transition: none; }
    .button:active { transform: none; }
}

@media (max-width: 830px) {
    .shell { width: calc(100% - 40px); }
    .home-hero { grid-template-columns: minmax(0, 1fr); }
    .home-intro h1 { max-width: 17ch; font-size: clamp(41px, 8vw, 69px); }
    .composer { gap: 18px; padding: 18px; }
    .result-head { align-items: stretch; flex-direction: column; }
    .result-actions { justify-content: flex-start; }
}
@media (max-width: 580px) {
    .preview-toolbar { flex-wrap: wrap; }
    .preview-toolbar > span { flex: 1 1 100%; }
    .shell { width: calc(100% - 32px); }
    .header-inner { min-height: 58px; }
    .header-inner nav { gap: 0; }
    .nav-button { padding-inline: 7px; font-size: 13px; }
    .header-inner { flex-wrap: wrap; gap: 2px 6px; }
    .nav-wallet { gap: 4px; }
    .nav-wallet strong { font-size: 11px; }
    .home-hero { gap: 24px; }
    .home-intro h1 { max-width: 12ch; }
    .home-intro p { margin-block: 15px 19px; }
    .home-account { flex-wrap: wrap; }
    .project-library-head, .project-workspace { align-items: flex-start; }
    .project-library-head h1 { align-self: center; }
    .project-workspace { flex-direction: column; gap: 12px; }
    .saved-project-card { grid-template-columns: 42px minmax(0, 1fr) 20px; gap: 11px; min-height: 72px; }
    .saved-project-icon { width: 42px; height: 42px; }
    .composer { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 15px; }
    .composer-copy p { margin-top: 5px; font-size: 14px; }
    .form-actions { align-items: stretch; flex-direction: column-reverse; }
    .form-note { text-align: center; }
    .result { padding-top: 15px; }
    .preview-stage iframe { height: 550px; }
    .preview-stage.is-phone { padding: 6px; }
}
@media (max-width: 420px) {
    .header-inner { flex-wrap: wrap; padding-top: 9px; }
    .header-inner nav { flex: 1 0 100%; flex-wrap: wrap; }
}
@media (max-width: 360px) {
    .shell { width: calc(100% - 24px); }
    .brand { gap: 7px; }
    .project-library-head { flex-direction: column; gap: 13px; }
    .project-library-head h1 { align-self: flex-start; }
    .device-switch button { min-width: 35px; padding-inline: 5px; }
    .device-switch button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
