:root{font-family:ui-sans-serif,system-ui,sans-serif;color:var(--text-primary);background:var(--surface-0);font-synthesis:none;--purple:var(--accent)}*{box-sizing:border-box}body{margin:0}header,main,footer{max-width:1180px;margin:auto}header{padding:30px 28px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--border)}.brand{font-weight:850;font-size:25px;color:inherit;text-decoration:none;letter-spacing:-1px}.brand span{font-size:9px;letter-spacing:2px;margin-left:10px;color:var(--text-secondary)}.badge{font-size:12px;color:var(--text-secondary);border:1px solid var(--border);padding:8px 12px;border-radius:30px}main{padding:52px 28px}.intro{max-width:680px}.eyebrow{font-size:10px;font-weight:800;letter-spacing:2px;color:var(--purple)}h1{font-size:clamp(38px,5vw,62px);line-height:1.08;letter-spacing:-2.7px;margin:18px 0}p{line-height:1.65}.intro>p:last-child{max-width:560px;color:var(--text-secondary);font-size:16px}.studio{display:grid;grid-template-columns:1.05fr 1fr;gap:42px;margin-top:38px}.preview{background:var(--surface-2);border:1px solid var(--border);border-radius:22px;padding:24px;text-align:center}.preview-top{display:flex;justify-content:space-between;align-items:center;text-align:left;font-weight:700}.live{font-size:9px;letter-spacing:1px;color:var(--text-secondary)}.stage{height:310px;display:grid;place-items:center;background:radial-gradient(ellipse at center,var(--surface-2) 0,transparent 68%)}canvas{width:256px;height:256px;image-rendering:pixelated;max-width:100%;object-fit:contain}.moods{display:flex;gap:5px;background:var(--surface-2);padding:5px;border-radius:12px}.moods button{flex:1;font-size:11px;padding:10px 3px;border:0;background:transparent}.moods button[aria-pressed=true]{background:var(--surface-0);color:var(--purple);box-shadow:none}.quiet{border:0;background:transparent;color:var(--text-secondary);font-size:11px;margin-top:15px}.preview-note{font-size:10px;color:var(--text-secondary);margin-bottom:0}.controls{padding:8px 0}h2{font-size:27px;letter-spacing:-.8px;margin:10px 0 25px}label{display:flex;flex-direction:column;gap:8px;font-size:12px;font-weight:600;margin-bottom:17px}.pair{display:grid;grid-template-columns:1fr 1fr;gap:14px}input:not([type=color],[type=file]),select{min-width:0;width:100%;border:1px solid var(--border);border-radius:9px;padding:12px;background:var(--surface-0);color:var(--text-secondary);font:inherit;font-weight:400}fieldset{border:0;margin:2px 0 18px;padding:0}legend{font-size:12px;font-weight:600;margin-bottom:10px}.colors{display:flex;gap:12px}.colors label{flex:1;flex-direction:row;align-items:center;padding:10px;background:var(--surface-0);border:1px solid var(--border);border-radius:10px;font-size:10px;margin:0}input[type=color]{width:27px;height:28px;padding:0;border:0;background:none;cursor:pointer}button{font-family:inherit;cursor:pointer;border-radius:8px;color:inherit;font-weight:600}button:hover{filter:brightness(.96)}button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible{outline:3px solid var(--accent);outline-offset:3px}.primary{display:flex;justify-content:space-between;width:100%;padding:16px;background:var(--purple);border:0;color:var(--on-accent);margin:24px 0 10px;font-size:13px}.primary span{opacity:.75;font-size:11px}.secondary{display:flex;gap:10px}.secondary button{flex:1;background:transparent;border:1px solid var(--border);padding:12px;font-size:11px}.import{flex-direction:row;position:relative;justify-content:center;margin:19px 0 0;font-weight:400;color:var(--text-secondary);font-size:11px}.import span{color:var(--purple);text-decoration:underline}.import input{position:absolute;inset:0;opacity:0;width:100%;cursor:pointer}.import:focus-within{outline:3px solid var(--accent)}#status{min-height:2.5em;font-size:11px;text-align:center;color:var(--text-secondary)}.how{display:grid;grid-template-columns:repeat(3,1fr);gap:36px;margin-top:55px;border-top:1px solid var(--border);padding-top:30px}.how span{font-size:11px;color:var(--text-secondary);font-weight:800}.how h3{font-size:14px;margin:12px 0 5px}.how p{font-size:12px;color:var(--text-secondary);margin:0}footer{padding:26px 28px;border-top:1px solid var(--border);font-size:11px;color:var(--text-secondary);display:flex;justify-content:space-between}@media(max-width:760px){header{padding:22px}.brand span{display:none}main{padding:34px 20px}.studio{grid-template-columns:1fr;gap:28px}.stage{height:280px}.how{gap:18px}.colors{gap:7px}.colors label{padding:7px;font-size:9px}footer{gap:20px}.pair{grid-template-columns:1fr}.pair label{margin-bottom:0}.pair{margin-bottom:17px}h1{letter-spacing:-1.5px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}

[hidden]{display:none!important}a{color:var(--accent)}button:disabled{cursor:wait;opacity:.65}button:hover{filter:none;background-color:var(--surface-2)}.primary:hover{background:var(--accent-hover);color:var(--on-accent)}.header-actions{display:flex;gap:12px;align-items:center}#theme-toggle{background:var(--surface-1);border:1px solid var(--border-strong);padding:10px 13px;font-size:12px;min-height:44px}.prompt-link{max-width:350px;text-decoration:none;align-items:center;gap:15px}.intro .prompt-hint{font-size:13px;max-width:580px;color:var(--text-secondary)}.primary span{opacity:1}.sticker-button{width:100%;background:var(--surface-1);border:1px solid var(--border-strong);padding:14px;display:flex;justify-content:space-between;gap:12px;font-size:12px;color:var(--accent)}.export-note{font-size:11px;color:var(--text-secondary);margin:10px 0 18px}.stage{background:var(--surface-2);border-radius:12px;margin:14px 0}.moods button{min-height:44px}.quiet{min-height:44px}.preview-note{color:var(--text-muted)}.prompt-actions{display:flex;align-items:center;gap:24px}.prompt-actions .primary{width:auto;min-width:240px;margin:15px 0}#prompt-view{max-width:960px}#prompt-view>p{max-width:740px;color:var(--text-secondary)}.back-link{display:inline-block;margin-bottom:28px}.prompt-actions a{font-size:13px}#prompt-text{width:100%;min-height:65vh;resize:vertical;background:var(--code-bg);color:var(--text-primary);border:1px solid var(--border-strong);border-radius:12px;padding:22px;line-height:1.65;font:13px/1.65 ui-monospace,monospace}textarea:focus-visible{outline:3px solid var(--accent);outline-offset:3px}@media(max-width:760px){header{gap:10px;align-items:flex-start}.header-actions{flex-direction:column;align-items:flex-end;gap:6px}.badge{font-size:10px;padding:6px 8px}.how{grid-template-columns:1fr;gap:22px}.how h3{margin-top:6px}.prompt-actions{align-items:stretch;flex-direction:column;gap:8px;margin-bottom:20px}.prompt-actions .primary{margin-bottom:0}.colors label{flex-direction:column;font-size:11px}.export-note{font-size:12px}footer{flex-direction:column;gap:8px}.moods button{font-size:11px}.preview{padding:18px}.sticker-button{flex-wrap:wrap}}

.photo-section{margin-top:30px}.mode-switch,.photo-actions,.photo-inputs{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.photo-section button{min-height:44px;padding:10px 14px;border:1px solid var(--border-strong);background:var(--surface-1)}.photo-section .primary{background:var(--accent);color:var(--on-accent)}.mode-switch button[aria-pressed=true]{border-color:var(--accent);color:var(--accent);background:var(--surface-2)}#photo-editor{margin-top:22px;padding:24px;background:var(--surface-1);border:1px solid var(--border);border-radius:18px}.photo-workspace{display:grid;grid-template-columns:1fr 1fr;gap:30px}.photo-workspace>div{min-width:0}.photo-workspace h3{font-size:16px}.photo-section .small,.model-info p,#photo-status{font-size:12px;color:var(--text-secondary)}.photo-inputs label{margin:0;flex:1;min-width:220px}.photo-inputs input{max-width:100%;margin-bottom:12px}.model-info{padding:15px 0;font-size:13px}.model-info summary{cursor:pointer;min-height:36px}#photo-source{width:100%;height:auto;display:block;touch-action:none;image-rendering:auto;background:var(--surface-2);border:1px solid var(--border-strong);border-radius:6px}#photo-result{display:block;margin:14px auto;touch-action:none;background:repeating-conic-gradient(var(--surface-0) 0 25%,var(--surface-2) 0 50%) 0/16px 16px;border:1px solid var(--border-strong)}.photo-palette{display:flex;flex-wrap:wrap;gap:5px;margin:12px 0}.photo-palette button{min-height:32px;min-width:32px;padding:0;border:2px solid var(--border-strong)}.photo-section input[type=range]{padding:0;accent-color:var(--accent);min-height:30px}.photo-section .check{flex-direction:row;align-items:center;gap:8px}.photo-section input[type=checkbox]{width:auto;min-height:24px}.photo-section input[type=color]{min-width:44px;min-height:36px}#photo-progress{width:100%;margin-top:12px;accent-color:var(--accent)}#photo-status{min-height:3em}.photo-workspace canvas:focus-visible{outline:3px solid var(--accent);outline-offset:3px}.photo-actions{margin:10px 0}.photo-section output{color:var(--text-secondary)}
@media(max-width:760px){#photo-editor{padding:16px}.photo-workspace{grid-template-columns:1fr;gap:22px}.mode-switch button{flex:1}.photo-inputs{align-items:stretch;flex-direction:column}.photo-actions button{flex:1;font-size:12px}.photo-section input[type=file]{font-size:12px}}

.photo-art-wrap{position:relative;width:256px;max-width:100%;margin:14px auto}.photo-art-wrap #photo-result{margin:0}#photo-head-guide{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}#photo-simulation{font-size:12px;color:var(--text-secondary)}#photo-simulate,#photo-demo{margin:4px 4px 10px 0}#photo-head-status{min-height:2em}

.studio{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.studio>section{min-width:0}#species-fields .small{font-size:12px;color:var(--text-secondary)}@media(max-width:760px){.studio{grid-template-columns:minmax(0,1fr)}}

#theme-toggle{display:inline-flex;align-items:center;gap:9px;border:2px solid var(--accent);box-shadow:0 0 0 3px var(--surface-2);color:var(--accent);font-weight:700}#theme-toggle svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}@media(max-width:760px){#theme-toggle{padding:9px 11px;min-height:46px}}

/* Hidden mode roots must never retain layout or focusable descendants. */
#procedural-editor[hidden],#photo-output[hidden],.studio[hidden]{display:none!important}
#photo-output .studio{margin-top:28px}#photo-output .preview{align-self:start}.shared-recipe{display:flex;justify-content:flex-start}.shared-recipe .import{display:inline-flex;gap:6px;margin:12px 0 0;font-size:12px;min-height:32px}.shared-recipe .import input{max-width:100%}#photo-output .controls{min-width:0}
@media(max-width:760px){#photo-output .moods{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}#photo-output .moods button{min-width:0}#photo-output .stage{min-width:0}#photo-output #preview{max-width:100%;height:auto}}
