.osh-constrained { max-width: 1400px; margin-left: auto; margin-right: auto; }

/* Brand Variables */
:root {
    --navy: #112D61;
    --coral: #FF5A5F;
    --teal: #B1EDE8;
    --teal-dark: #345C72;
    --peach: #FF9E7A;
    --white: #ffffff;
    --light-bg: #f8f9fc;
    --text-dark: #1a1a2e;
    --text-muted: #6c757d;
    --topbar-height: 56px;
    --tagline-blue: #4A7C96;
}

/* Base */
html, body, #app {
    font-family: 'Heebo', Arial, sans-serif;
    background-color: #ffffff;
    color: var(--text-dark);
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Force white background on all MudBlazor layout containers */
.mud-layout,
.mud-main-content,
.mud-drawer-content {
    background-color: #ffffff !important;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--navy);
}

a, .btn-link {
    color: var(--coral);
}

/* MudBlazor nav icon size — match text height */
.mud-nav-item .mud-icon-root,
.mud-nav-link .mud-icon-root {
    font-size: 1.1rem !important;
    width: 1.1rem !important;
    height: 1.1rem !important;
}

/* Top Bar */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background-color: var(--white);
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 101;
    box-sizing: border-box;
}

.avatar-btn {
    cursor: pointer;
    line-height: 0;
}

.avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(0,0,0,0.08);
}

.avatar-initials {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    border: 2px solid rgba(0,0,0,0.08);
    user-select: none;
}

.avatar-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 0.4rem 0;
    z-index: 200;
}

.avatar-dropdown-menu.avatar-menu-open {
    display: block;
}

.avatar-dropdown-header {
    padding: 0.35rem 1rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

.avatar-dropdown-item {
    display: block;
    padding: 0.45rem 1rem;
    font-size: 0.83rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: background 0.15s;
}

.avatar-dropdown-item:hover {
    background: var(--light-bg);
    color: var(--text-dark);
}

.avatar-dropdown-item.text-danger:hover {
    background: #fff5f5;
}

.top-bar-greeting {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--coral);
    letter-spacing: 0.01em;
}

/* Page Body */
.page-body {
    margin-top: var(--topbar-height);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--navy);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--topbar-height);
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: width 0.3s ease;
    overflow-y: auto;
}

.sidebar.mini {
    width: 64px;
    overflow: hidden;
}

/* Main */
main {
    margin-left: 260px;
    transition: margin-left 0.3s ease;
}

main.sidebar-mini {
    margin-left: 64px;
}

.nav-icon {
    font-size: 1.2rem;
    min-width: 24px;
    text-align: center;
}

.sidebar.mini .nav-label {
    display: none;
}

.sidebar.mini .navbar-brand-custom {
    padding: 1rem 0.5rem;
    display: flex;
    justify-content: center;
}

.sidebar.mini .navbar-brand-custom img {
    margin-bottom: 0;
}

.sidebar.mini .nav-link-custom {
    display: flex;
    justify-content: center;
    padding: 0.6rem 0;
    margin: 0.2rem 0.5rem;
}

/* Content */
.content {
    padding: 2rem;
}

/* Hamburger */
.hamburger-btn {
    background: none;
    border: none;
    color: var(--navy);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
}

.hamburger-btn:hover {
    color: var(--coral);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
}

/* Buttons */
.btn-primary {
    background-color: var(--coral);
    border-color: var(--coral);
    color: var(--white);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background-color: #e04e53;
    border-color: #e04e53;
}

.btn-primary:disabled {
    background-color: var(--peach);
    border-color: var(--peach);
}

.btn:focus, .btn:active.focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 90, 95, 0.25);
}

/* Toggle Switch */
.form-check-input:checked {
    background-color: var(--coral);
    border-color: var(--coral);
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(17, 45, 97, 0.08);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: var(--navy);
    color: var(--white);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border-radius: 10px 10px 0 0 !important;
    padding: 0.75rem 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

.thread-card:hover {
    box-shadow: 0 4px 12px rgba(17, 45, 97, 0.15);
    transition: box-shadow 0.2s ease;
}

.osh-dashboard-card {
    transition: box-shadow 0.2s ease, transform 0.2s ease !important;
    will-change: transform;
}

.osh-dashboard-card:hover {
    box-shadow: 0 12px 32px rgba(0,0,0,0.2) !important;
    transform: translateY(-4px) !important;
    position: relative;
    z-index: 1;
}

/* Forms */
.form-control {
    border-radius: 6px;
    border: 1px solid #d0d7e3;
    font-family: 'Heebo', sans-serif;
}

.form-control:focus {
    border-color: var(--coral);
}

.form-label {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--navy);
}

/* Nav */
.navbar-brand-custom {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: var(--white) !important;
    font-size: 1.1rem;
    padding: 1.5rem 1rem 1rem 1rem;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
}

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    padding: 0.75rem 1.75rem 0.25rem;
    margin-top: 0.25rem;
}

.nav-link-custom {
    color: rgba(255, 255, 255, 0.75) !important;
    font-family: 'Heebo', sans-serif;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    margin: 0.2rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-link-custom:hover, .nav-link-custom.active {
    background-color: rgba(255, 90, 95, 0.2);
    color: var(--white) !important;
}

.nav-accent {
    width: 3px;
    background-color: var(--coral);
    border-radius: 2px;
    height: 20px;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

/* Markdown output */
.markdown-output h1, .markdown-output h2, .markdown-output h3 {
    margin-top: 1rem;
    color: var(--navy);
}

.markdown-output p {
    line-height: 1.7;
}

.markdown-output ul, .markdown-output ol {
    padding-left: 1.5rem;
}

.markdown-output table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.markdown-output th {
    background-color: var(--navy);
    color: var(--white);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    padding: 0.6rem 0.75rem;
    text-align: left;
}

.markdown-output td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

.markdown-output tr:hover {
    background-color: rgba(177, 237, 232, 0.15);
}

.markdown-output img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0.5rem 0;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

/* Blazor error */
.blazor-error-boundary {
    background-color: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* Validation */
.validation.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid var(--coral);
}

.validation-message {
    color: var(--coral);
}

/* Thinking Indicator */
.thinking-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(17, 45, 97, 0.08);
    animation: fadeIn 0.3s ease;
}

.thinking-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.thinking-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--coral);
    animation: bounce 1.4s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

.thinking-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--navy);
    font-size: 0.95rem;
    animation: fadeSwap 5s ease-in-out infinite;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSwap {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Chat */
.chat-history {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    margin-bottom: 1.5rem;
}

.chat-message {
    display: flex;
    align-items: flex-start;
}

.chat-user {
    flex-direction: row-reverse;
}

/* Wrapper positions bubble + superimposed avatar corner together */
.chat-bubble-wrapper {
    position: relative;
    width: fit-content;
    max-width: 82%;
}

.chat-assistant-wrapper {
    padding-top: 26px;
    padding-left: 26px;
}

.chat-user-wrapper {
    padding-top: 26px;
    padding-right: 26px;
}

/* Avatar pinned to the bubble's upper corner */
.chat-avatar-corner {
    position: absolute;
    width: 51px;
    height: 51px;
    border-radius: 50%;
    z-index: 2;
    border: 2.5px solid #ffffff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
    background-color: var(--coral);
    color: var(--white);
}

.chat-avatar-corner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-avatar-corner-left  { top: 0; left: 0; }
.chat-avatar-corner-right { top: 0; right: 0; }

/* Bubbles */
.chat-bubble {
    max-width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 20px;
    line-height: 1.6;
}

.chat-bubble-user {
    background-color: var(--navy);
    color: var(--white);
    border-top-right-radius: 5px;
    box-shadow: 0 6px 20px rgba(17, 45, 97, 0.28), 0 2px 6px rgba(17, 45, 97, 0.12);
    padding-top: 2rem;
}

.chat-bubble-assistant {
    background-color: var(--white);
    color: var(--text-dark);
    border-top-left-radius: 5px;
    box-shadow: 0 6px 20px rgba(17, 45, 97, 0.10), 0 2px 6px rgba(0,0,0,0.06);
    border: 1px solid rgba(17, 45, 97, 0.07);
    position: relative;
    padding-top: 3rem;
}

.response-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.response-tagline {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.tagline-blue {
    color: var(--navy);
}

.tagline-coral {
    color: var(--coral);
}

.response-disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0;
    line-height: 1.4;
}

.chat-input-bar {
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(17, 45, 97, 0.08);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.chat-input-bar textarea {
    border: 1px solid #e0e0e0;
    resize: none;
}

/* Auto-resize textarea */
.auto-resize {
    overflow: hidden;
    resize: none;
    min-height: 2.5rem;
}

/* Document search result rows */
.doc-search-result:hover {
    background-color: var(--light-bg);
}

.scroll-to-bottom-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 50;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 12px rgba(17, 45, 97, 0.2);
}

    /* Mobile */
    @media (max-width: 768px) {
        .sidebar {
            transform: translateX(-260px);
        }

            .sidebar.open {
                transform: translateX(0);
            }

        main {
            margin-left: 0 !important;
        }

        .sidebar-overlay.visible {
            display: block;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 99;
        }
    }

/* ============================================================
   Chat surface — phone overrides (below MudBlazor sm = 600px)
   Shrinks avatar corners, tightens bubble padding, scales typography.
   ============================================================ */
@media (max-width: 599.98px) {
    .chat-history {
        gap: 1.25rem;
        margin-bottom: 1rem;
    }
    .chat-bubble-wrapper {
        max-width: 92%;
    }
    .chat-assistant-wrapper {
        padding-top: 18px;
        padding-left: 18px;
    }
    .chat-user-wrapper {
        padding-top: 18px;
        padding-right: 18px;
    }
    .chat-avatar-corner {
        width: 38px;
        height: 38px;
        font-size: 0.78rem;
        border-width: 2px;
    }
    .chat-bubble {
        padding: 0.75rem 0.9rem;
        border-radius: 16px;
        line-height: 1.5;
    }
    .chat-bubble-user {
        padding-top: 1.5rem;
    }
    .chat-bubble-assistant {
        padding-top: 2.25rem;
    }
    .chat-input-bar {
        padding: 0.625rem 0.75rem;
        border-radius: 12px;
        margin-bottom: 0.75rem;
    }
    .response-tagline {
        font-size: 0.78rem;
    }
    .response-disclaimer {
        font-size: 0.7rem;
    }
    .scroll-to-bottom-btn {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
}

/* ============================================================
   Auth pages (Login / MfaLogin / ForgotPassword / ResetPassword)
   share a LoginLayout shell using inline styles. These rules add
   tap-target sizing + tighter padding on small phones without
   editing each page individually.
   ============================================================ */
.login-input {
    min-height: 44px;
    padding: 12px 14px !important;
}
.login-btn {
    min-height: 48px;
    padding: 14px !important;
}
@media (max-width: 480px) {
    /* The LoginLayout pages wrap their content in MudPaper with two
       inline-styled sections (header band + form body), each at 32px
       padding. On small phones the 64px lost to padding is too much —
       reduce to 20px so inputs get more room. */
    .login-section {
        padding: 20px !important;
    }
    .login-section-tight {
        padding: 20px 20px 16px !important;
    }
}

/* ===== News Help Docs ===== */
.help-toc {
    position: sticky;
    top: 90px;
}
.help-toc ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.help-toc li {
    margin: .25rem 0;
}
.help-toc a {
    text-decoration: none;
    color: var(--mud-palette-text-secondary, #495057);
    font-size: .9rem;
}
.help-toc a:hover {
    text-decoration: underline;
    color: var(--mud-palette-primary, #1971c2);
}
.help-section {
    /* keep anchor targets clear of the sticky top bar when deep-linked */
    scroll-margin-top: 90px;
}
.help-section-title {
    scroll-margin-top: 90px;
}

/* --- rendered markdown body --- */
.help-body {
    line-height: 1.55;
}
.help-body h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.4rem 0 .5rem;
    padding-bottom: .25rem;
    border-bottom: 1px solid var(--mud-palette-lines-default, #e9ecef);
}
.help-body h3 {
    font-size: .98rem;
    font-weight: 600;
    margin: 1rem 0 .35rem;
}
.help-body p { margin: .5rem 0; }
.help-body ul { margin: .4rem 0 .8rem; padding-left: 1.4rem; }
.help-body li { margin: .3rem 0; }

/* --- tables --- */
.help-body table {
    width: 100%;
    border-collapse: collapse;
    margin: .75rem 0 1.25rem;
    font-size: .92rem;
}
.help-body th,
.help-body td {
    border: 1px solid var(--mud-palette-lines-default, #dee2e6);
    padding: 7px 12px;
    text-align: left;
    vertical-align: top;
}
.help-body th {
    background: #f1f3f5;
    font-weight: 600;
    color: #343a40;
}
.help-body tbody tr:nth-child(even) {
    background: #fafbfc;
}

/* --- status / stage pills (match the queue lane colours) --- */
.help-pill {
    display: inline-block;
    padding: 1px 10px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}
.pill-pending  { background:#f1f3f5; color:#495057; }
.pill-reviewed { background:#e7f5ff; color:#1971c2; }
.pill-staged   { background:#fff4e6; color:#e8590c; }
.pill-live     { background:#ebfbee; color:#2f9e44; }
.pill-rejected { background:#fff5f5; color:#e03131; }
.pill-linked   { background:#f3f0ff; color:#7048e8; }
.pill-trending { background:#fff3bf; color:#e8590c; }
.pill-breaking { background:#ffe3e3; color:#e03131; }
.pill-tier1    { background:#fff9db; color:#b08900; }
.pill-tier2    { background:#e7f5ff; color:#1971c2; }
.pill-tier3    { background:#f1f3f5; color:#868e96; }
.help-pill .bi { font-size:.85em; margin-right:3px; line-height:1; }

/* --- action "button" chips (look like the app's buttons; icon = Bootstrap Icons) --- */
.help-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 9px;
    border-radius: 6px;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
    background: #f1f3f5;
    color: #343a40;
    border: 1px solid #dee2e6;
}
.help-btn .bi { font-size: .85em; line-height: 1; }
.help-btn-stage   { background:#fff4e6; color:#e8590c; border-color:#ffd8a8; }
.help-btn-publish { background:#ebfbee; color:#2f9e44; border-color:#b2f2bb; }
.help-btn-reject  { background:#fff5f5; color:#e03131; border-color:#ffc9c9; }
.help-btn-danger  { background:#fff5f5; color:#e03131; border-color:#ffc9c9; }
.help-btn-primary { background:#e7f5ff; color:#1971c2; border-color:#a5d8ff; }
