/* ─────────────────────────────────────────────────────────────
   Tokens. Medidas tomadas de una captura real de Instagram Live
   (iPhone 16 Pro, 402 × 874 pt, octubre de 2026).
   ───────────────────────────────────────────────────────────── */
:root {
  /* Color: modo oscuro actual de Instagram */
  --ig-bg: #000;              /* negro puro: en OLED la franja superior no se distingue */
  --ig-text: #f5f5f5;
  --ig-text-2: #a8abb0;
  --ig-text-3: #7b7f86;
  --ig-sheet: #1c1f25;
  --ig-card: #2a2e35;
  --ig-card-press: #353a42;
  --ig-separator: #3b4048;
  --ig-blue: #0095f6;
  --ig-blue-press: #1877f2;
  --ig-red: #ed4956;
  --ig-heart-red: #ff3040;
  --ig-live: rgb(255 1 105);
  --ig-count: rgb(38 37 42 / 0.94);  /* caja del contador */
  --ig-comment-border: rgb(255 255 255 / 0.4);
  --ig-banner: rgb(35 33 34 / 0.94);
  --ig-wave: rgb(32 32 32 / 0.94);
  --ig-username-dim: rgb(255 255 255 / 0.75);
  --ig-backdrop: rgb(0 0 0 / 0.55);
  --scrim-bottom: rgb(0 0 0 / 0.4);

  /* Tipografía: la misma pila que instagram.com (SF Pro en iOS, Roboto en Android) */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-14-5: 14.5px;
  --fs-15: 15px;
  --fs-16: 16px;
  --fs-22: 22px;

  /* Medidas del directo */
  --stage-radius: 12px;
  --edge: 16px;          /* margen izquierdo de avatar y caja de comentario */
  --icon-col: 32.2px;    /* centro de los iconos de la derecha, desde el borde */
  --badge-h: 26px;
  --avatar-top: 32px;
  --avatar-comment: 32px;
  --bar-h: 64px;
  --pill-h: 42px;
  --icon-box: 30px;     /* los iconos se dibujan en 30 × 30 pt */
  --bar-btn: 42px;

  /* Radios por función */
  --r-sheet: 17px;
  --r-card: 12px;
  --r-banner: 12px;
  --r-field: 12px;
  --r-button: 10px;
  --r-search: 10px;

  /* Movimiento */
  --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
  --dur-fast: 150ms;
  --dur-base: 220ms;
  --dur-slow: 300ms;
  --dur-heart: 2600ms;

  --safe-top: env(safe-area-inset-top, 0px);
  --blur-guard: 0px;          /* franja libre bajo la barra de estado (ver html.ios-standalone) */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--ig-bg); }
body {
  font-family: var(--font);
  font-size: var(--fs-14);
  line-height: 1.3;
  color: var(--ig-text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  touch-action: manipulation;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; }
img { display: block; }
.hidden { display: none !important; }

/* Contenedor: pantalla completa en el móvil, marco de iPhone 16 Pro en escritorio */
#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--ig-bg);
}
@media (min-width: 600px) and (min-height: 700px) {
  /* en el ordenador se simula el hueco de la barra de estado y del indicador de inicio */
  :root { --safe-top: 54px; --safe-bottom: 26px; }
  body { background: #05070a; }
  #app {
    inset: auto;
    left: 50%;
    top: 50%;
    width: 402px;
    height: min(874px, 100dvh - 32px);
    transform: translate(-50%, -50%);
    border-radius: 54px;
    box-shadow: 0 0 0 10px #1a1c20, 0 0 0 11px #2c2f34;
  }
}

.screen { position: absolute; inset: 0; }

/* Pegado arriba del todo: iOS colorea la barra de estado con su fondo (en modo "default"
   la mide; en "black-translucent" la pinta por debajo). Tiene que ser un elemento real. */
#statusbar-plate {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: max(env(safe-area-inset-top, 0px), 1px);
  background: var(--ig-bg);
  z-index: 100;
  pointer-events: none;
}

/* App instalada con la barra de estado translúcida (instalaciones antiguas): iOS mete la app bajo
   la barra pero calcula su alto sin ella y deja un hueco de ~59 pt abajo. 100vh es el alto real.
   Con la barra normal no hace falta (y 100vh se pasaría). La clase la pone main.js. */
/* PWA en iPhone: desde iOS 27 el sistema desenfoca ~30 pt por debajo de la barra de estado
   (medido en una captura real: borroso hasta ~78 pt, se desvanece hacia ~92 pt). Se deja esa franja
   en negro para que tu foto, tu nombre y el contador queden por debajo. */
html.ios-standalone { --blur-guard: var(--blur-guard-user, 22px); }  /* ajustable en los ajustes */
html.ios-standalone[data-rot] { --blur-guard: 0px; }

html.translucent, html.translucent body { height: 100vh; }
html.translucent #app { bottom: auto; height: 100vh; }

/* Siempre en vertical: si el móvil gira, la app se contrarrota y queda igual respecto al teléfono.
   El lado de la isla dinámica pasa a ser "arriba" (su margen sustituye al de la barra de estado). */
html[data-rot] { --safe-top: max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); --safe-bottom: 0px; }
html[data-rot] #app {
  inset: auto;
  top: 0;
  left: 0;
  width: 100vh;
  height: 100vw;
  border-radius: 0;
  box-shadow: none;
  transform-origin: 0 0;
}
html[data-rot="left"] #app { transform: translateY(100vh) rotate(-90deg); }
html[data-rot="right"] #app { transform: translateX(100vw) rotate(90deg); }

/* ═════════ Directo ═════════ */
.live {
  display: grid;
  grid-template-rows: 1fr calc(var(--bar-h) + var(--safe-bottom));
  padding-top: calc(var(--safe-top) + var(--blur-guard));
  background: var(--ig-bg);
  user-select: none;
  -webkit-user-select: none;
}

.stage {
  position: relative;
  container-type: size;
  overflow: hidden;
  border-radius: var(--stage-radius);
  background: #15191e;
  isolation: isolate;
}

.cam,
.shared-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cam.mirrored { transform: scaleX(-1); }
/* Al girar, la cámara entrega imagen apaisada: se rota al revés para que no salga torcida */
html[data-rot] .cam.cam-rot { inset: auto; left: 50%; top: 50%; width: 100cqh; height: 100cqw; }
html[data-rot="left"] .cam.cam-rot { transform: translate(-50%, -50%) rotate(90deg); }
html[data-rot="left"] .cam.cam-rot.mirrored { transform: translate(-50%, -50%) rotate(90deg) scaleX(-1); }
html[data-rot="right"] .cam.cam-rot { transform: translate(-50%, -50%) rotate(-90deg); }
html[data-rot="right"] .cam.cam-rot.mirrored { transform: translate(-50%, -50%) rotate(-90deg) scaleX(-1); }
.cam.fx { filter: saturate(1.15) contrast(1.04) brightness(1.06); }
/* Cambio de cámara: el vídeo nuevo no se ve hasta que su tamaño es estable; mientras tanto,
   el último fotograma congelado y difuminado (como hace la cámara del iPhone) */
.cam { transition: opacity var(--dur-base) var(--ease-out); }
.cam.switching { opacity: 0; transition: none; }
.cam-freeze {
  filter: blur(14px) brightness(0.9);
  transition: opacity var(--dur-base) var(--ease-out);
  pointer-events: none;
}
.cam-freeze.out { opacity: 0; }

/* Al compartir una foto, la cámara pasa a una miniatura arriba a la izquierda */
.stage.sharing .cam,
.stage.sharing .cam-off {
  inset: auto;
  left: 12px;
  top: 52px;
  width: 31%;
  height: auto;
  aspect-ratio: 3 / 4.6;
  border-radius: 10px;
  z-index: 2;
}
.stage.sharing .cam-off img { width: 44%; }

.cam-off {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #1a1e23;
}
.cam-off img {
  width: 30%;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
}

.scrim { position: absolute; left: 0; right: 0; pointer-events: none; z-index: 3; }
.scrim-bottom { bottom: 0; height: 45%; background: linear-gradient(transparent, var(--scrim-bottom)); }

/* Barra superior */
.topbar {
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  z-index: 10;
  height: var(--avatar-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 calc(var(--icon-col) - 17px) 0 var(--edge);
}
.host {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
}
.avatar {
  flex: none;
  width: var(--avatar-top);
  height: var(--avatar-top);
  border-radius: 50%;
  object-fit: cover;
  background: #d9d9d9;
}
.host-name {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  margin-left: 12.5px;
  font-size: var(--fs-15);
  font-weight: 600;
}
/* Instagram recorta el nombre por letras, sin "…" (lo ajusta fitHandle) */
.host-name > span:first-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
}
.verified { flex: none; width: 13px; height: 13px; }
.host-chevron { flex: none; width: 16px; height: 16px; margin-left: 6px; color: #fff; }

.top-right {
  display: flex;
  align-items: center;
  flex: none;
}
.live-badge {
  height: var(--badge-h);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border-radius: calc(var(--badge-h) / 2);
  background: var(--ig-live);
  color: #fff;
  font-size: var(--fs-13);
  font-weight: 600;
  white-space: nowrap;
}
.viewers {
  height: 28px;
  margin-left: 8px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 5px;
  background: var(--ig-count);
  color: #fff;
  font-size: var(--fs-13);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.viewers svg { width: 12px; height: 9px; margin-top: 1px; }
.top-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
}
#more-btn { margin-left: 5.4px; }
.top-btn svg { width: var(--icon-box); height: var(--icon-box); }

.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
}
.icon-btn:active svg, .top-btn:active svg { opacity: 0.6; }

/* Columna derecha: centros a 32 pt del borde, separados 48,7 pt */
.rail {
  position: absolute;
  z-index: 10;
  top: 51.5px;
  right: calc(var(--icon-col) - 20px);
  display: flex;
  flex-direction: column;
  gap: 8.85px;
}
.rail .icon-btn { width: 40px; height: 40px; }
.rail .icon-btn svg { width: var(--icon-box); height: var(--icon-box); }

/* Comentarios */
.comments {
  position: absolute;
  z-index: 6;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48%;
  padding: 0 10px 9.7px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent 0, #000 36%);
  mask-image: linear-gradient(transparent 0, #000 36%);
}
.comments.off { visibility: hidden; }
.comments ol {
  list-style: none;
  display: flex;
  flex-direction: column;
  will-change: transform;
}
.c {
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-right: 56px;
  padding: 12px 0 0 6px;
}
.c .c-avatar {
  flex: none;
  width: var(--avatar-comment);
  height: var(--avatar-comment);
  border-radius: 50%;
  object-fit: cover;
  background: #d9d9d9;
}
.c-body { min-width: 0; padding-top: 1px; }
.c-user {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: var(--fs-14);
  font-weight: 600;
  line-height: 17px;
  color: var(--ig-username-dim);
}
.c-user .verified { width: 12px; height: 12px; }
.c-text {
  font-size: var(--fs-15);
  line-height: 19px;
  color: #fff;
  overflow-wrap: anywhere;
  text-shadow: 0 0 4px rgb(0 0 0 / 0.15);
}
/* "X ora partecipa" + botón "👋 Saluta": una línea en negrita, a todo el ancho */
.c.join {
  align-items: center;
  gap: 9px;
  margin-right: 6.6px;
}
.c.join .c-body { flex: 1 1 auto; padding-top: 0; }
.c.join .c-text {
  font-size: var(--fs-15);
  font-weight: 600;
  line-height: 19px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c.join.many .c-text { white-space: normal; }
.c.join .c-text b { font-weight: inherit; }
.wave {
  flex: none;
  height: 32px;
  margin-left: 8px;
  padding: 0 13px 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 16px;
  background: var(--ig-wave);
  color: #fff;
  font-size: var(--fs-14-5);
  font-weight: 600;
  white-space: nowrap;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.wave .emoji { font-size: 15px; line-height: 1; }
.wave:disabled { opacity: 0.45; }
.c.host-comment .c-user { color: #fff; }

/* Aviso del sistema al empezar ("Estamos avisando a tus seguidores…") */
.c.notice {
  margin: 8px 0.5px 0 0;
  padding: 12px 30px 12px 6px;
  align-items: center;
  gap: 9px;
  min-height: 57px;
  border-radius: var(--r-banner);
  background: var(--ig-banner);
}
.c.notice svg { flex: none; width: 32px; height: 32px; }
.c.notice .c-text { font-size: var(--fs-14-5); line-height: 16.7px; text-shadow: none; }

.c.enter { animation: c-in var(--dur-slow) var(--ease-out); }
@keyframes c-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Corazones flotantes. La subida se mide en cqh (alto del contenedor) */
.hearts {
  position: absolute;
  z-index: 7;
  right: calc(var(--icon-col) - 22px);
  bottom: 16px;
  width: 44px;
  height: 40%;
  max-height: 300px;
  pointer-events: none;
  container-type: size;
}
.heart {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  color: #fff;
  will-change: transform, opacity;
  animation: heart-rise var(--dur-heart) cubic-bezier(0.33, 0.6, 0.6, 1) forwards;
}
.heart svg { width: 100%; height: 100%; filter: drop-shadow(0 0 2px rgb(0 0 0 / 0.15)); }
.heart.red { color: var(--ig-heart-red); }
.heart.face {
  width: 28px;
  height: 28px;
  margin-left: -14px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 1.5px #fff;
}
.heart.face img { width: 100%; height: 100%; object-fit: cover; }
@keyframes heart-rise {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.4); }
  8%   { opacity: var(--o, 1); transform: translate(0, -12px) scale(1); }
  35%  { transform: translate(calc(var(--sway) * 1px), -38cqh) scale(1); }
  70%  { opacity: var(--o, 1); transform: translate(calc(var(--sway) * -0.6px), -72cqh) scale(0.95); }
  100% { opacity: 0; transform: translate(calc(var(--sway) * 0.4px), -96cqh) scale(0.9); }
}

/* Barra inferior */
.bar {
  display: flex;
  align-items: flex-start;
  padding: 10.3px calc(var(--icon-col) + 4.1px - var(--bar-btn) / 2) var(--safe-bottom) var(--edge);
  background: var(--ig-bg);
}
.comment-pill {
  flex: 1 1 auto;
  min-width: 0;
  height: var(--pill-h);
  margin-right: 6.9px;
  display: flex;
  align-items: center;
  border: 1px solid var(--ig-comment-border);
  border-radius: calc(var(--pill-h) / 2);
  padding-left: 24px;
  overflow: hidden;
}
/* 16 px reales para que iOS no haga zoom al enfocar; se ve a 15 px */
.comment-pill input {
  width: 106.7%;
  flex: none;
  min-width: 0;
  font-size: var(--fs-16);
  transform: scale(0.9375);
  transform-origin: left center;
  background: none;
  border: 0;
  outline: 0;
  color: #fff;
  caret-color: var(--ig-blue);
}
.comment-pill input::placeholder { color: var(--ig-text); }
.comment-pill.disabled input::placeholder { color: var(--ig-text-3); }
.bar .icon-btn { width: var(--bar-btn); height: var(--pill-h); }
.bar .icon-btn svg { width: var(--icon-box); height: var(--icon-box); }

/* ═════════ Hojas inferiores ═════════ */
.sheet-layer { position: absolute; inset: 0; z-index: 50; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: var(--ig-backdrop);
  animation: fade-in var(--dur-base) var(--ease-out);
}
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 82%;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--safe-bottom) + 16px);
  background: var(--ig-sheet);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  animation: sheet-in var(--dur-slow) var(--ease-out);
}
.sheet.closing { animation: sheet-out var(--dur-base) ease-in forwards; }
.sheet-layer.closing .sheet-backdrop { animation: fade-out var(--dur-base) ease-in forwards; }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.grabber {
  width: 34px;
  height: 4px;
  margin: 14px auto 0;
  border-radius: 2px;
  background: rgb(255 255 255 / 0.42);
  flex: none;
}
.sheet-title {
  padding: 16px 16px 12px;
  text-align: center;
  font-size: var(--fs-16);
  font-weight: 700;
  flex: none;
}
.sheet-sub {
  padding: 0 24px 14px;
  text-align: center;
  color: var(--ig-text-2);
  font-size: var(--fs-14);
  line-height: 18px;
}
.sheet-sub.list-sub { padding: 8px 24px 4px; }

/* Menú "···": dos tarjetas arriba y una lista agrupada con iconos */
.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 24px 16px 0;
}
.tile {
  height: 73px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--r-card);
  background: var(--ig-card);
  font-size: var(--fs-14);
}
.tile svg { width: 25px; height: 25px; }
.menu {
  margin: 11px 16px 0;
  border-radius: var(--r-card);
  background: var(--ig-card);
  overflow: hidden;
}
.menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 53px;
  padding: 12px 48px 12px 0;
  text-align: left;
  font-size: var(--fs-16);
  line-height: 20px;
  border-top: 0.5px solid var(--ig-separator);
}
.menu-item:first-child { border-top: 0; }
.menu-item svg { flex: none; width: 24px; height: 24px; margin: 0 16px 0 21px; }
.menu-item.danger,
.menu-item.center { justify-content: center; padding: 12px 16px; text-align: center; }
.menu-item.danger { color: var(--ig-red); font-weight: 600; }
.tile:active, .menu-item:active { background: var(--ig-card-press); }

.sheet-search {
  margin: 4px 16px 6px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: var(--r-search);
  background: var(--ig-card);
  color: var(--ig-text-2);
  flex: none;
}
.sheet-search svg { width: 16px; height: 16px; flex: none; }
.sheet-search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  font-size: var(--fs-16);
  color: var(--ig-text);
}
.sheet-search input::placeholder { color: var(--ig-text-2); }
.sheet-list {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 0 4px;
  -webkit-overflow-scrolling: touch;
}
.sheet-count { padding: 10px 16px 4px; font-size: var(--fs-16); font-weight: 700; }
.sheet-empty { padding: 28px 32px 20px; text-align: center; color: var(--ig-text-2); line-height: 1.4; }
.u-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
}
.u-row img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; background: #d9d9d9; }
.u-meta { flex: 1; min-width: 0; }
.u-handle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: var(--fs-14);
}
.u-handle span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.u-handle .verified { width: 12px; height: 12px; }
.u-name { color: var(--ig-text-2); font-size: var(--fs-14); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-btn {
  flex: none;
  height: 32px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--ig-blue);
  color: #fff;
  font-size: var(--fs-14);
  font-weight: 600;
}
.u-btn.done { background: var(--ig-card); }
.u-more { flex: none; width: 32px; height: 32px; display: grid; place-items: center; color: var(--ig-text); }
.u-more svg { width: 18px; height: 18px; }
@media (hover: hover) { .u-row:hover { background: rgb(255 255 255 / 0.04); } }

/* Aviso breve */
.toast {
  position: absolute;
  z-index: 60;
  left: 50%;
  bottom: calc(var(--bar-h) + var(--safe-bottom) + 18px);
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ig-card);
  font-size: var(--fs-14);
  text-align: center;
  animation: fade-in var(--dur-base) var(--ease-out);
}

/* ═════════ Ajustes ═════════ */
.setup {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-top) + var(--blur-guard) + 24px) 16px calc(var(--safe-bottom) + 32px);
}
.setup-head h1 { font-size: var(--fs-22); font-weight: 700; letter-spacing: -0.01em; }
.setup-head p { margin-top: 4px; color: var(--ig-text-2); }

.profile-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0 20px;
}
.profile-pic {
  width: 77px;
  height: 77px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  background: #d9d9d9;
}
.profile-pic img { width: 100%; height: 100%; object-fit: cover; }
.profile-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.link { color: var(--ig-blue); font-weight: 600; font-size: var(--fs-14); padding: 2px 0; }
.link.muted { color: var(--ig-text-2); font-weight: 400; }

.group { display: flex; flex-direction: column; gap: 10px; }
.group-title {
  margin: 28px 0 10px;
  font-size: var(--fs-16);
  font-weight: 700;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 14px 10px;
  border-radius: var(--r-field);
  background: var(--ig-sheet);
}
.field:focus-within { box-shadow: 0 0 0 1px var(--ig-text-2); }
.field span { font-size: var(--fs-12); color: var(--ig-text-2); }
.field input, .field select {
  width: 100%;
  background: none;
  border: 0;
  outline: 0;
  font-size: var(--fs-16);
  color: var(--ig-text);
  padding: 2px 0 0;
  -webkit-appearance: none;
  appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23a8abb0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 16px;
  padding-right: 22px;
}
.field select option { background: var(--ig-sheet); }
.field input::placeholder { color: var(--ig-text-3); }
.field-error { color: var(--ig-red); font-size: var(--fs-13); padding: 0 4px; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: var(--r-field);
  background: var(--ig-sheet);
  font-size: var(--fs-16);
}
.switch-row small { display: block; margin-top: 2px; font-size: var(--fs-12); color: var(--ig-text-2); }
.switch {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--ig-card-press);
  position: relative;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--dur-fast) var(--ease-out);
}
.switch:checked { background: var(--ig-blue); }
.switch:checked::after { transform: translateX(18px); }
.switch:disabled { opacity: 0.4; }
.switch:focus-visible, .btn-primary:focus-visible, .link:focus-visible { box-shadow: 0 0 0 2px var(--ig-blue); outline: 0; }

.btn-primary {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 28px;
  border-radius: var(--r-button);
  background: var(--ig-blue);
  color: #fff;
  font-size: var(--fs-14);
  font-weight: 600;
}
.btn-primary:active { background: var(--ig-blue-press); }
.btn-primary:disabled { opacity: 0.5; }
.camera-note { margin-top: 10px; color: var(--ig-text-2); font-size: var(--fs-13); text-align: center; min-height: 1em; }

.tricks {
  margin-top: 28px;
  padding: 14px;
  border-radius: var(--r-field);
  background: var(--ig-sheet);
}
.tricks summary { font-weight: 600; cursor: pointer; }
.tricks ul { margin: 10px 0 0 18px; color: var(--ig-text-2); line-height: 1.5; }
.tricks li + li { margin-top: 6px; }
.tricks b { color: var(--ig-text); font-weight: 600; }

/* ═════════ Fin del directo ═════════ */
.end {
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + var(--blur-guard) + 24px) 16px calc(var(--safe-bottom) + 24px);
}
.end-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.end-avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: #d9d9d9; }
.end h2 { margin-top: 16px; font-size: var(--fs-22); font-weight: 700; text-wrap: balance; }
.end-stats {
  width: 100%;
  max-width: 320px;
  margin-top: 28px;
  border-top: 0.5px solid var(--ig-separator);
}
.end-stats div {
  display: flex;
  justify-content: space-between;
  padding: 14px 4px;
  border-bottom: 0.5px solid var(--ig-separator);
}
.end-stats dt { color: var(--ig-text-2); }
.end-stats dd { font-weight: 600; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .c.enter, .sheet, .sheet-backdrop, .toast { animation: none; }
  :root { --dur-heart: 1800ms; }
}
