.prescription-guidance {
  margin: 32px 0;
  padding: 26px;
  background: linear-gradient(120deg, #f5fbf8, #edf6fb);
  border: 1px solid #d7e9e3;
  border-radius: 20px;
}

.prescription-guidance-intro {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
}

.prescription-guidance-intro p:not(.eyebrow) {
  max-width: 680px;
  margin: 4px 0;
  color: #668078;
}

.prescription-guidance-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #08775f;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 22px #17372e12;
}

.prescription-guidance-icon svg,
.prescription-privacy svg,
.prescription-disclaimer svg {
  width: 21px;
  height: 21px;
}

.prescription-scan-form {
  display: grid;
  grid-template-columns: minmax(180px, .65fr) minmax(260px, 1.35fr) auto;
  gap: 14px;
  align-items: end;
  margin: 22px 0 12px;
}

.prescription-scan-form > * {
  min-width: 0;
}

.prescription-scan-form button svg {
  width: 20px;
  height: 20px;
  margin-right: 8px;
}

.prescription-storage-consent {
  grid-column: 1 / -1;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #cfe4dc;
  border-radius: 12px;
  font-size: .82rem;
}

.prescription-file-control input {
  padding: 8px;
}

.prescription-file-control small {
  color: #668078;
  font-weight: 400;
}

.prescription-privacy,
.prescription-disclaimer {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: #668078;
  font-size: .82rem;
}

.prescription-privacy svg,
.prescription-disclaimer svg {
  flex: none;
  color: #08775f;
}

.prescription-guidance-summary {
  padding-top: 22px;
  margin-top: 18px;
  border-top: 1px solid #d7e9e3;
}

.prescription-guidance-summary > h3 {
  color: #32584c;
  font-size: 1rem;
}

.prescription-tests {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 15px 0;
}

.prescription-tests span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 7px 10px;
  color: #28584b;
  font-size: .82rem;
  font-weight: 700;
  background: #fff;
  border: 1px solid #cfe4dc;
  border-radius: 999px;
}

.prescription-tests svg {
  width: 15px;
  height: 15px;
}

.prescription-recommendation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.prescription-recommendation-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px;
  background: #fff;
  border: 1px solid #dbe8e3;
  border-radius: 15px;
}

.prescription-recommendation-card.best-match {
  border-color: #50a891;
  box-shadow: 0 8px 24px #08775f12;
}

.prescription-recommendation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
}

.prescription-recommendation-card > small {
  color: #078069;
  font-weight: 700;
  letter-spacing: .08em;
}

.prescription-recommendation-card h3 {
  margin-top: 5px;
  font-size: 1rem;
}

.prescription-recommendation-card p,
.prescription-recommendation-card details {
  color: #668078;
  font-size: .82rem;
}

.prescription-recommendation-card details summary {
  color: #8a5a13;
  font-weight: 700;
  cursor: pointer;
}

.prescription-recommendation-card details p {
  margin-bottom: 0;
}

.prescription-recommendation-card .complete-match {
  color: #08775f;
  font-weight: 700;
}

.prescription-recommendation-action {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding-top: 15px;
  margin-top: auto;
}

.prescription-recommendation-action button {
  padding: 9px 12px;
  font-size: .82rem;
}

.prescription-no-match {
  padding: 14px;
  color: #765816;
  background: #fff7e7;
  border-radius: 12px;
}

.prescription-disclaimer {
  margin: 18px 0 0;
}

.prescription-history {
  padding-top: 22px;
  margin-top: 22px;
  border-top: 1px solid #d7e9e3;
}

.prescription-history-head,
.prescription-history-card,
.prescription-history-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.prescription-history-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.prescription-history-head h3 {
  margin: 2px 0 0;
  font-size: 1rem;
}

.prescription-history-list {
  display: grid;
  gap: 10px;
}

.prescription-history-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 14px;
  background: #fff;
  border: 1px solid #dbe8e3;
  border-radius: 14px;
}

.prescription-history-card h3,
.prescription-history-card p {
  margin: 2px 0;
}

.prescription-history-card h3 {
  overflow-wrap: anywhere;
  font-size: .92rem;
}

.prescription-history-card p,
.prescription-history-card small,
.prescription-history-empty,
.prescription-ocr-warning {
  color: #668078;
  font-size: .78rem;
}

.prescription-history-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #08775f;
  background: #eef8f4;
  border-radius: 11px;
}

.prescription-history-icon svg {
  width: 19px;
  height: 19px;
}

.prescription-history-actions button {
  padding: 8px 10px;
  font-size: .76rem;
}

.prescription-history-detail {
  grid-column: 2 / -1;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid #e4eeea;
}

.prescription-history-detail pre {
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #294c43;
  background: #f7faf9;
  border-radius: 10px;
}

@media (max-width: 900px) {
  .prescription-recommendation-grid {
    grid-template-columns: 1fr;
  }

  .prescription-scan-form {
    grid-template-columns: 1fr 1fr;
  }

  .prescription-scan-form button {
    grid-column: 1 / -1;
  }

  .prescription-guidance-intro {
    grid-template-columns: auto 1fr;
  }

  .prescription-guidance-intro .prescription-skip {
    grid-column: 2;
    justify-self: start;
  }

  .prescription-history-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .prescription-history-actions,
  .prescription-history-detail {
    grid-column: 2;
  }
}

@media (max-width: 600px) {
  .prescription-guidance {
    padding: 20px 17px;
  }

  .prescription-guidance-intro,
  .prescription-scan-form {
    grid-template-columns: 1fr;
  }

  .prescription-guidance-intro .prescription-skip {
    grid-column: 1;
  }

  .prescription-guidance-icon {
    width: 42px;
    height: 42px;
  }

  .prescription-recommendation-action {
    flex-direction: column;
    align-items: stretch;
  }

  .prescription-recommendation-action button {
    width: 100%;
  }

  .prescription-history-card {
    grid-template-columns: 1fr;
  }

  .prescription-history-icon,
  .prescription-history-actions,
  .prescription-history-detail {
    grid-column: 1;
  }

  .prescription-history-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
