/* Independent global-search panel; does not alter or hide page-local word rows. */
.global-search-shell { margin: 24px 0 14px; border: 1px solid #dbe5f4; border-radius: 15px; background: #fff; overflow: hidden; box-shadow: 0 4px 16px rgba(15,23,42,.04); }
.global-search-intro { padding: 12px 14px 8px; display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.global-search-intro h2 { margin: 0; color: #172554; font-size: 15px; font-weight: 900; letter-spacing: -.02em; }
.global-search-intro p { margin: 0; color: #64748b; font-size: 11px; }
.global-search-input-row { padding: 0 14px 13px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 245px); gap: 8px; }
.global-search-input-row input, .global-search-input-row select { min-width: 0; width: 100%; min-height: 42px; border: 1px solid #cbd5e1; border-radius: 10px; padding: 8px 12px; background: #fff; color: #172033; font: inherit; font-size: 13px; }
.global-search-input-row input:focus, .global-search-input-row select:focus { outline: 2px solid #bfdbfe; border-color: #60a5fa; outline-offset: 1px; }
.global-search-panel { display: none; border-top: 1px solid #e2e8f0; background: #f8fbff; }
.global-search-panel.visible { display: block; }
.global-search-heading { min-height: 42px; padding: 10px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #dbeafe; background: #eff6ff; color: #1e3a8a; }
.global-search-heading strong { font-size: 13px; font-weight: 850; }
.global-search-heading span { color: #64748b; font-size: 11px; font-weight: 650; text-align: right; }
.global-search-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; }
.global-search-result { min-width: 0; padding: 11px 12px; display: flex; flex-direction: column; align-items: stretch; gap: 5px; border: 1px solid #e2e8f0; border-radius: 11px; background: #fff; color: #172033; }
.global-search-result-top { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.global-search-source { flex: 0 0 auto; padding: 2px 7px; border-radius: 999px; color: #fff; font-size: 10px; font-weight: 850; letter-spacing: .01em; }
.global-search-source.source-ngsl { background: #2563eb; }
.global-search-source.source-ngsls { background: #0f766e; }
.global-search-source.source-hsk { background: #7c3aed; }
.global-search-meta { min-width: 0; color: #64748b; font-size: 10px; font-weight: 650; text-align: right; }
.global-search-word { color: #172554; font-size: 19px; font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; }
.global-search-secondary { color: #64748b; font-size: 11px; font-weight: 650; overflow-wrap: anywhere; }
.global-search-meaning { color: #334155; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.global-search-definition { display: block; padding-top: 2px; color: #64748b; font-size: 11px; }
.global-search-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 5px; margin-top: auto; }
.global-search-action { min-height: 32px; padding: 5px 9px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid #dbe3ee; border-radius: 8px; background: #fff; color: #334155; font: inherit; font-size: 11px; font-weight: 800; text-decoration: none; cursor: pointer; transition: background .14s ease, border-color .14s ease, transform .14s ease; }
.global-search-action:hover { border-color: #93c5fd; background: #f8fbff; text-decoration: none; }
.global-search-action.action-view { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.global-search-action.action-listen { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.global-search-action.action-dictionary { margin-left: auto; }
.global-search-action.action-open-book { border-color: #cbd5e1; background: #f8fafc; }
.word-table tbody tr.global-search-focus-target { scroll-margin-top: 150px; }
.word-table tbody tr.global-search-focus-target td { background: #fef3c7 !important; box-shadow: inset 0 1px 0 #f59e0b, inset 0 -1px 0 #f59e0b; }
.global-search-action.is-playing { box-shadow: 0 0 0 2px rgba(22,163,74,.16); }
.global-search-empty { padding: 23px 14px; color: #64748b; font-size: 13px; text-align: center; }
@media (max-width: 760px) {
  .global-search-input-row { grid-template-columns: minmax(0, 1fr); padding-bottom: 11px; }
  .global-search-results { grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 8px; }
  .global-search-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
  .global-search-heading span { text-align: left; }
  .global-search-word { font-size: 18px; }
  .global-search-action { min-height: 36px; }
}

/* Icon beside local search: jump to the global search section at the bottom. */
.controls button.global-search-jump {
  flex: 0 0 39px;
  width: 39px;
  height: 39px;
  min-height: 39px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  color: #1d4ed8;
  background: #eff6ff;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(37,99,235,.08);
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.controls button.global-search-jump:hover { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
.controls button.global-search-jump:active { transform: translateY(1px); }
.controls button.global-search-jump:focus-visible { outline: 3px solid #bfdbfe; outline-offset: 2px; }
.global-search-shell { scroll-margin-top: 14px; }
