:root {
  --bg: #08111f;
  --panel: #111c2e;
  --panel-2: #17253c;
  --text: #e9eef8;
  --muted: #9eb0cc;
  --line: rgba(255,255,255,.08);
  --primary: #4cc9f0;
  --primary-2: #7b61ff;
  --good: #2dd4bf;
  --warn: #f59e0b;
  --bad: #ef4444;
  --shadow: 0 20px 40px rgba(0,0,0,.28);
  --radius: 22px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #13233d 0%, var(--bg) 46%);
  color: var(--text);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(8,17,31,.84); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; position: relative; }
.brand { font-weight: 800; letter-spacing: .02em; font-size: 1.1rem; }
.brand span { color: var(--primary); }
.main-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.main-nav a { color: var(--muted); font-weight: 600; }
.main-nav a.active, .main-nav a:hover { color: #fff; }
.nav-toggle { display:none; background:none; border:0; color:#fff; font-size:1.5rem; }
.hero, .section { padding: 40px 0; }
img, canvas { max-width: 100%; }

.chart-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  height: clamp(220px, 34vw, 360px);
}
.chart-wrap.chart-tall { height: clamp(240px, 40vw, 420px); }
.chart-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.hero-grid, .dashboard-grid, .map-layout, .radar-layout { display: grid; gap: 24px; }
.hero-grid { grid-template-columns: 1.2fr .8fr; align-items: center; padding: 28px 0 12px; }
.dashboard-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.map-layout { grid-template-columns: 1.35fr .85fr; }
.radar-layout { grid-template-columns: 1.1fr .9fr; }
.page-header-block { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; }
.header-actions { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.hero h1, h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.04; margin: 8px 0 14px; }
.hero-copy { color: var(--muted); font-size: 1.05rem; line-height: 1.65; max-width: 62ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; color: var(--primary); font-size: .77rem; font-weight: 800; }
.source-strip { display:flex; flex-wrap:wrap; gap:10px; margin-top:20px; }
.source-chip {
  background: rgba(255,255,255,.06); border:1px solid var(--line); color:var(--muted);
  padding:10px 14px; border-radius:999px; font-size:.88rem;
}
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.hero-card { padding: 24px; }
.card-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:16px; }
.card-header h2, .card-header h1 { margin:0; font-size:1.35rem; }
.card-header a, .card-header span { color: var(--muted); font-size:.95rem; }
.btn {
  display:inline-flex; align-items:center; justify-content:center; border-radius: 14px; padding: 14px 18px;
  font-weight: 700; border:1px solid transparent; cursor:pointer; transition:.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #07111c; }
.btn-secondary { background: rgba(255,255,255,.06); color: #fff; border-color: var(--line); }
.btn-small {
  display:inline-flex; border:1px solid var(--line); background:rgba(255,255,255,.05); color:#fff;
  border-radius:12px; padding:10px 12px; font-weight:600; cursor:pointer;
}
.hero-actions, .station-actions { display:flex; gap:12px; flex-wrap:wrap; margin-top: 22px; }
.metrics-grid {
  display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:16px; margin-top:18px;
}
.metrics-grid.wide { grid-template-columns: repeat(4, minmax(0,1fr)); }
.metrics-grid dt { color: var(--muted); font-size: .84rem; margin-bottom: 6px; }
.metrics-grid dd { margin:0; font-weight:800; font-size:1.2rem; }
.status-pill {
  display:inline-flex; align-items:center; justify-content:center; min-width:120px; padding:9px 14px;
  border-radius:999px; font-weight:900; letter-spacing:.08em; font-size:.76rem; color:#06111b;
}
.status-pill.large { padding: 12px 16px; font-size: .84rem; }
.status-normal { background: var(--good); }
.status-alerta { background: var(--warn); }
.status-boom { background: var(--bad); color:#fff; }
.status-descenso { background: #60a5fa; }
.feature-grid { display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap:24px; }
.feature-card h3 { margin-top:0; }
.section-alt { background: rgba(255,255,255,.02); border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.site-footer { padding: 28px 0 40px; color: var(--muted); }
.footer-wrap { display:flex; justify-content:space-between; gap:16px; flex-wrap:wrap; border-top:1px solid var(--line); padding-top:22px; }
.simple-row, .station-card-header { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; }
.stack { display:grid; gap:14px; }
.station-meta { display:flex; flex-wrap:wrap; gap:10px; color: var(--muted); font-size:.88rem; margin-top:6px; }
.price-tag { font-weight:900; font-size:1.15rem; }
.badge { display:inline-flex; border-radius:999px; padding:6px 10px; margin-top:8px; font-weight:700; font-size:.78rem; }
.badge.good { background: rgba(45,212,191,.16); color:#9ff4e5; }
.badge.warn { background: rgba(245,158,11,.18); color:#ffd58a; }
.badge.risk { background: rgba(239,68,68,.16); color:#ffb2b2; }
.small-note, .panel-copy { color: var(--muted); line-height:1.6; }
.filters-grid {
  display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap:16px;
}
.filters-grid label, .form-stack label { display:grid; gap:8px; }
.filters-grid span, .form-stack span { color: var(--muted); font-size: .9rem; }
.filters-grid input, .filters-grid select, .form-stack input, .form-stack select {
  width:100%; background: rgba(255,255,255,.05); border:1px solid var(--line); color:#fff;
  border-radius: 14px; padding: 13px 14px;
}
.map-box { height: min(68vh, 640px); border-radius: 18px; overflow: hidden; }
.sidebar-panel { display:flex; flex-direction:column; }
.station-scroll { max-height: min(64vh, 700px); overflow:auto; padding-right:4px; }
.station-card { border:1px solid var(--line); border-radius:18px; padding:16px; background: rgba(255,255,255,.03); }
.signal-card, .cycle-card { border:1px solid var(--line); border-radius:18px; padding:16px; background: rgba(255,255,255,.03); }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse: collapse; }
th, td { text-align:left; padding: 14px 12px; border-bottom:1px solid var(--line); }
th { color: var(--muted); font-size: .88rem; }
.form-stack { display:grid; gap:16px; }
.empty-state { color: var(--muted); border:1px dashed var(--line); border-radius:18px; padding:18px; }
.top-gap { margin-top: 24px; }
.prose-tight p { margin: 0; color: var(--muted); line-height:1.6; }
.popup-actions { display:grid; gap:8px; margin-top:10px; }
.map-link { display:inline-flex; padding:8px 10px; border-radius:10px; background:#0f1b2c; color:#fff; font-size:.84rem; border:1px solid rgba(255,255,255,.08); }
.user-marker-note { color:var(--muted); font-size:.9rem; }
@media (max-width: 980px) {
  .hero-grid, .dashboard-grid, .map-layout, .radar-layout, .feature-grid, .filters-grid { grid-template-columns: 1fr; }
  .page-header-block { flex-direction:column; align-items:flex-start; }
  .metrics-grid.wide { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .nav-wrap { min-height: 64px; }
  .nav-toggle { display:block; }
  .main-nav { display:none; position:absolute; left:10px; right:10px; top:58px; background:#0b1628; border:1px solid var(--line); padding:14px; border-radius:16px; box-shadow:var(--shadow); }
  .main-nav.open { display:grid; gap:12px; }
  .hero, .section { padding: 24px 0; }
  .container { width:min(100% - 20px, 1180px); }
  .hero-actions, .header-actions, .station-actions { width: 100%; }
  .hero-actions .btn, .header-actions .btn, .station-actions .btn-small { flex: 1 1 100%; width: 100%; }
  .metrics-grid, .metrics-grid.wide { grid-template-columns: 1fr 1fr; }
  .card, .hero-card { padding: 18px; }
  .map-box { height: 46vh; min-height: 320px; }
  .station-scroll { max-height: none; }
  .chart-wrap { height: 240px; }
  .chart-wrap.chart-tall { height: 280px; }
  th, td { padding: 12px 8px; font-size: .92rem; }
}

@media (max-width: 520px) {
  .brand { font-size: 1rem; }
  .hero h1, h1 { font-size: clamp(1.8rem, 10vw, 2.5rem); }
  .hero-copy { font-size: 1rem; }
  .filters-grid { gap: 12px; }
  .source-chip { width: 100%; justify-content: center; text-align: center; }
  .page-header-block { gap: 14px; }
  .metrics-grid, .metrics-grid.wide { grid-template-columns: 1fr; }
  .simple-row, .station-card-header { flex-direction: column; align-items: flex-start; }
  .chart-wrap { height: 220px; }
  .chart-wrap.chart-tall { height: 260px; }
}


.map-legend {
  display:flex; flex-wrap:wrap; gap:10px; margin: 0 0 14px;
}
.legend-chip {
  display:inline-flex; align-items:center; gap:8px; padding:8px 12px; border-radius:999px;
  background: rgba(255,255,255,.05); border:1px solid var(--line); color: var(--muted); font-size:.84rem; font-weight:700;
}
.legend-chip i {
  width:10px; height:10px; border-radius:999px; display:inline-block;
}
.legend-good i { background:#22c55e; }
.legend-warn i { background:#f59e0b; }
.legend-risk i { background:#ef4444; }
.price-marker-wrap { background: transparent; border: 0; }
.price-marker {
  position: relative; width: 42px; height: 42px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); box-shadow: 0 6px 16px rgba(0,0,0,.28);
  border: 2px solid rgba(255,255,255,.9); display:flex; align-items:center; justify-content:center;
}
.price-marker span {
  transform: rotate(45deg); color:#fff; font-size:.58rem; font-weight:800; line-height:1; letter-spacing:.01em;
  display:block; width: 34px; text-align:center; text-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.price-marker--good { background: linear-gradient(135deg, #22c55e, #16a34a); }
.price-marker--warn { background: linear-gradient(135deg, #f59e0b, #d97706); }
.price-marker--risk { background: linear-gradient(135deg, #ef4444, #dc2626); }
.price-marker--neutral { background: linear-gradient(135deg, #64748b, #475569); }
@media (max-width: 760px) {
  .map-legend { gap:8px; }
  .legend-chip { font-size:.78rem; padding:7px 10px; }
  .price-marker { width: 36px; height: 36px; }
  .price-marker span { width: 28px; font-size: .5rem; }
}
