:root {
    --nav-offset: 86px;
    --brand-teal: #004D40;
    --brand-mint: #A8D5BA;
    --brand-sand: #E8D5B7;
    --brand-offwhite: #FAF9F5;
    --bg-dark: #FAF9F5;
    --glass-bg: #ffffff;
    --glass-border: rgba(0, 77, 64, 0.08);
    --text-main: #1C2E2A;
    --text-muted: #5A706A;
    --font-head: "Outfit", sans-serif;
    --font-body: "Outfit", sans-serif;
    --font-tagline: "Prata", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.mw-app {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    padding-top: var(--nav-offset);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(168, 213, 186, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(232, 213, 183, 0.2) 0%, transparent 50%);
}

a { color: var(--brand-teal); }

.nav-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(250, 249, 245, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 25px rgba(0, 77, 64, 0.02);
}

.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    gap: 1rem;
}

.logo { display: flex; align-items: center; }

.nav-logo-img {
    height: 58px;
    width: auto;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.35rem;
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.98rem;
    padding: 0.55rem 0.9rem;
    border-radius: 99px;
    display: inline-block;
}

.nav-link:hover {
    color: var(--brand-teal);
    background: rgba(168, 213, 186, 0.25);
}

.nav-item { position: relative; }

.dropdown {
    position: absolute;
    top: calc(100% - 4px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid rgba(0, 77, 64, 0.05);
    min-width: 260px;
    opacity: 0;
    visibility: hidden;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 45, 37, 0.06);
    padding: 12px 0.45rem 0.45rem;
    z-index: 20;
    max-height: 320px;
    overflow-y: auto;
}

.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown,
.nav-item.is-open .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    text-decoration: none;
    color: var(--text-main);
}

.dropdown-item:hover { background: rgba(232, 213, 183, 0.35); }

.dropdown-title {
    display: block;
    color: var(--brand-teal);
    font-weight: 600;
}

.dropdown-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 300;
    margin-top: 2px;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: 0;
    color: var(--brand-teal);
    font-size: 1.4rem;
    cursor: pointer;
}

.flash {
    position: relative;
    z-index: 900;
    margin: 96px auto 0;
    max-width: 860px;
    padding: 0.9rem 1.1rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--glass-border);
}

.flash-error { border-color: #c45c4a; color: #6d2d24; }
.flash-ok { border-color: var(--brand-mint); }

.hero-section {
    padding: 28px 20px 36px;
    text-align: center;
}

.hero-content h1,
.page-hero h1 {
    font-family: var(--font-head);
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    line-height: 1.1;
    color: var(--brand-teal);
    font-weight: 500;
    letter-spacing: -1.5px;
}

.gradient-text {
    font-weight: 600;
    color: var(--brand-teal);
    position: relative;
    display: inline-block;
}

.gradient-text::after {
    content: "";
    position: absolute;
    bottom: 6px;
    left: 0;
    width: 100%;
    height: 12px;
    background: var(--brand-mint);
    opacity: 0.55;
    z-index: -1;
    border-radius: 4px;
}

.brand-tagline, .lede {
    font-family: var(--font-tagline);
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-top: 16px;
}

.page-hero {
    padding: 20px 20px 10px;
    max-width: 1100px;
    margin: 0 auto;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.mw-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 20px 70px;
}

.page-hero + .mw-main,
.mw-main.tight { padding-top: 24px; }

.panel, .glass-card, .mw-card {
    background: #fff;
    border: 1px solid rgba(0, 77, 64, 0.06);
    border-radius: 28px;
    padding: 28px;
    box-shadow: 0 20px 50px rgba(0, 45, 37, 0.04);
    position: relative;
}

.panel::before, .glass-card::before, .mw-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    border-radius: 28px 28px 0 0;
    background: linear-gradient(90deg, var(--brand-mint), var(--brand-sand), var(--brand-teal));
}

.card-grid, .stat-grid, .partner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.stat-value {
    font-size: 2rem;
    color: var(--brand-teal);
    font-weight: 600;
}

.muted { color: var(--text-muted); font-weight: 300; line-height: 1.55; }

.mw-btn, .scan-btn, button.mw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    padding: 14px 18px;
    background: var(--brand-teal);
    color: #fff;
    border: 0;
    border-radius: 14px;
    font-family: var(--font-head);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.mw-btn.ghost, .scan-btn.ghost {
    background: transparent;
    color: var(--brand-teal);
    border: 2px solid var(--brand-teal);
}

.mw-btn.full, .scan-btn { width: 100%; }

.field { margin: 16px 0; text-align: left; }
.field label, .input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--brand-teal);
}

.field input, .field select, .field textarea,
.tech-select, .mw-legacy input, .mw-legacy select, .mw-legacy textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(0, 77, 64, 0.12);
    background: var(--bg-dark);
    color: var(--text-main);
    font: inherit;
}

.tech-slider { width: 100%; accent-color: var(--brand-teal); }

.dimensions-section { padding: 40px 20px 20px; text-align: center; }
.dimensions-section h2 { color: var(--brand-teal); font-weight: 600; font-size: 2rem; }

.radial-menu-container {
    position: relative;
    width: 350px;
    height: 350px;
    margin: 72px auto 40px;
    border-radius: 50%;
    border: 1px dashed rgba(0, 77, 64, 0.15);
    background: var(--brand-sand);
}

.dim-bar {
    position: sticky;
    top: var(--nav-offset);
    z-index: 40;
    background: rgba(250, 249, 245, 0.96);
    border-bottom: 1px solid var(--glass-border);
    padding: 10px 16px 12px;
}

.dim-switch {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 860px;
    margin: 0 auto 28px;
}

.dim-bar .dim-switch { margin: 0 auto; }

.dim-switch a {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 99px;
    background: #fff;
    border: 1px solid rgba(0, 77, 64, 0.14);
    color: var(--brand-teal);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
}

.dim-switch a.is-current { background: var(--brand-teal); color: #fff; }

.practice-steps { display: grid; gap: 8px; margin: 8px 0 0; padding-left: 1.2rem; }
.practice-steps li { margin: 4px 0; line-height: 1.45; }
.choice-row { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 12px 0; }
.choice-row label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.score-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; }
.score-split div { background: #FAF9F5; border-radius: 14px; padding: 10px 12px; }
.score-split strong { display: block; color: var(--brand-teal); font-size: 1.15rem; }

.center-dial {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110px;
    height: 110px;
    background: var(--brand-teal);
    border: 4px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.dimension-item {
    position: absolute;
    width: 110px;
    height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 3px solid var(--brand-mint);
    border-radius: 50%;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-main);
}

.dimension-item i { color: var(--brand-teal); font-size: 1.3rem; margin-bottom: 4px; }
.dimension-item span { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; }
.dimension-item em { font-style: normal; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--brand-teal); }
.dimension-item.is-complete { background: var(--brand-teal); border-color: var(--brand-teal); color: #fff; }
.dimension-item.is-complete i,
.dimension-item.is-complete span,
.dimension-item.is-complete em { color: #fff; }
.dimension-item.is-progress { background: var(--brand-sand); border-color: var(--brand-teal); }
.dimension-item.is-next { animation: journeyPulse 1.6s ease-in-out infinite; }
@keyframes journeyPulse {
    50% { box-shadow: 0 0 0 8px rgba(0, 77, 64, 0.16); }
}
.score-layout { display: grid; grid-template-columns: 160px 1fr; gap: 22px; align-items: center; }
.score-ring {
    width: 140px; height: 140px; border-radius: 50%;
    display: grid; place-items: center;
    background: conic-gradient(#004D40 calc(var(--p) * 1%), #E8D5B7 0);
}
.score-ring span {
    width: 104px; height: 104px; border-radius: 50%; background: #fff;
    display: grid; place-items: center; color: #004D40; font-size: 2rem; font-weight: 700;
}
.dim-bars { display: grid; gap: 10px; }
.dim-row { display: grid; grid-template-columns: 130px 1fr 48px; gap: 10px; align-items: center; }
.dim-track { height: 12px; background: #F3EFE6; border-radius: 99px; overflow: hidden; }
.dim-fill { height: 100%; border-radius: 99px; background: #A8D5BA; width: 0; }
.dim-fill.is-attention { background: #C4A484; }
.dim-fill.is-risk { background: #E8D5B7; }
.dim-fill.is-fair { background: #A8D5BA; }
.dim-fill.is-stable, .dim-fill.is-strong { background: #004D40; }
.band { border-top: 6px solid #A8D5BA; }
.band.is-attention { border-top-color: #C4A484; }
.band.is-risk, .band.is-fair { border-top-color: #E8D5B7; }
.band.is-stable, .band.is-strong { border-top-color: #004D40; }
.band.is-hidden { border-top-color: #d9d3c7; }
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.service-grid a { display: block; background: #fff; border-radius: 16px; padding: 16px; text-align: center; text-decoration: none; color: #004D40; border: 1px solid rgba(0,77,64,0.1); font-weight: 600; }
.service-grid i { display: block; font-size: 1.3rem; margin-bottom: 8px; }
.check-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.check-pills span { background: #FAF9F5; border-radius: 999px; padding: 8px 12px; }
.doctor-portal .filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.doctor-portal .filter-row button { border: 1px solid rgba(0,77,64,0.16); background: #fff; color: #004D40; border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.doctor-portal .filter-row button.active { background: #004D40; color: #fff; }
.doctor-portal .rx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.doctor-portal .rx-card { background: #fff; border-radius: 16px; padding: 18px; border: 1px solid rgba(0,77,64,0.1); display: flex; flex-direction: column; }
.doctor-portal .rx-card ul { margin: 8px 0 16px; padding-left: 18px; }
.doctor-portal .rx-card .mw-btn { margin-top: auto; }
@media (max-width: 700px) {
    .score-layout, .dim-row { grid-template-columns: 1fr; }
}
.journey-center { color: #fff; font-weight: 700; font-size: 1.35rem; line-height: 1.05; text-align: center; }
.journey-center small { display: block; font-size: 0.62rem; font-weight: 500; letter-spacing: 0.02em; }
.privacy-note {
    max-width: 860px;
    margin: 12px auto 4px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 14px;
    border-left: 4px solid var(--brand-teal);
    color: var(--text-main);
}

.dim-1 { top: 0; left: 50%; margin-top: -55px; margin-left: -55px; }
.dim-2 { top: 12%; right: 12%; margin-top: -55px; margin-right: -55px; }
.dim-3 { top: 50%; right: 0; margin-top: -55px; margin-right: -55px; }
.dim-4 { bottom: 12%; right: 12%; margin-bottom: -55px; margin-right: -55px; }
.dim-5 { bottom: 0; left: 50%; margin-bottom: -55px; margin-left: -55px; }
.dim-6 { bottom: 12%; left: 12%; margin-bottom: -55px; margin-left: -55px; }
.dim-7 { top: 50%; left: 0; margin-top: -55px; margin-left: -55px; }
.dim-8 { top: 12%; left: 12%; margin-top: -55px; margin-left: -55px; }

@keyframes rotateSlow { to { transform: rotate(360deg); } }
@keyframes rotateCounter { to { transform: rotate(-360deg); } }

.diagnostic-section, .visual-frame {
    padding: 40px 20px 80px;
    display: flex;
    justify-content: center;
}

.visual-inner {
    max-width: 1100px;
    width: 100%;
    border-radius: 28px;
    overflow: hidden;
    border: 8px solid #fff;
}

.scan-result { display: none; margin-top: 22px; text-align: left; padding: 16px; border-radius: 16px; background: rgba(168, 213, 186, 0.15); }

.footer {
    padding: 70px 20px 36px;
    background: var(--brand-teal);
    color: var(--brand-offwhite);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section h4 { color: var(--brand-sand); margin-bottom: 16px; }
.footer-section ul { list-style: none; }
.footer-section li { margin-bottom: 10px; }
.footer-section a { color: rgba(250, 249, 245, 0.86); text-decoration: none; }
.footer-section a:hover { color: var(--brand-sand); }
.footer-copy {
    text-align: center;
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid rgba(250, 249, 245, 0.15);
    color: var(--brand-sand);
    font-size: 0.85rem;
}

.mw-toast {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--brand-teal);
    color: #fff;
    padding: 12px 16px;
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    z-index: 1200;
}
.mw-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

.notice {
    background: rgba(232, 213, 183, 0.45);
    border-radius: 14px;
    padding: 12px 14px;
    margin: 12px 0;
}

.score-pill {
    display: inline-block;
    min-width: 72px;
    text-align: center;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(168, 213, 186, 0.35);
    color: var(--brand-teal);
    font-weight: 700;
}

.meal-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 77, 64, 0.06);
}

.bar {
    height: 12px;
    background: rgba(168, 213, 186, 0.35);
    border-radius: 99px;
    overflow: hidden;
}
.bar span { display: block; height: 100%; background: var(--brand-teal); }

.mw-gate {
    position: fixed;
    z-index: 900;
    top: 86px;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(250, 249, 245, 0.28);
    backdrop-filter: blur(7px);
}

.mw-gate-card {
    width: min(460px, 100%);
    background: #fff;
    color: var(--text-main);
    border-radius: 28px;
    border-top: 6px solid var(--brand-teal);
    box-shadow: 0 24px 60px rgba(0, 45, 37, 0.16);
    padding: 32px 28px;
    text-align: center;
}

.mw-gate-card h2 { color: var(--brand-teal); font-size: 1.7rem; margin-bottom: 10px; }
.mw-gate-card p { color: var(--text-muted); line-height: 1.5; margin-bottom: 18px; }
.mw-gate-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.mw-gate-join { display: inline-block; margin-top: 14px; color: var(--brand-teal); font-weight: 600; }

body.mw-locked .mw-main,
body.mw-locked .page-hero,
body.mw-locked .footer {
    filter: blur(2.5px);
    pointer-events: none;
    user-select: none;
}

.mw-legacy {
    background: #fff;
    color: var(--text-main);
    border-radius: 28px;
    padding: 28px 22px 36px;
    border: 1px solid rgba(0, 77, 64, 0.1);
    border-top: 6px solid var(--brand-teal);
    box-shadow: 0 20px 50px rgba(0, 45, 37, 0.06);
}

.mw-legacy, .mw-legacy button, .mw-legacy input, .mw-legacy select, .mw-legacy textarea {
    font-family: Outfit, sans-serif !important;
}

.mw-legacy h1, .mw-legacy h2, .mw-legacy h3, .mw-legacy h4 {
    font-family: Outfit, sans-serif !important;
    color: var(--brand-teal) !important;
    text-transform: none !important;
    letter-spacing: -0.03em !important;
    text-shadow: none !important;
}

.mw-legacy p, .mw-legacy li, .mw-legacy label, .mw-legacy td, .mw-legacy th {
    color: #1C2E2A !important;
}

.mw-legacy input, .mw-legacy select, .mw-legacy textarea {
    color: #1C2E2A !important;
    background: #FAF9F5 !important;
}

.mw-legacy button,
.mw-legacy .btn,
.mw-legacy .cta-btn,
.mw-legacy .scan-btn,
.mw-legacy .btn-analyze,
.mw-legacy .action-btn,
.mw-legacy .btn-neon,
.mw-legacy input[type="submit"],
.mw-legacy a.btn,
.mw-legacy a.cta-btn,
.mw-legacy a.action-btn {
    background: var(--brand-teal) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

.mw-legacy .container,
.mw-legacy .card,
.mw-legacy .glass-card,
.mw-legacy .day-card,
.mw-legacy .zone-card,
.mw-legacy [class*="card"],
.mw-legacy [class*="panel"] {
    background: #fff !important;
    color: #1C2E2A !important;
}

@media (min-width: 768px) {
    .radial-menu-container { width: 620px; height: 620px; }
}

@media (max-width: 1024px) {
    .menu-toggle { display: block; }
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: #fff;
        padding: 12px;
        border-bottom: 1px solid var(--glass-border);
    }
    .nav-menu.is-open { display: flex; }
    .dropdown {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        display: none;
        box-shadow: none;
        min-width: 0;
    }
    .nav-item.is-open .dropdown { display: block; }
}

@media print {
    .nav-container, .footer, .menu-toggle, .no-print { display: none !important; }
    .mw-main, .page-hero { padding-top: 0; }
    body.mw-app { background: #fff; }
}
