/*
 * Mahiti Sindhu Student Corner — Premium UI v3
 * Shared visual system for every Student Corner page.
 * Loaded after legacy styles so the portal remains backward compatible.
 */

:root {
    --ms3-navy: #07152f;
    --ms3-navy-2: #102a56;
    --ms3-blue: #2457e6;
    --ms3-blue-2: #4f7cff;
    --ms3-cyan: #00a7b5;
    --ms3-green: #0f9f74;
    --ms3-gold: #f4b740;
    --ms3-red: #dc4a5d;
    --ms3-ink: #152238;
    --ms3-text: #3e4b61;
    --ms3-muted: #718096;
    --ms3-bg: #f3f7fc;
    --ms3-surface: #ffffff;
    --ms3-soft: #edf3ff;
    --ms3-line: #dce5f2;
    --ms3-shadow-sm: 0 8px 24px rgba(17, 37, 75, .08);
    --ms3-shadow: 0 20px 55px rgba(17, 37, 75, .12);
    --ms3-shadow-lg: 0 32px 90px rgba(7, 21, 47, .18);
    --ms3-radius-sm: 14px;
    --ms3-radius: 22px;
    --ms3-radius-lg: 30px;
    --ms3-max: 1240px;
}

html { scroll-behavior: smooth; }

body.ms-premium-ui {
    margin: 0;
    color: var(--ms3-ink);
    background:
        radial-gradient(circle at 5% -5%, rgba(79,124,255,.14), transparent 30rem),
        radial-gradient(circle at 98% 7%, rgba(0,167,181,.11), transparent 27rem),
        linear-gradient(180deg, #f8fbff 0, var(--ms3-bg) 42rem, #f7f9fc 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
}

body.ms-premium-ui * { box-sizing: border-box; }
body.ms-premium-ui img { max-width: 100%; }
body.ms-premium-ui a { text-underline-offset: 3px; }
body.ms-premium-ui :focus-visible {
    outline: 3px solid rgba(36,87,230,.35);
    outline-offset: 3px;
}
body.ms-premium-ui ::selection { background: rgba(36,87,230,.2); }

.ms-skip-link {
    position: fixed;
    left: 16px;
    top: -80px;
    z-index: 100000;
    padding: 11px 16px;
    border-radius: 12px;
    color: #fff;
    background: var(--ms3-navy);
    font-weight: 800;
    transition: top .2s ease;
}
.ms-skip-link:focus { top: 14px; }

/* ---------- Global premium header ---------- */
.ms3-site-header {
    position: sticky;
    top: 0;
    z-index: 9990;
    border-bottom: 1px solid rgba(220,229,242,.86);
    background: rgba(255,255,255,.93);
    backdrop-filter: blur(18px) saturate(150%);
    box-shadow: 0 10px 35px rgba(7,21,47,.07);
}
.ms3-header-inner {
    width: min(calc(100% - 28px), var(--ms3-max));
    min-height: 70px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 22px;
}
.ms3-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--ms3-navy) !important;
    text-decoration: none !important;
    flex: 0 0 auto;
}
.ms3-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, var(--ms3-blue), var(--ms3-cyan));
    box-shadow: 0 11px 24px rgba(36,87,230,.25);
    font-size: 20px;
}
.ms3-brand-copy strong {
    display: block;
    font-size: 17px;
    line-height: 1.08;
    letter-spacing: -.3px;
}
.ms3-brand-copy small {
    display: block;
    margin-top: 4px;
    color: var(--ms3-muted);
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
}
.ms3-global-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}
.ms3-global-nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 12px;
    border-radius: 13px;
    color: #42516a !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 760;
    white-space: nowrap;
    transition: .2s ease;
}
.ms3-global-nav a:hover,
.ms3-global-nav a.active {
    color: var(--ms3-blue) !important;
    background: var(--ms3-soft);
}
.ms3-header-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    color: #fff !important;
    background: linear-gradient(135deg, var(--ms3-blue), #1946c8);
    border-radius: 14px;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 850;
    box-shadow: 0 10px 22px rgba(36,87,230,.22);
    white-space: nowrap;
}
.ms3-header-cta:hover { transform: translateY(-1px); }

/* ---------- Student section navigation ---------- */
.ms3-student-bar {
    position: sticky;
    top: 70px;
    z-index: 9980;
    border-bottom: 1px solid rgba(207,220,238,.9);
    background: rgba(242,247,255,.94);
    backdrop-filter: blur(15px);
}
.ms3-student-bar-inner {
    width: min(calc(100% - 28px), var(--ms3-max));
    min-height: 52px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
}
.ms3-student-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ms3-navy);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}
.ms3-student-title i { color: var(--ms3-blue); }
.ms3-student-links {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 6px 0;
}
.ms3-student-links::-webkit-scrollbar { display: none; }
.ms3-student-links a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #4b5b73 !important;
    text-decoration: none !important;
    font-size: 12.5px;
    font-weight: 780;
    white-space: nowrap;
    transition: .2s ease;
}
.ms3-student-links a:hover,
.ms3-student-links a.active {
    color: var(--ms3-blue) !important;
    border-color: #cbd9f3;
    background: #fff;
    box-shadow: 0 6px 16px rgba(36,87,230,.08);
}

/* Make the existing homepage header follow the same language. */
body.ms-premium-ui .ms-site-header,
body.ms-premium-ui .ms-header,
body.ms-premium-ui .ms-fallback-header {
    border-bottom-color: rgba(220,229,242,.9) !important;
    background: rgba(255,255,255,.94) !important;
    backdrop-filter: blur(18px) saturate(150%);
    box-shadow: 0 10px 35px rgba(7,21,47,.07) !important;
}
body.ms-premium-ui .ms-site-header { position: sticky; top: 0; z-index: 9990; }
body.ms-premium-ui .ms-student-strip { background: rgba(242,247,255,.95) !important; }

/* ---------- Layout normalization ---------- */
body.ms-premium-ui .container,
body.ms-premium-ui .wrap,
body.ms-premium-ui .seo-container,
body.ms-premium-ui .course-guide-container,
body.ms-premium-ui .sc-container,
body.ms-premium-ui main {
    max-width: var(--ms3-max);
}
body.ms-premium-ui .container {
    width: min(calc(100% - 28px), var(--ms3-max));
    padding-left: 0 !important;
    padding-right: 0 !important;
}
body.ms-premium-ui main[role="main"] { min-height: 55vh; }

/* ---------- Existing heroes, upgraded ---------- */
body.ms-premium-ui .hero,
body.ms-premium-ui .estimator-hero,
body.ms-premium-ui .sc-hero,
body.ms-premium-ui .cg-hero,
body.ms-premium-ui .seo-hero,
body.ms-premium-ui .premium-hero,
body.ms-premium-ui .page-hero,
body.ms-premium-ui .district-hero,
body.ms-premium-ui .college-hero,
body.ms-premium-ui .course-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.18) !important;
    border-radius: var(--ms3-radius-lg) !important;
    background:
        radial-gradient(circle at 85% 12%, rgba(61,198,205,.26), transparent 26rem),
        radial-gradient(circle at 5% 90%, rgba(79,124,255,.24), transparent 26rem),
        linear-gradient(135deg, #07152f 0%, #102a56 52%, #163a76 100%) !important;
    box-shadow: var(--ms3-shadow-lg) !important;
}
body.ms-premium-ui .hero::before,
body.ms-premium-ui .estimator-hero::before,
body.ms-premium-ui .sc-hero::before,
body.ms-premium-ui .seo-hero::before {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    right: -160px;
    top: -170px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    pointer-events: none;
}
body.ms-premium-ui .hero h1,
body.ms-premium-ui .estimator-hero h1,
body.ms-premium-ui .sc-hero h1,
body.ms-premium-ui .cg-hero h1,
body.ms-premium-ui .seo-hero h1,
body.ms-premium-ui .page-hero h1 {
    color: #fff !important;
    letter-spacing: -.035em;
    text-wrap: balance;
}
body.ms-premium-ui .hero p,
body.ms-premium-ui .estimator-hero p,
body.ms-premium-ui .sc-hero p,
body.ms-premium-ui .cg-hero p,
body.ms-premium-ui .seo-hero p,
body.ms-premium-ui .page-hero p {
    color: rgba(239,246,255,.86) !important;
    max-width: 800px;
}
body.ms-premium-ui .hero-search {
    border: 1px solid rgba(255,255,255,.55);
    box-shadow: 0 20px 50px rgba(0,0,0,.24) !important;
}
body.ms-premium-ui .shape { opacity: .22 !important; }

/* ---------- Cards and panels ---------- */
body.ms-premium-ui .section,
body.ms-premium-ui .box,
body.ms-premium-ui .filter-box,
body.ms-premium-ui .result-box,
body.ms-premium-ui .note-box,
body.ms-premium-ui .suggestions,
body.ms-premium-ui .quick-box,
body.ms-premium-ui .premium-panel,
body.ms-premium-ui .seo-panel,
body.ms-premium-ui .faq-box,
body.ms-premium-ui .ms-suggestions-wrap,
body.ms-premium-ui .guide,
body.ms-premium-ui .search-box,
body.ms-premium-ui .content-card {
    border: 1px solid var(--ms3-line) !important;
    background: rgba(255,255,255,.96) !important;
    border-radius: var(--ms3-radius) !important;
    box-shadow: var(--ms3-shadow-sm) !important;
}
body.ms-premium-ui .section,
body.ms-premium-ui .box,
body.ms-premium-ui .filter-box,
body.ms-premium-ui .result-box,
body.ms-premium-ui .premium-panel,
body.ms-premium-ui .seo-panel,
body.ms-premium-ui .faq-box { padding: clamp(20px, 3vw, 30px) !important; }

body.ms-premium-ui .service-card,
body.ms-premium-ui .card,
body.ms-premium-ui .action-card,
body.ms-premium-ui .item,
body.ms-premium-ui .course-card,
body.ms-premium-ui .info-box,
body.ms-premium-ui .hostel-card,
body.ms-premium-ui .result-card,
body.ms-premium-ui .seo-link-card,
body.ms-premium-ui .info-card,
body.ms-premium-ui .college-card {
    border: 1px solid var(--ms3-line) !important;
    border-radius: 19px !important;
    background: #fff !important;
    box-shadow: 0 10px 28px rgba(17,37,75,.07) !important;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease !important;
}
body.ms-premium-ui .service-card:hover,
body.ms-premium-ui .card:hover,
body.ms-premium-ui .action-card:hover,
body.ms-premium-ui .item:hover,
body.ms-premium-ui .course-card:hover,
body.ms-premium-ui .hostel-card:hover,
body.ms-premium-ui .result-card:hover,
body.ms-premium-ui .seo-link-card:hover,
body.ms-premium-ui .college-card:hover {
    transform: translateY(-4px) !important;
    border-color: #b8caee !important;
    box-shadow: var(--ms3-shadow) !important;
}
body.ms-premium-ui .service-card { min-height: 230px !important; }
body.ms-premium-ui .service-card::before { opacity: .08 !important; }

body.ms-premium-ui h1,
body.ms-premium-ui h2,
body.ms-premium-ui h3 { color: var(--ms3-ink); }
body.ms-premium-ui h1 { font-weight: 900; }
body.ms-premium-ui h2 { letter-spacing: -.025em; text-wrap: balance; }
body.ms-premium-ui p { color: var(--ms3-text); }
body.ms-premium-ui .meta,
body.ms-premium-ui .muted { color: var(--ms3-muted) !important; }

/* ---------- Student journey rail ---------- */
.ms3-journey {
    width: min(calc(100% - 28px), var(--ms3-max));
    margin: 18px auto 26px;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    border: 1px solid var(--ms3-line);
    border-radius: 20px;
    background: rgba(255,255,255,.93);
    box-shadow: var(--ms3-shadow-sm);
}
.ms3-journey-step {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 58px;
    padding: 10px 12px;
    border-radius: 15px;
    color: var(--ms3-ink) !important;
    text-decoration: none !important;
    transition: .2s ease;
}
.ms3-journey-step:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -6px;
    width: 12px;
    height: 2px;
    background: #cbd8ea;
}
.ms3-journey-step:hover,
.ms3-journey-step.active { background: var(--ms3-soft); }
.ms3-step-no {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--ms3-blue), var(--ms3-blue-2));
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 8px 17px rgba(36,87,230,.2);
}
.ms3-step-copy strong { display: block; font-size: 13px; }
.ms3-step-copy small { display: block; margin-top: 2px; color: var(--ms3-muted); font-size: 11px; }

/* ---------- Forms ---------- */
body.ms-premium-ui label {
    color: #263854;
    font-size: 13px;
    font-weight: 820 !important;
}
body.ms-premium-ui input:not([type="checkbox"]):not([type="radio"]),
body.ms-premium-ui select,
body.ms-premium-ui textarea {
    min-height: 48px;
    padding: 11px 13px !important;
    border: 1px solid #cbd7e8 !important;
    border-radius: 13px !important;
    color: var(--ms3-ink) !important;
    background: #fff !important;
    font: inherit;
    box-shadow: 0 1px 0 rgba(17,37,75,.02);
    transition: border-color .2s ease, box-shadow .2s ease;
}
body.ms-premium-ui input:focus,
body.ms-premium-ui select:focus,
body.ms-premium-ui textarea:focus {
    border-color: var(--ms3-blue) !important;
    box-shadow: 0 0 0 4px rgba(36,87,230,.11) !important;
    outline: 0 !important;
}
body.ms-premium-ui button,
body.ms-premium-ui .btn,
body.ms-premium-ui .button,
body.ms-premium-ui input[type="submit"] {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 13px !important;
    padding: 11px 18px !important;
    color: #fff !important;
    background: linear-gradient(135deg, var(--ms3-blue), #1745c9) !important;
    font-weight: 850 !important;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(36,87,230,.2);
    transition: transform .2s ease, box-shadow .2s ease;
}
body.ms-premium-ui button:hover,
body.ms-premium-ui .btn:hover,
body.ms-premium-ui .button:hover,
body.ms-premium-ui input[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(36,87,230,.25);
}
.ms3-form-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.ms3-clear-button {
    min-height: 44px !important;
    color: #31415b !important;
    background: #eef3f9 !important;
    box-shadow: none !important;
}
.ms3-form-help {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 2px 0 5px;
    padding: 11px 13px;
    border-radius: 13px;
    color: #36506f;
    background: #edf5ff;
    border: 1px solid #d4e5ff;
    font-size: 12.5px;
}
.ms3-form-help i { margin-top: 3px; color: var(--ms3-blue); }

/* Searchable select replacement */
.ms-smart-select { position: relative; width: 100%; }
.ms-smart-select > select.ms-original-select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.ms-smart-control {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 11px;
    border: 1px solid #cbd7e8;
    border-radius: 13px;
    background: #fff;
    cursor: text;
    transition: .2s ease;
}
.ms-smart-select.open .ms-smart-control,
.ms-smart-control:focus-within {
    border-color: var(--ms3-blue);
    box-shadow: 0 0 0 4px rgba(36,87,230,.11);
}
.ms-smart-control i { color: var(--ms3-blue); font-size: 13px; }
.ms-smart-input {
    width: 100% !important;
    min-height: 32px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    font-size: 14px !important;
}
.ms-smart-toggle {
    width: 26px;
    height: 26px;
    min-height: 26px !important;
    padding: 0 !important;
    border-radius: 9px !important;
    color: #52627a !important;
    background: #edf2f8 !important;
    box-shadow: none !important;
}
.ms-smart-menu {
    position: absolute;
    z-index: 10020;
    left: 0;
    right: 0;
    top: calc(100% + 7px);
    display: none;
    max-height: 285px;
    overflow: auto;
    padding: 7px;
    border: 1px solid #cbd7e8;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 20px 45px rgba(7,21,47,.18);
}
.ms-smart-select.open .ms-smart-menu { display: block; }
.ms-smart-option {
    width: 100%;
    min-height: 39px !important;
    justify-content: flex-start !important;
    padding: 9px 10px !important;
    border-radius: 10px !important;
    color: #31415b !important;
    background: transparent !important;
    box-shadow: none !important;
    text-align: left;
    font-size: 13px;
    font-weight: 650 !important;
}
.ms-smart-option:hover,
.ms-smart-option.active {
    color: var(--ms3-blue) !important;
    background: var(--ms3-soft) !important;
    transform: none !important;
}
.ms-smart-empty { padding: 14px; color: var(--ms3-muted); font-size: 13px; text-align: center; }

/* ---------- Tables ---------- */
.ms-table-shell {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--ms3-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 9px 26px rgba(17,37,75,.06);
}
body.ms-premium-ui table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: #fff;
}
body.ms-premium-ui th {
    padding: 13px 14px !important;
    color: #2d405f !important;
    background: #eef4fb !important;
    border-bottom: 1px solid #d5e0ee !important;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .035em;
}
body.ms-premium-ui td {
    padding: 14px !important;
    color: #3e4b61;
    border-bottom: 1px solid #e8eef6 !important;
    vertical-align: top;
}
body.ms-premium-ui tbody tr:hover td { background: #f8fbff; }
body.ms-premium-ui tbody tr:last-child td { border-bottom: 0 !important; }

/* ---------- Badges, breadcrumbs, pagination ---------- */
body.ms-premium-ui .badge,
body.ms-premium-ui .chip,
body.ms-premium-ui .tag {
    border-radius: 999px !important;
}
body.ms-premium-ui .breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    color: var(--ms3-muted);
    font-size: 12.5px;
}
body.ms-premium-ui .breadcrumb a { color: var(--ms3-blue); font-weight: 760; }
body.ms-premium-ui .pagination a,
body.ms-premium-ui .pagination span {
    min-width: 40px;
    min-height: 40px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px !important;
    border: 1px solid var(--ms3-line);
    background: #fff;
    color: #41516a;
    font-weight: 800;
}
body.ms-premium-ui .pagination .active,
body.ms-premium-ui .pagination a:hover { background: var(--ms3-blue); color: #fff; border-color: var(--ms3-blue); }

/* ---------- AdSense placements ---------- */
.ms-ad-shell,
body.ms-premium-ui .ms-ad-box,
body.ms-premium-ui .ms-seo-ad,
body.ms-premium-ui .ms-course-ad,
body.ms-premium-ui .ms-kar-ad {
    width: 100%;
    max-width: 1100px;
    min-height: 118px !important;
    margin: 24px auto !important;
    padding: 9px !important;
    border: 1px dashed #ced9e8 !important;
    border-radius: 17px !important;
    background: rgba(248,250,253,.82) !important;
    overflow: hidden;
    transition: opacity .25s ease, min-height .25s ease, margin .25s ease, padding .25s ease;
}
.ms-ad-caption,
body.ms-premium-ui .ms-ad-label,
body.ms-premium-ui .ms-seo-ad-label,
body.ms-premium-ui .ms-course-ad-label,
body.ms-premium-ui .ms-kar-ad-label {
    margin: 0 0 6px !important;
    color: #8a96a8 !important;
    font-size: 9.5px !important;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-align: center;
}
.ms-ad-shell ins.adsbygoogle,
body.ms-premium-ui .ms-ad-box ins.adsbygoogle { min-height: 90px !important; }
.ms-ad-shell.ms-ad-collapsed,
body.ms-premium-ui .ms-ad-box.ms-ad-collapsed,
body.ms-premium-ui .ms-seo-ad.ms-ad-collapsed,
body.ms-premium-ui .ms-course-ad.ms-ad-collapsed,
body.ms-premium-ui .ms-kar-ad.ms-ad-collapsed {
    min-height: 0 !important;
    max-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0;
}
.ms-ad-debug {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 10050;
    width: min(360px, calc(100vw - 28px));
    padding: 14px;
    border-radius: 16px;
    color: #dce9ff;
    background: rgba(7,21,47,.96);
    box-shadow: 0 18px 50px rgba(0,0,0,.28);
    font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ms-ad-debug strong { color: #fff; }
.ms-ad-debug code { color: #73e7d0; }

/* ---------- Student help drawer ---------- */
.ms3-help-button {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 10010;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 16px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--ms3-navy-2), var(--ms3-blue));
    box-shadow: 0 16px 35px rgba(7,21,47,.28);
    font-weight: 850;
    cursor: pointer;
}
.ms3-help-overlay {
    position: fixed;
    inset: 0;
    z-index: 10030;
    display: none;
    background: rgba(7,21,47,.52);
    backdrop-filter: blur(4px);
}
.ms3-help-overlay.open { display: block; }
.ms3-help-drawer {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(430px, 92vw);
    padding: 22px;
    overflow-y: auto;
    background: #fff;
    box-shadow: -25px 0 70px rgba(0,0,0,.22);
}
.ms3-help-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ms3-help-head h2 { margin: 0; font-size: 24px; }
.ms3-help-head p { margin: 5px 0 0; color: var(--ms3-muted); font-size: 13px; }
.ms3-close-help {
    min-width: 40px;
    width: 40px;
    min-height: 40px !important;
    padding: 0 !important;
    color: #42516a !important;
    background: #eef3f9 !important;
    box-shadow: none !important;
}
.ms3-help-actions { display: grid; gap: 10px; margin-top: 20px; }
.ms3-help-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--ms3-line);
    border-radius: 16px;
    color: var(--ms3-ink) !important;
    background: #fff;
    text-decoration: none !important;
    transition: .2s ease;
}
.ms3-help-action:hover { background: var(--ms3-soft); border-color: #b8caee; transform: translateY(-1px); }
.ms3-help-action i {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--ms3-blue), var(--ms3-cyan));
}
.ms3-help-action strong { display: block; font-size: 14px; }
.ms3-help-action small { display: block; margin-top: 2px; color: var(--ms3-muted); font-size: 11.5px; }
.ms3-safety-note {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid #f1d29d;
    border-radius: 16px;
    color: #745316;
    background: #fff9e9;
    font-size: 12.5px;
}
.ms3-recent { margin-top: 20px; }
.ms3-recent h3 { margin: 0 0 10px; font-size: 15px; }
.ms3-recent a { display: block; padding: 9px 0; border-bottom: 1px solid #edf1f6; color: var(--ms3-blue); font-size: 12.5px; }

/* ---------- Mobile dock ---------- */
.ms3-mobile-dock { display: none; }

/* ---------- Footer ---------- */
.ms3-footer {
    margin-top: 44px;
    padding: 38px 16px 105px;
    color: #c9d7ed;
    background:
        radial-gradient(circle at 80% 0, rgba(36,87,230,.28), transparent 22rem),
        var(--ms3-navy);
}
.ms3-footer-inner {
    width: min(100%, var(--ms3-max));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.3fr .7fr .7fr;
    gap: 28px;
}
.ms3-footer h3 { color: #fff !important; margin: 0 0 10px; }
.ms3-footer p { color: #aebdd4 !important; max-width: 520px; font-size: 13px; }
.ms3-footer a { display: block; margin: 7px 0; color: #dce8f8 !important; text-decoration: none; font-size: 13px; }
.ms3-footer a:hover { color: #fff !important; }
.ms3-footer-note { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); color: #8fa2bf; font-size: 11.5px; }

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

@media (max-width: 1050px) {
    .ms3-global-nav a span { display: none; }
    .ms3-header-cta { display: none; }
    .ms3-journey { grid-template-columns: repeat(2, 1fr); }
    .ms3-journey-step:nth-child(2)::after { display: none; }
}

@media (max-width: 760px) {
    body.ms-premium-ui { padding-bottom: 72px; }
    .ms3-site-header { position: relative; }
    .ms3-header-inner { min-height: 62px; }
    .ms3-global-nav { display: none; }
    .ms3-brand-copy small { display: none; }
    .ms3-header-cta { display: inline-flex; margin-left: auto; padding: 9px 12px; }
    .ms3-student-bar { top: 0; }
    .ms3-student-title { display: none; }
    .ms3-student-bar-inner { width: 100%; padding: 0 10px; }
    .ms3-student-links { width: 100%; }
    .ms3-student-links a { min-height: 35px; padding: 7px 10px; }

    body.ms-premium-ui .hero,
    body.ms-premium-ui .estimator-hero,
    body.ms-premium-ui .sc-hero,
    body.ms-premium-ui .cg-hero,
    body.ms-premium-ui .seo-hero,
    body.ms-premium-ui .page-hero {
        border-radius: 22px !important;
    }
    body.ms-premium-ui .hero h1,
    body.ms-premium-ui .estimator-hero h1,
    body.ms-premium-ui .sc-hero h1,
    body.ms-premium-ui .cg-hero h1,
    body.ms-premium-ui .seo-hero h1 { font-size: clamp(29px, 8vw, 38px) !important; }

    .ms3-journey {
        width: min(calc(100% - 20px), var(--ms3-max));
        grid-template-columns: 1fr 1fr;
        padding: 10px;
        gap: 6px;
    }
    .ms3-journey-step { min-height: 52px; padding: 8px; }
    .ms3-journey-step::after { display: none !important; }
    .ms3-step-copy small { display: none; }

    .ms3-help-button { right: 13px; bottom: 82px; width: 48px; height: 48px; padding: 0; justify-content: center; }
    .ms3-help-button span { display: none; }

    .ms3-mobile-dock {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 9px;
        z-index: 10020;
        min-height: 62px;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        border: 1px solid rgba(208,220,238,.95);
        border-radius: 19px;
        background: rgba(255,255,255,.96);
        backdrop-filter: blur(18px);
        box-shadow: 0 17px 45px rgba(7,21,47,.22);
        overflow: hidden;
    }
    .ms3-mobile-dock a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: #637087 !important;
        text-decoration: none !important;
        font-size: 9.5px;
        font-weight: 780;
    }
    .ms3-mobile-dock a i { font-size: 17px; }
    .ms3-mobile-dock a.active { color: var(--ms3-blue) !important; background: #edf3ff; }

    .ms3-footer-inner { grid-template-columns: 1fr; }

    .ms-table-shell { border: 0; background: transparent; box-shadow: none; overflow: visible; }
    table.ms-responsive-table thead { display: none; }
    table.ms-responsive-table,
    table.ms-responsive-table tbody,
    table.ms-responsive-table tr,
    table.ms-responsive-table td { display: block; width: 100%; }
    table.ms-responsive-table tr {
        margin-bottom: 13px;
        border: 1px solid var(--ms3-line);
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 8px 20px rgba(17,37,75,.06);
        overflow: hidden;
    }
    table.ms-responsive-table td {
        display: grid;
        grid-template-columns: minmax(105px, 37%) 1fr;
        gap: 10px;
        padding: 11px 13px !important;
        border-bottom: 1px solid #edf1f6 !important;
    }
    table.ms-responsive-table td::before {
        content: attr(data-label);
        color: #617087;
        font-size: 10.5px;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: .035em;
    }
    table.ms-responsive-table td:last-child { border-bottom: 0 !important; }

    .ms-ad-shell,
    body.ms-premium-ui .ms-ad-box,
    body.ms-premium-ui .ms-seo-ad,
    body.ms-premium-ui .ms-course-ad,
    body.ms-premium-ui .ms-kar-ad {
        min-height: 100px !important;
        margin: 18px auto !important;
        border-radius: 14px !important;
    }
}

@media (max-width: 480px) {
    .ms3-header-inner { width: min(calc(100% - 18px), var(--ms3-max)); }
    .ms3-brand-mark { width: 39px; height: 39px; border-radius: 13px; }
    .ms3-brand-copy strong { font-size: 15px; }
    .ms3-header-cta span { display: none; }
    .ms3-journey { grid-template-columns: 1fr; }
    .ms3-step-copy small { display: block; }
    .ms3-form-actions > * { width: 100%; }
}

/* --------------------------------------------------------------------------
   Homepage student-first journey panel
   -------------------------------------------------------------------------- */
body.ms-premium-ui .ms3-hero-search {
    width: min(760px, 100%);
    margin: 24px auto 0;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid rgba(255,255,255,.32);
    border-radius: 19px;
    background: rgba(255,255,255,.98);
    box-shadow: 0 20px 55px rgba(4,18,47,.28);
}
body.ms-premium-ui .ms3-hero-search > i {
    display: grid;
    place-items: center;
    color: #55749f;
    font-size: 16px;
}
body.ms-premium-ui .ms3-hero-search input {
    min-width: 0;
    height: 50px;
    padding: 0 16px;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    color: var(--ms3-ink);
    font: inherit;
    font-size: 15px;
    box-shadow: none !important;
}
body.ms-premium-ui .ms3-hero-search input::placeholder { color: #77859a; }
body.ms-premium-ui .ms3-hero-search button {
    min-height: 50px;
    padding: 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--ms3-blue), #0b68e8);
    color: #fff;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(22,91,211,.27);
}

.ms3-start-panel {
    width: min(calc(100% - 32px), var(--ms3-max));
    margin: 30px auto 38px;
    padding: clamp(22px, 4vw, 38px);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--ms3-line);
    border-radius: 28px;
    background:
        radial-gradient(circle at 95% -5%, rgba(38,168,255,.14), transparent 33%),
        radial-gradient(circle at -5% 105%, rgba(38,207,170,.11), transparent 34%),
        #fff;
    box-shadow: var(--ms3-shadow-lg);
}
.ms3-start-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--ms3-blue), var(--ms3-cyan), var(--ms3-green));
}
.ms3-start-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 22px;
    margin-bottom: 23px;
}
.ms3-start-heading > div { max-width: 680px; }
.ms3-start-heading > div > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    color: var(--ms3-blue);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.ms3-start-heading h2 {
    margin: 0 0 8px;
    color: var(--ms3-ink);
    font-size: clamp(25px, 3.4vw, 38px);
    line-height: 1.12;
    letter-spacing: -.035em;
}
.ms3-start-heading p {
    margin: 0;
    color: var(--ms3-muted);
    line-height: 1.7;
}
.ms3-start-university {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 1px solid #c9d9f5;
    border-radius: 13px;
    background: #f3f7ff;
    color: var(--ms3-blue) !important;
    text-decoration: none !important;
    font-weight: 850;
    white-space: nowrap;
}
.ms3-start-university:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(30,88,180,.12); }
.ms3-start-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.ms3-start-card {
    min-width: 0;
    padding: 18px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    border: 1px solid #e1e8f2;
    border-radius: 18px;
    background: rgba(255,255,255,.88);
    color: inherit !important;
    text-decoration: none !important;
    box-shadow: 0 8px 22px rgba(14,37,77,.055);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.ms3-start-card:hover {
    transform: translateY(-4px);
    border-color: #bdd0ee;
    box-shadow: 0 17px 35px rgba(17,48,99,.11);
}
.ms3-start-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    font-size: 19px;
}
.ms3-start-icon.blue { color: #135bd3; background: #eaf2ff; }
.ms3-start-icon.purple { color: #7a46d9; background: #f2ebff; }
.ms3-start-icon.green { color: #16835e; background: #e7f8f1; }
.ms3-start-icon.gold { color: #a86b00; background: #fff4d8; }
.ms3-start-icon.cyan { color: #087b9a; background: #e4f8fd; }
.ms3-start-icon.red { color: #c53d4d; background: #ffedf0; }
.ms3-start-card > .ms3-start-icon { grid-row: 1 / span 3; }
.ms3-start-card strong {
    grid-column: 2;
    display: block;
    margin-bottom: 3px;
    color: var(--ms3-ink);
    font-size: 15px;
    line-height: 1.28;
}
.ms3-start-card small {
    grid-column: 2;
    display: block;
    color: var(--ms3-muted);
    font-size: 12px;
    line-height: 1.45;
}
.ms3-start-card em {
    grid-column: 2;
    display: block;
    color: var(--ms3-muted);
    font-size: 12px;
    font-style: normal;
    line-height: 1.45;
}
.ms3-start-card em i { margin-left: 5px; font-size: 10px; }

@media (max-width: 900px) {
    .ms3-start-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    body.ms-premium-ui .ms3-hero-search { grid-template-columns: 34px minmax(0, 1fr); padding: 7px; }
    body.ms-premium-ui .ms3-hero-search input { height: 46px; }
    body.ms-premium-ui .ms3-hero-search button { grid-column: 1 / -1; width: 100%; min-height: 46px; }
    .ms3-start-panel { width: min(calc(100% - 20px), var(--ms3-max)); padding: 21px 15px; border-radius: 22px; }
    .ms3-start-heading { display: block; }
    .ms3-start-university { margin-top: 15px; width: 100%; justify-content: center; }
    .ms3-start-grid { grid-template-columns: 1fr; gap: 10px; }
    .ms3-start-card { padding: 14px; }
}
