:root {
  --fondo: #fafafa;
  --card: #ffffff;
  --inchiostro: #111113;
  --grigio: #6f6f77;
  --grigio-chiaro: #a1a1aa;
  --bordo: rgba(17, 17, 19, 0.09);
  --campo: #f4f4f5;
  --accento: #0f9d6b;
  --accento-velo: rgba(15, 157, 107, 0.09);
  --accento-bordo: rgba(15, 157, 107, 0.24);
  --banca-a: #2541a8;
  --banca-b: #1d6b45;
  --banca-c: #a3401c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

/* ---------- the accounts card ---------- */
.bk {
  position: relative;
  width: min(360px, 100%);
  background: var(--card);
  border: 1px solid var(--bordo);
  border-radius: 20px;
  padding: clamp(14px, 3.6vmin, 20px);
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.04), 0 18px 48px -18px rgba(17, 17, 19, 0.16);
}

.bk__head { display: flex; align-items: center; gap: 10px; }
.bk__mark {
  flex: none; width: 28px; height: 28px; padding: 5px; border-radius: 8px;
  background: var(--inchiostro);
  fill: none; stroke: #fff; stroke-width: 2.1; stroke-linecap: round;
}
.bk__brand { font-size: 14.5px; font-weight: 640; letter-spacing: -0.01em; flex: 1; }
.bk__brand span { color: var(--grigio-chiaro); font-weight: 500; }
.bk__state {
  font-size: 11.5px; font-weight: 600; color: var(--grigio);
  padding: 3px 9px; border-radius: 99px; background: var(--campo); border: 1px solid var(--bordo);
  white-space: nowrap;
}
.bk__state.is-on { color: var(--accento); background: var(--accento-velo); border-color: var(--accento-bordo); }

.bk__lead { margin-top: clamp(8px, 2.4vmin, 12px); font-size: 13px; line-height: 1.4; color: var(--grigio); }

/* ---------- the two ends and the wire ---------- */
.link {
  display: grid; grid-template-columns: auto 1fr auto; align-items: start;
  margin-top: clamp(12px, 3.4vmin, 18px);
}
.node { display: grid; justify-items: center; gap: 5px; width: 72px; }
.node__box {
  position: relative;
  display: grid; place-items: center;
  width: clamp(44px, 12vmin, 50px); aspect-ratio: 1;
  border-radius: 14px;
}
.node__box svg { width: 56%; height: 56%; }
.node__box--app { background: var(--inchiostro); box-shadow: 0 6px 14px -6px rgba(17, 17, 19, 0.5); }
.node__box--app svg { fill: none; stroke: #fff; stroke-width: 2.1; stroke-linecap: round; }
.node__box--slot { border: 1.5px dashed rgba(17, 17, 19, 0.2); background: var(--fondo); }
.node__box--slot.is-full { border-style: solid; border-color: var(--bordo); background: #fff; box-shadow: 0 6px 14px -8px rgba(17, 17, 19, 0.3); }
.slot__plus { fill: none; stroke: var(--grigio-chiaro); stroke-width: 1.8; stroke-linecap: round; }
.slot__logo { position: absolute; inset: 0; display: grid; place-items: center; }
.slot__logo svg { width: 56%; height: 56%; }
.node__name { font-size: 11.5px; font-weight: 560; color: var(--grigio); white-space: nowrap; }

.wire { width: 100%; height: clamp(44px, 12vmin, 50px); overflow: visible; }
.wire path { fill: none; stroke-linecap: round; }
.wire__base { stroke: rgba(17, 17, 19, 0.16); stroke-width: 1.5; stroke-dasharray: 1.5 5; }
.wire__live { stroke: var(--accento); stroke-width: 1.8; }
.wire__spark { stroke: var(--accento); stroke-width: 3.4; opacity: 0; }

/* ---------- the balance and the accounts ---------- */
.bal { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: clamp(10px, 3vmin, 16px); }
.bal__label { font-size: 12px; color: var(--grigio-chiaro); font-weight: 560; }
.bal__num { font-size: clamp(22px, 6.2vmin, 26px); font-weight: 680; letter-spacing: -0.02em; font-stretch: 94%; line-height: 1; display: flex; }
.bal__num .ch { display: inline-block; height: 1em; }
.bal__num .d { display: inline-block; width: 0.6em; height: 1em; overflow: hidden; text-align: center; }
.bal__num .col { display: block; }
.bal__num .col span { display: block; height: 1em; }
.bal__num.is-empty { color: var(--grigio-chiaro); }

.acc { list-style: none; margin-top: 8px; }
.acc li {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 13px; color: var(--grigio);
  border-top: 1px solid var(--bordo);
  overflow: hidden;
}
.acc li > span { padding: clamp(6px, 1.7vmin, 8px) 0; }
.acc li span:last-child { color: var(--inchiostro); font-weight: 580; }

/* ---------- the button and the row of banks ---------- */
.bk__foot { position: relative; margin-top: clamp(12px, 3.4vmin, 16px); }

.cb {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 44px; padding: 0 16px;
  border: 0; border-radius: 99px;
  background: var(--inchiostro); color: #fff;
  font: inherit; font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 8px 18px -8px rgba(17, 17, 19, 0.55);
  transition: box-shadow 0.25s;
}
.cb:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }
.cb.is-hover { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 12px 22px -8px rgba(17, 17, 19, 0.6); }
@media (hover: hover) { .cb:hover { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 12px 22px -8px rgba(17, 17, 19, 0.6); } }
.cb__icon { position: relative; width: 20px; height: 20px; flex: none; }
.cb__icon svg { position: absolute; inset: 0; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.cb__ring, .cb__check { opacity: 0; }
.ring__bg { stroke: rgba(255, 255, 255, 0.22); }
.ring__fg { stroke: #fff; stroke-dasharray: 14 34; transform-origin: 12px 12px; }
.cb__label { position: relative; display: inline-block; }

.pick {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 10px);
  width: max-content; margin: 0 auto;
  display: flex; gap: 6px; padding: 6px;
  background: #fff; border: 1px solid var(--bordo); border-radius: 18px;
  box-shadow: 0 2px 4px rgba(17, 17, 19, 0.05), 0 22px 44px -16px rgba(17, 17, 19, 0.3);
  visibility: hidden;
  z-index: 3;
}
.chip {
  display: grid; justify-items: center; gap: 6px;
  width: clamp(70px, 21vmin, 82px); padding: 10px 4px 8px;
  border: 1px solid transparent; border-radius: 13px;
  background: var(--campo);
  font: inherit; font-size: 11.5px; font-weight: 600; color: var(--inchiostro);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, border-color 0.2s;
}
.chip.is-hover { background: #fff; border-color: var(--bordo); }
@media (hover: hover) { .chip:hover { background: #fff; border-color: var(--bordo); } }
.chip:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
.logo { width: 26px; height: 26px; }
.logo--a { fill: none; stroke: var(--banca-a); stroke-width: 1.8; }
.logo--a .logo__fill { fill: var(--banca-a); stroke: none; }
.logo--b .logo__fill { fill: var(--banca-b); }
.logo--b .logo__fill + .logo__fill { opacity: 0.72; }
.logo--c .logo__fill { fill: var(--banca-c); }

.flyer { position: absolute; left: 0; top: 0; width: 26px; height: 26px; pointer-events: none; z-index: 4; }
.flyer svg { width: 100%; height: 100%; display: block; }

/* ---------- the drawn pointer ---------- */
.ghost {
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px;
  fill: var(--inchiostro); stroke: #fff; stroke-width: 1.4; stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18));
  pointer-events: none;
  opacity: 0;
  z-index: 5;
}

@media (max-height: 470px) {
  .bk__lead { display: none; }
}
@media (max-width: 360px) {
  .node { width: 62px; }
}
