/* Stili globali header/layout — estratto da includes/header.php (prima era <style> inline in ogni pagina) */
    :root {
      --font-display: 'Syne', 'Syne Metric Fallback', 'Arial Black', system-ui, sans-serif;
      --font-body: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
      --black: #06060c;
      --surface: #0c0d17;
      --surface-raised: #14152a;
      --white: #e8e8f0;
      --white-dim: #a2a2c0;
      --brand: #00d4ff;
      --brand-dim: #00b8d9;
      --brand-subtle: rgba(0, 212, 255, 0.08);
      --brand-glow: rgba(0, 212, 255, 0.25);
      --accent: #8b5cf6;
      --accent-dim: #7c3aed;
      --accent-subtle: rgba(139, 92, 246, 0.08);
      --accent-glow: rgba(139, 92, 246, 0.25);
      --trend: #f97316;
      --trend-dim: #ea580c;
      --trend-subtle: rgba(249, 115, 22, 0.08);
      --success: #22c55e;
      --gradient-brand: linear-gradient(135deg, #00d4ff, #0099bb);
      --gradient-bg: linear-gradient(180deg, #06060c 0%, #090915 50%, #0b0b1a 100%);
      --glass-bg: rgba(12, 13, 23, 0.75);
      --glass-border: rgba(255, 255, 255, 0.06);
      --glass-blur: 16px;
      --max-width: 1200px;
      --header-height: 4.5rem;
      --radius-sm: 0.375rem;
      --radius-md: 0.75rem;
      --radius-lg: 1.25rem;
      --radius-xl: 1.5rem;
      --radius-full: 9999px;
      --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
      --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.35);
      --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.45);
      --shadow-brand: 0 12px 32px rgba(0, 212, 255, 0.15);
      --focus-ring: 0 0 0 2px var(--black), 0 0 0 4px var(--brand);
      --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
      --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
      --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    }

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

    html {
      scroll-behavior: smooth;
      scroll-padding-top: calc(var(--header-height) + 2rem);
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      overflow-x: hidden;
      text-rendering: optimizeLegibility;
    }

    body {
      font-family: var(--font-body);
      background-color: var(--black);
      background-image: var(--gradient-bg);
      color: var(--white);
      font-size: 17px;
      line-height: 1.7;
      min-height: 100dvh;
      text-wrap: pretty;
      overflow-x: hidden;
    }

    main { isolation: isolate; }

    body::before {
      content: '';
      position: fixed;
      inset: 0;
      z-index: -1;
      pointer-events: none;
      opacity: 0.035;
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
      background-repeat: repeat;
      background-size: 256px 256px;
      transform: translateZ(0);
      will-change: transform;
    }

    @media (min-width: 769px) {
      body::after {
        content: '';
        position: fixed;
        inset: 0;
        z-index: -1;
        background-image: var(--gradient-bg);
        pointer-events: none;
      }
    }

    @media (hover: none) and (pointer: coarse) {
      .js body { cursor: auto; }
    }

    ::selection {
      background: var(--brand);
      color: var(--black);
    }

    ::-webkit-scrollbar { width: 6px; }
    ::-webkit-scrollbar-track { background: var(--black); }
    ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
    @media (hover: hover) { ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); } }

    a {
      color: var(--brand);
      text-decoration: none;
      transition: color 0.3s var(--ease-smooth);
    }

    @media (hover: hover) { a:hover {
      color: var(--brand-dim);
    } }

    :focus-visible {
      outline: none;
      box-shadow: var(--focus-ring);
      border-radius: var(--radius-sm);
    }

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

    .sr-only-focusable:focus {
      position: fixed;
      top: 0.5rem;
      left: 0.5rem;
      width: auto;
      height: auto;
      padding: 0.75rem 1.5rem;
      margin: 0;
      overflow: visible;
      clip: auto;
      white-space: nowrap;
      z-index: 10000;
      background: var(--black);
      color: var(--white);
      font-family: var(--font-display);
      font-size: 0.875rem;
      font-weight: 600;
      text-decoration: none;
      border-radius: var(--radius-sm);
      border: 1px solid var(--brand);
      box-shadow: var(--focus-ring);
    }

    img {
      max-width: 100%;
      height: auto;
      -webkit-backface-visibility: hidden;
      backface-visibility: hidden;
    }

    h1, h2, h3, h4, h5, h6 {
      font-family: var(--font-display);
      font-weight: 700;
      line-height: 1.1;
      letter-spacing: -0.02em;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      text-rendering: optimizeLegibility;
    }

    /* Metric-matched fallback for Syne to prevent CLS when the custom font
       loads later than first paint. We register Arial Black with metric
       overrides (size-adjust + ascent/descent overrides) that approximate
       Syne's metrics. By listing it BEFORE Syne in the font stack, browsers
       use Arial Black only when Syne is unavailable. */
    @font-face {
      font-family: "Syne Metric Fallback";
      src: local("Arial Black");
      size-adjust: 100%;
      ascent-override: 95%;
      descent-override: 24%;
      line-gap-override: 0%;
    }

    p, span, li, a, button, label, dd, dt, blockquote {
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      text-rendering: optimizeLegibility;
    }

    .noise-overlay {
      position: fixed;
      inset: 0;
      z-index: 9999;
      pointer-events: none;
      opacity: 0.025;
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
      background-repeat: repeat;
      background-size: 256px 256px;
      transform: translateZ(0);
      will-change: transform;
      backface-visibility: hidden;
      -webkit-backface-visibility: hidden;
    }

    .container {
      max-width: var(--max-width);
      margin: 0 auto;
      padding: 0 1.5rem;
    }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
      }
      html { scroll-behavior: auto; }
      #cursor-canvas { display: none; }
      .cursor-dot, .cursor-ring, .cursor-trail-particle, .cursor-ripple { display: none !important; }
    }

    @media (hover: none) and (pointer: coarse) {
      .js body { cursor: auto; }
      .card:active,
      .btn:active,
      .channel-link:active,
      .related-card:active,
      .article-nav-link:active,
      .section-cta .btn:active {
        transform: scale(0.98);
      }
    }

    @media (max-width: 768px) {
      body { font-size: 18px; }
      .js body { cursor: auto; }
      #cursor-canvas { display: none; }
    }

    .load-anim {
      opacity: 1;
    }

    .site-header {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 1000;
      height: var(--header-height);
      background: var(--glass-bg);
      backdrop-filter: blur(var(--glass-blur));
      -webkit-backdrop-filter: blur(var(--glass-blur));
      border-bottom: 1px solid var(--glass-border);
      transition: transform 0.4s var(--ease-out-expo), background 0.3s var(--ease-smooth);
    }

    .header-inner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      height: 100%;
    }

    .logo {
      display: flex;
      align-items: center;
      gap: 0.625rem;
      text-decoration: none;
      color: var(--white);
      z-index: 1001;
      flex-shrink: 0;
    }
    .logo-icon {
      display: flex;
      align-items: center;
      transition: transform 0.4s var(--ease-spring);
    }
    @media (hover: hover) { .logo:hover .logo-icon {
      transform: rotate(-8deg) scale(1.08);
    } }
    .logo-img {
      display: block;
      width: 32px;
      height: 32px;
      border-radius: 50%;
      object-fit: cover;
      border: 1.5px solid rgba(0, 212, 255, 0.4);
    }
    .logo-text {
      font-family: var(--font-display);
      font-size: 1.35rem;
      font-weight: 700;
      letter-spacing: -0.03em;
    }
    .logo-text span {
      background: var(--gradient-brand);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }
    .nav-link-external {
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
    }
    .nav-external-icon {
      opacity: 0.45;
      flex-shrink: 0;
      transition: transform 0.25s var(--ease-spring), opacity 0.25s ease;
    }
    @media (hover: hover) { .nav-link-external:hover .nav-external-icon {
      opacity: 1;
      transform: translate(1px, -1px);
    } }

    .nav-desktop {
      display: flex;
      align-items: center;
      gap: 0.25rem;
    }

    .nav-link {
      position: relative;
      padding: 0.5rem 1.125rem;
      font-family: var(--font-display);
      font-size: 0.9375rem;
      font-weight: 600;
      color: var(--white-dim);
      text-decoration: none;
      border-radius: var(--radius-full);
      transition: all 0.3s var(--ease-smooth);
      letter-spacing: -0.01em;
    }
    @media (hover: hover) { .nav-link:hover {
      color: var(--white);
      background: rgba(255,255,255,0.04);
    } }
    .nav-link.active {
      color: var(--white);
      background: rgba(0, 212, 255, 0.08);
    }
    .nav-link.active::after {
      content: '';
      position: absolute;
      bottom: 2px;
      left: 50%;
      transform: translateX(-50%);
      width: 20px;
      height: 2px;
      border-radius: 1px;
      background: var(--gradient-brand);
    }

    .header-actions {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .lang-switch {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.5rem 1rem;
      font-family: var(--font-display);
      font-size: 0.8125rem;
      font-weight: 600;
      color: var(--white-dim);
      text-decoration: none;
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: var(--radius-full);
      transition: all 0.3s var(--ease-smooth);
    }
    @media (hover: hover) { .lang-switch:hover {
      color: var(--brand);
      border-color: rgba(0, 212, 255, 0.3);
      background: rgba(0, 212, 255, 0.04);
    } }
    .lang-flag {
      display: block;
      border-radius: 2px;
      box-shadow: 0 0 0 1px rgba(255,255,255,0.12);
      transition: transform 0.3s var(--ease-spring);
      flex-shrink: 0;
    }
    @media (hover: hover) { .lang-switch:hover .lang-flag {
      transform: scale(1.1);
    } }

    .hamburger {
      display: none;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      gap: 5px;
      width: 40px;
      height: 40px;
      background: none;
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: var(--radius-sm);
      cursor: pointer;
      z-index: 1001;
      padding: 0;
    }
    .hamburger-line {
      display: block;
      width: 18px;
      height: 2px;
      background: var(--white);
      border-radius: 2px;
      transition: all 0.3s var(--ease-out-expo);
    }
    .hamburger[aria-expanded="true"] .hamburger-line:nth-child(1) {
      transform: translateY(7px) rotate(45deg);
    }
    .hamburger[aria-expanded="true"] .hamburger-line:nth-child(2) {
      opacity: 0;
      transform: scaleX(0);
    }
    .hamburger[aria-expanded="true"] .hamburger-line:nth-child(3) {
      transform: translateY(-7px) rotate(-45deg);
    }

    @media (max-width: 768px) {
      .nav-desktop { display: none; }
      /* Mobile: lo switch lingua vive già nel pannello del menu (.mobile-lang),
         tenerlo in header ruba spazio a campanella/ricerca/hamburger. */
      .header-actions .lang-switch { display: none; }
      /* Mobile: pulsanti da 36 px e padding laterale ridotto, così resta
         spazio vero tra logo e azioni (prima l'interruttore tema toccava il logo). */
      .site-header .header-inner { padding: 0 1.125rem; }
      .logo { gap: 0.5rem; }
      .logo-text { font-size: 1.2rem; }
      .header-actions { gap: 0.375rem; margin-left: 0.75rem; }
      .header-actions .search-trigger,
      .header-actions .theme-toggle,
      .header-actions .hamburger { width: 36px; height: 36px; }
      .hamburger { display: flex; }

      .mobile-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 999;
        visibility: hidden;
      }
      .mobile-menu.is-open {
        visibility: visible;
      }

      .mobile-backdrop {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        opacity: 0;
        transition: opacity 0.3s ease;
        cursor: pointer;
      }
      .mobile-menu.is-open .mobile-backdrop {
        opacity: 1;
      }

      .mobile-panel {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(10, 10, 18, 0.96);
        backdrop-filter: blur(32px);
        -webkit-backdrop-filter: blur(32px);
        border-top-left-radius: var(--radius-xl);
        border-top-right-radius: var(--radius-xl);
        padding: 1.75rem 1.75rem calc(1.75rem + env(safe-area-inset-bottom, 0px));
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
        max-height: 85vh;
        overflow-y: auto;
      }
      .mobile-menu.is-open .mobile-panel {
        transform: translateY(0);
      }

      .mobile-panel-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 1.5rem;
      }

      .mobile-panel-label {
        font-family: var(--font-display);
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.12em;
        color: var(--white-dim);
        opacity: 0.5;
      }

      .mobile-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: none;
        border-radius: 50%;
        background: rgba(255,255,255,0.06);
        color: var(--white-dim);
        cursor: pointer;
        transition: all 0.25s var(--ease-smooth);
        padding: 0;
      }
      .mobile-close:active {
        background: rgba(0, 212, 255, 0.12);
        color: var(--brand);
      }

      .mobile-nav {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        margin-bottom: 1.75rem;
      }

      .mobile-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.875rem 1.25rem;
        font-family: var(--font-display);
        font-size: 1.35rem;
        font-weight: 600;
        color: var(--white);
        text-decoration: none;
        border-radius: var(--radius-md);
        letter-spacing: -0.02em;
        transition: background 0.2s, color 0.2s;
      }
      .mobile-link:active {
        background: rgba(255,255,255,0.04);
      }
      .mobile-link.active {
        color: var(--brand);
        background: rgba(0, 212, 255, 0.06);
      }
      .mobile-link.active .mobile-link-indicator {
        opacity: 1;
        transform: scale(1);
      }

      .mobile-link-indicator {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--brand);
        box-shadow: 0 0 8px var(--brand-glow);
        opacity: 0;
        transform: scale(0);
        transition: all 0.35s var(--ease-spring);
        flex-shrink: 0;
      }

      .mobile-footer {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
      }

      .mobile-footer-row {
        display: flex;
        align-items: center;
        justify-content: center;
      }

      .mobile-lang {
        display: inline-flex;
        align-items: center;
        gap: 0.625rem;
        padding: 0.5rem 1.25rem;
        font-family: var(--font-display);
        font-size: 0.875rem;
        font-weight: 600;
        color: var(--white-dim);
        text-decoration: none;
        border: 1px solid rgba(255,255,255,0.06);
        border-radius: var(--radius-full);
        transition: all 0.25s var(--ease-smooth);
      }
      .mobile-lang:active {
        color: var(--brand);
        border-color: rgba(0, 212, 255, 0.25);
        background: rgba(0, 212, 255, 0.04);
      }

      .mobile-social {
        display: flex;
        align-items: center;
        gap: 0.5rem;
      }

      .mobile-social-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        color: var(--white-dim);
        opacity: 0.55;
        transition: all 0.25s var(--ease-smooth);
      }
      .mobile-social-link:active {
        opacity: 1;
        color: var(--brand);
        background: rgba(0, 212, 255, 0.06);
      }
    }

    @media (max-width: 380px) {
      .logo-text { font-size: 1.15rem; }
      .header-actions { gap: 0.3125rem; margin-left: 0.5rem; }
      .container, .site-header .header-inner { padding: 0 1rem; }
    }

    @media (min-width: 769px) {
      .mobile-menu { display: none; }
    }

    .search-trigger {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 2.5rem;
      height: 2.5rem;
      background: none;
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: var(--radius-sm);
      color: var(--white-dim);
      cursor: pointer;
      transition: all 0.2s var(--ease-smooth);
    }

    @media (hover: hover) { .search-trigger:hover {
      color: var(--brand);
      border-color: rgba(0, 212, 255, 0.3);
      background: rgba(0, 212, 255, 0.04);
    } }

      .search-overlay[role="search"] {
        position: fixed;
        inset: 0;
        z-index: 2000;
        background: rgba(6, 6, 12, 0.85);
        display: flex;
      align-items: flex-start;
      justify-content: center;
      padding-top: 15vh;
      overflow-y: auto;
      opacity: 0;
      visibility: hidden;
      transition: all 0.3s var(--ease-smooth);
    }

    .search-overlay.open {
      opacity: 1;
      visibility: visible;
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
    }

    .search-modal {
      width: 100%;
      max-width: 600px;
      padding: 0 1.5rem;
    }

    .search-input-wrap {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      padding: 1rem 1.25rem;
      background: var(--surface);
      border: 1px solid rgba(255,255,255,0.1);
      border-radius: var(--radius-lg);
      transition: border-color 0.2s var(--ease-smooth);
    }

    .search-input-wrap:focus-within {
      border-color: var(--brand);
    }

    .search-modal-icon {
      flex-shrink: 0;
      color: var(--white-dim);
      opacity: 0.4;
    }

    .search-input-wrap .search-input {
      flex: 1;
      background: none;
      border: none;
      outline: none;
      color: var(--white);
      font-size: 1.125rem;
      font-family: var(--font-body);
    }

    .search-input-wrap .search-input::placeholder {
      color: var(--white-dim);
      opacity: 0.4;
    }

    .search-close {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      width: 2rem;
      height: 2rem;
      background: none;
      border: 1px solid rgba(255,255,255,0.12);
      color: var(--white-dim);
      cursor: pointer;
      border-radius: var(--radius-sm);
      transition: all 0.2s var(--ease-smooth);
    }

    @media (hover: hover) { .search-close:hover {
      color: var(--white);
      border-color: rgba(255,255,255,0.3);
      background: rgba(255,255,255,0.06);
    } }

    .search-reset {
      display: none;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      width: 1.75rem;
      height: 1.75rem;
      background: none;
      border: none;
      color: var(--white-dim);
      cursor: pointer;
      border-radius: 50%;
      transition: all 0.2s var(--ease-smooth);
    }

    .search-reset.visible {
      display: flex;
    }

    @media (hover: hover) { .search-reset:hover {
      color: var(--white);
      background: rgba(255,255,255,0.08);
    } }

    .search-help-btn {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 2rem;
      height: 2rem;
      background: none;
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: var(--radius-sm);
      color: var(--white-dim);
      font-size: 0.8125rem;
      font-family: var(--font-body);
      cursor: pointer;
      transition: all 0.2s var(--ease-smooth);
    }

    @media (hover: hover) { .search-help-btn:hover {
      color: var(--brand);
      border-color: rgba(0, 212, 255, 0.3);
      background: rgba(0, 212, 255, 0.04);
    } }

    .search-help-modal {
      position: fixed;
      z-index: 2100;
      width: min(460px, calc(100vw - 2rem));
      opacity: 0;
      visibility: hidden;
      transform: translateY(-8px);
      transition: opacity 0.25s var(--ease-smooth), transform 0.25s var(--ease-smooth), visibility 0.25s;
      pointer-events: none;
    }

    .search-help-modal.open {
      opacity: 1;
      visibility: visible;
      transform: translateY(0);
      pointer-events: auto;
    }

    .search-help-card {
      background: var(--surface);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: var(--radius-lg);
      padding: 1.5rem;
      box-shadow: 0 24px 60px rgba(0,0,0,0.5);
      position: relative;
      max-height: calc(100vh - 3rem);
      overflow-y: auto;
    }

    .search-help-card::before {
      content: "";
      position: absolute;
      top: -6px;
      left: 1.5rem;
      width: 12px;
      height: 12px;
      background: var(--surface);
      border-left: 1px solid rgba(255,255,255,0.12);
      border-top: 1px solid rgba(255,255,255,0.12);
      transform: rotate(45deg);
    }

    .search-help-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 1rem;
    }

    .search-help-head h3 {
      margin: 0;
      font-family: var(--font-display, var(--font-body));
      font-size: 1.125rem;
      color: var(--white);
    }

    .search-help-close {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 2rem;
      height: 2rem;
      background: none;
      border: none;
      color: var(--white-dim);
      cursor: pointer;
      border-radius: var(--radius-sm);
      transition: all 0.2s var(--ease-smooth);
    }

    @media (hover: hover) { .search-help-close:hover {
      color: var(--white);
      background: rgba(255,255,255,0.06);
    } }

    .search-help-list {
      margin: 0;
      padding: 0;
      list-style: none;
      display: grid;
      gap: 0.75rem;
    }

    .search-help-list li {
      padding-left: 1.25rem;
      position: relative;
      color: var(--white-dim);
      font-size: 0.9375rem;
      line-height: 1.55;
    }

    .search-help-list li::before {
      content: "";
      position: absolute;
      left: 0;
      top: 0.55em;
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--brand);
    }

    .search-help-list li em {
      font-style: normal;
      color: var(--brand);
      background: rgba(0, 212, 255, 0.08);
      border-radius: 4px;
      padding: 0 0.3em;
      white-space: nowrap;
    }

    [data-search-results] {
      display: none;
      margin-top: 1rem;
      background: var(--surface);
      border: 1px solid rgba(255,255,255,0.06);
      border-radius: var(--radius-lg);
      overflow: hidden;
      max-height: 60vh;
      overflow-y: auto;
    }

    [data-search-results] .search-result-item {
      display: block;
      padding: 1rem 1.25rem;
      text-decoration: none;
      border-bottom: 1px solid rgba(255,255,255,0.04);
      transition: background 0.15s var(--ease-smooth);
    }

    [data-search-results] .search-result-item:last-child {
      border-bottom: none;
    }

    @media (hover: hover) { [data-search-results] .search-result-item:hover {
      background: rgba(255,255,255,0.04);
    } }

    [data-search-results] .search-result-title {
      display: block;
      font-size: 0.9375rem;
      font-weight: 600;
      color: var(--white);
      margin-bottom: 0.25rem;
    }

    [data-search-results] .search-result-excerpt {
      display: block;
      font-size: 0.8125rem;
      color: var(--white-dim);
      opacity: 0.6;
      line-height: 1.5;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    [data-search-empty] {
      display: none;
      margin-top: 1rem;
      text-align: center;
      padding: 2rem;
      color: var(--white-dim);
      opacity: 0.5;
      font-size: 0.9375rem;
    }

    [data-search-pagination] {
      display: none;
      margin-top: 0.75rem;
      justify-content: space-between;
      align-items: center;
      padding: 0 0.25rem;
    }

    [data-search-pagination].visible {
      display: flex;
    }

    .search-pag-btn {
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.1);
      color: var(--white-dim);
      padding: 0.5rem 1rem;
      border-radius: var(--radius-sm);
      cursor: pointer;
      font-size: 0.8125rem;
      transition: all 0.15s var(--ease-smooth);
    }

    @media (hover: hover) { .search-pag-btn:hover:not(:disabled) {
      background: rgba(255,255,255,0.12);
      color: var(--white);
    } }

    .search-pag-btn:disabled {
      opacity: 0.3;
      cursor: default;
    }

    .search-pag-info {
      font-size: 0.8125rem;
      color: var(--white-dim);
      opacity: 0.6;
    }

    @media (max-width: 768px) {
      .search-overlay {
        padding-top: 10vh;
        align-items: flex-start;
      }

      .search-modal {
        padding: 0 1rem;
      }

      .search-input-wrap .search-input {
        font-size: 1rem;
      }
    }

    .notif-wrap {
      position: relative;
    }

    .notif-bell {
      position: relative;
    }

    .notif-badge {
      position: absolute;
      top: -0.5rem;
      right: -0.375rem;
      font-family: var(--font-body);
      font-size: 0.6875rem;
      font-weight: 800;
      line-height: 1;
      color: #f43f5e;
      text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
      pointer-events: none;
    }

    /* Il display:flex di .search-trigger non deve mai battere l'hidden:
       con 0 non letti il badge non esiste proprio. */
    .notif-badge[hidden] {
      display: none;
    }

    .notif-panel {
      position: absolute;
      top: calc(100% + 0.75rem);
      right: 0;
      width: min(22rem, calc(100vw - 2rem));
      background: var(--surface);
      border: 1px solid rgba(255,255,255,0.1);
      border-radius: var(--radius-lg);
      box-shadow: 0 24px 60px rgba(0,0,0,0.5);
      overflow: hidden;
      z-index: 2001;
    }

    .notif-panel-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
      padding: 0.875rem 1rem;
      border-bottom: 1px solid rgba(255,255,255,0.06);
    }

    .notif-panel-title {
      font-family: var(--font-display);
      font-size: 0.8125rem;
      font-weight: 700;
      color: var(--white);
    }

    .notif-toggle {
      flex-shrink: 0;
      background: rgba(0, 212, 255, 0.08);
      border: 1px solid rgba(0, 212, 255, 0.25);
      color: var(--brand);
      font-family: var(--font-body);
      font-size: 0.75rem;
      font-weight: 600;
      padding: 0.35rem 0.75rem;
      border-radius: var(--radius-full);
      cursor: pointer;
      transition: all 0.2s var(--ease-smooth);
      white-space: nowrap;
    }

    @media (hover: hover) { .notif-toggle:hover {
      background: rgba(0, 212, 255, 0.15);
    } }

    .notif-toggle.is-on {
      background: rgba(34, 197, 94, 0.1);
      border-color: rgba(34, 197, 94, 0.3);
      color: #22c55e;
    }

    .notif-list {
      max-height: 22rem;
      overflow-y: auto;
    }

    .notif-empty {
      padding: 1.5rem 1rem;
      text-align: center;
      font-size: 0.875rem;
      color: var(--white-dim);
      opacity: 0.6;
    }

    .notif-session {
      display: block;
      padding: 0.875rem 1rem;
      text-decoration: none;
      border-bottom: 1px solid rgba(255,255,255,0.04);
      transition: background 0.15s var(--ease-smooth);
    }

    .notif-session:last-child {
      border-bottom: none;
    }

    @media (hover: hover) { .notif-session:hover {
      background: rgba(255,255,255,0.04);
    } }

    .notif-session-count {
      display: block;
      font-size: 0.8125rem;
      font-weight: 700;
      color: var(--brand);
      margin-bottom: 0.25rem;
    }

    .notif-session-titles {
      display: block;
      font-size: 0.8125rem;
      color: var(--white-dim);
      line-height: 1.5;
    }

    .notif-session-title {
      display: block;
      font-size: 0.8125rem;
      color: var(--white-dim);
      line-height: 1.5;
      text-decoration: none;
      padding: 0.15rem 0;
      transition: color 0.2s var(--ease-smooth);
    }

    @media (hover: hover) { .notif-session-title:hover {
      color: var(--brand);
    } }

    .notif-session-more {
      display: block;
      font-size: 0.75rem;
      color: var(--white-dim);
      opacity: 0.6;
    }

    .notif-session-time {
      display: block;
      font-size: 0.6875rem;
      color: var(--white-dim);
      opacity: 0.5;
      margin-top: 0.25rem;
    }

    .notif-ask {
      position: fixed;
      right: 2rem;
      bottom: 5.5rem;
      z-index: 890;
      display: flex;
      align-items: center;
      gap: 0.75rem;
      max-width: min(22rem, calc(100vw - 2.5rem));
      padding: 0.65rem 0.75rem 0.65rem 1rem;
      background: var(--surface);
      border: 1px solid var(--glass-border);
      border-radius: 0.9rem;
      box-shadow: 0 6px 24px rgba(0,0,0,0.3);
      font-size: 0.8rem;
      line-height: 1.4;
      color: var(--white-dim);
      opacity: 0;
      transform: translateY(8px);
      transition: opacity 0.3s var(--ease-smooth), transform 0.3s var(--ease-smooth);
    }

    .notif-ask.is-in { opacity: 1; transform: none; }
    .notif-ask-text { margin: 0; }
    .notif-ask-text a { color: var(--brand); white-space: nowrap; }
    .notif-ask-actions { display: flex; align-items: center; gap: 0.25rem; flex-shrink: 0; }

    .notif-ask-yes {
      padding: 0.4rem 0.8rem;
      border-radius: 999px;
      border: 1px solid var(--brand);
      background: var(--brand-subtle);
      color: var(--brand);
      font: inherit;
      font-weight: 600;
      cursor: pointer;
    }

    .notif-ask-no {
      width: 1.75rem;
      height: 1.75rem;
      border: 0;
      background: none;
      color: var(--white-dim);
      font-size: 1.25rem;
      line-height: 1;
      cursor: pointer;
    }

    @media (max-width: 768px) {
      .notif-ask { right: 1.25rem; bottom: 4.5rem; }
    }

    @media (prefers-reduced-motion: reduce) {
      .notif-ask { transition: none; }
    }

    .notif-consent {
      margin: 0;
      padding: 0.6rem 1rem;
      border-bottom: 1px solid rgba(255,255,255,0.06);
      font-size: 0.72rem;
      line-height: 1.45;
      color: var(--white-dim);
    }

    .notif-consent a { color: var(--brand); }

    .notif-panel-foot {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      padding: 0.75rem 1rem;
      border-top: 1px solid rgba(255,255,255,0.06);
      font-size: 0.75rem;
    }

    .notif-foot-link {
      color: var(--white-dim);
      text-decoration: none;
      transition: color 0.2s var(--ease-smooth);
      white-space: nowrap;
    }

    @media (hover: hover) { .notif-foot-link:hover {
      color: var(--brand);
    } }

    .notif-foot-sep {
      color: var(--white-dim);
      opacity: 0.3;
    }

    @media (max-width: 768px) {
      .notif-panel {
        position: fixed;
        top: var(--header-height);
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
      }
    }

/* ── View Transitions tra pagine (2026-09-26) ──
   La copertina cliccata (card/featured) si trasforma nella copertina
   dell'articolo; il resto fa un cross-fade breve. Browser non compatibili:
   navigazione normale. Movimento ridotto: disattivato. */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
.article-cover { view-transition-name: hero-cover; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.22s; }
::view-transition-group(hero-cover) { animation-duration: 0.38s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }
::view-transition-old(hero-cover), ::view-transition-new(hero-cover) { height: 100%; object-fit: cover; overflow: clip; }

/* ── Icone delle fonti sulle card (renderSourceStack) ── */
.src-stack { display: inline-flex; align-items: center; gap: 0.45rem; margin-top: 0.55rem; font-size: 0.75rem; color: var(--white-dim); }
.src-icons { display: inline-flex; }
.src-icons > img, .src-icons > .src-initial {
  width: 18px; height: 18px; border-radius: 50%; margin-left: -5px;
  border: 2px solid var(--surface, #0f1119); background: #fff; object-fit: cover; flex-shrink: 0;
}
.src-icons > :first-child { margin-left: 0; }
.src-initial { display: inline-grid; place-items: center; background: #2a2f45; color: #fff; font-size: 0.6rem; font-weight: 700; }
.src-count { font-family: var(--font-mono); letter-spacing: 0.02em; }
/* Mini-costellazione (una stella per fonte): si accende al passaggio sulla card */
.src-const { flex-shrink: 0; overflow: visible; }
.src-const polyline { fill: none; stroke: var(--brand); stroke-width: 0.6; opacity: 0.35; transition: opacity 0.3s ease; }
.src-const circle { fill: var(--brand); opacity: 0.75; transition: opacity 0.3s ease, filter 0.3s ease; }
@media (hover: hover) {
  .card:hover .src-const polyline, .featured-card:hover .src-const polyline { opacity: 0.8; }
  .card:hover .src-const circle, .featured-card:hover .src-const circle { opacity: 1; filter: drop-shadow(0 0 2px var(--brand)); }
}

/* ── Segui gli argomenti (follow.js) ── */
.follow-btn {
  border: 1px solid rgba(0,212,255,0.4); background: rgba(0,212,255,0.06); color: var(--brand);
  border-radius: var(--radius-full); font: inherit; font-weight: 600; cursor: pointer; transition: all 0.2s ease;
}
.follow-btn[hidden] { display: none; }
.follow-btn--lg { margin-top: 1.1rem; padding: 0.5rem 1.1rem; font-size: 0.875rem; }
.follow-btn.is-on { background: var(--gradient-brand); color: var(--black); border-color: transparent; }
.follow-btn--star { border: 0; background: none; padding: 0; min-width: 28px; min-height: 28px; display: inline-grid; place-items: center; font-size: 0.95rem; line-height: 1; color: var(--white-dim); }
.follow-btn--star.is-on { background: none; color: #ffc940; }
.article-topic-wrap { display: inline-flex; align-items: center; gap: 0.1rem; }
.foryou-topics { display: flex; flex-wrap: wrap; gap: 0.3rem 0.7rem; margin-bottom: 0.4rem; font-size: 0.78rem; }
.foryou-topic { color: var(--brand); text-decoration: none; }
.foryou-empty { color: var(--white-dim); font-size: 0.875rem; padding: 1rem 0; }
.notif-filter { display: flex; align-items: center; gap: 0.45rem; padding: 0.55rem 1rem; font-size: 0.78rem; color: var(--white-dim); border-top: 1px solid rgba(255,255,255,0.06); cursor: pointer; }
.notif-filter[hidden] { display: none; }

/* ── Palette ⌘K: riga AI + argomenti/categorie ── */
.search-result-item.search-result-ai, .search-result-item.search-result-nav { display: flex; align-items: baseline; gap: 0.6rem; }
.search-result-kind { flex-shrink: 0; font-family: var(--font-mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand); min-width: 5.5em; }
.search-result-ai .search-result-kind { min-width: 0; padding: 0.1rem 0.4rem; border-radius: 6px; background: var(--gradient-brand); color: var(--black); }
.search-result-ai .search-result-title { font-weight: 700; }

/* ── Interruttore tema chiaro/scuro ── */
.theme-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); color: var(--white-dim); cursor: pointer; }
@media (hover: hover) { .theme-toggle:hover { color: var(--white); } }
.theme-icon-moon { display: none; }
html[data-theme="light"] .theme-icon-sun { display: none; }
html[data-theme="light"] .theme-icon-moon { display: block; }

/* Badge "Nuovo" (news uscite da meno di 3 ore) */
.badge-new { display: inline-block; padding: 0.1rem 0.45rem; border-radius: 6px; background: rgba(34,197,94,0.14); color: #34d17a; font-family: var(--font-mono); font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
