/* Neurosphere — tema chiaro + navbar grigio scuro a contrasto */
@font-face {
  font-family: "Biancoenero";
  src: url("../fonts/biancoenero-regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Biancoenero";
  src: url("../fonts/biancoenero-italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Biancoenero";
  src: url("../fonts/biancoenero-bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Biancoenero";
  src: url("../fonts/biancoenero-bold-italic.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Brand (logo) */
  --ns-blue: #2563eb;
  --ns-violet: #7c3aed;
  --ns-purple-deep: #5b21b6;
  --ns-orange: #ea580c;
  --ns-amber: #fbbf24;
  --ns-teal: #0d9488;
  --ns-teal-deep: #0f766e;
  --ns-mint: #14b8a6;
  /* Pagina chiara */
  --bg-page: #f6f7fb;
  --bg-subtle: #eef0f6;
  --surface: #ffffff;
  --surface-raised: #fafbff;
  --text: #1c1f2e;
  --text-muted: #5a6178;
  --border: rgba(28, 31, 46, 0.1);
  --border-strong: rgba(28, 31, 46, 0.14);
  /* Navbar scura ad alto contrasto */
  --nav-bg: #3a3a40;
  --nav-bg-deep: #323238;
  --nav-text: #f4f4f6;
  --nav-muted: #c8c8d0;
  --nav-border: rgba(0, 0, 0, 0.25);
  /* Compat nomi precedenti */
  --ns-ink: var(--text);
  --ns-ink-mid: var(--bg-subtle);
  --ns-ink-elevated: var(--surface-raised);
  --ns-surface: rgba(28, 31, 46, 0.04);
  --ns-surface-strong: rgba(28, 31, 46, 0.07);
  --ns-glass: var(--surface);
  --ns-glass-border: var(--border-strong);
  --accent: var(--ns-blue);
  --accent-strong: #1d4ed8;
  --accent-warm: var(--ns-orange);
  --danger: #dc2626;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-pill: 999px;
  --shadow-soft: 0 4px 20px rgba(28, 31, 46, 0.07);
  --shadow-lift: 0 12px 40px rgba(28, 31, 46, 0.1);
  --shadow-glow: 0 0 40px rgba(37, 99, 235, 0.08);
  --font-sans: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.3rem;
  --step-3: clamp(1.85rem, 4.2vw, 2.5rem);
  --step-4: clamp(2.35rem, 5.5vw, 3.35rem);
  --space: 1.5rem;
  --max: 1140px;
  --touch-min: 44px;
  --focus-ring: 0 0 0 3px #fff, 0 0 0 5px var(--ns-blue);
  --header-z: 100;
  --gradient-brand: linear-gradient(125deg, var(--ns-blue) 0%, var(--ns-violet) 45%, var(--ns-orange) 78%, var(--ns-teal) 100%);
  --gradient-cta: linear-gradient(135deg, var(--ns-blue), var(--ns-purple-deep));
  /* Mesh leggero su sfondo bianco */
  --gradient-mesh: radial-gradient(ellipse 90% 70% at 10% 8%, rgba(37, 99, 235, 0.09), transparent 55%),
    radial-gradient(ellipse 80% 60% at 88% 12%, rgba(124, 58, 237, 0.07), transparent 50%),
    radial-gradient(ellipse 70% 50% at 92% 85%, rgba(13, 148, 136, 0.06), transparent 50%),
    radial-gradient(ellipse 65% 45% at 8% 88%, rgba(234, 88, 12, 0.05), transparent 48%);
}

@media (prefers-contrast: more) {
  :root {
    --border: rgba(28, 31, 46, 0.2);
    --text-muted: #3d4456;
    --nav-muted: #e4e4ea;
  }
}

[data-text-size="sm"] {
  font-size: 93.75%;
}

[data-text-size="lg"] {
  font-size: 112.5%;
}

html[data-reading-font="dsa"] {
  --font-sans: "Biancoenero", system-ui, sans-serif;
  --font-display: "Biancoenero", system-ui, sans-serif;
}

html[data-reading-font="dsa"] body {
  line-height: 1.75;
}

html[data-reading-font="dsa"] .hero-title,
html[data-reading-font="dsa"] .logo {
  letter-spacing: 0.02em;
}

html[data-reading-font="dsa"] .eyebrow {
  letter-spacing: 0.06em;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg-page);
  background-image: var(--gradient-mesh),
    linear-gradient(180deg, #ffffff 0%, var(--bg-page) 35%, #f2f4fa 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

body.nav-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

/* Solo pagine template: la SPA React ha sempre #root e usa Tailwind per i link */
body:not(:has(#root)) a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

body:not(:has(#root)) a:hover {
  color: var(--ns-teal-deep);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--ns-blue);
  outline-offset: 2px;
}

button:focus-visible,
.btn:focus-visible {
  box-shadow: var(--focus-ring);
  outline-offset: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  z-index: 200;
  padding: 0.65rem 1.25rem;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
  background: var(--gradient-cta);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius-pill);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
}

.skip-link:focus {
  left: 0.75rem;
  outline: 3px solid var(--text);
}

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--header-z) - 1);
  background: rgba(20, 22, 32, 0.45);
  backdrop-filter: blur(4px);
}

.nav-overlay[hidden] {
  display: none;
}

/* Navbar = stessa fascia grigia del footer, senza effetti luminosi */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--header-z);
  padding: 0;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: none;
  isolation: isolate;
}

.site-header--bar {
  box-shadow: none;
}

.site-header > .header-inner {
  position: relative;
  z-index: 1;
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.65rem var(--space);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  flex-shrink: 0;
  text-decoration: none;
  align-self: center;
}

.logo--plain {
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.logo:focus-visible {
  border-radius: 4px;
  outline-offset: 3px;
}

.logo-img {
  display: block;
  flex-shrink: 0;
}

/* Logo navbar: solo grafica, più grande, niente ombre né riquadri */
.logo-img--navbar {
  position: relative;
  z-index: 1;
  width: auto;
  height: clamp(3.15rem, 9vw, 4.55rem);
  max-height: 4.85rem;
  max-width: min(20rem, 82vw);
  object-fit: contain;
  object-position: left center;
  border-radius: 0;
  box-shadow: none;
  filter: none;
  vertical-align: middle;
}

.logo--plain:hover .logo-img--navbar,
.logo--plain:active .logo-img--navbar {
  opacity: 0.92;
}

.logo--plain:hover .logo-img--navbar {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .logo--plain:hover .logo-img--navbar,
  .logo--plain:active .logo-img--navbar {
    opacity: 1;
  }
}

.logo-img-sm {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.menu-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: var(--touch-min);
  min-width: var(--touch-min);
  padding: 0 1.1rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--nav-text);
  font-family: inherit;
  font-weight: 700;
  font-size: var(--step--1);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

.menu-toggle-bars {
  display: block;
  width: 20px;
  height: 14px;
  background:
    linear-gradient(90deg, var(--ns-blue), var(--ns-violet)) 0 0 / 100% 2px no-repeat,
    linear-gradient(90deg, var(--ns-violet), var(--ns-teal)) 0 6px / 100% 2px no-repeat,
    linear-gradient(90deg, var(--ns-teal), var(--ns-orange)) 0 12px / 100% 2px no-repeat;
  opacity: 0.95;
  border-radius: 1px;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bars {
  background:
    linear-gradient(90deg, var(--ns-mint), var(--ns-blue)) 0 0 / 100% 2px no-repeat,
    linear-gradient(90deg, var(--ns-blue), var(--ns-violet)) 0 6px / 100% 2px no-repeat,
    linear-gradient(90deg, var(--ns-violet), var(--ns-orange)) 0 12px / 100% 2px no-repeat;
}

.header-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(100vw - 2rem, 23rem);
  height: 100vh;
  height: 100dvh;
  padding: 4.75rem var(--space) var(--space);
  background: linear-gradient(180deg, #ffffff 0%, var(--bg-page) 100%);
  border-left: 1px solid var(--border-strong);
  box-shadow: -12px 0 40px rgba(28, 31, 46, 0.12);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.28s;
  z-index: calc(var(--header-z) + 2);
}

.header-drawer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-brand);
  opacity: 0.95;
  pointer-events: none;
}

.site-header.nav-open .header-drawer {
  transform: translateX(0);
  visibility: visible;
}

.nav-primary {
  margin-bottom: 1.25rem;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nav-list > li > a,
.submenu-trigger {
  display: flex;
  align-items: center;
  min-height: var(--touch-min);
  padding: 0.4rem 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--step-1);
  font-family: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  width: 100%;
  text-align: left;
  border-radius: var(--radius);
}

.nav-list > li > a:hover,
.submenu-trigger:hover {
  color: var(--ns-teal-deep);
  background: rgba(37, 99, 235, 0.06);
}

.has-submenu {
  position: relative;
}

.submenu {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0.35rem 0 0.5rem 0.85rem;
  border-left: 3px solid transparent;
  border-image: var(--gradient-brand) 1;
}

.submenu a {
  display: flex;
  align-items: center;
  min-height: calc(var(--touch-min) - 4px);
  padding: 0.4rem 0.55rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--step--1);
  font-weight: 600;
  border-radius: 10px;
}

.submenu a:hover {
  color: var(--text);
  background: var(--ns-surface);
}

.submenu-sep {
  height: 1px;
  margin: 0.55rem 0;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  list-style: none;
  padding: 0;
}

.submenu-trigger[aria-expanded="true"] {
  color: var(--ns-violet);
}

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.text-size,
.reading-font {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.5rem;
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.text-size-label,
.reading-font-label {
  flex: 1 1 100%;
  font-weight: 700;
  color: var(--text-muted);
  font-size: var(--step--1);
}

.text-size-btn,
.reading-font-btn {
  flex: 1 1 auto;
  min-height: calc(var(--touch-min) - 6px);
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--step--1);
  font-weight: 700;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: inherit;
}

.text-size-btn:hover,
.reading-font-btn:hover {
  color: var(--text);
  background: rgba(37, 99, 235, 0.06);
}

.text-size-btn.is-active,
.reading-font-btn.is-active {
  background: rgba(37, 99, 235, 0.1);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.22);
}

.header-auth {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.header-auth .btn {
  width: 100%;
  min-height: var(--touch-min);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.25rem;
  min-height: var(--touch-min);
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: var(--step-1);
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-ghost {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface);
}

.btn-ghost:hover {
  border-color: var(--ns-blue);
  background: rgba(37, 99, 235, 0.06);
  color: var(--text);
}

.site-header .header-auth .btn-ghost {
  color: var(--nav-text);
  border-color: rgba(255, 255, 255, 0.35);
  background: transparent;
}

.site-header .header-auth .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.btn-primary {
  background: var(--gradient-cta);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(47, 143, 255, 0.35);
}

.btn-primary:hover {
  filter: brightness(1.08);
  color: #fff;
  box-shadow: 0 6px 28px rgba(124, 58, 237, 0.35);
}

@media (prefers-reduced-motion: no-preference) {
  .btn-primary:hover {
    transform: translateY(-1px);
  }
}

.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: var(--step-0);
  text-decoration: none;
  color: #3c4043;
  background: #fff;
  border: 1px solid #dadce0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  color: #3c4043;
}

.btn-google svg {
  flex-shrink: 0;
}

.auth-access-hint {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: var(--step--1);
  line-height: 1.45;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: var(--step--1);
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}

/* ——— Pagina accesso: layout (navbar = stessa barra grigia globale) ——— */
body.page-auth {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-flash-outer {
  max-width: 26.5rem;
  width: 100%;
  margin: 0 auto;
  padding: 0.65rem var(--space) 0;
}

body.page-auth .flash-stack {
  padding: 0;
}

.auth-page-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0.35rem var(--space) 2.25rem;
  box-sizing: border-box;
}

.auth-flow {
  width: 100%;
  max-width: 26.5rem;
  margin: 0 auto;
}

.auth-flow-header {
  text-align: center;
  margin-bottom: 1.25rem;
  padding: 0 0.35rem;
}

.auth-flow-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--step--1);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ns-blue);
  margin: 0 0 0.45rem;
}

.auth-flow-eyebrow .eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gradient-brand);
  flex-shrink: 0;
}

.auth-flow-title {
  margin: 0 0 0.6rem;
  font-size: clamp(1.65rem, 5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(125deg, var(--text) 0%, var(--ns-blue) 42%, var(--ns-violet) 70%, var(--ns-teal-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@supports not (background-clip: text) {
  .auth-flow-title {
    color: var(--text);
    background: none;
  }
}

.auth-flow-lead {
  margin: 0 auto;
  max-width: 36ch;
  font-size: var(--step--1);
  color: var(--text-muted);
  line-height: 1.55;
}

.auth-card {
  position: relative;
  width: 100%;
  padding: clamp(1.2rem, 4.5vw, 1.85rem);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    var(--shadow-lift),
    0 0 0 1px rgba(37, 99, 235, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.auth-card-accent {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: var(--gradient-brand);
  opacity: 0.92;
  pointer-events: none;
}

.auth-google-block {
  margin-bottom: 0.1rem;
}

body.page-auth .auth-card .btn-google {
  margin-top: 0.25rem;
}

.auth-google-note {
  margin: 0.6rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
  text-align: center;
}

.auth-google-note--solo {
  margin-bottom: 0.45rem;
  text-align: left;
}

body.page-auth .auth-card .auth-divider {
  margin: 1.25rem 0 1.05rem;
}

.auth-steps {
  list-style: none;
  margin: 0 0 1.05rem;
  padding: 0;
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.auth-steps-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.auth-steps-item.is-active {
  color: var(--text);
}

.auth-steps-item.is-done {
  color: var(--ns-teal-deep);
}

.auth-steps-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
}

.auth-steps-item.is-active .auth-steps-num {
  background: var(--gradient-cta);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.auth-steps-item.is-done .auth-steps-num {
  background: rgba(13, 148, 136, 0.18);
  border-color: rgba(13, 148, 136, 0.32);
  color: var(--ns-teal-deep);
}

.auth-step-panel {
  animation: authPanelIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-step-panel[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .auth-step-panel {
    animation: none;
  }
}

@keyframes authPanelIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-field {
  margin-bottom: 0.95rem;
}

.auth-label {
  display: block;
  font-weight: 750;
  font-size: var(--step--1);
  margin-bottom: 0.38rem;
  color: var(--text);
}

.auth-input {
  display: block;
  width: 100%;
  min-height: var(--touch-min);
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: rgba(250, 251, 255, 0.96);
  font-family: inherit;
  font-size: var(--step-1);
  color: var(--text);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.auth-input:hover {
  border-color: rgba(37, 99, 235, 0.32);
}

.auth-input:focus {
  outline: none;
  border-color: var(--ns-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.auth-input[aria-invalid="true"] {
  border-color: rgba(220, 38, 38, 0.55);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.auth-hint {
  margin: 0.38rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.auth-form .err,
.auth-err {
  margin-top: 0.4rem !important;
}

.auth-btn-next,
.auth-btn-submit {
  width: 100%;
  justify-content: center;
  min-height: var(--touch-min);
  font-size: var(--step-1);
}

.auth-btn-next {
  margin-top: 0.25rem;
}

.auth-form-actions {
  margin-top: 0.45rem;
}

.auth-email-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  padding: 0.62rem 0.85rem;
  margin-bottom: 0.95rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.07), rgba(124, 58, 237, 0.05));
  border: 1px solid rgba(37, 99, 235, 0.15);
}

.auth-email-chip-label {
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  width: 100%;
}

.auth-email-chip-value {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: var(--step--1);
  word-break: break-all;
  color: var(--text);
}

.auth-email-chip-edit {
  flex-shrink: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-weight: 800;
  font-size: var(--step--1);
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  padding: 0.25rem 0;
  border-radius: 6px;
}

.auth-email-chip-edit:hover {
  color: var(--ns-teal-deep);
}

.auth-email-chip-edit:focus-visible {
  box-shadow: var(--focus-ring);
  outline: none;
}

.auth-footer-note {
  text-align: center;
  margin: 1.25rem 0 0;
  font-size: var(--step--1);
}

.auth-footer-note .panel-link {
  font-weight: 700;
}

@media (min-width: 960px) {
  .menu-toggle {
    display: none;
  }

  .nav-overlay {
    display: none !important;
  }

  .site-header {
    padding: 0;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    box-shadow: none;
  }

  .header-inner {
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem 1.25rem;
    padding: 0.65rem var(--space);
    background: transparent;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .header-drawer {
    position: static;
    width: auto;
    height: auto;
    max-height: none;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
    transform: none;
    visibility: visible;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    z-index: auto;
  }

  .nav-primary {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
  }

  .nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.5rem;
  }

  .nav-list > li > a,
  .submenu-trigger {
    display: inline-flex;
    width: auto;
    min-height: calc(var(--touch-min) - 2px);
    padding: 0.48rem 1rem;
    font-size: var(--step--1);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--nav-muted);
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease;
  }

  .nav-list > li > a:hover,
  .submenu-trigger:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
  }

  .submenu-trigger[aria-expanded="true"] {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
  }

  .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    margin: 0.4rem 0 0;
    padding: 0.5rem 0;
    min-width: 240px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lift);
    border-left: 0;
    border-image: none;
    padding-left: 0;
  }

  .submenu a {
    display: block;
    padding: 0.6rem 1.1rem;
    color: var(--text-muted);
  }

  .submenu a:hover {
    color: var(--text);
    background: var(--bg-subtle);
  }

  .header-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem 0.55rem;
    padding-top: 0;
    border-top: 0;
    max-width: 100%;
  }

  .a11y-panel .text-size,
  .a11y-panel .reading-font {
    flex-wrap: nowrap;
    padding: 0.35rem 0.45rem;
    border-radius: var(--radius-pill);
  }

  .a11y-panel .text-size-label {
    flex: 0 0 auto;
    padding: 0 0.45rem;
    font-size: var(--step--1);
    font-weight: 800;
    white-space: nowrap;
  }

  .a11y-panel .text-size-label::before {
    content: "Aa · ";
    color: var(--ns-mint);
  }

  .a11y-panel .reading-font-label {
    flex: 0 0 auto;
    padding: 0 0.45rem;
    white-space: nowrap;
  }

  .a11y-panel .text-size-btn,
  .a11y-panel .reading-font-btn {
    min-height: auto;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.42rem 0.55rem;
  }

  .header-auth {
    flex-direction: row;
    flex-wrap: wrap;
    width: auto;
  }

  .header-auth .btn {
    width: auto;
    min-height: calc(var(--touch-min) - 4px);
  }
}

/* ——— Hero (mesh + card vetro stile IG) ——— */
.hero {
  position: relative;
  padding: clamp(2rem, 7vw, 5rem) var(--space);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--gradient-mesh);
  opacity: 1;
  pointer-events: none;
}

.hero-blobs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.22;
}

.hero-blob--1 {
  width: min(55vw, 380px);
  height: min(55vw, 380px);
  background: var(--ns-blue);
  top: -12%;
  left: -8%;
}

.hero-blob--2 {
  width: min(45vw, 320px);
  height: min(45vw, 320px);
  background: var(--ns-violet);
  top: 20%;
  right: -10%;
}

.hero-blob--3 {
  width: min(50vw, 360px);
  height: min(50vw, 360px);
  background: var(--ns-teal);
  bottom: -18%;
  left: 30%;
}

.hero-inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
}

.hero-card {
  position: relative;
  padding: clamp(1.75rem, 5vw, 3rem);
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: none;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lift), var(--shadow-glow);
  max-width: 52rem;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(47, 143, 255, 0.45), rgba(167, 139, 250, 0.35), rgba(45, 212, 191, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--step--1);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ns-teal-deep);
}

.eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gradient-cta);
}

.hero-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  max-width: 20ch;
  color: var(--text);
}

.hero-lead {
  margin: 0 0 1.5rem;
  font-size: var(--step-2);
  max-width: 42ch;
  color: var(--text-muted);
  font-weight: 500;
}

.hero-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 2px solid var(--ns-violet);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.hero-link:hover {
  color: var(--ns-teal-deep);
  border-color: var(--ns-teal);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: var(--step--1);
  font-weight: 700;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.25);
  color: var(--ns-purple-deep);
}

.pill-soft {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-muted);
  font-weight: 600;
}

.layout-grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space) clamp(2.5rem, 8vw, 5rem);
  display: grid;
  gap: 1.35rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .layout-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .panel-wide {
    grid-column: 1 / -1;
  }
}

.panel {
  background: var(--surface);
  backdrop-filter: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.45rem;
  box-shadow: var(--shadow-soft);
}

.panel-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 520px) {
  .panel-head {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }
}

.panel h2 {
  margin: 0;
  font-size: var(--step-1);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.panel-link {
  font-size: var(--step--1);
  font-weight: 700;
  text-decoration: none;
  color: var(--accent);
}

.panel-link:hover {
  text-decoration: underline;
  color: var(--ns-teal-deep);
}

.card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card {
  display: block;
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  }

  .card:hover {
    transform: translateY(-2px);
  }
}

.card:hover,
.card:focus-visible {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 8px 28px rgba(28, 31, 46, 0.08);
}

.card-kicker {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.4rem;
}

@supports not (background-clip: text) {
  .card-kicker {
    color: var(--ns-blue);
  }
}

.card-title {
  display: block;
  font-weight: 700;
  font-size: var(--step-1);
  line-height: 1.42;
  margin-bottom: 0.4rem;
}

.card-meta {
  font-size: var(--step--1);
  color: var(--text-muted);
  font-weight: 500;
}

.locals {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .locals {
    grid-template-columns: repeat(3, 1fr);
  }
}

.local-card {
  margin: 0;
  padding: 1.15rem;
  border-radius: var(--radius);
  background: var(--surface-raised);
  border: 1px solid var(--border);
}

.local-name {
  margin: 0 0 0.5rem;
  font-size: var(--step-1);
  font-weight: 800;
}

.local-name a {
  color: inherit;
  text-decoration: none;
}

.local-name a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.local-desc {
  margin: 0 0 0.75rem;
  font-size: var(--step--1);
  color: var(--text-muted);
}

.local-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
  background: rgba(13, 148, 136, 0.12);
  color: var(--ns-teal-deep);
  border: 1px solid rgba(13, 148, 136, 0.28);
}

.about-strip {
  position: relative;
  border-top: 1px solid var(--border);
  padding: clamp(2.5rem, 7vw, 4.5rem) var(--space);
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg-subtle) 50%, #ffffff 100%);
}

.about-inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
}

.about-heading {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.about-text {
  margin: 0 0 2rem;
  font-size: var(--step-1);
  color: var(--text-muted);
  max-width: 62ch;
  font-weight: 500;
}

.about-columns {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .about-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

.about-sub {
  margin: 0 0 0.55rem;
  font-size: var(--step-1);
  font-weight: 800;
  color: var(--ns-purple-deep);
}

.about-columns p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--step--1);
  line-height: 1.6;
}

/* Footer minimale — grigio navbar, allineato e pulito */
.site-footer--minimal {
  --footer-pad-y: clamp(1rem, 2.8vw, 1.35rem);
  --footer-gap: clamp(0.75rem, 2vw, 1.15rem);
  --footer-line: rgba(255, 255, 255, 0.07);

  margin-top: auto;
  border-top: 1px solid var(--nav-border);
  padding: var(--footer-pad-y) var(--space);
  background: var(--nav-bg);
  color: var(--nav-muted);
}

.footer-min-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--footer-gap);
  text-align: center;
}

.footer-min-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  text-decoration: none;
  border-radius: 0;
  transition: opacity 0.2s ease;
}

.footer-min-brand:hover {
  opacity: 0.88;
}

.footer-min-brand:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 4px;
}

.footer-min-logo-img {
  display: block;
  height: clamp(1.65rem, 4.2vw, 2rem);
  width: auto;
  max-width: min(14rem, 85vw);
  object-fit: contain;
  object-position: center;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.footer-min-brand:hover .footer-min-logo-img {
  opacity: 1;
}

.footer-min-nav {
  margin: 0;
  padding: 0;
  width: 100%;
}

.footer-min-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.2rem;
}

.footer-min-list--links {
  row-gap: 0.5rem;
}

.footer-min-list--links li {
  display: flex;
  align-items: center;
}

.footer-min-list--links li:not(:last-child)::after {
  content: "";
  width: 1px;
  height: 0.75rem;
  margin: 0 0.65rem;
  background: var(--footer-line);
  flex-shrink: 0;
  opacity: 0.9;
}

.footer-min-list--links a {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(244, 244, 246, 0.72);
  text-decoration: none;
  padding: 0.2rem 0;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.footer-min-list--links a:hover {
  color: #fff;
}

.footer-min-list--links a:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 2px;
}

.footer-min-nav--social {
  padding-top: 0.15rem;
}

.footer-min-list--social {
  gap: 0.35rem;
}

.footer-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}

.footer-social-btn img {
  display: block;
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
  opacity: 0.72;
}

.footer-social-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
}

.footer-social-btn:hover img {
  opacity: 1;
}

.footer-social-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 2px;
}

.footer-min-copy {
  margin: 0;
  width: 100%;
  border-top: 1px solid var(--footer-line);
  padding-top: calc(var(--footer-gap) * 0.85);
  margin-top: 0.1rem;
}

.footer-min-copy-inner {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(244, 244, 246, 0.38);
}

@media (min-width: 720px) {
  .footer-min-inner {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: clamp(1rem, 2.5vw, 1.75rem);
    row-gap: 0.65rem;
    text-align: unset;
  }

  .footer-min-brand {
    grid-column: 1;
    grid-row: 1;
    justify-content: flex-start;
  }

  .footer-min-logo-img {
    object-position: left center;
    max-width: min(13rem, 28vw);
  }

  .footer-min-nav:not(.footer-min-nav--social) {
    grid-column: 2;
    grid-row: 1;
  }

  .footer-min-nav--social {
    grid-column: 3;
    grid-row: 1;
    padding-top: 0;
  }

  .footer-min-list--links {
    justify-content: center;
  }

  .footer-min-list--social {
    justify-content: flex-end;
  }

  .footer-min-copy {
    grid-column: 1 / -1;
    grid-row: 2;
    text-align: center;
    border-top: 1px solid var(--footer-line);
    padding-top: calc(var(--footer-gap) * 0.9);
    margin-top: 0.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .footer-min-brand,
  .footer-min-list--links a,
  .footer-social-btn {
    transition: none;
  }
}

/* Pagine statiche (privacy, termini, …) */
body.page-static {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.static-page-shell {
  flex: 1;
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.25rem var(--space) 2rem;
  box-sizing: border-box;
}

.static-prose {
  color: var(--text);
}

.static-page-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.static-lead {
  margin: 0 0 1.5rem;
  font-size: var(--step-1);
  color: var(--text-muted);
  line-height: 1.6;
}

.static-prose h2 {
  margin: 1.75rem 0 0.5rem;
  font-size: var(--step-1);
  font-weight: 800;
  color: var(--text);
}

.static-prose p {
  margin: 0 0 0.85rem;
  line-height: 1.65;
}

.static-muted {
  margin-top: 2rem !important;
  font-size: var(--step--1);
  color: var(--text-muted);
}

.static-list {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  line-height: 1.7;
}

.static-list li {
  margin-bottom: 0.35rem;
}

/* ——— Messaggi flash (sito pubblico) ——— */
.flash-stack {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.75rem var(--space) 0;
}

.flash-msg {
  margin: 0 0 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
}

.flash-msg--success {
  background: rgba(13, 148, 136, 0.12);
  border: 1px solid rgba(13, 148, 136, 0.35);
  color: var(--ns-teal-deep);
}

.flash-msg--error {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: var(--danger);
}

.flash-msg--info {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.25);
  color: var(--accent-strong);
}

/* ——— Articoli staff (HTML da Markdown) ——— */
.staff-article-body {
  font-size: var(--step-1);
  line-height: 1.7;
  color: var(--text);
}

.staff-article-body > *:first-child {
  margin-top: 0;
}

.staff-article-body h1,
.staff-article-body h2,
.staff-article-body h3,
.staff-article-body h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 1.5rem 0 0.65rem;
  line-height: 1.25;
  color: var(--text);
}

.staff-article-body h1 {
  font-size: var(--step-3);
}

.staff-article-body h2 {
  font-size: var(--step-2);
}

.staff-article-body h3 {
  font-size: var(--step-1);
}

.staff-article-body p {
  margin: 0 0 1rem;
}

.staff-article-body ul,
.staff-article-body ol {
  margin: 0 0 1rem 1.25rem;
  padding: 0;
}

.staff-article-body li {
  margin-bottom: 0.35rem;
}

.staff-article-body a {
  color: var(--accent);
  font-weight: 600;
}

.staff-article-body a:hover {
  color: var(--ns-teal-deep);
}

.staff-article-body blockquote {
  margin: 1rem 0;
  padding: 0.65rem 1rem;
  border-left: 4px solid var(--ns-violet);
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.staff-article-body pre {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--text);
  color: #f4f4f8;
  overflow-x: auto;
  font-size: var(--step--1);
}

.staff-article-body code {
  font-family: ui-monospace, monospace;
  font-size: 0.92em;
  background: var(--bg-subtle);
  padding: 0.12rem 0.35rem;
  border-radius: 6px;
}

.staff-article-body pre code {
  background: transparent;
  padding: 0;
}

.staff-article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: var(--step--1);
}

.staff-article-body th,
.staff-article-body td {
  border: 1px solid var(--border-strong);
  padding: 0.5rem 0.65rem;
  text-align: left;
}

.staff-article-body th {
  background: var(--bg-subtle);
  font-weight: 800;
}

/* ——— Blog ——— */
.blog-hero {
  position: relative;
  margin: 0 0 1.5rem;
  padding: clamp(2rem, 6vw, 3.5rem) var(--space);
  border-radius: var(--radius-xl);
  overflow: hidden;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.blog-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(251, 191, 36, 0.08) 42%, rgba(124, 58, 237, 0.1) 100%);
  opacity: 1;
}

.blog-hero .blog-page-title {
  position: relative;
  margin: 0;
}

.blog-page-title {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.blog-page-lead {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: var(--step-1);
  max-width: 62ch;
  font-weight: 500;
}

.blog-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.85rem;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

@media (min-width: 640px) {
  .blog-toolbar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.blog-session {
  flex: 1 1 16rem;
}

.blog-session-label {
  display: block;
  font-weight: 800;
  margin-bottom: 0.4rem;
  font-size: var(--step--1);
}

.blog-session-hint {
  margin: 0.4rem 0 0;
  font-size: var(--step--1);
  color: var(--text-muted);
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.field-input {
  flex: 1 1 12rem;
  min-height: var(--touch-min);
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface-raised);
  color: var(--text);
  font-family: inherit;
  font-size: var(--step-1);
}

.field-input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.field-input:focus {
  border-color: var(--ns-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.blog-note {
  margin: 0 0 1.5rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-lg);
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.2);
  font-size: var(--step--1);
  color: var(--text-muted);
}

.blog-layout {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2rem) var(--space) clamp(3rem, 8vw, 4rem);
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.post-article {
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.post-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

@media (min-width: 520px) {
  .post-header {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
  }
}

.post-title {
  margin: 0;
  font-size: var(--step-2);
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.post-meta {
  font-size: var(--step--1);
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 600;
}

.post-body {
  margin: 0 0 1rem;
  color: var(--text);
  font-size: var(--step-1);
  line-height: 1.65;
  white-space: pre-wrap;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.btn-like {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: var(--touch-min);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface-raised);
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  font-size: var(--step--1);
  cursor: pointer;
}

.btn-like[aria-pressed="true"] {
  border-color: rgba(167, 139, 250, 0.55);
  color: var(--ns-violet);
  background: rgba(167, 139, 250, 0.12);
}

.like-count {
  font-variant-numeric: tabular-nums;
}

.comments-block {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.comments-title {
  margin: 0 0 0.7rem;
  font-size: var(--step-1);
  font-weight: 800;
}

.comment-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.comment-item {
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  background: var(--surface-raised);
  border: 1px solid var(--border);
}

.comment-author {
  font-weight: 800;
  font-size: var(--step--1);
}

.comment-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.35rem;
  font-weight: 500;
}

.comment-text {
  margin: 0.4rem 0 0;
  font-size: var(--step--1);
  color: var(--text-muted);
  white-space: pre-wrap;
}

.comment-form label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4rem;
  font-size: var(--step--1);
}

.comment-form textarea {
  width: 100%;
  min-height: 5.5rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface-raised);
  color: var(--text);
  font-family: inherit;
  font-size: var(--step-1);
  line-height: 1.5;
  resize: vertical;
  margin-bottom: 0.55rem;
}

.compose-section {
  margin-top: 2.75rem;
  padding: 1.4rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(124, 58, 237, 0.35);
  background: rgba(124, 58, 237, 0.04);
}

.compose-section h2 {
  margin: 0 0 0.85rem;
  font-size: var(--step-1);
  font-weight: 800;
}

.compose-form .field {
  margin-bottom: 1rem;
}

.compose-form label {
  display: block;
  font-weight: 800;
  margin-bottom: 0.4rem;
  font-size: var(--step--1);
}

.compose-form input[type="text"],
.compose-form textarea {
  width: 100%;
  min-height: var(--touch-min);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface-raised);
  color: var(--text);
  font-family: inherit;
  font-size: var(--step-1);
}

.compose-form textarea {
  min-height: 8rem;
  line-height: 1.55;
  resize: vertical;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.compose-locked {
  color: var(--text-muted);
  font-size: var(--step-1);
  font-weight: 500;
}

@media (max-width: 640px) {
  .text-size-btn,
  .reading-font-btn {
    font-size: 0.8rem;
  }

  .btn {
    flex: 1;
    min-width: 0;
  }
}

/* ——— Bolla accessibilità (Aa) + pannello popup ——— */
.a11y-backdrop {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(28, 31, 46, 0.35);
  backdrop-filter: blur(5px);
}

.a11y-backdrop[hidden] {
  display: none !important;
}

body.a11y-panel-open {
  overflow: hidden;
}

.a11y-dock {
  position: fixed;
  z-index: 260;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
  pointer-events: none;
}

.a11y-dock > * {
  pointer-events: auto;
}

.a11y-fab {
  position: relative;
  width: 58px;
  height: 58px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(145deg, var(--ns-blue) 0%, var(--ns-purple-deep) 55%, var(--ns-violet) 100%);
  color: #fff;
  font-family: inherit;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.25),
    0 12px 32px rgba(47, 143, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.a11y-fab:hover {
  transform: scale(1.06);
  box-shadow:
    0 6px 12px rgba(0, 0, 0, 0.3),
    0 16px 40px rgba(124, 58, 237, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.a11y-fab:focus-visible {
  outline: 3px solid var(--ns-mint);
  outline-offset: 3px;
}

.a11y-fab[aria-expanded="true"] {
  box-shadow:
    0 0 0 3px rgba(94, 234, 212, 0.45),
    0 12px 36px rgba(47, 143, 255, 0.35);
}

.a11y-fab-glow {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 120deg, var(--ns-blue), var(--ns-violet), var(--ns-teal), var(--ns-orange), var(--ns-blue));
  opacity: 0.35;
  filter: blur(10px);
  z-index: -1;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .a11y-fab:hover {
    transform: none;
  }
}

.a11y-fab-text {
  position: relative;
  z-index: 1;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.a11y-panel {
  width: min(100vw - 1.5rem, 400px);
  max-height: min(75vh, 560px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lift), 0 0 0 1px rgba(37, 99, 235, 0.06);
  overflow: hidden;
}

.a11y-panel[hidden] {
  display: none !important;
}

.a11y-panel-inner {
  padding: 1.15rem 1.25rem 1.35rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.a11y-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.a11y-panel-title {
  margin: 0;
  font-size: var(--step-1);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}

.a11y-panel-close {
  flex-shrink: 0;
  width: var(--touch-min);
  height: var(--touch-min);
  margin: -0.35rem -0.35rem 0 0;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.a11y-panel-close:hover {
  background: var(--border);
}

.a11y-panel-lead {
  margin: 0 0 1rem;
  font-size: var(--step--1);
  color: var(--text-muted);
  line-height: 1.5;
}

.a11y-control-group {
  margin-bottom: 0.85rem;
}

.a11y-section {
  margin-top: 1.15rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.a11y-section-title {
  margin: 0 0 0.45rem;
  font-size: var(--step--1);
  font-weight: 800;
}

.a11y-section-text {
  margin: 0 0 0.75rem;
  font-size: var(--step--1);
  color: var(--text-muted);
  line-height: 1.55;
}

.a11y-dictation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.dictation-status {
  min-height: 1.35rem;
  margin: 0 0 0.65rem;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ns-teal-deep);
}

.a11y-fallback-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: var(--step--1);
  font-weight: 700;
}

.dictation-fallback {
  width: 100%;
  min-height: 4.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface-raised);
  color: var(--text);
  font-family: inherit;
  font-size: var(--step-1);
  line-height: 1.45;
  resize: vertical;
}

.dictation-fallback:focus {
  border-color: var(--ns-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.a11y-screenreader-note {
  margin: 1rem 0 0;
  padding: 0.75rem 0.85rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
