.cookbook-article-header {
  background:
    linear-gradient(120deg, rgba(255, 189, 84, 0.18), transparent 34%),
    linear-gradient(290deg, rgba(79, 215, 197, 0.2), transparent 48%),
    #14120f;
}

.cookbook-hero-grid {
  display: grid;
  width: min(1080px, 100%);
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 36px;
  align-items: end;
}

.cookbook-title-card {
  border: 1px solid rgba(244, 239, 228, 0.2);
  border-radius: 8px;
  padding: 24px;
  background: rgba(17, 16, 13, 0.62);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.cookbook-title-card h2 {
  margin: 30px 0 8px;
  color: var(--paper-strong);
  font-size: 2.1rem;
}

.cookbook-title-card p {
  color: var(--muted);
  line-height: 1.55;
}

.cookbook-title-card dl {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
}

.cookbook-title-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid rgba(244, 239, 228, 0.14);
  padding-top: 10px;
}

.cookbook-title-card dt {
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.cookbook-title-card dd {
  margin: 0;
  color: var(--paper-strong);
  font-weight: 800;
  text-align: right;
}

.cookbook-title-card .inline-cta {
  width: 100%;
  margin-top: 22px;
  color: #171512;
}

.cookbook-article-shell {
  width: min(920px, 100%);
}

.cookbook-rule-grid section {
  min-height: 204px;
}

.library-audit {
  width: min(1180px, 100%);
  margin: 58px auto 0;
}

.library-audit-shell {
  border: 1px solid rgba(23, 21, 18, 0.16);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 30px);
  background: #fffaf0;
}

.library-audit-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
}

.library-audit-heading h2 {
  margin-bottom: 12px;
}

.library-audit-heading p:not(.eyebrow) {
  max-width: 720px;
  color: #4d4538;
  line-height: 1.64;
}

.audit-actions,
.audit-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.audit-actions {
  justify-content: flex-end;
}

.audit-actions .button {
  border-color: rgba(23, 21, 18, 0.18);
}

.audit-actions .button-secondary {
  border-color: #171512;
  color: #fffaf0;
  background: #171512;
}

.audit-link-row a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(23, 21, 18, 0.16);
  border-radius: 6px;
  padding: 0 12px;
  color: #171512;
  font-size: 0.82rem;
  font-weight: 900;
  background: rgba(79, 215, 197, 0.14);
}

.audit-link-row a:hover,
.audit-link-row a:focus-visible {
  outline: 2px solid rgba(79, 215, 197, 0.44);
}

.audit-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.audit-stats div {
  min-height: 94px;
  border: 1px solid rgba(23, 21, 18, 0.14);
  border-radius: 8px;
  padding: 16px;
  background: rgba(244, 239, 228, 0.78);
}

.audit-stats span,
.audit-market,
.audit-status-control,
.audit-score span {
  color: #6d5d41;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.audit-stats strong {
  display: block;
  margin-top: 10px;
  color: #171512;
  font-size: 2rem;
  line-height: 1;
}

.audit-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.35fr) minmax(160px, 0.35fr);
  gap: 12px;
  margin-top: 20px;
}

.audit-controls label,
.audit-status-control {
  display: grid;
  gap: 7px;
}

.audit-controls input,
.audit-controls select,
.audit-status-control select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(23, 21, 18, 0.18);
  border-radius: 6px;
  padding: 0 12px;
  color: #171512;
  font: inherit;
  font-size: 0.95rem;
  background: #fffdfa;
}

.audit-output {
  min-height: 54px;
  margin-top: 18px;
  border-left: 4px solid var(--coral);
  padding: 14px 16px;
  color: #2f2a23;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
  background: rgba(255, 111, 89, 0.1);
}

.audit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.audit-card {
  display: grid;
  gap: 16px;
  border: 1px solid rgba(23, 21, 18, 0.14);
  border-radius: 8px;
  padding: 18px;
  background: rgba(244, 239, 228, 0.72);
}

.audit-card-flagged {
  border-color: rgba(155, 63, 47, 0.46);
  background: rgba(255, 111, 89, 0.12);
}

.audit-card-audit {
  border-color: rgba(60, 123, 41, 0.35);
}

.audit-card-covered {
  border-color: rgba(79, 215, 197, 0.46);
}

.audit-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.audit-card h3 {
  margin: 8px 0 0;
  color: #171512;
  font-size: 1.18rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.audit-status-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: #171512;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(109, 93, 65, 0.16);
}

.status-flagged {
  background: rgba(255, 111, 89, 0.28);
}

.status-audit {
  background: rgba(183, 255, 82, 0.34);
}

.status-covered {
  background: rgba(79, 215, 197, 0.28);
}

.status-monitor {
  background: rgba(255, 189, 84, 0.26);
}

.audit-score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  gap: 8px 12px;
  align-items: center;
}

.audit-score span {
  grid-column: 1 / -1;
}

.audit-score meter {
  width: 100%;
  height: 12px;
}

.audit-score strong {
  color: #171512;
  font-size: 1.2rem;
  text-align: right;
}

.audit-evidence {
  margin: 0;
  color: #3f392f;
  line-height: 1.58;
}

.audit-signal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.audit-signal-list li {
  border: 1px solid rgba(23, 21, 18, 0.12);
  border-radius: 999px;
  padding: 6px 9px;
  color: #3f392f;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(255, 250, 240, 0.82);
}

@media (max-width: 860px) {
  .cookbook-hero-grid,
  .library-audit-heading,
  .audit-grid,
  .audit-controls {
    grid-template-columns: 1fr;
  }

  .audit-actions {
    justify-content: stretch;
  }

  .audit-actions .button {
    flex: 1 1 170px;
  }

  .audit-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .cookbook-title-card dl div,
  .audit-card-head {
    grid-template-columns: 1fr;
  }

  .cookbook-title-card dl div {
    display: grid;
  }

  .cookbook-title-card dd {
    text-align: left;
  }

  .audit-status-pill {
    width: max-content;
  }

  .library-audit {
    margin-top: 42px;
  }
}

@media (max-width: 420px) {
  .audit-stats {
    grid-template-columns: 1fr;
  }

  .audit-link-row,
  .audit-actions {
    display: grid;
  }

  .audit-link-row a,
  .audit-actions .button {
    width: 100%;
  }
}
