/* ============================================================
   Surf Analysis MVP — Estilos
   ============================================================ */

:root {
  --color-bg:         #0f1117;
  --color-surface:    #1a1d27;
  --color-border:     #2a2d3a;
  --color-text:       #e8eaf0;
  --color-muted:      #6b7280;
  --color-primary:    #4a90d9;
  --color-success:    #27ae60;
  --color-warning:    #f39c12;
  --color-danger:     #e74c3c;
  --color-severe:     #e74c3c;
  --topbar-height:    64px;
  --panel-width:      380px;
  --radius:           8px;
  --font: 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Suppress native video controls (custom controls replace them) */
#video-player::-webkit-media-controls-enclosure,
#video-player::-webkit-media-controls,
#overlay-player::-webkit-media-controls-enclosure,
#overlay-player::-webkit-media-controls { display: none !important; }

/* ---- TOPBAR ---- */
#topbar {
  height: var(--topbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  flex-shrink: 0;
}

/* ====================================================
   MENÚS DESPLEGABLES — TOPBAR
   ==================================================== */

/* ── Contenedores ── */
#brand-menu,
#load-menu,
#downloads-menu {
  position: relative;
}

/* ── Botón topbar compartido (Configuración / Cargar video / Descargas) ── */
.dd-menu-btn {
  background: #252e3f;
  color: #9aafcb;
  border: none;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 7px 14px;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: background 0.15s;
}
.dd-menu-btn:hover { background: #2e3a52; }

/* ── Panel desplegable compartido ── */
.dd-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px;
  min-width: 220px;
  z-index: 100;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  display: none;
}
.dd-panel.open { display: flex; }

/* Ancho específico donde haga falta */
#brand-dropdown { min-width: 260px; }

/* ── Botón/label de acción dentro del panel ── */
.dd-action {
  background: none;
  border: none;
  color: var(--color-text);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 400;
  cursor: pointer;
  text-align: left;
  display: block;
  width: 100%;
  transition: background 0.15s;
}
.dd-action:hover:not(:disabled) { background: var(--color-border); }
.dd-action:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Divisor ── */
.dd-divider {
  border-top: 1px solid var(--color-border);
  margin: 2px 0;
}

/* ── Fila label + select ── */
.dd-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dd-label {
  font-family: var(--font);
  font-size: 0.82rem;
  color: var(--color-muted);
  white-space: nowrap;
  min-width: 90px;
}
.dd-row select {
  flex: 1;
  font-family: var(--font);
  font-size: 0.82rem;
  padding: 4px 8px;
}

/* ── Heading de sección dentro del submenú ── */
.dd-sub-heading {
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-muted);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--color-border);
}

/* ── Opciones radio (Benchmark) ── */
.dd-bench-opts { display: flex; flex-direction: column; gap: 2px; }
.dd-radio-opt {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--color-text);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius);
}
.dd-radio-opt:hover { background: var(--color-border); }
.dd-radio-opt input[type="radio"] {
  accent-color: var(--color-primary);
  cursor: pointer;
  margin: 0;
}

/* ── Input URL ── */
.dd-url-row { display: flex; flex-direction: column; gap: 6px; }
.dd-url-input {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font-family: var(--font);
  font-size: 0.82rem;
  padding: 5px 8px;
  width: 100%;
  box-sizing: border-box;
}
.dd-url-input::placeholder { color: var(--color-muted); }

/* ── Flyout submenu (Análisis) ── */
.dd-submenu { position: relative; }
.dd-sub-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.dd-sub-panel {
  position: absolute;
  left: calc(100% + 4px);
  top: 0;
  min-width: 260px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  z-index: 101;
}
.dd-submenu:hover .dd-sub-panel { display: flex; }

/* Unified topbar button style (Analizar) */
.btn-topbar {
  background: #252e3f;
  color: #9aafcb;
  border: none;
  border-radius: var(--radius);
  padding: 7px 14px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-topbar:hover:not(:disabled) { background: #2e3a52; }
.btn-topbar:disabled { opacity: 0.38; cursor: not-allowed; }

/* ---- BOTÓN ANALIZAR FLOTANTE ---- */
#analyze-float {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 200;
  display: none;
  pointer-events: none;
}
#analyze-float.visible {
  display: block;
  pointer-events: auto;
}
#btn-analyze {
  background: #1a4d2e;
  color: #6ddb90;
  border: 1px solid #2d7a47;
  border-radius: var(--radius);
  padding: 14px 48px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 28px rgba(0,0,0,0.6);
  transition: background 0.15s, transform 0.1s;
}
#btn-analyze:hover { background: #1f5c37; transform: scale(1.03); }


.btn-speed {
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--color-muted);
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 0.68rem;
  cursor: pointer;
  transition: background 0.12s;
}
.btn-speed:hover  { background: rgba(255,255,255,0.16); }
.btn-speed.active { background: var(--color-primary); color: #fff; }

.det-opt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.det-opt-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.det-opt-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
}
.det-opt-hint {
  font-size: 0.75rem;
  color: var(--color-muted);
  line-height: 1.4;
}
.det-opt-check {
  accent-color: #4a90d9;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}
.det-opt-number {
  width: 60px;
  flex-shrink: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: var(--radius);
  padding: 5px 8px;
  font-size: 0.88rem;
  text-align: center;
}

/* ---- BOTONES ---- */
.btn {
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-primary  { background: var(--color-primary); color: #fff; }
.btn-secondary { background: var(--color-border); color: var(--color-text); }
.btn-outline  { background: transparent; color: var(--color-text); border: 1px solid var(--color-border); }
.btn-toggle   { background: var(--color-border); color: var(--color-muted); font-size: 0.8rem; }
.btn-toggle.active { background: var(--color-primary); color: #fff; }

select {
  background: var(--color-border);
  color: var(--color-text);
  border: none;
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  cursor: pointer;
}

/* ---- MAIN ---- */
#main-content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ---- ZONA VIDEO ---- */
#video-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 12px 16px;
  gap: 8px;
  overflow-y: auto;
  background: #0a0c12;
}

#video-placeholder {
  color: var(--color-muted);
  font-size: 1rem;
  text-align: center;
}

#video-roi-wrapper,
#overlay-player {
  width: 100%;
  border-radius: var(--radius);
  background: #000;
}

/* Limitar altura del video para que siempre quepa en pantalla */
#video-player,
#overlay-player {
  max-height: calc(100vh - var(--topbar-height) - 120px);
  object-fit: contain;
}

#annotation-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 0;
}

#roi-banner {
  background: #1a6b3a;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
}
#roi-banner button {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.75rem;
}

#video-toggle-buttons {
  display: flex;
  gap: 8px;
}

#progress-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  background: rgba(0, 0, 0, 0.72);
  border-radius: 10px;
  padding: 18px 28px;
  display: none;          /* oculto por defecto; JS lo muestra con flex */
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  pointer-events: none;
}
#progress-container.visible {
  display: flex;
}

#progress-track {
  width: 100%;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}

#progress-bar {
  height: 6px;
  width: 0%;
  background: var(--color-primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

#progress-label {
  font-size: 0.85rem;
  color: #e8eaf0;
  font-weight: 500;
  white-space: nowrap;
}

/* ---- PANEL LATERAL ---- */
#results-panel {
  width: var(--panel-width);
  flex-shrink: 0;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-block {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.panel-block h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  margin-bottom: 8px;
}

.result-placeholder {
  color: var(--color-border);
  font-size: 0.85rem;
}

.hidden { display: none !important; }

/* --- Bloque 1: Maniobra --- */
.big-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 2px;
}
.meta-row span:last-child { color: var(--color-text); font-weight: 500; }

/* --- Bloque 2: Nota --- */
.grade-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}
.grade-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-primary);
}
.grade-scale {
  font-size: 1rem;
  color: var(--color-muted);
}

.grade-bar-container {
  background: var(--color-border);
  border-radius: 3px;
  height: 6px;
  width: 100%;
}
.grade-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--color-primary);
  transition: width 0.5s ease;
}

/* --- Bloque 3: Dimensiones --- */
.dim-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.dim-table th {
  text-align: left;
  color: var(--color-muted);
  padding: 2px 4px;
  font-weight: 500;
}
.dim-table td {
  padding: 3px 4px;
  border-bottom: 1px solid var(--color-border);
}
.dim-table td:last-child { text-align: right; font-weight: 600; color: var(--color-primary); }

/* --- Bloque 4: Comparación --- */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.comparison-table th {
  color: var(--color-muted);
  text-align: right;
  padding: 3px 4px;
  font-weight: 500;
  border-bottom: 1px solid var(--color-border);
}
.comparison-table th:first-child { text-align: left; }
.comparison-table td {
  padding: 4px 4px;
  text-align: right;
  border-bottom: 1px solid var(--color-border);
}
.comparison-table td:first-child { text-align: left; }

.severity-high   { color: var(--color-danger); }
.severity-medium { color: var(--color-warning); }
.severity-low    { color: var(--color-success); }

/* --- Bloque 5: Recomendación --- */
.main-rec {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--color-text);
  margin-bottom: 10px;
}
.secondary-recs {
  padding-left: 16px;
  font-size: 0.82rem;
  color: var(--color-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.secondary-recs li { list-style: disc; }

/* ---- TIMELINE DE MANIOBRAS ---- */
#maneuver-timeline {
  width: 100%;
  padding: 0 8px;
  margin-bottom: 4px;
}

#timeline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

#timeline-track {
  position: relative;
  height: 32px;
  background: var(--color-border);
  border-radius: 4px;
  overflow: visible;
  cursor: crosshair;
}

/* resize handles */
.seg-handle {
  position: absolute;
  top: 0;
  width: 8px;
  height: 100%;
  cursor: ew-resize;
  z-index: 6;
  border-radius: 2px;
  transition: background 0.1s;
}
.seg-handle-l { left: 0; border-radius: 3px 0 0 3px; }
.seg-handle-r { right: 0; border-radius: 0 3px 3px 0; }
.seg-handle:hover { background: rgba(255,255,255,0.35); }

/* param info icon + diagram popup */
.param-info-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0 3px;
  opacity: 0.7;
  vertical-align: middle;
  line-height: 1;
}
.param-info-btn:hover { opacity: 1; }

.param-diagram-popup {
  position: fixed;
  z-index: 3000;
  background: #1e2535;
  border: 1px solid #3a5a7a;
  border-radius: 8px;
  padding: 10px 12px;
  width: 220px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.7);
}
.param-diagram-popup svg { display: block; margin: 0 auto 6px; }
.param-diagram-popup p {
  font-size: 0.72rem;
  color: var(--color-muted);
  text-align: center;
  line-height: 1.4;
  margin: 0;
}

/* timeline segment delete btn */
.seg-delete-btn {
  position: absolute;
  top: 2px;
  right: 10px;
  background: rgba(0,0,0,0.5);
  border: none;
  color: #fff;
  font-size: 0.62rem;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 7;
  line-height: 1.4;
}
.timeline-segment:hover .seg-delete-btn { opacity: 1; }

/* segment edit popup */
.seg-popup {
  position: fixed;
  z-index: 2000;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  min-width: 210px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.55);
}

/* save-training segment rows */
.st-seg-row {
  background: var(--color-border);
  border-radius: 6px;
  padding: 10px 12px;
}

.timeline-segment {
  position: absolute;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  border-right: 2px solid var(--color-bg);
  transition: filter 0.15s;
  user-select: none;
}
.timeline-segment { cursor: pointer; }
.timeline-segment:hover { filter: brightness(1.2); }
.timeline-segment.active { outline: 2px solid rgba(255,255,255,0.85); outline-offset: -2px; }

.timeline-segment-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 6px;
  pointer-events: none;
  text-shadow: 0 0 3px rgba(255,255,255,0.4);
}

#timeline-playhead {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: #fff;
  opacity: 0.9;
  pointer-events: none;
  z-index: 10;
  left: 0%;
}

#timeline-legend {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  flex-wrap: wrap;
}

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

.timeline-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ---- MODALES ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.hidden { display: none !important; }

.modal-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.modal-wide { max-width: 820px; }
.modal-box-fullscreen {
  max-width: 100vw !important;
  width: 100vw !important;
  max-height: 100vh !important;
  height: 100vh !important;
  border-radius: 0 !important;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.modal-header h2 { font-size: 0.95rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--color-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.modal-close:hover { background: var(--color-border); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

/* Form dentro del modal */
.modal-form { }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 0.75rem; color: var(--color-muted); }
.form-group input, .form-group select {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 0.83rem;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* Queue de entrenamientos */
.queue-item {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}
.queue-item-info { display: flex; flex-direction: column; gap: 2px; }
.queue-item-name { font-weight: 600; color: var(--color-primary); }
.queue-item-meta { font-size: 0.75rem; color: var(--color-muted); }
.queue-item-remove {
  background: none;
  border: none;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 4px;
}
.queue-item-remove:hover { color: var(--color-danger); background: var(--color-border); }

/* Tabla de muestras */
.samples-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.samples-table th {
  text-align: left;
  color: var(--color-muted);
  padding: 4px 8px;
  border-bottom: 1px solid var(--color-border);
  font-weight: 500;
  white-space: nowrap;
}
.samples-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.samples-table tr.outlier-row td { background: rgba(231,76,60,0.07); }
.outlier-badge {
  background: var(--color-danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
}
.outlier-cell { color: var(--color-danger); font-weight: 600; }
tr[data-frame]:hover td { background: rgba(106,176,255,0.10) !important; }
tr.lm-row-active td { outline: 2px solid #6ab0ff; outline-offset: -1px; background: rgba(106,176,255,0.18) !important; }

/* ── Curve model modal ─────────────────────────────────────────────────── */
.cm-method-btn {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 0.72rem;
  padding: 4px 8px;
  text-align: left;
  width: 100%;
  transition: background 0.15s, color 0.15s;
}
.cm-method-btn:hover { background: rgba(255,152,0,0.08); color: var(--color-text); }
.cm-method-active {
  background: rgba(255,152,0,0.15) !important;
  color: #ff9800 !important;
  border-color: #ff980055 !important;
  font-weight: 600;
}
.cm-coord-btn {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  transition: background 0.15s, color 0.15s;
}
.cm-coord-btn:hover { background: rgba(106,176,255,0.08); color: var(--color-text); }
.cm-coord-active { background: rgba(106,176,255,0.18) !important; color: #6ab0ff !important; border-color: #6ab0ff55 !important; }

.cm-lm-group { margin-bottom: 8px; }
.cm-lm-group-title {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
}
.cm-lm-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.73rem;
  cursor: pointer;
  padding: 2px 0;
  border-radius: 3px;
  user-select: none;
}
.cm-lm-row:hover { background: rgba(255,255,255,0.04); }
.cm-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.btn-delete-sample {
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 0.75rem;
  white-space: nowrap;
}
.btn-delete-sample:hover { border-color: var(--color-danger); color: var(--color-danger); }

/* Definiciones */
.defs-tab {
  padding: 5px 12px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: none;
  color: var(--color-muted);
  transition: all 0.15s;
}
.defs-tab:hover { background: var(--color-border); color: var(--color-text); }
.defs-tab.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.defs-section { margin-bottom: 16px; }
.defs-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #a8c4e0;
  font-weight: 600;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #3a5a7a;
}
.defs-field { margin-bottom: 8px; }
.defs-field label { font-size: 0.75rem; color: var(--color-muted); display: block; margin-bottom: 3px; }
.defs-field input[type="text"],
.defs-field input[type="number"],
.defs-field textarea {
  width: 100%;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-family: inherit;
}
.defs-field textarea { resize: vertical; min-height: 60px; }
.defs-field input[type="number"] { width: 90px; }
.defs-field input:focus, .defs-field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}
.defs-thresh-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.defs-thresh-item label { font-size: 0.72rem; color: var(--color-muted); }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  #main-content { flex-direction: column; }
  #results-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--color-border);
    max-height: 50vh;
  }
}
