/* P32 — header + layout in plain CSS (no missing Tailwind utilities) */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100%;
    margin: 0;
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

main,
#main-content,
footer,
section {
    width: 100%;
    max-width: 100%;
}
.max-w-7xl,
.max-w-6xl {
    width: 100%;
    max-width: min(80rem, 100%);
    margin-left: auto;
    margin-right: auto;
    padding-left: max(1rem, env(safe-area-inset-left, 0));
    padding-right: max(1rem, env(safe-area-inset-right, 0));
}
@media (min-width: 640px) {
    .max-w-7xl,
    .max-w-6xl {
        padding-left: max(2rem, env(safe-area-inset-left, 0));
        padding-right: max(2rem, env(safe-area-inset-right, 0));
    }
}

/* ── Marketing header ── */
.mathla-site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(214, 211, 209, 0.8);
    padding-top: env(safe-area-inset-top, 0);
}

.mathla-header-inner {
    width: 100%;
    max-width: min(80rem, 100%);
    margin: 0 auto;
    padding: 0.625rem max(1rem, env(safe-area-inset-left, 0)) 0.625rem
        max(1rem, env(safe-area-inset-right, 0));
}
@media (min-width: 640px) {
    .mathla-header-inner {
        padding-left: max(2rem, env(safe-area-inset-left, 0));
        padding-right: max(2rem, env(safe-area-inset-right, 0));
    }
}

/* Mobile: one compact row — logo + locale + sign up + menu */
.mathla-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    min-height: 48px;
}

.mathla-header-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: #334155;
    cursor: pointer;
    flex-shrink: 0;
}
.mathla-header-menu-btn:hover {
    background: #f5f5f4;
}

.mathla-header-brand {
    flex: 1 0 auto;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.mathla-header-brand img,
.mathla-header-logo img,
.mathla-header-logo {
    height: 2.85rem;
    max-height: 2.85rem;
    width: auto;
}

.mathla-header-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.mathla-header-actions .mathla-header-signin-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    color: var(--mathla-text, #0f172a);
    text-decoration: none;
    white-space: nowrap;
}
.mathla-header-actions .mathla-header-signin-link:hover {
    color: var(--mathla-primary-dark, #a67c00);
}

.mathla-header-actions .mathla-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Nav links: desktop inline only */
.mathla-header-links--desktop {
    display: none;
}

.mathla-header-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mathla-text-body, #334155);
    text-decoration: none;
    white-space: nowrap;
    transition:
        color 0.15s ease,
        background-color 0.15s ease;
}
.mathla-header-link:hover {
    color: var(--mathla-primary-dark, #a67c00);
    background: #f5f5f4;
}
.mathla-header-link.mathla-header-link--active {
    color: var(--mathla-primary-dark, #a67c00);
    background: rgba(212, 175, 55, 0.1);
    font-weight: 600;
}
.mathla-header-link.mathla-header-link--active::after {
    content: "";
    position: absolute;
    bottom: 3px;
    left: 0.75rem;
    right: 0.75rem;
    height: 2.5px;
    background-color: var(--mathla-primary, #d4af37);
    border-radius: 9999px;
}

@media (min-width: 1024px) {
    .mathla-header-menu-btn {
        display: none;
    }
    .mathla-header-inner {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.5rem 1rem;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
    .mathla-header-top {
        display: contents;
    }
    .mathla-header-brand {
        flex: 0 0 auto;
    }
    .mathla-header-brand img,
    .mathla-header-logo img,
    .mathla-header-logo {
        height: 4.25rem !important;
        max-height: 4.25rem !important;
        width: auto !important;
    }
    .mathla-header-logo .font-display {
        font-size: 1.45rem;
    }
    .mathla-header-actions {
        flex: 0 0 auto;
        margin-inline-start: auto;
    }
    .mathla-header-links--desktop {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 0.25rem 0.5rem;
        flex: 1 1 auto;
        min-width: 0;
    }
    #mathla-mobile-nav {
        display: none !important;
    }
}

@media (max-width: 1023px) {
    .mathla-header-actions .mathla-locale-switcher,
    .mathla-header-locale--desktop {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    .mathla-mobile-nav__locale-wrap {
        display: none !important;
    }
}

/* ── Modern Floating Dropdown Language Switcher (Gold Branding) ── */
.mathla-locale-switcher {
    position: relative;
    display: inline-block;
}

.mathla-locale-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 42px;
    padding: 0.5rem 0.875rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    background: #fef3c7;
    color: var(--mathla-primary-dark, #a67c00);
    border: 1.5px solid var(--mathla-primary, #d4af37);
    box-shadow:
        0 0 0 2px rgba(212, 175, 55, 0.15),
        0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mathla-locale-btn:hover {
    background: #fde68a;
    color: var(--mathla-primary-dark, #7a5c00);
    border-color: var(--mathla-primary-dark, #a67c00);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25);
}

.mathla-locale-btn:focus-visible {
    outline: 2px solid var(--mathla-primary, #d4af37);
    outline-offset: 2px;
}

.mathla-locale-btn--dark {
    background: rgba(212, 175, 55, 0.2);
    color: #fef08a;
    border: 1.5px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
}

.mathla-locale-btn--dark:hover {
    background: rgba(212, 175, 55, 0.3);
    color: #ffffff;
    border-color: var(--mathla-primary, #d4af37);
}

.mathla-locale-btn .mathla-locale-icon {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    color: var(--mathla-primary-dark, #a67c00);
}

.mathla-locale-btn--dark .mathla-locale-icon {
    color: #fef08a;
}

.mathla-locale-btn .mathla-locale-chevron {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
    color: var(--mathla-primary-dark, #a67c00);
    transition: transform 0.2s ease;
}

.mathla-locale-btn--dark .mathla-locale-chevron {
    color: #fef08a;
}

.mathla-locale-btn[aria-expanded="true"] .mathla-locale-chevron,
.mathla-locale-switcher.is-open .mathla-locale-chevron {
    transform: rotate(180deg);
}

/* Dropdown Menu Panel */
.mathla-locale-dropdown {
    position: absolute;
    top: calc(100% + 0.375rem);
    z-index: 100;
    min-width: 165px;
    max-width: calc(100vw - 1.5rem);
    padding: 0.375rem;
    border-radius: 0.75rem;
    background: #ffffff;
    border: 1.5px solid var(--mathla-primary, #d4af37);
    box-shadow:
        0 10px 30px -5px rgba(212, 175, 55, 0.25),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    animation: mathlaDropdownFadeIn 0.15s ease-out forwards;
}

html[dir="ltr"] .mathla-locale-dropdown {
    right: 0;
    left: auto;
}
html[dir="rtl"] .mathla-locale-dropdown {
    left: 0;
    right: auto;
}

/* Smart contextual alignment to prevent left-edge screen overflow */
html[dir="ltr"] aside .mathla-locale-dropdown,
html[dir="ltr"] .mathla-app-mobile-header .mathla-locale-dropdown,
html[dir="ltr"] .mathla-mobile-nav .mathla-locale-dropdown,
html[dir="ltr"] .services-header-actions .mathla-locale-dropdown {
    left: 0 !important;
    right: auto !important;
}

html[dir="rtl"] aside .mathla-locale-dropdown,
html[dir="rtl"] .mathla-app-mobile-header .mathla-locale-dropdown,
html[dir="rtl"] .mathla-mobile-nav .mathla-locale-dropdown,
html[dir="rtl"] .services-header-actions .mathla-locale-dropdown {
    right: 0 !important;
    left: auto !important;
}

/* Sidebar dropdown pops upwards cleanly inside sidebar */
aside .mathla-locale-dropdown {
    bottom: calc(100% + 0.375rem) !important;
    top: auto !important;
}

.mathla-locale-dropdown--dark {
    background: #0f172a;
    border: 1.5px solid rgba(212, 175, 55, 0.4);
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(212, 175, 55, 0.15);
    color: #ffffff;
}

.mathla-locale-dropdown-header {
    padding: 0.375rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mathla-primary-dark, #a67c00);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    margin-bottom: 0.25rem;
}

.mathla-locale-dropdown--dark .mathla-locale-dropdown-header {
    color: #fef08a;
    border-bottom-color: rgba(212, 175, 55, 0.2);
}

.mathla-locale-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 0.625rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.mathla-locale-option:hover {
    background: #fef3c7;
    color: var(--mathla-primary-dark, #a67c00);
}

.mathla-locale-dropdown--dark .mathla-locale-option {
    color: #cbd5e1;
}

.mathla-locale-dropdown--dark .mathla-locale-option:hover {
    background: rgba(212, 175, 55, 0.15);
    color: #fef08a;
}

.mathla-locale-option.is-active {
    background: #fef3c7;
    color: var(--mathla-primary-dark, #a67c00);
    font-weight: 700;
    border-inline-start: 3px solid var(--mathla-primary, #d4af37);
}

.mathla-locale-dropdown--dark .mathla-locale-option.is-active {
    background: rgba(212, 175, 55, 0.25);
    color: #fef08a;
    font-weight: 700;
    border-inline-start: 3px solid #fef08a;
}

.mathla-locale-option .mathla-locale-check {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: var(--mathla-primary-dark, #a67c00);
}

.mathla-locale-dropdown--dark .mathla-locale-option .mathla-locale-check {
    color: #fef08a;
}

@keyframes mathlaDropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mathla-mobile-nav__locale-wrap {
    padding: 0 1rem 1rem;
    border-bottom: 1px solid #e7e5e4;
    margin-bottom: 0.75rem;
}
.mathla-mobile-nav__locale-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mathla-muted, #64748b);
    margin-bottom: 0.5rem;
}
.mathla-mobile-nav__locale {
    display: flex;
    justify-content: center;
    width: 100%;
}
.mathla-mobile-nav__locale .mathla-locale-btn {
    width: 100%;
}

@media (max-width: 479px) {
    .mathla-header-actions .mathla-header-signin-link {
        display: none;
    }
    .mathla-header-actions .mathla-btn-primary {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Mobile nav drawer */
.mathla-mobile-nav {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 60;
}
body.mathla-nav-marketing-open #mathla-mobile-nav,
body.mathla-nav-app-open #mathla-app-mobile-nav {
    display: block;
}
body.mathla-scroll-lock {
    overflow: hidden !important;
    touch-action: none;
}

.mathla-mobile-nav__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}
.mathla-mobile-nav__panel {
    position: absolute;
    top: 0;
    bottom: 0;
    width: min(100%, 20rem);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
html[dir="ltr"] .mathla-mobile-nav__panel {
    left: 0;
}
html[dir="rtl"] .mathla-mobile-nav__panel {
    right: 0;
}
.mathla-mobile-nav__panel--light {
    background: #fff;
}

.mathla-mobile-nav__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e7e5e4;
}
.mathla-mobile-nav__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    cursor: pointer;
}
.mathla-mobile-nav__close:hover {
    background: #f5f5f4;
}

.mathla-mobile-nav__scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0;
}
.mathla-mobile-nav__link {
    display: block;
    padding: 0.875rem 1rem;
    min-height: 48px;
    font-size: 1rem;
    font-weight: 500;
    color: #1c1917;
    text-decoration: none;
    border-bottom: 1px solid #f5f5f4;
}
.mathla-mobile-nav__link:hover {
    background: #fafaf9;
    color: var(--mathla-primary-dark, #a67c00);
}
.mathla-mobile-nav__foot {
    padding: 1rem;
    border-top: 1px solid #e7e5e4;
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0));
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.mathla-mobile-nav__link--signin {
    border-bottom: 0;
    text-align: center;
    padding: 0.75rem 1rem;
}
.mathla-mobile-nav__btn {
    width: 100%;
    text-align: center;
}

/* Page wrap */
.mathla-page-wrap {
    width: 100%;
    max-width: min(80rem, 100%);
    margin: 0 auto;
    padding: 3rem 1rem;
    box-sizing: border-box;
}

/* Hero */
.mathla-hero-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}
@media (min-width: 1024px) {
    .mathla-hero-grid {
        flex-direction: row;
        align-items: flex-start;
        gap: 3rem;
    }
    .mathla-hero-copy {
        flex: 1 1 50%;
        min-width: 0;
    }
    .mathla-hero-map {
        flex: 1 1 50%;
        min-width: 0;
        max-width: none;
        margin: 0;
    }
}
.mathla-hero-title {
    font-family: var(--font-display, "Cinzel", "Zain", Georgia, serif);
    font-size: clamp(1.75rem, 6vw, 3.25rem);
    line-height: 1.2;
    color: var(--mathla-text, #0f172a);
    margin: 0;
}
.mathla-hero-accent {
    color: var(--mathla-primary-dark, #a67c00);
}
.mathla-hero-lead {
    margin: 1.5rem 0 0;
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--mathla-muted, #64748b);
    max-width: 36rem;
}
.mathla-hero-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
    width: 100%;
}
@media (min-width: 640px) {
    .mathla-hero-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
}
@media (max-width: 1023px) {
    .mathla-hero-copy {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .mathla-hero-lead {
        margin-left: auto;
        margin-right: auto;
    }
    .mathla-hero-actions {
        justify-content: center;
    }
}
.mathla-hero-map {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    aspect-ratio: 4 / 3;
    border-radius: 1rem;
    overflow: hidden;
    background: #0f172a;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Homepage explore links (below hero) */
.mathla-home-explore {
    width: 100%;
    padding: 1.25rem 1rem;
    box-sizing: border-box;
}
.mathla-home-explore__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    max-width: min(80rem, 100%);
    margin: 0 auto;
}
@media (min-width: 640px) {
    .mathla-home-explore__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem;
    }
}
.mathla-home-explore__link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--mathla-primary-dark, #a67c00);
    background: #fff;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 0.75rem;
    text-decoration: none;
    transition:
        background 0.15s,
        border-color 0.15s;
}
.mathla-home-explore__link:hover {
    background: rgba(212, 175, 55, 0.08);
    border-color: var(--mathla-primary, #d4af37);
}

/* App shell */
@media (max-width: 1023px) {
    .mathla-app-mobile-header__extras {
        display: none !important;
    }
    .mathla-app-mobile-header__wordmark {
        display: none !important;
    }
    .mathla-app-main {
        padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0));
    }
}

/* App drawer reuses .mathla-mobile-nav; dark panel variant */
.mathla-mobile-nav__panel:not(.mathla-mobile-nav__panel--light) {
    background: var(--mathla-sidebar, #3d3428);
}

@media (min-width: 1024px) {
    html[dir="ltr"] .mathla-app-with-sidebar {
        margin-left: 16rem;
    }
    html[dir="rtl"] .mathla-app-with-sidebar {
        margin-right: 16rem;
    }
}

.skip-link {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    width: 1px;
    height: 1px;
    clip: rect(0, 0, 0, 0);
    overflow: hidden;
    border: 0;
    z-index: 200;
}

.leaflet-container,
#mathla-contributor-map {
    max-width: 100% !important;
    overflow: hidden;
}
img,
video,
svg,
.mathla-card {
    max-width: 100%;
    height: auto;
}
input,
select,
textarea,
button {
    font-size: 16px;
    touch-action: manipulation;
}

/* P17 — map popup profile links */
.mathla-map-popup {
    font-size: 0.8125rem;
    line-height: 1.4;
    min-width: 10rem;
}
.mathla-map-popup__list {
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
}
.mathla-map-popup__list a {
    color: #008b74;
    font-weight: 600;
    text-decoration: none;
}
.mathla-map-popup__list a:hover {
    text-decoration: underline;
}
.mathla-map-popup__more {
    margin: 0.375rem 0 0;
    font-size: 0.75rem;
    color: #64748b;
}

/* P37/P36 — inner app pages mobile polish */
.mathla-app-main .overflow-x-auto,
.mathla-app-main table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.mathla-app-main .grid {
    gap: 1rem;
}
.mathla-app-main .mathla-card,
.mathla-app-main [class*="rounded-xl"],
.mathla-app-main [class*="rounded-lg"] {
    width: 100%;
    max-width: 100%;
}
.mathla-app-main form input[type="text"],
.mathla-app-main form input[type="email"],
.mathla-app-main form input[type="search"],
.mathla-app-main form input[type="password"],
.mathla-app-main form select,
.mathla-app-main form textarea {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
}
.mathla-app-main .flex.flex-wrap.gap-2,
.mathla-app-main .flex.gap-2 {
    flex-wrap: wrap;
}
.mathla-app-main .mathla-btn-primary,
.mathla-app-main .mathla-btn-outline {
    min-height: 44px;
}

#main-content.academy-main {
    max-width: 72rem;
    margin-left: auto;
    margin-right: auto;
}
@media (max-width: 1024px) {
    #main-content.academy-main {
        width: auto !important;
        margin-left: 2.5rem !important;
        margin-right: 2.5rem !important;
    }
}
@media (max-width: 768px) {
    #main-content.academy-main {
        margin-left: 1.75rem !important;
        margin-right: 1.75rem !important;
    }
}
@media (max-width: 640px) {
    #main-content.academy-main {
        margin-left: 1.25rem !important;
        margin-right: 1.25rem !important;
    }
}
#main-content.services-main {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
}
.community-hero,
.community-hub__inner {
    max-width: 72rem;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}
.community-hub__grid {
    max-width: 72rem;
    margin-left: auto;
    margin-right: auto;
}
@media (min-width: 1024px) {
    .community-hub__grid.community-hub__grid--wide {
        grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
    }
}
.community-hub__main {
    min-width: 0;
    flex: 1 1 0%;
}

@media (max-width: 639px) {
    .mathla-app-main h1 {
        font-size: clamp(1.25rem, 5vw, 1.75rem);
    }
    .mathla-app-main .hidden.sm\:inline,
    .mathla-app-main .hidden.md\:table-cell {
        display: none !important;
    }
    .mathla-app-mobile-header {
        padding-left: max(0.75rem, env(safe-area-inset-left, 0));
        padding-right: max(0.75rem, env(safe-area-inset-right, 0));
    }
}

/* Auth card must stay narrow even when .mathla-card is forced to 100% */
.mathla-auth-card {
    width: 100% !important;
    max-width: 26rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
.mathla-auth-main {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mathla-auth-card h1 {
    font-size: 1.25rem !important;
    line-height: 1.4 !important;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1.25rem;
}

/* MATHLA_COLLECT_CAMERA_VIEWFINDER — LOCKED 2026-07-17 (operator)
   1) Box stays LARGE (70vh / min 50vh) — never shrink
   2) object-fit: contain — show ENTIRE camera frame (zoomed OUT). cover CROPS = looks zoomed IN
   3) Real zoom-out = getUserMedia widest mode + min zoom (JS) */
.mathla-collect-viewfinder {
    width: 100% !important;
    height: min(70vh, 720px) !important;
    min-height: 50vh !important;
    max-height: 85dvh !important;
    background: #000;
    border-radius: 0.75rem;
    overflow: hidden;
    position: relative;
}
.mathla-collect-viewfinder video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* FULL FOV — never cover */
    object-position: center center;
}

/* ── Cross-Site Navigation Links (Platform, Academy, Services) ── */
.mathla-site-nav-links {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    vertical-align: middle;
}

.mathla-site-nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: #475569;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.mathla-site-nav-link:hover {
    color: #000;
    background: #ffffff;
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.mathla-site-nav-link--active {
    color: #D4AF37 !important;
    background: #ffffff !important;
    border-color: #D4AF37 !important;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}

/* Tooltip on hover */
.mathla-site-nav-link[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    color: #ffffff;
    background: #1e293b;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 70;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mathla-site-nav-link[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.mathla-site-nav-link[data-tooltip]::after {
    content: '';
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px;
    border-style: solid;
    border-color: transparent transparent #1e293b transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 70;
}

.mathla-site-nav-link[data-tooltip]:hover::after {
    opacity: 1;
}

/* Services header dark theme variant */
.services-header .mathla-site-nav-link {
    color: #ccc;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.services-header .mathla-site-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border-color: #D4AF37;
}

.services-header .mathla-site-nav-link--active {
    color: #111 !important;
    background: #D4AF37 !important;
    border-color: #D4AF37 !important;
}

/* Academy header variant */
.academy-header .mathla-site-nav-link {
    background: rgba(214, 201, 178, 0.2);
    border-color: rgba(214, 201, 178, 0.4);
}

.academy-header .mathla-site-nav-link--active {
    color: #001B3A !important;
    background: #ffffff !important;
    border-color: #001B3A !important;
}

/* Mobile drawer full list variant */
.mathla-site-nav-links--mobile-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.mathla-site-nav-links--mobile-list .mathla-site-nav-link {
    width: 100%;
    height: 40px;
    justify-content: flex-start;
    padding: 0 0.75rem;
    gap: 0.65rem;
    border-radius: 8px;
}

