:root {
    --bg: #f5f4ef;
    --surface: #fffefb;
    --surface-soft: #eeeee6;
    --ink: #1e2a24;
    --muted: #69736e;
    --border: #dcded6;
    --accent: #285c43;
    --accent-dark: #1f4935;
    --accent-soft: #e2eee6;
    --highlight: #f4eacb;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(30, 42, 36, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

a { color: inherit; }

.site-header {
    max-width: 1200px;
    min-height: 76px;
    margin: 0 auto;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.brand-mark {
    width: 24px;
    height: 30px;
    border: 2px solid var(--accent);
    border-radius: 50% 50% 48% 52%;
    transform: rotate(12deg);
    background: var(--surface);
}

main { max-width: 1120px; margin: 0 auto; padding: 72px 32px 64px; }

.intro { max-width: 680px; margin-bottom: 40px; }

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

h1, h2 { margin: 0; line-height: 1.15; letter-spacing: -0.035em; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(44px, 7vw, 72px); font-weight: 500; }
.lede { max-width: 620px; margin: 20px 0 0; color: var(--muted); font-size: 18px; }

.controls, .results, .method-note {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.controls { padding: 24px; margin-bottom: 24px; }

.view-options {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: var(--surface-soft);
    border-radius: 10px;
    margin-bottom: 24px;
}

.view-options a {
    min-height: 40px;
    padding: 9px 16px;
    border-radius: 7px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.view-options a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.view-options a:hover { color: var(--ink); }

form { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) auto; gap: 16px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 7px; }
label { font-size: 13px; font-weight: 700; }

input, button { min-height: 44px; border-radius: 8px; font: inherit; }
input { width: 100%; padding: 9px 12px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); }
button { padding: 10px 20px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; }
button:hover { background: var(--accent-dark); }

input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid rgba(40, 92, 67, 0.25); outline-offset: 2px; }

.quick-ranges { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 20px; font-size: 13px; }
.quick-ranges span { color: var(--muted); }
.quick-ranges a { color: var(--accent); font-weight: 600; text-underline-offset: 3px; }

.notice { margin: 0 0 24px; padding: 12px 16px; border-radius: 8px; background: var(--highlight); font-size: 14px; }
.results { overflow: hidden; }
.results-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; padding: 28px 32px 24px; }
.results-heading h2 { font-family: Georgia, "Times New Roman", serif; font-size: 32px; font-weight: 500; }
.results-heading > p { max-width: 260px; margin: 0; color: var(--muted); font-size: 13px; text-align: right; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { padding: 17px 32px; text-align: left; border-top: 1px solid var(--border); }
thead th { padding-top: 12px; padding-bottom: 12px; background: var(--surface-soft); color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
tbody th { font-size: 16px; }
tbody td strong { display: block; font-weight: 650; }
tbody td > span:not(.difference) { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
tbody tr:hover { background: #fafaf6; }
.current-year { background: var(--accent-soft); }
.current-year:hover { background: var(--accent-soft); }
.year-badge { display: inline-block; margin-left: 8px; padding: 3px 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; vertical-align: 2px; }
.current-date { background: rgba(40, 92, 67, 0.1); box-shadow: inset 4px 0 0 var(--accent); }
.current-date strong { color: var(--accent-dark); font-size: 17px; }
.current-date > span:not(.difference) { color: var(--accent-dark); font-weight: 650; }
.difference { display: inline-block; padding: 5px 9px; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.difference.same { background: var(--accent-soft); color: var(--accent-dark); }

.method-note { max-width: 760px; margin: 24px auto 0; padding: 24px 28px; }
.method-note h2 { font-size: 18px; letter-spacing: -0.01em; }
.method-note p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

.faq { margin-top: 64px; }
.faq > h2 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(30px, 4vw, 42px); font-weight: 500; }
.faq-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.faq article { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.faq h3 { margin: 0; font-size: 16px; letter-spacing: -0.01em; }
.faq p { margin: 10px 0 0; color: var(--muted); font-size: 14px; }

footer { max-width: 1120px; margin: 0 auto; padding: 0 32px 32px; color: var(--muted); font-size: 13px; }

@media (max-width: 700px) {
    .site-header { padding: 16px 20px; }
    .site-header p { display: none; }
    main { padding: 48px 16px; }
    .intro { margin-bottom: 32px; }
    .lede { font-size: 16px; }
    .controls { padding: 16px; }
    .view-options { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
    .view-options a { padding-left: 8px; padding-right: 8px; text-align: center; }
    form { grid-template-columns: 1fr 1fr; }
    button { grid-column: 1 / -1; }
    .results-heading { align-items: start; padding: 24px 20px; }
    .results-heading > p { display: none; }
    th, td { padding-left: 20px; padding-right: 20px; }
    .method-note { padding: 20px; }
    .faq { margin-top: 48px; }
    .faq-grid { grid-template-columns: 1fr; }
    footer { padding-left: 20px; padding-right: 20px; }
}

@media print {
    body { background: #fff; }
    .site-header, .controls, .method-note, footer { display: none; }
    main { max-width: none; padding: 0; }
    .intro { margin-bottom: 24px; }
    .results { border: 0; box-shadow: none; }
    tr { break-inside: avoid; }
}
