﻿/* =========================
   Design Tokens
   ========================= */

:root {
    /* Typography */
    --font-display: 'Spectral', Georgia, 'Times New Roman', serif;
    --font-body: 'Nunito', system-ui, -apple-system, sans-serif;

    /* Brand colour scale (OKLCH) */
    --color-brand-950: oklch(0.18 0.07 5);
    --color-brand-900: oklch(0.25 0.10 5);
    --color-brand-700: oklch(0.38 0.11 358);
    --color-brand-600: oklch(0.50 0.13 355);
    --color-brand-400: oklch(0.64 0.13 355);
    --color-brand-200: oklch(0.88 0.05 355);
    --color-brand-100: oklch(0.93 0.03 355);
    --color-brand-50:  oklch(0.97 0.015 355);

    /* Neutral scale - tinted toward brand hue */
    --color-neutral-950: oklch(0.15 0.008 4);
    --color-neutral-800: oklch(0.27 0.006 4);
    --color-neutral-700: oklch(0.37 0.005 4);
    --color-neutral-500: oklch(0.52 0.005 4);
    --color-neutral-400: oklch(0.62 0.005 4);
    --color-neutral-300: oklch(0.76 0.006 4);
    --color-neutral-200: oklch(0.87 0.006 4);
    --color-neutral-100: oklch(0.94 0.006 4);
    --color-neutral-50:  oklch(0.97 0.005 4);

    /* Semantic aliases */
    --primary-colour:      var(--color-brand-900);
    --secondary-colour:    var(--color-brand-600);
    --background-colour:   var(--color-neutral-50);
    --surface-colour:      oklch(0.994 0.003 355);
    --surface-soft:        var(--color-brand-100);
    --offwhite:            oklch(0.985 0.008 355);
    --offwhite-dim:        oklch(0.87 0.045 355);
    --text-colour:         var(--color-neutral-950);
    --text-muted:          var(--color-neutral-500);
    --border-soft:         var(--color-neutral-200);
    --tint-soft:           var(--color-brand-50);
    --tint-soft-strong:    var(--color-brand-100);
    --focus-ring:          var(--color-brand-400);
    --nav-surface:         oklch(0.994 0.003 355 / 0.93);

    /* Status vocabulary - two accents only, used as markers/text/borders, never pastel fills */
    --ink-attention:       oklch(0.46 0.10 75);   /* ochre - needs review, in progress */
    --ink-resolved:        oklch(0.40 0.075 165); /* deep teal - approved, disbursed, positive */
    --ink-closed:          oklch(0.45 0.05 30);   /* muted clay - rejected, withdrawn */
    --ink-attention-soft:  oklch(0.46 0.10 75 / 0.08);
    --ink-resolved-soft:   oklch(0.40 0.075 165 / 0.08);
    --ink-closed-soft:     oklch(0.45 0.05 30 / 0.08);

    /* Radii */
    --radius-sm: 4px;
    --radius-md: 8px;

    /* Shadow */
    --surface-shadow: 0 2px 8px oklch(0.25 0.10 5 / 0.07), 0 1px 3px oklch(0.25 0.10 5 / 0.05);

    /* Panel / auth split-screen */
    --panel-background: var(--primary-colour);
    --panel-accent:     oklch(1 0 0 / 0.12);

    /* Footer */
    --footer-background:      var(--color-brand-950);
    --footer-text:            var(--offwhite);
    --footer-text-muted:      oklch(0.73 0.04 355);
    --footer-link:            var(--offwhite);
    --footer-link-hover:      oklch(0.88 0.06 355);
    --footer-divider-colour:  oklch(0.94 0.03 355 / 0.14);

    /* Sidebar */
    --sidebar-width: 256px;
}


/* =========================
   Base / Reset
   ========================= */

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--background-colour);
    font-family: var(--font-body);
    color: var(--text-colour);
    line-height: 1.65;
}

p {
    margin-bottom: 0;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
}


/* =========================
   Toasts
   ========================= */

.mb-toast-container {
    z-index: 1200;
}

.layout-panel .mb-toast-container,
.layout-app-shell .mb-toast-container {
    inset: 1rem 1rem auto auto !important;
}

.mb-toast {
    width: min(380px, calc(100vw - 2rem));
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    box-shadow: var(--surface-shadow);
    background: var(--surface-colour);
    color: var(--text-colour);
    overflow: hidden;
}

.mb-toast-header {
    border-bottom: 1px solid var(--border-soft);
    background: var(--surface-colour);
    color: var(--text-muted);
    font-size: .78rem;
    font-family: var(--font-body);
}

.mb-toast-header strong {
    color: var(--primary-colour);
    font-size: .82rem;
    font-family: var(--font-body);
}

.mb-toast-body {
    font-size: .95rem;
    line-height: 1.5;
    padding: .85rem 1rem;
}

.mb-toast-success {
    border-color: oklch(0.87 0.09 160);
    background: oklch(0.98 0.02 160);
}

.mb-toast-info {
    border-color: var(--color-brand-200);
    background: var(--color-brand-50);
}

.mb-toast-warning {
    border-color: oklch(0.87 0.09 80);
    background: oklch(0.98 0.02 80);
}

.mb-toast-error {
    border-color: oklch(0.87 0.09 25);
    background: oklch(0.98 0.02 25);
}

@media (max-width: 575.98px) {
    .mb-toast-container {
        inset: 0 auto auto 0 !important;
        padding: .75rem !important;
        width: 100%;
    }

    .mb-toast {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .layout-panel .mb-toast-container {
        inset: .75rem .75rem auto .75rem !important;
    }

    .layout-panel .mb-toast {
        width: 100%;
    }
}


/* =========================
   Brand Elements
   ========================= */

.wordmark {
    text-decoration: none;
    font-size: 1.15rem;
    font-family: var(--font-display);
    letter-spacing: -0.01em;
}

.wordmark .wm-my {
    font-weight: 400;
    font-style: italic;
    color: var(--primary-colour);
}

.wordmark .wm-b {
    font-weight: 700;
    color: var(--secondary-colour);
}

.wordmark-inv .wm-my {
    color: var(--offwhite);
}

.wordmark-inv .wm-b {
    color: oklch(0.98 0.005 355);
}


/* =========================
   Buttons
   ========================= */

.btn.mb-btn {
    background-color: var(--primary-colour);
    color: oklch(0.98 0.005 355);
    border-color: var(--primary-colour);
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 600;
}

.btn.mb-btn:hover {
    background-color: var(--secondary-colour);
    border-color: var(--secondary-colour);
}

.btn.mb-btn-outline {
    background-color: transparent;
    border-color: var(--primary-colour);
    color: var(--primary-colour);
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 600;
}

.btn.mb-btn-outline:hover {
    background-color: var(--primary-colour);
    color: oklch(0.98 0.005 355);
    border-color: var(--primary-colour);
}

.btn.mb-btn-invert {
    background-color: var(--secondary-colour);
    color: oklch(0.98 0.005 355);
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 600;
}

.btn.mb-btn-invert:hover {
    background-color: var(--primary-colour);
    color: oklch(0.98 0.005 355);
}

.btn.mb-btn-invert-dull {
    background-color: transparent;
    border-color: var(--color-brand-200);
    color: var(--offwhite);
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 600;
}

.btn.mb-btn-invert-dull:hover {
    background-color: oklch(0.98 0.005 355);
    color: var(--primary-colour);
    border-color: oklch(0.98 0.005 355);
}


/* =========================
   Navigation
   ========================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-nav {
    border-bottom: 1px solid var(--border-soft);
    box-shadow: 0 1px 6px oklch(0.25 0.10 5 / 0.06);
    background: var(--nav-surface);
    backdrop-filter: blur(8px);
}

.nav-inner {
    display: flex;
    align-items: center;
    min-height: 62px;
    gap: 1.5rem;
}

.nav-top-row {
    display: flex;
    align-items: center;
    min-height: 62px;
    gap: 1.5rem;
    min-width: 0;
}

.nav-menu {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

@media (min-width: 992px) {
    .nav-menu {
        display: flex;
        align-items: center;
        flex: 1;
    }
}

.nav-links {
    list-style: none;
    align-items: center;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-links a {
    display: block;
    padding: .4rem .75rem;
    color: var(--text-colour);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background-color .2s, color .2s;
    font-size: .9rem;
    font-weight: 500;
    font-family: var(--font-body);
}

.nav-links a:hover {
    background: var(--tint-soft-strong);
    color: var(--primary-colour);
}

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.nav-toggle {
    background: none;
    border: 1px solid var(--border-soft);
    color: var(--primary-colour);
    padding: .3rem .55rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.nav-toggle:focus {
    box-shadow: none;
}

.nav-toggle i {
    font-size: 1.2rem;
    line-height: 1;
}


/* =========================
   Shared Sections
   ========================= */

.section {
    padding: 5rem 0;
    background: var(--surface-colour);
}

.section-alt {
    background: var(--color-brand-700);
}

.section-dark {
    background: var(--color-brand-950);
}

.s-label {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: .9rem;
    color: var(--secondary-colour);
    font-family: var(--font-body);
}

.s-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.75vw, 3.25rem);
    color: var(--primary-colour);
    letter-spacing: -0.03em;
    font-weight: 600;
    line-height: 1.1;
}

.s-title em {
    font-style: italic;
    color: var(--secondary-colour);
}


/* =========================
   Panel Layout (Auth)
   ========================= */

.panel-container {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 3fr 2fr;
}

.panel-aside {
    background: var(--panel-background);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem 3rem;
    position: relative;
    overflow: hidden;
}

.panel-aside::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at -10% 110%, var(--panel-accent), transparent 55%),
        radial-gradient(ellipse 50% 40% at 110% -10%, var(--panel-accent), transparent 55%);
}

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

.panel-aside-inst-logo {
    max-height: 52px;
    max-width: 180px;
    width: auto;
    object-fit: contain;
    background: var(--offwhite);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
}

.panel-aside-inst-name {
    display: block;
    color: oklch(1 0 0 / 0.75);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-top: 0.5rem;
}

.panel-mobile-inst-logo {
    max-height: 36px;
    max-width: 140px;
    width: auto;
    object-fit: contain;
}

.panel-tagline {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.5vw, 3.25rem);
    font-weight: 600;
    font-style: italic;
    color: var(--offwhite);
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 3rem 0 1rem;
}

.panel-tagline em {
    font-style: normal;
    color: oklch(1 0 0 / 0.82);
}

.panel-aside p {
    color: oklch(1 0 0 / 0.70);
    font-size: .9rem;
    line-height: 1.75;
    max-width: 360px;
    margin: 0;
}

.panel-trust {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    position: relative;
    z-index: 1;
}

.panel-trust-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .82rem;
    color: oklch(1 0 0 / 0.55);
}

.main-panel {
    background: var(--surface-colour);
    padding: 2.5rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.panel-form-shell {
    width: min(100%, 520px);
}

.panel-form-card {
    background: var(--surface-colour);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    box-shadow: var(--surface-shadow);
    padding: 2rem;
}

.auth-heading {
    font-family: var(--font-display);
    color: var(--primary-colour);
    margin: 0 0 .5rem;
    letter-spacing: -0.02em;
}

.auth-meta {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    font-size: .92rem;
}

.auth-form .form-control,
.auth-form .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--border-soft);
    padding: .7rem .9rem;
    font-family: var(--font-body);
    font-size: .92rem;
}

.auth-form .form-control:focus,
.auth-form .form-select:focus {
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 .22rem oklch(0.64 0.13 355 / 0.18);
}

.auth-form .alert {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    box-shadow: none;
    padding: .65rem .9rem;
    margin-bottom: 1rem;
    font-size: .9rem;
}

.auth-form .alert-danger,
.auth-form .alert-error {
    border-color: oklch(0.45 0.05 30 / 0.3);
    background: var(--ink-closed-soft);
    color: var(--ink-closed);
}

.auth-form .alert-warning {
    border-color: oklch(0.46 0.10 75 / 0.3);
    background: var(--ink-attention-soft);
    color: var(--ink-attention);
}

.auth-form .errorlist,
.auth-form .errorlist.nonfield {
    list-style: none;
    margin: .35rem 0 .75rem;
    padding: 0;
}

.auth-form .errorlist li {
    margin: 0;
    padding: .2rem 0;
    color: var(--ink-closed);
    font-size: .88rem;
}

/* MFA / allauth generic element styling */
.panel-form-shell.auth-form h1 {
    font-family: var(--font-display);
    color: var(--primary-colour);
    margin: 0 0 .65rem;
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    letter-spacing: -0.02em;
}

.panel-form-shell.auth-form h2 {
    font-family: var(--font-display);
    color: var(--primary-colour);
    margin: 0 0 .55rem;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.panel-form-shell.auth-form p {
    color: var(--text-muted);
    margin: 0 0 .9rem;
}

.panel-form-shell.auth-form hr {
    border-color: var(--border-soft);
    opacity: 1;
    margin: 1rem 0;
}

.panel-form-shell.auth-form form {
    margin: .75rem 0 1rem;
}

.panel-form-shell.auth-form form p {
    margin-bottom: .8rem;
}

.panel-form-shell.auth-form label {
    display: block;
    margin-bottom: .3rem;
    color: var(--text-colour);
    font-weight: 600;
    font-size: .88rem;
    font-family: var(--font-body);
}

.panel-form-shell.auth-form input,
.panel-form-shell.auth-form textarea,
.panel-form-shell.auth-form select {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    padding: .7rem .85rem;
    color: var(--text-colour);
    background: var(--surface-colour);
    font-family: var(--font-body);
    font-size: .92rem;
}

.panel-form-shell.auth-form input:focus,
.panel-form-shell.auth-form textarea:focus,
.panel-form-shell.auth-form select:focus {
    outline: none;
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 .22rem oklch(0.64 0.13 355 / 0.18);
}

.panel-form-shell.auth-form button,
.panel-form-shell.auth-form a[role="button"],
.panel-form-shell.auth-form a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    background: var(--primary-colour);
    color: oklch(0.98 0.005 355);
    border: 1px solid var(--primary-colour);
    border-radius: var(--radius-sm);
    padding: .55rem .9rem;
    text-decoration: none;
    font-weight: 600;
    font-family: var(--font-body);
    line-height: 1.2;
    margin-right: .45rem;
    margin-bottom: .45rem;
}

.panel-form-shell.auth-form button:hover,
.panel-form-shell.auth-form a[role="button"]:hover,
.panel-form-shell.auth-form a.button:hover {
    background: var(--secondary-colour);
    border-color: var(--secondary-colour);
}

.panel-form-shell.auth-form section {
    background: var(--surface-colour);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    box-shadow: var(--surface-shadow);
    padding: 1rem;
    margin-bottom: .9rem;
}

.panel-form-shell.auth-form section ul {
    list-style: none;
    padding: 0;
    margin: .6rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.panel-form-shell.auth-form section ul li {
    margin: 0;
}

.panel-form-links {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: .88rem;
}

.panel-form-links a {
    color: var(--primary-colour);
    font-weight: 600;
    text-decoration: none;
}

.panel-form-links a:hover {
    color: var(--secondary-colour);
    text-decoration: underline;
}


/* =========================
   Footer
   ========================= */

.site-footer {
    background: var(--footer-background);
    padding: 2.5rem 0 1.5rem;
    color: var(--footer-text);
}

.footer-main-row {
    align-items: start;
}

.footer-brand-copy {
    margin-top: .9rem;
    max-width: 34ch;
    font-size: .88rem;
    line-height: 1.7;
}

.footer-heading {
    margin: 0 0 .85rem;
    font-size: .7rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--offwhite);
    font-family: var(--font-body);
}

.footer-link-list {
    margin: 0;
    font-size: .88rem;
    list-style: none;
}

.footer-link-list li + li {
    margin-top: .3rem;
}

.site-footer a {
    color: var(--footer-link);
    text-decoration: none;
    transition: color .2s ease;
}

.site-footer a:hover {
    color: var(--footer-link-hover);
}

.site-footer a:focus-visible {
    outline-color: var(--footer-link-hover);
}

.footer-divider {
    margin: 1.5rem 0 1.1rem;
    border: 0;
    border-top: 1px solid var(--footer-divider-colour);
    opacity: 1;
}

.footer-legal {
    font-size: .75rem;
    line-height: 1.6;
    color: var(--footer-text-muted);
}

.footer-bottom-row {
    row-gap: .6rem;
}

.footer-email-link {
    color: var(--footer-text);
    font-weight: 600;
}


/* =========================
   Application Views
   ========================= */

.app-page {
    background: var(--background-colour);
    min-height: calc(100vh - 60px);
}

/* Page header - architectural zone, full bleed within app-main */
.app-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: -2.5rem -2.5rem 2.5rem;
    padding: 2rem 2.5rem 1.75rem;
    background: var(--surface-colour);
    border-bottom: 1px solid var(--border-soft);
}

.app-page-header-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .25rem;
}

/* Horizontally-scrollable tab nav - prevents wrapping on narrow screens */
.app-tab-nav-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Bleed to card/container edges on mobile so scroll hint is visible */
    margin-bottom: 1.5rem;
}
.app-tab-nav-wrap .nav-tabs {
    flex-wrap: nowrap;
    min-width: max-content;
    border-bottom: 1px solid var(--border-soft);
}

.app-page-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 2.5vw, 2.25rem);
    font-weight: 600;
    color: var(--primary-colour);
    letter-spacing: -0.03em;
    margin: 0;
    line-height: 1.15;
}

.app-page-subtitle {
    color: var(--text-muted);
    font-size: .92rem;
    margin-top: .25rem;
    margin-bottom: 0;
}

.app-breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: .82rem;
    transition: color .15s;
    margin-bottom: .3rem;
}

.app-breadcrumb-link:hover {
    color: var(--primary-colour);
}

/* Cards */
.app-card {
    background: var(--surface-colour);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    box-shadow: var(--surface-shadow);
    overflow: hidden;
}

.app-card--info {
    background: var(--tint-soft);
    box-shadow: none;
}

.app-card--warning {
    background: var(--ink-attention-soft);
    border-color: oklch(0.46 0.10 75 / 0.3);
    box-shadow: none;
}

.app-card-header {
    padding: .8rem 1.5rem;
    border-bottom: 1px solid var(--border-soft);
    background: var(--color-neutral-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.app-card-title {
    font-family: var(--font-display);
    font-size: .95rem;
    font-weight: 600;
    color: var(--primary-colour);
    margin: 0;
    display: flex;
    align-items: center;
    gap: .45rem;
}

.app-card-body {
    padding: 1.25rem 1.5rem;
}

.app-card-body.p-0 {
    padding: 0;
}

.app-hero-card {
    padding: 2rem;
}

/* Buttons */
.app-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    font-weight: 600;
    font-family: var(--font-body);
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, transform .1s ease-out;
    line-height: 1.3;
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

.app-btn:hover {
    transform: translateY(-1px);
}

.app-btn:active {
    transform: none;
}

.app-btn-primary {
    background: var(--primary-colour);
    color: oklch(0.98 0.005 355);
    border-color: var(--primary-colour);
}

.app-btn-primary:hover {
    background: var(--secondary-colour);
    border-color: var(--secondary-colour);
    color: oklch(0.98 0.005 355);
}

.app-btn-secondary {
    background: var(--tint-soft);
    color: var(--primary-colour);
    border-color: var(--border-soft);
}

.app-btn-secondary:hover {
    background: var(--tint-soft-strong);
    color: var(--primary-colour);
}

.app-btn-outline {
    background: transparent;
    color: var(--primary-colour);
    border-color: var(--border-soft);
}

.app-btn-outline:hover {
    background: var(--tint-soft);
    color: var(--primary-colour);
}

.app-btn-danger {
    background: oklch(0.40 0.13 25);
    color: oklch(0.98 0.01 25);
    border-color: oklch(0.40 0.13 25);
}

.app-btn-danger:hover {
    background: oklch(0.33 0.13 25);
    border-color: oklch(0.33 0.13 25);
    color: oklch(0.98 0.01 25);
}

.app-btn-danger-outline {
    background: transparent;
    color: oklch(0.40 0.13 25);
    border-color: oklch(0.78 0.09 25);
}

.app-btn-danger-outline:hover {
    background: oklch(0.97 0.02 25);
    border-color: oklch(0.40 0.13 25);
}

.app-btn-warning {
    background: var(--ink-attention);
    color: oklch(0.99 0.01 95);
    border-color: var(--ink-attention);
}

.app-btn-warning:hover {
    background: oklch(0.40 0.10 75);
    border-color: oklch(0.40 0.10 75);
    color: oklch(0.99 0.01 95);
}

.app-btn-sm {
    padding: .28rem .65rem;
    font-size: .8rem;
}

/* Badges */
.app-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .18rem .55rem;
    border-radius: 999px;
    font-size: .73rem;
    font-weight: 600;
    font-family: var(--font-body);
    line-height: 1.4;
    letter-spacing: .02em;
    white-space: nowrap;
}

.app-badge-success {
    background: var(--ink-resolved-soft);
    color: var(--ink-resolved);
}

.app-badge-danger {
    background: var(--ink-closed-soft);
    color: var(--ink-closed);
}

.app-badge-warning {
    background: var(--ink-attention-soft);
    color: var(--ink-attention);
}

.app-badge-info {
    background: var(--color-neutral-100);
    color: var(--text-muted);
}

.app-badge-secondary {
    background: var(--color-neutral-100);
    color: var(--text-muted);
}

/* Definition list */
.app-dl {
    display: grid;
    grid-template-columns: minmax(160px, auto) 1fr;
    gap: .6rem 1.25rem;
    margin: 0;
}

.app-dl dt {
    font-weight: 600;
    font-size: .85rem;
    color: var(--text-muted);
    padding-top: .05rem;
    font-family: var(--font-body);
}

.app-dl dd {
    margin: 0;
    font-size: .9rem;
    color: var(--text-colour);
}

/* Alerts */
.app-alert {
    padding: .8rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    font-size: .9rem;
    line-height: 1.55;
}

.app-alert--danger {
    background: var(--ink-closed-soft);
    border-color: oklch(0.45 0.05 30 / 0.3);
    color: var(--ink-closed);
}

.app-alert--info {
    background: var(--tint-soft);
    border-color: var(--border-soft);
    color: var(--text-colour);
}

.app-alert--warning {
    background: var(--ink-attention-soft);
    border-color: oklch(0.46 0.10 75 / 0.3);
    color: var(--ink-attention);
}

.app-alert--success {
    background: var(--ink-resolved-soft);
    border-color: oklch(0.40 0.075 165 / 0.3);
    color: var(--ink-resolved);
}

/* Links */
.app-link {
    color: var(--primary-colour);
    text-decoration: none;
    font-weight: 600;
}

.app-link:hover {
    color: var(--secondary-colour);
    text-decoration: underline;
}

/* Empty state */
.app-empty-icon {
    font-size: 2rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: .75rem;
}

/* Stats */
.app-title {
    font-family: var(--font-display);
    color: var(--primary-colour);
    letter-spacing: -0.02em;
    margin: 0;
}

.app-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
    margin-top: .75rem;
}

.app-subtitle-sm {
    font-size: .92rem;
}

.app-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    margin: 1rem 0 1.5rem;
}

.app-meta {
    color: var(--text-muted);
    font-size: .88rem;
}

.app-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .38rem .8rem;
    font-size: .8rem;
    font-weight: 700;
    font-family: var(--font-body);
    letter-spacing: .02em;
}

.app-pill-warning {
    background: var(--ink-attention-soft);
    color: var(--ink-attention);
}

.app-pill-success {
    background: var(--ink-resolved-soft);
    color: var(--ink-resolved);
}

.app-stat-grid {
    margin-top: .25rem;
}

.app-stat-card {
    background: var(--tint-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.app-stat-card--info,
.app-stat-card--warning,
.app-stat-card--success,
.app-stat-card--danger {
    background: var(--surface-colour);
    border-color: var(--border-soft);
}

.app-stat-card--info .app-stat-label,
.app-stat-card--warning .app-stat-label,
.app-stat-card--success .app-stat-label,
.app-stat-card--danger .app-stat-label {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

.app-stat-card--info .app-stat-label::before,
.app-stat-card--warning .app-stat-label::before,
.app-stat-card--success .app-stat-label::before,
.app-stat-card--danger .app-stat-label::before {
    content: '';
    display: inline-block;
    width: .4rem;
    height: .4rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.app-stat-card--info .app-stat-label::before    { background: var(--color-neutral-400); }
.app-stat-card--warning .app-stat-label::before { background: var(--ink-attention); }
.app-stat-card--success .app-stat-label::before { background: var(--ink-resolved); }
.app-stat-card--danger .app-stat-label::before  { background: var(--ink-closed); }

.app-stat-card--action {
    background: var(--surface-colour);
    border-color: var(--border-soft);
    transition: border-color .15s, background .15s;
    text-decoration: none;
    cursor: pointer;
}

.app-stat-card--action:hover {
    background: var(--tint-soft);
    border-color: var(--color-brand-200);
}

.app-stat-card--action i {
    color: var(--primary-colour);
}

.app-stat-card--action .app-stat-label {
    color: var(--text-muted);
}

.app-stat-card--action .app-stat-value {
    color: var(--primary-colour);
}

.app-stat-value {
    font-family: var(--font-display);
    color: var(--text-colour);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: .25rem;
    letter-spacing: -0.01em;
}

.app-stat-label {
    color: var(--text-muted);
    font-size: .88rem;
}

.app-section-title {
    font-family: var(--font-display);
    color: var(--primary-colour);
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

/* Timeline */
.app-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.app-timeline li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .9rem;
}

.app-timeline-marker {
    width: .65rem;
    height: .65rem;
    margin-top: .5rem;
    border-radius: 50%;
    background: var(--secondary-colour);
    box-shadow: 0 0 0 5px oklch(0.50 0.13 355 / 0.14);
}

.app-timeline-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .25rem;
}

.app-timeline-title-row h3 {
    font-family: var(--font-display);
    color: var(--primary-colour);
    font-size: 1rem;
    margin: 0;
    font-weight: 600;
}

.app-timeline p,
.app-activity-list li,
.app-list span {
    color: var(--text-muted);
}

/* ── Application progress tracker ── */

.app-progress-track {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    padding: .25rem 0 .5rem;
    scrollbar-width: none;
}

.app-progress-track::-webkit-scrollbar { display: none; }

.app-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    flex-shrink: 0;
    min-width: 72px;
}

.app-progress-step-indicator {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--color-neutral-300);
    background: var(--surface-colour);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    color: var(--color-neutral-400);
    transition: border-color .2s, background .2s, color .2s;
}

.app-progress-step.is-done .app-progress-step-indicator {
    border-color: var(--secondary-colour);
    background: var(--secondary-colour);
    color: #fff;
}

.app-progress-step.is-active .app-progress-step-indicator {
    border-color: var(--primary-colour);
    background: var(--primary-colour);
    color: #fff;
    box-shadow: 0 0 0 3px oklch(0.25 0.10 5 / 0.12);
}

.app-progress-step-label {
    font-size: .65rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-muted);
    line-height: 1.2;
    max-width: 72px;
}

.app-progress-step.is-done .app-progress-step-label,
.app-progress-step.is-active .app-progress-step-label {
    color: var(--text-colour);
}

.app-progress-connector {
    flex: 1;
    height: 2px;
    background: var(--color-neutral-200);
    min-width: 16px;
    margin-bottom: 1.4rem;
    transition: background .2s;
    flex-shrink: 1;
}

.app-progress-connector.is-done {
    background: var(--secondary-colour);
}

.app-list,
.app-activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.app-list li {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
}

.app-list i {
    color: var(--secondary-colour);
    margin-top: .15rem;
}

/* Table */
.app-table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-colour);
    --bs-table-border-color: var(--border-soft);
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: .88rem;
}

/* Responsive scroll shell - wraps every app-table that lives inside a p-0 card body */
.app-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.app-table thead th {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    background: var(--color-neutral-100);
    border-bottom: 1px solid var(--border-soft);
    padding: .65rem 1rem;
    font-family: var(--font-body);
}

.app-table td {
    padding: .8rem 1rem;
    vertical-align: middle;
}

.app-support-note {
    color: var(--text-muted);
    font-size: .88rem;
}

/* Form fields */
.app-main .form-control,
.app-main .form-select {
    border-color: var(--border-soft);
    border-radius: var(--radius-sm);
    color: var(--text-colour);
    font-size: .9rem;
    font-family: var(--font-body);
    background-color: var(--surface-colour);
    padding: .55rem .85rem;
    min-width: 9rem;
}

.app-main .form-select-sm {
    min-width: 9rem;
    font-size: .875rem;
    padding: .35rem 2.25rem .35rem .65rem;
}

.app-main .form-control:focus,
.app-main .form-select:focus {
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 .2rem oklch(0.64 0.13 355 / 0.18);
    outline: none;
}

.app-main .form-control::placeholder {
    color: var(--text-muted);
    opacity: .7;
}

.app-main .form-label {
    font-weight: 600;
    font-size: .85rem;
    color: var(--text-colour);
    margin-bottom: .3rem;
    font-family: var(--font-body);
}

.app-main .form-text {
    font-size: .78rem;
    color: var(--text-muted);
}

.app-main .form-check-input {
    border-color: var(--border-soft);
    margin-top: .2rem;
}

.app-main .form-check-input:checked {
    background-color: var(--primary-colour);
    border-color: var(--primary-colour);
}

.app-main .form-check-input:focus {
    box-shadow: 0 0 0 .2rem oklch(0.64 0.13 355 / 0.18);
    border-color: var(--focus-ring);
}

.app-main .invalid-feedback {
    font-size: .8rem;
}

.app-main .input-group-text {
    background: var(--tint-soft);
    border-color: var(--border-soft);
    color: var(--text-muted);
    font-size: .88rem;
}

/* Cost total */
.app-cost-total {
    background: var(--tint-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: .75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-cost-total-label {
    font-weight: 600;
    color: var(--text-colour);
    font-size: .9rem;
}

.app-cost-total-value {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--primary-colour);
    font-size: 1.05rem;
}

/* Step indicator */
.app-steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: .25rem;
}

.app-step {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}

.app-step-num {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 700;
    font-family: var(--font-body);
    background: var(--tint-soft);
    color: var(--text-muted);
    border: 1.5px solid var(--border-soft);
    flex-shrink: 0;
}

.app-step.is-active .app-step-num {
    background: var(--primary-colour);
    color: oklch(0.98 0.005 355);
    border-color: var(--primary-colour);
}

.app-step.is-done .app-step-num {
    background: var(--ink-resolved-soft);
    color: var(--ink-resolved);
    border-color: oklch(0.40 0.075 165 / 0.3);
}

.app-step-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    font-family: var(--font-body);
}

.app-step.is-active .app-step-label {
    color: var(--primary-colour);
}

.app-step-divider {
    flex: 1 1 1.5rem;
    height: 1px;
    background: var(--border-soft);
    margin: 0 .35rem;
    flex-shrink: 0;
    min-width: 1rem;
    max-width: 3rem;
}

/* Document checklist */
.app-doc-checklist {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.app-doc-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .65rem .85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background: var(--surface-colour);
}

.app-doc-item.is-uploaded {
    background: var(--ink-resolved-soft);
    border-color: oklch(0.40 0.075 165 / 0.3);
}

.app-doc-item-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: .05rem;
}

.app-doc-item.is-uploaded .app-doc-item-icon {
    color: var(--ink-resolved);
}

.app-doc-item:not(.is-uploaded) .app-doc-item-icon {
    color: var(--text-muted);
}

.app-doc-item-body {
    flex: 1;
    min-width: 0;
}

.app-doc-item-title {
    font-weight: 600;
    font-size: .88rem;
    color: var(--text-colour);
    margin: 0;
}

.app-doc-item-hint {
    font-size: .78rem;
    color: var(--text-muted);
    margin: 0;
}

.app-support-note a {
    color: var(--primary-colour);
    font-weight: 600;
    text-decoration: none;
}

/* Badge size variant */
.app-badge--lg {
    font-size: .82rem;
    padding: .32rem .75rem;
}

/* Decision outcome card variants */
.app-card--outcome-approved {
    border-color: oklch(0.40 0.075 165 / 0.35);
    background: var(--ink-resolved-soft);
}

.app-card--outcome-rejected {
    border-color: oklch(0.45 0.05 30 / 0.35);
    background: var(--ink-closed-soft);
}

/* Amount awarded emphasis */
.app-amount-awarded {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--ink-resolved);
}

/* Subsection heading (within card body) */
.app-subsection-heading {
    font-family: var(--font-body);
    font-size: .85rem;
    font-weight: 700;
    color: var(--primary-colour);
    margin: 1rem 0 .5rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}

/* Cost breakdown table */
.app-costs-table {
    width: 100%;
    font-size: .88rem;
    border-collapse: collapse;
    margin-bottom: 0;
}

.app-costs-table td {
    padding: .3rem 0;
    vertical-align: top;
}

.app-costs-table td:last-child {
    text-align: right;
    font-weight: 600;
    padding-left: 1rem;
    white-space: nowrap;
}

.app-costs-table td:first-child {
    color: var(--text-muted);
}

.app-costs-table-total td {
    border-top: 1px solid var(--border-soft);
    padding-top: .6rem;
    margin-top: .3rem;
    font-weight: 700;
    color: var(--primary-colour);
}

.app-costs-table-total td:first-child {
    color: var(--primary-colour);
}

/* Document filename - long strings */
.app-doc-filename {
    word-break: break-all;
    font-size: .8rem;
    color: var(--text-muted);
    display: block;
}

/* Pagination */
.app-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.app-pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 .65rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background: var(--surface-colour);
    color: var(--text-colour);
    font-size: .88rem;
    font-family: var(--font-body);
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
    line-height: 1;
}

.app-pagination .page-link:hover {
    background: var(--tint-soft-strong);
    border-color: var(--color-brand-200);
    color: var(--primary-colour);
}

.app-pagination .page-item.active .page-link {
    background: var(--primary-colour);
    border-color: var(--primary-colour);
    color: oklch(0.98 0.005 355);
}

.app-pagination .page-item.disabled .page-link {
    color: var(--text-muted);
    background: var(--color-neutral-100);
    border-color: var(--border-soft);
    cursor: default;
    pointer-events: none;
}

/* Bursary type selection card */
.bursary-type-card {
    cursor: pointer;
    transition: background .15s, border-color .15s;
    border-radius: var(--radius-sm);
}

/* Application form section headings */
.app-form-section-heading {
    font-family: var(--font-body);
    font-size: .9rem;
    font-weight: 700;
    color: var(--primary-colour);
    margin-bottom: .4rem;
    display: flex;
    align-items: center;
    gap: .35rem;
    line-height: 1.4;
}

/* Soft HR divider */
hr.app-hr-soft {
    border-top-color: var(--border-soft);
    opacity: 1;
}

/* Narrow input group - constrained on desktop, full-width on mobile */
.app-input-narrow {
    max-width: 200px;
}

/* Income section panel */
.app-income-section {
    background: var(--tint-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
}

/* Income running total row */
.app-running-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem .25rem;
    border-top: 1px solid var(--border-soft);
    margin-top: .25rem;
}

.app-running-total-label {
    font-weight: 600;
    font-size: .85rem;
    color: var(--primary-colour);
    display: flex;
    align-items: center;
    gap: .35rem;
}

.app-running-total-value {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--primary-colour);
    letter-spacing: -0.01em;
}

/* Income builder table */
.app-income-table {
    font-size: .88rem;
}

.app-income-table thead th {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    background: var(--color-neutral-100);
    border-bottom: 1px solid var(--border-soft);
}

/* Sticky info card (for xl sidebar panels) */
.app-card--sticky {
    position: sticky;
    top: 1.5rem;
}

/* Step list in info panels */
.app-list-steps {
    padding-left: 1.25rem;
    font-size: .9rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin: 0;
}

@media (max-width: 575.98px) {
    .app-input-narrow {
        max-width: 100%;
    }
}

.app-demo-banner {
    margin-bottom: 1rem;
    background: var(--tint-soft);
    border: 1px solid var(--border-soft);
    color: var(--primary-colour);
    border-radius: var(--radius-md);
    padding: .8rem 1rem;
    font-weight: 600;
    font-size: .92rem;
}

.nav-user-chip {
    display: inline-flex;
    align-items: center;
    padding: .4rem .75rem;
    border-radius: 999px;
    background: var(--tint-soft);
    color: var(--primary-colour);
    font-weight: 600;
    font-size: .88rem;
    font-family: var(--font-body);
}


/* =========================
   App Shell / Sidebar Layout
   ========================= */

.app-shell {
    display: flex;
    min-height: 100dvh;
}

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--primary-colour);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: oklch(1 0 0 / 0.15) transparent;
    z-index: 100;
}

.app-sidebar-header {
    padding: 1.5rem 1.25rem 1.15rem;
    border-bottom: 1px solid oklch(1 0 0 / 0.12);
    flex-shrink: 0;
}

.app-sidebar-logo {
    display: block;
    max-height: 44px;
    max-width: 180px;
    object-fit: contain;
}

.app-sidebar-inst-name {
    display: block;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: oklch(1 0 0 / 0.45);
    margin-top: .6rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-body);
}

.app-sidebar-nav {
    flex: 1;
    padding: .85rem .75rem;
    display: flex;
    flex-direction: column;
    gap: .1rem;
    overflow-y: auto;
}

.app-sidebar-section-label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: oklch(1 0 0 / 0.55);
    padding: .95rem .5rem .3rem;
    font-family: var(--font-body);
}

.app-sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .52rem .75rem;
    border-radius: var(--radius-sm);
    color: oklch(1 0 0 / 0.68);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 500;
    font-family: var(--font-body);
    transition: background .15s, color .15s;
}

.app-sidebar-nav-link i {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
    opacity: .75;
}

.app-sidebar-nav-link:hover {
    background: oklch(1 0 0 / 0.1);
    color: oklch(1 0 0);
}

.app-sidebar-nav-link:hover i {
    opacity: 1;
}

.app-sidebar-nav-link.is-active {
    background: var(--background-colour);
    color: var(--primary-colour);
    font-weight: 700;
}

.app-sidebar-nav-link.is-active i {
    opacity: 1;
}

.app-sidebar-footer {
    padding: .85rem .75rem;
    border-top: 1px solid oklch(1 0 0 / 0.12);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.app-sidebar-user {
    padding: .1rem .5rem;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.app-sidebar-user-name {
    font-size: .86rem;
    font-weight: 600;
    color: oklch(1 0 0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-body);
}

.app-sidebar-user-role {
    font-size: .72rem;
    color: oklch(1 0 0 / 0.48);
    font-family: var(--font-body);
}

.app-sidebar-logout {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .48rem .75rem;
    border-radius: var(--radius-sm);
    color: oklch(1 0 0 / 0.55);
    text-decoration: none;
    font-size: .85rem;
    font-family: var(--font-body);
    transition: background .15s, color .15s;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.app-sidebar-logout:hover {
    background: oklch(1 0 0 / 0.1);
    color: oklch(1 0 0);
}

/* App body */
.app-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--background-colour);
}

/* Mobile top bar */
.app-topbar {
    height: 56px;
    background: var(--surface-colour);
    border-bottom: 1px solid var(--border-soft);
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 4px oklch(0.25 0.10 5 / 0.05);
}

.app-topbar-logo {
    max-height: 28px;
    max-width: 110px;
    object-fit: contain;
}

.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.app-topbar-logout {
    color: var(--text-muted);
    font-size: 1.15rem;
    text-decoration: none;
    padding: .25rem .4rem;
    border-radius: var(--radius-sm);
    transition: color .15s, background .15s;
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.app-topbar-logout:hover {
    color: var(--primary-colour);
    background: var(--tint-soft);
}

/* Sidebar toggle */
.app-sidebar-toggle {
    background: none;
    border: 1px solid var(--border-soft);
    color: var(--primary-colour);
    padding: .3rem .55rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 1.15rem;
    line-height: 1;
    transition: background .15s;
}

.app-sidebar-toggle:hover {
    background: var(--tint-soft);
}

.app-sidebar-toggle:focus-visible {
    outline: 2px solid var(--focus-ring);
}

/* Main content */
.app-main {
    flex: 1;
    padding: 2.5rem 2.5rem 3rem;
}

/* Overlay for mobile sidebar */
.app-shell-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: oklch(0.15 0.008 4 / 0.42);
    z-index: 90;
}

.app-shell-overlay.is-visible {
    display: block;
}


/* =========================
   Homepage
   ========================= */

.public-page-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}

/* Hero - full-width plum with radial ambient light */
.homepage-hero {
    background: var(--primary-colour);
    padding: 6.5rem 0 9rem;
    position: relative;
    overflow: hidden;
}

.homepage-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 80% at -5% 120%, oklch(0.50 0.13 355 / 0.22), transparent 55%),
        radial-gradient(ellipse 40% 55% at 105% -5%, oklch(0.38 0.11 358 / 0.28), transparent 55%);
    pointer-events: none;
}

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

.hero-eyebrow {
    display: inline-block;
    font-family: var(--font-body);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: oklch(0.80 0.06 355);
    margin-bottom: .75rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 8.5vw, 8rem);
    font-weight: 600;
    line-height: 0.97;
    color: var(--offwhite);
    letter-spacing: -0.05em;
    margin: .5rem 0 0;
    max-width: none;
}

.hero-lower {
    margin-top: 3.5rem;
    padding-top: 3rem;
    border-top: 1px solid oklch(0.94 0.03 355 / 0.15);
}

.hero-title em {
    font-style: italic;
    color: var(--color-brand-400);
}

.hero-body {
    font-size: 1.05rem;
    line-height: 1.75;
    color: oklch(0.80 0.04 355);
    max-width: 48ch;
    margin-bottom: 2rem;
}

.hero-cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 2.5rem;
}

.hero-proof {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.hero-proof-item {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    font-size: .88rem;
    line-height: 1.5;
    color: oklch(0.75 0.04 355);
}

.hero-proof-item i {
    color: var(--color-brand-400);
    margin-top: .15rem;
    flex-shrink: 0;
}

/* Hero benefit panel */
.hero-panel {
    background: oklch(0.22 0.09 5);
    border: 1px solid oklch(0.94 0.03 355 / 0.12);
    border-radius: var(--radius-md);
    padding: 2rem 2rem 2.25rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.hero-panel-item {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: 1.5rem 0;
}

.hero-panel-item + .hero-panel-item {
    border-top: 1px solid oklch(0.94 0.03 355 / 0.12);
}

.hero-panel-item:first-child {
    padding-top: 0;
}

.hero-panel-item:last-child {
    padding-bottom: 0;
}

.hero-panel-label {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--offwhite);
    letter-spacing: -0.01em;
}

.hero-panel-text {
    font-size: .88rem;
    line-height: 1.65;
    color: oklch(0.75 0.04 355);
    margin: 0;
}

/* Problem section - heading in container, roster bleeds full width */
.section-problem {
    background: var(--surface-colour);
    padding: 7rem 0 0;
    overflow: hidden;
}

.problem-roster {
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
    border-radius: 0;
    margin-top: 4rem;
}

.problem-item {
    display: grid;
    grid-template-columns: min(13rem, 22vw) 1fr;
    align-items: stretch;
    border-bottom: 1px solid var(--border-soft);
}

.problem-item:last-child {
    border-bottom: none;
}

.problem-item-num {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 6vw, 6rem);
    font-weight: 600;
    font-style: italic;
    color: var(--color-brand-200);
    padding: 2.5rem 3rem;
    border-right: 1px solid var(--border-soft);
    background: var(--color-neutral-50);
    display: flex;
    align-items: center;
    line-height: 1;
    letter-spacing: -0.06em;
}

.problem-item-body {
    padding: 2.5rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 72ch;
}

.problem-item-title {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 1.8vw, 1.5rem);
    font-weight: 600;
    color: var(--primary-colour);
    margin: 0 0 .5rem;
    letter-spacing: -0.02em;
}

.problem-item-text {
    color: var(--text-muted);
    font-size: .95rem;
    line-height: 1.7;
    margin: 0;
}

/* How it works - horizontal columns at desktop */
.section-steps {
    background: var(--color-neutral-50);
    padding: 7rem 0;
}

/* Horizontal 3-column step layout */
.steps-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--border-soft);
    gap: 0;
}

.step-col {
    padding: 3rem 3rem 3rem 0;
    border-right: 1px solid var(--border-soft);
}

.step-col:first-child {
    padding-left: 0;
}

.step-col:last-child {
    border-right: none;
    padding-right: 0;
    padding-left: 3rem;
}

.step-col:nth-child(2) {
    padding-left: 3rem;
}

.step-num-large {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 5vw, 5.5rem);
    font-weight: 600;
    font-style: italic;
    color: var(--color-brand-200);
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
    display: block;
}

.step-title {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 1.8vw, 1.5rem);
    font-weight: 600;
    color: var(--primary-colour);
    margin: 0 0 .65rem;
    letter-spacing: -0.02em;
}

.step-text {
    color: var(--text-muted);
    font-size: .95rem;
    line-height: 1.7;
    margin: 0;
}

/* Features - inverted, dark plum mid-page break */
.section-features {
    background: var(--primary-colour);
    padding: 7rem 0;
    position: relative;
    overflow: hidden;
}

.section-features::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 70% at 110% 50%, oklch(0.38 0.11 358 / 0.25), transparent 60%);
    pointer-events: none;
}

.section-features .s-label {
    color: oklch(0.75 0.05 355);
}

.section-features .s-title {
    color: var(--offwhite);
}

.section-features .s-title em {
    color: var(--color-brand-400);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid oklch(0.94 0.03 355 / 0.15);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    counter-reset: feature-counter;
}

.feature-item {
    padding: 2rem 2rem;
    border-right: 1px solid oklch(0.94 0.03 355 / 0.15);
    counter-increment: feature-counter;
}

.feature-item::before {
    content: "0" counter(feature-counter);
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 3.5vw, 3.25rem);
    font-weight: 600;
    font-style: italic;
    color: oklch(0.94 0.03 355 / 0.18);
    letter-spacing: -0.04em;
    line-height: 1;
    display: block;
    margin-bottom: 1.25rem;
}

.feature-item:last-child {
    border-right: none;
}

.feature-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--offwhite);
    margin: 0 0 .55rem;
    letter-spacing: -0.01em;
}

.feature-text {
    color: oklch(0.75 0.04 355);
    font-size: .9rem;
    line-height: 1.75;
    margin: 0;
}

/* FAQ */
.section-faq {
    background: var(--color-neutral-50);
    padding: 7rem 0;
}

.faq-list {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-item {
    border-bottom: 1px solid var(--border-soft);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-btn {
    width: 100%;
    border: 0;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.5rem;
    color: var(--primary-colour);
    background: var(--surface-colour);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.4;
    transition: background .15s;
}

.faq-btn:not(.collapsed) {
    background: var(--color-neutral-100);
}

.faq-btn:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: -2px;
}

.faq-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    color: var(--secondary-colour);
    flex-shrink: 0;
}

.faq-icon-plus,
.faq-icon-minus {
    font-size: 1rem;
    line-height: 1;
}

.faq-icon-minus {
    display: none;
}

.faq-btn:not(.collapsed) .faq-icon-plus {
    display: none;
}

.faq-btn:not(.collapsed) .faq-icon-minus {
    display: inline-block;
}

.faq-answer {
    padding: .5rem 1.5rem 1.25rem;
    color: var(--text-muted);
    line-height: 1.7;
    background: var(--color-neutral-50);
    font-size: .95rem;
}

/* Final CTA */
.section-cta {
    background: var(--color-brand-950);
    padding: 9rem 0 10rem;
}

.homepage-final-cta {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    align-items: center;
}

.homepage-final-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5.5vw, 4.75rem);
    font-weight: 600;
    font-style: italic;
    color: var(--offwhite);
    letter-spacing: -0.04em;
    margin: 0;
    line-height: 1.1;
    text-align: center;
    max-width: 22ch;
}

/* Legacy/fallback classes for non-homepage templates */
.s-label-inv {
    color: oklch(0.80 0.04 355);
}

.homepage-container {
    background: var(--primary-colour);
    color: var(--offwhite-dim);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 3rem;
    border-radius: var(--radius-md);
}

.homepage-container em {
    color: var(--offwhite);
}

.homepage-hero-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    color: var(--offwhite);
    letter-spacing: -0.03em;
    margin: 0;
}

.homepage-hero-subtitle {
    font-size: 1.05rem;
    line-height: 1.7;
}

.homepage-cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.homepage-trust-list {
    margin: 0;
    padding-left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    line-height: 1.5;
}

.homepage-metric-card {
    border: 1px solid var(--border-soft);
    background: var(--surface-colour);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: var(--radius-md);
}

.homepage-metric-card hr {
    margin: 1.5rem 0;
    border-color: var(--border-soft);
}

.homepage-metric-value {
    font-family: var(--font-display);
    color: var(--primary-colour);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: .3rem;
}

.homepage-metric-text {
    color: var(--text-muted);
    line-height: 1.7;
}

.homepage-steps {
    background: var(--surface-colour);
}

.homepage-step {
    background: var(--tint-soft);
    border: 1px solid var(--border-soft);
    padding: 1.3rem;
    border-radius: var(--radius-md);
}

.homepage-step-number {
    font-family: var(--font-display);
    color: var(--secondary-colour);
    font-weight: 600;
    font-style: italic;
    letter-spacing: .02em;
    margin-bottom: .25rem;
}

.homepage-card,
.homepage-feature {
    background: var(--surface-colour);
    border: 1px solid var(--border-soft);
    padding: 1.3rem;
    border-radius: var(--radius-md);
    transition: transform .2s ease, box-shadow .2s ease;
}

.homepage-card-title {
    font-family: var(--font-display);
    color: var(--primary-colour);
    font-size: 1.1rem;
    margin-bottom: .35rem;
    font-weight: 600;
}

.homepage-card p,
.homepage-feature p {
    color: var(--text-muted);
    line-height: 1.7;
}

.homepage-faq {
    background: var(--surface-colour);
}

.homepage-step:hover,
.homepage-card:hover,
.homepage-feature:hover {
    transform: translateY(-2px);
    box-shadow: var(--surface-shadow);
}

.homepage-cta-group .mb-btn-outline {
    color: var(--offwhite);
    border-color: var(--color-brand-200);
}

.homepage-cta-group .mb-btn-outline:hover {
    border-color: var(--secondary-colour);
}


/* =========================
   Homepage nav - seamless with hero
   ========================= */

.layout-homepage .site-nav {
    background: var(--primary-colour);
    border-bottom-color: oklch(0.94 0.03 355 / 0.12);
    box-shadow: none;
    backdrop-filter: none;
}

.layout-homepage .wordmark .wm-my {
    color: var(--offwhite);
}

.layout-homepage .wordmark .wm-b {
    color: oklch(0.98 0.005 355);
}

.layout-homepage .nav-links a {
    color: oklch(0.88 0.04 355);
}

.layout-homepage .nav-links a:hover {
    background: oklch(0.94 0.03 355 / 0.14);
    color: var(--offwhite);
}

.layout-homepage .nav-toggle {
    border-color: oklch(0.94 0.03 355 / 0.3);
    color: var(--offwhite);
}

.layout-homepage .site-nav.is-mobile-open {
    background: var(--primary-colour);
    border-bottom: none;
}

.layout-homepage .site-nav.is-mobile-open .nav-links a {
    color: oklch(0.88 0.04 355);
}

.layout-homepage .site-nav.is-mobile-open .nav-links a:hover {
    background: oklch(0.94 0.03 355 / 0.14);
    color: var(--offwhite);
}

.layout-homepage .site-nav.is-mobile-open .nav-right {
    border-top-color: oklch(0.94 0.03 355 / 0.15);
}

.layout-homepage .site-nav.is-mobile-open .nav-right .btn.mb-btn {
    background-color: var(--secondary-colour);
    border-color: var(--secondary-colour);
}

.layout-homepage .site-nav.is-mobile-open .nav-right .btn.mb-btn-outline {
    border-color: var(--color-brand-200);
    color: var(--offwhite);
}


/* =========================
   Accessibility
   ========================= */

.btn:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

a:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}


/* =========================
   Responsive
   ========================= */

@media (max-width: 900px) {
    .panel-container {
        grid-template-columns: 1fr;
    }

    .panel-aside {
        display: none;
    }

    .homepage-container {
        padding: 2rem;
    }

    .homepage-metric-card {
        padding: 1.5rem;
    }

    .main-panel {
        padding: 2rem;
    }

    /* Problem section */
    .problem-item {
        grid-template-columns: 1fr;
        padding: 1.75rem 1.5rem;
        gap: .25rem;
    }

    .problem-item-num {
        border-right: none;
        background: transparent;
        padding: 0;
        font-size: 1.5rem;
        line-height: 1;
        letter-spacing: -0.03em;
    }

    .problem-item-body {
        padding: 0;
    }

    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
    }

    .feature-item {
        border-right: none;
        border-bottom: 1px solid oklch(0.94 0.03 355 / 0.15);
    }

    .feature-item:last-child {
        border-bottom: none;
    }

    /* Steps columns collapse */
    .steps-columns {
        grid-template-columns: 1fr;
        border-top: none;
    }

    .step-col {
        padding: 0 0 2rem;
        border-right: none;
        border-top: 1px solid var(--border-soft);
        padding-top: 2rem;
    }

    .step-col:first-child {
        border-top: none;
        padding-top: 0;
    }

    .step-col:last-child {
        padding-bottom: 0;
    }

    .step-col:nth-child(2) {
        padding-left: 0;
    }

    /* App header zone adjusts to reduced padding */
    .app-page-header {
        margin: -1.25rem -1.25rem 1.75rem;
        padding: 1.25rem 1.25rem 1.1rem;
    }
}

@media (max-width: 991.98px) {
    .site-footer {
        padding: 2rem 0 1.25rem;
    }

    .footer-brand-copy {
        max-width: none;
    }

    .footer-bottom-row {
        justify-content: flex-start !important;
    }

    /* Mobile nav */
    .nav-menu,
    .nav-links,
    .nav-right {
        display: none;
    }

    .nav-inner {
        display: block;
        min-height: 62px;
    }

    .nav-top-row {
        gap: 1rem;
    }

    .site-nav.is-mobile-open {
        position: fixed;
        inset: 0;
        z-index: 1099;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        border-bottom: none;
        box-shadow: none;
        background: var(--surface-colour);
        backdrop-filter: none;
    }

    .site-nav.is-mobile-open > .container {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .site-nav.is-mobile-open .nav-inner {
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
    }

    .site-nav.is-mobile-open .nav-top-row {
        min-height: 62px;
        gap: 1rem;
    }

    .site-nav.is-mobile-open .nav-menu {
        display: flex;
        flex: 1;
        flex-direction: column;
        width: 100%;
    }

    .site-nav.is-mobile-open .nav-links {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin: 0;
        padding: 1rem 0 0;
        gap: .35rem;
    }

    .site-nav.is-mobile-open .nav-links li {
        border-bottom: none;
    }

    .site-nav.is-mobile-open .nav-links a {
        padding: .9rem .8rem;
        font-size: 1rem;
        font-weight: 600;
        color: var(--text-colour);
        border-radius: var(--radius-sm);
        width: 100%;
    }

    .site-nav.is-mobile-open .nav-right {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin-left: 0;
        margin-top: auto;
        padding: 1.5rem 0 1rem;
        border-top: 1px solid var(--border-soft);
        gap: .75rem;
    }

    .site-nav.is-mobile-open .nav-right .btn {
        width: 100%;
        text-align: center;
    }

    .site-nav.is-mobile-open .nav-user-chip {
        width: 100%;
        justify-content: center;
    }

    .app-hero-card {
        padding: 1.5rem;
    }

    /* Sidebar slide-in */
    .app-sidebar {
        position: fixed;
        left: calc(var(--sidebar-width) * -1);
        top: 0;
        height: 100%;
        z-index: 100;
        transition: left .22s ease-out;
    }

    .app-sidebar.is-open {
        left: 0;
    }

    .app-main {
        padding: 1.25rem;
    }

    /* Steps - 2-col at tablet before single-col on mobile */
    .steps-columns {
        grid-template-columns: repeat(2, 1fr);
    }

    .step-col:nth-child(3) {
        border-top: 1px solid var(--border-soft);
        padding-top: 2.5rem;
        grid-column: span 2;
        border-right: none;
        padding-left: 0;
        padding-right: 0;
    }

    .step-col:nth-child(2) {
        border-right: none;
        padding-right: 0;
    }

    .step-num-large {
        font-size: 3.5rem;
    }
}

@media (max-width: 575.98px) {
    .footer-bottom-row {
        flex-direction: column;
        align-items: flex-start !important;
        gap: .45rem;
    }

    .homepage-hero {
        padding: 3.5rem 0 4.5rem;
    }

    .hero-lower {
        margin-top: 2.5rem;
        padding-top: 2rem;
    }

    .section-problem {
        padding: 4rem 0 0;
    }

    .problem-roster {
        margin-top: 3rem;
    }

    .section-steps,
    .section-faq {
        padding: 4rem 0;
    }

    .section-features {
        padding: 4rem 0;
    }

    .section-cta {
        padding: 5rem 0 6rem;
    }

    .homepage-final-title {
        font-size: clamp(2rem, 5vw, 3rem);
    }

    .hero-panel {
        padding: 1.25rem;
    }

    .step-num-large {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
}


/* =========================
   Legal pages
   ========================= */

.legal-page-header {
    border-bottom: 1px solid var(--color-neutral-200);
    padding-bottom: 2rem;
}

.legal-eyebrow {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--secondary-colour);
    margin-bottom: 0.5rem;
}

.legal-page-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--primary-colour);
    margin-bottom: 0.5rem;
}

.legal-meta {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0;
}

.legal-body {
    color: var(--text-colour);
    font-size: 1rem;
    line-height: 1.75;
}

.legal-body h2 {
    font-family: var(--font-display);
    font-size: 1.3125rem;
    font-weight: 700;
    color: var(--primary-colour);
    margin-top: 0;
    margin-bottom: 0.875rem;
    padding-top: 2.25rem;
    border-top: 1px solid var(--color-neutral-200);
    scroll-margin-top: 5rem;
}

.legal-body h2:first-of-type {
    border-top: none;
    padding-top: 0;
}

.legal-body h3,
.legal-h3 {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-colour);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

.legal-body p,
.legal-body ul,
.legal-body address {
    margin-bottom: 1rem;
}

.legal-body ul {
    padding-left: 1.5rem;
}

.legal-body ul li {
    margin-bottom: 0.35rem;
}

.legal-body a {
    color: var(--secondary-colour);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-body a:hover {
    color: var(--primary-colour);
}

.legal-toc {
    background: var(--color-brand-50);
    border: 1px solid var(--color-brand-200);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    font-size: 0.9375rem;
}

.legal-toc li {
    margin-bottom: 0.25rem;
}

.legal-table-wrapper {
    margin: 1.25rem 0 1.5rem;
}

.legal-table {
    font-size: 0.9rem;
    border-color: var(--color-neutral-200);
}

.legal-table thead th {
    background: none;
    color: var(--text-colour);
    font-weight: 600;
    border-bottom: 1px solid var(--color-neutral-300);
}

.legal-table tbody td {
    vertical-align: top;
    border-color: var(--color-neutral-200);
}

.legal-contact-block {
    border: 1px solid var(--color-neutral-200);
    padding: 0.75rem 1.25rem;
    background: var(--color-neutral-50);
    font-style: normal;
    margin-top: 0.5rem;
    line-height: 1.9;
    border-radius: var(--radius-sm);
}

/* Two-column legal page layout */
.legal-grid {
    display: grid;
    gap: 0;
    align-items: start;
}

@media (min-width: 992px) {
    .legal-grid {
        grid-template-columns: 190px 1fr;
        gap: 0 3.5rem;
    }
}

/* Sticky sidebar table of contents */
.legal-sidebar {
    position: sticky;
    top: 5.5rem;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
    padding-bottom: 2rem;
}

.legal-sidebar-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.875rem;
    padding-left: 0.75rem;
}

.legal-sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.35;
}

.legal-sidebar-nav li + li {
    margin-top: 0.125rem;
}

.legal-sidebar-nav a {
    display: block;
    padding: 0.35rem 0.75rem;
    color: var(--color-neutral-500);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease, background-color 0.15s ease;
}

.legal-sidebar-nav a:hover,
.legal-sidebar-nav a.is-active {
    color: var(--primary-colour);
    background-color: var(--color-brand-50);
}

.legal-sidebar-nav a.is-active {
    font-weight: 600;
}

/* Callout block for important notices within legal body */
.legal-callout {
    background: var(--color-brand-50);
    border: 1px solid var(--color-brand-200);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
}

.legal-callout p:last-child,
.legal-callout ul:last-child {
    margin-bottom: 0;
}

.legal-callout-label {
    display: none;
}

/* ── List nav links (used in report menus, settings lists) ───────────────── */
.app-list-link {
    color: var(--text-colour);
    text-decoration: none;
    transition: background .12s;
}
.app-list-link:hover {
    background: var(--tint-soft);
    color: var(--primary-colour);
}
.app-list-link:hover .text-muted {
    color: var(--primary-colour) !important;
}

/* ── Staff application action bar ─────────────────────────────────────────── */
.app-action-bar {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .85rem 1.1rem;
    border-radius: var(--radius-sm);
    border: 1px solid;
    font-size: .88rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}
.app-action-bar-body { flex: 1; min-width: 0; }
.app-action-bar-icon { font-size: 1.1rem; flex-shrink: 0; opacity: .75; }
.app-action-bar--need {
    background: var(--tint-soft);
    border-color: var(--color-brand-200);
    color: var(--primary-colour);
}
.app-action-bar--waiting {
    background: var(--ink-attention-soft);
    border-color: oklch(0.46 0.10 75 / 0.25);
    color: var(--ink-attention);
}
.app-action-bar--done {
    background: var(--ink-resolved-soft);
    border-color: oklch(0.40 0.075 165 / 0.25);
    color: var(--ink-resolved);
}
.app-action-bar--danger {
    background: var(--ink-closed-soft);
    border-color: oklch(0.45 0.05 30 / 0.25);
    color: var(--ink-closed);
}
.app-action-bar--muted {
    background: var(--color-neutral-100);
    border-color: var(--border-soft);
    color: var(--text-muted);
}

/* ── Sidebar sub-navigation ───────────────────────────────────────────────── */
.app-sidebar-subnav {
    display: flex;
    flex-direction: column;
    padding-left: 2rem;
    gap: .05rem;
    margin-bottom: .15rem;
}
.app-sidebar-subnav-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .28rem .6rem;
    border-radius: var(--radius-sm);
    color: oklch(1 0 0 / 0.55);
    text-decoration: none;
    font-size: .8rem;
    font-weight: 500;
    font-family: var(--font-body);
    transition: background .15s, color .15s;
}
.app-sidebar-subnav-link:hover {
    background: oklch(1 0 0 / 0.1);
    color: oklch(1 0 0);
}
.app-sidebar-subnav-link.is-active {
    color: oklch(1 0 0);
    font-weight: 600;
}

/* Stage guidance card */
.app-card--stage-guidance {
    border-color: var(--border-soft);
    background: var(--tint-soft);
}

/* Legal page header version */
.legal-version-pill {
    display: inline;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--text-muted);
}

.legal-page-header {
    border-bottom: none;
    padding-bottom: 2rem;
    margin-bottom: 0;
}

.legal-page-header-inner {
    border-bottom: 1px solid var(--color-neutral-200);
    padding-bottom: 2rem;
}

@media (min-width: 992px) {
    .legal-page-header-inner {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 2rem;
    }
    .legal-page-header-meta {
        text-align: right;
        flex-shrink: 0;
    }
}

.legal-page-header-meta .legal-meta {
    margin-top: 0.35rem;
    display: block;
}

/* Lead / intro paragraph */
.legal-lead {
    font-size: 1.0625rem;
    color: var(--text-colour);
    line-height: 1.8;
}

/* Inline part label inside a section heading (Part 1, Part 2) */
.legal-part-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--secondary-colour);
    margin-bottom: 0.3rem;
}

/* Download button in legal page header */
.legal-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--primary-colour);
    background: none;
    border: 1px solid var(--color-neutral-300);
    border-radius: 0.375rem;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.legal-download-btn:hover {
    background: var(--color-brand-50);
    border-color: var(--secondary-colour);
    color: var(--primary-colour);
    text-decoration: none;
}

/* Numbered summary list in LIA intro */
.legal-numbered-list {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.75;
}

.legal-numbered-list li {
    margin-bottom: 0.35rem;
}

.legal-numbered-list a {
    color: var(--secondary-colour);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── LIA assessment cards ── */
.lia-assessment {
    border: 1px solid var(--color-neutral-200);
    border-radius: 0.5rem;
    padding: 1.75rem;
    margin: 2.5rem 0;
    scroll-margin-top: 5rem;
}

.lia-assessment-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.lia-number {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--color-brand-50);
    color: var(--secondary-colour);
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 0.125rem;
}

.lia-heading {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-colour);
    margin: 0;
    border: none;
    padding: 0;
    scroll-margin-top: 5rem;
}

.lia-test {
    padding: 1rem 1.25rem;
    background: var(--color-neutral-50);
    border-radius: 0.375rem;
    margin-bottom: 0.75rem;
}

.lia-test:last-child {
    margin-bottom: 0;
}

.lia-test p {
    margin-bottom: 0.75rem;
}

.lia-test p:last-child {
    margin-bottom: 0;
}

.lia-test-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--secondary-colour);
    margin-bottom: 0.5rem !important;
}

.lia-conclusion {
    border-top: 1px solid var(--color-neutral-200);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.9375rem;
}

/* ── About page ──────────────────────────────────────────────────────────── */

.about-opening {
    padding: 5rem 0 4rem;
}

.about-statement {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 400;
    font-style: italic;
    line-height: 1.4;
    color: var(--primary-colour);
    margin-bottom: 1.5rem;
}

.about-lede {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--text-colour);
    max-width: 52ch;
    margin-bottom: 0;
}

.about-section {
    padding: 4rem 0;
    border-top: 1px solid var(--color-neutral-200);
}

.about-prose {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-colour);
}

.about-prose p {
    margin-bottom: 1rem;
}

.about-prose p:last-child {
    margin-bottom: 0;
}

.about-facts {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-fact-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.about-fact-value {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-colour);
    margin-bottom: 0;
}

/* ── Security page ───────────────────────────────────────────────────────── */

.security-opening {
    padding: 5rem 0 3rem;
}

.security-section {
    padding: 4rem 0;
    border-top: 1px solid var(--color-neutral-200);
}

.security-assurance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem 3rem;
    margin-top: 2.5rem;
}

@media (min-width: 992px) {
    .security-assurance-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.security-assurance-num {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-neutral-200);
    line-height: 1;
    margin-bottom: 0.75rem;
    display: block;
}

.security-assurance-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--primary-colour);
    margin-bottom: 0.5rem;
}

.security-assurance-text {
    font-size: 0.875rem;
    color: var(--text-colour);
    line-height: 1.65;
    margin-bottom: 0;
}

.security-tech-list {
    margin-top: 2rem;
}

.security-tech-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--color-neutral-200);
    display: grid;
    gap: 0.25rem 2rem;
}

.security-tech-item:first-child {
    border-top: 1px solid var(--color-neutral-200);
}

@media (min-width: 768px) {
    .security-tech-item {
        grid-template-columns: 14rem 1fr;
        align-items: baseline;
    }
}

.security-tech-heading {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-colour);
    margin-bottom: 0;
}

.security-tech-detail {
    font-size: 0.9rem;
    color: var(--text-colour);
    line-height: 1.65;
    margin-bottom: 0;
}

/* ── Bursary type card choice ──────────────────────────────────────────────── */

.app-bursary-card {
    border: 2px solid var(--color-neutral-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.15s ease;
    cursor: pointer;
}

.app-bursary-card:hover {
    border-color: var(--color-brand-400);
}

.app-bursary-card.is-selected {
    border-color: var(--primary-colour);
    background: oklch(from var(--primary-colour) l c h / 0.04);
}

.app-bursary-card-inner {
    padding: 1rem 1.25rem;
    cursor: pointer;
    display: block;
    margin: 0;
}

.app-bursary-radio {
    accent-color: var(--primary-colour);
    width: 1.1rem;
    height: 1.1rem;
}

.app-bursary-subcategory {
    border-top: 1px solid var(--color-neutral-200);
    background: var(--color-neutral-50);
    padding-top: 0.75rem;
}


/* =========================
   Pipeline stat strip
   ========================= */

.app-stat-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: var(--surface-colour);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    box-shadow: var(--surface-shadow);
    overflow: hidden;
}

.app-stat-strip-item {
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: .3rem;
    border-right: 1px solid var(--border-soft);
}

.app-stat-strip-item:last-child {
    border-right: none;
}

.app-stat-strip-value {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--primary-colour);
}

.app-stat-strip-label {
    font-family: var(--font-body);
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
}

.app-stat-strip-item--submitted .app-stat-strip-value { color: var(--text-colour); }
.app-stat-strip-item--review   .app-stat-strip-value { color: var(--ink-attention); }
.app-stat-strip-item--approved .app-stat-strip-value { color: var(--ink-resolved); }
.app-stat-strip-item--rejected .app-stat-strip-value { color: var(--ink-closed); }

@media (max-width: 767.98px) {
    .app-stat-strip {
        display: flex;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .app-stat-strip::-webkit-scrollbar { display: none; }

    .app-stat-strip-item {
        min-width: 110px;
        flex-shrink: 0;
        padding: 1rem 1.25rem;
        border-right: 1px solid var(--border-soft);
    }

    .app-stat-strip-item:last-child {
        border-right: none;
    }

    .app-stat-strip-value {
        font-size: 1.65rem;
    }
}


/* =========================
   Budget figures & bar
   ========================= */

.app-budget-figure {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--text-colour);
}

.app-budget-figure--awarded   { color: var(--primary-colour); }
.app-budget-figure--disbursed { color: var(--ink-resolved); }
.app-budget-figure--ok        { color: var(--ink-resolved); }
.app-budget-figure--warn      { color: var(--ink-closed);  }

.app-budget-bar {
    height: 6px;
    background: var(--color-neutral-200);
    border-radius: 999px;
    overflow: hidden;
    display: flex;
}

.app-budget-bar-disbursed {
    background: var(--ink-resolved);
    flex-shrink: 0;
}

.app-budget-bar-awarded {
    background: var(--color-brand-400);
    flex-shrink: 0;
}

.app-budget-legend {
    display: flex;
    gap: 1.25rem;
    font-size: .8rem;
    color: var(--text-muted);
    font-family: var(--font-body);
    align-items: center;
}

.app-budget-legend-item {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.app-budget-dot {
    width: .6em;
    height: .6em;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}


/* =========================
   Clickable table rows
   ========================= */

.app-table tbody tr.is-clickable {
    cursor: pointer;
    transition: background .1s;
}

.app-table tbody tr.is-clickable:hover {
    background: var(--tint-soft);
}


/* =========================
   Student status hero
   ========================= */

.app-status-hero {
    background: var(--surface-colour);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1.1rem;
    border: 1px solid var(--border-soft);
    border-top: 1px solid var(--border-soft);
}

.app-status-hero--draft {
    border-color: var(--border-soft);
}

.app-status-hero--submitted {
    border-color: var(--color-neutral-300);
}

.app-status-hero--review {
    border-color: oklch(0.46 0.10 75 / 0.35);
    background: var(--ink-attention-soft);
}

.app-status-hero--approved {
    border-color: oklch(0.40 0.075 165 / 0.35);
    background: var(--ink-resolved-soft);
}

.app-status-hero--rejected {
    border-color: oklch(0.45 0.05 30 / 0.35);
    background: var(--ink-closed-soft);
}

.app-status-hero-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    line-height: 1;
    margin-top: .1rem;
}

.app-status-hero--draft .app-status-hero-icon     { color: var(--text-muted); }
.app-status-hero--submitted .app-status-hero-icon { color: var(--text-muted); }
.app-status-hero--review .app-status-hero-icon    { color: var(--ink-attention); }
.app-status-hero--approved .app-status-hero-icon  { color: var(--ink-resolved); }
.app-status-hero--rejected .app-status-hero-icon  { color: var(--ink-closed); }

.app-status-hero-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-colour);
    margin: 0 0 .2rem;
}

.app-status-hero-text {
    font-size: .88rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
}


/* =========================
   Simple single-fill bar
   ========================= */

.app-bar {
    height: 5px;
    background: var(--color-neutral-200);
    border-radius: 999px;
    overflow: hidden;
    flex-grow: 1;
}

.app-bar-fill {
    height: 100%;
    background: var(--secondary-colour);
    border-radius: 999px;
    transition: width .4s ease-out;
}

.app-bar--lg {
    height: 10px;
}

/* ── Application detail: section jump nav ─────────────────────────────────── */
.app-section-jump {
    display: flex;
    gap: .25rem;
    flex-wrap: wrap;
    padding-bottom: .25rem;
}
.app-section-jump-link {
    display: inline-flex;
    align-items: center;
    padding: .3rem .75rem;
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--color-neutral-100);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.app-section-jump-link:hover {
    background: var(--tint-soft);
    color: var(--primary-colour);
    text-decoration: none;
}

/* ── Application detail: section headings in the left column ──────────────── */
.app-detail-section-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-colour);
    letter-spacing: -.01em;
    margin-bottom: .85rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--border-soft);
}

/* ── Action card variant (review form) ────────────────────────────────────── */
.app-card--action {
    border-color: var(--color-brand-200);
}
.app-card--action > .app-card-header {
    background: var(--tint-soft);
    border-bottom-color: var(--color-brand-200);
}

/* ── Screenshot cards (homepage product preview) ───────────────────────────── */
.screenshot-card {
    border: 1px solid var(--mb-border, #e5e0e8);
    border-radius: .75rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 12px oklch(0.18 0.06 310 / .08);
}
.screenshot-chrome {
    background: oklch(0.18 0.06 310);
    padding: .6rem 1rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-shrink: 0;
}
.screenshot-dot {
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.screenshot-dot-red    { background: oklch(0.6 0.15 27); }
.screenshot-dot-yellow { background: oklch(0.75 0.18 90); }
.screenshot-dot-green  { background: oklch(0.6 0.15 145); }
.screenshot-chrome-label {
    color: rgba(255,255,255,.5);
    font-size: .7rem;
    margin-left: .5rem;
    font-family: monospace;
}
.screenshot-body {
    /* Clip the image so partial screenshots don't show a gap at the bottom */
    overflow: hidden;
    line-height: 0;
}
.screenshot-img {
    width: 100%;
    height: auto;
    display: block;
    /* Subtle top shadow so the image doesn't look pasted in */
    box-shadow: inset 0 2px 4px rgba(0,0,0,.06);
}

/* =========================
   Layout width utilities
   ========================= */

.app-content-lg { max-width: 960px; }
.app-content-md { max-width: 720px; }

/* =========================
   Overline / uppercase label
   ========================= */

.app-overline-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
}

/* =========================
   Super Admin portal badge
   ========================= */

.app-superadmin-badge {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* =========================
   Mobile responsiveness
   ========================= */

@media (max-width: 768px) {
  .app-filter-collapse { display: none; }
  .app-filter-collapse.show { display: block; }
  .app-table-mobile-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .app-btn-mobile-full { width: 100%; margin-bottom: 0.5rem; }
  .app-stat-strip { flex-wrap: wrap; }
  .app-stat-strip-item { min-width: 45%; }
}
