
:root {
  color-scheme: dark;
  --bg: #10110f;
  --bg-soft: #171815;
  --panel: rgba(31, 32, 29, .94);
  --panel-strong: #252622;
  --panel-soft: #1a1b18;
  --border: rgba(255, 255, 255, .11);
  --border-strong: rgba(238, 120, 31, .48);
  --text: #f7f7f4;
  --muted: #aaa9a3;
  --primary: #e96f17;
  --primary-hover: #ff8b32;
  --primary-soft: rgba(233, 111, 23, .15);
  --metallic-a: #fff1d8;
  --metallic-b: #ffac54;
  --metallic-c: #d45508;
  --success: #19b96b;
  --warning: #f2bd57;
  --danger: #ff6b6b;
  --shadow: 0 22px 65px rgba(0, 0, 0, .32);
  --radius: 20px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f3ef;
  --bg-soft: #ebe9e3;
  --panel: rgba(255, 255, 255, .95);
  --panel-strong: #ffffff;
  --panel-soft: #f7f6f2;
  --border: rgba(24, 24, 20, .13);
  --border-strong: rgba(217, 91, 5, .42);
  --text: #1e1f1c;
  --muted: #66665f;
  --primary: #d85b08;
  --primary-hover: #ec6a12;
  --primary-soft: rgba(216, 91, 8, .12);
  --shadow: 0 18px 48px rgba(45, 39, 31, .12);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(59, 130, 246, .13), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(124, 58, 237, .10), transparent 31%),
    linear-gradient(180deg, #080d17 0%, #070b13 65%, #060910 100%);
}

button, input, select { font: inherit; }
button, .button-link {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 0 16px;
  background: var(--primary);
  color: white;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
}
button:hover:not(:disabled), .button-link:hover { background: var(--primary-hover); transform: translateY(-1px); }
button:active:not(:disabled), .button-link:active { transform: translateY(0); }
button:disabled { opacity: .46; cursor: not-allowed; }
button.secondary, .button-link.secondary {
  background: #1b273a;
  border-color: var(--border);
  color: #edf3ff;
}
button.secondary:hover:not(:disabled), .button-link.secondary:hover { background: #25344c; border-color: rgba(148, 163, 184, .28); }
button.ghost { background: transparent; border-color: var(--border); color: var(--muted); }
button.danger { background: rgba(255, 107, 107, .14); border-color: rgba(255, 107, 107, .35); color: #ffb3b3; }
button.active { border-color: var(--primary); background: var(--primary-soft); color: #bcd4ff; box-shadow: inset 0 0 0 1px rgba(79, 140, 255, .16); }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

input, select {
  width: 100%;
  min-height: 45px;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 0 12px;
  color: var(--text);
  background: #0a1220;
  outline: none;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 140, 255, .12); }
input[type="range"] {
  min-height: 20px;
  padding: 0;
  border: 0;
  accent-color: var(--primary);
  background: transparent;
  box-shadow: none;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 3px; font-size: 23px; letter-spacing: -.025em; }
h2 { margin-bottom: 10px; font-size: 18px; letter-spacing: -.015em; }
h3 { margin-bottom: 7px; font-size: 16px; }
p { line-height: 1.55; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
[hidden] { display: none !important; }

.container { width: min(1180px, calc(100% - 34px)); margin: 0 auto; padding: 28px 0 50px; }
.studio-container { width: min(1540px, calc(100% - 28px)); margin: 0 auto; padding: 20px 0 42px; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand p { margin: 0; color: var(--muted); font-size: 13px; }
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  color: #dbeafe;
  font-size: 23px;
  background: linear-gradient(145deg, #224fa7, #5636a7);
  box-shadow: 0 10px 24px rgba(45, 87, 180, .24);
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.version-badge, .online-badge {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(15, 23, 39, .78);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
}
.online-badge[data-online="true"] { color: #9cf0c7; border-color: rgba(61, 220, 151, .35); background: rgba(61, 220, 151, .09); }

.card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 26, 43, .94), rgba(12, 19, 32, .94));
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.compact-card { padding: 17px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.section-heading.compact { margin-bottom: 14px; }
.section-heading h2 { margin: 2px 0 0; }
.eyebrow { display: block; color: #7facff; font-size: 10px; font-weight: 900; letter-spacing: .14em; }

.grid { display: grid; grid-template-columns: minmax(280px, 340px) 1fr; gap: 20px; }
.studio-grid { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 18px; align-items: start; }
.studio-sidebar { display: grid; gap: 14px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; padding-right: 3px; scrollbar-width: thin; }
.studio-main { min-width: 0; display: grid; gap: 15px; }

.room-code {
  margin: 14px 0 10px;
  padding: 14px 10px;
  border: 1px dashed rgba(96, 165, 250, .52);
  border-radius: 14px;
  background: #091221;
  color: #82b5ff;
  font: 900 clamp(34px, 5vw, 50px)/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .13em;
  text-align: center;
  text-shadow: 0 0 30px rgba(79, 140, 255, .28);
}
.link-box {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: #98c3ff;
  background: #09111e;
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.actions, .button-row { display: flex; gap: 9px; margin-top: 10px; }
.actions > *, .button-row > * { flex: 1; }
.button-row.wrap { flex-wrap: wrap; }
.button-row.wrap > * { flex: 1 1 120px; }
.wide-button { width: 100%; margin-top: 16px; }

.status { margin-top: 12px; padding: 10px 11px; border: 1px solid var(--border); border-radius: 11px; color: var(--muted); background: rgba(6, 10, 18, .52); font-size: 12px; line-height: 1.45; }
.status[data-kind="success"] { border-color: rgba(61, 220, 151, .42); color: #95ebbf; background: rgba(61, 220, 151, .06); }
.status[data-kind="warning"] { border-color: rgba(242, 189, 87, .48); color: #f2ce84; background: rgba(242, 189, 87, .06); }
.status[data-kind="error"] { border-color: rgba(255, 107, 107, .52); color: #ffadad; background: rgba(255, 107, 107, .06); }
.status[data-kind="waiting"] { border-color: rgba(79, 140, 255, .48); color: #a9c9ff; background: rgba(79, 140, 255, .06); }

.field { margin-bottom: 14px; }
.field.no-margin { margin-bottom: 0; }
.field label, .control-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 800; }
.orientation-hint { margin: -5px 0 14px; line-height: 1.45; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.segmented { display: grid; gap: 7px; margin-bottom: 15px; }
.segmented.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.segmented button { min-height: 37px; padding: 0 7px; border-color: var(--border); background: #111c2d; font-size: 10px; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 15px; }
.preset-grid button { min-height: 38px; padding: 0 9px; font-size: 11px; }
.range-field { margin: 12px 0; }
.range-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.range-label label { color: var(--muted); font-size: 11px; font-weight: 800; }
.range-label output { color: #bcd4ff; font-size: 11px; font-weight: 900; }

.preview-card { padding: 0; overflow: hidden; }
.preview-topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.video-title { margin-top: 3px; font-size: 15px; font-weight: 850; }
.live-metrics { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.live-metrics span { padding: 6px 9px; border: 1px solid var(--border); border-radius: 999px; color: #b7c4d7; background: #09111d; font-size: 11px; font-weight: 800; }
.preview-workspace {
  min-height: 570px;
  padding: 24px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(255,255,255,.018) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.018) 75%),
    linear-gradient(45deg, rgba(255,255,255,.018) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.018) 75%),
    #05080e;
  background-position: 0 0, 18px 18px;
  background-size: 36px 36px;
}
.video-stage {
  --stream-ratio: 1.777777;
  position: relative;
  width: min(100%, 1080px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #000;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 17px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .46);
  transition: width .25s ease, aspect-ratio .25s ease, border-radius .25s ease;
}
.video-stage.layout-exact {
  width: 100%;
  max-height: 72vh;
  aspect-ratio: var(--stream-ratio);
}
.video-stage.layout-portrait { width: min(100%, 480px); aspect-ratio: 9 / 16; }
.video-stage.layout-landscape { width: min(100%, 1080px); aspect-ratio: 16 / 9; }
.video-stage.layout-square, .video-stage.layout-circle { width: min(100%, 650px); aspect-ratio: 1 / 1; }
.video-stage.shape-circle { border-radius: 50%; }
.video-transform {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  transform-origin: center;
  backface-visibility: hidden;
  will-change: width, height, transform;
  contain: paint;
}
.video-stage video {
  width: 100%;
  height: 100%;
  display: block;
  object-position: center;
  transform-origin: center;
  transition: transform .12s linear;
  backface-visibility: hidden;
  will-change: transform;
  background: #000;
}
.video-stage video.fit-contain { object-fit: contain; }
.video-stage video.fit-cover { object-fit: cover; }
.video-empty { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; gap: 8px; padding: 30px; color: var(--muted); text-align: center; pointer-events: none; }
.video-empty strong { color: #dce7f7; font-size: 16px; }
.empty-icon { font-size: 38px; color: #5b8eea; }
.video-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--border); background: rgba(13, 21, 36, .96); }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; }
.video-toolbar button { min-height: 38px; padding: 0 12px; }
.video-toolbar .meta { color: var(--muted); font-size: 11px; }

.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.info-card { padding: 16px; box-shadow: none; }
.info-card p { margin: 0; color: var(--muted); font-size: 12px; }
.info-card h3 { margin-top: 5px; }

.mobile-shell { width: min(680px, calc(100% - 22px)); margin: 0 auto; padding: 18px 0 42px; }
.mobile-shell .card { margin-bottom: 13px; }
.room-input { font: 900 30px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .16em; text-align: center; }
.platform-notice { margin-bottom: 12px; padding: 12px 14px; border: 1px solid rgba(79, 140, 255, .38); border-radius: 13px; color: #bdd4ff; background: rgba(79, 140, 255, .08); font-size: 13px; line-height: 1.45; }
.platform-notice.warning { border-color: rgba(242, 189, 87, .42); color: #f0d08f; background: rgba(242, 189, 87, .07); }
.camera-preview-card { padding: 15px; }
.mobile-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.orientation-message { display: grid; gap: 3px; margin: -2px 0 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: rgba(8, 15, 27, .62); }
.orientation-message strong { color: #cfe0ff; font-size: 12px; }
.orientation-message span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.preview-stage {
  position: relative;
  width: 100%;
  min-height: 300px;
  max-height: 66vh;
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  background: #000;
  display: grid;
  place-items: center;
}
.preview-stage video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.preview-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 24px; }
.mobile-controls { margin-top: 13px; }
.help { margin-top: 12px; border-left: 3px solid var(--warning); padding: 10px 12px; background: rgba(242, 189, 87, .07); color: #e8cc95; font-size: 13px; }

.landing { width: min(930px, calc(100% - 28px)); margin: 0 auto; padding: 62px 0 38px; }
.hero { text-align: center; margin-bottom: 32px; }
.hero-mark { width: 70px; height: 70px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 22px; background: linear-gradient(145deg, #2458bb, #693db8); font-size: 36px; box-shadow: 0 20px 55px rgba(57, 83, 184, .30); }
.hero h1 { max-width: 860px; margin: 14px auto 14px; font-size: clamp(38px, 7vw, 68px); line-height: 1.02; letter-spacing: -.05em; }
.hero p { max-width: 720px; margin: 0 auto; color: var(--muted); font-size: 18px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.choice-card { padding: 25px; }
.choice-card.featured { border-color: var(--border-strong); background: linear-gradient(180deg, rgba(26, 47, 82, .92), rgba(13, 22, 38, .94)); }
.choice-card .icon { font-size: 38px; }
.choice-card h2 { margin: 13px 0 7px; }
.choice-card p { min-height: 48px; color: var(--muted); }
.choice-card .button-link { width: 100%; }
.landing-note { margin: 22px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 18px 0 0; }
.steps li { position: relative; padding: 0 0 18px 42px; color: var(--muted); }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: -2px; width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: #243149; color: white; font-weight: 800; }
.diagnostic-table { width: 100%; border-collapse: collapse; }
.diagnostic-table th, .diagnostic-table td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; }
.ok { color: #8de3b4; }
.bad { color: #ff9999; }

.video-stage:fullscreen { width: 100vw !important; height: 100vh !important; max-height: none !important; aspect-ratio: auto !important; border: 0; border-radius: 0; }
.video-stage:fullscreen video.fit-contain { object-fit: contain; }
.video-stage:fullscreen .video-transform { border-radius: 0; }

@media (max-width: 1180px) {
  .studio-grid { grid-template-columns: 320px minmax(0, 1fr); }
  .segmented.five { grid-template-columns: repeat(3, 1fr); }
  .preview-workspace { min-height: 500px; }
}

@media (max-width: 940px) {
  .studio-grid, .grid { grid-template-columns: 1fr; }
  .studio-sidebar { position: static; max-height: none; overflow: visible; grid-template-columns: 1fr 1fr; }
  .connect-card { grid-column: 1 / -1; }
  .preview-workspace { min-height: 440px; }
  .info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .studio-container { width: min(100% - 16px, 1540px); padding-top: 12px; }
  .studio-sidebar { grid-template-columns: 1fr; }
  .connect-card { grid-column: auto; }
  .site-header { align-items: flex-start; }
  .studio-header { flex-direction: column; }
  .header-actions { width: 100%; justify-content: space-between; }
  .preview-topbar { align-items: flex-start; flex-direction: column; }
  .live-metrics { justify-content: flex-start; }
  .preview-workspace { min-height: 390px; padding: 12px; }
  .video-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-right { width: 100%; }
  .field-row { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: 1fr; }
  .choice-card p { min-height: 0; }
  .hero h1 { font-size: clamp(36px, 12vw, 56px); }
}

@media (max-width: 450px) {
  .card { padding: 16px; border-radius: 16px; }
  .compact-card { padding: 15px; }
  .brand-mark { width: 39px; height: 39px; border-radius: 11px; }
  h1 { font-size: 20px; }
  .segmented.five { grid-template-columns: 1fr 1fr; }
  .preview-workspace { min-height: 350px; }
  .room-code { font-size: 38px; }
}

/* Studio 4.0 — renderização estável por canvas e janela separada */
.segmented.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.render-source {
  position: absolute !important;
  width: 2px !important;
  height: 2px !important;
  left: -9999px !important;
  top: -9999px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.render-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}
.video-stage.shape-circle .render-canvas { border-radius: 50%; }
.video-stage .video-transform { display: none; }
.toolbar-left { flex-wrap: wrap; }
.mobile-orientation-controls { margin-bottom: 12px; }
.preview-stage .render-canvas { position: absolute; inset: 0; }
.preview-stage .preview-placeholder { z-index: 2; }

.floating-page {
  margin: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
}
.floating-shell {
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #000;
}
.floating-shell canvas {
  display: block;
  max-width: 100vw;
  max-height: 100vh;
  background: #000;
}
.floating-status {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #c9d6e9;
  background: #000;
  font: 700 14px/1.5 system-ui, sans-serif;
  text-align: center;
}
.floating-status[hidden] { display: none; }

/* Mantém o elemento de vídeo dentro da área para evitar economia agressiva de decodificação. */
.video-stage > .render-source,
.preview-stage > .render-source,
.floating-shell > .render-source {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  left: 0 !important;
  top: 0 !important;
  opacity: .001 !important;
  object-fit: contain !important;
  z-index: 0 !important;
}
.video-stage > .render-canvas,
.preview-stage > .render-canvas,
.floating-shell > canvas { position: relative; z-index: 1; }
.floating-shell { position: relative; }

/* T2H LIVE 5.0 — identidade, login, planos, painel e tema */
body {
  background:
    radial-gradient(circle at 10% 0%, rgba(233, 111, 23, .12), transparent 32%),
    radial-gradient(circle at 90% 8%, rgba(255, 255, 255, .035), transparent 28%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 68%, var(--bg) 100%);
}
html[data-theme="light"] body {
  background:
    radial-gradient(circle at 10% 0%, rgba(233, 111, 23, .10), transparent 32%),
    linear-gradient(180deg, #faf9f6 0%, var(--bg) 70%);
}

button, .button-link { background: linear-gradient(135deg, var(--primary-hover), var(--primary)); }
button.secondary, .button-link.secondary { background: var(--panel-strong); border-color: var(--border); color: var(--text); }
button.secondary:hover:not(:disabled), .button-link.secondary:hover { background: var(--panel-soft); border-color: var(--border-strong); }
button.active { border-color: var(--primary); background: var(--primary-soft); color: var(--text); box-shadow: inset 0 0 0 1px rgba(233,111,23,.16); }
button.ghost { background: transparent; border-color: var(--border); color: var(--muted); }
input, select { color: var(--text); background: var(--panel-soft); }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type="range"] { accent-color: var(--primary); }

.card { background: linear-gradient(180deg, var(--panel-strong), var(--panel-soft)); }
.eyebrow { color: var(--primary-hover); }
.segmented button { background: var(--panel-strong); }
.range-label output { color: var(--primary-hover); }
.room-code { border-color: rgba(233,111,23,.55); background: #0d0e0c; color: #ff9b4b; text-shadow: 0 0 28px rgba(233,111,23,.25); }
.link-box { color: #ffab67; background: var(--panel-soft); }
.live-metrics span { color: var(--muted); background: var(--panel-soft); }
.online-badge[data-online="true"] { color: #90e9bb; }
.preview-workspace { background-color: #090a08; }
.video-toolbar { background: var(--panel-soft); }
.version-badge, .online-badge { background: var(--panel); }

.brand-mark {
  overflow: hidden;
  padding: 0;
  color: white;
  background: linear-gradient(145deg, var(--metallic-a), var(--metallic-b) 32%, var(--metallic-c) 78%, #7b2c00);
  box-shadow: 0 10px 28px rgba(216, 85, 7, .26);
}
.brand-mark svg, .hero-mark svg { width: 100%; height: 100%; display: block; }
.hero-mark { overflow: hidden; padding: 9px; background: linear-gradient(145deg, var(--metallic-a), var(--metallic-b) 30%, var(--metallic-c) 78%, #762900); box-shadow: 0 20px 55px rgba(216, 85, 7, .28); }
.hero h2 { max-width: 880px; margin: 14px auto; font-size: clamp(36px, 6.4vw, 66px); line-height: 1.03; letter-spacing: -.05em; }
.hero p { font-size: clamp(16px, 2vw, 19px); }
.landing-header { margin-bottom: 44px; }

.header-actions { flex-wrap: wrap; justify-content: flex-end; }
.inline-form { display: inline-flex; margin: 0; }
.inline-form button { min-height: 40px; }
.theme-toggle { min-height: 40px; white-space: nowrap; }
.user-mini { display: grid; max-width: 240px; line-height: 1.15; }
.user-mini strong { overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-mini span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.plan-badge { display: inline-flex; min-height: 29px; align-items: center; padding: 0 11px; border: 1px solid var(--border); border-radius: 999px; font-size: 11px; font-weight: 900; letter-spacing: .05em; }
.plan-badge.pro { color: #9af1c7; border-color: rgba(25,185,107,.38); background: rgba(25,185,107,.10); }
.plan-badge.free { color: #ffd0a7; border-color: rgba(233,111,23,.42); background: rgba(233,111,23,.10); }

.login-card { max-width: 590px; margin: 0 auto 20px; text-align: center; }
.login-card > p { max-width: 500px; margin-left: auto; margin-right: auto; }
.google-button { display: flex; min-height: 46px; justify-content: center; margin: 20px 0 12px; }
.privacy-note { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.public-features { margin-top: 16px; }

.account-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.account-main { display: flex; align-items: center; gap: 13px; min-width: 0; }
.user-avatar-placeholder { width: 52px; height: 52px; display: grid; flex: 0 0 auto; place-items: center; border: 1px solid var(--border-strong); border-radius: 16px; color: #fff; background: linear-gradient(145deg, var(--primary-hover), #9d3900); font-size: 22px; font-weight: 900; }
.account-summary h2 { margin: 3px 0 1px; }
.masked-email { margin: 0; color: var(--muted); font-size: 13px; }
.account-plan { display: grid; justify-items: end; gap: 5px; text-align: right; }
.account-plan small { color: var(--muted); }
.upgrade-card { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-top: 16px; border-color: var(--border-strong); }
.upgrade-card p { max-width: 650px; margin-bottom: 0; color: var(--muted); }
.upgrade-card .button-link { flex: 0 0 auto; }
.network-note { max-width: 700px; margin-left: auto; margin-right: auto; padding: 13px 16px; border: 1px solid var(--border); border-radius: 13px; background: var(--panel-soft); font-size: 14px; font-weight: 700; }

.whatsapp-support { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: inline-flex; align-items: center; min-height: 46px; padding: 0 17px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; color: #fff; background: #139f59; box-shadow: 0 14px 38px rgba(0,0,0,.28); font-size: 13px; font-weight: 900; text-decoration: none; }
.whatsapp-support:hover { transform: translateY(-2px); background: #17b968; }

.compact-landing { max-width: 640px; padding-top: 80px; }
.activation-result { display: grid; gap: 14px; text-align: center; }
.centered-brand { justify-content: center; text-align: left; }
.activation-status { font-size: 15px; }
.identity-line { margin: 0; padding: 13px; border: 1px solid var(--border); border-radius: 13px; background: var(--panel-soft); }
.identity-line span { color: var(--muted); }

.admin-login-shell { width: min(480px, calc(100% - 24px)); min-height: 100vh; display: grid; place-items: center; margin: 0 auto; padding: 24px 0; }
.admin-login-card { width: 100%; }
.admin-container { width: min(1540px, calc(100% - 28px)); margin: 0 auto; padding: 20px 0 60px; }
.admin-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 15px; }
.stat-card { display: grid; gap: 3px; padding: 18px; }
.stat-card span, .stat-card small { color: var(--muted); }
.stat-card strong { font-size: 34px; line-height: 1; }
.admin-section { margin-bottom: 15px; }
.global-status { margin: 0 0 14px; }
.admin-inline-form { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 12px; align-items: end; margin-top: 14px; }
.admin-search { display: flex; gap: 8px; min-width: min(100%, 420px); }
.admin-search input { min-width: 0; }
.admin-search button { flex: 0 0 auto; }
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 920px; }
.admin-table th, .admin-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; text-align: left; }
.admin-table th { color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.admin-table td { font-size: 13px; }
.admin-table td span, .admin-table td small { color: var(--muted); }
.compact-table { min-width: 680px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-actions form { margin: 0; }
.admin-actions button { min-height: 34px; padding: 0 9px; font-size: 11px; }
.danger-text { color: var(--danger); font-style: normal; font-weight: 800; }
.meta-box, .activation-url-box { padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-soft); }
.activation-url-box { display: grid; gap: 8px; margin: 12px 0; border-color: rgba(25,185,107,.36); }
.activation-url-box input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }

html[data-theme="light"] .preview-workspace,
html[data-theme="light"] .preview-stage,
html[data-theme="light"] .video-stage { background-color: #090a08; }
html[data-theme="light"] .room-code { background: #17130f; }
html[data-theme="light"] .platform-notice { color: #7b3b0a; background: rgba(233,111,23,.08); border-color: rgba(233,111,23,.30); }

@media (max-width: 980px) {
  .admin-stat-grid { grid-template-columns: 1fr 1fr; }
  .account-summary, .upgrade-card { align-items: flex-start; flex-direction: column; }
  .account-plan { justify-items: start; text-align: left; }
}

@media (max-width: 680px) {
  .landing { padding-top: 18px; }
  .landing-header { margin-bottom: 28px; }
  .landing-header, .site-header { align-items: flex-start; flex-direction: column; }
  .header-actions { width: 100%; justify-content: flex-start; }
  .user-mini { order: 5; width: 100%; max-width: none; }
  .hero h2 { font-size: clamp(34px, 11vw, 54px); }
  .upgrade-card .button-link { width: 100%; }
  .admin-stat-grid { grid-template-columns: 1fr 1fr; }
  .admin-inline-form { grid-template-columns: 1fr; }
  .admin-search { width: 100%; min-width: 0; }
  .whatsapp-support { right: 12px; bottom: 12px; }
}

@media (max-width: 430px) {
  .admin-stat-grid { grid-template-columns: 1fr; }
  .account-main { align-items: flex-start; }
  .hero-mark { width: 60px; height: 60px; }
  .whatsapp-support { left: 12px; right: 12px; justify-content: center; }
}
.site-footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; margin-top: 22px; padding: 12px; }
.site-footer a { color: var(--muted); font-size: 12px; text-decoration: none; }
.site-footer a:hover { color: var(--primary-hover); }
.legal-card { max-width: 900px; margin: 0 auto; }
.legal-card h2 { margin-top: 26px; }
.legal-card p { color: var(--muted); }
