html {
  font-size: 14px;
}

.saved-field-map { display: block; width: 100%; max-width: 50rem; height: 24rem; border: 1px solid var(--bs-border-color); }

.dashboard-link-card { transition: border-color 120ms ease, box-shadow 120ms ease; }
.dashboard-link-card:hover { border-color: var(--bs-primary); box-shadow: 0 .25rem .75rem rgb(0 0 0 / 12%); }
.dashboard-link-card:has(.stretched-link:focus-visible) { outline: 3px solid #258cfb; outline-offset: 2px; }
.dashboard-hero { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin: 1.5rem 0 1.25rem; }
.dashboard-hero h1 { margin: .15rem 0 .35rem; font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -.045em; }
.dashboard-hero p { max-width: 42rem; margin: 0; color: var(--bs-secondary-color); }
.dashboard-primary-actions, .dashboard-latest-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.dashboard-primary-actions { align-items: end; flex-direction: column; }
.dashboard-safety-note { display: flex; flex-wrap: wrap; gap: .35rem .75rem; margin-bottom: 1.5rem; padding: .8rem 1rem; color: var(--bs-secondary-color); background: var(--bs-tertiary-bg); border-left: .25rem solid var(--bs-primary); border-radius: .35rem; font-size: .9rem; }
.dashboard-safety-note strong { color: var(--bs-body-color); }
.dashboard-latest, .dashboard-panel { background: linear-gradient(145deg, color-mix(in srgb, var(--bs-body-bg) 96%, var(--bs-primary) 4%), var(--bs-body-bg)); border: 1px solid var(--bs-border-color); border-radius: 1rem; box-shadow: 0 .5rem 1.5rem rgb(0 0 0 / 6%); }
.dashboard-latest { margin-bottom: 1.25rem; padding: clamp(1.25rem, 3vw, 2rem); }
.dashboard-section-heading, .dashboard-panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.dashboard-section-heading { margin-bottom: 1.5rem; }
.dashboard-section-heading h2, .dashboard-panel-heading h2 { margin: .15rem 0 .2rem; }
.dashboard-eye-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.dashboard-eye-card { min-width: 0; padding: 1rem; background: var(--bs-tertiary-bg); border-radius: .8rem; }
.dashboard-eye-card__heading { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; margin-bottom: .75rem; }
.dashboard-eye-card__heading h3 { margin: 0; font-size: 1.1rem; }
.dashboard-eye-card__heading strong { color: var(--bs-primary); font-size: 1.35rem; white-space: nowrap; }
.dashboard-eye-card__heading small { color: var(--bs-secondary-color); font-size: .72rem; font-weight: 500; }
.dashboard-eye-card .saved-field-map { max-width: none; height: 16rem; border-radius: .55rem; }
.dashboard-eye-card > p { margin: .65rem 0 0; color: var(--bs-secondary-color); font-size: .8rem; }
.dashboard-eye-empty { display: grid; height: 16rem; place-items: center; color: var(--bs-secondary-color); border: 1px dashed var(--bs-border-color); border-radius: .55rem; }
.dashboard-reference-note { margin: 1rem 0 0; padding: .7rem .85rem; background: color-mix(in srgb, var(--bs-primary) 8%, transparent); border-radius: .5rem; font-size: .9rem; }
.dashboard-secondary-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(18rem, .75fr); gap: 1.25rem; }
.dashboard-panel { padding: 1.4rem; }
.comparison-level { align-self: start; padding: .35rem .65rem; border-radius: 50rem; font-size: .78rem; font-weight: 750; }
.comparison-level--high { color: #075b37; background: #d1f4e0; }
.comparison-level--moderate { color: #775500; background: #fff0bd; }
.comparison-level--low { color: #842029; background: #f8d7da; }
[data-bs-theme="dark"] .comparison-level--high { color: #a7f3d0; background: #064e3b; }
[data-bs-theme="dark"] .comparison-level--moderate { color: #fde68a; background: #713f12; }
[data-bs-theme="dark"] .comparison-level--low { color: #fecaca; background: #7f1d1d; }
.dashboard-comparison-score { display: grid; grid-template-columns: 1fr auto; gap: .15rem .75rem; margin: 1rem 0; padding: .8rem 1rem; background: var(--bs-tertiary-bg); border-radius: .65rem; }
.dashboard-comparison-score strong { color: var(--bs-primary); font-size: 1.25rem; }
.dashboard-comparison-score small { grid-column: 1 / -1; color: var(--bs-secondary-color); }
.dashboard-eye-changes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.dashboard-eye-changes > div { display: grid; padding: .75rem; background: var(--bs-tertiary-bg); border-radius: .6rem; }
.dashboard-eye-changes span, .dashboard-eye-changes small { color: var(--bs-secondary-color); font-size: .78rem; }
.dashboard-change-withheld { padding: .8rem 1rem; background: color-mix(in srgb, var(--bs-warning) 14%, var(--bs-body-bg)); border-radius: .65rem; }
.dashboard-total { color: var(--bs-primary); font-size: 2rem; line-height: 1; }
.dashboard-recent-list { display: grid; gap: .5rem; padding: 0; list-style: none; }
.dashboard-recent-list a { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem .75rem; color: var(--bs-body-color); background: var(--bs-tertiary-bg); border-radius: .5rem; text-decoration: none; }
.dashboard-recent-list a:hover { color: var(--bs-primary); }
.dashboard-recent-list small { color: var(--bs-secondary-color); }
.dashboard-empty-state { margin-top: 2rem; }
.test-intro-header { align-items: center; }
.test-intro-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(18rem, .75fr); gap: 1.25rem; }
.test-intro-card { padding: clamp(1.25rem, 3vw, 2rem); background: linear-gradient(145deg, color-mix(in srgb, var(--bs-body-bg) 96%, var(--bs-primary) 4%), var(--bs-body-bg)); border: 1px solid var(--bs-border-color); border-radius: 1rem; box-shadow: 0 .5rem 1.5rem rgb(0 0 0 / 6%); }
.test-intro-card h2 { margin: .25rem 0 1.25rem; }
.test-intro-steps { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.test-intro-steps li { display: grid; grid-template-columns: 2.5rem 1fr; gap: .85rem; align-items: start; }
.test-intro-steps li > span { display: grid; width: 2.35rem; height: 2.35rem; place-items: center; color: white; background: var(--bs-primary); border-radius: 50%; font-weight: 750; }
.test-intro-steps strong { display: block; margin-bottom: .15rem; }
.test-intro-steps p { margin: 0; color: var(--bs-secondary-color); }
.test-intro-checks { display: grid; gap: .75rem; margin: 1.25rem 0; padding-left: 1.2rem; }
.test-intro-start { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; margin-top: 1.25rem; padding: 1.25rem 1.5rem; background: color-mix(in srgb, var(--bs-primary) 9%, var(--bs-body-bg)); border: 1px solid color-mix(in srgb, var(--bs-primary) 30%, var(--bs-border-color)); border-radius: 1rem; }
.test-intro-start div { display: grid; }
.test-intro-start span { color: var(--bs-secondary-color); }
.legal-page { max-width: 52rem; margin-inline: auto; }
.legal-page section { margin-top: 1.75rem; }
.legal-page h2 { font-size: 1.25rem; }

.tests-page-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  margin: 1.5rem 0 2rem;
}

.tests-page-header h1 { margin: .15rem 0 .35rem; font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -.045em; }
.tests-eyebrow { color: var(--bs-primary); font-size: .78rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.test-history-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.test-history-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 32rem);
  gap: 1.5rem;
  padding: 1.4rem;
  overflow: hidden;
  background: linear-gradient(145deg, color-mix(in srgb, var(--bs-body-bg) 96%, var(--bs-primary) 4%), var(--bs-body-bg));
  border: 1px solid var(--bs-border-color);
  border-radius: 1rem;
  box-shadow: 0 .5rem 1.5rem rgb(0 0 0 / 7%);
}
.test-history-details { display: flex; min-width: 0; flex-direction: column; gap: 1.15rem; }
.test-history-card__top { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.test-history-date { display: grid; gap: .2rem; text-align: right; font-size: .85rem; }
.test-history-date span, .test-history-id span { color: var(--bs-secondary-color); }
.test-history-id { display: grid; gap: .35rem; padding: .75rem; background: var(--bs-tertiary-bg); border-radius: .65rem; font-size: .8rem; }
.test-history-id code { overflow: hidden; color: var(--bs-body-color); text-overflow: ellipsis; white-space: nowrap; }
.test-history-actions { display: flex; gap: .65rem; margin-top: auto; }
.test-history-actions .btn { flex: 1; }
.test-history-thumbnails { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; align-items: stretch; }
.test-history-thumbnails figure { display: flex; min-width: 0; margin: 0; flex-direction: column; }
.test-history-thumbnails figcaption { margin-bottom: .4rem; color: var(--bs-secondary-color); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.test-history-thumbnails .saved-field-map { height: 9rem; border-radius: .65rem; }
.test-thumbnail-empty { display: grid; height: 9rem; place-items: center; color: var(--bs-secondary-color); background: var(--bs-tertiary-bg); border: 1px dashed var(--bs-border-color); border-radius: .65rem; }
.test-eye-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; align-items: start; }
.test-eye-grid section { min-width: 0; }
.test-eye-grid .saved-field-map { max-width: none; }
.comparison-selection-bar { position: sticky; z-index: 5; top: .75rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; padding: .85rem 1rem; background: color-mix(in srgb, var(--bs-body-bg) 92%, var(--bs-primary) 8%); border: 1px solid var(--bs-border-color); border-radius: .8rem; box-shadow: 0 .4rem 1.2rem rgb(0 0 0 / 8%); }
.comparison-selection-bar div { display: grid; }
.comparison-selection-bar span { color: var(--bs-secondary-color); font-size: .85rem; }
.comparison-check { display: inline-flex; align-items: center; gap: .45rem; margin-right: .65rem; color: var(--bs-body-color); font-size: .85rem; font-weight: 650; cursor: pointer; }
.comparison-tests { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.comparison-tests > div { display: grid; gap: .3rem; padding: 1rem; background: var(--bs-tertiary-bg); border-radius: .75rem; }
.comparison-tests span { color: var(--bs-secondary-color); font-size: .8rem; font-weight: 700; text-transform: uppercase; }
.comparison-tests code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comparison-trend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.comparison-trend > div { display: grid; gap: .2rem; padding: .8rem 1rem; background: var(--bs-tertiary-bg); border-radius: .65rem; }
.comparison-trend span { color: var(--bs-secondary-color); font-size: .82rem; }
.comparison-trend strong { font-size: 1.35rem; }
.comparison-eyes > section { padding: 1.25rem; border: 1px solid var(--bs-border-color); border-radius: 1rem; }
.comparison-score-row { display: flex; align-items: center; gap: .85rem; margin-bottom: 1rem; }
.comparison-score { display: flex; width: 4.5rem; height: 4.5rem; flex: 0 0 auto; align-items: baseline; justify-content: center; padding-top: 1rem; color: white; background: var(--bs-primary); border-radius: 50%; }
.comparison-score strong { font-size: 1.45rem; }
.comparison-score span { font-size: .7rem; }
.comparison-map { display: block; width: 100%; height: 24rem; border: 1px solid var(--bs-border-color); border-radius: .65rem; }
.comparison-legend { display: flex; flex-wrap: wrap; gap: .8rem; margin: .75rem 0; font-size: .82rem; }
.comparison-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.comparison-legend i { width: .8rem; height: .8rem; border-radius: 50%; }
.comparison-legend .persistent { background: #facc15; }
.comparison-legend .added { background: #f472b6; }
.comparison-legend .removed { background: #22d3ee; }
.comparison-breakdown { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.comparison-breakdown div { display: flex; justify-content: space-between; gap: .5rem; padding: .5rem .65rem; background: var(--bs-tertiary-bg); border-radius: .4rem; }
.comparison-breakdown dd { margin: 0; font-weight: 750; }
.comparison-unavailable { padding: 2rem; color: var(--bs-secondary-color); text-align: center; background: var(--bs-tertiary-bg); border-radius: .65rem; }
.score-guide-intro, .score-guide-section { margin-bottom: 1.25rem; padding: 1.25rem; border: 1px solid var(--bs-border-color); border-radius: .9rem; background: var(--bs-body-bg); }
.score-guide-intro h2, .score-guide-section h2 { font-size: 1.35rem; }
.score-weight-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin: 1rem 0; }
.score-weight-grid article { padding: 1rem; background: var(--bs-tertiary-bg); border-radius: .65rem; }
.score-weight-grid strong { color: var(--bs-primary); font-size: 1.6rem; }
.score-weight-grid h3 { margin: .25rem 0; font-size: 1rem; }
.score-weight-grid p { margin: 0; color: var(--bs-secondary-color); font-size: .9rem; }
.tests-pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin: 2rem 0; }
.tests-empty-state { max-width: 42rem; margin: 3rem auto; padding: 3rem 1.5rem; text-align: center; background: var(--bs-tertiary-bg); border: 1px dashed var(--bs-border-color); border-radius: 1rem; }
.tests-empty-icon, .delete-test-icon { display: grid; width: 3.5rem; height: 3.5rem; margin: 0 auto 1rem; place-items: center; color: var(--bs-primary); background: color-mix(in srgb, var(--bs-primary) 12%, transparent); border-radius: 50%; font-size: 2rem; font-weight: 800; }
.delete-test-card { max-width: 42rem; margin: 3rem auto; padding: clamp(1.5rem, 5vw, 3rem); border: 1px solid var(--bs-border-color); border-radius: 1rem; box-shadow: 0 .75rem 2rem rgb(0 0 0 / 8%); }
.delete-test-icon { margin-left: 0; color: var(--bs-danger); background: color-mix(in srgb, var(--bs-danger) 12%, transparent); }
.delete-test-summary { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .5rem 1rem; margin: 1.5rem 0; padding: 1rem; background: var(--bs-tertiary-bg); border-radius: .65rem; }
.delete-test-summary dd { margin: 0; overflow-wrap: anywhere; }

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

@media (max-width: 575.98px) {
  .dashboard-hero, .dashboard-section-heading, .dashboard-panel-heading { align-items: stretch; flex-direction: column; }
  .dashboard-primary-actions { align-items: stretch; }
  .dashboard-primary-actions .btn, .dashboard-latest-actions .btn { flex: 1; }
  .dashboard-eye-grid, .dashboard-secondary-grid, .dashboard-eye-changes { grid-template-columns: 1fr; }
  .test-intro-grid { grid-template-columns: 1fr; }
  .test-intro-start { align-items: stretch; flex-direction: column; }
  .tests-page-header { align-items: stretch; flex-direction: column; }
  .tests-page-header .btn { width: 100%; }
  .test-history-card { grid-template-columns: 1fr; }
  .test-history-card__top { flex-direction: column; }
  .test-history-date { text-align: left; }
  .test-history-actions { flex-direction: column; }
  .delete-test-summary { grid-template-columns: 1fr; }
  .delete-test-summary dt:not(:first-child) { margin-top: .5rem; }
  .test-eye-grid { grid-template-columns: 1fr; }
  .comparison-selection-bar { position: static; align-items: stretch; flex-direction: column; }
  .comparison-tests { grid-template-columns: 1fr; }
  .comparison-trend { grid-template-columns: 1fr; }
  .score-weight-grid { grid-template-columns: 1fr; }
}

@media (min-width: 576px) and (max-width: 991.98px) {
  .dashboard-secondary-grid { grid-template-columns: 1fr; }
  .test-history-card { grid-template-columns: 1fr; }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem var(--bs-body-bg), 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  transition: background-color 120ms ease, color 120ms ease;
}

a, button, input, select, textarea {
  transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

#theme-toggle {
  min-width: 6.5rem;
}

@media (prefers-reduced-motion: reduce) {
  body, a, button, input, select, textarea, .dashboard-link-card {
    transition: none;
  }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}
