:root {
  --black: #000;
  --white: #fff;
  --line: rgba(0, 0, 0, 0.18);
  --line-strong: #000;
  --mono: "Courier New", Courier, monospace;
  --sans: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--white); }

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.35;
  text-rendering: optimizeLegibility;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }

.skip-link {
  position: fixed;
  z-index: 20;
  top: 8px;
  left: 8px;
  padding: 8px 10px;
  background: var(--black);
  color: var(--white);
  font-family: var(--mono);
  font-size: 11px;
  text-decoration: none;
  transform: translateY(-160%);
}

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

.app-header {
  position: sticky;
  z-index: 5;
  top: 0;
  display: grid;
  grid-template-columns: minmax(240px, 17vw) minmax(0, 1fr) auto;
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid var(--black);
  background: var(--white);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

.wordmark { display: flex; align-items: center; gap: 8px; height: 100%; padding: 0 13px; background: var(--black); color: var(--white); text-decoration: none; }
.wordmark__suffix { opacity: 0.62; }
.app-header__identity { margin: 0; padding: 0 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-header__actions { display: flex; align-self: stretch; }
.header-action { display: flex; align-items: center; border: 0; border-left: 1px solid var(--black); padding: 0 13px; background: var(--white); color: var(--black); font-family: inherit; font-size: inherit; letter-spacing: inherit; text-decoration: none; text-transform: uppercase; cursor: pointer; }
.header-action:hover, .header-action:focus-visible { background: var(--black); color: var(--white); outline-offset: -2px; }

.archive-app {
  display: grid;
  grid-template-columns: minmax(215px, 17vw) minmax(510px, 1fr) minmax(285px, 23vw);
  min-height: calc(100svh - 42px);
}

.index-rail, .table-pane, .record-inspector { min-width: 0; }
.index-rail { display: flex; flex-direction: column; border-right: 1px solid var(--black); padding: 19px 13px 13px; }
.rail-section { border-top: 1px solid var(--black); padding: 8px 0 17px; }
.rail-label, .eyebrow, .result-strip, .select-control > span, .rail-note, .inspector-meta dt, .inspector-index, .archive-table thead, .group-heading td { font-family: var(--mono); font-size: 10px; letter-spacing: 0.015em; text-transform: uppercase; }
.rail-label, .eyebrow { margin: 0 0 8px; }

.rail-filter { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; width: 100%; gap: 10px; border: 0; padding: 4px 0; background: transparent; color: var(--black); font-size: 13px; line-height: 1.25; text-align: left; cursor: pointer; }
.rail-filter span:last-child { font-family: var(--mono); font-size: 10px; }
.rail-filter:hover span:first-child, .rail-filter.is-active span:first-child { text-decoration: underline; text-underline-offset: 3px; }
.rail-filter.is-active::before { content: "→"; position: absolute; margin-left: -12px; font-family: var(--mono); font-size: 10px; }
.rail-section--about { font-size: 12px; line-height: 1.4; }
.rail-section--about p:not(.rail-label) { margin: 0 0 10px; }
.rail-section--documents { display: grid; gap: 4px; }
.rail-section--documents .rail-label { margin-bottom: 4px; }
.rail-section--documents a { display: flex; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 10px; line-height: 1.35; text-decoration: none; }
.rail-section--documents a:hover { text-decoration: underline; text-underline-offset: 3px; }
.rail-note { margin: auto 0 0; padding-top: 16px; border-top: 1px solid var(--black); line-height: 1.45; }

.table-pane { display: flex; flex-direction: column; padding: 19px 17px 0; }
.pane-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 25px; padding-bottom: 22px; }
.pane-heading h1 { margin: 0; font-size: 28px; font-weight: 400; letter-spacing: -0.06em; line-height: 0.9; }
.archive-scope { max-width: 280px; margin: 0; font-size: 12px; line-height: 1.4; }

.toolbar { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto auto; align-items: stretch; border-top: 1px solid var(--black); border-bottom: 1px solid var(--black); }
.search-control { display: flex; min-width: 0; }
.search-control input { width: 100%; min-height: 37px; border: 0; padding: 0 10px 0 0; background: transparent; color: var(--black); outline: 0; font-size: 12px; }
.search-control input::placeholder { color: var(--black); opacity: 0.48; }
.select-control { display: grid; grid-template-columns: auto auto; align-items: center; gap: 7px; border-left: 1px solid var(--black); padding: 0 8px; }
.select-control select { max-width: 122px; border: 0; padding: 0; background: var(--white); color: var(--black); font-size: 11px; outline: 0; cursor: pointer; }
.reset-button { border: 0; border-left: 1px solid var(--black); padding: 0 10px; background: var(--black); color: var(--white); font-family: var(--mono); font-size: 10px; text-transform: uppercase; cursor: pointer; }
.reset-button:hover { background: var(--white); color: var(--black); }

.result-strip { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--black); }
.result-strip span:last-child { opacity: 0.62; text-align: right; }
.table-scroll { flex: 1; overflow: auto; }
.archive-table { width: 100%; border-spacing: 0; border-collapse: collapse; table-layout: fixed; }
.archive-table th { position: sticky; z-index: 1; top: 0; padding: 9px 8px 8px 0; background: var(--white); font-weight: 400; text-align: left; }
.archive-table th:nth-child(1) { width: 9%; }
.archive-table th:nth-child(2) { width: 25%; }
.archive-table th:nth-child(3) { width: 20%; }
.archive-table th:nth-child(4) { width: 13%; }
.archive-table th:nth-child(5) { width: 13%; }
.archive-table th:nth-child(6) { width: 20%; }
.archive-table td { border-top: 1px solid var(--line); padding: 9px 8px 10px 0; vertical-align: top; font-size: 12px; line-height: 1.25; }
.archive-table tbody tr:not(.group-heading) { cursor: pointer; }
.archive-table tbody tr:not(.group-heading):hover td, .archive-table tbody tr.is-selected td { background: var(--black); color: var(--white); }
.archive-table .record-year, .archive-table .record-discipline, .archive-table .record-format { font-family: var(--mono); font-size: 10px; line-height: 1.35; text-transform: uppercase; }
.record-title { display: block; font-size: 14px; font-weight: 400; letter-spacing: -0.025em; }
.record-client { display: block; margin-top: 2px; font-family: var(--mono); font-size: 10px; text-transform: uppercase; }
.record-role { font-size: 11px; }
.record-location { font-size: 11px; }
.group-heading td { border-top: 1px solid var(--black); padding: 15px 0 7px; background: var(--white) !important; color: var(--black) !important; }
.group-heading strong { font-weight: 400; }
.empty-row td { padding: 24px 0; font-family: var(--mono); font-size: 10px; text-transform: uppercase; }

.record-inspector { border-left: 1px solid var(--black); padding: 19px 15px; }
.inspector-empty { max-width: 240px; }
.inspector-empty p:last-child { margin: 0; font-size: 13px; line-height: 1.4; }
.inspector-index { display: flex; justify-content: space-between; gap: 15px; padding-bottom: 8px; border-bottom: 1px solid var(--black); }
.inspector-title { margin: 24px 0 7px; font-size: clamp(28px, 3.3vw, 47px); font-weight: 400; letter-spacing: -0.065em; line-height: 0.87; }
.inspector-client { margin: 0 0 22px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; }
.inspector-summary { margin: 0 0 26px; font-size: 15px; line-height: 1.38; }
.inspector-meta { margin: 0; border-top: 1px solid var(--black); }
.inspector-meta > div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.inspector-meta dt, .inspector-meta dd { margin: 0; }
.inspector-meta dd { font-size: 12px; line-height: 1.35; }
.inspector-status { margin: 18px 0 0; font-family: var(--mono); font-size: 10px; text-transform: uppercase; }

@media (max-width: 1120px) {
  .archive-app { grid-template-columns: 205px minmax(0, 1fr) 280px; }
  .table-pane { padding-left: 13px; padding-right: 13px; }
  .select-control > span { display: none; }
  .select-control select { max-width: 103px; }
  .archive-scope { max-width: 220px; }
}

@media (max-width: 880px) {
  .app-header { grid-template-columns: 1fr auto; }
  .app-header__identity { display: none; }
  .archive-app { grid-template-columns: minmax(178px, 26vw) minmax(0, 1fr); }
  .record-inspector { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(178px, 26vw) minmax(0, 1fr); min-height: 0; border-top: 1px solid var(--black); border-left: 0; padding: 0; }
  .record-inspector > * { grid-column: 2; padding: 17px 13px 22px; }
  .inspector-empty { max-width: none; }
  .inspector-index { margin: 0 -13px; padding: 0 13px 8px; }
  .toolbar { grid-template-columns: 1fr auto auto auto; }
  .archive-table th:nth-child(4), .archive-table td:nth-child(4), .archive-table th:nth-child(5), .archive-table td:nth-child(5) { display: none; }
  .archive-table th:nth-child(1) { width: 12%; }
  .archive-table th:nth-child(2) { width: 34%; }
  .archive-table th:nth-child(3) { width: 27%; }
  .archive-table th:nth-child(6) { width: 27%; }
}

@media (max-width: 620px) {
  body { font-size: 13px; }
  .app-header { min-height: 39px; }
  .wordmark { padding: 0 10px; }
  .wordmark__suffix { display: none; }
  .header-action { padding: 0 9px; }
  .header-action:first-child { display: none; }
  .archive-app { display: block; min-height: 0; }
  .index-rail { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; border-right: 0; border-bottom: 1px solid var(--black); padding: 13px 10px; }
  .rail-section { padding-bottom: 12px; }
  .rail-section--about { display: none; }
  .rail-section--documents { align-self: start; }
  .rail-note { grid-column: 1 / -1; margin: 0; padding-top: 11px; }
  .table-pane { padding: 14px 10px 0; }
  .pane-heading { padding-bottom: 16px; }
  .pane-heading h1 { font-size: 25px; }
  .archive-scope { max-width: 185px; font-size: 11px; }
  .toolbar { grid-template-columns: 1fr auto auto; }
  .search-control { grid-column: 1 / -1; border-bottom: 1px solid var(--black); }
  .search-control input { min-height: 35px; }
  .select-control { border-left: 0; padding: 7px 8px 7px 0; }
  .select-control + .select-control { border-left: 1px solid var(--black); padding-left: 8px; }
  .reset-button { min-height: 34px; }
  .result-strip span:last-child { display: none; }
  .archive-table th:nth-child(3), .archive-table td:nth-child(3) { display: none; }
  .archive-table th:nth-child(1) { width: 14%; }
  .archive-table th:nth-child(2) { width: 50%; }
  .archive-table th:nth-child(6) { width: 36%; }
  .record-inspector { display: block; border-left: 0; }
  .record-inspector > * { padding: 15px 10px 22px; }
  .inspector-index { margin: 0 -10px; padding: 0 10px 8px; }
  .inspector-title { margin-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
