/**
 * Bookkeeping bottom sticky nav (shared spoke chrome).
 * Compact; respects iOS safe-area; hide while soft keyboard is open.
 */
.bk-bottom-nav {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    /* Above PWA install banner (z-index 9998) and other page chrome */
    z-index: 10050 !important;
    width: 100% !important;
    max-width: 100vw !important;
    margin: 0 !important;
    transform: none !important;
    display: none;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.16);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.12);
}

/* PWA install banner shares bottom:0 — hide while spoke bottom-nav is active */
body.bk-bottom-nav-active #anexis-pwa-install-banner {
    display: none !important;
}

[data-theme="dark"] .bk-bottom-nav {
    background: #16161a;
    border-top-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.5);
}

.bk-bottom-nav.is-visible {
    display: flex !important;
}

.bk-bottom-nav.is-keyboard-hidden {
    display: none !important;
}

.bk-bottom-nav-back {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: #f3f4f6;
    color: #111;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.2;
}

[data-theme="dark"] .bk-bottom-nav-back {
    color: #f3f3f3;
    background: #2a2a30;
    border-color: rgba(255, 255, 255, 0.22);
}

.bk-bottom-nav-back:active {
    opacity: 0.75;
}

.bk-bottom-nav-actions {
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.bk-bottom-nav-actions:empty {
    display: none;
}

.bk-bottom-nav-primary {
    flex: 0 1 auto;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background: var(--primary, #3d3d42);
    color: var(--color-btn-on-primary, #fff);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.2;
    max-width: 100%;
}

.bk-bottom-nav-primary:active {
    opacity: 0.85;
}

.bk-bottom-nav-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Reserve space so last content is not hidden behind the bar */
body.bk-bottom-nav-active {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
}

body.bk-bottom-nav-active.bk-bottom-nav-keyboard {
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
}
