:root {
  --bg: #0e0e0e;
  --glass: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.09);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --cyan: #22d3ee;
  --teal: #2dd4bf;
  --violet: #a78bfa;
  --pink: #f472b6;
  --orange: #fb923c;
  --lime: #a3e635;

  /* Tema oscuro para dcc.Dropdown (Dash 4) */
  --Dash-Fill-Inverse-Strong: #0f172a;
  --Dash-Fill-Primary-Hover: rgba(34, 211, 238, 0.12);
  --Dash-Fill-Primary-Active: rgba(34, 211, 238, 0.2);
  --Dash-Fill-Interactive-Strong: #22d3ee;
  --Dash-Fill-Interactive-Weak: rgba(34, 211, 238, 0.15);
  --Dash-Fill-Disabled: rgba(255, 255, 255, 0.05);
  --Dash-Text-Primary: #e2e8f0;
  --Dash-Text-Strong: #f8fafc;
  --Dash-Text-Weak: #94a3b8;
  --Dash-Text-Disabled: #64748b;
  --Dash-Stroke-Weak: rgba(255, 255, 255, 0.1);
  --Dash-Stroke-Strong: rgba(255, 255, 255, 0.25);
}

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  background-attachment: fixed;
}

.shell { max-width: 1760px; margin: 0 auto; padding: 28px 24px 60px; }

.top {
  position: sticky; top: 0; z-index: 50; background: rgba(14, 14, 14, 0.7);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border);
}
.top-inner { position: relative; max-width: 1760px; margin: 0 auto; padding: 22px 24px; display: flex; justify-content: flex-end; align-items: center; gap: 16px; }
.top h1 { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 12px; margin: 0; font-size: 1.5rem; letter-spacing: -0.02em; font-weight: 800; cursor: pointer; transition: opacity .15s; }
.brand-logo { display: block; height: 35.75px; width: auto; }
.top h1:hover { opacity: .8; }
.controls { display: flex; gap: 12px; align-items: center; }

.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--glass); border: 1px solid var(--border); }
.seg label { cursor: pointer; margin: 0; }
.seg input { display: none; }
.seg label span, .seg label { padding: 8px 18px; border-radius: 999px; color: var(--muted); transition: all .2s; font-weight: 600; }
.seg label:has(input:checked) { background: linear-gradient(90deg, var(--cyan), var(--violet)); color: #06101f; }

.btn {
  border: 1px solid var(--border); background: var(--glass); color: var(--text);
  padding: 10px 18px; border-radius: 999px; font-weight: 600; cursor: pointer; transition: all .2s;
}
.btn:hover { border-color: rgba(203, 213, 225, 0.55); box-shadow: 0 0 18px rgba(203, 213, 225, 0.22); }
.btn-icon { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; }
.btn-icon::before {
  content: ""; width: 20px; height: 20px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-2.64-6.36'/%3E%3Cpath d='M21 3v6h-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-2.64-6.36'/%3E%3Cpath d='M21 3v6h-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.btn-icon:hover { color: #f1f5f9; }
.btn-icon.btn-gear::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Pestaña Galería junto al botón de recargar. */
.btn-tab { display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 20px; box-sizing: border-box; }
a.btn { text-decoration: none; }
.tab-icon {
  width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
  --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E");
}
.btn-tab.active { background: linear-gradient(90deg, var(--cyan), var(--violet)); border-color: transparent; color: #06101f; }
.btn-tab.active:hover { box-shadow: 0 0 18px rgba(203, 213, 225, 0.3); }

.kpis { position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 22px; }
/* Luz de color detrás de las tarjetas: el cristal tiene algo que desenfocar y se nota el efecto. */
.kpis::before {
  content: ""; position: absolute; inset: -34px -4px; z-index: -1; pointer-events: none; filter: blur(34px);
  background:
    radial-gradient(18% 70% at 10% 40%, rgba(34, 211, 238, 0.55), transparent 70%),
    radial-gradient(18% 70% at 32% 70%, rgba(167, 139, 250, 0.45), transparent 70%),
    radial-gradient(16% 70% at 50% 35%, rgba(163, 230, 53, 0.4), transparent 70%),
    radial-gradient(18% 70% at 72% 65%, rgba(244, 114, 182, 0.5), transparent 70%),
    radial-gradient(16% 70% at 93% 35%, rgba(251, 146, 60, 0.45), transparent 70%);
}
/* Tarjeta de cristal: desenfoque y saturación del fondo, brillo en el borde y reflejo diagonal. */
.kpi, .login-card {
  position: relative; overflow: hidden; isolation: isolate; padding: 18px 22px; border-radius: 24px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.045) 38%, rgba(255, 255, 255, 0.02) 100%),
    radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(30px) saturate(190%) brightness(1.1); backdrop-filter: blur(30px) saturate(190%) brightness(1.1);
  box-shadow:
    inset 0 1.5px 2px -1px rgba(255, 255, 255, 0.55),   /* canto superior */
    inset 0 -1.5px 2px -1px rgba(255, 255, 255, 0.2),   /* canto inferior */
    inset 1.5px 0 2px -1px rgba(255, 255, 255, 0.22), inset -1.5px 0 2px -1px rgba(255, 255, 255, 0.1),
    inset 0 0 26px rgba(255, 255, 255, 0.045),           /* grosor del cristal */
    0 22px 44px -20px rgba(0, 0, 0, 0.65), 0 2px 8px rgba(0, 0, 0, 0.25);
}
.kpi > *, .login-card > * { position: relative; z-index: 1; }
.kpi::before, .login-card::before {  /* destello de la luz sobre el canto, en la esquina superior izquierda */
  content: ""; position: absolute; top: 0; left: 18px; width: 34%; height: 1px; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85) 30%, transparent);
}
.kpi::after, .login-card::after {  /* aro de luz de 1 px que se degrada suavemente alrededor de la tarjeta */
  content: ""; position: absolute; inset: -1px; z-index: 2; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.13) 22%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0.13) 78%, rgba(255, 255, 255, 0.38) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.kpi-cyan { --accent: var(--cyan); } .kpi-teal { --accent: var(--teal); } .kpi-violet { --accent: var(--violet); }
.kpi-pink { --accent: var(--pink); } .kpi-orange { --accent: var(--orange); } .kpi-lime { --accent: var(--lime); }
.kpi-title { color: rgba(226, 232, 240, 0.62); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .13em; }
.kpi-value {
  font-size: clamp(1.55rem, 1.1vw + 1rem, 2.05rem); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 45%, #fff) 0%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--accent) 38%, transparent));
}
.kpi-unit { margin-left: 6px; color: rgba(226, 232, 240, 0.55); font-size: .9rem; font-weight: 500; }
.kpi-unit + .kpi-value { margin-left: 10px; }
.dive-main .kpi { padding: 16px 18px; }
.dive-main .kpi-value { font-size: clamp(1.3rem, .7vw + .9rem, 1.7rem); }
.dive-main .kpi-value.long { font-size: clamp(1.02rem, .45vw + .75rem, 1.45rem); white-space: nowrap; }

/* ---- Detalle: KPIs en 3 columnas (aire, inmersión, seguridad) ---- */
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }
.kpi-cols { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(330px, 400px) minmax(0, 1fr); gap: 18px; margin-bottom: 22px; }
.kpi-cols::before {
  content: ""; position: absolute; inset: -20px -4px; z-index: -1; pointer-events: none; filter: blur(40px);
  background:
    radial-gradient(22% 38% at 12% 25%, rgba(34, 211, 238, 0.5), transparent 70%),
    radial-gradient(22% 38% at 50% 40%, rgba(244, 114, 182, 0.4), transparent 70%),
    radial-gradient(22% 38% at 85% 20%, rgba(251, 146, 60, 0.4), transparent 70%);
}
.kpi-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.kpi-col > .section { margin: 0 4px; }
.kpi-col > .kpi, .kpi-col > .note { flex: 1; }
.kpi-col .kpi { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "t v" "h v"; align-items: center; column-gap: 14px; }
.kpi-col .kpi-title { grid-area: t; align-self: end; }
.kpi-col .kpi-valuebox { grid-area: v; text-align: right; white-space: nowrap; }
.kpi-col .kpi-hint { grid-area: h; align-self: start; margin-top: 3px; }
.kpi-col .kpi-valuebox .kpi-value { font-size: clamp(1.45rem, .9vw + 1rem, 1.9rem); }

/* ---- Detalle: KPIs relacionados en una misma tarjeta de color (azul profundidad, violeta tiempo, verde seguridad, naranja alertas) ---- */
.kpi-board { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.kpi-bands { flex: 1; display: grid; grid-template-columns: 3fr 2fr; grid-auto-rows: 1fr; gap: 14px; }
.band {
  --c1: #2563eb; --c2: #6366f1;
  position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
  min-width: 0; padding: 16px 22px 18px; border-radius: 22px; color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: inset 0 1.5px 2px -1px rgba(255, 255, 255, 0.6), inset 0 -3px 8px -3px rgba(0, 0, 0, 0.25),
              0 22px 40px -22px color-mix(in srgb, var(--c2) 85%, #000);
}
.band::before {  /* brillo de cristal sobre el color */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(90% 130% at 0% 0%, rgba(255, 255, 255, 0.3), transparent 60%), linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 45%);
}
.band::after {  /* icono grande y tenue de marca de agua, recortado por la esquina */
  content: ""; position: absolute; right: -12px; bottom: -26px; z-index: -1; width: 136px; height: 136px; background: #fff; opacity: .14;
  transform: rotate(-12deg); pointer-events: none; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
}
.band-blue { --c1: #2563eb; --c2: #6366f1; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='7 13 12 18 17 13'/%3E%3Cpolyline points='7 6 12 11 17 6'/%3E%3C/svg%3E"); }
.band-violet { --c1: #7c3aed; --c2: #db2777; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E"); }
.band-green { --c1: #059669; --c2: #0f766e; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E"); }
.band-orange { --c1: #f97316; --c2: #e11d48; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E"); }
.band-head { display: flex; align-items: center; gap: 8px; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.band-icon { flex: none; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.band-metrics { display: grid; grid-template-columns: var(--cols, repeat(var(--n), minmax(0, 1fr))); }
.metric { min-width: 0; padding: 0 18px; border-left: 1px solid rgba(255, 255, 255, 0.28); }
.metric:first-child { padding-left: 0; border-left: 0; }
.metric:last-child { padding-right: 0; }
.m-num { font-size: clamp(1.8rem, 1.1vw + 1.1rem, 2.4rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.2); }
.m-unit { margin-left: 4px; font-size: .95rem; font-weight: 600; opacity: .85; }
.m-unit + .m-num { margin-left: 8px; }
.metric-label { margin-top: 6px; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .92; }
.metric-note { margin-top: 3px; font-size: .74rem; opacity: .75; }
/* Detalle: valor, etiqueta y nota (2 líneas cada una) ocupan siempre las mismas filas en todas las métricas y tarjetas. */
.kpi-bands .band-metrics { grid-template-rows: auto calc(2.6 * .68rem + 6px) calc(2.6 * .74rem + 3px); }
.kpi-bands .metric { display: grid; grid-row: span 3; grid-template-rows: subgrid; }
.kpi-bands .metric-label, .kpi-bands .metric-note { line-height: 1.3; }
/* Sin notas no se reserva su fila y los KPIs quedan centrados en el hueco bajo el título. */
.kpi-bands .band-compact .band-metrics { grid-template-rows: auto auto; margin: auto 0; }
.kpi-bands .band-compact .metric { grid-row: span 2; }
.band-yellow { --c1: #eab308; --c2: #a16207; }
.band-apple { --c1: #6bb82f; --c2: #3b7a1d; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.59 4.59A2 2 0 1 1 11 8H2m10.59 11.41A2 2 0 1 0 14 16H2m15.73-8.27A2.5 2.5 0 1 1 19.5 12H2'/%3E%3C/svg%3E"); }
.band-cyan { --c1: #0891b2; --c2: #155e75; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.59 4.59A2 2 0 1 1 11 8H2m10.59 11.41A2 2 0 1 0 14 16H2m15.73-8.27A2.5 2.5 0 1 1 19.5 12H2'/%3E%3C/svg%3E"); }
/* Tarjeta del aire con el mismo fondo y tipografía que las tarjetas de color; la botella y los indicadores no cambian. */
.kpi-col > .air-card { flex: 1; }
.air-card .kpi-title { color: #fff; opacity: .92; font-weight: 700; letter-spacing: .12em; }
.air-card .kpi-value { background: none; color: #fff; filter: none; font-weight: 800; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.2); }
.air-card .kpi-unit { color: #fff; opacity: .85; font-weight: 600; }
.air-card .kpi-hint, .air-card .g-unit { color: #fff; opacity: .75; }
.air-card .ring { background: conic-gradient(from -90deg, var(--c1), var(--c2) calc(var(--p) * 1%), rgba(255, 255, 255, 0.22) 0); }
.air-card .air-dot { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4), 0 0 12px currentColor; }
.air-card .air-gauges { border-top-color: rgba(255, 255, 255, 0.28); }
/* Fondo de mármol negro brillante: base casi negra, reflejo en la esquina superior y vetas muy tenues en diagonal. */
.band.air-card {
  background:
    linear-gradient(112deg, transparent 36%, rgba(255, 255, 255, 0.055) 41%, transparent 46%, transparent 63%, rgba(255, 255, 255, 0.04) 67%, transparent 72%),
    linear-gradient(152deg, transparent 18%, rgba(255, 255, 255, 0.035) 24%, transparent 29%, transparent 80%, rgba(255, 255, 255, 0.03) 85%, transparent 90%),
    linear-gradient(135deg, #1d1d22 0%, #0b0b0e 42%, #040405 68%, #17171c 100%);
  box-shadow: inset 0 1.5px 2px -1px rgba(255, 255, 255, 0.6), inset 0 -3px 8px -3px rgba(0, 0, 0, 0.5), 0 22px 40px -22px rgba(0, 0, 0, 0.85);
}
.band.air-card::before {
  background: radial-gradient(90% 60% at 8% 0%, rgba(255, 255, 255, 0.2), transparent 62%), linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 40%);
}
@media (max-width: 1000px) { .kpi-bands { grid-template-columns: 1fr; } }
.ic-activity { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22 12 18 12 15 21 9 3 6 12 2 12'/%3E%3C/svg%3E"); }
.ic-depth { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='7 13 12 18 17 13'/%3E%3Cpolyline points='7 6 12 11 17 6'/%3E%3C/svg%3E"); }
.ic-thermo { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 14.76V3.5a2.5 2.5 0 0 0-5 0v11.26a4.5 4.5 0 1 0 5 0z'/%3E%3C/svg%3E"); }

/* Botella: el nivel de agua es la presión final; la zona rayada es el gas consumido. */
.kpi-col .air-card { display: flex; flex-direction: column; justify-content: space-between; gap: 22px; padding: 22px 24px; }
.air-top { display: flex; align-items: stretch; justify-content: center; gap: 28px; }
.tank { position: relative; flex: none; width: 88px; height: 210px; --water: #67e8f9; }
.tank.low { --water: #fdba74; }
.tank-valve {
  position: absolute; top: 0; left: 50%; width: 38px; height: 8px; transform: translateX(-50%); border-radius: 4px;
  background: linear-gradient(180deg, #e2e8f0, #64748b); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.tank-neck {
  position: absolute; top: 7px; left: 50%; width: 22px; height: 22px; transform: translateX(-50%); border-radius: 6px 6px 0 0;
  background: linear-gradient(90deg, #94a3b8, #e2e8f0 45%, #64748b); border: 1px solid rgba(255, 255, 255, 0.4); border-bottom: 0;
}
.tank-body {
  position: absolute; inset: 26px 0 0 0; overflow: hidden; border-radius: 44px 44px 22px 22px / 34px 34px 22px 22px;
  background: rgba(255, 255, 255, 0.05); border: 1.5px solid rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 0 22px rgba(255, 255, 255, 0.08), 0 10px 24px -10px rgba(0, 0, 0, 0.6);
}
.tank-used {
  position: absolute; left: 0; right: 0; top: 0; height: calc(var(--used) * 1%);
  background: repeating-linear-gradient(135deg, rgba(250, 204, 21, 0.32) 0 5px, rgba(250, 204, 21, 0.1) 5px 10px);
}
.tank-fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--remain) * 1%); animation: tank-rise 1.2s cubic-bezier(.2, .8, .2, 1);
  background: linear-gradient(180deg, var(--water) 0%, color-mix(in srgb, var(--water) 55%, #0891b2) 55%, color-mix(in srgb, var(--water) 25%, #0e7490) 100%);
}
.tank-fill::before {  /* ola en la superficie */
  content: ""; position: absolute; left: 0; right: 0; top: -5px; height: 10px; animation: tank-wave 2.4s linear infinite;
  background: radial-gradient(ellipse 12px 6px at 50% 100%, var(--water) 98%, transparent 100%) 0 0 / 24px 10px repeat-x;
}
.bubble { position: absolute; bottom: 4%; width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, 0.6); opacity: 0; animation: tank-bubble 3.6s ease-in infinite; }
.bubble.b1 { left: 22%; } .bubble.b2 { left: 52%; width: 4px; height: 4px; animation-delay: 1.2s; } .bubble.b3 { left: 76%; animation-delay: 2.3s; }
.tank-shine { position: absolute; left: 11px; top: 14px; bottom: 14px; width: 7px; border-radius: 6px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.04)); }
@keyframes tank-rise { from { height: 0; } }
@keyframes tank-wave { to { background-position-x: 24px; } }
@keyframes tank-bubble { 0% { bottom: 4%; opacity: 0; } 15% { opacity: .85; } 100% { bottom: 92%; opacity: 0; } }
.air-stats { flex: none; display: flex; flex-direction: column; justify-content: space-between; padding: 30px 0 6px; }
.air-stat { display: flex; align-items: center; gap: 14px; }
.air-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 12px currentColor; }
.air-stat .kpi-value { font-size: clamp(1.45rem, .9vw + 1rem, 1.9rem); }

/* Indicadores circulares de RMV y SAC. */
.air-gauges { display: flex; justify-content: space-around; gap: 14px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.09); }
.gauge-wrap { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.gauge-wrap .kpi-hint { margin-top: 0; }
.air-card .kpi-hint:has(.vs-avg) { opacity: 1; }
.vs-avg { display: inline-block; padding: 1px 9px; border-radius: 99px; background: rgba(0, 0, 0, 0.28); font-size: .72rem; font-weight: 600; color: #fff; }
.vs-avg.down { color: #86efac; }
.vs-avg.up { color: #fca5a5; }
.gauge-wrap .kpi-title, .gauge-wrap .kpi-hint { align-self: center; }
.gauge { position: relative; width: 116px; height: 116px; display: grid; place-items: center; margin-bottom: 6px; }
.ring {
  position: absolute; inset: 0; border-radius: 50%; animation: gauge-in 1.3s cubic-bezier(.2, .8, .2, 1);
  background: conic-gradient(from -90deg, var(--c1), var(--c2) calc(var(--p) * 1%), rgba(255, 255, 255, 0.09) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 11px), #000 calc(100% - 10px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 11px), #000 calc(100% - 10px));
}
@keyframes gauge-in { from { --p: 0; } }
.g-text { position: relative; line-height: 1.05; }
.g-value { display: block; font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: #f8fafc; }
.g-unit { display: block; margin-top: 2px; font-size: .72rem; color: rgba(226, 232, 240, 0.55); }
@media (max-width: 1250px) { .kpi-cols { grid-template-columns: 1fr; } }

.card { padding: 12px 14px; margin-bottom: 20px; border-radius: 20px; background: none; border: none; }
.card h3 { margin: 6px 8px 12px; }
.grid-3 > .card { padding: 14px 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-route { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 1100px) { .grid-route { grid-template-columns: 1fr; } }

/* Atribución del mapa oculta (uso personal). */
.maplibregl-ctrl-attrib { display: none !important; }

/* Mapas sin caja. */
.card.map-bare { background: none; border: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 0; }
.card.map-bare.expanded { padding: 18px 22px; background: var(--bg); border: 1px solid var(--border); }
@media (max-width: 1200px) { .grid-3 { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); } }

.info { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 28px; padding: 0 8px 8px; }
.info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.info-row span { color: var(--muted); }

@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

.controls { flex-wrap: wrap; }
.rot-menu {
  display: none; position: absolute; top: 50px; right: 10px; z-index: 6; width: 360px; padding: 14px 18px 10px;
  border-radius: 14px; border: 1px solid var(--border); background: #0e1530; color: var(--muted); font-size: .85rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.rot-menu.open { display: block; }
.rot-actions { display: flex; gap: 10px; align-items: center; padding: 8px 0 4px; }
.btn-sm { padding: 6px 14px; font-size: .8rem; }

.th-flex { display: flex; align-items: center; gap: 6px; }
.tbl-main th { z-index: 40; }  /* el th sticky crea contexto de apilado: sin esto las gráficas tapan el menú del filtro */
.tbl-main th .th-filter {
  position: relative; display: block; width: 26px; height: 26px; min-width: 0; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer; transition: all .15s;
}
.tbl-main th .th-filter:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); box-shadow: 0 0 14px rgba(203, 213, 225, 0.18); }
.tbl-main th .th-filter .dash-dropdown-trigger { position: absolute; inset: 0; overflow: hidden; opacity: 0; }
.tbl-main th .th-filter::before {
  content: ""; position: absolute; inset: 5px; background: currentColor; pointer-events: none;
  -webkit-mask: var(--funnel) center / contain no-repeat; mask: var(--funnel) center / contain no-repeat;
  --funnel: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3'/%3E%3C/svg%3E");
}
.tbl-main th .th-filter:has(.dash-dropdown-value:not(.dash-dropdown-placeholder)) { color: var(--cyan); }
.dash-dropdown-content { min-width: 260px; max-height: none !important; overflow: visible !important; }
.dash-dropdown-content * { max-height: none !important; overflow: visible !important; }
.best { color: var(--lime); font-weight: 700; }

.row-menu { width: 1%; text-align: right; }
.row-menu-btn {
  position: relative; display: block; margin: -4px 0 -4px auto; width: 28px; height: 28px; padding: 0; border: 0;
  border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; transition: all .15s;
}
.row-menu-btn:hover { background: rgba(255, 255, 255, 0.1); color: #f1f5f9; box-shadow: 0 0 14px rgba(203, 213, 225, 0.25); }
.row-menu-btn::before {
  content: ""; position: absolute; inset: 5px; background: currentColor; pointer-events: none;
  -webkit-mask: var(--sliders) center / contain no-repeat; mask: var(--sliders) center / contain no-repeat;
  --sliders: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='21' x2='4' y2='14'/%3E%3Cline x1='4' y1='10' x2='4' y2='3'/%3E%3Cline x1='12' y1='21' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12' y2='3'/%3E%3Cline x1='20' y1='21' x2='20' y2='16'/%3E%3Cline x1='20' y1='12' x2='20' y2='3'/%3E%3Cline x1='1' y1='14' x2='7' y2='14'/%3E%3Cline x1='9' y1='8' x2='15' y2='8'/%3E%3Cline x1='17' y1='16' x2='23' y2='16'/%3E%3C/svg%3E");
}
.center-line { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; vertical-align: middle; line-height: 1; font-size: .74rem; color: var(--muted); }
.center-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tag:hover { filter: brightness(1.2); }
.center-line { cursor: pointer; transition: color .15s; }
.center-line:hover { color: var(--text); }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; }
.chip.hidden { display: none; }
.chip-x { margin-left: 2px; color: var(--muted); font-size: .75rem; }
.chip:hover .chip-x { color: var(--text); }
.meta-hint { margin-top: 6px; color: var(--muted); font-size: .78rem; }
.table-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; padding: 0 8px; }
.bulk-bar { display: none; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
.bulk-bar.open { display: flex; }
/* Gráficos mientras llegan los datos: se atenuan y aparece un anillo de carga en el centro. */
[id^="g-"][data-dash-is-loading="true"] { position: relative; }
[id^="g-"][data-dash-is-loading="true"] .js-plotly-plot { opacity: .35; transition: opacity .2s; }
[id^="g-"][data-dash-is-loading="true"]::after {
  content: ""; position: absolute; top: 50%; left: 50%; z-index: 5; width: 36px; height: 36px; margin: -18px 0 0 -18px;
  box-sizing: border-box; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.12); border-top-color: var(--cyan);
  animation: gr-spin .8s linear infinite; pointer-events: none;
}
@keyframes gr-spin { to { transform: rotate(360deg); } }
/* KPIs, detalles y eventos del detalle al cambiar de inmersión: se desenfocan y atenúan con un anillo de carga hasta que llegan los nuevos. */
:is(#kpi-air, #kpi-bands, #dive-info, #dive-events)[data-dash-is-loading="true"] { position: relative; }
:is(#kpi-air, #kpi-bands, #dive-info, #dive-events)[data-dash-is-loading="true"] > * {
  opacity: .28; filter: blur(3px) saturate(.5); pointer-events: none; transition: opacity .2s, filter .25s;
}
:is(#kpi-air, #kpi-bands, #dive-info, #dive-events)[data-dash-is-loading="true"]::after {
  content: ""; position: absolute; top: 50%; left: 50%; z-index: 5; width: 36px; height: 36px; margin: -18px 0 0 -18px;
  box-sizing: border-box; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.15); border-top-color: #fff;
  animation: gr-spin .8s linear infinite; pointer-events: none;
}
/* Paginación de la tabla del resumen. */
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; padding-top: 14px; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.pager.hidden { display: none; }
.btn:disabled { opacity: .35; cursor: default; box-shadow: none; border-color: var(--border); }
/* Filtros de periodo de la tabla del resumen, a la derecha del título. */
.head-tools { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }
.seg-sm { box-sizing: border-box; height: 34px; align-items: center; padding: 0 3px; }
.seg-sm label, .seg-sm label span { padding: 5px 14px; font-size: .8rem; }
.seg-sm label span { padding: 0; color: inherit; }
.seg-sm .dash-options-list-option-text { color: inherit; }
.seg-sm label[aria-selected="true"], .seg-sm label[aria-selected="true"]:hover { color: #06101f !important; }
.seg-sm label:hover:not([aria-selected="true"]) { color: var(--text); background: rgba(255, 255, 255, 0.06); box-shadow: 0 0 14px rgba(203, 213, 225, 0.2); }
#filters-clear { height: 34px; padding: 0 16px; }
.row-select { width: 1%; user-select: none; }
.row-check {
  position: relative; display: block; width: 16px; height: 16px; box-sizing: border-box; border: 1.5px solid #64748b;
  border-radius: 4px; cursor: pointer; transition: all .12s;
}
.row-check:hover { border-color: #cbd5e1; box-shadow: 0 0 10px rgba(203, 213, 225, 0.3); }
.row-check.checked { background: var(--cyan); border-color: var(--cyan); }
.row-check.checked::after {
  content: ""; position: absolute; left: 4px; top: 0; width: 4px; height: 8px; border: solid #06101f;
  border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.row-check.partial { border-color: var(--cyan); }
.row-check.partial::after { content: ""; position: absolute; left: 3px; top: 6px; width: 7px; height: 2px; background: var(--cyan); }
.tbl-main tbody tr.row-link.selected { background: rgba(34, 211, 238, 0.08); }
.modal:not(.bulk) .only-bulk { display: none; }

/* Centro de buceo y etiquetas del detalle: píldoras planas con el color del centro (--accent). */
.dive-meta-row { display: none; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 32px; }
.dive-meta-row.open { display: flex; }
.glass-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: 999px;
  font-size: .85rem; font-weight: 700; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  background: color-mix(in srgb, var(--accent) 58%, #000);
}
.glass-pill.center { padding: 7px 18px; font-size: .92rem; }
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, 0.6); }
.pill-k { font-size: .64rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: rgba(255, 255, 255, 0.75); }

/* Final de la tabla: hay inmersiones anteriores a este reloj. */
.tbl-main tr.more-row td { padding: 14px 0 10px; border-bottom: 0; text-align: center; cursor: default; }
.more-dot { display: inline-block; width: 10px; height: 10px; margin: 0 7px; border-radius: 50%; background: rgba(226, 232, 240, 0.55); box-shadow: 0 0 12px rgba(226, 232, 240, 0.25); }
.modal { display: none; position: fixed; inset: 0; z-index: 1100; align-items: center; justify-content: center; }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4, 8, 20, 0.55); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.modal-box {
  position: relative; width: min(520px, 92vw); padding: 20px 24px; border-radius: 18px; border: 1px solid var(--border);
  background: #0b1124; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.modal-box h3 { margin: 0 0 16px; }
.modal-box .rot-actions { justify-content: flex-end; padding-top: 18px; }
/* Ajustes: desplegable bajo el engranaje, arriba a la derecha; el fondo solo recoge el clic que lo cierra. */
#settings-modal { align-items: flex-start; justify-content: flex-end; }
#settings-modal .modal-backdrop { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
#settings-modal .modal-box {
  width: min(380px, calc(100vw - 24px)); margin: 76px max(12px, calc((100vw - 1760px) / 2 + 24px)) 0 0; padding: 16px 20px 14px;
  border-radius: 16px; animation: lb-pop .15s ease-out; transform-origin: top right;
}
#settings-modal .modal-box h3 { margin-bottom: 12px; font-size: 1rem; }
.best-yellow { color: #facc15; }
.tags { display: flex; align-items: center; height: 20px; }
.tag {
  --tc: var(--cyan); display: block; margin-right: 6px; padding: 0 11px; line-height: 20px; border-radius: 999px; font-size: .74rem;
  font-weight: 700; letter-spacing: .02em; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); cursor: pointer; transition: filter .15s;
  background: color-mix(in srgb, var(--tc) 58%, #000);
  box-shadow: none;
}
.meta-form { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 16px; align-items: center; padding: 0 8px 6px; }
.meta-form label { color: var(--muted); font-size: .9rem; }
.meta-form .rot-actions { grid-column: 2; padding: 2px 0 0; }
.meta-form .seg { justify-self: start; }
.field {
  width: 100%; box-sizing: border-box; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05); color: var(--text); font: inherit; transition: border-color .15s;
}
.field:focus-within { border-color: var(--cyan); }
.field .dash-input-element {
  display: block; width: 100%; height: auto; padding: 0; border: 0; border-radius: 0; background: transparent;
  color: inherit; font: inherit; outline: none; box-shadow: none;
}
.field .dash-input-element::placeholder { color: #64748b; }

.card { position: relative; }

.scroll-x { overflow-x: auto; padding: 0 0 8px; }
.card:has(> .scroll-x) { padding-left: 0; padding-right: 0; }  /* la tabla llega hasta los bordes del resto de tarjetas */
.muted { color: var(--muted); font-weight: 400; }
.tbl-main td { padding: 12px 10px; }
.tbl-main tbody tr.row-link { cursor: pointer; transition: background .15s; }
.tbl-main tbody tr.row-link:hover { background: rgba(34, 211, 238, 0.09); }
.tbl-main tbody tr.month-break td { border-bottom-color: rgba(130, 105, 145, 0.5); }  /* cambio de mes */

.dive-layout { grid-template-columns: 310px minmax(0, 1fr); gap: 28px; align-items: start; }
.dive-main { min-width: 0; }
.sidebar { position: sticky; top: 110px; max-height: calc(100vh - 130px); overflow-y: auto; }
.side-nav { display: flex; flex-direction: column; gap: 0; }
.side-nav input { display: none; }
.side-nav label {
  display: block; margin: 0; padding: 0; color: var(--muted); font-size: .82rem; line-height: 1.4;
  white-space: pre-line; cursor: pointer;
}
.side-nav label:has(.year-head), .side-nav label:has(.year-head) * { opacity: 1; cursor: pointer !important; }
.year-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 6px 4px; color: var(--text); font-weight: 800;
  font-size: .95rem; letter-spacing: .06em; user-select: none;
}
.year-head:hover { color: var(--cyan); }
.year-head .chev { display: inline-block; width: 12px; color: var(--muted); font-size: .8rem; transition: transform .15s; }
.year-head.collapsed .chev { transform: rotate(-90deg); }
.year-count { margin-left: auto; font-weight: 500; font-size: .72rem; color: var(--muted); }
.dive-opt { display: grid; grid-template-columns: 40px minmax(0, 1fr); }
.dive-opt.month-start { margin-top: 8px; }
.m-tag {
  padding: 7px 8px 0 0; text-align: right; font-size: .66rem; font-weight: 700; letter-spacing: .1em;
  color: var(--violet); border-right: 1px solid var(--border);
}
.opt-text { padding: 5px 14px; white-space: nowrap; border-left: 2px solid transparent; border-radius: 0 10px 10px 0; transition: all .15s; }
/* Columnas fijas: cada dato queda en vertical con el mismo dato de las demás inmersiones. */
.opt-cols { display: grid; grid-template-columns: 20px 34px 40px 52px 56px; column-gap: 10px; font-variant-numeric: tabular-nums; }
.opt-cols .c-day, .opt-cols .c-depth, .opt-cols .c-dur { text-align: right; }
/* Fecha de la tabla del resumen: mismas columnas fijas en todas las filas. */
.dcell { display: inline-grid; grid-template-columns: 2ch auto 4ch auto 4ch auto auto; column-gap: .12em; font-variant-numeric: tabular-nums; }
.dcell .dc-day { text-align: right; }
.dcell .dc-mon { text-align: center; }
.dcell .dc-sep { margin: 0 .3em; }
.tbl-main td.num-cell { color: #b0bacb; }
.side-nav label:hover .opt-text { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.side-nav label:has(input:checked) .opt-text {
  color: #f8fafc; border-left-color: #7fd13b; background: linear-gradient(90deg, rgba(127, 209, 59, 0.16), transparent);
}
@media (max-width: 900px) {
  .dive-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; }
  .side-nav { flex-direction: row; overflow-x: auto; }
  .side-nav label { white-space: nowrap; }
}
.expand-btn, .gear-btn, .mode-btn {
  position: absolute; top: 10px; right: 10px; z-index: 5; width: 30px; height: 30px; padding: 0;
  border-radius: 10px; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.06);
  color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; opacity: .55; transition: all .2s;
}
.card:hover .expand-btn, .card:hover .gear-btn, .card:hover .mode-btn,
.expand-btn:focus-visible, .gear-btn:focus-visible, .mode-btn:focus-visible { opacity: 1; color: var(--text); }
.expand-btn:hover, .gear-btn:hover, .mode-btn:hover {
  opacity: 1; color: #f8fafc; border-color: rgba(203, 213, 225, 0.6); box-shadow: 0 0 16px rgba(203, 213, 225, 0.3);
}
.gear-btn, .mode-btn { right: 48px; }
.mode-btn.mode-2 { right: 86px; }
.lightbox-backdrop {
  position: fixed; inset: 0; z-index: 999; background: rgba(4, 8, 20, 0.55);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); animation: lb-fade .2s ease-out;
}
.card.expanded {
  position: fixed; inset: 0 4vw; height: min(92vh, 1440px); z-index: 1000; margin: auto; padding: 18px 22px; overflow: hidden;
  background: var(--bg); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); animation: lb-pop .2s ease-out;
}
body.lightbox-open { overflow: hidden; }
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lb-pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }

/* Filas de KPIs en una sola línea cuando hay sitio (6 en el detalle, 8 en el resumen). */
.dive-main .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
#kpis { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.kpis .note { grid-column: 1 / -1; }

.kpi-group { grid-column: span 2; display: flex; flex-wrap: wrap; gap: 12px 0; }
.kpi-part { flex: 1 1 130px; min-width: 0; padding-right: 14px; }
.kpi-part + .kpi-part {
  padding-left: 22px; padding-right: 0; border-left: 1px solid;
  border-image: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.2), transparent) 1;
}

.delta { margin-left: 6px; font-size: .85rem; color: var(--muted); }
.delta.up { color: #f87171; }
.delta.down { color: var(--lime); }
@media (max-width: 1500px) { #kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
@media (max-width: 1200px) { .dive-main .kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.section {
  margin: 28px 4px 12px; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
  display: flex; align-items: center; gap: 12px;
}
.section::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }
.kpi-hint { margin-top: 4px; color: rgba(226, 232, 240, 0.5); font-size: .76rem; }
.note { padding: 14px 18px; border-radius: 14px; background: var(--glass); border: 1px dashed var(--border); color: var(--muted); }

/* Marcas de fotos y vídeos junto a la fecha en la tabla. */
.media-marks { display: inline-flex; align-items: center; gap: 10px; margin-left: 14px; vertical-align: middle; }
.media-mark { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 600; color: var(--cyan); font-variant-numeric: tabular-nums; }
.media-mark.video { color: var(--violet); }
.media-mark::before { content: ""; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.media-mark.photo { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/svg%3E"); }
.media-mark.video { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='23 7 16 12 23 17 23 7'/%3E%3Crect x='1' y='5' width='15' height='14' rx='2' ry='2'/%3E%3C/svg%3E"); }

/* Álbum de la inmersión: miniaturas redondeadas sin caja, centradas, con un botón redondo de añadir a la derecha. */
.album-card {
  position: relative; box-sizing: border-box; height: 150px; padding: 0 16px; display: flex; flex-direction: column; justify-content: center;
  border-radius: 22px; transition: box-shadow .15s, background .15s;
}  /* altura fija: las tarjetas de KPIs no cambian de tamaño con o sin fotos */
.album-card.drop { background: rgba(34, 211, 238, 0.06); box-shadow: 0 0 0 1.5px rgba(34, 211, 238, 0.55); }
.album-add-tile {
  flex: none; width: 34px; height: 34px; padding: 0 0 2px; border-radius: 50%; border: 1.5px dashed rgba(255, 255, 255, 0.25); background: transparent;
  color: var(--muted); font-size: 1.25rem; line-height: 1; cursor: pointer; transition: all .15s;
}
.album-add-tile:hover { color: #f1f5f9; border-color: rgba(203, 213, 225, 0.6); background: rgba(255, 255, 255, 0.05); box-shadow: 0 0 14px rgba(203, 213, 225, 0.25); }
.album-status { position: absolute; left: 0; right: 0; bottom: 5px; font-size: .8rem; color: var(--lime); text-align: center; pointer-events: none; }
.album-status.error { color: #f87171; }
.album-grid { padding: 20px 8px; display: flex; flex-wrap: nowrap; align-items: center; justify-content: safe center; gap: 18px; overflow-x: auto; scrollbar-width: none; }
.album-item {
  position: relative; flex: none; width: 76px; isolation: isolate; border-radius: 10px; cursor: pointer;
  box-shadow: 0 8px 16px -6px rgba(0, 0, 0, 0.7); transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
}
.album-item:hover { z-index: 1; transform: translateY(-4px) scale(1.08); box-shadow: 0 16px 26px -8px rgba(0, 0, 0, 0.8); }
.album-item img, .album-item video { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 10px; pointer-events: none; }
.album-grid .album-play { border-radius: 10px; background: linear-gradient(transparent 55%, rgba(0, 0, 0, 0.3)); }
.album-play {
  position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: .9rem; pointer-events: none;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); background: linear-gradient(transparent 55%, rgba(0, 0, 0, 0.35));
}

/* Zonas del mapa del resumen: menú flotante a la izquierda (assets/map_zones.js). */
.map-zones {
  position: absolute; left: 14px; top: 14px; z-index: 6; box-sizing: border-box; width: 190px; max-height: calc(100% - 28px); overflow-y: auto;
  padding: 10px 8px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(14, 14, 14, 0.62);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  box-shadow: inset 0 1px 1px -0.5px rgba(255, 255, 255, 0.3), 0 18px 40px -16px rgba(0, 0, 0, 0.7); scrollbar-width: thin;
}
.map-zones:empty { display: none; }
.mz-title { padding: 2px 10px 8px; font-size: .66rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.mz-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 7px 10px; border: 1px solid transparent; border-radius: 12px;
  background: transparent; color: var(--text); font: inherit; font-size: .84rem; text-align: left; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s;
}
.mz-item:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(203, 213, 225, 0.3); box-shadow: 0 0 14px rgba(203, 213, 225, 0.12); }
.mz-item.active { background: linear-gradient(90deg, rgba(127, 209, 59, 0.22), rgba(127, 209, 59, 0.04)); border-color: rgba(127, 209, 59, 0.4); }
.mz-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mz-count { flex: none; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Popup de las inmersiones del mapa del resumen (assets/map_tooltip.js): tarjeta de color como las del resumen. */
.map-tip-wrap {
  position: fixed; z-index: 1400; width: 320px; pointer-events: none; perspective: 700px; animation: tip-in .15s ease-out;
}
.map-tip { box-sizing: border-box; width: 100%; padding: 14px 18px 12px; gap: 10px; border-radius: 20px; }
/* Etiquetas de la inmersión: pestañas verticales que se abren en abanico hacia la derecha y quedan rectas. El texto se lee girando la cabeza a la izquierda. */
.tip-tags { position: absolute; z-index: 2; left: calc(100% - 12px); bottom: 20px; display: flex; align-items: flex-end; gap: 5px; }
.tip-tag {
  --a: calc(var(--i, 0) * 10deg);
  box-sizing: border-box; display: flex; flex-direction: column; justify-content: flex-end; padding: 18px 7px 12px;  /* más margen donde acaba el texto (arriba) */
  border-radius: 12px 12px 5px 5px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  background: linear-gradient(135deg, color-mix(in srgb, var(--tc) 62%, #000) 0%, color-mix(in srgb, var(--tc) 44%, #000) 55%, color-mix(in srgb, var(--tc) 28%, #000) 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.28), inset 0 -2px 3px rgba(0, 0, 0, 0.3), 0 10px 18px -6px rgba(0, 0, 0, 0.75), 0 2px 4px rgba(0, 0, 0, 0.4);
  transform-origin: left bottom; animation: tag-fan .75s cubic-bezier(.3, 1.1, .4, 1) backwards; animation-delay: calc(60ms + var(--i, 0) * 65ms);
}
.tip-tag-text {
  display: block; flex: none; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap;
  font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.tip-more { background: linear-gradient(135deg, #64748b, #334155); }
@keyframes tag-fan {
  0% { opacity: 0; transform: translateX(calc(var(--i, 0) * -33px - 24px)) rotate(0deg); }
  55% { opacity: 1; transform: translateX(0) rotate(var(--a)); }
  100% { opacity: 1; transform: none; }
}
.tip-sub { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: .78rem; font-weight: 700; letter-spacing: .03em; opacity: .95; }
.tip-place { font-weight: 500; opacity: .8; }
.tip-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.tip-wide { grid-column: span 2; }
/* Fila de la tabla de la inmersión que está mostrando el popup del mapa, con el color de su ruta. */
.tbl-main tbody tr.row-link.map-hover td { background: color-mix(in srgb, var(--hl, #22d3ee) 24%, transparent); transition: background .15s; }
.tbl-main tbody tr.row-link.map-hover td:first-child { box-shadow: inset 3px 0 0 var(--hl, #22d3ee); }
.map-tip .m-num { font-size: 1.3rem; }
.map-tip .m-unit { margin-left: 3px; font-size: .74rem; }
.map-tip .m-unit + .m-num { margin-left: 6px; }
.map-tip .metric-label { margin-top: 3px; font-size: .6rem; }
.tip-hint { font-size: .66rem; letter-spacing: .06em; opacity: .7; }
@keyframes tip-in { from { opacity: 0; transform: translateY(4px) scale(.98); } }

/* Galería: filas justificadas (cada pieza ocupa su proporción) agrupadas por inmersión. */
#gallery { padding-left: 34px; }  /* hueco para el selector de cada inmersión: el texto queda alineado con las fotos */
.g-bar {
  position: sticky; top: 85px; z-index: 10; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  margin: 0 -8px 8px; padding: 12px 8px; background: rgba(14, 14, 14, 0.72); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.g-summary { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.g-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.g-group { margin-bottom: 34px; }
.g-head {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; width: fit-content; max-width: 100%; margin: 0 0 12px -34px;
  position: relative; padding-left: 34px; cursor: pointer; user-select: none;
}
.g-date { font-size: 1.15rem; font-weight: 800; letter-spacing: .04em; color: var(--text); transition: color .15s; }
.g-num { font-size: .85rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--violet); }
.g-place { font-size: .85rem; color: var(--muted); }
.g-head .media-marks { margin-left: 0; }
.g-go { font-size: .8rem; color: var(--cyan); opacity: 0; transform: translateX(-6px); transition: opacity .2s, transform .2s; }
.g-head:hover .g-go { opacity: 1; transform: none; }
.g-head:hover .g-date { color: var(--cyan); }
.g-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; }
.g-grid::after { content: ""; flex-grow: 1000000; }  /* la última fila no se estira para llenar el ancho */
.g-item {
  position: relative; min-width: 0; overflow: hidden; border-radius: 12px; cursor: pointer; background: rgba(255, 255, 255, 0.04);
  aspect-ratio: var(--ar); flex-basis: calc(var(--ar) * var(--row-h, 200px)); flex-grow: calc(var(--ar) * 100); flex-shrink: 1;
  opacity: 0; animation: g-in .5s cubic-bezier(.2, .8, .2, 1) forwards; animation-delay: calc(var(--i, 0) * 30ms);
  transition: box-shadow .25s, transform .25s;
}
.g-item:hover { transform: translateY(-2px); box-shadow: 0 0 0 1.5px rgba(34, 211, 238, 0.6), 0 18px 34px -16px rgba(0, 0, 0, 0.8); z-index: 1; }
.g-item img, .g-item video { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.g-item:hover img, .g-item:hover video { transform: scale(1.06); }
.g-item::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: linear-gradient(transparent 55%, rgba(0, 0, 0, 0.6));
}
.g-item:hover::after { opacity: 1; }
.g-cap {
  position: absolute; left: 12px; bottom: 9px; z-index: 1; font-size: .75rem; font-weight: 600; color: #fff; letter-spacing: .02em;
  opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; pointer-events: none; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}
.g-item:hover .g-cap { opacity: 1; transform: none; }
.g-play {
  position: absolute; top: 10px; right: 10px; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; padding-left: 2px;
  box-sizing: border-box; border-radius: 50%; font-size: .65rem; color: #fff; pointer-events: none;
  background: rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, 0.25);
}
@keyframes g-in { from { opacity: 0; translate: 0 14px; scale: .97; } to { opacity: 1; translate: none; scale: none; } }

/* Selección múltiple: círculo en cada pieza y en cada cabecera, barra flotante de acciones y listado de destino. */
.g-check {
  position: absolute; top: 9px; left: 9px; z-index: 2; display: grid; place-items: center; box-sizing: border-box; width: 24px; height: 24px;
  border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.9); background: rgba(0, 0, 0, 0.3); color: transparent; font-size: .8rem; font-weight: 800;
  opacity: 0; cursor: pointer; transition: opacity .2s, background .15s, border-color .15s, color .15s, box-shadow .2s;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.g-check::before { content: "\2713"; }
.g-check:hover { box-shadow: 0 0 14px rgba(203, 213, 225, 0.5); }
.g-item:hover .g-check, #gallery.selecting .g-check { opacity: 1; }
.g-item.selected .g-check, .g-check-head.on { opacity: 1; background: #7fd13b; border-color: #7fd13b; color: #0e0e0e; }
.g-item.selected { background: rgba(127, 209, 59, 0.2); }
.g-item.selected img, .g-item.selected video, .g-item.selected:hover img, .g-item.selected:hover video { transform: scale(.86); border-radius: 10px; }
.g-check-head { position: absolute; top: 50%; left: 6px; width: 22px; height: 22px; transform: translateY(-50%); }
.g-head:hover .g-check-head, #gallery.selecting .g-check-head { opacity: 1; }
.g-selbar {
  position: fixed; left: 50%; bottom: 28px; z-index: 60; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 20px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(24, 24, 24, 0.82); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); opacity: 0; pointer-events: none; transform: translate(-50%, 20px);
  transition: opacity .2s, transform .25s cubic-bezier(.2, .8, .2, 1);
}
.g-selbar.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
#g-sel-count { margin-right: 6px; font-weight: 700; font-size: .85rem; color: var(--text); white-space: nowrap; }
.btn-danger { color: #fca5a5; }
.btn-danger:hover { border-color: rgba(248, 113, 113, 0.6); box-shadow: 0 0 18px rgba(248, 113, 113, 0.28); }
.g-move-list { max-height: 52vh; margin: 0 -8px; padding: 0 8px; overflow-y: auto; }
.g-move-month { margin: 14px 0 6px; font-size: .7rem; font-weight: 700; letter-spacing: .12em; color: var(--muted); }
.g-move-month:first-child { margin-top: 0; }
.g-move-opt {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 9px 12px; border: 1px solid transparent; border-radius: 12px;
  background: transparent; color: var(--text); font: inherit; font-size: .85rem; text-align: left; cursor: pointer; transition: all .15s;
}
.g-move-opt:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(203, 213, 225, 0.3); box-shadow: 0 0 14px rgba(203, 213, 225, 0.12); }
.g-move-num { flex: none; width: 26px; font-weight: 800; color: var(--violet); font-variant-numeric: tabular-nums; }
.g-move-date { flex: none; width: 112px; font-variant-numeric: tabular-nums; }
.g-move-place { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.g-move-opt .media-marks { margin-left: 0; }
.modal-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.g-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 1300; padding: 10px 20px; border-radius: 999px; font-size: .85rem; color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(24, 24, 24, 0.9); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  opacity: 0; transform: translate(-50%, 16px); transition: opacity .25s, transform .25s;
}
.g-toast.show { opacity: 1; transform: translate(-50%, 0); }
.g-toast.error { color: #fca5a5; border-color: rgba(248, 113, 113, 0.5); }

/* Letterbox del álbum: fondo oscuro desenfocado, controles de cristal y carrusel inferior. */
.mlb {
  position: fixed; inset: 0; z-index: 1200; display: flex; flex-direction: column; align-items: center;
  background: rgba(4, 8, 20, 0.72); -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
  animation: lb-fade .2s ease-out;
}
.mlb[hidden] { display: none; }
.mlb-top { position: absolute; top: 16px; left: 20px; right: 20px; z-index: 3; display: flex; align-items: center; gap: 14px; pointer-events: none; }
.mlb-top > * { pointer-events: auto; }
.mlb-pill {
  display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; font-size: .8rem; color: rgba(226, 232, 240, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12); background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: inset 0 1px 1px -0.5px rgba(255, 255, 255, 0.35);
}
.mlb-zoom { position: absolute; left: 50%; transform: translateX(-50%); }
.mlb-dive { cursor: pointer; font-family: inherit; color: var(--text); transition: border-color .15s, color .15s; }
.mlb-dive:hover { color: #f8fafc; border-color: rgba(203, 213, 225, 0.55); box-shadow: 0 0 16px rgba(203, 213, 225, 0.25); }
.mlb-zoom[hidden] { display: none; }
.mlb-zoom input { width: 140px; accent-color: var(--cyan); }
.mlb-actions { display: flex; gap: 10px; margin-left: auto; }
.mlb-btn, .mlb-arrow {
  display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.14); color: var(--text); cursor: pointer;
  text-decoration: none; background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: inset 0 1px 1px -0.5px rgba(255, 255, 255, 0.4);
  transition: color .15s, border-color .15s, box-shadow .15s;
}
.mlb-btn { width: 42px; height: 42px; padding: 0; }
.mlb-btn svg { width: 18px; height: 18px; }
.mlb-btn:hover { color: #f8fafc; border-color: rgba(203, 213, 225, 0.6); box-shadow: 0 0 18px rgba(203, 213, 225, 0.3); }
.mlb-delete:hover { color: #f87171; border-color: #f87171; box-shadow: 0 0 18px rgba(248, 113, 113, 0.3); }
.mlb-arrow {
  position: absolute; top: calc(50% - 40px); z-index: 3; width: 52px; height: 52px; padding: 0 0 4px; font-size: 3rem; line-height: 1;
  border: 0; border-radius: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  color: rgba(226, 232, 240, 0.75); text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
.mlb-arrow:hover { color: #fff; box-shadow: none; text-shadow: 0 0 14px rgba(203, 213, 225, 0.6); }
.mlb-prev { left: 22px; }
.mlb-next { right: 22px; }
.mlb-stage { position: relative; flex: 1; min-height: 0; width: 100%; margin-top: 70px; padding: 8px 20px; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.mlb-img, .mlb-video {
  max-width: 92vw; max-height: calc(100vh - 290px); object-fit: contain; border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);  /* sin sombra grande: el contenedor la recorta en rectángulo */
}
.mlb-img { opacity: 0; transform: scale(.97); transition: opacity .2s, transform .2s; user-select: none; -webkit-user-drag: none; }
.mlb-img.visible { opacity: 1; transform: scale(1); }
.mlb-img.zoomed { cursor: grab; transition: opacity .2s; }
.mlb-img.zoomed.panning { cursor: grabbing; }
.mlb-img[hidden], .mlb-video[hidden] { display: none; }
.mlb-video { background: #000; }
.mlb-info { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 10px 20px 0; min-height: 34px; }
.mlb-thumbs {
  display: flex; align-items: center; gap: 10px; max-width: min(92vw, 1100px); margin: 12px auto 22px; padding: 14px 18px; overflow-x: auto;
  scroll-behavior: smooth; scrollbar-width: none;
}
.mlb-thumbs::-webkit-scrollbar { display: none; }
.mlb-thumb { position: relative; flex: none; width: 60px; height: 60px; border-radius: 12px; overflow: hidden; opacity: .5; cursor: pointer; transform: scale(.92); transition: transform .2s, opacity .2s, box-shadow .2s; }
.mlb-thumb.active { opacity: 1; transform: scale(1.15); box-shadow: 0 0 0 2px var(--cyan), 0 0 18px rgba(34, 211, 238, 0.45); }
.mlb-thumb img, .mlb-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.mlb-thumb .album-play { font-size: .9rem; }

.scroll { max-height: 420px; overflow-y: auto; padding: 0 8px 8px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; position: sticky; top: 0; background: #0c1226; }
.tbl td { padding: 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: #fff; }
.dot-ascent { background: #ef4444; } .dot-gas { background: var(--orange); } .dot-notice { background: #facc15; }
.dot-bearing { background: var(--violet); } .dot-stop { background: var(--lime); }
.dot-stop_partial { background: transparent; border: 2px solid var(--lime); box-sizing: border-box; } .dot-dive { background: transparent; border: 2px solid #fff; box-sizing: border-box; }

/* ---- Acceso ---- */
.login-body { min-height: 100vh; display: grid; place-items: center; }
.login-wrap { position: relative; isolation: isolate; width: min(400px, calc(100vw - 32px)); }
.login-wrap::before {  /* luz de color detrás del cristal */
  content: ""; position: absolute; inset: -70px -100px; z-index: -1; pointer-events: none; filter: blur(46px);
  background:
    radial-gradient(40% 45% at 18% 30%, rgba(34, 211, 238, 0.5), transparent 70%),
    radial-gradient(40% 45% at 85% 25%, rgba(167, 139, 250, 0.45), transparent 70%),
    radial-gradient(40% 45% at 75% 85%, rgba(244, 114, 182, 0.42), transparent 70%),
    radial-gradient(35% 40% at 15% 85%, rgba(163, 230, 53, 0.3), transparent 70%);
}
.login-card { --accent: var(--violet); display: flex; flex-direction: column; gap: 16px; padding: 34px 32px 30px; border-radius: 28px; }
.login-logo { align-self: center; display: block; height: 38px; width: auto; margin-bottom: 2px; }
.login-sub { margin: -6px 0 6px; text-align: center; color: var(--muted); font-size: .85rem; }
.login-card label { display: flex; flex-direction: column; gap: 7px; color: rgba(226, 232, 240, 0.62); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .13em; }
.login-card input {
  box-sizing: border-box; width: 100%; height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05); color: var(--text); font: inherit; font-size: .95rem; text-transform: none; letter-spacing: normal;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.login-card input:focus { border-color: rgba(34, 211, 238, 0.7); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18); }
.login-card input:-webkit-autofill { -webkit-text-fill-color: var(--text); -webkit-box-shadow: 0 0 0 40px #1a1a1d inset; caret-color: var(--text); }
.login-btn {
  height: 44px; margin-top: 6px; border: 0; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: .95rem; color: #06101f;
  background: linear-gradient(90deg, var(--cyan), var(--violet)); transition: box-shadow .2s, transform .1s;
}
.login-btn:hover { box-shadow: 0 0 22px rgba(203, 213, 225, 0.3); }
.login-btn:active { transform: translateY(1px); }
.login-error { padding: 10px 14px; border-radius: 14px; background: rgba(244, 114, 182, 0.12); border: 1px solid rgba(244, 114, 182, 0.35); color: #fbcfe8; font-size: .85rem; text-align: center; }

/* ---- Tema claro ----
   Las tarjetas de color (.band, aire, etiquetas, popup del mapa) se quedan como están. Estas reglas cambian solo lo que era claro sobre oscuro.
   :where() deja la especificidad como la de la regla original; al ir al final del archivo gana, pero no a las más concretas (.air-card ...). */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef1f6; --glass: rgba(15, 23, 42, 0.04); --border: rgba(15, 23, 42, 0.12); --text: #0f172a; --muted: #475569;
  --Dash-Fill-Inverse-Strong: #ffffff; --Dash-Fill-Primary-Hover: rgba(14, 116, 144, 0.1); --Dash-Fill-Primary-Active: rgba(14, 116, 144, 0.18);
  --Dash-Fill-Interactive-Strong: #0891b2; --Dash-Fill-Interactive-Weak: rgba(8, 145, 178, 0.14); --Dash-Fill-Disabled: rgba(15, 23, 42, 0.05);
  --Dash-Text-Primary: #0f172a; --Dash-Text-Strong: #0f172a; --Dash-Text-Weak: #475569; --Dash-Text-Disabled: #94a3b8;
  --Dash-Stroke-Weak: rgba(15, 23, 42, 0.12); --Dash-Stroke-Strong: rgba(15, 23, 42, 0.3);
}
/* Paneles que siguen oscuros (flotan sobre el mapa o las fotos): recuperan las variables del tema oscuro. */
:where(html[data-theme="light"]) :is(.map-zones, .g-selbar, .g-toast, .mlb) {
  --text: #e2e8f0; --muted: #94a3b8; --border: rgba(255, 255, 255, 0.09); --glass: rgba(255, 255, 255, 0.045);
  --Dash-Text-Primary: #e2e8f0; --Dash-Text-Strong: #f8fafc; --Dash-Text-Weak: #94a3b8;
}
:where(html[data-theme="light"]) .top { background: rgba(238, 241, 246, 0.78); }
:where(html[data-theme="light"]) .brand-logo { content: url("/assets/Suunto-logo.svg"); }
:where(html[data-theme="light"]) .btn:hover { border-color: rgba(15, 23, 42, 0.35); box-shadow: 0 0 14px rgba(15, 23, 42, 0.12); }
:where(html[data-theme="light"]) .btn-icon:hover { color: #0f172a; }
:where(html[data-theme="light"]) .btn-danger { color: #dc2626; }
:where(html[data-theme="light"]) .seg-sm label:hover:not([aria-selected="true"]) { background: rgba(15, 23, 42, 0.06); box-shadow: none; }
:where(html[data-theme="light"]) .field .dash-input-element::placeholder { color: #94a3b8; }

/* Tarjetas de cristal de los KPI: blancas, con sombra suave; el valor en el tono oscuro de su color. */
:where(html[data-theme="light"]) .kpi {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.72) 100%),
    radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%);
  border-color: rgba(15, 23, 42, 0.08);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 14px 34px -18px rgba(15, 23, 42, 0.38), 0 2px 6px rgba(15, 23, 42, 0.06);
}
:where(html[data-theme="light"]) .kpi::before, :where(html[data-theme="light"]) .kpi::after { display: none; }
:where(html[data-theme="light"]) .kpi-cyan { --kt: #0e7490; } :where(html[data-theme="light"]) .kpi-teal { --kt: #0f766e; }
:where(html[data-theme="light"]) .kpi-violet { --kt: #6d28d9; } :where(html[data-theme="light"]) .kpi-pink { --kt: #be185d; }
:where(html[data-theme="light"]) .kpi-orange { --kt: #c2410c; } :where(html[data-theme="light"]) .kpi-lime { --kt: #4d7c0f; }
:where(html[data-theme="light"]) .kpi-title { color: rgba(15, 23, 42, 0.62); }
:where(html[data-theme="light"]) .kpi-value {
  background-image: linear-gradient(180deg, var(--kt, #0f172a), color-mix(in srgb, var(--kt, #0f172a) 78%, #000)); filter: none;
}
:where(html[data-theme="light"]) .kpi-unit, :where(html[data-theme="light"]) .kpi-hint { color: rgba(15, 23, 42, 0.55); }
:where(html[data-theme="light"]) .kpi-part + .kpi-part { border-image: linear-gradient(to bottom, transparent, rgba(15, 23, 42, 0.2), transparent) 1; }

/* Tablas, listas y sidebar. */
:where(html[data-theme="light"]) .tbl th { background: var(--bg); }
:where(html[data-theme="light"]) .tbl-main td.num-cell { color: #64748b; }
:where(html[data-theme="light"]) .tbl-main tbody tr.row-link:hover { background: rgba(8, 145, 178, 0.08); }
:where(html[data-theme="light"]) .tbl-main th .th-filter:hover, :where(html[data-theme="light"]) .row-menu-btn:hover { background: rgba(15, 23, 42, 0.07); color: #0f172a; box-shadow: none; }
:where(html[data-theme="light"]) .tbl-main th .th-filter:has(.dash-dropdown-value:not(.dash-dropdown-placeholder)) { color: #0e7490; }
:where(html[data-theme="light"]) .row-check:hover { border-color: #475569; box-shadow: none; }
:where(html[data-theme="light"]) .more-dot { background: rgba(15, 23, 42, 0.35); box-shadow: none; }
:where(html[data-theme="light"]) .best, :where(html[data-theme="light"]) .delta.down, :where(html[data-theme="light"]) .album-status { color: #4d7c0f; }
:where(html[data-theme="light"]) .delta.up, :where(html[data-theme="light"]) .album-status.error { color: #dc2626; }
:where(html[data-theme="light"]) .m-tag, :where(html[data-theme="light"]) .g-num, :where(html[data-theme="light"]) .g-move-num, :where(html[data-theme="light"]) .media-mark.video { color: #6d28d9; }
:where(html[data-theme="light"]) .media-mark, :where(html[data-theme="light"]) .g-go, :where(html[data-theme="light"]) .g-head:hover .g-date, :where(html[data-theme="light"]) .year-head:hover { color: #0e7490; }
:where(html[data-theme="light"]) .side-nav label:hover .opt-text { background: rgba(15, 23, 42, 0.05); }
:where(html[data-theme="light"]) .side-nav label:has(input:checked) .opt-text {
  color: #0f172a; border-left-color: #5a9e1f; background: linear-gradient(90deg, rgba(107, 184, 47, 0.22), transparent);
}
:where(html[data-theme="light"]) .expand-btn, :where(html[data-theme="light"]) .gear-btn, :where(html[data-theme="light"]) .mode-btn { background: rgba(15, 23, 42, 0.05); }
:where(html[data-theme="light"]) .expand-btn:hover, :where(html[data-theme="light"]) .gear-btn:hover, :where(html[data-theme="light"]) .mode-btn:hover {
  color: #0f172a; border-color: rgba(15, 23, 42, 0.35); box-shadow: none;
}
:where(html[data-theme="light"]) .album-add-tile { border-color: rgba(15, 23, 42, 0.3); }
:where(html[data-theme="light"]) .album-add-tile:hover { color: #0f172a; border-color: rgba(15, 23, 42, 0.5); background: rgba(15, 23, 42, 0.05); box-shadow: none; }
:where(html[data-theme="light"]) .g-bar { background: rgba(238, 241, 246, 0.8); }
:where(html[data-theme="light"]) .g-item { background: rgba(15, 23, 42, 0.06); }
:where(html[data-theme="light"]) .g-move-opt:hover { background: rgba(15, 23, 42, 0.05); border-color: rgba(15, 23, 42, 0.2); box-shadow: none; }

/* Cuadros y menús. */
:where(html[data-theme="light"]) .modal-backdrop, :where(html[data-theme="light"]) .lightbox-backdrop { background: rgba(15, 23, 42, 0.35); }
:where(html[data-theme="light"]) .modal-box, :where(html[data-theme="light"]) .rot-menu { background: #ffffff; box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35); }
:where(html[data-theme="light"]) .field { background: rgba(15, 23, 42, 0.04); }
:where(html[data-theme="light"]) .card.expanded { box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35); }

/* Gráficos de Plotly: texto, rejilla y guías con contraste sobre fondo claro; los colores de las series no cambian. */
:where(html[data-theme="light"]) .js-plotly-plot :is(.gridlayer, .zerolinelayer) path { stroke: rgba(15, 23, 42, 0.1) !important; }
:where(html[data-theme="light"]) .js-plotly-plot .spikeline { stroke: #64748b !important; }
:where(html[data-theme="light"]) .js-plotly-plot text[style*="rgb(203, 213, 225)"] { fill: #334155 !important; }
:where(html[data-theme="light"]) .js-plotly-plot text[style*="rgb(226, 232, 240)"] { fill: #1e293b !important; }
:where(html[data-theme="light"]) .js-plotly-plot text[style*="rgb(248, 250, 252)"] { fill: #0f172a !important; }
:where(html[data-theme="light"]) .js-plotly-plot text[style*="rgb(148, 163, 184)"] { fill: #475569 !important; }
:where(html[data-theme="light"]) .js-plotly-plot text[style*="rgb(96, 165, 250)"] { fill: #1d4ed8 !important; }
:where(html[data-theme="light"]) .js-plotly-plot text[style*="rgb(250, 204, 21)"] { fill: #a16207 !important; }
:where(html[data-theme="light"]) .js-plotly-plot text[style*="rgb(163, 230, 53)"] { fill: #4d7c0f !important; }
:where(html[data-theme="light"]) .js-plotly-plot text[style*="rgb(167, 139, 250)"] { fill: #6d28d9 !important; }
:where(html[data-theme="light"]) .js-plotly-plot text[style*="rgb(244, 114, 182)"] { fill: #be185d !important; }
:where(html[data-theme="light"]) .js-plotly-plot text[style*="rgb(239, 68, 68)"] { fill: #b91c1c !important; }
:where(html[data-theme="light"]) .js-plotly-plot text[style*="rgb(251, 146, 60)"] { fill: #c2410c !important; }
:where(html[data-theme="light"]) .js-plotly-plot text[style*="rgb(34, 211, 238)"] { fill: #0e7490 !important; }
:where(html[data-theme="light"]) .js-plotly-plot :is(text, tspan):is([style*="rgb(74, 222, 128)"], [style*="4ade80" i]) { fill: #15803d !important; }
:where(html[data-theme="light"]) .js-plotly-plot tspan:is([style*="rgb(203, 213, 225)"], [style*="cbd5e1" i]) { fill: #334155 !important; }
:where(html[data-theme="light"]) .js-plotly-plot tspan:is([style*="rgb(239, 68, 68)"], [style*="ef4444" i]) { fill: #b91c1c !important; }
/* Etiquetas al pasar el ratón: fondo blanco, para que el texto oscuro de arriba se lea. */
:where(html[data-theme="light"]) .js-plotly-plot .hoverlayer :is(.hovertext path, .legend rect.bg) { fill: #ffffff !important; stroke: rgba(15, 23, 42, 0.25) !important; }
/* Botones de los mapas: sobre el satélite o el mapa claro necesitan su propio fondo. */
:where(html[data-theme="light"]) .card:has(#g-map, #g-route) :is(.expand-btn, .gear-btn, .mode-btn) {
  background: rgba(255, 255, 255, 0.88); color: #0f172a; border-color: rgba(15, 23, 42, 0.25); opacity: .9;
}
:where(html[data-theme="light"]) .dot-dive { border-color: #475569; }
/* Sin el halo oscuro bajo la línea de temperatura mínima. */
:where(html[data-theme="light"]) .js-plotly-plot path.js-line[style*="stroke: rgb(11, 17, 36)"] { stroke-opacity: 0 !important; }
:where(html[data-theme="light"]) .js-plotly-plot :is(.points, .legendpoints) path[style*="stroke: rgb(255, 255, 255)"] { stroke: #475569 !important; }
