/* Trayectorias de borrascas · canarywildfirerisk.es
   Todo va prefijado con .ct- para no chocar con los estilos del visor. */
.ct-root {
  --ct-bg: #f4f4f9;
  --ct-panel: #ffffff;
  --ct-panel-2: #f4f4f4;
  --ct-line: #dddddd;
  --ct-text: #222222;
  --ct-muted: #666666;
  --ct-accent: #b30000;
  --ct-warn: #d48806;
  font: 14px/1.4 'Segoe UI', Roboto, sans-serif;
  color: var(--ct-text);
  background: var(--ct-bg);
  border: 1px solid var(--ct-line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}
.ct-root * { box-sizing: border-box; }
.ct-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  padding: 14px 18px; border-bottom: 1px solid var(--ct-line);
  background: var(--ct-panel);
}
.ct-title { font-size: 1.5em; font-weight: 700; margin: 0; color: var(--ct-accent); }
.ct-title span[data-k=name] { color: var(--ct-text); }
.ct-sub { color: var(--ct-muted); font-size: 12.5px; }
.ct-demo {
  background: var(--ct-warn); color: #fff; font-weight: 700; font-size: 11px;
  padding: 2px 8px; border-radius: 999px; letter-spacing: .04em; white-space: nowrap; display: inline-block;
}
.ct-head .ct-spacer { flex: 1; }
.ct-select, .ct-btn {
  background: var(--ct-panel-2); color: var(--ct-text); border: 1px solid var(--ct-line);
  border-radius: 8px; padding: 6px 10px; font: inherit; cursor: pointer;
}
.ct-btn:hover, .ct-select:hover { border-color: var(--ct-accent); }
.ct-btn.ct-primary { background: var(--ct-accent); color: #fff; border-color: var(--ct-accent); font-weight: 600; }
.ct-btn:disabled { opacity: .4; cursor: default; }

.ct-body { display: grid; grid-template-columns: 300px 1fr; min-height: 640px; }
.ct-side { background: var(--ct-panel); border-right: 1px solid var(--ct-line); padding: 14px; overflow-y: auto; max-height: 760px; }
.ct-main { display: flex; flex-direction: column; min-width: 0; }
.ct-map { flex: 1; min-height: 520px; background: #1a1a1a; }

.ct-sec { margin-bottom: 16px; }
.ct-sec h4 { margin: 0 0 8px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ct-muted); font-weight: 600; }
.ct-model {
  display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 8px; cursor: pointer; user-select: none;
}
.ct-model:hover { background: var(--ct-panel-2); }
.ct-model.ct-off { opacity: .4; }
.ct-model.ct-child { margin-left: 14px; }
.ct-sw { width: 14px; height: 14px; border-radius: 3px; }
.ct-sw.ct-ens { background-image: repeating-linear-gradient(135deg, rgba(0,0,0,.45) 0 2px, transparent 2px 4px); }
.ct-model small { color: var(--ct-muted); font-size: 11.5px; }
.ct-opt { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; }
.ct-opt input { accent-color: var(--ct-accent); }

.ct-run { display: flex; align-items: center; gap: 6px; }
.ct-run .ct-select { flex: 1; min-width: 0; }

.ct-time {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 10px 14px; border-top: 1px solid var(--ct-line); background: var(--ct-panel);
}
.ct-time input[type=range] { width: 100%; accent-color: var(--ct-accent); }
.ct-time-label { font-variant-numeric: tabular-nums; min-width: 190px; text-align: right; }
.ct-time-label b { color: var(--ct-accent); }

.ct-stats { padding: 12px 14px 16px; border-top: 1px solid var(--ct-line); overflow-x: auto; }
.ct-stats table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.ct-stats th, .ct-stats td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--ct-line); white-space: nowrap; }
.ct-stats th:first-child, .ct-stats td:first-child { text-align: left; }
.ct-stats th { color: var(--ct-muted); font-weight: 600; font-size: 11.5px; }
.ct-bar { display: inline-block; height: 6px; border-radius: 3px; background: var(--ct-accent); vertical-align: middle; margin-right: 6px; opacity: .85; }
.ct-note { color: var(--ct-muted); font-size: 12px; margin-top: 8px; }

.ct-legend { font-size: 12px; color: var(--ct-muted); display: grid; gap: 4px; }
.ct-legend span.ct-l { display: inline-block; width: 26px; vertical-align: middle; margin-right: 6px; border-top: 3px solid #333; }
.ct-legend span.ct-l.ct-thin { border-top-width: 1px; opacity: .6; }
.ct-legend span.ct-l.ct-dash { border-top-style: dashed; }

.ct-tip { background: rgba(255,255,255,0.95) !important; color: var(--ct-text) !important; border: 1px solid #333 !important; border-radius: 6px !important; box-shadow: 2px 2px 10px rgba(0,0,0,0.3) !important; font-size: 12.5px; }
.ct-tip::before { display: none; }
.ct-obs-label { background: transparent; border: 0; box-shadow: none; color: #fff; font-size: 11px; font-weight: 600; text-shadow: 0 0 3px #000, 0 0 6px #000; }
.ct-obs-label::before { display: none; }

.ct-loading { padding: 40px; text-align: center; color: var(--ct-muted); }

@media (max-width: 860px) {
  .ct-body { grid-template-columns: 1fr; }
  .ct-side { max-height: none; border-right: 0; border-bottom: 1px solid var(--ct-line); }
  .ct-map { min-height: 420px; }
  .ct-main { order: -1; }
  .ct-side { border-bottom: 0; border-top: 1px solid var(--ct-line); }
  .ct-time { grid-template-columns: auto 1fr; }
  .ct-time-label { grid-column: 1 / -1; text-align: left; min-width: 0; }
}

/* Navegación entre el visor de riesgo y las trayectorias */
.ct-nav { display: inline-flex; gap: 4px; background: var(--ct-panel-2); border: 1px solid var(--ct-line); border-radius: 8px; padding: 3px; }
.ct-nav a { color: var(--ct-muted); text-decoration: none; padding: 5px 10px; border-radius: 6px; font-size: 13px; }
.ct-nav a:hover { color: var(--ct-accent); }
.ct-nav a.ct-active { background: var(--ct-panel); color: var(--ct-accent); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.ct-empty { padding: 10px 12px; background: var(--ct-panel-2); border-left: 4px solid var(--ct-accent); border-radius: 8px; font-size: 13px; }
.ct-root [hidden] { display: none !important; }
