:root {
  --fondo: #ffffff;
  --inchiostro: #17171a;
  --grigio: #6e6e78;
  --grigio-chiaro: #a3a3ab;
  --bordo: #e7e5e0;
  --chip: #f2f1ed;
  --accento: #2f5bea;
  --accento-chiaro: #f1f4ff;
  --accento-bordo: #c8d3fb;
  --nero: #17171a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: clamp(14px, min(1.45vw, 2.5vh), 24px); }
html, body { height: 100%; }
body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

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

.pezzo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
}

/* ---- the stack of unread emails ---- */
.pila {
  position: relative;
  width: min(15.5rem, calc(100vw - 32px));
  height: 4.3rem;
}
.riga {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3.1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.8rem 0 0.6rem;
  background: #fff;
  border: 1px solid var(--bordo);
  border-radius: 0.85rem;
  box-shadow: 0 1px 0 rgba(23, 23, 26, 0.03), 0 10px 22px -14px rgba(23, 23, 26, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform-origin: 50% 100%;
  will-change: transform, opacity;
}
.riga__avatar {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  font-weight: 640;
  font-stretch: 105%;
  letter-spacing: 0.01em;
  color: var(--tinta-scura, #3b3b44);
  background: var(--tinta, #eeeeef);
  box-shadow: inset 0 0 0 1px rgba(23, 23, 26, 0.05);
}
.riga__testi {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  line-height: 1.1;
}
.riga__chi {
  font-size: 0.72rem;
  font-weight: 620;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.riga__oggetto {
  font-size: 0.66rem;
  color: var(--grigio);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.riga__ora {
  flex: none;
  align-self: flex-start;
  margin-top: 0.62rem;
  font-size: 0.6rem;
  color: var(--grigio-chiaro);
  font-variant-numeric: tabular-nums;
}
.vuoto {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.9rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--grigio);
  opacity: 0;
  visibility: hidden;
}

/* ---- the row: the button and Undo ---- */
.fila {
  display: flex;
  align-items: center;
}

/* the button: one element for GSAP (tasto), the inside for the CSS */
.tasto {
  position: relative;
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.tasto__corpo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  height: 3rem;
  padding: 0 0.62rem 0 1rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--bordo);
  box-shadow: 0 1px 0 rgba(23, 23, 26, 0.04), 0 10px 20px -12px rgba(23, 23, 26, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.25s ease, color 0.35s ease;
}
@media (hover: hover) {
  .tasto:hover .tasto__corpo { border-color: #d9d6cf; box-shadow: 0 1px 0 rgba(23, 23, 26, 0.04), 0 14px 26px -14px rgba(23, 23, 26, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.9); }
}
.tasto.is-ghosthover .tasto__corpo { border-color: #d9d6cf; }
.tasto:focus-visible { outline: none; }
.tasto:focus-visible .tasto__corpo { box-shadow: 0 0 0 3px var(--fondo), 0 0 0 5px var(--accento); }
.tasto.is-fatto .tasto__corpo {
  background: var(--accento-chiaro);
  border-color: var(--accento-bordo);
  color: var(--accento);
}

.scatola {
  width: 1.35rem;
  height: 1.35rem;
  flex: none;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.coperchio rect { fill: var(--fondo); }
.tasto.is-fatto .coperchio rect { fill: var(--accento-chiaro); }
.spunta { stroke-dasharray: 9; stroke-dashoffset: 9; }

.scritte {
  position: relative;
  display: block;
  height: 1.3rem;
  overflow: hidden;
}
.scritta {
  position: absolute;
  left: 0;
  top: 0;
  line-height: 1.3rem;
  font-size: 0.86rem;
  font-weight: 560;
  font-stretch: 104%;
  white-space: nowrap;
}
.scritta--fatto { visibility: hidden; }

.conto {
  position: relative;
  flex: none;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--chip);
  box-shadow: inset 0 0 0 1px rgba(23, 23, 26, 0.05);
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  color: var(--inchiostro);
}
.conto__cifra {
  grid-area: 1 / 1;
  line-height: 1;
}

/* ---- Undo ---- */
.posto-annulla {
  display: block;
  width: 0;
  overflow: visible;
  /* the slot only hides what is beyond its width on the left side; the Undo shadow can fall below and to the right */
  clip-path: inset(-1.4rem -1.4rem -1.6rem 0);
  padding: 0.5rem 0;
}
.annulla {
  appearance: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  margin-left: 0.55rem;
  height: 2.4rem;
  padding: 0 1rem;
  border-radius: 999px;
  background: var(--nero);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.24rem;
  box-shadow: 0 10px 18px -10px rgba(23, 23, 26, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
}
.annulla:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
.annulla__scritta { font-size: 0.74rem; font-weight: 600; line-height: 1; }
.annulla__tempo {
  display: block;
  width: 1.9rem;
  height: 1.5px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}
.annulla__tempo span {
  display: block;
  height: 100%;
  background: #fff;
  transform-origin: 0 50%;
}

.voce {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 1.3rem;
  height: 1.3rem;
  margin: -0.15rem 0 0 -0.25rem;
  fill: var(--inchiostro);
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18));
}
