/* Admin settings' search (GitHub issue 203, part 1d, the owner's AH9; docs/adr/0079; public/js/app/settings-search.js):
   the box at the top of the side menu, and the results that drop down under it. Sizes are the tokens' (tokens.css);
   colors the page's own, so light and dark both follow them. */
.settings-search { position:relative; min-width:0; }
.settings-search-field { display:flex; align-items:center; gap:var(--space-100); min-width:0; padding:0 var(--space-75) 0 var(--space-150); border:1px solid var(--line); border-radius:var(--radius-md); background:var(--surface); color:var(--muted); }
.settings-search-field:focus-within { border-color:var(--spruce); box-shadow:0 0 0 3px var(--spruce-pale); }
.settings-search-icon { flex:none; font-size:var(--text-md); line-height:1; }
/* The box is the field: the words are typed into it, with no box of their own inside it (components.css draws one around
   every field of a page). */
.settings-search .settings-search-field input[type="search"] { flex:1; min-width:0; min-height:var(--control-height); padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; color:var(--ink); font:inherit; font-size:var(--text-sm); outline:none; }
.settings-search .settings-search-field input[type="search"]:focus-visible { border:0; box-shadow:none; }
.settings-search-field input::placeholder { color:var(--muted); opacity:1; }
/* "/" opens it: said beside the box until it has the cursor. */
.settings-search-key { flex:none; min-width:1.5em; padding:0 var(--space-50); border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface-2, var(--paper)); color:var(--muted); font:inherit; font-size:var(--text-2xs); line-height:1.6; text-align:center; }
.settings-search-field:focus-within .settings-search-key { display:none; }

/* The results, over what is under the box. */
.settings-search-results { position:absolute; top:calc(100% + var(--space-50)); right:0; left:0; z-index:var(--z-menu); max-height:min(70vh, 36rem); overflow-y:auto; padding:var(--space-50); border:1px solid var(--line); border-radius:var(--radius-lg); background:var(--surface); box-shadow:var(--shadow); overscroll-behavior:contain; }
.settings-search-results[hidden], #settingsSearchList[hidden] { display:none; }
#settingsSearchList { display:grid; gap:var(--space-25); margin:0; padding:0; list-style:none; }
.settings-search-option { display:flex; align-items:flex-start; gap:var(--space-100); min-width:0; padding:var(--space-100); border-radius:var(--radius-md); color:var(--ink); cursor:pointer; }
.settings-search-option:hover { background:var(--hover-bg); }
.settings-search-option.active { background:var(--hover-bg); outline:2px solid var(--spruce); outline-offset:-2px; }
.settings-search-kind { flex:none; min-width:4.75em; margin-top:var(--space-25); padding:0 var(--space-75); text-align:center; border-radius:var(--radius-pill); background:var(--spruce-pale); color:var(--spruce-dark); font-size:var(--text-2xs); font-weight:var(--weight-semibold); line-height:1.6; }
.settings-search-kind.is-field, .settings-search-kind.is-section { background:var(--surface-2, var(--paper)); color:var(--ink-2); }
.settings-search-words { display:flex; flex-direction:column; gap:var(--space-25); min-width:0; }
.settings-search-words b { color:var(--ink); font-size:var(--text-sm); font-weight:var(--weight-semibold); line-height:var(--leading-tight); overflow-wrap:anywhere; }
.settings-search-words small { color:var(--muted); font-size:var(--text-xs); line-height:var(--leading-normal); overflow-wrap:anywhere; }
/* Found by its line of help: two lines of it. */
.settings-search-words .settings-search-help { display:block; overflow:hidden; color:var(--ink-2); overflow-wrap:break-word; }
.settings-search-note:empty { display:none; }
.settings-search-note p { margin:0; padding:var(--space-100); color:var(--ink-2); font-size:var(--text-sm); line-height:var(--leading-normal); }
.settings-search-note b { display:block; margin-bottom:var(--space-50); color:var(--ink); }
.settings-search-partial { border-top:1px solid var(--line); }
#settingsSearchList[hidden] + .settings-search-note .settings-search-partial { border-top:0; }

/* In a department, for an Administrator of the IT Service Desk: what is there, each with a way there. */
.settings-search-elsewhere { margin:var(--space-50) 0 0; padding:var(--space-100); border-top:1px solid var(--line); }
#settingsSearchList[hidden] + .settings-search-note .settings-search-none + .settings-search-elsewhere { margin-top:0; }
.settings-search-elsewhere-title { margin:0 0 var(--space-50); padding:0; color:var(--muted); font-size:var(--text-2xs); font-weight:var(--weight-bold); letter-spacing:.04em; text-transform:uppercase; }
.settings-search-elsewhere ul { display:grid; gap:var(--space-75); margin:0; padding:0; list-style:none; }
.settings-search-elsewhere li { color:var(--ink-2); font-size:var(--text-sm); line-height:var(--leading-normal); }
.settings-search-note .settings-search-elsewhere li b { display:inline; margin:0; color:var(--ink); font-weight:var(--weight-semibold); }
.settings-search-note .settings-search-elsewhere p { padding:0; }
.settings-search-elsewhere-open { font-size:var(--text-sm); white-space:nowrap; }

/* At desktop width the box sits in the side menu, a narrow column: the results open wider than it, over the page,
   on a solid card with a shadow (GitHub issue 203, 1e: in the column each result wrapped to 3 or 4 lines, and the
   menu showed through under the last one). While they are open the menu doesn't clip them. */
@media (min-width:1100px) {
  .settings-search-results { right:auto; width:min(32rem, calc(100vw - var(--settings-menu-width) - var(--space-800))); max-height:min(75vh, 40rem); box-shadow:var(--shadow-pop); }
  #settingsView.settings-has-frame .settings-side-inner:has(.settings-search-results:not([hidden])) { overflow:visible; }
  .settings-search-words .settings-search-help {; overflow-wrap:break-word; }
}

/* A field or section a result opened, marked so the eye finds it (GitHub issue 203, 1e: the outline was there for a
   moment only, and easy to miss): a tint behind it and a ring around it, which fade once it has been seen. */
.settings-search-hit { border-radius:var(--radius-md); background:var(--spruce-pale); box-shadow:0 0 0 var(--space-75) var(--spruce-pale), 0 0 0 calc(var(--space-75) + 2px) var(--spruce); transition:background-color .6s ease, box-shadow .6s ease; }
.settings-search-hit.is-fading { background:transparent; box-shadow:0 0 0 var(--space-75) transparent, 0 0 0 calc(var(--space-75) + 2px) transparent; }
@media (prefers-reduced-motion: reduce) { .settings-search-hit { transition:none; } }

/* The "/" key is no use on a touch screen: not said there (GitHub issue 203, 1e). */
@media (hover:none) and (pointer:coarse) { .settings-search-key { display:none; } }
