.topbar:has(.global-search-header) { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.global-search-header { display: flex; align-items: center; width: clamp(130px, 14vw, 210px); height: 34px; border: 1px solid #dce4ed; border-radius: 8px; background: #f7f9fc; }
.global-search-header input { min-width: 0; width: 100%; padding: 6px 0 6px 10px; border: 0; background: transparent; color: #26354b; font: inherit; font-size: 12px; }
.global-search-header > button { display: grid; place-items: center; flex: none; width: 34px; height: 32px; padding: 6px; border: 0; background: transparent; color: #52647a; cursor: pointer; border-radius: 7px; }
.global-search-header svg { width: 18px; height: 18px; }
.global-search-header:focus-within { border-color: #218c75; outline: 2px solid #c9e8df; }
.global-search-header input:focus { outline: none; }
.global-search-form { display: flex; gap: 12px; max-width: 900px; margin: 24px 0; }
.global-search-form input[type="search"] { flex: 1; min-width: 0; padding: 14px 16px; background: #fff; border: 1px solid #dce4ed; border-radius: 10px; color: #26354b; font: inherit; }
.global-search-form input:focus-visible, .global-search-header > button:focus-visible { outline: 2px solid #218c75; outline-offset: 2px; }
.global-search-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.global-search-tabs a { padding: 10px 14px; border-radius: 8px; color: #52647a; font-size: 13px; font-weight: 600; }
.global-search-tabs a[aria-current="page"] { background: #e5f3ee; color: #157a63; }
.global-search-tabs span, .global-search-group h2 span { margin-left: 7px; color: #8490a0; font-size: 12px; }
.global-search-summary { color: #68788e; font-size: 13px; overflow-wrap: anywhere; }
.global-search-group { max-width: 1100px; margin: 28px 0; }
.global-search-group h2 { font-size: 18px; color: #26354b; }
.global-search-results { padding: 0; margin: 14px 0; list-style: none; border: 1px solid #e2e8ef; border-radius: 12px; background: #fff; overflow: hidden; }
.global-search-results li + li { border-top: 1px solid #e9edf3; }
.global-search-result { display: flex; align-items: flex-start; gap: 16px; padding: 20px; color: #26354b; }
.global-search-result:hover { background: #f6faf8; }
.global-search-result:focus-visible { outline: 2px solid #218c75; outline-offset: -3px; }
.global-search-result > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.global-search-result h3 { margin: 0 0 7px; font-size: 15px; }
.global-search-result p { margin: 4px 0 0; color: #68788e; font-size: 12px; line-height: 1.6; }
.global-search-kind { flex: none; min-width: 72px; padding: 5px 8px; border-radius: 6px; background: #edf3f8; color: #52647a; font-size: 11px; font-weight: 700; }
.global-search-arrow { color: #218c75; }
.global-search-pagination { display: flex; gap: 18px; align-items: center; font-size: 13px; color: #68788e; }
.global-search-pagination a { color: #157a63; font-weight: 600; }
.global-search-empty, .global-search-no-results { padding: 24px; border: 1px dashed #dce4ed; border-radius: 12px; color: #68788e; background: #fff; }
.global-search-empty h2 { margin-top: 0; color: #26354b; font-size: 18px; }
@media (max-width: 650px) {
  .global-search-form { gap: 8px; }
  .global-search-form input[type="search"] { padding: 12px; font-size: 14px; }
  .global-search-result { gap: 10px; padding: 16px 12px; }
  .global-search-kind { min-width: 0; font-size: 10px; }
  .global-search-pagination { justify-content: space-between; gap: 8px; }
}

@media (max-width: 1100px) {
  .topbar:has(.global-search-header) { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand actions" "search search" "projects projects"; height: auto; padding-block: 10px; row-gap: 6px; }
  .topbar-brand { grid-area: brand; }
  .project-switcher { grid-area: projects; }
  .topbar-right { grid-area: actions; }
  .global-search-header { grid-area: search; width: 100%; background: #f7f9fc; border-color: #dce4ed; }
  .global-search-header input { display: block; }
}
@media (max-width: 400px) {
  .topbar:has(.global-search-header) .topbar-brand { font-size: 18px; }
  .topbar:has(.global-search-header) .topbar-right { gap: 8px; }
  .topbar:has(.global-search-header) .refresh-button { display: none; }
}
@media (max-width: 360px) {
  .topbar:has(.global-search-header) .topbar-brand > span:last-child { display: none; }
}

[data-search-autocomplete] { position: relative; }
.global-search-popup[hidden] { display: none; }
.global-search-popup { position: absolute; top: calc(100% + 8px); right: 0; z-index: 100; width: min(560px, calc(100vw - 40px)); border: 1px solid #dce4ed; border-radius: 12px; background: #fff; box-shadow: 0 12px 36px #20304726; overflow: hidden; }
.global-search-form .global-search-popup { left: 0; right: auto; width: 100%; }
.global-search-popup-tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid #e2e8ef; padding: 6px; gap: 4px; }
.global-search-popup-tab { flex: 1; padding: 10px 6px; border: 0; border-radius: 7px; background: transparent; color: #52647a; font: inherit; font-size: 12px; cursor: pointer; }
.global-search-popup-tab[aria-selected="true"] { background: #e5f3ee; color: #157a63; font-weight: 700; }
.global-search-popup-tab:focus-visible, .global-search-suggestion:focus-visible, .global-search-popup-more:focus-visible { outline: 2px solid #218c75; outline-offset: -2px; }
.global-search-popup-status { margin: 0; padding: 12px 16px; color: #68788e; font-size: 12px; }
.global-search-popup-panel { max-height: min(360px, 45vh); overflow-y: auto; }
.global-search-suggestion { display: block; padding: 12px 16px; border-top: 1px solid #f0f3f6; color: #26354b; overflow-wrap: anywhere; }
.global-search-suggestion:hover { background: #f6faf8; }
.global-search-suggestion strong, .global-search-suggestion span { display: block; }
.global-search-suggestion strong { font-size: 13px; }
.global-search-suggestion span { margin-top: 4px; color: #68788e; font-size: 11px; }
.global-search-popup-more { display: block; padding: 12px 16px; border-top: 1px solid #e2e8ef; color: #157a63; font-size: 12px; font-weight: 700; }
@media (max-width: 650px) { .global-search-popup-tab { font-size: 11px; padding: 8px 4px; } }
.global-search-popup-more[hidden] { display: none; }
.user-profile-dialog { width: min(680px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); box-sizing: border-box; padding: 32px; border: 1px solid #dce4ed; border-radius: 16px; color: #26354b; background: #fff; overflow-y: auto; }
.user-profile-dialog::backdrop { background: #15263c80; }
.user-profile-close { position: absolute; right: 16px; top: 12px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: #f0f4f8; color: #52647a; font-size: 24px; cursor: pointer; }
.user-profile-page { box-sizing: border-box; width: 100%; min-width: 0; padding: 28px; border: 1px solid #dce4ed; border-radius: 16px; background: #fff; }
.user-profile-heading { padding-right: 24px; }
.user-profile-heading h2 { margin: 6px 0 24px; font-size: 24px; overflow-wrap: anywhere; }
.user-profile-eyebrow { color: #157a63; font-size: 10px; letter-spacing: 1.5px; font-weight: 700; }
.user-profile-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; margin: 0; }
.user-profile-fields dt { color: #68788e; font-size: 11px; margin-bottom: 5px; }
.user-profile-fields dd { margin: 0; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.user-profile-section { border-top: 1px solid #e2e8ef; margin-top: 24px; padding-top: 16px; }
.user-profile-section h3 { font-size: 14px; }
.user-profile-section ul { list-style: none; padding: 0; }
.user-profile-section li { padding: 8px 0; font-size: 13px; }
.user-profile-section p { margin: 5px 0; color: #68788e; font-size: 12px; }
.user-profile-section a { color: #157a63; }
.user-profile-actions { margin-top: 24px; }
@media (max-width: 500px) { .user-profile-dialog { padding: 24px 18px; } .user-profile-fields { grid-template-columns: 1fr; gap: 14px; } }

@media (max-width: 650px) {
  .global-search-popup-tabs:has(> :nth-child(4)) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.global-search-popup-tabs[hidden], .global-search-popup-panel[hidden] { display: none; }

.user-profile-page > .user-profile-fields { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 24px 32px; }
.user-profile-page > .user-profile-fields > div { min-width: 0; padding-bottom: 16px; border-bottom: 1px solid var(--page-border, #e2e8ef); }
.user-profile-page .user-profile-fields dt { font-size: 12px; line-height: 1.5; }
.user-profile-page .user-profile-fields dd { font-size: 14px; }
.user-profile-page .user-profile-section h3 { margin: 0 0 16px; }
.user-profile-page .user-profile-section li { overflow-wrap: anywhere; }
