:root {
  --fondo: #f2f2f3;
  --card: #ffffff;
  --inchiostro: #141416;
  --grigio: #6f6f77;
  --grigio-chiaro: #a9a9b1;
  --bordo: rgba(20, 20, 22, 0.09);
  --campo: #f4f4f5;
  --accento: #4f46e5;
  --verde: #16a34a;
  --p1: #4f46e5;
  --p2: #f59e0b;
  --p3: #10b981;
  --p4: #ec4899;
}

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

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

.card {
  width: min(360px, 100%);
  background: var(--card);
  border: 1px solid var(--bordo);
  border-radius: 22px;
  padding: clamp(12px, 3.4vmin, 20px);
  box-shadow: 0 1px 2px rgba(20, 20, 22, 0.04), 0 24px 54px -26px rgba(20, 20, 22, 0.24);
}

/* ---- header ---- */
.head { display: flex; align-items: center; gap: 10px; }
.head__logo {
  width: 30px; height: 30px; flex: none;
  border-radius: 9px;
  background: linear-gradient(140deg, #6d64ff, var(--accento));
  display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 4px 10px -4px rgba(79, 70, 229, 0.6);
}
.head__logo svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.head__txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.head__app { font-size: 11px; color: var(--grigio-chiaro); font-weight: 520; }
.head__title { font-size: 14px; font-weight: 680; letter-spacing: -0.01em; }
.head__place {
  margin-left: auto;
  font-size: 11px; font-weight: 560; color: var(--grigio);
  background: var(--campo); border: 1px solid var(--bordo);
  border-radius: 99px; padding: 4px 9px;
  white-space: nowrap;
}

/* ---- total ---- */
.total { display: flex; align-items: baseline; justify-content: space-between; margin-top: clamp(10px, 2.6vmin, 16px); }
.total__label { font-size: 12px; color: var(--grigio); font-weight: 540; }
.total__amt { font-size: clamp(22px, 6vmin, 28px); font-weight: 700; letter-spacing: -0.02em; }

/* ---- money on wheels ---- */
.money { display: inline-flex; align-items: flex-end; line-height: 1.15em; }
.money .ch { display: block; height: 1.15em; line-height: 1.15em; }
.money .wheel { display: block; position: relative; width: 0.6em; height: 1.15em; overflow: hidden; }
.money .wheel__strip { position: absolute; left: 0; top: 0; width: 100%; display: flex; flex-direction: column; }
.money .wheel__strip span { display: block; height: 1.15em; line-height: 1.15em; text-align: center; }

/* ---- the bar of shares ---- */
.bar { position: relative; height: 8px; margin-top: 8px; border-radius: 99px; background: var(--campo); overflow: hidden; }
.seg {
  position: absolute; top: 0; bottom: 0; left: 0;
  border-radius: 99px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* ---- modes ---- */
.modes {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr;
  margin-top: clamp(10px, 2.6vmin, 14px);
  padding: 3px;
  background: var(--campo); border: 1px solid var(--bordo);
  border-radius: 11px;
}
.modes__pill {
  position: absolute; top: 3px; bottom: 3px; left: 3px;
  width: calc(50% - 3px);
  background: #fff; border-radius: 8px;
  box-shadow: 0 1px 2px rgba(20, 20, 22, 0.08), 0 2px 8px -3px rgba(20, 20, 22, 0.14);
}
.modes__btn { position: relative; z-index: 1; font-size: 12px; font-weight: 600; padding: 6px 0; color: var(--grigio); transition: color 0.25s; }
.modes__btn.is-on { color: var(--inchiostro); }

/* ---- people ---- */
.people { list-style: none; margin-top: clamp(4px, 1.4vmin, 8px); }
.person { border-bottom: 1px solid rgba(20, 20, 22, 0.06); }
.person:last-child { border-bottom: 0; }
.person__row { display: flex; align-items: center; gap: 10px; padding: clamp(6px, 1.7vmin, 9px) 0; }
.avatar {
  width: 28px; height: 28px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700; color: #fff; letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 0 2px #fff, 0 0 0 3px rgba(20, 20, 22, 0.06);
}
.person__txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; }
.person__name { font-size: 13px; font-weight: 620; }
.person__meta { font-size: 11px; color: var(--grigio-chiaro); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person__amt { font-size: 13.5px; font-weight: 640; }
.check {
  width: 22px; height: 22px; flex: none;
  border-radius: 7px;
  border: 1.5px solid rgba(20, 20, 22, 0.16);
  display: grid; place-items: center;
  background: #fff;
}
.check svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.check.is-on { background: var(--inchiostro); border-color: var(--inchiostro); }
.person.is-out .person__name, .person.is-out .person__amt { color: var(--grigio-chiaro); }
.person.is-out .avatar { filter: grayscale(1); opacity: 0.45; }

/* in Custom the slider takes the place of the line of detail under the name: the card never grows */
.person__sub { display: grid; align-items: center; height: 18px; }
.person__sub > * { grid-area: 1 / 1; }
.slide { display: flex; align-items: center; gap: 8px; height: 18px; opacity: 0; pointer-events: none; }
.slide.is-open { pointer-events: auto; }
.track { position: relative; flex: 1; height: 18px; touch-action: none; cursor: pointer; }
.track__rail { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 99px; background: var(--campo); }
.track__fill { position: absolute; left: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 99px; }
.knob {
  position: absolute; top: 50%; left: 0;
  width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(20, 20, 22, 0.22), 0 0 0 1px rgba(20, 20, 22, 0.06);
}
.knob__in { position: absolute; inset: 4.5px; border-radius: 50%; }
.slide__pct { font-size: 11px; line-height: 18px; font-weight: 620; color: var(--grigio); min-width: 28px; text-align: right; }

/* ---- request ---- */
.request {
  position: relative;
  width: 100%;
  height: 44px;
  margin-top: clamp(8px, 2.4vmin, 14px);
  border-radius: 13px;
  background: var(--inchiostro);
  color: #fff;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 8px 18px -10px rgba(20, 20, 22, 0.55);
}
.request__face, .request__busy, .request__done { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; }
.request__label { font-size: 13.5px; font-weight: 600; }
.request__amt { font-size: 13.5px; font-weight: 680; }
.request__busy, .request__done { opacity: 0; }
.request__spin { width: 18px; height: 18px; fill: none; stroke-width: 2.2; stroke-linecap: round; }
.request__spin circle { stroke: rgba(255, 255, 255, 0.22); }
.request__spin path { stroke: #fff; }
.request__done { font-size: 13.5px; font-weight: 620; }
.request__done svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.pointer {
  position: absolute; left: 0; top: 0;
  width: 20px; height: 20px;
  fill: #111; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.22));
  opacity: 0;
  pointer-events: none;
  z-index: 50;
}

/* short frames (the phone preview is 341 by 410): tighter spacing, same pieces */
@media (max-height: 480px) {
  .stage { padding: 8px; }
  .card { padding: 12px 13px; border-radius: 18px; }
  .head__logo { width: 26px; height: 26px; border-radius: 8px; }
  .total { margin-top: 8px; }
  .total__amt { font-size: 22px; }
  .bar { height: 6px; margin-top: 6px; }
  .modes { margin-top: 8px; }
  .modes__btn { padding: 5px 0; }
  .people { margin-top: 2px; }
  .person__row { padding: 5px 0; }
  .avatar { width: 26px; height: 26px; }
  .request { height: 40px; margin-top: 8px; border-radius: 12px; }
}

@media (hover: hover) {
  .check:hover { border-color: rgba(20, 20, 22, 0.32); }
  .modes__btn:hover { color: var(--inchiostro); }
  .request:hover { background: #26262b; }
}
