html:has(.studio-body) {
  height: auto;
  min-height: 100%;
}
.studio-body {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}
.studio-body {
  --bg: #f3f1fb;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-2: #ffffff;
  --line: rgba(92, 78, 168, 0.14);
  --ink: #241b3a;
  --muted: #6d6786;
  --blue: #6d72f5;
  --blue-2: #7a5af8;
  margin: 0;
  background:
    radial-gradient(820px 380px at 0% -10%, rgba(125, 148, 255, 0.35), transparent 55%),
    radial-gradient(720px 420px at 100% 0%, rgba(186, 140, 255, 0.32), transparent 50%),
    var(--bg);
  color: var(--ink);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
}
.studio-body a { color: inherit; text-decoration: none; }
.studio-body h1,
.studio-chrome-label {
  margin: 0;
  font-family: "DM Sans", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6b6288;
}
.studio-chrome-label {
  /* product chrome label — not the SEO H1 */
}
.studio-app {
  height: 100dvh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}
.studio-content {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 22px 56px;
  background: #fff;
  color: #1A1A1A;
  border-top: 1px solid rgba(92, 78, 168, 0.14);
}
.studio-content a {
  color: #2F5BB8;
  text-decoration: underline;
}
.studio-content h1 {
  font-family: "DM Sans", sans-serif;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  letter-spacing: -0.03em;
  text-transform: none;
  color: #1A1A1A;
  margin: 0 0 10px;
  font-weight: 700;
}
.studio-content .lede {
  color: #5c5c5c;
  font-size: 1.05rem;
  margin: 0 0 8px;
  line-height: 1.55;
}
.studio-content .section { padding: 18px 0; }
.studio-content h2 {
  font-family: "DM Sans", sans-serif;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: #1A1A1A;
  text-transform: none;
  margin: 0 0 10px;
}
.studio-content .prose p,
.studio-content .prose li { color: #5c5c5c; line-height: 1.55; }
.studio-content ol { padding-left: 1.2rem; margin: 0 0 12px; }
.studio-content .faq details {
  background: #faf8f4;
  border: 1px solid #e5e0d6;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.studio-content .faq summary {
  cursor: pointer;
  font-weight: 700;
  font-family: "DM Sans", sans-serif;
  color: #1A1A1A;
}

.top {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 0 22px;
  background: transparent;
}
#shortcut { margin-left: auto; }
.mode-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 220px));
  justify-content: center;
  gap: 14px;
  padding: 4px 22px 8px;
}
.mode, .ghost, .solid, .opt, .pick, .file, .card {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 72px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 18px;
  padding: 12px 10px;
  box-shadow: 0 10px 24px rgba(70, 48, 140, 0.06);
}
.mode b { font-family: "DM Sans", sans-serif; font-size: 1.02rem; letter-spacing: -0.02em; }
.mode span { color: var(--muted); font-size: 0.78rem; font-weight: 650; }
.mode.is-on {
  border-color: transparent;
  background: linear-gradient(135deg, #6d8bff, #9a6bff);
  color: #fff;
  box-shadow: 0 12px 24px rgba(122, 90, 248, 0.28);
}
.mode.is-on span { color: rgba(255, 255, 255, 0.88); }
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "DM Sans", sans-serif;
  font-weight: 750;
  letter-spacing: -0.03em;
}
.mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  background: linear-gradient(135deg, #6d8bff 0%, #9a6bff 100%);
}
.ghost, .solid {
  border-radius: 12px;
  padding: 8px 14px;
  font-weight: 700;
  white-space: nowrap;
}
.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
.solid {
  border: 0;
  background: linear-gradient(135deg, #6d8bff, #8b5cf6);
  color: #fff;
  box-shadow: 0 8px 18px rgba(122, 90, 248, 0.28);
}
.solid:disabled, .ghost:disabled { opacity: 0.4; cursor: default; }
.bench {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  min-height: 0;
  padding: 8px 22px 18px;
}
.pane { min-height: 0; }
.pane.in, .pane.out {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.drop {
  border: 1px dashed rgba(122, 90, 248, 0.35);
  border-radius: 18px;
  padding: 10px 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.72);
}
.drop.is-over { border-color: #7a5af8; background: #f3efff; }
.drop strong {
  display: block;
  font-family: "DM Sans", sans-serif;
  font-size: 1.05rem;
}
.drop p, .settings p, .meter p, .empty, #meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.pick {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #6d8bff, #8b5cf6);
  color: #fff;
  font-weight: 700;
}
.pick input { display: none; }
.files, .gallery {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
  justify-content: start;
}
.has-batch .drop,
.has-batch .out-head {
  height: 52px;
  min-height: 52px;
  flex-basis: 52px;
  flex-direction: row;
  gap: 10px;
  padding: 8px 12px;
}
.has-batch .drop p,
.has-batch .out-head p { display: none; }
.has-batch .drop strong { font-size: 0.95rem; }
.has-batch .pick { margin-top: 0; padding: 6px 12px; }
.drop, .out-head {
  height: 132px;
  min-height: 132px;
  flex: 0 0 132px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.out-head {
  border: 1px dashed rgba(122, 90, 248, 0.35);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}
.out-head[hidden] { display: none; }
.out-head strong { font-family: "DM Sans", sans-serif; font-size: 1.05rem; }
.card, .out-card {
  width: 100%;
  height: 86px;
  min-height: 86px;
  flex: 0 0 86px;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
}
.card {
  display: grid;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 8px 20px rgba(70, 48, 140, 0.06);
}
.meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card b, .out-card b {
  font-weight: 700;
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag { color: var(--muted); font-size: 0.75rem; }
.card.is-on { border-color: #7a5af8; box-shadow: 0 0 0 3px rgba(122, 90, 248, 0.16); }
.card.is-bad .tag { color: #b42318; }
.thumb {
  display: block;
  width: 68px;
  height: 68px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(120deg, #e7e4ff, #d9e6ff 45%, #f3e8ff);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.has-batch .card,
.has-batch .out-card {
  width: auto;
  height: auto;
  min-height: 0;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 6px;
  position: relative;
  grid-template-columns: none;
}
.has-batch .thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 10px;
}
.has-batch .meta { align-items: center; min-width: 0; }
.has-batch .card b,
.has-batch .out-card b {
  font-size: 0.68rem;
  text-align: center;
  width: 100%;
}
.has-batch .tag { display: none; }
.has-batch .is-wait .tag,
.has-batch .is-bad .tag {
  display: block;
  text-align: center;
  font-size: 0.66rem;
}
.has-batch .out-card .ghost {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 7px;
  font-size: 0.68rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}
.convert { width: 100%; min-height: 44px; }
.gallery[hidden], .convert[hidden] { display: none; }
.out-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 8px 20px rgba(70, 48, 140, 0.06);
}
.thumb { position: relative; }
.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 28%, rgba(255, 255, 255, 0.92) 50%, transparent 72%);
  transform: translateX(-140%);
  pointer-events: none;
}
.card.is-wait, .out-card.is-wait {
  animation: aura 1s ease-in-out infinite;
}
.is-wait .thumb::after { animation: sweep 0.85s ease-in-out infinite; }
.out-card.is-new {
  animation: pop 0.74s cubic-bezier(0.16, 0.84, 0.24, 1);
}
.out-card.is-new .thumb img {
  animation: develop 0.74s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.out-card.is-new::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 18px 4px rgba(154, 107, 255, 0.85), 0 0 36px 8px rgba(109, 139, 255, 0.45);
  animation: ring 0.74s ease-out;
  pointer-events: none;
}
.out-card.is-wait::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 18px;
  padding: 2px;
  background: conic-gradient(from var(--spin), transparent 0 55%, #fff 72%, #9a6bff 84%, #6d8bff 92%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spinborder 0.7s linear infinite;
  pointer-events: none;
}
.beam {
  position: fixed;
  left: 0;
  top: 0;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 80;
  background: #fff;
  box-shadow:
    0 0 10px 4px #fff,
    0 0 22px 8px #c084fc,
    0 0 42px 16px #6d8bff,
    -22px 0 18px 2px rgba(154, 107, 255, 0.8);
}
@property --spin {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
@keyframes develop {
  0% { clip-path: inset(0 100% 0 0); filter: brightness(2.4) saturate(0.15); }
  62% { clip-path: inset(0 0 0 0); filter: brightness(1.45) saturate(1.2); }
  100% { clip-path: inset(0 0 0 0); filter: none; }
}
@keyframes ring {
  0% { opacity: 1; transform: scale(0.72); }
  100% { opacity: 0; transform: scale(1.22); }
}
@keyframes spinborder {
  to { --spin: 360deg; }
}
.out-card.is-new .thumb::after { animation: sweep 0.72s ease-out 1; }
@keyframes sweep {
  to { transform: translateX(140%); }
}
@keyframes aura {
  50% { box-shadow: 0 0 0 3px rgba(122, 90, 248, 0.38), 0 0 26px rgba(154, 107, 255, 0.62); }
}
@keyframes pop {
  0% { opacity: 0; transform: scale(0.82) translateY(14px); filter: brightness(1.7) saturate(1.3); }
  58% { opacity: 1; transform: scale(1.05); filter: brightness(1.12); }
  100% { opacity: 1; transform: none; filter: none; }
}
@keyframes barflow {
  to { background-position: -220% 0; }
}
.out-card .ghost { padding: 6px 10px; }
.settings { display: grid; gap: 8px; }
.settings[hidden] { display: none; }
.settings label, .field {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  margin: 0;
}
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.84rem;
  font-weight: 700;
}
.opt.is-on { background: linear-gradient(135deg, #6d8bff, #9a6bff); color: #fff; border-color: transparent; }
.pane.out {
  display: flex;
}
.frame {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 12px;
  overflow: hidden;
  padding: 16px;
  box-shadow: 0 16px 36px rgba(70, 48, 140, 0.05);
}
.work {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.empty {
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  place-items: center;
  text-align: center;
  pointer-events: none;
}
.empty[hidden] { display: none; }
#shot {
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.stage {
  position: relative;
  touch-action: none;
  cursor: grab;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.stage:active { cursor: grabbing; }
.stage canvas { display: block; width: 100%; height: 100%; }
.oval {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 8%;
  bottom: 28%;
  border: 2px dashed rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.run[hidden] { display: none; }
.run {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
}
.run b {
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.9;
}
.run span {
  color: var(--blue);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
}
.meter { padding: 12px 2px 0; }
.bar {
  height: 4px;
  border-radius: 99px;
  background: #e6e1f5;
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #6d8bff, #c084fc);
  transition: width 0.35s ease;
}
.bar.is-run span {
  background-image: linear-gradient(90deg, #6d8bff, #ffffff, #c084fc, #6d8bff);
  background-size: 220% 100%;
  box-shadow: 0 0 16px rgba(154, 107, 255, 0.75);
  animation: barflow 0.7s linear infinite, glow 1.1s ease-in-out infinite;
}
@keyframes glow {
  50% { filter: brightness(1.45); }
}
.out-actions, .dock {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-height: 46px;
}
.dock .convert,
.out-actions .solid,
.out-actions .ghost {
  flex: 1 1 0;
  min-height: 46px;
}
.out-actions .ghost[hidden],
.out-actions .solid[hidden] { display: none; }
#meta { margin: 0; min-height: 0; font-family: "IBM Plex Mono", monospace; font-size: 0.78rem; }
#meta:empty { display: none; }
input[type="range"] { width: 100%; accent-color: #7a5af8; }
.stage { margin: auto; }
@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes sheen {
  50% { filter: brightness(1.08); opacity: 0.72; }
}

@media (max-width: 860px) {
  .bench { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); padding: 8px 12px 12px; }
  .mode-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 12px 6px; }
  .mode { min-height: 62px; padding: 10px 6px; }
  .mode span { display: none; }
  .top { padding: 8px 12px; }
  .files, .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
