/**
 * VideoSmart Smart Live - Mobile Sender Interface Styles
 * Inspired by Blackmagic Camera.
 * 
 * Features: Touch exposure reticle with draggable sun icon,
 * lateral zoom slider (native / digital), lock candado,
 * and seamless vertical & horizontal responsive layouts.
 */

:root {
  --sl-bg: #090a0c;
  --sl-panel: #16181d;
  --sl-border: #32353d;
  --sl-red: #e30613;
  --sl-white: #f8f9fb;
  --sl-muted: #b8bec9;
}

/* Standalone Viewport Container */
body.videosmart-standalone-view {
  margin: 0;
  padding: 0;
  background: #000;
  color: var(--sl-white);
  font-family: Archivo, -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  -webkit-text-size-adjust: 100%;
}

.vs-camera-viewport {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
  z-index: 1;
}

/* ========================================================
   BASE DEVICE CONTAINER (.sl-device)
   ======================================================== */
.sl-device {
  --sl-bg: #090a0c;
  --sl-panel: #16181d;
  --sl-border: #32353d;
  --sl-red: #e30613;
  --sl-white: #f8f9fb;
  --sl-muted: #b8bec9;
  width: 100%;
  max-width: 420px;
  height: 100%;
  max-height: 100dvh;
  margin: auto;
  background: var(--sl-bg);
  color: var(--sl-white);
  border: 1px solid #33363e;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 16px 38px #0004;
  color-scheme: dark;
  display: flex;
  flex-direction: column;
  position: relative;
  box-sizing: border-box;
  font-family: Archivo, -apple-system, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

.sl-device * {
  box-sizing: border-box;
}

.sl-device button,
.sl-device input,
.sl-device select {
  font: inherit;
}

.sl-device button {
  color: inherit;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sl-device button:focus-visible,
.sl-device input:focus-visible,
.sl-device select:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.sl-device button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.sl-device [hidden] {
  display: none !important;
}

/* Lucide Icon SVGs */
.sl-device .lucide {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ========================================================
   1. HEADER
   ======================================================== */
.sl-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 6px;
  padding-top: max(12px, env(safe-area-inset-top));
  flex-shrink: 0;
}

.sl-brand-mark {
  background: var(--sl-red);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  border-radius: 8px;
  color: #fff;
  flex-shrink: 0;
}

.sl-brand {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.3px;
}

.sl-brand small {
  color: var(--sl-muted);
  font-weight: 400;
  margin-left: 3px;
}

.sl-header .sl-cam-id {
  margin-left: auto;
  font-size: 12px;
  color: var(--sl-muted);
  white-space: nowrap;
}

.sl-icon-button {
  min-width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  transition: background 0.15s;
}

.sl-icon-button:hover {
  background: #25282f;
}

/* ========================================================
   2. STATUS ROW
   ======================================================== */
.sl-status-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 2px 16px 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.sl-sending {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #6ae2ad;
  transition: color 0.2s ease;
}

.sl-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.sl-tally {
  color: #ffffff;
  background: #252831;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  user-select: none;
  flex-shrink: 0;
}

/* Estado 1: CONECTADO (Color GRIS, texto blanco) */
.sl-tally.is-connected {
  background: #252831;
  color: #ffffff;
  border: 1px solid #3c414c;
}

/* Estado 2: PREVIO (Color VERDE, texto blanco) */
.sl-tally.is-preview,
.sl-tally.is-standby {
  background: #10B981;
  color: #ffffff;
  font-weight: 800;
  border: 1px solid #10B981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* Estado 3: PROGRAMA (Color ROJO, texto blanco) */
.sl-tally.is-program {
  background: var(--sl-red);
  color: #ffffff;
  font-weight: 800;
  border: 1px solid #ff4d59;
  box-shadow: 0 0 10px rgba(227, 6, 19, 0.4);
}

/* Estado 4: EN DIRECTO (Color ROJO con punto rojo circular visible contrastante) */
.sl-tally.is-live {
  background: var(--sl-red);
  color: #ffffff;
  font-weight: 800;
  border: 1px solid #ff4d59;
  box-shadow: 0 0 14px rgba(227, 6, 19, 0.6);
}

.sl-tally-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff2d3b;
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 6px #ff2d3b;
  animation: slTallyDotPulse 1.2s infinite alternate;
}

@keyframes slTallyDotPulse {
  0% { opacity: 0.6; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1.2); }
}

.sl-tally.is-unavailable {
  background: #1c1e24;
  color: #88909e;
  border: 1px solid #2a2e38;
}

.sl-tally.is-disconnected {
  background: #1a1d24;
  color: #8f96a3;
  border: 1px solid #282c35;
}

/* Indicador Independiente de Conexión a OBS (FASE 7) */
.sl-obs-status {
  background: #181b22;
  border: 1px solid #2e333d;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  color: #d1d5dd;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.sl-obs-status:hover {
  background: #252831;
  border-color: #424754;
}

.sl-obs-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8f96a3;
  flex-shrink: 0;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.sl-obs-dot.dot-connected {
  background: #10B981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.sl-obs-dot.dot-no-video {
  background: #F5C86F;
  box-shadow: 0 0 8px rgba(245, 200, 111, 0.6);
}

.sl-obs-dot.dot-waiting {
  background: #38bdf8;
  animation: slObsPulse 1.2s infinite alternate;
}

.sl-obs-dot.dot-unavailable {
  background: #64748b;
}

@keyframes slObsPulse {
  0% { opacity: 0.3; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1.15); }
}

.sl-timer {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: #e1e3e9;
  flex-shrink: 0;
}

/* ========================================================
   3. VIEWFINDER & FORMAT SELECTOR
   ======================================================== */
.sl-viewfinder {
  position: relative;
  flex: 1;
  min-height: 280px;
  background: #060709;
  display: flex;
  align-items: stretch;
  isolation: isolate;
  overflow: hidden;
}

.sl-hud {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 6;
  pointer-events: none;
}

.sl-hud > * {
  pointer-events: auto;
}

/* Selector Manual de Formato (FASE 4) */
.sl-format-selector {
  display: inline-flex;
  align-items: center;
  background: rgba(14, 16, 20, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  z-index: 7;
}

.sl-fmt-btn {
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #9ba3af;
  border-radius: 6px;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.sl-fmt-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.sl-fmt-btn.active {
  background: var(--sl-red);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(227, 6, 19, 0.4);
}

.sl-format {
  font-size: 11px;
  color: #d1d5dd;
  letter-spacing: .03em;
  background: rgba(16, 18, 23, 0.7);
  backdrop-filter: blur(6px);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
}

.sl-link {
  padding: 6px 10px;
  background: #17271f;
  color: #77e1ac;
  border: 1px solid #294335;
  border-radius: 8px;
  font-size: 11px;
  display: flex;
  gap: 5px;
  align-items: center;
  min-height: 32px;
  cursor: pointer;
  transition: background 0.15s;
}

.sl-link:hover {
  background: #1f362a;
}

.sl-link.bitrate-yellow {
  background: #2c2714;
  color: #f5c86f;
  border-color: #4b421e;
}

.sl-link.bitrate-red {
  background: #2b1619;
  color: #ff7e87;
  border-color: #492025;
}

.sl-image {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: default;
}

.sl-camera-feed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* CAMBIAR contain por cover */
  object-fit: cover !important; 
  background: #000;
  z-index: 1;
}

.sl-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, transparent 33.1%, #cdd8ed35 33.1%, #cdd8ed35 33.4%, transparent 33.4%, transparent 66.5%, #cdd8ed35 66.5%, #cdd8ed35 66.8%, transparent 66.8%),
    linear-gradient(to bottom, transparent 33.1%, #cdd8ed35 33.1%, #cdd8ed35 33.4%, transparent 33.4%, transparent 66.5%, #cdd8ed35 66.5%, #cdd8ed35 66.8%, transparent 66.8%);
  z-index: 2;
  pointer-events: none;
}

.sl-preview-label {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: #eef2f6;
  font-size: 13px;
  letter-spacing: .02em;
  text-align: center;
  padding: 14px 20px;
  background: #202b38;
  border-radius: 6px;
  pointer-events: none;
  transition: opacity 0.3s;
}

.sl-preview-label small {
  color: #c2ccd9;
  font-size: 11px;
}

/* ========================================================
   RIGHT LATERAL ZOOM CONTROL (Blackmagic Style)
   ======================================================== */
.sl-lateral-zoom {
  display: none !important;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 8;
  background: rgba(14, 16, 20, 0.86);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(50, 53, 61, 0.9);
  border-radius: 14px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  user-select: none;
}

.sl-zoom-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.sl-zoom-val {
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.sl-zoom-mode-tag {
  font-size: 8px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.2);
  color: #6ae2ad;
  letter-spacing: 0.03em;
}

.sl-zoom-mode-tag.is-digital {
  background: rgba(245, 200, 111, 0.2);
  color: #f5c86f;
}

.sl-zoom-slider-wrap {
  position: relative;
  width: 32px;
  height: 105px;
  display: grid;
  place-items: center;
}

.sl-zoom-slider {
  writing-mode: bt-lr;
  -webkit-appearance: slider-vertical;
  appearance: slider-vertical;
  width: 6px;
  height: 95px;
  margin: 0;
  accent-color: var(--sl-red);
  cursor: pointer;
}

.sl-zoom-quick-buttons {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.sl-zoom-preset-btn {
  width: 28px;
  height: 24px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #a6aeba;
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}

.sl-zoom-preset-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.sl-zoom-preset-btn.active {
  background: var(--sl-red);
  color: #fff;
}

/* ========================================================
   BOTTOM VIEWFINDER BAR
   ======================================================== */
.sl-view-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: absolute;
  bottom: 12px;
  left: 14px;
  right: 14px;
  z-index: 6;
  pointer-events: none;
}

.sl-view-bottom > * {
  pointer-events: auto;
}

.sl-source-button {
  background: rgba(26, 29, 36, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(50, 53, 61, 0.9);
  border-radius: 8px;
  min-height: 36px;
  padding: 6px 11px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  transition: background 0.15s;
}

.sl-source-button:hover {
  background: #2a2f3a;
}

.sl-view-bottom-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sl-torch-pill {
  background: rgba(26, 29, 36, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(50, 53, 61, 0.9);
  border-radius: 8px;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #d8dbe3;
  transition: all 0.15s;
}

.sl-torch-pill:hover {
  background: #2a2f3a;
}

.sl-torch-pill[aria-pressed="true"] {
  background: #f5c86f;
  border-color: #f5c86f;
  color: #090a0c;
}



/* ========================================================
   SHEETS / MODAL PANELS INSIDE VIEWFINDER
   ======================================================== */
.sl-sheet {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  background: #181b21;
  border-top: 1px solid #3c414c;
  border-radius: 18px 18px 0 0;
  padding: 10px 16px 18px;
  z-index: 12;
  box-shadow: 0 -10px 30px #0006;
  max-height: 85%;
  overflow-y: auto;
  animation: slSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slSlideUp {
  from { transform: translateY(12px); opacity: 0.7; }
  to { transform: translateY(0); opacity: 1; }
}

.sl-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.sl-sheet-header .sl-icon-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
}

.sl-field-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: #d4d8e0;
  margin-bottom: 5px;
}

.sl-value {
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.sl-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.sl-select-grid label {
  color: #afb7c5;
  font-size: 11px;
  display: grid;
  gap: 5px;
}

.sl-device select {
  width: 100%;
  background: #282d37;
  border: 1px solid #414754;
  border-radius: 8px;
  padding: 9px 6px;
  color: #fff;
  min-height: 39px;
  font-size: 13px;
}

.sl-options {
  display: grid;
  gap: 6px;
}

.sl-option {
  width: 100%;
  min-height: 46px;
  padding: 8px 11px;
  background: #252a33;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  text-align: left;
  color: #fff;
  transition: background 0.15s;
}

.sl-option:hover {
  background: #2e3440;
}

.sl-option[aria-pressed="true"] {
  background: #403036;
  box-shadow: inset 3px 0 var(--sl-red);
}

.sl-option[data-camera] svg {
  display: none;
}

.sl-option[data-camera][aria-pressed="true"] svg {
  display: inline-block;
  color: #fff;
}

.sl-option small {
  color: #b7bfce;
  font-size: 11px;
  display: block;
  margin-top: 3px;
}

.sl-info-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid #353b46;
  font-size: 12px;
  color: #fff;
}

.sl-info-row span {
  color: #b8c0cf;
}

.sl-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 12px;
}

.sl-dialog-actions button {
  padding: 12px 8px;
  background: #323842;
  border-radius: 9px;
  font-size: 12px;
  color: #fff;
  font-weight: 700;
  transition: background 0.15s;
}

.sl-dialog-actions button:hover {
  background: #3d4450;
}

.sl-dialog-actions .sl-danger {
  background: var(--sl-red);
}

.sl-dialog-actions .sl-danger:hover {
  background: #ff1f2d;
}

.sl-note {
  font-size: 11px;
  color: #bcc4d2;
  margin: 0 0 10px;
  line-height: 1.5;
}

/* ========================================================
   4. AUDIO CONTROLS & VU METER
   ======================================================== */
.sl-audio {
  padding: 10px 15px 8px;
  background: #13151a;
  border-top: 1px solid #30343b;
  flex-shrink: 0;
}

.sl-audio-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sl-audio-mute {
  min-width: 44px;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: #282d36;
  display: grid;
  place-items: center;
  color: #fff;
  transition: background 0.15s, color 0.15s;
}

.sl-audio-mute:hover {
  background: #353a45;
}

.sl-audio-mute[aria-pressed="true"] {
  color: #ff7e87;
  background: #411c24;
}

.sl-meter-block {
  flex: 1;
  min-width: 0;
}

.sl-meter-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #bfc6d2;
  margin-bottom: 5px;
}

.sl-meter {
  height: 7px;
  background: #30343c;
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}

.sl-meter-fill {
  height: 100%;
  width: 0%;
  background: #48cf91;
  transition: width 0.08s ease, background-color 0.15s ease;
}

.sl-meter-peak {
  position: absolute;
  left: 0%;
  width: 2px;
  height: 100%;
  top: 0;
  background: #f5c86f;
  transition: left 0.12s ease;
}

.sl-meter-scale {
  position: relative;
  height: 12px;
  color: #aeb7c8;
  font-size: 11px;
  margin-top: 4px;
}

.sl-meter-scale span {
  position: absolute;
}

.sl-meter-scale span:nth-child(1) { left: 0; }
.sl-meter-scale span:nth-child(2) { left: 60%; transform: translateX(-50%); }
.sl-meter-scale span:nth-child(3) { left: 80%; transform: translateX(-50%); }
.sl-meter-scale span:nth-child(4) { right: 0; }

.sl-gain-row {
  display: grid;
  grid-template-columns: 54px 1fr 50px;
  gap: 9px;
  align-items: center;
  margin-top: 3px;
  font-size: 11px;
  color: #ccd3df;
}

.sl-gain-row output {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

/* ========================================================
   5. BOTTOM TRANSPORT BAR
   ======================================================== */
.sl-transport {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 16px max(14px, env(safe-area-inset-bottom));
  background: #101217;
  flex-shrink: 0;
}

.sl-transport-side {
  min-width: 54px;
  min-height: 52px;
  background: transparent;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  font-size: 11px;
  color: #b9c1cf;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s;
}

.sl-transport-side:hover {
  background: #1c1f26;
  color: #fff;
}

.sl-transport-side .lucide {
  width: 18px;
  height: 18px;
}

.sl-stop {
  background: var(--sl-red);
  min-height: 52px;
  border-radius: 14px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 700;
  flex: 1;
  color: #fff;
  transition: background-color 0.2s;
}

.sl-stop:hover {
  background: #ff1f2d;
}

.sl-stop-mark {
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 3px;
  flex-shrink: 0;
}

.sl-stop.is-idle {
  background: #252830;
  border: 1px solid #3c414c;
}

.sl-stop.is-idle:hover {
  background: #313642;
}

.sl-stop.is-idle .sl-stop-mark {
  border-radius: 50%;
  background: var(--sl-red);
}

/* ========================================================
   6. LOCK OVERLAY
   ======================================================== */
.sl-lock-overlay {
  position: absolute;
  inset: auto 12px 12px;
  padding: 18px;
  border-radius: 14px;
  background: #0d1016;
  z-index: 15;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  font-size: 13px;
  border: 1px solid #2b303a;
  box-shadow: 0 8px 30px #0008;
}

.sl-lock-overlay button {
  background: #343b47;
  padding: 13px 20px;
  border-radius: 10px;
  color: #fff;
  font-weight: 700;
  transition: background 0.15s;
}

.sl-lock-overlay button:hover {
  background: #424a59;
}

.sl-device.is-locked .sl-audio,
.sl-device.is-locked .sl-stop,
.sl-device.is-locked .sl-switch,
.sl-device.is-locked .sl-lateral-zoom,
.sl-device.is-locked .sl-view-bottom {
  opacity: .35;
  pointer-events: none;
}

.sl-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* ========================================================
   TOASTS CONTAINER
   ======================================================== */
.sl-toast-container {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 360px;
}

.sl-toast {
  background: rgba(22, 24, 29, 0.96);
  border: 1px solid #32353d;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  animation: slToastFade 0.25s ease;
  transition: opacity 0.3s;
}

.sl-toast.toast-error {
  border-color: var(--sl-red);
  color: #ff858d;
}

.sl-toast.toast-success {
  border-color: #10b981;
  color: #6ae2ad;
}

@keyframes slToastFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================================
   7. HORIZONTAL / LANDSCAPE ORIENTATION (Approved Layout)
   ======================================================== */
@media (orientation: landscape), (min-aspect-ratio: 1.05/1) {
  .sl-device {
    max-width: 768px;
    height: 100%;
    max-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    grid-template-rows: 44px 26px minmax(0, 1fr) 98px;
    border-radius: 24px;
  }
  .sl-header {
    grid-column: 1;
    grid-row: 1;
    padding: 2px 14px;
    background: #101217;
    z-index: 3;
  }
  .sl-status-row {
    grid-column: 1;
    grid-row: 2;
    padding: 0 14px 4px;
    background: #101217;
    z-index: 3;
  }
  .sl-viewfinder {
    grid-column: 1;
    grid-row: 3;
    min-height: 0;
    height: 100%;
    align-items: stretch;
  }
  .sl-audio {
    grid-column: 1;
    grid-row: 4;
    padding: 8px 14px;
  }
  .sl-transport {
    grid-column: 2;
    grid-row: 1 / 5;
    border-left: 1px solid #343842;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 10px 8px;
  }
  .sl-stop {
    width: 100%;
    min-height: 52px;
    padding: 8px;
    font-size: 11px;
  }
  .sl-transport-side {
    width: 100%;
    min-height: 48px;
    font-size: 11px;
  }
  .sl-sheet {
    left: auto;
    right: 0;
    bottom: 0;
    width: min(340px, 100%);
    max-height: 100%;
    border-radius: 16px 0 0 0;
    padding: 8px 14px 12px;
  }
  .sl-lateral-zoom {
    right: 8px;
  }
}

/* Explicit class .is-landscape on .sl-device (FASE 11 Redesign) */
.sl-device.is-landscape {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  grid-template-rows: 36px 24px minmax(0, 1fr) 40px;
  border-radius: 0;
  border: 0;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.sl-device.is-landscape .sl-header {
  grid-column: 1;
  grid-row: 1;
  padding: 2px 14px;
  background: #101217;
  z-index: 3;
}

.sl-device.is-landscape .sl-status-row {
  grid-column: 1;
  grid-row: 2;
  padding: 0 14px 4px;
  background: #101217;
  z-index: 3;
}

.sl-device.is-landscape .sl-viewfinder {
  grid-column: 1;
  grid-row: 3;
  min-height: 0;
  height: 100%;
  align-items: stretch;
}

.sl-device.is-landscape .sl-camera-feed {
  object-fit: contain !important;
  width: 100%;
  height: 100%;
}

.sl-device.is-landscape .sl-audio {
  grid-column: 1;
  grid-row: 4;
  padding: 4px 14px;
  background: #121419;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sl-device.is-landscape .sl-audio-top {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sl-device.is-landscape .sl-gain-row {
  display: none;
}

.sl-device.is-landscape .sl-transport {
  grid-column: 2;
  grid-row: 1 / 5;
  border-left: 1px solid #343842;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 10px 8px;
  background: #0f1115;
}

.sl-device.is-landscape .sl-stop {
  width: 100%;
  min-height: 52px;
  padding: 8px;
  font-size: 11px;
}

.sl-device.is-landscape .sl-transport-side {
  width: 100%;
  min-height: 48px;
  font-size: 11px;
}

.sl-device.is-landscape .sl-sheet {
  left: auto;
  right: 108px;
  bottom: 0;
  width: min(340px, 100%);
  max-height: 100%;
  border-radius: 16px 0 0 0;
  padding: 8px 14px 12px;
}

.sl-device.is-landscape .sl-lateral-zoom {
  right: 12px;
}

/* ========================================================
   END STREAM BUTTON & MOBILE FINISHED OVERLAY
   ======================================================== */
.sl-btn-end-stream {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #FF5A65;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.16s ease;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.sl-btn-end-stream:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.6);
  color: #FFFFFF;
}

.sl-btn-end-stream svg {
  stroke: currentColor;
}

/* Modal de Confirmación Móvil */
.sl-mobile-confirm-modal {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.sl-mobile-confirm-modal[hidden] {
  display: none !important;
}

.sl-mobile-modal-card {
  background: #181C26;
  border: 1px solid #2B3142;
  border-radius: 16px;
  padding: 24px 20px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
}

.sl-mobile-modal-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.12);
  color: #F87171;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px auto;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.sl-mobile-modal-card h4 {
  font-size: 16px;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0 0 6px 0;
}

.sl-mobile-modal-card p {
  font-size: 13px;
  color: #94A3B8;
  margin: 0 0 18px 0;
  line-height: 1.45;
}

.sl-mobile-modal-actions {
  display: flex;
  gap: 10px;
}

.sl-modal-btn {
  flex: 1;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: all 0.16s;
}

.sl-modal-btn-cancel {
  background: #1E2330;
  border: 1px solid #2B3142;
  color: #FFFFFF;
}

.sl-modal-btn-cancel:hover {
  background: #252B3B;
}

.sl-modal-btn-confirm {
  background: #E30613;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.sl-modal-btn-confirm:hover {
  background: #C50510;
}

/* Pantalla Finalizada en Móvil (Smart Live 1.0 - Variante A: Tarjeta Estudio) */
.sl-mobile-finished-screen {
  position: absolute;
  inset: 0;
  background: #090A0D;
  display: flex;
  flex-direction: column;
  z-index: 1100;
  overflow: hidden;
}

.sl-mobile-finished-screen[hidden] {
  display: none !important;
}

.sl-mob-finished-header {
  height: 52px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #202532;
  background: #0E1015;
  flex-shrink: 0;
}

.sl-mob-finished-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sl-mob-finished-logo {
  height: 24px;
  width: auto;
}

.sl-mob-logo-fallback {
  font-weight: 900;
  color: #FFFFFF;
  font-size: 14px;
  letter-spacing: -0.02em;
}

.sl-mob-logo-fallback span {
  color: #E30613;
}

.sl-mob-brand-badge {
  font-size: 11px;
  font-weight: 700;
  color: #CBD5E1;
  background: #141720;
  border: 1px solid #2B3142;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.sl-mob-finished-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}

.sl-mob-finished-card {
  width: 100%;
  max-width: 380px;
  background: #181C26;
  border: 1px solid #2B3142;
  border-radius: 16px;
  padding: 32px 20px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.sl-mob-finished-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  border: 1.5px solid rgba(16, 185, 129, 0.35);
  color: #34D399;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

.sl-mob-finished-icon svg,
.sl-mob-finished-icon i {
  width: 30px;
  height: 30px;
  color: #34D399;
}

.sl-mob-finished-card h2 {
  font-size: 21px;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0 0 10px 0;
  letter-spacing: -0.02em;
}

.sl-mob-finished-card p {
  font-size: 13px;
  color: #94A3B8;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.sl-mob-finished-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.sl-mob-finished-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 600;
  color: #CBD5E1;
  background: #141720;
  border: 1px solid #202532;
  padding: 4px 8px;
  border-radius: 5px;
}

.sl-mob-finished-badge svg,
.sl-mob-finished-badge i {
  width: 11px;
  height: 11px;
  color: #10B981;
}

.sl-mob-finished-hint {
  font-size: 11.5px;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 18px;
}

.sl-mob-finished-hint svg,
.sl-mob-finished-hint i {
  width: 13px;
  height: 13px;
  color: #64748B;
}

.sl-mob-finished-link-wrap {
  margin-top: 4px;
}

.sl-mob-finished-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  text-decoration: none;
  transition: color 0.16s ease;
  cursor: pointer;
}

.sl-mob-finished-link:hover,
.sl-mob-finished-link:focus {
  color: #FFFFFF;
}

.sl-mob-finished-link svg,
.sl-mob-finished-link i {
  width: 13px;
  height: 13px;
}
