:root {
  color-scheme: light;
  --ink: #191816;
  --muted: #74716a;
  --line: #dedbd4;
  --paper: #f5f2eb;
  --panel: #fffdf8;
  --violet: #7467db;
  --mint: #bce6d4;
  --peach: #f4bfad;
  --ease: cubic-bezier(.23, 1, .32, 1);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: var(--paper); }
button, input, textarea { font: inherit; }
button { color: inherit; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgba(116,103,219,.26); outline-offset: 2px; }

.site-header { position: sticky; z-index: 10; top: 0; min-height: 70px; padding: 0 clamp(20px, 4vw, 58px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; border-bottom: 1px solid rgba(222,219,212,.9); background: rgba(245,242,235,.86); backdrop-filter: blur(18px); }
.wordmark { justify-self: start; padding: 0; display: inline-flex; align-items: center; gap: 10px; border: 0; background: transparent; cursor: pointer; font-size: 17px; font-weight: 760; letter-spacing: -.035em; }
.mark { position: relative; width: 28px; height: 28px; display: block; }
.mark i { position: absolute; width: 19px; height: 23px; border: 1px solid rgba(25,24,22,.17); }
.mark i:first-child { left: 1px; top: 0; border-radius: 50% 48% 56% 44%; background: linear-gradient(145deg, rgba(255,255,255,.8), var(--mint)); transform: rotate(-12deg); }
.mark i:last-child { right: 0; bottom: 0; border-radius: 44% 56% 50% 50%; background: linear-gradient(145deg, rgba(255,255,255,.72), #c8bef2); transform: rotate(13deg); mix-blend-mode: multiply; }
.site-header nav { display: flex; align-self: stretch; gap: 25px; }
.worlds-nav-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: 12px; font-weight: 630; text-decoration: none; }
.nav-link { position: relative; padding: 0 2px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 630; transition: color 160ms var(--ease), transform 120ms var(--ease); }
.nav-link::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); transform: scaleX(0); transition: transform 180ms var(--ease); }
.nav-link.is-active { color: var(--ink); }
.nav-link.is-active::after { transform: scaleX(1); }
.nav-link span { margin-left: 4px; padding: 2px 6px; border-radius: 20px; background: #e7e2d9; font-size: 9px; }
.private-pill { justify-self: end; padding: 7px 10px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 30px; color: var(--muted); background: rgba(255,255,255,.52); font-size: 9px; }
.private-pill i { width: 7px; height: 7px; border-radius: 50%; background: #6fc198; box-shadow: 0 0 0 3px rgba(111,193,152,.13); }

main { min-height: calc(100vh - 70px); }
.view { display: none; }
.view.is-active { display: block; }
.home-view { padding: 54px clamp(20px, 5vw, 72px) 52px; background: radial-gradient(circle at 82% 10%, rgba(188,230,212,.46), transparent 27rem), radial-gradient(circle at 11% 42%, rgba(244,191,173,.22), transparent 25rem); }
.hero-copy { max-width: 820px; margin: 0 auto 34px; text-align: center; }
.eyebrow, .section-kicker { margin: 0 0 11px; color: var(--muted); font-size: 10px; font-weight: 760; letter-spacing: .15em; text-transform: uppercase; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
.hero-copy h1 { margin: 0; font-size: clamp(47px, 6vw, 70px); line-height: .98; letter-spacing: -.055em; }
.hero-lede { max-width: 690px; margin: 22px auto 0; color: #66625c; font-size: clamp(14px, 1.5vw, 17px); line-height: 1.65; }

.creator-shell { max-width: 1080px; margin: auto; display: grid; grid-template-columns: minmax(0, .92fr) minmax(420px, 1.08fr); overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,253,248,.9); box-shadow: 0 28px 80px rgba(62,56,47,.11); }
.source-panel, .intent-panel { padding: 27px; }
.source-panel { border-right: 1px solid var(--line); background: rgba(239,235,226,.52); }
.step-label { margin-bottom: 17px; display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; }
.step-label span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: white; font-size: 9px; }
.drop-zone { width: 100%; aspect-ratio: 1.04; padding: 0; display: grid; place-items: center; overflow: hidden; border: 1px dashed #b9b3aa; border-radius: 15px; background: rgba(255,253,248,.73); cursor: pointer; transition: border-color 160ms var(--ease), background-color 160ms var(--ease), transform 120ms var(--ease); }
.drop-zone:active { transform: scale(.99); }
.drop-zone.is-dragging { border-color: var(--violet); background: #f0edff; }
.drop-zone.is-loading { cursor: progress; opacity: .72; }
.drop-zone img { width: 100%; height: 100%; display: block; object-fit: contain; background: #ebe7df; }
.drop-content { display: grid; justify-items: center; gap: 8px; padding: 26px; }
.drop-content strong { font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 500; }
.drop-content small { color: var(--muted); font-size: 10px; }
.paste-icon { width: 56px; height: 50px; margin-bottom: 4px; display: grid; place-items: center; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 13px; background: white; box-shadow: 0 9px 22px rgba(46,42,36,.08); font-size: 14px; font-weight: 760; }
.privacy-line { margin-top: 12px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.privacy-line span { color: #68ae8b; font-size: 16px; }

.intent-panel { display: grid; align-content: start; gap: 17px; }
.field { margin: 0; padding: 0; display: grid; gap: 8px; border: 0; }
.field > span, .field legend { color: #514e48; font-size: 10px; font-weight: 700; }
.field small { color: #99948a; font-weight: 450; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: white; color: var(--ink); font-size: 12px; transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease); }
.field input { min-height: 42px; padding: 0 12px; }
.field textarea { padding: 10px 12px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { border-color: #9d978d; box-shadow: 0 0 0 3px rgba(25,24,22,.055); }
.choice-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 7px; }
.choice { min-height: 61px; padding: 8px 4px 7px; display: grid; place-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 9px; background: #fbfaf6; color: var(--muted); cursor: pointer; font-size: 9px; transition: color 160ms var(--ease), border-color 160ms var(--ease), background-color 160ms var(--ease), transform 120ms var(--ease); }
.choice.is-selected { border-color: #ada7a0; background: white; color: var(--ink); box-shadow: 0 5px 14px rgba(48,44,38,.05); }
.choice:active { transform: scale(.96); }
.choice i { width: 22px; height: 22px; display: block; }
.choice-color { border-radius: 50%; background: conic-gradient(var(--peach), #d7cdf7, var(--mint), #f4dd9b, var(--peach)); }
.choice-texture { border-radius: 6px; background: repeating-radial-gradient(circle at 30% 30%, #9a948a 0 1px, #e6e1d8 1px 4px); }
.choice-light { border-radius: 50%; background: radial-gradient(circle at 35% 32%, white 0 12%, #f5d698 22%, #b99be4 80%); box-shadow: 0 0 9px #edd59e; }
.choice-shape { border-radius: 35% 65% 55% 45%; background: var(--mint); transform: rotate(-12deg); }
.choice-ui { border: 1px solid #b5aea4; border-radius: 5px; background: linear-gradient(#d8cff3 0 32%, transparent 32% 100%); box-shadow: inset 0 -5px #efc2b4; }
.segment-control { padding: 3px; display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 9px; background: #eae6dd; }
.segment-control button { min-height: 34px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; transition: color 160ms var(--ease), background-color 160ms var(--ease), transform 120ms var(--ease); }
.segment-control button.is-selected { background: white; color: var(--ink); box-shadow: 0 3px 10px rgba(48,44,38,.08); font-weight: 700; }
.segment-control button:active { transform: scale(.97); }
.generate-button { min-height: 48px; margin-top: 2px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 10px; background: var(--ink); color: white; cursor: pointer; font-size: 12px; font-weight: 700; box-shadow: 0 8px 24px rgba(25,24,22,.17); transition: background-color 160ms var(--ease), transform 120ms var(--ease), opacity 160ms var(--ease); }
.generate-button:active { transform: scale(.985); }
.generate-button:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
.generate-button i { font-style: normal; font-size: 17px; }

.value-strip { max-width: 1080px; margin: 30px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.value-strip article { min-height: 73px; padding: 14px; display: flex; align-items: center; gap: 11px; border-right: 1px solid var(--line); }
.value-strip article:last-child { border-right: 0; }
.value-strip article > span { color: #aaa49a; font-family: Georgia, serif; font-style: italic; font-size: 12px; }
.value-strip div { display: grid; gap: 3px; }
.value-strip strong { font-size: 10px; }
.value-strip small { color: var(--muted); font-size: 8px; }

.result-view { min-height: calc(100vh - 70px); padding: 28px clamp(20px, 5vw, 72px) 70px; }
.result-topbar { max-width: 1160px; margin: auto; display: flex; justify-content: space-between; gap: 16px; }
.back-button { padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.result-actions { display: flex; gap: 8px; }
.button { min-height: 40px; padding: 0 14px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 10px; font-weight: 700; transition: transform 120ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease); }
.button:active { transform: scale(.97); }
.button.primary { color: white; background: var(--ink); }
.button.secondary { background: white; border-color: var(--line); }
.result-hero { max-width: 1160px; margin: 24px auto 0; display: grid; grid-template-columns: minmax(300px,.82fr) minmax(0,1.18fr); overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.result-reference { height: 354px; background: #e9e5dd; }
.result-reference img { width: 100%; height: 100%; display: block; object-fit: contain; }
.result-intro { padding: clamp(28px, 4vw, 49px); display: flex; flex-direction: column; justify-content: center; }
.result-intro h2 { margin: 0; font-size: clamp(34px, 4.2vw, 53px); line-height: 1; letter-spacing: -.05em; }
.result-intro > p:not(.eyebrow) { max-width: 610px; margin: 16px 0 20px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.large-palette { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { display: inline-flex; align-items: center; gap: 5px; }
.swatch i { width: 26px; height: 26px; display: block; border: 1px solid rgba(25,24,22,.1); border-radius: 50%; background: var(--color); box-shadow: inset 0 0 0 1px rgba(255,255,255,.23); }
.swatch small { color: var(--muted); font-size: 8px; font-variant-numeric: tabular-nums; }
.favorite-toggle { align-self: flex-start; margin-top: 20px; padding: 0; border: 0; background: transparent; color: #68645d; cursor: pointer; font-size: 10px; }
.result-tabs { max-width: 1160px; margin: 28px auto 0; display: flex; gap: 23px; border-bottom: 1px solid var(--line); }
.result-tabs button { min-height: 44px; padding: 0 1px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 680; }
.result-tabs button.is-active { border-bottom-color: var(--ink); color: var(--ink); }
.result-content { max-width: 1160px; margin: 24px auto 0; }
.dna-layout, .kit-grid { display: grid; grid-template-columns: minmax(350px,1.05fr) minmax(320px,.95fr); gap: 22px; }
.preview-card, .kit-preview, .signal-panel, .recipe-panel { min-width: 0; min-height: 390px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.preview-card { position: relative; overflow: hidden; background: var(--preview-bg); }
.preview-sky { position: absolute; inset: 0; overflow: hidden; }
.preview-sky::before { content: ''; position: absolute; left: -5%; right: -5%; bottom: -27%; height: 70%; border-radius: 50% 50% 0 0; background: var(--preview-primary); opacity: .5; }
.preview-sky span { position: absolute; width: 160px; height: 160px; left: 14%; top: 17%; border-radius: 45% 55% 60% 40%; background: var(--preview-surface); transform: rotate(17deg); box-shadow: 120px 90px 0 -35px var(--preview-accent); }
.preview-sky i { position: absolute; width: 90px; height: 90px; right: 13%; top: 12%; border-radius: 50%; background: var(--preview-accent); box-shadow: 0 0 70px var(--preview-accent); opacity: .82; }
.preview-sky b { position: absolute; width: 80px; height: 155px; right: 21%; bottom: 13%; border-radius: 48px 48px 13px 13px; background: linear-gradient(90deg, var(--preview-primary), var(--preview-surface)); transform: rotate(-8deg); box-shadow: -180px 25px 0 20px var(--preview-surface); }
.preview-ui { position: absolute; left: 20px; right: 20px; bottom: 20px; padding: 17px; display: grid; grid-template-columns: 1fr auto; align-items: end; border: 1px solid rgba(255,255,255,.48); border-radius: 13px; background: color-mix(in srgb, var(--preview-surface) 82%, transparent); color: var(--preview-ink); backdrop-filter: blur(12px); }
.preview-ui small { grid-column: 1; font-size: 7px; letter-spacing: .13em; }
.preview-ui strong { grid-column: 1; margin-top: 4px; font-family: Georgia, serif; font-size: 18px; font-weight: 500; }
.preview-ui button { grid-column: 2; grid-row: 1 / 3; min-height: 34px; padding: 0 13px; border: 0; border-radius: 8px; background: var(--preview-ink); color: var(--preview-surface); font-size: 9px; }
.signal-panel, .recipe-panel { padding: 25px; }
.signal-list { display: grid; }
.signal-list > div { padding: 11px 0; display: grid; grid-template-columns: 90px 1fr; gap: 12px; border-bottom: 1px solid var(--line); }
.signal-list span { color: var(--muted); font-size: 9px; text-transform: capitalize; }
.signal-list strong { font-size: 10px; font-weight: 600; }
.metric-row { margin-top: 20px; display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.metric-row > div { display: grid; gap: 5px; }
.metric-row span { color: var(--muted); font-size: 8px; text-transform: capitalize; }
.metric-row meter { width: 100%; height: 6px; accent-color: var(--violet); }

.kit-preview { position: relative; overflow: hidden; }
.two-d-preview { background: var(--gv-background); color: var(--gv-ink); }
.game-hud { position: absolute; z-index: 3; top: 18px; left: 18px; right: 18px; display: flex; justify-content: space-between; font-size: 9px; }
.game-hud span, .game-hud b { padding: 7px 10px; border-radius: var(--gv-radius); background: color-mix(in srgb, var(--gv-surface) 86%, transparent); box-shadow: 0 5px 15px color-mix(in srgb, var(--gv-ink) 10%, transparent); }
.sprite-scene { position: absolute; inset: 0; overflow: hidden; }
.cloud { position: absolute; width: 62px; height: 21px; border-radius: 20px; background: var(--gv-surface); opacity: .72; }
.cloud::before, .cloud::after { content: ''; position: absolute; bottom: 0; border-radius: 50%; background: inherit; }
.cloud::before { left: 12px; width: 28px; height: 28px; }.cloud::after { right: 8px; width: 20px; height: 20px; }
.cloud.one { left: 15%; top: 23%; }.cloud.two { right: 12%; top: 34%; transform: scale(.75); }
.hill { position: absolute; left: -12%; right: -12%; bottom: -35%; height: 76%; border-radius: 50% 50% 0 0; }
.hill.back { background: var(--gv-accent); opacity: .56; transform: translateX(25%); }
.hill.front { background: var(--gv-primary); transform: translateX(-16%); }
.player { position: absolute; left: 48%; bottom: 30%; width: 52px; height: 67px; display: grid; place-items: center; border-radius: 48% 52% 44% 56%; background: var(--gv-surface); color: var(--gv-accent); box-shadow: 0 9px 0 color-mix(in srgb, var(--gv-ink) 16%, transparent); font-size: 27px; }
.dialogue { position: absolute; z-index: 3; left: 18px; right: 18px; bottom: 18px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: var(--gv-outline) solid color-mix(in srgb, var(--gv-ink) 13%, transparent); border-radius: var(--gv-radius); background: var(--gv-surface); }
.dialogue strong { font-family: Georgia, serif; font-size: 13px; font-weight: 500; }
.dialogue button { min-height: 30px; padding: 0 10px; border: 0; border-radius: calc(var(--gv-radius) * .6); background: var(--gv-ink); color: var(--gv-surface); font-size: 8px; }
.recipe-panel dl { margin: 0; }
.recipe-panel dl > div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.recipe-panel dt { margin-bottom: 4px; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.recipe-panel dd { margin: 0; font-size: 10px; line-height: 1.5; }
.code-card, .budget-card { margin-top: 17px; padding: 13px; border-radius: 9px; background: #ebe7df; }
.code-card > span, .budget-card > span { display: block; margin-bottom: 8px; font-size: 8px; font-weight: 760; text-transform: uppercase; letter-spacing: .08em; }
.code-card code { white-space: pre-wrap; color: #5c5750; font-family: ui-monospace, monospace; font-size: 8px; line-height: 1.5; }
.budget-card p { margin: 5px 0; color: #5e5a53; font-size: 8px; line-height: 1.4; }
.three-d-preview { perspective: 700px; background: linear-gradient(var(--world-bg), var(--world-fog)); }
.world-plane { position: absolute; left: -20%; right: -20%; bottom: -26%; height: 64%; background: color-mix(in srgb, var(--world-primary) 44%, var(--world-surface)); transform: rotateX(62deg); box-shadow: inset 0 40px 90px rgba(255,255,255,.38); }
.world-sun { position: absolute; width: 110px; height: 110px; right: 12%; top: 11%; border-radius: 50%; background: var(--world-accent); box-shadow: 0 0 70px var(--world-accent); opacity: .75; }
.world-object { position: absolute; z-index: 2; background: var(--world-primary); filter: saturate(.92); box-shadow: -15px 25px 25px rgba(35,30,25,.15), inset 18px 15px 24px rgba(255,255,255,.35), inset -18px -15px 24px rgba(30,25,20,.1); }
.world-object.orb { left: 15%; bottom: 24%; width: 125px; height: 125px; border-radius: 50%; }
.world-object.block { left: 48%; bottom: 22%; width: 95px; height: 135px; border-radius: 18px; transform: rotateY(-18deg) rotateX(5deg); background: var(--world-surface); }
.world-object.arch { right: 8%; bottom: 23%; width: 115px; height: 150px; border-radius: 58px 58px 13px 13px; background: var(--world-accent); clip-path: polygon(0 0,100% 0,100% 100%,72% 100%,72% 43%,28% 43%,28% 100%,0 100%); }
.world-label { position: absolute; z-index: 3; left: 18px; bottom: 18px; padding: 10px 12px; display: grid; gap: 3px; border: 1px solid rgba(255,255,255,.46); border-radius: 9px; background: color-mix(in srgb, var(--world-surface) 70%, transparent); backdrop-filter: blur(10px); }
.world-label span { font-size: 7px; text-transform: uppercase; letter-spacing: .1em; }.world-label strong { font-size: 10px; }

.agent-layout { display: grid; grid-template-columns: minmax(260px,.65fr) minmax(440px,1.35fr); gap: 22px; }
.agent-layout > section, .agent-layout pre { min-height: 410px; margin: 0; padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.agent-layout h3 { margin: 0; font-size: 32px; line-height: 1.05; letter-spacing: -.04em; }
.agent-layout section > p:not(.section-kicker) { color: var(--muted); font-size: 11px; line-height: 1.65; }
.agent-layout pre { overflow: auto; background: #23211f; color: #e9e3d8; font: 9px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
.inline-copy { margin-top: 10px; }

.analysis-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr); gap: 22px; align-items: start; }
.description-panel { min-width: 0; padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.analysis-layout h3 { margin: 0 0 12px; font-size: 30px; line-height: 1.1; letter-spacing: -.025em; }
.analysis-note { color: #625d55; font-size: 12px; line-height: 1.65; }
.device-analysis { margin: 20px 0; padding: 17px; border: 1px solid var(--line); border-radius: 10px; background: #f1eee7; }
.device-analysis [role="status"] { margin: 0; font-size: 12px; line-height: 1.5; font-weight: 650; }
.analysis-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.analysis-layout .button { min-height: 44px; line-height: 1.4; padding: 10px 14px; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.download-consent { display: flex; align-items: center; min-height: 44px; gap: 10px; margin-bottom: 12px; font-size: 12px; line-height: 1.5; }
.download-consent input { width: 18px; height: 18px; flex: 0 0 auto; }
.description-editor summary { min-height: 44px; padding: 12px 0; cursor: pointer; font-size: 13px; font-weight: 700; }
.description-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; padding: 12px 0 20px; }
.description-fields .field > span { font-size: 12px; }
.description-fields textarea { min-height: 112px; font-size: 13px; }
.description-fields .field:last-child { grid-column: 1 / -1; }
.palette-evidence { display: grid; margin: 16px 0 20px; }
.palette-evidence > div { display: grid; grid-template-columns: 24px 70px 1fr; gap: 9px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.palette-evidence i { display: block; width: 24px; height: 24px; border: 1px solid #0002; border-radius: 6px; }
.palette-evidence span { color: #625d55; overflow-wrap: anywhere; }
.analysis-layout .signal-panel { min-height: 0; }
.agent-layout pre { overflow-wrap: anywhere; }

.library-view { padding: 58px clamp(20px, 5vw, 72px) 80px; }
.library-heading { max-width: 1160px; margin: auto; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.library-heading h1 { margin: 0; font-size: 52px; letter-spacing: -.05em; }
.library-toolbar { max-width: 1160px; margin: 28px auto 22px; display: flex; justify-content: space-between; gap: 14px; }
.search-field { width: min(420px,100%); min-height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--muted); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 11px; }
.favorite-filter { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; }
.style-grid { max-width: 1160px; margin: auto; display: grid; grid-template-columns: repeat(auto-fill,minmax(min(260px,100%),1fr)); gap: 19px; }
.style-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); cursor: pointer; box-shadow: 0 9px 30px rgba(55,50,43,.055); transition: transform 200ms var(--ease), box-shadow 200ms var(--ease); }
.style-card:active { transform: scale(.985); }
.style-image { position: relative; aspect-ratio: 1.15; background: #e8e4dc; }
.style-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
.style-image button { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.64); border-radius: 50%; background: rgba(255,255,255,.82); color: #db6573; backdrop-filter: blur(9px); cursor: pointer; }
.style-card-body { padding: 15px; }
.style-card-body > span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .11em; }
.style-card-body h2 { margin: 6px 0; font-size: 21px; letter-spacing: -.03em; }
.style-card-body p { min-height: 32px; margin: 0 0 12px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.mini-palette { display: flex; }
.mini-palette .swatch { margin-left: -4px; }.mini-palette .swatch:first-child { margin-left: 0; }
.mini-palette .swatch i { width: 18px; height: 18px; border: 2px solid var(--panel); }
.empty-library { max-width: 440px; margin: 14vh auto 0; text-align: center; }
.empty-library > span { font-size: 50px; color: #b4aea4; }.empty-library h2 { margin: 8px 0; font-size: 28px; }.empty-library p { color: var(--muted); font-size: 11px; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: 23px; padding: 11px 15px; border-radius: 9px; background: var(--ink); color: white; box-shadow: 0 10px 30px rgba(25,24,22,.22); font-size: 10px; opacity: 0; pointer-events: none; transform: translate(-50%,8px); transition: opacity 170ms var(--ease), transform 170ms var(--ease); }
.toast.is-visible { opacity: 1; transform: translate(-50%,0); }

@media (hover:hover) and (pointer:fine) {
  .nav-link:hover, .back-button:hover, .favorite-filter:hover { color: var(--ink); }
  .generate-button:hover, .button.primary:hover { background: #36332f; }
  .button.secondary:hover { background: #f2efe8; }
  .choice:hover { border-color: #aaa49a; }
  .style-card:hover { transform: translateY(-3px); box-shadow: 0 16px 42px rgba(55,50,43,.1); }
}

@media (max-width: 820px) {
  .site-header { grid-template-columns: 1fr auto; min-height: 64px; padding: 0 18px; background: #f5f2eb; backdrop-filter: none; }
  .site-header nav { position: fixed; z-index: 12; left: 0; right: 0; bottom: 0; height: 58px; justify-content: center; gap: clamp(20px, 6vw, 48px); border-top: 1px solid var(--line); background: rgba(250,248,243,.94); backdrop-filter: blur(18px); }
  .private-pill { display: none; }
  .home-view { padding: 52px 16px 84px; }
  .hero-copy { margin-bottom: 30px; }
  .hero-copy h1 { font-size: clamp(44px,13vw,62px); }
  .hero-lede { font-size: 13px; }
  .creator-shell { grid-template-columns: 1fr; border-radius: 17px; }
  .source-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .drop-zone { aspect-ratio: 1.35; }
  .intent-panel { padding-top: 23px; }
  .value-strip { grid-template-columns: repeat(2,1fr); margin-bottom: 20px; }
  .value-strip article:nth-child(2) { border-right: 0; }.value-strip article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .result-view { padding: 20px 16px 86px; }
  .result-hero { grid-template-columns: 1fr; }
  .result-reference { height: min(58vh,420px); }
  .result-tabs { overflow-x: auto; gap: 20px; scrollbar-width: none; }
  .result-tabs button { flex: 0 0 auto; }
  .dna-layout, .kit-grid, .agent-layout { grid-template-columns: 1fr; }
  .analysis-layout { grid-template-columns: 1fr; }
  .analysis-layout .signal-panel { grid-row: 1; }
  .preview-card, .kit-preview { min-height: 360px; }
  .agent-layout pre { min-height: 340px; }
  .library-view { padding: 38px 16px 92px; }
}

@media (max-width: 480px) {
  .wordmark { font-size: 16px; }
  .source-panel, .intent-panel { padding: 18px; }
  .choice-grid { grid-template-columns: repeat(5,minmax(52px,1fr)); overflow-x: auto; padding-bottom: 2px; }
  .choice { min-width: 58px; }
  .value-strip article { min-height: 66px; padding: 10px 8px; }
  .value-strip small { display: none; }
  .result-topbar { align-items: center; }
  .result-actions .secondary { display: none; }
  .result-intro { padding: 25px 19px; }
  .large-palette .swatch small { display: none; }
  .result-tabs { margin-top: 18px; }
  .preview-card, .kit-preview, .signal-panel, .recipe-panel { min-height: 330px; }
  .world-object.orb { width: 92px; height: 92px; }.world-object.block { width: 70px; height: 105px; }.world-object.arch { width: 82px; height: 117px; }
  .library-heading h1 { font-size: 40px; }.library-heading .button { display: none; }
  .library-toolbar { align-items: center; }.favorite-filter { flex: 0 0 auto; }
  .style-grid { grid-template-columns: 1fr; }
  .description-panel { padding: 19px; }
  .description-fields { grid-template-columns: 1fr; }
  .description-fields textarea { font-size: 16px; }
  .analysis-layout .signal-panel { padding: 19px; }
  .toast { bottom: 72px; max-width: calc(100vw - 32px); width: max-content; font-size: 12px; }
}

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