/* ==========================================================================
   PRYSMIA FACE — Hoja de Estilos Corporativa (Fase 6.1B Mobile-First)
   Diseño de Alta Fidelidad basado en los Design Tokens de Prysmia Care
   Enfoque: Exploración Longitudinal del GAP Facial y Experiencia Mobile-First
   ========================================================================== */

:root {
  /* Paleta Corporativa */
  --navy: #000c18;
  --navy-surface: #071b2c;
  --navy-card: #0a2136;
  --navy-border: #1a3956;
  --blue: #608dff;
  --blue-hover: #4b7aef;
  --blue-light: rgba(96, 141, 255, 0.12);
  --lime: #f9ff2d;
  --lime-hover: #eff729;
  --lime-light: rgba(249, 255, 45, 0.12);
  --ink: #092034;
  --muted: #536a7c;
  --muted-light: #7e95a7;
  --paper: #f7f9fb;
  --card-bg: #ffffff;
  --line: #dbe4ec;
  --line-light: #eef3f8;
  --danger: #ff5252;
  --danger-bg: rgba(255, 82, 82, 0.1);
  --success: #2ed573;
  --success-bg: rgba(46, 213, 115, 0.1);
  --warning: #ffa502;
  --warning-bg: rgba(255, 165, 2, 0.12);

  /* Tipografía */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;

  /* Elevaciones */
  --shadow-sm: 0 2px 8px rgba(0, 12, 24, 0.05);
  --shadow-md: 0 6px 20px rgba(0, 12, 24, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 12, 24, 0.14);
  --shadow-lime: 0 0 20px rgba(249, 255, 45, 0.35);

  /* Radios */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  /* Transiciones */
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset y base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection {
  background: var(--lime);
  color: var(--navy);
}

img, video, canvas {
  display: block;
  max-width: 100%;
}

button, input, select {
  font: inherit;
}

/* Layout Container */
.container {
  width: min(100% - 32px, 1100px);
  margin-inline: auto;
}

/* Header */
.app-header {
  background-color: var(--navy);
  color: #ffffff;
  border-bottom: 1px solid var(--navy-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-name .badge-face {
  background: var(--lime);
  color: var(--navy);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.brand-sub {
  font-size: 0.7rem;
  color: var(--muted-light);
  letter-spacing: 0.02em;
}

.header-session-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--navy-surface);
  border: 1px solid var(--navy-border);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  color: #d1dfed;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.status-dot.offline {
  background: var(--danger);
  box-shadow: 0 0 6px var(--danger);
}

/* Eyebrows */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #3b60c4;
}

.eyebrow::before {
  content: '';
  width: 16px;
  height: 2px;
  background: var(--blue);
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  user-select: none;
}

.btn > * {
  pointer-events: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-lime {
  background-color: var(--lime);
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

.btn-lime:hover {
  background-color: var(--lime-hover);
  box-shadow: var(--shadow-lime);
}

.btn-dark {
  background-color: var(--navy);
  color: #ffffff;
}

.btn-dark:hover {
  background-color: var(--navy-surface);
}

.btn-outline {
  background-color: #ffffff;
  color: var(--navy);
  border-color: var(--line);
}

.btn-outline:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.btn-ghost {
  background-color: transparent;
  color: var(--muted);
  min-height: 38px;
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
}

.btn-ghost:hover {
  color: var(--navy);
  background-color: rgba(0, 12, 24, 0.05);
}

.btn-sm {
  min-height: 36px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.btn-circle {
  width: 60px;
  height: 60px;
  min-height: 60px;
  border-radius: 50%;
  padding: 0;
}

/* Main Content Views */
.main-content {
  flex: 1;
  padding-block: 24px 48px;
}

.screen-view {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.screen-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Banner de Sesión */
.session-info-banner {
  background: #edf2f9;
  border-left: 3px solid var(--blue);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.session-info-banner strong {
  color: var(--ink);
}

/* ==========================================================================
   PANTALLA 1: INICIO (HOME)
   ========================================================================== */
.hero-box {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 5vw, 48px);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.hero-box .eyebrow {
  margin-bottom: 16px;
}

.hero-box h1 {
  font-size: clamp(1.8rem, 4.2vw, 2.9rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.04em;
  color: var(--navy);
  margin-bottom: 16px;
  max-width: 760px;
}

.hero-box h1 em {
  font-style: normal;
  color: var(--blue);
}

.hero-box .lead {
  font-size: clamp(0.95rem, 1.3vw, 1.15rem);
  color: var(--muted);
  max-width: 660px;
  line-height: 1.55;
  margin-bottom: 24px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.privacy-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background-color: var(--paper);
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: var(--muted);
}

/* Concept Cards Grid */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.concept-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition);
}

.concept-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}

.concept-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 8px;
}

.concept-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.concept-card p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

/* ==========================================================================
   PANTALLA 2: CAPTURA FOTOGRÁFICA Y DATOS MÍNIMOS
   ========================================================================== */
.capture-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: start;
}

.viewport-card {
  background: var(--navy);
  border-radius: var(--radius-lg);
  padding: 18px;
  color: #ffffff;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--navy-border);
}

/* Selector Segmentado: Foto Actual vs Histórica */
.photo-type-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  background: var(--navy-surface);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--navy-border);
}

.photo-type-btn {
  flex: 1;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--muted-light);
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.photo-type-btn.active {
  background: var(--navy-card);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Caja de Fecha Histórica */
.historical-date-box {
  background: var(--navy-surface);
  border: 1px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  display: none;
}

.historical-date-box.active {
  display: block;
}

.historical-date-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--lime);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.historical-date-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
}

.select-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--navy-border);
  background: var(--navy-card);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
}

.select-input:focus {
  outline: none;
  border-color: var(--blue);
}

.historical-help-text {
  font-size: 0.72rem;
  color: var(--muted-light);
  margin-top: 6px;
  line-height: 1.35;
}

/* Modos de Captura: Cámara vs Galería */
.mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  background: var(--navy-surface);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.mode-tab {
  flex: 1;
  padding: 7px 10px;
  border: none;
  background: transparent;
  color: var(--muted-light);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.mode-tab.active {
  background: var(--navy-card);
  color: #ffffff;
}

/* Viewport Area */
.camera-stage {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #000812;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--navy-border);
}

.camera-video, .preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.preview-image.no-mirror {
  transform: none;
}

/* Oval Guide Overlay */
.oval-guide {
  position: absolute;
  width: 58%;
  height: 76%;
  border: 2px dashed rgba(249, 255, 45, 0.65);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 12, 24, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.oval-crosshair {
  position: absolute;
  width: 16px;
  height: 16px;
  border-top: 1px solid rgba(249, 255, 45, 0.4);
  border-left: 1px solid rgba(249, 255, 45, 0.4);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.oval-tip {
  position: absolute;
  bottom: -28px;
  white-space: nowrap;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--lime);
  background: rgba(0, 12, 24, 0.85);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* File Drop Zone */
.dropzone-stage {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--navy-surface);
  border-radius: var(--radius-md);
  border: 2px dashed var(--navy-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
  padding: 16px;
  text-align: center;
}

.dropzone-stage:hover, .dropzone-stage.dragover {
  border-color: var(--blue);
  background: var(--navy-card);
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--blue-light);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  color: var(--blue);
}

.dropzone-text h4 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.dropzone-text p {
  font-size: 0.76rem;
  color: var(--muted-light);
}

/* Camera Controls Bar */
.camera-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
}

.shutter-btn {
  background: var(--lime);
  border: 4px solid rgba(249, 255, 45, 0.35);
  box-shadow: 0 0 14px rgba(249, 255, 45, 0.4);
  cursor: pointer;
  transition: var(--transition);
  display: grid;
  place-items: center;
}

.shutter-btn:hover {
  transform: scale(1.05);
}

.shutter-btn:active {
  transform: scale(0.95);
}

.shutter-inner {
  width: 22px;
  height: 22px;
  background: var(--navy);
  border-radius: 50%;
}

/* Side Form Panel */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 5px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--navy);
  background: #ffffff;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-light);
}

.form-help {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.35;
}

/* Quality Checklist Banner */
.quality-checklist-card {
  background: #f4f8fc;
  border: 1px solid #d2e3f3;
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 0.8rem;
}

.quality-checklist-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.quality-checklist-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #314d68;
}

/* Contexto Opcional Colapsable */
.optional-context-details {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: var(--paper);
  margin-bottom: 16px;
}

.optional-context-details summary {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--navy);
  cursor: pointer;
  user-select: none;
}

.context-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.context-field label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 700;
}

.context-field select {
  width: 100%;
  padding: 6px 8px;
  font-size: 0.78rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

/* ==========================================================================
   PANTALLA 3: ANÁLISIS (WAIT)
   ========================================================================== */
.analyzing-box {
  background: var(--navy);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 48px);
  color: #ffffff;
  text-align: center;
  max-width: 580px;
  margin-inline: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--navy-border);
}

.radar-wrapper {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto 24px;
}

.radar-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--blue);
  opacity: 0.8;
  animation: radarWave 2s infinite ease-out;
}

.radar-pulse:nth-child(2) { animation-delay: 0.6s; }
.radar-pulse:nth-child(3) { animation-delay: 1.2s; }

@keyframes radarWave {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.35); opacity: 0; }
}

.analyzing-avatar {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--lime);
  box-shadow: 0 0 16px rgba(249, 255, 45, 0.5);
  background: #000c18;
}

.analyzing-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.analyzing-scanner-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
  animation: scanVertical 2s infinite ease-in-out alternate;
}

@keyframes scanVertical {
  0% { top: 15%; }
  100% { top: 85%; }
}

.analyzing-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
}

.analyzing-step {
  font-size: 0.9rem;
  color: var(--lime);
  font-weight: 700;
  min-height: 24px;
  margin-bottom: 18px;
}

.analyzing-timer {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted-light);
  background: var(--navy-surface);
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 18px;
  border: 1px solid var(--navy-border);
}

.analyzing-notice {
  font-size: 0.76rem;
  color: var(--muted-light);
  line-height: 1.45;
}

/* ==========================================================================
   PANTALLA 4: RESULTADO Y COMPARATIVA LONGITUDINAL
   ========================================================================== */
.results-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Tarjeta Hero Principal */
.result-hero-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 4vw, 36px);
  box-shadow: var(--shadow-md);
  position: relative;
}

.result-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.result-status-tag.basal {
  background: #eef4ff;
  color: #2b54bc;
  border: 1px solid #c8dafc;
}

.result-status-tag.longitudinal {
  background: var(--success-bg);
  color: #1a964f;
  border: 1px solid #b6e9c9;
}

/* Hero Display para 1ª Medición (BASAL) */
.basal-display-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.metric-block {
  display: flex;
  flex-direction: column;
}

.metric-block-label {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.metric-block-val {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
}

.metric-block-sub {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ==========================================================================
   FASE 6.1D: NUEVA JERARQUÍA DEFINITIVA DE RESULTADOS
   ========================================================================== */

/* 1. Interpretación Humana (Efecto WOW) */
.wow-card {
  background: linear-gradient(135deg, #071b2c 0%, #000c18 100%);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.wow-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: var(--lime);
}

.wow-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--lime);
  margin-bottom: 8px;
}

.wow-headline {
  font-size: clamp(1.2rem, 3.5vw, 1.5rem);
  font-weight: 800;
  line-height: 1.35;
  color: #ffffff;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.wow-subheadline {
  font-size: clamp(0.92rem, 2.5vw, 1.05rem);
  color: #d1e2f2;
  line-height: 1.5;
  margin-bottom: 12px;
}

.wow-extra-note {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  line-height: 1.4;
}

.wow-extra-note.favorable {
  background: rgba(249, 255, 45, 0.15);
  color: var(--lime);
  border: 1px solid rgba(249, 255, 45, 0.3);
}

.wow-extra-note.neutral {
  background: rgba(96, 141, 255, 0.15);
  color: #d6e5fa;
  border: 1px solid rgba(96, 141, 255, 0.3);
}

.wow-extra-note.small-change {
  background: rgba(255, 255, 255, 0.08);
  color: #c0d3e5;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.wow-extra-note.caution {
  background: rgba(255, 184, 184, 0.12);
  color: #ffcccc;
  border: 1px solid rgba(255, 184, 184, 0.25);
}

.wow-scientific-caveat {
  font-size: 0.72rem;
  color: var(--muted-light);
  line-height: 1.4;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  margin-top: 4px;
}

/* 2. Segunda Prioridad: Cambio Facial Estimado */
.cambio-facial-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.cambio-facial-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-light);
}

.cambio-facial-title {
  font-size: 0.96rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--navy);
}

.cambio-facial-pill {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  color: var(--muted);
}

.cambio-facial-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  gap: 12px;
  align-items: stretch;
}

@media (max-width: 680px) {
  .cambio-facial-metrics-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.cambio-col {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.cambio-col-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}

.cambio-col-val {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}

.cambio-col-tech {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted-light);
}

.cambio-col-center {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy-border);
  box-shadow: var(--shadow-sm);
}

.cambio-col-center-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--lime);
  margin-bottom: 4px;
}

.cambio-col-center-val {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 800;
  line-height: 1.1;
  color: #ffffff;
  margin-bottom: 4px;
}

.cambio-col-center-text {
  font-size: 0.78rem;
  color: #d1e2f2;
}

/* 3. Tercera Prioridad: Ritmo de Envejecimiento Facial Estimado */
.ritmo-facial-card {
  background: #f4f8fd;
  border: 1px solid #c8ddf3;
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 20px;
}

.ritmo-facial-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.ritmo-facial-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--navy);
}

.ritmo-facial-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--blue);
}

.ritmo-facial-text {
  font-size: 0.85rem;
  color: #1e3a5a;
  line-height: 1.45;
}

/* Basal Hero Box & Actions */
.basal-hero-box {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-bottom: 20px;
}

.basal-hero-title {
  font-size: clamp(1.2rem, 3vw, 1.45rem);
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}

.basal-hero-lead {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.basal-actions-container {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line-light);
}

.basal-actions-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}

.basal-return-hint {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
}

.longitudinal-actions-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Selector de Periodo Comparado */
.period-selector-bar {
  background: var(--navy-surface);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.period-selector-label {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--blue);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.period-select-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}

.period-select-input {
  background: var(--navy-card);
  color: #ffffff;
  border: 1px solid var(--navy-border);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  max-width: 220px;
}

.period-select-input:focus {
  outline: none;
  border-color: var(--blue);
}

/* Advertencia Breve sobre Fotografía Aislada */
.disclaimer-age-banner {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 16px;
}

/* Gráfica Temporal SVG */
.chart-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.chart-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--navy);
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.72rem;
  color: var(--muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.chart-svg-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.chart-svg {
  width: 100%;
  min-width: 320px;
  height: 220px;
}

/* Lista Histórica de la Línea de Tiempo */
.timeline-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.timeline-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 14px;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
}

.timeline-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.timeline-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.timeline-date-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--navy);
}

.timeline-tag-basal {
  background: var(--blue);
  color: #ffffff;
  font-size: 0.62rem;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 800;
}

.timeline-data-row {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.timeline-gap-pill {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.88rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--line);
}

/* Sección Secundaria Colapsable "Entender mis resultados" */
.results-details-accordion {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #ffffff;
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.results-details-accordion summary {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--navy);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.details-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
  font-size: 0.82rem;
}

.details-section-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
}

.details-section-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.details-section-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}

.details-section-desc {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Botones de Acción en Resultados */
.result-actions-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

/* ==========================================================================
   ERROR CARD
   ========================================================================== */
.error-card {
  background: #ffffff;
  border: 1px solid var(--danger);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.error-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--danger-bg);
  color: var(--danger);
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  margin: 0 auto 16px;
}

.error-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}

.error-card p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* Footer */
.app-footer {
  background: var(--navy);
  color: var(--muted-light);
  border-top: 1px solid var(--navy-border);
  padding-block: 22px;
  font-size: 0.78rem;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Mobile Adjustments */
@media (max-width: 860px) {
  .capture-layout {
    grid-template-columns: 1fr;
  }
  .details-content-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   MODAL OBLIGATORIO DE CALIDAD FOTOGRÁFICA (FASE 6.1E)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  inset: 0;
  background: rgba(0, 12, 24, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-card {
  background: var(--navy-surface);
  border: 1px solid var(--navy-border);
  border-radius: 20px;
  max-width: 490px;
  width: 100%;
  padding: 28px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 1px rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateY(14px) scale(0.97);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  color: #ffffff;
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(96, 141, 255, 0.15);
  border: 1px solid rgba(96, 141, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.modal-lead-box {
  background: rgba(96, 141, 255, 0.08);
  border-left: 3px solid var(--blue);
  border-radius: 0 10px 10px 0;
  padding: 12px 14px;
}

.modal-lead {
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.45;
}

.modal-guidelines-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.modal-guidelines-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  line-height: 1.4;
  color: #dbe4ec;
}

.guide-bullet {
  color: var(--lime);
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1.4;
  flex-shrink: 0;
}

.modal-footnote {
  font-size: 0.8rem;
  color: var(--muted-light);
  line-height: 1.4;
  font-style: italic;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.modal-actions .btn-lime {
  width: 100%;
  padding: 13px;
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
  justify-content: center;
}

.modal-actions .btn-ghost {
  color: var(--muted-light);
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 6px;
  align-self: center;
  background: transparent;
  border: none;
  cursor: pointer;
}

.modal-actions .btn-ghost:hover {
  color: #ffffff;
}

@media (max-width: 540px) {
  .container {
    width: min(100% - 24px, 1100px);
  }
  .hero-box {
    padding: 20px 16px;
  }
  .result-hero-card {
    padding: 18px 14px;
  }
  .gap-comparison-row {
    flex-direction: column;
    gap: 12px;
  }
  .gap-side-metrics {
    width: 100%;
    justify-content: space-between;
  }
  .modal-card {
    padding: 22px 18px;
    gap: 14px;
  }
  .modal-title {
    font-size: 1.2rem;
  }
  .modal-lead {
    font-size: 0.88rem;
  }
}

/* ==========================================================================
   FASE 6.2C1 — ESTILOS DE AUTENTICACIÓN OTP Y PERFIL INTEGRADO
   ========================================================================== */
/* Prevención de salto visual en cabecera durante la resolución de sesión (Fase 6.2D1) */
.app-header.auth-resolving .header-right-group,
.app-header.auth-resolving .header-space-switcher {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-header.auth-ready .header-right-group,
.app-header.auth-ready .header-space-switcher {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.22s ease;
}

.header-right-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-auth-group {
  display: flex;
  align-items: center;
}

.btn-header-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: rgba(96, 141, 255, 0.4);
  color: #ffffff;
  padding: 5px 12px;
  font-size: 0.76rem;
  border-radius: var(--radius-full);
  background: rgba(96, 141, 255, 0.08);
  transition: var(--transition);
}

.btn-header-login:hover {
  background: rgba(96, 141, 255, 0.2);
  border-color: var(--blue);
  color: #ffffff;
}

.user-pill-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(96, 141, 255, 0.12);
  border: 1px solid rgba(96, 141, 255, 0.28);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
  color: #ffffff;
  max-width: 170px;
}

.user-avatar-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 6px var(--lime);
  flex-shrink: 0;
}

.user-pill-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  color: var(--muted-light);
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-logout:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

.modal-card-auth {
  max-width: 480px;
}

.modal-subtitle {
  font-size: 0.8rem;
  color: var(--muted-light);
  font-weight: 500;
  display: block;
  margin-top: 2px;
}

.auth-step-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-alert {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.82rem;
  margin-top: 10px;
  margin-bottom: 12px;
  line-height: 1.45;
}

.auth-alert.error {
  background: rgba(255, 82, 82, 0.12);
  border: 1px solid var(--danger);
  color: #ffb4b4;
}

.auth-alert.success {
  background: rgba(46, 213, 115, 0.12);
  border: 1px solid var(--success);
  color: #b7fcd3;
}

.otp-input {
  letter-spacing: 0.35em;
  font-size: 1.4rem;
  font-weight: 800;
  text-align: center;
  font-family: var(--font-mono);
  background: #ffffff;
  color: var(--navy);
  padding: 10px 12px;
}

.auth-secondary-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  text-align: center;
}

.btn-link {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
  transition: var(--transition);
}

.btn-link:hover {
  color: #ffffff;
}

.auth-link {
  color: var(--blue);
  text-decoration: underline;
}

.auth-link:hover {
  color: #ffffff;
}

@media (max-width: 640px) {
  .header-right-group {
    gap: 6px;
  }
  .header-session-badge {
    padding: 4px 8px;
    font-size: 0.7rem;
  }
  .user-pill {
    max-width: 110px;
    padding: 3px 8px;
    font-size: 0.7rem;
  }
  .btn-header-login {
    padding: 4px 8px;
    font-size: 0.72rem;
  }
}

/* ==========================================================================
   FASE 6.2C2 — ESTILOS DE CONSENTIMIENTO, PRIVACIDAD Y PERSISTENCIA
   ========================================================================== */
.modal-card-consent {
  max-width: 540px;
}

.modal-card-doc {
  max-width: 620px;
  max-height: 85vh;
}

.btn-header-privacy {
  color: var(--muted-light);
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  background: transparent;
  border: none;
  cursor: pointer;
}

.btn-header-privacy:hover {
  color: var(--blue);
  background: rgba(96, 141, 255, 0.1);
}

.consent-block-mandatory {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.consent-block-optional {
  background: #ffffff;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.consent-badge-row {
  display: flex;
  align-items: center;
}

.consent-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.consent-tag.required {
  background: rgba(96, 141, 255, 0.14);
  color: #2b54bc;
  border: 1px solid rgba(96, 141, 255, 0.3);
}

.consent-tag.optional {
  background: rgba(83, 106, 124, 0.1);
  color: var(--muted);
  border: 1px solid var(--line);
}

.consent-main-text {
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.5;
  font-weight: 600;
  font-style: italic;
}

.consent-optional-lead {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.consent-links-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
}

.link-btn-text {
  background: none;
  border: none;
  color: var(--blue);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0;
  font-family: inherit;
}

.link-btn-text:hover {
  color: var(--navy);
}

.consent-links-row .sep {
  color: var(--muted-light);
}

.consent-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.45;
  cursor: pointer;
  user-select: none;
}

.consent-checkbox-row.mandatory-check-label {
  padding-top: 4px;
  font-weight: 700;
  color: var(--navy);
}

.consent-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
}

.doc-body-scroll {
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--ink);
}

.doc-body-scroll h4 {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--navy);
  margin-top: 6px;
}

.doc-body-scroll ul {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.doc-regulatory-notice {
  background: rgba(255, 165, 2, 0.08);
  border: 1px solid rgba(255, 165, 2, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.76rem;
  color: #8c5b00;
  margin-top: 8px;
}

.privacy-settings-status-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
}

.setting-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.setting-desc {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 2px;
}

.badge-status-active {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--success);
  background: var(--success-bg);
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.data-deletion-info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--line-light);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 8px;
}

.data-deletion-info-box strong {
  color: var(--ink);
  display: block;
  margin-bottom: 2px;
}

.persistence-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(46, 213, 115, 0.12);
  border: 1px solid rgba(46, 213, 115, 0.3);
  color: #1a7a40;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.home-user-history-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(96, 141, 255, 0.12);
  border: 1px solid rgba(96, 141, 255, 0.3);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 12px;
}

/* ==========================================================================
   PRYSMIA FACE — MODO OPERADOR Y PARTICIPANTES ASISTIDOS (FASE 6.2C3)
   ========================================================================== */

.btn-header-operator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(249, 255, 45, 0.1);
  border-color: rgba(249, 255, 45, 0.4);
  color: var(--lime);
  font-weight: 700;
  padding: 4px 10px;
}

.btn-header-operator:hover {
  background: var(--lime);
  color: var(--navy);
  border-color: var(--lime);
}

.btn-operator-hero {
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 600;
}

.btn-operator-hero:hover {
  background: rgba(96, 141, 255, 0.08);
  border-color: var(--blue-glow);
}

.badge-role-operator {
  display: inline-flex;
  background: var(--lime);
  color: var(--navy);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  margin-left: 4px;
  letter-spacing: 0.5px;
}

.activation-claim-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(7, 27, 44, 0.95), rgba(10, 33, 54, 0.95));
  border: 1px solid var(--blue);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  color: #ffffff;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}

.claim-banner-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.claim-banner-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #ffffff;
}

.claim-banner-content p {
  font-size: 0.85rem;
  color: var(--muted-light);
  margin-bottom: 12px;
  line-height: 1.45;
}

.claim-banner-actions {
  display: flex;
  gap: 10px;
}

/* Pantalla Operador */
.operator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.operator-header-title h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
}

.operator-header-title p {
  font-size: 0.85rem;
  color: var(--muted);
}

.operator-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.operator-active-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: rgba(96, 141, 255, 0.1);
  border: 1px solid var(--blue);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 20px;
  font-size: 0.88rem;
}

.operator-active-banner strong {
  color: var(--blue);
}

.operator-filter-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.operator-search-input {
  flex: 1;
  max-width: 360px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.operator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.operator-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.operator-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--blue);
}

.operator-card.is-active-subject {
  border: 2px solid var(--blue);
  background: rgba(96, 141, 255, 0.03);
}

.op-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.op-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.op-card-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.badge-operator-pending {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--warning-bg);
  color: #b36b00;
  border: 1px solid rgba(255, 165, 2, 0.4);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.badge-operator-claimed {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--success-bg);
  color: #1a7a40;
  border: 1px solid rgba(46, 213, 115, 0.4);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.op-card-stats {
  background: var(--line-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.78rem;
  color: var(--muted);
}

.op-card-stats strong {
  color: var(--ink);
}

.op-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  flex-wrap: wrap;
}

.operator-empty-state {
  text-align: center;
  padding: 48px 24px;
  background: var(--card-bg);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
}

.operator-empty-state p {
  margin-bottom: 16px;
  font-size: 0.92rem;
}

.link-copy-box {
  display: flex;
  gap: 8px;
  background: var(--navy-surface);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 14px 0;
  align-items: center;
}

.link-copy-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  outline: none;
}

/* ==========================================================================
   PRYSMIA FACE — CABECERA RESPONSIVE Y SELECTOR DE ESPACIOS (FASE 6.2C3 UX)
   ========================================================================== */
.header-space-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--navy-surface);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 3px;
}

.space-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--muted-light);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.space-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.space-tab.active {
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.header-user-menu-wrapper {
  position: relative;
  display: inline-flex;
}

.header-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(96, 141, 255, 0.12);
  border: 1px solid rgba(96, 141, 255, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  max-width: 200px;
}

.header-user-btn:hover {
  background: rgba(96, 141, 255, 0.22);
  border-color: var(--blue);
}

.header-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-chevron {
  font-size: 0.65rem;
  color: var(--muted-light);
  transition: transform 0.2s ease;
}

.header-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: #00172d;
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  padding: 8px 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.dropdown-user-header {
  padding: 8px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-user-header strong {
  font-size: 0.82rem;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-role-label {
  font-size: 0.68rem;
  color: var(--lime);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dropdown-divider {
  height: 1px;
  background: var(--navy-border);
  margin: 4px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 16px;
  background: transparent;
  border: none;
  color: #d1dfed;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.dropdown-item:hover {
  background: rgba(96, 141, 255, 0.12);
  color: #ffffff;
}

.dropdown-logout:hover {
  background: rgba(255, 71, 87, 0.12);
  color: var(--danger);
}

/* Barra superior contextual en Resultados */
.results-top-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.results-context-pill {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue);
  background: rgba(96, 141, 255, 0.08);
  border: 1px solid rgba(96, 141, 255, 0.2);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   FICHA INDIVIDUAL DEL PARTICIPANTE (FASE 6.2C3 UX)
   ========================================================================== */
.op-detail-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.op-detail-nav-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.op-detail-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.op-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.op-detail-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(96, 141, 255, 0.12);
  border: 2px solid var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.op-detail-info {
  flex: 1;
}

.op-detail-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.op-detail-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}

.op-detail-meta-row {
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.op-meta-dot {
  color: var(--line);
}

.op-detail-meas-box {
  background: var(--line-light);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.op-detail-meas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.op-detail-meas-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ink);
}

.op-detail-count-badge {
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--card-bg);
  border: 1px solid var(--line);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  color: var(--blue);
}

.op-detail-meas-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.op-detail-meas-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.op-detail-actions-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  padding-top: 8px;
}

.op-btn-block {
  width: 100%;
  justify-content: center;
}

.activation-env-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(96, 141, 255, 0.1);
  border: 1px solid rgba(96, 141, 255, 0.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.78rem;
  color: var(--blue);
  margin-top: 10px;
}

/* Modificación interactiva de tarjeta de operador: cursor pointer */
.operator-card {
  cursor: pointer;
}

/* Ajustes Responsivos */
@media (max-width: 768px) {
  .header-inner {
    height: auto;
    padding: 10px 0;
    flex-wrap: wrap;
    gap: 10px;
  }
  .brand-sub {
    display: none;
  }
  .header-space-switcher {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .header-right-group {
    margin-left: auto;
  }
  .header-user-btn {
    max-width: 140px;
  }
  .op-detail-actions-panel {
    grid-template-columns: 1fr;
  }
}



