:root {
  --bg:       #0d1117;
  --bg2:      #161b22;
  --bg3:      #1f2937;
  --border:   rgba(255,255,255,.08);
  --border-h: rgba(16,185,129,.45);
  --text:     #e6edf3;
  --muted:    #8b949e;
  --accent:   #10b981;
  --accent2:  #06b6d4;
  --accent3:  #3b82f6;
  --danger:   #ef4444;
  --radius:   14px;
  --shadow:   0 10px 40px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, system-ui, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--accent2); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent); }

button { font-family: inherit; cursor: pointer; }

/* ── Background decorativo ─────────────────────────── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 40% at 20% 10%, rgba(16,185,129,.12), transparent 60%),
    radial-gradient(ellipse 40% 35% at 80% 90%, rgba(59,130,246,.10), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

/* ══════════════════════════════════════════════════════
   HOMEPAGE
══════════════════════════════════════════════════════ */
.home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18vh 20px 60px;
  text-align: center;
}

@media (max-width: 640px) {
  .home { padding-top: 12vh; }
}

.logo { width: min(360px, 80vw); height: auto; margin-bottom: 14px; }
.logo-reset { display: inline-block; cursor: pointer; transition: transform .15s, filter .15s; }
.logo-reset:hover { transform: scale(1.02); filter: brightness(1.08); }
.logo-reset:active { transform: scale(.99); }
.logo-sm { width: 180px; height: auto; }

.tagline {
  color: var(--muted);
  font-size: 1rem;
  margin: 0 0 40px;
  letter-spacing: .02em;
}

/* ── Search bar ───────────────────────────────────── */
.search-wrap {
  width: min(640px, 100%);
  position: relative;
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 6px 6px 22px;
  transition: border-color .2s, box-shadow .2s, transform .1s;
}

.search-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(16,185,129,.15), var(--shadow);
}

.search-icon {
  width: 20px; height: 20px;
  color: var(--muted);
  flex-shrink: 0;
  margin-right: 12px;
}

.search-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 1.05rem;
  padding: 14px 6px;
  min-width: 0;
}

.search-input::placeholder { color: var(--muted); }

.search-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #052e23;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: .95rem;
  letter-spacing: .02em;
  flex-shrink: 0;
  transition: transform .1s, box-shadow .2s, filter .2s;
}

.search-btn:hover { filter: brightness(1.08); box-shadow: 0 6px 20px rgba(16,185,129,.3); }
.search-btn:active { transform: translateY(1px); }

/* ── Quick chips ──────────────────────────────────── */
.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  max-width: 700px;
}

.chip {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .88rem;
  transition: all .18s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip:hover {
  border-color: var(--border-h);
  background: rgba(16,185,129,.08);
  color: var(--accent);
  transform: translateY(-1px);
}

.chip svg { width: 14px; height: 14px; opacity: .75; }

/* ── Avviso (box warning) ─────────────────────────── */
.avv-hero {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 22px 24px;
  background: linear-gradient(135deg, rgba(245,158,11,.12), rgba(239,68,68,.06));
  border: 1px solid rgba(245,158,11,.25);
  border-left: 4px solid #fbbf24;
  border-radius: var(--radius);
  margin-bottom: 22px;
}
.avv-hero-icon { font-size: 2.5rem; line-height: 1; flex-shrink: 0; }

.avv-warning {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: var(--radius);
  color: #fca5a5;
  margin: 24px 0;
}
.avv-warning svg { color: #f87171; flex-shrink: 0; margin-top: 2px; }
.avv-warning strong { color: #f87171; display: block; margin-bottom: 6px; font-size: 1.05rem; }
.avv-warning p { margin: 0; color: #fecaca; line-height: 1.65; font-size: .95rem; }

/* ── Ad banner (inserito nelle pagine commerciali) ── */
.ad-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 26px;
  margin: 28px auto;
  max-width: 1100px;
  background:
    linear-gradient(135deg, rgba(16,185,129,.1), rgba(6,182,212,.06)),
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(16,185,129,.03) 14px 28px);
  border: 1px dashed rgba(16,185,129,.35);
  border-radius: var(--radius);
  color: var(--text);
}

.ad-banner-badge {
  position: absolute;
  top: -10px;
  left: 18px;
  padding: 3px 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #052e23;
  font-size: .64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(16,185,129,.3);
}

.ad-banner-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.ad-banner-text { flex: 1; min-width: 0; }
.ad-banner-text h3 {
  margin: 0 0 3px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.ad-banner-text p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.5;
}

.ad-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #052e23 !important;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: filter .15s, transform .1s, box-shadow .2s;
}
.ad-banner-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(16,185,129,.35);
  color: #052e23 !important;
}

@media (max-width: 640px) {
  .ad-banner {
    flex-wrap: wrap;
    padding: 18px 20px;
    margin: 20px 14px;
  }
  .ad-banner-text h3 { font-size: .98rem; }
  .ad-banner-btn { width: 100%; justify-content: center; }
}

/* ── Pubblicità page (card grid) ──────────────────── */
.pub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin: 18px 0 24px;
}
.pub-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 14px;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform .15s, box-shadow .2s, border-color .15s;
  position: relative;
}
.pub-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-h);
  box-shadow: 0 12px 28px rgba(0,0,0,.4);
}
.pub-card:nth-child(2n) { border-top-color: var(--accent2); }
.pub-card:nth-child(3n) { border-top-color: var(--accent3); }
.pub-card:nth-child(4n) { border-top-color: #a855f7; }
.pub-card:nth-child(5n) { border-top-color: #f59e0b; }
.pub-card:nth-child(6n) { border-top-color: #ec4899; }

.pub-card-icon { font-size: 2rem; line-height: 1; margin-bottom: 4px; }
.pub-card h3 { margin: 0 0 2px; font-size: 1rem; font-weight: 700; color: var(--text); }
.pub-card p  { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.55; }

.pub-card-tag {
  position: absolute;
  top: -10px;
  right: 14px;
  padding: 3px 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #052e23;
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(16,185,129,.3);
}

/* ── Pagine statiche (chi-siamo / privacy / come-funziona) ── */
.static-page {
  max-width: 780px;
  margin: 32px auto 60px;
  padding: 0 24px;
  color: var(--text);
  line-height: 1.7;
}
.static-page h1 {
  font-size: 2rem;
  margin: 0 0 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.static-page h2 {
  font-size: 1.2rem;
  margin: 32px 0 10px;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}
.static-page p { color: #c5cdd5; margin: 0 0 14px; }
.static-page .static-lead { font-size: 1.05rem; color: var(--text); margin-bottom: 22px; }
.static-page ul { padding-left: 20px; margin: 10px 0 18px; color: #c5cdd5; }
.static-page li { margin-bottom: 8px; }
.static-page a { color: var(--accent2); }
.static-page a:hover { color: var(--accent); }
.static-page .static-back {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: .9rem;
}
@media (max-width: 640px) {
  .static-page { padding: 0 16px; margin-top: 24px; }
  .static-page h1 { font-size: 1.6rem; }
}

/* ── Top navigation (stile Google home) ───────────── */
.top-nav {
  position: absolute;
  top: 18px;
  left: 22px;
  display: flex;
  gap: 18px;
  z-index: 5;
  font-size: .82rem;
}
.top-nav.top-nav-right { left: auto; right: 22px; }

.top-nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color .15s, text-decoration-color .15s;
  padding: 4px 2px;
}
.top-nav a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.top-nav a.ads-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.25);
  border-radius: 999px;
  color: var(--accent);
  font-weight: 600;
  transition: all .15s;
}
.top-nav a.ads-link:hover {
  background: rgba(16,185,129,.15);
  text-decoration: none;
  border-color: rgba(16,185,129,.5);
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .top-nav { top: 12px; left: 14px; gap: 12px; font-size: .76rem; }
  .top-nav.top-nav-right { right: 14px; }
  .top-nav a.ads-link { padding: 5px 10px; }
}
@media (max-width: 480px) {
  .top-nav.top-nav-right .ads-link { font-size: 0; gap: 0; padding: 7px 9px; }
  .top-nav.top-nav-right .ads-link::after { content: "Pubblicità"; font-size: .72rem; font-weight: 600; }
}

/* ── Role toggle Turista / Cittadino ──────────────── */
.role-toggle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 48px;
  width: 100%;
  max-width: 420px;
}

.role-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: 2px solid var(--border);
  color: var(--text);
  font-size: .88rem;
  font-weight: 700;
  font-family: inherit;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: transform .15s, border-color .2s, background .2s, box-shadow .25s;
  letter-spacing: .01em;
}

.role-btn .role-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  flex-shrink: 0;
  transition: background .2s, color .2s;
}
.role-btn .role-icon svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: color .2s;
}

.role-btn[data-role="turista"]   { border-top-color: #a855f7; }
.role-btn[data-role="turista"] .role-icon { background: rgba(168,85,247,.15); }
.role-btn[data-role="turista"] .role-icon svg { color: #a855f7; }

.role-btn[data-role="cittadino"] { border-top-color: var(--accent); }
.role-btn[data-role="cittadino"] .role-icon { background: rgba(16,185,129,.15); }
.role-btn[data-role="cittadino"] .role-icon svg { color: var(--accent); }

.role-btn:hover {
  transform: translateY(-3px);
  border-color: var(--border-h);
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
}

.role-btn.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(16,185,129,.1), rgba(6,182,212,.05));
  box-shadow: 0 10px 32px rgba(16,185,129,.25), inset 0 0 0 1px rgba(16,185,129,.25);
}
.role-btn[data-role="turista"].active   { border-color: #a855f7; border-top-color: #a855f7; box-shadow: 0 10px 32px rgba(168,85,247,.3), inset 0 0 0 1px rgba(168,85,247,.3); background: linear-gradient(135deg, rgba(168,85,247,.12), rgba(168,85,247,.04)); }
.role-btn[data-role="cittadino"].active { border-color: var(--accent); border-top-color: var(--accent); }

/* Grid nascosta di default — appare solo dopo scelta */
.cat-grid { display: none; }
body.role-tutti     .cat-grid,
body.role-turista   .cat-grid,
body.role-cittadino .cat-grid {
  display: grid;
  animation: fadeSlide .35s ease;
}

/* Filtri audience */
body.role-turista   .cat-card[data-audience="cittadino"] { display: none; }
body.role-cittadino .cat-card[data-audience="turista"]   { display: none; }

/* Hint iniziale quando nulla è selezionato */
.role-hint {
  margin-top: 32px;
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
  max-width: 520px;
}
body.role-tutti .role-hint,
body.role-turista .role-hint,
body.role-cittadino .role-hint { display: none; }

.role-hint svg {
  vertical-align: -3px;
  margin-right: 4px;
  opacity: .6;
}

@media (max-width: 640px) {
  .role-toggle { grid-template-columns: 1fr; margin-top: 32px; gap: 8px; max-width: 280px; }
  .role-btn { padding: 8px 12px; font-size: .84rem; }
  .role-btn .role-icon { width: 28px; height: 28px; }
  .role-btn .role-icon svg { width: 15px; height: 15px; }
}

/* ── Category grid (6 quadrati con sotto-voci) ────── */
.cat-grid {
  width: 100%;
  max-width: 1080px;
  margin-top: 44px;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.cat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .22s, box-shadow .22s, border-color .22s;
  animation: fadeSlide .45s ease backwards;
}
.cat-card:nth-child(1) { animation-delay: .04s; }
.cat-card:nth-child(2) { animation-delay: .08s; }
.cat-card:nth-child(3) { animation-delay: .12s; }
.cat-card:nth-child(4) { animation-delay: .16s; }
.cat-card:nth-child(5) { animation-delay: .20s; }
.cat-card:nth-child(6) { animation-delay: .24s; }

.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(0,0,0,.45);
}

.cat-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent);
}

.cat-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  flex-shrink: 0;
}
.cat-card-icon svg { width: 22px; height: 22px; }

.cat-card-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.cat-card-desc {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.35;
}

.cat-card-list {
  list-style: none;
  padding: 8px 0;
  margin: 0;
  flex: 1;
}

.cat-card-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  color: #b8c2cc;
  font-size: .9rem;
  border-left: 2px solid transparent;
  transition: background .15s, color .15s, border-left-color .15s, padding-left .15s;
}
.cat-card-list li a svg {
  color: var(--muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .15s, transform .15s, color .15s;
}
.cat-card-list li a:hover {
  background: rgba(255,255,255,.03);
  color: var(--text);
  padding-left: 22px;
}
.cat-card-list li a:hover svg {
  opacity: 1;
  transform: translateX(0);
}

/* Colori per categoria */
.cat-red    { border-top-color: #ef4444; }
.cat-red .cat-card-icon { background: rgba(239,68,68,.15); color: #f87171; }
.cat-red .cat-card-list li a:hover { border-left-color: #ef4444; color: #f87171; }
.cat-red .cat-card-list li a:hover svg { color: #f87171; }

.cat-green  { border-top-color: var(--accent); }
.cat-green .cat-card-icon { background: rgba(16,185,129,.15); color: var(--accent); }
.cat-green .cat-card-list li a:hover { border-left-color: var(--accent); color: var(--accent); }
.cat-green .cat-card-list li a:hover svg { color: var(--accent); }

.cat-orange { border-top-color: #f59e0b; }
.cat-orange .cat-card-icon { background: rgba(245,158,11,.15); color: #f59e0b; }
.cat-orange .cat-card-list li a:hover { border-left-color: #f59e0b; color: #f59e0b; }
.cat-orange .cat-card-list li a:hover svg { color: #f59e0b; }

.cat-blue   { border-top-color: var(--accent3); }
.cat-blue .cat-card-icon { background: rgba(59,130,246,.15); color: var(--accent3); }
.cat-blue .cat-card-list li a:hover { border-left-color: var(--accent3); color: var(--accent3); }
.cat-blue .cat-card-list li a:hover svg { color: var(--accent3); }

.cat-purple { border-top-color: #a855f7; }
.cat-purple .cat-card-icon { background: rgba(168,85,247,.15); color: #a855f7; }
.cat-purple .cat-card-list li a:hover { border-left-color: #a855f7; color: #a855f7; }
.cat-purple .cat-card-list li a:hover svg { color: #a855f7; }

.cat-cyan   { border-top-color: var(--accent2); }
.cat-cyan .cat-card-icon { background: rgba(6,182,212,.15); color: var(--accent2); }
.cat-cyan .cat-card-list li a:hover { border-left-color: var(--accent2); color: var(--accent2); }
.cat-cyan .cat-card-list li a:hover svg { color: var(--accent2); }

.cat-indigo { border-top-color: #6366f1; }
.cat-indigo .cat-card-icon { background: rgba(99,102,241,.15); color: #818cf8; }
.cat-indigo .cat-card-list li a:hover { border-left-color: #6366f1; color: #a5b4fc; }
.cat-indigo .cat-card-list li a:hover svg { color: #a5b4fc; }

.cat-lime   { border-top-color: #84cc16; }
.cat-lime .cat-card-icon { background: rgba(132,204,22,.15); color: #a3e635; }
.cat-lime .cat-card-list li a:hover { border-left-color: #84cc16; color: #a3e635; }
.cat-lime .cat-card-list li a:hover svg { color: #a3e635; }

.cat-pink   { border-top-color: #ec4899; }
.cat-pink .cat-card-icon { background: rgba(236,72,153,.15); color: #f472b6; }
.cat-pink .cat-card-list li a:hover { border-left-color: #ec4899; color: #f472b6; }
.cat-pink .cat-card-list li a:hover svg { color: #f472b6; }

/* 9 cards → 3x3 layout, cat-card animation delays 7-9 */
.cat-card:nth-child(7) { animation-delay: .28s; }
.cat-card:nth-child(8) { animation-delay: .32s; }
.cat-card:nth-child(9) { animation-delay: .36s; }

@media (max-width: 960px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}
@media (max-width: 560px) {
  .cat-grid { grid-template-columns: 1fr; margin-top: 28px; }
  .cat-card-head { padding: 14px 16px; }
  .cat-card-list li a { padding: 9px 16px; }
}

/* ── Service grid (6 quadrati) ────────────────────── */
.service-grid {
  width: 100%;
  max-width: 980px;
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.service-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px 22px;
  text-align: center;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: transform .22s, box-shadow .22s, border-color .22s;
  animation: fadeSlide .45s ease backwards;
}
.service-card:nth-child(1) { animation-delay: .04s; }
.service-card:nth-child(2) { animation-delay: .08s; }
.service-card:nth-child(3) { animation-delay: .12s; }
.service-card:nth-child(4) { animation-delay: .16s; }
.service-card:nth-child(5) { animation-delay: .20s; }
.service-card:nth-child(6) { animation-delay: .24s; }

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
  color: var(--text);
}

.service-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  margin-bottom: 4px;
}
.service-icon svg { width: 28px; height: 28px; }

.service-name {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
}

.service-desc {
  margin: 0;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.45;
  flex: 1;
}

.service-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  width: 100%;
  justify-content: center;
  font-size: .84rem;
  font-weight: 600;
  color: var(--muted);
  transition: color .15s, gap .15s;
}
.service-card:hover .service-link { gap: 8px; }

/* Colori per ogni card */
.service-red    { border-top-color: #ef4444; }
.service-red    .service-icon { background: rgba(239,68,68,.15); color: #f87171; }
.service-red:hover    { border-color: rgba(239,68,68,.45); }
.service-red:hover    .service-link { color: #f87171; }

.service-green  { border-top-color: var(--accent); }
.service-green  .service-icon { background: rgba(16,185,129,.15); color: var(--accent); }
.service-green:hover  { border-color: rgba(16,185,129,.45); }
.service-green:hover  .service-link { color: var(--accent); }

.service-orange { border-top-color: #f59e0b; }
.service-orange .service-icon { background: rgba(245,158,11,.15); color: #f59e0b; }
.service-orange:hover { border-color: rgba(245,158,11,.45); }
.service-orange:hover .service-link { color: #f59e0b; }

.service-blue   { border-top-color: var(--accent3); }
.service-blue   .service-icon { background: rgba(59,130,246,.15); color: var(--accent3); }
.service-blue:hover   { border-color: rgba(59,130,246,.45); }
.service-blue:hover   .service-link { color: var(--accent3); }

.service-purple { border-top-color: #a855f7; }
.service-purple .service-icon { background: rgba(168,85,247,.15); color: #a855f7; }
.service-purple:hover { border-color: rgba(168,85,247,.45); }
.service-purple:hover .service-link { color: #a855f7; }

.service-cyan   { border-top-color: var(--accent2); }
.service-cyan   .service-icon { background: rgba(6,182,212,.15); color: var(--accent2); }
.service-cyan:hover   { border-color: rgba(6,182,212,.45); }
.service-cyan:hover   .service-link { color: var(--accent2); }

@media (max-width: 880px) {
  .service-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}
@media (max-width: 520px) {
  .service-grid { grid-template-columns: 1fr; margin-top: 28px; }
  .service-card { padding: 22px 18px 18px; }
}

/* ── Footer homepage ──────────────────────────────── */
.home-footer {
  margin-top: auto;
  padding-top: 50px;
  color: var(--muted);
  font-size: .8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.home-footer .dot { margin: 0 8px; opacity: .4; }

.home-footer-piva {
  font-size: .74rem;
  opacity: .6;
  letter-spacing: .02em;
}

.home-visits {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .72rem;
  color: var(--muted);
  letter-spacing: .02em;
  margin-top: 32px;
  align-self: center;
}
.home-visits .hv-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.home-visits .hv-item svg { opacity: .7; }
.home-visits .hv-sep { opacity: .35; }

/* ── Live strip (meteo + data + tramonto) ─────────── */
.live-strip {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  background: rgba(22,27,34,.78);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: .85rem;
  color: var(--text);
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
  animation: fadeSlide .5s ease .2s backwards;
}

.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(16,185,129,.6);
  animation: livePulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,.6); }
  70%  { box-shadow: 0 0 0 10px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

.live-sep { opacity: .35; }
.live-date { color: var(--muted); font-size: .82rem; }
.live-weather { display: inline-flex; align-items: center; gap: 6px; }
.live-icon { font-size: 1.1rem; line-height: 1; }
.live-weather strong { color: var(--accent); font-weight: 700; font-size: 1rem; }
.live-label { color: var(--text); }
.live-minmax { color: var(--muted); font-size: .78rem; margin-left: 2px; }
.live-sun { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .82rem; }
.live-sun svg { opacity: .7; }

@media (max-width: 820px) {
  .live-strip { bottom: 12px; padding: 7px 12px; gap: 6px; font-size: .8rem; }
  .live-strip .live-date,
  .live-strip .live-sep,
  .live-strip .live-minmax,
  .live-strip .live-sun { display: none; }
}

/* ══════════════════════════════════════════════════════
   RESULTS PAGE
══════════════════════════════════════════════════════ */
.top-bar {
  border-bottom: 1px solid var(--border);
  background: rgba(13,17,23,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.top-bar .logo-sm { flex-shrink: 0; }

.top-bar .search-form {
  flex: 1;
  max-width: 620px;
  padding: 4px 4px 4px 18px;
}

.top-bar .search-input { font-size: .98rem; padding: 10px 6px; }
.top-bar .search-btn { padding: 9px 18px; font-size: .9rem; }

/* ── Category tabs ────────────────────────────────── */
.cat-tabs {
  max-width: 720px;
  margin: 16px auto 0;
  padding: 0 24px;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
}
.cat-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}

.cat-tab svg { width: 15px; height: 15px; opacity: .85; }

.cat-tab:hover { color: var(--text); }
.cat-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.cat-tab.active svg { opacity: 1; }

/* ══════════════════════════════════════════════════════
   METEO PAGE
══════════════════════════════════════════════════════ */
.meteo-page {
  max-width: 960px;
  margin: 24px auto 60px;
  padding: 0 24px;
}

.meteo-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  padding: 32px;
  background: linear-gradient(135deg, rgba(16,185,129,.12), rgba(6,182,212,.08) 50%, rgba(59,130,246,.1));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.meteo-hero::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle at 30% 30%, rgba(16,185,129,.1), transparent 50%);
  pointer-events: none;
}

.meteo-hero-left { position: relative; z-index: 1; }

.meteo-hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  margin-bottom: 14px;
}
.meteo-hero-label.big {
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
  margin: 10px 0 6px;
}
.meteo-hero-label .live-dot { margin: 0; }

.meteo-hero-main {
  display: flex;
  align-items: center;
  gap: 18px;
}

.meteo-hero-icon { font-size: 5rem; line-height: 1; }

.meteo-hero-temp {
  font-size: 5.5rem;
  font-weight: 200;
  line-height: 1;
  letter-spacing: -.04em;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.meteo-hero-temp span { font-size: 3rem; font-weight: 300; margin-left: 2px; }

.meteo-hero-sub { color: var(--muted); font-size: .92rem; }

.meteo-hero-right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-content: center;
  position: relative;
  z-index: 1;
}

.meteo-stat {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 14px;
  background: rgba(0,0,0,.35);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.meteo-stat svg { color: var(--accent); width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.meteo-stat-label { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.meteo-stat-value { display: block; color: var(--text); font-size: .95rem; font-weight: 600; margin-top: 2px; }

/* Section titles */
.meteo-section {
  margin-top: 32px;
}
.meteo-section h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 14px;
}

/* Hourly strip */
.meteo-hours {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scrollbar-width: thin;
}
.meteo-hours::-webkit-scrollbar { height: 6px; }
.meteo-hours::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.meteo-hour {
  flex: 0 0 auto;
  min-width: 78px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  transition: transform .15s, border-color .15s;
}
.meteo-hour:hover { transform: translateY(-2px); border-color: var(--border-h); }

.meteo-hour-time { color: var(--muted); font-size: .78rem; margin-bottom: 6px; }
.meteo-hour-icon { font-size: 1.5rem; line-height: 1; margin: 4px 0; }
.meteo-hour-temp { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.meteo-hour-rain { font-size: .7rem; color: var(--accent2); margin-top: 3px; }

/* Daily list */
.meteo-days {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.meteo-day {
  display: grid;
  grid-template-columns: 110px 60px 70px 1fr;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.meteo-day:last-child { border-bottom: 0; }
.meteo-day:hover { background: rgba(16,185,129,.05); }

.meteo-day-name strong { color: var(--text); font-size: 1rem; text-transform: capitalize; display: block; }
.meteo-day-name span { color: var(--muted); font-size: .78rem; }

.meteo-day-icon { font-size: 1.8rem; text-align: center; line-height: 1; }

.meteo-day-rain { color: var(--accent2); font-size: .85rem; }

.meteo-day-range {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: .9rem;
}
.meteo-day-range .t-min { color: #9ca3af; width: 30px; text-align: right; }
.meteo-day-range .t-max { color: var(--text); font-weight: 600; width: 30px; }

.meteo-range-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}
.meteo-range-fill {
  position: absolute;
  top: 0; bottom: 0;
  background: linear-gradient(90deg, #3b82f6, #10b981, #f59e0b);
  border-radius: 999px;
  min-width: 8px;
}

.meteo-credit {
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  margin-top: 24px;
}

@media (max-width: 720px) {
  .meteo-page { padding: 0 14px; }
  .meteo-hero {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px;
  }
  .meteo-hero-icon { font-size: 4rem; }
  .meteo-hero-temp { font-size: 4.5rem; }
  .meteo-hero-temp span { font-size: 2.5rem; }
  .meteo-hero-right { grid-template-columns: 1fr 1fr; gap: 10px; }
  .meteo-day {
    grid-template-columns: 80px 44px 60px 1fr;
    padding: 12px 14px;
    gap: 10px;
  }
  .meteo-day-name strong { font-size: .92rem; }
  .meteo-day-icon { font-size: 1.5rem; }
}

/* ══════════════════════════════════════════════════════
   COMUNE PAGE
══════════════════════════════════════════════════════ */
.cp-page {
  max-width: 1100px;
  margin: 24px auto 60px;
  padding: 0 24px;
}

.cp-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(168,85,247,.12), rgba(16,185,129,.08));
  border: 1px solid var(--border);
  border-left: 4px solid #a855f7;
  border-radius: var(--radius);
}
.cp-hero-icon { font-size: 2.8rem; line-height: 1; flex-shrink: 0; }
.cp-hero-text { flex: 1; min-width: 0; }
.cp-hero-text h1 { margin: 0 0 4px; font-size: 1.5rem; color: var(--text); }
.cp-hero-text p  { margin: 0; color: var(--muted); font-size: .9rem; }
.cp-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: rgba(0,0,0,.3);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text) !important;
  font-size: .85rem;
  font-weight: 500;
  white-space: nowrap;
  transition: border-color .15s, background .15s;
}
.cp-hero-btn:hover { border-color: var(--border-h); background: rgba(16,185,129,.08); }

.cp-tabs {
  display: flex;
  gap: 4px;
  margin: 22px 0 18px;
  border-bottom: 1px solid var(--border);
}
.cp-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  color: var(--muted);
  font-weight: 500;
  font-size: .95rem;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.cp-tab:hover { color: var(--text); }
.cp-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.cp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.cp-card {
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  color: var(--text);
  transition: transform .15s, border-color .15s, box-shadow .2s;
}
.cp-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-h);
  box-shadow: 0 12px 28px rgba(0,0,0,.4);
  color: var(--text);
}

.cp-card-img {
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-color: var(--bg3);
}

.cp-card-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, rgba(168,85,247,.12), rgba(16,185,129,.08));
}

.cp-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.cp-card-date {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.cp-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.cp-card p {
  margin: 0;
  color: #b8c2cc;
  font-size: .87rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 640px) {
  .cp-page { padding: 0 14px; }
  .cp-hero { flex-wrap: wrap; padding: 18px; }
  .cp-hero-text h1 { font-size: 1.2rem; }
  .cp-hero-btn { width: 100%; justify-content: center; }
}

/* ══════════════════════════════════════════════════════
   TRENI PAGE
══════════════════════════════════════════════════════ */
.tr-page {
  max-width: 1100px;
  margin: 24px auto 60px;
  padding: 0 24px;
}

.tr-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(6,182,212,.14), rgba(59,130,246,.08));
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent2);
  border-radius: var(--radius);
}
.tr-hero-icon { font-size: 2.8rem; line-height: 1; flex-shrink: 0; }
.tr-hero-text { flex: 1; min-width: 0; }
.tr-hero-text h1 { margin: 0 0 4px; font-size: 1.5rem; color: var(--text); }
.tr-hero-text p  { margin: 0; color: var(--muted); font-size: .9rem; }

.tr-hero-clock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(0,0,0,.35);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.tr-table-wrap {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg2);
}
.tr-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
}
.tr-table thead th {
  background: rgba(0,0,0,.3);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.tr-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.tr-table tbody tr:last-child { border-bottom: 0; }
.tr-table tbody tr:hover { background: rgba(255,255,255,.02); }
.tr-table tbody tr.tr-done { opacity: .55; }
.tr-table td { padding: 12px 16px; vertical-align: middle; }

.tr-time {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  width: 80px;
}

.tr-dest {
  font-weight: 500;
  color: var(--text);
  text-transform: capitalize;
}

.tr-train { white-space: nowrap; }
.tr-cat {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .03em;
  margin-right: 4px;
}
.tr-cat.cat-reg { background: rgba(16,185,129,.18); color: var(--accent);  border: 1px solid rgba(16,185,129,.3); }
.tr-cat.cat-ic  { background: rgba(59,130,246,.18); color: var(--accent3); border: 1px solid rgba(59,130,246,.3); }
.tr-cat.cat-fr  { background: rgba(239,68,68,.18);  color: #f87171;        border: 1px solid rgba(239,68,68,.3);  }
.tr-num { color: var(--muted); font-size: .88rem; }

.tr-bin { text-align: center; width: 60px; }
.tr-bin-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,.35);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 700;
  color: var(--text);
  font-size: 1rem;
}
.tr-bin-empty { color: var(--muted); }

.tr-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}
.tr-status.st-ontime { background: rgba(16,185,129,.15); color: var(--accent); border: 1px solid rgba(16,185,129,.3); }
.tr-status.st-minor  { background: rgba(245,158,11,.1);  color: #f59e0b;       border: 1px solid rgba(245,158,11,.2); }
.tr-status.st-warn   { background: rgba(245,158,11,.2);  color: #fbbf24;       border: 1px solid rgba(245,158,11,.4); }
.tr-status.st-late   { background: rgba(239,68,68,.2);   color: #f87171;       border: 1px solid rgba(239,68,68,.4);  }
.tr-status.st-early  { background: rgba(6,182,212,.15);  color: var(--accent2);border: 1px solid rgba(6,182,212,.3);  }
.tr-status.st-here   { background: rgba(168,85,247,.2);  color: #c4b5fd;       border: 1px solid rgba(168,85,247,.4); animation: livePulse 2s ease-in-out infinite; }
.tr-status.st-done   { background: rgba(139,148,158,.1); color: var(--muted);  border: 1px solid var(--border); }

@media (max-width: 720px) {
  .tr-page { padding: 0 14px; }
  .tr-hero { padding: 18px; flex-wrap: wrap; }
  .tr-hero-text h1 { font-size: 1.2rem; }
  .tr-table thead { display: none; }
  .tr-table, .tr-table tbody, .tr-table tr, .tr-table td { display: block; }
  .tr-table tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  .tr-table td { padding: 3px 0; }
  .tr-time { display: inline-block; margin-right: 12px; width: auto; }
  .tr-dest { display: inline-block; }
}

/* ══════════════════════════════════════════════════════
   ANAGRAFE / CINEMA PAGES (generic card layout)
══════════════════════════════════════════════════════ */
.ag-page {
  max-width: 1100px;
  margin: 24px auto 60px;
  padding: 0 24px;
}

.ag-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(16,185,129,.1), rgba(59,130,246,.06));
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
}
.ag-hero-icon { font-size: 2.8rem; line-height: 1; flex-shrink: 0; }
.ag-hero-text h1 { margin: 0 0 4px; font-size: 1.5rem; color: var(--text); }
.ag-hero-text p  { margin: 0; color: var(--muted); font-size: .92rem; }

.ag-section { margin-top: 32px; }
.ag-section h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 14px;
}

.ag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.ag-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .12s, border-color .15s, box-shadow .2s;
}
.ag-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-h);
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
}

.ag-card-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.ag-desc {
  margin: 0;
  color: #b8c2cc;
  font-size: .85rem;
  line-height: 1.5;
}

.ag-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: .83rem;
  color: #b8c2cc;
}
.ag-meta li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.ag-meta li svg { color: var(--muted); flex-shrink: 0; margin-top: 2px; }
.ag-meta a { color: var(--accent2); }

.ag-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.ag-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  transition: filter .15s, transform .1s;
}
.ag-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.ag-btn-web {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #052e23 !important;
}
.ag-btn-map {
  background: rgba(0,0,0,.3);
  border: 1px solid var(--border);
  color: var(--text) !important;
}

@media (max-width: 640px) {
  .ag-page { padding: 0 14px; }
  .ag-hero { padding: 18px; flex-wrap: wrap; }
  .ag-hero-text h1 { font-size: 1.2rem; }
}

/* ══════════════════════════════════════════════════════
   TRAFFICO PAGE
══════════════════════════════════════════════════════ */
.tf-page {
  max-width: 1100px;
  margin: 24px auto 60px;
  padding: 0 24px;
}

.tf-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 28px;
  background: linear-gradient(135deg, rgba(245,158,11,.1), rgba(239,68,68,.06));
  border: 1px solid var(--border);
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.tf-hero-icon { font-size: 2.6rem; line-height: 1; flex-shrink: 0; }
.tf-hero-text { flex: 1; min-width: 200px; }
.tf-hero-text h1 { margin: 0 0 3px; font-size: 1.5rem; color: var(--text); }
.tf-hero-text p  { margin: 0; color: var(--muted); font-size: .9rem; }
.tf-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #052e23 !important;
  border-radius: 999px;
  font-weight: 700;
  font-size: .9rem;
  white-space: nowrap;
  transition: filter .15s, transform .1s, box-shadow .2s;
}
.tf-hero-cta:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(16,185,129,.35);
}

.tf-map-wrap {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg2);
}
.tf-map-wrap iframe {
  display: block;
  width: 100%;
  height: 460px;
  border: 0;
  filter: hue-rotate(175deg) invert(.92) brightness(.95) contrast(1.05);
}
.tf-map-note {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 16px;
  font-size: .82rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,.15);
}

.tf-actions { margin-top: 32px; }
.tf-actions h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 14px;
}

.tf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.tf-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  transition: transform .12s, border-color .15s, background .15s;
}
.tf-card:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,.02);
  color: var(--text);
}

.tf-card-icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px;
  flex-shrink: 0;
}
.tf-card-icon svg { width: 20px; height: 20px; }
.tf-card-body { flex: 1; min-width: 0; }
.tf-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.tf-card-head h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
}
.tf-badge {
  padding: 2px 8px;
  background: rgba(16,185,129,.15);
  color: var(--accent);
  border: 1px solid rgba(16,185,129,.3);
  border-radius: 999px;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .06em;
  animation: livePulse 2s ease-in-out infinite;
}
.tf-card p {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.4;
}
.tf-card-arrow {
  color: var(--muted);
  transition: color .15s, transform .15s;
  flex-shrink: 0;
}
.tf-card:hover .tf-card-arrow { transform: translate(3px, -3px); }

/* Colori specifici per ogni card */
.tf-card.tf-green  { border-left-color: var(--accent); }
.tf-card.tf-green .tf-card-icon { background: rgba(16,185,129,.15); color: var(--accent); }
.tf-card.tf-green:hover  { border-color: rgba(16,185,129,.4); }
.tf-card.tf-green:hover .tf-card-arrow { color: var(--accent); }

.tf-card.tf-cyan   { border-left-color: var(--accent2); }
.tf-card.tf-cyan .tf-card-icon { background: rgba(6,182,212,.15); color: var(--accent2); }
.tf-card.tf-cyan:hover   { border-color: rgba(6,182,212,.4); }
.tf-card.tf-cyan:hover .tf-card-arrow { color: var(--accent2); }

.tf-card.tf-orange { border-left-color: #f59e0b; }
.tf-card.tf-orange .tf-card-icon { background: rgba(245,158,11,.15); color: #f59e0b; }
.tf-card.tf-orange:hover { border-color: rgba(245,158,11,.4); }
.tf-card.tf-orange:hover .tf-card-arrow { color: #f59e0b; }

.tf-card.tf-red    { border-left-color: #ef4444; }
.tf-card.tf-red .tf-card-icon { background: rgba(239,68,68,.15); color: #f87171; }
.tf-card.tf-red:hover    { border-color: rgba(239,68,68,.4); }
.tf-card.tf-red:hover .tf-card-arrow { color: #f87171; }

.tf-card.tf-blue   { border-left-color: var(--accent3); }
.tf-card.tf-blue .tf-card-icon { background: rgba(59,130,246,.15); color: var(--accent3); }
.tf-card.tf-blue:hover   { border-color: rgba(59,130,246,.4); }
.tf-card.tf-blue:hover .tf-card-arrow { color: var(--accent3); }

.tf-card.tf-purple { border-left-color: #a855f7; }
.tf-card.tf-purple .tf-card-icon { background: rgba(168,85,247,.15); color: #a855f7; }
.tf-card.tf-purple:hover { border-color: rgba(168,85,247,.4); }
.tf-card.tf-purple:hover .tf-card-arrow { color: #a855f7; }

@media (max-width: 640px) {
  .tf-page { padding: 0 14px; }
  .tf-hero { padding: 18px; }
  .tf-hero-text h1 { font-size: 1.2rem; }
  .tf-hero-cta { width: 100%; justify-content: center; }
  .tf-map-wrap iframe { height: 340px; }
}

/* ══════════════════════════════════════════════════════
   MUSEI PAGE
══════════════════════════════════════════════════════ */
.mu-page {
  max-width: 1100px;
  margin: 24px auto 60px;
  padding: 0 24px;
}

.mu-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(168,85,247,.12), rgba(245,158,11,.08));
  border: 1px solid var(--border);
  border-left: 4px solid #a855f7;
  border-radius: var(--radius);
}
.mu-hero-icon { font-size: 2.8rem; line-height: 1; flex-shrink: 0; }
.mu-hero-text h1 { margin: 0 0 4px; font-size: 1.5rem; color: var(--text); }
.mu-hero-text p  { margin: 0; color: var(--muted); font-size: .92rem; }

.mu-tabs {
  display: flex;
  gap: 4px;
  margin: 22px 0 18px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.mu-tabs::-webkit-scrollbar { display: none; }

.mu-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  color: var(--muted);
  font-weight: 500;
  font-size: .92rem;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.mu-tab:hover { color: var(--text); }
.mu-tab.active {
  color: #a855f7;
  border-bottom-color: #a855f7;
}
.mu-tab-count {
  padding: 1px 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .7rem;
  color: var(--text);
}

.mu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.mu-card {
  display: flex;
  gap: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .15s, border-color .15s, box-shadow .2s;
}
.mu-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-h);
  box-shadow: 0 12px 28px rgba(0,0,0,.4);
}

.mu-card-icon {
  width: 90px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, rgba(168,85,247,.12), rgba(16,185,129,.06));
  border-right: 1px solid var(--border);
}
.mu-card-icon.mu-cat-arte    { background: linear-gradient(135deg, rgba(245,158,11,.15), rgba(239,68,68,.08)); }
.mu-card-icon.mu-cat-storia  { background: linear-gradient(135deg, rgba(168,85,247,.15), rgba(59,130,246,.08)); }
.mu-card-icon.mu-cat-cultura { background: linear-gradient(135deg, rgba(16,185,129,.15), rgba(6,182,212,.08)); }

/* Parchi & giardini: colore categorie */
.mu-card-icon.pa-cat-urbano   { background: linear-gradient(135deg, rgba(132,204,22,.18), rgba(16,185,129,.08)); }
.mu-card-icon.pa-cat-storia   { background: linear-gradient(135deg, rgba(168,85,247,.15), rgba(59,130,246,.08)); }
.mu-card-icon.pa-cat-arte     { background: linear-gradient(135deg, rgba(245,158,11,.15), rgba(239,68,68,.08)); }
.mu-card-icon.pa-cat-natura   { background: linear-gradient(135deg, rgba(6,182,212,.15), rgba(16,185,129,.08)); }
.mu-card-icon.pa-cat-famiglia { background: linear-gradient(135deg, rgba(236,72,153,.15), rgba(245,158,11,.08)); }
.mu-card-icon.pa-cat-vivai    { background: linear-gradient(135deg, rgba(34,197,94,.18), rgba(132,204,22,.08)); }

.mu-badge.pa-cat-urbano   { background: rgba(132,204,22,.15); color: #a3e635; border: 1px solid rgba(132,204,22,.3); }
.mu-badge.pa-cat-storia   { background: rgba(168,85,247,.15); color: #a855f7; border: 1px solid rgba(168,85,247,.3); }
.mu-badge.pa-cat-arte     { background: rgba(245,158,11,.15); color: #f59e0b; border: 1px solid rgba(245,158,11,.3); }
.mu-badge.pa-cat-natura   { background: rgba(6,182,212,.15);  color: var(--accent2); border: 1px solid rgba(6,182,212,.3); }
.mu-badge.pa-cat-famiglia { background: rgba(236,72,153,.15); color: #f472b6; border: 1px solid rgba(236,72,153,.3); }
.mu-badge.pa-cat-vivai    { background: rgba(34,197,94,.15);  color: #4ade80; border: 1px solid rgba(34,197,94,.3);  }

.mu-tab.active { color: #84cc16; border-bottom-color: #84cc16; }

.mu-card-body {
  flex: 1;
  padding: 14px 16px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mu-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.mu-card-top h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.mu-badge {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  flex-shrink: 0;
}
.mu-badge.mu-cat-arte    { background: rgba(245,158,11,.15); color: #f59e0b; border: 1px solid rgba(245,158,11,.3); }
.mu-badge.mu-cat-storia  { background: rgba(168,85,247,.15); color: #a855f7; border: 1px solid rgba(168,85,247,.3); }
.mu-badge.mu-cat-cultura { background: rgba(16,185,129,.15); color: var(--accent); border: 1px solid rgba(16,185,129,.3); }

.mu-desc {
  margin: 0;
  color: #b8c2cc;
  font-size: .85rem;
  line-height: 1.5;
}

.mu-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .8rem;
  color: var(--muted);
}
.mu-meta li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.mu-meta li svg { color: var(--muted); flex-shrink: 0; margin-top: 2px; }
.mu-meta a { color: var(--accent2); }

.mu-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.mu-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  transition: filter .15s, transform .1s;
}
.mu-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.mu-btn-web {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #fff !important;
}
.mu-btn-map {
  background: rgba(0,0,0,.3);
  border: 1px solid var(--border);
  color: var(--text) !important;
}

@media (max-width: 640px) {
  .mu-page { padding: 0 14px; }
  .mu-hero { padding: 18px; flex-wrap: wrap; }
  .mu-hero-text h1 { font-size: 1.2rem; }
  .mu-card-icon { width: 70px; font-size: 2rem; }
}

/* ══════════════════════════════════════════════════════
   EMERGENZE PAGE
══════════════════════════════════════════════════════ */
.em-page {
  max-width: 1100px;
  margin: 24px auto 60px;
  padding: 0 24px;
}

.em-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 26px 28px;
  background: linear-gradient(135deg, rgba(239,68,68,.18), rgba(220,38,38,.06));
  border: 1px solid rgba(239,68,68,.25);
  border-left: 4px solid #ef4444;
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.em-hero-icon { font-size: 3rem; line-height: 1; flex-shrink: 0; }
.em-hero-text { flex: 1; min-width: 200px; }
.em-hero-text h1 { margin: 0 0 4px; font-size: 1.6rem; color: var(--text); }
.em-hero-text p  { margin: 0; color: var(--muted); font-size: .92rem; }

.em-hero-call {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff !important;
  border-radius: 14px;
  text-decoration: none;
  transition: transform .12s, box-shadow .2s, filter .15s;
  box-shadow: 0 8px 24px rgba(239,68,68,.35);
  flex-shrink: 0;
}
.em-hero-call:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(239,68,68,.5); }
.em-hero-call svg { width: 26px; height: 26px; flex-shrink: 0; }
.em-hero-num   { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.em-hero-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; opacity: .9; margin-top: 2px; }

.em-hero-desc {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 12px 18px;
  background: rgba(239,68,68,.06);
  border: 1px solid rgba(239,68,68,.15);
  border-radius: 10px;
  color: #fca5a5;
  font-size: .88rem;
  line-height: 1.5;
}
.em-hero-desc svg { flex-shrink: 0; margin-top: 2px; color: #f87171; }

.em-disclaimer {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 12px 18px;
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.22);
  border-radius: 10px;
  color: #fbbf24;
  font-size: .85rem;
  line-height: 1.5;
}
.em-disclaimer svg { flex-shrink: 0; margin-top: 2px; }

/* Sections */
.em-section { margin-top: 32px; }
.em-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 14px;
  padding-left: 12px;
  border-left: 3px solid var(--border);
}
.em-section-title.em-red    { color: #f87171; border-color: #ef4444; }
.em-section-title.em-red svg{ color: #f87171; }
.em-section-title.em-green  { color: var(--accent); border-color: var(--accent); }
.em-section-title.em-green svg{ color: var(--accent); }
.em-section-title.em-blue   { color: var(--accent3); border-color: var(--accent3); }
.em-section-title.em-blue svg{ color: var(--accent3); }
.em-section-title.em-orange { color: #f59e0b; border-color: #f59e0b; }
.em-section-title.em-orange svg{ color: #f59e0b; }
.em-section-title.em-purple { color: #a855f7; border-color: #a855f7; }
.em-section-title.em-purple svg{ color: #a855f7; }
.em-section-title.em-pink   { color: #ec4899; border-color: #ec4899; }
.em-section-title.em-pink svg{ color: #ec4899; }

/* Grid of emergency cards */
.em-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.em-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  position: relative;
  transition: transform .12s, border-color .15s, box-shadow .2s;
}
.em-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
  color: var(--text);
}

.em-card.em-red    { border-left-color: #ef4444; }
.em-card.em-red:hover    { border-color: rgba(239,68,68,.5); }
.em-card.em-green  { border-left-color: var(--accent); }
.em-card.em-green:hover  { border-color: rgba(16,185,129,.5); }
.em-card.em-blue   { border-left-color: var(--accent3); }
.em-card.em-blue:hover   { border-color: rgba(59,130,246,.5); }
.em-card.em-orange { border-left-color: #f59e0b; }
.em-card.em-orange:hover { border-color: rgba(245,158,11,.5); }
.em-card.em-purple { border-left-color: #a855f7; }
.em-card.em-purple:hover { border-color: rgba(168,85,247,.5); }
.em-card.em-pink   { border-left-color: #ec4899; }
.em-card.em-pink:hover   { border-color: rgba(236,72,153,.5); }

.em-card-num {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
  line-height: 1.1;
}
.em-red    .em-card-num { color: #f87171; }
.em-green  .em-card-num { color: var(--accent); }
.em-blue   .em-card-num { color: var(--accent3); }
.em-orange .em-card-num { color: #f59e0b; }
.em-purple .em-card-num { color: #a855f7; }
.em-pink   .em-card-num { color: #ec4899; }

.em-card-name {
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}
.em-card-desc {
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 4px;
}
.em-card-call {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 5px 12px;
  background: rgba(0,0,0,.25);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  align-self: flex-start;
  transition: background .15s, color .15s;
}
.em-card:hover .em-card-call { background: rgba(16,185,129,.12); color: var(--accent); }

/* Tips */
.em-tips {
  list-style: none;
  padding: 18px 22px;
  margin: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.em-tips li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  color: #b8c2cc;
  font-size: .9rem;
  line-height: 1.55;
  border-bottom: 1px dashed var(--border);
}
.em-tips li:last-child { border-bottom: 0; }
.em-tips li svg { color: var(--accent); flex-shrink: 0; margin-top: 4px; }

@media (max-width: 640px) {
  .em-page { padding: 0 14px; }
  .em-hero { padding: 20px; }
  .em-hero-text h1 { font-size: 1.3rem; }
  .em-hero-call { width: 100%; justify-content: center; }
  .em-hero-num  { font-size: 1.9rem; }
  .em-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════
   FARMACIE PAGE
══════════════════════════════════════════════════════ */
.fm-page {
  max-width: 1100px;
  margin: 24px auto 60px;
  padding: 0 24px;
}

.fm-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(239,68,68,.1), rgba(16,185,129,.08));
  border: 1px solid var(--border);
  border-left: 4px solid #ef4444;
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.fm-hero-icon { font-size: 3rem; line-height: 1; flex-shrink: 0; }
.fm-hero-text { flex: 1; min-width: 200px; }
.fm-hero-text h1 { margin: 0 0 4px; font-size: 1.5rem; color: var(--text); }
.fm-hero-text p  { margin: 0 0 8px; color: var(--muted); font-size: .9rem; }

.fm-hero-stats {
  display: flex;
  gap: 14px;
  flex-shrink: 0;
}
.fm-hero-stats > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 16px;
  background: rgba(0,0,0,.3);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 66px;
}
.fm-hero-stats strong {
  font-size: 1.4rem;
  color: var(--accent);
  font-weight: 700;
  line-height: 1.1;
}
.fm-hero-stats span {
  font-size: .7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 2px;
}

.fm-section { margin-top: 28px; }
.fm-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 14px;
}
.fm-section-title svg { color: var(--accent); }
.fm-turn-title { color: #fbbf24; }
.fm-turn-title svg { color: #fbbf24; }
.fm-closed-title { color: var(--muted); }
.fm-closed-title svg { color: var(--muted); }

.fm-count {
  margin-left: 4px;
  padding: 2px 9px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .72rem;
  color: var(--text);
  letter-spacing: 0;
}

.fm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}
.fm-grid-closed { opacity: .62; }

.fm-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .12s, border-color .15s, box-shadow .2s;
}
.fm-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-h);
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
}

.fm-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.fm-card-head h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
  text-transform: capitalize;
}

.fm-badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  flex-shrink: 0;
}
.fm-badge-turn   { background: rgba(251,191,36,.18); color: #fbbf24; border: 1px solid rgba(251,191,36,.4); animation: livePulse 2.5s ease-in-out infinite; }
.fm-badge-open   { background: rgba(16,185,129,.15); color: var(--accent); border: 1px solid rgba(16,185,129,.3); }
.fm-badge-closed { background: rgba(239,68,68,.12); color: #f87171; border: 1px solid rgba(239,68,68,.25); }

.fm-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: .85rem;
  color: #b8c2cc;
}
.fm-meta li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.fm-meta li svg { color: var(--muted); flex-shrink: 0; margin-top: 2px; }
.fm-zone {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: .75rem;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.fm-turno-row {
  padding: 6px 8px;
  background: rgba(251,191,36,.08);
  border: 1px solid rgba(251,191,36,.2);
  border-radius: 6px;
  color: #fbbf24 !important;
}
.fm-turno-row svg { color: #fbbf24 !important; }
.fm-turno-row strong { color: #fbbf24; }

.fm-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.fm-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  transition: filter .15s, transform .1s;
}
.fm-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.fm-btn-phone {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #052e23 !important;
}
.fm-btn-map {
  background: rgba(0,0,0,.3);
  border: 1px solid var(--border);
  color: var(--text) !important;
}

@media (max-width: 640px) {
  .fm-page { padding: 0 14px; }
  .fm-hero { padding: 18px; }
  .fm-hero-text h1 { font-size: 1.2rem; }
  .fm-hero-stats { width: 100%; justify-content: space-between; }
}

/* ══════════════════════════════════════════════════════
   AUTOBUS PAGE
══════════════════════════════════════════════════════ */
.bus-page {
  max-width: 960px;
  margin: 24px auto 60px;
  padding: 0 24px;
}

.bus-hero {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 28px;
  background: linear-gradient(135deg, rgba(59,130,246,.14), rgba(16,185,129,.08));
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent3);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.bus-hero::after {
  content: "🚌";
  position: absolute;
  right: -10px; bottom: -20px;
  font-size: 9rem;
  opacity: .06;
  transform: rotate(-8deg);
  pointer-events: none;
}
.bus-hero-icon { font-size: 3.5rem; line-height: 1; position: relative; z-index: 1; }
.bus-hero-text { position: relative; z-index: 1; }
.bus-hero-text h1 { margin: 0 0 4px; font-size: 1.6rem; color: var(--text); }
.bus-hero-text p  { margin: 0 0 10px; color: var(--muted); font-size: .95rem; }

.bus-section { margin-top: 30px; }
.bus-section h3 {
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 14px;
}

/* Action cards */
.bus-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.bus-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  transition: transform .12s, border-color .15s, background .2s;
}
.bus-link:hover {
  transform: translateY(-2px);
  border-color: var(--border-h);
  background: rgba(16,185,129,.06);
}
.bus-link-icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #052e23;
  border-radius: 12px;
  flex-shrink: 0;
}
.bus-link-icon svg { width: 20px; height: 20px; }
.bus-link-text { flex: 1; min-width: 0; }
.bus-link-text strong { display: block; color: var(--text); font-size: .98rem; font-weight: 600; }
.bus-link-text span   { display: block; color: var(--muted); font-size: .82rem; margin-top: 2px; }
.bus-link-arrow { color: var(--muted); transition: transform .15s, color .15s; flex-shrink: 0; }
.bus-link:hover .bus-link-arrow { color: var(--accent); transform: translateX(3px); }

/* Tickets */
.bus-tickets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.bus-ticket {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .15s;
}
.bus-ticket:hover { border-color: var(--border-h); }
.bus-ticket-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.bus-ticket-head h4 { margin: 0; font-size: 1rem; color: var(--text); font-weight: 600; }
.bus-ticket-price {
  color: var(--accent);
  font-weight: 600;
  font-size: .82rem;
  padding: 3px 9px;
  background: rgba(16,185,129,.12);
  border-radius: 999px;
  border: 1px solid rgba(16,185,129,.25);
}
.bus-ticket-detail {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #b8c2cc;
  font-size: .85rem;
  line-height: 1.45;
}
.bus-ticket-detail svg { color: var(--muted); margin-top: 2px; flex-shrink: 0; }

/* Tips */
.bus-tips {
  list-style: none;
  padding: 18px 22px;
  margin: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.bus-tips li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  color: #b8c2cc;
  font-size: .92rem;
  line-height: 1.5;
  border-bottom: 1px dashed var(--border);
}
.bus-tips li:last-child { border-bottom: 0; }
.bus-tips li svg { color: var(--accent); flex-shrink: 0; margin-top: 3px; }

@media (max-width: 640px) {
  .bus-page { padding: 0 14px; }
  .bus-hero { flex-direction: column; text-align: center; padding: 22px; gap: 12px; }
  .bus-hero-text h1 { font-size: 1.3rem; }
}

/* ── Knowledge base panel ─────────────────────────── */
.kb-panel {
  max-width: 960px;
  margin: 24px auto 40px;
  padding: 0 24px;
}

.kb-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  background: linear-gradient(135deg, rgba(16,185,129,.12), rgba(59,130,246,.08));
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius) var(--radius) 0 0;
}

.kb-head-icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.35);
  border-radius: 14px;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.kb-head-text { flex: 1; min-width: 0; }
.kb-head-text h2 {
  margin: 0 0 2px;
  font-size: 1.35rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.kb-head-text p { margin: 0; color: var(--muted); font-size: .88rem; }

.kb-updated {
  color: var(--muted);
  font-size: .76rem;
  padding: 4px 10px;
  background: rgba(0,0,0,.25);
  border-radius: 999px;
  white-space: nowrap;
}

.kb-note {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 12px 18px;
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.2);
  border-top: none;
  color: #fbbf24;
  font-size: .85rem;
  line-height: 1.5;
}
.kb-note svg { flex-shrink: 0; margin-top: 2px; }

.kb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  padding: 18px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}

.kb-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: border-color .2s, transform .12s, box-shadow .2s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kb-card:hover {
  border-color: var(--border-h);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
}

.kb-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.kb-card-head h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
}

.kb-badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-free    { background: rgba(16,185,129,.15); color: var(--accent); border: 1px solid rgba(16,185,129,.3); }
.badge-paid    { background: rgba(59,130,246,.12); color: var(--accent3); border: 1px solid rgba(59,130,246,.3); }
.badge-neutral { background: rgba(255,255,255,.06); color: var(--muted); border: 1px solid var(--border); }

.kb-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: .83rem;
  color: #b8c2cc;
}

.kb-meta li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kb-meta li svg { color: var(--muted); flex-shrink: 0; }

.kb-notes {
  margin: 0;
  padding: 8px 10px;
  background: rgba(255,255,255,.03);
  border-left: 2px solid var(--accent);
  border-radius: 6px;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.5;
}

.kb-maps-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #052e23 !important;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  margin-top: 4px;
  transition: filter .2s, transform .1s;
}
.kb-maps-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }

@media (max-width: 640px) {
  .kb-panel { padding: 0 14px; }
  .kb-head { padding: 16px 18px; flex-wrap: wrap; }
  .kb-updated { order: 3; width: 100%; text-align: right; }
  .kb-grid { grid-template-columns: 1fr; padding: 14px; }
}

/* ── Stats bar ────────────────────────────────────── */
.stats {
  max-width: 720px;
  margin: 18px auto 6px;
  padding: 0 24px;
  color: var(--muted);
  font-size: .85rem;
}

.stats strong { color: var(--text); }

/* ── Results list ─────────────────────────────────── */
.results {
  max-width: 720px;
  margin: 10px auto 60px;
  padding: 0 24px;
}

.result {
  margin-bottom: 28px;
  animation: fadeSlide .35s ease backwards;
}
.result:nth-child(1) { animation-delay: .02s; }
.result:nth-child(2) { animation-delay: .07s; }
.result:nth-child(3) { animation-delay: .12s; }
.result:nth-child(4) { animation-delay: .16s; }
.result:nth-child(5) { animation-delay: .20s; }
.result:nth-child(6) { animation-delay: .24s; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-url {
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-url .favicon {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--bg2);
  padding: 2px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.result-title a {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  display: inline-block;
  margin-bottom: 4px;
}

.result-title a:hover {
  color: var(--accent2);
  text-decoration: underline;
}

.result-snippet {
  font-size: .93rem;
  color: #b8c2cc;
  line-height: 1.55;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.result-thumb {
  width: 88px;
  height: 66px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg2);
}

.result-snippet b, .result-snippet strong {
  color: var(--accent);
  font-weight: 600;
}

/* ── Pagination ───────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 40px auto 0;
}

.pagination a, .pagination span {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: .9rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  transition: all .15s;
}

.pagination a:hover {
  border-color: var(--border-h);
  background: rgba(16,185,129,.08);
}

.pagination .current {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #052e23;
  border-color: transparent;
  font-weight: 700;
}

.pagination .disabled { opacity: .4; cursor: not-allowed; }

/* ── No results / error ───────────────────────────── */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty h3 { color: var(--text); margin: 12px 0 6px; }
.empty .icon { font-size: 3rem; opacity: .4; }

.error-box {
  max-width: 700px;
  margin: 40px auto;
  padding: 20px 24px;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: var(--radius);
  color: #fca5a5;
}
.error-box strong { color: #f87171; }
.error-box pre { color: var(--muted); font-size: .82rem; white-space: pre-wrap; margin: 10px 0 0; }

/* ── Loading spinner (full-page) ──────────────────── */
.spinner {
  width: 22px; height: 22px;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 640px) {
  .logo { width: 280px; }
  .search-btn { padding: 10px 14px; font-size: .85rem; }
  .search-input { font-size: 1rem; padding: 12px 4px; }
  .top-bar { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .top-bar .logo-sm { width: 140px; }
  .results, .stats { padding: 0 16px; }
  .result-snippet { flex-direction: column; }
  .result-thumb { width: 100%; height: 140px; }
  .result-title a { font-size: 1.1rem; }
}
