:root {
  --bg: #ffffff;
  --ink: #14161b;
  --soft: #6f7480;
  --line: #dfe2e8;
  --accent: #2f6bff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 12px 16px;
}

/* the box keeps the room of the open panel, so nothing around it moves when it opens */
.ms { position: relative; width: min(296px, 100%); height: min(338px, calc(100vh - 24px)); }
.ms__label { display: block; margin: 0 0 6px 4px; font-size: 12px; line-height: 16px; font-weight: 640; color: var(--soft); }

.field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 52px;
  padding: 0 12px 0 8px;
  border: 0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(20, 22, 27, 0.05), 0 8px 18px -14px rgba(20, 22, 27, 0.3);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: box-shadow 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.field[aria-expanded="true"] { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent), 0 8px 18px -14px rgba(20, 22, 27, 0.3); }
.field:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.field__hint { position: absolute; left: 14px; font-size: 14.5px; font-weight: 520; color: #9a9faa; pointer-events: none; }
.field__chips { flex: 1; min-width: 0; display: flex; align-items: center; gap: 5px; height: 100%; overflow: hidden; }
.chip { flex: none; height: 32px; padding: 0 11px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 10%, #ffffff); color: color-mix(in srgb, var(--accent) 86%, #000000); font-size: 13px; line-height: 32px; font-weight: 640; white-space: nowrap; }
.chip--more { background: #eef0f4; color: var(--soft); padding: 0 9px; }
.field__count { flex: none; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; background: var(--accent); color: #ffffff; font-size: 12px; line-height: 24px; font-weight: 700; text-align: center; overflow: hidden; }
.field__count span { display: block; }
.field__chev { flex: none; width: 16px; height: 16px; }
.field__chev path { fill: none; stroke: var(--soft); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 82px;
  padding: 5px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(20, 22, 27, 0.07), 0 4px 8px rgba(20, 22, 27, 0.05), 0 24px 44px -18px rgba(20, 22, 27, 0.32);
  transform-origin: 50% 0;
}
.opts { list-style: none; display: grid; gap: 1px; }
.opt { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; height: min(40px, calc((100vh - 170px) / 5)); padding: 0 10px; border: 0; border-radius: 12px; background: none; color: inherit; font: inherit; font-size: 14px; font-weight: 560; text-align: left; cursor: pointer; transition: background-color 0.2s ease; -webkit-tap-highlight-color: transparent; }
.opt.is-near { background: #f3f5f8; }
.opt[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 7%, #ffffff); }
.opt:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.box { flex: none; width: 20px; height: 20px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px #c5cad3; display: grid; place-items: center; transition: box-shadow 0.2s ease; }
.box i { position: absolute; width: 20px; height: 20px; border-radius: 7px; background: var(--accent); }
.box svg { position: relative; width: 12px; height: 12px; }
.box path { fill: none; stroke: #ffffff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.opt[aria-selected="true"] .box { box-shadow: inset 0 0 0 1.5px var(--accent); }
.opt__name { flex: 1; min-width: 0; }
.opt__note { font-size: 11.5px; font-weight: 520; color: var(--soft); }
.panel__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; padding: 7px 6px 3px 11px; border-top: 1px solid #eef0f4; font-size: 12px; font-weight: 560; color: var(--soft); }
.panel__foot button { height: 26px; padding: 0 10px; border: 0; border-radius: 99px; background: #eef0f4; color: var(--ink); font: inherit; font-weight: 640; cursor: pointer; transition: opacity 0.2s ease; }
.panel__foot button:disabled { opacity: 0.4; cursor: default; }
.panel__foot button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

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

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #14151a;
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(20, 21, 26, 0.3));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}
