/* ============================================================
   STRABAREGGIA 2026 — Design System
   Palette: nero (#161618) · fucsia (#FF00E2) · giallo (#FFD600) · bianco (#f0f0f0)
   ============================================================ */

:root {
  --bg:          #161618;
  --surface:     #1f1f21;
  --surface-alt: #282829;
  --fg:          #f0f0f0;
  --muted:       rgba(255,255,255,0.55);
  --border:      rgba(255,255,255,0.08);
  --accent:      #FF00E2;
  --accent-hover:#FF40E8;
  --accent-glow: rgba(255,0,226,0.25);
  --accent-2:    #FFD600;
  --accent-2-glow: rgba(255,214,0,0.20);
  --nav-h:       72px;
  --max-w:       1160px;
  --r:           14px;
  --trans:       0.22s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
ul { list-style: none; }

/* ---- Container ---- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ================================================================
   NAVIGATION
   ================================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background var(--trans), border-color var(--trans), padding var(--trans);
  border-bottom: 1px solid transparent;
}
.nav.nav-scrolled {
  background: rgba(22,22,24,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--border);
  padding: 10px 0;
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo { display: flex; align-items: center; }
.nav-logo img { height: 40px; width: auto; filter: hue-rotate(284deg) saturate(1.8); }
.nav-logo-text {
  font-size: 22px; font-weight: 900; letter-spacing: -0.03em;
  color: var(--accent);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav-link {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px; font-weight: 500;
  color: rgba(255,255,255,0.6);
  transition: color var(--trans), background var(--trans);
}
.nav-link:hover { color: #f0f0f0; background: rgba(255,255,255,0.06); }
.nav-link.active { color: var(--accent); background: rgba(255,0,226,0.09); }
.btn-nav {
  margin-left: 8px;
  padding: 9px 22px;
  background: var(--accent);
  color: #080808;
  border-radius: 8px;
  font-size: 14px; font-weight: 700;
  transition: background var(--trans), transform var(--trans), box-shadow var(--trans);
}
.btn-nav:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(255,0,226,0.4);
}
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  margin-left: auto;
  z-index: 101;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--fg); border-radius: 2px;
  transition: transform var(--trans), opacity var(--trans);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 24px;
  border-radius: 10px;
  font-size: 15px; font-weight: 700;
  letter-spacing: 0.01em;
  transition: all var(--trans);
  text-align: center;
}
.btn-accent { background: var(--accent); color: #080808; }
.btn-accent:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(255,0,226,0.35);
}
.btn-ghost {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: var(--fg); }
.btn-lg { padding: 16px 36px; font-size: 16px; border-radius: 12px; }
.w-full { width: 100%; }

/* ================================================================
   PANELS (homepage sections)
   ================================================================ */
.panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 100px 0;
  position: relative;
}
.panel-surface     { background: var(--surface); }
.panel-dark        { background: var(--bg); }
.panel-accent-dark { background: #1e132a; }

/* Section headers */
.section-tag {
  display: inline-block;
  padding: 5px 12px;
  background: rgba(255,0,226,0.12);
  color: var(--accent);
  border-radius: 6px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 16px;
}
.section-title {
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 900; letter-spacing: -0.025em; line-height: 1.1;
  margin-bottom: 16px;
}
.section-title em { font-style: normal; color: var(--accent); }
.section-title.accent-2 em { color: var(--accent-2); }
.section-desc {
  font-size: 16px; color: var(--muted); max-width: 520px; line-height: 1.75;
  text-wrap: pretty;
}
.section-header { margin-bottom: 52px; }
.section-header-center { text-align: center; }
.section-header-center .section-desc { margin: 0 auto; }

/* ================================================================
   HERO
   ================================================================ */
.hero {
  background: var(--bg);
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  min-height: 100vh;
  padding: 0;
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,0,226,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,0,226,0.035) 1px, transparent 1px);
  background-size: 60px 60px;
}
.hero-glow {
  position: absolute; top: -250px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 900px;
  background: radial-gradient(ellipse, rgba(255,0,226,0.11) 0%, transparent 65%);
}
.hero-content {
  position: relative; z-index: 1;
  padding-top: 0;
  padding-bottom: 0;
  display: grid;
  grid-template-columns: 5fr 7fr;
  align-items: start;
  gap: 0;
  max-width: none;
  padding-left: max(24px, calc((100vw - var(--max-w)) / 2 + 24px));
  padding-right: 0;
}
.hero-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  padding: calc(var(--nav-h) + 40px) 48px 48px 0;
}
.hero-edition {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.hero-logo {
  height: clamp(120px, 20vw, 280px);
  width: auto;
  display: block;
  filter: hue-rotate(284deg) saturate(1.8) drop-shadow(0 0 40px rgba(255,0,226,.25));
}
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.badge {
  padding: 6px 14px;
  background: var(--accent); color: #080808;
  border-radius: 100px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
}
.badge-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.65);
}
.hero-title {
  font-size: clamp(52px, 10vw, 120px);
  font-weight: 900; letter-spacing: -0.035em; line-height: 0.9;
  color: var(--fg);
}
.hero-subtitle {
  font-size: clamp(11px, 1.6vw, 16px);
  color: var(--accent-2);
  font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap;
}
.countdown {
  display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
}
.cd-unit {
  display: flex; flex-direction: column; align-items: center;
  min-width: 74px; padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.cd-num {
  font-size: clamp(30px, 4.2vw, 48px);
  font-weight: 900; letter-spacing: -0.02em;
  color: var(--accent);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.cd-label {
  font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.1em; margin-top: 5px;
}
.cd-sep {
  font-size: 30px; font-weight: 800; color: var(--accent-2); opacity: 0.45;
  line-height: 1; padding-bottom: 20px;
}
.cd-live {
  font-size: 24px; font-weight: 800; color: var(--accent);
  letter-spacing: -0.01em;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-price {
  font-size: 14px;
  color: rgba(255,255,255,0.45);
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* Hero carousel */
.hero-carousel {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}
.hero-carousel::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: clamp(80px, 10vw, 160px);
  background: linear-gradient(90deg, var(--bg) 0%, transparent 100%);
  z-index: 1;
  pointer-events: none;
}
.hero-carousel::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(180deg, rgba(22,22,24,0.6) 0%, transparent 100%);
  z-index: 1;
  pointer-events: none;
}
.hero-carousel__track {
  display: flex;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-carousel__slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Carousel navigation */
.hero-carousel__arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  z-index: 3;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.hero-carousel__arrow:hover {
  background: rgba(255,0,226,0.15);
  border-color: rgba(255,0,226,0.4);
  color: #fff;
}
.hero-carousel__arrow--prev { left: 14px; }
.hero-carousel__arrow--next { right: 14px; }

.hero-carousel__dots {
  position: absolute;
  bottom: max(20px, calc(100% - 100vh + 40px));
  left: 50%; transform: translateX(-50%);
  z-index: 3;
  display: flex; gap: 8px;
  align-items: center;
}
.hero-carousel__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  border: none; padding: 0;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s;
}
.hero-carousel__dot:hover {
  background: rgba(255,255,255,0.6);
}
.hero-carousel__dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

@keyframes hero-kenburns {
  0%   { transform: scale(1); }
  100% { transform: scale(1.08); }
}

.scroll-hint {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.25);
  animation: bounce 2s ease-in-out infinite;
  z-index: 1;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(9px); }
}

/* ================================================================
   ISCRIZIONI
   ================================================================ */
.cards-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px; margin-bottom: 36px;
}
.card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 32px; position: relative; overflow: hidden;
  transition: border-color var(--trans), transform var(--trans);
}
.card:hover { border-color: rgba(255,255,255,0.12); transform: translateY(-4px); }
.race-card-featured { border-color: rgba(255,0,226,0.28); }
.race-card-featured:hover { border-color: rgba(255,0,226,0.7); }
.race-badge-feat {
  position: absolute; top: 16px; right: 16px;
  background: var(--accent-2); color: #080808;
  padding: 4px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
.race-dist {
  font-size: 72px; font-weight: 900; letter-spacing: -0.04em;
  line-height: 1; color: var(--fg); margin-bottom: 24px;
}
.race-dist span { font-size: 28px; font-weight: 700; color: var(--accent); vertical-align: super; }
.race-info { display: flex; flex-direction: column; gap: 16px; }
.race-start {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 14px;
}
.race-start svg { color: var(--accent); flex-shrink: 0; }
.race-price { display: flex; align-items: baseline; gap: 10px; }
.price { font-size: 38px; font-weight: 900; letter-spacing: -0.02em; }
.price-note { font-size: 13px; color: var(--muted); }
.race-features { display: flex; flex-direction: column; gap: 9px; }
.race-features li {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px; color: rgba(255,255,255,0.7);
}
.race-features li::before {
  content: ''; display: block; width: 6px; height: 6px;
  background: var(--accent-2); border-radius: 50%; flex-shrink: 0;
}
.iscr-chips {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.info-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 10px; font-size: 13px; color: rgba(255,255,255,0.65);
}
.info-chip svg { color: var(--accent); flex-shrink: 0; }
.iscr-note { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ================================================================
   PERCORSO
   ================================================================ */
.percorso-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 80px; align-items: center; width: 100%;
}
.percorso-desc { font-size: 16px; color: var(--muted); line-height: 1.75; margin-bottom: 32px; }
.percorso-stats { display: flex; gap: 36px; margin-bottom: 32px; flex-wrap: wrap; }
.p-stat { display: flex; flex-direction: column; gap: 4px; }
.p-num { font-size: 44px; font-weight: 900; color: var(--accent); letter-spacing: -0.02em; line-height: 1; }
.p-unit { font-size: 18px; font-weight: 600; color: rgba(255,255,255,0.4); }
.p-label { font-size: 13px; color: var(--muted); }
.percorso-details { display: flex; flex-direction: column; gap: 13px; }
.pd-item {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; color: rgba(255,255,255,0.6);
}
.pd-item svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.map-wrapper {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 28px;
}
.map-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  background: rgba(255,255,255,0.06); border-radius: 10px; padding: 4px;
}
.map-tab {
  flex: 1; padding: 8px 0; border: none; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 14px;
  font-weight: 600; cursor: pointer; transition: all 0.25s ease;
  font-family: inherit;
}
.map-tab:hover { color: var(--fg); }
.map-tab.active {
  background: var(--accent); color: #fff;
  box-shadow: 0 2px 8px rgba(249,115,22,0.3);
}
.map-slider-viewport {
  overflow: hidden; border-radius: 12px;
}
.map-slider {
  display: flex; width: 200%;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.map-slide { width: 50%; }
.route-svg { width: 100%; height: auto; }
.map-legend {
  display: none; gap: 20px; margin-top: 16px; justify-content: center;
  flex-wrap: wrap;
}
.map-legend.active { display: flex; }
.leg-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
}
.leg-item.leg-sub { font-size: 12px; width: 100%; justify-content: center; }
.leg-line { display: block; width: 28px; height: 2px; border-radius: 2px; }
.leg-dot { display: block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; flex-shrink: 0; }
.leg-solid { background: var(--accent); }
.leg-dashed {
  background: transparent;
  border-top: 2px dashed var(--accent);
  height: 0;
}
.leg-10 { background: var(--accent); }
.leg-5 { background: rgba(255,255,255,0.4); }

/* ================================================================
   NUMERI
   ================================================================ */
.numeri-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}
.num-item {
  padding: 52px 32px; text-align: center;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: var(--r);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: background var(--trans);
}
.num-item:hover { background: rgba(255,0,226,0.05); }
.num-val {
  font-size: clamp(46px, 5vw, 72px);
  font-weight: 900; letter-spacing: -0.035em;
  color: var(--accent); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.num-plus { font-size: 28px; font-weight: 800; color: var(--accent-2); opacity: 0.7; }
.num-label { font-size: 13px; color: var(--muted); text-align: center; line-height: 1.4; }

/* ================================================================
   PHOTO PLACEHOLDERS
   Swap any .photo-ph for a real <img> or CSS background-image
   ================================================================ */
.photo-ph {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a1a 0%, #1a0f20 100%);
  border: 1.5px dashed rgba(255,0,226,0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 20px;
  transition: border-color var(--trans);
}
.photo-ph:hover { border-color: rgba(255,0,226,0.55); }
.photo-ph-icon { color: rgba(255,0,226,0.4); }
.photo-ph-title {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,0,226,0.6);
}
.photo-ph-desc {
  font-size: 12px; color: rgba(255,255,255,0.3);
  font-style: italic; max-width: 240px; line-height: 1.5;
  margin: 0;
}

/* ── Real race photo wrappers ──────────────────────────────── */
.race-photo-wrap {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  background: #1a1a1a;
}
.race-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.race-photo-wrap:hover img { transform: scale(1.04); }

/* Caption overlay for hero strip */
.race-photo-wrap .rp-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px 14px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
  pointer-events: none;
}
.race-photo-wrap .rp-caption strong {
  display: block;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,0,226,0.9);
}
.race-photo-wrap .rp-caption span {
  font-size: 11px; color: rgba(255,255,255,0.7);
  font-style: italic;
}


/* Iscrizioni — wide banner before cards */
.iscr-photo-banner { margin-bottom: 40px; }
.iscr-photo-banner .photo-ph,
.iscr-photo-banner .race-photo-wrap { height: 220px; width: 100%; }

/* Percorso — photo above map */
.percorso-photo { margin-bottom: 18px; }
.percorso-photo .photo-ph,
.percorso-photo .race-photo-wrap { height: 200px; width: 100%; }

/* Numeri — wide photo below stats */
.numeri-photo { margin-top: 44px; }
.numeri-photo .photo-ph { height: 320px; width: 100%; }
.numeri-photo .race-photo-wrap { width: 100%; }
.numeri-photo .race-photo-wrap img { height: auto; object-position: center; }

/* ================================================================
   PARTNERS
   ================================================================ */
.partners-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.partner-item {
  padding: 16px;
  background: #ffffff; border: 1px solid var(--border);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  font-size: 14px; font-weight: 600; color: rgba(0,0,0,0.4);
  transition: all var(--trans);
  height: 100px;
  text-decoration: none;
}
.partner-item img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
a.partner-item:hover {
  color: #080808; border-color: rgba(0,0,0,0.1);
  background: #f0f0f0;
}

/* ================================================================
   FOOTER
   ================================================================ */
.footer { background: var(--surface); border-top: 1px solid var(--border); }
.footer-inner {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 40px; align-items: start;
  padding: 56px 24px; max-width: var(--max-w); margin: 0 auto;
}
.footer-brand img { margin-bottom: 12px; filter: hue-rotate(284deg) saturate(1.8); }
.footer-brand p { font-size: 14px; color: var(--muted); line-height: 1.65; }
.footer-links { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.footer-links a { font-size: 14px; color: rgba(255,255,255,0.45); transition: color var(--trans); }
.footer-links a:hover { color: var(--fg); }
.footer-social { display: flex; gap: 10px; padding-top: 6px; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 9px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.4); transition: all var(--trans);
}
.footer-social a:hover { color: #080808; background: var(--accent); border-color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 18px 24px;
  max-width: var(--max-w); margin: 0 auto;
  display: flex; justify-content: space-between;
  font-size: 12px; color: rgba(255,255,255,0.22);
  flex-wrap: wrap; gap: 6px;
}

/* ================================================================
   ANIMATIONS
   ================================================================ */
.fade-in {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(0.23,1,0.32,1),
              transform 0.65s cubic-bezier(0.23,1,0.32,1);
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ================================================================
   INNER PAGES (news, info, reg, faq)
   ================================================================ */
.page-hero {
  padding-top: calc(var(--nav-h) + 64px);
  padding-bottom: 64px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.page-hero .section-tag { margin-bottom: 12px; }
.page-hero .section-title { margin-bottom: 0; }
.page-content { padding: 72px 0 96px; }

/* Content layout with sidebar */
.content-layout { display: grid; grid-template-columns: 240px 1fr; gap: 56px; align-items: start; }
.sidebar { position: sticky; top: calc(var(--nav-h) + 20px); }
.sidebar-title {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 10px; padding: 0 14px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
  padding: 9px 14px; border-radius: 8px; font-size: 14px;
  color: rgba(255,255,255,0.5); transition: all var(--trans);
}
.sidebar-link:hover { color: var(--fg); background: rgba(255,255,255,0.05); }
.sidebar-link.active { color: var(--accent); background: rgba(255,0,226,0.09); font-weight: 600; }
.main-content { min-width: 0; }
.content-section { margin-bottom: 56px; scroll-margin-top: calc(var(--nav-h) + 24px); }
.content-section + .content-section { padding-top: 8px; border-top: 1px solid var(--border); }
.content-section h2 {
  font-size: 26px; font-weight: 800; letter-spacing: -0.02em;
  margin-bottom: 20px; color: var(--accent);
}
.content-section h3 { font-size: 18px; font-weight: 700; margin-bottom: 12px; color: rgba(255,255,255,0.9); }
.content-section p { font-size: 15px; color: rgba(255,255,255,0.65); line-height: 1.78; margin-bottom: 16px; }
.content-section ul { padding-left: 20px; list-style: disc; display: flex; flex-direction: column; gap: 8px; }
.content-section ul li { font-size: 15px; color: rgba(255,255,255,0.65); line-height: 1.65; }
.content-section strong { color: var(--fg); font-weight: 600; }

/* Tech diagram */
.tech-diagram { margin: 24px 0; overflow-x: auto; }
.tech-diagram canvas { max-width: 100%; height: auto; }
.tech-diagram-caption { font-size: 12px; color: var(--muted); text-align: center; margin-top: 8px; }

/* Info boxes */
.info-highlight {
  background: rgba(255,0,226,0.08); border: 1px solid rgba(255,0,226,0.2);
  border-radius: 12px; padding: 20px 24px; margin-bottom: 24px;
}
.info-highlight p { margin-bottom: 0; }
.info-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 16px; margin-bottom: 24px;
}
.info-cell {
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 20px;
}
.info-cell .lbl {
  font-size: 11px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 5px;
}
.info-cell .val { font-size: 17px; font-weight: 700; color: var(--fg); line-height: 1.35; }
.info-cell .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ================================================================
   NEWS
   ================================================================ */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.news-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden;
  transition: transform var(--trans), border-color var(--trans);
  display: flex; flex-direction: column;
}
.news-card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,0.12); }
.news-card-img {
  width: 100%; height: 200px;
  background: var(--surface-alt);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; overflow: hidden; position: relative;
}
.news-card-img img { width: 100%; height: 100%; object-fit: cover; }
.news-card-img-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.15);
}
.news-card-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.news-card-meta {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap;
}
.news-card-date { font-size: 12px; color: var(--accent); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.news-card-tag {
  font-size: 11px; color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.05); border-radius: 4px;
  padding: 2px 7px;
}
.news-card-title { font-size: 17px; font-weight: 700; line-height: 1.3; margin-bottom: 10px; }
.news-card-excerpt { font-size: 14px; color: var(--muted); line-height: 1.65; flex: 1; }
.news-card-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 16px; font-size: 13px; font-weight: 700;
  color: var(--accent); transition: gap var(--trans);
}
.news-card-link:hover { gap: 10px; }

/* ================================================================
   FAQ ACCORDION
   ================================================================ */
.faq-section-title {
  font-size: 18px; font-weight: 800; letter-spacing: -0.01em;
  color: rgba(255,255,255,0.5); margin-bottom: 16px; margin-top: 40px;
  text-transform: uppercase; font-size: 12px; letter-spacing: 0.12em;
}
.faq-section-title:first-child { margin-top: 0; }
.faq-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  transition: border-color var(--trans);
}
.faq-item.open { border-color: rgba(255,0,226,0.3); }
.faq-q {
  padding: 18px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  cursor: pointer; font-size: 15px; font-weight: 600; color: var(--fg);
  user-select: none; transition: color var(--trans);
}
.faq-q:hover { color: var(--accent); }
.faq-icon {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 18px; line-height: 1;
  transition: background var(--trans), transform var(--trans), color var(--trans);
  color: var(--accent);
}
.faq-item.open .faq-icon { background: var(--accent); color: #080808; transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.38s cubic-bezier(0.23,1,0.32,1); }
.faq-item.open .faq-a { max-height: 800px; }
.faq-a-inner {
  padding: 16px 22px 20px;
  font-size: 14px; color: rgba(255,255,255,0.62); line-height: 1.78;
  border-top: 1px solid var(--border);
}
.faq-a-inner strong { color: var(--fg); }
.faq-a-inner ul { list-style: disc; padding-left: 18px; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1366px) {
  .hero { justify-content: flex-start; }
  .hero-text { gap: 16px; padding-top: calc(var(--nav-h) + 24px); }
  .hero-logo { height: clamp(80px, 15vw, 180px); }
  .hero-carousel { min-height: auto; }
  .cd-unit { min-width: 56px; padding: 8px 10px; }
  .cd-num { font-size: clamp(22px, 3.5vw, 36px); }
  .cd-label { font-size: 8px; }
  .cd-sep { font-size: 22px; padding-bottom: 14px; }
  .hero-subtitle { font-size: clamp(10px, 1.4vw, 14px); }
}
@media (max-width: 1024px) {
  .numeri-grid    { grid-template-columns: repeat(2, 1fr); }
  .partners-grid  { grid-template-columns: repeat(3, 1fr); }
  .percorso-grid  { grid-template-columns: 1fr; gap: 52px; }
  .percorso-visual { max-width: 500px; }
  .content-layout { grid-template-columns: 1fr; gap: 40px; }
  .sidebar { position: static; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-content { grid-template-columns: 1fr 1fr; }
  .hero-text { padding-right: 24px; }
}
@media (max-width: 768px) {
  .panel { padding: 80px 0; min-height: auto; }
  .hero-content { grid-template-columns: 1fr; text-align: center; padding-left: 24px; padding-right: 24px; padding-bottom: 72px; max-width: var(--max-w); margin: 0 auto; }
  .hero-text { align-items: center; gap: 24px; padding-top: calc(var(--nav-h) + 40px); }
  .hero-logo { height: clamp(120px, 20vw, 280px); }
  /* Hero carousel → fullscreen crossfade background on mobile */
  .hero { min-height: 100vh; min-height: 100dvh; padding: 0; }
  .hero-content { position: static; z-index: auto; }
  .hero-text { position: relative; z-index: 2; }
  .hero-carousel {
    position: absolute;
    inset: 0;
    z-index: 1;
    min-height: 0;
  }
  .hero-carousel::before {
    right: 0; width: 100%; height: 100%;
    background: linear-gradient(
      180deg,
      rgba(22,22,24,0.78) 0%,
      rgba(22,22,24,0.48) 35%,
      rgba(22,22,24,0.48) 65%,
      rgba(22,22,24,0.82) 100%
    );
    z-index: 2;
  }
  .hero-carousel::after { display: none; }
  .hero-carousel__arrow,
  .hero-carousel__dots { display: none; }
  .hero-carousel__track {
    display: block;
    position: absolute;
    inset: 0;
    transition: none;
    transform: none;
  }
  .hero-carousel__slide {
    position: absolute;
    inset: 0;
    flex: none;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
  }
  .hero-carousel__slide.active {
    opacity: 1;
    animation: hero-kenburns 6s ease-out forwards;
  }
  .cd-unit {
    background: rgba(22,22,24,0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-color: rgba(255,255,255,0.12);
  }
  .countdown { justify-content: center; }
  .hero-cta { justify-content: center; }
  .cards-row { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  .numeri-grid    { grid-template-columns: repeat(2, 1fr); }
  .partners-grid  { grid-template-columns: repeat(2, 1fr); }
  .footer-inner   { grid-template-columns: 1fr; gap: 28px; padding: 40px 24px; }
  .footer-bottom  { flex-direction: column; gap: 4px; text-align: center; }
  .iscr-chips     { flex-direction: column; }
  .percorso-stats { gap: 24px; }
  .info-grid      { grid-template-columns: 1fr; }
  .nav-links {
    display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh;
    background: rgba(22,22,24,0.96); backdrop-filter: blur(20px);
    flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; padding: 40px 24px; z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-link  { font-size: 20px; padding: 12px 28px; }
  .btn-nav   { font-size: 17px; padding: 14px 40px; margin: 8px 0 0 0; }
  .nav-toggle { display: flex; }
}
@media (max-width: 480px) {
  .partners-grid { grid-template-columns: 1fr 1fr; }
  .countdown { gap: 3px; }
  .cd-unit { min-width: auto; padding: 8px 8px; }
  .cd-num  { font-size: clamp(20px, 6vw, 26px); }
  .cd-sep  { font-size: 18px; padding-bottom: 14px; }
  .cd-label { font-size: 8px; letter-spacing: 0.08em; }
  .hero-title { font-size: clamp(44px, 14vw, 80px); }
}

/* ── NEWS DETAIL ── */
.news-detail { max-width: 760px; margin: 0 auto; }
.news-detail-meta {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.news-detail-image {
  margin-bottom: 40px; border-radius: var(--r); overflow: hidden;
}
.news-detail-image img {
  width: 100%; height: auto; max-height: 420px; object-fit: cover; display: block;
}
.news-detail-content { font-size: 16px; line-height: 1.75; color: rgba(255,255,255,0.8); }
.news-detail-content h2 {
  font-size: 22px; font-weight: 700; margin: 40px 0 16px; color: var(--fg);
}
.news-detail-content h3 {
  font-size: 18px; font-weight: 700; margin: 32px 0 12px; color: var(--fg);
}
.news-detail-content p { margin-bottom: 18px; }
.news-detail-content ul, .news-detail-content ol {
  margin: 0 0 18px 20px; padding: 0;
}
.news-detail-content li { margin-bottom: 6px; }
.news-detail-content a {
  color: var(--accent); text-decoration: underline;
  text-underline-offset: 3px; transition: color var(--trans);
}
.news-detail-content a:hover { color: var(--accent-hover); }
.news-detail-content img {
  max-width: 100%; height: auto; border-radius: var(--r); margin: 24px 0;
}
.news-detail-content blockquote {
  margin: 24px 0; padding: 16px 20px;
  border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: 0 var(--r) var(--r) 0;
  color: rgba(255,255,255,0.7); font-style: italic;
}
.news-detail-content strong { color: var(--fg); }
.news-detail-back {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 48px; font-size: 14px; font-weight: 700;
  color: var(--accent); transition: gap var(--trans);
}
.news-detail-back:hover { gap: 10px; }

@media (max-width: 768px) {
  .news-detail-image img { max-height: 280px; }
  .news-detail-content h2 { font-size: 20px; }
}

/* ================================================================
   REDUCED MOTION
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .fade-in { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ================================================================
   POPUP ISCRIZIONI CHIUSE
   ================================================================ */
.iscr-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.iscr-popup-overlay.visible { opacity: 1; }

.iscr-popup {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px 40px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  transform: translateY(16px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.iscr-popup-overlay.visible .iscr-popup {
  transform: translateY(0) scale(1);
}

.iscr-popup-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.iscr-popup-close:hover {
  color: var(--fg);
  background: rgba(255,255,255,0.06);
}

.iscr-popup-icon {
  margin-bottom: 16px;
  color: var(--accent);
  opacity: 0.8;
}

.iscr-popup-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--fg);
  margin: 0 0 12px;
}

.iscr-popup-text {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 8px;
}
.iscr-popup-text strong {
  color: var(--accent);
  font-weight: 600;
}

.iscr-popup-sub {
  font-size: 14px;
  color: var(--muted);
  opacity: 0.7;
  margin: 0;
}

/* ── Prezzi blur (mostra_prezzi: false) ──────────────────── */
.prezzo-blur-wrap {
  display: inline;
  cursor: default;
}
.prezzo-blur-wrap .prezzo-blur {
  filter: blur(8px);
  -webkit-filter: blur(8px);
  user-select: none;
  -webkit-user-select: none;
}
.prezzo-tooltip-global {
  position: fixed;
  white-space: nowrap;
  background: var(--surface, #1a1a2e);
  color: var(--text, #e0e0e0);
  border: 1px solid var(--accent, #f97316);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
  z-index: 99999;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.prezzo-tooltip-global.visible {
  opacity: 1;
}

/* ── Gallery Grid ────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.gallery-item {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.gallery-item:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Lightbox ────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0;
  z-index: 100000;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.lightbox.active {
  opacity: 1; pointer-events: auto;
}
.lightbox-content {
  position: relative;
  max-width: 90vw; max-height: 85vh;
  display: flex; flex-direction: column; align-items: center;
}
.lightbox-img {
  max-width: 90vw; max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0,0,0,.6);
}
.lightbox-counter {
  margin-top: 12px;
  font-size: 13px;
  color: rgba(255,255,255,.6);
  font-weight: 500;
}
.lightbox-close {
  position: absolute; top: 20px; right: 24px;
  background: none; border: none;
  color: #fff; font-size: 36px; cursor: pointer;
  opacity: .7; transition: opacity .2s;
  z-index: 2;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-prev,
.lightbox-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff; font-size: 24px;
  width: 48px; height: 48px;
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: .7; transition: opacity .2s, background .2s;
  z-index: 2;
}
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1; background: rgba(255,255,255,.15);
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
  .lightbox-prev, .lightbox-next { width: 36px; height: 36px; font-size: 18px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

/* ── Gallery Carousel Widget ─────────────────────────────── */
.gallery-carousel-widget {
  margin: 32px 0;
}
.gcw-header {
  margin-bottom: 12px;
}
.gcw-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #e0e0e0);
  margin: 0;
}
.gcw-track-wrap {
  position: relative;
}
.gcw-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 0;
}
.gcw-track::-webkit-scrollbar { display: none; }
.gcw-slide {
  flex: 0 0 auto;
  width: 200px;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  scroll-snap-align: start;
}
.gcw-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s;
}
.gcw-slide:hover img {
  transform: scale(1.05);
}
.gcw-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: .85;
  transition: opacity .2s, background .2s;
  z-index: 2;
  backdrop-filter: blur(4px);
}
.gcw-arrow:hover {
  opacity: 1;
  background: rgba(0,0,0,.75);
}
.gcw-arrow-hidden {
  opacity: 0;
  pointer-events: none;
}
.gcw-arrow-left { left: -16px; }
.gcw-arrow-right { right: -16px; }
.gcw-footer {
  margin-top: 14px;
  text-align: center;
}
.gcw-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent, #f97316);
  text-decoration: none;
  transition: color .2s;
}
.gcw-link:hover {
  color: var(--accent-2, #e2580e);
  text-decoration: underline;
}

@media (max-width: 600px) {
  .gcw-slide { width: 150px; }
  .gcw-arrow-left { left: -8px; }
  .gcw-arrow-right { right: -8px; }
  .gcw-arrow { width: 32px; height: 32px; font-size: 14px; }
}

/* ============================================================
   CHATBOT WIDGET
   ============================================================ */

/* ── Toggle button ── */
.chatbot-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255,0,226,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--trans), box-shadow var(--trans), opacity var(--trans);
  overflow: hidden;
}
.chatbot-toggle img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.chatbot-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(255,0,226,0.5);
}
.chatbot-toggle:active { transform: scale(0.95); }
.chatbot-toggle--hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.5);
}

/* ── Panel ── */
.chatbot-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9001;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 66vh;
  height: 66dvh;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.chatbot-panel--open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ── Header ── */
.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chatbot-header-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}
.chatbot-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color var(--trans), background var(--trans);
}
.chatbot-close:hover {
  color: var(--fg);
  background: rgba(255,255,255,0.08);
}

/* ── Messages area ── */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Message bubbles ── */
.chatbot-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}
.chatbot-msg a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.chatbot-msg--bot {
  align-self: flex-start;
  background: var(--surface-alt);
  color: var(--fg);
  border-bottom-left-radius: 4px;
}
.chatbot-msg--user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* ── Search results ── */
.chatbot-result {
  padding: 8px 0;
}
.chatbot-result + .chatbot-result {
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.chatbot-result-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}
.chatbot-result-text {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.chatbot-result-link {
  font-size: 12px;
  color: var(--accent) !important;
  text-decoration: none !important;
}
.chatbot-result-link:hover { text-decoration: underline !important; }

/* ── Source attribution ── */
.chatbot-sources {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--muted);
}
.chatbot-sources a {
  font-size: 11.5px;
}

/* ── Suggestions ── */
.chatbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chatbot-suggestion {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color var(--trans), background var(--trans);
}
.chatbot-suggestion:hover {
  border-color: var(--accent);
  background: rgba(255,0,226,0.08);
}

/* ── Input row ── */
.chatbot-input-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  flex-shrink: 0;
  gap: 8px;
}
.chatbot-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--fg);
  font-size: 16px;
  outline: none;
  transition: border-color var(--trans);
}
.chatbot-input::placeholder { color: var(--muted); }
.chatbot-input:focus { border-color: var(--accent); }
.chatbot-send {
  background: var(--accent);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--trans);
}
.chatbot-send:hover { background: var(--accent-hover); }

/* ── Typing indicator ── */
.chatbot-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}
.chatbot-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: chatbot-bounce 1.2s infinite;
}
.chatbot-dot:nth-child(2) { animation-delay: 0.15s; }
.chatbot-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes chatbot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ── Small screens: full height ── */
@media (max-height: 900px) {
  .chatbot-panel {
    height: calc(100vh - 48px);
    height: calc(100dvh - 48px);
  }
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .chatbot-toggle {
    bottom: 16px;
    right: 16px;
  }
  .chatbot-panel {
    bottom: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
    max-height: calc(100vh - 60px);
    max-height: calc(100dvh - 60px);
    border-radius: var(--r) var(--r) 0 0;
    border-bottom: none;
  }
}
