/* Search (js/search.js), design canvas page 4b, Search A, with Mike's rulings of 2026-11-15:
   the field follows patterns.md (radius-md 10, line-strong border, gold when focused); the tag column is
   56 px; matches use the search-match style (keywash fill, 1 px gold underline). Phone first (390 px). */

/* The search field and Close stand in for the top bar. */
body[data-view="search"] .top, body[data-view="search"] .nav-sheet { display: none; }
body[data-view="search"] .wrap { max-width: 430px; padding: 10px 0 28px; }

.sr { display: flex; flex-direction: column; font: 400 15px/1.5 var(--ui); color: var(--text); }
.sr a { color: inherit; text-decoration: none; }
.sr-muted { color: var(--muted); }
.sr-sm { font-size: 13px; }
.sr-gold { color: var(--gold); }
.sr-lab { font: 600 11px/1.4 var(--ui); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }

.sr-bar { display: flex; align-items: center; gap: 6px; padding: 0 12px 0 16px; }
.sr-field {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px 0 14px;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; color: var(--muted);
}
.sr-field:focus-within { border-color: var(--gold); }
.sr-field-i { width: 20px; height: 20px; }
.sr-input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: none; padding: 0;
  font: 400 16px/1.3 var(--ui); color: var(--text);
}
.sr-close { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; font-size: 13px; color: var(--muted) !important; }
.sr-close:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }

.sr-summary { margin: 0; padding: 10px 20px 0; font-size: 12px; color: var(--muted); }
.sr-gh {
  display: flex; justify-content: space-between; align-items: baseline; margin: 0; padding: 20px 20px 4px;
  font: 600 11px/1.4 var(--ui); letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
}

/* A row (patterns.md "Lists"): tag column, then title over meta; an unopened day ends with the dot + New. */
.sr-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.sr-row:hover { background: var(--panel); }
.sr-row:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.sr-tag { width: 56px; flex: none; padding-top: 3px; font-size: 12px; line-height: 1.4; }
.sr-tag-i { display: flex; padding-top: 4px; }
.sr-tag-i .i { width: 16px; height: 16px; }
.sr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sr-title { font: 400 17px/1.3 var(--read); color: var(--text); }
.sr-meta { font-size: 12px; line-height: 1.4; color: var(--muted); }
.sr-new { flex: none; display: inline-flex; align-items: center; gap: 6px; padding-top: 3px; font-size: 12px; color: var(--muted); }
.sr-new .dot { width: 8px; height: 8px; }
.sr-verse { font: italic 400 16px/1.4 var(--read); color: var(--text); }
.sr-ref { color: var(--gold); font-weight: 500; }
.sr-row-note { flex-direction: column; gap: 4px; }
.sr-hand { font: 500 20px/1.25 "Caveat", cursive; color: var(--text); white-space: pre-line; }

/* The search-match style. Inside the reader's own words it keeps their Caveat. */
.sr mark { background: var(--keywash); color: var(--text); border-bottom: 1px solid var(--gold); padding: 0 1px; font: inherit; }

.sr-pd { margin: 0; padding: 16px 20px 0; font: italic 12px/1.4 var(--read); color: var(--muted); }

/* Before typing, and under no results. */
.sr-hint { display: flex; flex-direction: column; gap: 8px; padding: 20px 20px 0; }
.sr-empty { display: flex; flex-direction: column; gap: 14px; padding: 56px 24px 0; }
.sr-empty .sr-hint { padding: 18px 0 0; margin-top: 4px; border-top: 1px solid var(--line); }
.sr-h2 { font: 400 28px/1.2 var(--read); margin: 0; color: var(--text); overflow-wrap: anywhere; }
.sr-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 16px;
  border-radius: 10px; background: var(--gold); color: var(--ground) !important; font: 500 15px/1.3 var(--ui); text-align: center;
  overflow-wrap: anywhere;
}
.sr-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Loading and failure: plain text, never red. */
.sr-loading { margin: 0; padding: 20px; }
.sr-error { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 20px; }
.sr-error-line { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text); }
.sr-again {
  min-height: 44px; padding: 0 16px; border-radius: 10px; cursor: pointer;
  background: var(--raised); border: 1px solid var(--line-strong); color: var(--text); font: 500 14px/1 var(--ui);
}
.sr-again:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
