/* Chapter 12: Finding and Evaluating Sources */
.ch12-lead {
  font-size: 1.08rem;
  line-height: 1.75;
}

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

.ch12-card,
.ch12-source-card,
.ch12-tool {
  border: 1px solid rgba(74, 111, 165, 0.28);
  border-radius: 0.65rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.dark-mode .ch12-card,
.dark-mode .ch12-source-card,
.dark-mode .ch12-tool {
  background: rgba(29, 35, 44, 0.96);
  border-color: rgba(163, 189, 226, 0.38);
}

.ch12-card h4,
.ch12-source-card h4,
.ch12-tool h3,
.ch12-tool h4 {
  margin-top: 0;
}

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

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

.ch12-tool label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.ch12-tool input,
.ch12-tool textarea,
.ch12-tool select {
  width: 100%;
  padding: 0.7rem 0.75rem;
  border: 1px solid #b8c0ca;
  border-radius: 0.4rem;
  background: #fff;
  color: #111;
}

.dark-mode .ch12-tool input,
.dark-mode .ch12-tool textarea,
.dark-mode .ch12-tool select {
  background: #202833;
  color: #fff;
  border-color: #627086;
}

.ch12-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.ch12-output,
.ch12-status {
  margin-top: 0.9rem;
  padding: 0.85rem 1rem;
  border-left: 4px solid var(--primary, #4a6fa5);
  border-radius: 0.35rem;
  background: #eef3f9;
}

.dark-mode .ch12-output,
.dark-mode .ch12-status {
  background: #253142;
}

.ch12-output:empty,
.ch12-status:empty {
  display: none;
}

.ch12-route-result strong,
.ch12-search-string {
  display: block;
  margin-bottom: 0.4rem;
}

.ch12-search-string code {
  white-space: normal;
  overflow-wrap: anywhere;
}

.ch12-compare {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.ch12-compare th,
.ch12-compare td {
  border: 1px solid #c9d1db;
  padding: 0.75rem;
  vertical-align: top;
  text-align: left;
}

.ch12-compare th {
  background: #e8eef7;
}

.dark-mode .ch12-compare th {
  background: #2b3a50;
}

.dark-mode .ch12-compare th,
.dark-mode .ch12-compare td {
  border-color: #56657a;
}

.ch12-sift details {
  border: 1px solid #ccd4de;
  border-radius: 0.45rem;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.7rem;
}

.ch12-sift summary {
  cursor: pointer;
  font-weight: 800;
}

.ch12-job-test {
  font-size: 1.08rem;
  padding: 1rem 1.15rem;
  border-left: 5px solid var(--secondary, #ff8c42);
  background: #fff7ef;
}

.dark-mode .ch12-job-test {
  background: #3a3026;
}

.ch12-source-card fieldset {
  border: 0;
  padding: 0;
  margin: 0.8rem 0 0;
}

.ch12-source-card legend {
  font-weight: 800;
  font-size: 1rem;
}

.ch12-source-card label {
  display: block;
  margin: 0.45rem 0;
}

.ch12-decision-feedback {
  margin-top: 0.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.35rem;
  background: #f1f3f5;
}

.dark-mode .ch12-decision-feedback {
  background: #283241;
}

.ch12-checklist li {
  margin-bottom: 0.5rem;
}

.ch12-works li {
  margin-bottom: 0.75rem;
  overflow-wrap: anywhere;
}

.ch12-noscript {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border: 2px solid #8a5a00;
  background: #fff3cd;
  color: #3d2a00;
}

@media (max-width: 768px) {
  .ch12-grid,
  .ch12-form-grid {
    grid-template-columns: 1fr;
  }

  .ch12-form-grid .full-width {
    grid-column: auto;
  }

  .ch12-actions .btn {
    width: 100%;
  }
}

@media print {
  .ch12-actions,
  .ch12-tool button,
  .ch12-source-card fieldset,
  .ch12-decision-feedback:empty {
    display: none !important;
  }

  .ch12-card,
  .ch12-source-card,
  .ch12-tool {
    box-shadow: none;
    break-inside: avoid;
  }

  .ch12-compare {
    min-width: 0;
    font-size: 9pt;
  }
}
