* {
  box-sizing: border-box;
  margin: 0px;
  padding: 0px;
  font-family: sans-serif;
}
:root {
  --bg-color: #f0f0f0;
}
body {
  background-color: var(--bg-color);
}
#primary-section-wrapper {
  border: 1px solid black;
  border-radius: 5px;
  background-color: white;
  display: grid;
  max-width: 720px;
  margin: auto;
  padding: 0.8rem;
  place-content: center;
  justify-items: center;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  margin-top: 20px;
  margin-bottom: 20px;
  gap: 10px;
}

.title {
  grid-column: 1 / span 4;
  width: 100%;
  margin-bottom: 10px;
  h1 {
    text-align: start;
    text-wrap: pretty;
  }
}

.spacer {
  width: 100%;
}
.result {
  border: 2px solid black;
  border-radius: 7px;
  height: 3rem;
  width: 3rem;
  display: grid;
  place-content: center;
  filter: drop-shadow(1px 2px 4px rgba(0, 0, 0, 0.25));
}
.result:hover {
  cursor: pointer;
}
.side-label {
  display: grid;
  place-content: center;
}
#key {
  background-color: var(--bg-color);
  grid-column: 1 / span 4;
  justify-self: stretch;
  padding-left: 10px;
  padding-top: 15px;
  h4 {
    padding-block: 5px;
  }
}
.key-symbol {
  height: 25px;
  width: 30px;
}

#keyAsterisk {
  height: 18px;
  width: 18px;
  filter: brightness(0) opacity(0.4);
}
.key-group {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-left: 10px;
}
.DNT {
  color: rgba(128, 128, 128, 0.524);
  font-style: italic;
}
.DNT:after {
  content: " *";
}
.DNT-box {
  border: 1px solid rgba(128, 128, 128, 0.524);
  filter: none;
}
.DNT-box:hover {
  cursor: pointer;
}

.img-sizer {
  height: 2rem;
  width: 2rem;
}

.test-label {
  text-align: center;
}

.criteria-text {
  padding-left: 3.5rem;
  font-size: 0.8rem;
  display: grid;
  grid-template-columns: 10% 1fr;
  gap: 15px;
  span {
    font-weight: bold;
    padding-right: 5px;
  }
}

.key-wrapper {
  background-color: white;
  width: 96%;
  padding: 0.5rem;
  border-radius: 9px;
}

.fade-in {
  animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* State color classes */
.good {
  background-color: #2a8c2a;
}

.mild {
  background-color: #d4a800;
}

.severe {
  background-color: #c02020;
}

/* White marks on dark backgrounds; black marks on amber */
.good img,
.severe img {
  filter: brightness(0) invert(1);
}

.mild img {
  filter: brightness(0);
}

footer {
  font-size: 8px;
  text-align: center;
  padding-bottom: 16px;
  color: #999;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #ccc;
}

.app-header h2 {
  font-size: 1rem;
  font-weight: 600;
}

a.icon-btn {
  text-decoration: none;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: white;
  color: #555;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: #e8e8e8;
  color: #111;
}

/* Help modal */
#help-modal {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  position: fixed;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  margin: 0;
}
#help-modal::backdrop {
  background: rgba(0, 0, 0, 0.4);
}
#help-modal-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
#help-modal-content h2 {
  font-size: 1.2rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.5rem;
}
#help-modal-content h3 {
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}
#help-modal-content p,
#help-modal-content li {
  font-size: 0.875rem;
  line-height: 1.5;
}
#help-modal-content ol {
  padding-left: 1.2rem;
}
#help-close-btn {
  align-self: flex-end;
  padding: 0.4rem 1rem;
  border: 1px solid #555;
  border-radius: 5px;
  background: white;
  cursor: pointer;
}
#help-close-btn:hover {
  background: #e8e8e8;
}

@media print {
  .app-header {
    display: none;
  }
}
