:root {
  --fondo: #fafafa;
  --card: #ffffff;
  --inchiostro: #111113;
  --grigio: #6f6f77;
  --grigio-chiaro: #a1a1aa;
  --bordo: rgba(17, 17, 19, 0.09);
  --campo: #f4f4f5;
  --accento: #4f5bd5;
  --alone: rgba(79, 91, 213, 0.14);
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { 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: 12px 16px;
}

.ship {
  position: relative;
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--bordo);
  border-radius: 20px;
  padding: clamp(14px, 4.2vmin, 22px);
  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; gap: 12px; align-items: center; margin-bottom: clamp(10px, 3vmin, 16px); }
.ship__mark {
  flex: none; width: 30px; height: 30px; padding: 6px; border-radius: 9px;
  background: var(--inchiostro);
  fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.ship__title { font-size: 15px; font-weight: 640; letter-spacing: -0.01em; }
.ship__sub { margin-top: 2px; font-size: 12.5px; color: var(--grigio); }

.group { position: relative; min-width: 0; }
.row { margin-top: clamp(8px, 2.4vmin, 12px); }
.row--two { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 10px; }

.label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; color: #34343a; }

.field {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  height: clamp(36px, 9.6vmin, 42px);
  padding: 0 12px;
  border-radius: 11px;
  background: var(--campo);
  border: 1px solid var(--bordo);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field.is-focus {
  background: #fff;
  border-color: var(--accento);
  box-shadow: 0 0 0 4px var(--alone);
}
.field--search { padding-left: 10px; }

.field__icon { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--grigio-chiaro); stroke-width: 2; stroke-linecap: round; transition: stroke 0.2s; }
.field.is-focus .field__icon { stroke: var(--accento); }

.field__input {
  flex: 1; min-width: 0; width: 100%;
  border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 13.5px; font-weight: 500; color: var(--inchiostro);
  caret-color: var(--accento);
}
.field__input::placeholder { color: var(--grigio-chiaro); font-weight: 450; }
.field__input--mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0.02em; }

/* the drawn caret the autopilot uses while it types (the real one is hidden then) */
.field__caret {
  position: absolute; top: 50%; left: 0;
  width: 1.5px; height: 16px; margin-top: -8px;
  background: var(--accento); border-radius: 1px;
  opacity: 0; pointer-events: none;
}

/* the flash that runs round a field when its value arrives */
.field__flash {
  position: absolute; inset: -1px; border-radius: inherit;
  border: 1.5px solid var(--accento);
  box-shadow: 0 0 0 4px var(--alone);
  opacity: 0; pointer-events: none;
}

/* the suggestions: they sit over the fields below, inside the card */
.drop {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  z-index: 4;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--bordo);
  border-radius: 14px;
  box-shadow: 0 2px 4px rgba(17, 17, 19, 0.04), 0 22px 44px -16px rgba(17, 17, 19, 0.24);
  transform-origin: 50% 0;
  opacity: 0; visibility: hidden;
  overflow: hidden;
}

.drop__load {
  position: absolute; left: 0; top: 0; height: 2px; width: 100%;
  background: linear-gradient(90deg, transparent, var(--accento), transparent);
  transform: scaleX(0); transform-origin: 0 50%;
  opacity: 0;
}

.drop__pill {
  position: absolute; left: 6px; right: 6px; top: 6px;
  height: 44px; border-radius: 9px;
  background: var(--campo);
  opacity: 0;
}

.drop__list { position: relative; list-style: none; }

.opt {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 10px;
  border-radius: 9px;
  cursor: pointer;
}
.opt__pin { flex: none; width: 26px; height: 26px; padding: 5px; border-radius: 8px; background: var(--campo); fill: none; stroke: #55555d; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: background 0.2s, stroke 0.2s; }
.opt.is-active .opt__pin { background: #fff; stroke: var(--accento); }
.opt__text { min-width: 0; }
.opt__main { font-size: 13px; font-weight: 450; color: #3a3a40; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt__main b { font-weight: 700; color: var(--inchiostro); }
.opt__sub { font-size: 11.5px; color: var(--grigio); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.drop__empty { display: none; padding: 12px 10px; font-size: 12.5px; color: var(--grigio); }
.drop.is-empty .drop__empty { display: block; }

.drop__manual {
  display: flex; align-items: center; gap: 8px; width: 100%;
  margin-top: 4px; padding: 9px 10px 4px;
  border: 0; border-top: 1px solid var(--bordo);
  background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--grigio);
  cursor: pointer; text-align: left;
}
.drop__manual svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .drop__manual:hover { color: var(--inchiostro); } }
.drop__manual:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; border-radius: 6px; }

.ship__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: clamp(12px, 3.4vmin, 18px);
}
.ship__note { font-size: 12px; color: var(--grigio); }

.solidbtn {
  flex: none;
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border: 0; border-radius: 10px;
  background: var(--inchiostro); color: #fff;
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}
.solidbtn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.solidbtn[aria-disabled="true"] { opacity: 0.35; cursor: default; }
@media (hover: hover) { .solidbtn:not([aria-disabled="true"]):hover { background: #2a2a2e; } }
.solidbtn: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: 6;
}

@media (max-width: 380px) {
  .ship__note { font-size: 11px; }
  .opt { height: 40px; }
  .drop__pill { height: 40px; }
  .opt__main { font-size: 12.5px; }
}
