/* CLANKER COCK Studio. Shell for the video, photo, remix, upscale and cutout tools.
   One column on phones with a sticky render bar; rail + stage + controls on wide screens. */

.studio-body { overflow-x: hidden; }
.studio-body::before {
  /* fine grain over the whole page, so the glass panels have something to sit on */
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .32; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .5 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}
.studio { position: relative; z-index: 1; max-width: 1360px; margin: 0 auto; padding: 14px var(--gutter) 120px; display: grid; gap: 16px; }

/* ---------- glass ---------- */
.glass, .stage, .controls, .ctl-more {
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .015));
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 20px 60px rgba(0, 0, 0, .45);
}

/* ---------- tool rail ---------- */
.tool-rail { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px; margin: 0 calc(var(--gutter) * -1); padding-left: var(--gutter); padding-right: var(--gutter); scroll-snap-type: x proximity; }
.tool-rail::-webkit-scrollbar { display: none; }
.tool {
  flex: 0 0 auto; scroll-snap-align: start;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 14px 9px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); color: var(--ink-2);
  font-weight: 800; font-size: 13px; letter-spacing: .02em; line-height: 1;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease), box-shadow .25s var(--ease);
}
.tool-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .06); transition: inherit; }
.tool-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tool:hover { color: var(--ink); border-color: rgba(255, 191, 58, .45); transform: translateY(-1px); }
.tool[aria-pressed="true"] {
  color: var(--yellow-ink); border-color: transparent;
  background: linear-gradient(135deg, #ffd36e, #ffbf3a 55%, #f0a500);
  box-shadow: 0 10px 30px rgba(255, 191, 58, .28), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.tool[aria-pressed="true"] .tool-ico { background: rgba(26, 18, 0, .18); }
.tool[disabled] { opacity: .4; }

/* ---------- stage ---------- */
.stage { padding: 18px 16px 20px; min-width: 0; }
.stage-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.eyebrow { margin: 0 0 2px; font-size: 10.5px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: var(--yellow); }
.stage-head h1 { font-size: clamp(28px, 5vw, 40px); letter-spacing: -.03em; line-height: 1; background: linear-gradient(180deg, #fff, #c8c8d2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stage-blurb { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.online-pill { margin: 2px 0 0; flex-shrink: 0; font-size: 11px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); white-space: nowrap; }
.online-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); box-shadow: 0 0 0 3px rgba(255, 255, 255, .05); }
.online-pill.is-online { color: var(--green); }
.online-pill.is-online::before { background: var(--green); box-shadow: 0 0 10px rgba(182, 240, 168, .7); }
.online-pill.is-offline { color: var(--red); }
.online-pill.is-offline::before { background: var(--red); }
.online-pill:empty { display: none; }

.canvas {
  position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: min(68vh, 760px); margin: 0 auto;
  border-radius: 18px; overflow: hidden; background: #0a0a0d; border: 1px solid rgba(255, 255, 255, .07);
  display: grid; place-items: center;
  transition: aspect-ratio .3s var(--ease);
}
.canvas[data-state="done"] { border-color: rgba(255, 191, 58, .35); box-shadow: 0 0 0 1px rgba(255, 191, 58, .15), 0 30px 80px rgba(0, 0, 0, .6), 0 0 120px rgba(255, 191, 58, .08); }
.canvas[data-state="empty"]::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 50% at 50% 45%, rgba(255, 191, 58, .06), transparent 70%); }
@media (max-width: 1023px) { .canvas[data-state="empty"] { max-height: 42vh; } .canvas[data-state="rendering"] { max-height: 48vh; } }
.canvas[data-aspect="1:1"] { aspect-ratio: 1; }
.canvas[data-aspect="4:3"] { aspect-ratio: 4 / 3; }
.canvas[data-aspect="3:2"] { aspect-ratio: 3 / 2; }
.canvas[data-aspect="16:9"] { aspect-ratio: 16 / 9; }
.canvas[data-aspect="2:3"] { aspect-ratio: 2 / 3; }
.canvas[data-aspect="9:16"] { aspect-ratio: 9 / 16; }
.canvas[data-aspect="source"] { aspect-ratio: 1; }
.canvas.is-alpha { background-color: #15151b; background-image: linear-gradient(45deg, #1f1f27 25%, transparent 25%), linear-gradient(-45deg, #1f1f27 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #1f1f27 75%), linear-gradient(-45deg, transparent 75%, #1f1f27 75%); background-size: 22px 22px; background-position: 0 0, 0 11px, 11px -11px, -11px 0; }
.canvas-empty { display: grid; place-items: center; gap: 12px; text-align: center; color: var(--muted-2); font-size: 13.5px; padding: 24px; }
.canvas-empty p { margin: 0; max-width: 260px; line-height: 1.5; }
.canvas-glyph { width: 64px; height: 64px; border-radius: 20px; border: 1px dashed rgba(255, 255, 255, .18); position: relative; }
.canvas-glyph::after { content: ""; position: absolute; inset: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, rgba(255, 211, 110, .9), rgba(255, 191, 58, .15) 60%, transparent 70%); filter: blur(.4px); }
.canvas[data-state="rendering"] .canvas-empty, .canvas[data-state="done"] .canvas-empty { display: none; }
.canvas[data-state="rendering"]::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 191, 58, .07) 45%, rgba(94, 196, 255, .06) 55%, transparent 80%);
  background-size: 220% 100%; animation: shimmer 2.2s linear infinite;
}
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.canvas-progress { position: relative; display: grid; place-items: center; gap: 14px; text-align: center; padding: 20px; }
.ring { width: 72px; height: 72px; border-radius: 50%; position: relative; background: conic-gradient(var(--yellow) 0 25%, rgba(255, 255, 255, .07) 25% 100%); animation: spin 1.1s linear infinite; -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%); mask: radial-gradient(circle, transparent 58%, #000 60%); }
.progress-title { margin: 0; font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.progress-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.progress-steps li { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); padding: 5px 9px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .07); }
.progress-steps li.is-on { color: var(--yellow); border-color: rgba(255, 191, 58, .5); background: rgba(255, 191, 58, .08); }
.progress-steps li.is-done { color: var(--green); border-color: rgba(182, 240, 168, .3); }
.canvas-media { position: absolute; inset: 0; display: grid; place-items: center; animation: reveal .5s var(--ease); }
.canvas-media img, .canvas-media video { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; object-fit: contain; }
.canvas-media video { width: 100%; height: 100%; background: #000; }
@keyframes reveal { from { opacity: 0; transform: scale(.985); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

.status { min-height: 1.3em; margin: 12px 2px 0; font-size: 13.5px; color: var(--yellow); line-height: 1.45; }
.status.is-ok { color: var(--green); }
.status.is-err { color: var(--red); }
.status.is-busy { color: var(--ink-2); }
.status a { color: var(--blue); font-weight: 600; }
.result-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 12px; }
.chain { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chain-label { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.keep-note { margin: 10px 2px 0; font-size: 12px; color: var(--muted-2); }

.recent { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .07); }
.recent-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.recent-head h2 { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.recent-hint { font-size: 11.5px; color: var(--muted-2); }
.film { list-style: none; margin: 0 calc(-16px); padding: 0 16px 4px; display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.film::-webkit-scrollbar { display: none; }
.film:empty::after { content: "Nothing yet."; color: var(--muted-2); font-size: 13px; }
.frame { flex: 0 0 auto; scroll-snap-align: start; }
.frame button {
  display: grid; grid-template-rows: 96px auto; width: 128px; padding: 0; overflow: hidden; text-align: left;
  border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); color: var(--ink);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.frame button:hover { border-color: rgba(255, 191, 58, .6); transform: translateY(-2px); }
.frame.is-current button { border-color: var(--yellow); box-shadow: 0 0 0 1px var(--yellow); }
.frame-thumb { position: relative; display: grid; place-items: center; background: #0a0a0d; overflow: hidden; }
.frame-thumb img { width: 100%; height: 100%; object-fit: cover; }
.frame-thumb svg { width: 26px; height: 26px; fill: none; stroke: var(--muted-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.frame-state { position: absolute; left: 7px; top: 7px; font-size: 9.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; background: rgba(7, 7, 8, .75); color: var(--ink-2); border: 1px solid rgba(255, 255, 255, .1); }
.frame.job-running .frame-state, .frame.job-queued .frame-state { color: var(--yellow); }
.frame.job-failed .frame-state { color: var(--red); }
.frame.job-succeeded .frame-state { color: var(--green); }
.frame-meta { padding: 8px 9px 9px; font-size: 11.5px; line-height: 1.35; }
.frame-meta strong { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.frame-meta span { display: block; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- controls ---------- */
.controls { padding: 6px 16px 16px; display: grid; gap: 4px; min-width: 0; }
.ctl-group { padding: 14px 0 12px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.ctl-group:last-of-type { border-bottom: 0; }
.ctl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.ctl-head h2 { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.ctl-sub { font-size: 11.5px; color: var(--muted-2); text-align: right; }

.models { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.models.is-long { max-height: 380px; overflow-y: auto; overscroll-behavior: contain; padding: 2px 4px 2px 2px; align-content: start; }
.model-find { display: grid; gap: 8px; margin-bottom: 10px; }
.model-find input { height: 40px; padding: 0 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--ink); font: inherit; font-size: 16px; width: 100%; }
.model-filter { display: flex; gap: 6px; }
.model-filter small { color: var(--muted); font-weight: 600; }
.model-filter [aria-checked="true"] small { color: inherit; opacity: .7; }
.model {
  position: relative; display: grid; gap: 4px; align-content: start; padding: 11px 11px 10px; min-height: 92px; text-align: left;
  border-radius: 14px; background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .08); color: var(--ink);
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease), box-shadow .25s var(--ease);
}
.model:hover { border-color: rgba(255, 191, 58, .45); transform: translateY(-1px); }
.model[aria-checked="true"] { border-color: var(--yellow); background: linear-gradient(180deg, rgba(255, 191, 58, .13), rgba(255, 191, 58, .05)); box-shadow: 0 0 0 1px var(--yellow), 0 12px 30px rgba(255, 191, 58, .12); }
.model[aria-checked="true"]::after { content: ""; position: absolute; right: 10px; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 10px var(--yellow); }
.model-name { font-weight: 800; font-size: 13.5px; letter-spacing: -.01em; padding-right: 14px; line-height: 1.2; }
.model-tag { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.model-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 6px; gap: 6px; }
.badge { font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; }
.hot { display: inline-flex; align-items: center; height: 20px; }
.hot img { height: 20px; width: auto; filter: drop-shadow(0 0 6px rgba(255, 120, 0, .55)); }
.hot-inline { height: 13px; width: auto; vertical-align: -2px; margin-right: 2px; }
.model-price { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.model-price .coin { width: 14px; height: 14px; }
.model-price:empty { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 999px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .09); color: var(--ink-2); font-weight: 700; font-size: 13px; line-height: 1;
  transition: border-color .2s var(--ease), color .2s var(--ease), background .2s var(--ease);
}
.chip:hover { border-color: rgba(255, 191, 58, .5); color: var(--ink); }
.chip[aria-checked="true"] { color: var(--yellow-ink); background: var(--yellow); border-color: var(--yellow); }
.chip small { font-weight: 600; font-size: 11px; opacity: .75; }
.shape-glyph { display: inline-block; width: 14px; height: 14px; border: 1.6px solid currentColor; border-radius: 3px; box-sizing: border-box; opacity: .85; }
.shape-glyph[data-r="1:1"] { width: 14px; height: 14px; }
.shape-glyph[data-r="3:4"] { width: 12px; height: 16px; }
.shape-glyph[data-r="2:3"] { width: 11px; height: 16px; }
.shape-glyph[data-r="9:16"] { width: 9px; height: 16px; }
.shape-glyph[data-r="4:3"] { width: 16px; height: 12px; }
.shape-glyph[data-r="3:2"] { width: 16px; height: 11px; }
.shape-glyph[data-r="16:9"] { width: 16px; height: 9px; }

.starters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 10px; padding: 0 16px; }
.starters::-webkit-scrollbar { display: none; }
.starters:empty { display: none; }
.starter { flex: 0 0 auto; font-size: 12px; font-weight: 700; padding: 7px 11px; border-radius: 999px; color: var(--muted); background: transparent; border: 1px dashed rgba(255, 255, 255, .16); }
.starter:hover { color: var(--yellow-2); border-color: var(--yellow); }
.controls textarea { margin: 0; min-height: 112px; background: rgba(0, 0, 0, .28); border-radius: 14px; }
.controls input[type="text"] { margin: 0 0 10px; background: rgba(0, 0, 0, .28); }
.controls textarea:focus, .controls input[type="text"]:focus { background: rgba(0, 0, 0, .4); }

input[type="range"] { width: 100%; margin: 4px 0 2px; accent-color: var(--yellow); }
.range-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted-2); }

.drop {
  position: relative; display: grid; place-items: center; min-height: 150px; padding: 14px; text-align: center; cursor: pointer;
  border-radius: 16px; background: rgba(0, 0, 0, .25); border: 1px dashed rgba(255, 255, 255, .2); color: var(--muted);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.drop:hover, .drop.is-over { border-color: var(--yellow); background: rgba(255, 191, 58, .05); }
.drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-empty { display: grid; place-items: center; gap: 3px; font-size: 12.5px; }
.drop-empty svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 4px; opacity: .8; }
.drop-empty strong { color: var(--ink); font-size: 14px; }
.drop.has-file { padding: 8px; border-style: solid; border-color: rgba(255, 255, 255, .14); }
.drop.has-file .drop-empty { display: none; }
.drop img { max-height: 260px; width: auto; max-width: 100%; border-radius: 10px; display: block; }
.drop-clear { position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; padding: 0; border-radius: 50%; display: grid; place-items: center; font-size: 18px; line-height: 1; background: rgba(7, 7, 8, .8); border: 1px solid rgba(255, 255, 255, .15); color: var(--ink); z-index: 2; }
.linklike { margin-top: 8px; padding: 0; background: none; border: 0; color: var(--blue); font-size: 12.5px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.ctl-more { padding: 0; margin-top: 10px; border-radius: 14px; box-shadow: none; background: rgba(255, 255, 255, .02); }
.ctl-more summary { cursor: pointer; list-style: none; padding: 12px 14px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 800; display: flex; justify-content: space-between; align-items: center; }
.ctl-more summary::-webkit-details-marker { display: none; }
.ctl-more summary::after { content: "+"; font-size: 16px; line-height: 1; color: var(--muted-2); }
.ctl-more[open] summary::after { content: "–"; }
.more-body { padding: 2px 14px 10px; }
.agree-studio { margin: 14px 0 0; border-radius: 14px; background: rgba(0, 0, 0, .25); border-color: rgba(255, 255, 255, .1); font-size: 12.5px; }

.render-bar {
  position: sticky; bottom: 0; z-index: 20; margin: 14px -16px -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(10, 10, 13, .82); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  border-top: 1px solid rgba(255, 255, 255, .08); border-radius: 0 0 22px 22px;
}
.price { display: grid; gap: 2px; min-width: 0; }
.price-label { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.price strong { display: inline-flex; align-items: center; gap: 5px; font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.price strong .coin { width: 16px; height: 16px; }
.price-bal { font-size: 11px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.price.is-short strong { color: var(--red); }
.render-btn {
  flex-shrink: 0; min-width: 140px; padding: 14px 22px; border-radius: 999px; font-size: 13px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
  color: var(--yellow-ink); border: 0; background: linear-gradient(135deg, #ffd36e, #ffbf3a 55%, #f0a500);
  box-shadow: 0 10px 30px rgba(255, 191, 58, .3), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.render-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.render-btn:disabled { background: var(--panel-3); color: var(--muted); box-shadow: none; }

/* ---------- wide ---------- */
@media (min-width: 760px) {
  .studio { padding-top: 22px; }
  .models { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .studio { grid-template-columns: 92px minmax(0, 1fr) 400px; align-items: start; gap: 18px; padding-bottom: 60px; }
  .tool-rail { flex-direction: column; gap: 8px; margin: 0; padding: 0; overflow: visible; position: sticky; top: 88px; }
  .tool { width: 92px; flex-direction: column; justify-content: center; gap: 7px; padding: 12px 6px 10px; border-radius: 18px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
  .tool-ico { width: 36px; height: 36px; }
  .tool-ico svg { width: 19px; height: 19px; }
  .stage { padding: 22px 22px 24px; position: sticky; top: 88px; }
  .canvas { max-height: calc(100vh - 330px); }
  .film { margin: 0 -22px; padding: 0 22px 4px; }
  .controls { padding: 8px 18px 18px; }
  .models { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .render-bar { position: sticky; bottom: 12px; margin: 14px -18px -18px; padding: 12px 18px; border-radius: 0 0 22px 22px; }
  .starters { margin: 0 -18px 10px; padding: 0 18px; }
}
@media (min-width: 1280px) {
  .studio { grid-template-columns: 100px minmax(0, 1fr) 440px; gap: 22px; }
  .tool { width: 100px; }
  .models { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .canvas[data-state="rendering"]::before, .ring, .canvas-media { animation: none; }
}

.ref-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-bottom: 10px; }
.ref-picks[hidden] { display: none; }
.ref-pick { aspect-ratio: 1; padding: 0; border-radius: 12px; overflow: hidden; border: 2px solid var(--line-2); background: #000; cursor: pointer; }
.ref-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-pick.is-on { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 191, 58, .25); }
.drop[hidden] { display: none; }
.is-waiting { opacity: .55; }
.post-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.post-split select { width: 100%; height: 46px; padding: 0 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--ink); font: inherit; }
.price { flex: 1; }
.count-pick { position: relative; flex-shrink: 0; }
.count-pick select { appearance: none; -webkit-appearance: none; height: 44px; padding: 0 30px 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink); font: inherit; font-size: 15px; font-weight: 900; cursor: pointer; }
.count-pick::after { content: ""; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px; margin-top: -5px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.count-pick select:focus { outline: none; border-color: var(--yellow); }
@media (max-width: 380px) { .render-btn { min-width: 0; padding: 14px 18px; } }
.price { overflow: hidden; }
.price strong { flex-wrap: wrap; row-gap: 0; }
.price-bal { flex-basis: 100%; margin-left: 0; }
@media (max-width: 440px) {
  .render-bar { gap: 8px; }
  .render-btn { min-width: 0; padding: 14px 18px; }
  .count-pick select { padding: 0 26px 0 12px; }
  .count-pick::after { right: 11px; }
}

/* prompt presets */
.presets { margin-top: 10px; gap: 6px; }
.presets[hidden] { display: none; }
.chip.preset { padding: 6px 11px; font-size: 12px; }
.chip.preset[aria-pressed="true"] { color: var(--yellow-ink); background: var(--yellow); border-color: var(--yellow); }

/* long-form button: the icon is wide */
.tool-ico-wide { width: 52px; border-radius: 999px; }
.tool-ico-wide .ico-longform { font-size: 10px; }
a.tool, a.tool:hover { text-decoration: none; }

/* VR */
.vr-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; margin-right: 4px; border-radius: 6px; font-size: 10.5px; font-weight: 900; letter-spacing: .08em; color: #06121c; background: linear-gradient(135deg, #7fd6ff, #4aa8ff); }
.tool[hidden] { display: none; }

/* ---------- polish ---------- */
/* phones: the empty preview stays small so the controls are in reach */
@media (max-width: 1023px) {
  .canvas[data-state="empty"] { aspect-ratio: auto !important; height: 168px; max-height: none; }
  .canvas[data-state="empty"] .canvas-glyph { width: 48px; height: 48px; border-radius: 16px; }
  .canvas[data-state="empty"] .canvas-glyph::after { inset: 13px; }
}
.canvas { transition: border-color .3s var(--ease), box-shadow .3s var(--ease); }

/* the short pickers sit in pairs: Shape | Quality, Length | Sound */
.controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 14px; }
.controls > * { grid-column: 1 / -1; }
.controls > #g-shape, .controls > #g-quality, .controls > #g-length, .controls > #g-sound { grid-column: auto; }
.controls > #g-shape .chips, .controls > #g-quality .chips, .controls > #g-length .chips, .controls > #g-sound .chips { gap: 6px; }
@media (max-width: 380px) { .controls > #g-shape, .controls > #g-quality, .controls > #g-length, .controls > #g-sound { grid-column: 1 / -1; } }

/* section heads: a small gold tick before each */
.ctl-head h2 { display: inline-flex; align-items: center; gap: 8px; }
.ctl-head h2::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--yellow); box-shadow: 0 0 10px rgba(255, 191, 58, .6); transform: rotate(45deg); }

/* prompt */
.controls textarea { border: 1px solid rgba(255, 255, 255, .1); transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease); font-size: 16px; line-height: 1.5; }
.controls textarea:focus { outline: none; border-color: rgba(255, 191, 58, .7); background: rgba(0, 0, 0, .4); box-shadow: 0 0 0 4px rgba(255, 191, 58, .12); }

/* models */
.model { transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease); }
.model:active { transform: scale(.98); }

/* chips */
.chip { transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .15s var(--ease); }
.chip:active { transform: scale(.96); }

/* make it */
.render-btn { position: relative; overflow: hidden; transition: transform .2s var(--ease), filter .2s var(--ease), box-shadow .2s var(--ease); }
.render-btn:not(:disabled)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .45) 50%, transparent 65%); background-size: 250% 100%; animation: st-sheen 3.4s ease-in-out infinite; pointer-events: none; }
@keyframes st-sheen { 0% { background-position: 140% 0; } 55%, 100% { background-position: -140% 0; } }
.render-btn:not(:disabled):hover { box-shadow: 0 14px 40px rgba(255, 191, 58, .45), inset 0 1px 0 rgba(255, 255, 255, .55); }
.render-bar { box-shadow: 0 -18px 40px rgba(0, 0, 0, .45); }

/* the tool rail: the active tool glows */
.tool[aria-current="page"], .tool.is-on { box-shadow: 0 10px 30px rgba(255, 191, 58, .25); }

/* agreement */
.agree-studio { transition: border-color .2s var(--ease), background .2s var(--ease); }
.agree-studio:has(input:checked) { border-color: rgba(255, 191, 58, .45); background: rgba(255, 191, 58, .06); }

@media (prefers-reduced-motion: reduce) { .render-btn::after { animation: none !important; } }
/* a picker without its partner takes the whole row */
.controls > #g-length:has(+ #g-sound[hidden]), .controls > #g-shape[hidden] + #g-quality { grid-column: 1 / -1; }
