:root {
    --navy: #16364a;
    --navy-dark: #0d2635;
    --blue: #2477a6;
    --blue-dark: #185f89;
    --cyan: #56b6c2;
    --coral: #d98b70;
    --paper: #f4f6f7;
    --white: #ffffff;
    --ink: #263942;
    --muted: #667982;
    --line: #d7e0e4;
    --success: #26755c;
    --success-bg: #edf8f4;
    --danger: #a53d44;
    --danger-bg: #fff2f2;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.62)),
        radial-gradient(circle at 12% 10%, #d7edf0, transparent 31%),
        radial-gradient(circle at 88% 24%, #f0ded7, transparent 25%),
        var(--paper);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.65;
}

a {
    color: var(--blue-dark);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-header {
    border-top: 5px solid var(--cyan);
    border-bottom: 1px solid #c8d4d9;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 3px 14px rgba(13, 38, 53, 0.08);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 82px;
}

.lab-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--navy);
    text-decoration: none;
}

.lab-brand:hover,
.lab-brand:focus {
    color: var(--navy);
    text-decoration: none;
}

.lab-brand > .glyphicon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: var(--white);
    background: var(--navy);
    font-size: 18px;
}

.lab-brand span:last-child {
    display: grid;
}

.lab-brand strong {
    font-family: "Times New Roman", Times, serif;
    font-size: 18px;
    line-height: 1.25;
}

.lab-brand small {
    color: var(--muted);
    font-size: 11px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 12px;
    border-radius: 6px;
    color: #43565f;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.main-nav a:hover,
.main-nav a:focus,
.main-nav a.active {
    color: var(--white);
    background: var(--navy);
    text-decoration: none;
}

.page-shell {
    margin-top: 26px;
    margin-bottom: 26px;
    padding: 0;
    overflow: hidden;
    border: 1px solid #cbd6db;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 12px 36px rgba(13, 38, 53, 0.13);
}

.hero-panel {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: stretch;
    min-height: 360px;
    border-bottom: 5px solid var(--navy);
}

.hero-panel.image-only-hero {
    display: block;
    min-height: 0;
}

.image-only-hero .hero-image-panel {
    min-height: 300px;
    padding: 55px 45px;
}

.image-only-hero .topoflow-main-image {
    width: min(100%, 720px);
}

.hero-image-panel {
    position: relative;
    display: grid;
    place-items: center;
    padding: 48px 38px;
    overflow: hidden;
    background:
        linear-gradient(rgba(255,255,255,.94), rgba(255,255,255,.94)),
        repeating-linear-gradient(0deg, transparent, transparent 27px, #dce7ea 28px),
        repeating-linear-gradient(90deg, transparent, transparent 27px, #dce7ea 28px);
}

.hero-image-panel::before,
.hero-image-panel::after {
    content: "";
    position: absolute;
    width: 190px;
    height: 190px;
    border: 1px solid rgba(86, 182, 194, 0.3);
    border-radius: 50%;
}

.hero-image-panel::before {
    left: -65px;
    top: -85px;
}

.hero-image-panel::after {
    right: -65px;
    bottom: -85px;
    border-color: rgba(217, 139, 112, 0.32);
}

.topoflow-main-image {
    position: relative;
    z-index: 1;
    display: block;
    width: min(100%, 560px);
    height: auto;
    padding: 24px 18px;
    border-radius: 8px;
    background: var(--white);
    box-shadow:
        0 14px 35px rgba(13, 38, 53, 0.17),
        0 0 0 1px rgba(22, 54, 74, 0.08);
}

.hero-copy {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    padding: 48px 54px;
    color: var(--white);
    background:
        radial-gradient(circle at 92% 12%, rgba(86, 182, 194, 0.2), transparent 35%),
        linear-gradient(145deg, var(--navy), var(--navy-dark));
}

.section-kicker {
    margin: 0 0 8px;
    color: #96d5dc;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-copy h1 {
    margin: 0 0 18px;
    font-family: "Times New Roman", Times, serif;
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.hero-lead {
    max-width: 500px;
    margin: 0;
    color: rgba(255, 255, 255, 0.74);
    font-size: 16px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.btn {
    border-radius: 5px;
    font-weight: 600;
}

.btn-primary {
    border-color: var(--blue-dark);
    background-color: var(--blue);
    background-image: none;
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: #124c6e;
    background-color: var(--blue-dark);
}

.content-section {
    padding: 44px 54px;
    border-bottom: 1px solid var(--line);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 28px;
}

.section-title > .glyphicon {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 7px;
    color: var(--white);
    background: var(--navy);
    font-size: 18px;
}

.section-title h2 {
    margin: 0 0 2px;
    color: var(--navy);
    font-family: "Times New Roman", Times, serif;
    font-size: 28px;
    font-weight: 700;
}

.section-title p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.introduction-section {
    background: var(--white);
}

.overview-section {
    border-bottom: 0;
}

.hero-image-panel.overview-image-panel {
    min-height: 450px;
    margin: -44px -54px 34px;
}

.overview-image-panel .topoflow-main-image {
    width: min(100%, 900px);
}

.introduction-text {
    margin: 0;
    color: #384f59;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.85;
    text-align: justify;
}

.introduction-divider {
    height: 0;
    margin: 32px 0 0;
    border: 0;
    border-top: 4px solid #7b858a;
}

.workflow-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.workflow-grid article {
    position: relative;
    min-height: 180px;
    padding: 25px 24px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--cyan);
    border-radius: 6px;
    background: #fbfcfc;
}

.workflow-grid article:nth-child(3) {
    border-top-color: var(--coral);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-bottom: 17px;
    border-radius: 50%;
    color: var(--white);
    background: var(--navy);
    font-size: 13px;
    font-weight: 700;
}

.workflow-grid h3,
.form-block h3,
.help-grid h3 {
    margin: 0 0 8px;
    color: var(--navy);
    font-size: 17px;
    font-weight: 700;
}

.workflow-grid p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.submission-section {
    background: #fbfcfd;
}

#topoflow-form {
    overflow: hidden;
    border: 1px solid #cbd8dd;
    border-radius: 7px;
    background: var(--white);
}

.form-block {
    padding: 28px 30px;
}

.form-block + .form-block {
    border-top: 1px solid var(--line);
}

.form-help {
    margin: -2px 0 20px;
    color: var(--muted);
    font-size: 13px;
}

.input-mode-tabs {
    display: inline-flex;
    margin-bottom: 16px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #edf2f4;
}

.input-mode {
    min-width: 140px;
    padding: 9px 16px;
    border: 0;
    border-radius: 4px;
    color: #50646d;
    background: transparent;
    font-weight: 600;
}

.input-mode.active {
    color: var(--white);
    background: var(--navy);
    box-shadow: 0 2px 6px rgba(13, 38, 53, 0.18);
}

.hidden {
    display: none !important;
}

label {
    display: block;
    margin-bottom: 7px;
    color: #334a54;
    font-size: 13px;
    font-weight: 700;
}

textarea,
.form-control {
    border-color: #bccbd1;
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(13, 38, 53, 0.05);
}

textarea {
    display: block;
    width: 100%;
    min-height: 165px;
    padding: 13px 14px;
    resize: vertical;
    border: 1px solid #bccbd1;
    color: #263942;
    background: #fcfdfd;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.55;
}

textarea:focus,
.form-control:focus {
    border-color: var(--blue);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(36, 119, 166, 0.12);
}

.input-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
}

.text-button {
    padding: 0;
    border: 0;
    color: var(--blue-dark);
    background: transparent;
    font-weight: 600;
    text-decoration: underline;
}

.file-drop {
    display: grid;
    place-items: center;
    min-height: 165px;
    padding: 25px;
    border: 1px dashed #91aab4;
    border-radius: 5px;
    color: #344d57;
    background: #f7fafb;
    text-align: center;
    cursor: pointer;
}

.file-drop:hover,
.file-drop.dragging {
    border-color: var(--blue);
    background: #edf6fa;
}

.file-drop input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.file-drop > .glyphicon {
    margin-bottom: 10px;
    color: var(--blue);
    font-size: 27px;
}

.file-drop strong,
.file-drop small {
    display: block;
}

.file-drop small,
.field-group small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
}

.validation-message {
    min-height: 20px;
    margin: 8px 0 0;
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 0.65fr 1.35fr;
    gap: 18px;
}

.field-group .form-control {
    height: 42px;
}

.email-field {
    margin-top: 20px;
}

.email-field .form-control {
    max-width: 520px;
}

.submit-row {
    display: flex;
    gap: 10px;
    padding: 20px 30px;
    border-top: 1px solid var(--line);
    background: #edf2f4;
}

.submit-row .btn {
    min-width: 105px;
}

.submission-status {
    display: none;
    margin: 20px 30px 28px;
    padding: 16px 18px;
    border-radius: 5px;
}

.submission-status.visible {
    display: block;
}

.submission-status.success {
    border: 1px solid #add8c8;
    color: var(--success);
    background: var(--success-bg);
}

.submission-status.error {
    border: 1px solid #edbec1;
    color: var(--danger);
    background: var(--danger-bg);
}

.submission-status strong {
    display: block;
    margin-bottom: 3px;
}

.submission-status code {
    display: block;
    margin: 9px 0;
    padding: 8px 10px;
    overflow-wrap: anywhere;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 4px;
    color: var(--navy-dark);
    background: rgba(255, 255, 255, 0.7);
}

.submission-status a {
    font-weight: 700;
    text-decoration: underline;
}

.help-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.help-grid > div {
    padding: 22px 24px;
    border-left: 3px solid var(--cyan);
    background: #f6f9fa;
}

.help-grid > div:nth-child(2) {
    border-left-color: var(--coral);
}

.help-grid ul {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
}

.help-grid li + li {
    margin-top: 6px;
}

.news-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.news-list li {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 18px;
    padding: 14px 17px;
    border-left: 3px solid var(--cyan);
    color: #3f5660;
    background: #f5f9fa;
}

.news-list time {
    color: var(--navy);
    font-weight: 700;
}

.home-download {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 22px 24px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8fafb;
}

.home-download p {
    max-width: 780px;
    margin: 0;
    color: #465d66;
}

.home-download code {
    color: var(--navy);
    font-weight: 700;
}

.reference-list {
    margin: 0;
    padding: 20px 24px 20px 44px;
    border-left: 3px solid var(--coral);
    color: #465d66;
    background: #faf7f5;
}

.reference-list li + li {
    margin-top: 12px;
}

#news,
#download,
#references {
    padding-top: 28px;
    padding-bottom: 28px;
}

#news .section-title,
#download .section-title,
#references .section-title {
    margin-bottom: 18px;
}

.site-footer {
    padding: 28px 35px;
    color: rgba(255, 255, 255, 0.75);
    background: var(--navy-dark);
    text-align: center;
}

.site-footer p {
    margin: 0;
    font-size: 12px;
}

.site-footer p + p {
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.45);
}

.subpage-hero {
    padding: 52px 54px;
    color: var(--white);
    background:
        radial-gradient(circle at 88% 15%, rgba(86, 182, 194, 0.25), transparent 28%),
        linear-gradient(145deg, var(--navy), var(--navy-dark));
}

.subpage-hero h1 {
    margin: 0 0 12px;
    font-family: "Times New Roman", Times, serif;
    font-size: 42px;
    font-weight: 700;
}

.subpage-hero > p:last-child {
    max-width: 720px;
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
}

.tutorial-steps {
    display: grid;
    gap: 0;
}

.tutorial-steps article {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 19px;
    padding: 25px 0;
    border-bottom: 1px solid var(--line);
}

.tutorial-steps article:first-child {
    padding-top: 0;
}

.tutorial-steps h2,
.example-card h2,
.example-result-callout h2,
.download-card h2 {
    margin: 0 0 8px;
    color: var(--navy);
    font-family: "Times New Roman", Times, serif;
    font-size: 22px;
    font-weight: 700;
}

.tutorial-steps p {
    margin: 0 0 10px;
    color: var(--muted);
}

pre {
    margin: 14px 0;
    padding: 15px 17px;
    overflow: auto;
    border: 1px solid #cedade;
    border-radius: 5px;
    color: #28424d;
    background: #f4f8f9;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
}

.doc-note {
    margin-top: 12px;
    padding: 13px 15px;
    border-left: 3px solid var(--cyan);
    color: #435b65;
    background: #edf6f7;
}

.doc-note code,
.download-card code {
    display: inline-block;
    margin-left: 5px;
    color: var(--navy-dark);
    font-weight: 700;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
}

.example-layout {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 20px;
}

.example-card {
    padding: 24px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--cyan);
    border-radius: 6px;
    background: #fbfcfc;
}

.example-card:nth-child(2) {
    border-top-color: var(--coral);
}

.job-summary {
    margin: 0;
}

.job-summary div {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.job-summary dt {
    color: var(--muted);
    font-weight: 600;
}

.job-summary dd {
    margin: 0;
    color: var(--navy);
    font-weight: 600;
}

.example-result-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    margin-top: 22px;
    padding: 24px;
    border-radius: 6px;
    color: var(--white);
    background: var(--navy);
}

.example-result-callout h2 {
    color: var(--white);
}

.example-result-callout p {
    margin: 0;
    color: rgba(255, 255, 255, 0.65);
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.download-card {
    min-height: 240px;
    padding: 25px 23px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfcfc;
}

.download-card > .glyphicon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 24px;
    border-radius: 6px;
    color: var(--white);
    background: var(--navy);
}

.download-card p {
    color: var(--muted);
}

.download-card code {
    margin: 6px 0 0;
    overflow-wrap: anywhere;
}

.download-note {
    margin-top: 22px;
}

.result-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 25px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f7fafb;
}

.result-summary div {
    display: block;
    padding: 14px 16px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
}

.result-summary div:last-child {
    border-right: 0;
}

.result-summary dt {
    margin-bottom: 3px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.status-complete {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    color: var(--success);
    background: #dff1ea;
    font-size: 12px;
}

.viewer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.viewer-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--white);
}

.molecule-viewer {
    position: relative;
    width: 100%;
    height: 340px;
    color: var(--muted);
    background:
        linear-gradient(rgba(255,255,255,.94), rgba(255,255,255,.94)),
        repeating-linear-gradient(0deg, transparent, transparent 24px, #dfe8eb 25px);
}

.viewer-footer {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 13px 15px;
    border-top: 1px solid var(--line);
    background: #f5f8f9;
    font-size: 13px;
}

.viewer-message {
    margin: 14px 0 0;
    color: var(--danger);
    font-size: 12px;
}

@media (max-width: 991px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .main-nav {
        flex-wrap: wrap;
    }

    .hero-panel {
        grid-template-columns: 1fr;
    }

    .hero-image-panel {
        min-height: 270px;
    }

    .image-only-hero .hero-image-panel {
        min-height: 260px;
    }

    .workflow-grid {
        grid-template-columns: 1fr;
    }

    .workflow-grid article {
        min-height: auto;
    }

    .download-grid,
    .result-summary {
        grid-template-columns: 1fr 1fr;
    }

    .result-summary div:nth-child(2) {
        border-right: 0;
    }

    .result-summary div {
        border-bottom: 1px solid var(--line);
    }

    .result-summary div:nth-child(3),
    .result-summary div:nth-child(4) {
        border-bottom: 0;
    }
}

@media (max-width: 767px) {
    body {
        padding: 0;
    }

    .topbar {
        padding-left: 18px;
        padding-right: 18px;
    }

    .main-nav {
        width: 100%;
    }

    .main-nav a {
        flex: 1 1 45%;
        justify-content: center;
    }

    .page-shell {
        width: calc(100% - 20px);
        margin: 12px auto;
    }

    .hero-copy,
    .content-section {
        padding: 34px 24px;
    }

    .hero-image-panel.overview-image-panel {
        min-height: 330px;
        margin: -34px -24px 28px;
    }

    .hero-copy h1 {
        font-size: 43px;
    }

    .hero-image-panel {
        min-height: 220px;
        padding: 35px 20px;
    }

    .image-only-hero .hero-image-panel {
        min-height: 210px;
        padding: 35px 20px;
    }

    .topoflow-main-image {
        padding: 16px 10px;
    }

    .introduction-text {
        font-size: 14px;
        line-height: 1.75;
        text-align: left;
    }

    .form-block {
        padding: 24px 18px;
    }

    .form-row,
    .help-grid,
    .example-layout,
    .download-grid,
    .viewer-grid,
    .result-summary {
        grid-template-columns: 1fr;
    }

    .input-mode-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .input-mode {
        min-width: 0;
    }

    .submit-row {
        padding: 18px;
    }

    .submission-status {
        margin-right: 18px;
        margin-left: 18px;
    }

    .subpage-hero {
        padding: 38px 24px;
    }

    .subpage-hero h1 {
        font-size: 34px;
    }

    .example-result-callout {
        align-items: flex-start;
        flex-direction: column;
    }

    .home-download {
        align-items: flex-start;
        flex-direction: column;
    }

    .news-list li {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .result-summary div,
    .result-summary div:nth-child(2),
    .result-summary div:nth-child(3) {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .result-summary div:last-child {
        border-bottom: 0;
    }

    .molecule-viewer {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .lab-brand strong {
        font-size: 15px;
    }

    .lab-brand small {
        font-size: 10px;
    }

    .hero-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .input-mode-tabs {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
