/* The artwork scrolls with the creation home. The workbench uses the shared canvas. */
html[data-theme="light"] { color-scheme: light; --bg: var(--studio-bg); --fg: var(--studio-text); }

#app #sidebar {
  background: linear-gradient(160deg, #f9fbffee, #eff4fff5);
}
#app #sidebar .nav-item.active {
  border-color: #fff;
  background: #fcfdff;
  color: var(--studio-accent-strong);
  box-shadow: 0 4px 13px #3a65db38, inset 0 1px 0 #fff;
}
#app .mobile-topbar { background: #f7faff; }
#app .mobile-topbar :is(#mobileSettingsBtn, #mobileAccountBtn) { color: var(--studio-text); }

#app #composer .composer-bar > #sendBtn > svg { transform: none; }

.studio-home-art { display: none; }
body:not(.reference-workspace) #app #viewCreate {
  --home-gutter: clamp(24px, 3.25vw, 68px);
  --home-hero-height: clamp(328px, 23.83vw, 440px);
}
body:not(.reference-workspace) #app #studioTopbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 8;
  height: 56px;
  min-height: 56px;
  padding-inline: var(--home-gutter);
  background: transparent;
  border: 0;
}
body:not(.reference-workspace) #studioTopbar .studio-location { visibility: hidden; }
body:not(.reference-workspace) #app #stage.stage {
  position: relative;
  min-height: 0;
  isolation: isolate;
  padding: 0 var(--home-gutter) 38px;
}
body:not(.reference-workspace) #app #stage > .studio-home-art {
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  display: block;
  height: calc(var(--home-hero-height) + 270px);
  pointer-events: none;
}
.studio-home-art > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 54% top;
  mask-image: linear-gradient(#000 65%, #000c 81%, transparent 100%);
}
body:not(.reference-workspace) #app #stage .hero {
  display: flex;
  align-items: flex-start;
  flex: 0 0 auto;
  min-height: var(--home-hero-height);
  height: auto;
  padding: clamp(84px, 6.35vw, 118px) 0 28px 12px;
  overflow: visible;
}
body:not(.reference-workspace) #app #stage .hero-copy {
  width: 62%;
  max-width: 710px;
  animation: none;
  opacity: 1;
  transform: none;
}
#app #stage .hero-kicker {
  color: var(--studio-text);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .08em;
  margin-bottom: 12px;
}
#app #stage .hero-title {
  color: #101b38;
  font-family: "Songti SC", "Noto Serif CJK SC", "SimSun", "STIX Two Text", Georgia, serif;
  font-size: clamp(42px, 3.62vw, 71px);
  font-weight: 500;
  line-height: 1.11;
  letter-spacing: -.05em;
}
html[data-theme] #app #stage .hero-title > span {
  color: #123fc5;
  font-weight: inherit;
  -webkit-text-fill-color: currentColor;
}
#app #stage .hero-lede {
  color: var(--studio-muted);
  font-size: clamp(13px, 1vw, 16px);
  margin-top: 16px;
}

body:not(.reference-workspace) #app #stage > #composer {
  width: min(100%, clamp(900px, 58.6vw, 1120px));
  max-width: none;
  margin: 0;
  padding: 12px 16px 14px;
  border: 1px solid #ffffffd9;
  border-radius: 20px;
  background: linear-gradient(145deg, #f9fbffcf, #eef4ffbd 64%, #f9fbffcd);
  box-shadow: inset 0 1px 0 #fff, 0 16px 34px #23458227;
  backdrop-filter: blur(14px);
}
body:not(.reference-workspace) #app #stage > #composer:focus-within {
  box-shadow: inset 0 1px 0 #fff, 0 0 0 2px #3155d933, 0 16px 34px #23458227;
}
body:not(.reference-workspace) #app #stage > #composer .composer-input-row {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  align-items: center;
  gap: 9px;
  padding: 5px 7px;
  border: 1px solid #fff;
  border-radius: 13px;
  background: #ffffffd6;
}
body:not(.reference-workspace) #app #stage > #composer :is(#attachBtn, #attachMoreBtn) {
  align-self: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  flex: 0 0 38px;
  padding: 8px;
  background: #eaf0fb;
  color: var(--studio-text);
  border-color: #e9eff9;
}
body:not(.reference-workspace) #app #stage > #composer .composer-writing #promptInput {
  display: block;
  height: 38px;
  min-height: 38px;
  padding: 7px 0;
  font-size: 14px;
  line-height: 24px;
}
body:not(.reference-workspace) #app #stage > #composer.expanded .composer-writing #promptInput {
  height: var(--composer-edit-height);
  min-height: 38px;
}
body:not(.reference-workspace) #app #stage > #composer .composer-writing .prompt-counter { display: none; }
#app #composer #modelChip { order: -1; }
html[data-theme] #app #composer .composer-bar > #sendBtn,
html[data-theme] body.reference-workspace #app #dock #composer .composer-bar > #sendBtn {
  background: linear-gradient(105deg, #123cdd, #1b50de 57%, #2069cc);
  color: #fff;
}
html[data-theme] #app #composer .composer-bar > #sendBtn:hover:not(:disabled),
html[data-theme] body.reference-workspace #app #dock #composer .composer-bar > #sendBtn:hover:not(:disabled) {
  background: linear-gradient(105deg, #0f35c8, #1644cd 57%, #1a5db7);
}
@media (min-width: 1080px) {
  body:not(.reference-workspace) #app #stage > #composer {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 10px;
    margin-inline-start: 24px;
  }
  body:not(.reference-workspace) #app #stage > #composer > :is(.attach-tray, .commerce-draft-banner, .submission-status) {
    grid-column: 1 / -1;
  }
  body:not(.reference-workspace) #app #stage > #composer .attach-tray { grid-row: 1; }
  body:not(.reference-workspace) #app #stage > #composer .commerce-draft-banner { grid-row: 2; }
  body:not(.reference-workspace) #app #stage > #composer .composer-bar { display: contents; }
  body:not(.reference-workspace) #app #stage > #composer .composer-input-row {
    grid-area: 3 / 1 / 4 / -1;
    padding-right: 133px;
  }
  html[data-theme] body:not(.reference-workspace) #app #stage > #composer .composer-bar > #sendBtn {
    grid-area: 3 / 3;
    align-self: center;
    z-index: 1;
    min-width: 115px;
    min-height: 36px;
    height: 36px;
    margin: 0 7px 0 4px;
    padding-inline: 10px;
    gap: 7px;
    font-size: 13px;
  }
  body:not(.reference-workspace) #app #stage > #composer .composer-primary-controls {
    grid-area: 4 / 1;
    align-self: start;
    margin-top: 12px;
  }
  body:not(.reference-workspace) #app #stage > #composer #composerOptions {
    grid-area: 4 / 2 / 5 / -1;
    margin-top: 12px;
  }
  body:not(.reference-workspace) #app #stage > #composer .submission-status { grid-row: 5; }
}
body:not(.reference-workspace) #app #stage #inspire {
  margin-top: 20px;
}
#app #stage .commerce-shortcuts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 1.35vw, 22px);
  margin-bottom: 23px;
  padding: 0;
  border: 0;
}
#app #stage .commerce-shortcuts button,
#app #stage .commerce-shortcuts button:first-child {
  min-height: 68px;
  gap: 13px;
  padding: 9px clamp(10px, 1.25vw, 20px);
  border: 1px solid #ffffffde;
  border-radius: 11px;
  background: linear-gradient(130deg, #ffffffdb, #f9fbffae);
  box-shadow: inset 0 1px #fff, 0 4px 18px #42619c13;
  transition: background-color 180ms, box-shadow 180ms;
}
#app #stage .commerce-shortcuts button:hover {
  background-color: #fff;
  box-shadow: inset 0 1px #fff, 0 5px 19px #3155d92b;
}
#app #stage .commerce-shortcut-icon {
  width: 43px;
  height: 43px;
  border-radius: 12px;
  background: linear-gradient(130deg, #c7d6ff, #e8efff 73%);
}
.commerce-shortcut-icon > svg { width: 23px; height: 23px; }
#app #stage .commerce-shortcuts button b,
#app #stage .commerce-template-action {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #ffffffb0;
  border-radius: 50%;
  background: #fafdffeb;
  color: var(--studio-text);
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 1px 4px #1e355b20;
}
#app #stage .commerce-gallery-head { padding: 0 0 4px 12px; }
#app #stage .commerce-gallery-head .eyebrow { font-size: 11px; font-weight: 500; }
#app #stage .commerce-gallery-head h2 { font-size: clamp(19px, 1.6vw, 25px); font-weight: 700; }
#app #stage .commerce-filter-result {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.commerce-scene-link {
  color: var(--studio-text);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.commerce-scene-link:hover { color: var(--studio-accent-strong); }
.commerce-scene-link span { margin-inline-start: 5px; }
#app #stage .commerce-filters { margin: 0 12px 10px; scroll-margin-top: 60px; }
#app #stage .commerce-filters button { min-height: 32px; padding: 5px 10px; }
#app #stage .commerce-filters button[aria-pressed="true"] {
  border-color: #fff;
  background: #fcfdff;
  box-shadow: 0 2px 5px #425b9012;
  font-weight: 650;
}
#app #stage .commerce-template-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-inline: 12px 0;
}
#app #stage .commerce-template-media { aspect-ratio: 2.03; border-radius: 9px; }
#app #stage .commerce-template-media > img { object-position: center; }
#app #stage .commerce-template-media::after {
  position: absolute;
  inset: 42% 0 0;
  content: "";
  background: linear-gradient(transparent, #102644bb);
  pointer-events: none;
}
#app #stage .commerce-template-format { z-index: 1; }
#app #stage .commerce-template-copy {
  position: absolute;
  inset: auto 12px 11px 15px;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 0;
  color: #fff;
}
#app #stage .commerce-template-copy strong { font-weight: 700; }
#app #stage .commerce-template-action { position: static; opacity: 1; transform: none; }
#app #stage .commerce-gallery-note { padding-inline: 12px; }
.studio-nav-setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.studio-nav-setting input { width: 18px; height: 18px; accent-color: var(--studio-accent); }

@media (min-width: 920px) {
  #app { --studio-nav-width: clamp(174px, 11.35vw, 200px); }
  #app #sidebar .nav-label { margin-top: 18px; margin-bottom: 8px; }
  #app #sidebar .nav { gap: 2px; }
  #app #sidebar .nav-item { height: 42px; min-height: 42px; }
  body:not(.reference-workspace) #app #studioTopbar #workspaceEntryBtn { background: #fafdffed; }

}
@media (max-width: 1079px) {
  #app #stage .commerce-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #app #stage .commerce-template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  body:not(.reference-workspace) #app #viewCreate { --home-gutter: 14px; --home-hero-height: 221px; }
  body:not(.reference-workspace) #app #stage.stage { padding-inline: var(--home-gutter); }
  body:not(.reference-workspace) #app #stage > .studio-home-art { height: 375px; }
  .studio-home-art > img { object-position: 70% top; opacity: .78; }
  .studio-home-art::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(100deg, #f0f4fce6 0%, #f0f4fc80 52%, transparent 86%);
    mask-image: linear-gradient(#000 62%, transparent);
  }
  body:not(.reference-workspace) #app #stage .hero { padding: 45px 0 20px 7px; }
  body:not(.reference-workspace) #app #stage .hero-copy { width: 100%; }
  #app #stage .hero-title { font-size: clamp(31px, 7.8vw, 49px); }
  #app #stage .hero-lede { margin-top: 11px; }
  body:not(.reference-workspace) #app #stage > #composer { padding: 9px 10px 10px; border-radius: 14px; }
  body:not(.reference-workspace) #app #stage > #composer .composer-bar { gap: 6px; }
  #app #stage .commerce-shortcuts { margin-bottom: 20px; }
  #app #stage .commerce-shortcuts button,
  #app #stage .commerce-shortcuts button:first-child { gap: 8px; min-height: 64px; padding-inline: 8px; }
  #app #stage .commerce-shortcut-icon { width: 32px; height: 32px; border-radius: 8px; }
  .commerce-shortcut-icon > svg { width: 19px; height: 19px; }
  #app #stage .commerce-shortcuts strong { font-size: 13px; }
  #app #stage .commerce-shortcuts small { font-size: 11px; }
  #app #stage .commerce-shortcuts button b { display: none; }
  .commerce-scene-link { font-size: 11px; }
  #app #stage .commerce-gallery-head { gap: 7px; padding-bottom: 9px; }
  #app #stage .commerce-gallery-head, #app #stage .commerce-gallery-note { padding-inline: 0; }
  #app #stage .commerce-filters, #app #stage .commerce-template-grid { margin-inline: 0; }
  #app #stage .commerce-template-grid { gap: 10px; }
  #app #stage .commerce-template-copy { inset: auto 7px 7px; }
  #app #stage .commerce-template-copy strong { font-size: 12px; }
  #app #stage .commerce-template-action { width: 22px; height: 22px; font-size: 12px; }
}

/* MAGI-2 multi-modal audio preview & duration badges (light-theme matched) */
#app #composer .attach-tray .att[data-media-kind="audio"] .att-thumb { width: 76px; }
#app #composer .attach-tray .att-audio-play,
#app #composer .attach-tray .att-audio-placeholder {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  width: 100%;
  height: 100%;
  padding: 5px 5px 16px;
  border: 0;
  background: linear-gradient(155deg, #eef4ff, #e2ecff);
  color: #1f3c88;
  cursor: pointer;
}
#app #composer .attach-tray .att-audio-play[aria-pressed="true"],
#app #composer .attach-tray .att-audio-play.is-playing {
  background: linear-gradient(155deg, #dbe8ff, #c9deff);
  color: #1d4ed8;
}
#app #composer .attach-tray .att-audio-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffffd9;
  color: #2563eb;
  font-size: 9px;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(30, 58, 138, 0.16);
}
#app #composer .attach-tray .att-audio-wave {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
}
#app #composer .attach-tray .att-audio-wave > i {
  display: block;
  width: 2px;
  border-radius: 99px;
  background: currentColor;
  opacity: 0.72;
}
#app #composer .attach-tray .att-audio-wave > i:nth-child(1) { height: 4px; }
#app #composer .attach-tray .att-audio-wave > i:nth-child(2) { height: 8px; }
#app #composer .attach-tray .att-audio-wave > i:nth-child(3) { height: 10px; }
#app #composer .attach-tray .att-audio-wave > i:nth-child(4) { height: 7px; }
#app #composer .attach-tray .att-audio-wave > i:nth-child(5) { height: 5px; }
#app #composer .attach-tray .att-duration {
  position: absolute;
  right: 4px;
  bottom: 3px;
  z-index: 2;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.76);
  color: #f8fafc;
  font-size: 9px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
#app #composer .attach-tray .att-duration-summary {
  display: inline-flex;
  align-items: center;
  align-self: center;
  padding: 4px 10px;
  border: 1px solid rgba(59, 130, 246, 0.24);
  border-radius: 999px;
  background: rgba(239, 246, 255, 0.92);
  color: #1e40af;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
#app #composer .attach-tray .att-duration-summary.is-over-limit {
  border-color: rgba(220, 38, 38, 0.35);
  background: #fef2f2;
  color: #b91c1c;
}
