:root {
    --bb-tabbar-h: 64px;
}

[data-bs-theme="dark"] {
    --bb-accent: #a9a8f5;
}

@view-transition {
    navigation: auto;
}

html, body {
    min-height: 100dvh;
    overscroll-behavior-y: contain;
    -webkit-tap-highlight-color: transparent;
}

.bb-chrome {
    user-select: none;
    -webkit-user-select: none;
}

a, button, .btn, [role="button"] {
    touch-action: manipulation;
}

:focus-visible {
    outline: 3px solid var(--bs-warning);
    outline-offset: 2px;
}

.bb-initially-hidden { display: none; }
.bb-notification-list { max-height: 300px; overflow-y: auto; }
.bb-notification-message { max-width: 85%; overflow-wrap: anywhere; }
.bb-avatar, .bb-avatar-photo { width: 30px; height: 30px; }
.bb-avatar { line-height: 30px; }
.bb-avatar-photo { object-fit: cover; }
.bb-strava-logo { height: 30pt; }
.bb-progress-initial { width: 0; }
.bb-legacy-header .navbar-logo { height: 40px; width: auto; }
.bb-legacy-header .navbar-logo-mobile { height: 32px; width: auto; }

.bb-app-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    padding: env(safe-area-inset-top) 1rem 0;
    color: #fff;
    background: var(--bb-primary-dark);
}

.bb-app-heading { display: flex; align-items: center; gap: .5rem; }
.bb-brand { display: flex; align-items: center; min-height: 56px; gap: .5rem; color: inherit; white-space: nowrap; }
.bb-brand:hover { color: inherit; }
.bb-brand-logo { width: auto; height: 32px; }
.bb-header-button { min-width: 44px; min-height: 44px; border: 0; color: inherit; background: transparent; }
.bb-notification-badge { position: absolute; top: 0; right: 0; }
.bb-primary-nav { flex: 1; }
.bb-tab-list { display: flex; align-items: stretch; justify-content: flex-end; gap: .5rem; padding: 0; margin: 0; list-style: none; }
.bb-tab-list > li { display: flex; }
.bb-tab {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-width: 44px;
    min-height: 56px;
    padding: .5rem .75rem;
    border: 0;
    border-radius: 0;
    color: inherit;
    background: transparent;
    text-decoration: none;
}
.bb-tab:hover, .bb-tab:focus { color: inherit; text-decoration: underline; }
.bb-tab.active { box-shadow: inset 0 -3px currentColor; font-weight: 700; }
.bb-tab-icon { position: relative; }
.bb-due-badge { position: absolute; top: -.5rem; left: 80%; font-size: .65rem; }
.bb-more .dropdown-item { min-height: 44px; display: flex; align-items: center; gap: .5rem; }
.bb-main-authenticated { padding-top: 1rem; }
.bb-anchor-target { scroll-margin-top: 5rem; }
.bb-refresh-link { min-height: 44px; display: inline-flex; align-items: center; gap: .5rem; }
.bb-pull-status { text-align: center; padding: .5rem; }

@media (max-width: 767.98px) {
    .bb-app-header { display: block; padding-left: .5rem; padding-right: .5rem; }
    .bb-app-heading { justify-content: space-between; }
    .bb-primary-nav {
        position: fixed;
        z-index: 1030;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
        color: var(--bs-body-color);
        background: var(--bs-body-bg);
        border-top: 1px solid var(--bs-border-color);
    }
    .bb-tab-list { justify-content: space-around; gap: 0; }
    .bb-tab-list > li { flex: 1 1 0; min-width: 0; }
    .bb-tab { flex: 1; flex-direction: column; gap: .15rem; min-height: var(--bb-tabbar-h); padding: .35rem 0; font-size: .7rem; }
    .bb-tab.active { color: var(--bb-primary-dark); box-shadow: inset 0 3px currentColor; }
    [data-bs-theme="dark"] .bb-tab.active { color: var(--bb-accent); }
    .bb-tab i { font-size: 1.15rem; }
    .bb-more .dropdown-menu { max-height: 70dvh; overflow-y: auto; }
    .bb-footer { padding-bottom: calc(var(--bb-tabbar-h) + env(safe-area-inset-bottom) + 1rem) !important; }
    .bb-main-authenticated input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    .bb-main-authenticated select,
    .bb-main-authenticated textarea { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: .01ms !important; }
}
