:root {
  --fondo: #ffffff;
  --card: #ffffff;
  --dietro: #fafafa;
  --inchiostro: #111113;
  --grigio: #6d6d75;
  --grigio-chiaro: #a1a1aa;
  --bordo: rgba(17, 17, 19, 0.09);
  --riga: rgba(17, 17, 19, 0.07);
  --campo: #f4f4f5;
  --accento: #0f9f6e;
  --accento-chiaro: #e3f5ec;
  --alta: 70px;
}

* { 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;
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

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

/* the box is as tall as an open notification plus the edge of the one behind, so nothing ever leaves it */
.wrap {
  position: relative;
  width: min(392px, calc(100vw - 32px));
  height: calc(var(--alta) + 48px + 14px);
}

.stack { position: absolute; inset: 0; }

.note {
  position: absolute; left: 0; right: 0; top: 0;
  height: var(--alta);
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--bordo);
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.04), 0 10px 28px -14px rgba(17, 17, 19, 0.2);
  transform-origin: 50% 100%;
  overflow: hidden;
  outline: none;
  visibility: hidden;
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
  will-change: transform;
}
.note.is-open { box-shadow: 0 1px 2px rgba(17, 17, 19, 0.05), 0 18px 40px -16px rgba(17, 17, 19, 0.26); }
.note.is-press { box-shadow: 0 1px 1px rgba(17, 17, 19, 0.06), 0 6px 16px -10px rgba(17, 17, 19, 0.24); }
.note.is-back { background: var(--dietro); }
.note:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accento), 0 10px 28px -14px rgba(17, 17, 19, 0.2); }

.note__row {
  height: var(--alta);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 15px 0 14px;
}

/* the icon: a tray and an arrow that draws itself in when the money lands */
.ico {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--campo);
  display: grid; place-items: center;
}
.ico__glow { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; }
.ico__shine {
  position: absolute; top: -30%; bottom: -30%; left: 0; width: 46%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0));
}
.ico svg {
  position: relative;
  width: 22px; height: 22px;
  fill: none; stroke: var(--grigio-chiaro); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  overflow: visible;
}
.ico__arrow { stroke: var(--accento); }
.ico__badge {
  position: absolute; top: -6px; right: -7px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px;
  background: var(--inchiostro); color: #fff;
  box-shadow: 0 0 0 2px var(--card);
  font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center;
  opacity: 0;
}

.note__text { min-width: 0; }
.note__title { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.note__head {
  font-size: 14px; font-weight: 620; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.note__when { flex: none; font-size: 11.5px; color: var(--grigio-chiaro); font-weight: 500; }
.note__from {
  margin-top: 3px;
  font-size: 12.5px; color: var(--grigio);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.note__from b { font-weight: 560; color: #3f3f46; }

.note__money { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }

/* rolling figures: every digit is a column holding a strip of all ten digits, so every column is as wide as the
   widest digit: tabular spacing that never jitters, with the font's own drawing of the figures */
.amount, .balance__value {
  display: inline-flex;
  white-space: nowrap;
}
.amount {
  min-height: 1.2em;
  font-size: 16.5px; font-weight: 660; letter-spacing: -0.015em;
  color: var(--accento);
}
.balance { display: inline-flex; align-items: baseline; gap: 4px; font-size: 11.5px; color: var(--grigio-chiaro); }
.balance__value { color: var(--grigio); font-weight: 560; }
.balance__up {
  width: 10px; height: 10px; align-self: center; margin-right: -1px;
  fill: none; stroke: var(--accento); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0;
}

.col {
  display: inline-block;
  height: 1.2em;
  overflow: hidden;
  vertical-align: top;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
}
.strip { display: block; }
.strip > span, .sym { display: block; height: 1.2em; line-height: 1.2em; text-align: center; }
.sym { display: inline-block; }

/* the row that opens under the pointer */
.note__more {
  position: relative;
  height: 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 12px 10px 14px;
}
.note__more::before {
  content: ""; position: absolute; left: 14px; right: 14px; top: 0;
  height: 1px; background: var(--riga);
}
.note__meta {
  min-width: 0;
  font-size: 12px; color: var(--grigio);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.view {
  flex: none;
  height: 30px; padding: 0 10px 0 13px;
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px;
  background: var(--inchiostro); color: #fff;
  font-size: 12.5px; font-weight: 600; letter-spacing: -0.005em;
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: background-color 0.2s ease;
}
.view__arr { display: inline-grid; width: 14px; height: 14px; overflow: hidden; }
.view__arr svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.25s ease; }
.view.is-hover { background: #2b2b30; }
.view.is-hover svg { transform: translateX(1.5px); }
@media (hover: hover) {
  .view:hover { background: #2b2b30; }
  .view:hover svg { transform: translateX(1.5px); }
}
.view:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }

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

@media (max-width: 420px) {
  .note__row { gap: 9px; padding: 0 11px 0 10px; }
  .ico { width: 34px; height: 34px; border-radius: 10px; }
  .ico svg { width: 19px; height: 19px; }
  .ico__badge { top: -6px; right: -6px; min-width: 17px; height: 17px; line-height: 17px; font-size: 10px; }
  .note__head { font-size: 13.5px; }
  .note__when, .note__brand { display: none; }
  .note__from { font-size: 11.5px; }
  .amount { font-size: 15.5px; }
  .balance { font-size: 10.5px; gap: 3px; }
  .note__more { padding: 0 10px 10px 10px; }
  .note__more::before { left: 10px; right: 10px; }
  .note__meta { font-size: 11.5px; }
}
