/* ---------- Search ---------- */
.search-wrap{ padding:0 16px 12px; }
.search-input-row{ display:flex; align-items:center; gap:8px; }
.search-input-wrap{ position:relative; flex:1; min-width:0; }
.search-input{
  width:100%; padding:10px 28px 10px 12px; border-radius:8px; border:1px solid var(--line);
  background:var(--ink-soft); color:var(--parchment); font-size:16px; font-family:var(--font-ui);
}
.search-input:focus{ outline:none; border-color:var(--gold); }
.clear-input-btn{
  display:none; position:absolute; right:4px; top:50%; transform:translateY(-50%);
  background:transparent; border:none; color:var(--text-dim); font-size:12px; padding:6px;
}
.clear-input-btn:hover{ color:var(--parchment); }
.clear-input-btn.visible{ display:block; }
.search-input-wrap.has-keyboard-btn .search-input{ padding-right:50px; }
.geez-keyboard-toggle-btn{
  position:absolute; right:26px; top:50%; transform:translateY(-50%);
  background:transparent; border:none; color:var(--text-dim); font-size:14px; padding:6px;
}
.geez-keyboard-toggle-btn:hover, .geez-keyboard-toggle-btn.active{ color:var(--gold); }
.geez-toggle-label{
  display:flex; align-items:center; gap:4px; font-size:11px; color:var(--text-dim);
  font-family:var(--font-ethiopic); white-space:nowrap; cursor:pointer;
}
.field-toggle{ display:flex; gap:6px; margin-top:8px; }
.field-toggle button{
  flex:1; padding:6px 4px; font-size:11.5px; background:transparent;
}
.field-toggle button.active{ background:var(--teal); border-color:var(--teal); color:var(--parchment); }

/* ---------- On-screen Ge'ez keyboard (search box) ---------- */
#geez-keyboard-panel, .geez-keyboard-panel{ margin-top:8px; border:1px solid var(--line); border-radius:8px; background:var(--ink-soft); padding:8px; }
.geez-keyboard-header{
  display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px;
  font-size:11px; color:var(--text-dim);
}
.geez-keyboard-header a{ color:var(--teal); text-decoration:none; }
.geez-keyboard-header a:hover{ text-decoration:underline; }
.geez-keyboard-tabs{ display:flex; gap:4px; }
.geez-keyboard-tab{
  padding:3px 8px; font-size:11px; background:transparent; border:1px solid var(--line);
  border-radius:5px; color:var(--text-dim); cursor:pointer;
}
.geez-keyboard-tab.active{ background:var(--teal); border-color:var(--teal); color:var(--parchment); }
.geez-keyboard-tab:hover{ border-color:var(--gold); }
.geez-keyboard-row{ display:flex; flex-wrap:wrap; gap:4px; }
.geez-keyboard-row + .geez-keyboard-row{ margin-top:6px; padding-top:6px; border-top:1px dashed var(--line); }
.geez-key{
  min-width:30px; padding:6px 4px; font-size:15px; font-family:var(--font-ethiopic);
  background:var(--ink-softer); border:1px solid var(--line); border-radius:6px; cursor:pointer;
}
.geez-key:hover{ border-color:var(--gold); }
.geez-key.active{ background:var(--teal); border-color:var(--teal); }

/* ---------- Ge'ez full mapping reference modal ---------- */
#geez-mapping-table{ max-height:60vh; overflow:auto; }
.geez-mapping-row{ display:flex; align-items:center; gap:6px; padding:3px 0; border-bottom:1px solid var(--line); }
.geez-mapping-row .geez-mapping-cells{ display:flex; flex-wrap:wrap; gap:4px; flex:1; }
.geez-mapping-cell{
  display:flex; flex-direction:column; align-items:center; min-width:36px; padding:4px 3px;
  background:var(--ink-softer); border:1px solid var(--line); border-radius:6px; cursor:pointer;
}
.geez-mapping-cell:hover{ border-color:var(--gold); }
.geez-mapping-cell .ch{ font-family:var(--font-ethiopic); font-size:15px; }
.geez-mapping-cell .latin{ font-size:9px; color:var(--text-dim); }

/* ---------- Voice search (left panel: toggle next to geez-toggle, plus
   the recognized-phrase box below the field toggle) ---------- */
.voice-toggle-row{ display:flex; align-items:center; gap:6px; font-size:14px; cursor:pointer; }
#voice-phrase-box, .voice-phrase-box{ margin-top:8px; border:1px solid var(--line); border-radius:8px; background:var(--ink-soft); padding:8px; }
.voice-phrase-box-header{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px; }
.voice-silence-row{ display:flex; align-items:center; gap:5px; font-size:11px; color:var(--text-dim); white-space:nowrap; }
#voice-silence-input, .voice-silence-input{
  width:36px; padding:2px 4px; border-radius:5px; border:1px solid var(--line);
  background:var(--ink-softer); color:var(--parchment); font-size:11px; text-align:center;
}
#voice-phrase-list, .voice-phrase-list{ max-height:260px; overflow-y:auto; }
#voice-phrase-list .empty-note, .voice-phrase-list .empty-note{ padding:6px 2px; }
.voice-phrase-row{
  padding:7px 8px; border-radius:6px; cursor:default;
  display:flex; justify-content:space-between; align-items:flex-start; gap:8px;
}
.voice-phrase-row:hover{ background:var(--ink-softer); }
.voice-phrase-row.live{ border:1px solid var(--teal); }
.voice-phrase-row .text{
  flex:1; min-width:0; display:flex; flex-wrap:wrap; align-items:center; gap:4px;
}
.voice-word-chip{
  display:inline-flex; align-items:center; gap:2px; font-size:12.5px; font-family:var(--font-ethiopic);
  background:var(--ink-softer); border-radius:10px; padding:2px 3px 2px 8px; white-space:nowrap;
}
.voice-word-chip .voice-word-remove{
  background:transparent; border:none; color:var(--text-dim); font-size:11px; line-height:1;
  padding:3px; border-radius:50%; cursor:pointer;
}
.voice-word-chip .voice-word-remove:hover{ color:var(--vermillion); }
.voice-interim{ font-size:12.5px; font-family:var(--font-ethiopic); color:var(--text-dim); font-style:italic; }

.search-status{ display:none; align-items:center; gap:6px; font-size:11px; color:var(--text-dim); }
.search-status.active{ display:flex; }
.search-status .status-dot{
  width:6px; height:6px; border-radius:50%; background:var(--gold); flex-shrink:0;
  animation:voice-pulse 1s ease-in-out infinite;
}
/* While a search is in flight, #results is about to be torn down and
   rebuilt — dim + disable its row actions so a click can't silently land
   on a button that's about to vanish mid-click (see runSearch()). */
#results.busy .row-actions{ pointer-events:none; opacity:0.5; }

.results-dropdown{
  margin:0 16px; border-radius:8px; overflow:hidden; max-height:260px; overflow-y:auto;
  border:1px solid var(--line); background:var(--ink-soft);
}
.result-row{
  padding:9px 12px; border-bottom:1px solid var(--line); cursor:pointer;
  display:flex; justify-content:space-between; align-items:center; gap:8px;
}
.result-row:last-child{ border-bottom:none; }
.lang-chip{
  font-size:10px; padding:2px 6px; border-radius:20px; border:1px solid var(--line);
  color:var(--text-dim); text-transform:uppercase; letter-spacing:0.04em; flex-shrink:0;
}
.empty-note{ padding:10px 16px; font-size:12.5px; color:var(--text-dim); }

/* ---------- Shared song row (Search / Browse / Playlist all use this via
   songRowHtml()) — title / singer / album+year (or search's matched
   lyric excerpt on the third line instead), a lang chip, and a hover
   tooltip (native title attribute) showing the full lyrics. ---------- */
.song-row .info{ min-width:0; flex:1; }
.song-row .info .t{ font-size:13.5px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.song-row .info .singer{ font-size:11.5px; color:var(--text-dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.song-row .info .meta{ font-size:10.5px; color:var(--text-dim); opacity:0.8; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* Search results' third line is a full matched verse (may itself be
   multi-line), not the single-line album/year meta browse & playlist rows
   show — let it wrap and clamp instead of truncating to one line. */
/* Bible search results reuse .info/.t/.singer's look (title + matched
   line) but without .song-row's single-line truncation, since a match
   can now be flanked by dimmed context lines that need to wrap. */
.bible-search-result .info .t{ font-size:13.5px; font-weight:600; }
.bible-search-result .info .singer{ font-size:11.5px; color:var(--text-dim); white-space:pre-line; }
.bible-context-line{ font-size:11.5px; color:var(--text-dim); opacity:0.65; white-space:pre-line; }
.result-row.song-row .info .meta{
  white-space:pre-line; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical;
  overflow:hidden; text-overflow:ellipsis;
}
.row-actions{ display:flex; gap:2px; flex-shrink:0; align-items:center; }
.row-actions .icon-btn{ font-size:13px; }

