/* ══════════════════════════════════════════════════════════
   KaKeKiKoKu — Integration annex styles
   Layered on top of docs-styles.css (shared tokens + base
   components). Only the integration-specific pieces live here:
   contents card, OS tabs (dark-ready), compatibility matrix,
   guide cards, breadcrumb row, and the theme-toggle top bar.
   ══════════════════════════════════════════════════════════ */

/* ── Page width (annexes are a bit denser than the manual) ── */
.doc-wrapper {
  max-width: 860px;
}

/* ── Top bar: breadcrumb + theme toggle ── */
.doc-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.4rem;
}

.doc-topbar .doc-breadcrumb {
  flex: 1;
  min-width: 0;
}

/* Integration breadcrumb is inline text with "›" separators */
.doc-breadcrumb {
  display: block;
  font-size: 0.84rem;
  color: var(--doc-text-faint);
  margin: 0;
}

.doc-breadcrumb a {
  color: var(--doc-text-muted);
  text-decoration: none;
}

.doc-breadcrumb a:hover {
  color: var(--doc-accent);
  text-decoration: underline;
}

/* ── Chapter headings: keep chip aligned with wrapping titles ── */
.doc-chapter h2 {
  align-items: baseline;
}

.doc-chapter-title {
  min-width: 0;
}

/* ── Contents card (per-client annexes) ── */
.doc-toc {
  background: var(--doc-surface);
  border: 1px solid var(--doc-border);
  border-radius: var(--doc-radius);
  padding: 1.4rem 1.8rem;
  margin-bottom: 3rem;
}

.doc-toc h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--doc-text-faint);
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.doc-toc ol,
.doc-toc ul {
  margin: 0;
  padding-left: 1.2rem;
}

.doc-toc ul {
  margin-bottom: 0.6rem;
  list-style: none;
  padding-left: 0;
}

.doc-toc li {
  margin-bottom: 0.45rem;
}

.doc-toc a {
  color: var(--doc-accent-strong);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.96rem;
}

.doc-toc a:hover {
  text-decoration: underline;
}

/* ── OS tabs: re-skin the shared component with tokens (dark-ready) ── */
.os-tabs {
  border-color: var(--doc-border);
  background: var(--doc-surface);
}

.os-tab-bar {
  background: var(--doc-surface-2);
  border-bottom-color: var(--doc-border);
}

.os-tab-btn {
  border-right-color: var(--doc-border);
  color: var(--doc-text-muted);
}

.os-tab-btn:hover {
  background: var(--doc-surface-2);
  color: var(--doc-text);
}

.os-tab-btn[aria-selected="true"] {
  background: var(--doc-surface);
  color: var(--doc-accent-strong);
  box-shadow: inset 0 -2px 0 var(--doc-accent);
}

.os-tab-btn:focus-visible {
  outline-color: var(--doc-accent);
}

.os-tab-panel {
  color: var(--doc-text);
}

.os-tab-panel code {
  background: var(--doc-code-bg);
  color: var(--doc-code-text);
}

.os-tab-panel pre {
  background: var(--doc-code-bg);
  border-color: var(--doc-border);
}

.os-tab-panel pre code {
  background: transparent;
  color: var(--doc-code-text);
}

/* ── Compatibility matrix ── */
.matrix-wrapper {
  overflow-x: auto;
  margin: 1.2rem 0 1rem;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  background: var(--doc-surface);
  border-radius: var(--doc-radius);
  overflow: hidden;
}

.matrix-table th,
.matrix-table td {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--doc-border);
  text-align: left;
  vertical-align: top;
}

.matrix-table thead th {
  background: var(--doc-accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
}

.matrix-table thead th:first-child {
  text-align: left;
}

.matrix-table .vendor-row td {
  background: var(--doc-accent-soft);
  font-weight: 700;
  color: var(--doc-text);
  padding: 0.55rem 0.8rem;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.matrix-table tbody tr td:first-child {
  font-weight: 500;
}

.matrix-table .client-link {
  color: var(--doc-accent-strong);
  text-decoration: none;
  font-weight: 600;
}

.matrix-table .client-link:hover {
  text-decoration: underline;
}

.matrix-table .client-no-link {
  color: var(--doc-text-faint);
  font-weight: 500;
  font-style: italic;
}

.matrix-table .status {
  text-align: center;
  font-size: 0.92rem;
}

.matrix-table .footnote {
  font-size: 0.8rem;
  color: var(--doc-text-muted);
  display: block;
  margin-top: 0.15rem;
  font-weight: 400;
}

/* ── Status colors (legend + matrix), light + dark ── */
.status-ok      { color: #1d8540; font-weight: 600; }
.status-pending { color: #cc8800; font-weight: 600; }
.status-na      { color: #9a988f; }
.status-untested{ color: #a87c4a; }
.status-future  { color: #7755bb; font-weight: 600; }
.status-release { color: #3b76b7; font-weight: 600; }

html[data-doc-theme="dark"] .status-ok      { color: #4cc38a; }
html[data-doc-theme="dark"] .status-pending { color: #e0a83c; }
html[data-doc-theme="dark"] .status-na      { color: #707a89; }
html[data-doc-theme="dark"] .status-untested{ color: #cba46f; }
html[data-doc-theme="dark"] .status-future  { color: #b19cf0; }
html[data-doc-theme="dark"] .status-release { color: #7cb2e6; }

/* ── Legend ── */
.matrix-legend {
  font-size: 0.88rem;
  color: var(--doc-text-muted);
  background: var(--doc-surface);
  border: 1px solid var(--doc-border);
  border-radius: var(--doc-radius);
  padding: 0.8rem 1.2rem;
  margin-bottom: 2rem;
}

.matrix-legend strong {
  font-weight: 600;
  color: var(--doc-text);
}

.matrix-legend ul {
  list-style: none;
  padding-left: 0;
  margin: 0.4rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.matrix-legend li {
  margin-bottom: 0;
}

/* ── Guide cards ── */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.guide-card {
  background: var(--doc-surface);
  border: 1px solid var(--doc-border);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.guide-card:hover {
  border-color: var(--doc-accent);
  transform: translateY(-2px);
  box-shadow: var(--doc-shadow);
}

.guide-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.guide-card h3 a {
  color: var(--doc-accent-strong);
  text-decoration: none;
}

.guide-card h3 a:hover {
  text-decoration: underline;
}

.guide-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--doc-text-muted);
  line-height: 1.5;
}

.guide-card-pending {
  background: var(--doc-surface-2);
  border-style: dashed;
}

.guide-card-pending h3,
.guide-card-pending h3 a {
  color: var(--doc-warn-accent);
  pointer-events: none;
  cursor: default;
}

/* ── Print ── */
@media print {
  .doc-topbar .doc-theme-toggle,
  .doc-progress { display: none !important; }
  .os-tab-panel[hidden] { display: block !important; }
}
