.cb {
  --desk: #5a2fd8;
  --desk-2: #5129cc;
  --face: #cfd2c6;
  --lite: #f7f8f0;
  --shade: #858a7b;
  --ink: #17180f;
  --amber: #ffb400;
  --paper: #fdfdf6;
  --drop: #1f0a66;
  width: 540px;
  height: 540px;
  box-sizing: border-box;
  position: relative;
  background: conic-gradient(var(--desk-2) 25%, var(--desk) 0 50%, var(--desk-2) 0 75%, var(--desk) 0) 0 0 / 8px 8px;
  color: var(--ink);
  font-family: "Pixelify Sans Variable", monospace;
  font-size: 40px;
  font-weight: 400;
  line-height: 40px;
}

.cb * { box-sizing: border-box; }

.cb-win {
  position: absolute;
  left: 26px;
  top: 48px;
  width: 488px;
  padding: 8px;
  border: 2px solid var(--ink);
  background: var(--face);
  box-shadow: inset 4px 4px 0 var(--lite), inset -4px -4px 0 var(--shade), 8px 8px 0 var(--drop);
}

.cb-title {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding: 0 10px;
  border: 2px solid var(--ink);
  background: var(--amber);
}

.cb-close {
  width: 24px;
  height: 24px;
  border: 2px solid var(--ink);
  background: var(--face);
  box-shadow: inset 2px 2px 0 var(--lite), inset -2px -2px 0 var(--shade);
}

.cb-label { padding-bottom: 4px; }

.cb-body { padding: 16px 8px 12px; }

.cb-row {
  display: flex;
  height: 56px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: -2px -2px 0 var(--shade), 2px 2px 0 var(--lite);
}

.cb-row:has(.cb-input:focus-visible) {
  outline: 4px solid var(--desk);
  outline-offset: 0;
  box-shadow: none;
}

.cb-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 10px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  outline: none;
  caret-color: var(--ink);
}

.cb-btn {
  display: grid;
  place-items: center;
  width: 52px;
  height: 100%;
  padding: 0;
  border: 0;
  border-left: 2px solid var(--ink);
  border-radius: 0;
  background: var(--face);
  box-shadow: inset 4px 4px 0 var(--lite), inset -4px -4px 0 var(--shade);
  outline: none;
}

.cb-arrow { width: 28px; height: 16px; fill: var(--ink); }

/* the popup is rendered in the top layer, outside .cb, so it repeats the palette */
.cb-pop {
  width: var(--anchor-width);
  margin: 0;
  padding: 0 8px 8px 0;
  box-sizing: content-box;
  border: 0;
  background: transparent;
  outline: none;
  overflow: visible;
  clip-path: inset(0 0 0 0);
  transition: clip-path 140ms steps(4, end);
}

.cb-pop[data-starting-style],
.cb-pop[data-ending-style] { clip-path: inset(0 0 100% 0); }

.cb-list {
  box-sizing: border-box;
  border: 2px solid #17180f;
  border-top: 0;
  background: #fdfdf6;
  box-shadow: 8px 8px 0 #1f0a66;
  color: #17180f;
  font-family: "Pixelify Sans Variable", monospace;
  font-size: 40px;
  font-weight: 400;
  line-height: 40px;
}

.cb-item {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 10px 4px;
  outline: none;
}

.cb-item mark {
  display: inline-block;
  height: 36px;
  margin-top: 4px;
  line-height: 32px;
  /* the face has its side bearing on the right: shift the block 2px left so the pad is even */
  background: linear-gradient(#ffb400, #ffb400) left / calc(100% - 2px) 100% no-repeat;
  box-shadow: -2px 0 0 #ffb400;
  color: inherit;
}

.cb-item[data-highlighted] { background: #5a2fd8; color: #fdfdf6; }
.cb-item[data-highlighted] mark { color: #17180f; }
