:root {
  --bg: #f8f7f3;
  --surface: #ffffff;
  --surface-soft: #f1eee7;
  --surface-muted: #ece8df;
  --border: #ded8cc;
  --border-strong: #c7bcad;
  --primary: #2f5d46;
  --primary-dark: #244936;
  --primary-soft: #e7f1eb;
  --text: #2c241f;
  --text-muted: #817568;
  --warning-bg: #f8ebe3;
  --warning-border: #e7b595;
  --warning-text: #8a4a23;
  --danger: #b33a2f;
  --success: #25834c;
  --success-bg: #ecfbf1;
  --review-bg: #fff6d7;
  --shadow: 0 2px 8px rgba(44, 36, 31, 0.1);
  --app-width: 1024px;
  --landing-width: 672px;
  --narrow-width: 576px;
  --medium-width: 768px;
  --about-width: 672px;
  --selected-width: 208px;
}

html.dark {
  --bg: #1d1815;
  --surface: #28211d;
  --surface-soft: #342b25;
  --surface-muted: #3b312a;
  --border: #463b33;
  --border-strong: #5b4d42;
  --primary: #72b68b;
  --primary-dark: #8fcaa2;
  --primary-soft: #20382b;
  --text: #f0ebe4;
  --text-muted: #b6a99b;
  --warning-bg: #38291f;
  --warning-border: #7e5432;
  --warning-text: #f0b06b;
  --danger: #f06f63;
  --success: #75c991;
  --success-bg: #173423;
  --review-bg: #3b321b;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: url("assets/images/background-image.avif");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body:not(.about-page) {
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-nav {
  display: grid;
  grid-template-columns: minmax(24px, 1fr) minmax(0, var(--app-width)) minmax(24px, 1fr);
  align-items: center;
  width: 100%;
  height: 58px;
  padding: 0;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
}

.brand {
  grid-column: 2;
  grid-row: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  object-fit: cover;
}

.nav-links {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-links a,
.about-link,
.back-link,
.resource-section a {
  color: var(--text-muted);
  text-decoration: none;
}

.nav-links a:hover,
.about-link:hover,
.back-link:hover,
.resource-section a:hover {
  color: var(--primary);
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.theme-toggle .sun-icon,
html.dark .theme-toggle .moon-icon {
  display: none;
}

html.dark .theme-toggle .sun-icon {
  display: block;
}

.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm {
  width: 0.875rem;
  height: 0.875rem;
}

.icon-md {
  width: 1rem;
  height: 1rem;
}

.icon-lg {
  width: 1.25rem;
  height: 1.25rem;
}

.icon-xl {
  width: 1.75rem;
  height: 1.75rem;
}

.with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.landing {
  flex: 1;
  width: min(calc(100% - 48px), var(--landing-width));
  margin: 0 auto;
  padding: 40px 0 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 32px;
}

.hero-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 1.25rem;
}

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

h1 {
  margin-bottom: 0;
  color: var(--primary);
  font-size: 2.25rem;
  line-height: 1.1;
  font-weight: 700;
}

.page-header h1,
.results-heading h1 {
  margin-bottom: 4px;
  font-size: 1.5rem;
  line-height: 1.25;
}

.subtitle {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.notice-card,
.agreement-card,
.card,
.info-card,
.table-card,
.summary-card,
.selected-panel,
.recommendation-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.notice-card {
  width: 100%;
  padding: 20px;
  text-align: left;
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.notice-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--warning-text);
  font-size: 1.05rem;
}

.notice-card p:last-child {
  margin-bottom: 0;
}

.agreement-card {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  text-align: left;
  color: var(--text);
}

.agreement-card input {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  accent-color: var(--primary);
  flex: 0 0 auto;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border-radius: 7px;
  padding: 0 24px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.primary-action {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
}

.primary-action:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.secondary-action {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.secondary-action:hover {
  background: var(--surface-soft);
}

html.dark .secondary-action:hover {
  background: var(--surface-muted);
}

.primary-action:disabled,
.secondary-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.landing .primary-action {
  width: min(100%, 320px);
  min-height: 48px;
  margin-top: -4px;
}

.compact-action {
  min-height: 40px;
  padding: 0 16px;
  white-space: nowrap;
  font-size: 0.95rem;
}

#expandBtn {
  width: 172px;
}

footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 18px 24px;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.8);
}

footer p {
  margin-bottom: 0;
}

.progress-bar {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  height: 86px;
  min-height: 0;
  padding: 12px 24px 10px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--border);
}

.step {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 82px;
}

.step-circle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-muted);
  border: 2px solid transparent;
  font-weight: 700;
}

.step.active .step-circle {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.step.completed .step-circle {
  background: var(--primary);
  color: #fff;
}

.step-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.step.active .step-label,
.step.completed .step-label {
  color: var(--primary);
}

.step-line {
  width: 96px;
  height: 2px;
  margin-top: 19px;
  background: var(--border);
}

.step-line.completed {
  background: var(--primary);
}

.workflow-main {
  width: min(calc(100% - 48px), var(--narrow-width));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.narrow-main {
  width: min(calc(100% - 48px), var(--narrow-width));
}

.wide-main {
  width: min(calc(100% - 48px), var(--app-width));
}

.page-header {
  margin-bottom: 24px;
}

.form-card {
  padding: 24px;
  display: grid;
  gap: 20px;
}

.site-info-page .form-card {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.site-info-page .form-card fieldset {
  grid-column: 1 / -1;
}

.form-group {
  display: grid;
  gap: 10px;
  border: 0;
  margin: 0;
  padding: 0;
}

.form-group label,
.form-group legend {
  font-weight: 700;
  color: var(--text);
}

.hint {
  color: var(--text-muted);
  font-weight: 500;
}

select,
.search-bar input,
.concentration-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0 15px;
  background: var(--surface);
  color: var(--text);
}

select:focus,
.search-bar input:focus,
.concentration-input:focus {
  outline: 3px solid rgba(47, 93, 70, 0.16);
  border-color: var(--primary);
}

.radio-group {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}

.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  cursor: pointer;
}

.radio-label input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-bottom: 16px;
}

.search-bar {
  position: relative;
}

.search-bar span {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  font-size: 0;
}

.search-bar span::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 1px;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.search-bar span::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 16px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
}

.search-bar input {
  padding-left: 58px;
}

.contaminants-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--selected-width);
  gap: 16px;
  align-items: start;
}

.contaminant-list {
  display: grid;
  gap: 12px;
}

.contaminant-category {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.category-header {
  display: grid;
  grid-template-columns: 20px minmax(0, auto) auto 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 0;
  padding: 0 20px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.category-header:hover {
  background: #fbfaf8;
}

html.dark .category-header:hover,
html.dark .contaminant-item:hover {
  background: #2f2822;
}

.chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  opacity: 0.86;
}

.category-title {
  font-size: 0.875rem;
  font-weight: 600;
}

.category-total {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.category-count {
  grid-column: 4;
  justify-self: end;
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(47, 93, 70, 0.08);
  font-size: 0.75rem;
  font-weight: 600;
}

.category-count:empty {
  display: none;
}

.select-all-btn {
  grid-column: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  background: var(--surface);
  font-weight: 500;
  font-size: 0.75rem;
}

.select-all-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.category-items {
  display: none;
  border-top: 1px solid var(--border);
}

.category-items.is-expanded {
  display: block;
}

.contaminant-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.contaminant-item:last-child {
  border-bottom: 0;
}

.contaminant-item:hover {
  background: #fbfaf8;
}

.contaminant-item.is-selected {
  background: rgba(47, 93, 70, 0.05);
}

.contaminant-item input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.contaminant-copy {
  display: grid;
  gap: 3px;
}

.contaminant-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.contaminant-description {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.cas {
  color: var(--text-muted);
  font-size: 0.625rem;
  font-style: italic;
}

.selected-panel {
  position: sticky;
  top: 20px;
  overflow: hidden;
}

.selected-panel.is-collapsible {
  cursor: pointer;
}

.selected-panel.is-collapsed #selectedList {
  display: none;
}

.selected-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.selected-header button {
  min-height: 26px;
  border: 1px solid #e5534b;
  border-radius: 7px;
  padding: 0 10px;
  background: #f65b55;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(179, 58, 47, 0.22);
  text-transform: none;
}

.selected-header button:hover {
  background: #e94f48;
  border-color: #d9463f;
}

.selected-header strong {
  color: var(--primary);
  font-weight: 600;
}

#selectedList {
  display: grid;
  padding: 0;
}

.selected-group {
  display: grid;
}

.selected-group + .selected-group {
  border-top: 1px solid var(--border);
}

.selected-group-title {
  padding: 8px 12px 6px;
  color: var(--text-muted);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
}

.no-selection,
.loading-message,
.empty-state {
  color: var(--text-muted);
}

.no-selection {
  padding: 24px 16px;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.5;
}

.selected-tag {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}

.selected-tag:last-child {
  border-bottom: 0;
}

.selected-tag strong,
.selected-tag small {
  display: block;
}

.selected-tag strong {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
}

.selected-tag small {
  color: var(--text-muted);
  font-size: 0.625rem;
}

.selected-tag button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
}

.selected-tag button:hover {
  color: var(--danger);
}

.lab-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.info-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--text-muted);
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 700;
  flex: 0 0 auto;
}

.table-card {
  overflow: hidden;
}

.table-card .loading-message,
.table-card .empty-state {
  margin: 0;
  padding: 14px 20px;
}

.table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.table-card-header h2 {
  margin-bottom: 0;
  font-size: 0.875rem;
}

.table-card-header p,
.table-card-header span {
  margin-bottom: 0;
  color: var(--text-muted);
}

.page-title-with-icon,
.card-heading-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.page-title-with-icon .icon {
  color: var(--primary);
}

.card-heading-with-icon .icon {
  color: var(--primary);
}

.table-card-header-split {
  align-items: flex-start;
}

.lab-table-head,
.lab-row,
.results-table-head,
.result-row {
  display: grid;
  align-items: center;
}

.lab-table-head,
.lab-row {
  grid-template-columns: minmax(220px, 1fr) 112px 112px;
}

.lab-table-head,
.results-table-head {
  min-height: 52px;
  padding: 0 20px;
  color: var(--text-muted);
  background: #fbfaf8;
  border-bottom: 1px solid var(--border);
  font-size: 0.6875rem;
  font-weight: 700;
}

.lab-table-head {
  text-transform: uppercase;
}

.lab-group-title,
.result-group-title {
  padding: 8px 20px;
  color: var(--text-muted);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lab-row {
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.lab-row:last-child {
  border-bottom: 0;
}

.lab-substance {
  display: grid;
}

.lab-substance strong {
  font-size: 0.875rem;
  font-weight: 500;
}

.lab-substance span {
  color: var(--text-muted);
  font-size: 0.6875rem;
}

.lab-row .concentration-input,
.lab-row .unit-select {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.875rem;
}

.results-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.results-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 28px;
}

.summary-card {
  padding: 24px 26px;
}

.summary-card h2 {
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.summary-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.summary-card dl div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
}

.summary-card dt {
  color: var(--text-muted);
}

.summary-card dd {
  margin: 0;
  font-weight: 700;
}

.summary-note {
  margin: 18px 0 0;
  padding: 12px 14px;
  background: #f7f5f1;
  color: var(--text-muted);
  border-radius: 6px;
}

.compact-notice {
  margin-bottom: 28px;
}

.compact-notice h2 {
  display: inline-flex;
  margin-bottom: 0;
  margin-right: 6px;
  color: var(--text);
}

.compact-notice p {
  display: inline;
  margin-bottom: 0;
}

.results-table-head,
.result-row {
  grid-template-columns: minmax(260px, 1.6fr) minmax(110px, 0.7fr) minmax(110px, 0.7fr) minmax(110px, 0.7fr) minmax(80px, 0.5fr) minmax(120px, 0.7fr);
}

.result-row {
  min-height: 84px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
}

.result-row:last-child {
  border-bottom: 0;
}

.result-substance {
  display: grid;
}

.result-substance span,
.result-substance small {
  color: var(--text-muted);
}

.sensitivity,
.result-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 0.85rem;
  font-weight: 700;
}

.sensitivity.high {
  background: #ffe8e4;
  color: var(--danger);
}

.sensitivity.medium,
.result-pill.review {
  background: var(--review-bg);
  color: #9a6a00;
}

.sensitivity.low,
.result-pill.below {
  background: var(--success-bg);
  color: var(--success);
}

.sensitivity.special,
.result-pill.neutral {
  background: var(--surface-soft);
  color: var(--text-muted);
}

.result-pill.exceeds {
  background: #ffe8e4;
  color: var(--danger);
}

.result-row.below {
  background: rgba(236, 251, 241, 0.4);
}

.result-row.exceeds {
  background: rgba(255, 232, 228, 0.45);
}

.recommendation-card {
  margin-top: 28px;
  padding: 28px 32px;
}

.recommendation-card h2 {
  margin-bottom: 12px;
}

.recommendation-card p:last-child {
  margin-bottom: 0;
}

.recommendation-card.below {
  border-color: #9be1b4;
  background: var(--success-bg);
}

html.dark .summary-note {
  background: var(--surface-soft);
}

html.dark .lab-table-head,
html.dark .results-table-head {
  background: var(--surface-soft);
}

html.dark .lab-group-title,
html.dark .result-group-title {
  background: var(--surface-muted);
}

.recommendation-card.below h2 {
  color: var(--success);
}

.recommendation-card.exceeds {
  border-color: #f0a29b;
  background: #fff0ee;
}

.recommendation-card.exceeds h2 {
  color: var(--danger);
}

.recommendation-card.review {
  border-color: #f0d378;
  background: #fffaf0;
}

.recommendation-card.review h2 {
  color: #9a6a00;
}

.about-main {
  width: min(calc(100% - 48px), var(--about-width));
  padding: 40px 0 48px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--text);
  font-size: 0.875rem;
}

.info-card {
  margin-bottom: 16px;
  padding: 20px;
}

.info-card h2,
.limitation-card h2 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.info-card p,
.limitation-card li {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.limitation-card {
  margin-top: 16px;
}

.limitation-card ul {
  margin: 0;
  padding-left: 24px;
}

.resource-section {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.resource-section h2 {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.resource-section a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
}

@media (max-width: 900px) {
  .site-nav {
    padding: 0 20px;
  }

  .progress-bar {
    gap: 8px;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .step {
    min-width: 82px;
  }

  .step-line {
    width: 42px;
  }

  .workflow-main {
    padding: 36px 20px 56px;
  }

  .site-info-page .form-card {
    grid-template-columns: 1fr;
  }

  .search-row,
  .contaminants-layout,
  .summary-grid,
  .results-heading {
    grid-template-columns: 1fr;
  }

  #expandBtn {
    width: 100%;
  }

  .results-heading {
    display: grid;
  }

  .selected-panel {
    position: static;
  }

  .lab-table,
  .results-table {
    overflow-x: auto;
  }

  .lab-table-head,
  .lab-row {
    min-width: 680px;
  }

  .results-table-head {
    display: none;
  }

  .result-row {
    grid-template-columns: 1fr;
    gap: 10px;
    min-width: 0;
    align-items: stretch;
  }

  .result-row > div:not(.result-substance) {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding-top: 8px;
    border-top: 1px solid rgba(222, 216, 204, 0.7);
  }

  .result-row > div:not(.result-substance)::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-weight: 700;
  }

  .summary-card dl div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (max-width: 560px) {
  .landing {
    padding-top: 64px;
  }

  .brand span {
    display: none;
  }

  .form-card,
  .info-card,
  .notice-card,
  .agreement-card,
  .recommendation-card {
    padding: 22px;
  }

  .category-header {
    grid-template-columns: 24px minmax(0, 1fr) auto;
  }

  .category-total,
  .category-count {
    display: none;
  }

  .select-all-btn {
    grid-column: 2 / 4;
    justify-self: start;
  }

  .nav-buttons,
  .results-actions,
  .compact-notice,
  .lab-header {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .site-info-page .nav-buttons {
    flex-direction: row;
    align-items: center;
  }

  .site-info-page .nav-buttons .primary-action,
  .site-info-page .nav-buttons .secondary-action {
    flex: 1 1 0;
    width: auto;
    padding-right: 12px;
    padding-left: 12px;
  }
}

@media (max-width: 560px) {
  .about-main {
    width: 100%;
    padding: 24px 16px 40px;
  }

  .about-main .back-link {
    min-height: 36px;
    margin-bottom: 18px;
    font-size: 0.9375rem;
  }

  .about-main .page-header {
    margin-bottom: 22px;
  }

  .about-main .page-header h1 {
    margin-bottom: 8px;
    font-size: 2rem;
    line-height: 1.1;
  }

  .about-main .subtitle {
    font-size: 1rem;
    line-height: 1.6;
  }

  .about-main .info-card,
  .about-main .notice-card {
    padding: 18px;
  }

  .about-main .info-card {
    margin-bottom: 14px;
  }

  .about-main .card-heading-with-icon,
  .about-main .limitation-card h2 {
    align-items: flex-start;
    gap: 10px;
    line-height: 1.35;
  }

  .about-main .card-heading-with-icon .icon,
  .about-main .limitation-card h2 .icon {
    margin-top: 2px;
  }

  .about-main .info-card h2,
  .about-main .limitation-card h2 {
    margin-bottom: 10px;
    font-size: 1.05rem;
  }

  .about-main .info-card p,
  .about-main .limitation-card li {
    font-size: 0.9375rem;
    line-height: 1.6;
  }

  .about-main .info-card p {
    margin-bottom: 12px;
  }

  .about-main .info-card p:last-child {
    margin-bottom: 0;
  }

  .about-main .limitation-card {
    margin-top: 14px;
  }

  .about-main .limitation-card ul {
    padding-left: 20px;
  }

  .about-main .limitation-card li + li {
    margin-top: 4px;
  }

  .about-main .resource-section {
    margin-top: 22px;
    padding-top: 18px;
  }

  .about-main .resource-section a {
    align-items: flex-start;
    font-size: 0.9375rem;
    line-height: 1.45;
  }

  .about-main .resource-section a .icon {
    margin-top: 3px;
  }
}

@media (max-width: 360px) {
  .about-main {
    padding-right: 14px;
    padding-left: 14px;
  }

  .about-main .page-header h1 {
    font-size: 1.875rem;
  }

  .about-main .info-card,
  .about-main .notice-card {
    padding: 16px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .no-print,
  footer {
    display: none !important;
  }

  .workflow-main {
    width: 100%;
    padding: 0;
  }

  .summary-card,
  .table-card,
  .notice-card,
  .recommendation-card {
    box-shadow: none;
    break-inside: avoid;
  }
}
