@scope (.live-studio){
:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --elev: #f6f8fc;
  --line: #e6eaf2;
  --line-2: #d7deea;
  --text: #1a1d26;
  --muted: #5b6475;
  --faint: #8b93a3;
  --accent: #3d7eff;
  --accent-ink: #ffffff;
  --danger: #e23d3d;
  --ok: #1a9e63;
  --sans: "DM Sans", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;
  --check-a: #eceff4;
  --check-b: #ffffff;
  --shadow: 0 12px 40px rgba(28, 39, 64, 0.10);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
::selection { background: #d6e4ff; }

.wrap { width: min(1080px, calc(100% - 40px)); margin: 0 auto; }

.nav, .app-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 22px 40px 8px; border-bottom: 0; background: #fff;
}
.brand {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  font-weight: 700; letter-spacing: -0.04em; font-size: 20px;
  flex: none; white-space: nowrap;
}
.build {
  font-size: 12px; font-weight: 500; letter-spacing: 0;
  color: var(--muted); margin-left: 2px; flex: none;
}
.logo { width: 28px; height: 28px; border-radius: 8px; display: block; flex: none; }
.wipe {
  position: relative; width: min(228px, 48vw); margin: 0 auto;
  border-radius: 16px; overflow: hidden; box-shadow: var(--shadow);
  aspect-ratio: 3 / 4; background: #fff;
}
.wipe img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.wipe-cut { z-index: 1; }
.wipe-orig { z-index: 2; }
.wipe-bar {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 3px; z-index: 3; background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.12);
  opacity: 0;
}
.wipe.on .wipe-orig {
  animation: peel 1.85s cubic-bezier(.22,.7,.2,1) forwards;
}
.wipe.on .wipe-bar {
  animation: peel-bar 1.85s cubic-bezier(.22,.7,.2,1) forwards;
}@keyframes peel{
  from { clip-path: inset(0 0 0 0); }
  to { clip-path: inset(0 0 0 100%); }}@keyframes peel-bar{
  0% { left: 0%; opacity: 1; }
  88% { left: 100%; opacity: 1; }
  100% { left: 100%; opacity: 0; }}@media (prefers-reduced-motion: reduce){
  .wipe-orig { clip-path: inset(0 0 0 100%); }
  .wipe-bar { display: none; }}
.mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 14px; font-weight: 800;
}
.nav-links { display: flex; gap: 22px; align-items: center; flex: none; color: var(--muted); font-size: 14px; font-weight: 500; }
[data-auth] { display: flex; gap: 12px; align-items: center; }
.nav-links a:hover { color: var(--text); }
.nav-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.meter { font-family: var(--mono); font-size: 12px; color: var(--faint); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 22px; border-radius: 8px; border: 0;
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.btn-acc { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(61,126,255,.28); }
.btn-acc:hover { filter: brightness(1.06); }
.btn-ghost { background: #fff; border: 1px solid var(--line-2); color: var(--text); }
.btn-ghost:hover { background: var(--elev); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rb-hero .sub { margin: 0 0 28px; color: var(--muted); font-size: 19px; }

.rb-card {
  width: min(800px, calc(100% - 32px)); margin: 0 auto;
  background: #fff; border-radius: 22px; box-shadow: var(--shadow);
  padding: 48px 32px 40px; cursor: pointer;
  border: 1px solid var(--line);
  min-height: 240px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.rb-card.over { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.rb-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.rb-card .upload {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 34px; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 17px;
  box-shadow: 0 8px 20px rgba(61,126,255,.28); pointer-events: none;
}
.rb-card .hint { margin: 22px 0 0; color: var(--faint); font-size: 15px; }
.rb-card .note { display: block; margin-top: 8px; color: var(--faint); font-size: 13px; }

.checker, .thumb img, .stage, .shot img {
  background-color: var(--check-b);
  background-image:
    linear-gradient(45deg, var(--check-a) 25%, transparent 25%),
    linear-gradient(-45deg, var(--check-a) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--check-a) 75%),
    linear-gradient(-45deg, transparent 75%, var(--check-a) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.variants { display: flex; gap: 8px; padding: 8px; overflow-x: auto; }

.cut-overlay {
  position: absolute; left: 16px; right: 16px; bottom: 16px;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 8px; padding: 12px 14px;
  box-shadow: 0 10px 28px rgba(28,39,64,.12);
  text-align: left;
}
.cut-top {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13px; font-weight: 700; margin-bottom: 8px;
}
.cut-top #overlay-count { color: var(--muted); font-weight: 500; }

.track {
  height: 7px; background: #e8eef8; border-radius: 99px; overflow: hidden;
}
.track > i {
  display: block; height: 100%; width: 0;
  background: var(--accent);
  border-radius: inherit;
  transition: width .35s ease;
}

.rb-actions { display: flex; gap: 12px; justify-content: center; margin: 22px auto 8px; width: min(800px, 100%); flex-wrap: wrap; }

.batch {
  width: min(800px, 100%); margin: 8px auto 48px; text-align: left;
}
.progress-panel { margin: 0 2px 14px; }
.progress-row {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13px; color: var(--muted); margin-bottom: 8px;
}
#batch-label { font-weight: 700; color: var(--text); }

.thumbs {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.shot.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(61,126,255,.16); }
.shot-bar > i { display: block; height: 100%; background: var(--accent); width: 0; }
.shot-mark {
  position: absolute; top: 6px; right: 6px;
  width: 18px; height: 18px; border-radius: 99px;
  background: var(--ok); color: #fff;
  font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
}
.shot.err .shot-mark { background: var(--danger); }
.shot.add {
  display: grid; place-items: center;
  border: 1.5px dashed var(--line-2);
  background: var(--elev); color: var(--muted);
  font-size: 28px; font-weight: 400; box-shadow: none;
}
.shot.add:hover { border-color: var(--accent); color: var(--accent); background: #fff; }
.shot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.msg { margin-top: 12px; text-align: left; }
.msg-thread {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 132px; overflow: auto;
  margin-bottom: 8px;
}
.msg-thread:empty { display: none; }
.msg-bar {
  display: flex; align-items: center; gap: 8px;
  background: #f0f2f5; border-radius: 22px;
  padding: 4px 4px 4px 14px;
}
.msg-bar input,
.msg-bar input:focus {
  flex: 1; border: 0; background: transparent;
  padding: 8px 0; outline: none; box-shadow: none;
  font-size: 15px;
}
.msg-send {
  width: 44px; height: 44px; border: 0; border-radius: 99px;
  background: #0084ff; color: #fff;
  font-size: 16px; font-weight: 700; cursor: pointer;
  display: grid; place-items: center; flex: none;
}
.msg-send:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.msg-send:disabled { opacity: .4; cursor: default; }
.auth-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
input {
  background: #fff; border: 1px solid var(--line-2); border-radius: 8px;
  padding: 12px 14px; outline: none;
}
input:focus { border-color: var(--accent); }
.err { color: var(--danger); font-size: 13px; min-height: 1.2em; }

.gate { position: fixed; inset: 0; background: rgba(16,22,36,.45); display: grid; place-items: center; padding: 20px; z-index: 30; }
.gate[hidden] { display: none; }
.gate-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); }
.gate-card h2 { font-size: 28px; margin: 0 0 8px; letter-spacing: -0.045em; font-weight: 800; }
.gate-card p { color: var(--muted); }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); }
.card.hl { border-color: var(--accent); }
.card h3 { margin: 0; font-size: 14px; color: var(--muted); font-weight: 600; }
.price small { font-size: 14px; color: var(--muted); font-weight: 500; }
.was { font-size: 16px; color: var(--faint); text-decoration: line-through; margin-left: 8px; }
.card ul { margin: 0 0 20px; padding-left: 18px; color: var(--muted); }
.card .btn { width: 100%; }
.account-card .btn { width: auto; }
.hero-cta { margin-top: 20px; }
.lead { color: var(--muted); }@media (max-width: 700px){
  .nav, .app-nav { padding: 10px 12px; gap: 8px; }
  .brand { font-size: 14px; gap: 6px; }
  .logo { width: 20px; height: 20px; }
  .nav .meter { display: none !important; }}@media (max-width: 480px){
  .nav, .app-nav { padding: 8px 12px; }
  .brand { font-size: 13px; }}

/* Footer commun */
.foot {
  border-top: 1px solid var(--line);
  margin-top: 72px;
  padding: 44px 0 64px;
  background: #fff;
}
.foot-brand p { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.foot h4 {
  margin: 4px 0 12px; font-size: 13px; font-weight: 700;
  letter-spacing: 0.02em; color: var(--text);
}
.foot-col a { display: block; color: var(--muted); font-size: 14px; padding: 5px 0; }
.foot-col a:hover { color: var(--text); }@media (max-width: 700px){}
.hub-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 22px 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px;
  transition: box-shadow .15s ease;
}
.hub-card p { margin: 0; color: var(--muted); font-size: 14px; }
.hub-card .go { margin-top: 10px; color: var(--accent); font-weight: 700; font-size: 14px; }@media (max-width: 700px){}
.chip {
  border: 1px solid var(--line-2); background: #fff; color: var(--muted);
  border-radius: 99px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip.on { border-color: var(--accent); color: var(--accent); background: #f0f5ff; }
.gal-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.gal-tag {
  position: absolute; left: 10px; bottom: 10px; z-index: 2;
  background: rgba(255,255,255,.92); border: 1px solid var(--line);
  border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--muted);
}
.gal-meta p { margin: 0; color: var(--muted); font-size: 13px; }@media (max-width: 900px){}@media (max-width: 600px){}
.endpoints th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); }
.endpoints td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.endpoints code, pre code { font-family: var(--mono); font-size: 13px; }
.method { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--accent); }
pre {
  background: #0f1320; color: #dbe4ff; border-radius: 8px;
  padding: 18px 20px; overflow: auto; font-size: 13px; line-height: 1.55;
}
.api-note { color: var(--muted); font-size: 14px; }@media (prefers-reduced-motion: reduce){
  * { transition: none !important; }}

/* The glass vocabulary is scoped to the working studio, not shared pages. */
.glass-studio { --text:#102633; --muted:#49606f; --accent:#2366df; --faint:#526b79; --line:#ffffffa6; --check-a:#e1e9eb; --check-b:#f8fcfc; background:linear-gradient(125deg,#d8f3f5 0%,#e8edf4 48%,#cbd4ef 100%); min-height:100vh; }
.glass-studio * { letter-spacing:0; }
.glass-studio .nav { background:transparent; max-width:1280px; margin:auto; padding:20px 32px; }
.glass-studio .nav-links { gap:20px; }
.brand-dot,.studio-heading h1 span { color:var(--accent); }
.glass-studio .build { color:var(--muted); }
.eyebrow { margin:0 0 2px; color:var(--muted); font-size:13px; }
.studio-heading > p { margin:0; font-size:17px; color:var(--muted); }
.studio-workspace { display:grid; grid-template-columns:minmax(0,1fr) 340px; border:1px solid #ffffffbf; border-radius:24px; background:#ffffff38; backdrop-filter:blur(22px); box-shadow:0 24px 65px #24456716,inset 0 1px 0 #fff; overflow:hidden; }
.editor { padding:22px; min-width:0; }
.editor-heading { display:flex; gap:12px; justify-content:space-between; align-items:center; margin-bottom:16px; font-size:13px; }
#selected-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.format-tag { flex:none; font-size:11px; color:#38546c; }
.upload-stage { min-height:350px; display:grid; align-items:center; border:1px dashed #85a6b8; border-radius:14px; background:#ffffff38; }
.upload-stage.has-jobs { min-height:0; border-style:solid; border-color:#ffffffd9; }
.upload-stage.over { outline:3px solid var(--accent); background:#e4faff; }
#empty { padding:44px 12px; text-align:center; }
.glass-studio .btn { border-radius:8px; min-height:44px; padding:10px 16px; font-size:13px; }
.glass-studio .btn-acc { background:var(--accent); box-shadow:0 6px 16px #2366df25; }
#upload-button { min-height:52px; font-size:16px; padding:12px 26px; }
.hint { color:var(--muted); font-size:14px; margin:20px 0 4px; }
.note { color:var(--muted); font-size:12px; }
.result-preview { position:relative; height:350px; width:100%; border-radius:13px; overflow:hidden; }
#result { width:100%; height:100%; display:block; object-fit:contain; touch-action:pan-y; user-select:none; }
.glass-studio .variants { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); padding:0; gap:10px; margin:14px 0; overflow:visible; }
.glass-studio .variant { min-width:0; display:flex; align-items:center; justify-content:center; gap:10px; background:#ffffff65; border:1px solid #ffffffd9; border-radius:8px; padding:5px; font-size:12px; min-height:60px; }
.glass-studio .variant img { width:40px; height:46px; object-fit:contain; }
.glass-studio .variant.on { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent); background:#e9f4ffcf; }
.batch-nav { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; }
.image-navigation { display:flex; align-items:center; gap:8px; }
#image-count { min-width:40px; text-align:center; font-size:12px; font-variant-numeric:tabular-nums; }
.icon-button { height:44px; min-width:44px; border:1px solid #ffffffc9; border-radius:8px; background:#ffffff7a; cursor:pointer; font-size:20px; }
.swipe-control { display:flex; align-items:center; gap:8px; min-height:44px; cursor:pointer; font-size:12px; }
.swipe-control input { width:32px; height:20px; accent-color:var(--accent); cursor:pointer; }
.glass-studio .rb-actions { width:100%; margin:16px 0 0; justify-content:start; gap:8px; }
.glass-studio .btn-ghost { background:#ffffff65; border:1px solid #ffffffd9; }
.glass-studio button:disabled { opacity:.45; cursor:default; }
.glass-studio :focus-visible { outline:2px solid #144faf; outline-offset:3px; }
.glass-studio .batch { width:100%; margin:18px 0 0; }
.glass-studio .shot { width:62px; height:62px; border-radius:8px; }
.glass-studio .shot img { object-fit:contain; }
.glass-studio .track { height:4px; background:#bccedd80; }
.studio-status:empty { display:none; }
.studio-status,.job-error { font-size:13px; overflow-wrap:anywhere; }
.job-error { color:#8b2020; }
.studio-inspector { min-width:0; padding:22px; border-left:1px solid #ffffffc2; background:#ffffff2e; display:flex; flex-direction:column; }
.inspector-heading { display:flex; align-items:center; gap:12px; }
.assistant-mark { width:36px; height:36px; display:grid; place-items:center; border-radius:8px; background:#143e55; color:#c8f7ff; font-weight:800; box-shadow:inset 0 1px 0 #ffffff55; }
.inspector-heading h2 { font-size:15px; margin:0; }
.inspector-heading p { font-size:12px; margin:1px 0 0; color:var(--muted); }
.demo { text-align:center; padding:28px 0 22px; }
.glass-studio .wipe { width:174px; aspect-ratio:3/4; box-shadow:0 12px 24px #254f6b20; }
.demo p { font-size:14px; font-weight:700; margin:20px 0 4px; }
.demo > span { font-size:12px; color:var(--muted); }
.glass-studio .msg { margin-top:24px; }
.glass-studio .msg-thread { max-height:360px; min-height:110px; gap:12px; padding:3px; }
.glass-studio .bubble { font-size:13px; max-width:95%; border-radius:14px; padding:10px 12px; }
.glass-studio .bubble.me { background:#2366df; border-bottom-right-radius:6px; }
.glass-studio .bubble.bot { background:#ffffffa1; border:1px solid #ffffffc9; border-bottom-left-radius:6px; color:var(--text); }
.glass-studio .msg-bar { border:1px solid #ffffff; background:#ffffff8c; border-radius:8px; padding:4px 4px 4px 12px; }
.glass-studio .msg-bar input { min-width:0; width:100%; font-size:13px; }
.glass-studio .msg-send { border-radius:8px; background:var(--accent); }
.refine-scope,.refine-note { color:var(--muted); font-size:11px; line-height:1.5; }
.refine-note { margin:8px 0 14px; }
#retry-refine { width:100%; }
.inspector-footer { margin-top:auto; padding-top:24px; display:flex; justify-content:space-between; gap:12px; font-size:11px; color:var(--muted); flex-wrap:wrap; }
.studio-bottom p { font-size:13px; margin:0; color:var(--muted); }
.glass-studio .foot { background:#ffffff25; border-top:1px solid #ffffff8f; padding:24px 0; }
.glass-studio .foot .wrap { width:calc(100% - 48px); max-width:1168px; }
.glass-studio .foot-grid { gap:28px; }
.glass-studio .foot-brand p { font-size:12px; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.glass-studio .gate-card { max-width:calc(100vw - 32px); }@media (max-width:1000px){ .glass-studio .nav-extra { display:none; } .studio-workspace { grid-template-columns:minmax(0,1fr) 310px; } .glass-studio .nav { padding:16px 24px; }}@media (max-width:760px){ .glass-studio .nav { padding:12px 16px; gap:8px; } .glass-studio .nav-links { gap:12px; font-size:12px; } .glass-studio .nav .meter,.glass-studio .nav .build { display:none; } .glass-studio .brand { font-size:17px; gap:6px; } .studio-workspace { grid-template-columns:minmax(0,1fr); border-radius:18px; } .editor,.studio-inspector { padding:16px; } .studio-inspector { border-left:0; border-top:1px solid #ffffffb3; } .upload-stage { min-height:260px; } .result-preview { height:300px; } .demo { display:grid; grid-template-columns:90px 1fr; text-align:left; column-gap:20px; padding:20px 0 0; } .glass-studio .wipe { grid-row:span 2; width:90px; margin:0; } .demo p { align-self:end; margin:0 0 4px; } .demo > span { align-self:start; } .inspector-footer { padding-top:18px; } .glass-studio .variant { gap:4px; } .glass-studio .variant img { width:28px; height:36px; } .batch-nav #keep { flex:1; } .glass-studio .foot-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .glass-studio .foot-brand { grid-column:1/-1; }}@media (prefers-reduced-motion:reduce){ .glass-studio *, .glass-studio *::before,.glass-studio *::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }}}
/* The supplied landing is unchanged; working controls live in this scope. */
[hidden]{display:none!important}
#upload-button{font:inherit;border:0;cursor:pointer}
#stage.over{outline:3px solid var(--blue)}
.live-studio{--text:#102633;--muted:#49606f;--accent:#2366df;--line:#ffffffa6;--check-a:#e1e9eb;--check-b:#f8fcfc}
#live-studio{margin-bottom:64px;scroll-margin-top:24px;background:transparent}
#live-studio .upload-stage{min-height:0}
#live-studio .result-preview{height:350px}
#live-studio .studio-workspace{font-family:'DM Sans',sans-serif}
.live-studio .gate{position:fixed;inset:0;z-index:1000}
#studio-status:not(:empty){padding:8px}
:focus-visible{outline:2px solid #144faf;outline-offset:3px}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}