/* Area agenzie di bsdhq: stesso linguaggio visivo di bsdhq.com (Poppins, fondo #0F0F0F, pill e card a gradiente)
   con gli schemi di una neobank. Colori dei soldi come in OFM Bank: verde entra, rosso esce, giallo in attesa. */

:root {
  --bg: #0f0f0f;
  --surface: #171717;
  --surface-2: #202020;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f5f5;
  --muted: rgba(245, 245, 245, 0.62);
  --faint: rgba(245, 245, 245, 0.4);
  --green: #34d399;
  --green-bg: rgba(52, 211, 153, 0.12);
  --red: #f87171;
  --red-bg: rgba(248, 113, 113, 0.1);
  --yellow: #facc15;
  --yellow-bg: rgba(250, 204, 21, 0.1);
  --blue: #93c5fd;
  --blue-bg: rgba(147, 197, 253, 0.12);
  --violet: linear-gradient(135deg, #3b82f6, #4f46e5 55%, #6d28d9);
  --shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.8);
  --radius: 28px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.16);
  --text: #0f0f0f;
  --muted: rgba(15, 15, 15, 0.62);
  --faint: rgba(15, 15, 15, 0.42);
  --green: #059669;
  --green-bg: #d1fae5;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --yellow: #a16207;
  --yellow-bg: #fef9c3;
  --blue: #2563eb;
  --blue-bg: #dbeafe;
  --shadow: 0 30px 80px -50px rgba(0, 0, 0, 0.35);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Poppins", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

h1,
h2,
p {
  margin: 0;
}

.muted {
  color: var(--muted);
}

/* Logo bsdhq: lo stesso file del sito, colorato con il testo. */
.logo {
  display: inline-block;
  width: 84px;
  height: 29px;
  background: currentColor;
  -webkit-mask: url(logo.svg) no-repeat left center / contain;
  mask: url(logo.svg) no-repeat left center / contain;
}

.logo-lg {
  width: 112px;
  height: 39px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill-sm {
  height: 24px;
  padding: 0 10px;
  font-size: 9px;
}

.pill-glass {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

/* Etichetta "Crypto Wallet": scritta così (non in maiuscolo), con il logo di Trust Wallet al posto del pallino. */
.pill-wallet {
  gap: 8px;
  padding: 0 14px 0 5px;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

.tw-logo {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
}

.tw-logo svg {
  width: 12px;
  height: 13px;
  stroke: none;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.dot-green {
  background: #6ee7b7;
  box-shadow: 0 0 10px #6ee7b7;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}

.icon-btn.round {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
}

:focus-visible {
  outline: 2px solid #818cf8;
  outline-offset: 2px;
}

/* --- Accesso ------------------------------------------------------------- */

/* Due colonne come una banca online: a sinistra il modulo, a destra un pannello scuro (uguale nei due temi) con le
   schede bsdhq inclinate e una scheda chiara che dice cos'è l'area. Sotto i 900px resta solo il modulo. */
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  background: var(--surface);
}

.login-side {
  display: grid;
  place-items: center;
  padding: 40px 24px;
}

.login-card {
  width: 100%;
  max-width: 412px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

/* L'icona bsdhq (la stessa della scheda del browser) come icona di un'app. */
.login-mark {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 13px;
  box-shadow: 0 0 0 1px var(--line-strong), 0 16px 30px -16px rgba(0, 0, 0, 0.55);
}

.login-card h1 {
  margin: 8px 0 12px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

/* Etichetta letta dagli screen reader ma non mostrata: nel modulo di accesso basta il testo dentro il campo. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-card .field {
  position: relative;
}

.login-card .input {
  height: 48px;
  padding: 0 6px 0 16px;
  border-radius: 12px;
}

.login-card .input input {
  font-size: 14px;
  font-weight: 400;
}

.login-card .input input::placeholder {
  color: var(--faint);
  opacity: 1;
}

.login-forgot {
  align-self: flex-end;
  margin-top: -4px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.login-forgot:hover,
.login-help a:hover {
  text-decoration: underline;
}

/* "Sign in": il gradiente bsdhq, largo quanto i campi. */
.btn-login {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  border: 0;
  border-radius: 12px;
  background: var(--violet);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.btn-login:hover {
  filter: brightness(1.08);
}

.btn-login:active {
  transform: scale(0.99);
}

.btn-login[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* Pannello di destra: un pezzo di bsdhq.com, sempre scuro. Dietro il cielo di "Our Story" (un canvas disegnato da
   app.js), sopra il titolo dell'hero e il suo carosello di schede in prospettiva. */
.login-art {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 5vh, 52px);
  margin: 20px;
  padding: 48px 28px 40px;
  border-radius: 28px;
  overflow: hidden;
  background: radial-gradient(ellipse 130% 90% at 50% -10%, #10101a 0%, #0a0a0c 55%, #050506 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: #fff;
  text-align: center;
}

.art-sky {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}

.art-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

/* Il marchio in cima al pannello, scritto come una collaborazione: "bsdhq × agency". La scritta bsdhq è il file del
   sito (logo.svg: 2905 × 1008 unità, linea di base a 740 dall'alto), grande quanto il testo accanto e sulla stessa
   linea di base. "agency" ha un riflesso azzurro e viola che scorre piano. */
.art-lockup {
  font-size: clamp(24px, 2.3vw, 32px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.art-lockup-logo {
  display: inline-block;
  width: 2.905em;
  height: 1.008em;
  vertical-align: -0.268em;
  background: #fff;
  -webkit-mask: url(logo.svg) no-repeat center / contain;
  mask: url(logo.svg) no-repeat center / contain;
}

.art-x {
  margin: 0 0.5em;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.72em;
  font-weight: 300;
  letter-spacing: 0;
}

.art-agency {
  background: linear-gradient(100deg, #6d8bff 0%, #a78bfa 28%, #fff 50%, #a78bfa 72%, #6d8bff 100%) 0 0 / 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 16px rgba(109, 139, 255, 0.4));
  animation: artShine 7s linear infinite;
}

/* Il gradiente è largo due volte la parola e comincia e finisce con lo stesso colore: spostato di una sua larghezza
   intera, riparte senza salti. */
@keyframes artShine {
  to { background-position: -200% 0; }
}

/* Il titolo dell'hero del sito, con la parola nel blocco bianco. */
.art-title {
  max-width: 12ch;
  font-size: clamp(30px, 3.5vw, 54px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  text-transform: uppercase;
}

.art-pop {
  display: inline-block;
  margin: 0.08em 0;
  padding: 0.04em 0.26em;
  border-radius: 0.3em;
  background: #fff;
  color: #0a0a0c;
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.8);
}

/* Il carosello: la scheda al centro è piatta e a fuoco, le due ai lati arretrano, ruotano e si sfocano. Sotto, i
   puntini: quello della scheda al centro è una lineetta. */
.art-carousel {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.art-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 6px;
}

.art-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  transition: width 0.3s ease, background 0.3s ease;
}

.art-dots span.is-on {
  width: 30px;
  background: #fff;
}

.art-stage {
  position: relative;
  width: 100%;
  height: 270px;
  display: grid;
  place-items: center;
  perspective: 1600px;
}

.art-slide {
  position: absolute;
  width: min(360px, 66%);
  min-height: 236px;
  padding: 24px 24px 26px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  color: #fff;
  text-align: left;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease, filter 0.6s ease;
}

.art-slide[data-pos="0"] {
  z-index: 3;
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  cursor: default;
}

.art-slide[data-pos="-1"] {
  z-index: 2;
  opacity: 0.8;
  filter: blur(1.5px);
  transform: translateX(-36%) scale(0.82) rotateY(10deg);
}

.art-slide[data-pos="1"] {
  z-index: 2;
  opacity: 0.8;
  filter: blur(1.5px);
  transform: translateX(36%) scale(0.82) rotateY(-10deg);
}

.art-zinc {
  background: linear-gradient(135deg, #27272a, #18181b 50%, #000);
}

.art-violet {
  background: linear-gradient(135deg, #3b82f6, #4f46e5 50%, #6d28d9);
}

.art-emerald {
  background: linear-gradient(135deg, #10b981, #0d9488 50%, #065f46);
}

.art-glow {
  position: absolute;
  top: -96px;
  right: -96px;
  width: 256px;
  height: 256px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  filter: blur(64px);
  pointer-events: none;
}

/* In cima a ogni scheda il marchio del servizio: il logo tondo e la sua scritta (app.js li scrive qui dentro). */
.art-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
}

.art-brand .brand-logo,
.art-brand .usdc-logo {
  display: block;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  stroke: none;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.5);
}

.art-brand .brand-logo svg {
  display: block;
  width: 100%;
  height: 100%;
  stroke: none;
}

.art-brand .slash-logo {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 6px 16px -6px rgba(0, 0, 0, 0.5);
}

.trust-logo {
  background: #fff;
}

.art-wordmark {
  width: auto;
  height: 24px;
  stroke: none;
}

.art-wordmark-cosmo {
  height: 13px;
}

/* Wallet: due loghi affiancati, lo scudo di Trust Wallet e USDC. */
.art-pair {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.art-brand-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.art-brand-name i {
  margin: 0 0.4em;
  font-style: normal;
  opacity: 0.6;
}

.art-slide h3 {
  position: relative;
  max-width: 11ch;
  margin: 28px 0 0;
  font-size: clamp(24px, 2.3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.02;
  text-transform: uppercase;
}

.art-slide p {
  position: relative;
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.8;
}

@media (prefers-reduced-motion: reduce) {
  .art-agency {
    animation: none;
  }

  .art-slide,
  .art-dots span {
    transition: none;
  }
}

/* Telefono e finestre strette: una colonna. Il pannello diventa una fascia in alto con il cielo e il titolo (niente
   carosello), il modulo sta subito sotto. */
@media (max-width: 900px) {
  .login {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }

  .login-art {
    order: -1;
    gap: 0;
    margin: 12px 12px 0;
    padding: 30px 20px 34px;
    border-radius: 24px;
  }

  .art-carousel {
    display: none;
  }

  .art-top {
    gap: 14px;
  }

  .art-title {
    max-width: 16ch;
    font-size: clamp(24px, 7.4vw, 36px);
  }

  .login-side {
    place-items: start center;
    padding: 30px 20px 40px;
  }
}

/* Finestre basse: il titolo si accorcia, così il carosello non viene tagliato. */
@media (max-height: 700px) {
  .art-title {
    font-size: clamp(26px, 2.8vw, 38px);
  }
}

.field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.input {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 8px 0 16px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--faint);
  transition: border-color 0.15s ease;
}

.input:focus-within {
  border-color: #818cf8;
  color: var(--text);
}

.input input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
}

.form-error {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--red-bg);
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
}

.login-help {
  width: 100%;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}

.login-help a {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

.demo-note {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed var(--line-strong);
  font-size: 12px;
  color: var(--muted);
}

.demo-note strong {
  color: var(--text);
  font-weight: 600;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
}

/* --- Struttura della dashboard ------------------------------------------ */

.app {
  display: flex;
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 248px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 18px 20px;
  border-right: 1px solid var(--line);
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.side-nav a:hover {
  color: var(--text);
  background: var(--surface);
}

.side-nav a.is-active {
  color: var(--text);
  background: var(--surface-2);
}

.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.side-action:hover {
  color: var(--text);
  background: var(--surface);
}

.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--violet);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.side-user-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.side-user-text strong {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-user-text small {
  font-size: 11px;
  color: var(--faint);
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 32px 40px;
  max-width: 1240px;
}

.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.top-brand {
  display: none;
}

.top-title h1 {
  margin-top: 6px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.top-actions {
  display: flex;
  gap: 8px;
}

/* --- Saldo e stadi -------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px;
  scroll-margin-top: 24px;
}

/* Total available: tutto al centro della scheda, in orizzontale e in verticale. */
.balance-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
  padding: 28px;
  border-radius: 32px;
  background: var(--violet);
  color: #fff;
  box-shadow: 0 40px 120px -40px rgba(79, 70, 229, 0.6);
}

.balance-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  right: -90px;
  top: -110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  filter: blur(50px);
  pointer-events: none;
}

.balance-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.balance-asset {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  opacity: 0.8;
}

.balance-amount {
  position: relative;
  margin-top: 4px;
  font-size: 60px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.balance-amount .cents {
  font-size: 28px;
  font-weight: 700;
  opacity: 0.7;
}

.quick {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 76px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.quick-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  transition: background 0.15s ease;
}

.quick-btn:hover .quick-icon {
  background: rgba(255, 255, 255, 0.28);
}

.stages {
  display: grid;
  gap: 12px;
}

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.stage-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
}

.stage-step {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}

.stage-cur {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--faint);
}

.stage-amount {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stage-pending {
  background: var(--yellow-bg);
  border-color: transparent;
}

.stage-pending .stage-step,
.stage-pending .stage-amount,
.stage-pending .stage-label {
  color: var(--yellow);
}

.stage-pending .stage-step {
  background: var(--yellow-bg);
  border: 1px solid currentColor;
}

.stage-main .stage-step {
  background: var(--blue-bg);
  color: var(--blue);
}

/* Crypto Wallet: logo di Trust Wallet, saldo in verde (è disponibile) con il token USDC davanti. */
.stage .tw-logo {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  box-shadow: 0 0 0 1px var(--line-strong);
}

.stage .tw-logo svg {
  width: 13px;
  height: 14px;
}

.stage-wallet .stage-amount {
  display: flex;
  align-items: center;
  gap: 0.3em;
  color: var(--green);
}

.stage-amount .token-icon {
  width: 0.95em;
  height: 0.95em;
}

.stage-amount .balance-unit {
  font-size: 0.5em;
}

/* Etichetta della scheda grande: icona di bsdhq davanti a "Total available". */
.pill-logo {
  display: grid;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

.pill-logo .brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

/* --- Pannelli ---------------------------------------------------------------- */

.panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  scroll-margin-top: 24px;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-head p {
  margin-top: 4px;
  font-size: 13px;
}

/* Stesse colonne di .hero: in Home la seconda colonna parte sulla linea degli stadi. */
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 -8px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.table th {
  padding: 0 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--faint);
  white-space: nowrap;
}

.table td {
  padding: 14px 8px;
  border-top: 1px solid var(--line);
  white-space: nowrap;
}

.table tfoot td {
  font-weight: 700;
}

.num {
  text-align: right !important;
}

.creator {
  display: flex;
  align-items: center;
  gap: 12px;
}

.creator .avatar {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.creator small {
  display: block;
  font-size: 11px;
  color: var(--faint);
}

.creator strong {
  font-weight: 600;
}

.amount-pending {
  color: var(--yellow);
  font-weight: 600;
}

.amount-out {
  color: var(--red);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.tag-new {
  background: var(--blue-bg);
  color: var(--blue);
}

.table th small {
  font-weight: 500;
  opacity: 0.7;
}

.table td small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 500;
  color: var(--faint);
}

.amount-in {
  color: var(--green);
  font-weight: 600;
}

.c-who .split {
  margin-top: 10px;
  max-width: 220px;
}

/* --- Viste, intestazioni, admin ------------------------------------------- */

.view {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: -6px;
}

.section-head h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.see-all {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
}

.see-all:hover {
  text-decoration: underline;
}

.admin-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  padding: 6px 6px 6px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  font-size: 13px;
}

.admin-badge {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--yellow-bg);
  color: var(--yellow);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-text {
  color: var(--muted);
}

.select {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select select {
  appearance: none;
  -webkit-appearance: none;
  height: 34px;
  padding: 0 34px 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.select svg {
  position: absolute;
  right: 12px;
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.icon-btn.is-spinning svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty {
  padding: 18px 4px;
  font-size: 13px;
  color: var(--muted);
  list-style: none;
}

.more-btn {
  align-self: center;
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.more-btn:hover {
  background: var(--surface-2);
}

/* --- Conti Slash -------------------------------------------------------------- */

.accounts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* In Home, Slash Debit parte sulla linea degli stadi (stesse colonne e spazio di .hero). */
#home-accounts {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px;
}

.acct {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

a.acct:hover,
button.acct:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

/* Vista Slash: le due schede sono il selettore del conto. Quella scelta è accesa, l'altra resta in secondo piano. */
button.acct {
  font: inherit;
  text-align: left;
  cursor: pointer;
}

button.acct:not(.is-selected) {
  opacity: 0.6;
}

button.acct:not(.is-selected):hover {
  opacity: 0.85;
}

button.acct.is-selected {
  border-color: var(--text);
  box-shadow: 0 0 0 1px var(--text);
}

button.acct:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.acct::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -70px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.35;
  pointer-events: none;
}

.acct-cash::after {
  background: #10b981;
}

.acct-debit::after {
  background: #6366f1;
}

.acct-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.acct-head strong {
  font-weight: 700;
}

.acct-logo {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--surface-2);
}

.acct-cash .acct-logo {
  color: var(--green);
  background: var(--green-bg);
}

.acct-debit .acct-logo {
  color: var(--blue);
  background: var(--blue-bg);
}

.acct-logo svg {
  width: 16px;
  height: 16px;
}

.acct-cur {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--faint);
}

.acct-amount {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.acct-amount .cents {
  font-size: 18px;
  opacity: 0.6;
}

.accounts-lg .acct-amount {
  font-size: 36px;
}

.acct-sub {
  font-size: 12px;
  color: var(--muted);
}

.acct-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--faint);
}

.columns-slash {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.chip.is-active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.cardlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.carditem {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.carditem:first-child {
  border-top: 0;
}

.carditem.is-paused {
  opacity: 0.55;
}

.carditem-chip {
  display: grid;
  place-items: center;
  width: 40px;
  height: 28px;
  border-radius: 7px;
  background: var(--surface-2);
}

.carditem-chip.acct-cash {
  background: var(--green-bg);
  color: var(--green);
}

.carditem-chip.acct-debit {
  background: var(--blue-bg);
  color: var(--blue);
}

.carditem-chip svg {
  width: 18px;
  height: 18px;
}

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

.carditem-text strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.carditem-text small,
.carditem-right small {
  font-size: 12px;
  color: var(--muted);
}

.carditem-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}

.carditem-right strong {
  font-size: 14px;
  font-weight: 700;
}

.carditem-right .tag {
  height: 20px;
  margin-top: 2px;
  font-size: 10px;
}

.tag-declined {
  background: var(--red-bg);
  color: var(--red);
}

/* --- Creator: elenco in Home, riquadri, barra prelevato / pending ------------ */

.crew {
  list-style: none;
  margin: 0 -12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.crew-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "who nums";
  align-items: center;
  gap: 10px 12px;
  padding: 10px 12px;
  border-radius: 18px;
  font-variant-numeric: tabular-nums;
}

.crew-row .creator {
  grid-area: who;
  min-width: 0;
}

.crew-nums {
  grid-area: nums;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 13px;
}

.crew-row .split {
  grid-area: bar;
}

.crew-legend {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--faint);
}

.crew-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.crew-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-w {
  background: var(--green);
}

.dot-p {
  background: var(--yellow);
}

.split {
  display: flex;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--yellow);
}

.split-w {
  display: block;
  background: var(--green);
}

.split-p {
  display: block;
  flex: 1;
  background: var(--yellow);
}

.split-empty {
  background: var(--surface-2);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.tile-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}

.tile-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tile-sub {
  font-size: 12px;
  color: var(--muted);
}

.tile-in .tile-value {
  color: var(--green);
}

.tile-pending {
  background: var(--yellow-bg);
  border-color: transparent;
}

.tile-pending .tile-value,
.tile-pending .tile-label {
  color: var(--yellow);
}

/* --- Movimenti ------------------------------------------------------------ */

.feed {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.day h3 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.day ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mov {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  grid-template-areas:
    "icon text amount"
    "icon text extra";
  align-items: center;
  column-gap: 14px;
  row-gap: 2px;
  padding: 12px 14px;
  border-radius: 18px;
  font-variant-numeric: tabular-nums;
}

.mov-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mov-text {
  grid-area: text;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mov-text strong {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mov-text small {
  font-size: 12px;
  opacity: 0.8;
}

.mov-amount {
  grid-area: amount;
  align-self: end;
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.mov-extra {
  grid-area: extra;
  align-self: start;
  text-align: right;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.75;
  white-space: nowrap;
}

/* Prelievo: la parte dell'agenzia, una riga per creator sotto il movimento. */
.mov-has-detail {
  grid-template-areas:
    "icon text amount"
    "icon text extra"
    ". detail detail";
}

.mov-detail {
  grid-area: detail;
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding: 8px 0 0;
  list-style: none;
  border-top: 1px dashed var(--line-strong);
  color: var(--text);
  font-size: 12px;
}

.mov-detail li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.mov-detail li span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mov-detail li span:last-child {
  font-weight: 600;
  white-space: nowrap;
}

.mov-detail small {
  margin-left: 6px;
  color: var(--muted);
  font-weight: 400;
}

.mov-in {
  color: var(--green);
}

.mov-in .mov-icon {
  background: var(--green-bg);
}

.mov-out {
  color: var(--red);
}

.mov-out .mov-icon {
  background: var(--red-bg);
}

.mov-pending {
  color: var(--yellow);
  background: var(--yellow-bg);
}

.mov-pending .mov-icon {
  background: rgba(250, 204, 21, 0.16);
}

.mov-move .mov-icon {
  background: var(--blue-bg);
  color: var(--blue);
}

.mov-move .mov-amount {
  color: var(--muted);
}

.mov-spend .mov-icon {
  background: var(--surface-2);
  color: var(--muted);
}

.mov-spend .mov-text small,
.mov-spend .mov-extra {
  color: var(--muted);
}

.mov-declined {
  color: var(--muted);
}

.mov-declined .mov-icon {
  background: var(--surface-2);
}

.mov-declined .mov-amount {
  text-decoration: line-through;
}

/* Rifiutati e stornati: il logo di Slash resta, ma spento. */
.mov-declined .slash-logo {
  opacity: 0.45;
}

.mov-extra .tag {
  height: 20px;
  padding: 0 8px;
  font-size: 10px;
}

/* --- Trasferimenti ------------------------------------------------------- */

.transfers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.transfer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.transfer:first-child {
  border-top: 0;
}

.transfer-date {
  width: 48px;
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
  text-transform: uppercase;
  line-height: 1.3;
}

.transfer-date b {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.transfer-who strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.transfer-who small {
  font-size: 12px;
  color: var(--muted);
}

.transfer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
}

.tag-main {
  background: var(--blue-bg);
  color: var(--blue);
}

.tag-done {
  background: var(--green-bg);
  color: var(--green);
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
  font-size: 11px;
  color: var(--faint);
}

.demo-tag {
  color: var(--yellow);
}

.tabbar {
  display: none;
}

.loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.loading[hidden] {
  display: none;
}

.loading-bar {
  width: 120px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #6366f1, transparent) 0 0 / 50% 100% no-repeat, var(--line);
  animation: loading 1.1s ease-in-out infinite;
}

@keyframes loading {
  from {
    background-position: -60px 0, 0 0;
  }
  to {
    background-position: 180px 0, 0 0;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
}

/* --- Valute, come in Trust Wallet: dollari con il $, USDC con il logo del token ---------- */

.usdc-logo {
  flex-shrink: 0;
  width: 1.05em;
  height: 1.05em;
  border-radius: 50%;
  stroke: none; /* le icone del sito hanno il contorno: i loghi no */
}

/* Logo USDC con il badge di Ethereum in basso a destra. */
.token-icon {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.token-icon .usdc-logo {
  display: block;
  width: 100%;
  height: 100%;
}

.net-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 42%;
  height: 42%;
  border-radius: 50%;
  stroke: none;
  box-shadow: 0 0 0 2px var(--surface);
}

/* Loghi delle piattaforme (OnlyFans sui payout), a tutto cerchio. */
.token-icon .brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  stroke: none;
}

/* Cosmo Payment: simbolo bianco sul gradiente viola della loro icona. */
.cosmo-logo {
  background: linear-gradient(135deg, #8000ff, #dd00ff);
}

.cosmo-logo svg {
  display: block;
  width: 100%;
  height: 100%;
  stroke: none;
}

/* Slash: la S del loro marchio in oro chiaro su cerchio scuro, come la loro icona. Un filo di bordo la stacca dalle
   schede scure. */
.slash-logo {
  background: #0b0b0d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.slash-logo svg {
  display: block;
  width: 100%;
  height: 100%;
  stroke: none;
  fill: #ead9a0;
}

/* Icona b+q di bsdhq: nera con il simbolo bianco nel tema chiaro, bianca con il simbolo nero nel tema scuro. */
.bsdhq-mark {
  background: var(--text);
  color: var(--surface);
}

.bsdhq-mark svg {
  display: block;
  width: 100%;
  height: 100%;
  stroke: none;
}

/* Al posto dei numeri degli stadi: logo di Cosmo (1 e 2) e di bsdhq (3). */
.stage .stage-step[data-step-logo] {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: none;
}

.stage-step .brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

/* Pallino informativo (ⓘ) in alto a destra: la spiegazione appare al passaggio del mouse o al tocco. */
.info {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin: -3px -4px -3px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}

.info svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

.info:hover,
.info:focus-visible,
.info.is-open {
  color: var(--text);
}

.tip {
  position: absolute;
  top: calc(100% + 10px);
  right: -6px;
  z-index: 40;
  width: 260px;
  max-width: calc(100vw - 48px);
  padding: 12px 14px;
  border-radius: 10px;
  background: #202124;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  white-space: normal;
  box-shadow: 0 14px 36px -10px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  pointer-events: none;
}

.tip::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 11px;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: inherit;
  transform: rotate(45deg);
}

.info:hover .tip,
.info:focus-visible .tip,
.info.is-open .tip {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* Nel tema scuro il fumetto ha un bordo, così si stacca dalle schede scure. */
:root:not([data-theme="light"]) .tip {
  border: 1px solid var(--line-strong);
}

/* Nella scheda Crypto Wallet il pallino sta nell'angolo, in bianco. */
/* Negli stadi il pallino sta a destra (prima lo spingeva l'etichetta della valuta, ora tolta). */
.stage-head .info {
  margin-left: auto;
}

.info-corner {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 2;
}

.info-corner .info {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
}

.info-corner .info:hover,
.info-corner .info.is-open {
  color: #fff;
}

/* Payout ancora in pending: orologio piccolo sul logo. */
.icon-badge {
  position: absolute;
  right: -3px;
  bottom: -3px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--surface);
  box-shadow: 0 0 0 2px var(--surface);
}

.icon-badge svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.6;
}

.token-sm {
  width: 34px;
  height: 34px;
}

/* Nei movimenti in USDC l'icona è il token, senza il cerchio colorato. */
.mov.mov-logo .mov-icon {
  background: none;
}

.mov-logo .mov-icon .token-icon {
  width: 100%;
  height: 100%;
}

/* Etichetta "USDC" con il logo piccolo (stadi, schede). */
.cur-token {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cur-token .usdc-logo,
.cur-token .brand-logo {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
}

/* Saldo Available: è solo USDC, quindi logo del token davanti e "USDC" piccolo dopo le cifre. */
.balance-amount {
  display: flex;
  align-items: center;
  gap: 0.24em;
}

.balance-amount .token-icon {
  width: 0.82em;
  height: 0.82em;
}

.balance-amount .net-badge {
  box-shadow: 0 0 0 2px #4f46e5;
}

.balance-unit {
  margin-left: 0.22em;
  font-size: 0.4em;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.8;
}

/* --- My Creators: disponibile in verde, pending in giallo; il nome apre la pagina della creator ------------- */

/* Tutta la riga di una creator si clicca, con lo stesso effetto al passaggio del mouse dei movimenti. */
.row-link {
  cursor: pointer;
  transition: background 0.15s ease;
}

.row-link:hover,
tr.row-link:hover td {
  background: var(--surface-2);
}

.row-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

tr.row-link td:first-child {
  border-radius: 14px 0 0 14px;
}

tr.row-link td:last-child {
  border-radius: 0 14px 14px 0;
}

.crew-money {
  grid-area: nums;
  display: flex;
  gap: 8px;
}

.money-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  min-width: 104px;
  padding: 7px 12px;
  border-radius: 14px;
}

.money-chip small {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}

.money-chip strong {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.chip-ok {
  background: var(--green-bg);
  color: var(--green);
}

/* Giallo vero per il pending (il --yellow del tema chiaro è un ambra scuro, pensato per il testo). */
.chip-wait {
  background: #fde047;
  color: #713f12;
}

:root:not([data-theme="light"]) .chip-wait {
  background: rgba(250, 204, 21, 0.16);
  color: #fde047;
}

.amount-wait {
  font-weight: 600;
  color: #a16207;
}

:root:not([data-theme="light"]) .amount-wait {
  color: #fde047;
}

/* My Creators e pagina creator: tre riquadri (Available, Net pending, On main account), come le tre colonne. */
.chip-main {
  background: var(--blue-bg);
  color: var(--blue);
}

.c-main {
  font-weight: 600;
  color: var(--blue);
}

/* Riquadro con il token USDC davanti all'importo (saldo del Crypto Wallet). */
.tile-token {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}

.tile-token .token-icon {
  width: 0.95em;
  height: 0.95em;
}

/* Schede della Home che aprono una sezione: si sollevano appena, senza cambiare colore. */
.stage.row-link {
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.stage.row-link:hover {
  background: var(--surface);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.stage-pending.row-link:hover {
  background: var(--yellow-bg);
  border-color: var(--yellow);
}

/* Home: My Creators e General Activity alti uguali. */
.columns-home {
  align-items: stretch;
}

/* Un conto Slash solo (Debit non usato): la scheda prende tutta la riga. */
.accounts.accounts-one,
#home-accounts.accounts-one {
  grid-template-columns: minmax(0, 1fr);
}

/* Titolo di un pannello con il pallino informativo accanto. */
.title-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-info .info {
  margin: 0;
}

/* Pallino vicino al bordo sinistro: il fumetto si apre verso destra. */
.info-start .tip {
  left: -6px;
  right: auto;
}

.info-start .tip::before {
  left: 11px;
  right: auto;
}

/* Pulsante secondario (Profile). */
.btn-soft {
  height: 40px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
}

.btn-soft:hover {
  background: var(--surface-2);
}

.creator-name {
  flex: 1;
  min-width: 0;
}

/* Filtri del periodo negli Insights. */
.period-chips {
  margin-bottom: 14px;
}

/* Periodo a scelta: pulsante con le date e calendario nello stile del sito. */
.range {
  position: relative;
  margin-bottom: 14px;
}

.range[hidden] {
  display: none;
}

.range-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.range-btn svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

/* Il calendario sta nel pop-up "Custom period", al centro dello schermo. */
.sheet.sheet-cal {
  width: min(340px, 100%);
  padding: 20px;
}

.sheet-cal .sheet-icon {
  color: var(--muted);
}

.sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.sheet-actions .btn {
  height: 40px;
  padding: 0 18px;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

/* Pagina Profile di una creator, come le impostazioni di Pagos: due schede in alto (Personal details, Documents) e
   sotto i riquadri uno dopo l'altro, a tutta larghezza. */
.ptabs {
  display: inline-flex;
  align-self: flex-start;
  gap: 4px;
  max-width: 100%;
  padding: 5px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.ptab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.ptab svg {
  width: 16px;
  height: 16px;
}

.ptab:hover {
  color: var(--text);
}

.ptab.is-active {
  background: var(--text);
  color: var(--bg);
}

.ptab-count {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.ptab.is-active .ptab-count {
  background: rgba(127, 127, 127, 0.3);
  color: inherit;
}

.pstack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pstack[hidden],
.ptab-count[hidden],
.pcard[hidden] {
  display: none;
}

.pcard-head .title-info {
  flex: 1;
}

/* Upload: pulsante azzurro tenue, come le icone delle schede (il nero pieno qui stonava). */
.pcard-action.btn-tint {
  height: 38px;
  padding: 0 16px 0 12px;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

.pcard-action svg {
  width: 16px;
  height: 16px;
}

/* SAN code: il numero grande, da copiare o da scrivere a mano, e sotto come inserirlo. */
.san-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.san-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.san-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.san-line .icon-btn {
  width: 34px;
  height: 34px;
}

.san-box small {
  font-size: 12px;
  color: var(--muted);
}

.san-how {
  margin-top: 16px;
  font-size: 13px;
}

.san-how summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
}

.san-how summary::-webkit-details-marker {
  display: none;
}

.san-how summary svg {
  width: 14px;
  height: 14px;
  transition: transform 0.15s ease;
}

.san-how[open] summary svg {
  transform: rotate(180deg);
}

.san-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: san-step;
  color: var(--muted);
}

.san-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  counter-increment: san-step;
}

.san-steps li::before {
  content: counter(san-step);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.san-steps strong {
  font-weight: 600;
  color: var(--text);
}

.san-note {
  margin-top: 12px;
  color: var(--muted);
}

.pcard-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pcard-head h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pcard-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--blue-bg);
  color: var(--blue);
}

.profile dd.is-empty {
  font-weight: 400;
  color: var(--faint);
}

.pcard-head h2 {
  flex: 1;
}

.pcard-action {
  height: 34px;
  padding: 0 14px;
  font-size: 12px;
}

.pcard-action[hidden] {
  display: none;
}

/* Scheda del profilo in modifica: stesse righe della lettura (etichetta a sinistra), con il campo al posto del valore. */
.pform {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pform .field {
  display: grid;
  grid-template-columns: 220px minmax(0, 440px);
  align-items: center;
  column-gap: 16px;
  row-gap: 4px;
  font-size: 14px;
  font-weight: 400;
}

.pform .field-error {
  grid-column: 2;
}

.pform .sheet-actions {
  justify-content: flex-start;
  margin-top: 6px;
  padding-left: 236px;
}

.pform .input {
  height: 46px;
}

.pform .input input {
  font-size: 14px;
}

.input.has-error {
  border-color: var(--red);
}

.field-error {
  font-size: 11px;
  font-weight: 500;
  color: var(--red);
}

/* Documenti della creator: tabella in un riquadro, come in Pagos. */
.doctable-wrap {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.doctable {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.doctable th {
  padding: 12px 16px;
  background: var(--surface-2);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.doctable td {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
  color: var(--muted);
}

.doctable .doc-type {
  width: 150px;
}

.doctable .doc-size {
  width: 100px;
}

.doctable .doc-date {
  width: 130px;
}

.doctable .doc-actions {
  width: 108px;
  text-align: right;
  white-space: nowrap;
}

.doc-name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.docitem-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
}

.docitem-icon svg {
  width: 20px;
  height: 20px;
}

.doc-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.doc-text strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-meta {
  display: none;
  font-size: 11px;
}

.doctable .icon-btn {
  width: 34px;
  height: 34px;
}

.doctable .icon-btn + .icon-btn {
  margin-left: 4px;
}

.doc-count {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}

/* Tipo del documento. */
.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-id {
  background: var(--blue);
  color: var(--surface);
}

.badge-contract {
  border: 1px solid var(--line-strong);
  color: var(--text);
}

.badge-other {
  background: var(--surface-2);
  color: var(--muted);
}

/* Scelta del file nel pop-up di caricamento. */
.filepick {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 24px 16px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 20px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.filepick:hover,
.filepick:focus-within {
  background: var(--surface-2);
}

.filepick.has-file {
  border-style: solid;
  border-color: var(--green);
}

.filepick input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.filepick strong {
  max-width: 100%;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.filepick small {
  font-size: 12px;
  color: var(--muted);
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-head strong {
  font-size: 14px;
  font-weight: 700;
}

.cal-head .icon-btn {
  width: 34px;
  height: 34px;
}

.cal-week,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.cal-week {
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--faint);
}

.cal-day {
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.cal-day:hover {
  background: var(--surface-2);
}

/* I giorni dentro il periodo restano tondi, come gli altri. */
.cal-day.in-range {
  background: var(--surface-2);
}

.cal-day.is-today {
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.cal-day.is-start,
.cal-day.is-end {
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
}

.cal-hint {
  margin-top: 10px;
  font-size: 11px;
  text-align: center;
  color: var(--muted);
}

.stat-row.stat-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Richiesta di un nuovo sub-account. */
/* "Add a creator": un invito tratteggiato, tutto cliccabile. In Home riempie lo spazio sotto le creator. */
.add-creator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 76px;
  padding: 14px 18px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 24px;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.add-creator strong {
  font-weight: 600;
}

.add-creator:hover {
  background: var(--surface);
  border-color: var(--blue);
}

.add-creator .add-icon {
  width: 40px;
  height: 40px;
}

.add-creator .add-icon svg {
  width: 20px;
  height: 20px;
}

.add-fill {
  flex: 1;
  min-height: 64px;
  border-radius: 18px;
}

.add-fill:hover {
  background: var(--surface-2);
}

.add-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--blue-bg);
  color: var(--blue);
}

.add-icon svg {
  width: 22px;
  height: 22px;
}

/* --- Pagina di una creator ---------------------------------------------------------------------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--text);
}

.creator-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.creator-head h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.avatar-lg {
  width: 60px;
  height: 60px;
  font-size: 20px;
}

.columns-creator {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  font-variant-numeric: tabular-nums;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-2);
  min-width: 0;
}

.stat strong {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.stat small {
  font-size: 11px;
  color: var(--muted);
}

.chart {
  display: block;
  width: 100%;
  height: auto;
  stroke: none;
}

.chart .bar {
  fill: var(--green);
}

.chart .bar:hover {
  opacity: 0.8;
}

.chart-base {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.chart text {
  font-family: inherit;
  text-anchor: middle;
  stroke: none;
}

.bar-value {
  font-size: 11px;
  font-weight: 700;
  fill: var(--text);
}

.bar-month {
  font-size: 11px;
  fill: var(--muted);
}

.profile {
  display: grid;
  gap: 0;
  margin: 0;
  font-size: 14px;
}

.profile div {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  padding: 8px 0;
}

.profile dt {
  color: var(--muted);
}

.profile dd {
  margin: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* --- Movimenti come in un'app bancaria: riga essenziale, i dettagli si aprono toccandola ------------- */

.mov[role="button"] {
  cursor: pointer;
  transition: background 0.15s ease, filter 0.15s ease;
}

.mov[role="button"]:hover {
  background: var(--surface-2);
}

.mov-pending[role="button"]:hover {
  background: var(--yellow-bg);
  filter: brightness(0.97);
}

.mov[role="button"]:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Senza la seconda riga a destra, l'importo sta al centro della riga. */
.mov.mov-plain {
  grid-template-areas: "icon text amount";
}

.mov-plain .mov-amount {
  align-self: center;
}

/* Logo dell'agenzia in fondo al menu, su un cerchio scuro (arriva dall'API dopo il login). */
.avatar-logo {
  background: #0f0f0f;
  border: 1px solid var(--line-strong);
  overflow: hidden;
}

.avatar-logo img {
  display: block;
  width: 70%;
  height: 70%;
  object-fit: contain;
}

/* --- Pop-up "Transaction details" ---------------------------------------------------------------- */

.sheet-open {
  overflow: hidden;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 10, 14, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: sheet-fade 0.16s ease;
}

.sheet-backdrop[hidden] {
  display: none;
}

.sheet {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 24px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.6);
  animation: sheet-rise 0.2s ease;
  font-variant-numeric: tabular-nums;
}

@keyframes sheet-fade {
  from { opacity: 0; }
}

@keyframes sheet-rise {
  from { opacity: 0; transform: translateY(14px); }
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.sheet-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-2);
}

.sheet-icon.mov-logo {
  background: none;
}

.sheet-icon .token-icon {
  width: 100%;
  height: 100%;
}

.sheet-icon.mov-in { color: var(--green); }
.sheet-icon.mov-out,
.sheet-icon.mov-declined { color: var(--red); }
.sheet-icon.mov-move { color: var(--blue); }

.sheet-headtext {
  flex: 1;
  min-width: 0;
}

.sheet-headtext h2 {
  margin: 2px 0 8px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.sheet-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 12px;
  color: var(--muted);
}

.sheet-status {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.st-ok { background: var(--green-bg); color: var(--green); }
.st-pending { background: var(--yellow-bg); color: var(--yellow); }
.st-info { background: var(--blue-bg); color: var(--blue); }
.st-bad { background: var(--red-bg); color: var(--red); }

.block-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.sheet-box {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
}

.sheet-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--surface-2);
}

.sheet-block[hidden] {
  display: none;
}

/* Da chi a chi, con la freccia in mezzo. */
.flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.flow-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.flow-to {
  align-items: flex-end;
  text-align: right;
}

.flow-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.flow-name {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.flow-sub {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.flow-address,
.ref-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sheet code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.flow-amount {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.flow-chip {
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.flow-arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}

.flow-arrow svg {
  width: 15px;
  height: 15px;
}

.flow-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.flow-meta strong {
  margin-left: 4px;
  font-weight: 700;
  color: var(--text);
}

.copy-btn {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}

.copy-btn:hover {
  background: var(--line);
  color: var(--text);
}

.copy-btn svg {
  width: 14px;
  height: 14px;
}

.ref-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
}

.ref-link:hover {
  text-decoration: underline;
}

.ref-link svg {
  width: 13px;
  height: 13px;
}

#sheet-lines ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

#sheet-lines li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

#sheet-lines li span:last-child {
  text-align: right;
  white-space: nowrap;
}

#sheet-lines small {
  margin-left: 8px;
  color: var(--muted);
}

#sheet-note p {
  font-size: 13px;
  line-height: 1.55;
}

.sheet-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Soldi in entrata: riquadro verde "You received". */
.sheet-total.total-in {
  border-color: transparent;
  background: var(--green-bg);
}

.total-in .block-label,
.total-in strong {
  color: var(--green);
}

.sheet-total strong {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* --- Tablet e telefono ------------------------------------------------- */

@media (max-width: 1100px) {
  .hero,
  .columns,
  .columns-slash,
  .columns-creator {
    grid-template-columns: minmax(0, 1fr);
  }

  .stages {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #home-accounts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 860px) {
  .side {
    display: none;
  }

  .main {
    padding: 16px 16px calc(96px + env(safe-area-inset-bottom));
    gap: 16px;
  }

  .top {
    flex-wrap: wrap;
    align-items: center;
  }

  .top-brand {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .top-title {
    order: 3;
    width: 100%;
  }

  .top-title h1 {
    font-size: 24px;
  }

  .stages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage {
    padding: 16px;
  }

  .stage-amount {
    font-size: 20px;
  }

  /* Su telefono Crypto Wallet prende tutta la riga; sotto, On main account e Pending affiancati. */
  .stage-wallet {
    grid-column: 1 / -1;
  }

  .balance-card {
    padding: 22px;
    border-radius: 28px;
  }

  .balance-amount {
    font-size: 40px;
  }

  .balance-amount .cents {
    font-size: 22px;
  }

  /* Su telefono i quattro pulsanti stanno su una riga sola, ognuno in un quarto della scheda. */
  .quick {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .quick-btn {
    min-width: 0;
  }

  .panel {
    padding: 18px;
    border-radius: 24px;
  }

  /* Movimenti: fee e netto vanno sotto il titolo, così il titolo non viene tagliato. */
  .mov {
    grid-template-areas:
      "icon text amount"
      "icon extra extra";
    padding: 10px 12px;
    column-gap: 10px;
    row-gap: 4px;
  }

  .mov-has-detail {
    grid-template-areas:
      "icon text amount"
      "icon extra extra"
      "detail detail detail";
  }

  /* Profile su telefono: schede su tutta la larghezza, etichetta sopra il campo, documenti senza peso e data in colonna. */
  .ptabs {
    display: flex;
    align-self: stretch;
  }

  .ptab {
    flex: 1;
    justify-content: center;
    padding: 0 10px;
  }

  .profile div {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 12px;
  }

  .pform .field {
    grid-template-columns: minmax(0, 1fr);
  }

  .pform .field-error {
    grid-column: 1;
  }

  .pform .sheet-actions {
    padding-left: 0;
  }

  .san-code {
    font-size: 24px;
    letter-spacing: 0.08em;
  }

  .doctable th,
  .doctable td {
    padding: 12px;
  }

  .doctable .doc-size,
  .doctable .doc-date {
    display: none;
  }

  .doctable .doc-type {
    width: 112px;
  }

  .doctable .doc-actions {
    width: 92px;
  }

  .doctable .icon-btn + .icon-btn {
    margin-left: 0;
  }

  .doc-meta {
    display: block;
  }

  .docitem-icon {
    display: none;
  }

  /* My Creators su telefono: i due saldi sotto il nome; statistiche su due colonne. */
  .crew-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "who" "nums";
  }

  .crew-money {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .money-chip {
    align-items: flex-start;
    min-width: 0;
  }

  .stat-row,
  .stat-row.stat-row-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mov.mov-plain {
    grid-template-areas: "icon text amount";
  }

  .sheet-backdrop {
    place-items: end stretch;
    padding: 0;
  }

  .sheet {
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
    border-radius: 28px 28px 0 0;
  }

  .flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .flow-to {
    align-items: flex-start;
    text-align: left;
  }

  .flow-arrow {
    transform: rotate(90deg);
  }

  .mov-amount {
    align-self: start;
  }

  .mov-extra {
    text-align: left;
    white-space: normal;
  }

  .mov-text strong {
    white-space: normal;
  }

  /* Creator: una scheda per riga, con "In attesa" in alto a destra. */
  .table-wrap {
    overflow: visible;
    margin: 0;
  }

  .table thead {
    display: none;
  }

  .table,
  .table tbody,
  .table tfoot {
    display: block;
  }

  .table tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "who who who"
      "withdrawn pending main";
    gap: 12px 10px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
  }

  .table tbody tr:first-child {
    border-top: 0;
    padding-top: 4px;
  }

  .table td {
    padding: 0;
    border: 0;
    text-align: left !important;
    white-space: normal;
  }

  .table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--faint);
  }

  .c-who {
    grid-area: who;
    align-self: center;
  }

  .c-who .split {
    max-width: none;
  }

  .c-withdrawn {
    grid-area: withdrawn;
    font-size: 15px;
  }

  .c-pending {
    grid-area: pending;
    font-size: 15px;
  }

  .c-main {
    grid-area: main;
    text-align: right !important;
    font-size: 15px;
  }

  .c-month {
    grid-area: month;
  }

  .c-last {
    grid-area: last;
  }

  .c-last .tag {
    white-space: normal;
    height: auto;
    padding: 3px 8px;
    text-align: right;
  }

  .table tfoot tr {
    grid-template-areas:
      "who who who"
      "withdrawn pending main";
  }

  .table tfoot .c-month,
  .table tfoot .c-last {
    display: none;
  }

  .table tfoot tr {
    border-top: 1px solid var(--line-strong);
  }

  .accounts,
  .tiles {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  #home-accounts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #home-accounts .acct {
    padding: 16px;
    gap: 6px;
  }

  #home-accounts .acct-amount {
    font-size: 22px;
  }

  #home-accounts .acct-amount .cents {
    font-size: 14px;
  }

  #home-accounts .acct-cur {
    display: none;
  }

  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tiles .tile:last-child {
    grid-column: 1 / -1;
  }

  /* Tre riquadri su telefono: due affiancati e uno su tutta la riga (il saldo del wallet sta sopra, gli altri sotto). */
  #creator-tiles,
  #creator-money,
  #wallet-tiles,
  #cosmo-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #wallet-tiles .tile:last-child {
    grid-column: auto;
  }

  #wallet-tiles .tile:first-child {
    grid-column: 1 / -1;
  }

  .acct {
    padding: 18px;
  }

  .accounts-lg .acct-amount {
    font-size: 30px;
  }

  .admin-bar {
    align-self: stretch;
  }

  .admin-bar .select {
    flex: 1;
  }

  .admin-bar select {
    width: 100%;
  }

  .tabbar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    padding: 6px;
    border-radius: 24px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border: 1px solid var(--line-strong);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
  }

  .tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
    border-radius: 18px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
  }

  .tabbar a.is-active {
    color: var(--text);
    background: var(--surface-2);
  }

  .toast {
    bottom: calc(100px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  .mov-text small {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
