:root {
    color-scheme: light;
    --ink: #17211c;
    --muted: #647067;
    --line: #d9e4dc;
    --paper: #f8faf7;
    --panel: #ffffff;
    --green: #176b55;
    --green-dark: #0d493b;
    --blue: #245b7a;
    --amber: #98690c;
    --red: #a7342f;
    --red-bg: #fff0ee;
    --soft: #eef6f1;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(23, 107, 85, 0.10), transparent 32%),
        linear-gradient(315deg, rgba(36, 91, 122, 0.10), transparent 34%),
        var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 34px clamp(18px, 4vw, 56px) 22px;
}

.topbar h1,
.section-heading h2,
.empty-state h3,
.alert h3,
.remedies h3 {
    margin: 0;
    letter-spacing: 0;
}

.topbar h1 {
    max-width: 860px;
    font-size: clamp(28px, 4vw, 52px);
    line-height: 1.04;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.status-pill,
.small-badge {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 800;
    padding: 10px 14px;
    box-shadow: 0 10px 30px rgba(22, 42, 33, 0.08);
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    gap: 22px;
    padding: 0 clamp(18px, 4vw, 56px) 28px;
}

.panel {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 22px 60px rgba(22, 42, 33, 0.10);
}

.case-panel,
.result-panel {
    padding: clamp(18px, 2.4vw, 28px);
}

.result-panel {
    position: sticky;
    top: 18px;
    align-self: start;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-heading h2 {
    font-size: clamp(20px, 2vw, 28px);
}

.case-form {
    display: grid;
    gap: 16px;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
    display: grid;
    gap: 8px;
    color: #2e3c34;
    font-size: 14px;
    font-weight: 750;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdfb;
    color: var(--ink);
    font: inherit;
    font-weight: 500;
    line-height: 1.45;
    padding: 12px 13px;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: var(--green);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(23, 107, 85, 0.12);
}

.actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 4px;
}

button,
.secondary-action {
    min-height: 44px;
    border-radius: 8px;
    font: inherit;
    font-weight: 850;
    text-decoration: none;
    cursor: pointer;
}

button {
    border: 0;
    background: var(--green);
    color: white;
    padding: 0 18px;
}

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

.secondary-action {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    background: white;
    color: var(--green-dark);
    padding: 0 16px;
}

.empty-state,
.alert,
.remedies {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdfb;
    padding: 16px;
    margin-top: 14px;
}

.empty-state h3,
.alert h3,
.remedies h3 {
    font-size: 18px;
}

.empty-state p,
.alert p,
.remedy-card p,
footer p {
    color: var(--muted);
    line-height: 1.55;
}

.alert ul {
    margin: 10px 0 0;
    padding-left: 18px;
    color: #35443b;
    line-height: 1.55;
}

.emergency {
    border-color: rgba(167, 52, 47, 0.35);
    background: var(--red-bg);
}

.emergency h3 {
    color: var(--red);
}

.clinical-note {
    border-left: 3px solid var(--amber);
    padding-left: 10px;
}

.remedy-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    padding: 14px;
    margin-top: 12px;
}

.remedy-card h4 {
    margin: 0 0 6px;
    font-size: 17px;
}

.remedy-card p {
    margin: 0;
}

.remedy-card span {
    flex: 0 0 auto;
    border-radius: 8px;
    background: var(--soft);
    color: var(--green-dark);
    font-weight: 900;
    padding: 8px 10px;
}

.match-line {
    margin-top: 8px !important;
    color: var(--blue) !important;
    font-weight: 750;
}

footer {
    padding: 0 clamp(18px, 4vw, 56px) 30px;
}

footer p {
    max-width: 960px;
    margin: 0;
    font-size: 13px;
}

@media (max-width: 980px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .result-panel {
        position: static;
    }
}

@media (max-width: 680px) {
    .topbar {
        flex-direction: column;
    }

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

    .actions,
    button,
    .secondary-action {
        width: 100%;
    }

    button,
    .secondary-action {
        justify-content: center;
    }
}
