:root {
  --ink: #1d2922;
  --forest: #183a2a;
  --forest-2: #29533d;
  --moss: #71806b;
  --paper: #f3efe4;
  --paper-deep: #e7dfce;
  --white: #fffdf7;
  --rust: #9a4e2d;
  --gold: #b4975a;
  --line: #cfc5ae;
  --danger: #8a2e2e;
  --shadow: 0 12px 40px rgb(31 42 34 / 10%);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); line-height: 1.6; }
a { color: var(--forest-2); text-underline-offset: .22em; }
a:hover { color: var(--rust); }
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; }
:focus-visible { outline: 3px solid #d48e26; outline-offset: 4px; }
.skip-link { position: fixed; top: .5rem; left: .5rem; z-index: 100; padding: .75rem 1rem; background: var(--white); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.shell { width: min(1180px, calc(100% - 3rem)); margin-inline: auto; }
.eyebrow { margin: 0 0 .7rem; color: var(--rust); font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.small { font-size: .82rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: .7rem 1.1rem; border: 1px solid var(--forest); background: var(--forest); color: white; font-weight: 700; text-decoration: none; }
.button:hover { background: var(--forest-2); color: white; }
.text-link { font-weight: 700; }

/* Public website */
.public-site { background-image: linear-gradient(rgb(31 42 34 / 2%) 1px, transparent 1px); background-size: 100% 5px; }
.site-header { border-bottom: 1px solid var(--line); background: rgb(243 239 228 / 96%); }
.masthead { min-height: 116px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.wordmark { display: flex; flex-direction: column; color: var(--ink); text-decoration: none; font-family: var(--serif); text-transform: uppercase; line-height: 1; letter-spacing: .1em; }
.wordmark span { font-size: .78rem; }
.wordmark strong { margin-top: .35rem; font-size: 2rem; font-weight: 400; letter-spacing: .2em; }
.masthead nav { display: flex; gap: 1.8rem; }
.masthead nav a { color: var(--ink); font-size: .86rem; font-weight: 650; text-decoration: none; }
.masthead nav a:hover { color: var(--rust); }
.hero { min-height: 650px; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .7fr); align-items: center; gap: 6rem; padding-block: 6rem; }
.hero h1, .page-header h1 { margin: 0; font-family: var(--serif); font-weight: 400; line-height: .9; letter-spacing: -.05em; }
.hero h1 { max-width: 9ch; font-size: clamp(4rem, 10vw, 8.5rem); }
.standfirst { max-width: 720px; font-family: var(--serif); font-size: clamp(1.3rem, 2.4vw, 2rem); line-height: 1.4; }
.hero .standfirst { max-width: 650px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1.4rem; margin-top: 2.3rem; }
.hero-note { position: relative; padding: 7rem 2rem 2rem; border: 1px solid var(--line); background: rgb(255 253 247 / 55%); box-shadow: var(--shadow); }
.hero-note::before, .hero-note::after { content: ""; position: absolute; border: 1px solid var(--line); inset: 10px; pointer-events: none; }
.hero-note::after { inset: 18px; border-color: transparent; border-top-color: var(--gold); }
.ornament { position: absolute; top: 2rem; left: 50%; width: 65px; height: 65px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: var(--forest); font-family: var(--serif); transform: translateX(-50%); }
.paper-band { padding-block: 6rem; background: var(--forest); color: var(--white); }
.paper-band .eyebrow { color: #d7bb82; }
.prose-grid { display: grid; grid-template-columns: minmax(130px, .35fr) minmax(0, 1.35fr); gap: 4rem; }
.prose-grid h2 { margin-top: 0; font-family: var(--serif); font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 400; line-height: 1.1; }
.prose-grid > div > p { max-width: 760px; font-size: 1.08rem; }
.paper-band a { color: white; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; padding-block: 6rem; }
.feature-grid article { padding: 1rem 3rem 2rem; border-left: 1px solid var(--line); }
.feature-grid article:last-child { border-right: 1px solid var(--line); }
.feature-grid h2 { font-family: var(--serif); font-size: 2rem; font-weight: 400; }
.number { color: var(--rust); font-family: var(--serif); font-size: 1.3rem; }
.page-header { padding-block: 7rem 5rem; border-bottom: 1px solid var(--line); }
.page-header h1 { max-width: 950px; font-size: clamp(3.5rem, 8vw, 7rem); }
.page-header + .prose-grid { padding-block: 5rem 7rem; }
.prose { max-width: 800px; }
.prose > p:first-child { margin-top: 0; font-size: 1.2rem; }
.prose h2 { margin-top: 3rem; font-size: 2.2rem; }
.notice { margin: 2.5rem 0; padding: 1.2rem 1.4rem; border-left: 4px solid var(--gold); background: var(--paper-deep); }
.notice p:last-child { margin-bottom: 0; }
.checklist { padding: 0; list-style: none; }
.checklist li { padding: .8rem 0 .8rem 2.2rem; border-bottom: 1px solid var(--line); position: relative; }
.checklist li::before { content: "✓"; position: absolute; left: .3rem; color: var(--forest-2); font-weight: 800; }
.timeline { padding-block: 5rem 7rem; list-style: none; }
.timeline li { display: grid; grid-template-columns: 150px minmax(0, 700px); gap: 3rem; padding: 2rem 0; border-top: 1px solid var(--line); }
.timeline time { color: var(--rust); font-family: var(--serif); font-size: 2rem; }
.timeline h2 { margin: 0; font-family: var(--serif); font-size: 2rem; font-weight: 400; }
.site-footer { padding-block: 4rem; border-top: 1px solid var(--line); background: var(--paper-deep); }
.footer-grid { display: grid; grid-template-columns: 1.2fr .6fr .7fr; gap: 4rem; }

/* Administration */
.admin-site { background: #eceeea; color: #18241c; }
.admin-header { min-height: 78px; display: flex; align-items: center; gap: 2rem; padding: .8rem 2rem; background: var(--forest); color: white; }
.admin-brand { display: flex; flex-direction: column; min-width: 210px; color: white; line-height: 1.15; text-decoration: none; }
.admin-brand span { font-family: var(--serif); }
.admin-brand strong { margin-top: .15rem; color: #d8c38f; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; }
.admin-header nav { display: flex; flex: 1; gap: 1.2rem; }
.admin-header nav a { color: #edf2ed; font-size: .85rem; font-weight: 600; text-decoration: none; }
.quiet-button { border: 1px solid rgb(255 255 255 / 35%); background: transparent; color: white; padding: .45rem .8rem; }
.admin-main { width: min(1380px, calc(100% - 3rem)); margin: 0 auto; padding-block: 2.5rem 5rem; }
.admin-page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.admin-page-heading h1 { margin: 0; font-family: var(--serif); font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 400; line-height: 1; }
.admin-page-heading p:last-child { margin-bottom: 0; color: #536158; }
.heading-actions { display: flex; align-items: center; gap: 1rem; }
.metric-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .8rem; margin-bottom: 1.5rem; }
.metric-grid article { min-height: 130px; padding: 1.1rem; border: 1px solid #d3d8d2; background: white; }
.metric-grid span { font-family: var(--serif); font-size: 2.8rem; line-height: 1; }
.metric-grid p { margin: .8rem 0 0; color: #556159; font-size: .82rem; }
.metric-grid .attention { border-color: #b8634f; background: #fff8f5; }
.panel { margin-bottom: 1.5rem; padding: 1.4rem; border: 1px solid #d3d8d2; background: white; box-shadow: 0 4px 15px rgb(30 43 34 / 4%); }
.panel h2 { margin: 0 0 1rem; font-family: var(--serif); font-size: 1.8rem; font-weight: 400; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin-bottom: 1rem; }
.panel-heading .eyebrow { margin-bottom: .2rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .85rem .7rem; border-bottom: 1px solid #e3e6e2; text-align: left; vertical-align: top; }
th { color: #5b685f; font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; }
td small { display: block; color: #66736a; }
.status { display: inline-block; padding: .28rem .55rem; border: 1px solid #bac5bd; border-radius: 99px; background: #edf3ee; color: #294434; font-size: .72rem; font-style: normal; font-weight: 700; white-space: nowrap; }
.status-awaiting_family, .status-awaiting_payment, .status-supplied_copy { border-color: #d3b56d; background: #fff8dd; color: #614c13; }
.status-declined, .status-closed { background: #eee; color: #555; }
.sample-badge { display: inline-block; margin-left: .5rem; padding: .28rem .55rem; background: #fff0d0; color: #674611; font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.filter-bar { display: flex; align-items: end; gap: 1rem; margin-bottom: 1rem; padding: 1rem; border: 1px solid #d3d8d2; background: #f7f8f6; }
.filter-bar label { flex: 1; color: #526057; font-size: .78rem; font-weight: 700; }
.filter-bar input, .filter-bar select { width: 100%; margin-top: .25rem; }
input, select, textarea { min-height: 42px; padding: .55rem .65rem; border: 1px solid #aab5ad; border-radius: 0; background: white; color: var(--ink); }
textarea { min-height: 100px; resize: vertical; }
input[type="checkbox"] { width: 20px; min-height: 20px; }
.filter-bar button, .stacked-form button, .model-form button { min-height: 42px; padding: .55rem 1rem; border: 1px solid var(--forest); background: var(--forest); color: white; font-weight: 700; }
.model-form { padding: 2rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem 1.5rem; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field label, .stacked-form label { font-size: .79rem; font-weight: 750; }
.field small { color: #647168; }
.field .errorlist { margin: .2rem 0; color: var(--danger); }
.checkbox-field { flex-direction: row; align-items: center; }
.checkbox-field input { order: -1; }
.form-actions { display: flex; align-items: center; gap: 1rem; margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid #dfe4df; }
.stacked-form > div { display: flex; flex-direction: column; gap: .25rem; margin-bottom: 1rem; }
.compact { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid #dfe4df; }
.login-panel { width: min(480px, 100%); margin: 5rem auto; padding: 2.5rem; border: 1px solid #ccd3cd; background: white; box-shadow: var(--shadow); }
.login-panel h1 { margin-top: 0; font-family: var(--serif); font-size: 2.7rem; font-weight: 400; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(310px, .65fr); gap: 1.5rem; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; padding-top: 1rem; border-top: 1px solid #e2e5e2; }
.facts dt { color: #69736c; font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.facts dd { margin: .2rem 0 0; }
.sensitive { border-left: 4px solid #93613a; background: #fffdf8; }
.sensitive h3 { margin: 1.2rem 0 .3rem; font-size: .8rem; text-transform: uppercase; }
.quote-row { display: grid; grid-template-columns: 1fr auto; gap: .1rem 1rem; padding: .8rem 0; border-top: 1px solid #e3e6e2; }
.quote-row small, .quote-row em { grid-column: 1 / -1; color: #667269; }
.quote-row em { color: #815a15; font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.audit-list { padding: 0; list-style: none; }
.audit-list li { display: grid; grid-template-columns: 145px 1fr; gap: 1rem; padding: .65rem 0; border-top: 1px solid #e3e6e2; }
.audit-list time { color: #69736c; font-size: .78rem; }
.audit-list small { display: block; color: #69736c; }
.messages { width: min(1380px, calc(100% - 3rem)); margin: 1rem auto 0; }
.message { padding: .75rem 1rem; border-left: 4px solid var(--forest); background: white; }
.message.error, .form-errors { border-left-color: var(--danger); color: var(--danger); }
.warning { border-left-color: #b17b1f; }

@media (max-width: 980px) {
  .masthead { align-items: flex-start; flex-direction: column; padding-block: 1.3rem; }
  .masthead nav { flex-wrap: wrap; gap: .8rem 1.3rem; }
  .hero { grid-template-columns: 1fr; gap: 3rem; }
  .hero-note { max-width: 520px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid article, .feature-grid article:last-child { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .admin-header { align-items: flex-start; flex-wrap: wrap; }
  .admin-header nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  .shell, .admin-main, .messages { width: min(100% - 1.5rem, 1180px); }
  .hero { min-height: auto; padding-block: 4rem; }
  .hero h1 { font-size: 4rem; }
  .prose-grid, .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .feature-grid { padding-block: 3rem; }
  .page-header { padding-block: 4rem 3rem; }
  .page-header h1 { font-size: 3.2rem; }
  .page-header + .prose-grid { padding-block: 3rem 4rem; }
  .timeline li { grid-template-columns: 1fr; gap: .4rem; }
  .admin-header { padding: .8rem; }
  .admin-page-heading { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid, .facts { grid-template-columns: 1fr; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .model-form { padding: 1rem; }
  .audit-list li { grid-template-columns: 1fr; gap: .2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .site-header, .site-footer, .admin-header, .filter-bar, .button, .quiet-button { display: none !important; }
  body { background: white; color: black; }
  .panel { box-shadow: none; }
}

