body {
  margin: 0;
  background-color: #070a13;
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  justify-content: center;
  padding: 0;
}

.smartphone-view {
  width: 100%;
  max-width: 430px;
  background-color: #0b0f19;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 85px;
  box-sizing: border-box;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  overflow-y: auto;
}

.hidden { display: none !important; }

/* CABECERA CON EL DEGRADADO PREMIUM FIEL DEL LOGO */
.yellow-header {
  background: linear-gradient(135deg, #fde047, #f97316);
  padding: 22px 20px 18px 20px;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  color: #070a13;
}
.header-top { display: flex; align-items: center; gap: 15px; }
.back-arrow { font-size: 28px; cursor: pointer; font-weight: 700; }
h1 { margin: 0; font-size: 20px; font-weight: 900; text-transform: uppercase; letter-spacing: -0.3px; }
.analysis-date { margin: 4px 0 2px 0; font-size: 11px; font-weight: 700; opacity: 0.85; }
.analysis-id { margin: 0; font-weight: 700; opacity: 0.7; }

/* HARDWARE CAPTURA CONTENEDOR */
.camera-container {
  padding: 15px 15px 0 15px;
  position: relative;
  overflow: hidden;
}
#output_canvas {
  width: 100%;
  border-radius: 14px;
  background: #000;
  border: 1px solid #242b3d;
  transition: transform 0.1s ease-out;
}

.floating-camera-btn {
  position: absolute;
  top: 25px;
  right: 25px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.zoom-control-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 20px;
  gap: 10px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
}
.zoom-control-container input[type="range"] {
  flex: 1;
  accent-color: #f97316;
}

.media-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #161b26;
  margin: 8px 15px 0 15px;
  border-radius: 14px;
  border: 1px solid #242b3d;
}
.record-btn {
  border: none;
  padding: 11px 18px;
  border-radius: 9px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  flex: 1;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.record-btn.play { background-color: #10b981; color: white; }
.record-btn.stop { background-color: #ef4444; color: white; margin-right: 10px; }
.chronometer-display {
  font-family: monospace;
  font-size: 16px;
  font-weight: 800;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* TARJETAS DE MÓDULOS DE SEGMENTO */
.cards-container { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.analysis-card {
  background: #161b26;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #242b3d;
}
.card-left h3 { margin: 0 0 8px 0; font-size: 13.5px; font-weight: 800; color: #ffffff; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 10px; margin-bottom: 3px; color: #94a3b8; }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.white  { background-color: #f8fafc; }
.dot.green  { background-color: #10b981; }
.dot.orange { background-color: #f97316; }
.dot.red    { background-color: #ef4444; }
.dot.purple { background-color: #a855f7; }

.card-right { flex-shrink: 0; }
.right-double-container { display: flex; gap: 12px; }
.donut-wrapper { text-align: center; font-size: 9px; color: #94a3b8; font-weight: 800; }

.donut-chart {
  width: 65px; height: 65px;
  border-radius: 50%;
  background: conic-gradient(#161b26 0deg, #242b3d 0deg);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.donut-chart.small-donut { width: 50px; height: 50px; }
.donut-chart::before {
  content: ""; position: absolute;
  width: 49px; height: 49px;
  background: #161b26; border-radius: 50%;
}
.donut-chart.small-donut::before { width: 36px; height: 36px; }
.center-value { position: relative; font-size: 12px; font-weight: 800; color: #ffffff; font-family: monospace; z-index: 1; }

/* METRIC BLOCKS DEL INFORME */
.stats-header-summary { padding: 15px 20px; text-align: center; }
.stats-header-summary h2 { margin: 0 0 5px 0; font-size: 17px; font-weight: 800; color: #f8fafc; }
.stats-header-summary p { margin: 0; font-size: 12px; color: #94a3b8; }
.fallback-message { background: #161b26; padding: 15px; border-radius: 12px; margin-top: 15px; font-size: 12px; color: #94a3b8; border: 1px dashed #242b3d; }

.stats-dashboard { display: flex; flex-direction: column; gap: 15px; padding: 0 15px; }
.dashboard-metric-block {
  background: #161b26;
  border-radius: 16px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid #242b3d;
}

.block-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #242b3d;
  padding-bottom: 10px;
}

/* AVATAR REDISEÑADO COMPATIBLE CON SILUETAS */
.segment-avatar {
  width: 80px !important; 
  height: 85px !important;
  background: #0f172a !important; 
  border-radius: 16px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #242b3d !important;
  gap: 6px;
  padding: 8px;
  box-sizing: border-box;
}

.avatar-silhouette {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: invert(1) drop-shadow(0 2px 4px rgba(249, 115, 22, 0.2));
}

.segment-avatar small {
  font-size: 10px !important;
  color: #38bdf8 !important; 
  font-weight: 800 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.velocimetro-box { flex: 1; display: flex; flex-direction: column; align-items: center; }
.v-label { font-size: 9px; font-weight: 800; color: #94a3b8; text-transform: uppercase; margin-bottom: 4px; letter-spacing: 0.3px; }
.v-subtext { font-size: 11px; font-weight: 900; text-align: center; margin-top: -2px; text-transform: uppercase; }

.gauge-wrapper {
  position: relative;
  width: 100px; height: 50px;
  overflow: hidden;
}
.gauge-svg { width: 100%; height: auto; }
.gauge-text {
  position: absolute; bottom: 0; left: 0; right: 0;
  text-align: center; font-size: 16px; font-weight: 900;
  font-family: monospace; color: #f8fafc;
}

.block-details-row h5 { margin: 6px 0 4px 0; font-size: 10.5px; text-transform: uppercase; color: #94a3b8; letter-spacing: 0.5px; }

/* AJUSTE INTEGRADO CON FLEX-WRAP DE ALTA FIDELIDAD */
.bar-stat {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px; margin-bottom: 5px; color: #cbd5e1;
  flex-wrap: wrap;
}
.bar-stat span { flex: 1; }
.bar-stat b { font-family: monospace; font-size: 12px; color: #f8fafc; min-width: 35px; text-align: right; }

.progress-bg {
  flex: 0 0 100%; 
  width: 100%; height: 5px; background: #242b3d;
  border-radius: 3px; overflow: hidden; margin-top: 4px;
}
.progress-fill {
  height: 100%; width: 0%; transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-fill.white { background-color: #cbd5e1; }
.progress-fill.green { background-color: #10b981; }
.progress-fill.orange { background-color: #f97316; }
.progress-fill.red { background-color: #ef4444; }
.progress-fill.purple { background-color: #a855f7; }

.reba-chips-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; width: 100%; margin-top: 6px; }
.reba-chip {
  display: flex; align-items: center; gap: 5px; justify-content: flex-start;
  padding: 6px 8px; background: #0d111c; border: 1px solid #242b3d;
  border-radius: 6px; font-size: 9.5px; font-weight: 700; color: #cbd5e1; box-sizing: border-box;
}
.reba-chip b { font-family: monospace; font-size: 11px; color: #f8fafc; margin-left: auto; }
.reba-square { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; display: inline-block; }

/* MENÚ NAVEGACIÓN INFERIOR CORPORATIVO */
.bottom-nav {
  position: fixed; bottom: 0; width: 100%; max-width: 430px; height: 65px;
  background: #0d111c; display: flex; justify-content: space-around; align-items: center;
  border-top: 1px solid #242b3d; box-sizing: border-box; z-index: 100;
}
.nav-item { text-align: center; color: #64748b; cursor: pointer; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; }
.nav-item span { font-size: 18px; }
.nav-item p { margin: 2px 0 0 0; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.nav-item.active { color: #f97316; }
.nav-item.active p { color: #f8fafc; }

.central-btn {
  background: linear-gradient(135deg, #fde047, #f97316); max-width: 65px; height: 48px; border-radius: 12px;
  color: #070a13 !important; box-shadow: 0 4px 12px rgba(249,115,22,0.3);
}
.central-text { font-weight: 900; color: #070a13 !important; }

/* HISTOGRAMA EN COLUMNAS */
.hist-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; width: 18%; }
.hist-bar { width: 100%; border-top-left-radius: 4px; border-top-right-radius: 4px; transition: height 0.6s ease-out; min-height: 2px; }
.hist-lbl { font-size: 9px; font-weight: bold; color: #94a3b8; margin-top: 5px; }

/* 🔒 SISTEMA FREEMIUM SUITE PRO LOCKS */
.premium-wrapper {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.bloqueado {
  filter: blur(10px);
  pointer-events: none;
  user-select: none;
  transition: filter 0.4s ease;
}

.paywall-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 15, 25, 0.6);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 99;
  padding: 20px;
  box-sizing: border-box;
  text-align: center;
}

.btn-premium {
  background: linear-gradient(135deg, #fde047, #f97316);
  color: #070a13;
  border: none;
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
  transition: transform 0.2s ease;
}

.btn-premium:active {
  transform: scale(0.96);
}