:root {
  --fondo: #fafafa;
  --carta: #ffffff;
  --inchiostro: #18181b;
  --grigio: #71717a;
  --spento: #a1a1aa;
  --linea: rgba(24, 24, 27, 0.08);
  --pillola: #f4f4f5;
  --accento: #4f46e5;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; }

body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

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

.card {
  width: min(520px, 100%);
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.04), 0 24px 48px -24px rgba(24, 24, 27, 0.16);
  padding: clamp(14px, 3.6vmin, 22px);
  display: grid;
  gap: clamp(10px, 2.6vmin, 14px);
}

/* la domanda */
.ask { display: flex; align-items: center; gap: 8px; }
.ask__icon { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--spento); stroke-width: 1.6; stroke-linecap: round; }
.ask__text { font-size: clamp(12px, 3.2vmin, 14.5px); color: var(--grigio); font-variation-settings: "wght" 450; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* la riga di stato */
.status {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 12px;
  border-radius: 14px;
  background: var(--pillola);
  position: relative;
}

.status__mark { position: relative; width: 18px; height: 18px; }
.status__mark svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.status__track { fill: none; stroke: rgba(24, 24, 27, 0.1); stroke-width: 2; }
.status__arc { fill: none; stroke: var(--accento); stroke-width: 2; stroke-linecap: round; }
.status__ring { transform-origin: 50% 50%; }
.status__disc { fill: var(--inchiostro); }
.status__tick { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.status__check { opacity: 0; }

.status__text {
  font-size: clamp(14px, 4vmin, 18px);
  line-height: 1.25;
  height: 1.25em;
  white-space: nowrap;
  overflow: hidden;
  letter-spacing: -0.005em;
}

.lettera {
  display: inline-block;
  white-space: pre;
  will-change: transform;
}

.status__time {
  font-size: 12px;
  color: var(--grigio);
  font-variant-numeric: tabular-nums;
  font-variation-settings: "wght" 500;
}

.status__stop {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid var(--linea);
  border-radius: 8px;
  background: var(--carta);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.status__stop svg { width: 14px; height: 14px; fill: var(--inchiostro); }
.status__stop:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }

/* le fonti */
.sources { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; }
.fonte {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px 0 4px;
  border-radius: 99px;
  background: var(--pillola);
  border: 1px solid transparent;
  font-size: 12px;
  color: var(--grigio);
  font-variation-settings: "wght" 500;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.fonte__segno {
  width: 18px; height: 18px; border-radius: 6px;
  display: grid; place-items: center;
  background: var(--carta);
  border: 1px solid var(--linea);
  font-size: 10px; color: var(--inchiostro);
  font-variation-settings: "wght" 650;
}

/* la risposta */
.answer { font-size: clamp(13px, 3.6vmin, 16px); line-height: 1.55; color: var(--inchiostro); min-height: 4.65em; font-variation-settings: "wght" 420; }
.answer b { font-variation-settings: "wght" 620; font-weight: normal; }
.parola { display: inline-block; white-space: pre; }
.answer { position: relative; }
.scheletro { position: absolute; inset: 0.2em 0 auto 0; display: grid; gap: 0.55em; pointer-events: none; }
.scheletro i {
  display: block; height: 0.8em; border-radius: 6px;
  background: linear-gradient(90deg, #f1f1f3 0%, #f1f1f3 35%, #e2e2e7 50%, #f1f1f3 65%, #f1f1f3 100%);
  background-size: 300% 100%;
}
.scheletro i:nth-child(2) { width: 88%; }
.scheletro i:nth-child(3) { width: 56%; }

.foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--linea); padding-top: 12px; }
.foot__btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px 0 9px;
  border-radius: 9px; border: 1px solid var(--linea);
  background: var(--carta);
  color: var(--inchiostro);
  font: inherit; font-size: 12.5px; font-variation-settings: "wght" 560;
  cursor: pointer;
  box-shadow: 0 1px 1px rgba(24, 24, 27, 0.04);
  transition: background 0.2s, box-shadow 0.2s;
}
.foot__btn:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
.foot__icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.foot__icon--done { position: absolute; left: 9px; opacity: 0; }
.foot__note { font-size: 11.5px; color: var(--spento); text-align: right; }

@media (hover: hover) {
  .status__stop:hover { background: var(--pillola); }
  .fonte:hover { background: #ececee; color: var(--inchiostro); border-color: var(--linea); }
  .foot__btn:hover { background: var(--pillola); }
}

@media (max-width: 380px) {
  .foot__note { display: none; }
}
