:root {
    /* My Dojo HQ — Quiet Strength × Technical Fighter (MDHQ-APP-VISUAL-001) */
    --app-bg: #F4F2EE;
    --app-canvas: #F4F2EE;
    --app-surface: #FFFFFF;
    --app-surface-muted: #EAE7E1;
    --app-charcoal: #202326;
    --app-graphite: #353A3F;
    --app-nav: #202326;
    --app-nav-hover: #2c3136;
    --app-nav-active: rgba(143, 29, 36, 0.28);
    --app-nav-ink: #F4F2EE;
    --app-nav-muted: rgba(244, 242, 238, 0.68);
    --app-ink: #202326;
    --app-muted: #62605C;
    --app-border: #D8D4CD;
    --app-deep-red: #8F1D24;
    --app-deep-red-hover: #71171C;
    --app-accent: #8F1D24;
    --app-accent-hover: #71171C;
    --app-accent-soft: #f3e4e5;
    --app-accent-warm: #8F1D24;
    --app-accent-warm-soft: #f3e4e5;
    --app-success: #2f6b4f;
    --app-success-soft: #e6f2eb;
    --app-warning: #9a6b2f;
    --app-warning-soft: #f7efdf;
    --app-danger: #a63d3d;
    --app-danger-soft: #f8e8e8;
    --app-info: #276EF1;
    --app-info-soft: #e8f0fe;
    --app-shadow: 0 1px 2px rgba(32, 35, 38, 0.05), 0 1px 3px rgba(32, 35, 38, 0.04);
    --app-radius-sm: 6px;
    --app-radius-md: 8px;
    --app-radius-lg: 12px;
    --app-clip: 10px;
    --app-focus: #276EF1;
    --app-topbar-height: 52px;
    --app-sidebar-width: 240px;
    --app-sidebar-collapsed-width: 72px;
    --app-font-ui: system-ui, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --app-font-display: "Arial Narrow", "Helvetica Neue Condensed", "Segoe UI Condensed", system-ui, sans-serif;
    /* Theme contract — tenant branding may remap brand slots only; never status/focus */
    --theme-brand: var(--app-deep-red);
    --theme-brand-hover: var(--app-deep-red-hover);
    --theme-surface: var(--app-surface);
    --theme-canvas: var(--app-canvas);
    --theme-ink: var(--app-ink);
    --theme-focus: var(--app-focus);
    --theme-success: var(--app-success);
    --theme-warning: var(--app-warning);
    --theme-danger: var(--app-danger);
    --theme-info: var(--app-info);

    /* Legacy aliases used across templates/CSS */
    --primary: var(--app-ink);
    --primary-dark: #141618;
    --primary-tint: var(--app-surface-muted);
    --accent-grey: var(--app-muted);
    --accent-grey-dark: #4a4845;
    --text-dark: var(--app-ink);
    --text-muted: var(--app-muted);
    --border: var(--app-border);
    --surface: var(--app-surface);
    --link-color: var(--app-ink);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (max-width: 1023px) {
    html { scroll-padding-top: var(--app-topbar-height); }
}
body {
    font-family: var(--app-font-ui);
    margin: 0;
    background: var(--app-bg);
    color: var(--app-ink);
    font-size: 15px;
    line-height: 1.5;
}
.app-body { min-height: 100vh; background: var(--app-bg); color: var(--app-ink); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Mobile top bar — hidden on desktop */
.mobile-header {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    padding-top: max(10px, env(safe-area-inset-top));
    background: var(--app-nav);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--app-nav-ink);
    position: sticky;
    top: 0;
    z-index: 90;
}
.mobile-header .nav-toggle {
    background: rgba(255, 255, 255, 0.08);
    border-color: transparent;
    color: var(--app-nav-ink);
}
.mobile-header .nav-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: transparent;
    color: var(--app-nav-ink);
}
.mobile-header-title { color: var(--app-nav-ink); }
.mobile-header-sub { color: var(--app-nav-muted); }
.mobile-header-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.mobile-header-title {
    font-weight: 700;
    font-size: 1em;
    line-height: 1.2;
    text-decoration: none;
}
.mobile-header-sub {
    font-size: 0.78em;
    color: var(--app-nav-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 190;
}

/* Left sidebar navigation */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--app-sidebar-width);
    height: 100vh;
    height: 100dvh;
    background: var(--app-nav);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--app-nav-ink);
    padding: 18px 0 0;
    display: flex;
    flex-direction: column;
}
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 12px;
}
.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 0 8px;
    margin-top: auto;
}
.sidebar-user {
    padding: 0 20px 2px;
    font-size: 0.88em;
    font-weight: 600;
    color: var(--app-nav-ink);
}
.sidebar-user-meta {
    padding: 0 20px 8px;
    font-size: 0.78em;
    color: var(--app-nav-muted);
}
.sidebar-footer-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 20px 8px;
}
.sidebar-footer-actions .nav-link-icon {
    flex: 0 0 auto;
    justify-content: center;
    padding: 10px;
    border-left: none;
    min-width: 44px;
    margin: 0;
    color: var(--app-nav-muted);
    border-radius: var(--app-radius-sm);
}
.sidebar-footer-actions .nav-link-icon:hover {
    color: var(--app-nav-ink);
    background: var(--app-nav-hover);
}
.sidebar-footer-actions .nav-link-icon.active {
    border-left: none;
    border-radius: var(--app-radius-sm);
    background: var(--app-nav-active);
    color: #fff;
}
.sidebar-footer-actions form.nav-logout {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}
.sidebar-footer-actions form.nav-logout .nav-link-icon {
    flex: 0 0 auto;
}
.nav-link-icon-badge-wrap {
    position: relative;
}
.nav-icon-badge {
    position: absolute;
    top: 4px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--app-danger);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
}
.sidebar-logout {
    font-size: 0.88em !important;
    min-width: 44px;
    min-height: 44px;
}
.sidebar .brand {
    display: block;
    color: var(--app-nav-ink);
    font-weight: 700;
    font-size: 1.08em;
    letter-spacing: -0.01em;
    padding: 0 20px 18px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 10px;
}
.sidebar .brand:hover { font-weight: 700; color: #fff; }
.sidebar form.dojo-switcher {
    display: block;
    margin: 0 12px 10px;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border: none;
    border-radius: 0;
}
.sidebar form.dojo-switcher select {
    width: 100%;
    font-weight: 600;
    font-size: 0.92em;
    background: rgba(255, 255, 255, 0.08);
    color: var(--app-nav-ink);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--app-radius-sm);
}
.sidebar form.dojo-switcher select option {
    color: var(--app-ink);
    background: var(--app-surface);
}
form.language-switcher {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    gap: 0;
}
form.language-switcher select {
    font-weight: 600;
    font-size: 0.85em;
    max-width: 10.5rem;
}
.mobile-header .language-switcher {
    margin-left: auto;
    flex-shrink: 0;
}
.mobile-header .language-switcher select {
    background: rgba(255, 255, 255, 0.08);
    color: var(--app-nav-ink);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--app-radius-sm);
}
.mobile-header .language-switcher select option {
    color: var(--app-ink);
    background: var(--app-surface);
}
/* Desktop: no empty fixed topbar — language switcher lives on Account.
   Mobile sticky header remains the only app topbar (see max-width: 1023px). */
@media (min-width: 1024px) {
    .mobile-header {
        display: none;
    }
}
.sidebar form.language-switcher {
    display: block;
    margin: 8px 12px 6px;
}
.sidebar form.language-switcher select {
    width: 100%;
    max-width: none;
    font-size: 0.88em;
}
.landing-nav form.language-switcher select {
    font-size: 0.88em;
}
.table-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.table-actions form {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}
.rank-swatch,
.discipline-swatch {
    display: inline-block;
    width: 0.85em;
    height: 0.85em;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    margin-right: 0.4em;
    vertical-align: -0.1em;
}
.discipline-color-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0 14px;
}
.discipline-color-field-label {
    font-size: 0.88em;
    color: #444;
}
.discipline-color-hint {
    margin: 0;
    font-size: 0.82em;
    color: var(--text-muted);
}
.discipline-color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.discipline-color-option {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    position: relative;
    cursor: pointer;
    margin: 0;
    gap: 0;
}
.discipline-color-option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}
.discipline-color-swatch {
    display: block;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    border: 2px solid #d1d5db;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.discipline-color-none {
    font-size: 0.8em;
    color: var(--text-muted);
    padding: 4px 8px;
    border: 1px dashed #ccc;
    border-radius: 999px;
}
.discipline-color-option input:focus-visible + .discipline-color-swatch,
.discipline-color-option input:focus-visible + .discipline-color-none {
    outline: 2px solid var(--text-dark);
    outline-offset: 2px;
}
.discipline-color-option input:checked + .discipline-color-swatch {
    border-color: var(--text-dark);
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--text-dark);
}
.discipline-color-option input:checked + .discipline-color-none {
    border-style: solid;
    border-color: var(--text-dark);
    color: var(--text-dark);
}
.address-fields .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.address-fields .form-row > label {
    flex: 1 1 12rem;
    min-width: 0;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.sidebar form.nav-logout {
    display: block;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}
.sidebar a.nav-link,
.sidebar button.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--app-nav-muted);
    text-decoration: none;
    padding: 9px 14px;
    margin: 0 8px;
    font-weight: 400;
    font-size: 0.92em;
    border-left: none;
    border-radius: var(--app-radius-sm);
}
.sidebar button.nav-link {
    width: calc(100% - 16px);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    min-height: 0;
    color: inherit;
}
.sidebar-footer-actions button.nav-link {
    width: auto;
    min-height: 44px;
    margin: 0;
}
.sidebar a.nav-link .icon,
.sidebar button.nav-link .icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex-shrink: 0; }
.sidebar a.nav-link .icon svg,
.sidebar button.nav-link .icon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sidebar a.nav-link:hover,
.sidebar button.nav-link:hover {
    background: var(--app-nav-hover);
    font-weight: 400;
    color: var(--app-nav-ink);
}
.sidebar a.nav-link.active {
    background: var(--app-nav-active);
    color: #fff;
    font-weight: 600;
    border-left: none;
}
.sidebar a.nav-link:focus-visible,
.sidebar button.nav-link:focus-visible,
.sidebar details.nav-group summary:focus-visible,
.sidebar details.nav-group summary .nav-group-primary-link:focus-visible {
    outline: 2px solid var(--app-focus);
    outline-offset: 2px;
}

main {
    margin-left: var(--app-sidebar-width);
    max-width: 1100px;
    padding: 32px 28px;
    width: 100%;
}

/* Horizontal scroll for wide data tables on small screens */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin: 12px 0;
}
.table-scroll table {
    margin-top: 0;
    min-width: 520px;
}
.calendar-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 12px 0;
}
.calendar-scroll .calendar-table {
    min-width: 680px;
}

.breadcrumbs {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.4;
}
.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
}
.breadcrumbs a:hover {
    color: var(--text-dark);
    text-decoration: underline;
    font-weight: 400;
}
.breadcrumbs .sep { margin: 0 6px; color: #ccc; }
.breadcrumbs .current { color: var(--text-dark); font-weight: 500; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.page-header h1 { margin: 0; letter-spacing: -0.02em; }

@media (min-width: 1024px) {
    main {
        max-width: min(1100px, calc(100vw - var(--app-sidebar-width) - 56px));
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    main { padding: 20px 24px; }
}

/* Collapsible nav groups (Dojo / Calendar / Finance, etc.) */
.sidebar details.nav-group { border-left: none; margin: 0 8px; }
.sidebar details.nav-group summary {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--app-nav-muted);
    cursor: pointer;
    padding: 9px 14px;
    font-weight: 400;
    font-size: 0.92em;
    list-style: none;
    border-radius: var(--app-radius-sm);
}
.sidebar details.nav-group summary::-webkit-details-marker { display: none; }
.sidebar details.nav-group summary:hover { background: var(--app-nav-hover); color: var(--app-nav-ink); }
.sidebar details.nav-group summary .icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex-shrink: 0; }
.sidebar details.nav-group summary .icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sidebar details.nav-group summary .chevron { margin-left: auto; display: inline-flex; transition: transform 0.15s ease; }
.sidebar details.nav-group summary .chevron svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sidebar details.nav-group summary .nav-group-primary-link {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}
.sidebar details.nav-group summary .nav-group-primary-link .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.sidebar details.nav-group summary .nav-group-primary-link .icon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sidebar details.nav-group[open] summary .chevron { transform: rotate(90deg); }
.sidebar details.nav-group.has-active > summary { color: #fff; font-weight: 600; }
.sidebar details.nav-group .nav-link { padding-left: 40px; font-size: 0.88em; margin: 2px 0; }

/* Mobile + small tablet — off-canvas navigation drawer */
@media (max-width: 1023px) {
    .mobile-header { display: flex; }

    .sidebar-backdrop { display: block; }
    body:not(.nav-open) .sidebar-backdrop { display: none; }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(280px, 88vw);
        height: 100vh;
        height: 100dvh;
        z-index: 200;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        box-shadow: none;
        padding-top: max(18px, env(safe-area-inset-top));
        padding-bottom: env(safe-area-inset-bottom);
    }
    body.nav-open .sidebar {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    }
    body.nav-open { overflow: hidden; }

    .sidebar a.nav-link,
    .sidebar button.nav-link,
    .sidebar details.nav-group summary {
        min-height: 44px;
        padding-top: 11px;
        padding-bottom: 11px;
    }

    main {
        margin-left: 0;
        padding: 16px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        max-width: 100%;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-row > label,
    input, select, textarea {
        max-width: 100%;
    }
    .form-row > label { min-width: 0; flex: 1 1 100%; }

    form.inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .tab-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 8px;
    }
    .tab-bar::-webkit-scrollbar { display: none; }
    .tab-btn { flex: 0 0 auto; white-space: nowrap; }

    .breadcrumbs {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .dojo-card { padding: 14px 16px; }

    input, select, textarea { font-size: 16px; }

    th, td { padding: 8px 10px; font-size: 0.88em; }

    .cal-day { height: auto; min-height: 72px; }
}

@media (max-width: 480px) {
    main { padding: 12px; }
    h1 { font-size: 1.25em; }
    .stat-value { font-size: 1.5em; }
}

/* Typography — calm operational hierarchy */
h1 { color: var(--app-ink); font-weight: 700; font-size: 1.55em; letter-spacing: -0.02em; margin: 0 0 0.5em; line-height: 1.2; }
h2 { color: var(--app-ink); font-weight: 600; font-size: 1.08em; margin: 1.2em 0 0.5em; letter-spacing: -0.01em; }
p { font-size: 0.95em; }

table { width: 100%; border-collapse: collapse; margin-top: 12px; background: var(--app-surface); border-radius: var(--app-radius-md); overflow: hidden; box-shadow: var(--app-shadow); border: 1px solid var(--app-border); font-size: 0.92em; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--app-border); }
th { background: var(--app-surface-muted); font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.04em; color: var(--app-muted); font-weight: 600; }
tbody tr:hover { background: var(--app-accent-soft); cursor: pointer; }
tbody tr:last-child td { border-bottom: none; }

form { display: flex; flex-direction: column; gap: 10px; background: var(--app-surface); padding: 18px; border-radius: var(--app-radius-md); margin: 12px 0; box-shadow: var(--app-shadow); border: 1px solid var(--app-border); font-size: 0.94em; }
form.inline-form { flex-direction: row; flex-wrap: wrap; align-items: center; box-shadow: none; padding: 0; background: transparent; border: none; }
form.inline-action {
    display: inline;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border: none;
}
button.btn-link,
button.btn-icon {
    cursor: pointer;
    font-family: inherit;
}
label { display: flex; flex-direction: column; font-size: 0.88em; gap: 4px; color: var(--app-ink); font-weight: 500; }
.checkbox-row { flex-direction: row; align-items: center; gap: 8px; }
.radio-row { display: flex; flex-direction: row; align-items: flex-start; gap: 8px; margin: 6px 0; }
.access-mode-fieldset { margin-bottom: 14px; }

.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > label { flex: 1; min-width: 150px; }
.log-class-form .log-class-row-2col > label {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
}
.log-class-form .log-class-row-times > label {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
}
.log-class-form .log-class-row-type-duration > label {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
}
.log-class-form .log-class-duration {
    max-width: none;
}
.log-class-location-other[hidden] {
    display: none !important;
}
.form-error { color: #c62828; margin-bottom: 12px; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.checkbox-group label.checkbox-row { flex: 0 0 auto; }
.student-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(12em, 1fr));
    gap: 6px 16px;
}
.student-grid label.checkbox-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin: 0;
    min-width: 0;
}
.student-grid label.checkbox-row span {
    min-width: 0;
}
@media (max-width: 768px) {
    .student-grid { grid-template-columns: 1fr; }
}

code {
    background: #f2f2f2;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.9em;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.dojo-card, .dojo-card p { overflow-wrap: anywhere; }

input, select, textarea {
    font: inherit;
    color: var(--app-ink);
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    padding: 9px 11px;
    min-height: 40px;
    width: 100%;
    max-width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--app-focus);
    outline-offset: 1px;
    border-color: var(--app-accent);
}
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    flex: 0 0 auto;
}

/* Button hierarchy — primary / secondary / tertiary */
button {
    background: var(--app-surface-muted);
    color: var(--app-ink);
    border: 1px solid var(--app-border);
    padding: 8px 16px;
    border-radius: var(--app-radius-sm);
    cursor: pointer;
    font-size: 0.88em;
    font-weight: 600;
    font-family: inherit;
    min-height: 40px;
}
button:hover { background: #e4dfd6; border-color: #d5d0c6; }
button:focus-visible {
    outline: 2px solid var(--app-focus);
    outline-offset: 2px;
}
button.btn-primary,
.btn-primary {
    background: var(--app-accent);
    border-color: var(--app-accent);
    color: #fff;
}
button.btn-primary:hover,
.btn-primary:hover {
    background: var(--app-deep-red-hover);
    border-color: var(--app-deep-red-hover);
    color: #fff;
}
button.btn-danger,
.btn-danger {
    background: var(--app-danger-soft);
    border-color: #e3b8b8;
    color: var(--app-danger);
}
button.btn-danger:hover,
.btn-danger:hover {
    background: #f1d4d4;
    border-color: #d9a0a0;
    color: #8f2f2f;
}
button.btn-sm { padding: 8px 12px; min-height: 40px; }
a.btn-sm,
.btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 8px 12px;
    min-height: 40px;
    border-radius: var(--app-radius-sm);
    border: 1px solid var(--app-border);
    background: var(--app-surface-muted);
    color: var(--app-ink);
    font-size: 0.88em;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    line-height: 1.2;
    cursor: pointer;
}
a.btn-sm:hover,
.btn-sm:hover {
    background: #e4dfd6;
    border-color: #d5d0c6;
    color: var(--app-ink);
}
a.btn-sm.btn-secondary,
button.btn-sm.btn-secondary,
.btn-sm.btn-secondary {
    background: var(--app-surface);
}
.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.table-actions form.inline-action,
td form.inline-action {
    display: inline;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    gap: 0;
}
.portal-home-card h2 { margin-bottom: 8px; }
.portal-finance-list { display: grid; gap: 12px; }
.portal-finance-item { padding: 10px 0; border-bottom: 1px solid var(--border, #e2e2e2); }
.portal-finance-item:last-child { border-bottom: none; }
.portal-finance-form .form-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.portal-finance-form label { display: flex; flex-direction: column; gap: 4px; min-width: 140px; flex: 1; }
.portal-payments-table-wrap,
.payment-reports-table-wrap { margin-top: 8px; }
.portal-payments-table,
.payment-reports-table { width: 100%; min-width: 640px; }
.portal-payments-table th,
.payment-reports-table th { white-space: nowrap; }
.portal-report-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; white-space: nowrap; }
.inline-withdraw-form { display: inline; margin: 0; }
.payment-report-actions-cell { min-width: 220px; }
.payment-report-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 6px; }
.payment-report-action-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.payment-report-reject-form { flex: 1 1 220px; flex-wrap: wrap; }
.payment-report-reason-input { min-width: 10rem; max-width: 100%; flex: 1 1 10rem; }
.payment-report-meta { margin: 6px 0 0; font-size: 0.92rem; }
.status-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.85rem; background: #f3f3f3; }
.status-pill.pending { background: #fff4e5; }
.field-hint-spaced { display: block; margin: 10px 0 18px; line-height: 1.45; }
.portal-feedback-list { margin: 0; padding-left: 18px; }
.portal-feedback-list li { margin-bottom: 10px; }

/* Icon-only action buttons (edit/save/delete/etc.) */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    background: var(--app-surface);
    color: var(--app-ink);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    cursor: pointer;
}
.btn-icon:hover { background: var(--app-surface-muted); border-color: #d5d0c6; color: var(--app-ink); }
.btn-icon.danger:hover, .btn-icon-text.danger:hover { background: var(--app-danger-soft); border-color: #e3b8b8; color: var(--app-danger); }

/* Buttons combining an icon with a text label (not icon-only) */
.btn-icon-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    height: auto;
    min-height: 40px;
    padding: 7px 16px;
    border-radius: var(--app-radius-sm);
    white-space: nowrap;
    background: var(--app-surface-muted);
    color: var(--app-ink);
    border: 1px solid var(--app-border);
    cursor: pointer;
    font-size: 0.88em;
    font-weight: 600;
    font-family: inherit;
}
.btn-icon-text:hover { background: #e4dfd6; border-color: #d5d0c6; }
.btn-icon-text svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

tr.row-view .edit-field { display: none !important; }
tr.row-edit .view-field { display: none !important; }
tr.row-view .btn-save-icon { display: none !important; }
tr.row-view .btn-save-text { display: none !important; }
tr.row-edit .btn-edit-icon { display: none !important; }
.btn-icon svg {
    width: 15px; height: 15px;
    fill: none; stroke: currentColor;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.btn-icon.star-toggle svg.star-icon {
    fill: none;
    stroke: currentColor;
    opacity: 0.42;
}
svg.star-icon-filled,
.btn-icon svg.star-icon-filled,
.btn-icon.star-toggle.is-default-star svg.star-icon,
.btn-icon.star-toggle svg.star-icon-filled {
    fill: currentColor;
    stroke: currentColor;
    opacity: 1;
}
a.btn-icon { text-decoration: none; }
a.btn-icon:hover { font-weight: normal; }
a.btn-icon.emergency-icon {
    color: var(--app-danger);
}
a.btn-icon.emergency-icon:hover {
    background: var(--app-danger-soft);
    border-color: #e3b8b8;
    color: #8f2f2f;
}
a.btn-icon.emergency-icon-missing {
    color: var(--app-danger);
    opacity: 0.72;
}

/* Hyperlinks */
a { color: var(--text-dark); text-decoration: underline; text-decoration-color: #aaa; text-underline-offset: 2px; font-size: inherit; }
a:hover { font-weight: bold; text-decoration: underline; text-decoration-color: var(--text-dark); }
a.btn-link, a.nav-link, a.brand, a.btn-icon { text-decoration: none !important; }
a.btn-link:hover, a.nav-link:hover, a.brand:hover { text-decoration: none !important; }

/* Dashboard cards */
.dojo-card {
    background: var(--app-surface);
    border-radius: var(--app-radius-md);
    padding: 18px 20px;
    margin-bottom: 16px;
    box-shadow: var(--app-shadow);
    border: 1px solid var(--app-border);
}
.dojo-card h2 { margin-top: 0; }
.dojo-card .btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.stat-card { margin-bottom: 0; text-align: center; }
.stat-label {
    font-size: 0.75em;
    color: var(--app-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
    font-weight: 600;
}
.stat-value { font-size: 1.7em; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; color: var(--app-ink); }
.stat-value.is-positive { color: var(--app-accent); }
.stat-value.is-alert { color: var(--app-danger); }
.stat-hint { font-size: 0.82em; color: var(--app-muted); margin: 6px 0 0; }
.dashboard-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.dashboard-panel-header h1,
.dashboard-panel-header h2 { margin: 0; }
.dashboard-section-card h2 { margin-bottom: 8px; }
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}
.dashboard-grid > .dojo-card { margin-bottom: 0; }
.dashboard-notice { margin-bottom: 12px; border-color: #e0e0e0; }
.dashboard-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.dashboard-quick-actions-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.dashboard-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 76px;
    padding: 10px 6px;
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow);
    text-decoration: none;
    color: var(--app-ink);
    text-align: center;
}
.dashboard-quick-action:hover {
    background: var(--app-surface-muted);
    color: var(--app-ink);
}
.dashboard-quick-action-primary {
    background: var(--app-nav);
    border-color: var(--app-nav);
    color: #fff;
}
.dashboard-quick-action-primary:hover {
    background: var(--app-nav-hover);
    border-color: var(--app-nav-hover);
    color: #fff;
}
.dashboard-quick-action-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.dashboard-quick-action-label {
    font-size: 0.72rem;
    line-height: 1.2;
    font-weight: 600;
}
@media (max-width: 520px) {
    .dashboard-quick-actions {
        gap: 6px;
    }
    .dashboard-quick-actions-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }
    .dashboard-quick-action {
        min-height: 68px;
        padding: 8px 4px;
    }
    .dashboard-quick-action-label {
        font-size: 0.64rem;
    }
}
.stat-delta {
    display: block;
    font-size: 0.78em;
    margin-top: 4px;
    font-weight: 500;
}
.stat-delta.up { color: var(--app-success); }
.stat-delta.down { color: var(--app-danger); }
.stat-delta.flat { color: var(--app-muted); }
.week-calendar-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.week-calendar-table { min-width: 640px; margin-bottom: 8px; }
.week-calendar-card {
    padding: 0;
    overflow: hidden;
}
.week-calendar-card > summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.week-calendar-card > summary::-webkit-details-marker { display: none; }
.week-calendar-card > summary::after {
    content: "";
    flex-shrink: 0;
    width: 0.55em;
    height: 0.55em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
    margin-top: -0.2em;
}
.week-calendar-card[open] > summary::after {
    transform: rotate(-135deg);
    margin-top: 0.15em;
}
.week-calendar-summary-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.week-calendar-title {
    font-size: 1.05em;
    font-weight: 600;
    color: var(--text-dark);
}
.week-calendar-dates {
    font-size: 0.88em;
    color: var(--text-muted);
}
.week-calendar-body {
    padding: 0 16px 16px;
}
.week-calendar-nav {
    margin-bottom: 10px;
}
.week-calendar-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
}
.week-calendar-day {
    border-top: 1px solid #ececec;
    padding: 10px 0;
}
.week-calendar-day:first-child { border-top: none; padding-top: 0; }
.week-calendar-day.is-today .week-calendar-day-label {
    font-weight: 700;
}
.week-calendar-day-label {
    font-size: 0.82em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.week-calendar-day-content {
    min-height: 0;
    height: auto;
    padding: 8px;
    border-radius: 8px;
}
.week-calendar-day.is-today .week-calendar-day-content {
    background: #f3f3f3;
    box-shadow: inset 0 0 0 2px var(--text-dark);
}
.week-calendar-mobile { display: none; }
@media (max-width: 768px) {
    .week-calendar-desktop { display: none; }
    .week-calendar-mobile { display: block; }
}
@media (min-width: 769px) {
    .week-calendar-card > summary { cursor: default; }
    .week-calendar-card > summary::after { display: none; }
}
.week-calendar-table th.week-col-today {
    background: #f3f3f3;
    color: var(--text-dark);
    box-shadow: inset 0 -3px 0 var(--text-dark);
}
.week-cal-day { height: auto; min-height: 90px; }
.week-calendar-legend { margin: 8px 0 0; }
.dashboard-upcoming-events { margin-bottom: 20px; }
.dashboard-section-card { margin-bottom: 20px; }
.dashboard-section-card .section-title { margin-top: 0; }
.students-owing-card .amount-owed {
    color: #c62828;
    font-weight: 600;
    white-space: nowrap;
}
.students-owing-total {
    font-size: 0.9em;
    font-weight: 600;
    color: #c62828;
}
.cal-day.cal-today {
    background: #f3f3f3;
    box-shadow: inset 0 0 0 2px var(--text-dark);
}
.cal-day.cal-today:hover { background: #f3f3f3; }
.cal-daynum-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.7em;
    height: 1.7em;
    padding: 0 0.4em;
    border-radius: 999px;
    background: var(--text-dark);
    color: #fff;
    font-weight: 700;
    font-size: 0.92em;
    line-height: 1;
}

/* Toast notifications */
.toast-container {
    margin-bottom: 16px;
    transition: opacity 0.4s ease;
}
.toast-container.toast-fade { opacity: 0; pointer-events: none; }
.toast {
    background: var(--app-surface);
    color: var(--app-ink);
    padding: 12px 16px;
    border-radius: var(--app-radius-sm);
    font-size: 0.9em;
    border: 1px solid var(--app-border);
    border-left: 3px solid var(--app-accent);
    box-shadow: var(--app-shadow);
}

/* Tab navigation */
.tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--app-border);
    padding-bottom: 10px;
}
.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--app-radius-sm);
    padding: 8px 14px;
    min-height: 40px;
    font-size: 0.88em;
    color: var(--app-muted);
    cursor: pointer;
}
.tab-btn:hover { background: var(--app-surface-muted); color: var(--app-ink); }
.tab-btn.active {
    background: var(--app-accent-soft);
    color: var(--app-accent);
    font-weight: 600;
    border-color: #c5d8cb;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Student workspace */
.student-workspace {
    max-width: 1100px;
}
.student-workspace-header {
    margin-bottom: 14px;
}
.student-workspace-header-main {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.student-workspace-name {
    margin: 0 0 8px;
    font-size: 1.65em;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
.student-workspace-meta,
.student-workspace-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    font-size: 0.92em;
    color: var(--text-dark);
}
.student-workspace-contact {
    margin-top: 8px;
    color: var(--text-muted);
}
.student-workspace-meta-item .meta-label,
.student-workspace-contact .meta-label {
    color: var(--text-muted);
    font-weight: 600;
    margin-right: 4px;
}
.student-status-pill {
    display: inline-block;
    font-size: 0.8em;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--app-border);
    background: var(--app-surface-muted);
}
.student-status-pill.is-active {
    color: var(--app-success);
    border-color: #b7d7c4;
    background: var(--app-success-soft);
}
.student-status-pill.is-inactive {
    color: var(--app-danger);
    border-color: #e3b8b8;
    background: var(--app-danger-soft);
}
.student-workspace-header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}
.student-workspace-status-action {
    opacity: 0.92;
}
.student-workspace-tabs.tab-bar a.tab-btn {
    text-decoration: none;
    display: inline-block;
}
.student-workspace-tabs.tab-bar a.tab-btn:focus-visible {
    outline: 2px solid var(--app-focus);
    outline-offset: 2px;
}
.student-overview-grid,
.student-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}
.student-overview-list {
    margin: 8px 0 0;
    padding-left: 18px;
}
.student-attention-list {
    margin: 0;
    padding-left: 18px;
}
.student-ready-mark {
    color: #2e7d32;
    font-weight: 600;
    font-size: 0.85em;
}
@media (max-width: 760px) {
    .student-overview-grid,
    .student-profile-grid {
        grid-template-columns: 1fr;
    }
    .student-workspace-header-actions {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

/* Analytics charts */
.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 900px) {
    .chart-grid { grid-template-columns: 1fr; }
}
.analytics-chart {
    width: 100%;
    height: auto;
    overflow: visible;
    display: block;
}
.chart-grid .section-title { margin-top: 0; }
.chart-subtitle {
    font-size: 0.85em;
    color: var(--text-muted);
    margin: -0.35em 0 0.75em;
}
.chart-y-label {
    font-size: 9px;
    fill: var(--text-muted);
}
.chart-x-label {
    font-size: 9px;
    fill: var(--text-muted);
}
.chart-value-label {
    font-size: 8px;
    fill: var(--text-dark);
    font-weight: 600;
}
.chart-value-label-muted { fill: var(--text-muted); }
.chart-legend-label {
    font-size: 9px;
    fill: var(--text-muted);
}
.chart-full-width { grid-column: 1 / -1; }
.analytics-chart line.chart-grid {
    stroke: #ececec;
    stroke-width: 1;
}
.analytics-chart line.chart-axis {
    stroke: #d8d8d8;
    stroke-width: 1;
}

/* Public landing / auth pages */
.landing-body {
    --landing-bg: #f3efe6;
    --landing-bg-soft: #e8e1d4;
    --landing-surface: #fffcf7;
    --landing-border: #ddd4c5;
    --landing-ink: #1f2421;
    --landing-muted: #5f675f;
    --landing-accent: #2f4a3c;
    --landing-accent-soft: #e4ebe6;
    --landing-accent-warm: #b08d57;
    --landing-accent-warm-soft: #f1e8d8;
    --landing-accent-cool: #3d5c4f;
    --landing-accent-cool-soft: #e5efe9;
    --landing-cta-hover: #243a30;
    --landing-charcoal: #1e2a24;
    --landing-charcoal-soft: #2a3a32;
    --landing-gold: #b08d57;
    --landing-gold-soft: #d4c4a8;
    --landing-font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --landing-font-body: "Avenir Next", "Segoe UI Variable", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(ellipse 100% 70% at 0% 0%, rgba(176, 141, 87, 0.10), transparent 50%),
        radial-gradient(ellipse 80% 50% at 100% 10%, rgba(47, 74, 60, 0.07), transparent 45%),
        var(--landing-bg);
    color: var(--landing-ink);
    font-family: var(--landing-font-body);
}
.landing-body h1,
.landing-body h2,
.landing-body h3,
.landing-body .landing-brand {
    font-family: var(--landing-font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
}
.landing-body a:not(.btn-link):not(.btn-icon):not(.landing-brand) {
    color: var(--landing-accent);
    text-decoration-color: rgba(47, 74, 60, 0.35);
}
.landing-body a:not(.btn-link):not(.btn-icon):not(.landing-brand):hover {
    color: var(--landing-cta-hover);
    text-decoration-color: var(--landing-accent);
}
.landing-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 252, 248, 0.92);
    border-bottom: 1px solid var(--landing-border);
    backdrop-filter: blur(8px);
}
.landing-header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 20px;
    padding-top: max(14px, env(safe-area-inset-top));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.landing-brand {
    font-weight: 700;
    color: var(--landing-ink);
    text-decoration: none;
}
.landing-brand:hover { color: var(--landing-accent); }
.landing-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 0.92em;
}
.landing-nav a {
    color: var(--landing-muted);
    text-decoration: none;
}
.landing-nav a:hover { color: var(--landing-accent); }
.landing-nav-icon {
    width: 40px;
    height: 40px;
}
.landing-nav-account {
    position: relative;
}
.landing-account-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: var(--landing-surface);
    border: 1px solid var(--landing-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(44, 40, 37, 0.08);
    padding: 6px;
    z-index: 60;
}
.landing-account-menu[hidden] {
    display: none;
}
.landing-account-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.92em;
    white-space: nowrap;
}
.landing-account-menu a:hover {
    background: var(--landing-accent-soft);
    color: var(--landing-accent);
}
.mobile-header-title {
    font-weight: 700;
    color: var(--text-dark);
    text-decoration: none;
}
.mobile-header-title:hover { color: var(--text-dark); }
.landing-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 20px 48px;
    padding-bottom: max(48px, env(safe-area-inset-bottom));
}
.landing-hero {
    text-align: center;
    padding: 24px 0 40px;
}
.landing-eyebrow {
    display: inline-block;
    margin: 0 0 12px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--landing-accent-soft);
    color: var(--landing-accent);
    font-size: 0.82em;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.landing-hero h1 {
    margin: 0 0 16px;
    font-size: clamp(1.8em, 5vw, 2.6em);
    line-height: 1.15;
}
.landing-lead {
    max-width: 640px;
    margin: 0 auto 24px;
    color: var(--text-muted);
    font-size: 1.05em;
    line-height: 1.6;
}
.landing-hero-cta {
    display: inline-block;
    padding: 10px 22px;
}
.landing-hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.landing-hero-secondary-link {
    margin: 0;
    font-size: 0.88em;
}
.landing-hero-secondary-link a {
    color: var(--text-muted);
    text-decoration: none;
}
.landing-hero-secondary-link a:hover {
    color: var(--text-dark);
    text-decoration: underline;
}
.public-wrap { max-width: 520px; margin: 0 auto; width: 100%; }
.landing-hero { max-width: 760px; margin: 0 auto; }
.landing-main--wide { max-width: 1180px; }
.landing-body.landing-home .landing-main--wide {
    max-width: 1180px;
    padding-top: 12px;
}
.landing-page-intro {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 32px;
}
.landing-section-head {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 28px;
}
.landing-section-head h2 {
    margin: 0 0 12px;
    font-size: clamp(1.35em, 3vw, 1.75em);
    color: var(--landing-ink);
}
.landing-section-head h2::after {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--landing-gold), var(--landing-accent-cool));
    opacity: 0.65;
}
.landing-section-lead {
    margin: 0;
    color: var(--landing-muted);
    line-height: 1.6;
}
.landing-audiences {
    margin-top: 48px;
    padding: 28px 22px;
    border-radius: 16px;
    background: var(--landing-accent-soft);
    border: 1px solid rgba(90, 79, 122, 0.12);
}
.landing-network,
.landing-dojo-reach,
.landing-previews,
.landing-proof {
    margin-top: 48px;
}
.landing-discover {
    margin-top: 48px;
    padding: 28px 22px;
    border-radius: 16px;
    background: var(--landing-accent-cool-soft);
    border: 1px solid rgba(61, 115, 104, 0.12);
}
.landing-section-lead--follow {
    margin-top: 12px;
}
.landing-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.landing-preview-chrome span:nth-child(1) { background: #d4a0a0; }
.landing-preview-chrome span:nth-child(2) { background: #d9c48a; }
.landing-preview-chrome span:nth-child(3) { background: #9fbf9f; }
.landing-preview-card {
    margin: 0;
    background: var(--landing-surface);
    border: 1px solid var(--landing-border);
    border-radius: 12px;
    overflow: hidden;
}
.landing-preview-frame {
    background: var(--landing-bg-soft);
    padding: 14px 14px 0;
}
.landing-preview-chrome {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}
.landing-preview-chrome span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d4d4d4;
}
.landing-preview-screen {
    background: var(--landing-surface);
    border: 1px solid var(--landing-border);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    min-height: 140px;
    padding: 12px;
}
.landing-preview-screen--roster .landing-preview-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr 0.7fr;
    gap: 8px;
    margin-bottom: 8px;
}
.landing-preview-screen--roster .landing-preview-row span {
    display: block;
    height: 10px;
    border-radius: 4px;
    background: #ececec;
}
.landing-preview-screen--roster .landing-preview-row.is-head span {
    background: #d8d8d8;
    height: 8px;
}
.landing-preview-cal-head {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}
.landing-preview-cal-head span {
    height: 8px;
    border-radius: 4px;
    background: #d8d8d8;
}
.landing-preview-cal-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}
.landing-preview-cal-grid i {
    display: block;
    height: 28px;
    border-radius: 6px;
    background: #f0f0f0;
    font-style: normal;
}
.landing-preview-cal-grid i.on {
    background: #cfcfcf;
}
.landing-preview-today-block {
    background: #f0f0f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}
.landing-preview-today-block span,
.landing-preview-today-list span,
.landing-preview-portal-card span {
    display: block;
    height: 10px;
    border-radius: 4px;
    background: #d8d8d8;
    margin-bottom: 8px;
}
.landing-preview-today-block span:last-child,
.landing-preview-today-list span:last-child,
.landing-preview-portal-card span:last-child {
    margin-bottom: 0;
    width: 60%;
}
.landing-preview-today-list span { background: #ececec; }
.landing-preview-portal-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.landing-preview-portal-nav span {
    flex: 1;
    height: 22px;
    border-radius: 6px;
    background: #ececec;
}
.landing-preview-portal-card {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 14px;
    min-height: 72px;
}
.landing-preview-card figcaption {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.landing-preview-card figcaption strong {
    color: var(--landing-ink);
}
.landing-preview-card figcaption span {
    color: var(--text-muted);
    font-size: 0.9em;
    line-height: 1.45;
}
.landing-proof-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.landing-proof-grid li {
    background: var(--landing-surface);
    border: 1px solid var(--landing-border);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.landing-proof-grid strong { color: var(--landing-ink); }
.landing-proof-grid span {
    color: var(--text-muted);
    font-size: 0.95em;
    line-height: 1.55;
}
.landing-audience-link--secondary {
    font-weight: 500;
    color: var(--landing-muted);
}
.landing-waitlist {
    margin-top: 48px;
    padding: 28px 22px;
    border-radius: 16px;
    background: var(--landing-accent-warm-soft);
    border: 1px solid rgba(166, 107, 69, 0.14);
}
.landing-waitlist-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}
.landing-waitlist-card {
    background: var(--landing-surface);
    border: 1px solid var(--landing-border);
    border-radius: 12px;
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.landing-waitlist-card h3 { margin: 0; }
.landing-waitlist-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95em;
    line-height: 1.55;
    flex: 1;
}
.landing-waitlist-dojo {
    text-align: center;
    margin: 20px 0 0;
    color: var(--text-muted);
    font-size: 0.95em;
}
.landing-waitlist-dojo a {
    color: var(--landing-accent-warm);
    font-weight: 600;
    text-decoration: none;
}
.landing-waitlist-dojo a:hover { text-decoration: underline; }
.landing-discover-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.landing-discover-card {
    background: var(--landing-surface);
    border: 1px solid var(--landing-border);
    border-radius: 12px;
    padding: 18px;
}
.landing-discover-card h3 {
    margin: 0 0 8px;
    font-size: 1.05em;
}
.landing-discover-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95em;
    line-height: 1.55;
}
.landing-section-head--spaced {
    margin-top: 48px;
}
.landing-audience-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.landing-audience-card {
    background: var(--landing-surface);
    border: 1px solid var(--landing-border);
    border-top: 3px solid var(--landing-accent);
    border-radius: 12px;
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.landing-audience-card:nth-child(2) { border-top-color: var(--landing-accent-cool); }
.landing-audience-card:nth-child(3) { border-top-color: var(--landing-accent-warm); }
.landing-audience-eyebrow {
    margin: 0;
    font-size: 0.78em;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--landing-accent);
}
.landing-audience-card:nth-child(2) .landing-audience-eyebrow { color: var(--landing-accent-cool); }
.landing-audience-card:nth-child(3) .landing-audience-eyebrow { color: var(--landing-accent-warm); }
.landing-audience-card h3 {
    margin: 0;
    font-size: 1.25em;
}
.landing-audience-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95em;
    line-height: 1.55;
    flex: 1;
}
.landing-audience-link {
    color: var(--landing-accent);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.92em;
}
.landing-audience-card:nth-child(2) .landing-audience-link { color: var(--landing-accent-cool); }
.landing-audience-card:nth-child(3) .landing-audience-link { color: var(--landing-accent-warm); }
.landing-audience-link:hover {
    text-decoration: underline;
}
.landing-network-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}
.landing-network-list li {
    background: var(--landing-surface);
    border: 1px solid var(--landing-border);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.landing-network-list strong {
    color: var(--landing-accent);
}
.landing-network-list span {
    color: var(--text-muted);
    font-size: 0.95em;
    line-height: 1.55;
}
.landing-network-note {
    margin: 18px 0 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88em;
}
.landing-plan-blurb {
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 0.9em;
    line-height: 1.5;
}
.landing-learners {
    margin-top: 48px;
}
.landing-learner-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}
.landing-learner-card {
    background: var(--landing-surface);
    border: 1px solid var(--landing-border);
    border-radius: 12px;
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.landing-learner-card:first-child {
    border-top: 3px solid var(--landing-accent-cool);
}
.landing-learner-card:last-child {
    border-top: 3px solid var(--landing-accent-warm);
}
.landing-learner-header h3 {
    margin: 0;
    font-size: 1.15em;
}
.landing-learner-tag {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.88em;
}
.landing-learner-blurb {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95em;
    line-height: 1.55;
}
.landing-learner-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.landing-learner-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--text-dark);
    font-size: 0.92em;
    line-height: 1.45;
}
.landing-learner-check {
    flex-shrink: 0;
    color: var(--landing-accent-cool);
    font-weight: 600;
}
.landing-learner-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 4px;
}
.landing-pricing-grid--audience {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
@media (max-width: 960px) {
    .landing-audience-grid,
    .landing-preview-grid,
    .landing-proof-grid,
    .landing-waitlist-grid,
    .landing-discover-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 640px) {
    .landing-learner-grid,
    .landing-pricing-grid--audience {
        grid-template-columns: 1fr;
    }
}
.landing-pillar-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.landing-pillar-card {
    background: var(--landing-surface);
    border: 1px solid var(--landing-border);
    border-radius: 12px;
    padding: 20px;
}
.landing-pillar-card h3 {
    margin: 0 0 8px;
    font-size: 1.05em;
    color: var(--landing-accent);
}
.landing-pillar-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95em;
    line-height: 1.55;
}
.landing-personas {
    text-align: center;
    padding: 24px 20px;
    background: var(--landing-surface);
    border: 1px solid var(--landing-border);
    border-radius: 12px;
}
.landing-personas-label {
    margin: 0 0 12px;
    font-size: 0.82em;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--landing-accent);
}
.landing-persona-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 20px;
    color: var(--text-muted);
    font-size: 0.95em;
}
.landing-persona-list li strong { color: var(--text-dark); }
.landing-pricing-note {
    margin: 12px 0 0;
    font-size: 0.88em;
    color: var(--text-muted);
}
.landing-pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
}
.landing-plan-card {
    display: flex;
    flex-direction: column;
    background: var(--landing-surface);
    border: 1px solid var(--landing-border);
    border-radius: 12px;
    padding: 18px;
}
.landing-plan-card--highlight {
    border-color: var(--landing-accent);
    box-shadow: 0 8px 24px rgba(90, 79, 122, 0.12);
    background: linear-gradient(180deg, #fffcf8 0%, var(--landing-accent-soft) 100%);
}
.landing-plan-header h3 {
    margin: 0 0 8px;
    font-size: 1.05em;
}
.landing-plan-price {
    margin: 0 0 14px;
}
.landing-plan-amount {
    font-size: 1.6em;
    font-weight: 700;
    line-height: 1.1;
}
.landing-plan-period {
    display: block;
    margin-top: 2px;
    font-size: 0.82em;
    color: var(--text-muted);
}
.landing-plan-limits,
.landing-plan-features {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    font-size: 0.88em;
}
.landing-plan-limits li {
    padding: 4px 0;
    color: var(--text-dark);
    font-weight: 500;
}
.landing-plan-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 0;
    color: var(--text-muted);
}
.landing-plan-features li.is-included { color: var(--landing-ink); }
.landing-plan-features li.is-excluded { opacity: 0.45; }
.landing-plan-check {
    flex: 0 0 1em;
    font-weight: 700;
    color: var(--landing-accent-cool);
}
.landing-plan-features li.is-excluded .landing-plan-check {
    color: var(--landing-muted);
}
.landing-plan-footer { margin-top: auto; }
.landing-plan-cta {
    display: block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}
.landing-trust {
    text-align: center;
    padding: 8px 0 0;
    margin-top: 8px;
}
.landing-trust-text {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95em;
}
.landing-footer {
    border-top: 1px solid var(--landing-border);
    background: var(--landing-surface);
    margin-top: 48px;
}
.landing-footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 20px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.landing-footer-brand {
    margin: 0;
    font-weight: 700;
    color: var(--landing-accent);
}
.landing-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.92em;
}
.landing-footer-nav a {
    color: var(--landing-muted);
    text-decoration: none;
}
.landing-footer-nav a:hover { color: var(--landing-accent); }
.landing-footer-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.landing-pricing-currency {
    margin: 8px 0 0;
    font-size: 0.85em;
    color: var(--text-muted);
}
.pricing-currency-switcher select,
.landing-footer-controls .language-switcher select {
    font-size: 0.88em;
}
.landing-pricing-faq {
    margin-top: 48px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
.landing-pricing-faq h2 {
    text-align: center;
    margin: 0 0 20px;
}
.landing-faq-list {
    margin: 0;
}
.landing-faq-list div {
    padding: 14px 0;
    border-top: 1px solid var(--landing-border);
}
.landing-faq-list dt {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--landing-ink);
}
.landing-faq-list dd {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
}
.landing-back-home {
    text-align: center;
    margin-top: 32px;
}
.landing-back-home a {
    color: var(--landing-accent);
    text-decoration: none;
}
.landing-back-home a:hover {
    color: var(--landing-cta-hover);
    text-decoration: underline;
}

/* Landing CTAs and auth forms */
.landing-body .btn-link:not(.secondary) {
    background: var(--landing-charcoal);
    border-color: var(--landing-charcoal);
    color: #f7f3ea !important;
}
.landing-body .btn-link:not(.secondary):hover {
    background: var(--landing-cta-hover);
    border-color: var(--landing-cta-hover);
    color: #fff !important;
}
.landing-body .btn-link.secondary {
    background: var(--landing-bg-soft);
    border-color: var(--landing-border);
    color: var(--landing-muted) !important;
}
.landing-body .btn-link.secondary:hover {
    background: #ddd5c8;
    border-color: #ddd5c8;
    color: var(--landing-ink) !important;
}
.landing-body .landing-form {
    background: var(--landing-surface);
    border-color: var(--landing-border);
}
.landing-body .landing-form button {
    background: var(--landing-accent);
    border-color: var(--landing-accent);
    color: #fff;
}
.landing-body .landing-form button:hover {
    background: var(--landing-cta-hover);
    border-color: var(--landing-cta-hover);
}
.landing-body .btn-icon {
    border-color: var(--landing-border);
    background: var(--landing-surface);
}
.landing-body .btn-icon:hover {
    background: var(--landing-accent-soft);
    border-color: var(--landing-accent-soft);
    color: var(--landing-accent);
}
.landing-preview-card figcaption strong {
    color: var(--landing-ink);
}
@media (max-width: 960px) {
    .landing-pricing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 640px) {
    .landing-pillar-grid,
    .landing-pricing-grid {
        grid-template-columns: 1fr;
    }
    .landing-persona-list {
        flex-direction: column;
        align-items: center;
    }
    .landing-footer-inner {
        flex-direction: column;
        text-align: center;
    }
    .landing-nav > a {
        display: none;
    }
}

/* ===== Martial Pod homepage redesign (MP-HOMEPAGE-REDESIGN-007) ===== */
.mp-home-eyebrow {
    margin: 0 0 10px;
    font-family: var(--landing-font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--landing-gold);
}
.mp-home-eyebrow--inline {
    margin: 0;
}
.mp-home-eyebrow--on-dark {
    color: var(--landing-gold-soft);
}
.mp-home-section-head {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 32px;
}
.mp-home-section-head h2 {
    margin: 0 0 12px;
    font-size: clamp(1.55rem, 3.2vw, 2.15rem);
    line-height: 1.15;
    color: var(--landing-ink);
}
.mp-home-section-head--dark h2 {
    color: #f5f1e8;
}
.mp-home-section-lead {
    margin: 0;
    color: var(--landing-muted);
    line-height: 1.65;
    font-size: 1.05rem;
}
.mp-home-section-head--dark .mp-home-section-lead {
    color: rgba(245, 241, 232, 0.78);
}
.mp-home-section-lead--left {
    text-align: left;
}
.mp-home-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--mp-focal, center);
}
.mp-home-placeholder-label {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 2;
    margin: 0;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(30, 42, 36, 0.78);
    color: #f5f1e8;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    pointer-events: none;
}
.mp-home-placeholder-label--on-dark {
    background: rgba(0, 0, 0, 0.45);
}
.mp-home-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 22px;
    border-radius: 8px !important;
}
.mp-home-cta-secondary {
    font-weight: 600;
    color: var(--landing-accent) !important;
    text-decoration: none !important;
}
.mp-home-cta-secondary:hover {
    color: var(--landing-cta-hover) !important;
    text-decoration: underline !important;
}
.mp-home-text-link {
    font-weight: 600;
    text-decoration: none !important;
}
.mp-home-text-link:hover {
    text-decoration: underline !important;
}
.mp-home-text-link--secondary {
    font-weight: 500;
    color: var(--landing-muted) !important;
}
.mp-home-status {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--landing-accent-warm-soft);
    color: #7a6234;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Hero */
.mp-home-hero {
    padding: 20px 0 8px;
}
.mp-home-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 36px;
    align-items: center;
}
.mp-home-hero__copy h1 {
    margin: 0 0 16px;
    font-size: clamp(2.1rem, 4.5vw, 3.25rem);
    line-height: 1.08;
    color: var(--landing-ink);
}
.mp-home-hero__lead {
    margin: 0 0 24px;
    max-width: 34rem;
    color: var(--landing-muted);
    font-size: 1.08rem;
    line-height: 1.65;
}
.mp-home-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}
.mp-home-hero__visual {
    position: relative;
    min-height: 420px;
}
.mp-home-hero__photo-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    aspect-ratio: 16 / 10;
    background: var(--landing-charcoal);
    box-shadow: 0 24px 48px rgba(30, 42, 36, 0.18);
}
.mp-home-device {
    margin: 0;
    position: absolute;
    background: var(--landing-surface);
    border: 1px solid rgba(30, 42, 36, 0.12);
    box-shadow: 0 18px 40px rgba(30, 42, 36, 0.22);
    overflow: hidden;
}
.mp-home-device--desktop {
    left: 6%;
    right: 18%;
    bottom: -6%;
    border-radius: 12px;
    aspect-ratio: 16 / 10;
}
.mp-home-device--mobile {
    width: min(28%, 148px);
    right: 4%;
    bottom: -10%;
    border-radius: 18px;
    aspect-ratio: 9 / 19;
    border-width: 3px;
    border-color: #1a2420;
}
.mp-home-device__chrome {
    display: flex;
    gap: 6px;
    padding: 8px 10px 0;
    background: #ece7dc;
}
.mp-home-device__chrome span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c9bfae;
}
.mp-home-device .mp-home-placeholder-label,
.mp-home-device figcaption.mp-home-placeholder-label {
    position: static;
    display: block;
    border-radius: 0;
    background: rgba(30, 42, 36, 0.9);
}
.mp-home-values {
    list-style: none;
    margin: 48px 0 0;
    padding: 22px 0 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    border-top: 1px solid var(--landing-border);
}
.mp-home-values li {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mp-home-values strong {
    font-family: var(--landing-font-display);
    font-size: 1.12rem;
    color: var(--landing-ink);
}
.mp-home-values span {
    color: var(--landing-muted);
    line-height: 1.5;
    font-size: 0.95rem;
}

/* Audiences */
.mp-home-audiences {
    margin-top: 56px;
    padding: 36px 28px;
    border-radius: 20px;
    background: var(--landing-surface);
    border: 1px solid var(--landing-border);
}
.mp-home-audience-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}
.mp-home-audience-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    background: var(--landing-bg);
    border: 1px solid var(--landing-border);
}
.mp-home-audience-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--landing-bg-soft);
}
.mp-home-audience-card__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 18px 20px;
    flex: 1;
}
.mp-home-audience-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.mp-home-audience-card h3 {
    margin: 0;
    font-size: 1.35rem;
}
.mp-home-audience-card p {
    margin: 0;
    color: var(--landing-muted);
    line-height: 1.55;
    font-size: 0.96rem;
}
.mp-home-audience-card__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
}

/* Product band */
.mp-home-product {
    margin-top: 56px;
    padding: 48px 28px;
    border-radius: 20px;
    background:
        radial-gradient(ellipse 70% 60% at 90% 0%, rgba(176, 141, 87, 0.18), transparent 55%),
        var(--landing-charcoal);
    color: #f5f1e8;
}
.mp-home-product__inner {
    max-width: 1080px;
    margin: 0 auto;
}
.mp-home-product__shot {
    position: relative;
    margin: 0 0 28px;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(245, 241, 232, 0.12);
    aspect-ratio: 16 / 9;
    background: var(--landing-charcoal-soft);
}
.mp-home-capability-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.mp-home-capability-grid li {
    padding: 16px 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(245, 241, 232, 0.1);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mp-home-capability-grid strong {
    font-family: var(--landing-font-display);
    font-size: 1.08rem;
    color: #f7f3ea;
}
.mp-home-capability-grid span {
    color: rgba(245, 241, 232, 0.72);
    line-height: 1.5;
    font-size: 0.93rem;
}

/* Vision */
.mp-home-vision {
    margin-top: 56px;
    padding: 8px 0 12px;
}
.mp-home-vision__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 36px;
    align-items: center;
}
.mp-home-vision__media {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    aspect-ratio: 5 / 4;
    background: var(--landing-bg-soft);
    border: 1px solid var(--landing-border);
}
.mp-home-vision__copy h2 {
    margin: 0 0 14px;
    font-size: clamp(1.7rem, 3.4vw, 2.4rem);
    line-height: 1.12;
}
.mp-home-vision__cta {
    margin: 22px 0 0;
}

/* Homepage spacing for shared pricing / FAQ / waitlist blocks */
.landing-home .landing-pricing,
.landing-home .landing-learners,
.landing-home .landing-pricing-faq,
.landing-home .landing-waitlist {
    margin-top: 56px;
}

@media (max-width: 900px) {
    .mp-home-hero__grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .mp-home-hero__visual {
        min-height: 0;
        max-width: 640px;
    }
    .mp-home-device--desktop {
        left: 8%;
        right: 22%;
        bottom: -4%;
    }
    .mp-home-device--mobile {
        width: min(26%, 130px);
        bottom: -8%;
    }
    .mp-home-audience-grid,
    .mp-home-capability-grid {
        grid-template-columns: 1fr 1fr;
    }
    .mp-home-audience-grid .mp-home-audience-card:last-child {
        grid-column: 1 / -1;
        max-width: 420px;
        justify-self: center;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .mp-home-values,
    .mp-home-vision__grid,
    .mp-home-audience-grid,
    .mp-home-capability-grid {
        grid-template-columns: 1fr;
    }
    .mp-home-audience-grid .mp-home-audience-card:last-child {
        max-width: none;
    }
    .mp-home-audiences,
    .mp-home-product {
        padding-left: 18px;
        padding-right: 18px;
    }
    .mp-home-device--mobile {
        display: none;
    }
    .mp-home-device--desktop {
        left: 8%;
        right: 8%;
        bottom: -8%;
    }
}

@media (max-width: 480px) {
    .mp-home-hero__actions {
        flex-direction: column;
        align-items: stretch;
    }
    .mp-home-hero__actions .mp-home-cta,
    .mp-home-hero__actions .mp-home-cta-secondary {
        text-align: center;
    }
    .mp-home-hero__photo-wrap {
        border-radius: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mp-home-hero,
    .mp-home-audiences,
    .mp-home-product,
    .mp-home-vision {
        scroll-margin-top: 72px;
    }
}

.auth-card h1 { text-align: center; }
.auth-copy, .auth-links { text-align: center; color: var(--text-muted); }
.auth-error { color: #c0392b; text-align: center; }
.landing-form {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.landing-form input,
.landing-form select,
.landing-form textarea,
.landing-form button {
    font-size: 16px;
}
.landing-form textarea {
    width: 100%;
    min-height: 8rem;
    resize: vertical;
    font: inherit;
    padding: 0.6rem 0.75rem;
    border: 1px solid #d8d4cd;
    border-radius: 8px;
}
.contact-honeypot {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.landing-form button {
    margin-top: 4px;
    width: 100%;
}
@media (max-width: 640px) {
    .landing-header-inner { padding: 12px 16px; }
    .landing-main { padding: 20px 16px 36px; }
}

.public-page form.landing-form {
    box-shadow: none;
    margin: 12px 0;
}

/* Curriculum page — collapsible requirement groups and filters */
.curriculum-setup details,
.curriculum-requirements details.curriculum-discipline-group,
.curriculum-requirements details.curriculum-belt-group {
    background: white;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.curriculum-setup details > summary,
.curriculum-requirements details.curriculum-discipline-group > summary,
.curriculum-requirements details.curriculum-belt-group > summary {
    cursor: pointer;
    padding: 14px 18px;
    font-weight: 600;
    list-style: none;
}
.curriculum-setup details > summary::-webkit-details-marker,
.curriculum-requirements details > summary::-webkit-details-marker { display: none; }
.curriculum-requirements details.curriculum-discipline-group > summary {
    font-size: 1.02em;
    background: #fafafa;
    border-radius: 12px;
}
.curriculum-requirements details.curriculum-discipline-group[open] > summary {
    border-bottom: 1px solid #f0f0f0;
    border-radius: 12px 12px 0 0;
}
.curriculum-requirements details.curriculum-belt-group {
    margin: 10px 14px 14px;
    border-color: #ececec;
}
.curriculum-requirements details.curriculum-belt-group > summary {
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
}
.curriculum-requirements .curriculum-category-label {
    margin: 0;
    padding: 10px 18px 4px;
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.curriculum-requirements table {
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
}
.curriculum-requirements .curriculum-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: flex-end;
    background: white;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    margin-bottom: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.curriculum-requirements .curriculum-filter-bar label {
    min-width: 140px;
    margin: 0;
}
.curriculum-requirements .curriculum-jump-links {
    margin-bottom: 14px;
}
.curriculum-requirements .curriculum-empty-filter {
    display: none;
    padding: 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.92em;
}
.curriculum-setup .curriculum-setup-body {
    padding: 0 18px 18px;
}
.curriculum-setup .curriculum-setup-body > table {
    margin-top: 0;
}

.log-class-more {
    background: white;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    margin: 16px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.log-class-more > summary {
    cursor: pointer;
    padding: 12px 16px;
    font-weight: 600;
    list-style: none;
}
.log-class-more > summary::-webkit-details-marker { display: none; }
.log-class-more[open] > summary {
    border-bottom: 1px solid #f0f0f0;
}
.log-class-more-body {
    padding: 12px 16px 16px;
}

.curriculum-term {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.curriculum-term-local { font-weight: 600; }
.curriculum-term-romanization {
    font-size: 0.88em;
    color: var(--text-muted);
    font-style: italic;
}
.curriculum-term-native {
    font-size: 1.05em;
    line-height: 1.35;
}
.curriculum-term-edit {
    min-width: 180px;
}
tr.row-edit .curriculum-term-edit {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
tr.row-view .curriculum-term-edit {
    display: none;
}
.curriculum-term-hint {
    font-size: 0.85em;
    color: var(--text-muted);
    margin: 0 0 12px;
}
.curriculum-req-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 8px;
}
.curriculum-req-heading .curriculum-term-local {
    font-size: 1.2em;
}
.curriculum-req-category {
    font-size: 0.75em;
    font-weight: normal;
    color: var(--text-muted);
    white-space: nowrap;
    margin-top: 4px;
}
.checklist-req-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.checklist-req-label .curriculum-term-local {
    font-weight: 500;
}

/* CTA links — secondary surface, primary accent available via .btn-primary */
.btn-link {
    display: inline-block;
    background: var(--app-surface-muted);
    color: var(--app-ink) !important;
    border: 1px solid var(--app-border);
    padding: 8px 16px;
    border-radius: var(--app-radius-sm);
    font-weight: 600;
    font-size: 0.88em;
    text-decoration: none;
    min-height: 40px;
    line-height: 1.35;
}
.btn-link:hover { background: #e4dfd6; border-color: #d5d0c6; font-weight: 600; }
.btn-link.secondary {
    background: var(--app-surface);
    color: var(--app-muted) !important;
    border-color: var(--app-border);
}
.btn-link.secondary:hover { background: var(--app-surface-muted); color: var(--app-ink) !important; }
.btn-link.btn-primary {
    background: var(--app-accent);
    border-color: var(--app-accent);
    color: #fff !important;
}
.btn-link.btn-primary:hover {
    background: #355f48;
    border-color: #355f48;
    color: #fff !important;
}

/* Admin portal */
body.admin-wide main { max-width: 1080px; }
.admin-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}
.admin-subnav .btn-link.active {
    background: var(--primary);
    color: #fff !important;
    border-color: var(--primary);
}
.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.admin-stat-grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.admin-stat { margin-bottom: 0; }
.admin-stat-label {
    font-size: 0.78em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 6px;
}
.admin-stat-value { font-size: 1.35em; font-weight: 600; line-height: 1.25; }
.admin-stat-value-small { font-size: 1.05em; font-weight: 600; }
.admin-stat-meta { font-size: 0.82em; color: var(--text-muted); margin-top: 6px; }
.status-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.72em;
    font-weight: 600;
    letter-spacing: 0.02em;
    vertical-align: middle;
}
.status-pill.ok { background: var(--app-success-soft); color: var(--app-success); }
.status-pill.fail { background: var(--app-danger-soft); color: var(--app-danger); }
.status-pill.warn { background: var(--app-warning-soft); color: var(--app-warning); border: 1px solid #e5d5b3; }
.status-pill.pending { background: var(--app-accent-warm-soft); color: #7a6230; }
.admin-table-wrap { overflow-x: auto; }
.admin-detail {
    background: #f7f7f7;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.82em;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Calendar */
.calendar-table { table-layout: fixed; box-shadow: 0 1px 3px rgba(0,0,0,0.06); font-size: 0.9em; }
.calendar-table th { background: var(--text-dark); color: white; text-align: center; }
.cal-day { vertical-align: top; height: 90px; padding: 6px; border: 1px solid #f0f0f0; }
.cal-day:hover { background: white; cursor: default; }
.cal-day.cal-day-empty { padding: 0; }
.cal-day.cal-day-empty:hover { background: #f3f3f3; cursor: pointer; }
.cal-day.cal-today.cal-day-empty:hover { background: #ececec; }
.cal-day-empty-link {
    display: block;
    min-height: 78px;
    padding: 6px;
    color: inherit;
    text-decoration: none;
}
.cal-day-empty-hint {
    display: block;
    font-size: 0.7em;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 2px;
}
.cal-outside .cal-day-empty-hint { color: #bbb; }
.cal-outside { background: #f7f7f5; color: #aaa; }
.cal-closed { background: var(--primary-tint); }
.cal-daynum { font-weight: 600; font-size: 0.85em; margin-bottom: 4px; }
.cal-tag { font-size: 0.72em; padding: 2px 5px; border-radius: 4px; margin-bottom: 2px; color: white; }
.cal-tag.has-discipline-color {
    box-shadow: inset 4px 0 0 var(--discipline-color);
    padding-left: 8px;
}
.cal-tag-scheduled { background: #9e9e9e; }
.cal-tag-held { background: #2e7d32; }
.cal-tag-cancelled { background: #c62828; }
.cal-tag-postponed { background: #e65100; }
.cal-tag-event { background: var(--primary); }
.cal-tag-closure { background: var(--accent-grey); }
.cal-legend-section { margin-top: 16px; }
.cal-legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.cal-legend { display: inline-block; padding: 3px 8px; border-radius: 4px; color: white; font-size: 0.75em; }
.cal-legend-disciplines { margin-top: 8px; }
.cal-legend-label {
    font-size: 0.75em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
}
.cal-legend-discipline {
    display: inline-flex;
    align-items: center;
    font-size: 0.8em;
    color: var(--text-dark);
}
.cal-legend-help {
    margin: 10px 0 0;
    font-size: 0.85em;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Print: hide nav/buttons, keep only checklist content */
@media print {
    .sidebar, .mobile-header, .sidebar-backdrop, .no-print, button { display: none !important; }
    main { margin-left: 0 !important; }
    .dojo-card { break-inside: avoid; border: 1px solid #ccc; box-shadow: none; }
}

/* Account recognition on public create-dojo */
.account-recognition-dialog {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.45);
}
.account-recognition-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    padding: 24px;
    max-width: 440px;
    width: 100%;
}
.account-recognition-card h2 {
    margin: 0 0 12px;
    font-size: 1.25rem;
}
.account-recognition-actions,
.account-recognition-secondary {
    margin-top: 16px;
}
.account-recognition-secondary button.btn-secondary {
    background: #f3f3f3;
    color: var(--text-dark);
}
.dojo-continue-summary {
    margin: 16px 0 0;
}
.dojo-continue-summary dt {
    font-weight: 600;
    margin-top: 8px;
}
.dojo-continue-summary dd {
    margin: 4px 0 0;
}
.link-button {
    background: none;
    border: none;
    color: var(--link-color, #0b5cab);
    cursor: pointer;
    padding: 0;
    font: inherit;
    text-decoration: underline;
}
.auth-copy-muted {
    color: var(--text-muted);
    font-size: 0.92em;
}

/* Session inactivity warning — authenticated shell only */
.session-timeout-dialog {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 300;
    max-width: min(360px, calc(100vw - 32px));
}
.session-timeout-card {
    background: #fff;
    border: 1px solid #ececec;
    border-left: 3px solid var(--text-dark);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 14px 16px;
}
.session-timeout-copy {
    margin: 0 0 6px;
    font-weight: 600;
}
.session-timeout-remaining {
    margin: 0 0 12px;
    color: var(--text-muted);
    font-size: 0.9em;
}
.session-timeout-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.session-timeout-logout {
    margin: 0;
}

/* Student portal UX */
.portal-home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
}
.training-assistant-form textarea {
    display: block;
    width: 100%;
    max-width: 640px;
    min-height: 72px;
    margin: 6px 0 10px;
}
.training-assistant-suggestions {
    margin-bottom: 4px;
}
.training-assistant-answer {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e6e6e6;
}
.training-assistant-answer h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}
.guardian-child-switcher {
    margin-bottom: 12px;
    padding: 12px 14px;
}
.guardian-switcher-label {
    font-size: 0.85rem;
    margin: 0 0 6px;
    color: #666;
}
.guardian-switcher-form select {
    width: 100%;
    max-width: 100%;
}
.guardian-switcher-links {
    margin: 8px 0 0;
    font-size: 0.9rem;
}
.family-child-grid {
    display: grid;
    gap: 12px;
    margin: 12px 0 20px;
}
.family-child-card-header h2 {
    margin: 0 0 4px;
    font-size: 1.1rem;
}
.family-child-meta {
    margin: 10px 0;
    display: grid;
    gap: 6px;
}
.family-child-meta div {
    display: flex;
    gap: 8px;
    font-size: 0.92rem;
}
.family-child-meta dt {
    color: #666;
    min-width: 7rem;
}
.family-child-meta dd {
    margin: 0;
}
.family-child-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.family-child-actions form {
    display: inline-flex;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
}
.family-add-card,
.family-empty-card {
    margin-top: 16px;
}
@media (min-width: 640px) {
    .family-child-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.portal-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.portal-metric-card {
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.portal-metric-label {
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}
.portal-metric-value {
    font-size: 1.05em;
    font-weight: 600;
}
.practice-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.practice-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 12px;
    padding: 10px 12px;
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 10px;
}
.practice-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}
.practice-discipline {
    font-size: 0.85em;
    color: var(--text-muted);
}
.portal-compact-table th,
.portal-compact-table td {
    padding: 6px 8px;
    vertical-align: middle;
}
.portal-compact-table tbody tr {
    cursor: default;
}
.portal-compact-table tbody tr:hover {
    background: var(--primary-tint);
}
.portal-compact-table .col-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}
.portal-table-card .table-scroll {
    overflow-x: auto;
}
.training-log-row-personal {
    background: #faf8ff;
}
.training-type-personal {
    font-weight: 600;
    color: #5e35b1;
}
.discipline-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}
.discipline-tab {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid #ddd;
    background: #fff;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.92em;
}
.discipline-tab.active {
    background: var(--text-dark);
    border-color: var(--text-dark);
    color: #fff;
}
.discipline-tab:hover {
    border-color: var(--text-dark);
}
.feedback-comment-cell {
    white-space: pre-wrap;
    min-width: 12rem;
}
.checkin-status {
    font-size: 0.85em;
}
.form-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
@media (max-width: 900px) {
    .portal-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
/* Inline help bubbles */
.info-bubble {
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
    position: relative;
}
.info-bubble-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 1px solid #d1d5db;
    background: #fff;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    font-style: italic;
    line-height: 1;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.info-bubble-trigger::-webkit-details-marker { display: none; }
.info-bubble-trigger:hover,
.info-bubble[open] .info-bubble-trigger {
    border-color: var(--text-dark);
    color: var(--text-dark);
}
.info-bubble-panel {
    position: absolute;
    z-index: 120;
    left: 0;
    top: calc(100% + 6px);
    min-width: 14rem;
    max-width: min(20rem, 85vw);
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    font-size: 0.88em;
    font-weight: 400;
    color: var(--text-dark);
    line-height: 1.45;
}
.page-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}
.page-title-row h1,
.page-title-row h2 {
    margin: 0;
}
.guardian-context-banner {
    margin: 0 0 14px;
    padding: 10px 14px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    font-size: 0.92em;
}
.guardian-context-banner a {
    font-weight: 600;
}
.family-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    align-items: center;
}
.family-actions form {
    margin: 0;
    display: inline;
}
@media (max-width: 600px) {
    .portal-metric-grid {
        grid-template-columns: 1fr;
    }
    .portal-compact-table thead,
    .portal-feedback-table thead,
    .roster-table thead {
        display: none;
    }
    .portal-compact-table tr,
    .portal-feedback-table tr,
    .roster-table tr {
        display: block;
        margin-bottom: 12px;
        border-bottom: 1px solid #ececec;
        padding-bottom: 8px;
    }
    .portal-compact-table td,
    .portal-feedback-table td,
    .roster-table td {
        display: block;
        border: none;
        padding: 2px 0;
    }
    .portal-compact-table td::before,
    .portal-feedback-table td::before,
    .roster-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.78em;
        text-transform: uppercase;
        color: var(--text-muted);
        display: block;
    }
    .portal-compact-table td.col-actions,
    .roster-table td.col-actions {
        padding-top: 6px;
    }
    .roster-table tr {
        cursor: default;
    }
    .info-bubble-panel {
        position: static;
        margin-top: 6px;
        max-width: 100%;
    }
}

/* Legal documents and emergency safety */
.legal-disclaimer,
.emergency-disclaimer {
    font-size: 0.92em;
    color: var(--text-muted);
    max-width: 46rem;
}
.legal-setup-warning,
.emergency-setup-warning {
    border-left: 4px solid #b45309;
}
.legal-page-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -6px 0 14px;
}
.legal-document-header .legal-document-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.legal-document-actions .inline-form {
    display: inline;
    margin: 0;
}
.legal-applicability-fieldset {
    border: 0;
    padding: 0;
    margin: 0 0 16px;
}
.legal-applicability-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 10px;
}
.legal-applicability-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #efefef;
    color: var(--text-dark);
    font-size: 0.92em;
}
.legal-wysiwyg-editor {
    min-height: 280px;
    background: #fff;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
}
.legal-wysiwyg-editor .ql-editor {
    min-height: 240px;
    font-size: 1rem;
    line-height: 1.55;
}
.legal-body-preview h1,
.legal-body-preview h2,
.legal-body-preview h3 {
    margin: 0.75em 0 0.35em;
}
.legal-body-preview p,
.legal-body-preview ul,
.legal-body-preview ol {
    margin: 0.5em 0;
}
.legal-body-card,
.legal-body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.55;
}
.legal-confirm-form {
    margin: 16px 0;
}
.legal-confirm-btn,
.emergency-call-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 12px 18px;
    font-size: 1rem;
    text-decoration: none;
}
.emergency-call-btn {
    background: #111;
    color: #fff;
    border-radius: 8px;
    margin: 8px 8px 8px 0;
}
.emergency-card h3 {
    margin-bottom: 4px;
}
.table-scroll,
.legal-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.legal-table {
    min-width: 640px;
}
.legal-item h2 {
    overflow-wrap: anywhere;
}
@media (max-width: 600px) {
    .legal-page h1,
    .emergency-page h1 {
        font-size: 1.35rem;
    }
    .legal-actions .btn-link,
    .legal-confirm-btn,
    .emergency-call-btn {
        width: 100%;
    }
}

.lifecycle-warning-card {
    border-left: 4px solid #b45309;
}
.lifecycle-pending-transfer {
    background: #fffbeb;
    margin-top: 12px;
}
.lifecycle-pending-transfer-banner {
    margin-top: 0;
    margin-bottom: 16px;
    padding: 16px 18px;
}
.lifecycle-pending-transfer h2,
.lifecycle-pending-transfer h3 {
    margin-top: 0;
}
.lifecycle-accept-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 12px 20px;
    background: #b45309;
    color: #fff;
    border: 1px solid #92400e;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.lifecycle-accept-btn:hover {
    background: #92400e;
}
.lifecycle-danger-card {
    border-left: 4px solid #b91c1c;
}
.lifecycle-danger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 10px 16px;
    background: #fff5f5;
    color: #9b1c1c;
    border: 1px solid #fecaca;
    border-radius: 8px;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
}
.lifecycle-danger-btn:hover {
    background: #fee2e2;
}
.lifecycle-check {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
}
.lifecycle-check input {
    min-width: 20px;
    min-height: 20px;
    margin-top: 0;
}
.dojo-card fieldset {
    border: 1px solid #ececec;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 0;
}
.lifecycle-action-row,
.lifecycle-inline-form {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 8px 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
}
.lifecycle-owner-list {
    display: flex;
    flex-direction: column;
}
.lifecycle-owner-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 10px 0;
    border-bottom: 1px solid #ececec;
}
.lifecycle-owner-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.lifecycle-owner-identity {
    min-width: 0;
    flex: 1 1 auto;
}
.lifecycle-owner-actions {
    margin: 0;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
}
.lifecycle-owner-actions select {
    width: auto;
    max-width: 16rem;
}
@media (max-width: 600px) {
    .lifecycle-danger-btn,
    .lifecycle-accept-btn,
    .lifecycle-action-row button,
    .lifecycle-inline-form button {
        width: 100%;
    }
    .lifecycle-owner-row {
        flex-wrap: wrap;
    }
    .lifecycle-owner-actions {
        width: auto;
        margin-left: auto;
    }
    .lifecycle-owner-actions button {
        width: auto;
    }
}

/* In-app Help */
.help-toc h2 { margin-bottom: 10px; }
.help-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}
.help-toc-list a { font-size: 0.95em; }
.help-section { scroll-margin-top: 72px; }
.help-points {
    margin: 0;
    padding-left: 1.2em;
}
.help-points li { margin: 0 0 0.65em; }
.help-points li:last-child { margin-bottom: 0; }

/* Instructor today’s-class home */
.instructor-today .portal-home-card { margin-bottom: 14px; }
.instructor-today-phase {
    margin: 0 0 4px;
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.instructor-today-time {
    margin: 4px 0 8px;
    font-size: 1.15em;
    font-weight: 600;
}
.instructor-today-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}
.instructor-today-chip {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid var(--border, #ddd);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    font-size: 0.92em;
}
.instructor-today-chip.is-active {
    border-color: var(--text-dark, #222);
    font-weight: 600;
}
.instructor-today-roster,
.instructor-today-checkins {
    list-style: none;
    margin: 0;
    padding: 0;
}
.instructor-today-roster li,
.instructor-today-checkins li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border, #ececec);
}
.instructor-today-roster li:last-child,
.instructor-today-checkins li:last-child {
    border-bottom: none;
}
.instructor-today-checkin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.instructor-today-checkin-actions form {
    margin: 0;
}
.instructor-today-note-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.instructor-today-note-form select,
.instructor-today-note-form input[type="text"] {
    width: 100%;
    max-width: 100%;
}
.instructor-today-portal-link {
    margin-bottom: 12px;
}
.checkin-status.confirmed { color: #1a7f37; }
.checkin-status.pending { color: #9a6700; }

/* Commerce / store integration cards */
.commerce-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ececec;
}
.commerce-subnav-link {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.92em;
    border: 1px solid transparent;
}
.commerce-subnav-link:hover {
    color: var(--text-dark);
    background: #f3f3f3;
}
.commerce-subnav-link.active {
    color: var(--text-dark);
    border-color: #ddd;
    background: #fff;
    font-weight: 600;
}
.integration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.integration-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.integration-card {
    display: block;
    position: relative;
    padding: 16px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.integration-card:hover {
    border-color: #ccc;
}
.integration-card-selected {
    border-color: var(--text-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.integration-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.integration-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}
.integration-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f4f4f4;
    color: var(--text-dark);
}
.integration-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.integration-card-title {
    font-weight: 600;
    font-size: 0.95em;
    margin-bottom: 4px;
}
.integration-card-desc {
    font-size: 0.85em;
    color: var(--text-muted);
    margin: 0 0 8px;
    line-height: 1.45;
}
.integration-card-hint {
    font-size: 0.8em;
    color: var(--text-muted);
    margin: 0;
}
.integration-connect-btn {
    margin-top: 4px;
}
.integration-card-compact {
    padding: 14px;
}

/* Training consistency / training rhythm (derived read model; no gamification) */
.tc-root {
    overflow: hidden;
}
.tc-metrics.portal-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tc-metric-hint,
.tc-rhythm-note {
    font-size: 0.82em;
    color: var(--text-muted);
}
.tc-rhythm-summary {
    margin: 14px 0 4px;
    font-weight: 600;
}
.tc-subhead,
.tc-detail-heading {
    font-size: 1em;
    margin: 16px 0 8px;
}
.tc-grid {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 8px 0 12px;
}
.tc-weekdays {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 0 0 auto;
    padding-top: 0;
}
.tc-month-spacer,
.tc-month-label {
    display: block;
    height: 1.1em;
    font-size: 0.7em;
    line-height: 1.1em;
    color: var(--text-muted);
    white-space: nowrap;
}
.tc-weekday {
    display: flex;
    align-items: center;
    height: 16px;
    font-size: 0.68em;
    color: var(--text-muted);
}
.tc-grid-recent .tc-weekday {
    height: 22px;
}
.tc-weekday-muted {
    visibility: hidden;
}
.tc-weeks-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    padding-bottom: 4px;
}
.tc-weeks {
    display: flex;
    gap: 3px;
    width: max-content;
}
.tc-week {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 0 0 auto;
}
.tc-cell-wrap {
    display: block;
    line-height: 0;
}
.tc-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    margin: 0;
    padding: 0;
    border: 1px solid #cfcfcf;
    border-radius: 3px;
    box-sizing: border-box;
    cursor: pointer;
}
.tc-grid-recent .tc-cell {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
}
.tc-cell-future {
    cursor: default;
    opacity: 0.35;
    border-style: dashed;
}
.tc-cell-none {
    background-color: #f3f3f3;
}
.tc-cell-light {
    background-color: #d4d4d4;
}
.tc-cell-moderate {
    background-color: #9a9a9a;
    background-image: radial-gradient(#fff 0.7px, transparent 0.8px);
    background-size: 4px 4px;
}
.tc-cell-substantial {
    background-color: #5f5f5f;
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.35) 0 1px,
        transparent 1px 4px
    );
}
.tc-cell-high {
    background-color: #1c1c1c;
    box-shadow: inset 0 0 0 2px #fff;
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.28) 0 1px,
        transparent 1px 3px
    ),
    repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.2) 0 1px,
        transparent 1px 3px
    );
}
.tc-cell-mark {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: transparent;
}
.tc-cell-light .tc-cell-mark {
    background: #6b7280;
}
.tc-cell-moderate .tc-cell-mark {
    box-shadow: -3px 0 0 #fff, 3px 0 0 #fff;
    background: #fff;
}
.tc-cell-substantial .tc-cell-mark,
.tc-cell-high .tc-cell-mark {
    width: 6px;
    height: 6px;
    background: #fff;
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.tc-radio:focus-visible + .tc-cell,
.tc-cell:focus-visible {
    outline: 2px solid var(--text-dark);
    outline-offset: 1px;
}
.tc-radio:checked + .tc-cell {
    outline: 2px solid var(--text-dark);
    outline-offset: 1px;
}
.tc-cell-today {
    box-shadow: 0 0 0 1px var(--text-dark);
}
.tc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    margin: 8px 0 12px;
    font-size: 0.85em;
}
.tc-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tc-legend .tc-cell {
    cursor: default;
}
.tc-activity-list {
    margin: 0;
    padding-left: 1.1rem;
}
.tc-activity-list li {
    margin: 0 0 8px;
}
.tc-activity-title {
    display: block;
    font-weight: 600;
}
.tc-activity-meta {
    display: block;
    font-size: 0.92em;
}
.tc-year-summary {
    cursor: pointer;
    font-weight: 600;
}
.tc-trained-days {
    margin-top: 12px;
}
.tc-trained-days ul {
    margin: 8px 0 0;
    padding-left: 1.1rem;
}

@media (min-width: 800px) {
    .tc-recent-wrap {
        display: none;
    }
    .tc-year-wrap > summary {
        list-style: none;
        cursor: default;
        pointer-events: none;
    }
    .tc-year-wrap > summary::-webkit-details-marker {
        display: none;
    }
    .tc-grid-year .tc-cell {
        width: 13px;
        height: 13px;
        min-width: 13px;
        min-height: 13px;
    }
    .tc-grid-year .tc-weekday {
        height: 13px;
    }
}

@media (max-width: 900px) {
    .tc-metrics.portal-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 600px) {
    .tc-metrics.portal-metric-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 799px) {
    .tc-recent-wrap {
        display: block;
    }
    .tc-weekday-muted {
        visibility: visible;
    }
    .tc-grid-recent .tc-cell {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
    }
    .tc-grid-recent .tc-weekday {
        height: 24px;
    }
}

/* —— Roster page (MP-ROSTER-ATTENDANCE-UX-003) —— */
.roster-page {
    max-width: 100%;
    overflow-x: hidden;
}
.roster-page-heading h1 {
    margin: 0;
}
.roster-page-context {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.95em;
}
.roster-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: flex-end;
    margin: 0 0 14px;
    padding: 12px 0;
    border-bottom: 1px solid #ececec;
}
.roster-status-filters {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}
.roster-status-filter {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #d8d8d8;
    background: #f7f7f7;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
}
.roster-status-filter.is-selected,
.roster-status-filter[aria-current="page"] {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.roster-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: flex-end;
    flex: 1 1 240px;
}
.roster-search-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85em;
    color: #444;
    min-width: 10rem;
    flex: 1 1 10rem;
}
.roster-search-label input,
.roster-search-label select {
    min-height: 36px;
}
.roster-result-count {
    margin: 0 0 8px;
    color: var(--text-muted);
    font-size: 0.88em;
}
.roster-table .roster-student-name {
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
}
.roster-table .roster-student-name:hover,
.roster-table .roster-student-name:focus {
    text-decoration: underline;
}
.roster-training-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.roster-training-list li {
    margin: 0 0 2px;
}
.roster-discipline {
    font-weight: 500;
}
.roster-belt {
    color: var(--text-muted);
}
.roster-meta-muted {
    color: var(--text-muted);
}
.roster-col-finance.is-owed .roster-finance-amount {
    color: #c62828;
    font-weight: 600;
}
.roster-finance-state {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.78em;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.roster-col-finance.is-owed .roster-finance-state {
    color: #c62828;
}
.roster-empty {
    margin-top: 16px;
}

@media (max-width: 600px) {
    .roster-table tr.roster-row {
        display: block;
        margin-bottom: 14px;
        padding: 12px;
        border: 1px solid #ececec;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    }
    .roster-table td.roster-col-name {
        padding-bottom: 6px;
    }
    .roster-table td.roster-col-name::before,
    .roster-table td.roster-col-training::before {
        display: none;
    }
    .roster-table td.roster-col-training {
        padding-bottom: 6px;
    }
    .roster-table td.roster-col-joined,
    .roster-table td.roster-col-classes,
    .roster-table td.roster-col-finance {
        display: inline-block;
        margin-right: 12px;
        padding-top: 2px;
    }
    .roster-student-name {
        font-size: 1.05em;
        display: inline-block;
        min-height: 44px;
        padding: 8px 0;
        line-height: 1.3;
    }
}

/* —— Log attendance page (MP-ROSTER-ATTENDANCE-UX-003) —— */
.log-attendance-page {
    max-width: 100%;
    overflow-x: hidden;
}
.log-attendance-lead {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.95em;
}
.log-attendance-header {
    align-items: flex-start;
}
.log-attendance-section-title {
    margin: 8px 0 12px;
    font-size: 1.15em;
}
.log-attendance-candidate-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.log-attendance-candidate {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #fafafa;
}
.log-attendance-candidate.is-selected {
    border-color: var(--primary);
    background: var(--primary-tint);
}
.log-attendance-candidate-meta {
    display: inline-block;
    margin-left: 8px;
    color: var(--text-muted);
    font-size: 0.92em;
}
.log-attendance-selected-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.8em;
    font-weight: 600;
}
.log-attendance-context-top {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.log-attendance-context-top h2 {
    margin: 0;
}
.log-attendance-context-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid #d0d0d0;
    background: #fff;
    font-size: 0.78em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}
.log-attendance-context-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 10px 16px;
    margin: 0 0 8px;
}
.log-attendance-context-grid dt {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin: 0 0 2px;
}
.log-attendance-context-grid dd {
    margin: 0;
    font-weight: 600;
}
.log-attendance-fieldset {
    border: 1px solid #ececec;
    border-radius: 10px;
    padding: 14px 14px 10px;
    margin: 0 0 14px;
}
.log-attendance-fieldset legend {
    padding: 0 6px;
    font-weight: 600;
    font-size: 0.95em;
}
.log-attendance-cancelled-reason[hidden] {
    display: none !important;
}
.log-attendance-roster-header h3 {
    margin: 0 0 4px;
}
.log-attendance-select-toolbar {
    margin: 8px 0 12px;
    align-items: center;
}
.log-attendance-selected-count {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9em;
}
.log-attendance-student-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.log-attendance-student-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    background: #fff;
    min-height: 48px;
}
.log-attendance-student-row.is-selected {
    border-color: #bdbdbd;
    background: #f8f8f8;
}
.log-attendance-student-check {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin: 0;
    flex: 1 1 12rem;
    min-height: 44px;
    cursor: pointer;
    color: inherit;
}
.log-attendance-student-check input {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
}
.log-attendance-student-name {
    font-weight: 600;
}
.log-attendance-comment-input {
    flex: 1 1 12rem;
    min-width: 0;
    min-height: 40px;
}
.log-attendance-sticky-actions {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f7f7f7;
    padding: 8px 0;
    margin-bottom: 4px;
}
.class-detail-page {
    max-width: 100%;
}
.class-detail-sub {
    margin: 4px 0 0;
    color: var(--text-muted);
}
.class-detail-nav {
    margin: 0 0 14px;
}

@media (max-width: 600px) {
    .log-attendance-student-row {
        align-items: stretch;
    }
    .log-attendance-comment-input {
        width: 100%;
        flex-basis: 100%;
    }
    .log-attendance-candidate .btn-link {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
    }

/* Operations Home (dashboard) — MP-OPERATIONS-HOME-UX-002 + visual refresh */
.ops-home {
    max-width: 1100px;
}
.ops-home-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.ops-home-header h1 {
    margin: 0;
    font-size: 1.75rem;
    letter-spacing: -0.025em;
}
.ops-home-date { margin-top: 6px; }
.ops-home-section {
    margin: 22px 0 26px;
}
.ops-home-section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.ops-home-section-head h2 {
    margin: 0;
    font-size: 1.18rem;
    letter-spacing: -0.015em;
}
.ops-home-section-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ops-home .dashboard-quick-actions {
    margin-bottom: 0;
}
.ops-home .dashboard-quick-actions-secondary .dashboard-quick-action-secondary {
    min-height: 64px;
    background: transparent;
    border-color: var(--app-border);
    box-shadow: none;
}
.ops-home .dashboard-quick-actions-secondary .dashboard-quick-action-secondary:hover {
    background: var(--app-surface-muted);
}
.ops-home .dashboard-quick-action:not(.dashboard-quick-action-primary):not(.dashboard-quick-action-secondary) {
    /* Keep Log Payment / Log Class in the primary operational row visually stronger */
    font-weight: 600;
}
.ops-attention-summary {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ops-attention-summary li {
    margin: 0;
}
.ops-attention-summary a,
.ops-attention-notice-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    background: var(--app-surface);
    box-shadow: var(--app-shadow);
    text-decoration: none;
    color: inherit;
    min-height: 44px;
}
.ops-attention-summary a:hover {
    background: var(--app-accent-warm-soft);
}
.ops-attention-count {
    display: inline-block;
    font-size: 0.82em;
    font-weight: 700;
    padding: 2px 8px;
    border: 1px solid #e5d5b3;
    border-radius: 999px;
    background: var(--app-accent-warm-soft);
    color: #7a6230;
    white-space: nowrap;
}
.ops-attention-panels > .dojo-card,
.ops-attention-panel > .dojo-card {
    margin-bottom: 12px;
}
.ops-attention-panel:empty { display: none; }
.ops-home-schedule .week-calendar-card {
    margin-bottom: 12px;
}
.ops-home-events {
    margin-top: 8px;
}
.ops-home-events-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}
.ops-pulse-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.ops-pulse-item {
    padding: 16px 14px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    background: var(--app-surface);
    box-shadow: var(--app-shadow);
    text-align: left;
}
.ops-pulse-item .stat-value {
    font-size: 1.85em;
}
.ops-pulse-item:nth-child(2) .stat-value {
    color: var(--app-accent);
}
.ops-pulse-item:nth-child(3) .stat-value {
    color: var(--app-accent);
}
.ops-pulse-item-secondary {
    background: var(--app-surface);
}
.ops-pulse-item-secondary .stat-value {
    font-size: 1.55em;
    font-weight: 600;
    color: var(--app-ink);
}
.ops-home-recent-card {
    margin-bottom: 0;
}
.ops-home-recent-card .stat-hint {
    margin: 0;
}
@media (max-width: 720px) {
    .ops-pulse-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .ops-home-section {
        margin: 16px 0 18px;
    }
    .ops-home .dashboard-quick-actions-secondary .dashboard-quick-action-secondary {
        min-height: 56px;
    }
}
@media (max-width: 420px) {
    .ops-pulse-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Instructor Today refinements — MP-OPERATIONS-HOME-UX-002 */
.instructor-today-top {
    align-items: flex-start;
}
.instructor-today-top .stat-hint {
    margin-top: 4px;
}
.instructor-today-focus {
    border-color: var(--app-border);
    box-shadow: var(--app-shadow);
}
.instructor-today-phase-now {
    color: var(--text-dark, #222);
    font-weight: 700;
}
.instructor-today-phase-next {
    font-weight: 600;
}
.instructor-today-focus-title {
    margin: 0 0 2px;
    font-size: 1.35rem;
    line-height: 1.25;
}
.instructor-today-focus-actions {
    margin-top: 14px;
}
.instructor-today-log-class {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    font-weight: 600;
}
.instructor-today-roster-card .page-title-row {
    margin-bottom: 4px;
}
.instructor-today-pending-block {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border, #ececec);
}
.instructor-today-pending-block h3 {
    margin: 0;
    font-size: 1rem;
}
.instructor-today-note-secondary {
    padding: 0;
}
.instructor-today-note-secondary > summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.instructor-today-note-secondary > summary::-webkit-details-marker {
    display: none;
}
.instructor-today-note-summary-title {
    font-weight: 600;
}
.instructor-today-note-secondary[open] > summary {
    border-bottom: 1px solid var(--border, #ececec);
}
.instructor-today-note-secondary .chart-subtitle,
.instructor-today-note-secondary .instructor-today-note-form {
    padding-left: 16px;
    padding-right: 16px;
}
.instructor-today-note-secondary .instructor-today-note-form {
    padding-bottom: 16px;
}
.instructor-today-empty {
    text-align: left;
}
.checkin-status.confirmed::before,
.checkin-status.pending::before,
.checkin-status.none::before {
    content: none;
}
.instructor-today .checkin-status.confirmed,
.instructor-today .checkin-status.pending,
.instructor-today .checkin-status.none {
    font-weight: 600;
}

/* MP-STAGING-UX-POLISH-004: enrollment save, inactive banner, card actions */
.enrollment-row-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.student-enroll-discipline-card {
    margin-top: 1rem;
}
.student-enroll-discipline-form label {
    display: block;
    margin-bottom: 0.75rem;
}
.student-enroll-discipline-actions {
    margin-top: 0.5rem;
}
.student-inactive-banner {
    margin: 0.75rem 0 0.25rem;
    padding: 0.75rem 1rem;
    border: 1px solid #ef9a9a;
    background: #ffebee;
    border-radius: 8px;
}
.student-inactive-banner .btn-row {
    margin: 0.5rem 0 0;
}
.discipline-switcher {
    margin: 0.5rem 0 1rem;
}
.lifecycle-target-dojo {
    margin: 0.5rem 0 1rem;
}
.settings-timezone-now {
    margin: -0.25rem 0 0.85rem;
}
.error-not-found {
    max-width: 36rem;
}

@media (min-width: 769px) {
    tr.row-edit .btn-save-text {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .enrollment-row-actions .btn-icon-desktop,
    tr.row-edit .btn-save-icon.btn-icon-desktop {
        display: none !important;
    }
    tr.row-edit .btn-save-text {
        display: inline-flex;
        min-height: 44px;
        align-items: center;
        padding: 0.55rem 1rem;
        font-weight: 600;
    }
    .student-enroll-discipline-actions {
        position: sticky;
        bottom: 0.75rem;
        z-index: 2;
        margin-top: 0.85rem;
        padding: 0.65rem;
        background: color-mix(in srgb, var(--surface, #fff) 92%, transparent);
        border: 1px solid color-mix(in srgb, var(--border, #e2e2e2) 80%, transparent);
        border-radius: 10px;
        backdrop-filter: blur(6px);
    }
    .student-enroll-discipline-actions .btn-save-text,
    .student-enroll-discipline-actions .btn-primary {
        width: 100%;
        justify-content: center;
        min-height: 48px;
    }
    .table-actions,
    .family-child-actions {
        gap: 8px;
    }
    .table-actions .btn-sm,
    .family-child-actions .btn-sm {
        min-height: 44px;
    }
}



/* MP-PLATFORM-VISUAL-REFRESH-006 portal/progress accents */
.portal-home-card {
    border-color: var(--app-border);
}
.progress-meter,
.portal-progress-bar,
.eligibility-progress {
    background: var(--app-surface-muted);
    border-radius: 999px;
    overflow: hidden;
}
.progress-meter > *,
.portal-progress-bar > *,
.eligibility-progress > span,
.eligibility-progress-fill {
    background: var(--app-accent);
}
.rank-badge,
.belt-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--app-accent-warm-soft);
    color: #7a6230;
    border: 1px solid #e5d5b3;
    font-size: 0.82em;
    font-weight: 600;
}
.form-error,
.dashboard-notice.form-error {
    border-color: #e3b8b8;
    background: var(--app-danger-soft);
}
.dashboard-notice {
    border-color: var(--app-border);
}
.legal-setup-warning,
.emergency-setup-warning {
    border-left: 3px solid var(--app-accent-warm);
}
.sidebar .sidebar-footer-actions .nav-link {
    color: var(--app-nav-muted);
}

/* ==========================================================================
   MDHQ-APP-VISUAL-001 — Quiet Strength × Technical Fighter shell primitives
   ========================================================================== */

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1000;
    padding: 10px 14px;
    background: var(--app-surface);
    color: var(--app-ink);
    border: 2px solid var(--app-focus);
    border-radius: var(--app-radius-sm);
}
.skip-link:focus {
    left: 12px;
    top: 12px;
}

.surface-clip,
.btn-primary.surface-clip,
.dashboard-quick-action-primary,
.ops-pulse-card,
.metric-widget,
.widget-card.feature {
    clip-path: polygon(
        0 0,
        calc(100% - var(--app-clip)) 0,
        100% var(--app-clip),
        100% 100%,
        0 100%
    );
}

.page-title-band {
    position: relative;
    margin: -8px 0 20px;
    padding: 18px 20px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    overflow: hidden;
}
.page-title-band::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.07;
    background-image:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 11px,
            var(--app-graphite) 11px,
            var(--app-graphite) 12px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 11px,
            var(--app-graphite) 11px,
            var(--app-graphite) 12px
        );
}
.page-title-band > * { position: relative; z-index: 1; }
.page-title-band h1 {
    margin: 0;
    font-family: var(--app-font-display);
    font-size: clamp(1.55rem, 2.4vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--app-charcoal);
}
.page-title-band .page-title-sub {
    margin: 6px 0 0;
    color: var(--app-muted);
    font-size: 0.95em;
}

.metric-widget,
.widget-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    box-shadow: var(--app-shadow);
    padding: 16px 18px;
}
.metric-widget .metric-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--app-muted);
    font-weight: 600;
}
.metric-widget .metric-value {
    font-family: var(--app-font-display);
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--app-charcoal);
    line-height: 1.1;
    margin-top: 6px;
}
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid var(--app-border);
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--app-surface-muted);
    color: var(--app-ink);
}
.status-badge.success { background: var(--app-success-soft); color: var(--app-success); border-color: transparent; }
.status-badge.warning { background: var(--app-warning-soft); color: var(--app-warning); border-color: transparent; }
.status-badge.danger { background: var(--app-danger-soft); color: var(--app-danger); border-color: transparent; }
.status-badge.info { background: var(--app-info-soft); color: var(--app-info); border-color: transparent; }

.btn-quiet {
    background: transparent;
    border-color: transparent;
    color: var(--app-graphite);
}
.btn-quiet:hover {
    background: var(--app-surface-muted);
    border-color: var(--app-border);
}

button.btn-primary,
.btn-primary,
a.btn-primary {
    background: var(--theme-brand, var(--app-deep-red));
    border-color: var(--theme-brand, var(--app-deep-red));
    color: #fff;
}

/* Desktop collapsible sidebar */
.sidebar-brand-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 0 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 10px;
}
.sidebar .brand {
    border-bottom: none;
    margin-bottom: 0;
    padding: 4px 8px 0;
    flex: 1;
    min-width: 0;
}
.sidebar .brand-mark {
    display: block;
    font-family: var(--app-font-display);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 1.05rem;
    line-height: 1.15;
}
.sidebar .brand-dojo {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--app-nav-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-collapse-toggle {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--app-radius-sm);
    background: transparent;
    color: var(--app-nav-muted);
    cursor: pointer;
    padding: 0;
}
.sidebar-collapse-toggle:hover {
    color: var(--app-nav-ink);
    background: var(--app-nav-hover);
}
.sidebar-collapse-toggle:focus-visible {
    outline: 2px solid var(--app-focus);
    outline-offset: 2px;
}
.sidebar-collapse-toggle svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sidebar a.nav-link.active,
.sidebar button.nav-link.active {
    background: var(--app-nav-active);
    color: #fff;
    border-left: 3px solid var(--app-deep-red);
}
.sidebar-powered {
    padding: 4px 20px 10px;
    font-size: 0.68rem;
    letter-spacing: 0.02em;
    color: var(--app-nav-muted);
    opacity: 0.9;
}

.app-topbar {
    display: none;
}
.app-stage {
    min-width: 0;
}

@media (min-width: 1024px) {
    .app-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: var(--app-topbar-height);
        margin-left: var(--app-sidebar-width);
        padding: 8px 28px;
        border-bottom: 1px solid var(--app-border);
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(8px);
        position: sticky;
        top: 0;
        z-index: 30;
    }
    .app-topbar .app-topbar-tools {
        flex: 1;
        min-width: 0;
    }
    .app-topbar-context {
        min-width: 0;
        font-size: 0.92em;
        font-weight: 600;
        color: var(--app-graphite);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .app-topbar-actions {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-left: auto;
    }
    .app-topbar-actions .nav-link-icon {
        color: var(--app-graphite);
        border-radius: var(--app-radius-sm);
        min-width: 40px;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
    }
    .app-topbar-actions .nav-link-icon:hover {
        background: var(--app-surface-muted);
        color: var(--app-ink);
    }
    .app-topbar-actions .nav-link-icon.active {
        background: var(--app-accent-soft);
        color: var(--app-deep-red);
    }
    main {
        padding-top: 24px;
    }
    body.sidebar-collapsed .sidebar {
        width: var(--app-sidebar-collapsed-width);
    }
    body.sidebar-collapsed main,
    body.sidebar-collapsed .app-topbar {
        margin-left: var(--app-sidebar-collapsed-width);
    }
    body.sidebar-collapsed .sidebar .brand-mark,
    body.sidebar-collapsed .sidebar .brand-dojo,
    body.sidebar-collapsed .sidebar .chevron,
    body.sidebar-collapsed .sidebar-user,
    body.sidebar-collapsed .sidebar-user-meta,
    body.sidebar-collapsed .sidebar-powered,
    body.sidebar-collapsed .sidebar form.dojo-switcher {
        display: none !important;
    }
    body.sidebar-collapsed .sidebar a.nav-link,
    body.sidebar-collapsed .sidebar button.nav-link,
    body.sidebar-collapsed .sidebar .nav-group-primary-link {
        font-size: 0;
        line-height: 0;
        letter-spacing: 0;
    }
    body.sidebar-collapsed .sidebar a.nav-link .icon,
    body.sidebar-collapsed .sidebar button.nav-link .icon,
    body.sidebar-collapsed .sidebar .nav-group-primary-link .icon {
        font-size: 1rem;
        line-height: 1;
    }
    body.sidebar-collapsed .sidebar-brand-row {
        justify-content: center;
        padding: 0 8px 12px;
    }
    body.sidebar-collapsed .sidebar .brand {
        display: none;
    }
    body.sidebar-collapsed .sidebar a.nav-link,
    body.sidebar-collapsed .sidebar button.nav-link,
    body.sidebar-collapsed .sidebar details.nav-group summary {
        justify-content: center;
        padding-left: 10px;
        padding-right: 10px;
    }
    body.sidebar-collapsed .sidebar details.nav-group > a.nav-link {
        display: none;
    }
    body.sidebar-collapsed .sidebar-footer-actions {
        justify-content: center;
        padding-left: 8px;
        padding-right: 8px;
        flex-wrap: wrap;
    }
    body.sidebar-collapsed .sidebar-collapse-toggle .icon-collapse-expanded { display: none; }
    body.sidebar-collapsed .sidebar-collapse-toggle .icon-collapse-collapsed { display: inline; }
    .sidebar-collapse-toggle .icon-collapse-collapsed { display: none; }
    @media (min-width: 1024px) {
        main {
            max-width: min(1100px, calc(100vw - var(--app-sidebar-width) - 56px));
        }
        body.sidebar-collapsed main {
            max-width: min(1100px, calc(100vw - var(--app-sidebar-collapsed-width) - 56px));
        }
    }
}

.mobile-shortcuts {
    display: none;
}
@media (max-width: 1023px) {
    .mobile-shortcuts {
        display: flex;
        position: sticky;
        top: var(--app-topbar-height);
        z-index: 40;
        gap: 4px;
        padding: 6px 10px;
        background: var(--app-surface);
        border-bottom: 1px solid var(--app-border);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .mobile-shortcut {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-height: 44px;
        min-width: 44px;
        padding: 8px 12px;
        border-radius: var(--app-radius-sm);
        border: 1px solid var(--app-border);
        background: var(--app-surface);
        color: var(--app-graphite);
        text-decoration: none;
        font-size: 0.82rem;
        font-weight: 600;
        white-space: nowrap;
    }
    .mobile-shortcut .icon {
        display: inline-flex;
        width: 18px;
        height: 18px;
    }
    .mobile-shortcut .icon svg {
        width: 18px;
        height: 18px;
        stroke: currentColor;
        fill: none;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
    .mobile-shortcut.active {
        border-color: var(--app-deep-red);
        color: var(--app-deep-red);
        background: var(--app-accent-soft);
    }
    .sidebar-collapse-toggle { display: none; }
    .app-body { padding-bottom: env(safe-area-inset-bottom); }
}

/* Auth / onboarding media slot */
.auth-stage {
    display: grid;
    gap: 24px;
    align-items: stretch;
    max-width: 960px;
    margin: 0 auto;
}
@media (min-width: 900px) {
    .auth-stage {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
        gap: 32px;
    }
}
.auth-media-slot {
    position: relative;
    min-height: 220px;
    border: 1px dashed var(--app-border);
    border-radius: var(--app-radius-md);
    background:
        linear-gradient(145deg, rgba(143, 29, 36, 0.08), transparent 55%),
        repeating-linear-gradient(
            135deg,
            transparent,
            transparent 14px,
            rgba(32, 35, 38, 0.04) 14px,
            rgba(32, 35, 38, 0.04) 15px
        ),
        var(--app-surface-muted);
    overflow: hidden;
    clip-path: polygon(
        0 0,
        calc(100% - 14px) 0,
        100% 14px,
        100% 100%,
        0 100%
    );
}
.auth-media-slot[data-aspect="4/5"] { aspect-ratio: 4 / 5; min-height: 0; }
.auth-media-slot-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    color: var(--app-graphite);
}
.auth-media-slot-fallback strong {
    font-family: var(--app-font-display);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 1.05rem;
}
.auth-media-slot-fallback span {
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--app-muted);
}
.auth-stage .auth-card {
    margin: 0;
}
.auth-endorsement {
    margin-top: 18px;
    font-size: 0.82rem;
    color: var(--app-muted);
}
.ops-home-header h1,
.admin-stat-value,
.ops-pulse-card .ops-pulse-value {
    font-family: var(--app-font-display);
    letter-spacing: 0.02em;
}
.ops-pulse-card {
    border-top: 3px solid var(--app-deep-red);
}
.role-home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 16px 0 24px;
}

@media (max-width: 320px) {
    main { padding: 16px 12px; }
    .mobile-shortcut-label { display: none; }
}


/* MDHQ mockup shell + dashboard (wordmark only, no logo) */
.app-topbar-tools {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}
.app-topbar-dojo {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 0 1 auto;
}
.app-topbar-dojo .dojo-switcher {
    margin: 0;
}
.app-topbar-dojo .dojo-switcher select {
    min-height: 40px;
    border-radius: 999px;
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    color: var(--app-ink);
    padding: 6px 14px;
    font-weight: 600;
    max-width: 220px;
}
.app-topbar-dojo-name {
    font-weight: 700;
    color: var(--app-charcoal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-topbar-role {
    font-size: 0.82rem;
    white-space: nowrap;
}
.app-topbar-search {
    position: relative;
    flex: 1 1 280px;
    max-width: 420px;
    margin: 0 auto;
}
.app-topbar-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--app-muted);
    pointer-events: none;
}
.app-topbar-search-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.app-topbar-search input[type="search"] {
    width: 100%;
    min-height: 42px;
    border-radius: 999px;
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    padding: 8px 16px 8px 42px;
    color: var(--app-ink);
    box-shadow: var(--app-shadow);
}
.app-topbar-search input[type="search"]:focus {
    outline: 2px solid var(--app-focus);
    outline-offset: 1px;
}
.app-topbar-end {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.app-topbar-profile {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--app-graphite);
}
.app-topbar-profile:hover,
.app-topbar-profile.active {
    background: var(--app-surface-muted);
    color: var(--app-ink);
}
.app-topbar-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--app-deep-red);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.app-topbar-profile-name {
    font-size: 0.9rem;
    font-weight: 600;
}
@media (max-width: 1100px) {
    .app-topbar-profile-name { display: none; }
}
@media (min-width: 1024px) {
    .sidebar-dojo-switcher { display: none; }
    /* Icon rail: no monogram/logo — only expand control when collapsed */
    body.sidebar-collapsed .sidebar .brand-mark,
    body.sidebar-collapsed .sidebar .brand-dojo {
        display: none !important;
    }
}
@media (max-width: 1023px) {
    .app-topbar-tools { display: none; }
}

.app-shell-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 36px;
    padding: 14px 0 4px;
    border-top: 1px solid var(--app-border);
}
.app-shell-footer-tagline {
    margin: 0;
    padding-left: 12px;
    border-left: 3px solid var(--app-deep-red);
    color: var(--app-muted);
    font-size: 0.9rem;
}
.app-shell-footer-brand {
    margin: 0;
    font-family: var(--app-font-display);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--app-charcoal);
    font-size: 0.85rem;
}

.mdhq-dash-hero {
    align-items: flex-start;
}
.mdhq-dash-greeting h1 {
    font-family: var(--app-font-display);
    font-size: clamp(1.6rem, 2.4vw, 2.1rem);
    letter-spacing: 0.01em;
    margin: 0;
}
.mdhq-dash-dojo-line {
    margin: 8px 0 0;
    color: var(--app-muted);
    font-size: 0.9rem;
}
.mdhq-dash-hero-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}
.mdhq-dash-motto {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--app-charcoal);
    border-bottom: 2px solid var(--app-deep-red);
    padding-bottom: 4px;
}
.mdhq-dash-widgets {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
    margin: 8px 0 22px;
}
.mdhq-dash-card {
    grid-column: span 6;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow);
    padding: 16px 18px;
}
.mdhq-dash-card-metric {
    grid-column: span 3;
}
.mdhq-dash-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}
.mdhq-dash-card-head h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--app-charcoal);
}
.mdhq-dash-class-list,
.mdhq-dash-action-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}
.mdhq-dash-class-list li a,
.mdhq-dash-action-list li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-decoration: none;
    color: var(--app-ink);
    padding: 10px 12px;
    border-radius: var(--app-radius-md);
    border-left: 3px solid var(--app-deep-red);
    background: var(--app-surface-muted);
}
.mdhq-dash-class-list li a:hover,
.mdhq-dash-action-list li a:hover {
    background: var(--app-accent-soft);
}
.mdhq-dash-class-name {
    font-weight: 600;
}
.mdhq-dash-class-meta {
    color: var(--app-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}
.mdhq-dash-card-metric .metric-value {
    margin-top: 4px;
}
@media (max-width: 900px) {
    .mdhq-dash-card,
    .mdhq-dash-card-metric {
        grid-column: span 12;
    }
    .mdhq-dash-hero-aside {
        align-items: flex-start;
    }
}


.mdhq-dash-card-classes,
.mdhq-dash-card-actions { grid-column: span 6; }
.app-shell-footer-tagline { margin: 0; padding-left: 12px; border-left: 3px solid var(--app-deep-red); color: var(--app-muted); font-size: 0.9rem; }
.app-shell-footer-brand { margin: 0; font-family: var(--app-font-display); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--app-charcoal); font-size: 0.85rem; }
.app-topbar-dojo-name { font-weight: 700; color: var(--app-charcoal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-topbar-search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--app-muted); pointer-events: none; }
.app-topbar-search-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.app-topbar-profile-name { font-size: 0.9rem; font-weight: 600; }
.app-topbar-role { font-size: 0.82rem; white-space: nowrap; }
