/* Reference: compact topbar. Existing controls retain their own interactions. */
.langselector__code { display: none; }
.header-context { min-width: 0; position: relative; }
.header-context__summary { display: none; }
@media (min-width: 1025px) {
  #root .home .header { height: 52px; min-height: 52px; padding: 0 16px; gap: 18px; background: #fafafa; border-bottom: 1px solid #dedee2; box-shadow: none; }
  #root :is([data-theme="dark"], .theme-dark) .header, :is([data-theme="dark"], .theme-dark) #root .home .header { background: linear-gradient(180deg,#0d0e10,#090a0b); border-color: #202124; }
  #root .home .header__left { flex: 1 1 auto; min-width: 0; max-width: none; gap: 20px; }
  #root .home .header__right { flex: 0 0 auto; min-width: 0; gap: 8px; }
  #root .home .header__search-toggle { display: none; }
  #root .home .header__search-wrap { flex: 1 1 326px; min-width: 160px; max-width: 326px; }
  #root .home .header__search { display: flex; position: relative; inset: auto; width: 100%; max-width: none; height: 34px; min-height: 34px; padding: 0 10px; gap: 7px; border-radius: 999px; border: 1px solid #d6d7dd; background: #f0f1f3; box-shadow: inset 0 1px 0 #ffffff08; }
  #root .home .header__search-input { font-size: 12px !important; line-height: 1.3; text-overflow: ellipsis; min-width: 0; }
  #root .home .header__search-icon { width: 15px; height: 15px; }
  #root .home .header__search-shortcut { display: inline-block; flex: none; font-size: 10px !important; line-height: 16px; padding: 1px 5px; border: 0; border-radius: 4px; }
  #root .home .header__search-panel { position: absolute; top: calc(100% + 10px); left: 0; right: auto; width: min(500px,calc(100vw - 280px)); }
  #root .home .header__feedback-trigger { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: auto; min-height: 34px; padding: 0; border: 0; border-radius: 7px; background: transparent; box-shadow: none; color: var(--text-primary); font-size: 11px !important; font-weight: 600; white-space: nowrap; }
  #root .home .header__feedback-trigger > svg { display: block; flex: none; width: 17px; height: 17px; color: var(--text-secondary); }
  #root .home .header__sponsor-trigger { padding: 0 13px; background: #fff0de; color: #713600; }
  #root .home .header__sponsor-trigger > svg { color: #f56a0b; }
  #root .home .header :is(.header__icon-button,.themetoggle__button,.langselector__button) { display: inline-flex; align-items: center; justify-content: center; width: 28px; min-width: 28px; height: 34px; min-height: 34px; padding: 0; border: 0; border-radius: 5px; background: transparent; box-shadow: none; color: var(--text-primary); }
  #root .home .header :is(.header__icon-button,.themetoggle__button) svg { width: 18px; height: 18px; }
  #root .home .header .langselector__icon, #root .home .header .langselector__flag { display: none; }
  #root .home .header .langselector__code { display: inline; font-size: 11px !important; font-weight: 700; }
  #root .home .header .header__user-menu { padding-left: 12px; margin-left: 2px; border-left: 1px solid var(--border); }
  #root .home .header__user-button { display: flex; gap: 8px; min-height: 34px; padding: 0; background: transparent; border: 0; border-radius: 5px; color: var(--text-primary); }
  #root .home .header__user-avatar { width: 30px; height: 30px; border: 1px solid #666; box-shadow: none; }
  #root .home .header__user-info { display: flex; flex-direction: column; align-items: flex-start; min-width: 65px; max-width: 110px; gap: 1px; }
  #root .home .header__user-name { font-size: 12px !important; line-height: 14px; text-transform: none; }
  #root .home .header__user-role { font-size: 10px !important; color: var(--text-secondary); line-height: 12px; text-transform: none; letter-spacing: 0; font-weight: 400; }
  #root .home .header__user-icon { width: 13px; height: 13px; margin-left: 8px; }
  #root .home .header-context { width: 196px; flex: none; margin-right: 8px; }
  #root .home .header-context__summary { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-1); }
  #root .home .header-context__summary > svg:first-child { color: #f76b1c; flex: none; }
  #root .home .header-context__summary strong { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px !important; font-weight: 600; }
  #root .home .header-context__summary span { flex: 0 1 auto; max-width: 75px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px !important; line-height: 18px; padding: 0 4px; background: var(--surface-3); border-radius: 4px; color: var(--text-secondary); }
  #root .home .header-context > .branch-selector { position: absolute; inset: 0; width: 100%; min-width: 0; opacity: 0; }
  #root .home .header-context .branch-selector__label { display: none; }
  #root .home .header-context .branch-selector__control { width: 100%; max-width: none; min-width: 0; height: 100%; cursor: pointer; }
  #root .home .header-context:focus-within { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 8px; }
  #root .home .header :is(button,input):focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
  :is([data-theme="dark"], .theme-dark) #root .home .header__search, #root :is([data-theme="dark"], .theme-dark) .home .header__search { background: linear-gradient(110deg,#202226,#1a1b1f); border-color: #303238; }
  :is([data-theme="dark"], .theme-dark) #root .home .header__sponsor-trigger, #root :is([data-theme="dark"], .theme-dark) .home .header__sponsor-trigger { background: #432007; color: #f9e7db; }
}
@media (min-width: 1025px) and (max-width: 1279px) {
  #root .home .header { gap: 10px; padding-inline: 12px; }
  #root .home .header__left { gap: 12px; }
  #root .home .header__search-wrap { min-width: 125px; }
  #root .home .header__right { gap: 5px; }
  #root .home .header-context { width: 162px; margin-right: 0; }
  #root .home .header__user-info { min-width: 48px; max-width: 65px; }
}
