:root {
  --navy: #353c52;
  --navy-deep: #242a3b;
  --navy-soft: #e9edf3;
  --gold: #f0cd7f;
  --gold-deep: #d0a84e;
  --paper: #ffffff;
  --cream: #f6f5ef;
  --ink: #16191f;
  --muted: #5e5f61;
  --line: #d8d7cf;
  --line-dark: #9a9b9e;
  --success: #17633b;
  --success-bg: #e7f5ec;
  --warning: #814816;
  --warning-bg: #fff1dc;
  --danger: #8c2e28;
  --danger-bg: #f9e8e5;
  --content-width: 1400px;
  --sans: "Untitled Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "Publico Banner", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: 78px;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.noscript {
  margin: 0;
  padding: 16px 20px;
  background: var(--gold);
  color: var(--ink);
  text-align: center;
  font-weight: 700;
}

button,
input,
select { font: inherit; }

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

a {
  color: inherit;
  text-underline-offset: 0.22em;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
.table-wrap:focus-visible {
  outline: 3px solid var(--gold-deep);
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  transform: translateY(-160%);
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
}

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

.site-header {
  min-height: 92px;
  padding: 22px max(24px, calc((100% - var(--content-width)) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  background: var(--navy);
  color: white;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.brand img {
  width: 156px;
  height: auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
}

.header-actions a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}

.header-actions a:hover { text-decoration: underline; }

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1.4;
  text-transform: uppercase;
}

.lookup-hero {
  min-height: calc(100vh - 92px);
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  grid-template-areas: "intro note" "form note";
  gap: 48px clamp(54px, 8vw, 130px);
  align-content: center;
  padding: clamp(72px, 10vw, 150px) max(24px, calc((100% - var(--content-width)) / 2));
  background:
    linear-gradient(90deg, transparent 0, transparent 69%, rgba(53, 60, 82, 0.055) 69%),
    var(--cream);
}

.lookup-intro { grid-area: intro; }

.lookup-intro h1 {
  max-width: 900px;
  margin: 20px 0 28px;
  font-family: var(--serif);
  font-size: clamp(48px, 7.2vw, 104px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.lookup-intro > p:last-child {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(18px, 1.8vw, 25px);
  line-height: 1.42;
}

.lookup-form {
  grid-area: form;
  max-width: 790px;
  align-self: start;
}

.lookup-form > label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
}

.lookup-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: white;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.lookup-controls:focus-within {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(53, 60, 82, 0.15);
}

.lookup-controls.has-error { border-color: var(--danger); }

.lookup-controls > span {
  padding-left: 18px;
  color: var(--navy);
  font-size: clamp(19px, 2vw, 25px);
  font-weight: 700;
}

.lookup-controls input {
  min-width: 0;
  padding: 20px 10px 20px 2px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: clamp(19px, 2vw, 25px);
  letter-spacing: 0.02em;
}

.lookup-controls input::placeholder { color: #96979b; }

.lookup-controls button,
.message-actions button,
.message-actions a {
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid var(--navy);
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: var(--navy);
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.lookup-controls button {
  min-height: 62px;
  margin: 4px;
}

.lookup-controls button:hover,
.message-actions button:hover,
.message-actions a:hover { background: var(--navy-deep); }

.form-help,
.form-error {
  margin: 9px 0 0;
  font-size: 13px;
}

.form-help { color: var(--muted); }
.form-error { color: var(--danger); font-weight: 650; }

.lookup-note {
  grid-area: note;
  align-self: stretch;
  padding-left: clamp(24px, 4vw, 62px);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.lookup-note ul {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.lookup-note li {
  padding: 22px 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

.lookup-note li span {
  color: var(--navy);
  font-family: var(--serif);
  font-size: 16px;
}

.certificate-hero {
  padding: clamp(50px, 6vw, 88px) max(24px, calc((100% - var(--content-width)) / 2)) clamp(44px, 6vw, 76px);
  background: var(--cream);
}

.hero-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.certificate-number {
  margin: clamp(58px, 8vw, 104px) 0 14px;
  color: var(--muted);
  font-size: clamp(15px, 1.6vw, 20px);
}

.certificate-hero h1 {
  max-width: 1050px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(46px, 6.7vw, 94px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1;
}

.status {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
  letter-spacing: 0.09em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.status > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-valid { color: var(--success); background: var(--success-bg); }
.status-expired,
.status-suspended { color: var(--warning); background: var(--warning-bg); }
.status-withdrawn,
.status-revoked { color: var(--danger); background: var(--danger-bg); }
.status-unknown { color: var(--muted); background: white; }

.hero-facts {
  margin-top: clamp(44px, 6vw, 72px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line-dark);
}

.hero-facts > div {
  padding: 18px 24px 0 0;
}

.hero-facts > div + div {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.hero-facts span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hero-facts strong {
  font-family: var(--serif);
  font-size: clamp(19px, 2vw, 27px);
  font-weight: 400;
}

.certificate-picker {
  max-width: 540px;
  margin-top: 38px;
}

.certificate-picker label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

.certificate-picker select {
  width: 100%;
  min-height: 48px;
  padding: 0 42px 0 13px;
  border: 1px solid var(--line-dark);
  border-radius: 3px;
  background: white;
  color: var(--ink);
}

.contents-nav {
  position: sticky;
  z-index: 10;
  top: 0;
  min-height: 58px;
  padding: 0 max(24px, calc((100% - var(--content-width)) / 2));
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 42px);
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  font-size: 13px;
  white-space: nowrap;
}

.contents-nav span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.contents-nav a { text-decoration: none; }
.contents-nav a:hover { text-decoration: underline; }

.record-shell {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
}

.record-section {
  display: grid;
  grid-template-columns: minmax(230px, 0.44fr) minmax(0, 1fr);
  gap: clamp(40px, 7vw, 110px);
  padding: clamp(68px, 8vw, 120px) 0;
  scroll-margin-top: 68px;
}

.record-section + .record-section { border-top: 1px solid var(--line-dark); }

.section-heading {
  align-self: start;
  position: sticky;
  top: 92px;
}

.section-heading h2 {
  margin: 16px 0 0;
  font-family: var(--serif);
  font-size: clamp(32px, 3.8vw, 54px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.section-heading-split > p,
.subsection-heading > p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.definition-list { margin: 0; }

.definition-list > div {
  display: grid;
  grid-template-columns: minmax(160px, 0.38fr) minmax(0, 1fr);
  border-top: 1px solid var(--line);
}

.definition-list > div:last-child { border-bottom: 1px solid var(--line); }

.definition-list dt,
.definition-list dd {
  margin: 0;
  padding: 19px 20px;
}

.definition-list dt {
  background: var(--cream);
  font-size: 13px;
  font-weight: 700;
}

.definition-list dd {
  min-width: 0;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.definition-list dd a { font-weight: 600; }

.plain-list {
  margin: 0;
  padding-left: 20px;
}

.plain-list li + li { margin-top: 6px; }

.tag-list {
  margin: -3px 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  list-style: none;
}

.tag-list li {
  padding: 5px 9px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: white;
  font-size: 12px;
}

.empty-value {
  color: var(--muted);
  font-style: italic;
}

.empty-block {
  margin: 0;
  padding: 28px;
  border: 1px dashed var(--line-dark);
  background: var(--cream);
  color: var(--muted);
}

.table-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.42;
}

caption {
  width: 1px;
  height: 1px;
  padding: 0;
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

th,
td {
  padding: 14px 15px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th:last-child,
td:last-child { border-right: 0; }
tbody tr:last-child td { border-bottom: 0; }

th {
  background: var(--navy-soft);
  color: var(--navy-deep);
  font-weight: 750;
}

tbody tr:nth-child(even) { background: var(--cream); }
tbody tr:hover { background: #eeece3; }

.facilities-section {
  grid-template-columns: 1fr;
  gap: 36px;
}

.facilities-section > .section-heading {
  position: static;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: end;
}

.facility-card {
  border: 1px solid var(--line-dark);
  background: white;
}

.facility-card + .facility-card { margin-top: -20px; }

.facility-card > summary {
  min-height: 92px;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.facility-card > summary::-webkit-details-marker { display: none; }
.facility-card[open] > summary { background: var(--navy); color: white; }

.facility-number {
  font-family: var(--serif);
  font-size: 18px;
}

.facility-card summary strong {
  display: block;
  font-family: var(--serif);
  font-size: clamp(20px, 2.4vw, 29px);
  font-weight: 400;
}

.facility-card summary small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.facility-card[open] summary small { color: rgba(255, 255, 255, 0.72); }

.summary-action {
  font-size: 0;
  font-weight: 700;
}

.summary-action::after { content: "View +"; font-size: 13px; }
.facility-card[open] .summary-action::after { content: "Hide −"; }

.facility-body {
  padding: clamp(24px, 4vw, 54px);
  border-top: 1px solid var(--line-dark);
}

.subsection-heading {
  margin: 58px 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
}

.subsection-heading h3 {
  margin: 9px 0 0;
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 400;
}

.secondary-button {
  min-height: 44px;
  margin-top: 16px;
  padding: 0 15px;
  border: 1px solid var(--navy);
  border-radius: 3px;
  background: white;
  color: var(--navy);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.secondary-button:hover { background: var(--navy-soft); }

.verification-note {
  padding: clamp(70px, 9vw, 128px) max(24px, calc((100% - 1020px) / 2));
  background: var(--gold);
  color: var(--ink);
}

.verification-note > p:nth-child(2) {
  margin: 20px 0 0;
  font-family: var(--serif);
  font-size: clamp(27px, 3.7vw, 50px);
  letter-spacing: -0.028em;
  line-height: 1.12;
}

.verification-note > p:last-child {
  margin: 30px 0 0;
  font-size: 13px;
}

.loading-page,
.message-page {
  min-height: calc(100vh - 92px);
  padding: clamp(80px, 12vw, 170px) max(24px, calc((100% - 1040px) / 2));
  background: var(--cream);
}

.loading-page h1,
.message-page h1 {
  max-width: 900px;
  margin: 19px 0 0;
  font-family: var(--serif);
  font-size: clamp(42px, 6vw, 78px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.loading-mark {
  width: 15px;
  height: 15px;
  margin-bottom: 22px;
  border: 3px solid var(--line);
  border-top-color: var(--navy);
  border-radius: 50%;
  display: block;
  animation: spin 900ms linear infinite;
}

.loading-lines {
  max-width: 720px;
  margin-top: 48px;
}

.loading-lines span {
  height: 12px;
  margin-top: 12px;
  display: block;
  border-radius: 2px;
  background: #e4e2da;
}

.loading-lines span:nth-child(2) { width: 74%; }
.loading-lines span:nth-child(3) { width: 46%; }

.message-copy {
  max-width: 680px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.message-actions {
  margin-top: 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.message-actions a:last-child:not(:first-child) {
  background: transparent;
  color: var(--navy);
}

.message-actions a:last-child:not(:first-child):hover { background: var(--navy-soft); }

.request-id {
  margin-top: 24px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.site-footer {
  min-height: 220px;
  padding: 46px max(24px, calc((100% - var(--content-width)) / 2));
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 30px 80px;
  align-items: start;
  background: var(--navy);
  color: white;
}

.site-footer img { width: 145px; height: auto; }
.site-footer p { margin: 14px 0 0; color: rgba(255, 255, 255, 0.78); font-size: 14px; }

.site-footer nav {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 12px 34px;
  font-size: 13px;
}

.site-footer nav a { text-decoration: none; }
.site-footer nav a:hover { text-decoration: underline; }

.site-footer .copyright {
  grid-column: 1 / -1;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .lookup-hero {
    grid-template-columns: 1fr;
    grid-template-areas: "intro" "form" "note";
    background: var(--cream);
  }

  .lookup-note {
    margin-top: 28px;
    padding: 36px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .record-section {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .section-heading { position: static; }
  .contents-nav span { display: none; }
}

@media (max-width: 680px) {
  html { scroll-padding-top: 55px; }

  .site-header {
    min-height: 76px;
    padding: 19px 18px;
  }

  .brand img { width: 132px; }
  .header-actions { gap: 14px; font-size: 12px; }
  .header-actions a:last-child { display: none; }

  .lookup-hero { padding: 66px 18px 82px; gap: 42px; }

  .lookup-controls {
    grid-template-columns: auto minmax(0, 1fr);
    overflow: visible;
  }

  .lookup-controls button {
    grid-column: 1 / -1;
    min-height: 54px;
    margin: 0;
    border-radius: 0;
  }

  .certificate-hero { padding: 42px 18px 48px; }
  .hero-topline { align-items: flex-start; }
  .certificate-number { margin-top: 54px; }

  .hero-facts { grid-template-columns: 1fr; }
  .hero-facts > div { padding: 16px 0; }
  .hero-facts > div + div { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }

  .contents-nav {
    min-height: 52px;
    padding: 0 18px;
    gap: 22px;
  }

  .record-shell { padding: 0 18px; }
  .record-section { padding: 64px 0; scroll-margin-top: 58px; }

  .definition-list > div { grid-template-columns: 1fr; }
  .definition-list dt { padding: 12px 14px 5px; }
  .definition-list dd { padding: 6px 14px 14px; background: var(--cream); }

  .facilities-section > .section-heading,
  .subsection-heading { align-items: flex-start; flex-direction: column; }

  .facility-card > summary {
    min-height: 82px;
    padding: 17px;
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .summary-action { display: none; }
  .facility-body { padding: 18px; }

  .verification-note { padding: 68px 18px; }
  .loading-page,
  .message-page { min-height: calc(100vh - 76px); padding: 84px 18px; }

  .site-footer {
    padding: 42px 18px;
    grid-template-columns: 1fr;
  }

  .site-footer .copyright { grid-column: auto; }
}

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