:root {
  --fondo: #fafafa;
  --carta: #ffffff;
  --bordo: rgba(17, 17, 19, 0.08);
  --riga: #f4f4f5;
  --binario: #e4e4e7;
  --testo: #18181b;
  --testo-2: #71717a;
  --testo-3: #a1a1aa;
  --entrata: #15803d;
  --accento: #2f5bea;
  --accento-chiaro: #e9efff;
  --trama: rgba(24, 24, 27, 0.16);
}

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

html, body { height: 100%; }

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

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3.5vmin, 40px);
}

.card {
  width: min(372px, 100%);
  padding: clamp(12px, 3vmin, 20px);
  background: var(--carta);
  border: 1px solid var(--bordo);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.04), 0 22px 46px -26px rgba(17, 17, 19, 0.32);
}

/* the bank and the account */
.top { display: flex; align-items: center; gap: 8px; }
.brand { display: inline-flex; align-items: center; gap: 7px; }
.brand__mark { width: 20px; height: 20px; }
.brand__mark rect { fill: var(--accento); }
.brand__mark path { fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; }
.brand__name { font-size: 13.5px; font-weight: 640; letter-spacing: -0.01em; }
.top__acc { margin-left: auto; font-size: 12px; color: var(--testo-3); }

/* the balance */
.bal { padding: clamp(10px, 3.2vmin, 20px) 2px clamp(10px, 3vmin, 18px); }
.bal__label { display: block; font-size: 12.5px; color: var(--testo-2); }
.bal__sub { display: block; height: 16px; overflow: hidden; margin-top: 4px; font-size: 12px; color: var(--testo-3); }
.bal__sub span { display: block; }

/* a figure: the digits and, on top, the veil with its fine hatch */
.num { position: relative; display: inline-block; vertical-align: top; line-height: 1.1; cursor: default; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.num--big { margin-top: 4px; font-size: clamp(30px, 8.8vmin, 40px); font-weight: 680; font-stretch: 92%; letter-spacing: -0.035em; }
.num--row { font-size: 13.5px; font-weight: 560; letter-spacing: -0.01em; }
.num--in { color: var(--entrata); }
.num__digits { display: inline-block; white-space: nowrap; }
.num__digits .c { display: inline-block; will-change: transform, filter; }
.num__veil {
  position: absolute;
  inset: -2px -5px;
  border-radius: 6px;
  background:
    repeating-linear-gradient(135deg, var(--trama) 0 1px, transparent 1px 4px),
    rgba(244, 244, 245, 0.55);
  opacity: 0;
  pointer-events: none;
  transform-origin: 0 50%;
}
.num--big .num__veil { inset: 2px -6px; border-radius: 10px; }

/* the switch row */
.row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: clamp(8px, 2.2vmin, 12px) clamp(8px, 2.2vmin, 12px);
  background: var(--riga);
  border-radius: 14px;
}
.eye {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: var(--carta);
  box-shadow: 0 0 0 1px var(--bordo);
  cursor: default;
}
.eye svg { width: 20px; height: 20px; overflow: visible; }
.eye svg path { fill: none; stroke: var(--testo); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.eye__iris { fill: var(--testo); }
.eye__closed, .eye__lash { opacity: 0; }

.row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row__name { font-size: 14px; font-weight: 600; }
.row__hint { display: block; height: 15px; overflow: hidden; font-size: 12px; color: var(--testo-2); }
.row__hint span { display: block; white-space: nowrap; }

.sw {
  flex: none;
  position: relative;
  width: 48px;
  height: 28px;
  border: 0;
  border-radius: 14px;
  background: var(--binario);
  cursor: pointer;
  outline: none;
}
.sw:focus-visible { box-shadow: 0 0 0 3px var(--accento-chiaro), 0 0 0 4px var(--accento); }
.sw__knob {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 22px;
  height: 22px;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16), 0 3px 8px rgba(0, 0, 0, 0.1);
}

/* recent activity */
.moves { list-style: none; margin-top: clamp(6px, 2vmin, 12px); }
.move {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: clamp(6px, 1.9vmin, 10px) 2px;
  border-top: 1px solid var(--riga);
}
.move:first-child { border-top: 0; }
.move__ic {
  flex: none;
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 9px;
  background: var(--riga);
  fill: none;
  stroke: var(--testo);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.move__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.move__name { font-size: 13.5px; font-weight: 540; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.move__when { font-size: 11.5px; color: var(--testo-3); }

.peek-tip { height: 24px; overflow: hidden; font-size: 11.5px; color: var(--testo-3); text-align: center; }
.peek-tip span { display: block; padding-top: 8px; }

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

@media (max-height: 470px) {
  .moves .move:nth-child(3) { display: none; }
}
