:root {
    --ink: #18241f;
    --muted: #66736d;
    --paper: #f5f3ed;
    --surface: #fffefb;
    --line: #dcded8;
    --green: #174f3c;
    --green-light: #e5efe9;
    --gold: #b88a3b;
    --danger: #a33a36;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top right, #e9eee8 0, transparent 32rem), var(--paper); }
a { color: var(--green); }
.topbar { height: 68px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; background: rgba(255, 254, 251, .94); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 1.08rem; font-weight: 750; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: white; background: var(--green); font-size: .75rem; letter-spacing: .05em; }
.topnav { display: flex; align-items: center; gap: 22px; font-size: .9rem; }
.topnav a { text-decoration: none; font-weight: 650; }
.topnav form { margin: 0; }
.parish-chip { padding: 7px 11px; border-radius: 999px; background: var(--green-light); }
.user-name { color: var(--muted); }
.link-button { border: 0; padding: 0; background: transparent; color: var(--green); font: inherit; font-weight: 650; cursor: pointer; }
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 80px; }
.hero { min-height: 64vh; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); gap: 64px; align-items: center; }
.hero h1, .auth-copy h1, .page-heading h1 { margin: 8px 0 14px; max-width: 760px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.4rem, 6vw, 4.8rem); line-height: .98; letter-spacing: -.045em; font-weight: 500; }
.page-heading h1 { font-size: clamp(2.2rem, 4vw, 3.5rem); }
.lede { max-width: 690px; color: var(--muted); font-size: 1.2rem; line-height: 1.65; }
.eyebrow { margin: 0; color: var(--gold); font-size: .75rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.hero-card { padding: 32px; border: 1px solid #cad6ce; border-radius: 24px; background: var(--green); color: #fff; box-shadow: 0 24px 70px rgba(23, 79, 60, .16); }
.hero-card strong { display: block; margin: 18px 0 10px; font-family: Georgia, serif; font-size: 1.5rem; }
.hero-card p { margin: 0; color: #d8e6de; line-height: 1.6; }
.hero-icon { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid #6f9585; border-radius: 50%; color: #e9c77d; }
.card { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 12px 40px rgba(28, 44, 36, .05); }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 0 19px; border: 1px solid var(--green); border-radius: 10px; background: var(--green); color: white; font: inherit; font-size: .9rem; font-weight: 750; text-decoration: none; cursor: pointer; }
.button:hover { background: #0f3e2e; }
.button.secondary { background: transparent; color: var(--green); }
.button.full { width: 100%; margin-top: 22px; }
.auth-grid { min-height: 65vh; display: grid; grid-template-columns: 1fr 460px; gap: 80px; align-items: center; }
.auth-copy p:last-child { max-width: 580px; color: var(--muted); line-height: 1.7; font-size: 1.05rem; }
.auth-card { padding: 36px; }
label { display: block; margin: 18px 0 7px; font-size: .84rem; font-weight: 750; }
input { width: 100%; min-height: 45px; padding: 10px 12px; border: 1px solid #bec6c0; border-radius: 9px; background: white; color: var(--ink); font: inherit; }
input:focus { border-color: var(--green); outline: 3px solid rgba(23, 79, 60, .12); }
.validation { display: block; margin-top: 6px; color: var(--danger); font-size: .82rem; }
.validation ul { margin: 0; padding-left: 18px; }
.privacy-note { margin: 22px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.page-heading { margin-bottom: 30px; }
.page-heading > p:last-child { color: var(--muted); }
.heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.read-only-badge { padding: 7px 12px; border: 1px solid #b8cec0; border-radius: 999px; color: var(--green); background: var(--green-light); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.parish-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.parish-card { padding: 28px; }
.parish-card h2 { margin: 12px 0 8px; font-family: Georgia, serif; font-size: 1.55rem; font-weight: 500; }
.parish-card p { color: var(--muted); }
.parish-code { color: var(--gold); font-size: .75rem; font-weight: 800; letter-spacing: .1em; }
.search-panel { display: grid; grid-template-columns: 1.5fr repeat(4, minmax(105px, .65fr)); gap: 16px; padding: 24px; align-items: end; }
.search-panel label { margin-top: 0; }
.search-actions { display: flex; gap: 10px; grid-column: 1 / -1; padding-top: 4px; }
.empty-state { padding: 42px; text-align: center; }
.empty-state.compact { margin-top: 24px; }
.empty-state h2 { margin-top: 0; font-family: Georgia, serif; font-weight: 500; }
.empty-state p, .muted { color: var(--muted); }
.result-summary { display: flex; justify-content: space-between; margin: 28px 2px 12px; color: var(--muted); font-size: .85rem; }
.result-summary strong { color: var(--ink); }
.table-wrap { overflow-x: auto; border-radius: 14px; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 16px; background: #edf1ed; color: #54615b; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; text-align: left; }
td { padding: 16px; border-top: 1px solid #e7e8e3; color: #4f5c56; font-size: .88rem; white-space: nowrap; }
td:first-child { color: var(--ink); }
.row-link { font-weight: 750; text-decoration: none; }
.pager { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.back-link { display: inline-block; margin-bottom: 22px; color: var(--muted); text-decoration: none; font-size: .88rem; font-weight: 650; }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-card { padding: 28px; }
.detail-card h2 { margin: 0 0 22px; font-family: Georgia, serif; font-size: 1.4rem; font-weight: 500; }
.detail-card dl { display: grid; grid-template-columns: 140px 1fr; gap: 14px; margin: 0; }
.detail-card dt { color: var(--muted); font-size: .8rem; font-weight: 700; }
.detail-card dd { margin: 0; }
.full-span { grid-column: 1 / -1; }
.sponsor-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.sponsor-list > div { display: grid; grid-template-columns: 28px 1fr; padding: 13px; border-radius: 10px; background: #f2f4f1; }
.sponsor-list span { grid-row: 1 / 3; color: var(--gold); font-weight: 800; }
.sponsor-list small { margin-top: 3px; color: var(--muted); }
.remarks { white-space: pre-line; line-height: 1.65; }

@media (max-width: 850px) {
    .topbar { height: auto; min-height: 64px; padding: 14px 20px; align-items: flex-start; }
    .topnav { flex-wrap: wrap; justify-content: flex-end; gap: 10px 16px; }
    .user-name { display: none; }
    .shell { width: min(100% - 28px, 1180px); padding-top: 34px; }
    .hero, .auth-grid { grid-template-columns: 1fr; gap: 34px; }
    .hero { padding-top: 30px; }
    .search-panel { grid-template-columns: 1fr 1fr; }
    .search-panel .wide { grid-column: 1 / -1; }
    .details-grid { grid-template-columns: 1fr; }
    .full-span { grid-column: auto; }
}

@media (max-width: 560px) {
    .brand { font-size: 0; }
    .brand-mark { font-size: .75rem; }
    .search-panel { grid-template-columns: 1fr; }
    .search-panel .wide { grid-column: auto; }
    .heading-row { align-items: flex-start; flex-direction: column; }
    .detail-card dl { grid-template-columns: 1fr; gap: 5px; }
    .detail-card dd { margin-bottom: 12px; }
}
