:root {
  --fondo: #f2f2f2;
  --pillola: #ffffff;
  --inchiostro: #141416;
  --grigio: #8a8a93;
  --grigio-scuro: #5e5e66;
  --bordo: rgba(20, 20, 22, 0.08);
  --campo: #f4f4f5;
  --tasto: #fbfbfc;
  --tasto-base: #dedee3;
  --accento: #2f6bff;
  --accento-bordo: rgba(47, 107, 255, 0.45);
  --accento-anello: rgba(47, 107, 255, 0.14);
  --corsa: 2.5px;
}

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

.search {
  position: relative;
  /* the suggestions hang below the pill: this keeps pill and suggestions centred together */
  margin-bottom: 136px;
}

.pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 9px 0 17px;
  border-radius: 999px;
  background: var(--pillola);
  border: 1px solid var(--bordo);
  box-shadow: 0 1px 2px rgba(20, 20, 22, 0.04), 0 12px 28px -14px rgba(20, 20, 22, 0.22);
  transition: box-shadow 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.35s ease;
}
.pill.is-hover { box-shadow: 0 1px 2px rgba(20, 20, 22, 0.05), 0 16px 32px -14px rgba(20, 20, 22, 0.28); }
.pill.is-open {
  border-color: var(--accento-bordo);
  box-shadow: 0 0 0 4px var(--accento-anello), 0 16px 34px -16px rgba(20, 20, 22, 0.28);
}

.lens {
  flex: none;
  width: 18px; height: 18px;
  fill: none; stroke: var(--grigio-scuro); stroke-width: 2; stroke-linecap: round;
}

.pill__field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 15px;
  font-variation-settings: "wdth" 100;
  white-space: nowrap;
  overflow: hidden;
}
.pill__ph { color: var(--grigio); }
.pill__typed { color: var(--inchiostro); font-weight: 500; }
.pill__ph + .pill__typed:empty { display: none; }
.caret {
  display: inline-block;
  width: 1.6px; height: 19px;
  margin-left: 1px;
  border-radius: 1px;
  background: var(--accento);
  opacity: 0;
}
.pill__input {
  position: absolute; inset: 0;
  width: 100%;
  border: 0; outline: 0; background: transparent;
  color: transparent; caret-color: transparent;
  font: inherit;
  pointer-events: none;
}
.pill.is-open .pill__input { pointer-events: auto; }

.keys { flex: none; display: flex; gap: 4px; padding-right: 2px; }
.keys--esc { position: absolute; right: 9px; top: calc(50% - 13px); opacity: 0; visibility: hidden; }

.key {
  --press: 0;
  --lift: 0;
  position: relative;
  display: block;
  min-width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--tasto-base);
  box-shadow: 0 calc(2.6px - var(--press) * 2px + var(--lift) * 1px) calc(4px - var(--press) * 3px + var(--lift) * 2px) -1px rgba(20, 20, 22, 0.26);
}
.key--wide { min-width: 38px; }
.key__cap {
  position: absolute; left: 0; right: 0; top: 0;
  height: 23px;
  display: grid;
  place-items: center;
  padding: 0 7px;
  border-radius: 7px;
  border: 1px solid rgba(20, 20, 22, 0.11);
  background: linear-gradient(180deg, #ffffff 0%, var(--tasto) 70%, #f2f2f4 100%);
  /* the light on the top edge of the keycap, and its own tiny shadow */
  box-shadow: inset 0 1px 0 #ffffff, inset 0 -1px 0 rgba(20, 20, 22, 0.04);
  color: var(--grigio-scuro);
  font-size: 11.5px;
  font-weight: 600;
  font-variation-settings: "wdth" 100;
  letter-spacing: 0.01em;
  transform: translateY(calc(var(--press) * var(--corsa) - var(--lift) * 1px));
}

.pill__hit {
  position: absolute; inset: 0;
  border: 0; border-radius: inherit;
  background: transparent;
  cursor: pointer;
}
.pill__hit:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }
.pill.is-open .pill__hit { pointer-events: none; }

.inquadra {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  visibility: hidden;
}

.sugg {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 10px);
  padding: 6px;
  border-radius: 18px;
  background: var(--pillola);
  border: 1px solid var(--bordo);
  box-shadow: 0 1px 2px rgba(20, 20, 22, 0.04), 0 18px 36px -18px rgba(20, 20, 22, 0.26);
  visibility: hidden;
  opacity: 0;
}
.sugg__label {
  padding: 7px 10px 5px;
  color: var(--grigio);
  font-size: 11.5px;
  font-weight: 500;
}
.sugg__list { position: relative; }
.sugg__mark {
  position: absolute; left: 0; right: 0; top: 0;
  height: 42px;
  border-radius: 11px;
  background: var(--campo);
  opacity: 0;
}
.sugg__row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 10px;
  border-radius: 11px;
  color: var(--inchiostro);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}
.sugg__row svg { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--grigio-scuro); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sugg__name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sugg__tag {
  margin-left: auto;
  flex: none;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--campo);
  color: var(--grigio-scuro);
  font-size: 11px;
  font-weight: 500;
}
.sugg__row.is-active .sugg__tag { background: #ffffff; }
.sugg__row: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-width: 420px) {
  .pill { height: 48px; padding-left: 15px; gap: 9px; }
  .pill__field { font-size: 14px; }
  .sugg__row { font-size: 13.5px; height: 40px; }
  .sugg__mark { height: 40px; }
  .search { margin-bottom: 128px; }
}
