/* A restrained visual layer for the isolated medical research frontend. */
:root {
    --clinical-navy: #102d57;
    --clinical-ink: #1a3351;
    --clinical-teal: #1d61c2;
    --clinical-mint: #d5e8ff;
    --clinical-border: #dce6f1;
    --clinical-paper: #ffffff;
}

body.portal-view,
body.eye-view,
body.cell-view,
body.performance-view,
body.login-view {
    color: var(--clinical-ink);
    background: #f3f7fc;
}

.portal-view .topbar {
    background: rgba(255, 255, 255, .97);
}

.portal-view .topbar-inner {
    min-height: 72px;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 30px;
    align-self: stretch;
    margin-left: auto;
    margin-right: 32px;
}

.topbar-nav a {
    display: inline-flex;
    align-items: center;
    border-bottom: 2px solid transparent;
    color: #627b88;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
    transition: color 160ms ease, border-color 160ms ease;
}

.topbar-nav a:hover,
.topbar-nav a[aria-current="page"] {
    border-bottom-color: var(--clinical-teal);
    color: var(--clinical-teal);
}

.portal-view .account-area {
    padding-left: 17px;
    border-left: 1px solid #dce7e8;
}

.portal-view .portal-shell {
    padding-top: 26px;
}

.portal-view .portal-hero {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    min-height: 395px;
    border: 1px solid #214150;
    border-radius: 24px;
    background-color: #061e32;
    background-image: linear-gradient(118deg, #edf5ff 0%, #f8fbff 52%, #e6f0ff 100%);
    background-position: center, center;
    background-size: cover;
    box-shadow: 0 22px 44px rgba(5, 36, 52, .18);
}

.portal-view .portal-hero::before {
    background: linear-gradient(0deg, rgba(5, 24, 40, .28), transparent 45%);
}

.portal-view .portal-hero__content {
    padding: 43px 52px 39px;
}

.portal-view .portal-kicker {
    margin-bottom: 18px;
    color: #a9e7dc;
    font-size: 11px;
    letter-spacing: .13em;
}

.portal-view .portal-hero h1 {
    font-size: clamp(38px, 4vw, 54px);
    line-height: 1.18;
    letter-spacing: -.04em;
}

.portal-view .portal-description {
    max-width: 490px;
    margin-top: 18px;
    color: #d1e0e5;
    font-size: 14px;
    line-height: 1.8;
}

.portal-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 23px;
}

.hero-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    min-height: 42px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 750;
    text-decoration: none;
    transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.hero-action:hover { transform: translateY(-2px); }
.hero-action--primary { color: #082c38; background: #a8e8df; }
.hero-action--primary:hover { background: #c5f5ee; }
.hero-action--ghost { border-color: rgba(205, 239, 237, .35); color: #e5f4f2; background: rgba(255,255,255,.045); }
.hero-action--ghost:hover { border-color: rgba(205,239,237,.7); background: rgba(255,255,255,.1); }

.portal-view .portal-hero__chips { margin-top: 22px; }
.portal-view .portal-hero__chips span { border-color: rgba(194, 226, 224, .22); color: #b9d8db; background: rgba(8, 47, 61, .48); }
.portal-view .portal-hero__visual { min-height: 395px; }
.visual-caption {
    position: absolute;
    right: 20px;
    bottom: 18px;
    padding: 6px 9px;
    border: 1px solid rgba(220, 243, 242, .2);
    border-radius: 6px;
    color: #dcebed;
    background: rgba(5, 24, 40, .58);
    font-size: 10px;
    letter-spacing: .08em;
}

.portal-view .module-section { margin-top: 29px; }
.portal-view .module-section__heading { margin-bottom: 17px; }
.portal-view .module-section__heading h2 { font-size: 24px; }
.portal-view .module-card {
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(17, 55, 66, .05);
}
.portal-view .module-card--featured { background: linear-gradient(145deg, #e6f6f1, #fff 69%); }
.portal-view .module-card--featured::after { opacity: .5; }
.portal-view .module-card--cell { background: linear-gradient(115deg, #fff, #f4f8fc); }
.portal-view .module-card--performance { background: linear-gradient(115deg, #fff, #f7f7fb); }
.portal-view .module-card:hover { box-shadow: 0 18px 40px rgba(17, 55, 66, .11); }
.portal-view .module-content h3 { color: #123149; }
.portal-view .module-content p { color: #5d7582; }
.portal-view .module-action { font-size: 13px; }
.portal-view .portal-footer { margin-top: 28px; }

/* The login page shares the same clinical illustration and plain-language copy. */
.login-view .login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr);
    width: min(1080px, calc(100% - 44px));
    min-height: 600px;
    padding: 0;
    margin: auto;
    border: 1px solid #d7e6e8;
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 24px 70px rgba(7, 39, 52, .16);
}

.login-view {
    display: grid;
    place-items: center;
    padding: 30px 0;
    background: #e8f1f2 !important;
}

.login-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 600px;
    padding: 34px 40px;
    color: #fff;
    background: linear-gradient(140deg, #123c7a 0%, #1d61c2 70%, #3b86de 100%);
}

.login-aside__top { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 750; }
.login-aside__mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(188,241,232,.5); border-radius: 10px; color: #a8e8df; font-size: 20px; }
.login-aside__content { max-width: 440px; }
.login-aside__eyebrow { color: #9de0d6; font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.login-aside__content h2 { margin: 15px 0 17px; font-size: clamp(29px, 3vw, 41px); line-height: 1.3; letter-spacing: -.04em; }
.login-aside__content > p:not(.login-aside__eyebrow) { max-width: 380px; margin: 0; color: #d0e0e5; font-size: 13px; line-height: 1.85; }
.login-aside__types { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 23px; }
.login-aside__types span { padding: 6px 10px; border: 1px solid rgba(198,238,233,.3); border-radius: 7px; color: #d3e9e7; background: rgba(255,255,255,.07); font-size: 11px; }
.login-aside__note { margin: 0; color: #b6d0d4; font-size: 10px; }
.login-view .login-card { align-self: center; width: min(100%, 440px); padding: 44px 45px; border: 0; border-radius: 0; box-shadow: none; background: #fff; backdrop-filter: none; }
.login-view .login-header { margin-bottom: 31px; text-align: left; }
.login-view .login-kicker { color: #0b827a; font-size: 11px; letter-spacing: .14em; }
.login-view .login-header h1 { margin-top: 12px; font-size: 31px; letter-spacing: -.04em; }
.login-view .login-header p { color: #6d8290; font-size: 13px; }
.login-view .login-field { color: #254658; font-size: 13px; }
.login-view .login-field input { height: 48px; border-color: #d7e5e9; background: #fbfdfd; }
.login-view .login-button { box-shadow: none; }
.login-view .login-footer { margin-top: 24px; color: #7c8f99; text-align: left; }

/* Analysis pages retain the original backend hooks and use matching surfaces. */
.eye-view .eye-mode-panel,
.eye-view .eye-panel,
.cell-view .panel,
.performance-view .data-panel,
.performance-view .highlight-card {
    border-color: var(--clinical-border);
    box-shadow: 0 9px 27px rgba(17, 55, 66, .055);
}
.eye-view .eye-mode-panel,
.eye-view .eye-panel,
.cell-view .panel { border-radius: 16px; }
.eye-view .eye-mode-option { background: #f8fbfb; }
.eye-view .eye-mode-option.active { border-color: #4cae9e; background: #eff9f5; }
.eye-view .eye-drop-zone,
.cell-view .drop-zone { background: #f9fcfb; }
.eye-view .eye-detect-button,
.cell-view .btn-primary { background: var(--clinical-teal); }
.eye-view .eye-detect-button:hover,
.cell-view .btn-primary:hover { background: #066960; }
.cell-view .sidebar { background: #0c2d3d; }
.cell-view .nav-btn.active { background: #087f78; }
.eye-view .patient-selector-mount,
.cell-view .patient-selector-mount {
    --ps-accent: #1d61c2;
    --ps-accent-deep: #174e9e;
    --ps-line: #dce6f1;
}
.eye-view .patient-selector-card,
.cell-view .patient-selector-card { box-shadow: 0 9px 27px rgba(17, 55, 66, .055); }
.eye-view .eye-overlay-placeholder { background: #f7faf9; }
.eye-view .eye-overlay-placeholder::before { display: none; }
.eye-view .result-empty-icon,
.cell-view .clinical-result-empty svg {
    width: 58px;
    height: 58px;
    stroke: #90aeb1;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.eye-view .overlay-label {
    margin-top: 11px;
    padding: 0;
    color: #6d858c;
    background: transparent;
    font-size: 12px;
}
.cell-view .clinical-result-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    padding: 30px;
    border: 1px dashed #d2e2e3;
    border-radius: 13px;
    color: #728991;
    background: #f8fbfa;
    text-align: center;
}
.cell-view .clinical-result-empty strong { margin-top: 13px; color: #254756; font-size: 15px; }
.cell-view .clinical-result-empty span { margin-top: 5px; font-size: 12px; }

@media (max-width: 900px) {
    .topbar-nav { display: none; }
    .portal-view .portal-hero { grid-template-columns: 1fr; background-position: center, 60% center; }
    .portal-view .portal-hero__visual { position: absolute; inset: 0; min-height: 0; pointer-events: none; }
    .portal-view .portal-hero__content { max-width: 650px; }
    .login-view .login-shell { grid-template-columns: 1fr; width: min(510px, calc(100% - 32px)); min-height: 0; }
    .login-aside { min-height: 200px; padding: 25px 28px; }
    .login-aside__content, .login-aside__note { display: none; }
    .login-view .login-card { width: 100%; padding: 36px 30px; }
}

@media (max-width: 560px) {
    .portal-view .portal-hero { min-height: 0; background-image: linear-gradient(118deg, #edf5ff, #e3efff); }
    .portal-view .portal-hero__content { padding: 34px 23px 38px; }
    .portal-view .portal-hero__visual { display: none; }
    .portal-view .portal-hero h1 { font-size: 34px; }
    .portal-hero__actions { flex-direction: column; align-items: stretch; }
    .hero-action { width: 100%; }
    .portal-view .module-section { margin-top: 25px; }
    .login-view { padding: 16px 0; }
    .login-view .login-card { padding: 30px 24px; }
}

/* Hospital blue system: clear hierarchy, quiet surfaces, and a functional hero. */
:root { --ui-teal: #1d61c2; --ui-teal-deep: #174e9e; --ui-canvas: #f3f7fc; --ui-line: #dce6f1; }
:is(a, button, input, label):focus-visible { outline-color: rgba(29, 97, 194, .42); }
.portal-view .topbar { border-bottom-color: #dce6f1; }
.portal-view .brand-mark,
.performance-view .performance-brand__mark { padding: 0; background: transparent; box-shadow: none; }
.portal-view .brand-mark img,
.performance-view .performance-brand__mark img { display: block; width: 42px; height: 42px; }
.portal-view .brand:hover .brand-text { color: #1d61c2; }
.portal-view .account-area { border-left-color: #dce6f1; }
.topbar-nav a { color: #58718d; }
.portal-view .portal-hero {
    grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr);
    min-height: 362px;
    border: 1px solid #cbdcf1;
    background-color: #edf5ff;
    background-image: linear-gradient(118deg, #f5faff 0%, #eaf3ff 55%, #dceafd 100%);
    box-shadow: 0 20px 46px rgba(28, 77, 145, .11);
}
.portal-view .portal-hero::before {
    background: radial-gradient(circle at 10% 90%, rgba(104, 162, 230, .14), transparent 38%),
                linear-gradient(90deg, transparent 50%, rgba(255,255,255,.34) 50.1%, transparent 50.2%);
}
.portal-view .portal-kicker { color: #3265a3; }
.portal-view .kicker-dot { background: #2b75d0; box-shadow: 0 0 0 5px rgba(43,117,208,.12); }
.portal-view .portal-hero h1 { color: #153962; }
.portal-view .portal-hero h1 span { color: #1d61c2; }
.portal-view .portal-description { color: #526c89; }
.portal-view .portal-hero__chips span { border-color: #c9dcf3; color: #315a87; background: rgba(255,255,255,.55); }
.hero-action--primary { color: #fff; background: #1d61c2; box-shadow: 0 8px 18px rgba(29,97,194,.18); }
.hero-action--primary:hover { background: #174e9e; }
.hero-action--ghost { border-color: #bad0eb; color: #24558e; background: rgba(255,255,255,.7); }
.hero-action--ghost:hover { border-color: #7ba8da; background: #fff; }
.portal-view .portal-hero__visual { display: flex; align-items: center; padding: 25px 31px 25px 3px; }
.workflow-card {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 19px 20px 16px;
    border: 1px solid rgba(163, 192, 230, .72);
    border-radius: 17px;
    background: rgba(255,255,255,.87);
    box-shadow: 0 17px 37px rgba(30, 81, 146, .11);
    backdrop-filter: blur(8px);
}
.workflow-card__head { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 0 1px 13px; border-bottom: 1px solid #e3ebf5; color: #173e6c; font-size: 13px; font-weight: 800; }
.workflow-card__head strong { color: #7b93ad; font-size: 9px; letter-spacing: .08em; }
.workflow-step { display: flex; align-items: center; gap: 12px; min-height: 62px; border-bottom: 1px solid #edf2f8; }
.workflow-step__index { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border: 1px solid #c8def7; border-radius: 8px; color: #2d6ebf; background: #eef6ff; font-size: 10px; font-weight: 800; }
.workflow-step div { flex: 1; min-width: 0; }
.workflow-step strong,.workflow-step small { display: block; }
.workflow-step strong { color: #274662; font-size: 12px; }
.workflow-step small { margin-top: 3px; color: #7a8fa5; font-size: 10px; }
.workflow-step > span:last-child { color: #8eb0d5; font-size: 15px; }
.workflow-card__foot { padding-top: 13px; color: #6e88a2; font-size: 10px; }
.workflow-card__foot span { padding: 0 6px; color: #afc3d9; }
.portal-view .module-card { border-color: #dce6f1; box-shadow: 0 8px 25px rgba(31, 78, 133, .06); }
.portal-view .module-card--featured { background: linear-gradient(145deg, #e8f2ff, #fff 66%); }
.portal-view .module-card--featured::after { border-color: rgba(43,105,191,.12); box-shadow: 0 0 0 48px rgba(43,105,191,.035), 0 0 0 96px rgba(43,105,191,.02); }
.portal-view .module-card--eye::before { background: radial-gradient(circle at 82% 18%, rgba(63,127,207,.14), transparent 28%); }
.portal-view .module-card--performance::before { background: radial-gradient(circle at 82% 18%, rgba(86,119,184,.12), transparent 28%); }
.portal-view .module-card--eye .module-icon,.portal-view .module-card--cell .module-icon,.portal-view .module-card--performance .module-icon { color: #2368bd; }
.module-flow { position: absolute; top: 32px; right: 31px; z-index: 1; display: grid; gap: 7px; width: min(48%, 245px); }
.module-flow span { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid #d8e6f6; border-radius: 7px; color: #6d89a6; background: rgba(255,255,255,.8); font-size: 10px; }
.module-flow b { color: #2c5d99; font-weight: 700; }
.portal-view .module-action,.portal-view .module-card--cell .module-action,.portal-view .module-card--performance .module-action { color: #1d61c2; }
.portal-view .module-tags span { border-color: #cbdff5; color: #2c65a4; background: #f4f9ff; }
.portal-view .section-eyebrow { color: #1d61c2; }
.portal-view .portal-footer { color: #8195a9; }

.login-view { background: #edf3fb !important; }
.login-view .login-shell { align-items: stretch; justify-items: stretch; border-color: #d6e3f3; box-shadow: 0 24px 65px rgba(30,71,121,.14); }
.login-aside { background: linear-gradient(145deg, #103c7d 0%, #1d61c2 68%, #3d89df 100%); }
.login-aside::after { position: absolute; inset: 0; pointer-events: none; content: ""; opacity: .34; background-image: linear-gradient(rgba(225,239,255,.16) 1px, transparent 1px), linear-gradient(90deg, rgba(225,239,255,.16) 1px, transparent 1px); background-size: 37px 37px; mask-image: linear-gradient(100deg, transparent 20%, black); }
.login-aside > * { position: relative; z-index: 1; }
.login-aside__mark { width: 37px; height: 37px; padding: 0; border: 0; background: #fff; }
.login-aside__mark img { display: block; width: 37px; height: 37px; }
.login-aside__eyebrow { color: #c8e0ff; }
.login-aside__content > p:not(.login-aside__eyebrow) { color: #dfecff; }
.login-aside__types span { border-color: rgba(219,237,255,.34); color: #e6f2ff; }
.login-aside__note { color: #d5e7fb; }
.login-view .login-kicker { color: #1d61c2; }
.login-view .login-button { background: #1d61c2; box-shadow: none; }
.login-view .login-button:hover:not(:disabled) { background: #174e9e; box-shadow: 0 10px 22px rgba(29,97,194,.17); }
.login-view .login-field input:focus { border-color: #1d61c2; box-shadow: 0 0 0 4px rgba(29,97,194,.12); }

.eye-view { --eye-primary: #1d61c2; --eye-blue: #1d61c2; --eye-canvas: #f3f7fc; }
.eye-view .eye-heading p,.eye-view .eye-drop-zone svg { color: #1d61c2; }
.eye-view .eye-status { border-color: #c9def5; color: #275d9d; background: #edf5ff; }
.eye-view .step-index,.eye-view .eye-mode-option.active .eye-mode-option__index { border-color: #1d61c2; background: #1d61c2; }
.eye-view .eye-mode-option { border-color: #dce6f1; background: #fafcff; }
.eye-view .eye-mode-option.active { border-color: #78a9e2; background: #edf5ff; box-shadow: inset 0 0 0 1px #78a9e2; }
.eye-view .eye-mode-option:focus-within { outline-color: rgba(29,97,194,.32); }
.eye-view .eye-drop-zone { border-color: #bad5f1; background: #f8fbff; }
.eye-view .eye-drop-zone:hover,.eye-view .eye-drop-zone.dragover { border-color: #1d61c2; background: #edf5ff; }
.eye-view .upload-note { border-left-color: #1d61c2; background: #f1f7ff; }
.eye-view .eye-detect-button { background: #1d61c2; box-shadow: 0 10px 22px rgba(29,97,194,.18); }
.eye-view .eye-detect-button:hover { background: #174e9e; }
.eye-view .result-card--cdr { border-color: #c8dcf4; background: #f7fbff; }
.eye-view .eye-image-placeholder,.eye-view .eye-overlay-placeholder { background: #f7faff; }
.eye-view .result-card-title { background: #f7faff; }
.cell-view { background: #f3f7fc !important; }
.cell-view .sidebar { background: #113765; }
.cell-view .logo { display: flex; align-items: center; gap: 10px; }
.cell-view .logo img { width: 30px; height: 30px; }
.cell-view .nav-btn.active { background: #286fc9; }
.cell-view .drop-zone { border-color: #bfd5ed; background: #f8fbff; }
.cell-view .drop-zone:hover,.cell-view .drop-zone.dragover { border-color: #1d61c2; background: #edf5ff; }
.cell-view .drop-icon { color: #1d61c2; }
.cell-view .btn-primary { background: #1d61c2; }
.cell-view .btn-primary:hover { background: #174e9e; }
.cell-view .clinical-result-empty { border-color: #cbdff4; background: #f8fbff; }
.performance-view { --perf-blue: #1d61c2; --perf-teal: #4d83c7; --perf-purple: #5573ad; --perf-canvas: #f3f7fc; }
.performance-view .section-kicker { color: #1d61c2; }

@media (max-width: 900px) {
    .portal-view .portal-hero { grid-template-columns: 1fr; }
    .portal-view .portal-hero__visual { position: relative; inset: auto; min-height: 0; padding: 0 32px 28px; pointer-events: auto; }
    .portal-view .portal-hero__content { padding-bottom: 25px; }
    .login-aside { min-height: 200px; }
}
@media (max-width: 560px) {
    .portal-view .portal-hero__content { padding: 32px 23px 22px; }
    .portal-view .portal-hero__visual { display: flex; padding: 0 20px 22px; }
    .workflow-card { padding: 15px; }
    .workflow-card__head strong { display: none; }
    .portal-view .module-card--featured { grid-template-rows: auto auto 1fr auto; gap: 14px; }
    .module-flow { position: relative; top: auto; right: auto; width: 100%; gap: 5px; }
    .module-flow span { padding: 7px 9px; }
}
