:root {
    color-scheme: light;
    --narrow-ink: #10213e;
    --narrow-muted: #66758c;
    --narrow-line: #dce6f1;
    --narrow-blue: #2867e8;
    --narrow-blue-dark: #164fc5;
    --narrow-blue-soft: #edf4ff;
    --narrow-surface: #ffffff;
    --narrow-canvas: #f7faff;
}

[hidden] {
    display: none !important;
}

html {
    min-height: 100%;
    background: var(--narrow-canvas);
}

body {
    min-height: 100%;
    margin: 0;
    background:
        radial-gradient(circle at 50% 20%, #ffffff 0, #f8fbff 46%, #eef5fd 100%);
    color: var(--narrow-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.narrow-shell {
    width: 100%;
    max-width: none;
    min-height: 100svh;
    margin: 0;
    padding: 0;
}

.body-navigation-screen {
    position: relative;
    box-sizing: border-box;
    min-height: 100svh;
    padding: 30px clamp(20px, 5vw, 72px) 24px;
    overflow: hidden;
}

.narrow-brand {
    position: relative;
    z-index: 4;
}

.narrow-brand a,
.workspace-brand {
    color: var(--narrow-ink);
    font-size: 21px;
    font-weight: 780;
    letter-spacing: -0.035em;
    text-decoration: none;
}

.body-navigation-heading {
    position: relative;
    z-index: 3;
    display: grid;
    justify-items: center;
    gap: 16px;
    margin: 14px auto 0;
    text-align: center;
}

.body-navigation-heading h1 {
    margin: 0;
    color: var(--narrow-ink);
    font-size: clamp(28px, 4.2vw, 46px);
    font-weight: 720;
    letter-spacing: -0.045em;
    line-height: 1.05;
}

.body-view-controls {
    display: inline-flex;
    gap: 3px;
    padding: 4px;
    border: 1px solid rgba(184, 200, 220, 0.64);
    border-radius: 999px;
    background: rgba(237, 244, 252, 0.9);
    box-shadow: 0 2px 8px rgba(16, 33, 62, 0.05);
}

.body-view-button {
    min-width: 82px;
    min-height: 38px;
    padding: 0 17px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #607088;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 670;
    transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.body-view-button:hover {
    color: var(--narrow-blue-dark);
}

.body-view-button.is-active {
    background: #ffffff;
    color: var(--narrow-blue-dark);
    box-shadow: 0 2px 7px rgba(16, 33, 62, 0.12);
}

.body-view-button:focus-visible,
.body-map-back:focus-visible,
.body-detail-choice:focus-visible,
.anatomy-node:focus-visible {
    outline: 3px solid rgba(40, 103, 232, 0.28);
    outline-offset: 3px;
}

.body-map-stage {
    position: relative;
    z-index: 2;
    display: grid;
    justify-items: center;
    width: min(760px, 100%);
    min-height: calc(100svh - 190px);
    margin: 0 auto;
}

.body-map-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    width: 100%;
}

.body-map-back {
    position: absolute;
    left: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 40px;
    padding: 0 13px;
    border: 1px solid var(--narrow-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    color: #42536b;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 650;
}

.body-map-back svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.body-map-breadcrumb {
    margin: 0;
    color: var(--narrow-muted);
    font-size: 14px;
    font-weight: 650;
}

.body-map-artwork {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: min(570px, calc(100svh - 270px));
    transition: opacity 150ms ease;
}

.body-map-artwork[data-loading="true"] {
    opacity: 0.35;
}

.body-map-artwork > svg {
    display: block;
    width: auto;
    height: min(570px, calc(100svh - 250px));
    max-width: 100%;
    overflow: visible;
    filter: drop-shadow(0 24px 35px rgba(35, 76, 125, 0.1));
}

.body-map-artwork > svg[viewBox="0 0 640 430"] {
    width: min(640px, 92vw);
    height: auto;
    max-height: 440px;
}

.body-map-artwork .anatomy-surface {
    fill: #f2f7fd;
    stroke: #bdd0e4;
    stroke-width: 2;
}

.body-map-artwork .anatomy-node {
    cursor: pointer;
    transform-box: fill-box;
    transform-origin: center;
    transition: filter 150ms ease;
}

.body-map-artwork .anatomy-node > path:not(.anatomy-detail):not(.anatomy-region):not(.anatomy-hit),
.body-map-artwork .anatomy-node > ellipse,
.body-map-artwork .anatomy-node > circle:not(.anatomy-detail-fill) {
    fill: #e5effa;
    stroke: #7d9fbe;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
    transition: fill 150ms ease, stroke 150ms ease;
}

.body-map-artwork .anatomy-node:hover,
.body-map-artwork .anatomy-node:focus-visible {
    filter: drop-shadow(0 6px 9px rgba(40, 103, 232, 0.2));
}

.body-map-artwork .anatomy-node:hover > path:not(.anatomy-detail):not(.anatomy-region):not(.anatomy-hit),
.body-map-artwork .anatomy-node:hover > ellipse,
.body-map-artwork .anatomy-node:hover > circle:not(.anatomy-detail-fill),
.body-map-artwork .anatomy-node:focus-visible > path:not(.anatomy-detail):not(.anatomy-region):not(.anatomy-hit),
.body-map-artwork .anatomy-node:focus-visible > ellipse,
.body-map-artwork .anatomy-node:focus-visible > circle:not(.anatomy-detail-fill) {
    fill: #cfe1fb;
    stroke: var(--narrow-blue);
}

.body-map-artwork .anatomy-node > .anatomy-region {
    fill: #cfe1fb;
    fill-opacity: 0;
    stroke: var(--narrow-blue);
    stroke-opacity: 0;
    transition: fill-opacity 150ms ease, stroke-opacity 150ms ease;
}

.body-map-artwork .anatomy-node > .anatomy-hit {
    fill: #ffffff;
    fill-opacity: 0.001;
    stroke: none;
    pointer-events: all;
}

.body-map-artwork .anatomy-node:hover > .anatomy-region,
.body-map-artwork .anatomy-node:focus-visible > .anatomy-region,
.body-map-artwork .anatomy-node[aria-current="true"] > .anatomy-region {
    fill-opacity: 0.74;
    stroke-opacity: 1;
}

.body-map-artwork .anatomy-detail {
    fill: none;
    stroke: #adc3da;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
    pointer-events: none;
}

.body-map-artwork .anatomy-detail-fill {
    fill: #7398bc;
    stroke: none;
    pointer-events: none;
}

.body-map-artwork .anatomy-spine {
    stroke: #6e9ac5;
    stroke-dasharray: 6 7;
    stroke-width: 2.5;
}

.body-map-choices {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
    width: min(660px, 100%);
    margin: -2px auto 18px;
}

.body-detail-choice {
    min-height: 42px;
    padding: 0 17px;
    border: 1px solid #cedbea;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #354760;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 620;
    box-shadow: 0 3px 10px rgba(16, 33, 62, 0.04);
    transition: border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.body-detail-choice:hover {
    border-color: var(--narrow-blue);
    color: var(--narrow-blue-dark);
    transform: translateY(-1px);
}

.body-map-error {
    color: var(--narrow-muted);
    font-size: 15px;
}

.clinical-workspace {
    box-sizing: border-box;
    width: min(920px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 64px;
}

.workspace-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 34px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--narrow-line);
}

.workspace-brand,
.location-kicker {
    margin: 0;
}

.location-kicker {
    margin-top: 22px;
    color: var(--narrow-muted);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.workspace-header h1 {
    margin: 4px 0 0;
    color: var(--narrow-ink);
    font-size: clamp(28px, 5vw, 40px);
    letter-spacing: -0.04em;
    line-height: 1.05;
}

.change-location-button {
    min-height: 42px;
    padding: 0 17px;
    border: 1px solid #cddaea;
    border-radius: 999px;
    background: #ffffff;
    color: #3e5069;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 650;
}

.clinical-workspace section {
    margin-bottom: 34px;
}

.clinical-workspace h2 {
    margin: 0 0 14px;
    color: var(--narrow-ink);
    font-size: 22px;
    letter-spacing: -0.02em;
}

.symptom-intake-section {
    padding-bottom: 6px;
    border: 0;
}

.symptom-intake-section .search-box {
    max-width: none;
}

.symptom-intake-section #symptomInput {
    height: 66px;
    border-color: #b9cae0;
    border-radius: 18px;
    box-shadow: 0 8px 28px rgba(16, 33, 62, 0.05);
}

.additional-details {
    margin: 4px 0 38px;
    border: 1px solid var(--narrow-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.7);
    overflow: hidden;
}

.additional-details summary {
    padding: 17px 20px;
    color: #3e5069;
    cursor: pointer;
    font-size: 15px;
    font-weight: 680;
    list-style-position: inside;
}

.additional-details-content {
    padding: 4px 20px 20px;
}

.additional-details-content section {
    margin: 18px 0 0;
    padding: 0;
    border: 0;
}

.additional-details-content h2 {
    font-size: 17px;
}

.timing-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: none;
    margin-top: 0;
}

.timing-fields label {
    display: grid;
    gap: 7px;
    color: #52627a;
    font-size: 13px;
    font-weight: 650;
}

.timing-fields select {
    min-height: 44px;
    border: 1px solid #cbd8e7;
    border-radius: 11px;
    background: #ffffff;
    color: var(--narrow-ink);
    padding: 0 36px 0 12px;
}

#patient-evidence-section .narrow-context-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.clinical-results {
    padding-top: 6px;
}

.clinical-results > section {
    padding: 26px 0 8px;
    border-top: 1px solid var(--narrow-line);
}

.clinical-result-list {
    display: grid;
    gap: 11px;
}

.clinical-result-card,
.clinical-question-card,
.clinical-outcome-card,
.clinical-routing-card,
.clinical-evidence-card,
.clinical-safety-card {
    border-color: #d8e3ef;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 16px rgba(16, 33, 62, 0.035);
}

.product-safety-note {
    max-width: 720px;
    color: var(--narrow-muted);
    font-size: 13px;
    line-height: 1.55;
}

@media (max-width: 700px) {
    .body-navigation-screen {
        padding: 22px 16px 16px;
    }

    .body-navigation-heading {
        margin-top: 18px;
    }

    .body-navigation-heading h1 {
        font-size: 31px;
    }

    .body-map-stage {
        min-height: calc(100svh - 175px);
    }

    .body-map-toolbar {
        justify-content: flex-end;
    }

    .body-map-breadcrumb {
        max-width: calc(100% - 95px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .body-map-artwork {
        min-height: min(500px, calc(100svh - 280px));
    }

    .body-map-artwork > svg {
        height: min(500px, calc(100svh - 260px));
    }

    .body-map-artwork > svg[viewBox="0 0 640 430"] {
        width: min(560px, 100%);
        height: auto;
    }

    .body-map-choices {
        gap: 7px;
        margin-top: 2px;
    }

    .body-detail-choice {
        min-height: 40px;
        padding: 0 14px;
        font-size: 13px;
    }

    .clinical-workspace {
        width: calc(100% - 28px);
        padding-top: 22px;
    }

    .workspace-header {
        align-items: center;
        margin-bottom: 26px;
    }

    .location-kicker {
        margin-top: 16px;
    }

    .change-location-button {
        padding: 0 13px;
        white-space: nowrap;
    }

    .symptom-intake-section #symptomInput {
        height: 60px;
        border-radius: 16px;
        font-size: 16px;
    }

    .timing-fields {
        grid-template-columns: 1fr;
    }

    .additional-details-content {
        padding-right: 14px;
        padding-left: 14px;
    }
}

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