/* Search, option A (js/search.js; proposals/search-menu.html). The field docks on the keyboard (--sx-kb, from the visual
   viewport), under the right thumb; matches stack above it; the page dims behind. Above the page and its sheets' scrims,
   under the to-do menu (z 80), which opens over it. */
.sx { position: fixed; inset: 0; z-index: 64; }
.sx-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.32); } /* a plain dim, no blur: opening a doc from here stays as quick as from a list */
.sx-col { position: absolute; left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); top: calc(var(--sat) + 8px);
  bottom: calc(var(--sab) + 12px); display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; pointer-events: none; }
.sx.kb .sx-col { bottom: calc(var(--sx-kb) + 8px); }
.sx-col > * { pointer-events: auto; }
.sx-bar { flex: none; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 4px 0 14px; border-radius: 24px; box-sizing: border-box;
  background: var(--sheet); color: var(--ink55); box-shadow: var(--glassRing), var(--md); }
.sx-bar > svg { flex: none; }
.sx-bar input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 17px; outline: none; -webkit-appearance: none; appearance: none; }
.sx-bar input::placeholder { color: var(--ink40); }
.sx-bar input::-webkit-search-cancel-button { display: none; }
.sx-x { flex: none; width: 40px; height: 40px; border-radius: 20px; display: flex; align-items: center; justify-content: center; color: var(--ink55); }
.sx-x:active { background: var(--fill8); }
.sx-chip-slot:empty { display: none; }
.sx-chip { display: inline-flex; align-items: center; gap: 2px; height: 28px; max-width: 150px; padding: 0 2px 0 10px; border-radius: 14px; background: var(--fill8);
  color: var(--ink85); font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.sx-chip button { flex: none; width: 26px; height: 26px; border-radius: 13px; display: flex; align-items: center; justify-content: center; color: var(--ink55); }
.sx-res { flex: 0 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; border-radius: 20px; background: var(--sheet); box-shadow: var(--glassRing), var(--md); padding: 4px 0; }
.sx-res[hidden] { display: none; }
.sx-hd { display: flex; align-items: baseline; gap: 6px; padding: 10px 16px 4px; font-size: 13px; font-weight: 600; color: var(--ink55); }
.sx-hd span { font-weight: 500; color: var(--ink40); }
.sx-res .ds-row.sx-sel { background-color: var(--fill4); }
.sx-res .ds-row:active { background-color: var(--fill8); }
.sx-none { margin: 0; padding: 14px 16px; color: var(--ink55); font-size: 15px; }
.sx-none button { color: var(--accent); font: inherit; font-weight: 600; margin-left: 4px; }
/* Mac / a wide window: a Spotlight-style box near the top, the field above its matches */
html:has(.mac) .sx-col { top: 12vh; bottom: auto; max-height: 70vh; left: 50%; right: auto; width: min(600px, calc(100% - 48px)); transform: translateX(-50%); flex-direction: column-reverse; justify-content: flex-start; }
button.m-search { width: calc(100% - 8px); text-align: left; cursor: pointer; }

/* the web's own button, right next to + (the native shell draws its own, right under + in the strip) */
.fab-find { position: absolute; z-index: 30; right: calc(24px + var(--sar)); bottom: calc(var(--sab) + 14px + 60px + 10px); width: 44px; height: 44px; border-radius: 22px;
  display: flex; align-items: center; justify-content: center; color: var(--ink85); background: var(--glass); -webkit-backdrop-filter: saturate(1.6) blur(30px); backdrop-filter: saturate(1.6) blur(30px);
  box-shadow: var(--glassRing), var(--sm); transition: transform 200ms var(--ease), opacity 160ms var(--ease); }
.fab-find:active { transform: scale(.92); }
body:has([contenteditable="true"]:focus) .fab-find { opacity: 0; transform: scale(.85); pointer-events: none; }
.side-rail .phone .fab-find, html.in-shell .phone .fab-find { display: none; } /* the strip carries it */
