/* Está de Chuva — folha de estilos
   Linguagem: tipografia de sistema grande e apertada, muito espaço em branco,
   vidro fosco sobre o céu, secções claras e um palco preto para o 3D. */

@property --sky-top { syntax: '<color>'; inherits: true; initial-value: #0a1730; }
@property --sky-bottom { syntax: '<color>'; inherits: true; initial-value: #1f3560; }

:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --paper: #ffffff;
  --paper-alt: #f5f5f7;
  --card: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --hair: rgba(0, 0, 0, 0.1);
  --link: #0066cc;
  --focus: #0071e3;
  --track: rgba(0, 0, 0, 0.07);
  --spread: rgba(0, 0, 0, 0.13);
  --nav-glass: rgba(251, 251, 253, 0.8);
  --ic-cloud: #a1a1a6;
  --ic-sun: #ffb400;
  --ic-moon: #8e8e93;
  --ic-rain: #0a84ff;
  --warn-yellow: #b38600;
  --warn-orange: #c2570c;
  --warn-red: #d70015;
  --radius: 22px;
  --radius-lg: 28px;
  --page: 1080px;
  --wide: 1240px;
  --gutter: clamp(20px, 5vw, 44px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #000000;
    --paper-alt: #000000;
    --card: #161617;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --ink-3: #86868b;
    --hair: rgba(255, 255, 255, 0.12);
    --link: #2997ff;
    --focus: #2997ff;
    --track: rgba(255, 255, 255, 0.1);
    --spread: rgba(255, 255, 255, 0.2);
    --nav-glass: rgba(22, 22, 23, 0.8);
    --ic-cloud: #d1d1d6;
    --ic-sun: #ffd60a;
    --ic-moon: #d1d1d6;
    --ic-rain: #64b5ff;
    --warn-yellow: #ffd60a;
    --warn-orange: #ff9f0a;
    --warn-red: #ff453a;
  }
}

* { box-sizing: border-box; }
/* sem o "elástico" do macOS e do iOS nas pontas da página: ao puxar para lá do topo aparecia a cor de fundo
   (a do fim do degradê) por cima do céu */
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.47 var(--font);
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; letter-spacing: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
small { font-size: inherit; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 30; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 14px; }
.skip:focus { top: 76px; }

.wrap { width: min(var(--page), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- navegação ---------- */
/* Duas cápsulas de vidro a flutuar: a da página (marca, secções, local, agora) e, ao lado, a das
   preferências (unidades, tema, fontes). Claras sobre o céu do topo, com a pele da página depois dele. */

.nav {
  --nav-pill: rgba(255, 255, 255, 0.2); --nav-panel: #1b2029;
  --nav-bg: rgba(18, 22, 30, 0.26); --nav-line: rgba(255, 255, 255, 0.18);
  position: fixed; z-index: 20; top: calc(10px + env(safe-area-inset-top)); left: 50%; translate: -50% 0;
  width: min(1180px, 100% - 24px);
  display: flex; align-items: flex-start; gap: 8px;
  color: #fff;
}
.past-hero .nav { --nav-pill: var(--track); --nav-panel: var(--card); --nav-bg: var(--nav-glass); --nav-line: var(--hair); color: var(--ink); }
.nav-in, .nav-prefs {
  height: 50px; display: flex; align-items: center;
  border-radius: 26px; background: var(--nav-bg); border: 1px solid var(--nav-line);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.4);
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.nav-in { position: relative; z-index: 1; flex: 1; min-width: 0; padding: 0 8px 0 12px; gap: 8px; font-size: 13px; letter-spacing: -0.01em; }
.nav-prefs { flex: none; padding: 0 8px; gap: 4px; }
.brand { display: flex; align-items: center; gap: 9px; margin-right: auto; font-size: 16px; font-weight: 600; letter-spacing: -0.02em; color: inherit; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3)); }
.nav-links { display: flex; gap: 2px; }
.nav-links a { padding: 7px 12px; border-radius: 999px; color: inherit; opacity: 0.8; white-space: nowrap; transition: background-color 0.2s, opacity 0.2s; }
.nav-links a:hover { opacity: 1; text-decoration: none; }
.nav-links a[aria-current] { opacity: 1; font-weight: 500; background: var(--nav-pill); }
.nav-now {
  display: inline-flex; align-items: center; gap: 4px; height: 34px; border-radius: 999px; white-space: nowrap;
  background: var(--nav-pill); color: inherit; font-size: 14px; overflow: hidden;
  /* sobre o céu do topo a temperatura já está em grande, por isso a pastilha fica recolhida */
  max-width: 0; padding: 0; margin-left: -8px; opacity: 0; pointer-events: none;
  transition: opacity 0.3s, max-width 0.35s, padding 0.35s, margin 0.35s;
}
.nav-now:hover { text-decoration: none; }
.nav-now b { font-weight: 600; }
.nav-now .ic { display: block; width: 22px; height: 22px; }
.nav-now:empty { display: none; }
.past-hero .nav-now { max-width: 96px; padding: 0 12px 0 8px; margin-left: 0; opacity: 1; pointer-events: auto; }
.nav-menu { display: none; position: relative; width: 38px; height: 38px; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.nav-menu i { position: absolute; left: 11px; width: 16px; height: 1.6px; border-radius: 1px; background: currentColor; transition: transform 0.25s, top 0.25s; }
.nav-menu i:first-child { top: 15px; }
.nav-menu i:last-child { top: 22px; }
.is-open .nav-menu i:first-child { top: 18.5px; transform: rotate(45deg); }
.is-open .nav-menu i:last-child { top: 18.5px; transform: rotate(-45deg); }

/* preferências: pílulas que abrem uma lista por baixo */
.pref {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 11px;
  border: 0; border-radius: 999px; background: var(--nav-pill); color: inherit; font: inherit; font-size: 14px; font-weight: 500;
  white-space: nowrap; cursor: pointer; position: relative;
}
.pref:hover, .pref[aria-expanded="true"] { background: color-mix(in srgb, currentColor 22%, transparent); }
.pref svg { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pref-swatch { flex: none; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.15); }
@media (max-width: 980px) {
  .nav-menu { display: block; }
  .nav-links {
    position: absolute; top: 58px; left: -1px; right: -1px; display: grid; gap: 2px; padding: 8px;
    border-radius: 22px; background: var(--nav-panel); border: 1px solid rgba(255, 255, 255, 0.14);
    -webkit-backdrop-filter: saturate(180%) blur(28px); backdrop-filter: saturate(180%) blur(28px);
    box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.45);
    opacity: 0; visibility: hidden; translate: 0 -6px; transition: opacity 0.2s, translate 0.2s, visibility 0.2s;
  }
  .past-hero .nav-links { border-color: var(--hair); }
  .is-open .nav-links { opacity: 1; visibility: visible; translate: 0 0; }
  .nav-links a { padding: 13px 14px; border-radius: 14px; font-size: 17px; opacity: 1; }
}

/* ---------- topo ---------- */

.hero {
  --ic-cloud: #ffffff; --ic-sun: #ffd60a; --ic-moon: #ffffff; --ic-rain: #9fd4ff;
  position: relative;
  --fade: clamp(120px, 20vh, 220px);
  /* o céu continua um pouco para lá do primeiro ecrã, e é aí que se desfaz na página */
  min-height: calc(max(660px, 100svh) + var(--fade) - 28px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  color: #fff;
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom));
  transition: --sky-top 1.6s ease, --sky-bottom 1.6s ease;
  overflow: hidden;
  isolation: isolate;
}
#sky { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
/* o céu esbate-se na cor da secção seguinte, por baixo das horas, em vez de acabar num corte */
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: var(--fade); z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom,
    transparent,
    color-mix(in srgb, var(--paper-alt) 9%, transparent) 22%,
    color-mix(in srgb, var(--paper-alt) 34%, transparent) 46%,
    color-mix(in srgb, var(--paper-alt) 70%, transparent) 72%,
    var(--paper-alt));
}
.hero-copy {
  align-self: center;
  padding: calc(88px + env(safe-area-inset-top)) var(--gutter) 28px;
  text-align: center;
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.22);
}
.hero-when { font-size: clamp(17px, 2.1vw, 21px); font-weight: 500; letter-spacing: -0.01em; opacity: 0.86; }
.hero-when::first-letter { text-transform: uppercase; }
.hero h1 {
  margin-top: 10px;
  font-size: clamp(46px, 10.4vw, 124px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.032em;
  text-wrap: balance;
}
.hero-sub { margin: 18px auto 0; max-width: 30em; font-size: clamp(19px, 2.4vw, 26px); line-height: 1.24; font-weight: 500; letter-spacing: -0.015em; opacity: 0.92; text-wrap: balance; }
.hero-now { margin-top: clamp(28px, 5vh, 52px); display: inline-flex; align-items: center; gap: 18px; text-align: left; }
.now-temp { font-size: clamp(64px, 9vw, 96px); font-weight: 300; line-height: 1; letter-spacing: -0.05em; }
.now-meta { display: grid; gap: 1px; font-size: 15px; line-height: 1.35; opacity: 0.92; white-space: pre; }
.now-kind { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 17px; }
.now-kind .ic { width: 26px; height: 26px; }
.hero-note { margin-top: 18px; font-size: 14px; opacity: 0.74; }
.hero-recado { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px auto 0; max-width: 34em; }
.hero-recado[hidden] { display: none; }
.hero-recado > span { display: inline-flex; align-items: center; gap: 8px; padding: 7px 15px 7px 10px; border-radius: 999px; font-size: 15px; font-weight: 500; line-height: 1.3; text-align: left; background: color-mix(in srgb, currentColor 9%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 16%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.hero-recado .ic { flex: none; width: 22px; height: 22px; }
@media (max-width: 600px) { .hero-recado > span { font-size: 14px; border-radius: 18px; } }
.retry { display: none; margin-top: 22px; padding: 11px 22px; border: 0; border-radius: 999px; background: #fff; color: #1d1d1f; cursor: pointer; }
.is-error .retry { display: inline-block; }
.is-loading .hero-now, .is-error .hero-now, .is-loading .hours-wrap, .is-error .hours-wrap, .is-loading .hero-note, .is-error .hero-note, .is-loading .hero-recado, .is-error .hero-recado { visibility: hidden; }
.is-loading #answer { opacity: 0.6; }

.hours-wrap { padding: 0 var(--gutter) calc(var(--fade) + env(safe-area-inset-bottom)); }
.hours {
  width: min(1080px, 100%); margin-inline: auto;
  display: flex; gap: 2px;
  padding: 14px 10px;
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
}
.hours::-webkit-scrollbar { display: none; }
.hour { flex: 0 0 58px; display: grid; justify-items: center; gap: 4px; scroll-snap-align: start; }
.hour-t { font-size: 13px; font-weight: 600; opacity: 0.86; }
.hour-i .ic { width: 28px; height: 28px; display: block; }
.hour-p { height: 14px; font-size: 11px; font-weight: 600; line-height: 14px; color: #a8d8ff; }
.hour-v { font-size: 18px; font-weight: 500; }

/* ---------- ícones ---------- */

.ic { width: 28px; height: 28px; overflow: visible; }
.ic-cloud { fill: var(--ic-cloud); }
.ic-sun { fill: var(--ic-sun); }
.ic-ray { stroke: var(--ic-sun); stroke-width: 2; stroke-linecap: round; fill: none; }
.ic-moon { fill: var(--ic-moon); }
.ic-rain { stroke: var(--ic-rain); stroke-width: 2.2; stroke-linecap: round; fill: none; }
.ic-mist { stroke: var(--ic-cloud); stroke-width: 2.2; stroke-linecap: round; fill: none; opacity: 0.7; }
.ic-bolt { fill: var(--ic-sun); }
.ic-snow { fill: var(--ic-rain); }

/* ---------- secções ---------- */

.band { padding: clamp(80px, 11vw, 150px) 0; background: var(--paper); }
.band-alt { background: var(--paper-alt); }
/* cada capítulo abre da mesma maneira: título grande ao centro, uma frase por baixo, e depois o que há para ver */
.head { text-align: center; }
h2, .head h3 { font-weight: 600; line-height: 1.07; letter-spacing: -0.022em; text-wrap: balance; }
h2 { font-size: clamp(34px, 5.2vw, 56px); }
.head h3 { font-size: clamp(26px, 3.6vw, 40px); }
.lede { margin: 14px auto 0; max-width: 32em; font-size: clamp(18px, 2vw, 21px); line-height: 1.38; letter-spacing: -0.012em; color: var(--ink-2); text-wrap: balance; }
.head-sub { margin-top: clamp(72px, 9vw, 120px); }
.fine { margin-top: 20px; max-width: 62em; font-size: 12px; line-height: 1.5; letter-spacing: -0.005em; color: var(--ink-3); }

/* ---------- fontes ---------- */

.facts { margin-top: clamp(36px, 5vw, 56px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.fact { padding: 4px 24px; display: grid; gap: 8px; align-content: start; justify-items: center; text-align: center; }
.fact + .fact { border-left: 1px solid var(--hair); }
.fact strong { font-size: clamp(34px, 4.6vw, 52px); font-weight: 600; line-height: 1; letter-spacing: -0.035em; }
.fact span { font-size: 15px; line-height: 1.4; color: var(--ink-2); max-width: 22em; }

.src-table { margin-top: clamp(36px, 5vw, 56px); }
.src-row { display: grid; grid-template-columns: minmax(0, 2.4fr) repeat(4, minmax(0, 1fr)); align-items: center; gap: 12px; padding: 15px 0; border-top: 1px solid var(--hair); font-size: 17px; }
.src-row > :not(:first-child) { text-align: right; }
.src-row small { display: block; font-size: 12px; line-height: 1.35; letter-spacing: -0.005em; color: var(--ink-3); }
.ap-hours { margin-top: clamp(28px, 4vw, 44px); padding: 18px 8px; list-style: none; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); border-radius: var(--radius); background: var(--card); }
.ap-hour { display: grid; justify-items: center; gap: 4px; padding: 2px 4px; text-align: center; }
.ap-hour + .ap-hour { border-left: 1px solid var(--hair); }
.ap-t { font-size: 13px; color: var(--ink-3); }
.ap-hour b { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.ap-hour small { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.ap-rain { min-height: 1.3em; font-size: 13px; font-weight: 600; color: var(--ic-rain); }
.ap-table .src-row { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) minmax(0, 1.3fr); }
.ap-weight { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.ap-weight i { width: 64px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--link) var(--w), var(--track) var(--w)); }
.src-head { border-top: 0; padding: 0 0 10px; font-size: 12px; letter-spacing: -0.005em; color: var(--ink-3); }
.src-name { display: flex; align-items: center; gap: 14px; min-width: 0; }
.src-name a, .src-name b { font-weight: 600; color: var(--ink); }
.src-name a:hover { color: var(--link); text-decoration: none; }
.src-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.src-dot.is-consensus { background: var(--ink); }
.src-consensus { font-weight: 600; }
.src-consensus small { font-weight: 400; }
.is-down { color: var(--ink-3); }
.is-down .src-dot { opacity: 0.35; }

/* ---------- palco 3D ---------- */

.stage {
  width: min(var(--wide), 100% - 2 * var(--gutter)); margin: clamp(28px, 4vw, 48px) auto 0; padding: 16px 0 20px; overflow: hidden;
  border-radius: var(--radius-lg); background: var(--stage, #0b0b0d); color: #f5f5f7; --focus: #2997ff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 24px 60px -30px rgba(0, 0, 0, 0.4);
}
.controls { padding: 0 16px; display: flex; flex-wrap: wrap; gap: 8px; }

/* câmaras em direto: o mesmo cartão escuro do gráfico, com o vídeo inteiro e sem nada por cima */
.cam { padding-bottom: 0; }
.cam-frame { margin-top: 14px; aspect-ratio: 16 / 9; background: #000; }
.cam-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.cam-note { padding: 12px 20px 16px; font-size: 12px; line-height: 1.5; color: #a1a1a6; }
.cam-note a { color: #2997ff; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); }
.seg button { padding: 7px 16px; border: 0; border-radius: 999px; background: none; font-size: 14px; color: #f5f5f7; cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.seg button[aria-pressed="true"] { background: #f5f5f7; color: #1d1d1f; font-weight: 500; }
.seg button:not([aria-pressed="true"]):hover { background: rgba(255, 255, 255, 0.1); }

.c3 { position: relative; width: 100%; height: clamp(380px, 40vw, 520px); margin: -8px auto 0; overflow: hidden; }
#c3-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; outline-offset: -4px; }
#c3-canvas.is-dragging { cursor: grabbing; }
.c3-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.c3-label { position: absolute; left: 0; top: 0; font-size: 12px; line-height: 1; letter-spacing: 0; white-space: nowrap; color: rgba(245, 245, 247, 0.5); will-change: transform; }
.c3-x { translate: -50% 4px; }
.c3-major { color: rgba(245, 245, 247, 0.9); font-weight: 600; }
.c3-y { translate: -100% -50%; }
.c3-row { translate: 0 -50%; color: rgba(245, 245, 247, 0.86); font-size: 13px; }
.c3-tip {
  position: absolute; left: 0; top: 0; z-index: 2; min-width: 190px; padding: 12px 14px;
  border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(34, 34, 36, 0.78);
  -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
  font-size: 13px; line-height: 1.3; pointer-events: none;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.c3-tip-head { margin-bottom: 8px; font-size: 12px; color: #a1a1a6; }
.c3-tip-row { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; padding: 2px 0; }
.c3-tip-row i { width: 12px; height: 3px; border-radius: 2px; }
.c3-tip-row span { color: #c7c7cc; }
.c3-tip-row b { font-weight: 600; color: #fff; }
.c3-tip-row.is-summary { margin-bottom: 5px; padding-bottom: 7px; border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
.c3-tip-row.is-summary span { color: #fff; }
.c3-fallback { display: none; position: absolute; inset: 0; place-content: center; padding: var(--gutter); text-align: center; color: #a1a1a6; }
.no-webgl .c3-fallback { display: grid; }
.no-webgl canvas { display: none; }

.legend { min-height: 36px; margin-top: 4px; padding: 0 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px; background: none; font-size: 13px; color: #f5f5f7; cursor: pointer; transition: opacity 0.2s, background-color 0.2s; }
.chip:hover { background: rgba(255, 255, 255, 0.08); }
.chip i { width: 14px; height: 4px; border-radius: 2px; }
.chip[aria-pressed="false"] { opacity: 0.42; text-decoration: line-through; }
.scale { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #a1a1a6; }
.scale i { width: min(280px, 46vw); height: 6px; border-radius: 3px; }

/* ---------- Lisboa em 3D ---------- */

.l3 {
  --map-ink: #1d1d1f; --map-halo: rgba(255, 255, 255, 0.92);
  --map-chip: #ffffff; --map-chip-ink: #1d1d1f;
  --glass: rgba(255, 255, 255, 0.72); --glass-on: #ffffff; --glass-ink: #1d1d1f; --glass-line: rgba(0, 0, 0, 0.06);
  position: relative; width: min(var(--wide), 100% - 2 * var(--gutter)); height: clamp(460px, 54vw, 720px);
  margin: clamp(28px, 4vw, 48px) auto 0; overflow: hidden; border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #dbe8f4 0%, #eef1f4 62%, #f4f3f0 100%);
  box-shadow: 0 1px 0 var(--hair), 0 24px 60px -30px rgba(0, 0, 0, 0.25);
}
.l3[data-skin="dark"] {
  --map-ink: #f5f5f7; --map-halo: rgba(0, 0, 0, 0.9);
  --map-chip: rgba(84, 84, 88, 0.94); --map-chip-ink: #ffffff;
  --glass: rgba(50, 50, 54, 0.72); --glass-on: #75757a; --glass-ink: #ffffff; --glass-line: rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, #262b35 0%, #181a1f 58%, #111113 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

#l3-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; outline-offset: -6px; border-radius: 28px; }
#l3-canvas.is-dragging { cursor: grabbing; }
.l3-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.l3-label {
  position: absolute; left: 0; top: 0; translate: -50% -100%;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; line-height: 1; letter-spacing: -0.005em; white-space: nowrap; color: var(--map-ink);
  text-shadow: 0 0 2px var(--map-halo), 0 0 5px var(--map-halo), 0 0 9px var(--map-halo); will-change: transform;
}
.l3-label b { font-weight: 600; }
.l3-label span {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 8px;
  background: var(--map-chip); color: var(--map-chip-ink); font-weight: 600; text-shadow: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14), 0 3px 10px rgba(0, 0, 0, 0.12);
}
.l3-label svg { width: 8px; height: 10px; fill: currentColor; }
.l3-label.is-wet span, .l3-label.is-sea span { background: #0a84ff; color: #ffffff; }
.l3-label.is-minor { font-size: 11px; }
.l3-label.is-minor b { font-weight: 500; }
.l3-label.is-minor span { height: 20px; padding: 0 6px; border-radius: 7px; }
.l3-label.is-north { translate: -50% -50%; font-size: 12px; opacity: 0.55; }
/* o Tejo: só letra, sobre a água, sem pastilha */
.l3-label.is-river { flex-direction: column-reverse; gap: 3px; translate: -50% -50%; color: #ffffff; text-shadow: 0 1px 2px rgba(0, 40, 80, 0.75), 0 0 6px rgba(0, 40, 80, 0.55), 0 0 14px rgba(0, 40, 80, 0.3); }
.l3-label.is-river b { font-size: 12px; font-weight: 600; font-style: italic; letter-spacing: 0.06em; opacity: 0.95; }
.l3-label.is-river span {
  display: block; height: auto; padding: 0; border-radius: 0; background: none; box-shadow: none; color: inherit; text-shadow: inherit;
  font-size: 11px; font-weight: 600; line-height: 1.3; text-align: center; white-space: pre-line; opacity: 0.95;
}
.l3[data-view="regiao"] .in-cidade, .l3[data-view="cidade"] .in-regiao { display: none; }
/* na cidade os nomes aparecem por camadas: os bairros grandes sempre, os outros ao chegar perto */
.l3[data-near="0"] .in-cidade.is-minor, .l3:not([data-near="2"]) .in-cidade.is-fine { display: none; }
.l3-label.is-link { pointer-events: auto; cursor: pointer; -webkit-user-select: none; user-select: none; }
.l3-label.is-link:hover b { text-decoration: underline; text-underline-offset: 2px; }

.seg-glass { background: var(--glass); border: 1px solid var(--glass-line); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); }
.seg-glass button { color: var(--glass-ink); padding: 7px 16px; }
.seg-glass button[aria-pressed="true"] { background: var(--glass-on); color: var(--glass-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16); }
.seg-glass button:not([aria-pressed="true"]):hover { background: var(--glass-line); }
.l3-view { position: absolute; top: 16px; left: 16px; }
.l3-zoom {
  position: absolute; top: 16px; right: 16px; display: flex; flex-direction: column; overflow: hidden; border-radius: 12px;
  background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
}
.l3-zoom button { width: 40px; height: 40px; display: grid; place-items: center; color: var(--glass-ink); background: none; border: 0; cursor: pointer; }
.l3-zoom button + button { border-top: 1px solid var(--glass-line); }
.l3-zoom button:hover:not(:disabled) { background: var(--glass-line); }
.l3-zoom button:disabled { opacity: 0.32; cursor: default; }
.l3-zoom button:focus-visible { outline-offset: -4px; border-radius: 10px; }
.l3-zoom svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.layers { position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; flex-wrap: wrap; gap: 8px; pointer-events: none; }
.chip-layer {
  pointer-events: auto; padding: 8px 14px; gap: 8px; font-size: 13px; color: var(--glass-ink);
  background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
}
.chip-layer:hover { background: var(--glass); }
/* a marca de cada camada imita o que se vê no mapa: risco deitado para o vento, risco a cair para a chuva */
.chip-layer .chip-mark { display: none; width: 16px; height: 12px; border-radius: 0; background: none; position: relative; }
.chip-layer[data-key="wind"] .chip-mark, .chip-layer[data-key="rain"] .chip-mark { display: block; }
.chip-layer[data-key="wind"] .chip-mark::before { content: ""; position: absolute; left: 0; top: 1px; width: 16px; height: 10px; background: currentColor; clip-path: polygon(100% 50%, 55% 0, 68% 42%, 0 50%, 68% 58%, 55% 100%); opacity: 0.8; }
.chip-layer[data-key="rain"] .chip-mark::before, .chip-layer[data-key="rain"] .chip-mark::after { content: ""; position: absolute; top: 0; width: 2px; height: 12px; border-radius: 1px; background: #1d6fe3; transform: rotate(14deg); }
.chip-layer[data-key="rain"] .chip-mark::before { left: 4px; }
.chip-layer[data-key="rain"] .chip-mark::after { left: 10px; }
.l3[data-skin="dark"] .chip-layer[data-key="rain"] .chip-mark::before, .l3[data-skin="dark"] .chip-layer[data-key="rain"] .chip-mark::after { background: #7fbfff; }
.chip-layer b { font-weight: 600; }
.chip-layer span { color: var(--glass-ink); opacity: 0.62; }
.chip-layer[aria-pressed="false"] { opacity: 0.5; text-decoration: none; }

/* ---------- mapa do tempo ---------- */

.wm {
  --glass: rgba(40, 42, 48, 0.66); --glass-on: #7a7c82; --glass-ink: #ffffff; --glass-line: rgba(255, 255, 255, 0.12);
  position: relative; width: min(var(--wide), 100% - 2 * var(--gutter)); height: clamp(460px, 54vw, 720px);
  margin: clamp(28px, 4vw, 48px) auto 0; overflow: hidden; border-radius: var(--radius-lg); background: #0d1826; color: #fff;
  box-shadow: 0 0 0 1px var(--hair), 0 24px 60px -30px rgba(0, 0, 0, 0.4);
}
.wm canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.wm-field { image-rendering: auto; }
.wm-wind { cursor: crosshair; touch-action: pan-y; }
.wm-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.wm-label {
  position: absolute; left: 0; top: 0; translate: -50% -50%; display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; line-height: 1; white-space: nowrap; color: #fff;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.9), 0 0 5px rgba(0, 0, 0, 0.75), 0 1px 8px rgba(0, 0, 0, 0.6); will-change: transform;
}
.wm-label[hidden], .wm-tip[hidden] { display: none; }
.wm-label b { font-size: 13px; font-weight: 700; }
.wm-label span { font-weight: 500; opacity: 0.92; }
.wm-label.is-minor { font-size: 11px; }
.wm-label.is-minor b { font-size: 12px; font-weight: 600; }
.wm-top { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none; }
.wm-top .seg { pointer-events: auto; max-width: 100%; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.wm-top .seg::-webkit-scrollbar { display: none; }
.wm-top .seg button { white-space: nowrap; padding: 7px 14px; font-size: 13px; }
.wm-view { flex: none; }
.wm-bottom { position: absolute; left: 16px; bottom: 16px; width: min(400px, 100% - 32px); display: grid; gap: 8px; pointer-events: none; }
.wm-legend, .wm-time {
  pointer-events: auto; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
}
.wm-legend { padding: 10px 14px 22px; font-size: 11px; }
.wm-legend b { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 600; }
.wm-legend i { display: block; height: 6px; border-radius: 3px; }
.wm-legend div { position: relative; height: 0; }
.wm-legend div span { position: absolute; top: 5px; translate: -50% 0; white-space: nowrap; opacity: 0.72; }
.wm-time { display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; }
.wm-play { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #fff; cursor: pointer; position: relative; }
.wm-play::before { content: ""; position: absolute; left: 13px; top: 10px; border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent #1d1d1f; }
.wm-play[aria-pressed="true"]::before { left: 11px; top: 11px; width: 4px; height: 12px; border: 0; border-left: 4px solid #1d1d1f; border-right: 4px solid #1d1d1f; }
.wm-range { flex: 1; min-width: 0; height: 28px; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
.wm-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.28); }
.wm-range::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.28); }
.wm-range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.wm-range::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.wm-when { flex: none; min-width: 84px; text-align: right; font-size: 13px; font-weight: 600; }
.wm-when::first-letter { text-transform: uppercase; }
.wm-tip {
  position: absolute; left: 0; top: 0; z-index: 2; display: grid; gap: 2px; padding: 8px 12px; border-radius: 12px; pointer-events: none;
  background: rgba(28, 28, 30, 0.82); border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); font-size: 12px; white-space: nowrap;
}
.wm-tip b { font-size: 15px; font-weight: 600; }
.wm-tip span { color: #c7c7cc; }
.wm-status { position: absolute; inset: 0; display: grid; place-content: center; padding: var(--gutter); text-align: center; font-size: 15px; color: #a1a1a6; pointer-events: none; }
.wm-status:empty { display: none; }
.wm.is-ready .wm-status { inset: 62px 0 auto 0; font-size: 13px; }
.wm:not(.is-ready) .wm-top, .wm:not(.is-ready) .wm-bottom { visibility: hidden; }

/* ---------- semana ---------- */

.bento { margin-top: clamp(36px, 5vw, 56px); display: grid; gap: 16px; }
.week { padding: 6px 22px; border-radius: var(--radius); background: var(--card); }
/* Em ecrãs largos a semana fica à esquerda e os cartões arrumam-se à direita, numa grelha de cinco colunas iguais. */
@media (min-width: 1021px) {
  .bento { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: minmax(172px, auto); }
  .bento .cards { display: contents; }
  .bento .week { grid-column: 1 / span 2; grid-row: 1 / span 3; display: flex; flex-direction: column; padding: 4px 20px; }
  .bento .day { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; }
  .bento .day summary { grid-template-columns: minmax(64px, 1fr) 44px 34px minmax(48px, 1.4fr) 34px 12px; gap: 8px; font-size: 17px; }
  .bento .card { min-height: 0; padding: 18px 20px 20px; }
  .bento .card-big { font-size: 40px; }
  .bento .card-note { font-size: 14px; }
  .bento .card-warn { grid-column: 1 / span 2; grid-row: 4; }
  .bento .sea-body .card-big { font-size: 34px; }
  .bento .wind-compass { width: 112px; }
}
.day + .day { border-top: 1px solid var(--hair); }
.day summary { display: grid; grid-template-columns: minmax(74px, 1.1fr) 62px 40px minmax(60px, 2.4fr) 40px 14px; align-items: center; gap: 10px; padding: 14px 0; font-size: 19px; font-weight: 500; cursor: pointer; list-style: none; border-radius: 10px; }
.day summary::-webkit-details-marker { display: none; }
.day-icon { display: grid; justify-items: center; }
.day-icon .ic { display: block; width: 28px; height: 28px; }
.day-icon small { font-size: 11px; font-weight: 600; line-height: 1.1; color: var(--ic-rain); }
.day-min { text-align: right; color: var(--ink-3); }
.day-max { text-align: left; }
.range { position: relative; height: 6px; border-radius: 99px; background: var(--track); }
.range i { position: absolute; top: 0; bottom: 0; border-radius: 99px; }
.range-spread { background: var(--spread); }
.range-fill { left: 0; right: 0; }
.range-now { width: 10px; top: -2px !important; bottom: -2px !important; margin-left: -5px; background: #fff; border: 2px solid var(--card); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); }
.day-chev { width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg) translate(-2px, -2px); transition: transform 0.25s; }
.day[open] .day-chev { transform: rotate(225deg) translate(-2px, -2px); }
.day-detail { padding: 2px 0 18px; }
.day-src { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 10px; padding: 7px 0; font-size: 15px; color: var(--ink-2); }
.day-src > :not(:first-child) { text-align: right; }
.day-src > :first-child { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.day-src-head { font-size: 12px; color: var(--ink-3); }
.day-src-head > :first-child { color: var(--ink-3); }

/* ---------- detalhes ---------- */

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.card { min-height: 190px; padding: 22px 24px 24px; display: flex; flex-direction: column; border-radius: var(--radius); background: var(--card); }
.card-wide { grid-column: span 2; }
.card-full { grid-column: 1 / -1; min-height: 0; }
.card h3 { font-size: 13px; font-weight: 600; letter-spacing: -0.005em; color: var(--ink-3); }
.card-big { margin-top: 10px; font-size: clamp(38px, 4.4vw, 52px); font-weight: 600; line-height: 1.05; letter-spacing: -0.035em; }
.card-big small { margin-left: 5px; font-size: 0.4em; font-weight: 500; letter-spacing: -0.01em; color: var(--ink-2); }
.card-note { margin-top: 8px; font-size: 15px; line-height: 1.35; color: var(--ink-2); }
.card-note:empty { display: none; }
.meter { position: relative; height: 6px; margin-top: auto; border-radius: 99px; }
.meter i { position: absolute; top: -3px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #fff; border: 2px solid var(--card); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28); }
.card .meter { margin-top: auto; }
.card-note:has(+ .meter) { margin-bottom: 18px; }

.wind-body, .sun-body { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wind-compass { flex: none; width: clamp(104px, 13vw, 132px); }
.compass { display: block; width: 100%; }
.cmp-ring { fill: none; stroke: var(--hair); stroke-width: 1.5; }
.cmp-tick { stroke: var(--ink-3); stroke-width: 1; opacity: 0.6; }
.cmp-tick.is-major { stroke-width: 1.6; opacity: 1; }
.compass text { font: 600 11px var(--font); fill: var(--ink-3); text-anchor: middle; }
.compass .cmp-n { fill: var(--ink); }
.cmp-arrow { fill: var(--ink); }
.cmp-tail { fill: var(--card); stroke: var(--ink); stroke-width: 3; }
.sun-arc { flex: 1; max-width: 240px; min-width: 120px; }
.sunarc { display: block; width: 100%; overflow: visible; }
.sun-path { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 3 5; stroke-linecap: round; }
.sun-horizon { stroke: var(--hair); stroke-width: 1.5; }
.sun-dot { fill: var(--ic-sun); stroke: var(--card); stroke-width: 3; }
.sea-body { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: center; }
.sea-body .card-big { font-size: clamp(30px, 3.4vw, 42px); }
.sea-body .card-note { margin-top: 4px; font-size: 13px; }

.warns { margin-top: 12px; display: grid; gap: 10px; }
.warn { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 15px; color: var(--ink-2); }
.warn b { color: var(--ink); }
.warn-level { font-weight: 600; }
.warn-level::before { content: "▲ "; }
.warn-yellow .warn-level { color: var(--warn-yellow); }
.warn-orange .warn-level { color: var(--warn-orange); }
.warn-red .warn-level { color: var(--warn-red); }

/* ---------- rodapé ---------- */

.foot { padding: clamp(48px, 6vw, 72px) 0 calc(40px + env(safe-area-inset-bottom)); background: var(--paper-alt); font-size: 12px; line-height: 1.5; letter-spacing: -0.005em; color: var(--ink-3); border-top: 1px solid var(--hair); }
.foot-title { font-size: 21px; line-height: 1.2; letter-spacing: -0.012em; color: var(--ink); }
.notes { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 40px; }
.notes b { font-weight: 600; color: var(--ink-2); }
.foot-legal { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--hair); display: grid; gap: 9px; }
.foot-legal p { max-width: 76em; }

/* ---------- ecrãs pequenos ---------- */

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 734px) {
  .hero { min-height: calc(max(600px, 100svh) + var(--fade) - 28px); }
  .hero-copy { padding-bottom: 20px; }
  .hero-now { gap: 14px; }
  .facts { grid-template-columns: 1fr; }
  .fact { padding: 18px 0; grid-template-columns: minmax(96px, auto) 1fr; align-items: center; justify-items: start; text-align: left; gap: 16px; }
  .fact + .fact { border-left: 0; border-top: 1px solid var(--hair); }
  .notes { grid-template-columns: 1fr; }
  .stage { width: calc(100% - 24px); border-radius: 22px; }
  .fact strong { font-size: 32px; }
  .src-row { grid-template-columns: minmax(0, 1.4fr) 0.8fr 1fr 0.8fr 0.7fr; gap: 6px; font-size: 14px; }
  .src-name { gap: 9px; }
  .src-name small { display: none; }
  .src-consensus .src-name small { display: none; }
  .src-dot { width: 8px; height: 8px; }
  .ap-hours { grid-template-columns: repeat(8, 64px); overflow-x: auto; scrollbar-width: none; padding: 14px 4px; }
  .ap-hour b { font-size: 20px; }
  .ap-hour small { white-space: normal; font-size: 11px; line-height: 1.25; }
  .ap-table .src-row { grid-template-columns: minmax(0, 1.4fr) 0.9fr 0.8fr 0.8fr 0.9fr; }
  .ap-weight i { display: none; }
  .ap-table .src-row > :nth-child(4) small { display: none; }
  .c3 { height: 400px; }
  .wm { width: calc(100% - 24px); height: 540px; border-radius: 22px; }
  .wm-top { top: 12px; left: 12px; right: 12px; flex-direction: column; }
  .wm-bottom { left: 12px; bottom: 12px; width: calc(100% - 24px); }
  .wm-label.is-minor { display: none; }
  .l3 { width: calc(100% - 24px); height: 500px; border-radius: 22px; }
  #l3-canvas { border-radius: 22px; }
  .l3-label.in-regiao.is-minor, .l3[data-near="0"] .in-cidade.is-wide { display: none; }
  .l3-view { top: 12px; left: 12px; }
  .l3-zoom { top: 12px; right: 12px; }
  .layers { left: 12px; right: 12px; bottom: 12px; gap: 6px; }
  .chip-layer { padding: 7px 11px; font-size: 12px; }
  .c3-label { font-size: 11px; }
  .seg button { padding: 8px 14px; }
  .week { padding: 4px 16px; }
  .day summary { grid-template-columns: 76px 44px 34px minmax(40px, 1fr) 34px 12px; gap: 8px; font-size: 17px; }
  .card { min-height: 164px; padding: 18px 18px 20px; }
  .card-note { font-size: 14px; }
  .wind-compass { width: 108px; }
}
@media (max-width: 380px) {
  .hour { flex-basis: 52px; }
  .src-row { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-delay: 0s !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- local ---------- */
/* O nome do sítio, na barra e no topo, abre a pesquisa de locais. */

[hidden] { display: none !important; }
.nav-place {
  display: inline-flex; align-items: center; gap: 5px; height: 34px; max-width: 190px; padding: 0 12px 0 9px;
  border: 0; border-radius: 999px; background: var(--nav-pill); color: inherit; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.nav-place span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-place svg { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.nav-place:hover { background: color-mix(in srgb, currentColor 22%, transparent); }
@media (max-width: 480px) { .nav-place { max-width: 120px; } .brand span { display: none; } }


/* ---------- listas das preferências (unidades, tema, fontes) ---------- */

.pop {
  position: fixed; inset: auto; margin: 0; width: min(380px, 100vw - 24px); max-height: min(600px, 100vh - 90px); overflow: hidden;
  padding: 16px 16px 12px; border: 1px solid var(--hair); border-radius: 22px; color: var(--ink);
  font-family: var(--font); letter-spacing: -0.012em; text-transform: none;
  /* o mesmo vidro das cápsulas da barra, um pouco mais espesso para a lista se ler sobre o céu ou um padrão */
  background: color-mix(in srgb, var(--card) 84%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 24px 60px -20px rgba(0, 0, 0, 0.45);
}
.pop-list label:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.pop-sm { width: min(280px, 100vw - 24px); }
.pop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pop-head h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.015em; background: none; color: var(--ink); }
.pop-head h2::before, .pop-head h2::after { content: none; }
.pop-link { padding: 0; border: 0; background: none; color: var(--link); font: inherit; font-size: 14px; cursor: pointer; }
.pop-note { margin-top: 6px; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
/* a lista é que desliza, por dentro da cápsula: a barra fica longe dos cantos redondos e o título não foge.
   (display só quando aberta: um display posto à mão mostraria também as listas fechadas) */
.pop:popover-open { display: flex; flex-direction: column; }
.pop-list {
  flex: 1 1 auto; min-height: 0; margin: 10px -6px 0; padding-right: 2px; overflow-y: auto; overscroll-behavior: contain;
  /* as linhas desvanecem nas pontas em vez de serem cortadas a direito */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 10px, #000 calc(100% - 14px), transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 10px, #000 calc(100% - 14px), transparent);
}
.pop-list label { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 12px; cursor: pointer; }
.pop-list input { width: 18px; height: 18px; margin: 0; accent-color: var(--link); cursor: pointer; }
.pop-list input:disabled { cursor: not-allowed; }
.pop-list input[type="checkbox"]:not(:checked) ~ :is(span, .src-dot) { opacity: 0.45; }
.pop-list b { display: block; font-size: 15px; font-weight: 600; }
.pop-list small { display: block; font-size: 12px; line-height: 1.35; color: var(--ink-3); }
.pop-msg { margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.pop-msg:empty { display: none; }

.hero-place {
  padding: 0 2px; margin: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: rgba(255, 255, 255, 0.45);
}
.hero-place:hover { text-decoration-color: currentColor; }

.picker {
  width: min(520px, 100% - 24px); max-height: min(640px, 100% - 48px); margin: max(72px, 10vh) auto auto; padding: 0;
  border: 1px solid var(--hair); border-radius: var(--radius-lg); background: var(--card); color: var(--ink);
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.5);
}
.picker::backdrop { background: rgba(0, 0, 0, 0.36); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.picker[open] { animation: picker-in 0.22s ease-out; }
@keyframes picker-in { from { opacity: 0; translate: 0 8px; } }
@media (prefers-reduced-motion: reduce) { .picker[open] { animation: none; } }
.picker-in { display: grid; gap: 12px; padding: 18px 18px 14px; }
.picker-head { display: flex; align-items: center; justify-content: space-between; }
.picker-head h2 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.picker-close { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--track); color: var(--ink-2); cursor: pointer; }
.picker-close svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.picker-search { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border-radius: 14px; background: var(--track); }
.picker-search svg { flex: none; width: 17px; height: 17px; fill: none; stroke: var(--ink-3); stroke-width: 1.6; stroke-linecap: round; }
.picker-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: inherit; font: inherit; font-size: 17px; outline: none; }
.picker-search:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 45%, transparent); }
.picker-here { justify-self: start; display: inline-flex; align-items: center; gap: 7px; padding: 6px 2px; border: 0; background: none; color: var(--link); font: inherit; font-size: 15px; cursor: pointer; }
.picker-here svg { width: 15px; height: 15px; fill: currentColor; }
.picker-here[disabled] { color: var(--ink-3); cursor: default; }
.picker-msg { margin: 0; font-size: 14px; color: var(--ink-2); }
.picker-msg:empty { display: none; }
.picker-list { list-style: none; margin: 0 -8px; padding: 0; overflow-y: auto; max-height: 380px; }
.picker-list .picker-group { padding: 10px 10px 4px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.picker-list a { display: grid; gap: 1px; padding: 10px; border-radius: 12px; color: var(--ink); }
.picker-list a:hover, .picker-list a:focus-visible { background: var(--track); text-decoration: none; }
.picker-list b { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.picker-list small { font-size: 13px; color: var(--ink-2); }
.pop-unit { display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; color: var(--ink-2); background: var(--track); box-shadow: none; }

/* ---------- barras de deslocamento ---------- */
/* Finas, redondas e meio transparentes, na cor do texto de cada tema, em vez das cinzentas do sistema.
   Chrome e Firefox leem as propriedades normais; o Safari só percebe as ::-webkit-scrollbar. */

:root { --scroll: color-mix(in srgb, var(--ink) 26%, transparent); --scroll-on: color-mix(in srgb, var(--ink) 42%, transparent); }
html, .pop-list, .picker-list { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
:is(html, .pop-list, .picker-list):hover { scrollbar-color: var(--scroll-on) transparent; }

::-webkit-scrollbar { width: 12px; height: 12px; background: transparent; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-corner { background: transparent; }
/* a borda transparente deixa a barra mais fina do que a área onde se pega, e afastada da margem */
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: var(--scroll) padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-on); }
/* nas listas de cantos redondos a barra não chega aos cantos */
:is(.pop-list, .picker-list)::-webkit-scrollbar-track { margin-block: 8px; }


/* ---------- preferências num só painel ---------- */
.pref-all { gap: 8px; padding: 0 12px 0 9px; }
.pref-all span { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }

.pop-prefs { width: min(392px, 100vw - 24px); max-height: min(780px, 100vh - 80px); padding-bottom: 0; }
.pop-prefs .pp-row { margin-top: 16px; }
/* com um só botão as preferências cabem na barra de cima também nos telefones: só a amostra e o ícone */
@media (max-width: 600px) {
  .nav-prefs { height: 50px; padding: 0 6px; border-radius: 26px; }
  #pref-all-label { display: none; }
  .pref-all { height: 38px; padding: 0 10px 0 8px; }
  html { scroll-padding-top: 76px; }
}
.pp-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 4px -16px 0; padding: 0 16px 16px; scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
.pp-sec { margin-top: 16px; }
.pp-title { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.01em; color: var(--ink-3); text-transform: none; background: none; }

/* língua: pastilhas com o nome de cada língua na própria língua */
.pp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-chip {
  padding: 7px 13px; border: 1px solid var(--hair); border-radius: 999px; background: none; color: var(--ink);
  font: inherit; font-size: 14px; cursor: pointer; transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.pp-chip:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.pp-chip[aria-checked="true"] { background: var(--ink); color: var(--card); border-color: transparent; font-weight: 500; }

/* unidades: um interruptor de duas posições */
.pp-seg { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 3px; padding: 3px; border-radius: 13px; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.pp-seg button {
  display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 9px 8px; border: 0; border-radius: 10px;
  background: none; color: var(--ink); font: inherit; cursor: pointer; transition: background-color 0.15s, box-shadow 0.15s;
}
.pp-seg b { font-size: 15px; font-weight: 600; }
.pp-seg span { font-size: 12px; color: var(--ink-3); }
.pp-seg button[aria-checked="true"] { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16), 0 0 0 1px var(--hair); }

/* tema: uma grelha de amostras redondas, com o nome por baixo */
.pp-themes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 6px; }
.pp-theme { display: grid; justify-items: center; gap: 6px; padding: 4px 0; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 11.5px; line-height: 1.2; text-align: center; cursor: pointer; }
.pp-theme i {
  width: 42px; height: 42px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); transition: transform 0.15s, box-shadow 0.15s;
}
.pp-theme:hover i { transform: scale(1.06); }
.pp-theme[aria-checked="true"] { color: var(--ink); font-weight: 600; }
.pp-theme[aria-checked="true"] i { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), 0 0 0 2.5px var(--card), 0 0 0 4.5px var(--link); }

/* fontes: uma linha que abre a lista completa */
.pp-row {
  width: 100%; margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 0; border-radius: 14px; background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.pp-row:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.pp-row b { display: block; font-size: 15px; font-weight: 600; }
.pp-row small { display: block; font-size: 12px; color: var(--ink-3); }
.pp-arrow { width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-top: 2px solid var(--ink-3); transform: rotate(45deg); }



/* ---------- faixa do topo: por hora ou por dia ---------- */
.hours-mode {
  width: max-content; margin: 0 auto 10px; display: flex; gap: 2px; padding: 3px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.13); border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(28px) saturate(160%); backdrop-filter: blur(28px) saturate(160%);
}
.hours-mode button { padding: 6px 14px; border: 0; border-radius: 999px; background: none; color: #fff; font: inherit; font-size: 13px; font-weight: 500; opacity: 0.86; cursor: pointer; transition: background-color 0.2s, color 0.2s, opacity 0.2s; }
.hours-mode button:hover { opacity: 1; }
.hours-mode button[aria-pressed="true"] { background: #fff; color: #1d1d1f; opacity: 1; }
.is-loading .hours-mode, .is-error .hours-mode { visibility: hidden; }
/* sete dias: as células repartem a largura toda, com a máxima em cima e a mínima por baixo, mais clara */
.hours.is-days { justify-content: space-between; }
.hours.is-days .hour-day { flex: 1 1 0; min-width: 64px; }
.hour-day .hour-v { white-space: nowrap; }
/* a mínima ao lado da máxima, na mesma linha: as duas vistas da faixa ficam exatamente com a mesma altura */
.hour-day .hour-v small { margin-left: 6px; font-size: inherit; font-weight: 400; opacity: 0.6; }

@media (max-width: 600px) {
  /* no telefone os sete dias cabem todos, sem deslizar */
  .hours.is-days { padding-inline: 4px; gap: 0; }
  .hours.is-days .hour-day { min-width: 0; }
  .hours.is-days .hour-t { font-size: 12px; }
  .hours.is-days .hour-v { font-size: 14px; }
  .hours.is-days .hour-v small { margin-left: 3px; }
}
.day[data-closing] .day-chev { transform: rotate(45deg) translate(-2px, -2px); }

/* ---------- câmaras em direto: um cartão do tema, com o vídeo embutido ---------- */
/* o id ganha às regras dos temas para o palco escuro do gráfico, que usa a mesma classe .stage */
#direto .cam {
  padding: 12px; background: var(--card); color: var(--ink);
  border: 1px solid var(--hair); box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.35);
}
#direto .cam .controls { padding: 2px 2px 0; }
#direto .cam .seg { background: color-mix(in srgb, var(--ink) 7%, transparent); }
#direto .cam .seg button { color: var(--ink); }
#direto .cam .seg button:not([aria-pressed="true"]):hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
#direto .cam .seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16), 0 0 0 1px var(--hair); }
#direto .cam-frame { margin-top: 12px; border-radius: max(6px, calc(var(--radius-lg) - 12px)); overflow: hidden; background: #000; }
#direto .cam-note { padding: 12px 6px 4px; color: var(--ink-2); }
#direto .cam-note a { color: var(--link); }


/* ---------- movimento ---------- */
/* Curvas: uma que trava suave (quase tudo) e uma com um pouco de mola (o realce dos interruptores). */
:root { --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1); --ease-spring: cubic-bezier(0.34, 1.32, 0.64, 1); }

/* interruptores: a peça de trás desliza até à opção escolhida; o botão em si fica transparente */
.seg-thumb {
  position: absolute; z-index: 0; top: 0; left: 0; pointer-events: none;
  transition: transform 0.42s var(--ease-spring), width 0.42s var(--ease-spring), height 0.3s var(--ease-out), background-color 0.3s, box-shadow 0.3s;
}
[data-thumb] { isolation: isolate; }
[data-thumb] > button { position: relative; z-index: 1; }
.has-thumb > button[aria-pressed="true"], .has-thumb > button[aria-checked="true"] { background: transparent !important; box-shadow: none !important; }
.thumb-measure > button { transition: none !important; }

/* faixa do topo: ao trocar de vista as células saem e as novas entram em cascata */
.hours > li { animation: strip-in 0.55s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 24ms); }
@keyframes strip-in { from { opacity: 0; translate: 0 12px; scale: 0.92; filter: blur(5px); } }
.hours.is-leaving > li { animation: strip-out 0.17s ease-in both; animation-delay: calc(var(--i, 0) * 8ms); }
@keyframes strip-out { to { opacity: 0; translate: 0 -8px; filter: blur(3px); } }

/* listas e painel: crescem do botão que as abre e desvanecem ao fechar */
.pop {
  transform-origin: top right; opacity: 0; scale: 0.94; translate: 0 -8px;
  transition: opacity 0.2s var(--ease-out), scale 0.28s var(--ease-out), translate 0.28s var(--ease-out), display 0.28s allow-discrete, overlay 0.28s allow-discrete;
}
.pop:popover-open { opacity: 1; scale: 1; translate: 0 0; }
@starting-style { .pop:popover-open { opacity: 0; scale: 0.94; translate: 0 -8px; } }
/* a pesquisa de locais: o cartão sobe e o fundo escurece devagar */
.picker { transition: opacity 0.22s var(--ease-out), translate 0.3s var(--ease-out), display 0.3s allow-discrete, overlay 0.3s allow-discrete; opacity: 0; translate: 0 14px; }
.picker[open] { opacity: 1; translate: 0 0; animation: none; }
@starting-style { .picker[open] { opacity: 0; translate: 0 14px; } }
.picker::backdrop { transition: background-color 0.3s, backdrop-filter 0.3s, display 0.3s allow-discrete, overlay 0.3s allow-discrete; }
@starting-style { .picker[open]::backdrop { background-color: rgba(0, 0, 0, 0); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); } }

/* o topo, quando chega a previsão: a resposta, depois a temperatura, depois a faixa */
html.motion body.hero-in :is(#answer, .hero-sub, .hero-recado, .hero-now, .hero-note, .hours-mode) { animation: rise 0.8s var(--ease-out) both; }
html.motion body.hero-in .hero-sub { animation-delay: 0.08s; }
html.motion body.hero-in .hero-now { animation-delay: 0.16s; }
html.motion body.hero-in .hero-note { animation-delay: 0.24s; }
html.motion body.hero-in .hours-mode { animation-delay: 0.3s; }
@keyframes rise { from { opacity: 0; translate: 0 16px; filter: blur(6px); } }

/* secções: o título sobe, os cartões e as linhas entram em cascata quando a secção chega ao ecrã */
html.motion .band :is(.head, .l3, .wm, .stage, .facts),
html.motion .band :is(#week, #cards, #src-table, #aposta-table) > *,
html.motion .foot .wrap > * {
  transition: opacity 0.8s var(--ease-out), translate 0.8s var(--ease-out);
}
html.motion :is(.band, .foot):not(.is-in) :is(.head, .l3, .wm, .stage, .facts),
html.motion .band:not(.is-in) :is(#week, #cards, #src-table, #aposta-table) > *,
html.motion .foot:not(.is-in) .wrap > * { opacity: 0; translate: 0 22px; }
html.motion .band :is(.l3, .wm, .stage, .facts) { transition-delay: 0.12s; }
html.motion .band :is(#week, #cards, #src-table) > :nth-child(1) { transition-delay: 0.1s; }
html.motion .band :is(#week, #cards, #src-table) > :nth-child(2) { transition-delay: 0.15s; }
html.motion .band :is(#week, #cards, #src-table) > :nth-child(3) { transition-delay: 0.2s; }
html.motion .band :is(#week, #cards, #src-table) > :nth-child(4) { transition-delay: 0.25s; }
html.motion .band :is(#week, #cards, #src-table) > :nth-child(5) { transition-delay: 0.3s; }
html.motion .band :is(#week, #cards, #src-table) > :nth-child(6) { transition-delay: 0.35s; }
html.motion .band :is(#week, #cards, #src-table) > :nth-child(7) { transition-delay: 0.4s; }
html.motion .band :is(#week, #cards, #src-table) > :nth-child(n+8) { transition-delay: 0.45s; }
/* depois de entrarem, as atualizações de dez em dez minutos não voltam a esperar */
html.motion .band.is-done :is(#week, #cards, #src-table) > * { transition-delay: 0s; }
/* as barras da semana crescem do meio para os lados */
html.motion .range-fill { transition: clip-path 1s var(--ease-out) 0.35s; }
html.motion .band:not(.is-in) .range-fill { clip-path: inset(0 50% 0 50% round 99px) !important; }

/* pequenas respostas ao toque */
.card { transition: translate 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out); }
@media (hover: hover) { .card:hover { translate: 0 -2px; } }
:is(.pref, .seg button, .pp-chip, .pp-theme, .chip, .hours-mode button, .nav-place):active { scale: 0.96; }
:is(.pref, .seg button, .pp-chip, .chip, .hours-mode button, .nav-place) { transition: scale 0.15s var(--ease-out), background-color 0.2s, color 0.2s, opacity 0.2s; }

/* tema, unidades e fontes: a página inteira troca num fundido */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.45s; animation-timing-function: var(--ease-out); }

.pp-seg-3 { --n: 3; }
.pp-seg-3 b { font-size: 14px; font-weight: 500; }

/* no computador a faixa do topo ficava encostada ao fundo do primeiro ecrã: sobe um pouco */
@media (min-width: 735px) {
  .hours-wrap { padding-bottom: calc(var(--fade) + clamp(20px, 8vh, 96px) + env(safe-area-inset-bottom)); }
}

/* ---------- para quem navega ---------- */
/* o estado das próximas 24 horas: uma pastilha por baixo do título */
.sail-alert {
  width: fit-content; max-width: 100%; margin: 22px auto 0; display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 12px;
  border-radius: 999px; font-size: 15px; line-height: 1.35; color: var(--ink); text-align: left;
  background: color-mix(in srgb, #34c759 13%, transparent); border: 1px solid color-mix(in srgb, #34c759 35%, transparent);
}
.sail-alert.is-warn { background: color-mix(in srgb, var(--warn-orange) 16%, transparent); border-color: color-mix(in srgb, var(--warn-orange) 50%, transparent); font-weight: 500; border-radius: 18px; }
.sail-alert::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #34c759; box-shadow: 0 0 0 4px color-mix(in srgb, #34c759 22%, transparent); }
.sail-alert.is-warn::before { background: var(--warn-orange); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn-orange) 25%, transparent); }

/* os quadros de agora: sem os enfeites de canto dos estilos de cidade, que aqui só fazem ruído */
#navegar .card { background: var(--card); min-height: 0; }
#navegar .card.sail-table { display: block; padding: 20px 0 14px; translate: none; }
.sail-cards { margin-top: clamp(24px, 3vw, 36px); display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 16px; }
.sail-tile h3 { margin-bottom: 4px; }
.sail-arrow { display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; color: var(--ink-2); }
.sail-arrow svg { width: 100%; height: 100%; fill: currentColor; transition: transform 0.6s var(--ease-out, ease); }

.sail-wind-body { flex: 1; display: flex; align-items: center; gap: clamp(14px, 2vw, 24px); margin-top: 6px; }
.dial-wrap { flex: none; width: clamp(140px, 13vw, 172px); }
.dial { display: block; width: 100%; overflow: visible; }
.dial-face { fill: color-mix(in srgb, var(--wc) 18%, transparent); stroke: color-mix(in srgb, var(--wc) 70%, var(--hair)); stroke-width: 2; }
.dial-tick { stroke: var(--ink-3); stroke-width: 1; opacity: 0.45; }
.dial-tick.is-major { opacity: 0.9; stroke-width: 1.6; }
.dial text { font: 600 11px var(--font); fill: var(--ink-3); text-anchor: middle; }
.dial .dial-n { fill: var(--ink); }
.dial .dial-big { font-size: 40px; letter-spacing: -0.04em; fill: var(--ink); }
.dial .dial-unit { font-size: 12px; font-weight: 500; fill: var(--ink-2); }
.dial-mark { transform-origin: 80px 80px; transition: transform 0.8s var(--ease-out, ease); }
.dial-mark path:first-child { stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.sail-wind-text { min-width: 0; display: grid; gap: 8px; }
.bf b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.bf span { display: block; color: var(--ink-2); font-size: 15px; }
.sail-gust { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.sail-wind .card-note { margin: 0; }

.sail-sea-top { display: flex; align-items: center; gap: 12px; }
.sail-sea-top .sail-arrow { width: 30px; height: 30px; margin-top: 10px; color: var(--link); }
.sail-sea .card-note { margin-top: 4px; }
.sail-sub { margin-top: auto; padding-top: 16px; display: grid; gap: 0; }
.sail-sub li { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; padding: 8px 0; border-top: 1px solid var(--hair); font-size: 14px; }
.sail-sub span { color: var(--ink-2); }
.sail-sub b { font-weight: 600; font-variant-numeric: tabular-nums; }
.sail-sub small { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); }

.tide-wrap { margin: 10px -4px 0; color: var(--link); }
.tide-wrap .tide-svg { width: 100%; height: auto; }
.tide-svg { display: block; overflow: visible; color: var(--link); }
.tide-line { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tide-now { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 3 3; opacity: 0.55; vector-effect: non-scaling-stroke; }
.tide-svg circle { fill: var(--card-fill, var(--paper)); stroke: currentColor; stroke-width: 2; }
.tide-svg .is-high circle { fill: currentColor; }
.tide-svg text { font: 600 10.5px var(--font); fill: var(--ink-2); text-anchor: middle; font-variant-numeric: tabular-nums; }
.tide-svg .sf-night { fill: var(--ink); opacity: 0.045; }
.tide-next { margin-top: auto; padding-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tide-next li { display: grid; gap: 1px; padding: 9px 12px; border-radius: 14px; background: color-mix(in srgb, var(--ink) 5%, transparent); }
.tide-next span { font-size: 12px; color: var(--ink-3); }
.tide-next .is-high span { color: var(--link); }
.tide-next b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tide-next small { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.sail-stats { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; padding: 6px 8px; }
.sail-stat { flex: 1 1 160px; display: grid; align-content: start; gap: 2px; padding: 14px 16px; }
.sail-stat + .sail-stat { border-left: 1px solid var(--hair); }
.sail-stat > span { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.sail-stat b { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sail-stat b i { font-style: normal; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.sail-stat small { font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.sail-stat.is-warn small { color: var(--warn-orange); font-weight: 600; }

/* a previsão: colunas de 3 em 3 horas que deslizam para o lado, com os nomes das linhas fixos à esquerda */
.sail-table { margin-top: 16px; padding: 20px 0 14px; border-radius: var(--radius); background: var(--card); }
.sf-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding: 0 22px 14px; }
.sf-head h3 { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.sf-legend { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--ink-3); }
.sf-scale { display: flex; justify-content: space-between; width: min(300px, 60vw); height: 18px; padding: 0 6px; border-radius: 999px; align-items: center; }
.sf-scale i { font-style: normal; font-size: 10px; font-weight: 600; color: #13202d; opacity: 0.85; }
.sf-scale i:nth-last-child(-n + 3) { color: #fff; }
.sf {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
}
.sf-labs, .sf-cols { display: grid; grid-auto-rows: auto; }
.sf-lab { display: flex; align-items: center; padding: 0 12px 0 22px; font-size: 12px; font-weight: 500; color: var(--ink-3); white-space: nowrap; border-right: 1px solid var(--hair); }
.sf-r-day { height: 30px; } .sf-lab.sf-r-day { border-right: 0; } .sf-r-hour { height: 26px; } .sf-r-wind { height: 62px; } .sf-r-gust { height: 38px; }
.sf-r-wave { height: 52px; } .sf-r-per { height: 28px; } .sf-r-tide { height: 78px; } .sf-r-temp, .sf-r-rain { height: 30px; }
.sf-scroll {
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
}
.sf-scroll.is-drag { cursor: grabbing; user-select: none; }
.sf-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.sf-cols { grid-template-columns: repeat(var(--n), var(--cw)); width: max-content; padding-right: 36px; }
.sf-day { display: flex; align-items: center; border-left: 1px solid var(--hair); font-size: 13px; font-weight: 600; color: var(--ink); }
.sf-day:first-child { border-left: 0; }
.sf-day span { position: sticky; left: 0; padding: 0 8px; white-space: nowrap; }
.sf-c { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink); }
.sf-c.is-night { background: color-mix(in srgb, var(--ink) 4.5%, transparent); }
.sf-hour { font-size: 11.5px; color: var(--ink-3); }
.sf-chip { min-width: 32px; padding: 4px 0; border-radius: 9px; font-size: 14px; font-weight: 650; text-align: center; line-height: 1.15; }
.sf-chip.is-gust { min-width: 28px; padding: 2px 0; font-size: 12.5px; font-weight: 600; border-radius: 7px; opacity: 0.88; }
.sf-chip.is-none { background: none; color: var(--ink-3); }
.sf-wave b { font-weight: 600; font-size: 13px; }
.sf-wave .sail-arrow { color: var(--link); }
.sf-temp { color: var(--ink-2); }
.sf-rain { font-size: 12px; color: var(--ink-3); }
.sf-rain.is-wet { color: color-mix(in srgb, #1f7ae0 80%, var(--ink)); font-weight: 600; background: linear-gradient(to top, color-mix(in srgb, #3b8fe8 calc(var(--wet) * 45%), transparent), transparent); }
.sf-tide { padding-top: 2px; }
.sail-fine { margin-top: 16px; }

@media (max-width: 980px) {
  .sail-cards { grid-template-columns: 1fr 1fr; }
  .sail-tide { grid-column: 1 / -1; }
}
@media (max-width: 734px) {
  .sail-cards { grid-template-columns: 1fr; }
  .sail-stat { flex-basis: 40%; padding: 12px; }
  .sail-stat + .sail-stat { border-left: 0; }
  .sail-stats { display: grid; grid-template-columns: 1fr 1fr; }
  .sail-stat:nth-child(even) { border-left: 1px solid var(--hair); }
  .sail-stat:nth-child(n + 3) { border-top: 1px solid var(--hair); }
  .sf-head { padding: 0 16px 12px; }
  .sf-lab { padding: 0 8px 0 14px; font-size: 11px; }
  .sf-scale { width: 220px; }
  .sail-alert { font-size: 14px; }
}

/* interruptor de ligar/desligar no painel e na lista das unidades */
.pp-switch { margin-top: 8px; }
.pp-toggle { position: relative; flex: none; width: 42px; height: 26px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 18%, transparent); transition: background-color 0.25s; }
.pp-toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: translate 0.3s var(--ease-spring, ease); }
.pp-switch[aria-checked="true"] .pp-toggle { background: #34c759; }
.pp-switch[aria-checked="true"] .pp-toggle::after { translate: 16px 0; }
