/* SEARCH EVERYWHERE (Alison, 2026-12-03: "love"). The magnifying glass at the end of the wave, and the box it opens.
   Logic: static/js/screens/search/search-everywhere.js. The landing glow is the story card's own (.story-just-saved).
   Calm, few buttons (the easy-on-the-eyes rule): one box, quiet sage text, the matched words marked softly.
   Full width on a phone; dark mode under :root[data-theme="dark"]. */
:root {
  --se-paper: #FBF8F1;
  --se-ink: #2F3A33;
  --se-quiet: #6B7A6E;
  --se-line: rgba(74, 124, 89, 0.18);
  --se-hover: rgba(141, 184, 138, 0.14);
  --se-mark: rgba(233, 168, 76, 0.32);
  --se-sage: #4A7C59;
  --se-veil: rgba(22, 28, 34, 0.38);
}
:root[data-theme="dark"] {
  --se-paper: #1F272F;
  --se-ink: #E8E4DC;
  --se-quiet: #A9B6AC;
  --se-line: rgba(169, 200, 166, 0.18);
  --se-hover: rgba(141, 184, 138, 0.12);
  --se-mark: rgba(233, 168, 76, 0.30);
  --se-sage: #A9C8A6;
  --se-veil: rgba(0, 0, 0, 0.55);
}

/* The glass keeps the same line box as the worded doors (a text line, the icon centred in it), so its top lines up
   with theirs. 2026-12-03: as an 18px flex box it sat 3px lower, and the nav's one-line measure (_fitWaveNav, tops
   within 2px) read that as "the doors wrap" and kept the compact nav on every wide screen. */
.wave-link.wave-link-search { display: inline-block; min-width: 32px; text-align: center; }
.wave-link.wave-link-search svg { display: inline-block; vertical-align: middle; }

/* The glass in the Lab's blue band (2026-12-04, "yes in thinking lab"): white like the band's words, on the right just
   before "lead with how". margin-left:auto takes the band's free space, so "<- Back" stays left and the two sit right. */
.tl-nav .tl-nav-search {
  margin-left: auto; margin-right: 1.1rem;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; min-height: 32px;
  color: rgba(255, 255, 255, 0.85); text-decoration: none; cursor: pointer;
  transition: color 0.15s;
}
.tl-nav .tl-nav-search svg { display: block; }
.tl-nav .tl-nav-search:hover { color: #fff; }
.tl-nav .tl-nav-search:focus-visible { color: #fff; outline: 2px solid #fff; outline-offset: 3px; border-radius: 4px; }

.se-sheet[hidden] { display: none; }
.se-sheet { position: fixed; inset: 0; z-index: 10050; display: flex; justify-content: center; align-items: flex-start; }
.se-backdrop { position: absolute; inset: 0; background: var(--se-veil); }
.se-panel {
  position: relative; margin-top: 9vh; width: min(640px, calc(100vw - 32px)); max-height: 78vh;
  display: flex; flex-direction: column; background: var(--se-paper); color: var(--se-ink);
  border-radius: 14px; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22); overflow: hidden;
}
.se-bar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--se-line); }
.se-glass { color: var(--se-quiet); display: inline-flex; }
.se-input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--se-ink);
  font: 400 17px/1.4 'Inter', 'Montserrat', sans-serif;
}
.se-input::placeholder { color: var(--se-quiet); }
.se-close { border: 0; background: transparent; color: var(--se-quiet); font-size: 24px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.se-results { overflow-y: auto; padding: 6px 8px 8px; flex: 1; }
.se-empty { margin: 18px 10px; color: var(--se-quiet); font-size: 15px; line-height: 1.5; }
.se-group-head {
  margin: 12px 10px 4px; font: 600 11.5px/1.2 'Montserrat', 'Inter', sans-serif; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--se-quiet);
}
.se-list { list-style: none; margin: 0; padding: 0; }
.se-row {
  display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; border: 0; background: transparent;
  color: var(--se-ink); padding: 9px 10px; border-radius: 10px; cursor: pointer; font: inherit;
}
.se-row:hover, .se-row:focus-visible { background: var(--se-hover); outline: none; }
.se-title { font-weight: 600; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.se-snip { font-size: 13.5px; line-height: 1.45; color: var(--se-quiet); overflow-wrap: anywhere; }
.se-where { font-size: 12.5px; color: var(--se-sage); }
.se-row mark { background: var(--se-mark); color: inherit; border-radius: 3px; padding: 0 1px; }
.se-more { margin: 2px 10px 6px; font-size: 12.5px; color: var(--se-quiet); }
.se-foot { margin: 0; padding: 12px 16px; border-top: 1px solid var(--se-line); font-size: 13.5px; color: var(--se-quiet); }
.se-ask { border: 0; background: transparent; padding: 0; color: var(--se-sage); font: inherit; font-weight: 600; cursor: pointer; }
.se-ask:hover { opacity: .8; }   /* no underlines in this house (tests/test_no_underlines.py) */
body.se-open { overflow: hidden; }

/* A phone: the box is the whole screen, edge to edge. */
@media (max-width: 600px) {
  .se-sheet { align-items: stretch; }
  .se-panel { margin: 0; width: 100vw; max-height: none; height: 100%; border-radius: 0; }
  .se-bar { padding: 12px 16px; }
  .se-results { padding: 4px 8px; }
}

/* 2026-12-03 walk: the browser's own clear x sat beside our close x, two x's that looked the same (Alison: "yes that's
   fine on the x"). One x, the close. Escape or a click outside also closes. */
.se-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }

/* 2026-12-03: with "reduce motion" on, the landing glow still shows, as a still highlight while it is on. */
@media (prefers-reduced-motion: reduce) {
  .story-just-saved { animation: none; transform: none; box-shadow: 0 0 0 3px rgba(222, 142, 122, 0.75); }
}
