:root {
  --fondo: #f2f2f2;
  --card: #ffffff;
  --inchiostro: #111113;
  --grigio: #71717a;
  --grigio-chiaro: #a1a1aa;
  --bordo: rgba(17, 17, 19, 0.08);
  --traccia: rgba(17, 17, 19, 0.1);
  --ok: #16a34a;
  --errore: #dc2626;
}

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

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

/* the row: one file icon, two lines of text, the button */
.sync {
  width: min(400px, 100%);
  display: flex;
  align-items: center;
  gap: clamp(10px, 3vmin, 14px);
  padding: clamp(12px, 3.4vmin, 16px) clamp(12px, 3.4vmin, 16px) clamp(12px, 3.4vmin, 16px) clamp(12px, 3.4vmin, 18px);
  background: var(--card);
  border: 1px solid var(--bordo);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.04), 0 16px 40px -20px rgba(17, 17, 19, 0.22);
}

.sync__files { flex: none; width: 34px; height: 34px; }
.sync__files svg { width: 100%; height: 100%; overflow: visible; fill: none; stroke: var(--inchiostro); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.sync__files .sheet { fill: #fff; }
.sync__files .sheet--back { stroke: var(--grigio-chiaro); }
.sync__files .lines { stroke: var(--grigio-chiaro); }

.sync__text { flex: 1; min-width: 0; }
.sync__title { font-size: 14.5px; font-weight: 640; letter-spacing: -0.01em; line-height: 1.3; }
.sync__sub { margin-top: 2px; font-size: 12.5px; color: var(--grigio); line-height: 1.3; font-variant-numeric: tabular-nums; }

/* a line that rolls its words up when it changes */
.roll { position: relative; display: inline-block; overflow: hidden; vertical-align: top; white-space: nowrap; max-width: 100%; }
.roll__in { display: inline-block; }
.roll__in + .roll__in { position: absolute; left: 0; top: 0; }

/* the button: a dark pill, a ring for the loading, an arrow, a check, two labels */
.retry {
  position: relative;
  flex: none;
  height: 40px;
  width: 92px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 620;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-radius: 999px;
}
.retry:focus-visible { outline: 2px solid var(--inchiostro); outline-offset: 3px; }

.retry__face {
  position: absolute; inset: 0;
  border-radius: 999px;
  background: var(--inchiostro);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 2px rgba(17, 17, 19, 0.2), 0 8px 18px -8px rgba(17, 17, 19, 0.55);
}

.retry__ring {
  position: absolute; left: 50%; top: 50%;
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  transform: rotate(-90deg);
  fill: none; stroke-width: 1.6;
  opacity: 0;
  pointer-events: none;
}
.retry__track { stroke: var(--traccia); }
.retry__arc { stroke: var(--inchiostro); stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; }

.retry__icon {
  position: absolute; left: 15px; top: 50%;
  width: 16px; height: 16px; margin-top: -8px;
}
.retry__icon svg { width: 100%; height: 100%; display: block; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.retry__check {
  position: absolute; left: 14px; top: 50%;
  width: 17px; height: 17px; margin-top: -8.5px;
  fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1 1; stroke-dashoffset: 1;
}

.retry__labels { position: absolute; left: 39px; right: 12px; top: 0; height: 100%; overflow: hidden; }
.retry__label { position: absolute; left: 0; top: 50%; transform: translateY(-50%); white-space: nowrap; line-height: 1; }
.retry__label[data-label-done] { opacity: 0; }

@media (hover: hover) {
  .retry:hover .retry__icon svg { transform: rotate(-28deg); }
}
.retry.is-hover .retry__icon svg { transform: rotate(-28deg); }
.retry__icon svg { transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }

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

@media (max-width: 380px) {
  .sync__title { font-size: 13.5px; }
  .sync__sub { font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .retry__icon svg { transition: none; }
}

/* on big screens the row grows a little, like the piece would sit in a real app at a larger zoom */
@media (min-width: 1100px) and (min-height: 700px) {
  .sync { scale: 1.3; }
}
