/* The site's search box (live/ui/search.php). Colours: admin theme (--msg-*) only. */
.msrch { position: relative; display: flex; align-items: center; box-sizing: border-box; height: 40px; border-radius: 999px; border: 1px solid var(--msg-border); background: var(--msg-surface-2); color: var(--msg-text); text-align: left; }
.msrch:focus-within { border-color: var(--msg-accent); }
.msrch-ic { flex: none; width: 18px; height: 18px; margin: 0 6px 0 14px; color: var(--msg-muted); }
.msrch-in, .msrch-in:focus, .msrch-in:hover { box-shadow: none; outline: 0; background-image: none; border-radius: 0; }
.msrch-in { margin: 0; border-bottom: 0; flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--msg-text); font: inherit; font-size: 16px; padding: 0; box-shadow: none; -webkit-appearance: none; appearance: none; }
.msrch-in::placeholder { color: var(--msg-muted); }
.msrch-in::-webkit-search-cancel-button { -webkit-appearance: none; }
.msrch-fbtn { flex: none; width: 40px; height: 100%; border: 0; border-radius: 0 999px 999px 0; background: transparent; color: var(--msg-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.msrch-fbtn svg { width: 20px; height: 20px; }
@media (hover: hover) { .msrch-fbtn:hover { color: var(--msg-text); } }
.msrch-header { position: absolute; left: 50%; top: 7px; transform: translateX(-50%); width: min(460px, 34vw); z-index: 1100; }
.msrch-inline { width: calc(100% - 16px); margin: 8px; }
.msrch-pop, .msrch-filters { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 1200; max-height: min(70vh, 640px); overflow-y: auto; border-radius: 14px; border: 1px solid var(--msg-border); background: var(--msg-surface); box-shadow: 0 18px 50px color-mix(in srgb, var(--msg-black) 55%, transparent); padding: 8px 8px 12px; }
.msrch-pop[hidden], .msrch-filters[hidden] { display: none; }
.msrch-h { padding: 12px 10px 6px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--msg-muted); display: flex; justify-content: space-between; align-items: center; }
.msrch-h button { border: 0; background: none; color: var(--msg-muted); font: inherit; font-size: 12px; cursor: pointer; min-height: 32px; text-transform: none; letter-spacing: 0; }
.msrch-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 6px 4px; }
.msrch-chip { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--msg-border); background: var(--msg-surface-2); color: var(--msg-text); font: inherit; font-size: 15px; cursor: pointer; }
.msrch-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 4px 10px; border: 0; border-radius: 8px; background: none; color: var(--msg-text); font: inherit; font-size: 15px; text-align: left; text-decoration: none; cursor: pointer; box-sizing: border-box; }
.msrch-row.is-on, .msrch-chip.is-on { background: var(--msg-hover); }
@media (hover: hover) { .msrch-row:hover, .msrch-chip:hover { background: var(--msg-hover); } }
.msrch-row .msrch-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msrch-row .msrch-n { flex: none; color: var(--msg-muted); font-size: 13px; }
.msrch-row .msrch-sub { color: var(--msg-muted); font-size: 13px; }
.msrch-row img.msrch-av { flex: none; width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.msrch-row .msrch-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--msg-muted); }
.msrch-row .msrch-dot.live { background: var(--msg-live); }
.msrch-row .cat-flag { width: 22px; height: 22px; margin: 0; }
.msrch-row .cat-icon { width: 22px; margin: 0; text-align: center; }
.msrch-row .msrch-gl { flex: none; width: 22px; text-align: center; color: var(--msg-muted); }
.msrch-empty { padding: 18px 10px; color: var(--msg-muted); text-align: center; }
/* the filters panel */
.msrch-ft { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 4px; font-size: 18px; font-weight: 700; }
.msrch-x { width: 44px; height: 44px; border: 0; background: none; color: var(--msg-muted); font-size: 26px; cursor: pointer; }
.msrch-fsearch { display: block; box-sizing: border-box; width: calc(100% - 20px); margin: 4px 10px 8px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--msg-border); background: var(--msg-surface-2); color: var(--msg-text); font: inherit; font-size: 16px; }
.msrch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; padding: 0 10px; }
.msrch-opt { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; cursor: pointer; }
.msrch-opt input { width: 20px; height: 20px; flex: none; accent-color: var(--msg-accent); }
.msrch-opt .msrch-n { margin-left: 4px; color: var(--msg-muted); font-size: 13px; }
.msrch-opt .cat-flag { width: 20px; height: 20px; margin: 0; }
.msrch-go { position: sticky; bottom: 0; display: block; width: calc(100% - 20px); margin: 10px 10px 0; min-height: 44px; border: 0; border-radius: 999px; background: var(--msg-accent); color: var(--msg-on-accent); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.msrch-go:disabled { opacity: .5; cursor: default; }
@media (min-width: 900px) { .msrch-inline { display: none; } }
@media (max-width: 899px) { .msrch-header { display: none; } .msrch-filters { position: fixed; inset: 56px 8px 8px 8px; max-height: none; } }
@media (max-width: 480px) { .msrch-grid { grid-template-columns: 1fr; } }

/* the dropdown: phrases first, models under them; the part you typed is bold */
.msrch-pop { border-radius: 16px; padding: 10px 10px 14px; background: var(--msg-surface-2); }
.msrch-row { min-height: 46px; border-radius: 10px; }
.msrch-row .msrch-t b { font-weight: 700; color: var(--msg-text); }
.msrch-row .msrch-t { color: var(--msg-text); }
.msrch-h { padding-top: 14px; }

/* the phone's search: a button opens it over the whole screen (examples, recent, trending, results; an X closes it) */
.msrch-close { display: none; flex: none; width: 44px; height: 100%; border: 0; background: none; color: var(--msg-muted); font-size: 28px; cursor: pointer; }
@media (max-width: 899px) {
  .msrch-inline { display: none; }
  .msrch-inline.is-full { display: flex; position: fixed; z-index: 3000; top: 0; left: 0; right: 0; width: auto; height: 56px; margin: 0; border-radius: 0; border: 0; border-bottom: 1px solid var(--msg-border); background: var(--msg-surface); }
  .msrch-inline.is-full .msrch-close { display: inline-flex; align-items: center; justify-content: center; }
  .msrch-inline.is-full .msrch-fbtn { border-radius: 0; }
  .msrch-inline.is-full .msrch-pop { position: fixed; top: 56px; left: 0; right: 0; bottom: 0; max-height: none; border: 0; border-radius: 0; box-shadow: none; background: var(--msg-surface); z-index: 3000; }
  .msrch-inline.is-full .msrch-filters { z-index: 3100; inset: 56px 0 0 0; border-radius: 0; }
  /* while it is open: the page behind does not scroll, and the bar + list sit in the part of the screen the keyboard leaves (search.js sets the two values) */
  html.msrch-lock, html.msrch-lock body { overflow: hidden; overscroll-behavior: none; }
  /* a solid layer behind the full-screen search, reaching past the screen's top and bottom: nothing of the page shows through the slightly see-through list, under it or behind the keyboard */
  html.msrch-lock body::after { content: ''; position: fixed; left: 0; right: 0; top: -100vh; bottom: -100vh; z-index: 2999; background: var(--msg-black); pointer-events: none; }
  html.msrch-lock .msrch-inline.is-full { top: var(--msrch-vt, 0px); }
  html.msrch-lock .msrch-inline.is-full .msrch-pop, html.msrch-lock .msrch-inline.is-full .msrch-filters { top: calc(var(--msrch-vt, 0px) + 56px); bottom: auto; height: calc(var(--msrch-vh, 100dvh) - 56px); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
}

/* the search drop-down and its Filters panel look like the all-categories panel: black, a little see-through (the owner's choice, so the text is always white), the highlight colour on the icons */
.msrch-pop, .msrch-filters, .msrch-inline.is-full .msrch-pop { background: #000000ed; color: var(--msg-white); border: 0; box-shadow: 0 16px 44px var(--msg-scrim); }
.msrch-pop .msrch-t, .msrch-pop .msrch-t b, .msrch-row, .msrch-filters, .msrch-ft, .msrch-opt, .msrch-empty { color: var(--msg-white); }
.msrch-h, .msrch-h button, .msrch-row .msrch-n, .msrch-row .msrch-sub, .msrch-opt .msrch-n, .msrch-x { color: var(--msg-white); opacity: .72; }
.msrch-row:hover, .msrch-row:focus-visible, .msrch-row.is-on, .msrch-chip.is-on { background: color-mix(in srgb, var(--msg-white) 14%, transparent); }
.msrch-chip { background: transparent; border-color: color-mix(in srgb, var(--msg-white) 32%, transparent); color: var(--msg-white); }
.msrch-row .cat-icon, .msrch-row .cat-icon i, .msrch-row .msrch-gl, .msrch-row .msrch-gl svg, .msrch-h svg { color: var(--msg-accent); opacity: 1; }
.msrch-row .msrch-dot { background: var(--msg-white); opacity: .5; }
.msrch-row .msrch-dot.live { background: var(--msg-live); opacity: 1; }
.msrch-fsearch { background: color-mix(in srgb, var(--msg-white) 12%, transparent); color: var(--msg-white); border-color: color-mix(in srgb, var(--msg-white) 28%, transparent); }
.msrch-fsearch::placeholder { color: var(--msg-white); opacity: .6; }
