/* ==========================================================================
   Traccia — design system (base)
   Edit tokens here; everything else inherits.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* colour */
  --ink: #0b0b0f;
  --ink-soft: #2a2a33;
  --muted: #6c6c78;
  --line: #e7e7ec;
  --line-soft: #f1f1f4;
  --bg: #ffffff;
  --bg-soft: #f7f7f5;
  --bg-dark: #0b0b0f;

  --accent: #0e6b47;
  --accent-ink: #0a5236;
  --accent-wash: #e8f3ee;
  --accent-lime: #c8f169;

  /* semantic (market + status) */
  --up: #0e6b47;
  --up-wash: #e8f3ee;
  --down: #c2334d;
  --down-wash: #fdecef;
  --warn: #a3660b;
  --warn-wash: #fdf3e2;
  --info: #1f4fa8;
  --info-wash: #eaf0fb;

  /* type */
  --font: "Inter", "Helvetica Neue", Helvetica, Arial, system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;
  --font-num: "SF Mono", ui-monospace, "Roboto Mono", Menlo, monospace;

  --fs-display: clamp(2.65rem, 7vw, 5.25rem);
  --fs-h1: clamp(2.2rem, 4.6vw, 3.6rem);
  --fs-h2: clamp(1.85rem, 3.6vw, 2.85rem);
  --fs-h3: clamp(1.2rem, 1.8vw, 1.45rem);
  --fs-lead: clamp(1.05rem, 1.5vw, 1.28rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-xs: 0.775rem;

  /* space */
  --gap: 1.25rem;
  --section-y: clamp(4rem, 9vw, 7.5rem);
  --container: 1200px;
  --pad-x: clamp(1.25rem, 4vw, 2.5rem);

  /* shape */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(11, 11, 15, 0.05), 0 1px 1px rgba(11, 11, 15, 0.04);
  --shadow-md: 0 4px 12px rgba(11, 11, 15, 0.06), 0 12px 32px rgba(11, 11, 15, 0.06);
  --shadow-lg: 0 8px 24px rgba(11, 11, 15, 0.08), 0 32px 72px rgba(11, 11, 15, 0.1);
  --ring: 0 0 0 1px rgba(11, 11, 15, 0.06);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.35s;

  --header-h: 76px;
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* the hidden attribute must always win over display rules set on classes */
[hidden] { display: none !important; }

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--accent-lime); color: var(--ink); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.container--narrow { max-width: 820px; }
.container--wide { max-width: 1360px; }

.section { padding-block: var(--section-y); }
.section--soft { background: var(--bg-soft); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--dark { background: var(--bg-dark); color: #fff; }
.section--dark .eyebrow { color: var(--accent-lime); }
.section--dark .lead,
.section--dark p { color: rgba(255, 255, 255, 0.72); }

.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.split--reverse .split__visual { order: -1; }

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split--reverse .split__visual { order: 0; }
}

/* --------------------------------------------------------------------------
   4. Typography
   -------------------------------------------------------------------------- */
.display {
  font-size: var(--fs-display);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 600;
}

.h1 {
  font-size: var(--fs-h1);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.h2 {
  font-size: var(--fs-h2);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 600;
}

.h3 {
  font-size: var(--fs-h3);
  line-height: 1.3;
  letter-spacing: -0.015em;
  font-weight: 600;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--muted);
  letter-spacing: -0.01em;
}

.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.muted { color: var(--muted); }
.small { font-size: var(--fs-small); }
.xs { font-size: var(--fs-xs); line-height: 1.5; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.accent { color: var(--accent); }
.balance { text-wrap: balance; }
.nowrap { white-space: nowrap; }

.stack > * + * { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 1.75rem; }

/* fine print, risk disclosures etc. */
.disclaimer {
  font-size: var(--fs-xs);
  line-height: 1.55;
  color: var(--muted);
  max-width: 62ch;
}

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.6rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease),
    box-shadow 0.2s var(--ease), color 0.2s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

.btn--accent { --btn-bg: var(--accent); }
.btn--accent:hover { --btn-bg: var(--accent-ink); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover { --btn-bg: var(--bg-soft); border-color: #d4d4dc; }

.btn--light { --btn-bg: #fff; --btn-fg: var(--ink); }
.btn--on-dark { --btn-bg: #fff; --btn-fg: var(--ink); }

.btn--lg { padding: 1.1rem 2rem; font-size: 1rem; }
.btn--block { width: 100%; }
.btn--sm { padding: 0.62rem 1.05rem; font-size: 0.82rem; min-height: 38px; }

/* focus visibile e coerente ovunque (accessibilita' + rifinitura) */
.btn:focus-visible,
.chip:focus-visible,
.nav-user__exit:focus-visible,
.nav-user__link:focus-visible,
.app-side a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--accent);
}
.link-arrow svg { transition: transform 0.2s var(--ease); }
.link-arrow:hover svg { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   6. Header / navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(255, 255, 255, 0.94);
}

.nav {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.brand__mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--accent-lime);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  font-weight: 700;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-inline-start: auto;
}
.nav-link {
  padding: 0.55rem 0.85rem;
  border-radius: var(--r-pill);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink-soft);
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.nav-link:hover { background: var(--bg-soft); }
.nav-link.is-active { color: var(--ink); font-weight: 600; }

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-inline-start: 0.75rem;
}

/* --- comandi utente: pillola compatta, una sola riga ------------------- */
.nav__actions { margin-inline-start: 0.9rem; }

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.28rem 0.3rem 0.28rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: #fff;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.nav-user__link {
  padding: 0.42rem 0.7rem;
  border-radius: var(--r-pill);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.nav-user__link:hover { background: var(--bg-soft); color: var(--ink); }
.nav-user__link--admin {
  background: var(--ink);
  color: #fff;
}
.nav-user__link--admin:hover { background: var(--ink-soft); color: #fff; }

.nav-user__id {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.55rem 0 0.35rem;
  border-left: 1px solid var(--line);
  margin-left: 0.2rem;
}

.nav-user__avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-wash);
  color: var(--accent-ink);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  flex: none;
}

.nav-user__name {
  max-width: 9.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

.nav-user__exit {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.7rem;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.nav-user__exit:hover { background: var(--down-wash); color: var(--down); }

[data-auth-slot] [hidden] { display: none !important; }

/* su tablet stretto il nome lascia spazio al resto */
@media (max-width: 1180px) {
  .nav-user__name { display: none; }
  .nav-user__id { border-left: 0; margin-left: 0; padding-right: 0.2rem; }
}


.nav__toggle {
  display: none;
  margin-inline-start: auto;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  border-radius: var(--r-pill);
  cursor: pointer;
}
.nav__toggle:hover { background: var(--bg-soft); }
.nav__toggle span {
  display: block;
  width: 20px;
  height: 1.75px;
  background: var(--ink);
  border-radius: 2px;
  position: relative;
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}
.nav__toggle span::before,
.nav__toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 1.75px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s var(--ease);
}
.nav__toggle span::before { top: -6px; }
.nav__toggle span::after { top: 6px; }
.nav__toggle[aria-expanded="true"] span { transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(-90deg); }
.nav__toggle[aria-expanded="true"] span::after { opacity: 0; }

@media (max-width: 1360px) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 1rem var(--pad-x) 1.5rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease),
      visibility 0.2s;
  }
  .nav__links.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .nav-link { padding: 0.9rem 0.5rem; font-size: 1rem; }
  .nav__actions { margin: 0.5rem 0 0; flex-direction: column; gap: 0.5rem; }
  .nav__actions .btn { width: 100%; }
  .nav__user { display: none; }
  body.nav-open { overflow: hidden; }
}

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */
.hero {
  padding-block: clamp(3rem, 7vw, 6rem) clamp(3rem, 8vw, 6.5rem);
  position: relative;
  overflow: hidden;
}
.hero--soft { background: var(--bg-soft); }

.hero__inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 940px) {
  .hero__inner { grid-template-columns: 1fr; }
}

.hero__title { max-width: 15ch; }

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: #fff;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}
.hero__badge b {
  background: var(--accent-wash);
  color: var(--accent-ink);
  padding: 0.15rem 0.5rem;
  border-radius: var(--r-pill);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* device mockup ---------------------------------------------------------- */
.device {
  position: relative;
  width: min(340px, 82vw);
  margin-inline: auto;
  aspect-ratio: 340 / 690;
  border-radius: 46px;
  background: #101014;
  padding: 11px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}
.device__screen {
  height: 100%;
  border-radius: 36px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.device__notch {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 92px;
  height: 22px;
  border-radius: var(--r-pill);
  background: #101014;
  z-index: 3;
}
.device__body {
  padding: 44px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
}

.app-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
}
.app-top strong { color: var(--ink); font-size: 0.8rem; }

.app-balance { }
.app-balance__label { font-size: 0.7rem; color: var(--muted); letter-spacing: 0.02em; }
.app-balance__value {
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.app-balance__delta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-wash);
  padding: 0.15rem 0.45rem;
  border-radius: var(--r-pill);
  margin-top: 0.35rem;
}

.app-spark { height: 74px; border-radius: var(--r-sm); overflow: hidden; }

.app-rows { display: flex; flex-direction: column; gap: 9px; overflow: hidden; }
.app-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-radius: var(--r-sm);
  background: var(--bg-soft);
}
.app-row__icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.app-row__meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.app-row__meta span:first-child {
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-row__meta span:last-child { font-size: 0.66rem; color: var(--muted); }
.app-row__val {
  margin-inline-start: auto;
  text-align: right;
  font-size: 0.7rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.app-row__val small { display: block; font-size: 0.6rem; font-weight: 500; }

.app-tabbar {
  margin-top: auto;
  display: flex;
  justify-content: space-around;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.55rem;
  color: var(--muted);
  text-align: center;
}
.app-tabbar span { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.app-tabbar i {
  width: 16px; height: 16px; border-radius: 5px; background: var(--line);
  display: block;
}
.app-tabbar span:first-child { color: var(--ink); font-weight: 600; }
.app-tabbar span:first-child i { background: var(--ink); }

/* floating chips around the device */
.device-wrap { position: relative; display: grid; place-items: center; }
.device-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.9rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-md);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  animation: float 7s var(--ease) infinite;
}
.device-chip small { display: block; font-weight: 500; color: var(--muted); font-size: 0.66rem; }
.device-chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.device-chip--a { top: 14%; left: -6%; }
.device-chip--b { bottom: 20%; right: -8%; animation-delay: -3.5s; }
@media (max-width: 1100px) {
  .device-chip--a { left: 0; }
  .device-chip--b { right: 0; }
}
@media (max-width: 520px) {
  .device-chip { display: none; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@media (prefers-reduced-motion: reduce) {
  .device-chip { animation: none; }
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* --------------------------------------------------------------------------
   8. Marquee / logo row
   -------------------------------------------------------------------------- */
.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  opacity: 0.62;
}
.logo-row span {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   9. Feature / card components
   -------------------------------------------------------------------------- */
.feature-list { display: flex; flex-direction: column; gap: 1.5rem; }
.feature-list li {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}
.feature-list svg { flex-shrink: 0; margin-top: 0.2rem; color: var(--accent); }
.feature-list strong { display: block; font-weight: 600; letter-spacing: -0.01em; }
.feature-list p { color: var(--muted); font-size: var(--fs-small); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(1.4rem, 3vw, 2rem);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    border-color 0.25s var(--ease);
}
.card--hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #dcdce4;
}
.card--soft { background: var(--bg-soft); border-color: transparent; }
.card--dark { background: var(--ink); color: #fff; border-color: transparent; }
.card--dark p { color: rgba(255, 255, 255, 0.7); }
.card--plain { background: transparent; border: 0; padding: 0; }

.card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-wash);
  color: var(--accent-ink);
  margin-bottom: 1.1rem;
}

/* metric / stat blocks */
.metric { }
.metric__value {
  font-size: clamp(2.1rem, 4.2vw, 3.1rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.metric__label {
  margin-top: 0.6rem;
  font-size: var(--fs-small);
  color: var(--muted);
  max-width: 26ch;
}
.section--dark .metric__label { color: rgba(255, 255, 255, 0.62); }

/* stat strip */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line);
}
.stat-strip > div {
  background: #fff;
  padding: clamp(1.25rem, 3vw, 1.75rem);
}
.stat-strip dt { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.stat-strip dd {
  margin: 0.45rem 0 0;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

/* pricing / plan cards */
.plan {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
}
.plan__price {
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}
.plan__price small { font-size: 0.9rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan ul { display: flex; flex-direction: column; gap: 0.6rem; font-size: var(--fs-small); }
.plan li { display: flex; gap: 0.55rem; }
.plan li::before { content: "✓"; color: var(--accent); font-weight: 700; }
.plan__footer { margin-top: auto; padding-top: 0.5rem; }

/* --------------------------------------------------------------------------
   10. FAQ
   -------------------------------------------------------------------------- */
.faq { border-top: 1px solid var(--line); }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.1rem, 2.5vw, 1.6rem) 0;
  cursor: pointer;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  transition: transform 0.25s var(--ease), background 0.2s var(--ease);
  position: relative;
}
.faq__icon::before,
.faq__icon::after {
  content: "";
  position: absolute;
  background: var(--ink);
  border-radius: 2px;
}
.faq__icon::before { width: 11px; height: 1.5px; }
.faq__icon::after { width: 1.5px; height: 11px; transition: transform 0.25s var(--ease); }
.faq__item[open] .faq__icon { background: var(--ink); transform: rotate(180deg); }
.faq__item[open] .faq__icon::before,
.faq__item[open] .faq__icon::after { background: #fff; }
.faq__item[open] .faq__icon::after { transform: scaleY(0); }
.faq__answer {
  padding-bottom: 1.5rem;
  max-width: 70ch;
  color: var(--muted);
}
.faq__answer p + p { margin-top: 0.75rem; }

/* --------------------------------------------------------------------------
   11. CTA band
   -------------------------------------------------------------------------- */
.cta-band {
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-xl);
  padding: clamp(2.25rem, 6vw, 4.5rem);
  position: relative;
  overflow: hidden;
}
.cta-band::after {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  right: -160px;
  top: -180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 241, 105, 0.22), transparent 70%);
  pointer-events: none;
}
.cta-band__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
@media (max-width: 820px) { .cta-band__inner { grid-template-columns: 1fr; } }
.cta-band p { color: rgba(255, 255, 255, 0.7); }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.1rem;
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink);
  font-size: var(--fs-xs);
  line-height: 1.15;
  font-weight: 600;
  transition: transform 0.2s var(--ease);
}
.store-badge:hover { transform: translateY(-2px); }
.store-badge small { display: block; font-weight: 500; font-size: 0.62rem; opacity: 0.6; letter-spacing: 0.02em; }

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding-block: clamp(2.5rem, 5vw, 4rem) 2rem;
  font-size: var(--fs-small);
}
.footer__top {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-bottom: 2.5rem;
}
@media (max-width: 860px) {
  .footer__top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .footer__top { grid-template-columns: 1fr; }
}
.footer__col h4 {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.9rem;
  font-weight: 600;
}
.footer__col ul { display: flex; flex-direction: column; gap: 0.55rem; }
.footer__col a:hover { color: var(--accent); }

.footer__legal {
  border-top: 1px solid var(--line);
  padding-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.6;
}
.footer__legal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
  justify-content: space-between;
}
.footer__disclaimer { max-width: 92ch; }

/* cookie banner */
.cookie-bar {
  position: fixed;
  z-index: 150;
  right: 1.25rem;
  bottom: 1.25rem;
  left: auto;
  transform: translateY(160%);
  width: min(430px, calc(100% - 2rem));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  font-size: 0.78rem;
  line-height: 1.55;
  transition: transform 0.45s var(--ease), opacity 0.3s var(--ease);
  opacity: 0;
}

.cookie-bar.is-visible { transform: translateY(0); opacity: 1; }

.cookie-bar__actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}
.cookie-bar__actions .btn { padding: 0.55rem 0.95rem; font-size: 0.78rem; min-height: 36px; }
@media (max-width: 560px) {
  .cookie-bar { right: 0.75rem; left: 0.75rem; width: auto; bottom: 0.75rem; }
}
.cookie-bar .btn {
  padding: 0.5rem 0.9rem;
  font-size: 0.72rem;
  border-radius: var(--r-pill);
}

/* --------------------------------------------------------------------------
   13. Inner pages (legal, support)
   -------------------------------------------------------------------------- */
.page-head {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--line);
}
.page-head__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 1.25rem;
  font-size: var(--fs-xs);
  color: var(--muted);
}

.prose { max-width: 72ch; }
.prose > * + * { margin-top: 1.1rem; }
.prose h2 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  margin-top: 2.5rem;
  font-weight: 600;
}
.prose h3 { font-size: 1.05rem; font-weight: 600; margin-top: 1.75rem; }
.prose p, .prose li { color: var(--ink-soft); line-height: 1.7; }
.prose ul { list-style: disc; padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.prose ol { list-style: decimal; padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.prose th, .prose td { text-align: left; padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; }

.toc {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 1.25rem 1.4rem;
  background: var(--bg-soft);
  font-size: var(--fs-small);
}
.toc h3 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 0.75rem; }
.toc ol { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.toc a:hover { color: var(--accent); }

/* forms */
.form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-size: var(--fs-small); font-weight: 600; }
.field input,
.field select,
.field textarea {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  font-size: 0.95rem;              /* 16px+: niente zoom automatico su iOS */
  min-height: 46px;
  color: var(--ink);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease),
    background 0.18s var(--ease);
}
.field input::placeholder,
.field textarea::placeholder { color: #a2a2ad; }
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: #d6d6de; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 107, 71, 0.12);
  background: #fff;
}
.field textarea { resize: vertical; min-height: 130px; }
.field__hint { font-size: var(--fs-xs); color: var(--muted); }
.field--check { flex-direction: row; align-items: flex-start; gap: 0.6rem; }
.field--check input { margin-top: 0.25rem; }
.form__note { font-size: var(--fs-xs); color: var(--muted); }

/* 404 */
.error-page {
  min-height: 62vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: var(--section-y);
}
.error-page__code {
  font-size: clamp(5rem, 18vw, 11rem);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 0.85;
  color: var(--line);
}

/* --------------------------------------------------------------------------
   14. Utilities & motion
   -------------------------------------------------------------------------- */
/* ---------------------------------------------------------------- motion --
   Sistema di animazione all'ingresso nel viewport.
   Default: contenuto visibile. Solo `html.js-anim` (aggiunta da anim.js)
   abilita gli stati iniziali nascosti, così uno script bloccato o JS
   disattivato non lasciano mai la pagina vuota.
   ------------------------------------------------------------------------- */

@keyframes reveal-up {
  from { opacity: 0; transform: translate3d(0, 22px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes reveal-left {
  from { opacity: 0; transform: translate3d(-26px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes reveal-right {
  from { opacity: 0; transform: translate3d(26px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes reveal-scale {
  from { opacity: 0; transform: scale(0.955); }
  to   { opacity: 1; transform: scale(1); }
}

/* stato iniziale: solo con JS attivo */
html.js-anim .reveal,
html.js-anim [data-reveal] {
  opacity: 0;
  will-change: opacity, transform;
}

/* stato finale: animazione fluida, con piccola attesa per il ritmo */
html.js-anim .reveal.is-visible,
html.js-anim [data-reveal].is-visible {
  opacity: 1;
  animation: reveal-up 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--reveal-delay, 0ms);
}

/* varianti direzionali */
html.js-anim .reveal--left.is-visible,
html.js-anim [data-reveal="left"].is-visible { animation-name: reveal-left; }
html.js-anim .reveal--right.is-visible,
html.js-anim [data-reveal="right"].is-visible { animation-name: reveal-right; }
html.js-anim .reveal--scale.is-visible,
html.js-anim [data-reveal="scale"].is-visible { animation-name: reveal-scale; }

/* a fine animazione tolgo will-change: non deve restare appeso */
html.js-anim .reveal.is-visible,
html.js-anim [data-reveal].is-visible { will-change: auto; }

/* senza JS restano visibili */
.reveal, [data-reveal] { opacity: 1; }

html.no-anim .reveal,
html.no-anim [data-reveal] { opacity: 1 !important; animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  html.js-anim .reveal,
  html.js-anim [data-reveal] { opacity: 1 !important; animation: none !important; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.text-center { text-align: center; }.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }
.pt-4 { padding-top: 2rem; }
.mb-4 { margin-bottom: 2rem; }
.hr { height: 1px; background: var(--line); border: 0; margin-block: 2rem; }
.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;
}

/* --------------------------------------------------------------------------
   15. Media slots — drop-in image with graceful branded fallback
   Set "hero_image" (or pass a src) in site.config.json / page markup and the
   <img> takes over automatically. Otherwise the placeholder stays.
   -------------------------------------------------------------------------- */
.media {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-lg);
  overflow: hidden;
  background:
    radial-gradient(120% 100% at 15% 0%, rgba(14, 107, 71, 0.14), transparent 60%),
    radial-gradient(90% 90% at 100% 100%, rgba(200, 241, 105, 0.35), transparent 65%),
    var(--bg-soft);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  isolation: isolate;
}
.media--wide { aspect-ratio: 16 / 10; }
.media--tall { aspect-ratio: 3 / 4; }
.media--square { aspect-ratio: 1 / 1; }

.media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
}
.media img[hidden] { display: none; }

.media__ph {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.5rem;
  justify-items: center;
  padding: 1.5rem;
  text-align: center;
  color: var(--ink-soft);
}
.media__ph .brand__mark { width: 38px; height: 38px; border-radius: 11px; font-size: 1.1rem; }
.media__ph span { font-size: var(--fs-xs); color: var(--muted); max-width: 28ch; }
.media__ph strong { font-size: var(--fs-small); font-weight: 600; }

/* --------------------------------------------------------------------------
   16. Markets — crypto list, ticker, deltas
   -------------------------------------------------------------------------- */
.coin {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  flex-shrink: 0;
}
.coin--lg { width: 42px; height: 42px; font-size: 0.82rem; }

.delta {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0.15rem 0.45rem;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.delta.is-up { color: var(--up); background: var(--up-wash); }
.delta.is-down { color: var(--down); background: var(--down-wash); }

.market-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.market-legend { display: flex; gap: 0.75rem; }

.market-table {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #fff;
}
.market-table table { width: 100%; border-collapse: collapse; }
.market-table thead th {
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  white-space: nowrap;
}
.market-table tbody td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-small);
  vertical-align: middle;
}
.market-table tbody tr:last-child td { border-bottom: 0; }
.market-table tbody tr { transition: background 0.15s var(--ease); }
.market-table tbody tr:hover { background: var(--bg-soft); }
.market-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.market-table thead th:nth-child(2),
.market-table thead th:nth-child(4) { text-align: right; }

.market-name { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.market-name strong { display: block; font-weight: 600; letter-spacing: -0.01em; }
.market-name span { display: block; font-size: var(--fs-xs); color: var(--muted); }
.market-action { text-align: right; }

.btn--sm { padding: 0.6rem 1rem; font-size: 0.82rem; min-height: 38px; }

@media (max-width: 720px) {
  .market-table { border-radius: var(--r-md); }
  .market-table thead th:nth-child(4),
  .market-table tbody td:nth-child(4) { display: none; }
  .market-table thead th,
  .market-table tbody td { padding: 0.7rem 0.75rem; }
  .market-name strong { font-size: var(--fs-small); }
}

/* ticker strip */
.ticker {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}
.ticker::-webkit-scrollbar { display: none; }
.ticker li {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: #fff;
  white-space: nowrap;
  font-size: var(--fs-xs);
}
.ticker__sym { font-weight: 700; letter-spacing: 0.02em; }

/* crypto hero card */
.crypto-hero {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: var(--shadow-md);
}
.crypto-hero__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.crypto-hero__label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.crypto-hero__value { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 600; letter-spacing: -0.04em; margin-top: 0.5rem; }
.crypto-hero__bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 92px;
  margin: 1.25rem 0;
}
.crypto-hero__bars span {
  flex: 1;
  height: var(--h);
  border-radius: 4px 4px 2px 2px;
  opacity: 0.9;
}
.crypto-hero__split { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.crypto-hero__chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  font-size: var(--fs-xs);
}
.crypto-hero__chip .coin { width: 26px; height: 26px; font-size: 0.68rem; }
.crypto-hero__chip strong { display: block; font-weight: 600; }
.crypto-hero__chip span { color: var(--muted); }

/* --------------------------------------------------------------------------
   17. Product app + admin console
   -------------------------------------------------------------------------- */
.auth-shell {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 4vw, 3rem) var(--pad-x);
  background:
    radial-gradient(80% 60% at 15% 0%, rgba(14, 107, 71, 0.10), transparent 60%),
    radial-gradient(70% 60% at 100% 100%, rgba(200, 241, 105, 0.14), transparent 60%),
    var(--bg-soft);
}

.auth-layout {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: stretch;
}
@media (max-width: 920px) {
  .auth-layout { grid-template-columns: 1fr; max-width: 520px; }
  .auth-aside { display: none; }
}

/* colonna informativa: pannello scuro premium */
.auth-aside {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: clamp(1.75rem, 3vw, 2.6rem);
  background:
    radial-gradient(120% 100% at 0% 0%, #17322a 0%, transparent 55%),
    var(--ink);
  color: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.auth-aside::after {
  content: "";
  position: absolute;
  right: -18%;
  bottom: -26%;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 241, 105, 0.16), transparent 68%);
  pointer-events: none;
}
.auth-aside__title {
  font-size: clamp(1.7rem, 2.6vw, 2.15rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin-top: 0.35rem;
  color: #fff;
}
.auth-aside__lead {
  margin-top: 0.9rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  max-width: 30ch;
}
.auth-points {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.auth-points li { display: flex; gap: 0.75rem; align-items: flex-start; }
.auth-points__icon {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.09);
  color: var(--accent-lime);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.auth-points strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: #fff;
}
.auth-points span {
  display: block;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.58);
  margin-top: 0.1rem;
}
.auth-aside__foot {
  margin-top: auto;
  padding-top: 1.75rem;
  font-size: 0.68rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.42);
  position: relative;
  z-index: 1;
}

/* colonna form */
.auth-card {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: clamp(1.5rem, 3vw, 2.35rem);
  display: flex;
  flex-direction: column;
}
.auth-card__head h1 {
  font-size: clamp(1.5rem, 2.4vw, 1.85rem);
  letter-spacing: -0.035em;
}
.auth-card__head p { margin-top: 0.35rem; }
.auth-card .form { gap: 0.9rem; }

.auth-switch {
  margin-top: 1.1rem;
  font-size: var(--fs-small);
  color: var(--muted);
  text-align: center;
}
.auth-switch a { color: var(--accent); font-weight: 600; }

/* app layout */
.app-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: calc(100vh - var(--header-h));
  background: var(--bg-soft);
}
.app-side {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.app-side__label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 0.75rem 0.75rem 0.4rem;
}
.app-side a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--r-sm);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink-soft);
}
.app-side a {
  position: relative;
  transition: background 0.16s var(--ease), color 0.16s var(--ease),
    padding-left 0.16s var(--ease);
}
.app-side a:hover { background: var(--bg-soft); padding-left: 0.95rem; }
.app-side a.is-active {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.app-side a.is-active::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  border-radius: 2px;
  background: var(--accent-lime);
}
.app-side__foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); }
.app-side .user-mini {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.5rem;
  font-size: var(--fs-xs);
}
.user-mini__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-wash); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 0.75rem;
}
.user-mini strong { display: block; }
.user-mini span { color: var(--muted); }

.app-main { padding: clamp(1.25rem, 3vw, 2.25rem); max-width: 1180px; }
.app-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.app-head h1 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); letter-spacing: -0.03em; }

.app-grid { display: grid; gap: 1rem; }
@media (min-width: 900px) { .app-grid--stats { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .app-grid--2 { grid-template-columns: 1.35fr 1fr; } }

/* riepilogo conto: pannello unico con divisori, non quattro card sparse */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
@media (max-width: 860px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-strip .stat-card:nth-child(3) { border-left: 0; }
  .stat-strip .stat-card:nth-child(n + 3) { border-top: 1px solid var(--line-soft); }
}

.stat-card {
  padding: 1.15rem 1.35rem;
  position: relative;
}
.stat-strip .stat-card + .stat-card { border-left: 1px solid var(--line-soft); }

.stat-card__label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--fs-xs);
  color: var(--muted);
  font-weight: 500;
}
.stat-card__label svg { opacity: 0.55; }

.stat-card__value {
  font-size: clamp(1.35rem, 2vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  margin-top: 0.45rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* la cifra principale ha il risalto che merita */
.stat-card--hero { background: linear-gradient(180deg, rgba(14, 107, 71, 0.05), transparent 75%); }
.stat-card--hero .stat-card__value { color: var(--accent-ink); }

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.panel__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.panel__head h2 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.panel__body { padding: 1.25rem; }
.panel__body--flush { padding: 0; }

/* status pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--r-pill);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.pill::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.pill--pending { color: var(--warn); background: var(--warn-wash); }
.pill--active, .pill--approved { color: var(--up); background: var(--up-wash); }
.pill--denied, .pill--suspended { color: var(--down); background: var(--down-wash); }
.pill--cancelled { color: var(--muted); background: var(--line-soft); }
.pill--master { color: var(--info); background: var(--info-wash); }
.pill--admin { color: var(--ink); background: var(--line-soft); }

/* data table */
.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.data-table th {
  text-align: left;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  padding: 0.7rem 1.25rem;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  color: var(--ink-soft);
}
.data-table td strong { color: var(--ink); font-weight: 600; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background 0.15s var(--ease); }
.data-table tbody tr:hover { background: #fbfbfc; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* date e orari restano su una riga: "29 ott, 21:13" non va a capo */
.data-table td:first-child { white-space: nowrap; }
.data-table td:first-child time,
.audit-item time { font-variant-numeric: tabular-nums; }

/* le azioni restano su una riga: niente pulsanti impilati */
.data-table__actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

/* bottoni dentro le tabelle: piu' piccoli e allineati */
.data-table .btn--sm {
  padding: 0.5rem 0.9rem;
  font-size: 0.78rem;
  min-height: 34px;
}

.table-scroll { overflow-x: auto; }
.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}
.empty-state {
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-small);
}

/* filter chips */
.filters { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--r-pill);
  padding: 0.4rem 0.85rem;
  font-size: var(--fs-xs);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.chip:hover { background: var(--bg-soft); }
.chip.is-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.chip:active { transform: translateY(1px); }
.chip__count { opacity: 0.65; margin-left: 0.3rem; }

/* action buttons inside tables */
.btn--approve { --btn-bg: var(--up); --btn-fg: #fff; }
.btn--deny { --btn-bg: transparent; --btn-fg: var(--down); border-color: #f2c9d1; }
.btn--deny:hover { --btn-bg: var(--down-wash); }

/* toast + modal */
.toast-stack {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(360px, calc(100% - 2rem));
}
.toast {
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-md);
  padding: 0.85rem 1rem;
  font-size: var(--fs-small);
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.28s var(--ease);
}
.toast--error { background: #7d1f32; }
.toast--success { background: var(--accent-ink); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(11, 11, 15, 0.45);
  display: grid;
  place-items: center;
  padding: 1.25rem;
}
.modal {
  width: min(440px, 100%);
  background: #fff;
  border-radius: var(--r-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}
.modal h3 { font-size: 1.1rem; letter-spacing: -0.02em; }
.modal p { color: var(--muted); font-size: var(--fs-small); margin-top: 0.5rem; }
.modal .btn-row { margin-top: 1.25rem; justify-content: flex-end; }

@media (max-width: 860px) {
  /* minmax(0,1fr): con "1fr" la traccia cresce fino alla larghezza del
     contenuto e la barra orizzontale dei link sfora la pagina */
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .app-side {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    overflow-x: auto;
    padding: 0.75rem;
    gap: 0.35rem;
  }
  .app-side__label, .app-side__foot { display: none; }
  .app-side a { white-space: nowrap; }
}

/* inline "summary" rows used in the admin overview */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.75rem;
}
.summary-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 1.1rem 1.2rem 1.15rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.summary-card:hover { box-shadow: var(--shadow-md); }

.summary-card__value {
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.summary-card__label {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: 0.35rem;
  line-height: 1.35;
}

/* attenzione: solo un filetto colorato, non tutta la card */
.summary-card--alert {
  border-color: var(--line);
  background: #fff;
}
.summary-card--alert::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--warn);
}
.summary-card--alert .summary-card__value { color: var(--ink); }
.summary-card--alert.has-items::before { background: var(--warn); }
.summary-card--alert:not(.has-items)::before { background: var(--line); }

/* card "sana" (nessuna richiesta in attesa): verde tenue */
.summary-card--alert.is-zero {
  background: linear-gradient(180deg, rgba(14, 107, 71, 0.035), transparent 70%);
}
.summary-card--alert.is-zero::before { background: var(--accent); }

.audit-list { display: flex; flex-direction: column; }
.audit-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-xs);
  align-items: baseline;
}
.audit-item:last-child { border-bottom: 0; }
.audit-item__action { font-weight: 600; }
.audit-item time { color: var(--muted); margin-left: auto; white-space: nowrap; }

/* --------------------------------------------------------------------------
   18. Limiti, KYC, wallet e impostazioni
   -------------------------------------------------------------------------- */
.summary-grid--5 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.limit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.75rem;
}
.limit-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 1rem 1.05rem;
  background: #fff;
  transition: box-shadow 0.2s var(--ease);
}
.limit-card:hover { box-shadow: var(--shadow-sm); }
.limit-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}
.limit-card__head strong {
  font-size: 0.86rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.limit-card__cap {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}
.limit-card__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.limit-card__foot b {
  color: var(--ink-soft);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.limit-card.is-high .limit-bar span { background: var(--warn); }
.limit-card.is-full .limit-bar span { background: var(--down); }
.limit-bar {
  height: 7px;
  border-radius: var(--r-pill);
  background: #e4e4ea;
  overflow: hidden;
  margin-bottom: 0.7rem;
}
.limit-bar span {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--accent);
  transition: width 0.4s var(--ease);
}
.limit-bar span.is-unlimited { background: linear-gradient(90deg, var(--accent), var(--accent-lime)); }

.kyc-select {
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
}

.settings-table th[scope="row"] {
  background: transparent;
  border-bottom: 1px solid var(--line-soft);
  text-transform: none;
  letter-spacing: -0.01em;
  font-size: var(--fs-small);
  color: var(--ink);
  font-weight: 600;
}
.settings-table td { border-bottom: 1px solid var(--line-soft); }
.input-num {
  width: 100%;
  max-width: 130px;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--font-num);
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
  text-align: right;
  background: #fff;
}
.input-num:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 107, 71, 0.12);
}

.settings-toggles { display: flex; flex-direction: column; gap: 0.7rem; }
.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: var(--fs-small);
  cursor: pointer;
  user-select: none;
}
.switch input {
  appearance: none;
  -webkit-appearance: none;
  width: 40px;
  height: 22px;
  border-radius: var(--r-pill);
  background: #d9d9e0;
  position: relative;
  cursor: pointer;
  transition: background 0.2s var(--ease);
  flex-shrink: 0;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease);
}
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.mono { font-family: var(--font-num); word-break: break-all; }

/* compact wallet list on small screens */
@media (max-width: 900px) {
  .settings-table { min-width: 620px; }
}

/* desktop: keep the console navigation in view while scrolling */
@media (min-width: 861px) {
  .app-side {
    position: sticky;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
    align-self: start;
  }
}
/* wallet addresses wrap instead of widening the table */
.data-table td.mono,
.data-table td .mono {
  word-break: break-all;
  max-width: 340px;
}

/* connection diagnostics on the login page */
.api-status {
  margin-top: 1.25rem;
  border: 1px solid #f0d9a8;
  background: var(--warn-wash);
  border-radius: var(--r-md);
  padding: 0.9rem 1rem;
  font-size: var(--fs-xs);
}
.api-status h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--warn);
  margin-bottom: 0.5rem;
  font-weight: 700;
}
.api-status ul { display: flex; flex-direction: column; gap: 0.3rem; }
.api-status li { line-height: 1.45; }
.api-status .is-ok { color: var(--up); font-weight: 700; }
.api-status .is-ko { color: var(--down); font-weight: 700; }
.api-status p { margin-top: 0.6rem; color: var(--ink-soft); }

/* avviso di modalità demo (anteprima senza backend) */
.demo-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.7rem var(--pad-x);
  background: var(--warn-wash);
  border-bottom: 1px solid #f0d9a8;
  color: #6b4708;
  font-size: var(--fs-xs);
  line-height: 1.5;
}
.demo-banner__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--warn); margin-top: 0.35rem; flex-shrink: 0;
  animation: demo-pulse 1.8s ease-in-out infinite;
}
.demo-banner code {
  font-family: var(--font-num);
  background: rgba(0, 0, 0, 0.06);
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
}
@keyframes demo-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-banner__dot { animation: none; }
}

/* --------------------------------------------------------------------------
   19. Modale larga + registrazione manuale cliente
   -------------------------------------------------------------------------- */
.modal--wide { width: min(620px, 100%); max-height: 92vh; overflow-y: auto; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
}

.credentials-box {
  margin-top: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-soft);
  padding: 1.1rem 1.25rem;
}
.credentials-box h4 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent-ink);
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.credentials-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  margin: 0.75rem 0;
  font-size: var(--fs-small);
}
.credentials-list dt { color: var(--muted); }
.credentials-list dd { margin: 0; font-weight: 600; word-break: break-all; }
.credentials-box .btn-row { margin-top: 0.9rem; }

/* ---------------------------------------------------------- live prices -- */
@keyframes tick-up {
  0%   { background: rgba(14, 107, 71, 0.16); }
  100% { background: transparent; }
}
@keyframes tick-down {
  0%   { background: rgba(197, 48, 48, 0.14); }
  100% { background: transparent; }
}

.is-tick-up   { animation: tick-up 0.9s ease-out; border-radius: 4px; }
.is-tick-down { animation: tick-down 0.9s ease-out; border-radius: 4px; }

[data-live-note] { transition: color 0.2s ease; }
[data-live-note].is-stale,
[data-market-note].is-stale { color: var(--warn); }

/* --------------------------------------------------------------- iban -- */
.iban-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.35rem;
}

.iban-box__value {
  font-family: var(--font-num);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  background: rgba(11, 11, 15, 0.05);
  border: 1px solid rgba(11, 11, 15, 0.08);
  white-space: nowrap;
}

.iban-box__copy { flex: none; }

.iban-note { font-size: 0.78rem; color: var(--muted); }

@media (max-width: 640px) {
  .iban-box__value { font-size: 0.78rem; }
}

/* ---------------------------------------------------- dati societari -- */
.footer__entity {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.footer__entity p {
  font-size: 0.76rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
  max-width: 86ch;
}

.footer__entity strong { color: var(--ink); }

/* -------------------------------------------------- rifiniture globali -- */
::selection {
  background: rgba(14, 107, 71, 0.16);
  color: var(--ink);
}

/* scrollbar discreta (Chromium / Safari) */
* { scrollbar-width: thin; scrollbar-color: #d3d3dc transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #d9d9e1;
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: #c3c3ce; background-clip: content-box; }

/* chi preferisce meno movimento non deve subire animazioni */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover { transform: none; }
}

/* ==========================================================================
   Traccia — componenti specifici del servizio di analisi forense
   ========================================================================== */

/* --- pannello "percorso dei fondi" (hero) -------------------------------- */
.trace-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: var(--shadow-lg, 0 24px 60px -30px rgba(11, 11, 15, 0.35));
}
.trace-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line-soft);
}
.trace-card__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.trace-card__chip {
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--r-pill);
  background: var(--accent-wash);
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}

.trace-path { margin: 1.1rem 0 0; padding: 0; list-style: none; }
.trace-path__step {
  position: relative;
  display: flex;
  gap: 0.85rem;
  padding: 0 0 1.05rem 0;
}
/* linea verticale che collega i passaggi */
.trace-path__step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: 0;
  width: 1.5px;
  background: var(--line);
}
.trace-path__dot {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  margin-top: 3px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #fff;
  position: relative;
  z-index: 1;
}
.trace-path__body { display: grid; gap: 0.1rem; }
.trace-path__body b {
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.trace-path__body em {
  font-style: normal;
  font-size: var(--fs-xs);
  color: var(--muted);
}
.trace-path__step--ok .trace-path__dot { border-color: var(--accent); background: var(--accent); }
.trace-path__step--warn .trace-path__dot { border-color: var(--warn); background: var(--warn-wash); }
.trace-path__step--stop .trace-path__dot { border-color: var(--down); background: var(--down); }

.trace-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.35rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-xs);
  color: var(--muted);
}
.trace-card__foot b {
  font-size: 1.15rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* --- banda di allerta (fase due della truffa) ---------------------------- */
.alert-band {
  background: var(--warn-wash);
  border-top: 1px solid rgba(163, 102, 11, 0.18);
  border-bottom: 1px solid rgba(163, 102, 11, 0.18);
  padding: 1.1rem 0;
}
.alert-band__inner {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}
.alert-band__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--warn);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
  margin-top: 1px;
}
.alert-band p {
  font-size: var(--fs-small);
  color: var(--ink-soft);
  margin: 0;
  max-width: 92ch;
}
.alert-band a { font-weight: 600; color: var(--warn); text-decoration: underline; }

/* --- lista dei "non facciamo" -------------------------------------------- */
.no-list { display: flex; flex-direction: column; gap: 1.15rem; margin: 0; padding: 0; list-style: none; }
.no-list__item {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  font-size: var(--fs-small);
  color: rgba(255, 255, 255, 0.78);
}
.no-list__x {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(194, 51, 77, 0.18);
  color: #ff8fa3;
  font-size: 0.72rem;
  margin-top: 1px;
}
.no-list__item b { color: #fff; font-weight: 600; }

/* --- griglia di metriche ------------------------------------------------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
}

/* --- titolo hero del servizio: tre righe volute, ultima in accento ------- */
.hero__title--svc {
  font-size: clamp(2.05rem, 4.6vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.hero__title--svc em {
  font-style: normal;
  color: var(--accent);
}

/* il chip va ancorato fuori dal pannello, non sopra i testi */
.trace-wrap > .device-chip {
  position: static;
  margin-top: 1rem;
  justify-self: end;
  box-shadow: var(--shadow-md);
}
@media (min-width: 941px) {
  .trace-wrap { align-content: center; justify-items: stretch; }
  .trace-wrap > .device-chip {
    justify-self: end;
    margin-top: -0.35rem;
    margin-right: -0.75rem;
    z-index: 2;
  }
}

/* --- fasi del metodo ----------------------------------------------------- */
.phases { display: flex; flex-direction: column; gap: 1px; background: var(--line); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
.phase {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: clamp(1rem, 3vw, 2.5rem);
  background: #fff;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  transition: background 0.25s var(--ease);
}
.phase:hover { background: var(--bg-soft); }
.phase__num {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--line);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.phase__body h2 { margin: 0; }
.phase__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-soft);
}
.phase__meta-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
@media (max-width: 640px) {
  .phase { grid-template-columns: 1fr; gap: 0.75rem; }
  .phase__num { font-size: 1.3rem; }
}

/* --- elenco numerato dei documenti -------------------------------------- */
.doc-list { margin: 0; padding: 0; list-style: none; counter-reset: doc; }
.doc-list li {
  counter-increment: doc;
  display: flex;
  gap: 0.85rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-small);
  color: var(--ink-soft);
}
.doc-list li:last-child { border-bottom: 0; }
.doc-list li::before {
  content: counter(doc, decimal-leading-zero);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
  padding-top: 0.1rem;
}

/* --- limiti del servizio (pagina onorari) -------------------------------- */
.limits { display: flex; flex-direction: column; gap: 1.5rem; }
.limits__item { display: flex; gap: 1rem; align-items: flex-start; }
.limits__x {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--down-wash);
  color: var(--down);
  font-size: 0.8rem;
  margin-top: 2px;
}
.limits__item h3 { margin: 0; }

/* --- casi seguiti -------------------------------------------------------- */
.cases { display: flex; flex-direction: column; gap: 1.5rem; }
.case {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(1.4rem, 3.5vw, 2.25rem);
  transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.case:hover { box-shadow: var(--shadow-md); border-color: transparent; }
.case__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}
.case__ref {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.case__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem 2rem;
  margin: 1.25rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-soft);
}
.case__facts dt {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.case__facts dd {
  margin: 0;
  font-size: var(--fs-small);
  color: var(--ink-soft);
  line-height: 1.55;
}

/* --- passaggi del tracciamento ------------------------------------------ */
.steps-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(1.4rem, 3vw, 2rem);
  box-shadow: var(--shadow-md);
}
.steps-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 1.15rem; }
.steps-list li { display: flex; gap: 0.9rem; align-items: flex-start; }
.steps-list__n {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-wash);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}
.steps-list b {
  display: block;
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* --- lista su fondo scuro ------------------------------------------------ */
.dark-list { margin: 0; padding: 0; list-style: none; counter-reset: dk; }
.dark-list li {
  counter-increment: dk;
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.82);
  font-size: var(--fs-small);
}
.dark-list li::before {
  content: counter(dk, decimal-leading-zero);
  color: var(--accent-lime);
  font-weight: 600;
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  padding-top: 0.15rem;
}

/* --- checklist operativa ------------------------------------------------ */
.checklist { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.checklist__item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: clamp(1rem, 2.5vw, 2rem);
  background: #fff;
  padding: clamp(1.25rem, 3vw, 1.85rem);
}
.checklist__n {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
}
.checklist__item h3 { margin: 0; }
@media (max-width: 640px) { .checklist__item { grid-template-columns: 1fr; gap: 0.75rem; } }

/* --- contatti ----------------------------------------------------------- */
.contact-list { display: flex; flex-direction: column; gap: 1.25rem; }
.contact-list__item a {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}
.contact-list__item a:hover { border-color: var(--accent); color: var(--accent-ink); }
.contact-list__label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

/* --- tracciato delle fasi (area riservata) ------------------------------ */
.phase-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  margin: 0;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  list-style: none;
}
.phase-track__step {
  position: relative;
  padding-right: 1rem;
  padding-top: 1.9rem;
}
.phase-track__step::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 14px;
  right: 0;
  height: 2px;
  background: var(--line);
}
.phase-track__step:last-child::before { display: none; }
.phase-track__dot {
  position: absolute;
  top: 4px;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #fff;
}
.phase-track__step.is-done .phase-track__dot { border-color: var(--accent); background: var(--accent); }
.phase-track__step.is-done::before { background: var(--accent); }
.phase-track__step.is-current .phase-track__dot {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-wash);
}
.phase-track__step b { display: block; font-size: var(--fs-small); font-weight: 600; letter-spacing: -0.01em; }
.phase-track__step.is-current b { color: var(--accent-ink); }
@media (max-width: 760px) {
  .phase-track { grid-template-columns: 1fr; gap: 1rem; }
  .phase-track__step { padding-top: 0; padding-left: 2rem; }
  .phase-track__step::before { display: none; }
  .phase-track__step .phase-track__dot { top: 2px; }
}

/* --- riferimento pratica ------------------------------------------------ */
.ref-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.15rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.ref-box__label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.ref-box__value { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.02em; }
.ref-box .btn { margin-left: auto; }

/* --- pannello nota ------------------------------------------------------ */
.panel--note { background: var(--accent-wash); border-color: transparent; }
.panel--note .panel__body { padding: 1rem 1.25rem; }
.panel--note a { font-weight: 600; text-decoration: underline; }

/* --- correzioni di contenimento su schermi stretti ---------------------- */
/* 1. i grid devono poter restringere i figli: senza min-width:0 il
      contenuto impone la larghezza minima e la pagina scorre in orizzontale */
.split > * { min-width: 0; }
.hero__inner > * { min-width: 0; }
.grid > * { min-width: 0; }

/* 2. i due nuovi blocchi usano il grid: senza questo il ticker forzava
      il contenitore a 996px su un viewport da 390 */
.split__visual { min-width: 0; }

/* 3. le tabelle dentro .table-scroll non devono allargare il genitore */
.table-scroll { max-width: 100%; }
.table-scroll table { min-width: 520px; }
@media (max-width: 560px) {
  .data-table th, .data-table td { padding-left: 0.85rem; padding-right: 0.85rem; }
}

/* 4. i controlli dei form hanno una larghezza intrinseca: in un grid a due
      colonne stretta (es. .split a 1024px) sforano il contenitore */
.field input,
.field select,
.field textarea { min-width: 0; width: 100%; }
.form-row > .field { min-width: 0; }
@media (max-width: 1024px) {
  .form-row { grid-template-columns: 1fr; }
}

/* 5. l'area riservata non deve mai generare scorrimento orizzontale */
.app-shell { max-width: 100%; }
.app-main { min-width: 0; }
.app-side { min-width: 0; }

/* ==========================================================================
   Componenti "enterprise" — stile agency forense
   ========================================================================== */

/* --- banda numerica: prova quantitativa subito dopo la hero -------------- */
.metric-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.metric-band__cell {
  background: #fff;
  padding: clamp(1.5rem, 3.5vw, 2.5rem) clamp(1rem, 2.5vw, 1.75rem);
}
.metric-band__value {
  display: block;
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.metric-band__label {
  display: block;
  margin-top: 0.7rem;
  font-size: var(--fs-small);
  color: var(--muted);
  line-height: 1.45;
  max-width: 24ch;
}
.metric-band__note {
  font-size: var(--fs-xs);
  color: var(--muted);
  padding: 0.9rem 0;
}

/* --- sezione con intestazione a due colonne (stile editoriale) ----------- */
.section-head {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: end;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.section-head__aside { padding-bottom: 0.4rem; }
@media (max-width: 860px) {
  .section-head { grid-template-columns: 1fr; align-items: start; }
}

/* --- card storia / caso con esito --------------------------------------- */
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gap);
}
.story {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    border-color 0.25s var(--ease);
}
.story:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.story__visual {
  position: relative;
  background: var(--bg-dark);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.story__visual svg { width: 100%; height: 100%; display: block; }
.story__tag {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  backdrop-filter: blur(4px);
}
.story__body {
  padding: clamp(1.15rem, 2.5vw, 1.6rem);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}
.story__kicker {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.story__title { font-size: 1.08rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
.story__text { font-size: var(--fs-small); color: var(--muted); line-height: 1.55; }
.story__foot {
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.story__stat { font-variant-numeric: tabular-nums; }
.story__stat b { display: block; font-size: 1.05rem; letter-spacing: -0.02em; }
.story__stat span { font-size: var(--fs-xs); color: var(--muted); }

/* --- pilastri "perché noi" ---------------------------------------------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
}
.pillar__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-wash);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
}
.pillar h3 { font-size: 1.15rem; }
.pillar p { margin-top: 0.6rem; font-size: var(--fs-small); color: var(--muted); line-height: 1.6; }

/* --- settori ------------------------------------------------------------ */
.sectors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.sector {
  background: #fff;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: background 0.2s var(--ease);
}
.sector:hover { background: var(--bg-soft); }
.sector b { font-size: var(--fs-small); font-weight: 600; letter-spacing: -0.01em; }
.sector p { font-size: var(--fs-xs); color: var(--muted); line-height: 1.5; }
.sector__svg { color: var(--accent); margin-bottom: 0.35rem; }

/* --- team --------------------------------------------------------------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--gap);
}
.member {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(1.15rem, 2.5vw, 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.member__head { display: flex; align-items: center; gap: 0.85rem; }
.member__avatar {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  background: var(--ink);
  color: #fff;
}
.member__avatar--accent { background: var(--accent); }
.member__avatar--soft { background: var(--accent-wash); color: var(--accent-ink); }
.member__name { font-size: var(--fs-small); font-weight: 600; letter-spacing: -0.01em; }
.member__role { font-size: var(--fs-xs); color: var(--muted); }
.member__bio { font-size: var(--fs-xs); color: var(--ink-soft); line-height: 1.55; }
.member__tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: auto; padding-top: 0.5rem; }
.member__tag {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.22rem 0.5rem;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  color: var(--muted);
  border: 1px solid var(--line);
}

/* --- timeline delle tappe (chi siamo) ----------------------------------- */
.timeline { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline li {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 1.25rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: 0; }
.timeline__year {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.timeline p { font-size: var(--fs-small); color: var(--muted); line-height: 1.55; }
.timeline b { color: var(--ink); font-weight: 600; }

/* la banda numerica vive dentro il container e resta allineata alla griglia */
.metric-band-wrap { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.metric-band { gap: 0; background: transparent; border: 0; }
.metric-band__cell { border-left: 1px solid var(--line); padding-left: clamp(1rem, 2vw, 1.5rem); }
.metric-band__cell:first-child { border-left: 0; padding-left: 0; }
@media (max-width: 720px) {
  .metric-band__cell { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 1.25rem; }
  .metric-band__cell:first-child { border-top: 0; }
}

/* 9 persone = 3 righe piene su desktop */
.team-grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
@media (min-width: 1000px) {
  .team-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* quattro pilastri = quattro colonne piene su desktop */
@media (min-width: 1000px) {
  .pillars--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
