/* Shared visual layer for the three live applications. */
:root{--ink:#f3f1f7;--quiet:#b0adbc;--surface:#1b1923;--inset:#14121b;--edge:#373342;--accent:#91eed6;--accent-ink:#132c25;--pulse:#ff8b9d;--coin:#f5ce82}
.live-surface{color-scheme:dark;background:#121118;color:var(--ink);font-size:14px;line-height:1.5;letter-spacing:0}
.live-surface button,.live-surface input,.live-surface select{font:inherit}
.live-surface button{transition:background-color .16s,border-color .16s;color:inherit}
.live-surface :is(button,a,input,select):focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.live-surface button:disabled{opacity:.52;cursor:not-allowed}
.live-surface :is(.appbar,.top,.ops-header){min-height:68px;height:auto;padding-block:12px;background:#17151e;border-color:var(--edge);gap:16px}
.live-surface .brand{letter-spacing:0;white-space:nowrap;color:var(--ink);font-weight:700;font-size:15px}
.live-surface :is(.brand-mark,.brand>span:first-child,.login-mark){background:var(--accent);color:var(--accent-ink);width:34px;height:34px;border-radius:7px;font-size:19px}
.live-surface :is(.top-right,.header-right,.main-nav,.bar-actions){gap:14px}
.live-surface :is(.top-right a,.header-right a,.main-nav a,.user-label,#host-user){color:var(--quiet);font-size:13px;white-space:nowrap}
.live-surface :is(.top-right a,.header-right a,.main-nav a):hover{color:var(--accent)}
.live-surface :is(.primary,.btn-primary,.modal-confirm,.host-cta,.gift-send-row>button,.compose-row>button,.register-submit){background:var(--accent);color:var(--accent-ink);border:1px solid transparent;border-radius:6px;font-weight:700;min-height:40px;font-size:13px}
.live-surface :is(.primary,.btn-primary,.modal-confirm,.host-cta,.gift-send-row>button,.compose-row>button):hover:not(:disabled){background:#b6f7e7;color:var(--accent-ink)}
.live-surface :is(.secondary,.btn-secondary,.profile-button,.modal-cancel,.icon-btn,.row-actions button){background:#282531;border:1px solid var(--edge);color:var(--ink);min-height:36px;border-radius:6px;font-size:13px;padding:7px 12px}
.live-surface :is(.secondary,.btn-secondary,.profile-button,.modal-cancel,.icon-btn,.row-actions button):hover:not(:disabled){background:#34303e;border-color:#595164}
.live-surface :is(.btn-danger,.row-actions button[data-end]){color:#ffc4cb;background:#38222d;border-color:#654051}
.live-surface :is(.btn-danger,.row-actions button[data-end]):hover{background:#533040}
.live-surface :is(input,select){background:var(--inset);border-color:var(--edge);color:var(--ink);min-height:40px;border-radius:6px;font-size:14px}
.live-surface input::placeholder{color:#938e9f}
.live-surface :is(dialog,.login-view form){background:var(--surface);border:1px solid var(--edge);color:var(--ink);border-radius:8px;box-shadow:0 20px 56px #0007}
.live-surface :is(dialog p,.login-view p,.panel-head p,.section-head p,.empty,.empty-note){color:var(--quiet);font-size:13px}
.live-surface :is(dialog h2,.login-view h1){font-size:22px}
.live-surface :is(dialog label,.modal-field span,.wallet-form label,.login-view label,.form-grid label){color:var(--quiet);font-size:13px}
.live-surface .toast{font-size:13px;background:var(--accent);color:var(--accent-ink)}

/* Audience: keep the video and conversation on the same visual plane. */
.viewer .appbar{justify-content:space-between}
.viewer .main-nav{height:auto}
.viewer .main-nav a{display:block;padding:7px 10px;border:none;border-radius:6px}
.viewer .main-nav a.nav-active{background:#263631;color:var(--accent)}
.viewer .bar-actions{margin-left:0}
.viewer :is(.lobby-heading,.room-head){gap:16px}
.viewer .lobby-heading{padding-bottom:18px;border-bottom:1px solid var(--edge)}
.viewer .lobby-heading h1,.viewer .room-head h1{font-size:28px;overflow-wrap:anywhere}
.viewer :is(.lobby-heading small,.eyebrow){font-size:12px;color:var(--quiet);letter-spacing:0}
.viewer .host-cta{display:inline-flex;align-items:center;gap:12px;white-space:nowrap}
.viewer .live-list{gap:18px;grid-template-columns:repeat(auto-fill,minmax(min(100%,240px),1fr))}
.viewer .live-card{background:var(--surface);border-color:var(--edge);border-radius:8px}
.viewer .live-card:hover{border-color:var(--accent)}
.viewer .live-card-info{padding:13px 15px}
.viewer .live-card-info strong{font-size:16px;overflow-wrap:anywhere}
.viewer .live-card-info small,.viewer .live-card-visual>b{font-size:12px;color:var(--quiet)}
.viewer .live-card-visual{height:auto;aspect-ratio:16/9;background:#2b2535}
.viewer .live-list>.empty-note{grid-column:1/-1;padding:48px 16px;text-align:center;border:1px dashed var(--edge);border-radius:8px}
.viewer :is(.video-stage,.chat-panel){height:clamp(400px,45vw,620px);border-radius:8px}
.viewer .video-stage{background:#201c2a}
.viewer .live-dot,.viewer .live-pill i{background:var(--pulse)}
.viewer .live-pill{color:#ffe2e7;background:#3b2531;font-size:11px}
.viewer :is(.host-avatar,.mini-avatar,.chat-avatar){background:#b7a5e2;color:#211731}
.viewer :is(.host-line b,.host-now b,.room-code){font-size:13px}
.viewer :is(.host-line small,.host-now small,.head-stats small){font-size:12px;color:var(--quiet)}
.viewer .head-stats b{font-size:21px;font-variant-numeric:tabular-nums}
.viewer .panel-card{background:var(--surface);border-color:var(--edge);border-radius:8px}
.viewer .panel-heading{height:48px;border-color:var(--edge)}
.viewer .tab{font-size:14px;color:var(--quiet)}
.viewer .tab.active{border-color:var(--accent);color:var(--accent)}
.viewer :is(.chat-row p,.chat-meta>b,.rank-name b,.gift-title>div b,.contact-row b){font-size:14px}
.viewer :is(.translation,.translation-error,.chat-meta time,.rank-coins,.gift-title>div small,.gift-send-row>span,.contact-row small,.translate-state){font-size:12px;color:var(--quiet)}
.viewer :is(.gift-item small,.coin-balance,.rank-coins){color:var(--coin);font-size:12px}
.viewer .gift-item{background:#25222f;border-radius:6px;padding:8px 4px}
.viewer .gift-item.selected{border-color:var(--accent);background:#25332f}
.viewer .gift-item span{font-size:22px}
.viewer .gift-item b{font-size:12px}
.viewer .gift-panel{padding:15px}
.viewer :is(.chat-composer,.gift-send-row,.rank-row){border-color:var(--edge)}
.viewer .compose-row>button{width:42px;font-size:20px}
.viewer :is(.wish-float,.goal-float){background:#191520ed;border:1px solid #554b62;max-width:calc(100% - 24px);border-radius:6px}
.viewer .wish-items{flex-wrap:wrap}
.viewer :is(.goal-heading,.goal-heading b,.goal-float>small,.wish-title,.wish-items>b,.wish-items>small){font-size:12px}
.viewer .progress i,.studio .goal-bar i{background:var(--accent)}

/* Studio and operations: use clear section rules, not stacked cards. */
.studio .layout{grid-template-columns:minmax(0,1fr) minmax(300px,360px);gap:24px}
.live-surface :is(.page-title h1,.page-head h1){font-size:28px;line-height:1.25}
.live-surface :is(.page-title small,.page-head small){font-size:12px;color:var(--accent);letter-spacing:0}
.studio .preview{height:auto;aspect-ratio:16/9;border-radius:8px;background:#211d2a;border-color:var(--edge)}
.studio .preview-empty b{font-size:17px;color:var(--ink)}
.studio :is(.preview-empty small,.broadcast-actions>span,.preview-footer){font-size:13px;overflow-wrap:anywhere}
.studio .preview-footer{gap:10px;background:#14121bdf}
.studio .preview-footer>span:last-child{flex:none}
.studio .broadcast-actions{margin:14px 0 22px;min-height:40px}
.studio .state-pill{font-size:12px;color:var(--quiet);background:#24212d;border-color:var(--edge)}
.studio .state-pill.on{color:var(--accent);border-color:#4a8777}
.studio .panel,.ops .table-panel{background:transparent;border:0;border-top:1px solid var(--edge);border-radius:0;padding:16px 0;margin-bottom:12px}
.studio :is(.section-head h2,.section-head h3),.ops .panel-head h2{font-size:17px}
.studio .form-grid{gap:14px}
.studio .form-grid small{color:var(--quiet);font-size:12px}
.studio .stat-grid{border:0;background:transparent;gap:8px}
.studio .stat-grid>div,.ops .metrics>div{background:var(--surface);border:1px solid var(--edge);border-radius:7px;padding:12px}
.studio :is(.stat-grid small,.wish-row small,.request-row small,.leader-row small,.online-row small),.ops .metrics small{font-size:12px;color:var(--quiet)}
.studio :is(.stat-grid b,.counter),.ops .metrics b{font-variant-numeric:tabular-nums}
.studio .stat-grid b{font-size:21px}
.studio .icon-btn{width:36px;padding:0}
.studio :is(.wish-row,.host-chat-row){background:var(--surface);border-color:var(--edge)}
.studio :is(.wish-row b,.request-row b,.leader-row b,.online-row b,.host-chat-row p,.host-chat-row header){font-size:13px;overflow-wrap:anywhere}
.studio .request-row button{font-size:12px;min-height:34px}
.ops .metrics{gap:12px;margin:20px 0}
.ops .metrics b{font-size:25px;color:var(--accent)}
.ops th,.ops td{font-size:13px;border-color:var(--edge);padding:11px 12px}
.ops th{background:#252130;color:var(--quiet)}
.ops tbody tr:nth-child(even){background:#191720}
.ops tbody tr:hover{background:#211d29}
.ops .table-wrap{border:1px solid var(--edge);border-radius:7px}
.ops .sub{display:block;color:var(--quiet);font-size:12px}
.ops .positive{color:var(--accent)}
.ops .negative{color:var(--pulse)}
.ops .wallet-form input{width:100%;min-width:0}
.ops .wallet-result{font-size:13px}
.ops .login-view form{padding:26px}
.ops .login-view input{width:100%;min-width:0}
.ops .login-view #login-error{font-size:13px;color:#ffb3bf}

@media(max-width:820px){
  .studio .layout{display:flex;flex-direction:column;align-items:stretch;width:calc(100% - 32px)}
  .viewer .workspace{display:flex;flex-direction:column;gap:16px}
  .viewer .side-column{display:flex}
  .viewer .video-stage{width:100%;max-width:100%;height:auto;min-height:0;aspect-ratio:4/3}
  .viewer .chat-panel{height:420px;order:0}
  .viewer .chat-panel,.viewer .gift-panel{max-height:none}
}
@media(max-width:520px){
  .live-surface :is(.appbar,.top,.ops-header){flex-wrap:wrap;gap:8px 14px;padding:10px 14px}
  .live-surface :is(.top-right,.header-right,.main-nav,.bar-actions){gap:8px}
  .viewer .main-nav{order:3;width:100%;height:auto}
  .viewer .main-nav a{font-size:13px}
  .viewer .room-head{flex-direction:column;align-items:flex-start}
  .viewer .head-stats{margin:0}
  .viewer :is(.room-head h1,.lobby-heading h1),.live-surface :is(.page-title h1,.page-head h1){font-size:23px}
  .viewer .lobby-view{padding-top:20px}
  .viewer .live-list{grid-template-columns:1fr}
  .viewer .video-stage{aspect-ratio:1;min-height:310px}
  .viewer .goal-float{width:min(228px,calc(100% - 24px))}
  .viewer :is(.under-stage,.private-offer,.contact-row,.gift-send-row){flex-wrap:wrap;gap:8px}
  .viewer :is(.private-offer,.room-tags,.contact-row>span){min-width:0;max-width:100%}
  .viewer .private-offer>button{max-width:100%;white-space:normal}
  .viewer .room-tags{flex-wrap:wrap}
  .viewer .wish-float{width:auto;min-width:0;right:12px;left:12px;max-height:82px;overflow:auto}
  .studio .form-grid{grid-template-columns:1fr}
  .studio .broadcast-actions>span{width:100%}
  .ops .metrics{gap:6px}
  .ops .metrics>div{padding:9px}
  .ops .metrics b{font-size:20px}
  .ops .wallet-form{grid-template-columns:1fr 1fr}
  .ops .panel-head{gap:10px}
  .ops .panel-head button{flex:none}
}
@media(prefers-reduced-motion:reduce){.live-surface *{transition:none!important}}
