/* ==================== GLOBAL SEARCH (Ctrl+K) ==================== */
.gs-trigger {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  color: inherit;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
}
.gs-trigger:hover { 
  background: rgba(255, 255, 255, 0.2); 
  border-color: rgba(255, 255, 255, 0.3);
}

.gs-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 10000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  backdrop-filter: blur(2px);
}
.gs-overlay.show { display: flex; animation: gs-fade .12s ease-out; }

.gs-modal {
  width: min(620px, 94vw);
  max-height: 70vh;
  background: var(--bg, #fff);
  color: var(--text, #111);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: gs-slide .15s ease-out;
}

.gs-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.gs-search-ico { font-size: 16px; opacity: .7; }
#gs-input {
  flex: 1; border: none; outline: none; background: transparent;
  color: inherit; font-size: 16px; font-family: inherit;
}
.gs-hint {
  font-size: 11px; padding: 2px 6px; border-radius: 4px;
  background: var(--bg-subtle, #f3f4f6); color: var(--muted, #6b7280);
  border: 1px solid var(--border, #e5e7eb);
}

.gs-results {
  overflow-y: auto; flex: 1; padding: 6px 0; min-height: 60px;
}

.gs-group { padding: 4px 0; }
.gs-group-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted, #6b7280); padding: 8px 16px 4px; font-weight: 600;
}

.gs-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; text-decoration: none; color: inherit;
  cursor: pointer; transition: background .08s;
}
.gs-item:hover, .gs-item.active {
  background: var(--bg-hover, rgba(128, 128, 128, 0.1)); 
  outline: none;
}

/* ★ Принудительный контраст для тёмной темы */
[data-theme="dark"] .gs-item:hover, 
[data-theme="dark"] .gs-item.active {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
}
.gs-item-ico { font-size: 16px; width: 20px; text-align: center; opacity: .85; }
.gs-item-body { display: flex; flex-direction: column; min-width: 0; }
.gs-item-title { font-size: 14px; font-weight: 500; }
.gs-item-sub   { font-size: 12px; color: var(--muted, #6b7280); margin-top: 1px; }

.gs-empty { padding: 24px 16px; text-align: center; color: var(--muted, #6b7280); font-size: 14px; }

.gs-footer {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 16px; border-top: 1px solid var(--border, #e5e7eb);
  font-size: 11px; color: var(--muted, #6b7280);
}
.gs-footer kbd {
  display: inline-block; padding: 1px 5px; border: 1px solid var(--border, #e5e7eb);
  border-radius: 3px; font-family: monospace; font-size: 10px;
  background: var(--bg-subtle, #f3f4f6); margin: 0 1px;
}

@keyframes gs-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gs-slide { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 600px) {
  .gs-overlay { padding-top: 5vh; }
  .gs-modal   { max-height: 85vh; }
  .gs-footer  { display: none; }
}
