:root {
    --primary-color: #17324d;
    --primary: #17324d;
    --primary-rgb: 23, 50, 77;
    --bs-primary: #17324d;
    --bs-primary-rgb: 23, 50, 77;
    --font-main: Arial, Helvetica, sans-serif;
    --warm-public-navbar: #8d7f56;
    --warm-public-navbar-deep: #6f6248;
    --paper: #f7f3ec;
    --paper-deep: #f1e7dc;
    --card-bg: #f4efe9;
    --ink: #17324d;
    --muted: #64707b;
    --coral: #e68163;
    --line: #dcd5ca;
:root[data-bs-theme="dark"] {
    --paper: #171f27;
    --paper-deep: #222c36;
    --card-bg: #202a34;
    --muted: #b6c0c9;
    --line: #3b4651;
}
}

:root[data-bs-theme="dark"] {
    --paper: #171f27;
    --paper-deep: #222c36;
    --card-bg: #202a34;
    --muted: #b6c0c9;
    --line: #3b4651;
}

[data-bs-theme="dark"] body {
    background-color: #141a20;
    color: #e8edf2;
}

[data-bs-theme="dark"] body.public-page {
    background: #141a20;
    color: #e8edf2;
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .dropdown-menu {
    background-color: #202a34;
    color: #e8edf2;
    border-color: #3b4651;
}

.admin-dropdown-menu {
    width: min(20rem, calc(100vw - 1rem));
    max-height: min(75vh, 640px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.admin-menu-category {
    list-style: none;
}

.admin-menu-category-toggle {
    position: relative;
    padding-right: 2.25rem;
    font-weight: 600;
    white-space: normal;
    cursor: pointer;
}

.admin-menu-category-toggle::-webkit-details-marker {
    display: none;
}

.admin-menu-category-toggle::after {
    position: absolute;
    right: 1rem;
    content: "+";
}

.admin-menu-category details[open] > .admin-menu-category-toggle::after {
    content: "-";
}

.admin-menu-category-toggle:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: -2px;
}

.admin-menu-submenu {
    margin: 0;
    padding: 0;
    list-style: none;
}

.admin-menu-submenu .dropdown-item {
    padding-left: 2rem;
    white-space: normal;
}

.admin-menu-role-preview {
    padding: 0.5rem 1rem 0.75rem 2rem;
}

.admin-role-preview-form {
    width: 100%;
}

.admin-menu-role-preview .admin-role-preview-form > .btn {
    width: auto !important;
    min-height: 2rem;
    padding: 0.3rem 0.65rem;
    font-size: 0.8125rem;
}

[data-bs-theme="dark"] .text-dark {
    color: #e8edf2 !important;
}

[data-bs-theme="dark"] :is(.login-card, .register-card, .admin-shell) th {
    background-color: #26333f;
    color: #e8edf2;
}

[data-bs-theme="dark"] :is(.login-card, .register-card, .admin-shell) th,
[data-bs-theme="dark"] :is(.login-card, .register-card, .admin-shell) td {
    border-bottom-color: #3b4651;
}

body {
    font-family: var(--font-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-color: #ffffff;
}

body.public-page {
    background-color: #fbf5ec;
    background-image: linear-gradient(135deg, #fbf5ec 0%, #f5eee3 52%, #eef2ef 100%);
    color: var(--ink);
    font-family: "DM Sans", sans-serif;
}

body.authenticated-page {
    background: #ffffff;
}

[data-bs-theme="dark"] body.authenticated-page {
    background: #141a20;
    color: #e8edf2;
}

.mailjet-status-wide {
    width: 85vw;
    margin-left: calc(50% - 42.5vw);
}

.mailjet-status-wide .table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed;
}

.mailjet-status-wide .table-responsive {
    width: 100%;
}

.mailjet-status-wide .table th:nth-child(1) { width: 18%; }
.mailjet-status-wide .table th:nth-child(2) { width: 28%; }
.mailjet-status-wide .table th:nth-child(3) { width: 40%; }
.mailjet-status-wide .table th:nth-child(4) { width: 14%; }
.mailjet-status-wide .table td { overflow-wrap: anywhere; }

.mailjet-events-panel {
    border: 1px solid var(--bs-border-color);
    border-radius: 4px;
    background: var(--bs-body-bg);
}

.mailjet-events-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.mailjet-window-form select {
    min-width: 140px;
}

.mailjet-events-chart {
    position: relative;
    height: 330px;
    padding: 1.25rem 1rem 0.5rem;
}

.mailjet-events-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    padding: 0.75rem 1rem 1rem;
}

.mailjet-event-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    white-space: nowrap;
}

.mailjet-event-toggle input {
    accent-color: var(--event-color);
}

.mailjet-event-swatch {
    width: 0.75rem;
    height: 0.75rem;
    flex: 0 0 0.75rem;
    background: var(--event-color);
}

@media (max-width: 767px) {
    .mailjet-status-wide {
        width: 100%;
        margin-left: 0;
    }

    .mailjet-status-wide .table {
        min-width: 640px;
    }

    .mailjet-events-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .mailjet-events-chart {
        height: 260px;
        padding-inline: 0.5rem;
    }
}

#site-container {
    flex: 0 0 auto;
    width: 100%;
    min-height: 0;
}

footer {
    margin-top: auto;
}

.site-footer {
    width: 100%;
    background-color: var(--ink);
    color: #ffffff;
    margin-top: auto;
    flex: 0 0 auto;
    position: relative;
    clear: both;
}

.site-footer .container {
    max-width: 1200px;
}

.navbar {
    min-height: 100px;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    background-color: var(--ink) !important;
    box-shadow: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar-dark .navbar-brand,
.navbar-dark .nav-link {
    color: rgba(255, 255, 255, 0.88) !important;
}

.navbar-dark .nav-link:hover,
.navbar-dark .nav-link:focus,
.navbar-dark .nav-link:active,
.navbar-dark .nav-link.active {
    color: #eef4fb !important;
    opacity: 1;
    text-shadow: 0 0 0.5px rgba(255,255,255,0.7);
}

.navbar-dark .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.35);
}

.nav-user-settings {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.btn-nav-user {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 0.35rem 0.65rem;
    color: rgba(255, 255, 255, 0.9);
}

.btn-nav-user:hover,
.btn-nav-user:focus-visible {
    border-color: #fff;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.btn-nav-user span:last-child {
    font-size: 1.15rem;
    line-height: 1;
}

.profile-settings-identity {
    overflow-wrap: anywhere;
}

.navbar-brand img {
    height: 92px;
    width: auto;
    max-height: 100%;
    filter: brightness(0) invert(1) drop-shadow(0 0 0 transparent);
    transition: filter 260ms ease;
}

.navbar-brand.logo-activating img {
    filter: brightness(1) invert(0) drop-shadow(0 0 12px rgba(255, 255, 255, 0.9));
}

@media (prefers-reduced-motion: reduce) {
    .navbar-brand img {
        transition: none;
    }
}

.program-map {
    height: 520px;
    border-radius: 8px;
    background: #e9ecef;
}

.operations-map {
    height: 430px;
}

.editorial-hero {
    min-height: 600px;
    display: grid;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 5rem 0;
}

.editorial-hero:after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    right: -110px;
    bottom: -170px;
    border: 1px solid #d6c8b5;
    border-radius: 50%;
    opacity: 0.7;
}

.hero-kicker {
    color: var(--coral);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-title,
.section-title,
.feature h3,
.sample-quote blockquote {
    font-family: "Playfair Display", Georgia, serif;
}

.hero-title {
    max-width: 780px;
    font-size: clamp(3.3rem, 8vw, 7.2rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
    margin: 1rem 0 1.5rem;
}

.hero-copy {
    max-width: 590px;
    color: var(--muted);
    font-size: 1.12rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.welcome-audio {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 1.4rem;
}

.btn-welcome-audio {
    min-height: 44px;
    border: 1px solid var(--coral);
    border-radius: 999px;
    padding: 0.65rem 1.1rem;
    color: var(--ink);
    font-weight: 700;
}

.btn-welcome-audio:hover,
.btn-welcome-audio[aria-pressed="true"] {
    background: var(--coral);
    color: #fff;
}

.btn-welcome-audio:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 3px;
}

.welcome-audio-status {
    color: var(--muted);
    font-size: 0.9rem;
}

.btn-editorial {
    border-radius: 999px;
    padding: 0.8rem 1.35rem;
    font-weight: 700;
}

.btn-coral {
    background: var(--coral);
    border-color: var(--coral);
    color: #fff;
}

.btn-coral:hover {
    background: #d56e51;
    border-color: #d56e51;
    color: #fff;
}

.btn-paper {
    border: 1px solid var(--ink);
    color: var(--ink);
}

.btn-paper:hover {
    background: var(--ink);
    color: #fff;
}

.hero-aside {
    position: relative;
    z-index: 1;
}

.public-service-hero {
    min-height: 520px;
    padding: 3.5rem 0;
}

.public-service-hero .hero-title {
    font-size: clamp(2.8rem, 6vw, 5rem);
}

.hero-image {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 180px 180px 12px 12px;
    filter: saturate(0.8) drop-shadow(18px 18px 0 #e9ded0);
    box-shadow: none;
}

.public-service-hero .hero-image {
    aspect-ratio: 4 / 3;
    border-radius: 150px 150px 10px 10px;
}

.public-step-list {
    counter-reset: public-steps;
    list-style: none;
    margin: 0;
    padding: 0;
}

.public-step-list li {
    counter-increment: public-steps;
    display: grid;
    grid-template-columns: 3rem 1fr;
    gap: 0.35rem 1rem;
    padding: 1.15rem 0;
    border-bottom: 1px solid var(--line);
}

.public-step-list li::before {
    grid-row: span 2;
    color: var(--coral);
    content: counter(public-steps, decimal-leading-zero);
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.5rem;
}

.public-step-list li span {
    color: var(--muted);
}

.public-check-list {
    display: grid;
    gap: 0.8rem;
    padding-left: 1.25rem;
}

.resource-link-row {
    padding: 1.15rem 0;
    border-bottom: 1px solid var(--line);
}

.resource-link-row:first-child {
    border-top: 1px solid var(--line);
}

.parent-story-copy {
    color: var(--muted);
    line-height: 1.7;
    white-space: pre-line;
}

.legal-page {
    max-width: 1000px;
    margin: 0 auto;
}

.legal-page-header {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}

.legal-document {
    max-width: 860px;
    margin: 0 auto;
    color: var(--ink);
    line-height: 1.72;
}

.legal-section {
    padding: 1.6rem 0;
    border-bottom: 1px solid var(--line);
    scroll-margin-top: 2rem;
}

.legal-section h2 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.legal-section h3 {
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.legal-section p:last-child {
    margin-bottom: 0;
}

.legal-letter-list li {
    margin-bottom: 0.6rem;
    padding-left: 0.35rem;
}

.section-rule {
    border-top: 1px solid var(--line);
    padding-top: 1.5rem;
}

.feature {
    min-height: 180px;
    border-top: 2px solid var(--ink);
    padding-top: 1rem;
}

.feature-number {
    color: var(--coral);
    font-size: 0.8rem;
    font-weight: 700;
}

.feature h3 {
    font-size: 1.45rem;
}

.feature p {
    color: var(--muted);
    line-height: 1.6;
}

.sample-quote {
    background: var(--ink);
    color: #fff;
    padding: 4rem;
    border-radius: 12px;
}

.sample-quote blockquote {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    line-height: 1.15;
}

.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay {
    animation-delay: 0.15s;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 767px) {
    .editorial-hero {
        padding: 3rem 0;
        min-height: auto;
    }

    .hero-title {
        font-size: 3.4rem;
    }

    .hero-aside {
        margin-top: 3rem;
    }

    .sample-quote {
        padding: 2rem;
    }
}

.team-bio p:last-child {
    margin-bottom: 0.5rem;
}

.team-bio.collapsed {
    max-height: 8.5em;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent);
    mask-image: linear-gradient(180deg, #000 60%, transparent);
}

.about-hero-image {
    height: 300px;
    object-fit: cover;
}

.about-team-photo {
    object-fit: cover;
}

.about-team-initial {
    background: var(--paper-deep);
    color: var(--ink);
}

.about-mission {
    padding: 1.5rem 1.75rem;
    border-left: 4px solid var(--ink);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.55);
    font-size: 1.1rem;
    line-height: 1.7;
}

[data-bs-theme="dark"] .about-mission {
    background: var(--card-bg);
    border-left-color: #9fc3e8;
}

.about-team-intro {
    max-width: 60rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.login-card,
.register-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.mfa-card {
    max-width: 620px;
    overflow: hidden;
}

.mfa-secret,
.mfa-uri {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.mfa-secret {
    margin: 1rem 0;
    padding: 0.75rem;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 4px;
    text-align: center;
    letter-spacing: 0.08em;
}

.mfa-uri {
    max-height: 5rem;
    overflow-y: auto;
}

.mfa-code {
    max-width: 12rem;
    letter-spacing: 0.2em;
    text-align: center;
}

.mfa-steps {
    padding-left: 1.25rem;
    text-align: left;
}

.mfa-steps li {
    margin-bottom: 0.75rem;
}

.mfa-qr {
    display: flex;
    justify-content: center;
    margin: 0.75rem 0;
}

/* The QR code keeps a white background in dark mode so phone cameras can read it. */
.mfa-qr svg {
    background: #fff;
    border-radius: 4px;
}

.mfa-backup-codes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 1rem 0;
    padding: 0;
    list-style: none;
}

.mfa-backup-codes code {
    display: block;
    padding: 0.4rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    text-align: center;
    font-size: 1rem;
    letter-spacing: 0.06em;
}

@media print {
    .auth-brand,
    .login-card .btn {
        display: none !important;
    }
}

.register-card {
    max-width: 480px;
}

.login-card h1, .register-card h1,
.login-card h2,
.register-card h2 {
    margin-bottom: 1.5rem;
    color: #333333;
    text-align: center;
}

:is(.login-card, .register-card, .admin-shell) .form-group {
    margin-bottom: 1.25rem;
}

:is(.login-card, .register-card, .admin-shell) .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555555;
    font-size: 0.9rem;
}

:is(.login-card, .register-card, .admin-shell) .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cccccc;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

:is(.login-card, .register-card, .admin-shell) .form-control:focus {
    outline: none;
    border-color: var(--ink);
}

:is(.login-card, .register-card, .admin-shell) select.form-control {
    background-color: #ffffff;
}

:is(.login-card, .register-card, .admin-shell) .is-invalid {
    border-color: #dc3545;
}

:is(.login-card, .register-card, .admin-shell) .invalid-feedback {
    color: #dc3545;
    font-size: 0.825rem;
    margin-top: 0.25rem;
}

:is(.login-card, .register-card, .admin-shell) .btn {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--ink);
    color: #ffffff;
    border: 1px solid var(--ink);
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

:is(.login-card, .register-card, .admin-shell) .btn:hover {
    background-color: #1c3659;
    border-color: #1c3659;
    color: #ffffff;
}

:is(.login-card, .register-card, .admin-shell) .btn:active,
:is(.login-card, .register-card, .admin-shell) .btn.active {
    background-color: #10273b;
    border-color: #10273b;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.12);
    color: #ffffff;
}

:is(.login-card, .register-card, .admin-shell) .btn-primary,
:is(.login-card, .register-card, .admin-shell) .btn-secondary,
:is(.login-card, .register-card, .admin-shell) .btn-editorial,
:is(.login-card, .register-card, .admin-shell) .btn-paper,
:is(.login-card, .register-card, .admin-shell) .btn-link,
:is(.login-card, .register-card, .admin-shell) .btn-outline-primary {
    background-color: var(--ink);
    border-color: var(--ink);
    color: #ffffff;
}

:is(.login-card, .register-card, .admin-shell) .btn-primary:hover,
:is(.login-card, .register-card, .admin-shell) .btn-secondary:hover,
:is(.login-card, .register-card, .admin-shell) .btn-editorial:hover,
:is(.login-card, .register-card, .admin-shell) .btn-paper:hover,
:is(.login-card, .register-card, .admin-shell) .btn-link:hover,
:is(.login-card, .register-card, .admin-shell) .btn-outline-primary:hover {
    background-color: #1c3659;
    border-color: #1c3659;
    color: #ffffff;
}

:is(.login-card, .register-card, .admin-shell) .btn-primary:active,
:is(.login-card, .register-card, .admin-shell) .btn-secondary:active,
:is(.login-card, .register-card, .admin-shell) .btn-editorial:active,
:is(.login-card, .register-card, .admin-shell) .btn-paper:active,
:is(.login-card, .register-card, .admin-shell) .btn-link:active,
:is(.login-card, .register-card, .admin-shell) .btn-outline-primary:active,
:is(.login-card, .register-card, .admin-shell) .btn-primary.active,
:is(.login-card, .register-card, .admin-shell) .btn-secondary.active,
:is(.login-card, .register-card, .admin-shell) .btn-editorial.active,
:is(.login-card, .register-card, .admin-shell) .btn-paper.active,
:is(.login-card, .register-card, .admin-shell) .btn-link.active,
:is(.login-card, .register-card, .admin-shell) .btn-outline-primary.active {
    background-color: #10273b;
    border-color: #10273b;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.12);
    color: #ffffff;
}

:is(.login-card, .register-card, .admin-shell) .alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

:is(.login-card, .register-card, .admin-shell) .alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

:is(.login-card, .register-card, .admin-shell) .alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

:is(.login-card, .register-card, .admin-shell) .alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.form-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: #666666;
}

.form-footer a {
    color: var(--ink);
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

body.login-page,
body.register-page {
    background-color: #f4f6f9;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

body.login-page {
    padding: 2rem 1rem;
}

body.register-page {
    padding: 2rem 1rem;
}

.crm-opportunity-progress {
    overflow: hidden;
    padding: 1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.client-location-map {
    min-height: 280px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef1f2;
}

.crm-stage-scroll {
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.crm-stage-track {
    display: grid;
    grid-template-columns: repeat(10, minmax(100px, 1fr));
    min-width: 1080px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.crm-stage-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0.35rem;
    text-align: center;
}

.crm-stage-step::before {
    position: absolute;
    z-index: 0;
    top: 15px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--line);
    content: "";
}

.crm-stage-step:first-child::before {
    left: 50%;
    width: 50%;
}

.crm-stage-step:last-child::before {
    width: 50%;
}

.crm-stage-dot {
    position: relative;
    z-index: 1;
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 2px solid #a9b1ba;
    border-radius: 50%;
    background: #fff;
    color: #58616c;
    font-size: 0.8rem;
    font-weight: 700;
}

.crm-stage-label {
    max-width: 110px;
    color: #58616c;
    font-size: 0.78rem;
    line-height: 1.25;
}

.crm-stage-probability {
    color: var(--muted);
    font-size: 0.72rem;
}

.crm-stage-completed .crm-stage-dot {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.crm-stage-current .crm-stage-dot {
    border-color: var(--coral);
    background: var(--coral);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(221, 119, 91, 0.16);
}

.crm-stage-current .crm-stage-label {
    color: var(--ink);
    font-weight: 700;
}

.crm-stage-alternative .crm-stage-dot {
    border-style: dashed;
    color: #7b838c;
}

.crm-stage-accordion {
    background: var(--card-bg);
}

.crm-stage-accordion > summary {
    list-style: none;
    cursor: pointer;
}

.crm-stage-accordion > summary::-webkit-details-marker {
    display: none;
}

.crm-stage-accordion > summary::after {
    content: "+";
    float: right;
    color: var(--muted);
    font-weight: 700;
}

.crm-stage-accordion[open] > summary::after {
    content: "-";
}

.crm-stage-account-list {
    overflow-wrap: anywhere;
}

.crm-stage-guide {
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--coral);
    background: #fff;
    box-shadow: 0 1px 0 var(--line);
}

.crm-guide-actions {
    display: grid;
    gap: 0.65rem;
    padding-left: 1.2rem;
}

.crm-guide-risk,
.crm-guide-guardrail {
    padding: 0.8rem 1rem;
    border-left: 3px solid #c78d32;
    background: #fff8e8;
}

.crm-guide-guardrail {
    border-color: #4f7d71;
    background: #edf5f1;
}

.site-announcements {
    position: sticky;
    top: 0;
    z-index: 1020;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.site-announcements .alert {
    padding-right: 3rem;
}

.app-toast-container {
    z-index: 1090;
    width: min(100vw, 26rem);
    max-width: 100%;
}

.app-toast {
    width: 100%;
    box-shadow: 0 0.5rem 1.5rem rgba(15, 34, 48, 0.18);
}

.reminder-toast {
    border-left: 4px solid var(--coral);
}

@media (max-width: 767px) {
    .crm-opportunity-progress {
        padding: 0.85rem;
    }
}

@media (max-width: 480px) {
    .login-card,
    .register-card {
        padding: 1.25rem;
    }

    .mfa-card {
        max-width: 100%;
    }

    .mfa-secret {
        letter-spacing: 0.03em;
    }
}

.admin-shell {
    background-color: #f4f6f9;
    color: #333333;
    padding: 0 2rem 2rem;
}

.top-nav {
    max-width: none;
    margin: 0 -2rem 2rem;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #212529;
    border-bottom: 1px solid #343a40;
}

.top-nav-brand,
.top-nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

.top-nav-brand {
    color: #ffffff !important;
    font-size: 1.25rem;
    font-weight: 700;
    white-space: nowrap;
}

.top-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
    justify-content: flex-end;
}

.top-nav-links a:hover {
    color: #ffffff;
}

.admin-shell .container {
    max-width: 1100px;
    margin: 0 auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.header h1 {
    font-size: 1.75rem;
    color: #222222;
}

/* Brand buttons for every page: Bootstrap sizes (btn-sm/btn-lg) and variants stay intact. */
.btn-primary {
    --bs-btn-bg: var(--ink);
    --bs-btn-border-color: var(--ink);
    --bs-btn-hover-bg: #1c3659;
    --bs-btn-hover-border-color: #1c3659;
    --bs-btn-active-bg: #10273b;
    --bs-btn-active-border-color: #10273b;
    --bs-btn-disabled-bg: var(--ink);
    --bs-btn-disabled-border-color: var(--ink);
    --bs-btn-focus-shadow-rgb: var(--primary-rgb);
}

.btn-outline-primary {
    --bs-btn-color: var(--ink);
    --bs-btn-border-color: var(--ink);
    --bs-btn-hover-bg: var(--ink);
    --bs-btn-hover-border-color: var(--ink);
    --bs-btn-active-bg: #10273b;
    --bs-btn-active-border-color: #10273b;
    --bs-btn-disabled-color: var(--ink);
    --bs-btn-disabled-border-color: var(--ink);
    --bs-btn-focus-shadow-rgb: var(--primary-rgb);
}

[data-bs-theme="dark"] .btn-outline-primary {
    --bs-btn-color: #9fc3e8;
    --bs-btn-border-color: #9fc3e8;
    --bs-btn-hover-bg: #9fc3e8;
    --bs-btn-hover-border-color: #9fc3e8;
    --bs-btn-hover-color: #141a20;
    --bs-btn-active-bg: #c4dbf2;
    --bs-btn-active-border-color: #c4dbf2;
    --bs-btn-active-color: #141a20;
}

.btn {
    font-weight: 500;
}

/* Tables: one header style everywhere, Bootstrap spacing (table-sm works). */
.table > thead {
    --bs-table-bg: var(--paper-deep);
    --bs-table-color: var(--ink);
}

.table > thead th {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: bottom;
}

[data-bs-theme="dark"] .table > thead {
    --bs-table-bg: #26333f;
    --bs-table-color: #e8edf2;
}

.table td .btn,
.table td form {
    white-space: nowrap;
}

:is(.login-card, .register-card, .admin-shell) .btn-danger {
    background-color: #dc3545;
    color: #ffffff;
    padding: 0.4rem 0.8rem;
    font-size: 0.825rem;
}

:is(.login-card, .register-card, .admin-shell) .btn-danger:hover {
    background-color: #bd2130;
}

:is(.login-card, .register-card, .admin-shell) .btn-secondary {
    background-color: var(--ink);
    color: #ffffff;
}

:is(.login-card, .register-card, .admin-shell) .btn-secondary:hover {
    background-color: #10273b;
}

.card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.table-responsive {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    overflow-x: auto;
}

.teacher-management-table {
    min-width: 960px;
    table-layout: fixed;
}

.teacher-management-table th,
.teacher-management-table td {
    overflow-wrap: anywhere;
}

.teacher-management-table .teacher-management-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.375rem;
}

:is(.login-card, .register-card, .admin-shell) table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    text-align: left;
}

:is(.login-card, .register-card, .admin-shell) th,
:is(.login-card, .register-card, .admin-shell) td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
}

:is(.login-card, .register-card, .admin-shell) th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

:is(.login-card, .register-card, .admin-shell) tr:last-child td {
    border-bottom: none;
}

:is(.login-card, .register-card, .admin-shell) tr:hover {
    background-color: #f8f9fa;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: capitalize;
}

.badge-admin {
    background-color: #cce5ff;
    color: #004085;
}

.badge-teacher {
    background-color: #d4edda;
    color: #155724;
}

.badge-student {
    background-color: #e2e3e5;
    color: #383d41;
}

.legacy-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
}

.legacy-modal-content {
    background: var(--card-bg);
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    position: relative;
}

.legacy-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.legacy-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888888;
}

.admin-shell .form-group {
    margin-bottom: 1rem;
}

.admin-shell .form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.admin-shell .form-control {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #cccccc;
    border-radius: 4px;
    font-size: 0.95rem;
}

.admin-shell .invalid-feedback {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

/* Workshop funnel: current step and Claude coaching panel */
.workshop-step-current {
    border-color: var(--bs-primary) !important;
    box-shadow: inset 0 0 0 1px var(--bs-primary);
}
.workshop-coach {
    background: var(--bs-tertiary-bg, #f8f9fa);
}

/* Selects inside table rows (stage, attendance) keep a readable width. */
.table td .form-select {
    min-width: 10rem;
}

/* Public inquiry form */
.inquiry-page {
    max-width: 850px;
}

.inquiry-reassurance {
    color: var(--muted);
}

/* Home: audience path cards */
.path-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.55);
}

.path-card p {
    flex: 1;
}

.path-card-link {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.path-card-link:hover,
.path-card-link:focus-visible {
    text-decoration: underline;
}

[data-bs-theme="dark"] .path-card {
    background: var(--card-bg);
}

[data-bs-theme="dark"] .path-card-link {
    color: #9fc3e8;
}

/* Badges that hold a sentence keep normal capitalisation */
.badge.badge-plain {
    text-transform: none;
}

/* Skip link: visible only when focused with the keyboard */
.skip-link:focus {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2000;
    padding: 0.5rem 1rem;
    background: #fff;
    color: var(--ink);
    border: 2px solid var(--ink);
    border-radius: 6px;
}

#site-container:focus {
    outline: none;
}

/* Role guides */
.guide-nav .list-group-item.active {
    background-color: var(--ink);
    border-color: var(--ink);
}

.guide-article h2 {
    color: var(--ink);
}

/* Welcome page: Deaf culture story modal */
.deaf-story p {
    font-size: 1.1rem;
    line-height: 1.75;
    margin-bottom: 1.1rem;
}
.deaf-story p:first-child::first-letter {
    float: left;
    font-size: 3.2rem;
    line-height: 0.9;
    padding: 0.25rem 0.5rem 0 0;
    font-weight: 700;
}

/* Lesson plans and Class mode */
.lesson-sheet h1.lesson-title { font-size: 1.6rem; margin-bottom: .25rem; }
.lesson-sheet .lesson-meta { color: var(--bs-secondary-color); margin-bottom: 1rem; }
.lesson-sheet h2 { font-size: 1.1rem; margin-top: 1.25rem; }
.lesson-sheet .pre { white-space: pre-line; }
.lesson-sheet .lesson-vocab { columns: 2; }
.lesson-sheet .lesson-table { width: 100%; border-collapse: collapse; }
.lesson-sheet .lesson-table th, .lesson-sheet .lesson-table td { border: 1px solid var(--bs-border-color); padding: .4rem .6rem; vertical-align: top; }
.class-stage:fullscreen { background: var(--bs-body-bg); padding: 1.5rem; overflow-y: auto; }
.class-timer { background: var(--bs-tertiary-bg); }
.class-timer.time-up { animation: class-time-up 0.8s ease-in-out 6; background: #ffe69c; color: #1b1b1b; }
@keyframes class-time-up { 50% { background: #dc3545; color: #fff; } }
@media (prefers-reduced-motion: reduce) { .class-timer.time-up { animation: none; outline: 6px solid #dc3545; } }
.vocab-card { min-height: 12rem; background: var(--bs-tertiary-bg); border: 2px solid var(--bs-border-color); }
#agendaList .list-group-item { cursor: pointer; }
#agendaList .list-group-item.active .text-muted { color: rgba(255, 255, 255, 0.9) !important; }
