:root {
  --fondo: #fafafa;
  --card: #ffffff;
  --inchiostro: #111113;
  --grigio: #6f6f77;
  --grigio-chiaro: #a1a1aa;
  --bordo: rgba(17, 17, 19, 0.09);
  --campo: #f4f4f5;
  --accento: #2f6b4f;
  --accento-velo: rgba(47, 107, 79, 0.06);
}

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

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

.ship {
  width: min(400px, 100%);
  background: var(--card);
  border: 1px solid var(--bordo);
  border-radius: 20px;
  padding: clamp(14px, 3.6vmin, 22px);
  display: grid;
  gap: clamp(10px, 2.6vh, 16px);
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.04), 0 18px 48px -18px rgba(17, 17, 19, 0.16);
}

.ship__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ship__title { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.ship__sub { font-size: 12px; color: var(--grigio); margin-top: 2px; }
.ship__sub span { color: var(--grigio-chiaro); }
.ship__items {
  font-size: 11.5px; font-weight: 600; color: var(--grigio);
  border: 1px solid var(--bordo); border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}

.opts { position: relative; display: grid; gap: 6px; }

.opts__frame {
  position: absolute; left: 0; right: 0; top: 0; height: 0;
  border-radius: 14px;
  border: 1.5px solid var(--accento);
  background: var(--accento-velo);
  box-shadow: 0 6px 18px -10px rgba(47, 107, 79, 0.55);
  pointer-events: none;
  z-index: 0;
}

.opt {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px;
  min-height: clamp(42px, 10.8vh, 58px);
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid var(--bordo);
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.25s, background-color 0.25s;
}
.opt[aria-checked="true"] { border-color: transparent; }
.opt.is-hover:not([aria-checked="true"]) { background: var(--campo); }
@media (hover: hover) { .opt:hover:not([aria-checked="true"]) { background: var(--campo); } }
.opt:focus-visible { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accento); }

.opt__icon {
  width: 22px; height: 22px; overflow: visible;
  fill: none; stroke: var(--grigio); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke 0.25s;
}
.opt[aria-checked="true"] .opt__icon { stroke: var(--accento); }
.opt__speed { opacity: 0; }

.opt__text { display: grid; gap: 1px; min-width: 0; }
.opt__name { font-size: 14px; font-weight: 600; }
.opt__when { font-size: 12px; color: var(--grigio); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.25s; }
.opt[aria-checked="true"] .opt__when { color: var(--inchiostro); }

.opt__price { font-size: 13px; font-weight: 600; }

.opt__tick { width: 20px; height: 20px; fill: none; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.opt__ring { stroke: rgba(17, 17, 19, 0.18); stroke-width: 1.5; fill: #fff; transition: fill 0.25s, stroke 0.25s; }
.opt[aria-checked="true"] .opt__ring { fill: var(--accento); stroke: var(--accento); }
.opt__check { stroke: #fff; stroke-width: 2.2; }

.sum { display: grid; gap: 6px; padding-top: clamp(8px, 2vh, 12px); border-top: 1px dashed rgba(17, 17, 19, 0.12); }
.sum__row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--grigio); }
.sum__row dd { color: var(--inchiostro); font-weight: 550; }
.sum__row--total { color: var(--inchiostro); font-size: 15px; font-weight: 650; }
.sum__row--total dd { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }

.swap { position: relative; display: inline-grid; overflow: hidden; height: 1.3em; line-height: 1.3em; text-align: right; }
.swap > span { grid-area: 1 / 1; }

.total { display: inline-flex; height: 1.2em; line-height: 1.2em; overflow: hidden; }
.total .ch { display: inline-block; }
.total .col { display: inline-block; height: 1.2em; overflow: hidden; position: relative; }
.total .strip { display: flex; flex-direction: column; }
.total .strip span { display: block; height: 1.2em; text-align: center; }

.cta {
  position: relative;
  height: clamp(40px, 10vh, 46px);
  border: 0; border-radius: 12px;
  background: var(--inchiostro); color: #fff;
  font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; overflow: hidden;
  box-shadow: 0 8px 18px -8px rgba(17, 17, 19, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.3s;
}
.cta.is-hover { background: #26262b; }
@media (hover: hover) { .cta:hover { background: #26262b; } }
.cta:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
.cta.is-done { background: var(--accento); }
.cta > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; }
.cta__busy, .cta__done { opacity: 0; }
.cta svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.cta__track { stroke: rgba(255, 255, 255, 0.22); stroke-width: 2.2; }
.cta__arc { stroke-width: 2.2; transform-origin: 12px 12px; }
.cta__done svg { stroke-width: 2.4; }

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

@media (max-width: 380px) {
  .opt { gap: 9px; padding: 0 10px; }
  .opt__when { font-size: 11px; }
  .ship__sub span { display: none; }
}
