:root {
  --fondo: #f4f4f5;
  --carta: #ffffff;
  --bordo: rgba(17, 17, 19, 0.08);
  --testo: #18181b;
  --testo-2: #71717a;
  --testo-3: #a1a1aa;
  --rosso: #e5484d;
  --rosso-scuro: #cd2b31;
  --rosso-tenue: #fdeceb;
  --ambra: #b4610e;
  --ambra-tenue: #fdf3e4;
  --verde: #2f8a4c;
  --verde-tenue: #eaf6ee;
  --accento: #5b5bd6;
}

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

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

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

.pezzo {
  width: min(320px, 100%);
  display: grid;
  justify-items: center;
  row-gap: clamp(10px, 2.2vh, 16px);
}

/* the plan card */
.piano {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--carta);
  border: 1px solid var(--bordo);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.04), 0 12px 32px -20px rgba(17, 17, 19, 0.28);
}

.piano__icona {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eeeefb;
  color: var(--accento);
}

.piano__icona svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.piano__testo { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.piano__nome { font-size: 14px; font-weight: 600; }
.piano__dati { font-size: 12px; color: var(--testo-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stato { flex: none; display: grid; }
.stato__voce {
  grid-area: 1 / 1;
  justify-self: end;
  font-size: 11px;
  font-weight: 560;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--verde-tenue);
  color: var(--verde);
  white-space: nowrap;
}
.stato__voce--fine { background: var(--ambra-tenue); color: var(--ambra); opacity: 0; visibility: hidden; }

/* the place of the button: as tall as the open confirmation, so the card never jumps */
.posto { width: 100%; display: flex; justify-content: center; align-items: flex-start; }

.morph {
  position: relative;
  overflow: hidden;
  background: var(--carta);
  border: 1px solid var(--bordo);
  border-radius: 22px;
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.05), 0 8px 22px -14px rgba(17, 17, 19, 0.3);
  will-change: width, height;
}

.strato { position: absolute; left: 0; top: 0; }

.strato--tasto {
  height: 42px;
  padding: 0 20px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 560;
  color: var(--testo-2);
  white-space: nowrap;
  transition: color 0.2s;
}
@media (hover: hover) {
  .strato--tasto:hover { color: var(--rosso-scuro); }
}
.strato--tasto.is-ghosthover { color: var(--rosso-scuro); }

.strato--conferma { width: min(320px, calc(100vw - 32px)); padding: 16px 16px 12px; }

.conferma__titolo { font-size: 15px; font-weight: 640; letter-spacing: -0.005em; }

.perdi { list-style: none; margin-top: 10px; display: grid; gap: 7px; }
.perdi__riga { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--testo-2); }
.perdi__riga svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--testo-3); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.scelte { margin-top: 14px; display: grid; grid-template-columns: 1fr 1.25fr; gap: 8px; }

.scelta {
  height: 38px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 580;
  white-space: nowrap;
}
.scelta--tieni { background: var(--testo); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 4px 10px -6px rgba(17, 17, 19, 0.6); }
.scelta--via {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--rosso-tenue);
  color: var(--rosso-scuro);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
@media (hover: hover) {
  .scelta--tieni:hover { background: #27272a; }
  .scelta--via:hover { background: #fbe1df; }
}
.scelta--via.is-ghosthover { background: #fbe1df; }

.anello { width: 18px; height: 18px; flex: none; }
.anello svg { width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.anello__fondo { fill: none; stroke: rgba(205, 43, 49, 0.22); stroke-width: 2; }
.anello__pieno { fill: none; stroke: var(--rosso); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: 100; }
.anello__segno { fill: none; stroke: var(--rosso); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100 100; stroke-dashoffset: 100; transform: rotate(90deg); transform-origin: 10px 10px; }

.via__scritte { display: grid; justify-items: center; }
.via__scritte > span { grid-area: 1 / 1; }
[data-via-scritta="tieni"], [data-via-scritta="fatto"] { opacity: 0; }

.conferma__nota { margin-top: 9px; text-align: center; font-size: 11.5px; color: var(--testo-3); }

.strato--fine {
  height: 42px;
  padding: 0 6px 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.fine__data { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 540; color: var(--testo); }
.fine__data svg { width: 17px; height: 17px; fill: none; stroke: var(--ambra); stroke-width: 1.6; stroke-linecap: round; }
.riprendi {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--testo);
  color: #fff;
  font-size: 12.5px;
  font-weight: 580;
}
@media (hover: hover) { .riprendi:hover { background: #27272a; } }

.strato:focus-visible, .scelta:focus-visible, .riprendi:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; border-radius: 12px; }

.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  margin: -3px 0 0 -4px;
  fill: #18181b;
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
  pointer-events: none;
  opacity: 0;
  z-index: 5;
}
