/* The designs search: the search pill, the Colour pill with its swatches and the line saying what was found, one
   look on the public designs pages (frontend/site/design-search.js) and in the print board's design picker
   (frontend/dashboard/print/set/suitePicker.js). It reads --line, --surface, --ink, --muted, --accent,
   --accent-soft, --menu-bg, --menu-hover and --shadow-menu, which the board maps onto its own tokens. */
.design-search { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.design-search__field {
  flex: 1 1 auto;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 0 6px 0 22px;
  /* The home page's card search (.own__find in frontend/site/home.css): a white capsule on a hairline and a soft shadow, a
     2px ring of the main colour with the cursor in it. */
  border: 0;
  border-radius: 999px;
  background: var(--surface-raised, var(--surface));
  box-shadow: 0 0 0 1px var(--line), 0 10px 30px -18px color-mix(in srgb, var(--shadow-color, var(--ink)) 35%, transparent);
  color: var(--muted);
  cursor: text;
  transition: box-shadow 160ms var(--ease-out);
}
.design-search__field:focus-within { box-shadow: 0 0 0 2px var(--accent), 0 10px 30px -18px color-mix(in srgb, var(--shadow-color, var(--ink)) 35%, transparent); }
/* The pill itself shows the focus, so the box inside it draws no ring of its own. */
.design-search .design-search__input:is(:focus, :focus-visible) { outline: none; box-shadow: none; }
.design-search__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-base);
  font-weight: 500;
  outline: none;
  user-select: text;
}
.design-search__input::placeholder { color: var(--muted); }
.design-search__input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.design-search__clear, .design-search__pill-clear {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.design-search__clear:hover, .design-search__pill-clear:hover { background: var(--menu-hover); color: var(--ink); }
.design-search__clear[hidden], .design-search__pill-clear[hidden], .design-search__swatches[hidden] { display: none; }
.design-search__colour { position: relative; display: flex; align-items: center; flex: none; }
.design-search__pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 0 22px 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-raised, var(--surface));
  box-shadow: 0 0 0 1px var(--line), 0 10px 30px -18px color-mix(in srgb, var(--shadow-color, var(--ink)) 35%, transparent);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: scale var(--dur-press, 120ms) var(--ease-out);
}
.design-search__pill:active { scale: .96; }
.design-search__pill.is-chosen { padding-right: 44px; box-shadow: 0 0 0 2px var(--accent); }
.design-search__pill-clear { position: absolute; right: 6px; }
.design-search__dot {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--shadow-color) 12%, transparent);
}
.design-search__dot--any { background: conic-gradient(#c5a059, #d4838f, #7b5294, #2b4c7e, #2d5c43, #c5a059); /* ui-audit: card, the swatch shows the palette colours the picker offers */ }
/* The swatches open under their own pill. */
.design-search__swatches {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 2px;
  width: max-content;
  min-width: 240px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--menu-bg);
  box-shadow: var(--shadow-menu);
  transform-origin: top right;
  animation: design-search-open 160ms var(--ease-out);
}
@keyframes design-search-open { from { opacity: 0; scale: .96; } }
.design-search__swatch {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 14px 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-base);
  text-align: left;
  cursor: pointer;
}
.design-search__swatch:hover { background: var(--menu-hover); }
.design-search__swatch[aria-pressed="true"] { background: var(--accent-soft); font-weight: 600; }
.design-search__status { min-height: 22px; margin: 0 0 clamp(18px, 2.4vw, 28px); font-size: var(--text-sm); color: var(--muted); }
.design-search__status:empty { min-height: 0; }
.design-search__try { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 10px; }
.design-search__word, .design-search__reset {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}
.design-search__word:hover, .design-search__reset:hover { background: var(--menu-hover); }
.design-search__reset { display: block; margin-top: 10px; }
/* On a phone the colour pill keeps only its dot, so the search keeps the width. */
@media (max-width: 559px) {
  .design-search__pill { padding: 0 14px; }
  .design-search__pill-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .design-search__pill.is-chosen { padding-right: 40px; }
  .design-search__swatches { position: fixed; top: auto; right: 16px; left: 16px; bottom: 16px; width: auto; transform-origin: bottom center; }
}
@media (prefers-reduced-motion: reduce) { .design-search__swatches { animation: none; } }
