:root { --ink:#17151d; --muted:#6f6a78; --purple:#8e5892; --line:#e7e3e9; --accent:#8e5892; --tint:#f6eff6; --tint-line:#e2d3e3; --cta:#ca1765; font-family:"Manrope",sans-serif; color:var(--ink); background:#fff; font-synthesis:none; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; min-width:320px; min-height:100dvh; display:flex; flex-direction:column; background:linear-gradient(180deg,#fffafc 0,#fff 34rem); }
button,input,select { font:inherit; }
button,a,label,input { -webkit-tap-highlight-color:transparent; }
button { cursor:pointer; }
button:disabled { cursor:default; opacity:.45; }
button,a,input,select { touch-action:manipulation; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible { outline:3px solid var(--purple); outline-offset:3px; }
a { color:inherit; }
.studio-header { position:relative; z-index:20; }
main { width:100%; max-width:1320px; margin:0 auto; padding:44px 24px 64px; flex:1; overflow-x:clip; }
h1,h2,h3 { font-family:"Manrope",sans-serif; }
h1 { margin:0; font-size:clamp(32px,4vw,50px); font-weight:800; letter-spacing:-.05em; line-height:1; }
.page-intro > p { margin:12px 0 0; color:var(--muted); font-size:16px; line-height:1.6; }
.steps { display:flex; gap:8px; margin:30px 0; padding-bottom:24px; border-bottom:1px solid var(--line); }
.steps button { display:flex; gap:10px; align-items:center; border:0; background:none; padding:8px 18px 8px 0; min-height:44px; color:var(--muted); font-size:14px; font-weight:600; }
.steps button span { display:grid; place-items:center; width:28px; height:28px; border:1px solid var(--tint-line); border-radius:50%; font-size:12px; }
.steps button[aria-current="step"] { color:var(--accent); }
.steps button:disabled { opacity:1; }
.steps button:disabled span { opacity:.55; }
.steps button[aria-current="step"] span { background:var(--accent); color:#fff; border-color:var(--accent); }
.design-layout { display:grid; grid-template-columns:minmax(0,.95fr) minmax(0,1.15fr); gap:40px; align-items:start; }
.editor { min-width:0; }
h2 { margin:0; font-size:25px; letter-spacing:-.04em; font-weight:700; }
.section-copy { color:var(--muted); font-size:14px; line-height:1.6; margin:10px 0 23px; max-width:450px; }
.presets { display:flex; gap:8px; flex-wrap:wrap; }
.presets button { display:flex; align-items:center; gap:9px; min-height:44px; padding:8px 12px; border:1px solid var(--line); border-radius:10px; background:#fff; font-size:12px; font-weight:600; }
.preset-dots { display:flex; padding-right:3px; }
.preset-dots i { width:15px; height:15px; border-radius:50%; margin-right:-3px; border:1px solid white; }
.school-palettes { margin-top:12px; }
.selected-colors { display:flex; gap:8px; flex-wrap:wrap; padding:20px 0; min-height:76px; }
.selected-chip { display:flex; align-items:center; gap:7px; padding:5px 9px 5px 6px; background:var(--tint); border:1px solid var(--tint-line); border-radius:24px; min-height:36px; font-size:12px; }
.selected-chip i { width:22px; height:22px; border-radius:50%; border:1px solid #0001; }
.selected-chip b { font-size:17px; font-weight:400; color:var(--muted); }
.catalog-filters { display:flex; gap:10px; margin-bottom:14px; }
.search-label { flex:1; min-width:0; }
.catalog-filters input,.full-input { min-height:44px; border:1px solid var(--line); border-radius:10px; padding:10px 12px; background:#fff; color:var(--ink); font-size:14px; width:100%; }
.catalog-filters .select-menu { flex-shrink:0; width:150px; min-width:0; }
.catalog-colors { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; max-height:304px; overflow:auto; padding:3px; margin:-3px; }
.color-choice { display:flex; flex-direction:column; justify-content:flex-start; border:1px solid transparent; border-radius:10px; background:transparent; padding:7px; min-width:0; text-align:left; color:var(--ink); }
.color-choice:hover { background:var(--tint); }
.color-choice[aria-pressed="true"] { border-color:var(--accent); background:var(--tint); }
.color-choice i { display:block; height:48px; border-radius:7px; border:1px solid #0001; margin-bottom:7px; }
.color-choice small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.color-choice strong { display:-webkit-box; overflow:hidden; -webkit-box-orient:vertical; -webkit-line-clamp:2; font-size:12px; line-height:1.3; overflow-wrap:anywhere; }
.color-choice small { font-size:11px; color:var(--muted); margin-top:2px; }
.muted { color:var(--muted); font-size:12px; line-height:1.6; }
.editor-message { font-size:13px; color:#815034; line-height:1.5; }
.editor-message:empty { display:none; }
.editor-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; border-top:1px solid var(--line); padding-top:20px; margin-top:22px; }
.primary-button,.secondary-button { min-height:46px; border-radius:11px; padding:12px 18px; font-size:14px; font-weight:600; }
.primary-button { background:var(--cta); color:#fff; border:1px solid var(--cta); margin-left:auto; display:flex; align-items:center; gap:22px; }
.primary-button:hover { background:#a8114f; }
.secondary-button { background:#fff; border:1px solid var(--line); color:var(--accent); }
.text-button { min-height:44px; border:0; background:none; color:var(--accent); padding:8px 0; font-size:13px; font-weight:600; }
.preview { position:sticky; top:24px; min-width:0; }
.preview-picture { aspect-ratio:1 / 1.02; border-radius:20px; overflow:hidden; border:1px solid var(--tint-line); background:#f3eef3; }
.preview-picture svg { display:block; width:100%; height:100%; }
.preview-caption { display:flex; justify-content:space-between; gap:16px; align-items:center; padding:20px 0 16px; border-bottom:1px solid var(--line); }
.preview-caption h2 { font-size:18px; overflow-wrap:anywhere; }
.preview-caption p { margin:6px 0 0; font-size:12px; color:var(--muted); line-height:1.5; }
.preview-swatches { display:flex; flex-shrink:0; padding-left:6px; }
.preview-swatches i { display:block; width:25px; height:25px; border-radius:50%; border:2px solid #fff; margin-left:-6px; }
.preview-note { color:var(--muted); font-size:12px; line-height:1.6; }
.venue-upload { position:relative; min-height:230px; border:1.5px dashed #c9b2cb; border-radius:16px; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:12px; background:#fbf7fb; padding:20px; text-align:center; }
.venue-upload input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.venue-upload:focus-within { outline:3px solid var(--purple); outline-offset:3px; }
.venue-upload.dragging { border-color:var(--accent); background:#f1e5f1; }
.venue-upload svg { width:32px; height:32px; fill:none; stroke:var(--accent); stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
.venue-upload strong { font-size:15px; }
.venue-upload span { font-size:12px; color:var(--muted); }
.tip { background:#f7f4f7; border-radius:12px; padding:18px; margin-top:25px; font-size:13px; }
.tip strong { font-weight:600; }
.tip p { color:var(--muted); line-height:1.6; margin:6px 0 0; }
.field-label,legend { display:block; font-size:13px; font-weight:600; margin-bottom:10px; }
fieldset { padding:0; border:0; margin:24px 0; }
.option-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.design-option { position:relative; display:flex; flex-direction:column; align-items:center; border:1px solid var(--line); background:#fff; border-radius:12px; padding:18px 10px; cursor:pointer; }
.design-option input,.segmented input { position:absolute; opacity:0; }
.design-option:has(input:checked) { border-color:var(--accent); background:var(--tint); }
.design-option:has(input:focus-visible),.segmented label:has(input:focus-visible) { outline:3px solid var(--purple); outline-offset:3px; }
.design-option svg { width:70px; height:50px; fill:none; stroke:#c9b2cb; stroke-width:12; stroke-linecap:round; }
.design-option strong { margin-top:12px; font-size:13px; }
.design-option span { margin-top:5px; font-size:11px; color:var(--muted); }
.segmented { display:flex; padding:4px; background:#f3ecf3; border-radius:10px; }
.segmented label { flex:1; position:relative; text-align:center; cursor:pointer; }
.segmented span { display:block; padding:12px 5px; font-size:13px; border-radius:7px; }
.segmented input:checked + span { background:#fff; box-shadow:0 2px 5px #0001; }
.placement-controls { display:grid; grid-template-columns:120px 1fr; gap:15px; align-items:center; font-size:12px; }
.placement-controls input { width:100%; accent-color:var(--accent); }
.shop-color { display:grid; grid-template-columns:52px minmax(0, 1fr); gap:14px; align-items:center; padding:16px 0; border-top:1px solid var(--line); }
.shop-color > i { width:52px; height:58px; border-radius:10px; border:1px solid #0001; flex-shrink:0; }
.shop-color > div { flex:1; }
.shop-color h3 { font-size:14px; margin:0 0 5px; }
.shop-color p { font-size:12px; color:var(--muted); margin:0; }
.shop-color > a { padding:12px 0; font-size:12px; font-weight:700; color:var(--accent); text-underline-offset:4px; }
footer { display:flex; justify-content:space-between; gap:20px; border-top:1px solid var(--line); padding:24px max(24px,calc((100vw - 1272px)/2)); color:var(--muted); font-size:12px; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media(max-width:900px) { .design-layout { gap:24px; grid-template-columns:1fr 1fr; } .catalog-colors { grid-template-columns:repeat(3,minmax(0,1fr)); } .steps button { padding-right:8px; } }
@media(max-width:700px) {
  main { padding:28px 18px 40px; }
  .steps { justify-content:space-between; gap:3px; margin:22px 0; padding-bottom:18px; }
  .steps button { flex-direction:column; gap:6px; font-size:12px; padding:3px; }
  .design-layout { display:flex; flex-direction:column; gap:28px; }
  .editor,.preview { width:100%; } .preview { position:static; }
  .concept-ready .preview { order:-1; }
  .catalog-colors { grid-template-columns:repeat(3,minmax(0,1fr)); max-height:320px; }
  /* 16px keeps iOS Safari from zooming the page when a field is focused. */
  .catalog-filters { flex-wrap:wrap; } .catalog-filters > label { flex-basis:100%; } .catalog-filters .select-menu { display:block; width:100%; }
  .catalog-filters input,.full-input { font-size:16px; }
  h2 { font-size:23px; } .page-intro > p { font-size:14px; }
  .preview-picture { aspect-ratio:1; } .preview-caption { gap:8px; }
  footer { padding:20px 18px; flex-direction:column; gap:8px; }
}
@media(prefers-reduced-motion:no-preference) { button,a { transition:background .15s,border-color .15s; } }
textarea { font:inherit; width:100%; border:1px solid var(--line); border-radius:10px; padding:12px; resize:vertical; color:var(--ink); background:#fff; font-size:14px; line-height:1.5; }
textarea:focus-visible { outline:3px solid var(--purple); outline-offset:3px; }
@media(max-width:700px) { textarea { font-size:16px; } }
.design-field-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:20px 0; }
.design-field-grid .select-menu { display:block; width:100%; margin-top:8px; }
.design-field-grid .select-trigger { font-weight:500; }
.design-field-grid label { min-width:0; margin:0; }
.setting-options { display:grid; gap:10px; }
.setting-options label { display:flex; align-items:center; gap:10px; border:1px solid var(--line); border-radius:10px; min-height:48px; padding:12px; font-size:14px; cursor:pointer; background:white; }
.setting-options label:has(input:checked) { border-color:var(--accent); background:var(--tint); }
.setting-options input,.enhance-option input { accent-color:var(--accent); }
.enhance-option { display:flex; gap:10px; font-size:13px; line-height:1.5; align-items:start; margin:16px 0; }
.generation-privacy { border-left:3px solid #c9b2cb; padding-left:12px; font-size:12px; line-height:1.6; margin-top:24px; color:var(--muted); }
.generation-status:not(:empty) { margin:18px 0; padding:14px; border-radius:10px; background:var(--tint); color:var(--accent); font-size:14px; line-height:1.6; }
.result-actions { display:flex; flex-wrap:wrap; gap:10px; }
.result-actions a { display:inline-flex; align-items:center; text-decoration:none; }
.preview-picture { position:relative; }
.preview-picture > img { display:block; width:100%; height:100%; object-fit:contain; background:#f7f4f7; }
.generation-animation { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:24px; overflow:hidden; background:radial-gradient(ellipse at 28% 28%,#fffdf5 0,transparent 65%),linear-gradient(145deg,#f6eff6,#fbeef3); }
.loading-cluster { position:relative; width:260px; height:220px; flex-shrink:0; }
.loading-cluster::before { content:""; position:absolute; inset:30px 10px -10px; border:1px solid #ffffffa6; border-radius:50%; transform:rotate(-25deg); }
.loading-balloon { position:absolute; width:76px; height:88px; border-radius:49% 49% 47% 47%; background:radial-gradient(ellipse at 28% 22%,#ffffffa6,transparent 42%),radial-gradient(ellipse at 40% 30%,transparent 48%,#00000024 100%),var(--balloon-color); box-shadow:inset -2px -3px 5px #0000000a,0 12px 20px #8e58920e; animation:balloon-float 4.8s ease-in-out infinite; animation-delay:var(--delay); }
.loading-balloon::after { content:""; position:absolute; top:calc(100% - 2px); left:calc(50% - 4px); width:8px; height:7px; background:var(--balloon-color); clip-path:polygon(50% 0,100% 100%,0 100%); }
.loading-balloon:nth-child(1) { left:35px; top:55px; width:65px; height:75px; }
.loading-balloon:nth-child(2) { left:147px; top:24px; width:71px; height:82px; }
.loading-balloon:nth-child(3) { left:155px; top:105px; width:83px; height:96px; }
.loading-balloon:nth-child(4) { left:90px; top:2px; width:58px; height:67px; }
.loading-balloon:nth-child(5) { left:58px; top:120px; width:70px; height:81px; }
.loading-balloon:nth-child(6) { left:99px; top:61px; width:91px; height:105px; }
.loading-balloon:nth-child(7) { left:20px; top:145px; width:40px; height:47px; }
.loading-copy { position:relative; text-align:center; padding:0 20px; color:var(--accent); }
.loading-copy h3 { margin:0 0 10px; font-size:clamp(20px,2.4vw,28px); font-weight:500; letter-spacing:-.5px; }
.loading-copy p { margin:0 0 16px; font-size:14px; }
.loading-copy small { font-size:12px; color:var(--muted); }
@keyframes balloon-float { 0%,100% { transform:translateY(5px) rotate(-4deg); } 50% { transform:translateY(-10px) rotate(5deg); } }
@media(max-width:400px) { .generation-animation { gap:10px; } .loading-cluster { zoom:.8; } }
@media(prefers-reduced-motion:reduce) { .loading-balloon { animation:none; } }
.saved-designs { margin:40px 0 0; font-size:13px; color:var(--accent); }
.saved-designs summary { cursor:pointer; min-height:44px; padding:12px 0; }
.saved-design-list { display:flex; gap:10px; overflow-x:auto; padding:4px 0 12px; }
.saved-design-link { display:flex; flex:0 0 150px; flex-direction:column; gap:6px; padding:10px; text-decoration:none; border:1px solid var(--line); border-radius:10px; background:#fff; }
.saved-design-link img { width:128px; height:85px; object-fit:cover; border-radius:6px; }
.saved-design-link span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.saved-design-link small { color:var(--muted); }
#placementControls { margin-top:18px; }
@media(max-width:400px) { .design-field-grid { grid-template-columns:1fr; } }
.step-panel h2[tabindex="-1"]:focus { outline:none; }

.palette-summary { display:flex; align-items:center; gap:12px; margin:0 0 24px; padding:10px 12px 10px 18px; border:1px solid var(--tint-line); border-radius:14px; background:var(--tint); }
.summary-swatches { display:flex; flex-shrink:0; padding-left:8px; }
.summary-swatches i { display:block; width:30px; height:30px; margin-left:-8px; border:2px solid #fff; border-radius:50%; box-shadow:0 1px 3px #1f18271f; }
.palette-summary p { flex:1; min-width:0; margin:0; font-size:13px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.palette-summary .text-button { padding:8px 4px; }

/* Entrance from Color Studio, exit back to it (see lib/page-transition.mjs). */
@media(prefers-reduced-motion:no-preference) {
  html.leaving main,html.leaving footer { animation:studio-leave .24s ease-in forwards; }
  html.arriving .page-intro,html.arriving .steps,html.arriving .editor,html.arriving .preview { animation:studio-enter .55s cubic-bezier(.2,.8,.2,1) both; }
  html.arriving .steps { animation-delay:.05s; }
  html.arriving .editor { animation-delay:.1s; }
  html.arriving .preview { animation-delay:.16s; }
  html.arriving .summary-swatches i { animation:swatch-pop .5s cubic-bezier(.3,1.5,.5,1) both; animation-delay:calc(.25s + var(--i,0) * .07s); }
}
@keyframes studio-leave { to { opacity:0; transform:translateY(-10px); } }
@keyframes studio-enter { from { opacity:0; transform:translateY(16px); } }
@keyframes swatch-pop { from { opacity:0; transform:scale(.3) translateY(8px); } }
.image-download { position:absolute; top:14px; right:14px; display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:10px 16px; border-radius:99px; background:#ffffffeb; color:var(--ink); font-size:14px; font-weight:700; text-decoration:none; box-shadow:0 6px 20px #1f182726; backdrop-filter:blur(8px); }
.image-download:hover { background:#fff; color:var(--accent); }
.image-download svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }

/* Step changes: a progress line, completed-step checks, and panels that glide in. */
.steps { position:relative; }
.steps::after { content:""; position:absolute; left:0; bottom:-1px; height:2px; width:calc(var(--progress,.25) * 100%); border-radius:2px; background:var(--accent); transition:width .6s cubic-bezier(.2,.8,.2,1); }
.steps button span { position:relative; transition:background .3s,border-color .3s,color .3s,transform .3s; }
.steps button[aria-current="step"] span { transform:scale(1.08); }
.steps button.done span { background:var(--tint); border-color:var(--accent); color:transparent; }
.steps button.done span::after { content:""; position:absolute; inset:0; background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5.5 10.5 3 3L14.5 7' fill='none' stroke='%238e5892' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat; }
.steps button.done { color:var(--ink); }
@media(prefers-reduced-motion:no-preference) {
  .step-panel.entering > * { animation:step-in .5s cubic-bezier(.2,.8,.2,1) both; animation-delay:calc(var(--n,0) * 45ms); }
  .step-panel.entering.back > * { animation-name:step-in-back; }
  .palette-summary:not([hidden]) { animation:studio-enter .45s cubic-bezier(.2,.8,.2,1) both; }
  .preview-picture > img { animation:concept-in .8s ease both; }
}
@keyframes step-in { from { opacity:0; transform:translateX(22px); } }
@keyframes step-in-back { from { opacity:0; transform:translateX(-22px); } }
@keyframes concept-in { from { opacity:0; transform:scale(1.02); filter:blur(6px); } }

.toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); max-width:90vw; background:var(--ink); color:white; padding:12px 18px; border-radius:12px; z-index:50; }
.toast:empty { display:none; }
