:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --inchiostro: #0a0a0a;
  --grigio: #71717a;
  --linea: rgba(10, 10, 10, 0.08);
  --morbido: #f4f4f5;
  --accento: #4f46e5;
  --accento-chiaro: #eef0ff;
}

* { 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; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }

.stage { position: relative; height: 100vh; min-height: 0; }

/* the notice: GSAP owns its width, height and position; the two faces live inside at fixed widths */
.box {
  position: absolute;
  left: 50%;
  bottom: max(16px, calc(50vh - 172px));
  width: 320px;
  height: 64px;
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(10, 10, 10, 0.05), 0 10px 24px -14px rgba(10, 10, 10, 0.28);
}

.tile {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--accento-chiaro);
  color: var(--accento);
}
.tile svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tile--big { width: 40px; height: 40px; border-radius: 12px; }

/* the small face */
.compact {
  position: absolute; left: 0; bottom: 0;
  height: 62px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 11px 0 13px;
}
.compact__text { position: relative; display: flex; flex-direction: column; min-width: 0; flex: 1; overflow: hidden; }
.pill__short { display: none; }
.compact__title { display: block; font-size: 14px; line-height: 1.25; font-weight: 620; letter-spacing: -0.01em; white-space: nowrap; }
.compact__title--done { position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 6px; opacity: 0; color: var(--inchiostro); }
.compact__sub { font-size: 12px; color: var(--grigio); margin-top: 1px; white-space: nowrap; }
.mini-check { width: 15px; height: 15px; fill: none; stroke: var(--accento); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.ver { font-variant-numeric: tabular-nums; }
.digit { position: relative; display: inline-block; height: 1.25em; overflow: hidden; vertical-align: -0.29em; }
.digit__col { display: flex; flex-direction: column; line-height: 1.25em; }

.pill {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: -0.005em;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background-color 0.2s, box-shadow 0.2s;
}
.pill:focus-visible, .close:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
.pill--soft { background: var(--morbido); flex: none; }
.pill--ink { background: var(--inchiostro); color: #fff; box-shadow: 0 1px 1px rgba(10, 10, 10, 0.2), 0 6px 14px -8px rgba(10, 10, 10, 0.6); }
.pill--ghost { color: var(--grigio); }
.pill__arrow { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* the open face */
/* the invisible frame of the open card, for the preview: same anchor as the notice, size set by the script */
.frame { position: absolute; left: 50%; bottom: max(16px, calc(50vh - 172px)); transform: translateX(-50%); width: 394px; height: 300px; pointer-events: none; visibility: hidden; }

.full {
  position: absolute; left: 0; bottom: 0;
  padding: 16px 16px 14px;
  opacity: 0;
  pointer-events: none;
}
.full__head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--linea); }
.full__head > div { flex: 1; min-width: 0; }
.full__title { font-size: 15.5px; font-weight: 650; letter-spacing: -0.015em; }
.full__sub { font-size: 12px; color: var(--grigio); margin-top: 2px; }
.close { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--grigio); flex: none; }
.close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

.items { list-style: none; padding: 6px 0 4px; }
.item { display: flex; gap: 12px; align-items: flex-start; padding: 9px 2px; }
.item__icon {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--linea);
  color: var(--inchiostro);
}
.item__icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.item__text { display: flex; flex-direction: column; min-width: 0; }
.item__title { font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 7px; }
.item__line { font-size: 12.5px; color: var(--grigio); line-height: 1.4; margin-top: 2px; }
.tag {
  display: inline-block;
  font-size: 10.5px; font-weight: 640; letter-spacing: 0.01em;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accento-chiaro);
  color: var(--accento);
}

.foot { position: relative; height: 44px; margin-top: 6px; }
.foot__actions { position: absolute; inset: 0; display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.foot__progress { position: absolute; left: 0; right: 0; top: 6px; opacity: 0; }
.foot__row { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 560; }
.foot__pct { font-variant-numeric: tabular-nums; color: var(--grigio); }
.bar { display: block; height: 4px; margin-top: 9px; border-radius: 99px; background: var(--morbido); overflow: hidden; }
.bar__fill { display: block; height: 100%; width: 100%; border-radius: 99px; background: var(--accento); transform-origin: 0 50%; transform: scaleX(0); }
.foot__done { position: absolute; inset: 0; display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 620; opacity: 0; }
.foot__hint { margin-left: auto; font-size: 12px; font-weight: 480; color: var(--grigio); }
.big-check { width: 20px; height: 20px; fill: none; stroke: var(--accento); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }

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

@media (hover: hover) {
  .pill--soft:hover { background: #e9e9ec; }
  .pill--ink:hover { box-shadow: 0 1px 1px rgba(10, 10, 10, 0.2), 0 10px 20px -10px rgba(10, 10, 10, 0.7); }
  .pill--ghost:hover { color: var(--inchiostro); background: var(--morbido); }
  .close:hover { background: var(--morbido); color: var(--inchiostro); }
}

@media (max-width: 380px) {
  .compact__sub { display: none; }
  .pill__long { display: none; }
  .pill__short { display: inline; }
  .compact { gap: 10px; padding: 0 9px 0 11px; }
}
