html {
  font-size: 14px;
  min-height: 100%;
  position: relative;
}

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

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

body {
  background: #f6f7f4;
  color: #1f2a28;
  margin-bottom: 60px;
}

.navbar-brand {
  font-weight: 700;
}

.search-header {
  align-items: end;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  padding: 2rem 0 1.5rem;
}

.page-heading {
  align-items: end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 2rem 0 1.5rem;
}

.page-heading h1 {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0;
}

.page-heading p {
  color: #4c5956;
  margin: 0.35rem 0 0;
  max-width: 760px;
}

.eyebrow {
  color: #52645f;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.search-header h1 {
  font-size: 3.6rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0;
}

.lead {
  color: #4c5956;
  max-width: 780px;
}

.action-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

.status-banner {
  background: #e8f4ef;
  border: 1px solid #c5ddd2;
  border-radius: 8px;
  color: #173b31;
  font-weight: 700;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
}

.primary-action,
.secondary-action,
.review-form button {
  align-items: center;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  padding: 0.65rem 1rem;
  text-decoration: none;
}

.primary-action {
  background: #153f38;
  color: #ffffff;
}

.primary-action:hover {
  color: #ffffff;
}

.secondary-action,
.review-form button {
  background: #e6ece9;
  color: #1f2a28;
}

.secondary-action:hover {
  color: #1f2a28;
}

.summary-grid,
.panel,
.candidate,
.form-panel,
.table-panel,
.photo-card {
  background: #ffffff;
  border: 1px solid #dce2df;
  border-radius: 8px;
}

.summary-grid {
  display: grid;
  gap: 1px;
  overflow: hidden;
}

.summary-grid div {
  padding: 1rem;
}

.summary-grid span {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
}

.summary-grid small,
.panel-title span,
.reference-item small,
.candidate-heading p,
.score small {
  color: #65736f;
}

.panel-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 2rem;
}

.panel {
  padding: 1.2rem;
}

.panel-title {
  align-items: baseline;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.panel h2,
.section-heading h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
}

.reference-list {
  display: grid;
  gap: 0.8rem;
}

.reference-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  margin-bottom: 1rem;
}

.reference-card {
  background: #f8faf9;
  border: 1px solid #e2e9e6;
  border-radius: 8px;
  overflow: hidden;
}

.reference-card-image,
.reference-card-placeholder {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}

.reference-card-placeholder {
  align-items: center;
  background: #e9efe8;
  color: #52645f;
  display: grid;
  font-weight: 800;
}

.reference-card div {
  display: grid;
  gap: 0.2rem;
  padding: 0.6rem 0.75rem 0.8rem;
}

.reference-item {
  align-items: center;
  display: flex;
  gap: 0.8rem;
}

.reference-thumb {
  align-items: center;
  aspect-ratio: 1;
  background: #e9efe8;
  border-radius: 8px;
  color: #2f5147;
  display: grid;
  font-weight: 800;
  width: 48px;
}

.reference-image {
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  width: 48px;
}

.next-steps {
  color: #33413d;
  margin-bottom: 0;
}

.form-panel {
  margin-bottom: 1.2rem;
  padding: 1.2rem;
}

.stack-form {
  display: grid;
  gap: 1rem;
  max-width: 760px;
}

.compact-form {
  margin-top: 1rem;
  max-width: none;
}

.inline-edit-form {
  align-items: end;
  border-top: 1px solid #e5ebe8;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto;
  padding: 0.9rem 0;
}

.profile-edit-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-edit-form .check-row,
.profile-edit-form button {
  align-self: center;
}

.full-width {
  grid-column: 1 / -1;
}

.inline-meta {
  color: #52645f;
  font-weight: 700;
}

.stack-form label {
  color: #33413d;
  display: grid;
  font-weight: 800;
  gap: 0.35rem;
}

.check-row {
  align-items: center;
  display: flex !important;
  gap: 0.5rem !important;
}

.two-column-form {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.photo-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.photo-card {
  overflow: hidden;
}

.photo-card img,
.photo-placeholder {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}

.photo-placeholder {
  align-items: center;
  background: #e9efe8;
  color: #52645f;
  display: grid;
  font-weight: 800;
  justify-content: center;
}

.photo-card div {
  padding: 1rem;
}

.photo-card h2 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 0.2rem;
}

.photo-card p {
  color: #65736f;
  margin: 0;
}

.table-panel {
  overflow-x: auto;
}

.table-panel table {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
}

.table-panel th,
.table-panel td {
  border-bottom: 1px solid #e5ebe8;
  padding: 0.8rem 1rem;
  text-align: left;
  vertical-align: top;
}

.table-panel th {
  color: #52645f;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.section-heading {
  align-items: end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-heading p {
  color: #52645f;
  margin: 0;
  max-width: 580px;
}

.candidate-list {
  display: grid;
  gap: 1rem;
}

.candidate {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  overflow: hidden;
}

.candidate img {
  height: 100%;
  min-height: 180px;
  object-fit: cover;
  width: 100%;
}

.candidate-body {
  padding: 1rem;
}

.candidate-heading {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.candidate h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0 0 0.25rem;
}

.candidate h2 {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0 0 0.25rem;
}

.review-candidate {
  grid-template-columns: 260px minmax(0, 1fr);
}

.review-form {
  align-items: center;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: minmax(180px, 1fr) repeat(3, auto) auto;
}

.review-form a {
  font-weight: 800;
  text-align: center;
}

.review-note {
  background: #f6f7f4;
  border-left: 4px solid #153f38;
  padding: 0.7rem;
}

.score {
  background: #153f38;
  border-radius: 8px;
  color: white;
  min-width: 82px;
  padding: 0.6rem;
  text-align: center;
}

.score span {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
}

.score small {
  color: #c8d8d4;
}

.score-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.score-breakdown span {
  background: #edf2ef;
  border-radius: 999px;
  color: #354844;
  font-size: 0.85rem;
  padding: 0.35rem 0.7rem;
}

.candidate-actions {
  display: flex;
  gap: 1rem;
}

.candidate-actions form {
  margin: 0;
}

.source-link {
  background: none;
  border: 0;
  color: #195b82;
  cursor: pointer;
  font-weight: 700;
  padding: 0;
}

@media (max-width: 800px) {
  .search-header,
  .page-heading,
  .panel-grid,
  .candidate,
  .review-candidate,
  .two-column-form,
  .inline-edit-form,
  .review-form {
    grid-template-columns: 1fr;
  }

  .page-heading,
  .section-heading,
  .candidate-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .search-header h1 {
    font-size: 2.4rem;
  }
}
