/* SAF Downloads: Print-Ready Document Styles */
:root {
  --ink: #111827;
  --muted: #6b7280;
  --accent: #0078d4;
  --rule: #e5e7eb;
  --bg-light: #f9fafb;
  --badge-disc: #0078d4;
  --badge-jargon: #7c3aed;
  --badge-consens: #059669;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 11pt;
  color: var(--ink);
  background: #fff;
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 40px 60px;
  line-height: 1.6;
}

/* ── Document Header ── */
.doc-header {
  border-bottom: 3px solid var(--accent);
  padding-bottom: 16px;
  margin-bottom: 28px;
}
.doc-header .program-label {
  font-size: 9pt;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 4px;
}
.doc-header h1 {
  font-size: 18pt;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}
.doc-header .module-tag {
  display: inline-block;
  margin-top: 8px;
  font-size: 9pt;
  font-weight: 600;
  color: var(--accent);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 2px 10px;
}

/* ── Print button ── */
.print-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
}
.print-bar .btn {
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 10pt;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--rule) !important;
  color: var(--muted);
}

/* ── Sections ── */
h2 {
  font-size: 13pt;
  font-weight: 700;
  color: var(--ink);
  margin-top: 32px;
  margin-bottom: 10px;
  padding-bottom: 4px;
  border-bottom: 1.5px solid var(--rule);
}
h3 {
  font-size: 11pt;
  font-weight: 700;
  color: var(--ink);
  margin-top: 20px;
  margin-bottom: 6px;
}
p { margin-bottom: 10px; }
ul, ol { padding-left: 20px; margin-bottom: 10px; }
li { margin-bottom: 4px; }

/* ── Purpose box ── */
.purpose-box {
  background: #eff6ff;
  border-left: 4px solid var(--accent);
  padding: 12px 16px;
  margin-bottom: 24px;
  border-radius: 0 6px 6px 0;
  font-size: 10.5pt;
}

/* ── Checklist ── */
.checklist { list-style: none; padding: 0; }
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 10.5pt;
}
.checklist li:last-child { border-bottom: none; }
.check-box {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 1.5px solid #9ca3af;
  border-radius: 3px;
  margin-top: 2px;
}

/* ── Table ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 20px;
  font-size: 10pt;
}
th {
  background: var(--bg-light);
  text-align: left;
  padding: 8px 10px;
  font-weight: 600;
  border: 1px solid var(--rule);
}
td {
  padding: 8px 10px;
  border: 1px solid var(--rule);
  vertical-align: top;
}
tr:nth-child(even) td { background: var(--bg-light); }

/* ── Fill-in fields ── */
.fill-field {
  border: none;
  border-bottom: 1.5px solid #9ca3af;
  width: 100%;
  padding: 4px 0;
  font-family: inherit;
  font-size: 10.5pt;
  background: transparent;
  color: var(--ink);
  margin-bottom: 14px;
}
.field-label {
  font-size: 9pt;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 2px;
}
.field-row { margin-bottom: 16px; }
.field-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.write-space {
  border: 1.5px solid var(--rule);
  border-radius: 6px;
  min-height: 80px;
  padding: 10px;
  margin: 8px 0 16px;
  background: var(--bg-light);
}

/* ── Cards ── */
.card {
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.card h4 { margin-bottom: 6px; font-size: 10.5pt; }

/* Architecture comparisons */
.architecture-figure {
  margin: 12px 0 8px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.architecture-figure img {
  display: block;
  width: 100%;
  height: auto;
}
.architecture-figure figcaption {
  padding: 8px 10px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  background: var(--bg-light);
  font-size: 9pt;
}
.architecture-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}
.architecture-grid h5 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 10pt;
}
.diagram-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}
.diagram-actions a {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  background: #eff6ff;
  color: #005a9e;
  font-size: 9pt;
  font-weight: 600;
  text-decoration: none;
}

/* ── Score row ── */
.score-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.score-chip {
  border: 1.5px solid var(--rule);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 9.5pt;
  cursor: pointer;
}

/* ── Footer ── */
.doc-footer {
  margin-top: 48px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: 9pt;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

/* ── Print ── */
@media print {
  .print-bar { display: none; }
  .diagram-actions { display: none; }
  body { padding: 0; max-width: 100%; }
  h2 { page-break-after: avoid; }
  .card { page-break-inside: avoid; }
}

@media (max-width: 600px) {
  body { padding: 24px 20px 48px; }
  table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
  }
  .doc-footer { display: block; }
  .doc-footer span { display: block; margin-top: 4px; }
  .architecture-grid { grid-template-columns: 1fr; }
}
