:root {
  --fondo: #f5f5f3;
  --schermo: #ffffff;
  --inchiostro: #121214;
  --grigio: #6c6c74;
  --grigio-chiaro: #a3a3ab;
  --linea: rgba(18, 18, 20, 0.07);
  --scuro: #17171a;
  --accento: #2f6bff;
  --errore: #e5484d;
}

* { 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", "Mona Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

/* the small app window: always visible, it is also what the preview frames */
.screen {
  position: relative;
  width: min(340px, 100%);
  height: min(420px, calc(100vh - 28px));
  background: var(--schermo);
  border-radius: 22px;
  border: 1px solid var(--linea);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 18px 40px -18px rgba(20, 20, 40, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 10px;
}
.brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 640; font-size: 14px; letter-spacing: -0.01em; }
.brand svg { width: 18px; height: 18px; fill: none; stroke: var(--accento); stroke-width: 1.8; stroke-linejoin: round; }
.top__title { font-size: 12px; color: var(--grigio); font-weight: 520; }

.list { list-style: none; padding: 0 8px; display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-height: 0; }
.row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: min(10px, 1.6vh) 10px; border-radius: 12px;
}
.av {
  width: min(36px, 7vh); height: min(36px, 7vh); border-radius: 50%;
  background: var(--av); display: grid; place-items: center;
  font-size: 11px; font-weight: 650; color: #3a3a44; letter-spacing: 0.02em;
}
.row__txt { display: flex; flex-direction: column; min-width: 0; }
.row__name { font-size: 13.5px; font-weight: 620; }
.row__msg { font-size: 12.5px; color: var(--grigio); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__time { font-size: 11px; color: var(--grigio-chiaro); align-self: start; padding-top: 3px; }

/* a message written while offline, waiting at the bottom of the inbox */
.draft {
  margin: 0 16px 76px; padding: 10px 12px; border-radius: 14px 14px 4px 14px;
  background: #eef2ff; align-self: flex-end; max-width: 78%;
  display: flex; flex-direction: column; gap: 2px;
}
.draft__txt { font-size: 12.5px; }
.draft__state { font-size: 10.5px; color: var(--grigio); text-align: right; }

/* the notice */
.toast {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px;
  padding: 10px 10px 10px 10px;
  border-radius: 16px;
  background: var(--scuro);
  color: #fff;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.45);
  will-change: transform;
}
.toast__bg {
  position: absolute; inset: 0; border-radius: inherit; background: #fff; opacity: 0;
  border: 1px solid var(--linea);
}
.wifi { position: relative; width: 38px; height: 38px; display: grid; place-items: center; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 1.6; }
.ring__track { stroke: rgba(255, 255, 255, 0.12); }
.ring__run { stroke: rgba(255, 255, 255, 0.75); stroke-linecap: round; }
.arcs, .tick { position: absolute; width: 22px; height: 22px; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.arc { stroke: #fff; stroke-width: 2; }
.arc--base { stroke-width: 2.6; }
.cross { stroke: var(--errore); stroke-width: 2; }
.tick path { stroke: #fff; stroke-width: 2.4; }
.tick { width: 18px; height: 18px; }

.toast__txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; position: relative; }
.toast__title { font-size: 13.5px; font-weight: 640; letter-spacing: -0.005em; height: 18px; overflow: hidden; position: relative; }
.toast__sub { font-size: 11.5px; color: rgba(255, 255, 255, 0.62); height: 16px; line-height: 16px; overflow: hidden; white-space: nowrap; }
.swap, .digit { position: relative; display: inline-block; }
.swap > span, .digit > span { display: block; white-space: nowrap; }
.digit { height: 16px; overflow: hidden; min-width: 0.62em; text-align: center; vertical-align: bottom; }
.digit > span { line-height: 16px; }

.retry {
  position: relative;
  font: inherit; font-size: 12.5px; font-weight: 620;
  color: var(--scuro); background: #fff;
  border: 0; border-radius: 999px; padding: 8px 13px; cursor: pointer;
  will-change: transform;
}
.retry:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
@media (hover: hover) { .retry:hover { background: #ececf0; } }

.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;
}
