/* Every dropdown in the app looks the same: select menus and typing suggestions (datalist fields,
   made into a listbox by dropdowns.js). Colours follow the page's own palette when it has one. */
:root {
  --dd-accent: var(--gold, var(--tone2, #4e7a2e));
  --dd-ink: var(--ink, #292524);
  --dd-muted: var(--muted, #6b6560);
  --dd-line: var(--line-strong, #d6d3d1);
  --dd-tint: var(--gold-tint, var(--btn-hover, #eff6e9));
  --dd-shadow: 0 18px 40px -18px rgba(41, 37, 36, .38), 0 2px 6px -2px rgba(41, 37, 36, .08);
}

/* ---- the open list: one look for select menus and suggestion lists ---- */
.dd-list {
  position: fixed; z-index: 10000; inset: auto; margin: 0; box-sizing: border-box;
  min-width: 180px; max-height: min(320px, 55vh); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px; border: 1px solid var(--dd-line); border-radius: 14px; background: var(--th-paper, #fff); color: var(--dd-ink);
  box-shadow: var(--dd-shadow); font: 500 14px/1.35 var(--sans, system-ui, -apple-system, "Segoe UI", sans-serif);
  scrollbar-width: thin; scrollbar-color: var(--dd-line) transparent;
}
.dd-list[hidden] { display: none; }
.dd-list, .dd-list * { -webkit-tap-highlight-color: transparent !important; }
.dd-list [role="option"] { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 9px; cursor: pointer; -webkit-tap-highlight-color: transparent !important; }
.dd-list [role="option"][aria-selected="true"], .dd-list [role="option"]:hover { background: var(--dd-tint); }
.dd-list [role="option"] mark { background: none; color: var(--dd-accent); font-weight: 700; }
.dd-list .dd-empty { padding: 9px 12px; color: var(--dd-muted); font-size: 13px; }

/* ---- select menus: styled where the browser allows it (Chrome / Edge 135+); others keep their own menu ---- */
@supports (appearance: base-select) {
  select:not([multiple]):not([size]) { appearance: base-select; background-image: none !important; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: space-between; gap: 10px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }   /* one line, "…" when narrow */
  select:not([multiple]):not([size])::picker-icon {
    content: ""; flex: none; width: 7px; height: 7px; margin: 0 2px -2px 0; border: solid var(--dd-accent);
    border-width: 0 2px 2px 0; transform: translateY(-3px) rotate(45deg); transition: transform .18s ease; }
  select:not([multiple]):not([size]):open::picker-icon { transform: translateY(1px) rotate(-135deg); }
  select:not([multiple]):not([size])::picker(select) {
    appearance: base-select; margin-top: 6px; min-width: anchor-size(width); max-height: min(320px, 55vh); overflow-y: auto;
    padding: 6px; border: 1px solid var(--dd-line); border-radius: 14px; background: var(--th-paper, #fff); color: var(--dd-ink);
    box-shadow: var(--dd-shadow); scrollbar-width: thin; scrollbar-color: var(--dd-line) transparent; }
  select:not([multiple]):not([size]) option { display: flex; align-items: center; gap: 8px; padding: 9px 12px;
    border-radius: 9px; font: inherit; font-size: 14px; color: var(--dd-ink); cursor: pointer; }
  select:not([multiple]):not([size]) option:hover, select:not([multiple]):not([size]) option:focus-visible { background: var(--dd-tint); outline: none; }
  select:not([multiple]):not([size]) option:checked { background: var(--dd-tint); color: var(--dd-accent); font-weight: 600; }
  select:not([multiple]):not([size]) option::checkmark { order: 1; margin-left: auto; color: var(--dd-accent); }
  select:not([multiple]):not([size]) option:disabled { color: var(--dd-muted); cursor: default; background: none; }
  select:not([multiple]):not([size]) optgroup { padding: 4px 0; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--dd-muted); }
}
@media (prefers-reduced-motion: reduce) { select::picker-icon { transition: none !important; } }
