:root {
  --paper: #f3efe3;
  --paper-light: #fbf8ef;
  --paper-dark: #dfd6c3;
  --ink: #17211f;
  --muted: #66706b;
  --green: #17362f;
  --green-2: #254a3e;
  --navy: #142b3d;
  --red: #8d2e2b;
  --red-dark: #6f211f;
  --brass: #aa7b35;
  --brass-light: #d6b36b;
  --line: #c8bfab;
  --white: #fffdf7;
  --shadow: 0 14px 32px rgba(35, 31, 24, .12);
  --sans: "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Batang", "바탕", serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --disclaimer-h: 34px;
  --header-h: 154px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--disclaimer-h) + 130px); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.drawer-open,
body.dialog-open { overflow: hidden; }

button,
input,
select,
textarea { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

button { color: inherit; }

a { color: inherit; text-decoration: none; }

img,
video { display: block; max-width: 100%; }

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

h1,
h2,
h3 { text-wrap: balance; }

[hidden] { display: none !important; }

.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 500;
  left: 16px;
  top: 8px;
  padding: 10px 16px;
  background: var(--white);
  color: var(--green);
  border: 2px solid var(--brass);
  transform: translateY(-140%);
}

.skip-link:focus { transform: translateY(0); }

:focus-visible { outline: 3px solid #d6a849; outline-offset: 3px; }

.site-disclaimer {
  position: fixed;
  z-index: 200;
  inset: 0 0 auto;
  min-height: var(--disclaimer-h);
  padding: 6px 20px;
  background: #efe5cc;
  border-bottom: 1px solid #b59b65;
  color: #3d3527;
  font-size: 12px;
  line-height: 21px;
  text-align: center;
  letter-spacing: .02em;
}

.site-disclaimer strong { color: var(--red-dark); }
.disclaimer-divider { display: inline-block; height: 11px; margin: 0 10px; border-left: 1px solid #9d8a61; vertical-align: -1px; }

.site-header {
  position: sticky;
  z-index: 100;
  top: var(--disclaimer-h);
  background: var(--paper-light);
  box-shadow: 0 3px 0 rgba(23, 54, 47, .12);
}

.utility-bar {
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #5c625d;
  font-size: 11px;
  letter-spacing: .035em;
}

.utility-bar p { margin: 0; }
.utility-actions { display: flex; align-items: center; gap: 14px; }
.archive-status { display: flex; align-items: center; gap: 6px; color: var(--green); font-weight: 700; }
.archive-status i { width: 6px; height: 6px; border-radius: 50%; background: #3f7658; box-shadow: 0 0 0 3px #d8e2d7; }
.text-link,
.text-button { color: var(--green); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.text-button { padding: 0; border: 0; background: none; cursor: pointer; }

.masthead { height: 86px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 14px; }
.brand-mark {
  position: relative;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid var(--red);
  color: var(--red);
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1;
}
.brand-mark::before,
.brand-mark::after { content: ""; position: absolute; inset: 4px; border: 1px solid var(--red); opacity: .65; }
.brand-mark::after { inset: 8px; border-style: dotted; }
.brand-mark b { position: relative; z-index: 1; }
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy small { margin-bottom: 5px; color: var(--brass); font-family: var(--serif); font-size: 10px; letter-spacing: .24em; }
.brand-copy strong { color: var(--green); font-family: var(--serif); font-size: 23px; letter-spacing: -.06em; }
.brand-copy > span { margin-top: 6px; color: #777469; font-family: var(--mono); font-size: 8px; letter-spacing: .16em; text-transform: uppercase; }

.primary-nav { background: var(--green); border-top: 3px solid var(--brass); color: #f9f5e9; }
.nav-inner { height: 43px; display: flex; align-items: stretch; }
.nav-inner a { min-width: 138px; display: grid; place-items: center; padding: 0 21px; border-left: 1px solid rgba(255, 255, 255, .12); font-family: var(--serif); font-size: 15px; font-weight: 700; letter-spacing: -.03em; transition: background-color .18s ease; }
.nav-inner a:last-child { border-right: 1px solid rgba(255, 255, 255, .12); }
.nav-inner a:hover,
.nav-inner a.active { background: var(--red-dark); }
.admin-nav-link { margin-left: auto; background: #af7931; color: #fff; }
.nav-toggle { display: none; }

main { min-height: 70vh; }

.hero { position: relative; overflow: hidden; background: var(--navy); color: var(--white); border-bottom: 8px solid #dbc18c; }
.hero::before { content: ""; position: absolute; inset: 24px 0 auto; border-top: 1px solid rgba(214, 179, 107, .23); }
.hero::after { content: "記錄"; position: absolute; right: max(3vw, calc((100vw - 1370px) / 2)); bottom: -55px; color: rgba(244, 236, 216, .035); font-family: var(--serif); font-size: clamp(180px, 24vw, 340px); font-weight: 700; line-height: 1; letter-spacing: -.18em; pointer-events: none; }
.hero-grid { position: relative; z-index: 1; min-height: 480px; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, .75fr); gap: clamp(50px, 7vw, 96px); align-items: center; padding-block: 64px 69px; }
.hero-copy { padding-top: 6px; }
.eyebrow { margin-bottom: 18px; color: #d9c395; font-size: 11px; font-weight: 700; letter-spacing: .2em; }
.eyebrow span { margin-right: 12px; padding: 4px 8px; border: 1px solid #b9904c; color: #f0dfb9; font-family: var(--mono); font-size: 9px; letter-spacing: .17em; }
.hero h1 { margin-bottom: 18px; font-family: var(--serif); font-size: clamp(36px, 4.25vw, 60px); font-weight: 700; line-height: 1.22; letter-spacing: -.065em; }
.hero-lead { max-width: 670px; margin-bottom: 30px; color: #d5d9d5; font-size: 15px; line-height: 1.85; }

.hero-search { min-height: 66px; display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: stretch; max-width: 730px; background: var(--paper-light); box-shadow: 9px 9px 0 rgba(0, 0, 0, .16); }
.search-index { display: grid; place-items: center; border-right: 1px solid var(--line); color: var(--red); font-family: var(--serif); font-weight: 700; }
.hero-search input { min-width: 0; padding: 0 22px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 15px; }
.hero-search input::placeholder { color: #888980; }
.hero-search:focus-within { outline: 3px solid #d6a849; outline-offset: 3px; }
.hero-search input:focus { outline: 0; }
.hero-search button { margin: 7px; padding: 0 23px; border: 0; background: var(--red); color: #fff; font-weight: 700; cursor: pointer; transition: background-color .18s ease; }
.hero-search button:hover { background: var(--red-dark); }
.quick-terms { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; color: #aebbb5; font-size: 11px; }
.quick-terms > span { margin-right: 3px; color: #d3bd8f; font-weight: 700; }
.quick-terms button { padding: 4px 10px; border: 1px solid rgba(255,255,255,.18); background: transparent; color: #d6ded9; font-size: 11px; cursor: pointer; }
.quick-terms button:hover { border-color: var(--brass-light); color: #fff; }

.hero-dossier { position: relative; min-height: 318px; padding: 38px 30px 25px; border: 1px solid #a99a79; background: #e7deca; color: var(--ink); box-shadow: 13px 13px 0 rgba(0, 0, 0, .2); transform: rotate(.7deg); }
.hero-dossier::before { content: ""; position: absolute; inset: 8px; border: 1px solid #c2b596; pointer-events: none; }
.dossier-tab { position: absolute; top: -25px; left: -1px; min-width: 138px; height: 26px; padding: 4px 17px; background: #c59f59; color: #42351f; font-family: var(--serif); font-size: 12px; font-weight: 700; }
.dossier-heading { position: relative; display: flex; align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 2px solid #897b60; }
.mini-seal { width: 42px; height: 42px; display: grid; place-items: center; border: 2px solid var(--red); border-radius: 50%; color: var(--red); font-family: var(--serif); font-size: 11px; font-weight: 700; }
.dossier-heading div { display: grid; }
.dossier-heading small { font-family: var(--mono); font-size: 8px; letter-spacing: .16em; }
.dossier-heading strong { font-family: var(--serif); font-size: 19px; }
.hero-stats { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); margin: 20px 0 16px; }
.hero-stats div { padding: 0 11px; border-left: 1px solid #b5a98e; text-align: center; }
.hero-stats div:first-child { border-left: 0; }
.hero-stats dt { color: #6a665b; font-size: 10px; }
.hero-stats dd { margin: 4px 0 0; color: var(--green); font-family: var(--serif); font-size: 25px; font-weight: 700; }
.dossier-note { position: relative; margin: 0; padding: 12px 11px; border-top: 1px dashed #9d9177; color: #69655b; font-size: 10px; line-height: 1.65; }
.register-code { position: relative; display: block; margin-top: 12px; color: #827967; font-family: var(--mono); font-size: 7px; letter-spacing: .17em; text-align: right; }

.access-strip { background: #ece5d6; border-bottom: 1px solid var(--line); }
.access-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.access-grid > div { min-height: 88px; display: flex; align-items: center; gap: 13px; padding: 13px 24px; border-left: 1px solid var(--line); }
.access-grid > div:last-child { border-right: 1px solid var(--line); }
.access-icon { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #809087; color: var(--green); font-family: var(--serif); font-size: 14px; }
.access-grid p { display: grid; margin: 0; line-height: 1.3; }
.access-grid strong { font-family: var(--serif); font-size: 14px; }
.access-grid small { margin-top: 5px; color: #777a72; font-size: 10px; }

.section { padding: 86px 0; }
.section-heading { margin-bottom: 34px; }
.split-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.section-kicker { margin: 0 0 7px; color: var(--brass); font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .18em; }
.section-heading h2,
.guide-copy h2 { margin: 0 0 8px; color: var(--green); font-family: var(--serif); font-size: clamp(28px, 3vw, 39px); letter-spacing: -.055em; }
.section-heading p:not(.section-kicker) { margin: 0; color: var(--muted); font-size: 13px; }
.heading-number { color: #d7cebb; font-family: var(--serif); font-size: 50px; line-height: 1; }

.search-catalog { background: var(--paper-light); }
.catalog-search { display: grid; grid-template-columns: minmax(250px, 2fr) repeat(3, minmax(130px, .75fr)) auto auto; align-items: end; gap: 10px; padding: 18px; border: 1px solid var(--line); border-top: 4px solid var(--green); background: #e9e2d3; }
.catalog-search label,
.record-form label { display: grid; gap: 6px; color: #4e554f; font-size: 11px; font-weight: 700; }
.catalog-search input,
.catalog-search select,
.record-form input,
.record-form select,
.record-form textarea,
.admin-search input,
.grant-form input { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #bfb5a2; border-radius: 0; background: var(--white); color: var(--ink); }
.record-form textarea { resize: vertical; }
.catalog-search input:focus,
.catalog-search select:focus,
.record-form input:focus,
.record-form select:focus,
.record-form textarea:focus,
.admin-search input:focus,
.grant-form input:focus { outline: 2px solid var(--brass); outline-offset: 1px; border-color: var(--brass); }

.primary-button,
.outline-button,
.quiet-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 18px; border-radius: 0; font-size: 12px; font-weight: 700; cursor: pointer; transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease; }
.primary-button { border: 1px solid var(--green); background: var(--green); color: #fff; }
.primary-button:hover { background: var(--red-dark); border-color: var(--red-dark); }
.outline-button { border: 1px solid var(--green); background: transparent; color: var(--green); }
.outline-button:hover { background: var(--green); color: #fff; }
.quiet-button { border: 1px solid #aaa18e; background: #f5f0e4; color: #5d5a52; }
.quiet-button:hover { border-color: var(--green); color: var(--green); }
.primary-button:disabled,
.outline-button:disabled,
.quiet-button:disabled { opacity: .55; cursor: not-allowed; }
.catalog-submit,
.catalog-reset { min-width: 76px; }

.results-toolbar { min-height: 61px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.results-toolbar p { margin: 0; color: #606762; font-size: 12px; }
.results-toolbar p strong { color: var(--red); font-family: var(--mono); font-size: 14px; }
.results-toolbar label { display: flex; align-items: center; gap: 8px; color: #72756f; font-size: 11px; }
.results-toolbar select { padding: 5px 8px; border: 1px solid var(--line); background: var(--white); font-size: 11px; }

.record-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 19px; padding-top: 28px; }
.record-card { position: relative; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--paper-light); box-shadow: 0 6px 0 #ded5c1; transition: transform .18s ease, box-shadow .18s ease; }
.record-card:hover { transform: translateY(-3px); box-shadow: 0 9px 0 #d8cdb7; }
.record-card button.card-open { all: unset; display: flex; flex: 1; flex-direction: column; cursor: pointer; }
.record-card button.card-open:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; }
.card-preview { position: relative; height: 152px; display: grid; place-items: center; overflow: hidden; background: #d8d1c1; border-bottom: 1px solid var(--line); color: #34473f; }
.card-preview img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.7) contrast(.95); transition: transform .25s ease, filter .25s ease; }
.record-card:hover .card-preview img { transform: scale(1.025); filter: saturate(.9) contrast(1); }
.preview-document { background: #d8d1c1; }
.preview-photo { background: #d5ddda; }
.preview-video,
.preview-youtube { background: #243b48; color: #fff; }
.preview-audio { background: #d8cbb6; }
.type-glyph { width: 64px; height: 76px; display: grid; place-items: center; border: 1px solid currentColor; font-family: var(--serif); font-size: 21px; }
.preview-video .type-glyph,
.preview-youtube .type-glyph { width: 66px; height: 48px; border-radius: 2px; }
.preview-audio .type-glyph { border-radius: 50%; height: 64px; }
.card-type { position: absolute; left: 10px; top: 10px; padding: 3px 8px; background: rgba(20, 43, 61, .9); color: #fff; font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.card-lock { position: absolute; right: 10px; top: 10px; padding: 3px 7px; background: var(--red); color: #fff; font-size: 9px; }
.card-copy { min-height: 160px; padding: 17px 17px 14px; }
.record-accession { margin: 0 0 8px; color: var(--red); font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: .08em; overflow-wrap: anywhere; }
.card-copy h3 { margin: 0 0 9px; color: var(--green); font-family: var(--serif); font-size: 17px; line-height: 1.45; letter-spacing: -.035em; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-copy p { margin: 0; color: #6a706b; font-size: 11px; line-height: 1.65; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding: 10px 17px; border-top: 1px dashed var(--line); color: #6e726d; font-size: 10px; }
.access-chip { color: var(--green); font-weight: 700; }
.access-chip.restricted { color: var(--red); }

.record-skeleton { height: 350px; border: 1px solid #d3cbb9; background: #e7e0d1; animation: paper-pulse 1.2s ease-in-out infinite alternate; }
@keyframes paper-pulse { to { opacity: .55; } }
.empty-panel { grid-column: 1 / -1; padding: 48px 24px; border: 1px dashed #b6ad9a; color: #77766e; text-align: center; }
.empty-panel.compact { padding: 30px 20px; }
.empty-panel.dark { border-color: rgba(255,255,255,.25); color: #c5cfca; }
.empty-panel button { margin-top: 12px; }

.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; padding-top: 30px; }
.pagination button { min-width: 37px; min-height: 37px; padding: 5px 10px; border: 1px solid var(--line); background: var(--white); color: #555b57; font-family: var(--mono); font-size: 11px; cursor: pointer; }
.pagination button:hover,
.pagination button[aria-current="page"] { border-color: var(--green); background: var(--green); color: #fff; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

.collections-section { background: #e7e0d1; border-block: 1px solid var(--line); }
.folder-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 29px 21px; padding-top: 14px; }
.folder-card { position: relative; min-height: 170px; display: grid; grid-template-columns: 1fr auto; gap: 18px; padding: 30px 24px 22px; border: 1px solid #bcae91; border-top: 7px solid #b6904c; background: #f2e9d5; box-shadow: 7px 7px 0 #d4c8ae; text-align: left; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.folder-card::before { content: attr(data-tab); position: absolute; left: -1px; top: -31px; min-width: 110px; height: 25px; padding: 4px 14px; border: 1px solid #bcae91; border-bottom: 0; background: #c7a460; color: #56431f; font-family: var(--mono); font-size: 8px; letter-spacing: .06em; }
.folder-card:hover { transform: translateY(-3px); box-shadow: 10px 10px 0 #cdc0a5; }
.folder-card h3 { margin: 0 0 9px; color: var(--green); font-family: var(--serif); font-size: 20px; }
.folder-card p { margin: 0; color: #69675e; font-size: 11px; line-height: 1.65; }
.folder-card strong { align-self: center; color: var(--red); font-family: var(--serif); font-size: 29px; }
.folder-card strong small { display: block; color: #777066; font-family: var(--sans); font-size: 9px; font-weight: 400; text-align: center; }

.section-ink { position: relative; background: var(--green); color: #f5f1e6; }
.section-ink::before { content: ""; position: absolute; inset: 13px 0 auto; border-top: 1px solid rgba(214, 179, 107, .28); }
.section-heading-light { border-color: rgba(255,255,255,.22); }
.section-heading-light h2 { color: #fff; }
.section-heading-light p:not(.section-kicker) { color: #bac7c0; }
.section-heading-light .heading-number { color: rgba(255,255,255,.12); }
.recent-list { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid rgba(255,255,255,.18); }
.recent-item { min-height: 112px; display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 18px 22px 18px 0; border-bottom: 1px solid rgba(255,255,255,.18); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.recent-item:nth-child(odd) { border-right: 1px solid rgba(255,255,255,.18); padding-right: 28px; }
.recent-item:nth-child(even) { padding-left: 28px; }
.recent-item:hover h3 { color: var(--brass-light); }
.recent-date { height: 64px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.26); color: #d7c08f; font-family: var(--serif); font-size: 18px; }
.recent-copy { min-width: 0; }
.recent-copy .record-accession { color: #c6a866; }
.recent-copy h3 { margin: 0 0 5px; color: #fff; font-family: var(--serif); font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .18s ease; }
.recent-copy p { margin: 0; color: #aebdb5; font-size: 10px; }
.recent-arrow { color: #bca870; font-size: 20px; }

.timeline-section { background: var(--paper); }
.timeline-track { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; padding: 28px 0 0; }
.timeline-track::before { content: ""; position: absolute; top: 50px; left: 4%; right: 4%; border-top: 2px solid #9f8b61; }
.timeline-node { position: relative; z-index: 1; display: grid; justify-items: center; padding: 0 14px; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: center; }
.timeline-dot { width: 17px; height: 17px; margin: 15px 0 17px; border: 4px solid var(--paper); border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px #9f8b61; }
.timeline-node strong { color: var(--green); font-family: var(--serif); font-size: 25px; }
.timeline-node small { color: #75766f; font-size: 10px; }
.timeline-node b { margin-top: 8px; padding: 2px 8px; background: #ded4bf; color: #665a43; font-size: 9px; font-weight: 700; }
.timeline-node:hover .timeline-dot { background: var(--brass); transform: scale(1.15); }

.guide-section { background: #ddd3bf; border-top: 1px solid #c1b59e; }
.guide-grid { display: grid; grid-template-columns: .85fr 1.25fr; gap: clamp(50px, 8vw, 110px); align-items: center; }
.guide-copy > p:not(.section-kicker) { margin-bottom: 24px; color: #62655f; font-size: 13px; }
.guide-steps { margin: 0; padding: 0; list-style: none; border-top: 1px solid #aea38e; }
.guide-steps li { display: grid; grid-template-columns: 48px 1fr; gap: 18px; padding: 20px 12px; border-bottom: 1px solid #aea38e; }
.guide-steps li > span { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--red); color: var(--red); font-family: var(--serif); font-weight: 700; }
.guide-steps strong { color: var(--green); font-family: var(--serif); }
.guide-steps p { margin: 4px 0 0; color: #696b65; font-size: 11px; }

.site-footer { padding: 38px 0 48px; border-top: 5px solid var(--brass); background: #0f2923; color: #afbbb4; }
.footer-grid { display: grid; grid-template-columns: 1.1fr 1.5fr .8fr; gap: 50px; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 13px; }
.brand-mark.small { width: 42px; height: 42px; border-color: #b85a52; color: #cb756b; font-size: 20px; }
.brand-mark.small::before,
.brand-mark.small::after { border-color: #b85a52; }
.footer-brand strong { color: #f2eee3; font-family: var(--serif); font-size: 16px; }
.footer-brand p,
.footer-grid > div > p { margin: 3px 0 0; font-size: 10px; }
.footer-grid > div > p strong { color: #d5c59c; }
.footer-code { color: #81918a; font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-align: right; }
.footer-code span { font-size: 7px; }

/* Record viewer */
.record-dialog { width: min(1040px, calc(100vw - 40px)); max-height: calc(100vh - 38px); padding: 0; border: 0; background: transparent; color: var(--ink); overflow: hidden; }
.record-dialog::backdrop { background: rgba(9, 19, 17, .82); }
.dialog-frame { max-height: calc(100vh - 38px); overflow-y: auto; background: var(--paper-light); box-shadow: 0 20px 80px rgba(0,0,0,.4); }
.dialog-topbar { min-height: 43px; display: flex; align-items: center; justify-content: space-between; padding-left: 20px; border-bottom: 3px solid var(--brass); background: var(--green); color: #eee7d6; font-family: var(--mono); font-size: 9px; letter-spacing: .13em; }
.dialog-close { width: 44px; height: 43px; border: 0; border-left: 1px solid rgba(255,255,255,.18); background: transparent; color: inherit; font-family: var(--sans); font-size: 27px; line-height: 1; cursor: pointer; }
.dialog-close:hover { background: var(--red-dark); color: #fff; }
.dialog-loading { padding: 80px 30px; color: #6b706b; text-align: center; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 28px 31px 22px; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { margin: 0; color: var(--green); font-family: var(--serif); font-size: clamp(24px, 4vw, 35px); line-height: 1.3; }
.dialog-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.badge { display: inline-flex; align-items: center; min-height: 27px; padding: 4px 9px; border: 1px solid #8e9c95; color: var(--green); font-size: 9px; font-weight: 700; white-space: nowrap; }
.badge.restricted { border-color: #bd716a; color: var(--red); }
.viewer-wrap { min-height: 260px; display: grid; place-items: center; background: #182721; color: #dce3de; }
.viewer-wrap img { max-width: 100%; max-height: 72vh; object-fit: contain; }
.viewer-wrap video { width: 100%; max-height: 72vh; background: #0b100e; }
.viewer-wrap audio { width: min(600px, calc(100% - 40px)); }
.viewer-wrap iframe { width: 100%; height: min(62vw, 585px); border: 0; background: #fff; }
.viewer-placeholder { max-width: 530px; padding: 55px 28px; text-align: center; }
.viewer-placeholder .type-glyph { margin: 0 auto 17px; color: #b9c6bf; }
.viewer-placeholder h3 { margin-bottom: 8px; color: #fff; font-family: var(--serif); }
.viewer-placeholder p { margin: 0; color: #aab8b0; font-size: 12px; }
.viewer-placeholder a { margin-top: 18px; border-color: #d4c28f; color: #fff; }
.dialog-body { display: grid; grid-template-columns: 1.5fr .8fr; gap: 34px; padding: 31px; }
.dialog-body h3 { margin-bottom: 13px; padding-bottom: 10px; border-bottom: 2px solid var(--green); color: var(--green); font-family: var(--serif); font-size: 17px; }
.record-description p { color: #565e59; font-size: 13px; white-space: pre-wrap; }
.metadata-panel dl { margin: 0; border-top: 1px solid var(--line); }
.metadata-panel dl > div { display: grid; grid-template-columns: 90px 1fr; border-bottom: 1px solid var(--line); font-size: 11px; }
.metadata-panel dt { padding: 9px; background: #e7e0d1; color: #60655f; font-weight: 700; }
.metadata-panel dd { margin: 0; padding: 9px; overflow-wrap: anywhere; }
.dialog-actions { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 15px 31px; border-top: 1px solid var(--line); background: #e9e2d3; }
.dialog-actions p { margin: 0; color: #646a65; font-size: 10px; }

/* Admin */
#admin-app { background: #e5dfd2; }
.admin-gate { min-height: 650px; display: grid; place-items: center; padding: 70px 20px; background: var(--navy); }
.gate-card { width: min(480px, 100%); padding: 48px; border: 1px solid #a7946d; background: var(--paper-light); box-shadow: 14px 14px 0 rgba(0,0,0,.22); text-align: center; }
.gate-mark { width: 70px; height: 70px; display: grid; place-items: center; margin: 0 auto 23px; border: 2px solid var(--red); border-radius: 50%; color: var(--red); font-family: var(--serif); font-weight: 700; }
.gate-card h1 { color: var(--green); font-family: var(--serif); font-size: 34px; }
.gate-card > p:not(.section-kicker) { margin-bottom: 24px; color: #686c66; font-size: 13px; }
.gate-card .primary-button { display: flex; margin-bottom: 18px; }

.admin-shell { min-height: 700px; padding-bottom: 90px; }
.admin-heading { min-height: 210px; display: flex; align-items: center; justify-content: space-between; gap: 40px; color: #fff; }
.admin-heading::before { content: ""; position: absolute; z-index: -1; left: 0; right: 0; height: 210px; background: var(--navy); border-bottom: 5px solid var(--brass); }
.admin-heading h1 { margin: 0 0 6px; font-family: var(--serif); font-size: 41px; letter-spacing: -.055em; }
.admin-heading p:not(.eyebrow) { margin: 0; color: #b9c4c0; font-size: 12px; }
.admin-heading .primary-button { border-color: #d0b477; background: #d0b477; color: #26352f; }
.admin-heading .primary-button:hover { border-color: #fff; background: #fff; }
.admin-content { display: grid; gap: 28px; margin-top: 34px; }
.admin-content > section { padding: 25px; border: 1px solid #c6bcaa; background: var(--paper-light); box-shadow: 5px 5px 0 #d3c9b7; }
.admin-section-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding-bottom: 13px; border-bottom: 2px solid var(--green); }
.admin-section-title > div:first-child { display: flex; align-items: baseline; gap: 12px; }
.admin-section-title span { color: var(--red); font-family: var(--mono); font-size: 9px; font-weight: 700; }
.admin-section-title h2 { margin: 0; color: var(--green); font-family: var(--serif); font-size: 20px; }
.icon-button { width: 35px; height: 35px; border: 1px solid var(--line); background: #eee7d9; color: var(--green); font-size: 18px; cursor: pointer; }
.overview-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.overview-grid article { min-height: 115px; display: grid; align-content: center; padding: 19px 22px; border-right: 1px solid var(--line); }
.overview-grid article:last-child { border-right: 0; }
.overview-grid small { color: #69706a; font-size: 10px; }
.overview-grid strong { color: var(--green); font-family: var(--serif); font-size: 31px; line-height: 1.35; }
.overview-grid span { color: #88877f; font-size: 9px; }
.table-title { align-items: flex-end; }
.admin-search { display: flex; }
.admin-search input { width: min(280px, 38vw); min-height: 38px; font-size: 11px; }
.admin-search button { min-width: 58px; border: 0; background: var(--green); color: #fff; font-size: 11px; font-weight: 700; cursor: pointer; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { padding: 11px 13px; background: #ded6c6; color: #515951; font-size: 10px; text-align: left; white-space: nowrap; }
td { padding: 12px 13px; border-top: 1px solid #d5ccbb; color: #5b625d; vertical-align: middle; }
tbody tr:hover { background: #f1ebdf; }
.table-record { min-width: 270px; }
.table-record small { display: block; margin-bottom: 2px; color: var(--red); font-family: var(--mono); font-size: 8px; }
.table-record strong { color: var(--green); font-family: var(--serif); font-size: 13px; }
.table-badge { display: inline-block; padding: 3px 7px; border: 1px solid #9ba49f; font-size: 9px; white-space: nowrap; }
.table-badge.restricted,
.table-badge.admin { border-color: #bd716a; color: var(--red); }
.edit-button { min-height: 32px; padding: 4px 11px; border: 1px solid var(--green); background: transparent; color: var(--green); font-size: 10px; font-weight: 700; cursor: pointer; }
.edit-button:hover { background: var(--green); color: #fff; }
.table-empty { padding: 28px !important; color: #767872; text-align: center; }
.audit-list { display: grid; }
.audit-item { display: grid; grid-template-columns: 145px minmax(160px, .55fr) 1fr; gap: 20px; padding: 12px 8px; border-bottom: 1px solid #ddd5c5; color: #5d645f; font-size: 10px; }
.audit-item time { color: #7b7b73; font-family: var(--mono); font-size: 9px; }
.audit-item strong { color: var(--green); }

/* Editor drawer */
.drawer-backdrop { position: fixed; z-index: 250; inset: 0; background: rgba(12, 24, 21, .67); }
.record-drawer { position: fixed; z-index: 260; top: 0; right: 0; bottom: 0; width: min(670px, 100vw); display: flex; flex-direction: column; background: var(--paper-light); box-shadow: -18px 0 60px rgba(0,0,0,.3); transform: translateX(105%); transition: transform .25s ease; }
.record-drawer.open { transform: translateX(0); }
.drawer-header { min-height: 79px; display: flex; align-items: center; justify-content: space-between; padding-left: 26px; border-bottom: 4px solid var(--brass); background: var(--green); color: #fff; }
.drawer-header p { margin: 0; color: #cdb984; font-family: var(--mono); font-size: 8px; letter-spacing: .14em; }
.drawer-header h2 { margin: 2px 0 0; font-family: var(--serif); font-size: 23px; }
.drawer-header .dialog-close { height: 75px; width: 58px; }
.record-form { flex: 1; overflow-y: auto; padding: 25px 27px 92px; }
.record-form fieldset { margin: 0 0 28px; padding: 0; border: 0; }
.record-form legend { width: 100%; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid #bfb5a3; color: var(--green); font-family: var(--serif); font-size: 15px; font-weight: 700; }
.record-form legend span { margin-right: 9px; color: var(--red); font-family: var(--mono); font-size: 9px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.record-form label em { color: var(--red); font-size: 9px; font-style: normal; }
.checkbox-label { display: flex !important; grid-column: 1 / -1; grid-template-columns: auto 1fr; align-items: center; justify-content: start; }
.checkbox-label input { width: 18px; min-height: 18px; accent-color: var(--green); }
.policy-warning { margin-top: 15px; padding: 13px 15px; border-left: 4px solid var(--brass); background: #ede4d1; }
.policy-warning strong { color: var(--red-dark); font-size: 11px; }
.policy-warning p { margin: 3px 0 0; color: #67675f; font-size: 10px; line-height: 1.65; }
.file-label input { padding: 10px; background: #ece5d7; }
.file-label > span { color: #787972; font-size: 9px; font-weight: 400; }
.fieldset-help { margin: -7px 0 12px; color: #71746e; font-size: 10px; }
.grant-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.grant-list { display: grid; gap: 7px; margin: 13px 0 0; padding: 0; list-style: none; }
.grant-list li { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 9px 11px; border: 1px solid var(--line); background: #eee8dc; }
.grant-list code { color: var(--green); font-family: var(--mono); font-size: 11px; }
.grant-list button { border: 0; background: transparent; color: var(--red); font-size: 10px; font-weight: 700; cursor: pointer; text-decoration: underline; }
.drawer-actions { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; min-height: 71px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 27px; border-top: 1px solid var(--line); background: #e6dfd1; box-shadow: 0 -8px 20px rgba(42, 36, 25, .08); }
#save-status { margin-right: auto; color: #656b66; font-size: 10px; }
.danger-button { min-height: 40px; padding: 9px 14px; border: 1px solid var(--red); background: transparent; color: var(--red-dark); font-size: 11px; font-weight: 800; cursor: pointer; }
.danger-button:hover { background: var(--red-dark); color: #fff; }
.danger-button:disabled { cursor: wait; opacity: .55; }

.toast-region { position: fixed; z-index: 400; right: 22px; bottom: 22px; display: grid; gap: 8px; width: min(360px, calc(100vw - 44px)); }
.toast { padding: 13px 16px; border-left: 5px solid var(--brass); background: var(--navy); color: #fff; box-shadow: var(--shadow); font-size: 11px; animation: toast-in .2s ease both; }
.toast.error { border-color: #c4554b; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: minmax(0, 1.35fr) minmax(300px, .75fr); gap: 40px; }
  .catalog-search { grid-template-columns: 2fr repeat(3, 1fr); }
  .catalog-submit,
  .catalog-reset { grid-column: span 2; }
  .record-grid { grid-template-columns: repeat(3, 1fr); }
  .folder-grid { grid-template-columns: repeat(2, 1fr); }
  .access-grid > div { padding-inline: 14px; }
}

@media (max-width: 780px) {
  :root { --header-h: 112px; }
  .shell { width: min(100% - 28px, 680px); }
  .site-disclaimer { padding-inline: 10px; font-size: 10px; }
  .disclaimer-divider { margin-inline: 6px; }
  .utility-bar { display: none; }
  .masthead { height: 72px; }
  .brand-mark { width: 42px; height: 42px; font-size: 21px; }
  .brand-copy small,
  .brand-copy > span { display: none; }
  .brand-copy strong { font-size: 19px; }
  .nav-toggle { width: 49px; height: 43px; display: grid; grid-template-columns: 1fr; align-content: center; justify-items: center; gap: 4px; border: 1px solid #bcb29f; background: transparent; color: var(--green); cursor: pointer; }
  .nav-toggle span { width: 19px; border-top: 2px solid currentColor; }
  .nav-toggle b { position: absolute; width: 1px; height: 1px; overflow: hidden; }
  .primary-nav { position: absolute; top: 72px; left: 0; right: 0; display: none; border-top-width: 3px; box-shadow: 0 16px 25px rgba(0,0,0,.2); }
  .primary-nav.open { display: block; }
  .nav-inner { width: 100%; height: auto; display: grid; }
  .nav-inner a { min-height: 48px; justify-content: start; border-left: 0; border-bottom: 1px solid rgba(255,255,255,.12); }
  .admin-nav-link { margin-left: 0; }
  .hero-grid { grid-template-columns: 1fr; padding-block: 55px 61px; }
  .hero-dossier { display: none; }
  .hero h1 { font-size: clamp(34px, 10vw, 48px); }
  .hero-search { grid-template-columns: 48px 1fr auto; }
  .hero-search button { padding-inline: 16px; }
  .hero-search button span { display: none; }
  .access-grid { grid-template-columns: repeat(2, 1fr); }
  .access-grid > div:nth-child(3) { border-top: 1px solid var(--line); }
  .access-grid > div:nth-child(4) { border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
  .section { padding-block: 65px; }
  .catalog-search { grid-template-columns: repeat(2, 1fr); }
  .catalog-query { grid-column: 1 / -1; }
  .catalog-submit,
  .catalog-reset { grid-column: auto; }
  .record-grid { grid-template-columns: repeat(2, 1fr); }
  .recent-list { grid-template-columns: 1fr; }
  .recent-item:nth-child(odd),
  .recent-item:nth-child(even) { padding-inline: 0; border-right: 0; }
  .timeline-track { overflow-x: auto; grid-template-columns: repeat(5, minmax(140px, 1fr)); padding-bottom: 14px; }
  .timeline-track::before { left: 7%; right: -30%; }
  .guide-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-code { grid-column: 1 / -1; text-align: left; }
  .dialog-body { grid-template-columns: 1fr; }
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-grid article:nth-child(2) { border-right: 0; }
  .overview-grid article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .admin-heading { align-items: flex-start; flex-direction: column; justify-content: center; gap: 20px; }
  .admin-heading::before { height: 235px; }
  .admin-heading { min-height: 235px; }
  .table-title { align-items: stretch; flex-direction: column; }
  .admin-search input { width: 100%; }
  .audit-item { grid-template-columns: 125px 1fr; }
  .audit-item span:last-child { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .site-disclaimer { min-height: 42px; line-height: 14px; }
  :root { --disclaimer-h: 42px; }
  .site-disclaimer strong { display: block; }
  .site-disclaimer .disclaimer-divider { display: none; }
  .brand-copy strong { font-size: 16px; }
  .hero h1 br { display: none; }
  .hero-lead { font-size: 13px; }
  .hero-search { min-height: 112px; grid-template-columns: 44px 1fr; }
  .hero-search button { grid-column: 1 / -1; min-height: 46px; margin: 0; }
  .quick-terms { align-items: flex-start; }
  .access-grid > div { min-height: 79px; padding: 10px; gap: 9px; }
  .access-icon { width: 30px; height: 30px; }
  .access-grid small { display: none; }
  .split-heading { align-items: flex-start; }
  .heading-number { display: none; }
  .catalog-search { grid-template-columns: 1fr; padding: 14px; }
  .catalog-query { grid-column: auto; }
  .results-toolbar { align-items: flex-start; flex-direction: column; padding-block: 14px; }
  .record-grid { grid-template-columns: 1fr; }
  .card-preview { height: 190px; }
  .folder-grid { grid-template-columns: 1fr; gap: 40px; }
  .recent-item { grid-template-columns: 55px minmax(0, 1fr) auto; gap: 12px; }
  .recent-date { height: 51px; font-size: 15px; }
  .footer-grid { grid-template-columns: 1fr; gap: 25px; }
  .dialog-heading { align-items: flex-start; flex-direction: column; padding: 22px 19px; }
  .dialog-badges { justify-content: flex-start; }
  .dialog-body { padding: 23px 19px; }
  .dialog-actions { align-items: stretch; flex-direction: column; padding-inline: 19px; }
  .record-dialog { width: calc(100vw - 14px); max-height: calc(100vh - 14px); }
  .dialog-frame { max-height: calc(100vh - 14px); }
  .gate-card { padding: 35px 23px; }
  .admin-heading h1 { font-size: 33px; }
  .admin-heading .primary-button { width: 100%; }
  .admin-content > section { padding: 17px; }
  .overview-grid { grid-template-columns: 1fr; }
  .overview-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
  .overview-grid article:last-child { border-bottom: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .record-form { padding-inline: 17px; }
  .drawer-actions { padding-inline: 17px; }
  #save-status { display: none; }
  .grant-form { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .site-disclaimer { position: static; }
  .site-header,
  .site-footer,
  .hero-search,
  .quick-terms,
  .access-strip,
  .catalog-search,
  .pagination,
  .dialog-actions { display: none !important; }
  body { background: #fff; color: #000; }
}
