/* Shared fixed header: add has-app-headerbar to body to reserve its height. */
:root {
    --app-headerbar-height: 52px;
    --app-headerbar-max-width: var(--site-content-max-width);
    --app-headerbar-bg: #263b53;
    --app-headerbar-accent: #f87171;
}

.app-headerbar,
.app-headerbar * {
    box-sizing: border-box;
}

body.has-app-headerbar {
    padding-top: calc(var(--app-headerbar-height) + env(safe-area-inset-top, 0px));
}

.app-headerbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 70;
    height: calc(var(--app-headerbar-height) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    border-bottom: 1px solid #354c64;
    background: var(--app-headerbar-bg);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .14);
}

.app-headerbar-inner {
    position: relative;
    width: 100%;
    max-width: var(--app-headerbar-max-width);
    height: 100%;
    margin: 0 auto;
}

.app-headerbar-inner .app-headerbar-nav {
    padding-right: 52px;
    padding-left: 52px;
}

.app-headerbar-inner.has-headerbar-action .app-headerbar-nav {
    padding-right: 72px;
    padding-left: 72px;
}

.app-headerbar .app-headerbar-action {
    appearance: none;
    position: absolute;
    top: 50%;
    right: calc(12px + env(safe-area-inset-right, 0px));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 52px;
    min-height: 36px;
    padding: 0 3px;
    border-radius: 4px;
    border: 0;
    background: transparent;
    color: #cbd5e1;
    font-size: 12px;
    font-family: inherit;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
    transform: translateY(-50%);
    cursor: pointer;
}

.app-headerbar-action svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-headerbar .app-headerbar-button {
    min-width: 56px;
    min-height: 32px;
    padding: 0 7px;
    border: 1px solid #6f8ba7;
    border-radius: 5px;
    background: #42617e;
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}

.app-headerbar .app-headerbar-button:hover {
    border-color: #8ba5bf;
    background: #4d6d8b;
}

.app-headerbar .app-headerbar-button:active {
    background: #35526e;
    box-shadow: none;
}

.app-headerbar .app-headerbar-action:hover {
    color: #fff;
}

.app-headerbar .app-headerbar-action:focus-visible {
    outline: 2px solid var(--app-headerbar-accent);
    outline-offset: 2px;
}

.app-headerbar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    width: 100%;
    max-width: var(--app-headerbar-max-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 12px;
}

.app-headerbar .app-headerbar-link {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
}

.app-headerbar .app-headerbar-link:hover,
.app-headerbar .app-headerbar-link.active,
.app-headerbar .app-headerbar-link[aria-current="page"] {
    color: #ffffff;
}

.app-headerbar .app-headerbar-link.active::after,
.app-headerbar .app-headerbar-link[aria-current="page"]::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 7px;
    left: 0;
    height: 3px;
    border-radius: 2px;
    background: var(--app-headerbar-accent);
}

.app-headerbar .app-headerbar-link:focus-visible {
    outline: 2px solid var(--app-headerbar-accent);
    outline-offset: 3px;
}

.app-headerbar .app-headerbar-help {
    position: absolute;
    top: 50%;
    right: calc(8px + env(safe-area-inset-right, 0px));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #cbd5e1;
    text-decoration: none;
    transform: translateY(-50%);
}

.app-headerbar .app-headerbar-help:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, .08);
}

.app-headerbar .app-headerbar-help:focus-visible {
    outline: 2px solid var(--app-headerbar-accent);
    outline-offset: 2px;
}

.app-headerbar-help svg {
    display: block;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
