:root {
  color-scheme: light;
  --canvas: #f7faff;
  --canvas-solid: #f7faff;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-solid: #ffffff;
  --ink: #0b1736;
  --ink-soft: #455574;
  --muted: #8090ad;
  --line: rgba(63, 113, 195, 0.18);
  --line-strong: rgba(23, 107, 255, 0.52);
  --blue: #176bff;
  --blue-deep: #0757df;
  --blue-pale: #eaf2ff;
  --ice: #dceaff;
  --output: #eef5ff;
  --output-2: #dceaff;
  --output-ink: #153564;
  --output-muted: #6e8cb5;
  --output-line: rgba(34, 103, 204, 0.20);
  --green: #19b982;
  --danger: #dc4857;
  --shadow: 0 20px 58px rgba(43, 78, 136, 0.15);
  --shadow-soft: 0 10px 28px rgba(43, 78, 136, 0.10);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", ui-monospace, monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #071327;
  --canvas-solid: #071327;
  --surface: rgba(13, 32, 61, 0.78);
  --surface-solid: #0d203d;
  --ink: #f2f7ff;
  --ink-soft: #b0bfd6;
  --muted: #7184a4;
  --line: rgba(126, 168, 237, 0.17);
  --line-strong: rgba(87, 153, 255, 0.60);
  --blue: #5799ff;
  --blue-deep: #337fff;
  --blue-pale: #102b55;
  --ice: #163866;
  --output: #061736;
  --output-2: #082554;
  --output-ink: #eaf2ff;
  --output-muted: #83a7d8;
  --output-line: rgba(126, 174, 239, 0.22);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
  --shadow-soft: 0 10px 34px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(23, 107, 255, 0.14);
}
button, textarea, input { color: inherit; font: inherit; }
button, label, summary { -webkit-user-select: none; user-select: none; }
button { cursor: pointer; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

.skip-link {
  position: fixed;
  z-index: 100;
  left: 18px;
  top: -60px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #fff;
  background: var(--blue-deep);
  text-decoration: none;
  transition: top 180ms ease;
}
.skip-link:focus { top: 18px; }

.topbar {
  position: relative;
  z-index: 50;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 3.2vw, 54px);
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--canvas-solid) 78%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  backdrop-filter: blur(22px) saturate(1.2);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 720;
  letter-spacing: -0.04em;
  text-decoration: none;
}
.brand-mark { width: 32px; height: 32px; fill: var(--blue); filter: drop-shadow(0 7px 12px rgba(23, 107, 255, 0.25)); }
.topbar-meta { display: flex; align-items: center; gap: 24px; }
.connection { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.connection-dot { width: 7px; height: 7px; border-radius: 50%; background: #9aa8bb; }
.connection[data-state="ready"] .connection-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(25, 185, 130, 0.10); }
.connection[data-state="waiting"] .connection-dot { background: #e3a52e; }
.connection[data-state="offline"] .connection-dot { background: var(--danger); }
.theme-toggle { border: 0; padding: 0; border-radius: 999px; background: transparent; }
.theme-track {
  position: relative;
  width: 73px;
  height: 37px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.theme-track svg { z-index: 2; width: 15px; height: 15px; margin: auto; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: stroke 220ms ease; }
.theme-knob { position: absolute; z-index: 1; left: 3px; top: 3px; width: 29px; height: 29px; border-radius: 50%; background: var(--surface-solid); box-shadow: 0 4px 12px rgba(40, 77, 137, 0.18); transition: transform 320ms cubic-bezier(.2,.8,.2,1); }
html[data-theme="dark"] .theme-knob { transform: translateX(37px); }
html:not([data-theme="dark"]) .theme-track .sun { stroke: var(--blue); }
html[data-theme="dark"] .theme-track .moon { stroke: var(--blue); }

.composer {
  position: relative;
  min-height: calc(100dvh - 70px);
  display: grid;
  grid-template-columns: minmax(0, 58%) minmax(390px, 42%);
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(130deg, color-mix(in srgb, var(--canvas-solid) 94%, #dceaff), var(--canvas-solid) 52%, color-mix(in srgb, var(--canvas-solid) 90%, #d8e7ff));
}

.creative-canvas {
  position: relative;
  z-index: 1;
  min-height: max(900px, calc(100dvh - 70px));
  overflow: hidden;
  padding: clamp(40px, 5vh, 64px) clamp(30px, 4vw, 66px) 34px;
  background: transparent;
}
.creative-canvas::before {
  display: none;
}
.creative-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 89%, var(--line) 89%, var(--line) calc(89% + 1px), transparent calc(89% + 1px));
}

.coordinate-field { position: absolute; inset: 18px 20px 0; pointer-events: none; color: color-mix(in srgb, var(--blue) 68%, transparent); font: 10px/1 var(--mono); }
.coordinate-field::before { content: ""; position: absolute; left: 0; top: 20px; bottom: 31%; width: 1px; background: repeating-linear-gradient(to bottom, var(--line-strong) 0 1px, transparent 1px 9px); }
.coordinate-field::after { content: ""; position: absolute; left: 0; bottom: 31%; width: 72%; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }
.axis { position: absolute; font-size: 12px; color: var(--blue); }
.axis-x { left: 72%; bottom: calc(31% + 9px); }
.axis-y { left: 10px; top: 18px; }
.axis-z { left: 12px; bottom: calc(31% + 13px); }
.coordinate { position: absolute; opacity: .7; }
.coordinate-a { left: 10px; top: 120px; writing-mode: vertical-rl; }
.coordinate-b { left: 10px; top: 236px; writing-mode: vertical-rl; }

.hero-copy { position: relative; z-index: 5; max-width: 610px; }
.eyebrow { display: flex; align-items: center; gap: 13px; margin: 0 0 20px; color: var(--blue); font: 600 12px/1 var(--mono); letter-spacing: .11em; text-transform: uppercase; }
.eyebrow span:first-child { display: inline-flex; align-items: center; gap: 13px; }
.eyebrow span:first-child::after { content: ""; width: 34px; height: 1px; background: currentColor; opacity: .5; }
.hero-copy h1 { margin: 0; max-width: 9.6em; color: var(--ink); font-size: clamp(38px, 4.1vw, 66px); line-height: 1.12; letter-spacing: -.07em; font-weight: 730; text-wrap: balance; }
.hero-copy h1 span { color: var(--blue); text-shadow: 0 13px 30px rgba(23, 107, 255, .19); }
.hero-note { margin: 22px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.75; }

.inspiration-field { position: absolute; z-index: 2; top: 28px; right: -1.5%; width: 69%; height: 440px; pointer-events: none; perspective: 1000px; }
.orbit { position: absolute; inset: 20px -7% auto -20%; width: 122%; height: 360px; overflow: visible; fill: var(--blue); stroke: var(--blue); stroke-width: 1.35; opacity: .58; filter: drop-shadow(0 4px 10px rgba(23,107,255,.15)); }
.orbit path { fill: none; stroke-dasharray: 3 2; }
.cross { position: absolute; color: var(--blue); font: 300 28px/1 var(--sans); opacity: .62; }
.cross-a { left: 3%; top: 10%; }.cross-b { right: 10%; top: 30%; }.cross-c { left: 45%; bottom: 14%; }
.reference-tile { position: absolute; transform-style: preserve-3d; }
.tile-label { position: absolute; top: -23px; left: 0; color: var(--blue); font: 10px/1 var(--mono); letter-spacing: .05em; white-space: nowrap; }
.tile-label::after { content: ""; display: inline-block; width: 28px; margin-left: 7px; border-top: 1px dashed currentColor; vertical-align: middle; opacity: .55; }
.mini-art { position: relative; width: 100%; height: 100%; overflow: hidden; border: 4px solid rgba(255,255,255,.92); border-radius: 9px; background: #dce9f8; box-shadow: 0 22px 38px rgba(53,88,141,.20), inset 0 0 0 1px rgba(23,107,255,.16); }
.tile-a { width: 164px; height: 118px; left: 3%; top: 57%; transform: rotate(-7deg) translateZ(15px); }
.tile-b { width: 192px; height: 138px; right: 10%; top: 17%; transform: rotate(6deg) translateZ(48px); }
.tile-c { width: 108px; height: 134px; right: 2%; top: 65%; transform: rotate(-3deg) translateZ(1px); opacity: .82; }
.mist { background: linear-gradient(#c4d9ef, #f0f6fc 47%, #aabdd1 48%, #54708c); }
.mist::before, .mist::after { content: ""; position: absolute; bottom: 22%; width: 82%; height: 60%; background: #7995b0; clip-path: polygon(0 100%, 30% 43%, 45% 65%, 67% 21%, 100% 100%); opacity: .65; }
.mist::after { left: 25%; bottom: 12%; background: #36536d; transform: scale(.85); opacity: .52; }
.mist i { position: absolute; left: 16%; top: 13%; width: 72%; height: 32%; border-radius: 50%; background: rgba(255,255,255,.55); filter: blur(8px); }
.architecture { background: linear-gradient(155deg, #d6e6f4 0 50%, #9ab4cd 50% 51%, #edf5fa 51%); }
.architecture::before { content: ""; position: absolute; left: 22%; bottom: 12%; width: 60%; height: 70%; background: #f7fbfd; clip-path: polygon(0 100%, 0 34%, 27% 34%, 27% 12%, 63% 12%, 63% 0, 100% 0, 100% 100%); box-shadow: -14px 6px 0 rgba(99,132,162,.24); }
.architecture i { position: absolute; z-index: 2; left: 49%; bottom: 12%; width: 26%; height: 45%; border-radius: 45% 45% 0 0; border: 6px solid #b9cad9; border-bottom: 0; }
.botanic { background: linear-gradient(150deg, #f0f7fa, #bed1df); }
.botanic::before, .botanic::after { content: ""; position: absolute; left: 49%; bottom: 4%; width: 1px; height: 80%; background: #47708a; transform: rotate(17deg); transform-origin: bottom; }
.botanic::after { transform: rotate(-20deg); height: 65%; }
.botanic i, .botanic b { position: absolute; z-index: 2; width: 19px; height: 36px; border-radius: 100% 0 100% 0; background: #7096ae; transform: rotate(34deg); }
.botanic i { left: 30%; top: 30%; }.botanic b { right: 23%; top: 48%; transform: scale(-1,1) rotate(34deg); }

.creation-form { position: relative; z-index: 8; display: grid; gap: 13px; margin-top: clamp(150px, 17vh, 188px); }
.upload-zone {
  position: relative;
  min-height: 138px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1.5px dashed var(--line-strong);
  border-radius: 72px 72px 18px 18px / 52px 52px 18px 18px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  box-shadow: inset 0 0 52px color-mix(in srgb, var(--blue-pale) 55%, transparent);
  transition: border-color 180ms ease, transform 220ms cubic-bezier(.2,.8,.2,1), background 180ms ease;
}
.upload-zone::before { content: ""; position: absolute; inset: 7px; border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: inherit; pointer-events: none; }
.upload-zone:hover, .upload-zone.is-over { transform: translateY(-2px); border-color: var(--blue); background: color-mix(in srgb, var(--blue-pale) 48%, var(--surface)); }
.upload-zone input { position: absolute; z-index: 4; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-copy { position: relative; z-index: 2; display: grid; justify-items: center; gap: 5px; padding: 20px; pointer-events: none; }
.upload-copy svg { width: 30px; height: 30px; margin-bottom: 2px; fill: none; stroke: var(--blue); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.upload-copy strong { color: var(--ink); font-size: 14px; font-weight: 610; }
.upload-copy span { color: var(--muted); font-size: 11px; }
.preview-strip { position: relative; z-index: 5; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 18px 24px; pointer-events: none; }
.preview-card { position: relative; width: 86px; aspect-ratio: 1; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-solid); box-shadow: var(--shadow-soft); pointer-events: auto; }
.preview-card:nth-child(2) { transform: translateY(5px) rotate(3deg); }.preview-card:nth-child(3) { transform: translateY(-3px) rotate(-3deg); }
.preview-card img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 5px; }
.preview-card button { position: absolute; z-index: 7; top: -7px; right: -7px; width: 24px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--surface-solid); box-shadow: var(--shadow-soft); line-height: 1; }
.scan-beam { position: absolute; z-index: 3; left: 4%; right: 4%; top: -3px; height: 2px; opacity: 0; background: var(--blue); box-shadow: 0 0 18px 5px rgba(23,107,255,.38); }
.upload-zone.is-busy .scan-beam { opacity: 1; animation: scan-zone 1.8s ease-in-out infinite; }
@keyframes scan-zone { 0% { top: 4%; } 50%,100% { top: 96%; } }

.mode-field { margin: 0; padding: 0; border: 0; }
.mode-field legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--ice) 44%, transparent); }
.mode-option { position: relative; min-height: 66px; display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 10px; padding: 10px 15px; border-radius: 10px; color: var(--ink-soft); cursor: pointer; transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 120ms ease; }
.mode-option:active { transform: scale(.985); }
.mode-option:has(input:checked) { color: var(--blue); background: var(--surface-solid); box-shadow: 0 5px 18px rgba(50,87,146,.11), inset 0 0 0 1px color-mix(in srgb, var(--blue) 26%, transparent); }
.mode-option input { position: absolute; opacity: 0; }
.mode-option strong, .mode-option small { display: block; }
.mode-option strong { font-size: 14px; font-weight: 650; }
.mode-option small { margin-top: 1px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.mode-icon { position: relative; width: 24px; height: 24px; }
.focus-icon::before, .focus-icon::after { content: ""; position: absolute; inset: 2px; border: 1.5px solid currentColor; }
.focus-icon::before { border-right: 0; border-bottom: 0; width: 7px; height: 7px; box-shadow: 12px 0 0 -1.5px var(--surface-solid), 12px 0 0 0 currentColor; }
.focus-icon::after { top: 14px; border-top: 0; border-right: 0; width: 7px; height: 7px; box-shadow: 12px 0 0 -1.5px var(--surface-solid), 12px 0 0 0 currentColor; }
.grid-icon { background: linear-gradient(currentColor 0 0) 2px 2px/8px 8px no-repeat, linear-gradient(currentColor 0 0) 14px 2px/8px 8px no-repeat, linear-gradient(currentColor 0 0) 2px 14px/8px 8px no-repeat, linear-gradient(currentColor 0 0) 14px 14px/8px 8px no-repeat; opacity: .88; }

.text-in-image { margin: 0; padding: 0; border: 0; }
.text-in-image legend { margin-bottom: 8px; color: var(--ink-soft); font-size: 10px; font-weight: 600; }
.text-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--ice) 44%, transparent); }
.text-switch label { min-height: 40px; display: grid; place-items: center; border-radius: 9px; color: var(--ink-soft); cursor: pointer; font-size: 13px; font-weight: 600; }
.text-switch label:has(input:checked) { color: var(--blue); background: var(--surface-solid); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 26%, transparent); }
.text-switch input { position: absolute; opacity: 0; }

.prompt-stack { display: grid; gap: 8px; }
.add-prompt { min-height: 40px; width: 100%; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--blue); background: transparent; font-size: 12px; font-weight: 600; }
.add-prompt:hover { background: color-mix(in srgb, var(--blue-pale) 55%, transparent); }
.add-prompt:disabled { opacity: .45; cursor: not-allowed; }
.prompt-remove { position: absolute; top: 10px; right: 12px; width: 28px; height: 28px; border: 0; border-radius: 50%; color: var(--muted); background: transparent; font-size: 18px; line-height: 1; }
.prompt-remove:hover { color: var(--danger); }

.prompt-hint { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.prompt-field { position: relative; min-height: 104px; padding: 13px 46px 11px 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); transition: border-color 180ms ease, box-shadow 180ms ease; }
.prompt-field:focus-within { border-color: var(--line-strong); box-shadow: none; }
.prompt-heading { display: flex; justify-content: space-between; gap: 18px; color: var(--muted); font-size: 10px; }
.prompt-heading label { color: var(--ink-soft); font-weight: 600; }
.prompt-heading b { color: var(--blue); font-weight: 600; }
.prompt-field textarea { width: 100%; height: 62px; resize: none; padding: 7px 0 0; border: 0; color: var(--ink); background: transparent; font-size: 13px; line-height: 1.55; }
.prompt-field textarea:focus-visible { outline: none; }
.prompt-field textarea::placeholder { color: color-mix(in srgb, var(--muted) 78%, transparent); }
.prompt-spark { position: absolute; right: 15px; bottom: 17px; width: 23px; height: 23px; fill: none; stroke: var(--blue); stroke-width: 1.35; }
.form-footer { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.prompt-seeds { min-width: 0; display: flex; gap: 7px; overflow: hidden; }
.prompt-seeds button { min-height: 36px; flex: none; padding: 0 12px; border: 1px solid transparent; border-radius: 999px; color: var(--blue); background: color-mix(in srgb, var(--blue-pale) 76%, transparent); font-size: 10px; white-space: nowrap; transition: border-color 160ms ease, transform 120ms ease, background 160ms ease; }
.prompt-seeds button:hover { border-color: var(--line-strong); background: var(--surface-solid); }.prompt-seeds button:active { transform: scale(.97); }.prompt-seeds button span { margin-right: 5px; }
.generate-button { min-width: 170px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 23px; padding: 0 20px; border: 0; border-radius: 10px; color: #fff; background: var(--blue); box-shadow: 0 14px 30px rgba(23,107,255,.25); font-size: 15px; font-weight: 650; transition: background 160ms ease, transform 140ms ease, box-shadow 180ms ease; }
.generate-button svg { width: 28px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 220ms ease; }
.generate-button:hover { background: var(--blue-deep); box-shadow: 0 18px 38px rgba(23,107,255,.32); transform: translateY(-1px); }.generate-button:hover svg { transform: translateX(4px); }.generate-button:active { transform: scale(.975); }.generate-button:disabled { opacity: .62; cursor: wait; transform: none; }
.form-status { min-height: 17px; margin: -5px 2px 0; color: var(--muted); font-size: 11px; }.form-status[data-kind="error"] { color: var(--danger); }

.output-space { position: relative; min-width: 0; min-height: max(900px, calc(100dvh - 70px)); overflow: hidden; isolation: isolate; color: var(--ink); background: transparent; }
.output-space::before, .output-space::after { display: none; }
.output-header { position: relative; z-index: 6; height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; color: var(--output-muted); font: 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.output-header p { display: flex; align-items: center; gap: 9px; margin: 0; }
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: #2c8cff; box-shadow: 0 0 0 5px rgba(44,140,255,.10), 0 0 18px #2c8cff; animation: pulse-dot 2s ease-out infinite; }
@keyframes pulse-dot { 50% { box-shadow: 0 0 0 9px rgba(44,140,255,0), 0 0 18px #2c8cff; } }
.output-stage { position: absolute; z-index: 2; inset: 80px 86px 118px 38px; display: grid; place-items: center; perspective: 1200px; }
.paper-halo { position: absolute; width: min(70%, 430px); aspect-ratio: 3/5; border: 1px solid color-mix(in srgb, var(--blue) 40%, transparent); background: color-mix(in srgb, var(--surface-solid) 23%, transparent); box-shadow: 0 0 35px 10px rgba(28,112,241,.15), 0 0 100px 20px rgba(28,112,241,.10); transform: rotate(-4deg) translate(-16px, 12px); }
.paper-halo::before, .paper-halo::after { content: ""; position: absolute; inset: 0; border: 1px solid color-mix(in srgb, var(--blue) 20%, transparent); background: color-mix(in srgb, var(--surface-solid) 18%, transparent); }
.paper-halo::before { transform: rotate(7deg) translate(28px,-12px); }.paper-halo::after { transform: rotate(3deg) translate(15px,-6px); }
.output-paper { position: relative; width: min(70%, 430px); aspect-ratio: 3/5; overflow: hidden; color: #334f76; background: #f8fbff; box-shadow: 0 0 0 1px rgba(157,197,255,.86), 0 0 22px 3px rgba(57,137,255,.35), 0 34px 70px rgba(40,78,138,.22); transform: rotateY(-2deg) rotateX(1deg); transition: transform 500ms cubic-bezier(.2,.8,.2,1); }
.output-paper:hover { transform: rotateY(0) rotateX(0) translateY(-3px); }
.output-paper::before { content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: .35; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E"); mix-blend-mode: multiply; }
.paper-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 30px; text-align: center; }
.paper-empty svg { width: 64px; height: 64px; margin-bottom: 7px; fill: none; stroke: #94b8e8; stroke-width: .7; animation: empty-spark 8s linear infinite; }
@keyframes empty-spark { to { transform: rotate(360deg); } }
.paper-empty strong { color: #35557d; font-size: 15px; font-weight: 650; }.paper-empty span { color: #8aa0bd; font-size: 10px; }
.output-paper img { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: contain; background: #f6f9ff; }
.paper-scan { position: absolute; z-index: 5; left: 0; right: 0; top: -4px; height: 2px; opacity: 0; background: #69b0ff; box-shadow: 0 0 16px 5px rgba(70,155,255,.48); }
.output-paper.is-busy .paper-scan { opacity: 1; animation: paper-scan 2s ease-in-out infinite; }
@keyframes paper-scan { 0% { top: 0; } 50%,100% { top: 100%; } }
.progress-rail { position: absolute; z-index: 5; top: 31%; right: 20px; width: 86px; display: grid; gap: 58px; margin: 0; padding: 0; list-style: none; }
.progress-rail::before { content: ""; position: absolute; left: 4px; top: 7px; bottom: 8px; width: 1px; background: var(--output-line); }
.progress-rail li { position: relative; display: grid; grid-template-columns: 10px 1fr; gap: 8px; color: var(--output-muted); }
.progress-rail i { position: relative; z-index: 2; width: 9px; height: 9px; margin-top: 3px; border: 1px solid color-mix(in srgb, var(--output-muted) 74%, transparent); border-radius: 50%; background: var(--output); transition: background 240ms ease, box-shadow 240ms ease, border-color 240ms ease; }
.progress-rail strong, .progress-rail small { display: block; white-space: nowrap; }.progress-rail strong { font-size: 12px; font-weight: 560; }.progress-rail small { margin-top: 3px; font-size: 8px; }
.progress-rail li.is-on { color: var(--output-ink); }.progress-rail li.is-on i { border-color: #4b9cff; background: #2b89ff; box-shadow: 0 0 0 4px rgba(43,137,255,.15), 0 0 16px #2b89ff; }
.output-footer { position: absolute; z-index: 6; left: 36px; right: 30px; bottom: 24px; min-height: 72px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; border-top: 1px solid var(--output-line); color: var(--output-muted); }
.output-footer > p { margin: 17px 0 0; max-width: 58%; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.output-actions { display: flex; align-items: flex-end; gap: 10px; }
.download-button, .output-actions summary { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--output-line); border-radius: 8px; color: var(--output-ink); background: color-mix(in srgb, var(--surface-solid) 48%, transparent); font-size: 10px; text-decoration: none; cursor: pointer; }
.output-actions details { position: relative; }.output-actions details pre { position: absolute; right: 0; bottom: 45px; width: min(360px, 70vw); max-height: 200px; overflow: auto; margin: 0; padding: 14px; border: 1px solid var(--output-line); border-radius: 8px; color: var(--output-ink); background: color-mix(in srgb, var(--output) 94%, transparent); box-shadow: 0 18px 50px rgba(30,69,126,.24); font: 10px/1.6 var(--mono); white-space: pre-wrap; }

@media (max-width: 1180px) {
  .composer { grid-template-columns: minmax(0, 60%) minmax(370px, 40%); }
  .creative-canvas { padding-left: 42px; padding-right: 36px; }
  .hero-copy h1 { font-size: 48px; }
  .inspiration-field { width: 64%; }
  .tile-a { width: 135px; height: 98px; }.tile-b { width: 154px; height: 112px; }.tile-c { display: none; }
  .prompt-seeds button:nth-child(3) { display: none; }
  .output-stage { left: 24px; }
}

@media (max-width: 820px) {
  .topbar { position: sticky; top: 0; height: calc(66px + env(safe-area-inset-top)); padding-left: 20px; padding-right: 20px; }
  .brand { font-size: 20px; }.brand-mark { width: 29px; height: 29px; }
  .topbar-meta { gap: 14px; }.connection #healthText { display: none; }.theme-track { width: 64px; height: 34px; }.theme-knob { width: 26px; height: 26px; }.theme-track svg { width: 13px; height: 13px; }html[data-theme="dark"] .theme-knob { transform: translateX(31px); }
  .composer { display: block; }
  .creative-canvas { min-height: 0; padding: 58px 20px 42px; overflow: hidden; }
  .creative-canvas::before { background-size: 32px 32px; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 21%, #000 59%, transparent 88%); mask-image: linear-gradient(to bottom, transparent, #000 21%, #000 59%, transparent 88%); }
  .coordinate-field { inset: 10px 11px 0; }.coordinate-field::before { bottom: 45%; }.coordinate-field::after { bottom: 45%; width: 92%; }.axis-x { left: 92%; bottom: calc(45% + 10px); }.axis-z { bottom: calc(45% + 12px); }.coordinate { display: none; }
  .hero-copy { max-width: none; }.eyebrow { margin-bottom: 16px; font-size: 10px; }.hero-copy h1 { max-width: 8.6em; font-size: clamp(40px, 12.2vw, 55px); line-height: 1.12; }.hero-note { display: none; }
  .inspiration-field { position: relative; top: auto; right: auto; width: calc(100% + 40px); height: 330px; margin: 4px -20px 0; }
  .orbit { inset: 12px -16% auto -24%; width: 142%; height: 286px; }.tile-a { width: 144px; height: 106px; left: 8%; top: 42%; }.tile-b { width: 132px; height: 98px; right: 11%; top: 16%; }.tile-c { display: none; }.cross-a { left: 2%; top: 29%; }.cross-b { right: 8%; top: 6%; }.cross-c { left: 49%; bottom: 7%; }
  .creation-form { margin-top: -14px; gap: 14px; }
  .upload-zone { min-height: 178px; border-radius: 50% 50% 20px 20px / 32% 32% 20px 20px; }.upload-copy { padding: 30px 18px 22px; }.upload-copy svg { width: 36px; height: 36px; }.upload-copy strong { font-size: 15px; }.upload-copy span { font-size: 10px; text-align: center; }.preview-card { width: 82px; }
  .mode-switch { border-radius: 18px; }.mode-option { min-height: 68px; padding: 9px 12px; border-radius: 14px; }.mode-option small { display: none; }
  .prompt-field { min-height: 132px; padding-top: 16px; }.prompt-field textarea { height: 82px; font-size: 14px; }
  .form-footer { display: grid; gap: 12px; }.prompt-seeds { overflow-x: auto; margin: 0 -20px; padding: 0 20px 4px; scrollbar-width: none; }.prompt-seeds::-webkit-scrollbar { display: none; }.prompt-seeds button { min-height: 38px; padding: 0 14px; font-size: 11px; }.prompt-seeds button:nth-child(3) { display: block; }.generate-button { width: 100%; min-height: 58px; border-radius: 13px; font-size: 17px; }
  .form-status { min-height: 14px; }
  .output-space { min-height: 790px; }.output-header { padding: 0 22px; }.output-stage { inset: 82px 36px 126px; }.output-paper, .paper-halo { width: min(74%, 360px); }.progress-rail { top: auto; right: 22px; bottom: 157px; width: auto; display: flex; gap: 26px; }.progress-rail::before { left: 4px; right: 4px; top: 7px; bottom: auto; width: auto; height: 1px; }.progress-rail li { grid-template-columns: 10px 1fr; }.progress-rail small { display: none; }.output-footer { left: 22px; right: 22px; }.output-footer > p { max-width: 50%; }
}

@media (max-width: 430px) {
  .creative-canvas { padding-top: 48px; }.hero-copy h1 { font-size: 42px; }.inspiration-field { height: 300px; }.tile-a { width: 130px; height: 95px; left: 5%; }.tile-b { width: 118px; height: 88px; right: 7%; top: 19%; }.upload-zone { min-height: 164px; }.mode-option { grid-template-columns: 26px 1fr; }.prompt-seeds button:nth-child(3) { display: none; }.output-space { min-height: 730px; }.output-stage { inset: 72px 28px 120px; }.output-paper, .paper-halo { width: min(78%, 315px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
