:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --text: #17202a;
    --muted: #68737d;
    --border: #e3e7eb;
    --accent: #123c69;
    --accent-dark: #0b2c4f;
    --success: #1d9b63;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    min-height: 100vh;
}

.topbar {
    height: 76px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6vw;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--accent);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 20px;
}

.brand-name {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: .08em;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.status {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.container {
    width: min(920px, 90%);
    margin: 0 auto;
    padding: 70px 0 90px;
}

.hero {
    max-width: 720px;
    margin-bottom: 40px;
}

.eyebrow {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em;
    color: var(--accent);
    margin-bottom: 12px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(44px, 7vw, 76px);
    line-height: .98;
    letter-spacing: -.045em;
}

.hero h1 span {
    color: var(--accent);
}

.hero p {
    max-width: 650px;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.65;
}

.research-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 12px 35px rgba(20, 30, 40, .06);
}

.research-card label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
}

textarea {
    width: 100%;
    resize: vertical;
    min-height: 140px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 17px;
    font: inherit;
    font-size: 16px;
    line-height: 1.55;
    outline: none;
    background: #fbfcfd;
    color: var(--text);
}

textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(18, 60, 105, .08);
}

.card-footer {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.hint {
    font-size: 12px;
    color: var(--muted);
}

button {
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: white;
    padding: 13px 25px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    min-width: 120px;
}

button:hover {
    background: var(--accent-dark);
}

button:disabled {
    opacity: .65;
    cursor: wait;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

.results {
    margin-top: 55px;
}

.section-heading {
    margin-bottom: 20px;
}

.section-heading h2 {
    margin: 0;
    font-size: 30px;
    letter-spacing: -.025em;
}

.result-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
    margin-top: 15px;
}

.result-block h3 {
    margin: 0 0 15px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.answer,
.evidence,
.limitations {
    white-space: pre-wrap;
    line-height: 1.75;
    color: #38434d;
}

.answer-block {
    border-left: 4px solid var(--accent);
}

.error {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    background: #fff1f1;
    color: #9b2525;
    border: 1px solid #f0cccc;
}

footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 25px 6vw;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 600px) {
    .topbar {
        padding: 0 5%;
    }

    .container {
        width: 92%;
        padding-top: 48px;
    }

    .hero p {
        font-size: 16px;
    }

    .research-card {
        padding: 18px;
    }

    .card-footer {
        align-items: stretch;
        flex-direction: column;
    }

    button {
        width: 100%;
    }

    footer {
        flex-direction: column;
    }
}
