@font-face {
  font-family: "Untitled Sans";
  src: url("../fonts/untitled-sans-web-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Untitled Sans";
  src: url("../fonts/untitled-sans-web-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Untitled Sans";
  src: url("../fonts/untitled-sans-web-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Publico Banner";
  src: url("../fonts/PublicoBanner-Light-Web.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
--navy: #353C52;
--grove: #2C4748;
--gold: #F0CD7F;
--paper: #F6F5EF;
--white: #FFFFFF;
--sand: #B7B3A4;
--sage: #AAB199;
--spring: #C0D2AB;
--mist: #C1C4CC;
--navy-soft: #AAB3CB;
--navy-hover: #46506d;
--ink: #000000;
--muted: #5E5F61;
--line: #E2E4E8;
--line-dark: #C9CCD4;
--success: #28644B;
--success-bg: #E8F2E9;
--warning: #8a4f0a;
--warning-bg: #FFF2E3;
--danger: #9E362C;
--danger-bg: #F8E5E3;
--info: #326BA8;
--cream: #F5F6F7;
--autofill: #f2f8fc;
--shadow: 0 4px 18px rgba(55, 51, 39, 0.055);
--shadow-strong: 0 10px 28px rgba(37, 58, 46, 0.09);
--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);
  color-scheme: light;
  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);
  outline-offset: 3px;
}

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

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

.skip-link:not(:focus) {
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.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;
  border-bottom: 2px solid var(--navy);
  background:var(--navy);
  box-shadow: 0 3px 16px rgba(53, 60, 82, 0.16);
  color: var(--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; }

.header-auth {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.session-pending {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
}

.session-identity {
  max-width: 230px;
  display: grid;
  line-height: 1.18;
  text-align: right;
}

.session-identity span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
}

.session-identity strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-auth-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--gold);
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  background: var(--gold);
  color: var(--navy);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.header-auth-button:hover {
  background: var(--cream);
  color: var(--ink);
  text-decoration: none !important;
}

.header-auth-button:disabled { cursor: wait; opacity: 0.7; }

.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 {
  position: relative;
  isolation: isolate;
  min-height: calc(100dvh - 92px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(64px, 8vw, 112px) 24px;
  background: var(--paper);
}

.lookup-shell {
  width: min(100%, 900px);
  display: grid;
  gap: 30px;
}

.lookup-intro { text-align: center; }

.lookup-intro h1 {
  margin: 16px 0 18px;
  font-family: var(--serif);
  font-size: clamp(48px, 6.5vw, 82px);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1;
}

.lookup-intro > p:last-child {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.42;
}

.lookup-card {
  width: min(100%, 790px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  background: var(--white);
  box-shadow: var(--shadow-strong);
}

.lookup-tabs {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--cream);
}

.lookup-tab {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.lookup-tab:hover {
  border-color: var(--line-dark);
  color: var(--ink);
}

.lookup-tab.is-active {
  border-color: var(--grove);
  background: var(--grove);
  color: var(--white);
  box-shadow: 0 3px 10px rgba(44, 71, 72, 0.14);
}

.lookup-panel { padding: 28px 30px 26px; }
.lookup-panel[hidden] { display: none; }

.lookup-form {
  width: 100%;
}

.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: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.lookup-controls:focus-within {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(44, 71, 72, 0.14), var(--shadow);
}

.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: var(--muted); }

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

.lookup-controls-single input { padding-left: 18px; }

.public-transaction-shell { max-width: 980px; }

.tc-auth-panel {
  padding: 0 max(24px, calc((100% - var(--content-width)) / 2)) clamp(52px, 6vw, 78px);
  background: var(--paper);
}

#tc-authorized-view-slot:not([hidden]) {
  border-top: 1px solid var(--line-dark);
}

#tc-authorized-view-slot .record-section + .record-section {
  border-top: 1px solid var(--line-dark);
}

.authorized-view-context > p:first-child {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.authorized-record-intro .organization-selector {
  max-width: 680px;
}

.tc-auth-card {
  padding: clamp(26px, 3.2vw, 42px);
  border: 1px solid var(--line-dark);
  display: grid;
  grid-template-columns: minmax(240px, 0.65fr) minmax(0, 1fr);
  gap: clamp(30px, 4.5vw, 64px);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: var(--shadow);
}

.tc-auth-card h2 {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-size: clamp(30px, 3.6vw, 50px);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.05;
}

.tc-auth-copy {
  align-self: center;
  color: var(--muted);
  font-size: 16px;
}

.tc-auth-copy > p { max-width: 690px; }

.auth-primary,
.authorized-actions > a,
.organization-selector button {
  min-height: 48px;
  padding: 0 17px;
  border: 1px solid var(--navy);
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 3px 10px rgba(40, 88, 70, 0.14);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.auth-primary:hover,
.authorized-actions > a:hover,
.organization-selector button:hover { background: var(--navy-hover); }

.tc-auth-loading { align-items: center; }
.tc-auth-loading .loading-mark { margin: 0; justify-self: start; }

.tc-auth-card-authenticated {
  grid-template-columns: minmax(280px, 0.48fr) minmax(0, 1fr);
}

.organization-selector { margin-top: 30px; }

.organization-selector > label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 750;
}

.organization-selector > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.organization-selector select {
  min-width: 0;
  min-height: 48px;
  padding: 0 38px 0 12px;
  border: 1px solid var(--line-dark);
  border-radius: 3px 0 0 3px;
  background: var(--white);
  color: var(--ink);
}

.organization-selector button { border-radius: 0 7px 7px 0; }
.organization-selector button:disabled { cursor: wait; opacity: 0.7; }

.organization-selector > p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.tc-auth-result {
  min-width: 0;
  align-self: start;
  padding: clamp(24px, 3vw, 40px);
  border-left: 4px solid var(--gold);
  border-radius: 7px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.tc-auth-result h2,
.tc-auth-result h3 {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: clamp(25px, 2.8vw, 38px);
  font-weight: 400;
  line-height: 1.08;
}

.tc-auth-result > p:last-child { margin: 14px 0 0; color: var(--muted); }
.tc-auth-unavailable { border-left-color: var(--line-dark); }
.tc-auth-authorized { border-left-color: var(--success); }

.synthetic-warning {
  margin-top: 26px;
  padding: 16px 18px;
  border: 1px solid var(--warning);
  display: grid;
  gap: 4px;
  background: var(--warning-bg);
  color: var(--warning);
}

.synthetic-warning strong {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.authorized-details > div { grid-template-columns: minmax(160px, 0.38fr) minmax(0, 1fr); }

.authorized-products .table-wrap { margin-top: 0; }
.authorized-products table { min-width: 680px; }
.authorized-products th,
.authorized-products td { font-size: 12px; }

.authorized-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.authorized-actions p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.transaction-certificate-hero h1 {
  overflow-wrap: anywhere;
  font-size: clamp(44px, 6.5vw, 92px);
}

.lookup-controls button,
.message-actions button,
.message-actions a {
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid var(--gold);
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 3px 10px rgba(40, 88, 70, 0.14);
  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);
  color: var(--white);
}

.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-assurance {
  width: min(100%, 790px);
  margin: 0 auto;
  padding: 18px 20px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--paper);
}

.lookup-assurance svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  stroke: var(--navy);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.lookup-assurance p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.lookup-assurance strong { color: var(--ink); }

/* Keep both lookup actions visible in the shorter content area of laptop browsers. */
@media (min-width: 901px) and (max-height: 820px) {
  .lookup-hero {
    padding-block: clamp(36px, 6dvh, 52px);
  }

  .lookup-intro h1 {
    margin: 10px 0 14px;
    font-size: clamp(48px, 5.4vw, 76px);
  }

  .lookup-intro > p:last-child {
    font-size: clamp(18px, 1.55vw, 22px);
  }

  .lookup-shell { gap: 22px; }
}

.certificate-hero {
  padding: clamp(38px, 4.5vw, 60px) max(24px, calc((100% - var(--content-width)) / 2)) clamp(34px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

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

.certificate-number {
  margin: clamp(30px, 4vw, 50px) 0 10px;
  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(44px, 5.6vw, 78px);
  font-weight: 400;
  letter-spacing: -0.015em;
  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,
.status-invalid { color: var(--danger); background: var(--danger-bg); }
.status-unknown { color: var(--muted); background: var(--white); }

.hero-facts {
  margin-top: clamp(26px, 3.5vw, 40px);
  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: 26px;
}

.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: 7px;
  background: var(--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, 253, 250, 0.94);
  box-shadow: 0 4px 14px rgba(55, 51, 39, 0.045);
  backdrop-filter: blur(8px);
  font-size: 13px;
  white-space: nowrap;
}

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

.contents-certificate {
  max-width: min(38vw, 380px);
  padding-right: clamp(16px, 2vw, 28px);
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  flex: 0 0 auto;
  overflow: hidden;
  border-right: 1px solid var(--line);
}

.contents-certificate strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.015em;
  text-overflow: ellipsis;
}

.contents-nav a { text-decoration: none; }
.contents-nav a:hover { text-decoration: underline; }
.contents-nav a[aria-current="location"] {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--navy);
  text-decoration-thickness: 1px;
}

.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(36px, 5vw, 72px);
  padding: clamp(50px, 5.5vw, 78px) 0;
  scroll-margin-top: 68px;
}

.record-section > * { min-width: 0; }

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

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

.section-heading h2 {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: clamp(30px, 3.2vw, 46px);
  font-weight: 400;
  letter-spacing: -0.015em;
  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: 15px 18px;
}

.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; }

.definition-list.fact-grid {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.definition-list.fact-grid > div,
.definition-list.fact-grid > div:last-child {
  border: 0;
  display: block;
  background: var(--white);
}

.definition-list.fact-grid dt {
  padding: 13px 16px 4px;
  background: var(--white);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.definition-list.fact-grid dd {
  min-height: 47px;
  padding: 0 16px 14px;
  background: var(--white);
  font-size: 14px;
}

.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: var(--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);
  border-radius: 7px;
}

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

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(--grove);
  color: var(--white);
  font-weight: 700;
}

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

.facilities-section,
.transaction-products-section {
  grid-template-columns: 1fr;
  gap: 28px;
}

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

.facility-card {
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

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

.facility-card > summary {
  min-height: 78px;
  padding: 16px 20px;
  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: var(--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 −"; }

.transaction-products-card {
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

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

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

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

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

.transaction-products-card[open] summary small { color: rgba(255, 255, 255, 0.72); }
.transaction-products-card[open] .summary-action::after { content: "Hide −"; }

.transaction-products-body {
  padding: clamp(22px, 3vw, 38px);
  border-top: 1px solid var(--line-dark);
}

.product-tools {
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: minmax(190px, 0.65fr) minmax(280px, 1fr) auto;
  gap: 16px;
  align-items: end;
}

.product-filter span {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 750;
}

.product-filter select,
.product-filter input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line-dark);
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
}

.product-filter input::placeholder { color: var(--muted); }

.product-clear {
  min-width: 110px;
  margin: 0;
}

.product-results-heading {
  min-height: 24px;
  margin-bottom: 10px;
  display: flex;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 13px;
}

.product-results-heading p { margin: 0; }

.product-pagination {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.product-pagination .secondary-button { margin: 0; }

.facility-body {
  padding: clamp(22px, 3vw, 38px);
  border-top: 1px solid var(--line-dark);
}

.subsection-heading {
  margin: 42px 0 18px;
  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: 7px;
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.secondary-button:not(:disabled):hover {
  background: var(--navy-hover);
  color: var(--white);
}

.secondary-button:disabled {
  background: var(--white);
  color: var(--navy);
  cursor: not-allowed;
  opacity: 0.48;
}

.verification-note {
  padding: clamp(50px, 6vw, 76px) max(24px, calc((100% - 1020px) / 2));
  background: var(--grove);
  color: var(--paper);
  font-family: var(--sans);
}

.verification-note .eyebrow { color: var(--paper); }

.verification-note > p:nth-child(2) {
  margin: 20px 0 0;
  font-family: var(--sans);
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.6;
}

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

.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: var(--mist);
}

.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: center;
  border-top: 2px solid var(--navy);
  background: var(--navy);
  color: var(--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: flex;
  justify-content: flex-end;
  gap: 12px 34px;
  font-size: 13px;
  white-space: nowrap;
}

.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;
  text-align: center;
}

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

@media (max-width: 900px) {
  .lookup-hero { background: var(--cream); }

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

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

  .product-tools { grid-template-columns: 1fr 1fr; }
  .product-clear { justify-self: start; }

  .tc-auth-card,
  .tc-auth-card-authenticated { grid-template-columns: 1fr; }
}

@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; }
  .session-identity { display: none; }
  .header-auth-button { min-height: 36px; padding: 0 11px; }

  .lookup-hero {
    min-height: calc(100dvh - 76px);
    padding: 54px 18px 66px;
  }

  .lookup-shell { gap: 24px; }
  .lookup-card { border-radius: 8px; }
  .lookup-tabs { padding: 6px; gap: 4px; }
  .lookup-tab { min-height: 46px; padding: 0 10px; font-size: 12px; }
  .lookup-panel { padding: 24px 18px 22px; }

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

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

  .lookup-controls-single { grid-template-columns: 1fr; }

  .lookup-controls-single button { grid-column: 1; }

  .lookup-assurance { padding: 16px; }

  .certificate-hero { padding: 32px 18px 38px; }
  .hero-topline { align-items: flex-start; }
  .certificate-number { margin-top: 28px; }

  .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;
  }

  .contents-certificate {
    max-width: 54vw;
    padding-right: 16px;
  }

  .contents-certificate > span { display: none; }

  .record-shell { padding: 0 18px; }
  .record-section { padding: 48px 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); }
  .definition-list.fact-grid { grid-template-columns: 1fr; }

  .facilities-section > .section-heading,
  .transaction-products-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; }
  .transaction-products-card > summary { min-height: 82px; padding: 17px; }
  .transaction-products-body { padding: 18px; }
  .product-tools { grid-template-columns: 1fr; }
  .product-clear { width: 100%; }
  .product-results-heading { justify-content: flex-start; }
  .product-pagination { align-items: stretch; flex-direction: column; }
  .product-pagination span { order: -1; text-align: center; }

  .verification-note { padding: 48px 18px; }
  .tc-auth-panel { padding: 0 18px 52px; }
  .tc-auth-card { padding: 26px 20px; }
  .organization-selector > div { grid-template-columns: 1fr; }
  .organization-selector select { border-radius: 7px 7px 0 0; }
  .organization-selector button { border-radius: 0 0 7px 7px; }
  .tc-auth-result { padding: 22px 18px; }
  .authorized-details > div { grid-template-columns: 1fr; }
  .authorized-details dt { padding: 12px 14px 5px; }
  .authorized-details dd { padding: 6px 14px 14px; background: var(--cream); }
  .authorized-actions { align-items: stretch; flex-direction: column; }
  .authorized-actions > a { width: 100%; }
  .loading-page,
  .message-page { min-height: calc(100dvh - 76px); padding: 84px 18px; }

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

  .site-footer nav {
    justify-content: flex-end;
    gap: 12px 18px;
  }

  .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; }
}

.v4-certificate-hero {
  border-top: 7px solid var(--gold);
}

.v4-test-banner {
  padding: 18px max(24px, calc((100% - var(--content-width)) / 2));
  display: flex;
  align-items: baseline;
  gap: 18px;
  background: var(--gold);
  color: var(--ink);
  font-size: 14px;
}

.v4-test-banner strong {
  flex: 0 0 auto;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.submitted-code {
  margin-left: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.hash-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.v4-facility-card .definition-list > div {
  grid-template-columns: minmax(170px, 0.38fr) minmax(0, 1fr);
}

.v4-scope-content,
.v4-data-block {
  min-width: 0;
}

.v4-scope-content {
  display: grid;
  gap: 28px;
}

.v4-data-block h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
}

.v4-data-table {
  min-width: 680px;
}

.v4-data-table .plain-list {
  padding-left: 16px;
}

.v4-farm-capacity {
  margin-top: 24px;
}

@media (max-width: 640px) {
  .v4-test-banner {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .submitted-code {
    margin: 8px 0 0;
    display: block;
  }

  .v4-facility-card .definition-list > div {
    grid-template-columns: 1fr;
  }
}
/* Stakeholder portal */
.portal-app {
  min-height: 100dvh;
  background: var(--cream);
  color: var(--ink);
}

.portal-app button,
.portal-app input,
.portal-app select { font-family: var(--sans); }

.portal-header {
  min-height: 82px;
  padding: 16px clamp(20px, 3vw, 46px);
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--navy);
  color: var(--white);
}

.portal-brand {
  display: inline-flex;
  padding-right: 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.25);
}

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

.portal-header-title {
  display: grid;
  line-height: 1.05;
}

.portal-header-title span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.portal-header-title strong { font-size: 19px; font-weight: 500; }

.portal-account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.portal-account > span:not(.portal-preview-pill) {
  max-width: 220px;
  display: grid;
  text-align: right;
}

.portal-account small { color: rgba(255, 255, 255, 0.62); font-size: 10px; }
.portal-account strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

.portal-account button,
.portal-back-link {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.portal-account button:hover,
.portal-back-link:hover { border-color: var(--gold); color: var(--gold); }

.portal-preview-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.portal-layout {
  min-height: calc(100dvh - 82px);
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
}

.portal-sidebar {
  min-height: calc(100vh - 82px);
  padding: 34px 18px 24px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--white);
}

.portal-sidebar nav { display: grid; gap: 5px; }

.portal-sidebar nav a {
  min-height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 13px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.portal-sidebar nav a:hover { background: var(--cream); color: var(--navy); }

.portal-sidebar nav a[aria-current="page"] {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(23, 60, 49, 0.18);
}

.portal-sidebar svg,
.portal-actions-grid svg,
.portal-card-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.portal-sidebar-help {
  margin-top: auto;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--cream);
}

.portal-sidebar-help strong { font-size: 13px; }
.portal-sidebar-help p { margin: 6px 0 12px; color: var(--muted); font-size: 11px; }
.portal-sidebar-help a { color: var(--grove); font-size: 11px; font-weight: 700; }

.portal-workspace { min-width: 0; }

.portal-workspace-toolbar {
  min-height: 65px;
  padding: 10px clamp(24px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.82);
}

.portal-workspace-toolbar > a { color: var(--muted); font-size: 11px; font-weight: 700; text-decoration: none; }
.portal-workspace-toolbar > a:hover { color: var(--navy); text-decoration: underline; }

.portal-current-organization { display: grid; line-height: 1.2; }
.portal-current-organization span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.portal-current-organization strong { font-size: 13px; }
.portal-current-organization small { color: var(--muted); font-size: 10px; }

.portal-organization-picker { display: flex; align-items: center; gap: 8px; }
.portal-organization-picker label { color: var(--muted); font-size: 11px; font-weight: 700; }
.portal-organization-picker select { min-height: 38px; padding: 0 34px 0 10px; border: 1px solid var(--line-dark); border-radius: 5px; background: var(--white); }
.portal-organization-picker button { min-height: 38px; padding: 0 12px; border: 0; border-radius: 5px; background: var(--navy); color: var(--white); cursor: pointer; font-size: 11px; font-weight: 700; }

#portal-content { max-width: 1450px; margin: 0 auto; padding: clamp(34px, 4vw, 64px); }
.portal-panel[hidden] { display: none; }

.portal-welcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.portal-welcome h1,
.portal-page-heading h1,
.portal-signin-copy h1,
.portal-invitation-card h1 {
  margin: 10px 0 8px;
  font-family: var(--serif);
  font-size: clamp(40px, 5vw, 67px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.02;
}

.portal-welcome > div:first-child > p:last-child,
.portal-page-heading > p:last-child { max-width: 720px; margin: 0; color: var(--muted); font-size: 15px; }

.portal-trust-card {
  min-width: 230px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #c7d8c9;
  border-radius: 8px;
  background: var(--success-bg);
}

.portal-trust-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--success);
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
}

.portal-trust-card div { display: grid; }
.portal-trust-card strong { font-size: 12px; }
.portal-trust-card small { color: #46624a; font-size: 10px; }

.portal-preview-banner {
  margin-top: 28px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 13px;
  border-left: 4px solid var(--gold);
  background: #fff8e8;
  font-size: 12px;
}

.portal-preview-banner span { color: var(--muted); }
.portal-preview-banner a { margin-left: auto; flex: 0 0 auto; font-weight: 700; }

.portal-metrics {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.portal-metric {
  min-height: 138px;
  padding: 22px;
  display: grid;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.portal-metric strong { font-family: var(--serif); font-size: 37px; font-weight: 400; line-height: 1; }
.portal-metric span { margin-top: 8px; font-size: 12px; font-weight: 700; }
.portal-metric small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.portal-metric-gold { border-top: 4px solid var(--gold); }

.portal-overview-grid,
.portal-two-column {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.portal-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.portal-card-heading { margin-bottom: 19px; }
.portal-card-heading h2,
.portal-certificate-card h2,
.portal-roadmap-card h2,
.portal-invite-form h2,
.portal-profile-card h2 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: clamp(25px, 2.4vw, 34px);
  font-weight: 400;
  line-height: 1.12;
}

.portal-actions-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.portal-actions-grid > a {
  min-height: 178px;
  padding: 19px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.portal-actions-grid > a:hover { border-color: var(--gold); box-shadow: var(--shadow-strong); transform: translateY(-2px); }
.portal-actions-grid > a > span { grid-column: 1 / -1; width: 37px; height: 37px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: var(--navy); }
.portal-actions-grid strong { margin-top: 19px; font-size: 13px; }
.portal-actions-grid small { grid-column: 1; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.portal-actions-grid b { grid-column: 2; grid-row: 2 / span 2; align-self: end; font-size: 18px; font-weight: 400; }

.portal-activity ul { margin: 0; padding: 0; list-style: none; }
.portal-activity li { padding: 14px 0; display: flex; gap: 12px; border-top: 1px solid var(--line); }
.portal-activity li > span { width: 23px; height: 23px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line-dark); border-radius: 50%; color: var(--muted); font-size: 10px; }
.portal-activity li > span.is-complete { border-color: var(--success); background: var(--success); color: var(--white); }
.portal-activity li div { display: grid; }
.portal-activity li strong { font-size: 12px; }
.portal-activity li small { color: var(--muted); font-size: 10px; }

.portal-page-heading { margin-bottom: 34px; }
.portal-page-heading h1 { font-size: clamp(38px, 4.5vw, 60px); }
.portal-page-heading-split { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }

.portal-primary-action {
  min-height: 46px;
  padding: 0 17px;
  border: 1px solid var(--navy);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--navy);
  color: var(--white);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.portal-primary-action:hover { background: var(--navy-hover); }

.portal-certificate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.portal-certificate-card { min-height: 390px; display: flex; align-items: flex-start; flex-direction: column; }
.portal-card-icon { width: 48px; height: 48px; margin-bottom: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: var(--navy); }
.portal-card-icon svg { width: 23px; height: 23px; }
.portal-certificate-card > p:not(.eyebrow) { max-width: 540px; color: var(--muted); font-size: 13px; }
.portal-certificate-card .portal-primary-action,
.portal-certificate-card .portal-tc-form { width: 100%; margin-top: auto; }
.portal-certificate-card-dark { background: var(--navy); color: var(--white); }
.portal-certificate-card-dark .eyebrow,
.portal-certificate-card-dark > p:not(.eyebrow) { color: rgba(255, 255, 255, 0.68); }
.portal-certificate-card-dark .portal-card-icon { background: var(--white); }

.portal-tc-form > label { display: block; margin-bottom: 7px; font-size: 11px; font-weight: 700; }
.portal-tc-form > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.portal-tc-form input { min-width: 0; min-height: 48px; padding: 0 12px; border: 1px solid var(--line-dark); border-radius: 6px 0 0 6px; }
.portal-tc-form button { min-height: 48px; padding: 0 18px; border: 1px solid var(--gold); border-radius: 0 6px 6px 0; background: var(--gold); color: var(--ink); cursor: pointer; font-weight: 700; }
.portal-tc-form > p { margin: 7px 0 0; color: #ffd2cb; font-size: 11px; }
.portal-unavailable { margin-top: auto; color: var(--muted); font-size: 12px; }

.portal-preview-note {
  margin-top: 18px;
  padding: 18px 21px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  font-size: 12px;
}
.portal-preview-note span { color: var(--muted); }
.portal-preview-note a { margin-left: auto; flex: 0 0 auto; font-weight: 700; }

.portal-profile-card { min-height: 260px; display: flex; align-items: center; gap: 22px; }
.portal-organization-monogram { width: 82px; height: 82px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--navy); color: var(--gold); font-family: var(--serif); font-size: 38px; }
.portal-profile-card p { margin: 4px 0 0; color: var(--muted); }
.portal-status { display: inline-flex; align-items: center; gap: 6px; color: var(--success); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.portal-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

.portal-detail-card dl { margin: 0; }
.portal-detail-card dl > div { padding: 13px 0; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; border-top: 1px solid var(--line); }
.portal-detail-card dt { color: var(--muted); font-size: 10px; }
.portal-detail-card dd { margin: 0; font-size: 12px; font-weight: 700; }

.portal-governance-note {
  margin-top: 18px;
  padding: 22px;
  display: flex;
  gap: 15px;
  border-left: 4px solid var(--gold);
  background: var(--white);
}
.portal-governance-note > span { width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--gold); font-family: var(--serif); font-weight: 700; }
.portal-governance-note strong { font-size: 13px; }
.portal-governance-note p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }

.portal-people-card { padding: 0; overflow: hidden; }
.portal-table-heading { padding: 20px 24px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.portal-table-heading strong { font-size: 13px; }
.portal-table-heading span { color: var(--muted); font-size: 11px; }
.portal-people-row { min-height: 76px; padding: 12px 24px; display: grid; grid-template-columns: minmax(260px, 1fr) minmax(130px, 0.35fr) 90px; align-items: center; gap: 18px; border-top: 1px solid var(--line); font-size: 12px; }
.portal-people-row-head { min-height: 42px; border-top: 0; background: var(--cream); color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.portal-person { display: flex; align-items: center; gap: 12px; }
.portal-person > i { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--navy-soft); color: var(--navy); font-size: 10px; font-style: normal; font-weight: 700; }
.portal-person > span { display: grid; }
.portal-person strong { font-size: 12px; }
.portal-person small { color: var(--muted); font-size: 10px; }
.portal-active-pill { padding: 5px 9px; border-radius: 999px; background: var(--success-bg); color: var(--success); font-size: 9px; }
.portal-data-boundary { margin: 0; padding: 17px 24px; border-top: 1px solid var(--line); background: #fff8e8; color: var(--muted); font-size: 11px; }

.portal-dialog { width: min(94vw, 620px); padding: 0; border: 0; border-radius: 10px; box-shadow: 0 20px 70px rgba(23, 60, 49, 0.28); }
.portal-dialog::backdrop { background: rgba(23, 60, 49, 0.68); }
.portal-dialog-close { position: absolute; top: 13px; right: 13px; }
.portal-dialog-close button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--cream); color: var(--ink); cursor: pointer; font-size: 24px; }
.portal-invite-form { padding: 38px; }
.portal-invite-form > p:not(.eyebrow) { color: var(--muted); font-size: 13px; }
.portal-invite-form > label { display: block; margin: 18px 0 7px; font-size: 11px; font-weight: 700; }
.portal-invite-form > input,
.portal-invite-form > select { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--line-dark); border-radius: 6px; background: var(--white); }
.portal-form-help { margin: 10px 0 0; font-size: 10px !important; }
.portal-dialog-actions { margin-top: 25px; display: flex; justify-content: flex-end; gap: 10px; }
.portal-dialog-actions > button:first-child { min-height: 46px; padding: 0 15px; border: 1px solid var(--line-dark); border-radius: 6px; background: var(--white); cursor: pointer; font-weight: 700; }
.portal-form-message { min-height: 18px; margin: 13px 0 0; color: var(--danger) !important; font-size: 11px !important; }
.portal-invitation-result { margin-top: 18px; padding: 18px; display: grid; grid-template-columns: 1fr auto; gap: 8px; border: 1px solid #c7d8c9; border-radius: 7px; background: var(--success-bg); }
.portal-invitation-result strong,
.portal-invitation-result p { grid-column: 1 / -1; }
.portal-invitation-result p { margin: 0; color: #46624a !important; font-size: 10px !important; }
.portal-invitation-result input { min-width: 0; min-height: 40px; padding: 0 9px; border: 1px solid #adc3b0; background: var(--white); font-size: 10px; }
.portal-invitation-result button { padding: 0 13px; border: 0; border-radius: 5px; background: var(--success); color: var(--white); cursor: pointer; font-size: 10px; font-weight: 700; }

.portal-roadmap-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.portal-roadmap-card { min-height: 255px; padding: 24px; display: flex; align-items: flex-start; flex-direction: column; border: 1px solid var(--line); border-radius: 9px; background: var(--white); }
.portal-roadmap-card > span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }
.portal-roadmap-card p { color: var(--muted); font-size: 12px; }
.portal-roadmap-card b { margin-top: auto; padding: 5px 8px; border-radius: 4px; background: #eee; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.portal-roadmap-card.is-ready { border-top: 4px solid var(--gold); }
.portal-roadmap-card.is-ready b { background: var(--success-bg); color: var(--success); }

.portal-loading { min-height: 100dvh; padding: 30px; display: grid; place-items: center; align-content: center; background: var(--navy); color: var(--white); text-align: center; }
.portal-loading > span { width: 48px; height: 48px; margin-bottom: 28px; border: 3px solid rgba(255, 255, 255, 0.22); border-top-color: var(--gold); border-radius: 50%; animation: spin 800ms linear infinite; }
.portal-loading .eyebrow { color: var(--gold); }
.portal-loading h1 { margin: 10px 0 0; font-family: var(--serif); font-size: 42px; font-weight: 400; }

.portal-signed-out { background: var(--cream); }
.portal-signin-hero { min-height: calc(100dvh - 220px); padding: clamp(60px, 8vw, 120px) max(24px, calc((100% - 1400px) / 2)); display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr); align-items: center; gap: clamp(50px, 7vw, 120px); overflow: hidden; }
.portal-signin-copy h1 { font-size: clamp(54px, 6vw, 88px); }
.portal-signin-copy > p:not(.eyebrow) { max-width: 620px; color: var(--muted); font-size: 17px; }
.portal-signin-actions { margin-top: 30px; display: flex; align-items: center; gap: 22px; }
.portal-signin-actions > a:last-child { font-size: 12px; font-weight: 700; }
.portal-preview-link { margin-top: 23px; display: inline-block; color: var(--grove); font-size: 11px; font-weight: 700; }

.portal-signin-visual { position: relative; min-height: 480px; }
.portal-orbit { position: absolute; top: 50%; left: 50%; border: 1px solid var(--line-dark); border-radius: 50%; transform: translate(-50%, -50%); }
.portal-orbit-one { width: 330px; height: 330px; }
.portal-orbit-two { width: 480px; height: 480px; }
.portal-visual-core { position: absolute; top: 50%; left: 50%; width: 175px; height: 175px; padding: 25px; display: grid; place-items: center; align-content: center; border-radius: 50%; background: var(--navy); color: var(--white); box-shadow: 0 20px 50px rgba(23, 60, 49, 0.22); transform: translate(-50%, -50%); text-align: center; }
.portal-visual-core span { color: var(--gold); font-family: var(--serif); font-size: 43px; }
.portal-visual-core strong { font-size: 10px; }
.portal-visual-card { position: absolute; min-width: 190px; padding: 16px; display: flex; justify-content: space-between; border: 1px solid var(--line); border-radius: 8px; background: var(--white); box-shadow: 0 10px 30px rgba(23, 60, 49, 0.11); font-size: 11px; font-weight: 700; }
.portal-visual-card b { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; background: var(--success-bg); color: var(--success); }
.portal-visual-cert { top: 8%; left: 4%; }
.portal-visual-org { top: 37%; right: -2%; }
.portal-visual-people { bottom: 8%; left: 8%; }

.portal-signin-modules { padding: 25px max(24px, calc((100% - 1400px) / 2)); display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--navy); color: var(--white); }
.portal-signin-modules > div { padding: 12px 30px; display: grid; border-left: 1px solid rgba(255, 255, 255, 0.18); }
.portal-signin-modules > div:first-child { border-left: 0; }
.portal-signin-modules span { color: var(--gold); font-size: 9px; }
.portal-signin-modules strong { margin-top: 5px; font-size: 13px; }
.portal-signin-modules small { margin-top: 3px; color: rgba(255, 255, 255, 0.65); font-size: 10px; }

.portal-invitation-page { min-height: 100dvh; background: var(--cream); }
.portal-no-membership-actions { margin-top: 24px; display: flex; align-items: center; justify-content: center; gap: 20px; }
.portal-no-membership-actions > a:last-child { font-size: 12px; font-weight: 700; }
.portal-no-membership .portal-data-boundary { margin-top: 28px; }
.portal-invitation-card { width: min(92vw, 680px); margin: clamp(60px, 10vw, 140px) auto; padding: clamp(30px, 6vw, 64px); border: 1px solid var(--line-dark); border-top: 5px solid var(--gold); border-radius: 9px; background: var(--white); box-shadow: var(--shadow-strong); text-align: center; }
.portal-invitation-card h1 { font-size: clamp(38px, 5vw, 58px); }
.portal-invitation-card > p:not(.eyebrow) { color: var(--muted); }
.portal-invitation-success { width: 54px; height: 54px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 50%; background: var(--success); color: var(--white); font-size: 24px; }

@media (max-width: 1050px) {
  .portal-layout { grid-template-columns: 78px minmax(0, 1fr); }
  .portal-sidebar { padding-inline: 12px; }
  .portal-sidebar nav a { justify-content: center; padding: 0; }
  .portal-sidebar nav a span,
  .portal-sidebar-help { display: none; }
  .portal-actions-grid,
  .portal-roadmap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-overview-grid { grid-template-columns: 1fr; }
  .portal-signin-hero { grid-template-columns: 1fr; }
  .portal-signin-visual { min-height: 410px; }
}

@media (max-width: 720px) {
  .portal-header { min-height: 72px; padding: 14px 17px; gap: 14px; }
  .portal-brand { padding-right: 14px; }
  .portal-brand img { width: 120px; }
  .portal-header-title strong { font-size: 15px; }
  .portal-account > span:not(.portal-preview-pill) { display: none; }
  .portal-back-link { display: none; }
  .portal-layout { display: block; }
  .portal-sidebar { position: sticky; z-index: 10; top: 0; min-height: 0; padding: 7px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .portal-sidebar nav { display: flex; overflow-x: auto; }
  .portal-sidebar nav a { min-width: 46px; flex: 0 0 auto; }
  .portal-sidebar nav a span { display: none; }
  .portal-workspace-toolbar { padding: 9px 17px; }
  .portal-workspace-toolbar > a { display: none; }
  .portal-organization-picker { width: 100%; }
  .portal-organization-picker label { display: none; }
  .portal-organization-picker select { min-width: 0; flex: 1; }
  #portal-content { padding: 32px 17px 50px; }
  .portal-welcome { align-items: flex-start; flex-direction: column; }
  .portal-trust-card { width: 100%; }
  .portal-preview-banner { align-items: flex-start; flex-direction: column; }
  .portal-preview-banner a { margin-left: 0; }
  .portal-metrics,
  .portal-actions-grid,
  .portal-certificate-grid,
  .portal-two-column,
  .portal-roadmap-grid { grid-template-columns: 1fr; }
  .portal-metric { min-height: 120px; }
  .portal-actions-grid > a { min-height: 140px; }
  .portal-page-heading-split { align-items: flex-start; flex-direction: column; }
  .portal-certificate-card { min-height: 350px; }
  .portal-preview-note { align-items: flex-start; flex-direction: column; }
  .portal-preview-note a { margin-left: 0; }
  .portal-profile-card { align-items: flex-start; }
  .portal-people-row { grid-template-columns: minmax(0, 1fr) auto; }
  .portal-people-row > span:nth-child(2) { display: none; }
  .portal-invite-form { padding: 32px 20px; }
  .portal-signin-hero { min-height: 0; padding: 60px 20px; }
  .portal-signin-copy h1 { font-size: 52px; }
  .portal-signin-actions { align-items: flex-start; flex-direction: column; }
  .portal-signin-visual { display: none; }
  .portal-signin-modules { grid-template-columns: 1fr; padding: 16px 20px; }
  .portal-signin-modules > div { padding: 16px 0; border-top: 1px solid rgba(255, 255, 255, 0.18); border-left: 0; }
  .portal-signin-modules > div:first-child { border-top: 0; }
}

#tc-authorized-view-slot .authorized-record-intro { padding-top: 28px; padding-bottom: 28px; }
.authorized-record-intro h2 { font-size: clamp(28px, 3vw, 40px); }
.certificate-record-list { display: grid; gap: 20px; }
.certificate-record-item { min-width: 0; }
.certificate-record-list > .certificate-record-item + .certificate-record-item { border-top: 1px solid var(--line-dark); padding-top: 20px; }
.certificate-nested-records { margin-top: 20px; }
.certificate-group-label { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
.certificate-structured-facts { margin: 0; }
.certificate-structured-data .definition-list dd { overflow-wrap: anywhere; }

.certificate-structured-facts > div:last-child:nth-child(odd), .authorized-details > div:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* Staff organisation preview is separate from the normal certificate shell. */
body:has(.preview-banner) { padding-top: 7rem; }
.preview-banner { position: fixed; top: 0; inset-inline: 0; z-index: 100; background: #173d40; color: white; padding: 1rem 1.5rem; display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; box-shadow: 0 2px 8px #0003; }
.preview-banner strong, .preview-banner span { flex: 1 1 20rem; }
.preview-banner button, .preview-chooser button { padding: .7rem 1rem; border-radius: .35rem; cursor: pointer; }
.preview-chooser { max-width: 48rem; margin: 3rem auto; padding: 2rem; background: var(--surface, #fff); }
.preview-chooser label { display: grid; gap: .5rem; margin-block: 1rem; }
.preview-chooser select, .preview-chooser input { width: 100%; min-height: 3rem; padding: .5rem; }
.preview-chooser a { display: block; margin-top: 1.2rem; }
@media (max-width: 600px) { body:has(.preview-banner) { padding-top: 12rem; } .preview-chooser { margin: 0; padding: 1.2rem; } }

.preview-chooser { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); color: var(--navy); }
.preview-chooser h1 { font-family: var(--serif); font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.15; font-weight: 400; margin-block: 1rem 1.5rem; }
.preview-chooser p { color: var(--muted); }
.preview-chooser .eyebrow { color: var(--grove); }
.preview-chooser label { font-weight: 500; margin-bottom: .5rem; }
.preview-chooser select, .preview-chooser input { border: 1px solid var(--line-dark); border-radius: 6px; color: var(--navy); background: var(--white); }
.preview-chooser button { margin-top: .8rem; border: 1px solid var(--line-dark); background: var(--paper); color: var(--navy); }
.preview-chooser .preview-start { background: var(--grove); border-color: var(--grove); color: white; font-weight: 500; padding-inline: 1.5rem; }
.preview-chooser button:disabled { opacity: .5; cursor: default; }
.preview-chooser [hidden] { display: none !important; }
.preview-chooser :focus-visible, .preview-banner :focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.preview-banner button { background: var(--white); color: var(--grove); border: 1px solid var(--line); }
