/* Шапка GGGOLD используется на главной и на страницах Invidious. */
.topbar {
  min-height: 66px;
  display: grid;
  grid-template-columns: 1fr minmax(260px, 660px) 1fr;
  gap: 16px;
  align-items: center;
  padding: 10px 18px;
  color: #f5f3fb;
  font-family: 'GGGOLD Sidebar', Inter, var(--video-ui-fonts, system-ui, sans-serif);
}
#video-topbar, #video-topbar * { box-sizing: border-box; }
#contents > #video-topbar { padding-inline: 0; }
#contents > .navbar[hidden],
#contents:has(> #video-topbar) > .navbar { display: none; } /* Штатная шапка скрыта уже при первом отображении страницы. */
#video-topbar a { text-decoration: none; }
.top-search {
  grid-column: 2;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
  padding: 0 12px 0 16px;
  min-height: 43px;
  border: 1px solid #565b83;
  border-radius: 14px;
  color: #b9b6dc;
  background: linear-gradient(105deg, #24263d, #1c2032);
  box-shadow: inset 0 0 18px #7c79e21c;
}
.top-search:focus-within { border-color: #bc9dff; box-shadow: 0 0 0 2px #bc9dff28; }
.top-search input { min-width: 0; width: 100%; padding: 5px 0; border: 0; background: transparent; font: inherit; font-size: 14px; color: #fff; }
#video-topbar .top-search input:focus { outline: none; box-shadow: none; }
.top-search input::placeholder { color: #b7b8d4; opacity: 1; }
.top-search-button { display: grid; flex: none; place-items: center; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
.top-search-button:hover { color: #ead5ff; }
.top-search kbd { padding: 3px 7px; border-radius: 6px; background: #363752; color: #c7c6de; font: inherit; font-size: 12px; white-space: nowrap; }
.top-actions { grid-column: 3; display: flex; justify-content: end; align-items: center; gap: 10px; }
#video-topbar a.icon-button { color: #ede9fa; }
#video-topbar .profile-button { color: #ead5ff; border-color: #6d5598; background: #362a53; }
#video-topbar .profile-guest { width: auto; padding-inline: 10px; font-size: 13px; font-weight: 650; }
#video-topbar .menu-button, .compact-brand { display: none; }

@media (max-width: 1220px) {
  .topbar { grid-template-columns: minmax(10px, 1fr) minmax(230px, 560px) auto; }
}
@media (max-width: 1000px) {
  .topbar { grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 9px; }
  .top-search { grid-column: 3; }
  .top-actions { grid-column: 4; }
  #video-topbar .menu-button { display: inline-flex; }
  .compact-brand { display: inline-flex; margin: 0 4px; }
  .compact-brand .brand-symbol { width: 31px; height: 31px; border-radius: 9px; }
}
@media (max-width: 680px) {
  .topbar { min-height: 61px; padding: 8px 12px; gap: 7px; }
  .top-search { height: 40px; min-height: 40px; }
  #video-topbar .icon-button { width: 37px; }
  #video-topbar .profile-guest { width: 37px; padding: 0; }
  .top-search { padding: 0 8px 0 11px; gap: 7px; }
  .top-search input { font-size: 13px; }
  .top-search kbd, .profile-label { display: none; }
}
/* На телефоне отдаём место поиску, главная остаётся доступной через меню. */
@media (max-width: 440px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .compact-brand { display: none; }
  .top-search { grid-column: 2; }
  .top-actions { grid-column: 3; }
}

/* На самых узких экранах настройки доступны по одноимённому пункту меню. */
@media (max-width: 350px) {
  #video-topbar .settings-button { display: none; }
}
