/* Embalses · hoja de estilos única (sin Tailwind ni preprocesadores) */

/* ---------------------------------------------------------------- fuentes */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/geist-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/geist-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/geist-mono-latin-wght-normal.woff2) format("woff2-variations");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/fonts/instrument-serif-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/fonts/instrument-serif-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-display: swap;
  font-weight: 400;
  src: url(/fonts/instrument-serif-latin-400-italic.woff2) format("woff2");
}

/* ---------------------------------------------------------------- temas */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050c16;
  --surface: #0a1523;
  --surface-2: #0f1d2f;
  --line: rgb(148 186 226 / 0.09);
  --line-strong: rgb(148 186 226 / 0.18);
  --ink: #e9f2fb;
  --muted: #8ea3ba;
  --faint: #5b6f86;
  --accent: #5fe3f5;
  --accent-2: #6f9cff;
  --pos: #3ee0a1;
  --neg: #ff6f7d;
  --warn: #f6b24a;
  --glow: rgb(95 227 245 / 0.14);
  --grid: rgb(148 186 226 / 0.07);
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --line: rgb(15 40 70 / 0.08);
  --line-strong: rgb(15 40 70 / 0.16);
  --ink: #0a1726;
  --muted: #55687e;
  --faint: #8b9bb0;
  --accent: #0aa5c2;
  --accent-2: #3b6cf0;
  --pos: #0f9f68;
  --neg: #e0394f;
  --warn: #c7800f;
  --glow: rgb(10 165 194 / 0.1);
  --grid: rgb(15 40 70 / 0.06);
}
:root {
  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 20px;
}

/* ---------------------------------------------------------------- base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}
body {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 85% -10%, var(--glow), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgb(111 156 255 / 0.07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
ol,
ul {
  list-style: none;
  padding: 0;
}
svg {
  display: block;
}
img,
svg {
  max-width: 100%;
}
[hidden] {
  display: none !important;
}
table {
  border-collapse: collapse;
}
::selection {
  background: var(--accent);
  color: var(--bg);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------------------------------------------------------------- tipografía */
.num {
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "ss01";
  letter-spacing: -0.01em;
}
.mono {
  font-family: var(--mono);
}
.display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
}
.h1 {
  font-size: clamp(36px, 6vw, 48px);
  line-height: 1.05;
}
.h1.big {
  font-size: clamp(36px, 8vw, 60px);
}
.h2 {
  font-size: clamp(30px, 4.5vw, 36px);
  line-height: 1.05;
}
.hero-title {
  margin-top: 20px;
  font-size: clamp(44px, 7.4vw, 78px);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.title-xl {
  margin-top: 16px;
  font-size: clamp(52px, 8vw, 76px);
  line-height: 0.92;
  letter-spacing: -0.02em;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.lead {
  margin-top: 16px;
  font-size: 18px;
  color: var(--muted);
  max-width: 42rem;
  line-height: 1.6;
}
.italic {
  font-style: italic;
}
.strong {
  font-weight: 500;
}
.muted {
  color: var(--muted);
}
.faint {
  color: var(--faint);
}
.ink {
  color: var(--ink);
}
.accent {
  color: var(--accent);
}
.accent2 {
  color: var(--accent-2);
}
.pos {
  color: var(--pos);
}
.neg {
  color: var(--neg);
}
.warn {
  color: var(--warn);
}
.small {
  font-size: 13px;
}
.xs {
  font-size: 12px;
}
.xxs {
  font-size: 11px;
}
.big {
  font-size: 17px;
}
.xl {
  font-size: 22px;
}
.fig {
  font-size: 26px;
  margin-top: 4px;
}
.right {
  text-align: right;
}
.center {
  text-align: center;
}
.block {
  display: block;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nowrap {
  white-space: nowrap;
}
.note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--faint);
}
.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 12px;
  color: var(--faint);
}
.meta-line a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.meta-line a:hover,
.link-sm:hover {
  color: var(--ink);
}
.link-sm {
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
code {
  font-family: var(--mono);
  font-size: 0.92em;
}

/* ---------------------------------------------------------------- iconos */
.ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.ico-xs {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -1px;
}
.ico-sm {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -2px;
}
.ico-lg {
  width: 32px;
  height: 32px;
  margin: 0 auto;
}

/* ---------------------------------------------------------------- disposición */
.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
#app {
  flex: 1;
}
.wrap {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: 16px;
}
@media (min-width: 640px) {
  .wrap {
    padding-inline: 24px;
  }
}
.home > * + * {
  margin-top: clamp(80px, 9vw, 112px);
}
.pt-xl {
  padding-top: clamp(40px, 6vw, 64px);
}
.pt-md {
  padding-top: 32px;
}
.pb {
  padding-bottom: 40px;
}
.mt-xs {
  margin-top: 4px;
}
.mt-sm {
  margin-top: 8px;
}
.mt-md {
  margin-top: 24px;
}
.mt-lg {
  margin-top: 32px;
}
.mt-xl {
  margin-top: 80px;
}
.mb-md {
  margin-bottom: 16px;
}
.mb-lg {
  margin-bottom: 32px;
}
.m-sm {
  margin: 8px;
}
.stack {
  display: grid;
  gap: 16px;
  align-content: start;
}
.flex-c {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
p.flex-c {
  display: flex;
}
.flex-b {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.grow {
  flex: 1;
}
.minw0 {
  min-width: 0;
}
.fill {
  position: absolute;
  inset: 0;
}
.center-box {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 32px;
  text-align: center;
}
.w-16 {
  width: 16px;
}
.w-20 {
  width: 20px;
}
.w-68 {
  width: 68px;
}
.w-80 {
  width: 80px;
}
.w-96 {
  width: 96px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}
.gap-sm {
  gap: 12px;
}
@media (min-width: 640px) {
  .g2,
  .g3,
  .g4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .g2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .g3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .g4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .split {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  }
  .split-side {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
  .split-detail {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
  .split-rain {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }
  .split-live {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  }
}
@media (min-width: 768px) and (max-width: 1279px) {
  .g4.md2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.hero-grid,
.detail-grid {
  display: grid;
  gap: 40px;
  align-items: center;
}
@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 64px;
  }
  .detail-grid {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.section-head .eyebrow {
  margin-bottom: 8px;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.page-head .eyebrow {
  margin-bottom: 8px;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* visibilidad responsive */
.show-sm,
.show-md,
.show-lg,
.show-xl,
.sm-only,
.xl-only {
  display: none !important;
}
@media (min-width: 640px) {
  .show-sm {
    display: revert !important;
  }
  .sm-only {
    display: inline-flex !important;
  }
}
@media (min-width: 768px) {
  .show-md {
    display: revert !important;
  }
}
@media (min-width: 1024px) {
  .show-lg {
    display: revert !important;
  }
  .lg-hide {
    display: none !important;
  }
}
@media (min-width: 1280px) {
  .show-xl {
    display: revert !important;
  }
  .xl-only {
    display: inline-flex !important;
  }
}
.fillbar.show-sm {
  display: none !important;
}
@media (min-width: 640px) {
  .fillbar.show-sm {
    display: block !important;
  }
}

/* ---------------------------------------------------------------- cabecera */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.topbar-in {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo {
  width: 32px;
  height: 32px;
  transition: transform 0.5s var(--ease);
}
.brand:hover .logo {
  transform: rotate(-8deg);
}
.brand-name {
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.nav {
  display: none;
  align-items: center;
  gap: 4px;
  font-size: 14px;
}
@media (min-width: 1024px) {
  .nav {
    display: flex;
  }
}
.nav a,
.mobile-nav a {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav a:hover {
  color: var(--ink);
}
.nav a.on,
.mobile-nav a.on {
  background: var(--surface-2);
  color: var(--ink);
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 8px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  transition: border-color 0.2s;
}
.search-btn:hover,
.icon-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}
.kbd {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
}
.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  transition: border-color 0.2s, color 0.2s;
}
#theme-btn .ico-moon,
#theme-btn.is-light .ico-sun {
  display: none;
}
#theme-btn.is-light .ico-moon {
  display: block;
}
.mobile-nav {
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  font-size: 14px;
}
.mobile-nav a {
  border-radius: 12px;
  padding: 8px 12px;
}

/* ---------------------------------------------------------------- pie */
.footer {
  border-top: 1px solid var(--line);
  margin-top: 96px;
}
.footer-in {
  padding-block: 40px;
  display: grid;
  gap: 32px;
  font-size: 14px;
}
@media (min-width: 768px) {
  .footer-in {
    grid-template-columns: 1.2fr 2fr;
  }
  .footer-note {
    grid-column: 1 / -1;
  }
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  margin-bottom: 12px;
}
.logo-sm {
  width: 24px;
  height: 24px;
}
.footer p.muted {
  max-width: 24rem;
}
.footer-cols {
  display: grid;
  gap: 24px;
  color: var(--muted);
}
@media (min-width: 640px) {
  .footer-cols {
    grid-template-columns: repeat(3, 1fr);
  }
}
.footer-cols .eyebrow {
  margin-bottom: 8px;
}
.footer-cols a:hover {
  color: var(--ink);
}
.footer-note {
  font-size: 12px;
  color: var(--faint);
}

/* ---------------------------------------------------------------- tarjetas */
.card {
  position: relative;
  background: linear-gradient(180deg, color-mix(in oklab, var(--surface) 98%, white), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card-hover {
  display: block;
  transition: border-color 0.25s, transform 0.35s var(--ease), background 0.25s;
}
.card-hover:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}
.pad {
  padding: 20px;
}
.pad-sm {
  padding: 16px;
}
.pad-lg {
  padding: 20px;
}
@media (min-width: 640px) {
  .pad-lg {
    padding: 24px;
  }
}
.stat-value {
  margin-top: 12px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-height: 30px;
}
.stat-value > .num {
  font-size: 28px;
  line-height: 1;
  font-weight: 500;
}
.stat-sub {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
}
a.chip:hover {
  color: var(--ink);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip-live {
  color: var(--pos);
  border-color: color-mix(in oklab, var(--pos) 30%, transparent);
}
.chip.warn {
  color: var(--warn);
}
.chip-btn {
  transition: color 0.2s, box-shadow 0.2s;
}
.chip-btn:hover {
  color: var(--ink);
}
.chip-btn.on {
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

/* tira de métricas bajo el titular */
.strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}
@media (min-width: 640px) {
  .strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.strip-cell {
  background: var(--surface);
  padding: 16px;
}
.strip-label {
  font-size: 11px;
  color: var(--muted);
}
.strip-value {
  margin-top: 6px;
}
.strip-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--faint);
}

/* listas dentro de tarjetas */
.list-card {
  padding: 8px;
  overflow: auto;
}
.list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 8px;
}
.list-title {
  padding: 12px 12px 8px;
}
.row-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  transition: background 0.15s;
}
.row-link:hover,
.row-link.on {
  background: var(--surface-2);
}
.row-link.col {
  display: block;
  padding: 8px 12px;
}
.row-bar {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.live-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
}

/* ---------------------------------------------------------------- piezas */
.delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "ss01";
  letter-spacing: -0.01em;
}
.delta-sm {
  font-size: 13px;
}
.delta-sm .ico {
  width: 14px;
  height: 14px;
}
.delta-md {
  font-size: 15px;
}
.delta-lg {
  font-size: 26px;
}
.delta-lg .ico {
  width: 20px;
  height: 20px;
}
.delta .ico {
  stroke-width: 2.4;
}
.delta-unit {
  opacity: 0.7;
  margin-left: 2px;
}

.fillbar {
  width: 100%;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.fillbar > div {
  height: 100%;
  border-radius: 999px;
  transition: width 1s var(--ease);
}
.pct-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.tabs {
  display: inline-flex;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px;
  gap: 2px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  scrollbar-width: thin;
}
.tabs button {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
.tabs button:hover {
  color: var(--ink);
}
.tabs button.on {
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.select,
.input-pill {
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0 12px;
  font-size: 13px;
  color: var(--ink);
  outline: none;
}
.select:focus,
.input-pill:focus-within {
  border-color: var(--line-strong);
}
.input-pill {
  display: flex;
  align-items: center;
  gap: 8px;
}
.input-pill input {
  background: transparent;
  border: 0;
  outline: none;
  width: 160px;
  font-size: 13px;
}
::placeholder {
  color: var(--faint);
}

.crumbs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.crumbs a,
a.crumbs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.crumbs a:hover,
a.crumbs:hover {
  color: var(--ink);
}

.banner {
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
}
.info {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}
.info .ico-sm {
  margin-top: 3px;
}
.live-deltas {
  display: flex;
  gap: 24px;
  font-size: 13px;
}
.ref-card {
  font-size: 13px;
  display: grid;
  gap: 8px;
}
.ref-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.rain-figs {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin-bottom: 16px;
}
.basin-card {
  display: flex;
  align-items: center;
  gap: 20px;
}
.basin-name {
  font-size: 16px;
}
.basin-pct {
  font-size: 28px;
  line-height: 1.25;
  margin-top: 4px;
}
.basin-spark {
  display: none;
  align-self: flex-end;
}
@media (min-width: 640px) {
  .basin-spark {
    display: block;
  }
}
.src-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.empty {
  max-width: 36rem;
  padding-block: 96px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 12px;
}
.empty .h1 {
  margin-top: 16px;
}

/* tabla */
.table-card {
  overflow: hidden;
}
.scroll-x {
  overflow-x: auto;
}
.table {
  width: 100%;
  font-size: 14px;
}
.table th {
  padding: 12px 16px;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  text-align: left;
  border-bottom: 1px solid var(--line);
  user-select: none;
}
.table th.right {
  text-align: right;
}
.table th button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.table th button:hover,
.table th button.on {
  color: var(--ink);
}
.table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.table tr:last-child td {
  border-bottom: 0;
}
.table tbody tr {
  transition: background 0.15s;
}
.table tbody tr:hover {
  background: color-mix(in oklab, var(--surface-2) 60%, transparent);
}
.name-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.name-link:hover {
  color: var(--accent);
}
.pct-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.pct-cell .num {
  width: 56px;
  text-align: right;
}

/* ---------------------------------------------------------------- depósito */
.tank {
  position: relative;
}
.tank > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.tank-fluid {
  max-width: 78vw;
  max-height: 78vw;
}
.tank-water {
  transition: transform 1.8s var(--ease);
}
.tank-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
}
.tank-wrap {
  position: relative;
  display: grid;
  place-items: center;
}
.tank-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  filter: blur(48px);
  opacity: 0.4;
}
.tank-pct {
  font-size: clamp(48px, 9vw, 64px);
  font-weight: 500;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
.tank-pct.md {
  font-size: 54px;
}
.tank-pct.sm {
  font-size: 44px;
}
.tank-unit {
  font-size: 0.45em;
  opacity: 0.8;
}
.tank-sub {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.78);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}
.mini-tank {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.mini-tank > span {
  position: absolute;
  inset: auto 0 0 0;
}
@keyframes wave-x {
  to {
    transform: translateX(-50%);
  }
}
.wave {
  animation: wave-x 7s linear infinite;
}
.wave-slow {
  animation: wave-x 11s linear infinite;
}

/* ---------------------------------------------------------------- animaciones */
@keyframes pulse-dot {
  50% {
    opacity: 0.4;
    transform: scale(0.75);
  }
}
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--pos);
  flex-shrink: 0;
  animation: pulse-dot 1.8s ease-in-out infinite;
}
.live-anim {
  animation: pulse-dot 1.8s ease-in-out infinite;
}
@keyframes shimmer {
  from {
    background-position: -200% 0;
  }
  to {
    background-position: 200% 0;
  }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in oklab, var(--surface-2) 70%, var(--line-strong)) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  border-radius: 12px;
}
.skeleton.round {
  border-radius: 999px;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------------------------------------------------------------- buscador */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 0;
}
.modal-bg {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.5);
  backdrop-filter: blur(4px);
  animation: fade-in 0.2s ease-out;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 36rem;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.6);
  animation: pop-in 0.25s var(--ease);
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}
.search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}
.search-input {
  flex: 1;
  height: 56px;
  background: transparent;
  border: 0;
  outline: none;
  font-size: 15px;
}
.search-list {
  max-height: 420px;
  overflow: auto;
  padding: 8px;
}
.search-head {
  padding: 8px 12px 4px;
}
.search-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  text-align: left;
}
.search-item.on {
  background: var(--surface-2);
}
.search-none {
  padding: 32px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ---------------------------------------------------------------- mapa */
.map-card {
  overflow: hidden;
}
.map {
  width: 100%;
  height: 100%;
}
.full-h {
  height: calc(100dvh - 220px);
  min-height: 420px;
}
.legend-box {
  position: absolute;
  left: 12px;
  bottom: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  padding: 8px 12px;
}
.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}
.legend-bar {
  height: 8px;
  width: 160px;
  border-radius: 999px;
}
.maplibregl-popup-content {
  background: var(--surface) !important;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 14px !important;
  box-shadow: 0 20px 50px -20px rgb(0 0 0 / 0.6) !important;
  padding: 12px 14px !important;
  font-family: var(--sans);
}
.maplibregl-popup-tip {
  display: none;
}
.maplibregl-ctrl-group {
  background: var(--surface) !important;
  border: 1px solid var(--line-strong);
  box-shadow: none !important;
  border-radius: 12px !important;
  overflow: hidden;
}
.maplibregl-ctrl-group button + button {
  border-top: 1px solid var(--line) !important;
}
[data-theme="dark"] .maplibregl-ctrl-icon {
  filter: invert(1) hue-rotate(180deg);
}
.maplibregl-ctrl-attrib {
  background: color-mix(in oklab, var(--surface) 80%, transparent) !important;
  color: var(--muted);
  font-size: 10px;
}
.maplibregl-ctrl-attrib a {
  color: var(--muted) !important;
}
.pop-name {
  font-weight: 600;
  font-size: 14px;
}
.pop-basin {
  color: var(--muted);
  font-size: 12px;
}
.pop-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
}
.pop-extra {
  margin-top: 6px;
  color: var(--muted);
}

/* ---------------------------------------------------------------- gráficos */
.chart {
  position: relative;
  touch-action: pan-y;
  user-select: none;
}
.chart svg {
  overflow: visible;
}
.chart .ax {
  font-size: 11px;
  fill: var(--faint);
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
}
.chart .gl {
  stroke: var(--grid);
}
.chart .zero {
  stroke: var(--line-strong);
}
.chart .ln {
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart .ln-avg {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}
.chart .band-area {
  fill: var(--muted);
  opacity: 0.1;
}
.chart .cap-line {
  stroke: var(--faint);
  stroke-dasharray: 5 5;
}
.chart .end-label {
  font-size: 12px;
  fill: var(--accent);
  font-family: var(--sans);
  font-weight: 500;
}
.chart .bar-pos {
  fill: var(--pos);
}
.chart .bar-neg {
  fill: var(--neg);
}
.chart .bar {
  fill: var(--accent);
}
.chart .bar-today {
  fill: var(--accent-2);
}
.chart .bar-fc {
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 1.2;
  stroke-dasharray: 3 2;
}
.chart .cross line {
  stroke: var(--line-strong);
  stroke-dasharray: 4 4;
}
.chart .cross .band {
  fill: var(--grid);
}
.chart .draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1.2s var(--ease) forwards;
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
.chart .fade {
  animation: fade-in 1.2s ease-out both 0.2s;
}
.chart .rise {
  transform-box: fill-box;
  transform-origin: bottom;
  animation: rise 0.6s var(--ease) both;
  animation-delay: calc(var(--i) * 12ms);
}
@keyframes rise {
  from {
    transform: scaleY(0);
  }
}
.chart-tip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  pointer-events: none;
  min-width: 140px;
  background: color-mix(in oklab, var(--surface-2) 94%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--ink);
  box-shadow: 0 18px 40px -18px rgb(0 0 0 / 0.55);
  opacity: 0;
  transition: opacity 0.12s;
  white-space: nowrap;
}
.chart-tip.on {
  opacity: 1;
}
.tip-title {
  font-weight: 600;
  margin-bottom: 6px;
}
.tip-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.tip-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.tip-row i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}
.tip-row i.dash {
  height: 0;
  border-top: 2px dashed;
  background: none !important;
  border-radius: 0;
}
.tip-sub {
  color: var(--faint);
  font-size: 11px;
  margin-top: 2px;
}
.chart-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 12px;
}
.lg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lg-line {
  width: 20px;
  height: 3px;
  border-radius: 2px;
}
.lg-dash {
  width: 20px;
  border-top: 1px dashed var(--muted);
}
.lg-band {
  width: 20px;
  height: 10px;
  border-radius: 3px;
  background: color-mix(in oklab, var(--muted) 15%, transparent);
}
.lg-sep {
  width: 1px;
  height: 16px;
  background: var(--line);
  margin: 0 4px;
}
.year-chip {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--faint);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.year-chip:hover {
  color: var(--muted);
}
.year-chip.on {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
}

.scroll-thin {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
