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

* { box-sizing: border-box; }

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

body { margin: 0; min-height: 100vh; }
button, input, textarea { 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; }

.tool-page { max-width: 920px; }
.privacy-note { margin: 20px 0; padding: 14px 16px; border-left: 4px solid var(--green-700); background: #edf4ef; line-height: 1.55; }
.practice-quiz { display: grid; gap: 18px; margin-top: 28px; }
.practice-quiz fieldset { min-width: 0; margin: 0; padding: 18px; border: 1px solid var(--line); }
.practice-quiz legend { padding: 0 8px; font-weight: 700; }
.practice-quiz label { display: block; padding: 7px 4px; }
.practice-quiz input { margin-right: 7px; }
.tool-actions { display: flex; gap: 12px; }
.tool-actions button,
.equation-solver button,
.base-converter button { min-height: 44px; padding: 0 18px; border: 1px solid var(--green-800); background: var(--green-800); color: white; font: inherit; font-weight: 700; cursor: pointer; }
.tool-actions .secondary-button { background: white; color: var(--green-800); }
.tool-result { display: block; min-height: 58px; margin-top: 20px; padding: 16px; border: 1px solid var(--line); background: white; font-size: 17px; font-weight: 700; }
.tool-result:empty { display: none; }
.tool-result[data-state="warning"] { border-left: 4px solid var(--mustard); }
.tool-result[data-state="success"] { border-left: 4px solid var(--green-700); }
.equation-solver { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr) auto) minmax(110px, auto); gap: 14px; align-items: end; margin-top: 30px; }
.coefficient { display: grid; gap: 7px; }
.coefficient label { color: var(--muted); font-size: 13px; font-weight: 700; }
.coefficient input { width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); font: inherit; }
.base-converter { display: grid; grid-template-columns: minmax(220px, 2fr) minmax(120px, 1fr) 44px minmax(120px, 1fr) auto; gap: 14px; align-items: end; margin-top: 30px; }
.base-converter label { min-width: 0; display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.base-converter input { width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); font: inherit; text-transform: uppercase; }
.base-converter .secondary-button { width: 44px; padding: 0; background: white; color: var(--green-800); font-size: 22px; }

.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; }

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

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

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

main { padding-block: 42px 58px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-family: Georgia, 'Times New Roman', serif; font-size: 40px; line-height: 1.15; }
h2 { font-size: 22px; line-height: 1.25; }

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

.home-intro,
.page-intro { max-width: 820px; margin-bottom: 32px; }
.home-intro > p:last-child,
.page-intro > p:last-child { color: var(--muted); font-size: 17px; line-height: 1.5; }

.directory-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-block: 1px solid var(--line);
}

.directory-links a {
    min-height: 170px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    border-right: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
}

.directory-links a:last-child { border-right: 0; }
.directory-links a:hover { background: #edf4f0; }
.directory-links span { margin-bottom: 10px; color: var(--green-700); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.directory-links strong { margin-bottom: 8px; font-family: Georgia, 'Times New Roman', serif; font-size: 22px; }
.directory-links small { color: var(--muted); font-size: 13px; line-height: 1.45; }

.archive-preview { margin-top: 48px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 15px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading > a,
.primary-link { color: var(--green-800); font-weight: 700; text-underline-offset: 3px; }

.historical-note {
    padding: 13px 15px;
    border-left: 4px solid var(--mustard);
    background: var(--warning);
    color: #554b2a;
    font-size: 13px;
    line-height: 1.5;
}

.archive-list { border-top: 1px solid var(--line); }
.archive-row {
    min-width: 0;
    display: grid;
    gap: 5px;
    padding: 15px 3px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
    overflow-wrap: anywhere;
}
.archive-row:hover strong { color: var(--green-700); text-decoration: underline; text-underline-offset: 3px; }
.archive-row[hidden] { display: none; }
.archive-row strong { font-family: Georgia, 'Times New Roman', serif; font-size: 17px; }
.archive-row span { max-width: 900px; color: var(--muted); font-size: 13px; line-height: 1.45; }

.archive-browser {
    border: 1px solid var(--line);
    border-top: 4px solid var(--green-700);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.archive-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.archive-toolbar h2 { margin-bottom: 3px; }
.archive-toolbar p { min-height: 15px; margin-bottom: 0; color: var(--muted); font-size: 12px; }
.archive-toolbar label { width: min(100%, 360px); display: grid; gap: 7px; font-size: 13px; font-weight: 700; }
.archive-toolbar input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #aeb8b1; border-radius: 4px; }
.archive-browser .archive-list { max-height: 900px; overflow-y: auto; padding-inline: 24px; border-top: 0; }
.convocations-browser { margin-top: 24px; }
.convocations-browser .archive-toolbar { align-items: center; }
.empty-state { padding: 40px 20px; color: var(--muted); text-align: center; }

.contact-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.72fr) minmax(480px, 1.28fr);
    gap: 56px;
    align-items: start;
}
.contact-intro > p:not(.eyebrow) { color: var(--muted); font-size: 17px; line-height: 1.5; }
.contact-guidance { margin-top: 34px; padding-top: 20px; border-top: 4px solid var(--mustard); }
.contact-guidance h2 { font-size: 18px; }
.contact-guidance p { color: var(--muted); font-size: 14px; line-height: 1.55; }
.contact-form-panel {
    border: 1px solid var(--line);
    border-top: 4px solid var(--green-700);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.contact-form-heading { padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.contact-form-heading h2 { margin-bottom: 5px; }
.contact-form-heading p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; padding: 24px; }
.form-field { min-width: 0; display: grid; align-content: start; gap: 7px; font-size: 13px; font-weight: 700; }
.form-field-wide,
.contact-consent { grid-column: 1 / -1; }
.form-field input,
.form-field textarea {
    width: 100%;
    border: 1px solid #9eaaa2;
    border-radius: 4px;
    background: white;
    color: var(--ink);
}
.form-field input { height: 44px; padding: 0 11px; }
.form-field textarea { min-height: 164px; padding: 11px; line-height: 1.5; resize: vertical; }
.form-field input[aria-invalid='true'],
.form-field textarea[aria-invalid='true'] { border-color: #a53d38; }
.form-field input:focus,
.form-field textarea:focus,
button:focus-visible { outline: 3px solid rgb(209 167 44 / 45%); outline-offset: 2px; }
.field-error { color: #8c2f2b; font-size: 12px; font-weight: 400; }
.form-notice { margin: 20px 24px 0; padding: 13px 15px; border-left: 4px solid; font-size: 13px; line-height: 1.5; }
.success-notice { border-color: var(--green-700); background: #eaf4ef; color: var(--green-900); }
.error-notice { border-color: #a53d38; background: #fff0ee; color: #762824; }
.contact-consent { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 4px; }
.contact-consent p { max-width: 430px; margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.contact-consent button {
    min-height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 4px;
    background: var(--green-800);
    color: white;
    font-weight: 700;
    cursor: pointer;
}
.contact-consent button:hover { background: var(--green-900); }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.article-layout { display: grid; grid-template-columns: minmax(0, 820px) minmax(220px, 1fr); gap: 62px; align-items: start; }
.breadcrumb { display: flex; gap: 8px; margin-bottom: 30px; color: var(--muted); font-size: 13px; }
.breadcrumb a { color: var(--green-800); }
.article-content > h1 { max-width: 780px; font-size: 36px; }
.article-content > .historical-note { margin: 22px 0 30px; }
.article-aside { position: sticky; top: 24px; display: grid; border-top: 4px solid var(--mustard); padding-top: 18px; }
.article-aside h2 { margin-bottom: 12px; }
.article-aside a { padding: 12px 2px; border-bottom: 1px solid var(--line); color: var(--green-800); font-size: 14px; font-weight: 700; }

.legacy-article { font-size: 16px; line-height: 1.68; overflow-wrap: anywhere; }
.legacy-article h2 { margin: 34px 0 12px; font-family: Georgia, 'Times New Roman', serif; font-size: 25px; }
.legacy-article h3 { margin: 28px 0 10px; font-size: 20px; }
.legacy-article p { margin-bottom: 17px; }
.legacy-article a { color: var(--green-800); text-underline-offset: 3px; }
.legacy-article img { display: block; max-width: 100%; height: auto; margin: 20px auto; }
.legacy-article table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.legacy-article th,
.legacy-article td { padding: 8px; border: 1px solid var(--line); vertical-align: top; }
.legacy-article pre { max-width: 100%; overflow-x: auto; padding: 15px; background: #e9eeea; font-size: 13px; }

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

footer {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid #dce1dd;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 820px) {
    .directory-links { grid-template-columns: 1fr; }
    .directory-links a { min-height: 125px; border-right: 0; border-bottom: 1px solid var(--line); }
    .directory-links a:last-child { border-bottom: 0; }
    .article-layout { grid-template-columns: 1fr; gap: 44px; }
    .article-aside { position: static; }
    .contact-layout { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 660px) {
    .header-inner,
    main,
    footer { width: min(100% - 28px, 1180px); }
    .header-inner { flex-wrap: wrap; gap: 0; padding-top: 12px; }
    .brand img { width: 44px; height: 44px; }
    .brand strong { font-size: 20px; }
    .brand small { display: none; }
    .site-header nav { width: 100%; min-height: 44px; gap: 18px; overflow-x: auto; }
    .site-header nav a { flex: 0 0 auto; font-size: 12px; }
    main { padding-block: 28px 42px; }
    h1 { font-size: 32px; }
    .article-content > h1 { font-size: 30px; }
    .archive-toolbar,
    .section-heading,
    footer { align-items: flex-start; flex-direction: column; gap: 12px; }
    .archive-toolbar { padding: 18px 16px; }
    .archive-toolbar label { width: 100%; }
    .archive-browser .archive-list { padding-inline: 16px; }
    .legacy-article { font-size: 15px; }
    .contact-form { grid-template-columns: 1fr; padding: 18px 16px; }
    .form-notice { margin: 16px 16px 0; }
    .contact-form-heading { padding-inline: 16px; }
    .contact-consent { align-items: stretch; flex-direction: column; }
    .contact-consent button { width: 100%; }
    .equation-solver { grid-template-columns: 1fr auto; }
    .equation-solver button { grid-column: 1 / -1; }
    .base-converter { grid-template-columns: 1fr 44px 1fr; }
    .base-converter label:first-child { grid-column: 1 / -1; }
    .base-converter button[type='submit'] { grid-column: 1 / -1; }
    .tool-actions { align-items: stretch; flex-direction: column; }
}
