/* Xbrook Mail 2.3.7. Header presentation only; native search and account commands
   remain in place. Loaded after the skin layers, with no external dependencies. */
#xb-header-theme[hidden] {
  display: none !important;
}

@media (min-width: 481px) {
  .xb-topbar #xb-header-theme {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--xb-border);
    border-radius: 12px;
    background: var(--xb-surface);
    color: var(--xb-text-2);
    box-shadow: none;
    cursor: pointer;
  }
  .xb-topbar #xb-header-theme:is(:hover, :active) {
    background: var(--xb-soft);
    color: var(--xb-accent-strong);
    border-color: var(--xb-border-strong);
  }
  #xb-header-theme span:before {
    content: '\f186';
    font: 900 17px/1 Icons;
  }
  #xb-header-theme.is-dark span:before {
    content: '\f185';
  }
  .xb-topbar #xb-account-button {
    height: 48px;
    max-width: 294px;
    gap: 10px;
    padding: 5px 10px 5px 5px;
    border: 1px solid var(--xb-border);
    border-radius: 14px;
    background: var(--xb-surface);
  }
  .xb-topbar #xb-account-button:is(:hover, :active, [aria-expanded='true']) {
    border-color: var(--xb-border-strong);
    background: var(--xb-soft);
  }
  .xb-topbar .xb-account-button .xb-avatar {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: linear-gradient(145deg, #137c98, #087f76);
    color: #fff;
    font-size: 12px;
  }
  .xb-topbar .xb-account-copy {
    min-width: 0;
    gap: 3px;
    align-items: flex-start;
    text-align: left;
  }
  .xb-topbar .xb-account-label {
    display: block;
    color: var(--xb-text-2);
    font: 400 11px/1.2 var(--xb-font);
  }
  .xb-topbar .xb-account-address {
    max-width: 210px;
    font: 500 13px/1.3 var(--xb-font);
  }
  .xb-topbar .xb-account-chevron {
    color: var(--xb-text-2);
  }
  .xb-topbar .xb-account-menu {
    width: 286px;
    max-width: calc(100vw - 24px);
    padding: 8px;
    border-radius: 16px;
    box-shadow: 0 12px 36px #10233a24;
  }
  html.dark-mode .xb-topbar .xb-account-menu {
    box-shadow: 0 12px 36px #0006;
  }
  .xb-account-summary {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px 12px 16px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--xb-border);
  }
  .xb-account-summary-label {
    color: var(--xb-text-2);
    font-size: 12px;
  }
  .xb-account-summary strong {
    font-size: 14px;
    font-weight: 500;
    overflow-wrap: anywhere;
  }
  #xb-account-menu .xb-account-item {
    height: 42px;
    gap: 12px;
    border-radius: 9px;
  }
  #xb-account-menu .xb-account-item:before {
    width: 18px;
    text-align: center;
    font: 900 15px/1 Icons;
    color: var(--xb-text-2);
  }
  #xb-account-menu .xb-account-settings:before {
    content: '\f013';
  }
  #xb-account-menu .xb-account-theme:before {
    content: '\f186';
  }
  html.dark-mode #xb-account-menu .xb-account-theme:before {
    content: '\f185';
  }
  #xb-account-menu .xb-account-about:before {
    content: '\f059';
  }
  #xb-account-menu .xb-account-logout:before {
    content: '\f2f5';
  }
}

@media (min-width: 1025px) {
  body.xb-shell .xb-topbar {
    gap: 12px;
  }
  body.xb-shell .xb-topbar .xb-account {
    margin-left: 0;
  }
  body.xb-shell #xb-desktop-search {
    flex: 0 1 var(--xb-search-pane-width, 560px);
    width: var(--xb-search-pane-width, 560px);
    max-width: var(--xb-search-pane-width, 560px);
    min-width: 240px;
  }
  body.xb-shell #xb-desktop-search .searchbar {
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 5px 0 10px;
    gap: 4px;
    border-radius: 10px !important;
    background: var(--xb-soft) !important;
    border-color: var(--xb-border-strong) !important;
    transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
  }
  body.xb-shell #xb-desktop-search .searchbar:hover {
    border-color: var(--xb-text-2) !important;
  }
  body.xb-shell #xb-desktop-search .searchbar:focus-within {
    background: var(--xb-surface) !important;
    border-color: var(--xb-accent-strong) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--xb-accent-strong) 18%, transparent) !important;
  }
  body.xb-shell #xb-desktop-search .searchbar input.xf-control {
    font-size: 14px !important;
    height: 36px !important;
    min-height: 36px !important;
  }
  body.xb-shell #xb-desktop-search .searchbar .xbw-search-filters {
    height: 28px;
    border-radius: 7px;
    border-color: var(--xb-border);
    background: var(--xb-surface);
    color: var(--xb-accent-strong);
    padding: 0 8px;
    font-size: 12px;
  }
  body.xb-shell #xb-desktop-search .searchbar .xbw-search-filters:hover {
    background: var(--xb-hover);
  }
  body.xb-shell #xb-desktop-search .xb-search-kbd {
    /* Reserve its space during focus so the search actions do not jump. */
    order: 0;
    height: 20px;
    min-width: 20px;
    padding-inline: 5px;
    margin-right: 2px;
    background: var(--xb-surface);
    border: 1px solid var(--xb-border);
  }
  body.xb-shell #xb-desktop-search .searchbar:is(:focus-within, .active) .xb-search-kbd {
    display: inline-grid;
    visibility: hidden;
  }
  body.xb-shell .xb-topbar .xb-workspace {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 3px;
    padding: 0;
    margin: 0 auto 0 0;
    line-height: 1.3;
  }
  body.xb-shell .xb-workspace-label {
    font-size: 11px;
    font-weight: 400;
    color: var(--xb-text-2);
  }
  body.xb-shell .xb-workspace-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--xb-text);
  }
  body.xb-shell:has(#xb-desktop-search > .searchbar) .xb-workspace {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.xb-shell #xb-desktop-search .searchbar {
    transition: none;
  }
}

@media (min-width: 481px) and (max-width: 1024px) {
  .xb-topbar .xb-workspace {
    display: none;
  }
  .xb-topbar .xb-account {
    margin-left: auto;
  }
  .xb-topbar #xb-header-theme {
    margin-left: auto;
  }
  .xb-topbar #xb-header-theme:not([hidden]) + .xb-account {
    margin-left: 0;
  }
  .xb-topbar .xb-account-copy {
    display: none;
  }
}
@media (max-width: 480px) {
  body.xbm-phone #layout-list > .searchbar {
    height: 48px !important;
    min-height: 48px !important;
    border-radius: 12px !important;
  }
  body.xbm-phone .searchbar .xbw-search-filters {
    min-height: 38px;
    padding-inline: 10px;
  }
}
