:root {
    color-scheme: light;
    --green-900: #173f35;
    --green-800: #205447;
    --green-700: #2b6858;
    --mustard: #d1a72c;
    --ink: #202923;
    --muted: #66716b;
    --line: #d8ded9;
    --surface: #ffffff;
    --canvas: #f3f5f2;
    --error: #a52f2f;
    --shadow: 0 8px 24px rgb(23 63 53 / 8%);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--canvas);
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
}

body {
    margin: 0;
    min-height: 100vh;
}

button,
select {
    font: inherit;
}

.site-header {
    border-bottom: 4px solid var(--mustard);
    background: var(--green-900);
    color: white;
}

.header-inner,
main,
footer {
    width: min(1180px, calc(100% - 40px));
    margin-inline: auto;
}
footer a { color: var(--green-800); font-weight: 700; text-underline-offset: 3px; }

.header-inner {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
}

.brand img {
    border: 1px solid rgb(255 255 255 / 35%);
}

.brand span {
    display: grid;
    gap: 3px;
}

.brand strong {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 23px;
    line-height: 1;
}

.brand small {
    color: #d6e2dc;
    font-size: 12px;
}

nav {
    align-self: stretch;
    display: flex;
    align-items: stretch;
    gap: 22px;
}

nav a {
    display: flex;
    align-items: center;
    border-bottom: 3px solid transparent;
    color: #e4ece8;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

nav a[aria-current='page'] {
    border-bottom-color: var(--mustard);
    color: white;
}

main {
    padding-block: 42px 56px;
}

.intro {
    margin-bottom: 28px;
}

.eyebrow,
.step-label {
    margin: 0 0 7px;
    color: var(--green-700);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 780px;
    margin-bottom: 10px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 38px;
    line-height: 1.15;
    font-weight: 700;
}

.intro > p:last-child {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 17px;
}

.search-panel {
    padding: 26px;
    border: 1px solid var(--line);
    border-top: 4px solid var(--green-700);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel-heading,
.results-heading,
.form-actions,
.school-title-row,
footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

h2 {
    margin-bottom: 0;
    font-size: 21px;
    line-height: 1.25;
}

.database-note,
.result-count {
    color: var(--muted);
    font-size: 13px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
}

label {
    display: grid;
    gap: 7px;
    color: #344139;
    font-size: 13px;
    font-weight: 700;
}

select {
    width: 100%;
    height: 44px;
    padding: 0 36px 0 12px;
    border: 1px solid #aeb8b1;
    border-radius: 4px;
    background: white;
    color: var(--ink);
}

select:focus,
button:focus-visible,
a:focus-visible {
    outline: 3px solid rgb(209 167 44 / 45%);
    outline-offset: 2px;
}

select:disabled {
    background: #eef1ee;
    color: #78817c;
}

.form-actions {
    min-height: 52px;
    margin-top: 18px;
    border-top: 1px solid #edf0ed;
    padding-top: 18px;
}

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

.form-status.is-error {
    color: var(--error);
    font-weight: 700;
}

button {
    min-width: 172px;
    min-height: 44px;
    padding: 10px 20px;
    border: 1px solid var(--green-900);
    border-radius: 4px;
    background: var(--green-800);
    color: white;
    cursor: pointer;
    font-weight: 700;
}

button:hover:not(:disabled) {
    background: var(--green-900);
}

button:disabled {
    border-color: #abb3ae;
    background: #abb3ae;
    cursor: not-allowed;
}

.results-section {
    margin-top: 42px;
}

.results-heading {
    padding-bottom: 13px;
    border-bottom: 2px solid var(--green-900);
}

.results {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 7px;
    padding: 54px 20px;
    border: 1px dashed #b9c2bc;
    border-radius: 6px;
    background: rgb(255 255 255 / 62%);
    text-align: center;
}

.empty-state span {
    color: var(--muted);
    font-size: 14px;
}

.school-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--mustard);
    border-radius: 5px;
    background: var(--surface);
}

.school-title-row {
    align-items: flex-start;
}

.school-card h3 {
    margin-bottom: 7px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 19px;
    line-height: 1.3;
}

.school-codes {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.school-code {
    padding: 4px 7px;
    border: 1px solid #cbd2cd;
    border-radius: 3px;
    color: #47534b;
    font-family: Consolas, monospace;
    font-size: 12px;
}

.school-address {
    margin-bottom: 15px;
    color: var(--muted);
    font-size: 14px;
}

.school-details {
    display: grid;
    grid-template-columns: repeat(4, minmax(100px, 1fr));
    gap: 14px;
    margin: 0;
}

.school-details div {
    min-width: 0;
}

dt {
    margin-bottom: 3px;
    color: #79837d;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 13px;
}

.school-contact {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 14px;
    margin-top: 17px;
    padding-top: 15px;
    border-top: 1px solid #e5e9e6;
}

.school-contact[hidden] {
    display: none;
}

.school-contact > span {
    color: #79837d;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.contact-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
}

.contact-items a {
    display: grid;
    gap: 2px;
    min-width: 130px;
    color: var(--green-800);
    font-size: 13px;
    font-weight: 700;
    overflow-wrap: anywhere;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.contact-items a span {
    color: #79837d;
    font-size: 10px;
    text-decoration: none;
    text-transform: uppercase;
}

.school-ranking {
    min-width: 110px;
    padding-left: 20px;
    border-left: 1px solid var(--line);
    text-align: center;
}

.school-ranking span,
.school-ranking small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
}

.school-ranking strong {
    display: block;
    margin: 7px 0 3px;
    color: var(--green-800);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 27px;
}

footer {
    min-height: 72px;
    border-top: 1px solid #dce1dd;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 860px) {
    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .school-details {
        grid-template-columns: repeat(2, minmax(100px, 1fr));
    }
}

@media (max-width: 600px) {
    .header-inner,
    main,
    footer {
        width: min(100% - 28px, 1180px);
    }

    .header-inner {
        min-height: 70px;
        flex-wrap: wrap;
        gap: 0;
        padding-top: 12px;
    }

    .brand img {
        width: 44px;
        height: 44px;
    }

    .brand strong {
        font-size: 20px;
    }

    .brand small {
        display: none;
    }

    nav {
        width: 100%;
        min-height: 44px;
        gap: 12px;
        overflow-x: auto;
    }

    nav a {
        flex: 0 0 auto;
        font-size: 12px;
    }

    main {
        padding-block: 28px 40px;
    }

    h1 {
        font-size: 31px;
    }

    .panel-heading,
    .form-actions,
    .results-heading,
    footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
    }

    .search-panel {
        padding: 20px 16px;
    }

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

    button {
        width: 100%;
    }

    .results-section {
        margin-top: 34px;
    }

    .school-card {
        grid-template-columns: 1fr;
        padding: 18px 16px;
    }

    .school-title-row {
        flex-direction: column;
        gap: 4px;
    }

    .school-codes {
        justify-content: flex-start;
    }

    .school-details {
        grid-template-columns: 1fr 1fr;
    }

    .school-ranking {
        padding: 13px 0 0;
        border-top: 1px solid var(--line);
        border-left: 0;
        text-align: left;
    }

    .school-contact {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .school-ranking strong {
        display: inline-block;
        margin-right: 5px;
    }

    .school-ranking small {
        display: inline;
    }
}
