* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--av-paper);
  color: var(--av-ink);
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--av-petrol); }
button, input, textarea, select { font: inherit; }
button, summary, select { cursor: pointer; }
input, textarea, select { accent-color: var(--av-petrol); }
input:not([type=checkbox]):not([type=radio]), textarea, select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin-top: 6px;
  padding: 9px 12px;
  border: 1px solid var(--av-platinum);
  border-radius: 6px;
  background: var(--av-white);
  color: var(--av-ink);
  font-weight: 400;
}
input[readonly] { background: var(--av-paper); }
textarea { resize: vertical; }
label { display: block; color: var(--av-petrol); font-weight: 600; }
.check { display: flex; align-items: flex-start; gap: 10px; min-height: 32px; }
.check input { flex: 0 0 auto; width: 16px; height: 16px; margin: 4px 0 0; }
.optional { margin-left: 3px; color: var(--av-muted); font-size: 12px; font-weight: 400; }
.portal-wrap { width: min(1184px, calc(100% - 64px)); margin-inline: auto; }
.portal-main { flex: 1; padding-block: clamp(28px, 5vw, 62px) 70px; }
.portal-narrow { max-width: 490px; }
.portal-medium { max-width: 720px; }
.portal-heading { margin-bottom: 26px; }
.portal-heading h1, .portal-intro h1 {
  margin: 0;
  color: var(--av-petrol);
  font-size: clamp(29px, 5.3vw, 44px);
  line-height: 1.09;
  overflow-wrap: anywhere;
}
.portal-heading p, .portal-intro p { margin: 12px 0 0; max-width: 68ch; color: var(--av-muted); }
h2, h3, p { margin: 0; }
h2, h3 { color: var(--av-petrol); line-height: 1.3; overflow-wrap: anywhere; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
.portal-panel {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--av-line);
  border-radius: 16px;
  background: var(--av-white);
  min-width: 0;
}
.portal-intro {
  padding: clamp(25px, 6vw, 64px);
  border-radius: 16px;
  background: var(--av-petrol);
  color: var(--av-white);
}
.portal-intro h1, .portal-intro p, .portal-intro .light-link { color: var(--av-white); }
.portal-intro .actions { margin-top: 24px; }
.portal-intro .av-button:not(.av-button-secondary) { background: var(--av-white); color: var(--av-petrol); }
.portal-intro .av-button-secondary { background: transparent; color: var(--av-white); border-color: var(--av-platinum); }
.portal-intro .av-button:hover { background: var(--av-ice); color: var(--av-deep); }
.directory { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.directory a {
  display: flex;
  flex-direction: column;
  gap: 7px;
  border: 1px solid var(--av-line);
  border-radius: 16px;
  background: var(--av-white);
  padding: 19px 20px;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.directory a:hover { border-color: var(--av-petrol); }
.directory strong { font-size: 17px; }
.directory span { color: var(--av-muted); font-size: 14px; }
.stack { display: flex; flex-direction: column; gap: 15px; min-width: 0; }
.stack > .av-button { align-self: flex-start; }
.actions, .row-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.row-heading { justify-content: space-between; }
.row-heading > div { min-width: 0; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-hint, .section-note { color: var(--av-muted); font-size: 14px; }
.section-note { margin-block: 7px 15px; }
.notice { padding: 13px 16px; border: 1px solid var(--av-line); border-radius: 6px; background: var(--av-ice); color: var(--av-petrol); margin-bottom: 16px; }
.stack .notice { margin: 0; }
.notice-error { border-color: #E9C5BE; background: #FAE9E6; color: #9B2C22; }
.notice-success { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok); }
.footer-actions { margin-top: 20px; }
.text-button { color: var(--av-petrol); border: 0; background: transparent; text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; }
.staff-bar { background: var(--av-deep); color: var(--av-white); }
.staff-bar .portal-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 22px; padding-block: 10px; }
.staff-bar a, .staff-bar button { color: var(--av-white); }
.staff-bar form { margin-left: auto; }
.portal-footer { border-top: 1px solid var(--av-line); color: var(--av-muted); font-size: 14px; }
.portal-footer .portal-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 25px; padding-block: 20px; }
.portal-footer span { margin-right: auto; }
.steps {
  padding: 0;
  margin: 0 0 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--av-line);
  border-radius: 16px;
  background: var(--av-white);
  list-style: none;
  overflow: hidden;
}
.steps li { padding: 12px; text-align: center; color: var(--av-muted); border-right: 1px solid var(--av-line); font-size: 14px; }
.steps li:last-child { border-right: none; }
.steps [aria-current=step] { background: var(--av-petrol); color: var(--av-white); font-weight: 600; }
.steps span { margin-left: 4px; }
.checkout-layout, .detail-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(270px, 1fr); gap: 22px; align-items: start; }
.order-summary { position: sticky; top: 104px; min-width: 0; padding: 24px; border-radius: 16px; background: var(--av-deep); color: var(--av-white); }
.order-summary h2 { color: var(--av-white); margin-bottom: 14px; }
.order-summary .field-hint { color: var(--av-ice); margin-top: 12px; }
.summary-line, .receipt-totals div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #52727a; font-variant-numeric: tabular-nums; }
.summary-line span { overflow-wrap: anywhere; }
.summary-line strong, .receipt-totals dd { white-space: nowrap; }
.receipt-totals { margin: 10px 0 0; }
.receipt-totals dd { margin: 0; }
.receipt-totals .total { font-size: 18px; font-weight: 600; }
.checkout-actions { margin-top: 16px; }
.mobile-estimate { display: none; }
.tests-picker { border-top: 1px solid var(--av-line); padding-top: 10px; }
.tests-picker summary { color: var(--av-petrol); font-weight: 600; padding-block: 5px; }
.tests-picker[open] > div { margin-top: 9px; }
.test-choice span:last-child { margin-left: auto; white-space: nowrap; }
.test-choice input:disabled + span { color: var(--av-muted); }
.expedite { align-self: end; padding-bottom: 6px; }
.review-list { margin-bottom: 0; padding-left: 20px; }
.review-list li { margin-block: 10px; padding-left: 4px; }
.reference { font-family: "IBM Plex Mono", monospace; font-variant-numeric: tabular-nums; }
.break { overflow-wrap: anywhere; }
.status-label { display: inline-block; width: fit-content; background: var(--av-ice); color: var(--av-deep); padding: 4px 9px; border-radius: 4px; font-size: 13px; font-weight: 600; white-space: normal; }
.multiline { white-space: pre-line; overflow-wrap: anywhere; }
.records { overflow-x: auto; }
.records table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
.records th, .records td { padding: 12px 10px; border-bottom: 1px solid var(--av-line); vertical-align: top; }
.records th { color: var(--av-petrol); font-size: 13px; }
.records tr:last-child td { border-bottom: 0; }
.records a { overflow-wrap: anywhere; }
small { display: block; color: var(--av-muted); font-size: 13px; margin-top: 2px; }
.record { border-top: 1px solid var(--av-line); padding-top: 12px; margin-top: 12px; overflow-wrap: anywhere; }
.record p { margin-top: 4px; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { border-top: 1px solid var(--av-line); padding: 10px 0; margin-top: 8px; overflow-wrap: anywhere; }
.timeline time { color: var(--av-muted); font-size: 13px; }
.empty p { margin: 9px 0 0; max-width: 65ch; color: var(--av-muted); }
.empty a { display: inline-block; margin-top: 10px; }
.filter-bar, .search-panel { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; }
.filter-bar { margin: 16px 0; }
.filter-bar label { flex: 1 1 165px; }
.search-panel { align-items: stretch; flex-direction: column; }
.brand-search-help { margin-top: 5px; }
.brand-search-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.brand-suggestions { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--av-line); border-radius: 6px; }
.brand-suggestions p { margin: 0 0 4px; }
.brand-suggestions ul { list-style: none; padding: 0; margin: 0; }
.brand-suggestions button {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--av-petrol);
  text-align: left;
  overflow-wrap: anywhere;
}
.brand-suggestions button:hover, .brand-suggestions button:focus-visible { background: var(--av-ice); }
.results { margin-top: 23px; }
.results .empty { margin-top: 12px; }
.metrics { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--av-line); background: var(--av-white); border-radius: 16px; }
.metrics a { flex: 1 1 130px; display: flex; flex-direction: column; padding: 14px; text-decoration: none; }
.metrics a:hover { background: var(--av-ice); }
.metrics span { color: var(--av-muted); font-size: 13px; }
.metrics strong { font-size: 25px; line-height: 1.2; }
.facts { margin: 10px 0 0; }
.facts div { display: flex; gap: 14px; justify-content: space-between; border-top: 1px solid var(--av-line); padding: 9px 0; }
.facts dt { color: var(--av-muted); }
.facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.qr { width: 144px; height: 144px; display: block; }
@media (max-width: 760px) {
  .portal-wrap { width: calc(100% - 36px); }
  .checkout-layout, .detail-layout { grid-template-columns: minmax(0, 1fr); }
  .order-summary { position: static; }
  .mobile-estimate { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; margin: -10px 0 15px; border-bottom: 1px solid var(--av-line); color: var(--av-petrol); font-variant-numeric: tabular-nums; }
  .directory { grid-template-columns: minmax(0, 1fr); }
  .steps li { padding: 8px 4px; font-size: 12px; }
  .steps span { display: block; margin-left: 0; }
}
@media (max-width: 620px) {
  .mobile-records table, .mobile-records tbody, .mobile-records tr { display: block; }
  .mobile-records thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .mobile-records tr + tr { border-top: 1px solid var(--av-line); margin-top: 12px; padding-top: 12px; }
  .mobile-records td {
    display: grid;
    grid-template-columns: minmax(80px, 30%) minmax(0, 1fr);
    gap: 10px;
    padding: 5px 0;
    border: 0;
    overflow-wrap: anywhere;
  }
  .mobile-records td::before { content: attr(data-label); color: var(--av-muted); font-size: 13px; }
}
@media (max-width: 540px) {
  .field-grid { grid-template-columns: minmax(0, 1fr); }
  .filter-bar label:first-child { flex-basis: 100%; }
}
@media (max-width: 420px) {
  .portal-wrap { width: calc(100% - 28px); }
}
@media print {
  .av-header, .staff-bar, .portal-footer, button { display: none !important; }
  .portal-wrap { width: 100%; }
  .portal-panel { break-inside: avoid; }
}
