/* XLX569 — Dashboard pubblica ARI Catania / IQ9DE
   Temi: Etna (dark) · Ionio (light) · font: Fraunces + Manrope
*/

/* —— Shared tokens —— */
:root {
  --font-display: "Fraunces", "Georgia", "Times New Roman", serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --nav-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 0.22s;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

/* —— Dark (Etna) — default —— */
:root,
[data-theme="dark"] {
  --bg0: #0a0e16;
  --bg1: #111827;
  --bg2: #1a2436;
  --panel: rgba(18, 28, 44, 0.78);
  --panel-solid: #121c2c;
  --panel-hover: rgba(26, 38, 56, 0.95);
  --line: rgba(186, 206, 228, 0.12);
  --line-strong: rgba(186, 206, 228, 0.24);
  --text: #e9eef6;
  --muted: #8fa0b8;
  --ink-soft: #c5d0e0;
  --brand: #e8a317;
  --brand-hot: #f5c04a;
  --brand-2: #1aa8a0;
  --brand-2-hot: #3dcdc4;
  --brand-3: #d45a3a;
  --ok: #3cbf8a;
  --warn: #e8a317;
  --bad: #d45a3a;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.38);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.22);
  --header-bg: rgba(10, 14, 22, 0.86);
  --header-blur: blur(16px);
  --grid-line: rgba(255, 255, 255, 0.028);
  --glow-amber: rgba(232, 163, 23, 0.35);
  --glow-teal: rgba(26, 168, 160, 0.32);
  --stat-bg: linear-gradient(165deg, rgba(255, 255, 255, 0.04), transparent 60%), var(--panel);
  --code-bg: rgba(255, 255, 255, 0.05);
  --code-text: #d4e2f5;
  --badge-bg: rgba(26, 168, 160, 0.16);
  --badge-text: #7ad9d1;
  --badge-border: rgba(26, 168, 160, 0.3);
  --error-bg: rgba(212, 90, 58, 0.14);
  --error-border: rgba(212, 90, 58, 0.42);
  --error-text: #ffc4b4;
  --tip-bg: rgba(8, 12, 20, 0.94);
  --table-head: rgba(0, 0, 0, 0.22);
  --table-stripe: rgba(255, 255, 255, 0.018);
  --table-hover: rgba(26, 168, 160, 0.09);
  --module-bg: rgba(0, 0, 0, 0.2);
  --contact-bg: rgba(0, 0, 0, 0.18);
  --footer-bg: rgba(0, 0, 0, 0.28);
  --input-bg: var(--bg0);
  --nav-active-fg: #0a0e16;
  --flash: rgba(232, 163, 23, 0.28);
  --live: #3cbf8a;
  --bg-atmosphere:
    radial-gradient(1100px 560px at 6% -12%, rgba(26, 168, 160, 0.28), transparent 55%),
    radial-gradient(900px 480px at 94% -4%, rgba(232, 163, 23, 0.26), transparent 52%),
    radial-gradient(700px 420px at 72% 108%, rgba(212, 90, 58, 0.2), transparent 58%),
    radial-gradient(500px 320px at 40% 40%, rgba(90, 140, 255, 0.08), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 42%, var(--bg0));
}

/* —— Light (Ionio) —— */
[data-theme="light"] {
  --bg0: #f4f6f9;
  --bg1: #eef2f6;
  --bg2: #e4ebf2;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-solid: #ffffff;
  --panel-hover: #ffffff;
  --line: rgba(28, 42, 64, 0.1);
  --line-strong: rgba(28, 42, 64, 0.18);
  --text: #152033;
  --muted: #5a6b82;
  --ink-soft: #3a4a60;
  --brand: #c8870a;
  --brand-hot: #e8a317;
  --brand-2: #0f8f88;
  --brand-2-hot: #1aa8a0;
  --brand-3: #c24a2e;
  --ok: #1f9a68;
  --warn: #c8870a;
  --bad: #c24a2e;
  --shadow: 0 14px 36px rgba(28, 42, 64, 0.1);
  --shadow-sm: 0 3px 12px rgba(28, 42, 64, 0.08);
  --header-bg: rgba(244, 246, 249, 0.9);
  --header-blur: blur(14px);
  --grid-line: rgba(28, 42, 64, 0.035);
  --glow-amber: rgba(200, 135, 10, 0.28);
  --glow-teal: rgba(15, 143, 136, 0.26);
  --stat-bg: linear-gradient(165deg, rgba(255, 255, 255, 0.95), rgba(238, 242, 246, 0.7)), var(--panel);
  --code-bg: rgba(21, 32, 51, 0.05);
  --code-text: #1a3a5c;
  --badge-bg: rgba(15, 143, 136, 0.1);
  --badge-text: #0b6f69;
  --badge-border: rgba(15, 143, 136, 0.28);
  --error-bg: rgba(194, 74, 46, 0.08);
  --error-border: rgba(194, 74, 46, 0.35);
  --error-text: #8f2e1a;
  --tip-bg: rgba(21, 32, 51, 0.94);
  --table-head: rgba(21, 32, 51, 0.04);
  --table-stripe: rgba(21, 32, 51, 0.025);
  --table-hover: rgba(15, 143, 136, 0.08);
  --module-bg: rgba(238, 242, 246, 0.85);
  --contact-bg: rgba(238, 242, 246, 0.75);
  --footer-bg: rgba(228, 235, 242, 0.7);
  --input-bg: #ffffff;
  --nav-active-fg: #152033;
  --flash: rgba(200, 135, 10, 0.22);
  --live: #1f9a68;
  --bg-atmosphere:
    radial-gradient(1000px 520px at 4% -10%, rgba(15, 143, 136, 0.2), transparent 55%),
    radial-gradient(860px 460px at 96% 0%, rgba(200, 135, 10, 0.18), transparent 50%),
    radial-gradient(640px 380px at 70% 110%, rgba(194, 74, 46, 0.12), transparent 55%),
    radial-gradient(480px 300px at 45% 35%, rgba(70, 120, 220, 0.08), transparent 60%),
    linear-gradient(180deg, #f7f8fa, var(--bg1) 45%, #f0f3f7);
}

/* System preference when no explicit theme is set */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg0: #f4f6f9;
    --bg1: #eef2f6;
    --bg2: #e4ebf2;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-solid: #ffffff;
    --panel-hover: #ffffff;
    --line: rgba(28, 42, 64, 0.1);
    --line-strong: rgba(28, 42, 64, 0.18);
    --text: #152033;
    --muted: #5a6b82;
    --ink-soft: #3a4a60;
    --brand: #c8870a;
    --brand-hot: #e8a317;
    --brand-2: #0f8f88;
    --brand-2-hot: #1aa8a0;
    --brand-3: #c24a2e;
    --ok: #1f9a68;
    --warn: #c8870a;
    --bad: #c24a2e;
    --shadow: 0 14px 36px rgba(28, 42, 64, 0.1);
    --shadow-sm: 0 3px 12px rgba(28, 42, 64, 0.08);
    --header-bg: rgba(244, 246, 249, 0.9);
    --header-blur: blur(14px);
    --grid-line: rgba(28, 42, 64, 0.035);
    --glow-amber: rgba(200, 135, 10, 0.28);
    --glow-teal: rgba(15, 143, 136, 0.26);
    --stat-bg: linear-gradient(165deg, rgba(255, 255, 255, 0.95), rgba(238, 242, 246, 0.7)), var(--panel);
    --code-bg: rgba(21, 32, 51, 0.05);
    --code-text: #1a3a5c;
    --badge-bg: rgba(15, 143, 136, 0.1);
    --badge-text: #0b6f69;
    --badge-border: rgba(15, 143, 136, 0.28);
    --error-bg: rgba(194, 74, 46, 0.08);
    --error-border: rgba(194, 74, 46, 0.35);
    --error-text: #8f2e1a;
    --tip-bg: rgba(21, 32, 51, 0.94);
    --table-head: rgba(21, 32, 51, 0.04);
    --table-stripe: rgba(21, 32, 51, 0.025);
    --table-hover: rgba(15, 143, 136, 0.08);
    --module-bg: rgba(238, 242, 246, 0.85);
    --contact-bg: rgba(238, 242, 246, 0.75);
    --footer-bg: rgba(228, 235, 242, 0.7);
    --input-bg: #ffffff;
    --nav-active-fg: #152033;
    --flash: rgba(200, 135, 10, 0.22);
    --live: #1f9a68;
    --bg-atmosphere:
      radial-gradient(1000px 520px at 4% -10%, rgba(15, 143, 136, 0.1), transparent 55%),
      radial-gradient(860px 460px at 96% 0%, rgba(200, 135, 10, 0.1), transparent 50%),
      radial-gradient(640px 380px at 70% 110%, rgba(194, 74, 46, 0.06), transparent 55%),
      linear-gradient(180deg, #f7f8fa, var(--bg1) 45%, #f0f3f7);
  }
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

html[data-theme="light"],
html:not([data-theme="dark"]):not([data-theme="light"]) {
  /* color-scheme updated below for light when applicable */
}

[data-theme="light"] {
  color-scheme: light;
}

[data-theme="dark"] {
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
  }
}

body.public-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-atmosphere);
  background-attachment: fixed;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  transition:
    background-color var(--duration) var(--ease),
    color var(--duration) var(--ease);
}

body.public-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse at 50% 20%, black 25%, transparent 78%);
  z-index: 0;
  transition: opacity var(--duration) var(--ease);
}

a {
  color: var(--brand-2);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

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

a:focus-visible,
button:focus-visible,
.FilterField:focus-visible,
.input:focus-visible,
.theme-toggle:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}

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

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: var(--header-blur);
  -webkit-backdrop-filter: var(--header-blur);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  padding-top: var(--safe-top);
  transition:
    background-color var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}

.site-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--nav-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  color: inherit;
}

.brand:hover {
  color: inherit;
}

.brand-logo {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  box-shadow:
    0 0 0 2px var(--glow-amber),
    0 0 0 5px rgba(26, 168, 160, 0.18),
    0 10px 28px rgba(0, 0, 0, 0.28);
  animation: logoGlow 5s ease-in-out infinite;
}

@keyframes logoGlow {
  0%, 100% {
    box-shadow:
      0 0 0 2px var(--glow-amber),
      0 0 0 5px rgba(26, 168, 160, 0.15),
      0 10px 28px rgba(0, 0, 0, 0.28);
  }
  50% {
    box-shadow:
      0 0 0 2px var(--glow-teal),
      0 0 0 6px rgba(232, 163, 23, 0.2),
      0 12px 32px var(--glow-teal);
  }
}

.brand-text {
  min-width: 0;
}

.brand-club {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.8vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
  color: var(--brand-2);
  margin-bottom: 0.18rem;
  background: linear-gradient(100deg, var(--brand-2), var(--brand), var(--brand-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-kicker {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.12rem;
}

.brand-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.98rem, 2vw, 1.2rem);
  letter-spacing: 0.01em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-soft);
  font-variation-settings: "SOFT" 40, "WONK" 0;
}

.brand-title span {
  color: var(--brand);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  flex: 0 0 auto;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(60, 191, 138, 0.35);
  background: rgba(60, 191, 138, 0.12);
  color: var(--live);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.live-pill .live-dot {
  margin: 0;
}

.live-pill.is-offline {
  color: var(--warn);
  border-color: rgba(232, 163, 23, 0.35);
  background: rgba(232, 163, 23, 0.1);
}

.live-pill.is-offline .live-dot {
  background: var(--warn);
  animation: none;
  box-shadow: none;
}

[data-theme="light"] .live-pill {
  background: rgba(31, 154, 104, 0.1);
  border-color: rgba(31, 154, 104, 0.28);
}

.onair-pill {
  display: none;
  align-items: center;
  gap: 0.35rem;
  max-width: min(52vw, 280px);
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(232, 163, 23, 0.28);
  background: rgba(232, 163, 23, 0.08);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.onair-pill.is-active {
  display: inline-flex;
  color: var(--brand-3);
  border-color: rgba(212, 90, 58, 0.4);
  background: rgba(212, 90, 58, 0.12);
}

.onair-pill[hidden] {
  display: none !important;
}

.onair-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--brand-3, #d45a3a);
  box-shadow: 0 0 0 0 rgba(212, 90, 58, 0.45);
  animation: onairPulse 1.4s ease-out infinite;
  flex: 0 0 auto;
}

@keyframes onairPulse {
  0% { box-shadow: 0 0 0 0 rgba(212, 90, 58, 0.45); }
  70% { box-shadow: 0 0 0 0.45rem rgba(212, 90, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 90, 58, 0); }
}

.onair-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--brand-3, #d45a3a);
}

.onair-pill strong {
  color: var(--text);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
}

.onair-sep {
  opacity: 0.45;
}

.onair-mod {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
}

.onair-mod:hover {
  text-decoration: underline;
}

.onair-mod-name {
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 720px) {
  .onair-mod-name {
    display: none;
  }
}

/* Theme toggle */
.theme-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-left: 0;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition:
    background-color var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    color var(--duration) var(--ease),
    transform 0.15s var(--ease);
}

.theme-toggle:hover {
  background: rgba(127, 140, 160, 0.1);
  border-color: var(--brand);
  color: var(--brand);
}

.theme-toggle:active {
  transform: scale(0.96);
}

.theme-toggle__icon {
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  line-height: 0;
}

.theme-toggle__icon svg {
  width: 100%;
  height: 100%;
  grid-area: 1 / 1;
  stroke: currentColor;
  fill: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

[data-theme="dark"] .theme-toggle__icon .icon-moon,
[data-theme="light"] .theme-toggle__icon .icon-sun {
  opacity: 0;
  transform: scale(0.6) rotate(-20deg);
  pointer-events: none;
}

[data-theme="dark"] .theme-toggle__icon .icon-sun,
[data-theme="light"] .theme-toggle__icon .icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  margin-left: 0;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  transition:
    background-color var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}

.nav-toggle:hover {
  background: rgba(127, 140, 160, 0.1);
  border-color: var(--brand-2);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  align-items: center;
  margin-left: 0.5rem;
  margin-right: auto;
}

.site-nav a {
  position: relative;
  color: var(--muted);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  transition:
    color var(--duration) var(--ease),
    background-color var(--duration) var(--ease);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.28rem;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.28s var(--ease);
}

.site-nav a:hover {
  color: var(--text);
  background: rgba(127, 140, 160, 0.08);
}

.site-nav a:hover::after {
  transform: scaleX(0.45);
}

.site-nav a.active {
  color: var(--nav-active-fg);
  background: linear-gradient(125deg, var(--brand), var(--brand-hot));
}

.site-nav a.active::after {
  display: none;
}

.site-nav a .count {
  display: inline-block;
  margin-left: 0.28rem;
  font-size: 0.74rem;
  font-weight: 700;
  opacity: 0.8;
}

/* —— Page —— */
.page {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem calc(3rem + var(--safe-bottom));
  animation: pageIn 0.55s var(--ease) both;
}

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

.hero {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding: 1.1rem 0 0.35rem;
}

@media (min-width: 860px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 268px);
    align-items: center;
    gap: 1.35rem;
  }

  .hero .stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    width: 100%;
  }

  .hero .stat {
    max-width: none;
    min-width: 0;
    flex: unset;
    padding: 0.75rem 0.8rem;
  }
}

.hero-brand {
  min-width: 0;
  width: 100%;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.hero-logo-svg {
  display: block;
  width: auto;
  height: clamp(7.5rem, 16vw, 10.5rem);
  max-width: 100%;
  margin-inline: auto;
  overflow: visible;
  shape-rendering: geometricPrecision;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

.hero-logo-svg .hl-rings circle,
.hero-logo-svg .hl-rings path {
  stroke: var(--brand-2);
}

.hero-logo-svg .hl-rings .hl-ring-gold {
  stroke: var(--brand);
}

.hero-logo-svg .hl-nine {
  fill: var(--brand);
}

.hero-logo-svg .hl-mark {
  fill: var(--brand-2);
}

.hero-logo-svg .hl-title {
  fill: var(--text);
}

.hero-logo-svg .hl-sub {
  fill: var(--brand-2);
}

.hero-logo-svg .hl-muted {
  fill: var(--muted);
}

.hero-logo {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: left center;
  background: transparent;
}

.hero-copy h1 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.8vw, 2.55rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  font-variation-settings: "SOFT" 30, "WONK" 0;
}

.hero-copy p {
  margin: 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.stat {
  min-width: 108px;
  flex: 1 1 auto;
  max-width: 160px;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--stat-bg);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition:
    transform 0.22s var(--ease),
    border-color 0.22s var(--ease),
    box-shadow 0.22s var(--ease);
}

.stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-2), var(--brand), var(--brand-3));
}

.stats .stat:nth-child(1)::before { background: linear-gradient(90deg, var(--brand), var(--brand-hot)); }
.stats .stat:nth-child(2)::before { background: linear-gradient(90deg, var(--brand-2), var(--brand-2-hot)); }
.stats .stat:nth-child(3)::before { background: linear-gradient(90deg, #5a8cff, var(--brand-2)); }
.stats .stat:nth-child(4)::before { background: linear-gradient(90deg, var(--brand-3), var(--brand)); }

.stat:hover {
  transform: translateY(-2px);
  border-color: rgba(232, 163, 23, 0.35);
  box-shadow: var(--shadow);
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1;
}

.stat-label {
  display: block;
  margin-top: 0.38rem;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}

/* Meta / live bar */
.meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.2rem;
  align-items: center;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.88rem;
  box-shadow: var(--shadow-sm);
  transition: opacity 0.35s var(--ease);
}

.meta-bar strong {
  color: var(--text);
  font-weight: 650;
}

.live-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: var(--live);
  vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(60, 191, 138, 0.45);
  animation: livePulse 1.8s ease-out infinite;
}

.live-dot.is-offline {
  background: var(--warn);
  animation: none;
  box-shadow: none;
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(60, 191, 138, 0.45);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(60, 191, 138, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(60, 191, 138, 0);
  }
}

[data-live] {
  transition: opacity 0.3s var(--ease);
}

.live-updating {
  animation: liveUpdating 1.1s ease-in-out infinite;
}

@keyframes liveUpdating {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.flash-update {
  animation: flashUpdate 1.1s var(--ease);
}

@keyframes flashUpdate {
  0% { background-color: var(--flash); }
  100% { background-color: transparent; }
}

/* —— Panels —— */
.panel {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition:
    background-color var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    opacity 0.35s var(--ease);
}

.panel.live-updating,
.panel-body.live-updating {
  animation: liveUpdating 1.1s ease-in-out infinite;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(26, 168, 160, 0.16), rgba(232, 163, 23, 0.1), transparent 70%);
}

[data-theme="light"] .panel-head {
  background: linear-gradient(90deg, rgba(15, 143, 136, 0.14), rgba(200, 135, 10, 0.1), transparent 70%);
}

.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-body {
  padding: 0;
}

.panel-body.pad {
  padding: 1.25rem 1.15rem;
}

/* —— Filters / forms —— */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.filters form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
}

.FilterField,
.input {
  background: var(--input-bg);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font: inherit;
  min-width: 120px;
  min-height: 40px;
  transition:
    border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    background-color var(--duration) var(--ease);
}

.FilterField:focus,
.input:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(26, 168, 160, 0.22);
}

.FilterSubmit,
.btn {
  appearance: none;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  min-height: 40px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: #0a0e16;
  background: linear-gradient(125deg, var(--brand-2), var(--brand-2-hot));
  transition:
    transform 0.15s var(--ease),
    filter 0.15s var(--ease),
    box-shadow 0.15s var(--ease);
}

.btn-secondary {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line-strong);
}

.btn-secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
  filter: none;
}

.FilterSubmit:hover,
.btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.FilterSubmit:active,
.btn:active {
  transform: translateY(0);
}

.smalllink {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.smalllink:hover {
  color: var(--brand);
}

/* —— Tables —— */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  background: transparent;
  font-size: 0.92rem;
}

.table > thead > tr > th,
.table > tbody > tr > th,
.table > tbody > tr > td,
.table th,
.table td {
  padding: 0.72rem 0.85rem;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--text);
  background: transparent !important;
  transition: background-color 0.35s var(--ease);
}

.table thead th,
.table tr.table-center > th,
.table > tbody > tr:first-child > th {
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  background: var(--table-head) !important;
  white-space: nowrap;
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
  background: var(--table-stripe) !important;
}

.table-hover > tbody > tr:hover > td {
  background: var(--table-hover) !important;
}

.table tbody tr.flash-update > td {
  animation: flashUpdate 1.1s var(--ease);
}

.table-center * {
  text-align: center !important;
}

.table-flag {
  height: 16px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(127, 140, 160, 0.25);
}

.table a.pl,
.table a.listinglink {
  color: var(--text);
  font-weight: 700;
}

.table a.pl:hover,
.table a.listinglink:hover {
  color: var(--brand);
}

/* TX / status */
.tx-live {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: rgba(212, 90, 58, 0.18);
  color: var(--brand-3);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  animation: txPulse 1.15s ease-in-out infinite;
}

@keyframes txPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(212, 90, 58, 0.42);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 8px rgba(212, 90, 58, 0);
  }
}

.status-dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(60, 191, 138, 0.2);
}

.status-dot.down {
  background: var(--bad);
  box-shadow: 0 0 0 3px rgba(212, 90, 58, 0.2);
}

.status-dot.warn {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(232, 163, 23, 0.22);
}

.stat--ok .stat-value {
  color: var(--ok);
}

.stat--warn .stat-value {
  color: var(--warn);
}

.stat--bad .stat-value {
  color: var(--bad);
}

.stat--empty .stat-value {
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--badge-border);
}

/* —— Modules —— */
.module-groups {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.85rem 1rem 1.1rem;
}

.module-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--module-bg);
  overflow: hidden;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.module-group.is-open {
  border-color: rgba(232, 163, 23, 0.4);
  box-shadow: var(--shadow-sm);
}

.module-group-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.35rem 0.45rem 0.35rem 0.25rem;
}

.module-group-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 0.55rem;
  align-items: center;
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  min-width: 0;
}

.module-group-toggle:hover,
.module-group-toggle:focus-visible {
  background: rgba(232, 163, 23, 0.08);
  outline: none;
}

.module-group-chevron {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.2s var(--ease);
  margin: 0 0.15rem 0 0.2rem;
}

.module-group.is-open .module-group-chevron {
  transform: rotate(45deg);
  border-color: var(--brand);
}

.module-group-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.module-group-count {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.module-group-desc {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-group-name {
  justify-self: end;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(232, 163, 23, 0.28);
  background: rgba(232, 163, 23, 0.08);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-group-name:hover,
.module-group-name:focus-visible {
  border-color: rgba(232, 163, 23, 0.55);
  background: rgba(232, 163, 23, 0.16);
  outline: none;
}

.module-group-body {
  border-top: 1px solid var(--line);
  padding: 0.75rem 1rem 0.95rem;
}

.module-group.is-open .module-group-body {
  animation: moduleBodyIn 0.28s var(--ease);
}

@keyframes moduleBodyIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.module-group-body .module-nodes {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.35rem 0.75rem;
}

.module-group-body .module-empty {
  padding: 0.25rem 0;
}

@media (max-width: 720px) {
  .module-group-head {
    grid-template-columns: 1fr;
  }

  .module-group-name {
    justify-self: stretch;
    text-align: center;
  }
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 0.85rem;
  padding: 1.15rem;
}

.module-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--module-bg);
  padding: 1rem;
  min-height: 140px;
  transition:
    border-color 0.22s var(--ease),
    transform 0.22s var(--ease),
    box-shadow 0.22s var(--ease);
}

.module-card:hover {
  border-color: rgba(232, 163, 23, 0.42);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.module-card-hit {
  display: block;
  color: inherit;
  text-decoration: none;
  margin: -0.25rem -0.25rem 0.65rem;
  padding: 0.25rem;
  border-radius: calc(var(--radius) - 4px);
}

.module-card-hit:hover .module-letter,
.module-card-hit:focus-visible .module-letter {
  color: var(--brand);
}

.module-card-hit:focus-visible {
  outline: 2px solid rgba(232, 163, 23, 0.55);
  outline-offset: 2px;
}

.module-card-cta {
  display: inline-block;
  margin-top: 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brand);
  opacity: 0.85;
}

.module-list-hint {
  margin: 0;
  padding: 0.85rem 1.15rem 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.module-letter-link,
.module-name-link {
  color: inherit;
  text-decoration: none;
}

.module-letter-link:hover,
.module-name-link:hover {
  color: var(--brand);
}

.modules-table-row {
  cursor: pointer;
}

.modules-table-row:focus-visible {
  outline: 2px solid rgba(232, 163, 23, 0.55);
  outline-offset: -2px;
}

.module-sheet-nav {
  margin: 0 0 1rem;
}

.module-sheet-hero {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 1.15rem;
  padding: 1.55rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 140% at -8% 40%, rgba(232, 163, 23, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 120% at 108% -10%, rgba(26, 168, 160, 0.22), transparent 52%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.04), transparent 55%),
    var(--panel);
  box-shadow: var(--shadow-sm);
}

.module-sheet-badge {
  flex: 0 0 auto;
  width: 5rem;
  height: 5rem;
  display: grid;
  place-items: center;
  border-radius: 1.05rem;
  background: rgba(232, 163, 23, 0.18);
  border: 1px solid rgba(232, 163, 23, 0.42);
  box-shadow: 0 10px 28px rgba(232, 163, 23, 0.12);
  font-family: var(--font-display);
  font-size: 2.65rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1;
}

.module-sheet-hero-text {
  flex: 1 1 auto;
  min-width: 0;
}

.module-sheet-kicker {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.module-sheet-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.2vw, 2.55rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.module-sheet-desc {
  margin: 0.65rem 0 0;
  color: var(--ink-soft);
  max-width: 42rem;
  line-height: 1.5;
  font-size: 1.02rem;
}

.module-sheet-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.module-sheet-hero-meta strong {
  color: var(--text);
  font-weight: 800;
}

.module-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.module-sheet-notes {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.module-sheet-notes h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}

.module-sheet-notes p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-wrap;
}

@media (max-width: 820px) {
  .module-sheet-grid {
    grid-template-columns: 1fr;
  }

  .module-sheet-hero {
    padding: 1.15rem 1rem;
    align-items: flex-start;
  }

  .module-sheet-badge {
    width: 3.75rem;
    height: 3.75rem;
    font-size: 2rem;
    border-radius: 0.9rem;
  }
}

.module-letter {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1;
}

.module-name {
  margin: 0.35rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 2.4em;
  line-height: 1.35;
}

.module-nodes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

.module-nodes a {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 650;
}

.module-nodes a:hover {
  color: var(--brand-2);
}

.module-empty {
  color: var(--muted);
  font-size: 0.85rem;
}

/* —— Layouts —— */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr);
  gap: 1rem;
}

.content-block h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.015em;
}

.content-block h3 {
  margin: 1.5rem 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--brand);
}

.content-block p,
.content-block li {
  color: var(--muted);
}

.content-block ul {
  padding-left: 1.15rem;
}

.content-block code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  color: var(--code-text);
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.05rem 0.35rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.join-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.15rem 0 1rem;
}

.join-fact {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  background: var(--module-bg);
  min-width: 0;
}

.join-fact__label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

.join-fact strong,
.join-fact code {
  color: var(--text);
  font-size: 1.02rem;
  word-break: break-word;
}

.join-fact a {
  color: var(--brand-2);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.88rem;
  word-break: break-all;
}

.join-fact a:hover,
.join-fact a:focus-visible {
  color: var(--brand);
  text-decoration: underline;
}

.join-fact__hint {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.join-note {
  margin: 0 0 1.25rem;
  font-size: 0.92rem;
}

.join-protocols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 0 0 0.5rem;
}

.join-proto {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--module-bg);
  padding: 1rem 1.05rem 1.1rem;
  min-width: 0;
}

.join-proto__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.join-proto__head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text);
}

.join-steps {
  margin: 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.join-steps li {
  line-height: 1.45;
}

.join-proto__tip {
  margin: 0.85rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.join-code {
  margin: 0.65rem 0;
  padding: 0.7rem 0.8rem;
  overflow-x: auto;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--line);
  background: var(--code-bg);
  color: var(--code-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: pre;
}

@media (max-width: 1100px) {
  .join-facts {
    grid-template-columns: 1fr 1fr;
  }

  .join-protocols {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .join-facts {
    grid-template-columns: 1fr;
  }
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.contact-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--contact-bg);
  transition:
    border-color 0.22s var(--ease),
    transform 0.22s var(--ease);
}

.contact-item:hover {
  border-color: rgba(26, 168, 160, 0.35);
  transform: translateY(-1px);
}

.contact-item strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text);
  font-family: var(--font-display);
}

.error {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--error-border);
  background: var(--error-bg);
  color: var(--error-text);
  font-weight: 600;
}

/* Tooltip flags */
a.tip {
  text-decoration: none;
}

a.tip span {
  display: none;
}

a.tip:hover {
  position: relative;
}

a.tip:hover span {
  display: block;
  position: absolute;
  z-index: 50;
  top: 1.2rem;
  left: 0;
  white-space: nowrap;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--tip-bg);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* —— Footer —— */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  background: var(--footer-bg);
  padding-bottom: var(--safe-bottom);
  transition: background-color var(--duration) var(--ease);
}

.site-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.4rem 1.25rem 1.8rem;
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer strong {
  color: var(--text);
  font-weight: 700;
}

.site-footer a {
  color: var(--brand);
}

/* Bootstrap leftovers */
.row {
  margin-left: 0;
  margin-right: 0;
}

.col-md-9,
.col-md-3,
.col-md-1,
.col-md-2,
.col-md-4 {
  position: static;
  float: none;
  width: auto;
  padding: 0;
}

.users-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(240px, 1fr);
  gap: 1rem;
}

.users-layout .modules-side .table {
  font-size: 0.86rem;
}

.users-layout .modules-side th {
  text-align: center !important;
}

.modules-side {
  min-width: 0;
}

/* —— Mobile —— */
@media (max-width: 980px) {
  .split,
  .users-layout {
    grid-template-columns: 1fr;
  }

  .site-header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.65rem;
    row-gap: 0.55rem;
    flex-wrap: unset;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    order: unset;
    align-items: center;
    min-width: 0;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
    order: unset;
    margin-left: 0;
    align-self: center;
    justify-self: end;
    align-items: center;
  }

  .theme-toggle {
    margin-left: 0;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    grid-column: 1 / -1;
    grid-row: 2;
    order: unset;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--line);
    gap: 0.15rem;
  }

  .site-header.is-open .site-nav {
    display: flex;
    animation: pageIn 0.28s var(--ease) both;
  }

  .site-nav a {
    border-radius: var(--radius-sm);
    min-height: 44px;
    padding: 0.7rem 0.85rem;
  }

  .site-nav a::after {
    display: none;
  }

  .site-nav a.active {
    background: linear-gradient(125deg, var(--brand), var(--brand-hot));
  }
}

@media (max-width: 640px) {
  :root {
    --nav-h: 64px;
  }

  .site-header-inner {
    padding: 0.55rem 0.9rem;
    column-gap: 0.55rem;
    row-gap: 0.5rem;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .brand-text {
    min-width: 0;
  }

  .brand-club {
    font-size: clamp(0.95rem, 4.2vw, 1.2rem);
    white-space: normal;
  }

  .brand-title {
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .live-pill {
    padding: 0.35rem;
    min-width: 42px;
    min-height: 42px;
    justify-content: center;
  }

  .live-pill span:not(.live-dot) {
    display: none;
  }

  .live-pill .live-dot {
    margin: 0;
  }

  .page {
    padding: 1rem 0.9rem calc(2.25rem + var(--safe-bottom));
  }

  .hero {
    padding-top: 0.75rem;
    gap: 1rem;
    margin-bottom: 1.1rem;
  }

  .hero-brand {
    max-width: none;
  }

  .hero-logo-svg {
    width: 100%;
    height: auto;
    max-height: 9.25rem;
  }

  .hero-logo {
    max-height: none;
  }

  .hero-copy h1 {
    font-size: clamp(1.45rem, 7vw, 1.9rem);
  }

  .hero-copy p {
    font-size: 0.98rem;
  }

  .stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .stat {
    max-width: none;
    min-width: 0;
    padding: 0.75rem 0.85rem;
  }

  .stat-value {
    font-size: 1.35rem;
  }

  .meta-bar {
    padding: 0.65rem 0.8rem;
    font-size: 0.82rem;
    gap: 0.5rem 0.9rem;
  }

  .panel-head {
    padding: 0.85rem 0.9rem;
  }

  .panel-body.pad {
    padding: 1rem 0.9rem;
  }

  .module-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.65rem;
    padding: 0.9rem;
  }

  .table th,
  .table td {
    padding: 0.6rem 0.65rem;
    font-size: 0.86rem;
  }

  .FilterField,
  .input,
  .FilterSubmit,
  .btn {
    min-height: 44px;
  }

  .filters form {
    width: 100%;
  }

  .FilterField {
    flex: 1 1 auto;
    min-width: 0;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .brand-text {
    max-width: 11rem;
  }
}

/* —— Charts / map / modules meta —— */
.charts-section .panel-head {
  gap: 0.85rem;
}

.chart-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-left: auto;
}

.chart-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(26, 168, 160, 0.1);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.chart-chip strong {
  color: var(--brand);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
}

[data-theme="light"] .chart-chip {
  background: rgba(15, 143, 136, 0.08);
}

.chart-interact-hint {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.chart-tool {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease),
    color 0.2s var(--ease);
}

.chart-tool:hover,
.chart-tool:focus-visible {
  border-color: rgba(26, 168, 160, 0.45);
  outline: none;
}

.chart-tool.is-active {
  border-color: rgba(26, 168, 160, 0.55);
  background: rgba(26, 168, 160, 0.16);
  color: var(--brand-2);
}

.chart-tool--ghost {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  opacity: 0.85;
}

.chart-tool:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

a.chart-tool {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chart-period-label {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 14rem;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 0.25rem;
}

/* Controlli Attività: righe separate, leggibili anche su mobile */
.activity-controls {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0 0 0.75rem;
}

.activity-controls__row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
}

.activity-controls__row--toggles {
  justify-content: space-between;
  gap: 0.65rem;
}

.activity-seg {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 80%, transparent);
}

.activity-seg .chart-tool {
  margin: 0;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.activity-controls__nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "prev label next today";
  align-items: center;
  column-gap: 0.45rem;
  row-gap: 0.45rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 75%, transparent);
}

.activity-controls__nav > [data-chart-nav="prev"] {
  grid-area: prev;
}

.activity-controls__nav .chart-period-label {
  grid-area: label;
  flex: unset;
  max-width: none;
  width: 100%;
}

.activity-controls__nav > [data-chart-nav="next"] {
  grid-area: next;
}

.activity-controls__nav > [data-chart-nav="today"] {
  grid-area: today;
}

.chart-tool--nav {
  width: auto;
  min-width: 2.55rem;
  height: 2.55rem;
  padding: 0 0.55rem;
  border-radius: 8px;
  font-size: 1.05rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  border-color: rgba(26, 168, 160, 0.4);
  background: rgba(26, 168, 160, 0.1);
  color: var(--brand-2);
  font-weight: 800;
}

.chart-tool--nav:hover:not(:disabled),
.chart-tool--nav:focus-visible:not(:disabled) {
  border-color: rgba(26, 168, 160, 0.7);
  background: rgba(26, 168, 160, 0.2);
  color: var(--brand-2-hot, var(--brand-2));
}

.chart-tool--nav .chart-tool__label {
  display: none;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.chart-tool--today {
  min-height: 2.55rem;
  padding: 0 0.85rem;
  border-radius: 8px;
  text-transform: none;
}

.chart-panel__head--activity {
  margin-bottom: 0.55rem;
}

@media (max-width: 640px) {
  .charts-section .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .chart-summary {
    margin-left: 0;
    width: 100%;
  }

  .activity-controls__row--toggles {
    flex-direction: column;
    align-items: stretch;
  }

  .activity-seg {
    width: 100%;
    justify-content: center;
  }

  .activity-seg .chart-tool {
    flex: 1 1 0;
    text-align: center;
    justify-content: center;
  }

  .activity-controls__nav {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "prev label next"
      "today today today";
    padding: 0.55rem;
    gap: 0.45rem;
  }

  .activity-controls__nav > [data-chart-nav="today"] {
    justify-self: stretch;
    width: 100%;
  }

  .chart-period-label {
    font-size: 0.86rem;
    max-width: none;
  }

  .chart-tool--nav {
    min-width: 4.4rem;
    height: 2.75rem;
    padding: 0 0.65rem;
    font-size: 1.1rem;
  }

  .chart-tool--nav .chart-tool__label {
    display: inline;
  }

  .chart-tool--today {
    min-height: 2.6rem;
    padding: 0 0.75rem;
  }

  .activity-estimate {
    justify-content: center;
  }
}

/* Barre navigazione Utenti (giorno + pagine) */
.users-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: 0.45rem;
  row-gap: 0.45rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}

.users-pager-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
  margin-top: 0;
}

.users-toolbar__label {
  min-width: 0;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 0.35rem;
}

.users-bar-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  width: 2.55rem;
  height: 2.55rem;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg, var(--panel));
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
}

.users-bar-btn--nav {
  width: auto;
  min-width: 2.55rem;
  padding: 0 0.55rem;
  border-color: rgba(26, 168, 160, 0.4);
  background: rgba(26, 168, 160, 0.1);
  color: var(--brand-2);
  font-weight: 800;
}

.users-bar-btn__label {
  display: none;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.users-bar-btn--wide {
  width: auto;
  min-width: 4.75rem;
  padding: 0 0.75rem;
  font-size: 0.8rem;
}

.users-bar-btn--today {
  justify-self: end;
}

a.users-bar-btn:hover,
a.users-bar-btn:focus-visible {
  border-color: rgba(26, 168, 160, 0.55);
  color: var(--brand-2);
  outline: none;
}

.users-bar-btn.is-current {
  border-color: rgba(232, 163, 23, 0.6);
  background: rgba(232, 163, 23, 0.18);
  color: var(--brand);
}

.users-bar-btn.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.users-bar-gap {
  width: 1rem;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 2.55rem;
  user-select: none;
}

.users-pager-pages {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

@media (max-width: 640px) {
  .users-toolbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "uprev ulabel unext"
      "utoday utoday utoday";
  }

  .users-toolbar > [data-users-nav="prev"] {
    grid-area: uprev;
  }

  .users-toolbar__label {
    grid-area: ulabel;
    font-size: 0.86rem;
  }

  .users-toolbar > [data-users-nav="next"] {
    grid-area: unext;
  }

  .users-toolbar > [data-users-nav="today"] {
    grid-area: utoday;
    justify-self: stretch;
    width: 100%;
    min-height: 2.6rem;
  }

  .users-bar-btn--nav {
    min-width: 4.4rem;
    height: 2.75rem;
    padding: 0 0.65rem;
  }

  .users-bar-btn__label {
    display: inline;
  }

  .users-pager-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "pprev ppages pnext";
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 0.65rem;
  }

  .users-pager-bar > [data-users-page="prev"] {
    grid-area: pprev;
  }

  .users-pager-bar > [data-users-page="next"] {
    grid-area: pnext;
  }

  .users-pager-pages {
    grid-area: ppages;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
    justify-content: center;
  }
}

/* Reflector list: search + sortable columns */
.reflectors-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}

.reflectors-search {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.reflectors-search__input {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.95rem;
}

.th-sort {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.th-sort::after {
  content: "↕";
  opacity: 0.35;
  font-size: 0.75em;
  font-weight: 700;
}

th.is-sorted .th-sort::after {
  content: "▲";
  opacity: 0.9;
  color: var(--brand);
}

th.is-sorted-desc .th-sort::after {
  content: "▼";
}

th.is-sorted {
  color: var(--brand);
}

#reflectorsTable tbody tr.is-self td {
  background: rgba(232, 163, 23, 0.1);
}

#reflectorsTable tbody tr[hidden] {
  display: none;
}

.reflectors-empty {
  margin: 0;
  padding: 1.1rem 1.15rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
}

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

@media (max-width: 640px) {
  .reflectors-toolbar {
    padding: 0.65rem 0.85rem;
  }
}

.activity-estimate {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
}

.chart-canvas-wrap--interactive {
  cursor: crosshair;
}

.chart-tooltip {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  min-width: 110px;
  max-width: 220px;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 92%, black);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.35;
}

[data-theme="light"] .chart-tooltip {
  background: rgba(255, 255, 255, 0.96);
}

.chart-tooltip strong {
  color: var(--brand);
  font-weight: 700;
}

.dashboard-quick {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (max-width: 820px) {
  .dashboard-quick {
    grid-template-columns: 1fr;
  }
}

.dash-quick-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin: 1rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

.dash-quick-links a {
  color: var(--brand-2);
  text-decoration: none;
}

.dash-quick-links a:hover,
.dash-quick-links a:focus-visible {
  color: var(--brand);
  text-decoration: underline;
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
}

.dash-module-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.dash-module-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  text-decoration: none;
  color: inherit;
  background: var(--module-bg);
  transition:
    border-color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.dash-module-row:hover {
  border-color: rgba(232, 163, 23, 0.45);
  transform: translateY(-1px);
}

.dash-module-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.dash-module-count {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.dash-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.dash-link-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  text-decoration: none;
  color: inherit;
  background: var(--module-bg);
  transition:
    border-color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.dash-link-card:hover {
  border-color: rgba(26, 168, 160, 0.4);
  transform: translateY(-1px);
}

.dash-link-card strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--brand);
}

.dash-link-card span {
  color: var(--muted);
  font-size: 0.78rem;
}

.latency-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 1rem;
  margin-top: 0.85rem;
}

@media (max-width: 960px) {
  .latency-layout {
    grid-template-columns: 1fr;
  }
}

.latency-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.latency-side .panel-head h3 {
  margin: 0;
  font-size: 1rem;
}

.latency-target-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 70vh;
  overflow: auto;
}

.latency-group-title {
  margin: 0.55rem 0 0.2rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.latency-group-title:first-child {
  margin-top: 0;
}

.latency-target {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--module-bg);
  color: inherit;
  font: inherit;
  text-align: left;
  border-radius: calc(var(--radius) - 2px);
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.latency-target:hover,
.latency-target:focus-visible {
  border-color: rgba(26, 168, 160, 0.45);
  outline: none;
}

.latency-target.is-active {
  border-color: rgba(232, 163, 23, 0.5);
  background: rgba(232, 163, 23, 0.1);
}

.latency-target-name {
  font-weight: 700;
  font-size: 0.92rem;
}

.latency-target-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.latency-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0 0 0.85rem;
}

.latency-kpis .stat {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  background: var(--module-bg);
}

.latency-kpis .stat-value {
  font-size: 1.35rem;
}

.smokeping-frame {
  display: none;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
}

.chart-panel--wide {
  grid-column: 1 / -1;
}

@media (max-width: 980px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }

  .chart-panel--wide {
    grid-column: auto;
  }

  .chart-summary {
    margin-left: 0;
    width: 100%;
  }
}

.chart-panel {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.04), transparent 45%),
    var(--panel);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  padding: 0.95rem 1rem 1.05rem;
  transition:
    transform 0.25s var(--ease),
    border-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.chart-panel:hover {
  border-color: rgba(26, 168, 160, 0.35);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

[data-theme="light"] .chart-panel {
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.95), rgba(238, 242, 246, 0.55)),
    var(--panel);
}

.chart-panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.chart-panel__head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.chart-panel__hint {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chart-canvas-wrap {
  position: relative;
  height: 210px;
  width: 100%;
}

.chart-canvas-wrap--tall {
  height: 240px;
}

.chart-canvas-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  padding: 1rem;
}

.map-bars {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.25rem 0;
}

.map-bar-row {
  display: grid;
  grid-template-columns: minmax(7.5rem, 0.9fr) minmax(0, 1.6fr) auto;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  animation: mapRowIn 0.45s var(--ease) both;
  animation-delay: var(--bar-delay, 0ms);
}

@keyframes mapRowIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.map-bar-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.map-bar-flag {
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.map-bar-track {
  height: 0.7rem;
  border-radius: 999px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  overflow: hidden;
}

.map-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-2), var(--brand), var(--brand-3));
  box-shadow: 0 0 12px var(--glow-teal);
  transition: width 0.7s var(--ease);
  min-width: 2px;
}

.map-bar-count,
.map-bar-row .map-bar-value {
  min-width: 1.75rem;
  text-align: right;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .map-bar-row {
    grid-template-columns: minmax(5.5rem, 0.85fr) minmax(0, 1fr) auto;
    gap: 0.5rem;
  }

  .chart-canvas-wrap,
  .chart-canvas-wrap--tall {
    height: 200px;
  }
}

.modules-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.modules-table th,
.modules-table td {
  padding: 0.72rem 0.85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  text-align: left;
}

.modules-table thead th {
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  background: var(--table-head);
  white-space: nowrap;
}

.modules-table tbody tr:nth-of-type(odd) td {
  background: var(--table-stripe);
}

.modules-table tbody tr:hover td {
  background: var(--table-hover);
}

.module-meta {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.35;
}

.modules-table td.module-desc-cell,
.modules-table td.module-desc-cell * {
  text-align: left !important;
  font-size: inherit;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  margin: 0;
  white-space: normal;
  max-width: 22rem;
}

.dtmf,
.tg-code {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  background: var(--code-bg);
  color: var(--code-text);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.tg-code {
  background: linear-gradient(135deg, rgba(26, 168, 160, 0.14), rgba(232, 163, 23, 0.1));
  border-color: var(--badge-border);
  color: var(--badge-text);
}

[data-theme="light"] .tg-code {
  background: linear-gradient(135deg, rgba(15, 143, 136, 0.1), rgba(200, 135, 10, 0.08));
}

/* —— Empty states · densità tabelle · ingresso righe —— */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.35rem 1rem;
  text-align: center;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
  max-width: 28rem;
}

.empty-state__hint {
  font-size: 0.85rem !important;
  opacity: 0.9;
}

.empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.empty-state--compact {
  padding: 0.85rem 0.5rem;
}

.empty-state--compact p {
  font-size: 0.88rem;
}

.table tbody tr.row-enter > td {
  animation: rowEnter 0.35s var(--ease);
}

@keyframes rowEnter {
  from {
    opacity: 0;
    transform: translateX(-5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 720px) {
  .col-hide-sm {
    display: none !important;
  }
}

@media (max-width: 980px) {
  .col-hide-md {
    display: none !important;
  }
}

/* —— Reduced motion —— */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .brand-logo {
    box-shadow:
      0 0 0 1.5px var(--glow-amber),
      0 8px 22px rgba(0, 0, 0, 0.28);
  }

  .stat:hover,
  .module-card:hover,
  .contact-item:hover,
  .FilterSubmit:hover,
  .btn:hover {
    transform: none;
  }
}
