/* nomadkit/tokens.css */
/* NomadKit — Design tokens
   Source: nomadkit-DESIGN.md (colors). Type, spacing, radius and elevation
   are not in the spec; chosen to fit "light-packed, offline-first". */

:root {
  color-scheme: light;

  /* Brand */
  --n-sand: #D4A373;
  --n-sand-hover: #C08D5B;
  --n-sand-tint: #F6EBDD;
  --n-on-sand: #2A1F14;       /* sand is too light for white text */
  --n-ocean: #0891B2;
  --n-ocean-text: #0E7490;    /* darker ocean for link text (AA contrast) */
  --n-ocean-tint: #E0F4F8;
  --n-forest: #166534;
  --n-forest-tint: #E3F1E7;

  /* Neutrals (warm) */
  --n-bg: #FFFDF7;
  --n-surface: #FFFFFF;
  --n-surface-muted: #F5F1E8;
  --n-border: #E6DFD1;
  --n-border-strong: #CFC5B3;
  --n-text: #2A2520;
  --n-text-secondary: #5E564C;
  --n-text-muted: #6F675C;

  /* Semantic */
  --n-success: #166534;
  --n-success-tint: #E3F1E7;
  --n-warning: #CA8A04;
  --n-warning-text: #854D0E;
  --n-warning-tint: #FDF4DC;
  --n-error: #DC2626;
  --n-error-text: #B91C1C;
  --n-error-tint: #FDECEC;
  --n-info: #0891B2;
  --n-info-text: #0E7490;
  --n-info-tint: #E0F4F8;

  /* Typography — system stack: no font download, works offline */
  --n-font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --n-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --n-text-display: clamp(36px, 6vw, 56px);
  --n-text-h1: clamp(30px, 4.5vw, 40px);
  --n-text-h2: 26px;
  --n-text-h3: 20px;
  --n-text-body: 16px;
  --n-text-small: 14px;
  --n-text-caption: 12px;

  /* Spacing (4px grid) */
  --n-space-1: 4px;
  --n-space-2: 8px;
  --n-space-3: 12px;
  --n-space-4: 16px;
  --n-space-5: 20px;
  --n-space-6: 24px;
  --n-space-8: 32px;
  --n-space-10: 40px;
  --n-space-12: 48px;
  --n-space-16: 64px;

  --n-container: 1120px;

  /* Radius — soft, friendly */
  --n-radius-sm: 6px;
  --n-radius: 10px;
  --n-radius-lg: 16px;
  --n-radius-full: 9999px;

  /* Elevation — light, barely there */
  --n-shadow-sm: 0 1px 2px rgb(42 37 32 / 0.06);
  --n-shadow: 0 4px 14px rgb(42 37 32 / 0.08);
  --n-shadow-lg: 0 16px 40px rgb(42 37 32 / 0.12);
  --n-ring: 0 0 0 3px rgb(8 145 178 / 0.28);

  /* Motion */
  --n-fast: 150ms;
}

/* nomadkit/base.css */
/* NomadKit — Base & typography */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--n-bg);
  color: var(--n-text);
  font-family: var(--n-font);
  font-size: var(--n-text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .n-display {
  color: var(--n-text);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 var(--n-space-4);
}
.n-display { font-size: var(--n-text-display); line-height: 1.08; letter-spacing: -0.025em; }
h1 { font-size: var(--n-text-h1); line-height: 1.15; }
h2 { font-size: var(--n-text-h2); line-height: 1.25; }
h3 { font-size: var(--n-text-h3); line-height: 1.3; font-weight: 600; }
h4 { font-size: var(--n-text-body); line-height: 1.4; font-weight: 600; }

p { margin: 0 0 var(--n-space-4); }

.n-lead { font-size: 19px; line-height: 1.55; color: var(--n-text-secondary); }
.n-small { font-size: var(--n-text-small); }
.n-caption { font-size: var(--n-text-caption); }
.n-overline { font-size: var(--n-text-caption); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.n-secondary { color: var(--n-text-secondary); }
.n-muted { color: var(--n-text-muted); }

code, pre { font-family: var(--n-font-mono); font-size: 0.875em; }
code { background: var(--n-surface-muted); padding: 2px 6px; border-radius: var(--n-radius-sm); }

a { color: var(--n-ocean-text); text-underline-offset: 3px; }
a:hover { color: var(--n-ocean); }

::selection { background: var(--n-sand-tint); }

:focus-visible { outline: 2px solid var(--n-ocean); outline-offset: 2px; }

img { max-width: 100%; height: auto; }

.n-container { max-width: var(--n-container); margin: 0 auto; padding: 0 var(--n-space-4); }
@media (min-width: 768px) { .n-container { padding: 0 var(--n-space-6); } }
.n-section { padding: var(--n-space-10) 0; }
@media (min-width: 1024px) { .n-section { padding: var(--n-space-16) 0; } }
.n-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--n-space-4); }
@media (min-width: 1024px) { .n-grid { gap: var(--n-space-6); } }

.n-visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}

/* nomadkit/components.css */
/* NomadKit — Components */

/* ---------- Buttons ---------- */
.n-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--n-space-2);
  min-height: 44px;            /* comfortable touch target on the go */
  padding: 0 var(--n-space-5);
  font-family: var(--n-font);
  font-size: var(--n-text-body);
  font-weight: 600;
  line-height: 1;
  color: var(--n-text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--n-radius);
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--n-fast) ease, border-color var(--n-fast) ease, color var(--n-fast) ease;
}
.n-btn--sm { min-height: 36px; padding: 0 var(--n-space-3); font-size: var(--n-text-small); }
.n-btn--lg { min-height: 52px; padding: 0 var(--n-space-6); font-size: 17px; }
.n-btn--block { width: 100%; }

.n-btn--primary { background: var(--n-sand); color: var(--n-on-sand); }
.n-btn--primary:hover { background: var(--n-sand-hover); color: var(--n-on-sand); }

.n-btn--secondary { background: var(--n-surface); color: var(--n-ocean-text); border-color: var(--n-ocean); }
.n-btn--secondary:hover { background: var(--n-ocean-tint); color: var(--n-ocean-text); }

.n-btn--ghost { color: var(--n-text-secondary); }
.n-btn--ghost:hover { background: var(--n-surface-muted); color: var(--n-text); }

.n-btn--danger { background: var(--n-error-text); color: #FFFFFF; }
.n-btn--danger:hover { background: #991B1B; color: #FFFFFF; }

.n-btn:disabled, .n-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.n-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- Cards ---------- */
.n-card {
  background: var(--n-surface);
  border: 1px solid var(--n-border);
  border-radius: var(--n-radius-lg);
  padding: var(--n-space-5);
  box-shadow: var(--n-shadow-sm);
}
.n-card--interactive { transition: box-shadow var(--n-fast) ease, border-color var(--n-fast) ease; cursor: pointer; }
.n-card--interactive:hover { box-shadow: var(--n-shadow); border-color: var(--n-border-strong); }
.n-card__media {
  margin: calc(var(--n-space-5) * -1) calc(var(--n-space-5) * -1) var(--n-space-4);
  border-radius: var(--n-radius-lg) var(--n-radius-lg) 0 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--n-surface-muted);
}
.n-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.n-card__meta { display: flex; flex-wrap: wrap; gap: var(--n-space-3); font-size: var(--n-text-small); color: var(--n-text-muted); }

/* ---------- Inputs ---------- */
.n-field { display: flex; flex-direction: column; gap: 6px; }
.n-field__label { font-size: var(--n-text-small); font-weight: 600; color: var(--n-text); }
.n-field__help { font-size: var(--n-text-caption); color: var(--n-text-muted); }
/* Error text carries an icon so meaning isn't conveyed by color alone */
.n-field__error { font-size: var(--n-text-caption); color: var(--n-error-text); display: flex; gap: 4px; align-items: center; }
.n-field__error::before { content: "⚠"; }

.n-input {
  width: 100%;
  min-height: 44px;
  padding: 10px var(--n-space-3);
  font-family: var(--n-font);
  font-size: var(--n-text-body);
  color: var(--n-text);
  background: var(--n-surface);
  border: 1px solid var(--n-border-strong);
  border-radius: var(--n-radius);
  outline: none;
  transition: border-color var(--n-fast) ease, box-shadow var(--n-fast) ease;
}
textarea.n-input { min-height: 104px; resize: vertical; }
.n-input::placeholder { color: var(--n-text-muted); }
.n-input:focus { border-color: var(--n-ocean); box-shadow: var(--n-ring); }
.n-input[aria-invalid="true"] { border-color: var(--n-error); border-width: 2px; }
.n-input:disabled { background: var(--n-surface-muted); cursor: not-allowed; }

/* ---------- Chips & tags ---------- */
.n-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 var(--n-space-3);
  font-family: var(--n-font);
  font-size: var(--n-text-small);
  font-weight: 500;
  color: var(--n-text-secondary);
  background: var(--n-surface);
  border: 1px solid var(--n-border-strong);
  border-radius: var(--n-radius-full);
  transition: background-color var(--n-fast) ease, border-color var(--n-fast) ease;
}
button.n-chip { cursor: pointer; }
button.n-chip:hover { background: var(--n-surface-muted); }
/* Selected chip shows a check mark, not just a color change */
.n-chip[aria-pressed="true"] { background: var(--n-sand-tint); border-color: var(--n-sand); color: var(--n-on-sand); font-weight: 600; }
.n-chip[aria-pressed="true"]::before { content: "✓"; }

/* Status tags: always pair the color with text (and optionally an icon) */
.n-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font-size: var(--n-text-caption);
  font-weight: 600;
  border-radius: var(--n-radius-full);
}
.n-tag--success { background: var(--n-success-tint); color: var(--n-success); }
.n-tag--warning { background: var(--n-warning-tint); color: var(--n-warning-text); }
.n-tag--error { background: var(--n-error-tint); color: var(--n-error-text); }
.n-tag--info { background: var(--n-info-tint); color: var(--n-info-text); }
.n-tag--neutral { background: var(--n-surface-muted); color: var(--n-text-secondary); }

/* ---------- Alerts ---------- */
.n-alert {
  display: flex;
  gap: var(--n-space-3);
  padding: var(--n-space-3) var(--n-space-4);
  border-radius: var(--n-radius);
  border: 1px solid;
  font-size: var(--n-text-small);
}
.n-alert__icon { flex-shrink: 0; font-weight: 700; }
.n-alert strong { display: block; }
.n-alert--success { background: var(--n-success-tint); border-color: rgb(22 101 52 / 0.25); color: var(--n-success); }
.n-alert--warning { background: var(--n-warning-tint); border-color: rgb(202 138 4 / 0.35); color: var(--n-warning-text); }
.n-alert--error { background: var(--n-error-tint); border-color: rgb(220 38 38 / 0.3); color: var(--n-error-text); }
.n-alert--info { background: var(--n-info-tint); border-color: rgb(8 145 178 / 0.3); color: var(--n-info-text); }

/* ---------- Offline banner ---------- */
/* Toggle with: document.body.classList.toggle('is-offline', !navigator.onLine) */
.n-offline {
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--n-space-2);
  padding: var(--n-space-2) var(--n-space-4);
  background: var(--n-text);
  color: var(--n-bg);
  font-size: var(--n-text-small);
  text-align: center;
}
.is-offline .n-offline { display: flex; }

/* ---------- Skeleton (offline-first loading states) ---------- */
.n-skeleton {
  display: block;
  background: var(--n-surface-muted);
  background-image: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.65), transparent);
  background-size: 200% 100%;
  background-repeat: no-repeat;
  border-radius: var(--n-radius-sm);
  animation: n-shimmer 1.4s ease-in-out infinite;
}
.n-skeleton--text { height: 12px; margin-bottom: var(--n-space-2); }
.n-skeleton--title { height: 20px; width: 60%; margin-bottom: var(--n-space-3); }
.n-skeleton--media { aspect-ratio: 16 / 9; border-radius: var(--n-radius); margin-bottom: var(--n-space-4); }
.n-skeleton--avatar { width: 40px; height: 40px; border-radius: var(--n-radius-full); }
@keyframes n-shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }

/* ---------- List ---------- */
.n-list { list-style: none; margin: 0; padding: 0; }
.n-list__item {
  display: flex;
  align-items: center;
  gap: var(--n-space-3);
  min-height: 56px;
  padding: var(--n-space-3) var(--n-space-4);
  border-bottom: 1px solid var(--n-border);
}
.n-list__item:last-child { border-bottom: 0; }
.n-list__icon {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: var(--n-radius);
  background: var(--n-sand-tint);
  color: var(--n-on-sand);
  flex-shrink: 0;
}
.n-list__title { font-weight: 600; line-height: 1.3; }
.n-list__desc { font-size: var(--n-text-small); color: var(--n-text-muted); line-height: 1.4; }

/* ---------- Top navigation ---------- */
.n-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(255 253 247 / 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--n-border);
}
.n-nav__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--n-space-4); min-height: 60px; }
.n-nav__brand { font-weight: 700; color: var(--n-text); text-decoration: none; display: flex; align-items: center; gap: var(--n-space-2); }
.n-nav__links { display: flex; gap: var(--n-space-1); list-style: none; margin: 0; padding: 0; }
.n-nav__link {
  display: block;
  padding: var(--n-space-2) var(--n-space-3);
  border-radius: var(--n-radius-sm);
  color: var(--n-text-secondary);
  font-size: var(--n-text-small);
  font-weight: 500;
  text-decoration: none;
}
.n-nav__link:hover { background: var(--n-surface-muted); color: var(--n-text); }
.n-nav__link[aria-current="page"] { color: var(--n-text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--n-sand); border-radius: 0; }
@media (max-width: 640px) { .n-nav__links { display: none; } }

/* ---------- Divider ---------- */
.n-divider { height: 1px; border: 0; background: var(--n-border); margin: var(--n-space-6) 0; }

/* public/css/theme.css */
/* Tema Agualva-Cacém sobre o NomadKit.
   A ranhura "primária" do NomadKit (--n-sand*) passa a verde-floresta; a areia fica como neutro quente.
   Terracota é apontamento (marcadores, destaques), nunca cor de ação principal. */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  src: url("/fonts/bricolage-grotesque-latin-standard-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;
}

:root {
  --forest-900: #10342A;
  --forest-800: #163F32;
  --forest-700: #1E4D3B;
  --forest-500: #3A6F55;
  --sage-50: #F3F6EF;
  --sage-100: #E7EEE1;
  --sage-200: #D3DFCB;
  --sage-400: #9DB592;
  --cream-50: #FCF8F0;
  --cream-100: #F6EFE1;
  --cream-200: #ECE2CE;
  --terracotta-500: #CB6440;
  --terracotta-600: #B0502F;
  --terracotta-text: #9C4426;
  --terracotta-tint: #F8E7DD;

  --n-sand: var(--forest-700);
  --n-sand-hover: var(--forest-800);
  --n-sand-tint: var(--sage-100);
  --n-on-sand: var(--cream-50);

  --n-ocean: #1F6F8B;
  --n-ocean-text: #1B5F77;
  --n-ocean-tint: #E2EFF3;

  --n-bg: var(--cream-50);
  --n-surface: #FFFDF8;
  --n-surface-muted: var(--cream-100);
  --n-border: #E6DCC8;
  --n-border-strong: #CDBFA5;
  --n-text: #1D2621;
  --n-text-secondary: #4B564E;
  --n-text-muted: #5F685F;

  --n-ring: 0 0 0 3px rgb(30 77 59 / 0.28);
  --n-font-display: "Bricolage Grotesque", var(--n-font);

  --header-h: 64px;
  --n-container: 1320px; /* largura única: cabeçalho, páginas e rodapé */
  --panel-w: 400px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

[hidden] { display: none !important; }
html { -webkit-tap-highlight-color: rgb(30 77 59 / 0.12); }
a, button, input, select, textarea, label { touch-action: manipulation; }
h1, h2, h3, .display { text-wrap: balance; }
p { text-wrap: pretty; }
[id] { scroll-margin-top: calc(var(--header-h, 64px) + 16px); }
a.n-chip { text-decoration: none; color: var(--n-text-secondary); }
a.n-chip:hover { color: var(--n-text); }

a { color: var(--forest-700); }
a:hover { color: var(--forest-900); }
:focus-visible { outline: 3px solid var(--forest-500); outline-offset: 2px; }
::selection { background: var(--sage-200); }

h1, h2, h3, .n-display, .display { font-family: var(--n-font-display); font-variation-settings: "wdth" 92; letter-spacing: -0.02em; }

.icon { flex-shrink: 0; vertical-align: middle; }
.icon.flip { transform: scaleX(-1); }
.n-btn--primary:hover { box-shadow: 0 6px 16px rgb(16 52 42 / 0.18); }
.n-btn--secondary { color: var(--forest-700); border-color: var(--forest-700); }
.n-btn--secondary:hover { background: var(--sage-100); color: var(--forest-800); }
.n-chip[aria-pressed="true"] { background: var(--forest-700); border-color: var(--forest-700); color: var(--cream-50); }
.n-chip[aria-pressed="true"]:hover { background: var(--forest-800); color: var(--cream-50); }
.n-overline { letter-spacing: 0.18em; color: var(--n-text-muted); }

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--forest-700); color: var(--cream-50); padding: 10px 14px; border-radius: var(--n-radius);
}
.skip-link:focus { top: 8px; }

/* ---------- Cabeçalho ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  background: rgb(252 248 240 / 0.94);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--n-border);
}
.site-header__inner { height: 100%; display: flex; align-items: center; gap: var(--n-space-4); max-width: 1440px; margin: 0 auto; padding: 0 var(--n-space-4); }
/* O logótipo alinha com o conteúdo: grelha --n-container nas páginas (a do rodapé) e margem do painel na página do mapa, a toda a largura. */
body:not(.page-explore) .site-header__inner { max-width: var(--n-container); }
@media (min-width: 861px) { .page-explore .site-header__inner { max-width: none; padding-inline: var(--n-space-5); } }
.brand { display: inline-flex; align-items: center; gap: 0.3em; color: var(--forest-800); text-decoration: none; font-family: var(--n-font-display); font-weight: 700; font-size: 24px; letter-spacing: -0.03em; white-space: nowrap; }
.brand:hover { color: var(--forest-900); }
.brand svg { flex: none; width: 1.65em; height: 1.65em; }
.brand__name { display: inline-block; line-height: 1; }
.brand__name small { display: block; margin-bottom: 2px; font-size: 0.58em; font-weight: 600; letter-spacing: 0; }
/* Uma cor da paleta por zona; a terracota é o único apontamento quente. No fundo escuro, São Marcos clareia. */
.brand__agualva { fill: var(--sage-400); }
.brand__marcos { fill: var(--forest-500); }
.brand__cacem { fill: var(--terracotta-500); }
.site-footer .brand__marcos { fill: var(--sage-200); }
.site-nav { margin-left: auto; }
.site-nav a { white-space: nowrap; }
.nav-support .icon { color: var(--terracotta-500); }
/* Computador: discreto, só o coração. O texto fica para leitores de ecrã, para o rato e para o menu do telemóvel. */
@media (min-width: 961px) {
  .nav-support a { display: grid; place-items: center; height: 100%; padding-inline: 10px; }
  .nav-support__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
.site-nav ul { list-style: none; margin: 0; padding: 0; }
#menu-principal { display: flex; align-items: center; gap: 2px; }
.site-nav a { display: block; padding: 8px 12px; border-radius: var(--n-radius-sm); color: var(--n-text-secondary); font-weight: 500; text-decoration: none; font-size: 15px; }
.site-nav a:hover { color: var(--n-text); background: var(--cream-100); }
.site-nav a[aria-current] { color: var(--forest-800); font-weight: 600; box-shadow: inset 0 -2px 0 var(--terracotta-500); border-radius: 0; }
.site-nav a:focus-visible, .nav-sub-toggle:focus-visible { outline: 3px solid var(--forest-700); outline-offset: 1px; }
.site-nav a .icon { display: none; }
.nav-group { position: relative; display: flex; align-items: center; }
.nav-sub-toggle { position: relative; display: grid; place-items: center; width: 36px; height: 36px; margin-left: -6px; padding: 0; border: 0; border-radius: var(--n-radius-sm); background: none; color: var(--n-text-secondary); cursor: pointer; }
.nav-sub-toggle:hover { background: var(--cream-100); color: var(--n-text); }
.nav-sub-toggle .icon { transform: rotate(90deg); transition: transform var(--dur-fast) ease; }
.nav-sub-toggle[aria-expanded="true"] .icon { transform: rotate(-90deg); }
.site-nav .nav-sub { display: none; position: absolute; z-index: 30; left: 0; top: calc(100% + 8px); min-width: 190px; padding: 6px; background: var(--n-surface); border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); box-shadow: var(--n-shadow-lg); }
.site-nav .nav-sub.is-open { display: block; }
.nav-sub a[aria-current] { box-shadow: none; background: var(--sage-100); border-radius: var(--n-radius-sm); }
/* «Hoje» e a seta são um só item. A área de toque da seta sobe a 44 px de altura sem mudar o desenho. */
@media (min-width: 961px) {
  .nav-group { align-items: stretch; }
  .nav-group > a { padding-right: 4px; border-radius: var(--n-radius-sm) 0 0 var(--n-radius-sm); }
  .nav-group > .nav-sub-toggle { height: auto; margin-left: 0; border-radius: 0 var(--n-radius-sm) var(--n-radius-sm) 0; }
  .nav-sub-toggle::after { content: ''; position: absolute; inset: -4px 0; }
  .nav-group:hover > a, .nav-group:hover > .nav-sub-toggle { color: var(--n-text); background: var(--cream-100); }
  .nav-group.is-active > .nav-sub-toggle { border-radius: 0; box-shadow: inset 0 -2px 0 var(--terracotta-500); color: var(--forest-800); }
  /* Ponte invisível sobre o espaço entre o menu e o submenu. */
  .site-nav .nav-sub::before { content: ''; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
}
.menu-toggle { display: none; }

@media (max-width: 960px) {
  :root { --header-h: 56px; }
  .brand { font-size: 20px; }
  .site-nav { position: relative; }
  .menu-toggle { display: inline-flex; }
  #menu-principal { display: none; }
  .site-nav[open] #menu-principal, .site-nav.is-open #menu-principal {
    display: flex; flex-direction: column; align-items: stretch; position: absolute; right: 0; top: calc(100% + 8px);
    min-width: 260px; max-height: calc(100dvh - var(--header-h) - 24px - var(--safe-b)); overflow-y: auto; padding: 8px; background: var(--n-surface); border: 1px solid var(--n-border);
    border-radius: var(--n-radius-lg); box-shadow: var(--n-shadow-lg);
  }
  .site-nav a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 12px 14px; font-size: 16px; }
  .site-nav a .icon { display: block; color: var(--forest-700); }
  .site-nav a[aria-current] { box-shadow: inset 3px 0 0 var(--terracotta-500); }
  /* No telemóvel, Agenda e Avisos ficam sempre à vista, por baixo de Hoje. */
  .nav-group { display: block; }
  .nav-sub-toggle { display: none; }
  .site-nav .nav-sub, .site-nav .nav-sub.is-open { display: block; position: static; min-width: 0; padding: 0 0 4px 46px; border: 0; box-shadow: none; background: none; }
  .nav-sub li:first-child { display: none; }
  .nav-sub a { min-height: 44px; padding: 10px 12px; font-size: 15px; }
  .nav-sub a[aria-current] { box-shadow: inset 3px 0 0 var(--terracotta-500); background: none; border-radius: 0; }
}

/* Secções de Hoje: Visão geral, Agenda e Avisos. */
.hoje-nav { border-bottom: 1px solid var(--n-border); background: var(--n-bg); }
.hoje-nav ul { display: flex; gap: var(--n-space-1); max-width: var(--n-container); margin: 0 auto; padding: 0 var(--n-space-4); list-style: none; }
.hoje-nav a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--n-text-secondary); font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.hoje-nav li:first-child a { padding-left: 0; }
.hoje-nav a:hover { color: var(--n-text); }
.hoje-nav a:focus-visible { outline: 3px solid var(--forest-700); outline-offset: -3px; }
.hoje-nav a[aria-current] { color: var(--forest-800); font-weight: 600; box-shadow: inset 0 -2px 0 var(--terracotta-500); }

/* ---------- Páginas de conteúdo ---------- */
.page { max-width: var(--n-container); margin: 0 auto; padding: var(--n-space-8) var(--n-space-4) var(--n-space-16); }
.page--narrow { max-width: 760px; }
.page-head { margin-bottom: var(--n-space-8); }
.page-head h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.05; margin-bottom: var(--n-space-3); }
.page-head p { color: var(--n-text-secondary); font-size: 18px; max-width: 640px; margin: 0; }
.breadcrumb { font-size: var(--n-text-small); color: var(--n-text-muted); margin-bottom: var(--n-space-4); }
.breadcrumb a { color: var(--n-text-muted); }

.card-list { display: grid; gap: var(--n-space-4); grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.section-title { display: flex; align-items: center; gap: var(--n-space-2); font-size: 22px; margin: var(--n-space-10) 0 var(--n-space-4); }
.section-title .icon { color: var(--terracotta-500); }

.empty-state {
  text-align: center; padding: var(--n-space-10) var(--n-space-4);
  border: 1px dashed var(--n-border-strong); border-radius: var(--n-radius-lg); background: var(--n-surface);
  color: var(--n-text-secondary);
}
.empty-state .icon { color: var(--sage-400); width: 40px; height: 40px; margin-bottom: var(--n-space-2); }
.empty-state h2, .empty-state h3 { font-size: 20px; margin-bottom: var(--n-space-2); color: var(--n-text); }

.meta-line { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--n-text-muted); font-size: var(--n-text-small); }
.meta-line span { display: inline-flex; align-items: center; gap: 5px; }

.tag-official { background: var(--sage-100); color: var(--forest-800); }
.tag-community { background: var(--cream-100); color: var(--n-text-secondary); }
.tag-sponsored { background: var(--terracotta-tint); color: var(--terracotta-text); }

/* Contactos */
.contact-group { margin-bottom: var(--n-space-8); }
.contact-grid { display: grid; gap: var(--n-space-3); grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.contact-card { background: var(--n-surface); border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); padding: var(--n-space-4); display: flex; flex-direction: column; gap: 6px; }
.contact-card h3 { font-family: var(--n-font); font-size: 16px; font-weight: 600; letter-spacing: 0; margin: 0; }
.contact-card p { margin: 0; font-size: var(--n-text-small); color: var(--n-text-secondary); }
.contact-card .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.contact-card .source { font-size: var(--n-text-caption); color: var(--n-text-muted); margin-top: auto; padding-top: 6px; }
.phone-big { font-size: 20px; font-weight: 700; letter-spacing: 0.01em; }
.contact-group--emergencia .contact-card { border-color: rgb(203 100 64 / 0.4); background: #FFF9F5; }

/* Quick essentials strip */
.essentials { display: flex; gap: 8px; flex-wrap: wrap; }
.essentials a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--n-radius-full); background: var(--n-surface); border: 1px solid var(--n-border); color: var(--n-text); text-decoration: none; font-size: 14px; font-weight: 600; min-height: 40px; }
.essentials a:hover { border-color: var(--forest-500); }
.essentials a.is-urgent { background: var(--terracotta-tint); border-color: rgb(203 100 64 / 0.35); color: var(--terracotta-text); }

/* Eventos e avisos */
.event-card, .notice-card { background: var(--n-surface); border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); padding: var(--n-space-5); display: flex; gap: var(--n-space-4); }
.event-date { flex-shrink: 0; width: 64px; text-align: center; border-radius: var(--n-radius); background: var(--sage-100); color: var(--forest-800); padding: 8px 4px; line-height: 1.1; align-self: flex-start; }
.event-date strong { display: block; font-family: var(--n-font-display); font-size: 26px; }
.event-date span { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.event-card h3, .notice-card h3 { font-family: var(--n-font); font-size: 18px; letter-spacing: 0; margin: 0 0 6px; }
.event-card h3 a, .notice-card h3 a { color: var(--n-text); text-decoration: none; }
.event-card h3 a:hover { text-decoration: underline; }
.is-cancelled h3 { text-decoration: line-through; text-decoration-color: var(--terracotta-500); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: var(--n-space-6); }

/* Formulários */
.form-stack { display: grid; gap: var(--n-space-4); }
.form-row { display: grid; gap: var(--n-space-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-card { background: var(--n-surface); border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); padding: var(--n-space-6); }
.req { color: var(--terracotta-text); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
select.n-input { appearance: auto; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; margin-bottom: 6px; }
.tabs-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--n-space-6); }

/* ---------- Publicidade ---------- */
.ad-slot { position: relative; background: var(--cream-100); border-top: 1px solid var(--n-border); }
/* Faixa de anúncios: a imagem é do anunciante e ocupa a altura toda; a etiqueta vive com o texto e os controlos são discretos. */
.ad-carousel { position: relative; }
.ad-track { display: grid; }
.ad-slide { grid-area: 1 / 1; display: grid; grid-template-columns: 440px minmax(0, 1fr) auto; align-items: center; gap: var(--n-space-5); min-height: 180px; padding-right: var(--n-space-5); opacity: 0; visibility: hidden; }
.ad-slide.is-active { opacity: 1; visibility: visible; transition: opacity 300ms ease; }
.ad-slide__img { display: block; width: 100%; height: 180px; object-fit: cover; background: var(--cream-200); }
.ad-slide__label { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 700; color: var(--terracotta-text); }
.ad-slide__text h3 { font-family: var(--n-font-display); font-size: 22px; margin: 0 0 2px; line-height: 1.15; }
.ad-slide__text p { margin: 0; color: var(--n-text-secondary); font-size: 15px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ad-controls { position: absolute; right: var(--n-space-3); bottom: 6px; display: flex; align-items: center; gap: 2px; }
.ad-controls > button { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: var(--n-radius-full); background: none; color: var(--n-text-secondary); cursor: pointer; }
.ad-controls > button:hover { background: var(--cream-200); }
.ad-controls button:focus-visible { outline: 3px solid var(--forest-700); outline-offset: 1px; }
.ad-dots { display: flex; }
.ad-dots button { width: 24px; height: 24px; border: 0; background: none; padding: 0; display: grid; place-items: center; cursor: pointer; }
.ad-dots button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--n-border-strong); }
.ad-dots button[aria-current="true"]::before { background: var(--forest-700); width: 16px; border-radius: 4px; }
.ad-house { display: flex; align-items: center; justify-content: space-between; gap: var(--n-space-4); height: 100%; }
.ad-house p { margin: 0; color: var(--n-text-secondary); }
.ad-count { display: block; margin-top: 2px; text-align: right; font-size: 12px; color: var(--n-text-secondary); font-variant-numeric: tabular-nums; }
/* Destaque da página inicial: um anúncio por visita, parado. Todo o cartão abre o anúncio; à direita do mapa fica fora da cidade. */
.home-ad { position: relative; overflow: hidden; border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); background: var(--n-surface); }
.home-ad__img { display: block; object-fit: cover; background: var(--cream-200); }
.home-ad__text { display: grid; justify-items: start; gap: 3px; min-width: 0; }
.home-ad__label { width: 100%; overflow: hidden; font-size: 11px; font-weight: 700; color: var(--terracotta-text); text-overflow: ellipsis; white-space: nowrap; }
.home-ad__title { font-family: var(--n-font-display); font-size: 18px; line-height: 1.2; color: var(--n-text); }
.home-ad__body { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; font-size: 14px; line-height: 1.4; color: var(--n-text-secondary); }
.home-ad__cta { display: inline-flex; align-items: center; margin-top: 3px; font-size: 14px; font-weight: 700; color: var(--forest-700); }
.home-ad__cta::after { content: ""; position: absolute; inset: 0; }
.home-ad__cta:focus-visible { outline: none; }
.home-ad__cta:focus-visible::after { outline: 3px solid var(--forest-700); outline-offset: -3px; border-radius: var(--n-radius-lg); }
.home-ad__close { position: absolute; z-index: 1; top: 6px; right: 6px; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--cream-100); color: var(--forest-900); cursor: pointer; }
.home-ad__close:focus-visible { outline: 3px solid var(--forest-700); outline-offset: 2px; }
.home-ad--phone { margin: 0 0 var(--n-space-4); }
.home-ad--phone .home-ad__img { width: 100%; aspect-ratio: 800 / 384; }
.home-ad--phone .home-ad__text { padding: 12px 14px 14px; }
.home-ad--phone .home-ad__title { font-size: 20px; }
.home-ad--map { display: none; }
@media (min-width: 1024px) {
  .home-ad--map { display: block; position: absolute; z-index: 4; right: 68px; bottom: 44px; width: 380px; height: 168px; box-shadow: var(--n-shadow-lg); }
  .home-ad--map .home-ad__slide { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; height: 100%; padding: 10px 30px 10px 10px; }
  .home-ad--map .home-ad__img { width: 130px; height: 148px; border-radius: 10px; }
}
@media (max-width: 1000px) { .ad-slide { grid-template-columns: 38% minmax(0, 1fr) auto; gap: var(--n-space-4); } }
@media (max-width: 760px) {
  .ad-slide { grid-template-columns: minmax(0, 1fr); gap: var(--n-space-3); padding: 0 0 var(--n-space-4); align-content: start; }
  .ad-slide__img { height: auto; aspect-ratio: 800 / 384; }
  .ad-slide__text, .ad-slide__cta { margin-inline: var(--n-space-4); }
  .ad-slide__cta { justify-self: start; }
  .ad-slide__text h3 { font-size: 20px; }
  .ad-controls { right: var(--n-space-2); bottom: var(--n-space-4); }
  .ad-house { flex-direction: column; align-items: flex-start; justify-content: center; }
}

/* ---------- Rodapé ---------- */
.site-footer { background: var(--forest-900); color: #D9E2D6; padding: var(--n-space-10) 0 calc(var(--n-space-8) + var(--safe-b)); }
.site-footer a { color: #F3EBDA; }
.site-footer__inner { max-width: var(--n-container); margin: 0 auto; padding: 0 var(--n-space-4); display: grid; gap: var(--n-space-6); grid-template-columns: 2fr 1fr 1fr; }
.site-footer h2 { font-family: var(--n-font); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: #B9C9B5; margin-bottom: var(--n-space-3); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.site-footer p { font-size: 14px; color: #C9D5C5; }
@media (max-width: 760px) { .site-footer__inner { grid-template-columns: 1fr; } }

/* ---------- Ficha (página) ---------- */
.place-page { display: grid; gap: var(--n-space-8); grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 900px) { .place-page { grid-template-columns: 1fr; } }
.place-head { display: flex; gap: var(--n-space-4); align-items: flex-start; margin-bottom: var(--n-space-6); }
.cat-badge { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #fff; flex-shrink: 0; box-shadow: 0 4px 12px rgb(16 52 42 / 0.18); }
.place-head h1 { font-size: clamp(28px, 4.5vw, 42px); line-height: 1.08; margin: 0 0 6px; }
.facts { display: grid; gap: 0; border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); background: var(--n-surface); overflow: hidden; }
.fact { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--n-border); align-items: start; }
.fact:last-child { border-bottom: 0; }
.fact .icon { color: var(--forest-500); margin-top: 2px; }
.fact__label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--n-text-muted); font-weight: 600; }
.fact__value { overflow-wrap: anywhere; }
.hours-table { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 4px; }
.hours-table td { padding: 3px 0; }
.hours-table td:last-child { text-align: right; color: var(--n-text-secondary); }
.hours-table tr.is-today td { font-weight: 700; color: var(--n-text); }
.open-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.open-state::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.open-state--open { color: #23703D; }
.open-state--closed { color: var(--terracotta-text); }
.provenance { font-size: 13px; color: var(--n-text-muted); border-top: 1px solid var(--n-border); padding-top: var(--n-space-4); margin-top: var(--n-space-6); }
.provenance dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0 0; }
.provenance dt { font-weight: 600; }
.provenance dd { margin: 0; }
.mini-map { aspect-ratio: 4 / 3; border-radius: var(--n-radius-lg); overflow: hidden; border: 1px solid var(--n-border); background: var(--sage-100); position: relative; }
.mini-map img { width: 100%; height: 100%; object-fit: cover; display: block; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; margin: var(--n-space-4) 0; }

.directory-list { list-style: none; margin: 0; padding: 0; background: var(--n-surface); border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); overflow: hidden; }
.pagination { display: flex; justify-content: space-between; gap: 8px; margin-top: var(--n-space-4); }

@media (prefers-reduced-motion: reduce) {
  .ad-slide { transition: none; }
}
.place-photo { margin: 0 0 var(--n-space-5); }
.place-photo img { display: block; width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--n-radius-lg, 16px); background: var(--cream-100); }
.place-photo figcaption { font-size: 12px; color: var(--n-text-muted); padding-top: 4px; }
.action-row .btn-fav[aria-pressed="true"] .icon { fill: currentColor; }

/* Informação útil: acesso rápido e destaques */
.sos-banner { display: flex; align-items: center; gap: 12px; padding: 14px 18px; margin-bottom: var(--n-space-5); border-radius: var(--n-radius-lg); background: var(--terracotta-tint); border: 1px solid rgb(203 100 64 / 0.35); color: var(--terracotta-text); text-decoration: none; }
.sos-banner strong { font-family: var(--n-font-display); font-size: 26px; margin-right: 6px; }
.sos-banner__cta { margin-left: auto; padding: 6px 14px; border-radius: 999px; background: var(--terracotta-600); color: var(--cream-50); font-weight: 700; }
.quick-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: var(--n-space-8); }
.quick-tile { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--n-radius-lg); background: var(--n-surface); border: 1px solid var(--n-border); color: inherit; text-decoration: none; transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease; }
.quick-tile:hover { border-color: var(--forest-500); box-shadow: var(--n-shadow-sm); transform: translateY(-1px); }
.quick-tile > .icon { flex-shrink: 0; width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--sage-100); color: var(--forest-700); }
.quick-tile strong { display: block; }
.quick-tile span span { font-size: var(--n-text-small); color: var(--n-text-muted); }
.info-callout { padding: 16px; border-radius: var(--n-radius-lg); background: var(--sage-50); border: 1px solid var(--n-border); margin-bottom: var(--n-space-4); }
.info-callout p { margin: 0 0 10px; max-width: 70ch; }
.info-callout .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.subhead { font-size: 17px; margin: var(--n-space-5) 0 4px; }
.access-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.stat-pill { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--n-surface); border: 1px solid var(--n-border); color: inherit; text-decoration: none; }
.stat-pill strong { font-family: var(--n-font-display); font-size: 20px; color: var(--forest-800); }
.stat-pill--muted strong { color: var(--n-text-muted); }
a.stat-pill:hover { border-color: var(--forest-500); }
.info-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
@media (prefers-reduced-motion: reduce) { .quick-tile { transition: none; } }

/* Reciclagem */
.nearest-card { display: grid; grid-template-columns: 1fr auto; gap: 12px 20px; align-items: center; padding: 18px; margin-bottom: var(--n-space-5); border-radius: var(--n-radius-lg); background: var(--sage-50); border: 1px solid var(--n-border); }
.nearest-card h2 { display: flex; align-items: center; gap: 8px; font-size: 20px; margin: 0 0 4px; }
.nearest-card p { margin: 0; }
.nearest-card [data-nearest-out] { grid-column: 1 / -1; }
.nearest-card [data-nearest-out]:empty { display: none; }
@media (max-width: 600px) { .nearest-card { grid-template-columns: 1fr; } }
.stats-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--n-space-8); }
.bins { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 8px; }
.bin { display: grid; gap: 4px; padding: 14px 14px 14px 18px; border-radius: var(--n-radius-lg); background: var(--n-surface); border: 1px solid var(--n-border); border-left-width: 6px; font-size: var(--n-text-small); }
.bin strong { font-size: 15px; }
:root { --bin-yellow: #E0B21B; --bin-blue: #2D6CB5; --bin-green: #3D8B4A; } /* cores nacionais dos contentores */
.bin--yellow { border-left-color: var(--bin-yellow); }
.bin--blue { border-left-color: var(--bin-blue); }
.bin--green { border-left-color: var(--bin-green); }
.faq { border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); background: var(--n-surface); padding: 0 16px; margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; }
.faq[open] { padding-bottom: 14px; }
.faq p { max-width: 72ch; }
@media (max-width: 600px) {
  .quick-tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .quick-tile { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .quick-tile span span { font-size: 12px; }
  .sos-banner { flex-wrap: wrap; }
}

/* Agenda */
.agenda-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.agenda-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: var(--n-space-6); }
.agenda-bar .filters { margin-bottom: 0; }
.view-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--cream-100); border: 1px solid var(--n-border); }
.view-switch a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; color: var(--n-text-secondary); text-decoration: none; font-weight: 600; font-size: 14px; }
.view-switch a[aria-pressed="true"] { background: var(--forest-700); color: var(--cream-50); }
.agenda-day { margin: 0 0 16px; }
.cal { background: var(--n-surface); border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); padding: 12px; }
.cal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal__head h2 { font-size: 20px; margin: 0; }
.cal__grid { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.cal__grid th { font-size: 12px; font-weight: 600; color: var(--n-text-muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 4px; }
.cal__grid td { height: 86px; vertical-align: top; border-radius: 10px; background: var(--cream-50); padding: 0; }
.cal__grid td.is-out { background: transparent; }
.cal__grid td > div, .cal__grid td > a { display: block; height: 100%; padding: 6px; border-radius: 10px; color: inherit; text-decoration: none; }
.cal__grid td.has-events { background: var(--sage-100); }
.cal__grid td.has-events > a:hover { box-shadow: inset 0 0 0 2px var(--forest-500); }
.cal__grid td.is-today .cal__d { display: inline-block; background: var(--terracotta-500); color: var(--cream-50); border-radius: 999px; padding: 1px 7px; }
.cal__d { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.cal__ev { display: grid; gap: 2px; margin-top: 4px; }
.cal__ev span { font-size: 11px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) {
  .cal { padding: 6px; }
  .cal__grid { border-spacing: 2px; }
  .cal__grid td { height: 52px; }
  .cal__ev span:not(.n-muted) { display: none; }
  .cal__grid td.has-events .cal__ev::before { content: "●"; color: var(--forest-700); font-size: 10px; }
}

/* Formulários: marcar posição, próximos passos */
.pick { display: grid; gap: 8px; }
.pick__bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pick__map { height: 300px; border-radius: var(--n-radius-lg); overflow: hidden; border: 1px solid var(--n-border); }
.pick__map[hidden] { display: none; }
.next-steps { text-align: left; max-width: 420px; margin: 12px auto; padding-left: 20px; display: grid; gap: 4px; }

/* Hoje na cidade, zonas, os meus locais */
.today-head .n-overline { margin-bottom: 6px; }
.today-grid, .zone-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.today-card { background: var(--n-surface); border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); padding: 16px; min-width: 0; }
.today-card--wide { grid-column: 1 / -1; }
/* Hoje: eventos e dois cartões curtos à mesma altura; o que é longo ocupa a linha inteira, sem colunas vazias. */
.today-grid { align-items: stretch; grid-template-columns: minmax(0, 1fr); }
.today-grid .today-card { display: flex; flex-direction: column; }
.today-grid .today-links { margin-top: auto; }
.today-card--full { grid-column: 1 / -1; }
.today-grid .today-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-top: 6px; }
.today-card--key { padding: 20px; }
.today-card--key h2 { font-size: 21px; gap: 10px; margin-bottom: 12px; }
.today-card--key h2 .icon { box-sizing: content-box; padding: 7px; border-radius: 10px; background: var(--sage-100); flex: none; }
@media (min-width: 700px) {
  .today-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today-card--full .directory-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; border: 0; border-radius: 0; background: none; overflow: visible; }
  .today-card--full .directory-list .result { height: 100%; border: 0; border-radius: var(--n-radius); }
}
@media (min-width: 1100px) {
  .today-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .today-grid .today-card--wide { grid-column: span 2; }
  .today-grid.is-even { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .today-grid.is-even .today-card--wide { grid-column: auto; }
  .today-card--full .directory-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.today-card h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; margin: 0 0 10px; }
.today-card h2 .icon { color: var(--terracotta-500); }
.today-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.today-notice { display: grid; gap: 2px; justify-items: start; }
.today-links { margin: 10px 0 0; font-size: var(--n-text-small); }
.zone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.zone-card { display: grid; gap: 4px; padding: 20px; border-radius: var(--n-radius-lg); background: var(--sage-50); border: 1px solid var(--n-border); color: inherit; text-decoration: none; transition: border-color 150ms ease, transform 150ms ease; }
.zone-card:hover { border-color: var(--forest-500); transform: translateY(-1px); }
.zone-card strong { font-family: var(--n-font-display); font-size: 24px; color: var(--forest-800); }
.zone-card__parts { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--terracotta-text); }
.my-item { border-bottom: 1px solid var(--n-border); }
.my-item .result { border-bottom: 0; }
.my-actions { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 var(--n-space-5) 10px 72px; }
@media (prefers-reduced-motion: reduce) { .zone-card { transition: none; } }

/* ---------- Anunciar ---------- */
.ad-hero { background: var(--forest-800); color: var(--cream-50); padding: clamp(40px, 7vw, 80px) var(--n-space-4); }
.ad-hero__inner { max-width: calc(var(--n-container) - 2 * var(--n-space-4)); margin: 0 auto; }
.ad-hero .n-overline { color: var(--terracotta-tint); }
.ad-hero h1 { font-size: clamp(34px, 6vw, 60px); line-height: 1.02; max-width: 15ch; margin: 8px 0 16px; color: var(--cream-50); }
.ad-hero__lead { font-size: 19px; max-width: 52ch; color: var(--sage-100); margin: 0 0 20px; }
.ad-hero .n-btn--ghost { color: var(--cream-50); }
.ad-hero__note { display: flex; gap: 8px; align-items: center; margin-top: 18px; color: var(--sage-200); }
.ad-section { margin: var(--n-space-10) 0; }
.benefits { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.benefit { display: grid; gap: 6px; padding: 18px; border-radius: var(--n-radius-lg); background: var(--n-surface); border: 1px solid var(--n-border); }
.benefit .icon { color: var(--terracotta-500); width: 26px; height: 26px; }
.benefit span { font-size: var(--n-text-small); color: var(--n-text-secondary); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.slot-card { padding: 14px; border-radius: var(--n-radius-lg); background: var(--n-surface); border: 1px solid var(--n-border); }
.slot-card h3 { font-size: 16px; margin: 12px 0 4px; }
.slot-card p { font-size: var(--n-text-small); color: var(--n-text-secondary); margin: 0; }
.slot-demo { height: 120px; border-radius: 12px; background: var(--cream-100); position: relative; overflow: hidden; padding: 10px; display: grid; gap: 6px; align-content: start; }
.demo-row { display: flex; gap: 8px; align-items: center; padding: 6px; border-radius: 8px; background: var(--n-surface); font-size: 12px; }
.demo-row.is-sp { box-shadow: inset 3px 0 0 var(--terracotta-500); }
.demo-row em { display: block; font-style: normal; font-size: 10px; font-weight: 700; color: var(--terracotta-text); text-transform: uppercase; letter-spacing: 0.06em; }
.demo-ico { width: 20px; height: 20px; border-radius: 6px; background: var(--sage-200); flex-shrink: 0; }
.slot-demo--map { background: var(--sage-100); }
.demo-pin { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: var(--forest-500); border: 3px solid var(--n-surface); }
.demo-pin:nth-child(1) { left: 22%; top: 40%; } .demo-pin:nth-child(2) { left: 50%; top: 28%; } .demo-pin:nth-child(3) { left: 72%; top: 58%; }
.demo-pin.is-sp { border-color: var(--terracotta-500); width: 26px; height: 26px; }
.demo-bar { height: 10px; border-radius: 4px; background: var(--cream-200); }
.demo-bar.short { width: 60%; }
.demo-promo { height: 48px; border-radius: 8px; background: var(--terracotta-tint); color: var(--terracotta-text); font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 6px; }
.slot-demo--strip { grid-template-columns: 60px 1fr 40px; align-items: center; align-content: center; }
.demo-img { height: 40px; border-radius: 6px; background: var(--sage-200); }
.demo-btn { height: 22px; border-radius: 999px; background: var(--forest-700); }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.steps li { counter-increment: s; display: grid; gap: 4px; padding: 16px; border-radius: var(--n-radius-lg); background: var(--sage-50); border: 1px solid var(--n-border); }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--forest-700); color: var(--cream-50); font-weight: 700; }
.steps span { font-size: var(--n-text-small); color: var(--n-text-secondary); }
.ad-progress { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: passo; }
.ad-progress li { flex: 1; counter-increment: passo; padding-top: 8px; border-top: 3px solid var(--n-border); font-size: 13px; color: var(--n-text-secondary); }
.ad-progress li::before { content: counter(passo) ". "; }
.ad-progress li[aria-current="step"] { border-color: var(--forest-700); color: var(--n-text); font-weight: 700; }
.ad-progress li.is-done { border-color: var(--sage-400); }
[data-ad-form] { scroll-margin-top: calc(var(--header-h) + 12px); }
.ad-step-nav { display: flex; justify-content: space-between; gap: 10px; }
.ad-step-nav [data-next], .ad-step-nav [data-ad-submit] { margin-left: auto; }
.consents { display: grid; gap: 10px; }
@media (max-width: 900px) { [data-ad-wrap][data-step]:not([data-step="2"]) .ad-preview { display: none; } }
.ad-zones { display: grid; gap: 8px; }
.ad-zone { display: block; cursor: pointer; }
.ad-zone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ad-zone__box { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border: 2px solid var(--n-border); border-radius: var(--n-radius-lg); background: var(--n-surface); }
.ad-zone strong { display: block; font-size: 15px; }
.ad-zone small { display: block; font-size: 13px; color: var(--n-text-secondary); }
.ad-zone input:checked + .ad-zone__box { border-color: var(--forest-700); background: var(--sage-100); box-shadow: inset 0 0 0 1px var(--forest-700); }
.ad-zone input:focus-visible + .ad-zone__box { outline: 3px solid var(--forest-700); outline-offset: 2px; }
.ad-zone__demo { position: relative; display: block; height: 44px; border: 1px solid var(--n-border-strong); border-radius: 6px; background: var(--cream-100); overflow: hidden; }
.ad-zone__demo i { position: absolute; background: var(--terracotta-500); border-radius: 2px; }
.ad-zone__demo--all i { inset: 12px 18px; background: var(--sage-400); }
.ad-zone__demo--home i { right: 6px; bottom: 6px; width: 24px; height: 12px; }
.ad-zone__demo--pages i { left: 6px; right: 6px; top: 14px; height: 14px; }
.ad-focus { display: grid; gap: 6px; margin-top: 10px; }
.ad-focus__pick { position: relative; display: block; width: fit-content; max-width: 100%; margin-inline: auto; padding: 0; border: 1px solid var(--n-border); border-radius: var(--n-radius); background: none; cursor: crosshair; overflow: hidden; }
.ad-focus__pick:focus-visible { outline: 3px solid var(--forest-700); outline-offset: 2px; }
.ad-focus__pick img { display: block; width: auto; height: auto; max-width: 100%; max-height: 320px; }
.ad-focus__dot { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 3px solid var(--cream-50); border-radius: 50%; background: var(--terracotta-500); box-shadow: 0 0 0 1px var(--forest-900); pointer-events: none; }
.ad-shot { display: grid; gap: 4px; margin-bottom: 6px; }
.ad-shot .n-caption { margin: 0; }
.ad-mock-map { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px; }
.ad-mock-map .home-ad__img { height: 114px; border-radius: 8px; }
.ad-mock-strip { display: block; aspect-ratio: 2.444; border-radius: var(--n-radius); background-color: var(--cream-200); }
.ad-preview .home-ad__img { display: block; background: var(--cream-200) center / cover no-repeat; }
.ad-preview .home-ad__cta::after { display: none; }
.ad-form-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.ad-preview { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 8px; padding: 16px; border-radius: var(--n-radius-lg); background: var(--n-surface); border: 1px solid var(--n-border); }
.ad-preview__title { display: flex; gap: 6px; align-items: center; font-weight: 700; margin: 0; }
.ad-mock { display: grid; grid-template-columns: 72px 1fr; gap: 8px; align-items: center; padding: 10px; border-radius: 12px; background: var(--cream-100); position: relative; }
.ad-mock__label { position: absolute; top: 4px; right: 8px; font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--n-text-muted); font-weight: 700; }
.ad-mock__img, .promo-box__img { display: block; border-radius: 8px; background: var(--cream-200) center / cover no-repeat; }
.ad-mock__img { width: 72px; height: 54px; }
.ad-mock__text { display: grid; gap: 2px; font-size: 12px; min-width: 0; }
.ad-mock__text strong { font-size: 14px; line-height: 1.2; }
.ad-mock__text span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--n-text-secondary); }
.ad-mock__text em { font-style: normal; color: var(--n-text-muted); font-size: 11px; }
.ad-mock__cta { grid-column: 2; justify-self: start; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--n-border-strong); background: var(--n-surface); }
.promo-box { display: grid; gap: 6px; padding: 10px; border-radius: 12px; border: 1px solid rgb(203 100 64 / 0.35); background: var(--n-surface); position: relative; }
.promo-box__tag { justify-self: start; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--terracotta-text); background: var(--terracotta-tint); padding: 2px 8px; border-radius: 999px; }
.promo-box__img { aspect-ratio: 25 / 12; width: 100%; }
.promo-box .n-btn { justify-self: start; }
.consent { display: flex; gap: 10px; align-items: flex-start; }
.consent input { margin-top: 4px; }
.prose h2 { font-size: 20px; margin-top: 24px; }
.prose li { margin-bottom: 4px; }
.track-status { display: grid; gap: 2px; padding: 16px; border-radius: var(--n-radius-lg); background: var(--sage-50); border: 1px solid var(--n-border); margin-bottom: 12px; }
.track-status strong { font-family: var(--n-font-display); font-size: 24px; color: var(--forest-800); }
.track-status--rejected strong, .track-status--suspended strong { color: var(--terracotta-text); }
.track-status--changes { background: var(--terracotta-tint); }
.track-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 16px; }
.track-steps li { padding: 6px 12px; border-radius: 999px; background: var(--cream-100); color: var(--n-text-muted); font-size: 13px; font-weight: 600; }
.track-steps li.is-done { background: var(--sage-100); color: var(--forest-800); }
.track-steps li.is-done::before { content: "✓ "; }
.track-steps li.is-current { background: var(--forest-700); color: var(--cream-50); }
@media (max-width: 900px) { .ad-form-wrap { grid-template-columns: 1fr; } .ad-preview { position: static; } }
.ad-slot--inline { border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); overflow: hidden; margin: 0 0 var(--n-space-6); }
.promo-box img.promo-box__img { object-fit: cover; height: auto; }
.promo-box--page { margin: 0 0 var(--n-space-5); max-width: 520px; }
.sheet .promo-box { margin: 10px 0; }
.chart { margin: 8px 0 16px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart__bar { fill: var(--forest-500); }
.chart__bar:hover { fill: var(--terracotta-500); }
.chart__axis { font-size: 10px; fill: var(--n-text-muted); }
.ad-hero .n-btn--primary { background: var(--cream-50); border-color: var(--cream-50); color: var(--forest-900); }
.ad-hero .n-btn--primary:hover { background: var(--cream-100); }
.ad-hero .n-btn--ghost:hover { background: rgb(255 255 255 / 0.1); color: var(--cream-50); }

/* ---------- Descobrir a cidade ---------- */
.discover-panel { padding: 18px; border-radius: var(--n-radius-lg); background: var(--sage-50); border: 1px solid var(--n-border); margin-bottom: var(--n-space-8); }
.discover-panel[hidden], .discover-off[hidden] { display: none; }
.discover-panel__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.discover-panel__head h2 { display: flex; gap: 8px; align-items: center; font-size: 20px; margin: 0; }
.discover-panel__head h2 .icon { color: var(--terracotta-500); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 12px 0 16px; }
.badge { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 12px 8px; border-radius: 14px; background: var(--n-surface); border: 1px dashed var(--n-border-strong); color: var(--n-text-muted); }
.badge strong { font-size: 14px; color: var(--n-text-secondary); }
.badge__medal { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--cream-100); color: var(--n-text-muted); }
.badge.is-earned { border-style: solid; border-color: var(--forest-500); color: var(--n-text-secondary); }
.badge.is-earned strong { color: var(--forest-800); }
.badge.is-earned .badge__medal { background: var(--forest-700); color: var(--cream-50); box-shadow: 0 0 0 3px var(--terracotta-tint); }
.challenges { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.challenges li { display: grid; grid-template-columns: 22px 1fr 120px 36px; gap: 10px; align-items: center; font-size: 14px; }
.challenge__check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--n-border-strong); display: grid; place-items: center; }
.challenges li.is-done .challenge__check { background: var(--forest-700); border-color: var(--forest-700); color: var(--cream-50); }
.challenges li.is-done .challenge__title { color: var(--n-text-muted); text-decoration: line-through; }
.challenge__bar { height: 8px; border-radius: 999px; background: var(--cream-200); overflow: hidden; }
.challenge__bar span { display: block; height: 100%; background: var(--forest-500); border-radius: inherit; transition: width 400ms ease; }
.challenge__n { font-variant-numeric: tabular-nums; color: var(--n-text-muted); font-size: 13px; text-align: right; }
@media (max-width: 600px) { .challenges li { grid-template-columns: 22px 1fr 44px; } .challenge__bar { grid-column: 2 / 4; grid-row: 2; } }
.route-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.route-card { display: flex; gap: 12px; padding: 16px; border-radius: var(--n-radius-lg); background: var(--n-surface); border: 1px solid var(--n-border); color: inherit; text-decoration: none; transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease; }
.route-card:hover { border-color: var(--forest-500); transform: translateY(-2px); box-shadow: var(--n-shadow-sm); }
.route-card[hidden] { display: none; }
.route-card__icon { flex-shrink: 0; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--sage-100); color: var(--forest-700); }
.route-card__body { display: grid; gap: 3px; min-width: 0; }
.route-card__body strong { font-family: var(--n-font-display); font-size: 19px; line-height: 1.15; }
.route-card__kind { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--terracotta-text); }
.route-card__done { font-size: 12px; font-weight: 700; color: var(--forest-700); }
.route-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.route-note { display: flex; gap: 8px; align-items: flex-start; max-width: 80ch; }
.route-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.route-map-wrap { position: sticky; top: calc(var(--header-h) + 16px); }
.route-map { height: min(70vh, 560px); border-radius: var(--n-radius-lg); overflow: hidden; border: 1px solid var(--n-border); background: var(--sage-50); }
.route-pin { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--cat); color: #fff; font-weight: 800; font-size: 14px; border: 3px solid var(--n-surface); box-shadow: 0 4px 10px rgb(16 52 42 / 0.3); text-decoration: none; }
/* Percurso vertical ilustrado: um caminho tracejado com paragens numeradas. */
.trail { list-style: none; margin: 0; padding: 8px 0 8px 0; position: relative;
  background-image: radial-gradient(circle at 1px 1px, var(--sage-200) 1px, transparent 0); background-size: 22px 22px; border-radius: var(--n-radius-lg); }
.trail::before { content: ""; position: absolute; left: 31px; top: 28px; bottom: 36px; width: 0; border-left: 4px dashed var(--terracotta-500); opacity: 0.55; }
.trail__stop { position: relative; display: grid; grid-template-columns: 64px 1fr; align-items: start; padding: 0 8px 18px 0; }
.trail__node { grid-column: 1; justify-self: center; z-index: 1; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--cat); color: #fff; font-weight: 800; border: 4px solid var(--n-bg); box-shadow: 0 4px 12px rgb(16 52 42 / 0.22); }
.trail__leg { grid-column: 2; font-size: 12px; font-weight: 600; color: var(--terracotta-text); margin: -6px 0 6px; }
.trail__stop:has(.trail__leg) .trail__node { margin-top: 14px; }
.trail__card { grid-column: 2; display: flex; gap: 12px; padding: 14px; border-radius: var(--n-radius-lg); background: var(--n-surface); border: 1px solid var(--n-border); box-shadow: var(--n-shadow-sm); }
.trail__card h2 { font-size: 18px; margin: 0 0 2px; }
.trail__card p { margin: 0; }
.trail__icon { flex-shrink: 0; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--cat); color: #fff; }
.trail__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.trail__end { position: relative; display: flex; gap: 8px; align-items: center; padding-left: 18px; font-weight: 700; color: var(--terracotta-text); }
.n-btn.btn-visit[aria-pressed="true"] { background: var(--forest-700); color: var(--cream-50); border-color: var(--forest-700); }
.btn-visit[hidden] { display: none; }
@media (max-width: 900px) {
  .route-layout { grid-template-columns: 1fr; }
  .route-map-wrap { position: static; order: -1; }
  .route-map { height: 280px; }
}
/* Celebração de conquista */
.celebrate { position: fixed; z-index: 50; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 12px; align-items: center;
  width: min(440px, calc(100% - 24px)); padding: 14px 16px; border-radius: 18px; background: var(--forest-900); color: var(--cream-50); box-shadow: var(--n-shadow-lg);
  animation: celebrate-in 420ms cubic-bezier(.2, 1.4, .4, 1); overflow: hidden; }
.celebrate strong { display: block; }
.celebrate span span { font-size: 14px; color: var(--sage-200); }
.celebrate button { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; align-self: flex-start; }
.celebrate__medal { flex-shrink: 0; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--terracotta-500); color: var(--cream-50); animation: medal 900ms ease-out; }
.celebrate__spark i { position: absolute; left: 40px; top: 40px; width: 6px; height: 6px; border-radius: 2px; background: var(--terracotta-tint); opacity: 0; animation: spark 900ms ease-out forwards; }
.celebrate__spark i:nth-child(2n) { background: var(--sage-200); }
.celebrate__spark i:nth-child(1) { --dx: 40px; --dy: -30px; } .celebrate__spark i:nth-child(2) { --dx: -30px; --dy: -34px; }
.celebrate__spark i:nth-child(3) { --dx: 50px; --dy: 10px; } .celebrate__spark i:nth-child(4) { --dx: -40px; --dy: 16px; }
.celebrate__spark i:nth-child(5) { --dx: 14px; --dy: -46px; } .celebrate__spark i:nth-child(6) { --dx: -12px; --dy: 40px; }
.celebrate__spark i:nth-child(7) { --dx: 60px; --dy: -14px; } .celebrate__spark i:nth-child(8) { --dx: 30px; --dy: 36px; }
@keyframes celebrate-in { from { transform: translate(-50%, 30px) scale(.95); opacity: 0; } }
@keyframes medal { 30% { transform: scale(1.25) rotate(-8deg); } 60% { transform: scale(.95) rotate(4deg); } }
@keyframes spark { 15% { opacity: 1; } to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(120deg); } }
@media (prefers-reduced-motion: reduce) {
  .celebrate, .celebrate__medal, .celebrate__spark i { animation: none; }
  .celebrate__spark { display: none; }
  .route-card, .challenge__bar span { transition: none; }
}
.update-toast { position: fixed; z-index: 60; left: 50%; bottom: calc(16px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 10px; align-items: center;
  padding: 10px 14px; border-radius: 14px; background: var(--n-surface); border: 1px solid var(--n-border); box-shadow: var(--n-shadow-lg); font-size: 14px; width: max-content; max-width: calc(100% - 24px); flex-wrap: wrap; }
.footer-install { color: #F3EBDA; font-size: 15px; }
[data-install][hidden] { display: none; }
.offline-list { display: grid; gap: 8px; padding-left: 20px; }
.legal-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.legal-dl dt { font-weight: 600; color: var(--n-text-secondary); }
.legal-dl dd { margin: 0; }

/* ==========================================================================
   Sistema de movimento — um só vocabulário para todo o portal
   Durações: rápida (feedback), base (estado), lenta (entrada). Curvas: saída suave e mola discreta.
   Tudo desliga com prefers-reduced-motion; o conteúdo nunca depende da animação para aparecer.
   ========================================================================== */
:root {
  --dur-fast: 140ms; --dur-base: 240ms; --dur-slow: 480ms;
  --ease-out: cubic-bezier(.2, .9, .3, 1); --ease-spring: cubic-bezier(.2, 1.4, .4, 1); --ease-in-out: cubic-bezier(.6, 0, .3, 1);
}

/* MotionReveal: elementos com [data-reveal] entram ao ficarem visíveis (só com JavaScript ativo). */
.motion-ready [data-reveal] { opacity: 0; transform: translateY(12px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); transition-delay: calc(var(--i, 0) * 60ms); }
.motion-ready [data-reveal].is-in { opacity: 1; transform: none; }

/* Botões: feedback de clique e ícones com um pequeno avanço no hover. */
.n-btn { transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease, box-shadow var(--dur-base) var(--ease-out), transform var(--dur-fast) ease; }
.n-btn:active:not([aria-disabled="true"]) { transform: scale(.97); }
.n-btn .icon { transition: transform var(--dur-base) var(--ease-spring); }
@media (hover: hover) {
  .n-btn--primary:hover { box-shadow: 0 6px 18px rgb(16 52 42 / 0.18); }
  .n-btn:hover .icon[data-nudge], .n-btn:hover > .icon:first-child { transform: translateX(2px); }
}

/* Cartões: elevação suave e consistente. */
.route-card, .quick-tile, .zone-card, .line-card, .today-card, .slot-card, .benefit {
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-fast) ease; }

/* CinematicMedia: fotografia/ilustração com vídeo opcional. A camada de vídeo só aparece quando pode tocar. */
.cine { position: relative; margin: 0; overflow: hidden; border-radius: var(--n-radius-lg); background: var(--cream-100); isolation: isolate; }
.cine__poster, .cine__video { display: block; width: 100%; height: 100%; object-fit: cover; }
.cine__video { position: absolute; inset: 0; opacity: 0; transition: opacity var(--dur-slow) var(--ease-out); }
.cine.is-playing .cine__video { opacity: 1; }
.cine--kenburns .cine__poster { animation: kenburns 18s var(--ease-in-out) both; }
@keyframes kenburns { from { transform: scale(1.06) translate(-1%, 1%); } to { transform: scale(1) translate(0, 0); } }
.cine__badge { position: absolute; left: 10px; top: 10px; z-index: 2; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  background: rgb(252 248 240 / 0.92); color: var(--forest-900); box-shadow: 0 1px 4px rgb(16 52 42 / 0.15); }
.cine--reconstruction .cine__badge { background: var(--terracotta-tint); color: var(--terracotta-text); }
.cine__toggle { position: absolute; right: 10px; bottom: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgb(16 52 42 / 0.72); color: var(--cream-50); }
.cine__toggle[hidden] { display: none; }
.cine__toggle:focus-visible { outline: 3px solid var(--cream-50); outline-offset: 2px; }
.cine figcaption, .cine__credit { position: absolute; right: 10px; bottom: 8px; z-index: 1; font-size: 10px; color: var(--n-text-muted); background: rgb(252 248 240 / 0.85); padding: 1px 6px; border-radius: 6px; }
.cine:has(.cine__toggle:not([hidden])) .cine__credit { right: 52px; }

@media (prefers-reduced-motion: reduce) {
  .motion-ready [data-reveal] { opacity: 1; transform: none; transition: none; }
  .n-btn, .n-btn .icon, .route-card, .quick-tile, .zone-card, .line-card, .today-card, .slot-card, .benefit { transition: none; }
  .n-btn:active:not([aria-disabled="true"]) { transform: none; }
  .cine--kenburns .cine__poster { animation: none; }
  .cine__video { display: none; }
}

/* Composição editorial (Hoje por cá, Descobrir): texto + média, com resumo vivo. */
.editorial-head { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: center; margin-bottom: var(--n-space-8); }
.editorial-head .page-head { margin-bottom: 0; }
.editorial-head__media { box-shadow: 0 18px 40px rgb(16 52 42 / 0.12); }
@media (max-width: 760px) { .editorial-head { grid-template-columns: 1fr; gap: 16px; } .editorial-head__media { max-height: 220px; } }
.today-pulse { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.today-pulse span { padding: 6px 12px; border-radius: 999px; background: var(--n-surface); border: 1px solid var(--n-border); font-size: 14px; color: var(--n-text-secondary); }
.today-pulse strong { font-family: var(--n-font-display); font-size: 18px; color: var(--forest-800); margin-right: 2px; }
.today-card.is-highlight { border-color: rgb(203 100 64 / 0.45); box-shadow: inset 4px 0 0 var(--terracotta-500); }
@media (hover: hover) { .today-card:hover { box-shadow: var(--n-shadow-sm); } .today-card.is-highlight:hover { box-shadow: inset 4px 0 0 var(--terracotta-500), var(--n-shadow-sm); } }
/* Percurso que se desenha (só com JavaScript e sem movimento reduzido). */
.trail.is-drawing .trail__stop::before { content: ""; position: absolute; left: 31px; top: -18px; height: calc(100% + 18px); width: 4px; background: var(--n-bg); transform-origin: 50% 100%; transition: transform 700ms var(--ease-in-out); z-index: 0; }
.trail.is-drawing .trail__stop:first-child::before { display: none; }
.trail.is-drawing .trail__stop.is-in::before { transform: scaleY(0); }
.trail.is-drawing .trail__node { transform: scale(.4); opacity: 0; transition: transform var(--dur-slow) var(--ease-spring) 200ms, opacity var(--dur-base) ease 200ms; }
.trail.is-drawing .trail__card { opacity: 0; transform: translateX(12px); transition: opacity var(--dur-slow) var(--ease-out) 260ms, transform var(--dur-slow) var(--ease-out) 260ms; }
.trail.is-drawing .trail__stop.is-in .trail__node { transform: none; opacity: 1; }
.trail.is-drawing .trail__stop.is-in .trail__card { opacity: 1; transform: none; }
@media (hover: hover) { .trail__card { transition: box-shadow var(--dur-base) var(--ease-out); } .trail__card:hover { box-shadow: var(--n-shadow); } }
/* Histórias */
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.story-card { display: grid; gap: 10px; padding: 10px; border-radius: var(--n-radius-lg); background: var(--n-surface); border: 1px solid var(--n-border); color: inherit; text-decoration: none;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); margin-bottom: 16px; }
@media (hover: hover) { .story-card:hover { transform: translateY(-2px); box-shadow: var(--n-shadow); } .story-card:hover .cine__poster { transform: scale(1.03); } }
.story-card .cine__poster { transition: transform 900ms var(--ease-out); }
.story-card__body { display: grid; gap: 4px; padding: 0 4px 6px; }
.story-card__body strong { font-family: var(--n-font-display); font-size: 20px; line-height: 1.15; }
.story__body { margin: 20px 0; font-size: 18px; line-height: 1.6; }
@media (prefers-reduced-motion: reduce) { .story-card, .story-card .cine__poster { transition: none; } }
.editorial-head--compact { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); margin-bottom: var(--n-space-4); }
.editorial-head--compact .editorial-head__media { max-width: 360px; justify-self: end; width: 100%; }
@media (max-width: 760px) { .editorial-head--compact { grid-template-columns: 1fr; } .editorial-head--compact .editorial-head__media { display: none; } }
.cine__credit a { color: inherit; }
.editorial-head__media.is-portrait { max-height: 420px; max-width: 340px; justify-self: center; }

/* Cabeçalho com fotografia (photoHero): o texto assenta no céu da fotografia. */
:root { --dusk-900: #0A1E4E; --dusk-scrim: rgb(10 30 78 / 0.62); }
.photo-hero { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: flex-start;
  min-height: clamp(240px, 22vw, 320px); margin-bottom: var(--n-space-8); border-radius: var(--n-radius-lg); background: var(--dusk-900); color: var(--cream-50); }
.photo-hero__img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; }
.photo-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, var(--dusk-scrim) 0%, rgb(10 30 78 / 0.28) 48%, transparent 72%); }
.photo-hero__body { max-width: 620px; padding: clamp(20px, 3vw, 36px); }
.photo-hero__body .n-overline { color: var(--cream-100); opacity: 0.9; margin-bottom: 6px; }
.photo-hero__body h1 { color: var(--cream-50); margin: 0 0 10px; }
.photo-hero__body p { color: var(--cream-50); }
.photo-hero .today-pulse span { background: rgb(252 248 240 / 0.14); border-color: rgb(252 248 240 / 0.35); color: var(--cream-50);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.photo-hero .today-pulse strong { color: var(--cream-50); }
.photo-hero__badge { position: absolute; right: 14px; top: 14px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  background: rgb(252 248 240 / 0.92); color: var(--forest-900); }
.photo-hero__credit { position: absolute; right: 14px; bottom: 10px; font-size: 10px; color: var(--cream-50); background: rgb(10 30 78 / 0.55); padding: 1px 6px; border-radius: 6px; }
.photo-hero__credit a { color: inherit; }
@media (max-width: 760px) {
  .photo-hero { min-height: 0; margin-inline: calc(var(--n-space-4) * -1); border-radius: 0; }
  .photo-hero__img { object-position: 40% 70%; }
  .photo-hero__body { padding-top: 48px; padding-bottom: 96px; }
  .photo-hero::before { background: linear-gradient(180deg, var(--dusk-scrim) 0%, rgb(10 30 78 / 0.3) 55%, transparent 75%); }
}
.place-photo { max-width: 560px; margin: 0 0 var(--n-space-4); }
/* Participar: mesma largura e alinhamento das outras páginas; os formulários ficam com uma largura confortável. */
.participate-body { max-width: 760px; }

/* Farmácias de Serviço */
.pharm-duty { margin-bottom: var(--n-space-8); }
.pharm-callout .actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.pharm-callout .actions .n-btn { min-height: 48px; }
.pharm-widget { padding: 16px; border-radius: var(--n-radius-lg); background: var(--n-surface); border: 1px solid var(--n-border); }
.pharm-widget .n-btn { min-height: 48px; }
.pharm-frame { display: block; width: 100%; min-height: 420px; border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); background: var(--cream-50); }
.pharm-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); margin-bottom: 12px; }
.pharm-list .s-card__name a { color: inherit; text-decoration: none; }
.pharm-list .s-card__name a:hover { text-decoration: underline; }
.duty-filter-box { margin-bottom: 12px; }
.duty-filter-box summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--forest-700); }
.duty-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.duty-filters .n-field { flex: 1 1 140px; min-width: 0; margin: 0; }
.duty-filters .n-btn { min-height: 44px; }
.duty-ref { margin: 0 0 12px; font-size: var(--n-text-small); color: var(--n-text-secondary); }
.duty-ref::first-letter { text-transform: uppercase; }
.duty-note { display: flex; gap: 8px; margin: 0 0 12px; padding: 10px 12px; border-radius: var(--n-radius); background: var(--sage-50); font-size: var(--n-text-small); }
.duty-note .icon { flex: none; margin-top: 2px; }
.duty-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.duty-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--n-radius-lg); background: var(--n-surface); border: 1px solid var(--n-border); }
.duty-card__name { margin: 0; font-size: 20px; }
.duty-card__type { margin: 0; }
.duty-card__line { display: flex; gap: 8px; margin: 0; }
.duty-card__line .icon { flex: none; margin-top: 3px; color: var(--forest-700); }
.duty-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.duty-card__actions .n-btn { flex: 1 1 auto; min-height: 48px; }
.duty-card__source { margin: 4px 0 0; font-size: var(--n-text-caption, 13px); color: var(--n-text-secondary); }
.duty-map-wrap { margin-top: 14px; }
.duty-map { height: 340px; border-radius: var(--n-radius-lg); border: 1px solid var(--n-border); overflow: hidden; }
.pharm-how ul { padding-left: 1.2em; max-width: 70ch; }
.pharm-how li { margin-bottom: 6px; }

/* ---------- Participar: primeiro as ações, depois um formulário de cada vez ---------- */
.participate-actions__title { font-size: 20px; margin: 0 0 12px; }
.participate-actions ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.participate-action { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 76px; height: 100%; box-sizing: border-box;
  padding: 14px 16px; border-radius: var(--n-radius-lg); border: 1px solid var(--n-border); background: var(--n-surface); color: var(--n-text); text-decoration: none;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease, transform var(--dur-fast) ease; }
.participate-action:hover { border-color: var(--forest-500); background: var(--sage-50); }
.participate-action:active { transform: scale(0.99); }
.participate-action:focus-visible { outline: 3px solid var(--forest-700); outline-offset: 2px; }
.participate-action__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--sage-100); color: var(--forest-700); }
.participate-action__text { display: grid; gap: 2px; }
.participate-action__text strong { font-size: 17px; }
.participate-action__text span { font-size: var(--n-text-small); color: var(--n-text-secondary); }
.participate-action__go { color: var(--n-text-muted); }
.participate-note { margin: 14px 0 0; font-size: var(--n-text-small); color: var(--n-text-muted); }
.participate-panel { scroll-margin-top: calc(var(--header-h) + 12px); }
.participate-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-bottom: 4px; font-weight: 600; text-decoration: none; }
.participate-back .icon { transform: rotate(180deg); }
.participate-lead { margin: 0 0 12px; color: var(--n-text-secondary); }
.participate-steps { padding-left: 1.3em; display: grid; gap: 6px; }
.participate-more { margin-top: var(--n-space-8); padding-top: var(--n-space-4); border-top: 1px solid var(--n-border); font-size: var(--n-text-small); color: var(--n-text-secondary); }
.participate-more p { margin: 0 0 6px; }
.photo-chosen { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0 0; padding: 6px 6px 6px 12px; border-radius: var(--n-radius); background: var(--sage-50); font-size: var(--n-text-small); overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .participate-action { transition: none; } .participate-action:active { transform: none; } }

/* Farmácias: acesso às farmácias de serviço no topo da lista (mapa e Vista simples). */
.duty-tip-item { list-style: none; margin-bottom: 10px; }
.duty-tip { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 12px; border-radius: var(--n-radius-lg); background: var(--sage-50); border: 1px solid var(--sage-200); }
.duty-tip > .icon { flex: none; margin-top: 2px; color: var(--forest-700); }
.duty-tip > div { display: grid; gap: 4px; justify-items: start; }
.duty-tip span { font-size: var(--n-text-small); color: var(--n-text-secondary); }
.duty-tip .n-btn { margin-top: 6px; }
.duty-tip.is-closed { background: var(--terracotta-tint); border-color: rgb(203 100 64 / 0.3); }
.duty-tip.is-closed > .icon { color: var(--terracotta-text); }

/* public/css/explore.css */
/* Explorar: mapa + diretório */

.explore {
  position: relative;
  height: calc(100dvh - var(--header-h));
  min-height: 480px;
  display: grid;
  grid-template-columns: var(--panel-w) 1fr;
  background: var(--sage-50);
}

/* ---------- Painel ---------- */
.panel {
  position: relative; z-index: 5;
  display: flex; flex-direction: column; min-height: 0;
  background: var(--n-bg);
  border-right: 1px solid var(--n-border);
  box-shadow: 4px 0 24px rgb(16 52 42 / 0.06);
}
.panel__head { padding: var(--n-space-6) var(--n-space-5) var(--n-space-3); }
.panel__head .n-overline { margin: 0 0 6px; }
.panel__title { font-size: 34px; line-height: 1.02; margin: 0 0 var(--n-space-4); color: var(--forest-900); }
@media (max-height: 820px) and (min-width: 861px) { .panel__title br { display: none; } .panel__title { font-size: 30px; } .panel__head { padding-top: var(--n-space-4); } }
.is-filtering .panel__title, .is-filtering .panel__head .n-overline { display: none; }

.search { position: relative; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--n-text-muted); pointer-events: none; }
.search input { padding-left: 44px; padding-right: 44px; min-height: 50px; border-radius: 14px; font-size: 16px; background: var(--n-surface); box-shadow: var(--n-shadow-sm); }
.search__clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: none; border-radius: 50%; color: var(--n-text-muted); cursor: pointer; display: grid; place-items: center; }
.search__clear:hover { background: var(--cream-100); color: var(--n-text); }
.search__clear[hidden] { display: none; }

.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: var(--n-space-2) var(--n-space-5) var(--n-space-4); }
.cat-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 70px; padding: 8px 6px; border-radius: 14px;
  background: var(--n-surface); border: 1px solid var(--n-border);
  color: var(--cat, var(--forest-700)); font: inherit; font-size: 13px; font-weight: 600; line-height: 1.15; text-align: center;
  cursor: pointer; text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background-color 150ms ease;
}
.cat-tile span { color: var(--n-text); }
.cat-tile:hover { transform: translateY(-2px); box-shadow: var(--n-shadow); border-color: var(--cat); }
.cat-tile[aria-pressed="true"] { background: var(--cat); border-color: var(--cat); color: #fff; }
.cat-tile[aria-pressed="true"] span { color: #fff; }
.cat-tile .icon { width: 26px; height: 26px; }

.cat-strip { display: none; gap: 8px; overflow-x: auto; padding: 4px var(--n-space-5) var(--n-space-3); scrollbar-width: none; overscroll-behavior-x: contain; }
.cat-strip::-webkit-scrollbar { display: none; }
.cat-strip .n-chip { flex-shrink: 0; white-space: nowrap; background: var(--n-surface); }
.cat-strip .n-chip .icon { width: 16px; height: 16px; color: var(--cat); }
.cat-strip .n-chip[aria-pressed="true"] { background: var(--cat, var(--forest-700)); border-color: var(--cat, var(--forest-700)); color: #fff; }
.cat-strip .n-chip[aria-pressed="true"]::before { content: none; }
.cat-strip .n-chip[aria-pressed="true"] .icon { color: #fff; }
.is-filtering .cat-grid { display: none; }
.is-filtering .cat-strip { display: flex; }

.quick { padding: 0 var(--n-space-5) var(--n-space-3); gap: 6px; }
.quick a { min-height: 34px; padding: 5px 10px; font-size: 13px; }
.is-filtering .quick { display: none; }
.sub-strip { display: flex; gap: 6px; overflow-x: auto; padding: 0 var(--n-space-5) var(--n-space-3); scrollbar-width: none; }
.sub-strip[hidden] { display: none; }
.sub-strip .n-chip { min-height: 30px; font-size: 13px; flex-shrink: 0; }

.status-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px var(--n-space-5); border-top: 1px solid var(--n-border); border-bottom: 1px solid var(--n-border); background: var(--cream-100); font-size: 14px; color: var(--n-text-secondary); min-height: 44px; }
.status-bar strong { color: var(--n-text); }
.status-bar button { font-size: 13px; }

.results { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; list-style: none; margin: 0; padding: 0; }
.result {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center;
  width: 100%; padding: 12px var(--n-space-5); border: 0; border-bottom: 1px solid var(--n-border);
  background: transparent; text-align: left; font: inherit; color: inherit; cursor: pointer; text-decoration: none;
}
.result:hover, .result.is-hover { background: var(--n-surface); }
.result[aria-current="true"] { background: var(--sage-100); box-shadow: inset 3px 0 0 var(--forest-700); }
.result__icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--cat); }
.result__icon .icon { width: 20px; height: 20px; }
.result__name { font-weight: 600; line-height: 1.25; color: var(--n-text); display: block; }
.result__meta { font-size: 13px; color: var(--n-text-muted); line-height: 1.35; display: block; margin-top: 2px; }
.result__dist { font-size: 13px; color: var(--n-text-muted); white-space: nowrap; }
.result__sp { font-size: 11px; font-weight: 700; color: var(--terracotta-text); text-transform: uppercase; letter-spacing: 0.08em; }
.results-more { padding: var(--n-space-4) var(--n-space-5); text-align: center; }
.results-empty { padding: var(--n-space-8) var(--n-space-5); text-align: center; color: var(--n-text-secondary); }
.results-empty h3 { font-size: 18px; color: var(--n-text); margin-bottom: 6px; }

.panel__foot { padding: 10px var(--n-space-5) calc(10px + var(--safe-b)); border-top: 1px solid var(--n-border); font-size: 13px; color: var(--n-text-muted); display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.panel__foot a { color: var(--n-text-muted); }
.panel__foot > span { flex-basis: 100%; }

/* ---------- Mapa ---------- */
.map-wrap { position: relative; min-width: 0; min-height: 0; }
#map { position: absolute; inset: 0; background: #F1EADB; }
.map-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--n-space-6); text-align: center; color: var(--n-text-secondary); background:
  radial-gradient(circle at 30% 30%, var(--sage-100), transparent 60%), radial-gradient(circle at 70% 70%, var(--cream-200), transparent 55%), #F1EADB; }
.map-fallback[hidden] { display: none; }
.map-fallback .n-skeleton { width: 220px; height: 10px; margin: 10px auto 0; }

.map-controls { position: absolute; right: 16px; top: 16px; z-index: 3; display: flex; flex-direction: column; gap: 8px; }
.map-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--n-border);
  background: var(--n-surface); color: var(--forest-800); display: grid; place-items: center; cursor: pointer;
  box-shadow: var(--n-shadow); transition: background-color 150ms ease;
}
.map-btn:hover { background: var(--cream-50); }
.map-btn[aria-busy="true"] { opacity: 0.6; cursor: progress; }
.map-btn[aria-pressed="true"] { background: var(--forest-700); color: var(--cream-50); border-color: var(--forest-700); }
.map-toast {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 4;
  max-width: min(440px, calc(100% - 140px)); padding: 10px 14px; border-radius: 12px;
  background: var(--forest-900); color: var(--cream-50); font-size: 14px; box-shadow: var(--n-shadow-lg);
  display: flex; gap: 10px; align-items: flex-start;
}
.map-toast[hidden] { display: none; }
.map-toast button { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; margin-left: auto; }
.map-attrib-note { position: absolute; left: 8px; bottom: 6px; z-index: 2; font-size: 11px; }

/* MapLibre */
.maplibregl-ctrl-attrib { font-size: 11px; background: rgb(252 248 240 / 0.85) !important; }
.maplibregl-ctrl-attrib a { color: var(--n-text-secondary); }
.maplibregl-canvas:focus-visible { outline: 3px solid var(--forest-500); outline-offset: -3px; }
.maplibregl-ctrl-group { border-radius: 12px !important; box-shadow: var(--n-shadow) !important; border: 1px solid var(--n-border); overflow: hidden; }
.maplibregl-ctrl-group button { width: 42px !important; height: 42px !important; }
.maplibregl-ctrl-bottom-right { margin-bottom: 4px; }

/* Etiqueta do marcador selecionado (HTML sobre o mapa) */
.pin-label {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px;
  background: var(--n-surface); border-radius: 999px; box-shadow: 0 6px 18px rgb(16 52 42 / 0.22);
  font-weight: 600; font-size: 14px; color: var(--n-text); white-space: nowrap; pointer-events: none;
  transform: translateY(-38px); animation: pin-pop 220ms cubic-bezier(.2, 1.4, .4, 1);
}
.pin-label__text { max-width: min(60vw, 280px); overflow: hidden; text-overflow: ellipsis; }
.pin-label__icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--cat); }
.pin-label__icon .icon { width: 17px; height: 17px; }
.pin-label::after { content: ""; position: absolute; left: 20px; bottom: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: var(--n-surface); }
@keyframes pin-pop { from { transform: translateY(-26px) scale(.85); opacity: 0; } }

/* ---------- Ficha (painel) ---------- */
.sheet {
  position: absolute; z-index: 6; right: 16px; bottom: 16px; width: 380px; max-height: calc(100% - 32px);
  display: flex; flex-direction: column; background: var(--n-surface); border-radius: 20px;
  box-shadow: 0 18px 48px rgb(16 52 42 / 0.22); border: 1px solid var(--n-border); overflow: hidden;
  animation: sheet-in 260ms cubic-bezier(.2, .9, .3, 1);
}
.sheet[hidden] { display: none; }
@keyframes sheet-in { from { transform: translateY(16px); opacity: 0; } }
.sheet__handle { display: none; }
.sheet__bar { display: flex; justify-content: flex-end; gap: 4px; padding: 8px 8px 0; position: absolute; right: 0; top: 0; z-index: 2; }
.sheet__bar button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgb(255 253 248 / 0.92); color: var(--n-text); cursor: pointer; display: grid; place-items: center; box-shadow: var(--n-shadow-sm); }
.sheet__bar button:hover { background: var(--cream-100); }
.sheet__body { overflow-y: auto; overscroll-behavior: contain; padding: var(--n-space-5); }
.sheet__hero { height: 6px; background: var(--cat); margin: calc(var(--n-space-5) * -1) calc(var(--n-space-5) * -1) var(--n-space-5); }
.sheet__head { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; padding-right: 72px; }
.sheet__head .cat-badge { width: 48px; height: 48px; border-radius: 14px; background: var(--cat); }
.sheet__head h2 { font-size: 22px; line-height: 1.15; margin: 0; }
.sheet__sub { font-size: 14px; color: var(--n-text-muted); margin: 2px 0 0; }
.sheet__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--n-space-3) 0; }
.sheet__actions { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin: var(--n-space-4) 0; }
.sheet__actions .n-btn { min-height: 46px; }
.sheet .facts { border-radius: 14px; }
.sheet .fact { padding: 11px 14px; font-size: 15px; }
.sheet__links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: var(--n-space-4); font-size: 14px; }
.sheet__prov { font-size: 12px; color: var(--n-text-muted); margin-top: var(--n-space-3); }
.sheet .n-skeleton--title { width: 70%; }

/* Alternância mapa/lista (mobile) */
.view-toggle { display: none; }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .explore { display: block; height: calc(100dvh - var(--header-h)); min-height: 0; }
  .panel { position: absolute; inset: 0 0 auto 0; z-index: 7; background: transparent; border: 0; box-shadow: none; pointer-events: none; }
  .panel > * { pointer-events: auto; }
  .panel__head { padding: 10px 12px 6px; }
  .panel__head .n-overline, .panel__title { display: none; }
  .search input { min-height: 48px; box-shadow: 0 6px 18px rgb(16 52 42 / 0.14); border-color: transparent; }
  .cat-grid { display: none; }
  .cat-strip { display: flex; padding: 2px 12px 8px; }
  .cat-strip .n-chip { box-shadow: 0 2px 8px rgb(16 52 42 / 0.12); border-color: transparent; min-height: 36px; }
  .sub-strip { padding: 0 12px 8px; }
  .sub-strip .n-chip { box-shadow: 0 2px 8px rgb(16 52 42 / 0.1); }
  .status-bar, .results, .results-more, .panel__foot, .panel .ad-inline { display: none; }

  .map-wrap { position: absolute; inset: 0; }
  .maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right { bottom: calc(72px + var(--safe-b)); }
  .maplibregl-ctrl-bottom-right .maplibregl-ctrl-group { display: none; }
  .map-controls { top: auto; bottom: calc(84px + var(--safe-b)); right: 12px; }

  .view-toggle {
    display: inline-flex; position: absolute; z-index: 8; left: 50%; transform: translateX(-50%);
    bottom: calc(18px + var(--safe-b)); background: var(--forest-900); border-radius: 999px; padding: 4px; box-shadow: var(--n-shadow-lg);
  }
  .view-toggle button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: #D9E2D6; font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; }
  .view-toggle button[aria-pressed="true"] { background: var(--cream-50); color: var(--forest-900); }

  /* Vista de lista */
  .explore[data-view="list"] .panel { position: absolute; inset: 0; background: var(--n-bg); display: flex; overflow: hidden; }
  .explore[data-view="list"] .status-bar, .explore[data-view="list"] .results, .explore[data-view="list"] .panel__foot, .explore[data-view="list"] .results-more, .explore[data-view="list"] .panel .ad-inline { display: flex; }
  .explore[data-view="list"] .results { display: block; padding-bottom: 88px; }
  .explore[data-view="list"] .quick { display: flex; flex-wrap: nowrap; overflow-x: auto; padding: 0 12px 8px; }
  .explore[data-view="list"] .quick a { flex-shrink: 0; }
  .explore[data-view="list"] .results-more { display: block; }
  .explore[data-view="list"] .map-controls { display: none; }
  .explore[data-view="list"] .search input { box-shadow: var(--n-shadow-sm); border-color: var(--n-border-strong); }
  .explore[data-view="list"] .cat-strip .n-chip { box-shadow: none; border-color: var(--n-border-strong); }

  /* Ficha como painel inferior deslizante */
  .sheet { left: 0; right: 0; bottom: 0; width: auto; max-height: 82%; border-radius: 22px 22px 0 0; border-bottom: 0; padding-bottom: var(--safe-b); z-index: 9; animation-name: sheet-up; transition: max-height 240ms ease; }
  .sheet.is-collapsed { max-height: 168px; }
  .sheet.is-half { max-height: 50%; }
  .sheet.is-collapsed .sheet__body { overflow: hidden; }
  .sheet__handle { display: block; width: 100%; height: 26px; border: 0; background: none; cursor: grab; position: relative; touch-action: none; flex-shrink: 0; }
  .sheet__handle::before { content: ""; position: absolute; left: 50%; top: 10px; width: 44px; height: 5px; border-radius: 3px; background: var(--n-border-strong); transform: translateX(-50%); }
  .sheet__bar { top: 18px; }
  .sheet__body { padding-top: 4px; }
  .sheet__hero { display: none; }
  @keyframes sheet-up { from { transform: translateY(40%); } }
  .explore.has-sheet .view-toggle { display: none; }
  .explore.has-sheet .map-controls { display: none; }
  .map-toast { top: auto; bottom: calc(84px + var(--safe-b)); max-width: calc(100% - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  .sheet, .pin-label, .cat-tile { animation: none; transition: none; }
}

/* ---------- Revisão UX ---------- */
/* As faixas de categorias desvanecem na borda para mostrar que continuam (desktop). */
.result__meta .open-state { font-size: 12px; gap: 4px; }
.result__meta .open-state::before { width: 7px; height: 7px; }
.result__name { overflow-wrap: anywhere; }
.link-btn { background: none; border: 0; padding: 0 2px; font: inherit; font-size: 13px; color: var(--forest-700); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--forest-900); }
.status-bar [data-count] { min-width: 0; }
/* Desktop: o painel desliza todo (a lista nunca fica espremida); a pesquisa fica fixa no topo. */
@media (min-width: 861px) {
  .panel { overflow-y: auto; overscroll-behavior: contain; }
  /* Pesquisa + categorias + subcategorias formam um único bloco fixo: nada passa por baixo. */
  .panel__top { position: sticky; top: 0; z-index: 3; background: var(--n-bg); }
  .is-filtering .panel__top { box-shadow: 0 1px 0 var(--n-border); }
  .results { flex: none; overflow: visible; }
  .panel__foot { margin-top: auto; }
}
/* Telemóvel, vista de lista: o painel desliza todo e o «Mostrar mais» não fica sob o seletor Mapa/Lista. */
@media (max-width: 860px) {
  .explore[data-view="list"] .panel { overflow-y: auto; overscroll-behavior: contain; }
  .explore[data-view="list"] .panel__top { position: sticky; top: 0; z-index: 3; background: var(--n-bg); box-shadow: 0 1px 0 var(--n-border); }
  .explore[data-view="list"] .results { flex: none; overflow: visible; padding-bottom: 0; }
  .explore[data-view="list"] .results-more { padding-bottom: calc(96px + var(--safe-b)); }
  .explore[data-view="list"] .panel__foot { display: none; }
}

/* ---------- Faixas com deslize lateral: setas e desvanecimento só quando há mais para ver ---------- */
.scroller { position: relative; }
.scroller::before, .scroller::after {
  content: ""; position: absolute; top: 0; bottom: 6px; width: 48px; pointer-events: none; z-index: 1;
  opacity: 0; transition: opacity 150ms ease;
}
.scroller::before { left: 0; background: linear-gradient(90deg, var(--n-bg) 30%, transparent); }
.scroller::after { right: 0; background: linear-gradient(270deg, var(--n-bg) 30%, transparent); }
.scroller.can-left::before, .scroller.can-right::after { opacity: 1; }
.scroller__btn {
  position: absolute; top: calc(50% - 4px); transform: translateY(-50%); z-index: 2;
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--n-border-strong);
  background: var(--n-surface); color: var(--forest-800); box-shadow: var(--n-shadow-sm);
  display: none; place-items: center; cursor: pointer; padding: 0;
}
.scroller__btn:hover { background: var(--cream-50); border-color: var(--forest-500); }
.scroller__btn--prev { left: 8px; }
.scroller__btn--next { right: 8px; }
.scroller.can-left .scroller__btn--prev, .scroller.can-right .scroller__btn--next { display: grid; }
.scroller__btn .icon { width: 16px; height: 16px; }
@media (max-width: 860px) {
  /* Sobre o mapa não há fundo: sem desvanecimento, mas mantêm-se as setas. */
  .explore[data-view="map"] .scroller::before, .explore[data-view="map"] .scroller::after { display: none; }
  .scroller__btn { width: 30px; height: 30px; box-shadow: 0 2px 8px rgb(16 52 42 / 0.18); }
}
@media (prefers-reduced-motion: reduce) { .scroller::before, .scroller::after { transition: none; } }
.quick { scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
@media (max-width: 860px) {
  /* Com um filtro ativo, os contactos rápidos saem do bloco fixo para dar espaço à lista. */
  .explore[data-view="list"].has-filter .quick { display: none; }
}

/* ==========================================================================
   Agualva-Cacém 3.0 — refinamentos do painel, mapa e ficha
   ========================================================================== */

/* Contadores dinâmicos por categoria (acompanham a pesquisa e os filtros) */
.cat-tile { position: relative; }
.cat-count { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; color: var(--n-text-muted); }
.cat-tile .cat-count { position: absolute; top: 7px; right: 8px; padding: 3px 6px; border-radius: 999px; background: var(--cream-100); color: var(--n-text-secondary); }
.cat-tile[aria-pressed="true"] .cat-count { background: rgb(255 255 255 / 0.22); color: var(--cream-50); }
.n-chip .cat-count { margin-left: 2px; opacity: 0.85; }
.cat-strip .n-chip[aria-pressed="true"] .cat-count { color: var(--cream-50); }
.cat-tile.is-empty, .cat-strip .n-chip.is-empty { opacity: 0.55; }
.cat-tile:focus-visible, .cat-strip .n-chip:focus-visible { outline: 3px solid var(--forest-500); outline-offset: 2px; }
.cat-tile:active { transform: translateY(0) scale(0.98); }

/* Sugestões de pesquisa (campo vazio e focado) */
.search-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 6;
  display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; border-radius: 14px;
  background: var(--n-surface); border: 1px solid var(--n-border); box-shadow: var(--n-shadow-lg);
  animation: suggest-in 160ms ease-out;
}
.search-suggest[hidden] { display: none; }
.search-suggest__title { width: 100%; margin: 0 0 2px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--n-text-muted); }
.search-suggest .n-chip { min-height: 32px; font-size: 13px; }
@keyframes suggest-in { from { opacity: 0; transform: translateY(-4px); } }

/* Barra de estado: contagem com realce breve quando muda, nota de correção ortográfica */
.status-bar [data-count].bump strong { animation: count-bump 360ms ease-out; display: inline-block; }
@keyframes count-bump { 40% { transform: scale(1.18); color: var(--forest-700); } }
.status-note { display: block; font-size: 12px; color: var(--n-text-muted); }
.status-sos { display: none; }

/* Filtros secundários */
.opt-strip { display: flex; gap: 6px; overflow-x: auto; padding: 8px var(--n-space-5); border-bottom: 1px solid var(--n-border); scrollbar-width: none; }
.opt-strip::-webkit-scrollbar { display: none; }
.opt-strip .n-chip { flex-shrink: 0; min-height: 32px; font-size: 13px; gap: 6px; background: var(--n-surface); }
.opt-strip .n-chip .icon { color: var(--forest-500); }
.opt-strip .n-chip[aria-pressed="true"] .icon { color: var(--cream-50); }
.opt-strip .n-chip[aria-pressed="true"]::before { content: none; }
.n-chip--area { background: var(--forest-700) !important; color: var(--cream-50); border-color: var(--forest-700); }
.n-chip--area .icon { color: var(--cream-50) !important; }
.n-chip--area[hidden] { display: none; }

/* Lista: entrada suave ao mudar os resultados */
.results.is-fresh > li { animation: result-in 240ms cubic-bezier(.2, .9, .3, 1) both; }
.results.is-fresh > li:nth-child(2) { animation-delay: 20ms; } .results.is-fresh > li:nth-child(3) { animation-delay: 40ms; }
.results.is-fresh > li:nth-child(4) { animation-delay: 60ms; } .results.is-fresh > li:nth-child(5) { animation-delay: 80ms; }
.results.is-fresh > li:nth-child(n+6) { animation-delay: 100ms; }
@keyframes result-in { from { opacity: 0; transform: translateY(6px); } }
.result { transition: background-color 150ms ease, box-shadow 150ms ease; }
.result:hover .result__icon, .result.is-hover .result__icon { transform: scale(1.06); }
.result__icon { transition: transform 150ms ease; box-shadow: 0 2px 6px rgb(16 52 42 / 0.14); }
.result[aria-current="true"] { background: var(--sage-100); box-shadow: inset 4px 0 0 var(--cat, var(--forest-700)); }
.result[aria-current="true"] .result__name { color: var(--forest-900); }
.result__fav { display: inline-flex; vertical-align: -2px; margin-left: 6px; color: var(--terracotta-500); }
.result__fav .icon { fill: currentColor; }
.results-empty__icon { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--sage-100); color: var(--forest-700); }

/* Mapa: pesquisar nesta área, indicação de filtro, dicas nos botões */
.map-search-area {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 4;
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 0; background: var(--forest-700); color: var(--cream-50); font: inherit; font-size: 14px; font-weight: 600;
  box-shadow: var(--n-shadow-lg); cursor: pointer; animation: suggest-in 180ms ease-out;
}
.map-search-area:hover { background: var(--forest-800); }
.map-search-area[hidden] { display: none; }
.map-filter {
  position: absolute; top: 16px; left: 16px; z-index: 3; max-width: min(420px, calc(100% - 240px));
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 999px;
  background: var(--n-surface); border: 1px solid var(--n-border); box-shadow: var(--n-shadow); font-size: 13px; color: var(--n-text-secondary);
}
.map-filter[hidden] { display: none; }
.map-filter > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-filter strong { color: var(--n-text); }
.map-filter .icon { color: var(--forest-500); flex-shrink: 0; }
.map-filter button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--cream-100); color: var(--n-text); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.map-filter button:hover { background: var(--cream-200); }
.has-sheet .map-search-area { top: 16px; }
.map-btn, [data-tip] { position: relative; }
@media (hover: hover) and (min-width: 861px) {
  [data-tip]:hover::after, [data-tip]:focus-visible::after {
    content: attr(data-tip); position: absolute; z-index: 10; pointer-events: none; white-space: nowrap;
    padding: 5px 9px; border-radius: 8px; background: var(--forest-900); color: var(--cream-50); font-size: 12px; font-weight: 500;
    animation: suggest-in 120ms ease-out;
  }
  .map-btn[data-tip]:hover::after, .map-btn[data-tip]:focus-visible::after { right: calc(100% + 8px); top: 50%; transform: translateY(-50%); }
  .sheet__actions [data-tip]:hover::after, .sheet__actions [data-tip]:focus-visible::after { bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); }
}

/* Ficha */
.sheet__actions { grid-template-columns: 1fr repeat(3, auto); }
.btn-fav .icon { transition: transform 200ms cubic-bezier(.2, 1.6, .4, 1); }
.btn-fav[aria-pressed="true"] { color: var(--terracotta-500); border-color: var(--terracotta-500); background: var(--terracotta-tint); }
.btn-fav[aria-pressed="true"] .icon { fill: currentColor; }
.btn-fav.pop .icon { animation: fav-pop 380ms cubic-bezier(.2, 1.6, .4, 1); }
@keyframes fav-pop { 40% { transform: scale(1.35); } }
.sheet__photo { margin: 0; }
.sheet__photo img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; background: var(--cream-100); }
.sheet__photo figcaption { font-size: 11px; color: var(--n-text-muted); padding: 4px 2px 0; }
.access { font-weight: 600; }
.access--confirmed { color: var(--forest-700); }
.access--partial { color: var(--terracotta-text); }
.access--no { color: var(--n-text); }
.access--unknown { color: var(--n-text-muted); font-weight: 500; }
.line-badge { display: inline-block; min-width: 34px; padding: 2px 7px; margin: 0 2px 4px 0; border-radius: 6px; background: var(--forest-700); color: var(--cream-50); font-size: 12px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.transit-list { list-style: none; margin: 0 0 2px; padding: 0; display: grid; gap: 4px; }
.transit-list .link-btn { font-size: 14px; text-align: left; }
.list-handle { display: none; }

/* ---------- Telemóvel: resultados num painel inferior com três alturas ---------- */
@media (max-width: 860px) {
  .explore { --list-h: calc(66px + var(--safe-b)); }
  .explore[data-snap="half"] { --list-h: 50dvh; }
  .list-handle {
    display: block; width: 100%; height: 22px; flex-shrink: 0; border: 0; padding: 0; background: none; cursor: grab;
    position: relative; touch-action: none;
  }
  .list-handle::before { content: ""; position: absolute; left: 50%; top: 8px; width: 40px; height: 5px; border-radius: 3px; background: var(--n-border-strong); transform: translateX(-50%); }
  .list-handle:focus-visible { outline: 3px solid var(--forest-500); outline-offset: -3px; }

  .explore[data-view="map"] .panel__list {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 2; height: var(--list-h);
    display: flex; flex-direction: column; background: var(--n-bg); border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 28px rgb(16 52 42 / 0.16); padding-bottom: var(--safe-b); overflow: hidden;
    transition: height 280ms cubic-bezier(.2, .9, .3, 1);
  }
  .explore[data-view="map"] .status-bar { display: flex; border: 0; background: transparent; padding: 0 16px 8px; min-height: 40px; }
  .explore[data-view="map"] .status-sos {
    display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 6px 10px; border-radius: 999px;
    background: var(--terracotta-tint); color: var(--terracotta-text); font-weight: 700; font-size: 13px; text-decoration: none; white-space: nowrap;
  }
  .explore[data-view="map"] .status-bar [data-count] { flex: 1; }
  .explore[data-view="map"] .opt-strip { display: none; }
  .explore[data-snap="half"] .opt-strip { display: flex; padding: 0 12px 8px; }
  .explore[data-snap="half"] .results { display: block; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--n-border); }
  .explore[data-snap="half"] .results-more { display: block; }
  .explore[data-view="map"] .panel__foot { display: none; }
  .explore.has-sheet[data-view="map"] .panel__list { display: none; }

  .explore[data-view="map"] .view-toggle { bottom: calc(var(--list-h) + 12px); transition: bottom 280ms cubic-bezier(.2, .9, .3, 1); }
  .explore[data-snap="half"] .view-toggle { display: none; }
  .explore[data-view="map"] .map-controls { bottom: calc(var(--list-h) + 12px); transition: bottom 280ms cubic-bezier(.2, .9, .3, 1); }
  .explore[data-view="map"] .maplibregl-ctrl-bottom-left { bottom: calc(var(--list-h) + 66px); }
  .explore[data-snap="half"] .maplibregl-ctrl-bottom-left { bottom: calc(var(--list-h) + 2px); }
  .map-toast { bottom: calc(var(--list-h) + 70px); }
  .explore[data-snap="half"] .map-toast { bottom: calc(var(--list-h) + 12px); }
  .map-search-area { top: calc(var(--top-h, 110px) + 4px); min-height: 38px; font-size: 13px; }
  .map-filter { display: none; }
  .search-suggest { box-shadow: 0 10px 30px rgb(16 52 42 / 0.22); }

  /* Lista completa: a pega permite voltar a meio ecrã */
  .explore[data-view="list"] .list-handle { background: var(--n-bg); }
  .explore[data-view="list"] .opt-strip { padding: 8px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .results.is-fresh > li, .status-bar [data-count].bump strong, .search-suggest, .map-search-area, .btn-fav.pop .icon { animation: none; }
  .explore[data-view="map"] .panel__list, .explore[data-view="map"] .view-toggle, .explore[data-view="map"] .map-controls, .result, .result__icon { transition: none; }
}
.search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
@media (min-width: 861px) {
  /* Com a ficha aberta, avisos e «Pesquisar nesta área» centram-se na parte do mapa que fica à vista. */
  .explore.has-sheet .map-toast, .explore.has-sheet .map-search-area { left: calc((100% - 396px) / 2); }
  .explore.has-sheet .map-toast { max-width: min(400px, calc(100% - 440px)); }
}

/* ---------- Transportes ---------- */
a.line-badge { text-decoration: none; }
a.line-badge:hover { filter: brightness(1.1); }
.line-row { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.line-row .line-badge { margin: 0; font-size: 11px; min-width: 30px; padding: 1px 5px; }
.departures { margin: var(--n-space-4) 0; padding: 12px 14px; border-radius: 14px; background: var(--sage-50); border: 1px solid var(--n-border); }
.departures h2, .departures h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; }
.dep-list { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 6px; }
.dep-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.dep-list .line-badge { margin: 0; }
.dep-dest { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-time { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.15; }
.dep-kind { display: block; font-size: 11px; font-weight: 500; color: var(--n-text-muted); }
.dep-time.is-live { color: var(--forest-700); }
.dep-dot, .dep-live-key { color: var(--forest-500); }
.dep-dot { font-size: 9px; vertical-align: 2px; margin-right: 3px; animation: dep-pulse 1.6s ease-in-out infinite; }
@keyframes dep-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .dep-dot { animation: none; } }
.lines-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-bottom: var(--n-space-6); }
.line-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--n-surface); border: 1px solid var(--n-border); text-decoration: none; color: inherit; transition: border-color 150ms ease, box-shadow 150ms ease; }
.line-card:hover { border-color: var(--forest-500); box-shadow: var(--n-shadow-sm); }
.line-card .line-badge { flex-shrink: 0; margin: 0; }
.line-card__name { display: block; font-weight: 600; font-size: 14px; line-height: 1.3; }
.line-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.line-title .line-badge { font-size: 0.6em; padding: 4px 10px; }
.transit-section { margin-bottom: var(--n-space-8); }
.n-chip--sub[hidden] { display: none; }
.n-chip--sub { border-style: dashed; }

/* ==========================================================================
   Motion design do explorar (usa os tokens --dur-* e --ease-* do tema)
   ========================================================================== */
/* Apresentação integrada (primeira visita, computador): pequena cena por cima do título. */
.intro { position: relative; margin: 0 0 var(--n-space-4); animation: intro-in var(--dur-slow) var(--ease-out) both; }
.intro[hidden] { display: none; }
.intro .cine { border-radius: 16px; box-shadow: 0 10px 30px rgb(16 52 42 / 0.12); }
.intro__close { position: absolute; top: 8px; right: 8px; z-index: 3; width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgb(252 248 240 / 0.92); color: var(--n-text); box-shadow: 0 1px 4px rgb(16 52 42 / 0.15); }
.intro__close:hover { background: var(--cream-100); }
.intro.is-leaving { animation: intro-out var(--dur-base) var(--ease-in-out) both; }
@keyframes intro-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
@keyframes intro-out { to { opacity: 0; transform: translateY(-8px) scale(.97); } }
/* Revelação do título e entrada progressiva da interface (só na apresentação). */
.is-intro .panel__title { animation: title-reveal 720ms var(--ease-out) 120ms both; }
.is-intro .panel__head .n-overline { animation: fade-up var(--dur-slow) var(--ease-out) both; }
.is-intro .search { animation: fade-up var(--dur-slow) var(--ease-out) 260ms both; }
.is-intro .cat-grid > * { animation: fade-up var(--dur-slow) var(--ease-out) both; animation-delay: calc(340ms + var(--n, 0) * 35ms); }
.is-intro .quick, .is-intro .status-bar { animation: fade-up var(--dur-slow) var(--ease-out) 640ms both; }
@keyframes title-reveal { from { opacity: 0; clip-path: inset(0 0 100% 0); transform: translateY(14px); } to { opacity: 1; clip-path: inset(0 0 0 0); transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }
.cat-grid > :nth-child(1) { --n: 0 } .cat-grid > :nth-child(2) { --n: 1 } .cat-grid > :nth-child(3) { --n: 2 } .cat-grid > :nth-child(4) { --n: 3 } .cat-grid > :nth-child(5) { --n: 4 }
.cat-grid > :nth-child(6) { --n: 5 } .cat-grid > :nth-child(7) { --n: 6 } .cat-grid > :nth-child(8) { --n: 7 } .cat-grid > :nth-child(9) { --n: 8 }

/* Categorias: hover com a cor da categoria, ícone que responde ao escolher. */
.cat-tile { transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-fast) ease, background-color var(--dur-base) ease; }
.cat-tile .icon { transition: transform var(--dur-base) var(--ease-spring); }
@media (hover: hover) { .cat-tile:hover .icon { transform: translateY(-2px) scale(1.06); } }
.cat-tile[aria-pressed="true"] .icon, .cat-strip .n-chip[aria-pressed="true"] .icon { animation: icon-pick 420ms var(--ease-spring); }
@keyframes icon-pick { 40% { transform: scale(1.25) rotate(-6deg); } }
.n-chip { transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease, transform var(--dur-fast) ease; }
.n-chip:active { transform: scale(.96); }

/* Resultados: realce do selecionado com uma faixa que cresce. */
.result { position: relative; }
.result::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--cat, var(--forest-700)); transform: scaleY(0); transform-origin: 50% 50%; transition: transform var(--dur-base) var(--ease-spring); }
.result[aria-current="true"] { box-shadow: none; }
.result[aria-current="true"]::after { transform: scaleY(1); }

/* Ficha: entrada com escala ligeira e sombra que acompanha; saída curta. */
.sheet { animation: sheet-in var(--dur-base) var(--ease-out); transition: box-shadow var(--dur-base) ease; }
@keyframes sheet-in { from { transform: translateY(14px) scale(.985); opacity: 0; box-shadow: 0 4px 12px rgb(16 52 42 / 0.1); } }
.sheet.is-closing { animation: sheet-out 180ms var(--ease-in-out) forwards; }
@keyframes sheet-out { to { transform: translateY(12px) scale(.985); opacity: 0; } }
.sheet__body > * { animation: fade-up var(--dur-base) var(--ease-out) both; }
.sheet__body > :nth-child(2) { animation-delay: 40ms } .sheet__body > :nth-child(3) { animation-delay: 70ms } .sheet__body > :nth-child(n+4) { animation-delay: 100ms }
@media (max-width: 860px) {
  .sheet.is-closing { animation-name: sheet-down; }
  @keyframes sheet-down { to { transform: translateY(40%); opacity: 0; } }
}
.status-bar [data-count] strong { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .intro, .intro.is-leaving, .is-intro .panel__title, .is-intro .panel__head .n-overline, .is-intro .search, .is-intro .cat-grid > *, .is-intro .quick, .is-intro .status-bar,
  .cat-tile[aria-pressed="true"] .icon, .cat-strip .n-chip[aria-pressed="true"] .icon, .sheet, .sheet.is-closing, .sheet__body > * { animation: none; }
  .cat-tile .icon, .result::after, .n-chip { transition: none; }
}
.sheet__lines { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; }
.sheet__lines .line-badge { margin: 0; }

/* public/css/alva.css */
/* ============================================================
   Alva — mascote do portal (AlvaCharacter + AlvaAnimation)
   O SVG vem de public/js/alva/character.js; aqui ficam as cores (tokens do tema) e as animações por expressão.
   As animações só correm com .alva-anim (posta pelo controlador), param fora do ecrã (.is-paused) e com movimento reduzido.
   ============================================================ */
.alva { display: block; width: 100%; height: auto; overflow: visible; }
.alva-corpo { fill: var(--terracotta-500); }
.alva-tinta { fill: var(--forest-900); }
.alva-traco { fill: none; stroke: var(--forest-900); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.alva-fino { stroke-width: 2; }
.alva-membro { fill: none; stroke: var(--forest-900); stroke-width: 7; stroke-linecap: round; }
.alva-reflexo { fill: none; stroke: var(--cream-50); stroke-width: 3.2; stroke-linecap: round; opacity: 0.85; }
.alva-brilho, .alva-creme { fill: var(--cream-50); }
.alva-ribeira { fill: none; stroke: var(--sage-400); stroke-width: 2.4; stroke-linecap: round; }
.alva-lingua { fill: var(--terracotta-600); }
.alva-verde { fill: var(--forest-700); }
.alva-salvia { fill: var(--sage-400); }
.alva-contorno { stroke: var(--forest-900); stroke-width: 2.4; }
.alva--mini .alva-traco { stroke-width: 3.6; }
.alva--mini .alva-membro { stroke-width: 9; }
.alva--mini .alva-brilho { display: none; }
.alva--silhueta .alva-corpo { fill: var(--forest-900); }
/* Fundos escuros: braços e pés em sálvia para não desaparecerem. */
.alva--escuro .alva-membro { stroke: var(--sage-400); }
.alva--escuro .alva-pes { fill: var(--sage-400); }

/* ---------- Animações ---------- */
.alva g, .alva path, .alva rect, .alva circle, .alva ellipse { transform-box: view-box; }
.alva-mov { transform-origin: 62.5px 117px; }
.alva-olho { transform-box: fill-box; transform-origin: center; }
.alva-ponteiro { transform-origin: 14px 100px; }

@media (prefers-reduced-motion: no-preference) {
  .alva-anim .alva-olho { animation: alva-piscar 5.4s infinite; }
  .alva-anim .alva-ribeira { stroke-dasharray: 5 2.6; animation: alva-ribeira 2.4s linear infinite; }
  .alva-anim .alva-reflexos { animation: alva-brilho 6s var(--ease-in-out) infinite; }
  .alva-anim[data-expr="neutra"] .alva-mov { animation: alva-respirar 4s var(--ease-in-out) infinite; }
  .alva-anim[data-expr="neutra"] .alva-olhos { animation: alva-olhar 10s var(--ease-in-out) infinite; }
  .alva-anim[data-expr="feliz"] .alva-mov { animation: alva-pulo 0.7s var(--ease-spring) 1, alva-respirar 4s var(--ease-in-out) 0.7s infinite; }
  .alva-anim[data-expr="entusiasmada"] .alva-mov { animation: alva-salto 1.6s var(--ease-out) infinite; }
  .alva-anim[data-expr="entusiasmada"] .alva-p-braco-esq { animation: alva-acenar-e 0.8s var(--ease-in-out) infinite alternate; }
  .alva-anim[data-expr="entusiasmada"] .alva-p-braco-dir { animation: alva-acenar-d 0.8s var(--ease-in-out) infinite alternate; }
  .alva-anim[data-expr="curiosa"] .alva-mov { animation: alva-espreitar 3.4s var(--ease-in-out) infinite; }
  .alva-anim[data-expr="surpreendida"] .alva-mov { animation: alva-susto 0.5s var(--ease-spring) 1; }
  .alva-anim[data-expr="surpreendida"] .alva-olho { animation: none; }
  .alva-anim[data-expr="pensar"] .alva-mov { animation: alva-balancar 4.6s var(--ease-in-out) infinite; }
  .alva-anim[data-expr="pensar"] .alva-pontos circle { animation: alva-ponto 1.8s var(--ease-in-out) infinite; }
  .alva-anim[data-expr="pensar"] .alva-pontos circle:nth-child(2) { animation-delay: 0.25s; }
  .alva-anim[data-expr="pensar"] .alva-pontos circle:nth-child(3) { animation-delay: 0.5s; }
  .alva-anim[data-expr="explorar"] .alva-mov { animation: alva-balancar 3.8s var(--ease-in-out) infinite; }
  .alva-anim[data-expr="explorar"] .alva-ponteiro { animation: alva-ponteiro 2.4s var(--ease-in-out) infinite; }
  .alva-anim[data-expr="agradecer"] .alva-mov { animation: alva-venia 2.6s var(--ease-in-out) 2; }
  .alva-anim[data-expr="agradecer"] .alva-coracao { animation: alva-subir 2.6s var(--ease-out) 2 both; }
  .alva-anim[data-expr="celebrar"] .alva-mov { animation: alva-salto 1.1s var(--ease-out) 3, alva-respirar 4s var(--ease-in-out) 3.3s infinite; }
  .alva-anim[data-expr="celebrar"] .alva-p-braco-esq { animation: alva-acenar-e 0.55s var(--ease-in-out) 6 alternate; }
  .alva-anim[data-expr="celebrar"] .alva-p-braco-dir { animation: alva-acenar-d 0.55s var(--ease-in-out) 6 alternate; }
  .alva-anim[data-expr="celebrar"] .alva-faisca { animation: alva-faisca 1.1s var(--ease-out) 3 both; animation-delay: calc(var(--i) * 45ms); }
  .alva-anim[data-expr="confusa"] .alva-mov { animation: alva-encolher 2.4s var(--ease-in-out) 2; }
  .alva-anim[data-expr="confusa"] .alva-pergunta { animation: alva-balancar 2.4s var(--ease-in-out) infinite; transform-origin: 110px 26px; }
  .alva-anim[data-expr="descansar"] .alva-mov { animation: alva-respirar 6.5s var(--ease-in-out) infinite; }
  .alva-anim[data-expr="descansar"] .alva-olho { animation: none; }
  .alva-anim[data-expr="descansar"] .alva-zz { animation: alva-subir 4s var(--ease-in-out) infinite; }
  .alva-anim[data-expr="procurar"] .alva-olhos { animation: alva-procurar 2.6s var(--ease-in-out) infinite; }
  .alva-anim.is-paused, .alva-anim.is-paused * { animation-play-state: paused !important; }
}
@keyframes alva-piscar { 0%, 93%, 100% { transform: scaleY(1); } 95.5% { transform: scaleY(0.1); } }
@keyframes alva-ribeira { to { stroke-dashoffset: -7.6; } }
@keyframes alva-brilho { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
@keyframes alva-respirar { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, 1.025); } }
@keyframes alva-olhar { 0%, 60%, 100% { transform: translate(0, 0); } 65%, 73% { transform: translate(2.2px, 0); } 78%, 85% { transform: translate(-1.8px, 0); } }
@keyframes alva-pulo { 0% { transform: none; } 40% { transform: translateY(-7px) scale(0.98, 1.03); } 75% { transform: scale(1.04, 0.96); } 100% { transform: none; } }
@keyframes alva-salto { 0%, 55%, 100% { transform: none; } 12% { transform: scale(1.05, 0.94); } 30% { transform: translateY(-12px) scale(0.97, 1.04); } 45% { transform: scale(1.04, 0.96); } }
@keyframes alva-acenar-e { from { transform: rotate(8deg); } to { transform: rotate(-12deg); } }
@keyframes alva-acenar-d { from { transform: rotate(-8deg); } to { transform: rotate(12deg); } }
@keyframes alva-espreitar { 0%, 100% { transform: none; } 50% { transform: translateX(1.5px) rotate(-2.5deg); } }
@keyframes alva-susto { 0% { transform: scale(0.94); } 55% { transform: scale(1.06) translateY(-4px); } 100% { transform: none; } }
@keyframes alva-balancar { 0%, 100% { transform: rotate(-1.8deg); } 50% { transform: rotate(1.8deg); } }
@keyframes alva-ponto { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes alva-ponteiro { 0%, 100% { transform: rotate(-20deg); } 45% { transform: rotate(24deg); } 70% { transform: rotate(8deg); } }
@keyframes alva-venia { 0%, 100% { transform: none; } 35%, 55% { transform: scale(1.03, 0.95); } }
@keyframes alva-subir { 0% { opacity: 0; transform: translateY(6px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes alva-faisca { 0% { opacity: 0; transform: translateY(10px) scale(0.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-4px); } }
@keyframes alva-encolher { 0%, 100% { transform: none; } 30% { transform: translateY(-2px) rotate(-2.5deg); } 60% { transform: translateY(-2px) rotate(2.5deg); } }
@keyframes alva-procurar { 0%, 100% { transform: translate(-2.4px, 0); } 50% { transform: translate(2.4px, 0); } }

/* ---------- Mensagem (AlvaMessage) ----------
   Cartão no fluxo da página: nunca flutua sobre o mapa e só ocupa espaço quando há mensagem. */
.alva-slot:empty { display: none; }
.alva-slot { margin-bottom: var(--n-space-4); }
.alva-card { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 44px 12px 12px; border-radius: var(--n-radius-lg);
  background: var(--n-surface); border: 1px solid var(--n-border); box-shadow: 0 6px 18px rgb(16 52 42 / 0.06); }
.alva-card__who { flex: none; width: 56px; padding: 0; border: 0; background: none; border-radius: var(--n-radius); cursor: pointer; }
.alva-card__who:focus-visible { outline: 3px solid var(--forest-700); outline-offset: 2px; }
.alva-card__text { flex: 1; min-width: 0; padding-top: 2px; }
.alva-card__name { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--terracotta-text); margin-bottom: 2px; }
.alva-card__msg { margin: 0; font-size: 15px; line-height: 1.45; color: var(--n-text); }
.alva-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.alva-card__close { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--n-text-muted);
  cursor: pointer; display: grid; place-items: center; }
.alva-card__close:hover { background: var(--cream-100); color: var(--n-text); }
.alva-card__close:focus-visible { outline: 3px solid var(--forest-700); outline-offset: 0; }
@media (prefers-reduced-motion: no-preference) {
  .alva-card.is-in { animation: alva-entrar var(--dur-base) var(--ease-out) both; }
  .alva-card.is-out { animation: alva-sair var(--dur-fast) var(--ease-out) both; }
}
@keyframes alva-entrar { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes alva-sair { to { opacity: 0; transform: translateY(4px); } }
@media (max-width: 760px) {
  .alva-card { padding: 10px 42px 10px 10px; gap: 10px; }
  .alva-card__who { width: 42px; }
  .alva-card__msg { font-size: 14px; }
}

/* Menu de atalhos (AlvaInteractions) */
.alva-menu { position: absolute; z-index: 30; left: 8px; top: calc(100% + 6px); min-width: 250px; max-width: calc(100vw - 32px); padding: 6px; border-radius: var(--n-radius-lg);
  background: var(--n-surface); border: 1px solid var(--n-border); box-shadow: 0 14px 36px rgb(16 52 42 / 0.16); }
.alva-menu[hidden] { display: none; }
.alva-menu a, .alva-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 10px; border: 0; border-radius: var(--n-radius);
  background: none; color: var(--n-text); font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; }
.alva-menu a:hover, .alva-menu button:hover { background: var(--sage-50); }
.alva-menu a:focus-visible, .alva-menu button:focus-visible { background: var(--sage-50); outline: none; box-shadow: inset 0 0 0 2px var(--forest-700); }
.alva-menu svg { flex: none; color: var(--forest-700); }
.alva-menu hr { border: 0; border-top: 1px solid var(--n-border); margin: 4px 6px; }
.alva-menu .alva-menu__muted { color: var(--n-text-secondary); font-size: 13px; }

/* Estados vazios com a Alva (decorativa: o texto diz tudo). Sem a Alva, volta o ícone. */
.alva-static { display: block; width: 84px; margin: 0 auto 6px; }
.results-empty .alva-static { width: 64px; }
.alva-off .alva-static { display: none; }
.alva-fallback { display: none; }
.alva-off .alva-fallback { display: inline-flex; }

/* Conquista com a Alva a celebrar */
.celebrate__alva { flex: none; width: 52px; }

/* Página da Alva */
.alva-hero { display: grid; grid-template-columns: 170px 1fr; gap: 28px; align-items: center; margin-bottom: var(--n-space-6); }
.alva-hero .alva { max-width: 170px; }
.alva-hero__who { padding: 0; border: 0; background: var(--cream-100); border-radius: var(--n-radius-lg); padding: 10px; cursor: pointer; position: relative; }
.alva-hero__who:focus-visible { outline: 3px solid var(--forest-700); outline-offset: 2px; }
.alva-exprs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin: 0 0 var(--n-space-6); padding: 0; list-style: none; }
.alva-exprs li { display: grid; justify-items: center; gap: 4px; padding: 10px 8px; border-radius: var(--n-radius-lg); background: var(--n-surface); border: 1px solid var(--n-border);
  font-size: 13px; color: var(--n-text-secondary); text-align: center; }
.alva-exprs .alva { width: 80px; }
.alva-prefs { display: grid; gap: 10px; margin-bottom: var(--n-space-6); }
.alva-prefs label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--n-radius-lg); background: var(--n-surface); border: 1px solid var(--n-border); cursor: pointer; }
.alva-prefs input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--forest-700); flex: none; }
.alva-prefs small { display: block; color: var(--n-text-secondary); }
@media (max-width: 600px) { .alva-hero { grid-template-columns: 110px 1fr; gap: 16px; } }
.empty-state .alva-card { text-align: left; margin: 12px 0 16px; }
.panel__list > .alva-slot { margin: 10px 16px 6px; }
.alva-figure { display: block; }

/* public/css/simple.css */
/* ============================================================
   Vista simples (telemóvel) e preferências de acessibilidade
   Medidas em rem para acompanhar o tamanho de letra do navegador e do sistema.
   ============================================================ */

/* ---------- Alternância entre modos (só no telemóvel) ---------- */
.mode-switch { display: none; }
.simple { display: none; }
@media (max-width: 860px) {
  .mode-switch { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--n-surface); border: 1px solid var(--n-border); box-shadow: 0 4px 14px rgb(16 52 42 / 0.1); }
  .mode-switch button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 999px;
    background: transparent; color: var(--n-text); font: inherit; font-size: 0.9375rem; font-weight: 600; cursor: pointer; }
  .mode-switch button[aria-pressed="true"] { background: var(--forest-700); color: var(--cream-50); }
  .mode-switch button:focus-visible { outline: 3px solid var(--forest-700); outline-offset: 2px; }
  .panel__head .mode-switch { margin-bottom: 8px; }

  .mode-simple .explore { display: none; }
  .mode-simple .simple { display: block; }
}

/* ---------- Vista simples ---------- */
.simple { min-height: calc(100dvh - var(--header-h)); padding: 12px 16px calc(32px + var(--safe-b)); background: var(--n-bg); font-size: 1.0625rem; line-height: 1.5; }
.simple__top { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.simple__top .mode-switch { flex: 1; }
.simple-settings { margin: 28px 0 0; padding-top: 16px; border-top: 1px solid var(--n-border); }
.simple-link:focus-visible { outline: 3px solid var(--forest-700); outline-offset: 2px; border-radius: 6px; }
.simple__title { font-family: var(--n-font-display); font-size: 1.875rem; line-height: 1.15; margin: 0 0 12px; color: var(--n-text); }
.simple__title:focus { outline: none; }
.simple__title:focus-visible { outline: 3px solid var(--forest-700); outline-offset: 4px; border-radius: 4px; }
.simple__h2 { font-size: 1.1875rem; margin: 28px 0 12px; color: var(--n-text); }
.simple-lead { margin: -4px 0 16px; color: var(--n-text-secondary); font-size: 1rem; }
.simple-note { padding: 10px 12px; border-radius: var(--n-radius); background: var(--sage-50); border: 1px solid var(--sage-200); font-size: 1rem; margin: 0 0 12px; }

.simple-search { display: grid; grid-template-columns: 1fr; gap: 10px; }
.simple-search input { min-height: 56px; font-size: 1.125rem; padding: 0 16px; border-width: 2px; border-color: var(--forest-500); border-radius: var(--n-radius-lg); scroll-margin-top: 80px; }
.simple-search input:focus-visible { outline: 3px solid var(--forest-700); outline-offset: 2px; }
.simple-search .n-btn { min-height: 52px; font-size: 1.0625rem; justify-content: center; }
.simple-search--small { margin-top: 20px; }
.simple-search--small label { font-weight: 700; }
.simple-search--small > div { display: flex; gap: 8px; }
.simple-search--small input { flex: 1; min-height: 52px; min-width: 0; }

.simple-guide { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 14px; min-height: 64px; padding: 12px 16px; border-radius: var(--n-radius-lg);
  border: 2px solid var(--forest-700); background: var(--sage-50); color: var(--forest-900); font: inherit; text-align: left; cursor: pointer; }
.simple-guide strong { display: block; font-size: 1.125rem; }
.simple-guide span span { color: var(--n-text-secondary); font-size: 0.9375rem; }
.simple-guide svg { flex: none; color: var(--terracotta-600); }
.simple-guide:focus-visible { outline: 3px solid var(--forest-700); outline-offset: 2px; }
.simple .alva-slot { margin: 14px 0 0; }

.simple-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; list-style: none; margin: 0; padding: 0; }
.simple-cats a { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px; min-height: 104px; padding: 14px; border-radius: var(--n-radius-lg);
  background: var(--n-surface); border: 1px solid var(--n-border); color: var(--n-text); font-size: 1.0625rem; font-weight: 700; text-decoration: none; }
.simple-cats a svg { color: var(--forest-700); }
.simple-cats a:active { background: var(--sage-50); }
.simple-cats a:focus-visible, .simple-quick a:focus-visible, .simple-quick button:focus-visible, .simple-option:focus-visible { outline: 3px solid var(--forest-700); outline-offset: 2px; }
.simple-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--forest-700); font-weight: 700; }

.simple-quick { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.simple-quick a, .simple-quick button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 10px 14px; border-radius: var(--n-radius-lg);
  background: var(--n-surface); border: 1px solid var(--n-border); color: var(--n-text); font: inherit; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; }
.simple-quick svg { flex: none; color: var(--forest-700); }
.simple-quick [aria-expanded="true"] { border-color: var(--forest-700); background: var(--sage-50); }

.simple-sos { margin-top: 8px; padding: 12px; border-radius: var(--n-radius-lg); background: var(--n-surface); border: 2px solid var(--n-border); }
.simple-sos ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.simple-sos a:not(.simple-link) { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; border-radius: var(--n-radius); color: var(--n-text); text-decoration: none; background: var(--cream-100); }
.simple-sos a span:nth-child(2) { flex: 1; }
.simple-sos .simple-sos__112 { background: var(--n-error-text); color: var(--cream-50); font-size: 1.0625rem; }
.simple-sos .simple-sos__112 strong { font-size: 1.25rem; margin-right: 4px; }
.simple-sos .simple-sos__112 span:last-child { font-weight: 700; }

.simple-bar { margin: -4px 0 6px; }
.simple-back { display: inline-flex; align-items: center; gap: 4px; min-height: 48px; padding: 0 12px 0 4px; border: 0; background: none; color: var(--forest-700); font: inherit; font-weight: 700; cursor: pointer; border-radius: var(--n-radius); }
.simple-back:focus-visible { outline: 3px solid var(--forest-700); outline-offset: 2px; }
.simple-back .flip { transform: scaleX(-1); }

.simple-options { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.simple-option { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 10px 14px; border-radius: var(--n-radius-lg);
  background: var(--n-surface); border: 1px solid var(--n-border); color: var(--n-text); font: inherit; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; }
.simple-option > span { flex: 1; }
.simple-option small { display: block; font-weight: 400; color: var(--n-text-secondary); font-size: 0.875rem; }
.simple-option > svg:first-child { flex: none; color: var(--forest-700); }
.simple-option > svg:last-child { flex: none; color: var(--n-text-muted); }

.simple-refine { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.simple-refine .n-btn { min-height: 48px; }

.simple-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.s-card { padding: 16px; border-radius: var(--n-radius-lg); background: var(--n-surface); border: 1px solid var(--n-border); }
.s-card__name { font-family: var(--n-font); font-size: 1.1875rem; line-height: 1.3; margin: 0 0 6px; color: var(--n-text); letter-spacing: 0; }
.s-card__meta, .s-card__line { display: flex; align-items: flex-start; gap: 6px; margin: 0 0 4px; color: var(--n-text-secondary); font-size: 1rem; }
.s-card__meta svg, .s-card__line svg { flex: none; margin-top: 3px; color: var(--forest-500); }
.s-open { font-weight: 700; }
.s-open.is-open { color: var(--forest-700); }
.s-open.is-closed { color: var(--terracotta-text); }
.s-card__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.s-card__actions .n-btn { min-height: 48px; justify-content: center; font-size: 1rem; }
.s-card__actions .n-btn--primary { grid-column: 1 / -1; }
.s-card__actions > :nth-child(2):last-child { grid-column: 1 / -1; }
/* Numa paragem, «Próximos autocarros» já é a ação principal: «Como chegar» e «Ver no mapa» ficam a toda a largura. */
.s-card__bus ~ .s-card__actions { grid-template-columns: 1fr; }
.s-card__lines { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 6px; }
.s-card__lines .line-badge { margin: 0; }
.s-card__more { margin-top: 10px; border-top: 1px solid var(--n-border); }
.s-card__more summary { display: flex; align-items: center; min-height: 48px; font-weight: 700; color: var(--forest-700); cursor: pointer; list-style: none; }
.s-card__more summary::-webkit-details-marker { display: none; }
.s-card__more summary::after { content: '+'; margin-left: auto; font-size: 1.375rem; line-height: 1; }
.s-card__more[open] summary::after { content: '–'; }
.s-card__more summary:focus-visible { outline: 3px solid var(--forest-700); outline-offset: 2px; border-radius: 4px; }
.s-card__more-body p { margin: 0 0 10px; }
.s-hours { list-style: none; margin: 4px 0 10px; padding: 0; }
.s-hours li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--n-border); }
.s-hours li.is-today { font-weight: 700; }
.simple-more { width: 100%; min-height: 52px; margin-top: 14px; justify-content: center; }
.simple-empty { text-align: center; padding: 24px 8px; }
.simple-empty .alva-static { width: 84px; margin: 0 auto 8px; }
.simple-empty h2 { font-size: 1.25rem; margin: 0 0 8px; }
.simple-empty__actions { display: grid; gap: 8px; }
.simple-empty__actions .n-btn { min-height: 48px; justify-content: center; }
.simple-toast { position: fixed; left: 16px; right: 16px; bottom: calc(16px + var(--safe-b)); z-index: 40; margin: 0; padding: 12px 14px; border-radius: var(--n-radius-lg);
  background: var(--forest-900); color: var(--cream-50); font-size: 1rem; box-shadow: 0 10px 30px rgb(16 52 42 / 0.3); }
.simple-toast[hidden] { display: none; }
@media (min-width: 420px) { .simple-search { grid-template-columns: 1fr auto; } }

/* ---------- Preferências de acessibilidade (ver /preferencias) ---------- */
html.pref-reduce-motion *, html.pref-reduce-motion *::before, html.pref-reduce-motion *::after {
  animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important;
}
/* Maior contraste: texto secundário mais escuro, contornos visíveis e ligações sublinhadas. Também com «aumentar contraste» do sistema. */
html.pref-contrast { --n-text-secondary: var(--forest-900); --n-text-muted: var(--forest-800); --n-border: var(--forest-500); }
html.pref-contrast a { text-decoration-line: underline; }
html.pref-contrast .n-btn, html.pref-contrast .n-input, html.pref-contrast .n-chip { border-width: 2px; }
@media (prefers-contrast: more) {
  :root { --n-text-secondary: var(--forest-900); --n-text-muted: var(--forest-800); --n-border: var(--forest-500); }
}
/* Texto maior: amplia o conteúdo das páginas (o mapa fica igual, para não afetar os gestos). */
html.pref-text-lg .page, html.pref-text-lg .simple { zoom: 1.15; }

.prefs-form { display: grid; gap: 12px; max-width: 640px; }
.prefs-form fieldset { margin: 0; padding: 14px; border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); background: var(--n-surface); }
.prefs-form legend { font-weight: 700; padding: 0 6px; }
.prefs-form label { display: flex; gap: 12px; align-items: flex-start; min-height: 48px; padding: 8px 4px; cursor: pointer; }
.prefs-form input[type="checkbox"], .prefs-form input[type="radio"] { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--forest-700); }
.prefs-form small { display: block; color: var(--n-text-secondary); font-size: 0.9375rem; }

.s-card__bus { width: 100%; min-height: 52px; margin-top: 12px; justify-content: center; font-size: 1.0625rem; }
.s-card__bus[aria-expanded="true"] { background: var(--forest-900); }
.s-card__arrivals { margin-top: 10px; }

/* public/css/support.css */
/* ============================================================
   Apoiar o projeto: seleção de valor, transparência e agradecimento
   ============================================================ */
.support-hero { margin-bottom: var(--n-space-6); }
.support-hero .n-overline { display: inline-flex; align-items: center; gap: 6px; color: var(--terracotta-text); }
.support-hero h1 { font-size: clamp(32px, 6vw, 48px); line-height: 1.05; margin: 0 0 var(--n-space-3); }
.support-hero p { margin: 0 0 var(--n-space-3); font-size: 18px; color: var(--n-text-secondary); }
.support-hero .support-hero__note { font-size: 16px; font-weight: 600; color: var(--forest-700); }

.support-card { display: grid; gap: var(--n-space-3); margin-bottom: var(--n-space-8); padding: var(--n-space-5); border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); background: var(--n-surface); box-shadow: var(--n-shadow-sm); }
.support-card legend { padding: 0; margin-bottom: var(--n-space-3); font-family: var(--n-font-display); font-size: 20px; font-weight: 700; }
.support-amounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.support-amount input, .support-other input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.support-amount__box { display: grid; place-content: center; justify-items: center; gap: 2px; min-height: 84px; padding: 8px; border: 2px solid var(--n-border); border-radius: var(--n-radius-lg); background: var(--cream-50); color: var(--forest-900); cursor: pointer; transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease, transform var(--dur-fast) ease; }
.support-amount__box strong { font-family: var(--n-font-display); font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.support-amount__box em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--terracotta-text); }
.support-amount:hover .support-amount__box { border-color: var(--forest-500); }
.support-amount input:checked + .support-amount__box { border-color: var(--forest-700); background: var(--sage-100); box-shadow: inset 0 0 0 1px var(--forest-700); }
.support-amount input:focus-visible + .support-amount__box, .support-other input:focus-visible + span { outline: 3px solid var(--forest-700); outline-offset: 2px; }
.support-other { display: block; margin-top: 10px; }
.support-other span { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 2px dashed var(--n-border-strong); border-radius: var(--n-radius-lg); font-weight: 600; color: var(--forest-800); cursor: pointer; }
.support-other input:checked + span { border-style: solid; border-color: var(--forest-700); background: var(--sage-100); }
.support-custom input { font-size: 18px; min-height: 52px; }
.support-card > .n-field__error { margin: 0; }
.support-submit { justify-content: center; width: 100%; min-height: 56px; font-size: 18px; }
.support-submit[disabled] { opacity: 0.6; cursor: not-allowed; }
.support-card__foot { margin: 0; text-align: center; font-size: 14px; color: var(--n-text-secondary); }

.support-goal { margin-bottom: var(--n-space-8); }
.support-goal h2 { font-size: 18px; margin: 0 0 8px; }
.support-goal__bar { height: 10px; overflow: hidden; border-radius: 999px; background: var(--sage-100); }
.support-goal__bar span { display: block; height: 100%; background: var(--forest-700); }

.support-uses { display: grid; gap: 10px; margin: 0 0 var(--n-space-8); padding: 0; list-style: none; }
.support-uses li { display: grid; grid-template-columns: 24px 1fr; gap: 2px 12px; padding: 14px; border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); background: var(--n-surface); }
.support-uses .icon { grid-row: span 2; color: var(--terracotta-500); }
.support-uses span { color: var(--n-text-secondary); font-size: 15px; }
.support-faq details { border-bottom: 1px solid var(--n-border); }
.support-faq summary { padding: 14px 0; font-weight: 600; cursor: pointer; }
.support-faq p { margin: 0 0 14px; color: var(--n-text-secondary); }

.support-thanks { text-align: center; }
.support-thanks__art { position: relative; display: grid; place-items: center; width: 140px; height: 140px; margin: 0 auto var(--n-space-4); color: var(--terracotta-500); }
.support-thanks__art .alva-static svg { width: 120px; height: auto; }
.support-thanks__art--plain { color: var(--forest-700); }
.support-thanks h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.08; }
.support-thanks__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: var(--n-space-5); }
.support-spark { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--terracotta-500); opacity: 0; }
.support-spark:nth-child(even) { background: var(--sage-400); }

@media (min-width: 640px) {
  .support-amounts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .support-uses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Computador: a largura do site, com a mensagem ao lado da escolha do valor. */
@media (min-width: 1024px) {
  .support-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--n-space-10); align-items: center; margin-bottom: var(--n-space-8); }
  .support-hero, .support-main .support-card { margin-bottom: 0; }
  .support-uses { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .support-faq { columns: 2; column-gap: var(--n-space-10); }
  .support-faq details { break-inside: avoid; }
}
@media (prefers-reduced-motion: no-preference) {
  .support-amount input:checked + .support-amount__box { animation: support-pick 180ms var(--ease-out); }
  .support-thanks__art > .alva-static, .support-thanks__art > .alva-fallback { animation: support-in 600ms var(--ease-spring) both; }
  .support-spark { animation: support-spark 1200ms var(--ease-out) var(--d, 0ms) 1 both; }
}
@keyframes support-pick { from { transform: scale(0.97); } to { transform: none; } }
@keyframes support-in { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: none; } }
@keyframes support-spark { 0% { opacity: 0; transform: translate(0, 0) scale(0.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(1); } }

/* public/css/transit.css */
/* ============================================================
   Transportes em tempo real (página /transportes e ficha de paragem)
   Hierarquia dos cartões: minutos > linha > destino > hora > estado. Estados sempre com texto e ícone.
   ============================================================ */
.tr-app .page-head { margin-bottom: var(--n-space-4); }
.tr-search { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 8px; max-width: 640px; margin-bottom: 10px; }
.tr-search__field { position: relative; display: block; }
.tr-search__field > svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--n-text-muted); pointer-events: none; }
.tr-search input { width: 100%; min-height: 56px; padding-left: 48px; font-size: 1.0625rem; border-width: 2px; border-color: var(--forest-500); border-radius: var(--n-radius-lg); }
.tr-search input:focus-visible { outline: 3px solid var(--forest-700); outline-offset: 2px; }
.tr-search .n-btn { min-height: 56px; }
.tr-near .n-btn { min-height: 48px; }
.tr-near .n-btn[aria-busy="true"] { opacity: 0.7; }
.is-live [data-tr-server-results] { display: none; }

.tr-h { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--n-text-secondary); margin: 18px 0 8px; }
.tr-none { padding: 12px 14px; border-radius: var(--n-radius-lg); background: var(--cream-100); margin: 10px 0; }
.tr-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; max-width: 760px; }
.tr-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px; border-radius: var(--n-radius-lg); background: var(--n-surface);
  border: 1px solid var(--n-border); color: var(--n-text); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.tr-row:hover { border-color: var(--forest-500); box-shadow: 0 4px 14px rgb(16 52 42 / 0.08); }
.tr-row:focus-visible { outline: 3px solid var(--forest-700); outline-offset: 2px; }
.tr-row > svg:first-child { flex: none; color: var(--forest-700); }
.tr-row > svg:last-child { flex: none; color: var(--n-text-muted); }
.tr-row__main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tr-row__name { font-weight: 700; }
.tr-row__meta { color: var(--n-text-secondary); font-size: 0.9375rem; }
.tr-row__lines { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 0; }
.tr-line { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; padding: 2px 8px; border-radius: 6px; font-weight: 800; font-size: 0.875rem;
  font-variant-numeric: tabular-nums; background: var(--line, var(--forest-700)); color: var(--line-text, var(--cream-50)); }

.tr-stop { margin: 16px 0 24px; padding: 16px; max-width: 760px; border-radius: var(--n-radius-lg); background: var(--n-surface); border: 2px solid var(--forest-700);
  box-shadow: 0 10px 30px rgb(16 52 42 / 0.08); scroll-margin-top: calc(var(--header-h) + 12px); }
.tr-stop h2 { font-family: var(--n-font-display); font-size: 1.5rem; margin: 0 0 4px; }
.tr-stop h2:focus { outline: none; }
.tr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tr-actions .n-btn { min-height: 48px; }
@media (prefers-reduced-motion: no-preference) { .tr-stop:not([hidden]) { animation: tr-in var(--dur-base) var(--ease-out); } }
@keyframes tr-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Cartões de chegada */
.tr-arrivals { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tr-arr { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--n-radius-lg); background: var(--cream-50); border: 1px solid var(--n-border); }
.tr-arr__wait { display: grid; justify-items: center; align-content: center; min-height: 60px; border-radius: var(--n-radius); background: var(--n-surface); border: 1px solid var(--n-border); text-align: center; line-height: 1; }
.tr-arr__wait strong { font-family: var(--n-font-display); font-size: 1.75rem; font-variant-numeric: tabular-nums; color: var(--n-text); }
.tr-arr__wait.is-text strong { font-family: var(--n-font); font-size: 1rem; font-weight: 800; line-height: 1.15; padding: 0 4px; }
.tr-arr__wait span { font-size: 0.8125rem; font-weight: 700; color: var(--n-text-secondary); margin-top: 2px; }
.tr-arr--realtime .tr-arr__wait { background: var(--sage-50); border-color: var(--sage-400); }
.tr-arr--realtime .tr-arr__wait strong { color: var(--forest-800); }
.tr-arr__main { display: grid; gap: 4px; min-width: 0; }
.tr-arr__top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tr-arr__dest { font-weight: 700; overflow-wrap: anywhere; }
.tr-arr__meta { color: var(--n-text-secondary); font-size: 0.9375rem; }
.tr-state { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }
.tr-arr--realtime .tr-state { color: var(--forest-700); }
.tr-arr--stale .tr-state { color: var(--terracotta-text); }
.tr-arr--scheduled .tr-state { color: var(--n-text-secondary); font-weight: 600; }
.tr-arr--observed { opacity: 0.75; }
.tr-arr--observed .tr-state { color: var(--n-text-secondary); }
@media (prefers-reduced-motion: no-preference) {
  .tr-arr--realtime .tr-state svg { animation: tr-pulse 2.4s var(--ease-in-out) infinite; }
  .is-updating .tr-arrivals { opacity: 0.65; transition: opacity var(--dur-fast) var(--ease-out); }
}
@keyframes tr-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.tr-arrivals--compact .tr-arr { grid-template-columns: 62px 1fr; padding: 8px 10px; }
.tr-arrivals--compact .tr-arr__wait { min-height: 50px; }
.tr-arrivals--compact .tr-arr__wait strong { font-size: 1.375rem; }
.tr-arrivals--compact .tr-arr__wait.is-text strong { font-size: 0.9375rem; }

.tr-skeleton { display: grid; gap: 8px; }
.tr-skeleton .n-skeleton { display: block; height: 72px; border-radius: var(--n-radius-lg); }
.tr-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 0.875rem; color: var(--n-text-secondary); }
.tr-foot .n-btn { min-height: 44px; }
.tr-warn, .tr-error { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 0 0 10px; border-radius: var(--n-radius-lg); background: var(--terracotta-tint); color: var(--terracotta-text); }
.tr-error p { margin: 0; }
.tr-error .n-btn { margin-top: 8px; }
.tr-empty { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: var(--n-radius-lg); background: var(--cream-100); }
.tr-empty p { margin: 0; }

/* Favoritas */
.tr-favs { margin: 8px 0 28px; }
.tr-fav { display: grid; gap: 6px; }
.tr-fav__tools { display: flex; flex-wrap: wrap; gap: 4px; padding-left: 6px; }
.tr-fav__tools .n-btn { min-height: 40px; min-width: 40px; }
.tr-fav.is-missing { padding: 12px; border-radius: var(--n-radius-lg); background: var(--terracotta-tint); }
.tr-rename { display: grid; gap: 6px; padding: 10px; border-radius: var(--n-radius-lg); background: var(--cream-100); }
.tr-rename label { font-weight: 700; }
.tr-rename > div { display: flex; gap: 8px; }
.tr-rename input { flex: 1; min-height: 48px; min-width: 0; }
.tr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.tr-chips .n-chip { min-height: 40px; }
@media (max-width: 520px) { .tr-search { grid-template-columns: 1fr; } }

/* public/css/weather.css */
/* ============================================================
   «O tempo por cá» — cartão meteorológico com cena animada (SVG + CSS)
   Mobile primeiro (320–430 px). Só transform e opacity; nada pisca; tudo pára com «reduzir movimento».
   ============================================================ */
:root {
  /* Céu por condição (tons da identidade: creme, sálvia, verde-floresta). */
  --wx-sky-sunny-a: var(--terracotta-tint); --wx-sky-sunny-b: var(--cream-50);
  --wx-sky-partly-a: var(--sage-100); --wx-sky-partly-b: var(--cream-50);
  --wx-sky-cloudy-a: var(--sage-200); --wx-sky-cloudy-b: var(--sage-50);
  --wx-sky-rain-a: #BFCFC6; --wx-sky-rain-b: var(--sage-100);
  --wx-sky-heavy-a: #A9BDB2; --wx-sky-heavy-b: var(--sage-200);
  --wx-sky-fog-a: var(--cream-200); --wx-sky-fog-b: var(--cream-100);
  --wx-sky-storm-a: #9DAEA5; --wx-sky-storm-b: var(--sage-200);
  --wx-sky-night-a: var(--forest-900); --wx-sky-night-b: var(--forest-800);
  /* Avisos oficiais (cores convencionais do IPMA, com texto escuro legível). */
  --wx-warn-yellow: #FFE58A; --wx-warn-yellow-text: #4A3B00;
  --wx-warn-orange: #FFC285; --wx-warn-orange-text: #5A2A00;
  --wx-warn-red: #B42318; --wx-warn-red-text: var(--cream-50);
}

.wx { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; min-height: 196px;
  border-radius: var(--n-radius-lg); border: 1px solid var(--n-border); background: var(--cream-100); color: var(--n-text); }
.wx__scene { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--a, var(--cream-100)), var(--b, var(--cream-50))); }
.wx__scene svg { display: block; width: 100%; height: 100%; overflow: visible; }
/* A cena desvanece para a esquerda: nada se mexe por trás do texto (o céu fica, porque é o fundo de .wx__scene). */
.wx__scene svg { -webkit-mask-image: linear-gradient(90deg, transparent var(--wx-fade-a, 46%), #000 var(--wx-fade-b, 70%)); mask-image: linear-gradient(90deg, transparent var(--wx-fade-a, 46%), #000 var(--wx-fade-b, 70%)); }
.wx__body { position: relative; isolation: isolate; display: grid; gap: 2px; padding: 14px 16px 12px; min-height: 196px; align-content: start; }
.wx__top { display: flex; align-items: center; gap: 8px; }
.wx__title { font-family: var(--n-font-display); font-size: 1.125rem; margin: 0; color: inherit; }
.wx__src, .wx__stale { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; padding: 2px 7px; border-radius: 999px; background: rgb(252 248 240 / 0.85); color: var(--forest-900); }
.wx__stale { background: var(--terracotta-tint); color: var(--terracotta-text); }
.wx__loc { margin: 0; font-size: 0.875rem; color: var(--n-text-secondary); }
.wx__main { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0 2px; max-width: 64%; }
.wx__temp { font-family: var(--n-font-display); font-size: 2.875rem; line-height: 0.95; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; }
.wx__sep { opacity: 0.45; margin: 0 2px; font-size: 0.7em; }
.wx__cond { font-weight: 700; font-size: 0.9375rem; line-height: 1.25; padding-bottom: 4px; }
.wx__obs { margin: 0 0 8px; max-width: 64%; font-size: 0.8125rem; color: var(--n-text-secondary); }
.wx__msg { margin: 10px 0; max-width: 70%; }
.wx__sk { display: block; width: 140px; height: 48px; border-radius: 10px; }
.wx__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; }
.wx__chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border-radius: 999px; background: rgb(252 248 240 / 0.88); font-size: 0.875rem; font-weight: 700; color: var(--forest-900); }
.wx__cta { margin-left: auto; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--forest-700); color: var(--cream-50); font: inherit; font-weight: 700; font-size: 0.9375rem; cursor: pointer; }
.wx__cta:hover { background: var(--forest-800); }
.wx__cta:focus-visible { outline: 3px solid var(--forest-900); outline-offset: 2px; }
.wx__more { background: var(--n-surface); border-top: 1px solid var(--n-border); padding: 12px 16px 14px; }
.wx__h3 { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--n-text-secondary); margin: 4px 0 8px; }
.wx-days { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 2px; }
.wx-days li { display: grid; grid-template-columns: 5.5rem 28px 1fr auto; grid-template-areas: "n i l t" "n i x x"; column-gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--n-border); }
.wx-days__name { grid-area: n; font-weight: 700; }
.wx-days .wx-icon { grid-area: i; width: 26px; height: 26px; }
.wx-days__label { grid-area: l; font-size: 0.9375rem; }
.wx-days__t { grid-area: t; font-weight: 800; font-variant-numeric: tabular-nums; }
.wx-days__extra { grid-area: x; font-size: 0.8125rem; color: var(--n-text-secondary); }
.wx__source { font-size: 0.8125rem; color: var(--n-text-secondary); margin: 8px 0 0; }

/* Noite: o texto passa a creme sobre o céu escuro (os painéis de detalhe mantêm o fundo claro). */
.wx__body:has(.wx-svg.is-night) { color: var(--cream-50); }
.wx__body:has(.wx-svg.is-night) .wx__loc, .wx__body:has(.wx-svg.is-night) .wx__obs { color: var(--sage-200); }
.wx__body:has(.wx-svg.is-night) .wx__cta { background: var(--cream-50); color: var(--forest-900); }

/* Avisos oficiais: sempre com texto e ícone; nunca a piscar. */
.wx-warn { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; padding: 10px 16px; font-size: 0.9375rem; }
.wx > .wx-warn { position: relative; }
.wx-warn__level { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.wx-warn__when, .wx-warn__area { font-size: 0.875rem; }
.wx-warn__area { flex-basis: 100%; opacity: 0.85; }
.wx-warn__text { flex-basis: 100%; font-size: 0.875rem; }
.wx-warn-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.wx-warn--yellow { background: var(--wx-warn-yellow); color: var(--wx-warn-yellow-text); }
.wx-warn--orange { background: var(--wx-warn-orange); color: var(--wx-warn-orange-text); border-top: 3px solid var(--wx-warn-orange-text); }
.wx-warn--red { background: var(--wx-warn-red); color: var(--wx-warn-red-text); font-size: 1rem; padding: 14px 16px; }
.wx-warn-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.wx-warn-list .wx-warn { border-radius: var(--n-radius); }

/* ---------- Cenas ---------- */
.wx__scene:has(.wx-svg--sunny) { --a: var(--wx-sky-sunny-a); --b: var(--wx-sky-sunny-b); }
.wx__scene:has(.wx-svg--partly), .wx__scene:has(.wx-svg--wind) { --a: var(--wx-sky-partly-a); --b: var(--wx-sky-partly-b); }
.wx__scene:has(.wx-svg--cloudy) { --a: var(--wx-sky-cloudy-a); --b: var(--wx-sky-cloudy-b); }
.wx__scene:has(.wx-svg--rain) { --a: var(--wx-sky-rain-a); --b: var(--wx-sky-rain-b); }
.wx__scene:has(.wx-svg--heavy) { --a: var(--wx-sky-heavy-a); --b: var(--wx-sky-heavy-b); }
.wx__scene:has(.wx-svg--fog) { --a: var(--wx-sky-fog-a); --b: var(--wx-sky-fog-b); }
.wx__scene:has(.wx-svg--storm) { --a: var(--wx-sky-storm-a); --b: var(--wx-sky-storm-b); }
.wx__scene:has(.wx-svg.is-night) { --a: var(--wx-sky-night-a); --b: var(--wx-sky-night-b); }
.wx-sky { fill: transparent; }
.wx-sun circle { fill: var(--terracotta-500); }
.wx-sun .wx-halo { fill: var(--terracotta-500); opacity: 0.18; }
.wx-rays path { stroke: var(--terracotta-500); stroke-width: 3; stroke-linecap: round; opacity: 0.55; }
.wx-rays { transform-box: view-box; transform-origin: 300px 42px; }
.wx-birds path { fill: none; stroke: var(--forest-800); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0.7; }
.wx-moon circle { fill: var(--cream-100); }
.wx-moon .wx-moon-cut { fill: var(--forest-900); }
.wx-cloud { fill: var(--cream-50); opacity: 0.95; }
.wx-c2 .wx-cloud { opacity: 0.8; }
.wx-c3 .wx-cloud { opacity: 0.7; }
.wx-dark .wx-cloud { fill: var(--sage-400); }
.is-night .wx-cloud { fill: var(--forest-700); }
.wx-drop { stroke: var(--forest-500); stroke-width: 2; stroke-linecap: round; opacity: 0.7; }
.is-night .wx-drop { stroke: var(--sage-200); }
.wx-fog rect { fill: var(--cream-50); opacity: 0.6; }
.wx-bolt { fill: var(--terracotta-500); }
.wx-wind path { fill: none; stroke: var(--forest-500); stroke-width: 2.5; stroke-linecap: round; opacity: 0.5; }
.wx-city { fill: var(--forest-800); opacity: 0.16; }
.is-night .wx-city { fill: var(--forest-700); opacity: 0.9; }
.wx-windows rect { fill: var(--terracotta-500); opacity: 0.65; }
.wx-svg g, .wx-svg path, .wx-svg rect, .wx-svg circle { transform-box: fill-box; transform-origin: center; }
.wx-far path { fill: var(--forest-800); opacity: 0.07; }
.is-night .wx-far path { fill: var(--forest-800); opacity: 0.75; }
.wx-tree { transform-origin: 50% 100%; }
.wx-rail { stroke: var(--forest-800); stroke-width: 1; opacity: 0.2; }
.is-night .wx-rail { stroke: var(--sage-200); opacity: 0.12; }
.wx-train { opacity: 0.38; }
.wx-car { fill: var(--forest-700); }
.wx-car-win { fill: var(--cream-50); }
.is-night .wx-train { opacity: 0.95; }
.is-night .wx-car { fill: var(--forest-500); }
.is-night .wx-car-win { fill: var(--cream-100); }
.wx-moon .wx-halo { fill: var(--cream-100); opacity: 0.12; }
.wx-splash { fill: none; stroke: var(--forest-500); stroke-width: 1.5; stroke-linecap: round; opacity: 0; transform-origin: 50% 100%; }
.is-night .wx-splash { stroke: var(--sage-200); }
.wx-leaf { fill: var(--terracotta-500); opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .wx.wx-intro { animation: wx-in 420ms var(--ease-out) both; }
  .wx-anim.wx-enter { animation: wx-fade 600ms var(--ease-out) both; }
  /* Entrada coreografada (uma vez por visita): cidade, fundo, astro, nuvens, chuva, pássaros. */
  .wx-play .wx-l-city { animation: wx-city-in 700ms var(--ease-out) both; }
  .wx-play .wx-l-far { animation: wx-city-in 1000ms var(--ease-out) 120ms both; }
  .wx-play .wx-l-astro { animation: wx-astro-in 1300ms var(--ease-spring) 200ms both; }
  .wx-play .wx-l-clouds { animation: wx-clouds-in 1200ms var(--ease-out) 380ms both; }
  .wx-play .wx-l-precip { animation: wx-fade 700ms var(--ease-out) 900ms both; }
  .wx-play .wx-l-birds { animation: wx-fade 600ms var(--ease-out) 1300ms both; }
  /* Vida contínua: só transform e opacity; pausa fora do ecrã. */
  .wx-anim .wx-sun { animation: wx-float 7s var(--ease-in-out) infinite; }
  .wx-anim .wx-moon { animation: wx-float 9s var(--ease-in-out) infinite; }
  .wx-anim .wx-rays { animation: wx-spin 80s linear infinite; }
  .wx-anim .wx-rays path { animation: wx-ray 3.2s var(--ease-in-out) infinite; animation-delay: var(--d); }
  .wx-anim .wx-halo { animation: wx-glow 6s var(--ease-in-out) infinite; }
  .wx-anim .wx-far { animation: wx-slide 180s linear infinite; }
  .wx-anim .wx-tree { animation: wx-sway 5s var(--ease-in-out) infinite; animation-delay: var(--d, 0s); }
  .wx-anim .is-windy .wx-tree { animation-name: wx-sway-strong; animation-duration: 1.8s; }
  .wx-anim .wx-birds { animation: wx-birds 18s linear infinite; }
  .wx-anim .wx-wing { animation: wx-flap 420ms var(--ease-in-out) infinite alternate; animation-delay: var(--d, 0s); }
  .wx-anim .wx-blink { animation: wx-window 14s var(--ease-in-out) infinite; animation-delay: var(--d); }
  .wx-anim .wx-c1 { animation: wx-drift 22s var(--ease-in-out) infinite alternate; }
  .wx-anim .wx-c2 { animation: wx-drift 30s var(--ease-in-out) infinite alternate-reverse; }
  .wx-anim .wx-c3 { animation: wx-drift-wide 40s var(--ease-in-out) infinite alternate; }
  .wx-anim .wx-svg--wind .wx-c1, .wx-anim .wx-svg--wind .wx-c2 { animation-duration: 12s; }
  .wx-anim .wx-drop { animation: wx-rain 1.1s linear infinite; animation-delay: var(--d); }
  .wx-anim .wx-svg--heavy .wx-drop { animation-duration: 0.75s; }
  .wx-anim .wx-splash { animation: wx-splash 1.1s var(--ease-out) infinite; animation-delay: var(--d); }
  .wx-anim .wx-svg--heavy .wx-splash { animation-duration: 0.75s; }
  .wx-anim .wx-f1 { animation: wx-drift-wide 26s var(--ease-in-out) infinite alternate; }
  .wx-anim .wx-f2 { animation: wx-drift-wide 34s var(--ease-in-out) infinite alternate-reverse; }
  .wx-anim .wx-f3 { animation: wx-drift-wide 20s var(--ease-in-out) infinite alternate; }
  .wx-anim .wx-wind path { stroke-dasharray: 40 160; animation: wx-gust 5s linear infinite; }
  .wx-anim .wx-wind path:nth-child(2) { animation-delay: 1.6s; }
  .wx-anim .wx-wind path:nth-child(3) { animation-delay: 3.1s; }
  .wx-anim .wx-leaf { animation: wx-leaf 5.4s linear infinite; animation-delay: var(--d); }
  /* Comboio: passa de vez em quando, sem pressa (o primeiro aparece pouco depois da entrada). */
  .wx-anim .wx-train { animation: wx-train 34s var(--ease-in-out) 1.2s infinite both; }
  /* Paralaxe ao passar o cursor (computador): planos diferentes mexem-se a velocidades diferentes. */
  .wx-anim .wx-p-sky, .wx-anim .wx-p-mid, .wx-anim .wx-p-far { transition: translate 900ms var(--ease-out); }
  .wx-anim .wx-p-sky { translate: calc(var(--mx, 0) * -8px) calc(var(--my, 0) * -5px); }
  .wx-anim .wx-p-mid { translate: calc(var(--mx, 0) * -5px) calc(var(--my, 0) * -3px); }
  .wx-anim .wx-p-far { translate: calc(var(--mx, 0) * -2px) 0; }
  .wx__more.is-opening { animation: wx-fade 260ms var(--ease-out) both; }
  .wx__more.is-opening .wx-days li { animation: wx-day-in 320ms var(--ease-out) both; animation-delay: calc(var(--i) * 60ms + 60ms); }
  .wx.is-paused *, .wx__scene.is-paused *, .wx.is-settled .wx__scene * { animation-play-state: paused !important; }
  @media (hover: hover) { .wx:hover .wx-anim .wx-city { transform: translateY(-1px); transition: transform var(--dur-slow) var(--ease-out); } }
  /* Telemóvel: a mesma profundidade ao deslocar a página (onde o browser o suporta). */
  @supports (animation-timeline: view()) {
    @media (hover: none) {
      .wx__scene.wx-anim { view-timeline: --wxv block; }
      .wx-anim .wx-p-sky { animation: wx-par-sky linear both; animation-timeline: --wxv; }
      .wx-anim .wx-p-mid { animation: wx-par-mid linear both; animation-timeline: --wxv; }
    }
  }
}

@keyframes wx-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes wx-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wx-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes wx-city-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes wx-astro-in { from { opacity: 0; transform: translateY(70px); } 40% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes wx-clouds-in { from { opacity: 0; transform: translateX(46px); } to { opacity: 1; transform: none; } }
@keyframes wx-spin { to { transform: rotate(360deg); } }
@keyframes wx-birds { 0% { opacity: 0; transform: translate(-24px, 6px); } 6% { opacity: 0.75; } 44% { opacity: 0.75; transform: translate(118px, -8px); } 50%, 100% { opacity: 0; transform: translate(130px, -10px); } }
@keyframes wx-window { 0%, 55% { opacity: 0.65; } 62%, 92% { opacity: 0.08; } 100% { opacity: 0.65; } }
@keyframes wx-day-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes wx-glow { 0%, 100% { opacity: 0.14; } 50% { opacity: 0.26; } }
@keyframes wx-drift { from { transform: translateX(-12px); } to { transform: translateX(14px); } }
@keyframes wx-drift-wide { from { transform: translateX(-18px); } to { transform: translateX(18px); } }
@keyframes wx-rain { 0% { transform: translateY(-6px); opacity: 0; } 20% { opacity: 0.75; } 100% { transform: translateY(34px); opacity: 0; } }
@keyframes wx-gust { from { stroke-dashoffset: 200; } to { stroke-dashoffset: 0; } }
@keyframes wx-ray { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.8; } }
@keyframes wx-slide { from { transform: translateX(0); } to { transform: translateX(360px); } }
@keyframes wx-sway { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
@keyframes wx-sway-strong { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(6deg); } }
@keyframes wx-flap { from { transform: scaleY(1); } to { transform: scaleY(0.35); } }
@keyframes wx-splash { 0%, 55% { opacity: 0; transform: scale(0.2); } 70% { opacity: 0.8; } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes wx-leaf { 0% { opacity: 0; transform: translate(-40px, 0) rotate(0); } 10%, 85% { opacity: 0.85; } 50% { transform: translate(70px, -16px) rotate(240deg); } 100% { opacity: 0; transform: translate(170px, 8px) rotate(520deg); } }
@keyframes wx-train { 0% { transform: translateX(-280px); } 40%, 100% { transform: translateX(400px); } }
@keyframes wx-par-sky { from { translate: 0 10px; } to { translate: 0 -10px; } }
@keyframes wx-par-mid { from { translate: 0 5px; } to { translate: 0 -5px; } }

/* Ícones da lista de dias */
.wx-icon { fill: none; stroke: var(--forest-700); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wx-icon .wx-i-sun { fill: var(--terracotta-500); stroke: none; }
.wx-icon .wx-i-cloud { fill: var(--sage-100); }

/* Variante compacta (painel lateral no computador) */
.wx--compact, .wx--compact .wx__body { min-height: 132px; }
.wx--compact .wx__temp { font-size: 2.25rem; }
.wx--compact .wx__main { margin: 2px 0 6px; }

/* Vista simples: sem animação decorativa, controlos maiores. */
.wx--simple .wx__cta { min-height: 52px; font-size: 1.0625rem; padding: 0 20px; }
.wx--simple .wx__temp { font-size: 3rem; }

@media (min-width: 761px) {
  .wx:not(.wx--compact, .wx--bar) .wx__body { padding: 18px 22px 16px; }
  .wx:not(.wx--compact, .wx--bar) .wx__main, .wx:not(.wx--compact, .wx--bar) .wx__obs { max-width: 52%; }
}
.simple .wx { margin-top: 14px; }
.panel__head .wx { margin-top: 10px; }
/* O cartão compacto do painel só aparece no computador (no telemóvel está na Vista simples). */
/* «Hoje por cá»: dentro do banner. A fotografia faz de cena; a previsão abre por cima da página, sem aumentar o banner. */
.today-hero { z-index: 5; overflow: visible; }
.today-hero .photo-hero__body { position: relative; z-index: 1; }
.today-hero .photo-hero__img, .today-hero::before { border-radius: inherit; }
.wx--hero { margin-top: var(--n-space-3); min-height: 0; max-width: 460px; overflow: visible; border-color: rgb(252 248 240 / 0.35); background: rgb(10 30 78 / 0.42); backdrop-filter: blur(6px); color: var(--cream-50); }
.wx--hero .wx__scene { display: none; }
.wx--hero .wx__body { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; min-height: 0; padding: 8px 8px 8px 14px; }
.wx--hero .wx__top { order: 1; flex: none; }
.wx--hero .wx__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wx--hero .wx__loc, .wx--hero .wx__chip, .wx--hero .wx__obs:not(.wx__obs--key) { display: none; }
.wx--hero .wx__main { flex: 1; min-width: 0; flex-wrap: nowrap; align-items: center; gap: 8px; max-width: none; margin: 0; }
.wx--hero .wx__temp { font-size: 1.625rem; line-height: 1; }
.wx--hero .wx__sk { width: 120px; height: 24px; }
.wx--hero .wx__cond { padding: 0; font-size: 0.875rem; line-height: 1.2; }
.wx--hero .wx__obs--key { order: 3; flex-basis: 100%; margin: 0; max-width: none; color: var(--cream-50); font-size: 0.75rem; }
.wx--hero .wx__msg { margin: 0; max-width: none; }
.wx--hero .wx__foot { order: 2; flex: none; margin: 0; }
.wx--hero .wx__cta { min-height: 36px; margin: 0; padding: 0 14px; background: var(--cream-50); color: var(--forest-900); font-size: 0.875rem; white-space: nowrap; }
.wx--hero .wx__cta:hover { background: var(--cream-100); }
.wx--hero .wx__cta:focus-visible { outline-color: var(--cream-50); }
.wx--hero .wx__body { border-radius: inherit; }
.wx--hero .wx__more { position: absolute; z-index: 2; top: calc(100% + 6px); left: 0; right: 0; max-height: min(60dvh, 460px); overflow: auto; border: 1px solid var(--n-border); border-radius: var(--n-radius-lg); box-shadow: var(--n-shadow-lg); color: var(--n-text); }
.wx--hero .wx__more p { color: var(--n-text-secondary); }
.wx--hero .wx-warn--yellow { color: var(--wx-warn-yellow-text); }
.wx--hero .wx-warn--orange { color: var(--wx-warn-orange-text); }
.wx--hero .wx-warn--red { color: var(--wx-warn-red-text); }

/* Computador: faixa no topo do painel esquerdo, na largura dele. A previsão abre dentro do painel. */
.wx--bar { display: none; }
@media (min-width: 861px) {
  .wx--bar { --wx-fade-a: 34%; --wx-fade-b: 48%; display: flex; flex: none; min-height: 0; border: 0; border-bottom: 1px solid var(--n-border); border-radius: 0; }
  .wx--bar .wx__body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; align-content: center; gap: 4px 12px; min-height: 92px; padding: 12px var(--n-space-5); overflow: hidden; }
  /* O sol e as nuvens passam para o espaço livre, antes do botão. */
  .wx--bar .wx-svg .wx-p-sky, .wx--bar .wx-svg .wx-p-mid { translate: -270px 0; }
  .wx--bar .wx__top { grid-column: 1; }
  .wx--bar .wx__title { font-size: 0.9375rem; }
  .wx--bar .wx__loc, .wx--bar .wx__chip, .wx--bar .wx__obs:not(.wx__obs--key) { display: none; }
  .wx--bar .wx__main { grid-column: 1; min-width: 0; flex-wrap: nowrap; align-items: center; gap: 8px; max-width: none; margin: 0; }
  .wx--bar .wx__temp { font-size: 1.75rem; line-height: 1; }
  .wx--bar .wx__sk { width: 120px; height: 24px; }
  .wx--bar .wx__cond { padding: 0; font-size: 0.875rem; line-height: 1.2; }
  .wx--bar .wx__obs--key { grid-column: 1; margin: 0; max-width: none; font-size: 0.75rem; }
  .wx--bar .wx__msg { margin: 0; max-width: none; }
  .wx--bar .wx__foot { grid-column: 2; grid-row: 1 / span 3; margin: 0; }
  .wx--bar .wx__cta { min-height: 36px; margin: 0; padding: 0 14px; font-size: 0.875rem; white-space: nowrap; }
  .wx--bar > .wx-warn { padding-inline: var(--n-space-5); }
  .wx--bar .wx__more { padding-inline: var(--n-space-5); }
}

/* public/css/cidade.css */
/* Direção «App de cidade», sobre o fundo claro do portal: navegação em comprimidos, cantos generosos e uma cor por zona.
   Só nas páginas públicas (<html data-theme="cidade">); a administração não muda. As cores continuam as do tema. */
[data-theme="cidade"] {
  --n-radius: 14px;
  --n-radius-lg: 24px;

  /* Uma cor por zona, a partir do logótipo. */
  --zone-agualva: var(--sage-400);
  --zone-mira: var(--forest-700);
  --zone-cacem: var(--terracotta-500);
  --zone-marcos: var(--forest-500);
}

/* Botões e etiquetas em forma de comprimido. */
[data-theme="cidade"] .n-btn { border-radius: 999px; }
[data-theme="cidade"] .n-chip { border-radius: 999px; }

/* Cabeçalho: navegação em comprimidos, a página ativa em verde-floresta. */
@media (min-width: 961px) {
  [data-theme="cidade"] .site-nav a { border-radius: 999px; padding: 9px 15px; }
  [data-theme="cidade"] .site-nav a[aria-current] { background: var(--forest-700); color: var(--cream-50); box-shadow: none; border-radius: 999px; }
  /* «Hoje» e a seta formam um só comprimido: tem de ganhar à regra da página ativa, que arredonda tudo. */
  [data-theme="cidade"] .site-nav .nav-group > a, [data-theme="cidade"] .site-nav .nav-group > a[aria-current] { border-radius: 999px 0 0 999px; padding-right: 6px; }
  [data-theme="cidade"] .nav-group > .nav-sub-toggle { border-radius: 0 999px 999px 0; }
  [data-theme="cidade"] .nav-group.is-active > a[aria-current], [data-theme="cidade"] .nav-group.is-active > .nav-sub-toggle { background: var(--forest-700); color: var(--cream-50); box-shadow: none; }
  [data-theme="cidade"] .nav-group.is-active:hover > a, [data-theme="cidade"] .nav-group.is-active:hover > .nav-sub-toggle { background: var(--forest-800); color: var(--cream-50); }
  [data-theme="cidade"] .site-nav .nav-sub a[aria-current] { background: var(--sage-100); color: var(--forest-800); }
}

/* Hoje: o resumo do dia em números grandes, logo abaixo da fotografia. */
.today-stats { list-style: none; margin: var(--n-space-4) 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.today-stat { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-height: 132px; height: 100%; box-sizing: border-box; padding: 18px 20px;
  border-radius: var(--n-radius-lg); background: var(--n-surface); border: 1px solid var(--n-border); color: var(--n-text); text-decoration: none; }
.today-stat strong { font-family: var(--n-font-display); font-weight: 800; font-size: clamp(48px, 7vw, 76px); line-height: 0.9; letter-spacing: -0.04em; color: var(--forest-800); }
.today-stat span { font-size: var(--n-text-small); font-weight: 600; color: var(--n-text-secondary); }
.today-stat--warm { background: var(--terracotta-tint); border-color: rgb(203 100 64 / 0.3); }
.today-stat--warm strong { color: var(--terracotta-text); }
.today-stat--sage { background: var(--sage-100); border-color: var(--sage-200); }
.today-stat:hover { border-color: var(--forest-500); }
.today-stat:focus-visible { outline: 3px solid var(--forest-700); outline-offset: 2px; }
@media (max-width: 560px) {
  .today-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .today-stat { min-height: 104px; padding: 14px; }
  .today-stat span { font-size: 12px; }
}

/* Uma cor por zona, a partir do logótipo: Agualva e Mira-Sintra, Cacém e São Marcos. */
.zone-dots { display: inline-flex; gap: 3px; margin-right: 6px; vertical-align: middle; }
.zone-dots span { width: 9px; height: 9px; border-radius: 50%; }
[data-zone="agualva-mira-sintra"] .zone-dots span:first-child { background: var(--zone-agualva); }
[data-zone="agualva-mira-sintra"] .zone-dots span:last-child { background: var(--zone-mira); }
[data-zone="cacem-sao-marcos"] .zone-dots span:first-child { background: var(--zone-cacem); }
[data-zone="cacem-sao-marcos"] .zone-dots span:last-child { background: var(--zone-marcos); }
.n-chip[aria-pressed="true"] .zone-dots span { box-shadow: 0 0 0 1.5px var(--cream-50); }
.zone-card[data-zone="agualva-mira-sintra"] { border-top: 6px solid var(--zone-agualva); }
.zone-card[data-zone="cacem-sao-marcos"] { border-top: 6px solid var(--zone-cacem); }
