/* the studio: big live preview on the left, the customizer on the right */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; padding: 18px 22px 24px; height: calc(100vh - 57px); min-height: 560px; }
.preview { position: relative; border-radius: 22px; overflow: hidden; background: var(--bg2); border: 1px solid var(--line); min-height: 0; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.nameplate { position: absolute; left: 18px; top: 16px; display: flex; flex-direction: column; gap: 2px; max-width: 60%; padding: 10px 14px; border-radius: 14px; background: rgba(10, 9, 18, .55); backdrop-filter: blur(8px); }
.nameplate b { font: 800 20px var(--display); }
.nameplate span { color: var(--dim); font-size: 13px; }
.modes { position: absolute; right: 16px; top: 16px; display: flex; padding: 4px; border-radius: 14px; background: rgba(10, 9, 18, .6); backdrop-filter: blur(8px); }
.modes button { white-space: nowrap; border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; font-weight: 800; color: var(--dim); }
.modes button.on { background: var(--fg); color: #120f20; }
.dock { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 16px; background: rgba(10, 9, 18, .62); backdrop-filter: blur(10px); }
.dock[hidden] { display: none; }
.dock button { white-space: nowrap; border: 1px solid var(--line2); background: rgba(255, 255, 255, .05); border-radius: 10px; padding: 7px 11px; font-weight: 700; font-size: 13px; }
.dock button:hover { border-color: var(--accent); }
.dock-label { font-weight: 800; color: var(--dim); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.dock .slider { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); font-weight: 700; margin-left: 4px; }
.dock .slider input { width: 96px; accent-color: var(--accent); }
.dock .check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--dim); }
.dock .status { font-weight: 800; font-size: 13px; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .07); }
.dock .status.ok { color: var(--mint); }
.dock .status.bad { color: #ff8aa8; }
#camPeek { position: absolute; right: 16px; top: 70px; width: 160px; border-radius: 12px; border: 1px solid var(--line2); transform: scaleX(-1); opacity: .9; }
#camPeek[hidden] { display: none; }

.panel { display: flex; flex-direction: column; min-height: 0; border-radius: 22px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: transparent; padding: 7px 11px; border-radius: 10px; font-weight: 800; font-size: 13px; color: var(--dim); }
.tabs button.on { background: rgba(139, 92, 255, .2); color: var(--fg); }
.tabbody { flex: 1; overflow: auto; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 18px; }
.group h3 { margin: 0 0 9px; font: 800 12px var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.tile { border: 1px solid var(--line2); background: rgba(255, 255, 255, .03); border-radius: 12px; padding: 10px 8px; font-weight: 800; font-size: 13px; text-align: center; }
.tile:hover { border-color: #5a5390; }
.tile.on { border-color: var(--accent); background: rgba(139, 92, 255, .18); box-shadow: inset 0 0 0 1px var(--accent); }
.tile .emo { display: block; font-size: 22px; line-height: 1.2; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .15); padding: 0; }
.sw.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.swatches input[type=color] { width: 34px; height: 34px; border: 1px dashed var(--line2); border-radius: 10px; background: none; padding: 2px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field input, .field textarea { font: inherit; color: var(--fg); background: var(--bg2); border: 1px solid var(--line2); border-radius: 12px; padding: 10px 12px; }
.field textarea { min-height: 84px; resize: vertical; }
.field small { color: var(--dim2); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; }
/* the two main actions stay at the bottom of the panel, always in view */
.panel-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--card); }
.panel-actions .btn { justify-content: center; padding: 13px 16px; font-size: 15px; border-radius: 14px; }
.privacy { margin: 0; padding: 10px 16px 14px; color: var(--dim2); font-size: 12px; border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 50; padding: 12px 18px; border-radius: 14px; background: #1e1a33; border: 1px solid var(--line2); font-weight: 800; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.toast[hidden] { display: none; }

@media (max-width: 980px) {
  .studio { grid-template-columns: 1fr; height: auto; padding: 12px 16px 20px; }
  .preview { height: 64vh; min-height: 380px; }
  .panel { max-height: none; }
  .tabbody { overflow: visible; }
}
@media (max-width: 520px) {
  .preview { height: 58vh; }
  .dock { left: 8px; right: 8px; bottom: 8px; padding: 8px; gap: 6px; }
  .dock .slider input { width: 70px; }
  .nameplate { left: 10px; top: 10px; }
  .modes { right: 10px; top: 10px; }
  #camPeek { width: 110px; top: 62px; right: 10px; }
}

/* "your VTuber is ready" */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(6, 5, 12, .7); backdrop-filter: blur(6px); }
.modal[hidden] { display: none; }
.sheet { width: min(460px, 100%); padding: 26px 24px 20px; border-radius: 24px; background: var(--card); border: 1px solid var(--line2); text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.sheet img { width: 148px; height: 148px; border-radius: 28px; object-fit: cover; border: 1px solid var(--line2); background: var(--bg2); }
.sheet .kicker { margin: 14px 0 0; color: var(--mint); font-weight: 800; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.sheet h2 { margin: 4px 0 2px; font: 800 24px var(--display); }
.sheet .who { margin: 0 0 16px; color: var(--dim); }
.sheet .who b { color: var(--fg); }
.sheet .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet .acts .btn { justify-content: center; }
.sheet .acts .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.sheet .fine { margin: 14px 0 0; color: var(--dim2); font-size: 12px; }
.sheet code { color: var(--dim); }
