:root {
    --mh-primary: #15803d;
    --mh-primary-dark: #166534;
    --mh-navy: #0b1220;
    --mh-bg: #f6f8fb;
    --mh-card-bg: #ffffff;
    --mh-text: #182235;
    --mh-muted: #687386;
    --mh-border: #e4e8ef;
    --mh-shadow: 0 12px 30px rgba(11, 18, 32, 0.08);
}

[data-bs-theme="dark"] {
    --mh-bg: #111827;
    --mh-card-bg: #1b2433;
    --mh-text: #edf2f7;
    --mh-muted: #a7b1c2;
    --mh-border: #303b4f;
    --mh-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

body {
    background-color: var(--mh-bg);
    color: var(--mh-text);
    font-family: "Poppins", "Inter", "Segoe UI", sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 70px;
    overflow-x: hidden;
}

.mh-main {
    flex: 1 0 auto;
    width: 100%;
}

img, svg, video, canvas {
    max-width: 100%;
}

button, input, select, textarea {
    max-width: 100%;
}

.btn {
    min-height: 2.5rem;
    padding: 0.55rem 0.9rem;
    border-radius: 0.5rem;
    font-weight: 600;
}
.btn-sm {
    min-height: 2.15rem;
    padding: 0.4rem 0.7rem;
}
.mh-icon-button {
    width: 2.75rem;
    min-width: 2.75rem;
    padding: 0;
    display: inline-grid;
    place-items: center;
}
.mh-icon-search {
    width: 0.9rem;
    height: 0.9rem;
    border: 2px solid currentColor;
    border-radius: 50%;
    position: relative;
}
.mh-icon-search::after {
    content: "";
    position: absolute;
    width: 0.45rem;
    height: 2px;
    background: currentColor;
    right: -0.35rem;
    bottom: -0.15rem;
    transform: rotate(45deg);
    transform-origin: left center;
}
.mh-brand-mark {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    margin-right: 0.3rem;
    border: 2px solid var(--mh-primary);
    border-radius: 0.2rem;
    transform: rotate(45deg);
}
.mh-nav-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 1.5rem;
    padding: 0 0.25rem;
    border: 1px solid currentColor;
    border-radius: 0.3rem;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1;
}

/* Keep text-bearing controls readable when the navbar or forms become narrow. */
.mh-navbar .navbar-nav {
    min-width: 0;
}
.mh-navbar .nav-link,
.mh-navbar .btn,
.mh-navbar .navbar-brand {
    line-height: 1.35;
    white-space: nowrap;
}
.mh-navbar .nav-link {
    display: flex;
    align-items: center;
    min-height: 2.5rem;
}
.mh-navbar .nav-link.mh-nav-icon {
    width: 2.5rem;
    height: 2.5rem;
    justify-content: center;
    border-radius: 999px;
    padding: 0;
    font-size: 1.1rem;
}
.mh-navbar .nav-link.mh-nav-icon:hover {
    background: rgba(21, 128, 61, 0.08);
}
.mh-navbar .navbar-collapse {
    min-width: 0;
}
.mh-navbar form {
    min-width: 0;
}
.mh-navbar form .form-control {
    min-width: 0;
}

.mh-navbar {
    background-color: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--mh-border);
    backdrop-filter: blur(12px);
    position: relative;
    z-index: 1040;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
[data-bs-theme="dark"] .mh-navbar {
    background-color: rgba(17, 24, 39, 0.9);
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.28);
}
.mh-navbar .navbar-brand { letter-spacing: 0.01em; color: var(--mh-text); }
.mh-navbar .navbar-brand i { color: var(--mh-primary); }
.mh-navbar .nav-link { color: var(--mh-muted); border-radius: 0.5rem; transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; }
.mh-navbar .nav-link:hover, .mh-navbar .nav-link:focus { color: var(--mh-text); }
.mh-navbar .nav-link.active {
    color: var(--mh-text);
    font-weight: 700;
    background: rgba(21, 128, 61, 0.08);
    box-shadow: inset 0 -2px 0 var(--mh-primary);
}
.mh-navbar .mh-nav-icon {
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 1.1rem;
}
.mh-navbar .mh-nav-action {
    gap: 0.35rem;
}
.mh-navbar .mh-nav-action span {
    display: inline;
}
.mh-navbar .mh-nav-action .badge {
    top: 0.15rem !important;
    left: auto !important;
    right: -0.1rem !important;
    transform: none !important;
}
.mh-navbar .navbar-toggler {
    border-color: var(--mh-border);
    color: var(--mh-text);
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.35rem 0.55rem;
}
.mh-navbar .navbar-toggler:focus { box-shadow: 0 0 0 .2rem rgba(34,197,94,.2); }
.mh-navbar .dropdown-menu {
    background: var(--mh-card-bg);
    border: 1px solid var(--mh-border);
    box-shadow: var(--mh-shadow);
    color: var(--mh-text);
}
.mh-navbar .dropdown-item {
    color: var(--mh-text);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.9rem;
}
.mh-navbar .dropdown-item:hover,
.mh-navbar .dropdown-item:focus {
    background: rgba(21, 128, 61, 0.08);
    color: var(--mh-text);
}
.mh-community-item {
    padding: 0.7rem 0.9rem;
}
.mh-community-icon {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #fff;
    flex-shrink: 0;
}
.mh-community-lost { background: linear-gradient(135deg, #22c55e, #16a34a); }
.mh-community-groups { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.mh-community-delivery { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.mh-community-business { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.mh-search {
    border-color: var(--mh-border);
    background: var(--mh-bg);
    border-radius: 999px;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05), 0 0 0 1px rgba(148, 163, 184, 0.06);
}
.mh-search:focus { border-color: var(--mh-primary); box-shadow: 0 0 0 .2rem rgba(34,197,94,.14), inset 0 1px 2px rgba(15,23,42,0.05); }
.mh-status-badge {
    background: var(--mh-bg);
    color: var(--mh-text);
    border: 1px solid var(--mh-border);
}
.mh-soft-panel {
    background: var(--mh-bg);
    border-color: var(--mh-border);
    color: var(--mh-text);
}
.mh-checkout-callout {
    background: var(--mh-card-bg);
    border: 1px solid var(--mh-border);
    color: var(--mh-text);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}
.mh-checkout-callout ul,
.mh-checkout-callout li,
.mh-checkout-callout strong {
    color: var(--mh-text);
}

.mh-btn-primary, .btn-mh {
    background-color: var(--mh-primary);
    border-color: var(--mh-primary);
    color: #fff;
}
.mh-btn-primary:hover, .btn-mh:hover {
    background-color: var(--mh-primary-dark);
    border-color: var(--mh-primary-dark);
    color: #fff;
}

.mh-hero {
    background: var(--mh-navy);
    color: #fff;
    border-radius: 0.75rem;
    padding: clamp(2rem, 5vw, 4rem) clamp(1.25rem, 5vw, 3.5rem);
    box-shadow: var(--mh-shadow);
    position: relative;
    overflow: hidden;
}
.mh-hero::after { content: ""; position: absolute; width: 16rem; height: 16rem; border: 1px solid rgba(34,197,94,.28); border-radius: 50%; right: -5rem; top: -7rem; }

.mh-hero h1 { font-weight: 800; }

.mh-badge-deal {
    background-color: var(--mh-accent);
    color: #1f2937;
    font-weight: 600;
}

.mh-badge-campus {
    background-color: #0ea5e9;
}

.mh-badge-urgent {
    background-color: #dc2626;
}

.mh-card {
    background-color: var(--mh-card-bg);
    border: 1px solid var(--mh-border);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    height: 100%;
}
.mh-card h1,
.mh-card h2,
.mh-card h3,
.mh-card p,
.mh-card .validation-summary-errors {
    overflow-wrap: anywhere;
}
.mh-card .form-label {
    display: block;
    line-height: 1.35;
    margin-bottom: 0.4rem;
}
.mh-card .form-control,
.mh-card .form-select {
    min-height: 2.75rem;
}
.mh-card .field-validation-error,
.mh-card .validation-summary-errors {
    display: block;
    line-height: 1.35;
    margin-top: 0.35rem;
}
.mh-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--mh-shadow);
    border-color: var(--mh-border);
}

.mh-card img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    width: 100%;
}
.mh-product-body { padding: 0.85rem; }
.mh-product-title { min-height: 2.5rem; line-height: 1.25; }
.mh-product-meta { color: var(--mh-muted); font-size: 0.78rem; }
.mh-search { border-color: var(--mh-border); background: var(--mh-bg); }
.mh-search:focus { border-color: var(--mh-primary); box-shadow: 0 0 0 .2rem rgba(34,197,94,.14); }
.form-control, .form-select { border-color: var(--mh-border); background-color: var(--mh-card-bg); color: var(--mh-text); }
.form-control:focus, .form-select:focus { border-color: var(--mh-primary); box-shadow: 0 0 0 .2rem rgba(34,197,94,.14); }
.btn { border-radius: 0.4rem; font-weight: 600; }
.alert { border-radius: 0.5rem; border-width: 1px; }

.mh-price {
    font-weight: 700;
    color: var(--mh-primary);
}

.mh-payment-card {
    padding: clamp(1.25rem, 4vw, 2.25rem);
}
.mh-payment-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--mh-border);
}
.mh-payment-icon {
    display: grid;
    place-items: center;
    flex: 0 0 3rem;
    height: 3rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--mh-primary) 14%, transparent);
    color: var(--mh-primary);
    font-size: 1.5rem;
}
.mh-eyebrow { color: var(--mh-primary); letter-spacing: 0.08em; }
.mh-payment-total {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.15rem 1rem;
    align-items: center;
    padding: 1.35rem 0;
}
.mh-payment-total span { color: var(--mh-muted); }
.mh-payment-total strong { font-size: clamp(1.8rem, 5vw, 2.5rem); }
.mh-payment-total small { grid-column: 1 / -1; color: var(--mh-muted); }
.mh-payment-methods { border: 0; padding: 0; }
.mh-payment-method {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem;
    margin-top: 0.6rem;
    border: 1px solid var(--mh-border);
    border-radius: 0.6rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.mh-payment-method:has(input:checked) {
    border-color: var(--mh-primary);
    background-color: color-mix(in srgb, var(--mh-primary) 7%, var(--mh-card-bg));
}
.mh-payment-method > span:last-child { display: grid; gap: 0.15rem; }
.mh-payment-method small { color: var(--mh-muted); }
.mh-method-icon { color: var(--mh-primary); font-size: 1.25rem; }
.mh-payment-note { border-top: 1px solid var(--mh-border); padding-top: 1rem; }

.mh-price-strike {
    text-decoration: line-through;
    color: var(--mh-muted);
    font-size: 0.85em;
}

.mh-aiw-credit {
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--mh-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
[data-bs-theme="dark"] .mh-aiw-credit {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(148, 163, 184, 0.28);
}
.mh-aiw-logo {
    width: 2.25rem;
    height: 2.25rem;
    object-fit: contain;
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.8);
    padding: 0.2rem;
}
[data-bs-theme="dark"] .mh-aiw-logo {
    background: rgba(15, 23, 42, 0.7);
}
.mh-onboarding-banner {
    background: rgba(21, 128, 61, 0.06);
    border-color: rgba(21, 128, 61, 0.18) !important;
}
[data-bs-theme="dark"] .mh-onboarding-banner {
    background: rgba(21, 128, 61, 0.12);
    border-color: rgba(21, 128, 61, 0.34) !important;
}
.mh-footer {
    background-color: var(--mh-navy);
    color: #f8fafc;
    border-top: 0;
    flex-shrink: 0;
    position: static !important;
    z-index: 1;
}

.mh-checkout-page {
    padding-bottom: 1rem;
}
.mh-checkout-page .row {
    align-items: flex-start;
    row-gap: 1rem;
}
.mh-checkout-page .mh-card,
.mh-checkout-page .alert,
.mh-checkout-page form,
.mh-checkout-page .col-md-7,
.mh-checkout-page .col-md-5 {
    min-width: 0;
    position: relative;
    transform: none;
}
.mh-checkout-page .mh-card,
.mh-checkout-page .alert {
    width: 100%;
}
.mh-checkout-page .d-flex.justify-content-between {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
}
.mh-checkout-page .d-flex.justify-content-between > :first-child {
    min-width: 0;
    overflow-wrap: anywhere;
}
.mh-checkout-page .d-flex.justify-content-between > :last-child {
    margin-left: auto;
    white-space: nowrap;
}

.mh-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    display: flex;
    justify-content: space-around;
    background-color: var(--mh-card-bg);
    border-top: 1px solid var(--mh-border);
    padding: 0.4rem 0;
    z-index: 1030;
}
.mh-bottom-nav a {
    color: var(--mh-muted);
    text-decoration: none;
    text-align: center;
    font-size: 0.7rem;
    flex: 1;
    min-width: 0;
    line-height: 1.2;
    padding: 0 0.15rem;
}
.mh-bottom-nav a i {
    display: block;
    font-size: 1.25rem;
    line-height: 1.25;
    margin-bottom: 0.2rem;
}
.mh-bottom-nav a span {
    display: block;
    overflow-wrap: anywhere;
}
.mh-bottom-nav a:hover { color: var(--mh-primary); }

.mh-feedback-widget {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1025;
    max-width: min(19rem, calc(100vw - 2rem));
}
.mh-feedback-widget summary {
    cursor: pointer;
    list-style: none;
    background: var(--mh-navy);
    color: #fff;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    padding: 0.55rem 0.85rem;
    box-shadow: var(--mh-shadow);
    font-size: 0.78rem;
    font-weight: 600;
}
.mh-feedback-widget summary::-webkit-details-marker { display: none; }
.mh-feedback-form {
    margin-bottom: 0.5rem;
    padding: 0.85rem;
    background: var(--mh-card-bg);
    border: 1px solid var(--mh-border);
    border-radius: 0.65rem;
    box-shadow: var(--mh-shadow);
}
.mh-feedback-form textarea { resize: vertical; }

.mh-category-pill {
    border: 1px solid var(--mh-border);
    border-radius: 0.6rem;
    padding: 0.7rem 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--mh-text);
    text-decoration: none;
    background-color: var(--mh-card-bg);
    font-size: 0.85rem;
    min-height: 2.5rem;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.mh-category-pill[aria-current="page"],
.mh-category-pill:hover,
.mh-category-pill:focus-visible {
    background-color: var(--mh-navy);
    border-color: var(--mh-navy);
    color: #fff;
    transform: translateY(-1px);
}
.mh-category-pill:hover {
    text-decoration: none;
}
.mh-category-pill i { color: #2563eb; }
.mh-category-pill:nth-child(4n + 2) i { color: #7c3aed; }
.mh-category-pill:nth-child(4n + 3) i { color: #f97316; }
.mh-category-pill:nth-child(4n + 4) i { color: #ef4444; }

.mh-feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.mh-feature {
    text-align: center;
    padding: 1.1rem 0.6rem;
    border: 1px solid var(--mh-border);
    border-radius: 0.75rem;
    background: var(--mh-card-bg);
    box-shadow: 0 8px 20px rgba(11, 18, 32, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.mh-feature:hover,
.mh-feature:focus-visible {
    transform: scale(1.025);
    box-shadow: var(--mh-shadow);
}
.mh-feature-icon { width: 3rem; height: 3rem; margin: 0 auto 0.65rem; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 1.25rem; }
.mh-feature:nth-child(4n + 1) .mh-feature-icon { background: #22c55e; }
.mh-feature:nth-child(4n + 2) .mh-feature-icon { background: #7c3aed; }
.mh-feature:nth-child(4n + 3) .mh-feature-icon { background: #f97316; }
.mh-feature:nth-child(4n + 4) .mh-feature-icon { background: #ef4444; }
.mh-feature-label { font-size: 0.82rem; font-weight: 700; }

.mh-section-title {
    font-weight: 700;
    border-left: 0;
    padding-left: 0;
    margin-bottom: 1.25rem;
    letter-spacing: 0.01em;
}
.mh-section-title::after { content: ""; display: block; width: 2.3rem; height: 0.2rem; margin-top: 0.45rem; background: var(--mh-primary); border-radius: 99px; }

.mh-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--mh-primary);
    display: block;
    flex: 0 0 auto;
}
.mh-avatar-sm { width: 48px; height: 48px; }
.mh-avatar-lg { width: 96px; height: 96px; }
.mh-card img.mh-avatar-sm { width: 48px; height: 48px; }
.mh-card img.mh-avatar-lg { width: 96px; height: 96px; }

.mh-profile-card,
.mh-profile-header,
.mh-profile-summary,
.mh-profile-tab-content,
.mh-profile-tab-content .tab-pane {
    min-width: 0;
    max-width: 100%;
}
.mh-profile-name,
.mh-profile-institution,
.mh-profile-bio,
.mh-profile-skills,
.mh-profile-tab-content h3,
.mh-profile-tab-content p {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.mh-profile-roles,
.mh-profile-actions,
.mh-profile-tabs {
    max-width: 100%;
}
.mh-profile-roles .badge {
    white-space: normal;
    overflow-wrap: anywhere;
}
.mh-profile-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
}
.mh-profile-tabs .nav-link {
    white-space: nowrap;
}
.mh-profile-tab-content .row {
    min-width: 0;
}

.mh-star { color: var(--mh-accent); }

@media (max-width: 991.98px) {
    .mh-navbar .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1041;
        padding: 0.75rem 1rem 1rem;
        max-height: calc(100vh - 4.5rem);
        overflow-y: auto;
        background: var(--mh-card-bg);
        border-bottom: 1px solid var(--mh-border);
        box-shadow: 0 16px 30px rgba(11, 18, 32, 0.18);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-0.5rem);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
        display: block;
    }

    .mh-navbar .navbar-collapse.show {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    .mh-navbar .navbar-toggler {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .mh-navbar .navbar-nav {
        align-items: stretch !important;
        gap: 0.15rem;
    }

    .mh-navbar .navbar-nav .nav-item,
    .mh-navbar .navbar-nav .nav-link,
    .mh-navbar .navbar-nav .btn {
        width: 100%;
    }

    .mh-navbar .navbar-nav .nav-link,
    .mh-navbar .navbar-nav .btn {
        justify-content: flex-start;
    }

    .mh-navbar .navbar-nav .nav-link.position-relative { width: 100%; }

    .mh-nav-links {
        padding-bottom: 0.25rem;
    }
}

.mh-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1030;
    background: rgba(11, 18, 32, 0.42);
}
.mh-nav-backdrop[hidden] { display: none !important; }
.mh-menu-open { overflow: hidden; }

@media (max-width: 575.98px) {
    body {
        padding-bottom: 76px;
    }

    .mh-main {
        margin-top: 1rem !important;
        padding-bottom: 1rem;
    }

    .mh-checkout-page {
        padding-bottom: 5.5rem;
    }

    .mh-card {
        border-radius: 0.6rem;
    }

    .container {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    h1, .h1 { font-size: 1.65rem; }
    h2, .h2 { font-size: 1.35rem; }
    .display-6 { font-size: 2rem; }
    .mh-hero { padding: 1.75rem 1rem; }
    .mh-hero h1 { font-size: clamp(1.75rem, 8vw, 2.2rem); line-height: 1.12; }
    .mh-hero .lead { font-size: 1rem; }

    .row > [class*="col-"] {
        min-width: 0;
    }

    .mh-bottom-nav {
        padding: 0.45rem 0.15rem calc(0.45rem + env(safe-area-inset-bottom));
    }

    .mh-feedback-widget {
        right: 0.75rem;
        bottom: 5.25rem;
    }

    .mh-bottom-nav a {
        font-size: 0.68rem;
    }

    .mh-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; }
}
