/* Shared navigation and assistant, scoped to the base template. */
.skip-link {
    position: fixed;
    top: 12px;
    left: 16px;
    z-index: 10001;
    padding: 12px 18px;
    border-radius: 10px;
    background: #c4f5ff;
    color: #061726;
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }
.navbar a:focus-visible,
.navbar button:focus-visible,
.ai-fab-container button:focus-visible,
.ai-fab-container input:focus-visible,
.skip-link:focus-visible {
    outline: 3px solid #85ebff;
    outline-offset: 4px;
}

.navbar {
    padding: 16px clamp(20px, 3.5vw, 54px);
    background: rgba(10, 19, 31, 0.94);
    border-bottom-color: rgba(151, 206, 228, 0.14);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

.navbar .navbar-container {
    max-width: 1360px;
    gap: 22px;
    flex-direction: row;
}

.navbar .navbar-brand { font-size: 1.35rem; flex-shrink: 0; text-shadow: none; }
.navbar .mode-badge {
    margin-left: 9px;
    font-size: 0.875rem;
    letter-spacing: 0;
    -webkit-text-fill-color: currentColor;
    background-clip: border-box;
    box-shadow: none;
    text-shadow: none;
}
.navbar .navbar-nav { gap: 3px; flex-wrap: nowrap; }
.navbar .nav-link {
    padding: 10px 11px;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #b7c7d8 !important;
    border-radius: 9px;
    text-shadow: none;
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
    background: rgba(57, 195, 224, 0.1);
    color: #7ee6f6 !important;
    box-shadow: none;
    text-shadow: none;
    transform: none;
}
.navbar .nav-link::before { display: none; }
.navbar .navbar-actions { gap: 10px; flex-shrink: 0; }
.navbar .btn { padding: 9px 14px; border-radius: 9px; font-size: 0.875rem; }
.navbar .navbar-user {
    color: #c7d4df;
    font-size: 0.875rem;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.navbar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid rgba(151, 206, 228, 0.3);
    border-radius: 10px;
    background: #142737;
    color: #d9f3fc;
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
}
.navbar-toggle-icon { font-size: 1.2rem; line-height: 1; }

.site-footer {
    background: rgba(10, 19, 31, 0.92);
    border-top: 1px solid rgba(151, 206, 228, 0.12);
    padding: 26px clamp(20px, 4vw, 54px);
    text-align: center;
    color: #9bafc3;
    margin-top: 3rem;
    font-size: 0.875rem;
}
.site-footer p { margin: 0; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ai-fab-container {
    right: 24px;
    bottom: 24px;
    max-width: calc(100vw - 32px);
}
.ai-fab-container .ai-fab-btn { color: #fff; flex-shrink: 0; }
.ai-fab-container .ai-chat-window {
    display: flex;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 500px;
    max-height: calc(100dvh - 115px);
    background: #0e1c2b;
    border-color: rgba(112, 210, 232, 0.35);
    border-radius: 18px;
}
.ai-fab-container .ai-chat-window[hidden] { display: none; }
.ai-fab-container .ai-chat-header { align-items: center; gap: 12px; padding: 12px 16px; }
.ai-fab-container .ai-chat-close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #dce8f4;
    font-size: 1.6rem;
    cursor: pointer;
}
.ai-fab-container .ai-chat-close:hover { background: rgba(255, 255, 255, 0.08); }
.ai-fab-container .ai-chat-messages { min-height: 0; overscroll-behavior: contain; }
.ai-fab-container .chat-msg { color: #e2edf7; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-fab-container .msg-user { background: #125d85; }
.ai-fab-container .msg-admin { border-color: rgba(85, 228, 170, 0.5); background: rgba(0, 255, 136, 0.05); }
.ai-fab-container .msg-error { border-color: rgba(255, 182, 107, 0.5); color: #ffcea0; }
.ai-fab-container .chat-history-divider {
    align-self: stretch;
    text-align: center;
    color: #91a8bc;
    font-size: 0.75rem;
    margin: 8px 0;
}
.ai-fab-container .ai-chat-status {
    margin: 0;
    padding: 8px 14px;
    background: rgba(255, 181, 91, 0.08);
    color: #ffcea0;
    font-size: 0.875rem;
    line-height: 1.6;
}
.ai-fab-container .ai-chat-status[hidden] { display: none; }
.ai-fab-container .ai-chat-input { gap: 8px; align-items: center; }
.ai-fab-container .ai-chat-input input { min-width: 0; border-radius: 10px; font: inherit; font-size: 0.875rem; }
.ai-fab-container .ai-chat-send {
    min-width: 42px;
    min-height: 42px;
    border: 1px solid rgba(90, 207, 232, 0.4);
    border-radius: 10px;
    background: #12394b;
    color: #88e9fb;
    font-size: 1.15rem;
    cursor: pointer;
}
.ai-fab-container .ai-chat-send:disabled { opacity: 0.45; cursor: wait; }

@media (max-width: 1120px) {
    .navbar { padding: 12px 20px; }
    .navbar .navbar-container { flex-wrap: wrap; gap: 0; }
    .navbar .navbar-brand { margin-right: auto; }
    .navbar .navbar-nav {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 4px;
        padding: 14px 0 6px;
    }
    .navbar .navbar-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 0 4px;
        border-top: 1px solid rgba(151, 206, 228, 0.12);
    }
    .navbar .navbar-user { max-width: 180px; }
    .navbar.navbar-enhanced .navbar-toggle { display: inline-flex; }
    .navbar.navbar-enhanced:not(.is-menu-open) .navbar-nav,
    .navbar.navbar-enhanced:not(.is-menu-open) .navbar-actions { display: none; }
    .navbar .nav-link { min-height: 44px; padding: 11px 13px; }
}

@media (max-width: 480px) {
    .navbar { padding: 12px 16px; }
    .navbar .navbar-brand { font-size: 1.15rem; }
    .navbar .mode-badge { font-size: 0.875rem; padding: 2px 7px; }
    .navbar-toggle { padding: 8px 10px; }
    .navbar-toggle-label { display: none; }
    .ai-fab-container { right: 16px; bottom: 16px; }
    .ai-fab-container .ai-fab-btn { width: 54px; height: 54px; font-size: 25px; }
    .ai-fab-container .ai-chat-window { max-height: calc(100dvh - 104px); margin-bottom: 12px; }
    .site-footer { padding: 24px 22px 86px; line-height: 1.8; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    body::before { animation: none; }
    .navbar *, .navbar *::before,
    .ai-fab-container *, .ai-fab-container *::before,
    .skip-link { animation: none !important; transition: none !important; }
    .ai-fab-container .ai-fab-btn:hover { transform: none; }
}
