/*
 * СТАДИЯ 4.8.1 · Studio layout
 * Scoped to #image, #video, #audio and #chat via body.is-studio.
 * Tokens, proportions and backgrounds follow the supplied concept.html.
 */
body.is-studio {
  --bg: #131416;
  --surface: #1c1e21;
  --surface2: #23262a;
  --line: rgba(255, 255, 255, .07);
  --line2: rgba(255, 255, 255, .12);
  --text: #fff;
  --muted: #a8a8a8;
  --soft: #7f7f7f;
  --acid: #d1fe17;
  --acidHover: #dcff3d;
  --studio-glass: rgba(35, 38, 42, .82);
  --studio-lime-wash: rgba(209, 254, 23, .1);
  --studio-display: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.studio-expanded { overflow: hidden; }
body.is-studio .announcement,
body.is-studio .mobile-nav { display: none; }
body.is-studio #app { min-height: calc(100svh - 60px); }

/* The site's other navigation remains available through the more menu. */
body.is-studio .topbar {
  height: 60px;
  padding: 0 max(20px, calc((100vw - 1440px) / 2));
  gap: 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(19, 20, 22, .82);
  backdrop-filter: blur(22px);
}
body.is-studio .brand { gap: 9px; font-size: 17px; letter-spacing: -.04em; }
body.is-studio .brand strong { font-weight: 750; }
body.is-studio .brand img { width: 26px; height: 26px; filter: none; animation: brandOrbit 9s ease-in-out infinite; transform-origin:center; filter: drop-shadow(0 0 8px rgba(209,254,23,0.35)); }
body.is-studio .brand strong { background: linear-gradient(110deg,#fff 15%, var(--acid) 55%, #fff 85%); background-size:240% 100%; background-clip:text; -webkit-background-clip:text; -webkit-text-fill-color: transparent; animation: brandShine 7s linear infinite; }
@keyframes brandOrbit { 0%,100%{transform:rotate(-8deg) scale(1)} 50%{transform:rotate(12deg) scale(1.06)} }
@keyframes brandShine { 0%{background-position:100% 0} 100%{background-position:-100% 0} }
body.is-studio .brand::before {
  display: block;
  width: 38px; height: 38px; left: -6px; margin-top: -19px;
  border: 1.5px solid transparent;
  border-top-color: #c5ff69; border-bottom-color: #73e441;
  box-shadow: 0 0 18px rgba(180,255,90,.35);
  animation: brand-halo 6s linear infinite;
}
body.is-studio .brand::after {
  display: block; content: "✦"; left: 26px; top: 2px;
  color: #d7ff91; font-size: 11px; text-shadow: 0 0 9px rgba(168,250,107,.9);
  animation: brand-spark 2.7s ease-in-out infinite;
}
@keyframes brand-halo { to { transform: rotate(360deg); } }
@keyframes brand-spark { 50% { opacity: .25; transform: translate(3px,-3px) scale(.75); } }
@media (prefers-reduced-motion: reduce) { body.is-studio .brand::before, body.is-studio .brand::after { animation: none; } }
body.is-studio .nav-main { gap: 2px; }
body.is-studio .nav-main a,
body.is-studio .nav-main .nav-separator { display: none; }
body.is-studio .nav-main a[data-route="explore"],
body.is-studio .nav-main a[data-route="models"],
body.is-studio .nav-main a[data-route="prompts"],
body.is-studio .nav-main a[data-route="trending"] {
  display: inline-flex;
  padding: 7px 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}
body.is-studio .nav-main a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
body.is-studio .pricing-link[data-route="referral"] { display: none; }
body.is-studio .nav-actions { gap: 10px; }
body.is-studio .pricing-link,
body.is-studio .login-button,
body.is-studio .signup-button,
body.is-studio .account-button {
  min-height: 34px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 550;
}
body.is-studio .login-button { background: transparent; border: 1px solid var(--line2); color: #d3d4d5; }
body.is-studio .signup-button { background: var(--acid); color: #101302; }
body.is-studio .account-button { border: 1px solid var(--line2); background: #1c1e21; }
body.is-studio .account-button span { display: inline-block; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.is-studio .icon-button { background: transparent; border-color: var(--line2); color: var(--muted); }

/* One shared workspace; only the content and available controls vary by route. */
.studio-page { width: 100%; max-width: 1480px; margin: 0 auto; padding: 16px 20px 28px; }
.studio-shell.workbench {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  height: calc(100svh - 108px);
  min-height: 660px;
  max-height: 920px;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background: #1c1e21;
  isolation: isolate;
}
.studio-shell.is-expanded {
  position: fixed;
  inset: 0;
  z-index: 90;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  max-height: none;
  border: 0;
  border-radius: 0;
}
.studio-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  border-right: 1px solid var(--line);
  background: #18191c;
  z-index: 6;
}
.studio-rail-main,
.studio-rail-library,
.studio-rail-bottom { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; }
.studio-rail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 66px;
  min-height: 59px;
  padding: 8px 0;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #a8a8a8;
  font-size: 9.5px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -.015em;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.studio-rail-item svg { width: 21px; height: 21px; flex: none; }
.studio-rail-item:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.studio-rail-item.active { background: var(--studio-lime-wash); color: var(--acid); border-color: rgba(209, 254, 23, .22); }
.studio-rail-separator { width: 40px; height: 1px; margin: 8px 0; background: var(--line); }
.studio-rail-bottom { margin-top: auto; }

/* The five original concept images are served locally, not from an image CDN. */
.studio-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #0f1011; }
.studio-backdrop,
.studio-slide,
.studio-veil { position: absolute; inset: 0; pointer-events: none; }
.studio-backdrop { transition: opacity .3s; }
.studio-slide {
  background-size: cover;
  background-position: center;
  opacity: 0;
  animation: studio-fade 25s linear infinite;
  animation-delay: calc(var(--slide) * 5s - 1s);
}
@keyframes studio-fade {
  0% { opacity: 0; }
  4%, 20% { opacity: 1; }
  24%, 100% { opacity: 0; }
}
.studio-veil {
  z-index: 1;
  background:
    radial-gradient(70% 46% at 50% 31%, rgba(9,10,11,.62), rgba(9,10,11,.22) 62%, transparent 78%),
    radial-gradient(120% 80% at 50% 0%, rgba(19,20,22,.55), transparent 60%),
    linear-gradient(180deg, rgba(19,20,22,.55) 0%, rgba(19,20,22,.05) 34%, rgba(19,20,22,.35) 62%, rgba(15,16,17,.96) 100%);
}
.studio-stage.has-content .studio-backdrop { opacity: .18; }
.studio-stage.has-content .studio-veil { background: rgba(15,16,17,.68); }
.studio-shell .studio-stage-top {
  position: absolute;
  inset: 0 0 auto;
  z-index: 4;
  height: auto;
  min-height: 62px;
  padding: 14px 16px;
}
.studio-tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: rgba(16,17,19,.55);
  backdrop-filter: blur(14px);
}
.studio-tabs button {
  min-height: 26px;
  padding: 5px 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #a8a8a8;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.studio-tabs button.on { background: rgba(255,255,255,.1); color: #fff; }
.studio-tabs button:not(.on):hover { color: #fff; }
.studio-stage-actions { display: flex; align-items: center; gap: 8px; }
.studio-icon-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 7px;
  border: 1px solid var(--line2);
  border-radius: 9px;
  background: rgba(16,17,19,.5);
  color: #c9ccd0;
  backdrop-filter: blur(14px);
}
.studio-icon-button svg { width: 16px; height: 16px; }
.studio-icon-button:hover { border-color: rgba(255,255,255,.25); color: #fff; background: rgba(35,38,42,.75); }

.studio-shell .studio-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.studio-shell .studio-hero {
  position: absolute;
  top: 31%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: block;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 28px;
  text-align: center;
}
.studio-kicker { display: flex; align-items: center; justify-content: center; gap: 9px; margin-bottom: 16px; color: rgba(255,255,255,.62); font-size: 12px; line-height: 1.5; }
.studio-kicker b { color: #e9ebed; font-weight: 500; }
.studio-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 12px rgba(209,254,23,.7); flex: none; }
.studio-shell .studio-hero h1 { margin: 0; font-family: var(--studio-display); font-size: clamp(30px,3.6vw,52px); line-height: 1.06; font-weight: 650; letter-spacing: -.045em; text-transform: none; text-wrap: balance; }
.studio-shell .studio-hero h1 em { font-style: normal; background: linear-gradient(92deg,#eeffa7,#d1fe17 45%,#e1fe68); -webkit-background-clip: text; background-clip: text; color: transparent; }
.studio-shell .studio-hero p { max-width: 760px; margin: 16px auto 0; color: rgba(255,255,255,.62); font-size: 14px; line-height: 1.6; }

/* Compact prompt panel: the model controls and prices are the existing live ones. */
.studio-shell .studio-composer-zone {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 5;
  transform: translateX(-50%);
  width: min(880px,calc(100% - 40px));
  margin: 0;
  padding: 0;
  background: none;
  pointer-events: none;
}
.studio-suggestions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; pointer-events: auto; }
.studio-suggestions button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--line2); border-radius: 999px; background: rgba(20,21,24,.6); color: #d7dade; font-size: 11px; font-weight: 400; line-height: 1.3; backdrop-filter: blur(12px); transition: color .15s, background .15s; }
.studio-suggestions button svg { width: 12px; height: 12px; opacity: .7; }
.studio-suggestions button:hover { background: rgba(255,255,255,.1); color: #fff; }
.studio-shell .composer {
  position: relative;
  display: block;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 12px 12px 10px;
  border: 1px solid var(--line2);
  border-radius: 20px;
  background: var(--studio-glass);
  box-shadow: 0 24px 70px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(26px) saturate(140%);
  pointer-events: auto;
}
.studio-prompt-row { display: flex; align-items: flex-start; gap: 10px; padding: 4px 4px 10px; }
.studio-shell .studio-prompt-row textarea { flex: 1; display: block; width: auto; min-width: 0; height: 52px; min-height: 52px; max-height: 144px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: #fff; font-size: 14px; line-height: 1.5; resize: vertical; }
.studio-shell .studio-prompt-row textarea::placeholder { color: #85898f; opacity: 1; }
.studio-attach-button { display: grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; padding: 12px; border: 1px dashed rgba(255,255,255,.2); border-radius: 10px; background: transparent; color: #a8a8a8; }
.studio-attach-button svg { width: 17px; height: 17px; }
.studio-attach-button:hover,
.studio-attach-button[aria-expanded="true"] { color: var(--acid); border-color: rgba(209,254,23,.5); background: var(--studio-lime-wash); }
.studio-shell .composer-bottom { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: none; min-height: 0; padding: 10px 0 0; border-top: 1px solid var(--line); }
.studio-shell .composer-bottom .dock-controls { display: flex; flex: 0 1 auto; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.studio-shell .chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; min-height: 30px; max-width: 100%; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.05); color: #dfe2e5; font-size: 11px; font-weight: 500; line-height: 1; white-space: nowrap; }
.studio-shell .chip:hover { background: rgba(255,255,255,.1); }
.studio-shell .quick-chip small { display: none; }
.studio-shell .quick-chip strong { color: #dfe2e5; font-size: 11px; font-weight: 500; }
.studio-shell .studio-model-chip { gap: 7px; padding-left: 7px; border-color: var(--line2); background: rgba(255,255,255,.08); }
.studio-model-chip > span:not(.studio-model-dot) { max-width: 154px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-model-chip > svg { width: 12px; height: 12px; opacity: .65; flex: none; }
.studio-model-dot { display: grid; place-items: center; flex: none; width: 14px; height: 14px; border-radius: 4px; background: linear-gradient(135deg,#d1fe17,#5fe08b); color: #0c1503; font-size: 8px; font-weight: 800; }
.studio-shell .composer .generate-button {
  position: static;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 10px;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 34px;
  max-height: none;
  margin-left: auto;
  padding: 8px 13px;
  transform: none;
  border: 0;
  border-radius: 9px;
  background: var(--acid);
  color: #0d1002;
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
  line-height: 1.25;
  box-shadow: 0 0 0 1px rgba(0,0,0,.2), 0 6px 22px rgba(209,254,23,.18);
}
.studio-shell .composer .generate-button:hover:not(:disabled) { background: var(--acidHover); }
.studio-shell .composer .generate-button > span { display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; font-size: 12px; }
.studio-shell .composer .generate-button > span svg { width: 13px; height: 13px; flex: none; fill: currentColor; stroke-width: 0; }
.studio-shell .composer .generate-button small { display: block; width: auto; max-width: 205px; padding-left: 10px; border-left: 1px solid rgba(13,16,2,.22); color: inherit; font-size: 10px; font-weight: 550; line-height: 1.3; text-align: left; text-transform: none; overflow-wrap: anywhere; overflow: visible; -webkit-line-clamp: unset; opacity: .72; }
.studio-shell .composer .generate-button small span { display: block; font-size: 8px; line-height: 1.3; white-space: nowrap; }
.studio-shell .composer .generate-button:disabled { background: #35383a; color: #c6c9c7; box-shadow: none; opacity: 1; }
.studio-shell .composer .generate-button:disabled small { border-left-color: var(--line2); }
.studio-shell .composer-hint { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 9px auto 0; color: rgba(255,255,255,.43); font-size: 10px; line-height: 1.4; pointer-events: auto; }
.studio-shell .composer-hint > span { display: inline-flex; align-items: center; gap: 4px; }
.studio-shell .composer-hint b { font-weight: 500; color: rgba(255,255,255,.66); }
.studio-shell .composer-hint kbd { padding: 0; font: inherit; color: rgba(255,255,255,.66); }
.studio-shell .attachment-strip { max-height: 82px; overflow-y: auto; padding: 0 4px 10px; }
.studio-shell .attached { max-width: 100%; border-color: var(--line2); background: rgba(255,255,255,.05); }
.studio-shell .attached b { background: rgba(209,254,23,.12); color: var(--acid); }
.studio-shell .attached button { background: rgba(255,255,255,.05); }
.studio-shell .composer.drop-active { background: rgba(35,44,24,.95); }

/* Same settings schemas and data-actions as the original app. */
.studio-shell .popover { left: 0; right: auto; bottom: calc(100% + 12px); width: min(520px,100%); min-width: min(290px,100%); max-height: min(540px,var(--studio-popover-max,60svh)); padding: 16px; border: 1px solid rgba(255,255,255,.15); border-radius: 16px; background: rgba(28,30,33,.98); box-shadow: 0 22px 70px rgba(0,0,0,.65); backdrop-filter: blur(24px); scrollbar-width: thin; scrollbar-color: #4a4d50 transparent; }
.studio-shell .popover.wide { width: min(620px,100%); }
.studio-shell .quick-popover { width: min(320px,100%); }
.studio-shell .popover-title { color: #e7e9eb; font-size: 13px; font-weight: 600; }
.studio-shell .popover-title button { border: 1px solid var(--line2); background: rgba(255,255,255,.04); color: #afb2b6; }
.studio-shell .model-search { border-color: var(--line2); background: #151719; font-size: 12px; }
.studio-shell .model-list { max-height: min(340px,calc(var(--studio-popover-max,500px) - 92px)); scrollbar-width: thin; }
.studio-shell .model-option { border-radius: 9px; font-size: 12px; }
.studio-shell .model-option strong { font-size: 12px; font-weight: 550; }
.studio-shell .model-option small { color: #9fa3a7; }
.studio-shell .model-option:hover { background: rgba(255,255,255,.05); }
.studio-shell .model-option.selected { border-color: rgba(209,254,23,.22); background: var(--studio-lime-wash); }
.studio-shell .model-option-icon { border-radius: 8px; background: rgba(255,255,255,.06); color: #b5b9bd; }
.studio-shell .model-option.selected .model-option-icon { color: var(--acid); }
.studio-shell .quick-option { padding: 11px 12px; border-radius: 9px; font-size: 13px; font-weight: 500; }
.studio-shell .quick-option:hover,
.studio-shell .quick-option.selected { background: rgba(255,255,255,.06); }
.studio-shell .mode-list button { border-color: var(--line2); font-size: 11px; font-weight: 500; }
.studio-shell .mode-list button.active { background: var(--studio-lime-wash); border-color: rgba(209,254,23,.22); color: var(--acid); }
.studio-shell .popover .field textarea { display: block; flex: none; width: 100%; height: 86px; min-height: 72px; max-height: 180px; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 8px; background: #161719; font-size: 12px; resize: vertical; }
.studio-shell .field input,
.studio-shell .field select { border-color: var(--line2); background: #161719; font-size: 12px; }
.studio-shell .settings-help { font-size: 11px; line-height: 1.6; }
.studio-shell .upload-box { border-color: var(--line2); background: rgba(255,255,255,.025); }

/* Results stay inside the work area, without covering the composer or rail. */
.studio-shell .studio-canvas.has-content { inset: 72px 26px var(--composer-space,210px); width: auto; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #4b4d4f transparent; }
.studio-shell .result-stage { width: min(1080px,100%); margin: 0 auto; }
.studio-shell .result-stage-head { margin-bottom: 18px; }
.studio-shell .studio-result-title { margin: 0; color: #f0f1f2; font-size: 23px; font-weight: 550; line-height: 1.2; letter-spacing: -.035em; }
.studio-shell .result-stage-head p { color: #969ba0; font-size: 11px; }
.studio-shell .result-stage-head .secondary-button { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; }
.studio-shell .result-stage-head .secondary-button svg { width: 13px; height: 13px; }
.studio-shell .result-card { border-color: var(--line2); border-radius: 14px; background: rgba(28,30,33,.9); }
.studio-shell .result-card .result-media { background: #141618; }
.studio-shell .result-card img { object-fit: contain; }
.studio-shell .chat-stream { width: min(880px,100%); padding: 10px 0 24px; gap: 14px; }
.studio-shell .chat-bubble { padding: 15px 18px; border-color: var(--line2); background: rgba(35,38,42,.8); border-radius: 14px; color: #eceeef; font-size: 13px; }
.studio-shell .chat-bubble.user { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.16); }
.studio-shell .chat-bubble small { color: #a9b094; }

/* Real recent results when signed in; clearly labelled prompt ideas otherwise. */
.studio-recent { margin-top: 18px; }
.studio-recent-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.studio-recent-header h2 { margin: 0; color: #e7e9eb; font-size: 13px; font-weight: 550; letter-spacing: -.01em; }
.studio-text-link { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: transparent; color: var(--soft); font-size: 11px; }
.studio-text-link svg { width: 13px; height: 13px; }
.studio-text-link:hover { color: var(--acid); }
.studio-recent-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; }
.studio-recent-tile { position: relative; display: block; aspect-ratio: 16/10; min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #23262a; color: #fff; text-align: left; }
.studio-recent-tile > img,
.studio-recent-tile > video { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.studio-recent-tile:hover > img,
.studio-recent-tile:hover > video { transform: scale(1.045); }
.studio-tile-caption { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 12px; background: linear-gradient(180deg,transparent 30%,rgba(0,0,0,.78)); }
.studio-tile-caption > span { min-width: 0; }
.studio-tile-caption small { display: block; margin-bottom: 5px; color: rgba(255,255,255,.55); font-size: 9px; font-weight: 400; }
.studio-tile-caption strong { display: block; overflow: hidden; color: #e8ebee; font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.studio-tile-caption > svg { flex: none; width: 25px; height: 25px; padding: 5px; border: 1px solid var(--line2); border-radius: 7px; background: rgba(15,16,17,.6); opacity: 0; transition: opacity .2s; }
.studio-recent-tile:hover .studio-tile-caption > svg,
.studio-recent-tile:focus-visible .studio-tile-caption > svg { opacity: 1; }
.studio-tile-symbol { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 25%,#343a39,transparent 70%); color: #b9c1ac; }
.studio-tile-symbol svg { width: 42px; height: 42px; }

body.is-studio .dialog-layer { background: rgba(5,6,7,.75); backdrop-filter: blur(10px); }
body.is-studio .dialog { border-color: rgba(255,255,255,.15); border-radius: 20px; background: #1c1e21; }
body.is-studio .studio-history .library-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 20px; }
body.is-studio .studio-history .library-card { border-color: var(--line2); background: #23262a; }
body.is-studio .studio-history .card-thumb { height: 150px; }
body.is-studio .studio-history .library-card h3 { font-size: 12px; }
body.is-studio .studio-history .library-card p { font-size: 11px; }
.studio-history-empty { display: grid; justify-items: center; gap: 14px; padding: 48px 15px; margin-top: 20px; border: 1px dashed var(--line2); border-radius: 14px; color: #d5d8dc; text-align: center; }
.studio-history-empty > svg { width: 32px; height: 32px; color: #7e858c; }
.studio-history-empty strong { font-size: 15px; font-weight: 550; }
.studio-history-empty p { margin: 0; }

@media (max-width: 1100px) {
  body.is-studio .topbar { gap: 18px; }
  body.is-studio .nav-main a[data-route="trending"] { display: none; }
  .studio-shell.workbench { grid-template-columns: 76px minmax(0,1fr); }
  .studio-rail { padding-left: 6px; padding-right: 6px; }
  .studio-rail-item { width: 62px; }
  .studio-model-chip > span:not(.studio-model-dot) { max-width: 140px; }
  .studio-shell .studio-hero h1 { font-size: 42px; }
}
@media (max-width: 880px) {
  body.is-studio .nav-main { display: none; }
  .studio-page { padding: 16px 16px 24px; }
  .studio-shell .studio-composer-zone { width: calc(100% - 32px); }
  .studio-shell .studio-hero { top: 29%; }
  .studio-shell .studio-hero h1 { font-size: 38px; }
  .studio-shell .studio-hero p { max-width: 480px; font-size: 13px; }
  .studio-shell .composer-bottom .dock-controls { flex: 0 1 auto; }
  .studio-recent-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 600px) {
  body.is-studio .topbar { height: 56px; padding: 0 14px; gap: 12px; }
  body.is-studio .brand { font-size: 16px; }
  body.is-studio .nav-actions { gap: 7px; }
  body.is-studio .pricing-link { display: inline-flex; align-items: center; padding: 7px 9px; }
  body.is-studio .pricing-link[data-route="referral"] { display: none; }
  body.is-studio .login-button { padding: 7px 11px; }
  body.is-studio .account-button { padding: 7px 9px; gap: 5px; }
  body.is-studio .account-button span { display: none; }
  body.is-studio #app { min-height: calc(100svh - 56px); }
  .studio-page { padding: 12px 12px 24px; }
  .studio-shell.workbench { grid-template-columns: minmax(0,1fr); grid-template-rows: 68px minmax(0,1fr); height: calc(100svh - 88px); min-height: 740px; max-height: none; border-radius: 20px; }
  .studio-shell.is-expanded { height: 100dvh; min-height: 0; border-radius: 0; }
  .studio-rail { flex-direction: row; justify-content: space-between; gap: 5px; padding: 6px; border-right: 0; border-bottom: 1px solid var(--line); }
  .studio-rail-main { flex: 1; flex-direction: row; justify-content: space-between; gap: 2px; width: auto; }
  .studio-rail-library { flex-direction: row; width: auto; }
  .studio-rail-item { width: auto; min-width: 51px; min-height: 54px; gap: 4px; padding: 6px 4px; font-size: 9px; border-radius: 10px; }
  .studio-rail-main .studio-rail-item { flex: 1; }
  .studio-rail-item svg { width: 20px; height: 20px; }
  .studio-rail-separator,
  .studio-rail-bottom,
  .studio-rail-catalog { display: none; }
  .studio-shell .studio-stage-top { min-height: 56px; padding: 12px; }
  .studio-tabs button { padding: 5px 10px; font-size: 11px; }
  .studio-stage-actions { gap: 6px; }
  .studio-icon-button { width: 30px; height: 30px; padding: 6px; }
  .studio-shell .studio-hero { top: 28%; padding: 0 20px; }
  .studio-kicker { gap: 7px; margin-bottom: 12px; font-size: 10px; }
  .studio-kicker b { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .studio-shell .studio-hero h1 { font-size: 32px; line-height: 1.1; letter-spacing: -.04em; }
  .studio-shell .studio-hero p { max-width: 300px; margin-top: 13px; font-size: 12px; line-height: 1.55; }
  .studio-shell .studio-composer-zone { bottom: 16px; width: calc(100% - 24px); }
  .studio-suggestions { gap: 6px; margin-bottom: 10px; }
  .studio-suggestions button { padding: 5px 9px; font-size: 10px; }
  .studio-shell .composer { padding: 10px; border-radius: 16px; }
  .studio-prompt-row { gap: 8px; padding: 2px 2px 12px; }
  .studio-shell .studio-prompt-row textarea { min-height: 68px; height: 68px; max-height: 120px; font-size: 13px; }
  .studio-attach-button { width: 36px; height: 36px; padding: 9px; border-radius: 9px; }
  .studio-shell .composer-bottom { padding: 9px 0 0; gap: 6px; }
  .studio-shell .chip { gap: 5px; padding: 0 8px; height: 30px; min-height: 30px; font-size: 10px; }
  .studio-shell .quick-chip strong { font-size: 10px; }
  .studio-model-chip > span:not(.studio-model-dot) { max-width: 136px; }
  .studio-shell .composer .generate-button { flex-basis: 100%; width: 100%; height: auto; min-height: 38px; margin-top: 2px; margin-left: 0; }
  .studio-shell .composer .generate-button small { max-width: 210px; font-size: 10px; }
  .studio-shell .composer .generate-button small span { font-size: 9px; }
  .studio-shell .composer-hint { gap: 8px; margin-top: 8px; font-size: 9px; }
  .studio-shell .popover { padding: 12px; border-radius: 14px; }
  .studio-shell .popover .settings-grid { grid-template-columns: 1fr; }
  .studio-shell .studio-canvas.has-content { inset: 66px 14px var(--composer-space,245px); }
  .studio-shell .studio-result-title { font-size: 20px; }
  .studio-shell .result-stage-head { align-items: flex-start; gap: 8px; }
  .studio-shell .result-stage-head p { font-size: 10px; }
  .studio-shell .chat-bubble { max-width: 94%; padding: 12px 14px; font-size: 12px; }
  .studio-recent-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .studio-tile-caption { padding: 10px; }
  .studio-tile-caption strong { font-size: 10px; }
  .studio-tile-caption small { font-size: 8px; }
  body.is-studio .studio-history .library-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body.is-studio .studio-history .card-thumb { height: 110px; }
}
@media (max-width: 360px) {
  body.is-studio .nav-actions .pricing-link { display: none; }
  .studio-rail-item { min-width: 44px; font-size: 8px; }
  .studio-shell .studio-hero h1 { font-size: 29px; }
  .studio-shell .studio-hero p { font-size: 11px; }
  .studio-tabs button { padding: 5px 8px; font-size: 10px; }
  .studio-suggestions button { padding: 5px 7px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .studio-slide { animation: none; opacity: 0; }
  .studio-slide:first-child { opacity: 1; }
  .studio-backdrop,
  .studio-recent-tile > img,
  .studio-recent-tile > video { transition: none; }
}
@media (prefers-contrast: more) {
  .studio-rail-item,
  .studio-shell .composer,
  .studio-shell .chip,
  .studio-tabs,
  .studio-icon-button { border-color: rgba(255,255,255,.3); }
  .studio-shell .studio-hero p,
  .studio-shell .composer-hint { color: #c9cdd1; }
}

/* FON toggle off hides backdrop */
.studio-stage.no-backdrop .studio-backdrop,
.studio-stage.no-backdrop .studio-veil { display: none !important; }
.studio-stage.no-backdrop { background: #0f1011; }
body.fon-disabled .studio-backdrop { display:none; }
