:root {
  --fondo: #ffffff;
  --inchiostro: #111113;
  --grigio: #6f6f77;
  --grigio-chiaro: #a1a1aa;
  --bordo: rgba(17, 17, 19, 0.1);
  --campo: #f4f4f5;
  --accento: #128a5c;
  --accento-chiaro: rgba(18, 138, 92, 0.12);
}

* { 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 product card */
.product {
  width: min(352px, 92vw);
  display: flex; flex-direction: column; gap: 14px;
}

.product__row { display: flex; align-items: center; gap: 14px; }

.product__pic {
  flex: none;
  width: 72px; height: 72px;
  border-radius: 16px;
  background: linear-gradient(160deg, #f6f6f7, #ececee);
  box-shadow: inset 0 0 0 1px rgba(17, 17, 19, 0.05);
  display: grid; place-items: center;
}
.product__pic svg { width: 50px; height: 50px; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ph-band { stroke: #2a2a2e; stroke-width: 3.4; }
.ph-band--in { stroke: #6b6b72; stroke-width: 1.2; }
.ph-cup { fill: #2a2a2e; }
.ph-shine { stroke: rgba(255, 255, 255, 0.35); stroke-width: 1.4; }

.product__brand { font-size: 12px; font-weight: 600; color: var(--grigio); letter-spacing: 0.01em; }
.product__name { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; margin-top: 1px; }
.product__price { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; font-size: 15px; font-weight: 650; }
.product__note { font-size: 11.5px; font-weight: 500; color: var(--grigio); }

.product__foot { font-size: 11.5px; color: var(--grigio-chiaro); }

/* the slot is as tall as the open card, so the pill never pushes the page */
.slot { position: relative; height: 172px; }

.alert {
  position: absolute; left: 0; top: 0;
  height: 46px;
  border-radius: 23px;
  background: #fff;
  border: 1px solid var(--bordo);
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.05), 0 8px 22px -14px rgba(17, 17, 19, 0.35);
  overflow: hidden;
  will-change: width, height;
}

.pill {
  position: absolute; left: 0; top: 0;
  height: 44px;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 0 18px 0 14px;
  border: 0; background: transparent;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--inchiostro);
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pill:focus-visible { outline: 2px solid var(--accento); outline-offset: -4px; border-radius: 22px; }

.pill__bell { position: relative; width: 20px; height: 20px; display: grid; place-items: center; }
.pill__bell svg { width: 20px; height: 20px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pill__check { stroke: var(--accento); stroke-width: 2.2; }

.pill__label { display: inline-block; overflow: hidden; height: 20px; line-height: 20px; }
.pill__label > span { display: inline-block; }

.alert.is-hover { background: var(--campo); }
@media (hover: hover) { .alert:has(.pill:hover) { background: var(--campo); } }
.alert.is-set { border-color: rgba(18, 138, 92, 0.35); }

/* the panel */
.panel {
  position: absolute; left: 0; top: 0; right: 0;
  padding: 14px 16px 14px;
  opacity: 0; visibility: hidden;
}

.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.panel__ask { font-size: 13px; font-weight: 550; color: var(--grigio); }
.panel__price { display: flex; align-items: flex-start; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; color: var(--inchiostro); }
.panel__cur { font-size: 18px; margin: 3px 2px 0 0; }

.digits { display: inline-flex; height: 1em; overflow: hidden; }
.digit { position: relative; width: 0.62em; height: 1.12em; overflow: hidden; -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent); mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent); }
.digits { padding: 0.06em 0; height: 1.12em; }
.digit__strip { position: absolute; left: 0; right: 0; top: 0.06em; display: flex; flex-direction: column; text-align: center; }
.digit__strip span { height: 1em; line-height: 1; }

.track { position: relative; height: 40px; margin-top: 14px; touch-action: none; cursor: pointer; }
.track__rail { position: absolute; left: 0; right: 0; top: 18px; height: 4px; border-radius: 2px; background: var(--campo); box-shadow: inset 0 0 0 1px rgba(17, 17, 19, 0.05); }
.track__fill { position: absolute; top: 18px; right: 0; height: 4px; border-radius: 2px; background: var(--accento); opacity: 0.9; transform-origin: right center; }
.track__low { position: absolute; top: 9px; width: 0; }
.track__tick { position: absolute; left: -0.75px; top: 2px; width: 1.5px; height: 18px; border-radius: 1px; background: var(--grigio-chiaro); }
.track__tag { position: absolute; left: 50%; top: 24px; transform: translateX(-50%); font-size: 10.5px; font-weight: 600; color: var(--grigio); white-space: nowrap; }
.track__low.is-near .track__tick { background: var(--accento); }
.track__low.is-near .track__tag { color: var(--accento); }
.track__thumb {
  position: absolute; top: 9px; left: 0;
  width: 22px; height: 22px; margin-left: -11px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(17, 17, 19, 0.12);
  box-shadow: 0 2px 6px -1px rgba(17, 17, 19, 0.28), 0 0 0 0 var(--accento-chiaro);
  cursor: grab;
}
.track__thumb.is-held { cursor: grabbing; box-shadow: 0 3px 10px -2px rgba(17, 17, 19, 0.35), 0 0 0 6px var(--accento-chiaro); }

.panel__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.panel__save { font-size: 12px; font-weight: 600; color: var(--accento); white-space: nowrap; }
.panel__btns { display: flex; gap: 6px; }

.textbtn, .setbtn {
  height: 34px; padding: 0 13px;
  border-radius: 10px;
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}
.textbtn { background: transparent; border: 0; color: var(--grigio); }
.textbtn.is-hover { background: var(--campo); }
.setbtn { background: var(--inchiostro); color: #fff; border: 1px solid var(--inchiostro); box-shadow: 0 6px 14px -6px rgba(17, 17, 19, 0.5); }
.setbtn.is-hover { background: #2a2a2e; }
@media (hover: hover) { .textbtn:hover { background: var(--campo); } .setbtn:hover { background: #2a2a2e; } }
.textbtn:focus-visible, .setbtn:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }

.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-height: 460px) {
  .product { gap: 10px; }
  .product__pic { width: 60px; height: 60px; }
}
