:root {
  --fondo: #14110f;
  --panel: #1f1a17;
  --panel2: #2a2420;
  --linea: #3a322c;
  --texto: #f3ece4;
  --suave: #b3a79b;
  --acento: #ff8a3d;
  --acento2: #ffb27a;
  --ok: #7fd18b;
  --mal: #ff6b6b;
  --radio: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 50% -200px, #2b1d14 0%, var(--fondo) 60%) fixed, var(--fondo);
  color: var(--texto);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
main {
  max-width: 640px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 18px max(40px, env(safe-area-inset-bottom));
}
header { margin: 8px 0 22px; }
.marca { display: flex; gap: 14px; align-items: center; }
.marca h1 { font-size: 1.45rem; margin: 0; letter-spacing: -0.01em; }
.marca p { margin: 2px 0 0; color: var(--suave); font-size: .95rem; }
.logo {
  width: 44px; height: 58px; flex: none;
  border: 3px solid var(--acento); border-radius: 8px;
  display: grid; place-items: center; position: relative;
}
.logo::after {
  content: ""; position: absolute; bottom: -10px; left: 50%; width: 3px; height: 8px;
  background: var(--acento); transform: translateX(-50%);
}
.logo span { width: 0; height: 0; border-left: 12px solid var(--acento2); border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 4px; }

.aviso { padding: 14px 16px; border-radius: 14px; margin-bottom: 16px; }
.aviso.error { background: #3a1717; border: 1px solid #6b2626; }

.zona {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 34px 20px; border-radius: var(--radio);
  border: 2px dashed var(--linea); background: var(--panel);
  cursor: pointer; text-align: center; transition: border-color .15s, background .15s;
}
.zona:hover, .zona:focus-visible, .zona.encima { border-color: var(--acento); background: #261e19; outline: none; }
.zona-icono {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--acento); color: #1a0f07; margin-bottom: 6px;
}
.zona-titulo { font-size: 1.2rem; font-weight: 700; }
.zona-sub { color: var(--suave); font-size: .9rem; }

.lista { display: flex; flex-direction: column; gap: 14px; margin: 18px 0; }
.tarjeta { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 16px; }
.tarjeta-cab { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.nombre { font-weight: 650; word-break: break-word; }
.quitar {
  flex: none; width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: var(--panel2); color: var(--suave); font-size: 20px; line-height: 1; cursor: pointer;
}
.datos { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.dato { background: var(--panel2); border-radius: 999px; padding: 3px 10px; font-size: .82rem; color: var(--suave); }
.dato b { color: var(--texto); font-weight: 600; }
.estado { font-size: .92rem; color: var(--suave); margin-top: 8px; }
.estado.ok { color: var(--ok); }
.estado.mal { color: var(--mal); }
.barra { height: 8px; background: var(--panel2); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.barra span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--acento), var(--acento2)); transition: width .2s; }

.resultado { display: flex; gap: 18px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.tele-marco { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tele {
  --w: 126px; --h: 224px;
  width: var(--w); height: var(--h); position: relative; overflow: hidden;
  background: #000; border: 6px solid #0b0b0b; border-radius: 6px;
  box-shadow: 0 0 0 1px #4a4038, 0 10px 30px #0008;
}
.tele video {
  position: absolute; top: 50%; left: 50%;
  width: calc(var(--h) - 12px); height: calc(var(--w) - 12px);
  object-fit: contain; transform: translate(-50%, -50%) rotate(var(--giro, -90deg));
}
.tele-pie { font-size: .78rem; color: var(--suave); }
.acciones { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 10px; }
.salida { font-size: .85rem; color: var(--suave); }
.salida b { color: var(--texto); }
.boton {
  display: block; text-align: center; text-decoration: none; cursor: pointer;
  padding: 13px 16px; border-radius: 12px; font: inherit; font-weight: 650;
  border: 1px solid var(--linea); background: var(--panel2); color: var(--texto);
}
.boton.principal { background: var(--acento); border-color: var(--acento); color: #1a0f07; }

.opciones { background: var(--panel); border: 1px solid var(--linea); border-radius: 14px; margin-top: 12px; }
.opciones summary { padding: 14px 16px; cursor: pointer; font-weight: 600; }
.opciones[open] summary { border-bottom: 1px solid var(--linea); }
.opcion { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.segmento { display: flex; background: var(--panel2); border-radius: 10px; padding: 3px; }
.segmento label { padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: .92rem; color: var(--suave); }
.segmento input { display: none; }
.segmento label:has(input:checked) { background: var(--acento); color: #1a0f07; font-weight: 650; }
.nota { margin: 0; padding: 0 16px 14px; font-size: .85rem; color: var(--suave); }
.que-hace { margin: 0; padding: 12px 16px 14px 34px; color: var(--suave); font-size: .92rem; }
.que-hace li { margin: 4px 0; }
.que-hace b { color: var(--texto); }

/* ── Pestañas ── */
.pestanas { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--panel); border: 1px solid var(--linea); border-radius: 14px; padding: 5px; margin-bottom: 16px; }
.pestanas button { font: inherit; font-weight: 650; font-size: .93rem; padding: 11px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--suave); cursor: pointer; }
.pestanas button[aria-selected="true"] { background: var(--acento); color: #1a0f07; }

/* ── Fotos ── */
.fotos-cab { display: flex; justify-content: space-between; align-items: center; margin: 16px 2px 10px; color: var(--suave); font-size: .92rem; }
.link { background: none; border: 0; color: var(--acento2); font: inherit; cursor: pointer; padding: 4px; }
.fotos-lista { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.foto { position: relative; background: var(--panel); border: 1px solid var(--linea); border-radius: 12px; overflow: hidden; }
.foto img { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: #000; }
.foto .num { position: absolute; top: 5px; left: 5px; background: #000b; border-radius: 99px; padding: 1px 8px; font-size: .78rem; font-weight: 700; }
.foto .x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: #000b; color: #fff; font-size: 17px; line-height: 1; cursor: pointer; }
.foto .mover { display: grid; grid-template-columns: 1fr 1fr; }
.foto .mover button { border: 0; border-top: 1px solid var(--linea); background: var(--panel2); color: var(--texto); padding: 7px 0; font-size: 15px; cursor: pointer; }
.foto .mover button + button { border-left: 1px solid var(--linea); }
.foto .mover button:disabled { color: #5c524a; cursor: default; }
.foto.mal img { opacity: .3; }
.foto.mal::after { content: "No se pudo abrir"; position: absolute; inset: 40% 6px auto; text-align: center; font-size: .75rem; color: var(--mal); }
.ajustes { background: var(--panel); border: 1px solid var(--linea); border-radius: 14px; margin: 14px 0; padding-top: 4px; }
.boton.grande { width: 100%; padding: 16px; font-size: 1.05rem; }
.boton:disabled { opacity: .5; cursor: default; }
