:root {
  --fondo: #000000;
  --card: #0d0f0e;
  --card-2: #121513;
  --binario: rgba(255, 255, 255, 0.055);
  --bordo: rgba(255, 255, 255, 0.075);
  --testo: #f3f1ec;
  --testo-2: #9b9f9b;
  --testo-3: #5f645f;
  --pillola: #efe9dc;
  --inchiostro: #121412;
  --accento: #8fe3b4;
}

* { box-sizing: border-box; margin: 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;
}

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

/* ---- the card: dark green-black, a 1px rim that catches light from the top, soft stacked shadows ---- */
.card {
  position: relative;
  width: min(372px, 100%);
  padding: clamp(12px, 3.2vh, 20px) clamp(14px, 4.4vw, 20px) clamp(12px, 3vh, 18px);
  border-radius: 24px;
  background:
    radial-gradient(120% 70% at 85% -10%, rgba(143, 227, 180, 0.07), transparent 60%),
    linear-gradient(180deg, var(--card-2), var(--card));
  box-shadow:
    0 0 0 1px var(--bordo),
    0 1px 0 0 rgba(255, 255, 255, 0.06) inset,
    0 2px 4px rgba(0, 0, 0, 0.5),
    0 24px 60px -20px rgba(0, 0, 0, 0.9),
    0 40px 90px -40px rgba(143, 227, 180, 0.10);
  isolation: isolate;
  overflow: hidden;
}
.card__grain {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.card__rim {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 38%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

.head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 7px; }
.brand__mark { width: 18px; height: 18px; fill: none; stroke: var(--accento); stroke-width: 1.6; stroke-linecap: round; }
.brand__name { font-size: 14px; font-weight: 640; letter-spacing: -0.01em; font-variation-settings: "wdth" 104; }
.head__acct { font-size: 11.5px; color: var(--testo-2); font-weight: 480; white-space: nowrap; }

/* ---- the tabs: a recessed track, the pill below the labels and an ink copy of the labels clipped to the pill ---- */
.tabs {
  position: relative;
  display: flex;
  gap: 2px;
  margin-top: clamp(10px, 2.8vh, 16px);
  padding: 4px;
  border-radius: 999px;
  background: var(--binario);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05), 0 1px 2px rgba(0, 0, 0, 0.6) inset, 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}
.tab, .ink {
  flex: 1 1 auto;
  padding: 0 14px;
  height: clamp(30px, 7.4vh, 36px);
  display: grid;
  place-items: center;
  font: inherit;
  font-size: 13.5px;
  font-weight: 560;
  letter-spacing: -0.005em;
  font-variation-settings: "wdth" 100;
  white-space: nowrap;
}
.tab {
  position: relative; z-index: 2;
  border: 0; background: none; color: var(--testo-2);
  border-radius: 999px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.25s;
}
.tab:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
.tabs__ink {
  position: absolute; inset: 4px; z-index: 3; display: flex; gap: 2px; pointer-events: none;
  color: var(--inchiostro);
  clip-path: inset(0 100% 0 0 round 999px);
}
.ink { padding: 0 14px; }
.pill {
  position: absolute; z-index: 1; top: 4px; left: 0; height: calc(100% - 8px);
  width: 80px;
  transform-origin: 50% 50%;
  will-change: transform, width;
}
.pill__in {
  position: absolute; inset: 0; border-radius: 999px; overflow: hidden;
  background: linear-gradient(180deg, #f7f3ea, var(--pillola));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 -1px 0 rgba(0, 0, 0, 0.08) inset,
    0 1px 2px rgba(0, 0, 0, 0.5),
    0 6px 14px -6px rgba(0, 0, 0, 0.8);
}
.pill__shine {
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.7) 48%, transparent 64%);
  transform: translateX(-120%);
}
.tabs__hover {
  position: absolute; z-index: 0; top: 4px; height: calc(100% - 8px); left: 0; width: 60px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.06); opacity: 0;
}
@media (hover: hover) {
  .tab:hover { color: var(--testo); }
}

/* ---- the figure ---- */
.stat { margin-top: clamp(12px, 3.2vh, 20px); }
.stat__label, .stat__note { font-size: 12px; color: var(--testo-2); font-weight: 480; }
.stat__note { color: var(--testo-3); margin-top: 2px; }
.stat__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
[data-swap] { position: relative; display: inline-grid; overflow: hidden; vertical-align: top; }
[data-swap] > .sw { grid-area: 1 / 1; display: block; white-space: nowrap; }

.amount {
  display: inline-flex; align-items: flex-start;
  font-size: clamp(30px, 8.6vh, 38px);
  font-weight: 620;
  letter-spacing: -0.035em;
  font-variation-settings: "wdth" 96;
  line-height: 1;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.amount__cur { display: inline-block; margin-right: 0.04em; font-size: 0.62em; margin-top: 0.12em; color: var(--testo-2); font-weight: 560; }
.amount__digits { display: inline-flex; }
.slot { display: inline-block; height: 1.08em; overflow: hidden; position: relative; -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent); mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent); }
.slot--p { -webkit-mask-image: none; mask-image: none; }
.slot--p { color: var(--testo-2); }
.slot--dec { color: var(--testo-2); }
.col { display: block; }
.col > span { display: block; height: 1.08em; line-height: 1.08em; text-align: center; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px 4px 7px; border-radius: 999px;
  background: rgba(143, 227, 180, 0.1);
  box-shadow: 0 0 0 1px rgba(143, 227, 180, 0.16) inset;
  color: var(--accento); font-size: 12px; font-weight: 600;
  
  white-space: nowrap;
}
.chip__arrow { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---- the chart ---- */
.chart {
  position: relative;
  margin-top: clamp(8px, 2.4vh, 14px);
  height: clamp(74px, 21vh, 118px);
  touch-action: pan-y;
  cursor: crosshair;
}
.chart__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart__grid line { stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; stroke-dasharray: 2 4; }
.chart__line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart__level { stroke: var(--accento); stroke-opacity: 0.5; stroke-width: 1; stroke-dasharray: 3 3; }
.chart__scrub { stroke: rgba(243, 241, 236, 0.55); stroke-width: 1; opacity: 0; }
.tag {
  position: absolute; right: 0; top: 0;
  transform: translateY(-50%);
  font-size: 10.5px; font-weight: 660;  white-space: nowrap;
}
.tag__txt {
  box-shadow: 0 2px 8px -2px rgba(143, 227, 180, 0.45);
  display: block; padding: 2px 6px; border-radius: 6px;
  background: var(--accento); color: #0b1a12;
  transform-origin: 100% 50%;
}
.axis { display: flex; justify-content: space-between; margin-top: 6px; padding-right: 50px; font-size: 10.5px; color: var(--testo-3); font-weight: 500; }

.foot { margin-top: clamp(10px, 2.6vh, 16px); padding-top: clamp(8px, 2.2vh, 12px); border-top: 1px solid rgba(255, 255, 255, 0.06); }
.foot__row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.foot__k { color: var(--testo-2); font-weight: 480; }
.foot__v { color: var(--testo); font-weight: 580;  }
.foot__track { display: block; position: relative; height: 4px; margin-top: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.foot__fill { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, rgba(143, 227, 180, 0.55), var(--accento)); transform-origin: 0 50%; transform: scaleX(0.676); }

@media (max-width: 380px) {
  .tab, .ink { padding: 0 10px; font-size: 12.5px; }
  .head__acct { font-size: 11px; }
}
