/* Abuela Intel — una única gramática visual para todos los recorridos. */
@font-face {
  font-family: Inter;
  src: url("/static/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Inter Tight";
  src: url("/static/fonts/inter-tight.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --bg: #fafaf8;
  --panel: #fff;
  --soft: #f0f2ed;
  --ink: #202321;
  --ink2: #454a45;
  --muted: #696d69;
  --line: #e2e5df;
  --accent: #2848e7;
  --accent-bg: #edf1ff;
  --ok: #34715d;
  --warn: #91621d;
  --bad: #b44340;
  --danger: #b44340;
  --ui: Inter, system-ui, sans-serif;
  --display: "Inter Tight", Inter, system-ui, sans-serif;
  --radius: 18px;
  --shadow: 0 18px 70px #1621391c;
  --duration: 180ms;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #141515;
  --panel: #202221;
  --soft: #282d27;
  --ink: #f2f3ee;
  --ink2: #d6dad4;
  --muted: #a7ada7;
  --line: #373d36;
  --accent: #b7c5ff;
  --accent-bg: #252e48;
  --ok: #8ccdb5;
  --warn: #e9bd79;
  --bad: #f1938c;
  --danger: #f1938c;
  --shadow: 0 18px 70px #0007;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
  scroll-padding: 100px;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 400 15px/1.55 var(--ui);
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
button:disabled {
  opacity: 0.48;
  cursor: default;
}
svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  flex: none;
}
button svg,
a svg {
  pointer-events: none;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
button,
a {
  touch-action: manipulation;
}
p {
  margin: 0 0 16px;
}
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 550;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
}
h1 {
  font-size: 44px;
}
h2 {
  font-size: 21px;
}
h3 {
  font-size: 17px;
}
b,
strong {
  font-weight: 600;
}
small {
  font-size: 12px;
}
.muted,
.sub {
  color: var(--muted);
}
.sm {
  font-size: 13px;
}
.xs {
  font-size: 12px;
}
.link {
  color: var(--accent);
}
.sr-only,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.skip:focus {
  position: fixed;
  z-index: 200;
  background: var(--panel);
  padding: 14px;
}
.top {
  height: 88px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}
.in {
  max-width: 1280px;
  margin: auto;
  padding: 0 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 30px/1 var(--display);
  letter-spacing: -1.35px;
  min-height: 44px;
}
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.brand-lockup .brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
  color: var(--accent);
  transform: translateY(-2px);
}
.brand-name {
  text-transform: lowercase;
}
.brand-intel {
  font-weight: 450;
}
.brand-dot {
  color: var(--accent);
}
.mark {
  display: inline-flex;
  color: var(--accent);
  align-items: center;
  justify-content: center;
}
.mark svg {
  width: 30px;
  height: 30px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topnav {
  display: flex;
  gap: 8px;
  margin-left: auto;
  margin-right: auto;
}
.topnav a {
  min-height: 48px;
  padding: 12px 12px;
  color: var(--muted);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topnav a.act {
  color: var(--ink);
  font-weight: 600;
}
.topnav a.act svg {
  color: var(--accent);
}
.topnav svg {
  width: 24px;
  height: 24px;
}
.account-link {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--soft);
  border: 1px solid var(--line);
  font-size: 13px;
}
.icon-btn {
  border: 0;
  background: transparent;
  color: var(--ink2);
  width: 44px;
  height: 44px;
  padding: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  flex: none;
}
.icon-btn:hover {
  background: var(--soft);
}
.tabs {
  display: none;
}
main {
  width: min(100% - 80px, 900px);
  margin: 48px auto 36px;
  animation: page-in 220ms ease-out;
  outline: none;
}
.home-main {
  width: min(100% - 80px, 1180px);
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}
.page-heading h1 {
  margin: 0;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  min-height: 44px;
  margin-bottom: 14px;
}
.back-link svg {
  width: 16px;
  height: 16px;
}
.card {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  margin: 0;
}
.card:first-child {
  padding-top: 0;
}
.card:last-child {
  border-bottom: 0;
}
.card.flat {
  border: 0;
}
.card > h2,
.card > .head {
  margin-bottom: 18px;
}
.head,
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.head,
.between {
  justify-content: space-between;
}
.head h2,
.row h2 {
  margin-bottom: 0;
}
.nowrap {
  flex-wrap: nowrap;
}
.end {
  justify-content: flex-end;
  margin-top: 24px;
}
.right {
  margin-left: auto;
}
.t {
  flex: 1;
  min-width: 0;
}
.t small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}
.hr {
  height: 1px;
  background: var(--line);
  margin: 24px 0;
}
.grid2,
.grid3 {
  display: grid;
  gap: 20px;
}
.grid2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.btn,
.accion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 999px;
  min-height: 48px;
  padding: 11px 18px;
  line-height: 1.25;
  font-size: 14px;
  font-weight: 500;
  transition:
    background 150ms,
    transform 150ms;
}
.btn:hover,
.accion:hover {
  filter: brightness(0.97);
}
.btn:active,
.accion:active {
  transform: translateY(1px);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.btn.sec {
  background: var(--soft);
  border-color: transparent;
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn.danger {
  background: transparent;
  color: var(--bad);
  border-color: transparent;
}
.btn.sm {
  font-size: 13px;
  padding: 10px 13px;
  min-height: 44px;
}
.block {
  width: 100%;
}
.btn svg {
  width: 24px;
  height: 24px;
}
.chip {
  display: inline-block;
  font-size: 11px;
  line-height: 1.3;
  padding: 5px 8px;
  background: var(--soft);
  border-radius: 6px;
  color: var(--muted);
  vertical-align: middle;
}
.chip.accent {
  color: var(--accent);
  background: var(--accent-bg);
}
.chip.ok {
  color: var(--ok);
}
.chip.warn {
  color: var(--warn);
}
.chip.bad {
  color: var(--bad);
}
.msg {
  padding: 14px 17px;
  border-radius: 12px;
  background: var(--soft);
  margin: 16px 0;
  font-size: 14px;
  border-left: 2px solid var(--line);
}
.msg.ok {
  border-color: var(--ok);
}
.msg.warn {
  border-color: var(--warn);
}
.msg.err {
  border-color: var(--bad);
  color: var(--bad);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 22px;
  min-width: 0;
}
.field > label {
  font-size: 14px;
  font-weight: 500;
}
.field small {
  color: var(--muted);
}
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  padding: 12px;
  min-height: 46px;
  width: 100%;
  min-width: 0;
}
textarea {
  min-height: 110px;
  resize: vertical;
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
  width: 19px;
  height: 19px;
  flex: none;
}
fieldset.limpio {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
fieldset:disabled {
  opacity: 0.65;
}
.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.switch span {
  flex: 1;
}
.switch small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.switch input {
  appearance: none;
  width: 38px;
  height: 23px;
  border-radius: 20px;
  background: var(--line);
  position: relative;
  border: 1px solid var(--muted);
  transition: background 150ms;
}
.switch input:after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 15px;
  height: 15px;
  background: var(--muted);
  border-radius: 50%;
  transition: transform 150ms;
}
.switch input:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.switch input:checked:after {
  background: var(--bg);
  transform: translateX(15px);
}
.opciones {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.opciones label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  min-height: 44px;
}
.savebar {
  display: flex;
  justify-content: flex-end;
  padding: 24px 0;
}
.item,
.voz {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.item:last-child,
.voz:last-child {
  border-bottom: 0;
}
.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  background: var(--soft);
  border-radius: 12px;
  color: var(--muted);
}
.avatar svg {
  width: 24px;
  height: 24px;
}
.menu a {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 78px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.menu a:last-child {
  border: 0;
}
.menu a > span {
  flex: 1;
}
.menu a small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.menu a > svg:first-child {
  color: var(--accent);
}
.menu .chev {
  width: 17px;
  color: var(--muted);
}
.menu a:hover {
  color: var(--accent);
}
details {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}
summary {
  cursor: pointer;
  list-style: none;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  gap: 12px;
}
summary:after {
  content: "+";
  font-size: 21px;
  font-weight: 400;
  color: var(--muted);
}
summary::-webkit-details-marker {
  display: none;
}
details[open] > summary:after {
  content: "−";
}
details[open] > summary {
  margin-bottom: 20px;
}
.empty {
  padding: 38px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.empty .ico {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.empty svg {
  width: 28px;
  height: 28px;
}
.stat b {
  display: block;
  font: 500 30px var(--display);
  letter-spacing: -0.8px;
  font-variant-numeric: tabular-nums;
}
.stat small {
  color: var(--muted);
}
.tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
.tabla th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.tabla th,
.tabla td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.tabla td:first-child,
.tabla th:first-child {
  padding-left: 0;
}
.table-scroll {
  overflow: auto;
  max-width: 100%;
}
.pasos {
  list-style: none;
  padding: 0;
  font-size: 13px;
}
.pasos li {
  padding: 10px 0;
}
.pasos span {
  margin-right: 10px;
}
.aviso,
.diag {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.aviso .p,
.diag .p,
.dot {
  width: 6px;
  height: 6px;
  background: var(--muted);
  border-radius: 50%;
  flex: none;
  margin-top: 9px;
}
.alta .p,
.bad .p,
.error .p {
  background: var(--bad);
}
.aviso.info .p,
.aviso.revisado .p {
  background: var(--muted);
}
.warn .p {
  background: var(--warn);
}
.diag.ok .p,
.dot.ok {
  background: var(--ok);
}
.aviso b,
.diag b {
  font-size: 14px;
}
.aviso .m,
.diag small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}
.cuando {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.ia {
  font-size: 13px;
  padding: 12px;
  background: var(--soft);
  border-radius: 10px;
  margin-top: 10px;
}
.frase {
  font-size: 15px;
  color: var(--ink2);
}
.tramo {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.tramo .h {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.linea {
  display: flex;
  gap: 14px;
  padding: 7px 0;
  align-items: baseline;
}
.linea .q {
  font-size: 12px;
  min-width: 70px;
  color: var(--muted);
}
.linea.tele,
.linea.ruido {
  color: var(--muted);
}
.foto-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--soft);
  cursor: zoom-in;
}
.foto {
  display: block;
  width: 100%;
  max-height: 540px;
  object-fit: contain;
  background: #141515;
  border-radius: var(--radius);
}
.photo-expand {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0006;
  color: #fff;
  display: grid;
  place-items: center;
}
.photo-expand svg {
  width: 18px;
  height: 18px;
}
.foto-wrap .hora {
  position: absolute;
  bottom: 16px;
  left: 16px;
  font-size: 12px;
  color: #fff;
  background: #0009;
  max-width: calc(100% - 64px);
  border-radius: 20px;
  backdrop-filter: blur(12px);
  padding: 6px 10px;
}
.foto.rota {
  max-height: 200px;
  object-fit: contain;
  padding: 70px;
  background: var(--soft);
}
.strip {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding-bottom: 10px;
}
.strip .f {
  width: 125px;
  flex: none;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
}
.strip img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
}
.strip span {
  font-size: 12px;
  color: var(--muted);
}
.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--soft);
  border-radius: 999px;
  max-width: 520px;
  margin-bottom: 28px;
}
.seg a {
  flex: 1;
  text-align: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--muted);
}
.seg .act {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 4px #12210f0d;
}
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  grid-template-areas: "image intro" "image actions";
  gap: 20px 42px;
  align-items: start;
}
.home-copy {
  grid-area: intro;
  align-self: start;
}
.home-grid > .home-actions {
  grid-area: actions;
  align-self: end;
}
.home-grid > .home-photo {
  grid-area: image;
  align-self: stretch;
  height: 100%;
  aspect-ratio: auto;
}
.person-title {
  font-size: clamp(60px, 6.6vw, 90px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.06em;
  overflow-wrap: anywhere;
  margin: 14px 0 24px;
}
.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  color: var(--muted);
}
.observation {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 12px;
}
.home-photo {
  aspect-ratio: 16/9;
  border: 0;
  padding: 0;
}
.home-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-actions {
  display: flex;
  gap: 12px;
}
.home-actions .btn {
  min-height: 52px;
  flex: 1;
  padding: 12px;
}
.home-actions .primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.home-actions svg {
  width: 24px;
  height: 24px;
}
.home-recent {
  margin-top: 44px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.section-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.section-link h2 {
  margin: 0;
}
.section-link a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 12px;
  color: var(--muted);
}
.incident-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px;
  background: color-mix(in srgb, var(--bad) 8%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--bad) 25%, var(--bg));
  border-radius: 14px;
  margin-bottom: 32px;
  color: var(--bad);
}
.incident-banner .t small {
  color: inherit;
}
.record {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}
.record .record-time {
  font-size: 12px;
  color: var(--muted);
  width: 44px;
  flex: none;
  padding-top: 3px;
}
.record .event-icon {
  color: var(--accent);
}
.record .t > b {
  font-weight: 500;
}
.record p {
  font-size: 13px;
  color: var(--muted);
  margin: 5px 0 0;
}
.record details {
  border: 0;
  padding: 8px 0 0;
}
.record summary {
  font-size: 12px;
  color: var(--muted);
}
.record[data-kind="incidente"] .event-icon {
  color: var(--bad);
}
.filters {
  margin-bottom: 24px;
  border: 0;
  padding: 0;
}
.filters summary {
  justify-content: flex-start;
  color: var(--muted);
}
.filters summary:after {
  margin-left: auto;
}
.filter-form {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr auto;
  gap: 12px;
  align-items: end;
  padding: 18px;
  background: var(--soft);
  border-radius: 14px;
}
.filter-form .field {
  margin: 0;
}
.activity-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.chart-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
}
.chart-top select {
  width: auto;
  font-size: 13px;
  border: 0;
  padding: 6px 24px 6px 10px;
  min-height: 44px;
}
.metric-label {
  font-size: 14px;
  color: var(--muted);
}
.metric-value {
  font: 500 50px/1.15 var(--display);
  letter-spacing: -1.8px;
  display: block;
  margin: 8px 0;
}
.metric-value small {
  font: 400 14px var(--ui);
  letter-spacing: 0;
  color: var(--muted);
  margin-left: 5px;
}
.chart-tap {
  display: block;
  padding: 0;
  width: 100%;
  background: transparent;
  border: 0;
  text-align: left;
  color: var(--accent);
  border-radius: 8px;
  margin: 28px 0 10px;
}
.chart-tap svg {
  width: 100%;
  height: 190px;
  display: block;
  overflow: visible;
}
.chart-line {
  stroke: var(--accent);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-dot {
  fill: var(--accent);
  stroke: var(--bg);
  stroke-width: 2;
}
.chart-axis {
  font: 11px var(--ui);
  fill: var(--muted);
  stroke: none;
}
.chart-rule {
  stroke: var(--line);
  stroke-width: 1;
}
.chart-band {
  fill: var(--accent-bg);
  stroke: none;
}
.chart-footer {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}
.metric-rows {
  margin-top: 34px;
}
.metric-row {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 96px;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  text-align: left;
  padding: 20px 0;
}
.metric-row > svg {
  color: var(--muted);
}
.metric-row .t small {
  font-size: 13px;
}
.metric-row b {
  font: 500 25px var(--display);
  letter-spacing: -0.6px;
}
.metric-row b small {
  display: inline;
  font: 400 12px var(--ui);
  letter-spacing: 0;
}
.mini-chart {
  width: 110px;
  height: 38px;
}
.mini-chart svg {
  width: 100%;
  height: 100%;
}
.chart-dialog {
  width: min(740px, calc(100vw - 32px));
  padding: 30px;
}
.chart-detail svg {
  width: 100%;
  height: 240px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 24px 0;
}
.detail-grid small {
  display: block;
  color: var(--muted);
}
.family-intro {
  font-size: 15px;
  color: var(--muted);
  max-width: 620px;
}
.family-question {
  border-top: 1px solid var(--line);
  margin-top: 28px;
}
.settings-layout {
  display: grid;
  grid-template-columns: 225px 1fr;
  gap: 54px;
}
.settings-nav a {
  display: block;
  padding: 13px 16px;
  border-radius: 10px;
  color: var(--muted);
  margin-bottom: 4px;
  font-size: 14px;
  min-height: 46px;
}
.settings-nav .act {
  background: var(--soft);
  color: var(--ink);
}
.settings-form {
  max-width: 620px;
}
.settings-description {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 26px;
}
.intelligence-overview {
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
  margin-bottom: 28px;
}
.intelligence-overview h2 {
  font-size: 22px;
  letter-spacing: -0.5px;
}
.provider-list {
  margin-top: 24px;
}
.provider-item {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.provider-item .field {
  margin: 18px 0 12px;
}
.provider-action {
  margin-top: 10px;
}
.provider-item summary,
.provider-list > summary {
  min-height: 46px;
}
.preferences-grid .field {
  margin-top: 20px;
}
.settings-footer {
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding-top: 20px;
}
.preview-banner {
  padding: 6px 20px;
  background: var(--accent-bg);
  color: var(--accent);
  text-align: center;
  font-size: 11px;
}
.hero {
  display: flex;
  gap: 18px;
  align-items: center;
}
.ring {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--soft);
  display: grid;
  place-items: center;
  color: var(--muted);
  flex: none;
}
.ring.ok {
  color: var(--ok);
}
.ring.warn {
  color: var(--warn);
}
.ring.bad {
  color: var(--bad);
}
.titulo {
  font: 550 23px var(--display);
}
.detalle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}
.aprendido {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.aprendido .de {
  font-size: 13px;
  color: var(--muted);
  margin-top: 5px;
}
.login {
  max-width: 380px;
  margin: 70px auto;
}
.login > h1 {
  font-size: clamp(32px, 7vw, 44px);
  letter-spacing: -1.8px;
  text-align: left !important;
}
.login .brand-mark {
  width: 1.1em;
  height: 1.1em;
}
.login .sub {
  font: 400 15px/1.6 var(--ui);
  display: block;
  letter-spacing: 0;
  margin-top: 12px;
}
.login > .mark {
  margin-bottom: 24px;
}
.secret {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}
pre,
code {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}
pre {
  white-space: pre-wrap;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translate(-50%, 15px);
  opacity: 0;
  padding: 13px 20px;
  border-radius: 13px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow);
  max-width: min(500px, 90vw);
  pointer-events: none;
  z-index: 100;
  font-size: 13px;
  transition:
    opacity 180ms,
    transform 180ms;
}
.toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.err {
  background: var(--bad);
  color: var(--bg);
}
dialog {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  max-height: 90dvh;
  overflow: auto;
  animation: panel-in 200ms ease-out;
}
dialog::backdrop {
  background: #111a2b50;
  backdrop-filter: blur(3px);
}
.dlg {
  width: min(450px, calc(100% - 32px));
  padding: 28px;
}
.lb {
  padding: 0;
  width: 94vw;
  height: 90dvh;
  max-width: 1400px;
  background: #141515;
  color: #fff;
  border: 0;
}
.lb .cont {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  position: relative;
}
.lb img {
  max-width: 100%;
  max-height: calc(100% - 90px);
  object-fit: contain;
}
.lb .cap {
  padding: 20px;
  font-size: 13px;
}
.lb .x {
  position: absolute;
  right: 12px;
  top: 12px;
  color: #fff;
  background: #14151599;
}
.lb .n {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 13px;
}
.lb .nav {
  position: absolute;
  top: 50%;
  background: #14151599;
  color: #fff;
  border: 0;
  border-radius: 10px;
  width: 44px;
  height: 52px;
  font-size: 28px;
}
.lb .prev {
  left: 12px;
}
.lb .next {
  right: 12px;
}
.player {
  position: relative;
  background: #141515;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
}
.player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* El navegador conserva el foco de sus controles nativos, sin enmarcar todo el vídeo. */
.player > video:focus-visible { outline:none; box-shadow:none; }
/* Conserva el estado accesible sin un rótulo permanente sobre la imagen. */
.player .live { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.player > .video-marca { position:absolute; right:16px; bottom:16px; width:48px; height:48px; color:#fff; fill:none; opacity:0; pointer-events:none; z-index:2; filter:drop-shadow(0 1px 3px #000b); transition:opacity .2s; }
.player.is-playing:not(.has-status):not(.player-ui-visible) > .video-marca { opacity:.92; }
.player .ptz-ov:not([hidden]) ~ .video-marca { opacity:0; }
.player:fullscreen > .video-marca { right:max(24px,env(safe-area-inset-right)); bottom:max(24px,env(safe-area-inset-bottom)); width:64px; height:64px; }
.player:-webkit-full-screen > .video-marca { right:24px; bottom:24px; width:64px; height:64px; }
.player > .estado {
  position: absolute;
  inset: 40% 5% auto;
  text-align: center;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.barra {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 16px 0;
  flex-wrap: wrap;
}
.ptz-ov {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 14px;
  background: #141515de;
  border-radius: 14px;
  color: #fff;
  width: 220px;
  text-align: center;
}
.ptz {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  gap: 4px;
  justify-content: center;
}
.ptz button {
  height: 44px;
  border: 1px solid #657183;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 20px;
}
.ptz-ov small {
  display: block;
  font-size: 10px;
  margin-top: 8px;
}
.hablar-fila,
.hablar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.rec,
.play {
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent);
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.rec.on {
  background: var(--bad);
  color: var(--bg);
}
.rec.sm {
  width: 46px;
  height: 46px;
}
.play svg {
  width: 20px;
  fill: currentColor;
  stroke: none;
}
.zonas {
  position: relative;
  touch-action: none;
  max-width: 100%;
  overflow: hidden;
}
.zonas img {
  width: 100%;
  display: block;
}
.zonas .z,
.zonas .draw {
  position: absolute;
  border: 2px solid var(--accent);
  background: var(--accent-bg);
}
.zonas .z.mesa {
  border-color: var(--warn);
}
.zonas .z span {
  font-size: 12px;
  background: var(--accent);
  color: #fff;
  padding: 2px 6px;
}
.zonas .pt {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
}
.chat {
  position: fixed;
  inset: 70px 24px 24px auto;
  margin: 0;
  width: 440px;
  height: min(740px, calc(100dvh - 100px));
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: none;
}
.chat-cab {
  display: flex;
  align-items: center;
  padding: 22px;
  border-bottom: 1px solid var(--line);
  gap: 6px;
}
.chat-cab small {
  font-size: 11px;
}
.chat-lista {
  flex: 1;
  overflow: auto;
  padding: 24px;
  min-height: 0;
  overscroll-behavior: contain;
}
.chat-lista .vacio {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  padding: 60px 20px;
}
.vacio .mark {
  display: block;
  margin-bottom: 20px;
}
.msg-b {
  padding: 14px 17px;
  background: var(--soft);
  border-radius: 16px;
  margin-bottom: 16px;
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg-b.tu {
  margin-left: 36px;
  background: var(--accent-bg);
}
.msg-b.ia {
  margin-right: 10px;
}
.msg-b.err {
  color: var(--bad);
}
.msg-b img {
  width: 100%;
  border-radius: 10px;
}
.paso {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0;
}
.paso.hecho {
  opacity: 0.7;
}
.chat-sug {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding: 12px 20px;
}
.chat-sug button {
  font-size: 12px;
  border: 1px solid var(--line);
  background: transparent;
  padding: 10px 12px;
  border-radius: 12px;
  min-width: 140px;
}
.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 18px;
  border-top: 1px solid var(--line);
}
.chat-form textarea {
  resize: none;
  min-height: 46px;
  max-height: 120px;
  box-shadow: none;
}
.chat-form textarea:hover, .chat-form textarea:focus {
  box-shadow: none;
  outline: none;
  border-color: var(--line);
}
.chat-form textarea:focus-visible {
  outline: 1px solid var(--muted);
  outline-offset: 2px;
}
.enviar {
  background: var(--accent);
  color: var(--bg);
}
#chat-enviar {
  border-radius: 50%;
  flex: none;
}
.chat-vozp {
  padding: 20px;
  text-align: center;
}
.chat-vozp .rec {
  margin: 0 auto 14px;
}
.chat-vozp .row {
  justify-content: center;
  margin-top: 16px;
}
.chat-vozp .est {
  font-size: 13px;
  color: var(--muted);
}
.chat-vozp .habla {
  color: var(--ok);
}
@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
/* Abuela Intel: assistant pill and three destinations, shared across all pages. */
.bottom-shell {
  position: fixed;
  z-index: 35;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  width: min(100% - 48px, 1180px);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.bottom-shell button, .bottom-shell a { pointer-events: auto; }
body:has(#chat-abrir) main { padding-bottom: 110px; }
.ask-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 350px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  padding: 13px 18px;
  text-align: left;
  font-size: 14px;
  box-shadow: 0 4px 12px #12210f08;
  transition:
    background var(--duration),
    transform var(--duration);
}
.ask-pill span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ask-pill svg:first-child {
  color: var(--accent);
}
.ask-pill svg:last-child {
  width: 18px;
  height: 18px;
  color: var(--muted);
}
.ask-pill:hover {
  background: var(--soft);
}
.ask-pill:active {
  transform: translateY(1px);
}
#home-alerts:has(> *) {
  margin-bottom: 30px;
}
#home-alerts .msg {
  margin: 0;
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--warn);
  font-size: 13px;
}
#home-alerts .msg + .msg {
  padding-top: 0;
}
#home-alerts .msg a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
@media (max-width: 760px) {
  html {
    scroll-padding-bottom: 180px;
  }
  .toast {
    bottom: calc(155px + env(safe-area-inset-bottom));
  }
  .home-main {
    width: auto;
  }
  .top {
    border-bottom: 0;
  }
  .bottom-shell {
    position: fixed;
    z-index: 30;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    margin: 0;
    padding: 12px 18px calc(8px + env(safe-area-inset-bottom));
    display: block;
    background: var(--bg);
    border-top: 1px solid var(--line);
  }
  .ask-pill {
    width: 100%;
    min-height: 50px;
    font-size: 13px;
  }
  body:not(:has(.ask-pill)) main {
    margin-bottom: 105px;
  }
  #home-alerts:has(> *) {
    margin-bottom: 24px;
  }
}
@media (min-width: 1100px) {
  .home-recent {
    max-width: 100%;
    margin-top: 44px;
  }
  .home-recent .records {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
  .home-recent .record {
    border: 0;
  }
  .evolution {
    max-width: 760px;
    margin: auto;
  }
}
@media (max-width: 760px) {
  .top {
    height: 76px;
  }
  .in {
    padding: 0 24px;
    gap: 12px;
  }
  .brand {
    font-size: 25px;
    letter-spacing: -1px;
    gap: 8px;
  }
  .brand .brand-mark {
    width: 33px;
    height: 33px;
  }
  .topnav {
    display: none;
  }
  .header-actions {
    gap: 7px;
  }
  .tabs {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    margin-top: 6px;
  }
  .tabs a {
    min-height: 52px;
    min-width: 72px;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 12px;
    color: var(--muted);
  }
  .tabs a.act {
    color: var(--ink);
    font-weight: 600;
  }
  .tabs a.act svg {
    color: var(--accent);
  }
  .tabs svg {
    width: 24px;
    height: 24px;
  }
  main {
    width: auto;
    margin: 24px 24px 175px;
  }
  .page-heading {
    margin-bottom: 24px;
  }
  h1 {
    font-size: 38px;
  }
  h2 {
    font-size: 20px;
  }
  .home-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas: "intro" "image" "actions";
    gap: 24px;
    align-items: stretch;
  }
  .person-title {
    font-size: 64px;
    letter-spacing: -3.8px;
    margin: 12px 0 14px;
  }
  .observation {
    margin-bottom: 0;
    font-size: 14px;
  }
  .home-grid .home-actions {
    order: 3;
  }
  .home-grid .home-photo {
    order: 2;
    aspect-ratio: 16/9;
    height: auto;
  }
  .home-actions {
    margin-top: 0;
  }
  .home-recent {
    margin-top: 36px;
  }
  .home-recent h2 {
    font-size: 19px;
  }
  .home-photo .hora {
    font-size: 11px;
    bottom: 12px;
    left: 12px;
  }
  .card {
    padding: 24px 0;
  }
  .grid3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .row.nowrap {
    gap: 8px;
  }
  .item,
  .voz {
    gap: 12px;
    flex-wrap: wrap;
  }
  .item > .t,
  .voz > .t {
    min-width: 50%;
  }
  .item .avatar {
    width: 36px;
    height: 36px;
  }
  .item .avatar svg {
    width: 22px;
    height: 22px;
  }
  .record {
    gap: 12px;
  }
  .record .record-time {
    width: 38px;
    font-size: 11px;
  }
  .record .t > b {
    font-size: 14px;
  }
  .record .event-icon {
    width: 23px;
  }
  .record p {
    font-size: 12px;
  }
  .filter-form {
    grid-template-columns: 1fr 1fr;
  }
  .filter-form .search {
    grid-column: 1/-1;
  }
  .chart-tap {
    margin-top: 22px;
  }
  .chart-tap svg {
    height: 155px;
  }
  .metric-value {
    font-size: 44px;
  }
  .metric-row {
    min-height: 92px;
  }
  .metric-row b {
    font-size: 22px;
  }
  .metric-row .t small {
    font-size: 12px;
  }
  .mini-chart {
    width: 76px;
  }
  .chart-top {
    gap: 12px;
  }
  .chart-dialog {
    padding: 24px 20px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .settings-layout {
    display: block;
  }
  .settings-nav {
    display: none;
  }
  .settings-layout > .settings-nav:only-child {
    display: block;
  }
  .preferences-grid .field {
    margin-top: 20px;
  }
  .settings-form .switch {
    font-size: 14px;
  }
  .login {
    margin: 35px auto;
  }
  .chat {
    inset: 0;
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }
  .chat-form {
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }
  .chat-cab {
    padding-top: max(22px, env(safe-area-inset-top));
  }
  .chat-lista {
    padding: 20px;
  }
  .player {
    aspect-ratio: 4/3;
  }
  .ptz-ov {
    right: 10px;
    bottom: 10px;
    width: 174px;
    padding: 10px;
  }
  .barra .btn {
    font-size: 12px;
    padding: 10px;
  }
  .linea {
    gap: 8px;
  }
  .linea .q {
    min-width: 55px;
    max-width: 80px;
    overflow-wrap: anywhere;
  }
  .stat b {
    font-size: 28px;
  }
  .incident-banner {
    padding: 16px;
    gap: 12px;
  }
  .personas .item {
    align-items: flex-start;
  }
  .btn {
    padding: 11px 14px;
  }
  .preview-banner {
    font-size: 10px;
  }
}
@media (max-width: 350px) {
  main {
    margin-left: 18px;
    margin-right: 18px;
  }
  .in {
    padding: 0 18px;
  }
  .mini-chart {
    display: none;
  }
  .home-actions .btn {
    font-size: 13px;
    padding: 11px 12px;
  }
  .brand {
    font-size: 22px;
    gap: 7px;
  }
  .brand .brand-mark {
    width: 29px;
    height: 29px;
  }
  .record .record-time {
    width: 34px;
  }
  .record {
    gap: 10px;
  }
  .metric-row {
    gap: 12px;
  }
  .barra .btn svg {
    width: 18px;
  }
  .filter-form {
    grid-template-columns: 1fr;
  }
  .filter-form .search {
    grid-column: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .chat-vozp .rec {
    transform: none !important;
  }
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin: 20px 0;
  min-width: 0;
}
legend {
  padding: 0 8px;
  font-size: 14px;
  font-weight: 600;
}
.chart-tap svg,
.mini-chart svg {
  animation: chart-enter 380ms ease-out;
}
@keyframes chart-enter {
  from {
    clip-path: inset(0 100% 0 0);
    opacity: 0.4;
  }
  to {
    clip-path: inset(0);
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .chart-tap svg,
  .mini-chart svg {
    animation: none;
  }
}

.chat {
  max-width: none;
}
@media (min-width: 761px) {
  .chat {
    inset: auto auto 96px 50%;
    transform: translateX(-50%);
    width: min(680px, calc(100vw - 48px));
    height: min(650px, calc(100dvh - 130px));
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 22px 85px #17233e24;
  }
  .chat::backdrop { background: #15223a16; }
  .chat[open] { animation: chat-reveal 180ms ease-out; }
  .chat-sug { flex-wrap: wrap; overflow: visible; padding: 10px 20px; }
  .chat-sug button { min-width: 0; white-space: nowrap; min-height: 40px; }
  @keyframes chat-reveal { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
}
@media (prefers-reduced-motion: reduce) { .chat[open] { animation: none; } }
.settings-storage { border-block: 1px solid var(--line); padding: 16px 0; margin: 0 0 28px; }
.settings-storage p { margin: 6px 0; }
.settings-storage details { margin-top: 12px; }
.player > button.estado {
  border: 0;
  background: transparent;
  font: inherit;
  min-height: 44px;
  width: 90%;
}
.player.has-status .scene { visibility: hidden; }
.lb .lb-quality { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); min-height: 44px; max-width: calc(100% - 32px); padding: 10px 16px; border: 1px solid #ffffff40; border-radius: 24px; background: #121922e8; color: #fff; font: inherit; font-size: 13px; }
.lb .lb-quality:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
[id^="aviso-"], [id^="incidente-"] { scroll-margin-top: 96px; }

/* Ajustes del directo: pertenecen al vídeo, también al ampliar el reproductor. */
.camera-heading { justify-content: flex-start; gap: 12px; margin-bottom: 18px; }
.camera-heading .back-link { margin: 0; width: 44px; height: 44px; justify-content: center; flex: none; border-radius: 12px; }
.camera-heading .back-link:hover { background: var(--soft); }
.camera-heading .back-link svg { width: 22px; height: 22px; }
.card.directo { padding-top: 0; }
@media (min-width: 761px) and (min-height: 700px) {
  main:has(.camera-heading) {
    margin-top: 28px;
    width: min(100% - 80px, 900px, max(560px, calc((100dvh - 400px) * 16 / 9)));
  }
}
@media (min-width: 761px) and (max-width: 950px) {
  .top .in { padding-inline: 24px; gap: 12px; }
  .top .brand { font-size: 23px; gap: 7px; }
  .top .brand .brand-mark { width: 30px; height: 30px; }
  .topnav { gap: 0; }
  .topnav a { padding-inline: 8px; gap: 6px; font-size: 12px; }
  .topnav svg { width: 20px; height: 20px; }
  .header-actions { gap: 4px; }
}
.player-head { position: absolute; z-index: 5; top: 10px; right: 10px; bottom: 10px; left: 10px; display: flex; gap: 8px; align-items: flex-start; pointer-events: none; }
.player-tools { display: flex; flex: 1; min-width: 0; height: 100%; gap: 6px; align-items: flex-start; justify-content: flex-end; pointer-events: none; }
.player-quality { position: relative; height: 100%; flex: none; }
.player-tool { flex: none; min-width: 44px; min-height: 44px; border: 1px solid #ffffff26; border-radius: 12px; padding: 10px 12px; display: flex; gap: 7px; align-items: center; justify-content: center; background: #121922da; color: #fff; font: inherit; font-size: 12px; cursor: pointer; pointer-events: auto; }
.player-tool svg { width: 20px; height: 20px; fill: none; }
.player-tool:hover, .player-tool[aria-expanded=true] { background: #263446f5; }
.player-tool:focus-visible, .player-quality-menu button:focus-visible { outline: 2px solid #b6d5ff; outline-offset: -3px; }
.player-quality-menu { position: absolute; right: 0; top: 50px; min-width: 218px; max-height: calc(100% - 50px); overflow-y: auto; overscroll-behavior: contain; pointer-events: auto; padding: 6px; border: 1px solid #ffffff26; border-radius: 14px; color: #fff; background: #17212bf5; box-shadow: 0 12px 32px #0005; animation: player-menu-in 140ms ease-out; }
.player-quality-menu button { display: flex; align-items: center; text-align: left; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; color: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.player-quality-menu button::before { content: ''; width: 8px; height: 8px; border: 1px solid #c5cfdb; border-radius: 50%; margin-right: 12px; }
.player-quality-menu button[aria-checked=true]::before { background: #b6d5ff; border-color: #b6d5ff; }
.player-quality-menu button[aria-checked=true] { background: #ffffff0d; }
.player-quality-menu button:hover { background: #ffffff18; }
.player-quality-menu p { margin: 5px 12px; max-width: 200px; color: #d0d8e2; font-size: 11px; line-height: 1.35; }
.player:fullscreen { width: 100vw; height: 100vh; border-radius: 0; aspect-ratio: auto; }
.player:-webkit-full-screen { width: 100vw; height: 100vh; border-radius: 0; }
.player:fullscreen .player-head { top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); left: max(12px, env(safe-area-inset-left)); }
@keyframes player-menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 480px) {
  .player-head { top: 8px; right: 8px; bottom: 8px; left: 8px; gap: 6px; }
  .player-tool { padding: 10px; }
  #directo-calidad-texto { display: none; }
  .player-quality-menu { min-width: 210px; top: 48px; }
  .player > .video-marca { right:12px; bottom:12px; width:38px; height:38px; }
}
@media (prefers-reduced-motion: reduce) { .player-quality-menu { animation: none; } .player-tools,.player > .video-marca { transition: none; } }

/* Propuestas de memoria en el chat, disponibles en todas las pantallas. */
.memory-proposal{margin:12px 0;padding:16px;border:1px solid var(--line);border-radius:14px}.memory-proposal p{margin:8px 0 12px;white-space:pre-wrap;overflow-wrap:anywhere}.memory-proposal-actions{display:flex;gap:8px;flex-wrap:wrap}.memory-proposal [role=status]:empty{display:none}

/* Las observaciones del directo se retiran al pausar; su detalle conserva el contexto. */
.player:not(.is-playing) .scene { display:none; }

/* El directo controla su propia interfaz: la marca sólo aparece al retirarse los controles. */
.player .player-head,.player-web-controls { opacity:0; visibility:hidden; transition:opacity .18s; }
.player.player-ui-visible .player-head,.player.player-ui-visible .player-web-controls { opacity:1; visibility:visible; }
.player-web-controls { position:absolute; inset:0; z-index:4; pointer-events:none; color:#fff; }
.player-web-controls button,.player-web-controls input { pointer-events:auto; }
.player-web-play { position:absolute; left:50%; top:44%; transform:translate(-50%,-50%); width:58px; height:58px; border:0; border-radius:50%; padding:15px; display:grid; place-items:center; color:#fff; background:#0009; cursor:pointer; }
.player-web-play svg { width:28px; height:28px; stroke:none; }
.player-web-play .pause,.player-web-play[data-playing=true] .play { display:none; }
.player-web-play[data-playing=true] .pause { display:block; }
.player-web-play:focus-visible,.player-web-play:hover { outline:none; color:#111820; background:#f6f8fb; box-shadow:none; }
.player-web-play:disabled { visibility:hidden; }
.player-web-transport { position:absolute; left:0; right:0; bottom:0; padding:32px 14px 10px; background:linear-gradient(transparent,#000c); pointer-events:none; }
.player-web-seek { appearance:none; -webkit-appearance:none; width:100%; height:24px; padding:0; margin:0; border:0; background:transparent; cursor:pointer; }
.player-web-seek::-webkit-slider-runnable-track { height:3px; border-radius:2px; background:#fffc; }
.player-web-seek::-webkit-slider-thumb { -webkit-appearance:none; width:12px; height:12px; margin-top:-4.5px; border:0; border-radius:50%; background:#fff; }
.player-web-seek::-moz-range-track { height:3px; border-radius:2px; background:#fffc; }
.player-web-seek::-moz-range-thumb { width:12px; height:12px; border:0; border-radius:50%; background:#fff; }
.player-web-seek:focus-visible { outline:none; box-shadow:none; }
.player-web-seek:focus-visible::-webkit-slider-thumb { box-shadow:0 0 0 4px #fff5; }
.player-web-seek:focus-visible::-moz-range-thumb { box-shadow:0 0 0 4px #fff5; }
.player-web-seek:disabled { opacity:.35; }
.player-web-actions { display:flex; align-items:center; gap:8px; }
.player-web-actions button { min-height:36px; border:0; border-radius:9px; color:#fff; background:transparent; padding:6px 10px; font:inherit; font-size:12px; cursor:pointer; }
.player-web-actions button:focus-visible,.player-web-actions button:hover { outline:none; color:#111820; background:#f6f8fb; }
.player-web-actions button:disabled { opacity:.4; }
.player-web-live.at-live { color:#ff6b72; font-weight:700; }
.player-web-live.at-live:focus-visible,.player-web-live.at-live:hover { color:#b31d30; }
.player-web-mute svg { width:22px; height:22px; }
.player-web-mute .muted,.player-web-mute[data-muted=true] .sound { display:none; }
.player-web-mute[data-muted=true] .muted { display:block; }
.player.is-expired > video { visibility:hidden; }
.player.has-status > .estado { z-index:6; }
@media(prefers-reduced-motion:reduce) { .player .player-head,.player-web-controls { transition:none; } }

.player-web-actions { gap:6px; }
.player-web-actions > button { min-height:44px; }
.player-web-mute,.player-web-actions .player-expand { flex:none; width:44px; padding:10px; }
.player-web-actions .player-quality { height:auto; margin-left:auto; }
.player-web-actions .player-quality-menu { top:auto; bottom:50px; max-height:240px; min-width:218px; }
.player-web-actions .player-quality-menu button { min-height:44px; }
.player-web-actions .player-quality-menu button::before { width:13px; height:7px; border:0; border-left:2px solid transparent; border-bottom:2px solid transparent; border-radius:0; transform:rotate(-45deg); background:none; }
.player-web-actions .player-quality-menu button[aria-checked=true]::before { border-color:currentColor; background:none; }
.player-web-actions .player-quality-menu button:disabled { opacity:.4; cursor:default; }
.player-web-actions .player-tool { background:#12192299; }
.player-web-actions .player-tool:focus-visible { outline:none; color:#111820; background:#f6f8fb; }
.player-web-live { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
.player-web-controls .player-web-actions .player-quality-menu { pointer-events:auto; }
@media(max-width:480px) {
  .player-web-transport { padding:26px 8px 6px; }
  .player-web-actions { gap:2px; }
  .player-web-actions .player-quality { margin-left:0; }
  .player-web-live { flex:1; padding-inline:4px !important; font-size:11px !important; }
  .player-web-play { width:50px; height:50px; padding:12px; top:38%; }
  .player-web-play svg { width:25px; height:25px; }
}
.player:fullscreen .player-web-transport { padding-bottom:max(12px,env(safe-area-inset-bottom)); padding-left:max(14px,env(safe-area-inset-left)); padding-right:max(14px,env(safe-area-inset-right)); }

/* El área táctil del deslizador no hereda la caja de los campos de formulario. */
.player input.player-web-seek { min-height:44px; height:44px; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; outline:none; }

.player .player-web-play svg,.player .player-web-actions button svg { color:inherit; }
.player.is-ptz .player-web-controls,.player.is-ptz .player-head,.player.is-ptz > .estado { opacity:0; visibility:hidden; pointer-events:none; }
.player.is-ptz > .video-marca { opacity:0; }
.player .ptz-ov { z-index:7; max-height:calc(100% - 24px); overflow:auto; box-sizing:border-box; }
