/* Extended documentation pages: mobile-first, SEO content blocks, tools */

.seo-intro {
  font-size: 0.92rem;
  color: var(--muted);
  max-width: 68ch;
  margin: 0 0 1.25rem;
  line-height: 1.55;
}

.keyword-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0 1.25rem;
}

.keyword-pill {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--chip);
  color: var(--muted);
}

.docs-layout-wide {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  padding: 0 1rem 2rem;
  max-width: 72rem;
  margin: 0 auto;
}

@media (min-width: 900px) {
  .docs-layout-wide {
    grid-template-columns: 220px minmax(0, 1fr);
    padding: 0 1.5rem 2.5rem;
  }
}

.docs-sidebar {
  position: sticky;
  top: 0.75rem;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  background: var(--card, #f0ece2);
  font-size: 0.84rem;
}

.docs-sidebar h2 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem;
  color: var(--verdict);
}

.docs-sidebar a {
  display: block;
  padding: 0.28rem 0;
  color: inherit;
  text-decoration: none;
}

.docs-sidebar a:hover {
  color: var(--verdict);
}

.doc-section {
  margin-bottom: 2rem;
}

.doc-section h2 {
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  margin: 0 0 0.65rem;
}

.doc-section h3 {
  font-size: 1rem;
  margin: 1.1rem 0 0.45rem;
}

.doc-section p,
.doc-section li {
  line-height: 1.6;
  max-width: 68ch;
}

.changelog-table,
.error-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.changelog-table thead,
.error-table thead {
  display: table-header-group;
}

.changelog-table tbody,
.error-table tbody {
  display: table-row-group;
}

.changelog-table tr,
.error-table tr {
  display: table-row;
}

.changelog-table th,
.changelog-table td,
.error-table th,
.error-table td {
  border: 1px solid var(--line);
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.changelog-table th,
.error-table th {
  background: var(--chip);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.code-block {
  display: block;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--chip);
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.65rem 0 1rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.diagram-wrap {
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
  background: var(--card, #f0ece2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.diagram-wrap svg {
  display: block;
  max-width: 100%;
  height: auto;
  min-width: 280px;
}

.diagram-caption {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
}

.circuit-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
  align-items: center;
}

.circuit-toolbar input,
.circuit-toolbar select {
  flex: 1 1 140px;
  min-width: 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.88rem;
  background: var(--bg, #fff);
}

.circuit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  margin: 0.75rem 0 1.25rem;
}

.circuit-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  background: var(--card, #f0ece2);
  font-size: 0.82rem;
}

.circuit-card strong {
  display: block;
  font-size: 0.78rem;
  word-break: break-all;
}

.circuit-card span {
  color: var(--muted);
  font-size: 0.75rem;
}

.circuit-count {
  font-size: 0.84rem;
  color: var(--muted);
}

.pattern-step {
  border-left: 3px solid var(--verdict);
  padding: 0 0 0.85rem 1rem;
  margin: 0 0 0.85rem;
}

.print-pack {
  max-width: 48rem;
  margin: 0 auto;
  padding: 1rem;
}

@media print {
  .topbar,
  .footer,
  .eeat-box,
  .affix-social-sidebar,
  .no-print {
    display: none !important;
  }
  .print-pack {
    padding: 0;
  }
  .page {
    background: #fff;
  }
}

.dl-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  background: var(--chip);
}

.dl-box a {
  font-weight: 600;
}

.faq-block details {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 0.45rem 0;
  padding: 0.55rem 0.75rem;
  background: var(--card, #f0ece2);
}

.faq-block summary {
  font-weight: 600;
  cursor: pointer;
}

.incident-log {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.incident-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.84rem;
}

@media (min-width: 600px) {
  .incident-row {
    grid-template-columns: 7rem 6rem 1fr;
    align-items: start;
  }
}

.incident-row:last-child {
  border-bottom: none;
}

.status-ok {
  color: var(--verdict, #1a5c42);
  font-weight: 600;
}

@media (max-width: 599px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }
  .trust-table {
    display: block;
    overflow-x: auto;
  }
}
