:root {
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #f3f4f7;
  background: #0e1017;
  color-scheme: dark;
  --surface: #151922;
  --surface-raised: #1e2330;
  --stroke: #2a3140;
  --muted: #a6adbc;
  --accent: #9cafff;
  --accent-ink: #15204c;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 290px; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
h1 { font-size: 19px; letter-spacing: .02em; }
h2 { font-size: 16px; font-weight: 650; }
button, input, select, textarea { font: inherit; }
button, .button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 7px 13px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
button:hover:not(:disabled), .button:hover { filter: brightness(1.11); }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.secondary { color: #e3e7f1; background: var(--surface-raised); border-color: var(--stroke); }
.outline { color: #e3e7f1; background: transparent; border-color: var(--stroke); }
.text-button { min-height: 28px; padding: 3px 7px; background: transparent; color: var(--accent); }
.danger { min-height: 32px; background: #35222c; color: #ffb1c5; border-color: #573141; }
label { display: grid; gap: 6px; color: #c7ccda; font-size: 13px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--stroke);
  background: #10141e;
  color: #f3f4f7;
  border-radius: 7px;
  min-height: 38px;
  padding: 7px 9px;
}
textarea { resize: vertical; line-height: 1.5; min-height: 54px; }
input::placeholder, textarea::placeholder { color: #8e96a9; }
.console { --topbar-height: 67px; }
.topbar {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 2;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 0 clamp(14px, 4vw, 48px);
  min-height: var(--topbar-height);
  border-bottom: 1px solid var(--stroke);
  background: #10131bf5;
}
.brand, .topbar-actions, .section-heading, .stage-footer { display: flex; align-items: center; gap: 10px; }
.topbar-actions { flex-wrap: wrap; min-width: 0; max-width: 100%; }
.topbar-account { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; font-size: 13px; }
.topbar-account-label { color: var(--muted); white-space: nowrap; }
#account-identifier { min-width: 0; overflow-wrap: anywhere; }
.topbar-account button { flex: none; }
#test-release-link { white-space: nowrap; }
.brand-mark { width: 24px; height: 24px; border: 2px solid #b4c1ff; border-radius: 9px; transform: rotate(-12deg); box-shadow: inset 0 0 0 4px #10131b; background: #758ef4; }
.environment { color: #b4c1ff; font-size: 12px; }
.status-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.status-chip::before { content: ""; width: 7px; height: 7px; border-radius: 100%; background: #6d7789; }
.status-chip[data-state="online"]::before { background: #7ac8a3; }
.status-chip[data-state="error"]::before { background: #ff9d78; }
.workspace {
  width: min(1480px, 100%);
  margin: auto;
  padding: 25px clamp(14px, 4vw, 48px) 48px;
  display: grid;
  grid-template-columns: minmax(250px, 330px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.stack, .control-column, .control-grid { display: grid; gap: 14px; }
.control-grid { align-items: start; grid-template-columns: minmax(0, 1fr); }
.control-grid > .stack { min-width: 0; }
#login-panel { width: min(100%, 420px); }
.prompt-columns {
  display: grid;
  gap: inherit;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr));
}
#model-status { overflow-wrap: anywhere; text-align: right; }
.panel { min-width: 0; border: 1px solid var(--stroke); border-radius: 13px; background: var(--surface); padding: 15px; }
.panel > h2, .panel > .section-heading { margin-bottom: 12px; }
.section-heading, .stage-footer { justify-content: space-between; }
.panel > .panel-heading { gap: 7px; flex-wrap: wrap; margin-bottom: 0; min-height: 28px; }
.panel-heading h2 { margin-right: auto; }
.panel-content { min-width: 0; margin-top: 12px; }
.panel-toggle { min-height: 26px; white-space: nowrap; }
.panel-toggle::after {
  content: "";
  width: 5px;
  height: 5px;
  margin: 0 1px 3px 6px;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
}
.panel-toggle[aria-expanded="true"]::after { margin-bottom: -2px; transform: rotate(225deg); }
.membership-tier {
  padding: 2px 7px;
  border-radius: 5px;
  background: #243151;
  color: #c4d0ff;
  font-size: 12px;
  white-space: nowrap;
}
.membership-tier[data-premium] { background: #3a3028; color: #ffe2aa; }
#membership-refresh, .premium-locked > button, .advanced-form > button, .advanced-form .secondary { justify-self: start; }
.premium-locked { display: grid; gap: 8px; }
.advanced-form { display: grid; gap: 12px; }
.advanced-fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 172px), 1fr)); gap: 10px; }
.advanced-fields > .wide-field { grid-column: 1 / -1; }
.settings-check { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.settings-check input { width: 16px; min-height: 16px; margin: 0; accent-color: var(--accent); }
.setting-feedback { min-height: 1.55em; }
.setting-feedback[data-error] { color: #ffb1c5; }
.simulation-details { margin: 0; padding: 10px; border: 1px solid var(--stroke); border-radius: 8px; min-inline-size: 0; }
.simulation-details legend { font-size: 12px; color: var(--muted); }
.memory-entries { display: grid; gap: 9px; margin: 0; padding-inline-start: 22px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.stage-arm-space { display: grid; gap: 8px; margin-top: 8px; justify-items: start; }
.arm-space-controls { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr) 4ch auto; align-items: center; column-gap: 9px; }
.arm-space-controls label { grid-column: 1 / -1; }
.arm-space-controls input { border: 0; padding: 0; min-width: 0; accent-color: var(--accent); }
.arm-space-controls output { color: var(--muted); font-size: 13px; text-align: center; }
.quiet { color: var(--muted); font-size: 12px; line-height: 1.55; }
.notice { border-radius: 8px; padding: 9px 11px; font-size: 13px; line-height: 1.5; background: #20302d; color: #c4edda; }
.notice[data-error] { background: #3a252c; color: #ffd2d8; }
.pair-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 136px), 1fr)); gap: 6px; }
#asset-tools { margin-top: 12px; }
.pair-info { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 9px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.pair-info output { color: #eff2fb; font-family: ui-monospace, monospace; font-size: 16px; }
#stage-slot, .obs-stage-slot { display: grid; place-items: center; }
#stage-slot .stage { max-width: var(--preview-width, 360px); }
.live-output-panel { width: min(100%, 360px); margin: 0 auto 12px; }
.live-output-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.live-output-layout { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 8px; }
.live-output-button {
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 66px;
  padding: 10px 13px;
  border: 1px solid #6173a6;
  border-radius: 13px;
  background: linear-gradient(115deg, #293858, #202a43 68%, #1c253a);
  color: #f4f6ff;
  text-align: left;
  box-shadow: inset 0 1px #c4cfff19, 0 4px 14px #06091055;
}
.live-output-button:hover:not(:disabled) { border-color: #a0b2ee; }
.live-output-icon {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 10px;
  background: #b8c8ff;
  color: #273759;
}
.live-output-icon::before {
  content: "";
  width: 12px;
  height: 19px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  background: radial-gradient(circle at center, currentColor 2px, transparent 2.5px);
}
.live-output-copy { display: grid; gap: 3px; font-size: 14px; }
#live-output-hint { color: #c6cfe4; font-size: 12px; font-weight: 500; }
.live-output-arrow { justify-self: end; color: #bdcbfa; font-size: 19px; line-height: 1; }
#live-output-status { margin: 7px 2px 0; color: #b8c9ea; font-size: 12px; line-height: 1.45; }
#live-output-status[data-error] { color: #ffb1c5; }
.phone-preview, .phone-screen { display: contents; }
.phone-hardware, .phone-camera, .phone-ui-overlay, .phone-home, .phone-empty-mark { display: none; }
#live-output-panel:not([hidden]) + .phone-preview {
  --phone-width-per-height: .485;
  display: block;
  position: relative;
  isolation: isolate;
  width: min(100%, 344px);
  aspect-ratio: var(--phone-width-per-height);
  margin-inline: auto;
  padding: 7px;
  border: 1px solid #6f737b;
  border-radius: 37px;
  background:
    radial-gradient(ellipse 84% 9% at 23% 0%, #cbd0d887, transparent 88%),
    radial-gradient(ellipse 38% 12% at 100% 98%, #a3a8b88c, transparent 90%),
    linear-gradient(146deg, #6b6f77 0%, #383c45 23%, #262930 54%, #41464f 81%, #727680 100%);
  box-shadow:
    inset 0 0 0 1px #0c0e13b5,
    inset 0 0 0 3px #bfc5d04d,
    0 2px 4px #000b,
    0 16px 30px -12px #000e;
}
#live-output-panel:not([hidden]) + .phone-preview .phone-hardware {
  display: block;
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.phone-key {
  position: absolute;
  left: -4px;
  width: 4px;
  border-radius: 3px 0 0 3px;
  border-block: 1px solid #191c23;
  background: linear-gradient(90deg, #2a2d34, #999eaa 46%, #515663 85%);
  box-shadow: -1px 1px 2px #0008;
}
.phone-key-action { top: 13%; height: 3%; }
.phone-key-volume-up { top: 18%; height: 5.4%; }
.phone-key-volume-down { top: 25%; height: 5.4%; }
.phone-key-power { top: 22%; right: -4px; left: auto; height: 7.2%; transform: scaleX(-1); }
#live-output-panel:not([hidden]) + .phone-preview .phone-screen {
  display: grid;
  grid-template-rows: minmax(0, 1.25fr) auto minmax(0, 1fr);
  position: relative;
  height: 100%;
  overflow: hidden;
  border: 1px solid #030408;
  border-radius: 29px;
  background: linear-gradient(180deg, #111724, #171f30 28%, #151b29 76%, #101420);
  box-shadow: 0 0 0 1px #c4cbd235, 0 0 0 3px #13161d;
}
#live-output-panel:not([hidden]) + .phone-preview .phone-camera {
  display: block;
  position: relative;
  place-self: center;
  width: clamp(38px, 22%, 64px);
  aspect-ratio: 4.3;
  border-radius: 12px;
  background: #030408;
  box-shadow: inset 0 1px 2px #000, inset 0 -1px #3239466e, 0 0 0 1px #2b303b66;
}
.phone-camera::before, .phone-camera::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.phone-camera::before {
  left: 24%;
  width: 34%;
  height: 3px;
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, #42464f2b 0 1px, #090a0d 1px 2px);
  box-shadow: inset 0 1px #000b, 0 1px #4e525635;
}
.phone-camera::after {
  right: 11%;
  width: 13%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 33%, #b8cadd 0, #556a85 13%, #23374c 24%, #181d34 42%, #05070c 63%, #384050 74%, #0e1119 100%);
  box-shadow: 0 0 0 1px #121824;
}
#live-output-panel:not([hidden]) + .phone-preview .phone-home {
  display: block;
  place-self: end center;
  width: 32%;
  height: 3px;
  margin-bottom: 9px;
  border-radius: 10px;
  background: #b2b8caba;
}
#live-output-panel:not([hidden]) + .phone-preview #stage-slot {
  position: relative;
  aspect-ratio: 9 / 16;
  background: radial-gradient(ellipse at 50% 30%, #20283a, #141925 72%);
}
#live-output-panel:not([hidden]) + .phone-preview #stage-slot:has(> .stage) .phone-ui-overlay {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}
#live-output-panel:not([hidden]) + .phone-preview #stage-slot:not(:has(.stage)) .phone-empty-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid #3f4c68;
  border-radius: 14px;
  color: #a2b3e6;
  background: #202940;
  font-size: 22px;
}
body.live-output-window {
  display: grid;
  place-items: center;
  width: 100dvw;
  height: 100dvh;
  min-width: 0;
  overflow: hidden;
  background: #0e1017;
}
.live-output-window .stage { width: min(100%, 56.25dvh); }
.live-output-window[data-landscape] .stage {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(100dvh, 56.25dvw, var(--live-output-stage-max-width));
  transform: translate(-50%, -50%) rotate(-90deg);
}
.live-output-fullscreen-controls {
  position: fixed;
  inset: 8px 8px auto auto;
  z-index: 2;
  max-width: calc(100% - 16px);
  text-align: right;
}
.stage {
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: radial-gradient(ellipse at 56% 45%, #283955 0, #171f31 58%, #121722 100%);
}
.stage-background, .avatar-render { position: absolute; inset: 0; }
.stage-background img, .stage-background video { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar-render canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.avatar-render canvas:active { cursor: grabbing; }
.avatar-fallback { position: relative; width: min(36%, 200px); max-height: 64%; object-fit: contain; border-radius: 12px; }
.stage-placeholder { position: relative; padding: 8px 13px; border-radius: 7px; background: #111827c9; color: #d0d6e4; font-size: 14px; }
.caption { display: none; }
.playback-status { color: var(--muted); font-size: 13px; }
.speak-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(138px, 100%), 1fr)); gap: 10px; }
#speak-form > button { justify-self: end; }
.preset-row { display: grid; gap: 8px; border: 1px solid var(--stroke); border-radius: 8px; padding: 9px; }
.preset-row > button { justify-self: end; }
#reply-worker { white-space: normal; overflow-wrap: anywhere; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 10px; }
.metrics div { min-width: 0; border-radius: 9px; background: #10141d; padding: 10px; }
.metrics dt { color: var(--muted); font-size: 12px; }
.metrics dd { margin: 5px 0 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.obs, .obs-stage-slot { position: fixed; inset: 0; background: #0e1017; }
.obs .stage {
  width: min(100%, 56.25vh);
  width: min(100%, 56.25dvh);
}
.obs-overlay { position: fixed; z-index: 2; inset: 0; display: grid; place-items: center; padding: 14px; background: #0e1017a8; }
.obs-panel { width: min(360px, 100%); }
.obs-panel h1, .obs-panel form, .obs-panel > button { margin-bottom: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (min-width: 791px) {
  .console {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
  }
  .workspace {
    --workspace-pad: 16px;
    --preview-width: min(360px, max(0px, calc((100vh - var(--topbar-height) - 2 * var(--workspace-pad)) * 0.5625)));
    --preview-width: min(360px, max(0px, calc((100dvh - var(--topbar-height) - 2 * var(--workspace-pad)) * 0.5625)));
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: var(--workspace-pad) clamp(14px, 2vw, 48px);
    grid-template-columns: minmax(0, 1fr) var(--preview-width);
    align-items: stretch;
  }
  #live-output-panel:not([hidden]) + .phone-preview {
    width: min(100%, 344px, max(175px, calc((100dvh - var(--topbar-height) - 2 * var(--workspace-pad) - 78px) * var(--phone-width-per-height))));
  }
  .control-column {
    align-content: start;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
}
@media (min-width: 1100px) {
  .control-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
}
@media (max-width: 790px) {
  .workspace { display: flex; flex-direction: column; gap: 16px; }
  .control-column, .preview-column { width: 100%; }
  .preview-column:has(.live-output-panel:not([hidden])) { order: -1; }
}
@media (max-width: 550px) {
  .topbar { flex-wrap: wrap; padding-block: 8px; }
  .topbar-actions:has(#test-release-link:not([hidden])) { margin-inline-start: auto; }
}
@media (max-width: 420px) {
  .brand-mark, .environment { display: none; }
  .topbar-actions { gap: 6px; }
  .metrics { grid-template-columns: 1fr; }
}

.studio-details > summary { cursor: pointer; font-weight: 650; }
.studio-details[open] > summary { margin-bottom: 10px; }
.studio-events { max-height: 340px; overflow: auto; padding-inline-start: 22px; overflow-wrap: anywhere; }
.studio-events li { padding-block: 8px; }
.studio-events p { margin: 3px 0; }
.studio-events small { color: var(--muted); }
.simulation-result { border: 1px solid var(--stroke); border-radius: 10px; padding: 10px 12px; overflow-wrap: anywhere; }
.simulation-result p { margin: 4px 0; white-space: pre-wrap; }
.simulation-meme-details { margin-block: 6px; }
.simulation-meme-details summary { cursor: pointer; overflow-wrap: anywhere; }
.simulation-meme-body { max-height: 15rem; overflow: auto; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--stroke); border-radius: 8px; }
.simulation-meme-body dl { margin: 4px 0 12px; }
.simulation-meme-body dt { font-weight: 600; }
.simulation-meme-body dd { margin: 0 0 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.studio-assets { padding-inline-start: 22px; overflow-wrap: anywhere; }
#studio-meme-json { font-family: ui-monospace, monospace; }
.studio-sample { white-space: pre-wrap; overflow-wrap: anywhere; }

.compact-setting-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.settings-dialog { color: var(--text); background: var(--surface, #171f30); border: 1px solid var(--stroke); border-radius: 14px; width: min(560px, calc(100vw - 28px)); max-height: min(82vh, 760px); padding: 18px; }
.settings-dialog::backdrop { background: rgb(5 9 18 / 70%); }
.settings-dialog .section-heading { margin-bottom: 12px; }
.docked-dialog[open] { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.docked-dialog .dialog-top { flex: 0 0 auto; margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--stroke); }
.docked-dialog .dialog-top .quiet { margin: 7px 0 0; }
.docked-form { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; gap: 0; }
.dialog-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px; }
.dialog-footer { flex: 0 0 auto; padding: 12px 16px; border-top: 1px solid var(--stroke); }
.dialog-footer .setting-feedback { flex-basis: 100%; margin: 0; }
.room-rule-groups, .interaction-card { display: grid; gap: 12px; }
.room-rule-group { min-width: 0; border: 1px solid var(--stroke); border-radius: 10px; margin: 0; padding: 10px 12px 12px; }
.room-rule-group legend { font-weight: 650; padding: 0 5px; }
.occlusion-commands { display: grid; gap: 10px; margin-top: 12px; }
.occlusion-commands section { border: 1px solid var(--stroke); border-radius: 8px; padding: 8px 10px; }
.occlusion-commands .section-heading { margin-bottom: 5px; }
.occlusion-commands h3 { margin: 0; font-size: 13px; }
.occlusion-commands pre { margin: 0; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.occlusion-commands p { margin-bottom: 4px; }
#occlusion-copy-status:not(:empty) { margin-top: 8px; }
#prompt-advanced .panel { border-radius: 8px; padding: 10px; }
#prompt-advanced .panel h2 { font-size: 14px; }
.queue-table { display: grid; gap: 7px; }
.queue-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, .65fr) minmax(40px, .45fr) 78px; gap: 8px; align-items: center; }
.queue-table input { min-width: 0; }
.queue-label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.queue-label .text-button { white-space: nowrap; }
.queue-arrows { display: flex; gap: 4px; }
.queue-arrows button { min-width: 36px; padding: 5px 8px; }
.range-field { grid-template-columns: minmax(0, 1fr) 36px; align-items: center; }
.range-field input { grid-area: 2 / 1; padding: 0; min-height: 24px; accent-color: var(--accent); }
.range-field span { grid-area: 2 / 2; font-variant-numeric: tabular-nums; text-align: right; }
.stage-reply-bubble {
  --bubble-bg: #fff0c8;
  --bubble-ink: #472d1b;
  --bubble-accent: #80602a;
  --bubble-outline: #a76f39;
  --bubble-shadow: #79491c55;
  --bubble-talent-bg: #77512c;
  position: absolute;
  z-index: 5;
  width: var(--bubble-width, 88%);
  max-width: 100%;
  top: calc((100% - 9px) * var(--bubble-y, .06));
  left: calc(100% * var(--bubble-x, .5));
  translate: calc(-100% * var(--bubble-x, .5)) calc(-100% * var(--bubble-y, .06));
  color: var(--bubble-ink);
  background: var(--bubble-bg);
  border: 2px solid var(--bubble-outline);
  border-radius: 15px;
  box-shadow: 0 4px 0 var(--bubble-shadow);
  padding: 3.2%;
  pointer-events: none;
  container-type: inline-size;
}
.stage-reply-bubble[data-theme="lotus"] {
  --bubble-bg: #e5f5df; --bubble-ink: #183427; --bubble-accent: #3b6449; --bubble-outline: #6d9972;
  --bubble-shadow: #21453055; --bubble-talent-bg: #315a45;
  border-radius: 25px 25px 25px 8px;
}
.stage-reply-bubble[data-theme="ink"] {
  --bubble-bg: #1c2946; --bubble-ink: #f3f6ff; --bubble-accent: #b9cbf9; --bubble-outline: #859bd3;
  --bubble-shadow: #080f23aa; --bubble-talent-bg: #394875;
  border-radius: 8px;
}
.stage-reply-bubble[data-theme="peach"] {
  --bubble-bg: #ffe6df; --bubble-ink: #522d34; --bubble-accent: #963e50; --bubble-outline: #c76e7f;
  --bubble-shadow: #8d314d55; --bubble-talent-bg: #8d3d58;
  border-radius: 24px 24px 9px 24px;
}
.stage-reply-bubble::after { content: ""; position: absolute; right: 15%; bottom: -8px; width: 13px; height: 13px; background: var(--bubble-bg); border: solid var(--bubble-outline); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.stage-reply-bubble p { margin: 0; overflow-wrap: anywhere; line-height: 1.3; }
.bubble-viewer { color: var(--bubble-accent); font-weight: 700; font-size: calc(var(--bubble-font, 20) * .68px); }
.bubble-question { font-size: calc(var(--bubble-font, 20) * .78px); }
.bubble-reply { font-size: calc(var(--bubble-font, 20) * 1px); font-weight: 750; }
.bubble-question:empty { display: none; }
.bubble-talent { display: flex; align-items: center; gap: 5%; color: #fff9e8; background: var(--bubble-talent-bg); border-radius: 9px; padding: 3%; }
.bubble-talent img { width: 22%; max-height: 100px; object-fit: contain; }
.bubble-talent strong { font-size: calc(var(--bubble-font, 20) * 1px); overflow-wrap: anywhere; }
.bubble-wave { display: flex; align-items: center; gap: 3px; height: 28px; flex-shrink: 0; }
.bubble-wave i { width: 4px; height: 65%; background: white; border-radius: 5px; animation: bubble-wave .85s alternate infinite ease-in-out; }
.bubble-wave i:nth-child(2n) { animation-delay: -.45s; }
.bubble-wave i:nth-child(3n) { animation-delay: -.65s; }
@keyframes bubble-wave { from { transform: scaleY(.35); } to { transform: scaleY(1.4); } }
@media (prefers-reduced-motion: reduce) { .bubble-wave i { animation: none; } }

.bgm-controls { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--stroke); }
.bgm-controls > .stack { margin-top: 10px; }
.bgm-controls > p { margin: 5px 0 0; }
#premium-panels.workbench-menu { display: contents; }
.douyin-login-qr {
  display: block;
  max-width: 100%;
  object-fit: contain;
  padding: 8px;
  border-radius: 10px;
  background: white;
}
.douyin-login-qr[hidden] { display: none; }

.binding-header-role {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0 auto 0 0;
}
.binding-header-role select { min-width: 0; }

.prompt-draft-values { margin: 12px 0 0; }
.prompt-draft-values dt { font-weight: 600; }
.prompt-draft-values dd { margin: 4px 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* RELAY workspace: product navigation / role scope / settings / pinned output. */
:root {
  color-scheme: light;
  color: #24232b;
  background: #fafafb;
  --text: #24232b;
  --surface: #fff;
  --surface-raised: #f6f5f8;
  --stroke: #e6e5eb;
  --muted: #767380;
  --accent: #7950d8;
  --accent-ink: #fff;
}
body { line-height: 1.55; }
button, .button { background: #24232b; color: #fff; font-weight: 550; }
button:hover:not(:disabled), .button:hover { filter: brightness(.94); }
button:disabled { cursor: not-allowed; }
.secondary, .outline { background: #fff; border-color: var(--stroke); color: var(--text); }
.text-button { background: transparent; color: #7150bb; }
.danger { background: #fff2f2; border-color: #f0d6db; color: #a9364c; }
label { color: #45414d; }
input, select, textarea { background: #fff; color: var(--text); min-width: 0; border-radius: 8px; }
input:focus, select:focus, textarea:focus { border-color: #a58bdb; }
input[type="range"] { accent-color: var(--accent); padding: 0; }
input[type="checkbox"] { accent-color: var(--accent); }
a { color: #7150bb; }
.console { --topbar-height: 76px; }
.topbar { min-height: 76px; padding: 0 24px; background: #fff; gap: 24px; z-index: 10; }
.product-header, .product-nav { display: flex; align-items: center; gap: 26px; min-width: 0; }
.brand { color: #27232e; text-decoration: none; flex: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; background: #26232d; border: 0; border-radius: 10px; color: white; font-size: 21px; font-weight: 750; transform: none; box-shadow: none; }
.brand-name { font-size: 16px; font-weight: 700; white-space: nowrap; }
.brand-name small { display: block; font-size: 9px; font-weight: 500; letter-spacing: .15em; color: var(--muted); }
.product-nav { align-self: stretch; gap: 24px; }
.product-nav > * { display: flex; gap: 6px; align-items: center; border-radius: 0; padding: 24px 0; background: transparent; color: #8b8792; font-size: 14px; white-space: nowrap; }
.product-nav button:disabled { opacity: 1; }
.product-nav .product-active { border-bottom: 3px solid var(--accent); font-weight: 650; color: #292530; }
.product-nav small { background: #f1eff5; border-radius: 4px; padding: 1px 5px; font-size: 10px; font-weight: 400; }
.topbar-actions { justify-content: flex-end; gap: 10px; }
.topbar-actions .button, .topbar-actions button { min-height: 30px; padding: 4px 8px; font-size: 11px; }
.topbar-account { font-size: 11px; }
.topbar-account-label { display: none; }
.topbar-account .secondary { padding: 4px 7px; text-decoration: none; border: 1px solid var(--stroke); border-radius: 6px; }
#account-identifier { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-ready .workspace { display: grid; grid-template-columns: 208px minmax(0, 1fr) clamp(300px, 27vw, 420px); width: 100%; padding: 0; gap: 0; margin: 0; align-items: stretch; overflow: hidden; }
.relay-rail { display: flex; flex-direction: column; gap: 24px; padding: 24px 14px 14px; border-right: 1px solid var(--stroke); background: #fcfcfd; overflow-y: auto; min-height: 0; }
.role-switcher { padding: 14px 12px; border: 1px solid var(--stroke); border-radius: 12px; background: #fff; }
.role-switcher label { font-weight: 650; margin-bottom: 10px; }
.role-switcher p { font-size: 11px; color: var(--muted); margin-top: 9px; }
.role-switcher select { font-weight: 550; min-height: 40px; }
.workspace-nav { display: grid; gap: 6px; }
.workspace-nav button { display: flex; justify-content: start; gap: 12px; min-height: 44px; padding: 10px 12px; background: transparent; color: #57525f; font-size: 13px; text-align: left; }
.workspace-nav button > span { width: 20px; font-size: 21px; font-weight: 400; line-height: 1; text-align: center; }
.workspace-nav button[aria-current] { background: #eee7fc; color: #7244c5; font-weight: 650; }
.account-nav { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--stroke); }
.rail-caption { font-size: 10px; color: #97939e; text-align: center; letter-spacing: .04em; }
.workspace-ready .control-column { display: block; padding: 28px clamp(20px, 2.2vw, 40px) 40px; overflow-y: auto; min-height: 0; scrollbar-gutter: auto; }
.workspace-ready .control-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
#live-controls, #room-settings { display: contents; }
#premium-panels { display: contents; }
.workspace-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.workspace-heading h1 { font-size: 26px; letter-spacing: -.04em; line-height: 1.4; margin-bottom: 6px; }
.workspace-eyebrow { font-size: 10px; letter-spacing: .12em; color: #96909e; margin-bottom: 7px; }
#workspace-description { color: var(--muted); font-size: 12px; }
.role-context { flex: none; max-width: 42%; padding: 5px 10px; border-radius: 7px; background: #eee7fc; color: #7144ba; font-size: 12px; overflow-wrap: anywhere; }
.scope-note { font-size: 11px; color: var(--muted); padding-bottom: 14px; border-bottom: 1px solid var(--stroke); }
.workspace-page { display: grid; align-content: start; gap: 18px; min-width: 0; }
.panel { border-radius: 12px; padding: 20px; }
.panel h2 { font-size: 15px; }
.panel-content { margin-top: 16px; }
.stack { gap: 16px; }
.panel-toggle { color: #8a8493; font-size: 11px; font-weight: 400; }
.panel > .panel { padding: 16px; background: #faf9fc; }
#prompt-form textarea { min-height: 92px; }
#persona { min-height: 115px; }
#scene-form > button, #prompt-form > button { justify-self: start; background: #24232b; color: white; }
.stage-arm-space { border-top: 1px solid var(--stroke); margin-top: 20px; padding-top: 16px; }
.quiet { color: var(--muted); }
.notice { color: #644395; background: #f0eafb; border: 1px solid #e2d7f5; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.workspace-empty { padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--stroke); border-radius: 12px; font-size: 13px; }
.workspace-page:has(> .panel:not([hidden]), > details:not([hidden])) > .workspace-empty { display: none; }
#studio-events { padding: 20px; background: #fff; border: 1px solid var(--stroke); border-radius: 12px; }
#studio-events .studio-events { max-height: none; }
.membership-tier { background: #f0eafb; color: #7144ba; }
.membership-tier[data-premium] { background: #fbf2dd; color: #795a21; }
.metrics div { background: #f7f6f9; }
.setting-feedback[data-error], #live-output-status[data-error] { color: #af314d; }
.settings-dialog { color: var(--text); background: white; }
.settings-dialog::backdrop { background: #21192e66; backdrop-filter: blur(3px); }
.workspace-ready .preview-column { display: flex; flex-direction: column; gap: 14px; position: static; width: 100%; min-width: 0; min-height: 0; padding: 24px 20px; overflow-y: auto; background: #fff; border-left: 1px solid var(--stroke); align-items: stretch; }
.preview-heading { display: flex; align-items: center; justify-content: space-between; }
.preview-heading h2 { font-size: 18px; }
.preview-heading .quiet { font-size: 11px; }
.preview-tabs { display: flex; padding: 3px; background: #f5f4f7; border: 1px solid var(--stroke); border-radius: 8px; }
.preview-tabs button { flex: 1; min-height: 32px; background: transparent; color: #82798d; font-size: 12px; border-radius: 5px; }
.preview-tabs button[aria-pressed="true"] { background: #fff; color: #794bc6; box-shadow: 0 1px 3px #1c123015; }
/* Remove decorative phone hardware; preserve the actual stage and its output window. */
.workspace-ready #phone-preview { display: block; position: relative; width: min(100%, calc((100dvh - 330px) * .5625)); min-width: 155px; aspect-ratio: 9 / 16; padding: 0; margin: 0 auto; border: 1px solid var(--stroke); border-radius: 12px; background: #f3f0f7; box-shadow: none; flex: none; overflow: hidden; }
.workspace-ready #phone-preview .phone-screen { display: block; position: relative; height: 100%; border: 0; border-radius: 0; background: #f3f0f7; box-shadow: none; }
.workspace-ready #phone-preview :is(.phone-hardware,.phone-camera,.phone-home,.phone-empty-mark) { display: none; }
.workspace-ready #phone-preview #stage-slot { position: relative; width: 100%; height: 100%; margin: 0; aspect-ratio: 9 / 16; }
.workspace-ready #phone-preview .stage { height: 100%; background: #eeebf3; }
.workspace-ready .stage-placeholder { color: #8c829a; background: #ffffffb0; font-size: 12px; }
.workspace-ready #phone-preview .phone-ui-overlay { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.workspace-ready .preview-clean #phone-preview .phone-ui-overlay { display: none; }
.workspace-ready .live-output-panel { width: 100%; margin: 0; }
.live-output-actions { display: flex; flex-direction: column; gap: 8px; }
.live-output-button { display: flex; width: 100%; justify-content: center; gap: 10px; min-height: 42px; padding: 10px; color: #fff; background: #24232b; border-color: #24232b; border-radius: 8px; box-shadow: none; }
.live-output-icon, .live-output-arrow, #live-output-hint { display: none; }
.live-output-copy { font-size: 13px; }
#open-occlusion-dialog { color: #7950bf; border: 0; min-height: 28px; background: transparent; font-size: 12px; }
.live-output-layout { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 11px; }
.live-output-layout select { width: auto; max-width: 75%; min-height: 32px; font-size: 11px; }
#live-output-status { color: var(--muted); }
#account-panels[aria-busy="true"] { opacity: .55; }
@media (max-width: 1250px) {
  .topbar { padding: 0 16px; gap: 14px; }
  .product-header, .product-nav { gap: 16px; }
  .product-nav > * { font-size: 12px; }
  .product-nav small { font-size: 9px; }
  .brand-name { font-size: 14px; }
  .workspace-ready .workspace { grid-template-columns: 180px minmax(0, 1fr) 300px; }
  .topbar-actions { gap: 6px; }
  #obs-link { display: none; }
}
@media (max-width: 1000px) {
  .topbar { flex-wrap: wrap; padding-block: 8px; }
  .product-nav > * { padding: 12px 0; }
  .workspace-ready .workspace { grid-template-columns: 160px minmax(0, 1fr) 270px; }
  .workspace-ready .control-column { padding: 22px 16px; }
  .workspace-ready .preview-column { padding: 22px 14px; }
  .workspace-heading { flex-wrap: wrap; }
  .role-context { max-width: 100%; }
  .panel { padding: 16px; }
}
@media (max-width: 790px) {
  .workspace-ready.console { height: auto; display: block; }
  .workspace-ready .workspace { display: grid; grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .relay-rail { gap: 12px; border-right: 0; border-bottom: 1px solid var(--stroke); padding: 14px; }
  .role-switcher { display: flex; align-items: center; gap: 12px; padding: 8px 12px; }
  .role-switcher label { margin: 0; white-space: nowrap; }
  #global-role-slot { flex: 1; min-width: 0; }
  .role-switcher p, .rail-caption { display: none; }
  .workspace-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .workspace-nav button { min-height: 36px; padding: 6px 10px; font-size: 12px; gap: 5px; }
  .workspace-nav button > span { display: none; }
  .account-nav { margin: 0; padding: 0; border: 0; }
  .workspace-ready .control-column { width: 100%; overflow: visible; padding: 24px 16px; }
  .workspace-ready .preview-column { order: initial; border-left: 0; border-top: 1px solid var(--stroke); padding: 22px; }
  .workspace-ready #phone-preview { width: min(100%, 290px); }
  .product-nav { gap: 12px; }
  .product-nav small { display: none; }
  .brand-name { font-size: 12px; }
  .brand-mark { width: 28px; height: 28px; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
}
/* Keep the existing standalone sign-in composition from staging. */
#console-view:has(#login-panel:not([hidden])) .relay-rail { display: none; }
.launch-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.launch-steps button { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 15px; border: 1px solid var(--stroke); border-radius: 9px; background: #fcfbfe; color: var(--text); text-align: left; }
.launch-steps .step-number { grid-column: 1; font-size: 11px; color: #967dbd; letter-spacing: .1em; }
.launch-steps strong { grid-column: 1; font-size: 13px; font-weight: 600; }
.launch-steps small { grid-column: 1 / -1; font-size: 11px; color: var(--muted); font-weight: 400; }
.launch-steps button > span:last-child { grid-column: 2; grid-row: 1; color: #8b75ac; }
.collector-advanced > label { margin-top: 12px; }
.collector-advanced > p { margin-top: 8px; }
.workspace-ready #phone-preview { width: min(100%, calc((100dvh - 410px) * .5625)); }
@media (max-width: 1000px) { .launch-steps { grid-template-columns: 1fr; } .launch-steps button { grid-template-columns: auto 1fr auto; align-items: center; } .launch-steps .step-number { grid-area: 1 / 1; } .launch-steps strong { grid-area: 1 / 2; } .launch-steps small { grid-area: 2 / 2; } .launch-steps button > span:last-child { grid-area: 1 / 3; } }
@media (max-width: 790px) { .workspace-ready #phone-preview { width: min(100%, 290px); } }
.notice[data-error] { color: #9f354d; background: #fff1f3; border-color: #edd3da; }
@media (max-width: 790px) {
  .workspace-ready .preview-column:has(.live-output-panel:not([hidden])) { order: initial; }
}
/* Refined control system: consistent sizing, restrained surfaces and compact action rows. */
.workspace-page :is(button, .button), .settings-dialog button {
  min-height: 38px;
  padding: 9px 16px;
  gap: 7px;
  border-radius: 9px;
  border: 1px solid #28222f;
  background: #302738;
  color: #fff;
  box-shadow: 0 1px 2px #25142b12, inset 0 1px 0 #ffffff0c;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.3;
  white-space: normal;
  transition: background-color .16s, border-color .16s, box-shadow .16s;
}
.workspace-page :is(button, .button):hover:not(:disabled), .settings-dialog button:hover:not(:disabled) {
  background: #493753;
  border-color: #493753;
  box-shadow: 0 2px 5px #25142b16;
  filter: none;
}
.workspace-page :is(.secondary, .outline), .settings-dialog :is(.secondary, .outline) {
  background: #fff;
  border-color: #e3dfe8;
  color: #51465d;
  box-shadow: 0 1px 2px #25142b06;
}
.workspace-page :is(.secondary, .outline):hover:not(:disabled), .settings-dialog :is(.secondary, .outline):hover:not(:disabled) {
  background: #f6f2fa;
  color: #704ba4;
  border-color: #cdbde0;
}
.workspace-page .text-button, .settings-dialog .text-button {
  min-height: 30px;
  padding: 5px 9px;
  background: transparent;
  border-color: transparent;
  color: #80618f;
  box-shadow: none;
  font-size: 12px;
}
.workspace-page .text-button:hover:not(:disabled), .settings-dialog .text-button:hover:not(:disabled) {
  background: #f3edf8;
  color: #6d4295;
  border-color: transparent;
  box-shadow: none;
}
.workspace-page .danger, .settings-dialog .danger { background: #fff5f5; border-color: #f0d9dc; color: #a74758; box-shadow: none; }
.workspace-page .danger:hover:not(:disabled), .settings-dialog .danger:hover:not(:disabled) { background: #fce9ed; border-color: #e2b3be; color: #963247; }
.workspace-page button:disabled, .settings-dialog button:disabled { opacity: 1; background: #f4f2f6; color: #aaa3b1; border-color: #eae6ef; box-shadow: none; }
.workspace-page .panel-toggle { min-height: 28px; padding: 5px 8px; font-size: 11px; color: #93869c; }
.workspace-page :is(input, select, textarea), .settings-dialog :is(input, select, textarea) { border-color: #e4dfe9; padding: 10px 12px; min-height: 42px; font-size: 13px; border-radius: 9px; background: #fefeff; line-height: 1.55; }
.workspace-page :is(input, select, textarea):focus, .settings-dialog :is(input, select, textarea):focus { outline: 0; border-color: #b99ecf; box-shadow: 0 0 0 3px #9970c013; background: #fff; }
.workspace-page input[type="range"], .settings-dialog input[type="range"] { min-height: 24px; padding: 0; background: transparent; box-shadow: none; }
.workspace-page input[type="checkbox"], .settings-dialog input[type="checkbox"] { min-height: 16px; padding: 0; box-shadow: none; }
.workspace-page label { font-size: 13px; font-weight: 500; gap: 8px; color: #62576b; }
.workspace-page .panel { padding: 22px; border-color: #e9e4ee; box-shadow: 0 2px 5px #23142a03; }
.workspace-page .section-heading { gap: 10px; flex-wrap: wrap; }
.workspace-page .panel-heading h2 { font-size: 16px; font-weight: 650; letter-spacing: -.02em; }
.workspace-page .panel-content { margin-top: 20px; }
.workspace-page .pair-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.workspace-page .pair-actions > button { flex: 0 1 auto; }
.workspace-page .compact-setting-row { gap: 10px; }
.workspace-page :is(#asset-tools, #studio-bgm-settings) { margin-top: 16px; }
.workspace-page :is(#scene-form, #simulate-form, #speak-form, #prompt-form) > button { justify-self: start; min-width: 108px; }
#scene-form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
#scene-form > button { min-height: 42px; }
.workspace-page :is(#asset-tools, #prompt-panel) > .compact-setting-row { padding: 10px; border: 1px solid #eee9f3; border-radius: 10px; background: #fcfafd; }
#prompt-panel .panel-content > .compact-setting-row { margin-top: 12px; margin-bottom: 18px; }
#prompt-panel .panel-content > .studio-details { border-top: 1px solid #eee9f3; padding-top: 18px; }
#prompt-advanced { margin-top: 20px; }
#prompt-advanced .panel { padding: 14px 16px; background: #fdfbff; }
#prompt-panel #prompt-role { font-size: 12px; }
#scene-panel .stage-arm-space { margin: 0; }
#workspace-character > .panel > .stage-arm-space { border: 0; margin: 0; padding-top: 4px; }
.workspace-page .stage-footer { gap: 12px; flex-wrap: wrap; }
.workspace-page .bgm-controls .stage-footer { align-items: center; }
.workspace-page .launch-steps button { padding: 16px; background: #fbf9fd; color: #4e3e5d; border-color: #eae2f0; text-align: left; box-shadow: none; }
.workspace-page .launch-steps button:hover:not(:disabled) { background: #f2ebf8; color: #664180; border-color: #ccb7dd; box-shadow: none; }
.workspace-page .launch-steps small { font-size: 11px; line-height: 1.6; color: #94849e; }
.workspace-page .launch-steps strong { font-size: 14px; }
#open-live-output { border-radius: 10px; min-height: 44px; background: #302738; border-color: #302738; font-weight: 550; box-shadow: 0 2px 5px #25142b12; }
#open-live-output:hover:not(:disabled) { background: #493753; border-color: #493753; }
#open-live-output:disabled { background: #f0edf4; border-color: #e6e1ed; color: #9e93aa; opacity: 1; box-shadow: none; }
#open-live-output:disabled .live-output-copy { color: #9e93aa; }
.workspace-ready .live-output-layout { padding: 12px 0; border-top: 1px solid #eee9f3; margin-top: 10px; }
.workspace-ready .preview-tabs { border: 0; background: #f3eff7; padding: 4px; }
.workspace-ready .preview-tabs button { font-weight: 550; }
.workspace-ready .preview-tabs button[aria-pressed="true"] { color: #78538e; box-shadow: 0 1px 4px #29153312; }
.topbar-actions :is(button, .button) { min-height: 32px; border-radius: 7px; padding: 6px 10px; font-weight: 500; background: #fff; border: 1px solid #e9e3ee; color: #7a6c85; box-shadow: none; }
.topbar-actions :is(button, .button):hover:not(:disabled) { background: #f5f0f9; border-color: #d9cbe4; filter: none; }
/* Character picker: current scope plus asset action in a single popover. */
#global-role-slot { position: relative; }
.role-switcher { padding: 14px 12px 12px; background: #fefcfe; border-color: #e9e2ee; }
.role-switcher label { font-size: 12px; font-weight: 550; color: #9b87a8; margin-bottom: 10px; }
.role-picker-trigger { display: flex; width: 100%; justify-content: flex-start; gap: 9px; min-height: 46px; padding: 8px 10px; border: 1px solid #e9e1ef; border-radius: 9px; background: #fff; color: #48364f; box-shadow: 0 1px 3px #21112905; }
.role-picker-trigger:hover:not(:disabled), .role-picker-trigger[aria-expanded="true"] { background: #f8f3fb; border-color: #c8b4d8; filter: none; }
.role-picker-avatar { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; color: #9974b3; background: #f0e6f7; font-size: 12px; flex: none; }
.role-picker-name { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.role-picker-chevron { width: 6px; height: 6px; margin: 0 3px 3px; border: solid #9f8baa; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.role-picker-menu { position: fixed; inset: auto; margin: 0; padding: 6px; border: 1px solid #e7ddec; border-radius: 12px; background: #fff; color: #4b3953; box-shadow: 0 8px 28px #2b12351f, 0 2px 5px #2b12350a; overflow-y: auto; z-index: 30; }
.role-picker-menu:popover-open { display: flex; flex-direction: column; }
.role-picker-options { display: grid; gap: 3px; }
.role-picker-menu button { justify-content: space-between; gap: 8px; width: 100%; background: transparent; color: #66526f; padding: 11px 12px; border: 0; border-radius: 7px; font-size: 13px; font-weight: 500; text-align: left; box-shadow: none; }
.role-picker-menu button:hover:not(:disabled), .role-picker-menu button:focus-visible { background: #f6effa; color: #754294; filter: none; }
.role-picker-menu button[aria-checked="true"] { background: #f3eaf9; color: #754294; }
.role-picker-menu .role-picker-add { margin-top: 7px; padding-top: 12px; border-top: 1px solid #eee6f3; border-radius: 0 0 6px 6px; justify-content: flex-start; color: #8b5da4; }
.role-picker-add::before { content: "+"; font-size: 19px; font-weight: 400; }
.role-picker-menu button:disabled { color: #b4a9bc; opacity: 1; cursor: not-allowed; }
.role-switcher #role-switch-status { font-size: 10px; color: #a292ad; }
@media (max-width: 1000px) { .workspace-page .panel { padding: 18px; } }
@media (max-width: 550px) { #scene-form { grid-template-columns: minmax(0, 1fr); } .workspace-page .pair-actions > button { flex-grow: 1; } .workspace-page .compact-setting-row > button { flex: 1 1 auto; } .role-picker-trigger { min-height: 40px; } }
@media (prefers-reduced-motion: reduce) { .workspace-page button, .settings-dialog button { transition: none; } }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; border-top: 1px solid #eee8f3; padding-top: 16px; }
.form-actions > button { min-width: 90px; }
@media (max-width: 550px) { .form-actions > button { flex: 1; } }
