*{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,Arial,sans-serif;background:#f5f7fb;color:#111827}a{color:inherit}.topbar{padding:28px 4vw;display:flex;justify-content:space-between;gap:20px;align-items:center;background:linear-gradient(135deg,#2563eb,#7c3aed);color:#fff}.topbar h1{margin:4px 0;font-size:clamp(28px,4vw,48px);letter-spacing:-1.5px}.topbar p{margin:6px 0 0;color:#dbeafe}.eyebrow{font-size:11px;letter-spacing:2px;font-weight:800;opacity:.72}.btn{border:0;border-radius:12px;padding:12px 18px;font-weight:800;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center}.btn.primary{background:#2563eb;color:#fff}.btn.ghost{background:rgba(255,255,255,.14);color:#fff;border:1px solid rgba(255,255,255,.3)}.btn.small{padding:8px 12px;background:#e8eefc;color:#1d4ed8}.dashboard{max-width:1400px;margin:24px auto;padding:0 20px 60px}.grid{display:grid;grid-template-columns:2fr 1fr 1fr;gap:16px}.card{background:#fff;border:1px solid #e5e7eb;border-radius:22px;padding:24px;box-shadow:0 10px 30px rgba(15,23,42,.05);margin-bottom:16px}.status-row{display:flex;gap:10px;align-items:center;margin:16px 0 8px;font-size:20px}.status-dot{width:12px;height:12px;border-radius:50%;background:#9ca3af}.status-dot.on{background:#22c55e;box-shadow:0 0 0 6px #dcfce7}.status-card p,.card p{color:#64748b}.status-meta{display:flex;gap:24px;font-size:13px;color:#64748b}.big{font-size:42px;font-weight:900;margin:14px 0 0}.section-title{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;margin-bottom:20px}.section-title h2{margin:5px 0;font-size:25px}.pill{padding:8px 12px;border-radius:999px;background:#eef2ff;color:#4f46e5;font-size:11px;font-weight:800}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}label{font-weight:800;font-size:13px;color:#475569}input{display:block;width:100%;margin-top:8px;padding:14px 16px;border:1px solid #dbe2ea;border-radius:13px;font-size:16px;outline:none}input:focus{border-color:#6366f1;box-shadow:0 0 0 4px #eef2ff}.switch-wrap{margin-top:13px;display:flex;align-items:center;gap:10px;color:#64748b;font-weight:500}.switch-wrap input{display:none}.switch{width:46px;height:26px;background:#cbd5e1;border-radius:30px;position:relative}.switch:after{content:"";width:20px;height:20px;background:#fff;border-radius:50%;position:absolute;left:3px;top:3px;transition:.2s}.switch-wrap input:checked+.switch{background:#22c55e}.switch-wrap input:checked+.switch:after{left:23px}.endpoint{margin:20px 0;padding:13px 14px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:13px;display:flex;align-items:center;gap:12px}.endpoint span{font-size:12px;font-weight:800;color:#64748b}.endpoint code{flex:1;word-break:break-all}.save-msg{margin-left:12px;color:#16a34a;font-weight:700;font-size:13px}.sim-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:10px}.sim-grid button{border:1px solid #e2e8f0;background:#f8fafc;padding:13px 8px;border-radius:12px;font-weight:800;cursor:pointer}.event-list{display:flex;flex-direction:column;gap:9px;max-height:420px;overflow:auto}.event-item{display:flex;gap:12px;align-items:center;padding:12px 14px;border:1px solid #edf0f5;border-radius:14px;background:#fbfcfe}.event-icon{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;background:#eef2ff;font-size:18px}.event-body{flex:1}.event-body b{display:block}.event-body span{font-size:13px;color:#64748b}.event-type{font-size:11px;font-weight:900;text-transform:uppercase;color:#6366f1}.install pre{background:#0f172a;color:#dbeafe;padding:16px;border-radius:14px;overflow:auto}.note{font-size:12px!important}.overlay-page{min-height:100vh}.live-shell{max-width:1400px;margin:24px auto;padding:0 20px 60px;display:grid;grid-template-columns:1.4fr .8fr;gap:18px}.stage{min-height:650px;background:radial-gradient(circle at 50% 35%,#273c73,#0b1020 65%);border-radius:28px;padding:22px;color:#fff;position:relative;overflow:hidden}.stage-top{display:flex;gap:12px;align-items:center;font-weight:900}.live-dot{width:10px;height:10px;border-radius:50%;background:#ef4444;box-shadow:0 0 0 6px rgba(239,68,68,.18)}.viewer{margin-left:auto;color:#cbd5e1;font-size:12px}.welcome{position:absolute;inset:0;display:grid;place-items:center;color:#94a3b8;font-weight:800;font-size:18px}.feed{position:absolute;inset:60px 20px 20px;display:flex;flex-direction:column;justify-content:flex-end;align-items:flex-start;gap:10px}.live-card{max-width:min(88%,560px);padding:10px 14px;border-radius:18px;background:rgba(15,23,42,.28);color:#fff;box-shadow:0 8px 24px rgba(0,0,0,.18);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border:1px solid rgba(255,255,255,.20);animation:pop .25s ease}.live-card.gift{border-color:rgba(251,191,36,.55);background:rgba(251,191,36,.14)}.live-card .tag{font-size:10px;font-weight:900;color:#c7d2fe;text-transform:uppercase;letter-spacing:.4px}.live-card-content{min-width:0}.live-card-content b{display:block;margin-top:2px}.live-message{margin-top:2px;word-break:break-word}.welcome{transition:opacity .2s ease}.welcome.hidden{opacity:0;pointer-events:none}.event-panel{background:#fff;border:1px solid #e5e7eb;border-radius:28px;padding:22px}.panel-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.panel-head h2{margin:4px 0}.panel-head>span{font-size:12px;color:#64748b}.event-panel .event-list{max-height:590px}@keyframes pop{from{transform:translateY(10px);opacity:0}to{transform:none;opacity:1}}@media(max-width:900px){.grid,.form-grid,.live-shell{grid-template-columns:1fr}.sim-grid{grid-template-columns:repeat(2,1fr)}.topbar{align-items:flex-start;flex-direction:column}.stage{min-height:520px}}
.form-grid.second{margin-top:18px}.provider-info{display:flex;align-items:center;gap:14px;padding:14px 16px;border:1px solid #dbe2ea;border-radius:13px;color:#64748b}.provider-info b{color:#334155}.provider-info a{color:#4f46e5;font-weight:800;text-decoration:none}.form-grid label small{display:block;margin-top:7px;color:#64748b;font-weight:500;font-size:11px}.status-dot.on{background:#22c55e;box-shadow:0 0 0 6px #dcfce7}.status-dot:not(.on){box-shadow:0 0 0 6px #f1f5f9}

.top-actions{display:flex;gap:10px;align-items:center}.voice-btn{background:rgba(255,255,255,.14);color:#fff;border:1px solid rgba(255,255,255,.3)}.voice-btn.active{background:#22c55e;border-color:#22c55e}.avatar{width:42px;height:42px;border-radius:50%;object-fit:cover;flex:none;background:#eef2ff}.avatar.fallback,.bubble-avatar.fallback{display:grid;place-items:center}.event-item .event-body{min-width:0}.bubble-avatar{width:38px;height:38px;border-radius:50%;object-fit:cover;flex:none;background:#eef2ff}.live-card{display:flex;gap:10px;align-items:flex-start}.live-card>div:last-child{min-width:0}@media(max-width:900px){.top-actions{width:100%;flex-wrap:wrap}.top-actions .btn{flex:1}}

.tts-box{margin:20px 0;padding:18px;border:1px solid #e2e8f0;background:#f8fafc;border-radius:16px}.tts-box h3{margin:5px 0}.tts-box p{margin:5px 0 14px;font-size:13px}.tts-box select{display:block;width:100%;margin-top:8px;padding:14px 16px;border:1px solid #dbe2ea;border-radius:13px;background:#fff;font-size:16px}.tts-box .switch-wrap{margin-top:16px}

/* UI FINISHING v4.8 */
.live-header{position:sticky;top:0;z-index:20;padding:20px 4vw;background:rgba(9,14,30,.94);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);border-bottom:1px solid rgba(255,255,255,.08)}
.live-header h1{font-size:clamp(24px,3vw,38px);margin:2px 0}.brand-block p{font-size:13px;margin-top:5px}.top-actions{gap:8px}.live-badge{display:flex;align-items:center;gap:7px;padding:9px 12px;border-radius:999px;background:rgba(239,68,68,.13);border:1px solid rgba(239,68,68,.28);font-size:11px;font-weight:900;letter-spacing:.8px}.live-badge .live-dot{width:8px;height:8px}.live-shell{max-width:1500px;grid-template-columns:minmax(0,1.6fr) minmax(360px,.8fr);gap:20px;margin:20px auto}.stage{min-height:calc(100vh - 150px);max-height:820px;border:1px solid rgba(255,255,255,.10);box-shadow:0 24px 80px rgba(2,6,23,.35);background:radial-gradient(circle at 50% 20%,#304b91 0,#111a35 42%,#070b16 78%)}.stage:after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,rgba(0,0,0,.18),transparent 25%,transparent 70%,rgba(0,0,0,.32))}.stage-top,.stage-hud,.feed,.welcome{z-index:2}.connection{display:flex;align-items:center;gap:9px}.stage-top{font-size:11px;letter-spacing:.7px}.viewer{padding:7px 10px;border:1px solid rgba(255,255,255,.10);border-radius:999px;background:rgba(255,255,255,.06)}.stage-hud{position:absolute;left:22px;top:78px;display:flex;gap:8px}.stage-hud>div{min-width:92px;padding:9px 12px;border:1px solid rgba(255,255,255,.10);border-radius:13px;background:rgba(15,23,42,.34);backdrop-filter:blur(10px)}.hud-label{display:block;font-size:9px;letter-spacing:1px;color:#94a3b8;font-weight:900}.stage-hud strong{font-size:15px}.welcome{align-items:center;justify-content:center}.welcome-box{display:flex;flex-direction:column;align-items:center;text-align:center;gap:7px;max-width:340px;padding:28px;border:1px solid rgba(255,255,255,.10);border-radius:22px;background:rgba(15,23,42,.28);backdrop-filter:blur(14px);box-shadow:0 20px 50px rgba(0,0,0,.18)}.welcome-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:14px;background:rgba(99,102,241,.20);color:#c7d2fe;font-size:21px}.welcome-box strong{font-size:17px;color:#e2e8f0}.welcome-box span{font-size:12px;color:#94a3b8;line-height:1.55}.feed{inset:125px 22px 22px;gap:9px;overflow:hidden}.live-card{padding:10px 13px;border-radius:16px;background:rgba(10,16,31,.38);border:1px solid rgba(255,255,255,.16);box-shadow:0 10px 30px rgba(0,0,0,.16);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}.live-card:hover{background:rgba(15,23,42,.52);transform:translateX(2px)}.live-card.gift{background:rgba(245,158,11,.13);border-color:rgba(251,191,36,.38)}.live-card .tag{color:#a5b4fc}.bubble-avatar{width:40px;height:40px;border:2px solid rgba(255,255,255,.16)}.live-card-content b{font-size:13px}.live-message{font-size:13px;color:#e2e8f0;line-height:1.35}.event-panel{position:sticky;top:110px;height:calc(100vh - 130px);max-height:820px;padding:20px;border-radius:24px;box-shadow:0 20px 60px rgba(15,23,42,.08);display:flex;flex-direction:column}.panel-head{padding-bottom:15px;border-bottom:1px solid #eef2f7;margin-bottom:12px}.panel-head h2{font-size:22px}.panel-subtitle{font-size:12px;color:#94a3b8}.event-count{padding:7px 10px;border-radius:999px;background:#eef2ff;color:#4f46e5;font-size:11px;font-weight:900}.event-panel .event-list{max-height:none;flex:1;padding-right:3px}.event-item{padding:10px 11px;border-radius:13px;background:#fff;transition:.18s}.event-item:hover{transform:translateX(2px);box-shadow:0 7px 20px rgba(15,23,42,.06)}.event-item .avatar{width:38px;height:38px}.event-body b{font-size:13px}.event-body span{line-height:1.35;display:block;margin-top:2px}.event-type{font-size:9px}.voice-btn{transition:.2s}.voice-btn.active{box-shadow:0 0 0 4px rgba(34,197,94,.12)}
@media(max-width:900px){.live-header{position:relative}.live-shell{grid-template-columns:1fr;margin-top:12px}.stage{min-height:620px}.event-panel{position:relative;top:auto;height:auto;max-height:560px}.stage-hud{top:72px}.feed{inset:118px 14px 14px}.top-actions{width:auto}.live-badge{display:none}}


/* V4.9 — Mobile LIVE stage: 9:16 */
.live-page .live-shell,
.live-page .live-stage,
body.live-page .live-container {
  width: min(100vw, calc(100vh * 9 / 16));
  aspect-ratio: 9 / 16;
  max-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
}

/* If the overlay uses a different wrapper, keep the viewport itself 9:16 */
@media (min-width: 700px) {
  .live-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #0b0d12;
    overflow: hidden;
  }
  .live-page .live-shell,
  .live-page .live-stage,
  body.live-page .live-container {
    height: min(100vh, calc(100vw * 16 / 9));
    width: min(100vw, calc(100vh * 9 / 16));
  }
}

/* Common class used by the V4.x LIVE overlay */
.live-viewport {
  width: min(100vw, calc(100vh * 9 / 16));
  height: min(100vh, calc(100vw * 16 / 9));
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

@media (max-width: 699px) {
  .live-viewport {
    width: 100vw;
    height: calc(100vw * 16 / 9);
    max-height: 100vh;
  }
}

/* V4.10 — TRUE PHONE CANVAS 9:16
   The LIVE stage itself fills the complete portrait canvas. */
html,body.live-page{margin:0;width:100%;min-height:100%;overflow:hidden;background:#050812}
body.live-page .live-viewport{width:min(100vw, calc(100vh * 9 / 16));height:min(100vh, calc(100vw * 16 / 9));aspect-ratio:9/16;margin:0 auto;position:relative;overflow:hidden;background:#050812}
body.live-page .live-header{position:absolute;left:0;right:0;top:0;z-index:30;background:linear-gradient(180deg,rgba(5,8,18,.82),rgba(5,8,18,0));border:0;padding:18px 16px 48px}
body.live-page .live-header h1{font-size:20px}
body.live-page .live-header p{font-size:11px}
body.live-page .live-header .top-actions .btn.ghost{display:none}
body.live-page .live-shell{display:block;width:100%;height:100%;max-width:none;margin:0;padding:0;position:relative}
body.live-page .stage{width:100%;height:100%;min-height:0;max-height:none;border-radius:22px;padding:18px;position:absolute;inset:0}
body.live-page .stage-top{padding-top:4px}
body.live-page .stage-hud{top:88px;left:18px}
body.live-page .feed{inset:150px 14px 18px;overflow:hidden}
body.live-page .event-panel{display:none}
body.live-page .live-card{max-width:92%;padding:9px 11px}
body.live-page .bubble-avatar{width:38px;height:38px}

@media(max-width:699px){
  body.live-page .live-viewport{width:100vw;height:calc(100vw * 16 / 9);max-height:none}
  body.live-page .stage{border-radius:0}
}
