/* Undo the app shell so a single document scrolls normally. */
html, body, #root { height: auto; }
body { overflow: visible; background: var(--bg); }

/* Brand-mark theme swap (default theme is light -> gold mark). */
.bm-dark { display: none; }
.bm-light { display: inline-block; }
[data-theme="dark"] .bm-light { display: none; }
[data-theme="dark"] .bm-dark { display: inline-block; }

.site-header {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center;
  justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; padding: 12px 24px;
  background: var(--bg); border-bottom: 1px solid var(--border-subtle);
}
.site-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--fg-1); }
.site-brand img { height: 24px; width: auto; display: block; }
.site-brand span { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.site-brand:hover { text-decoration: none; }
.site-actions { display: flex; align-items: center; gap: 8px; }
.site-cta {
  display: inline-flex; align-items: center; white-space: nowrap; text-decoration: none;
  padding: 7px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  border: 1px solid var(--border-strong); color: var(--fg-1); background: transparent;
}
.site-cta:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.site-cta.primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-fg, #fff);
}
.site-cta.primary:hover { background: var(--accent-hover, var(--accent)); border-color: var(--accent-hover, var(--accent)); color: var(--accent-fg, #fff); }
.site-theme-toggle {
  border: 1px solid var(--border-subtle); background: var(--surface); color: var(--fg-1);
  width: 34px; height: 32px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; line-height: 1;
}
.site-theme-toggle:hover { border-color: var(--border-strong); }

.site-layout { display: flex; align-items: flex-start; max-width: 1180px; margin: 0 auto; }
.site-nav {
  flex: 0 0 236px; position: sticky; top: 55px; align-self: flex-start;
  max-height: calc(100vh - 55px); overflow-y: auto;
  padding: 22px 14px 48px; border-right: 1px solid var(--border-subtle);
}
.site-nav-home { display: inline-block; margin-bottom: 14px; font-size: 12px; color: var(--fg-3); }
.site-nav-home.is-active { color: var(--accent); }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav li a {
  display: block; padding: 6px 9px; border-radius: var(--radius-sm);
  color: var(--fg-2); font-size: 13px; text-decoration: none;
}
.site-nav li a:hover { background: var(--surface); }
.site-nav li a.is-active { background: var(--accent-soft, var(--surface)); color: var(--accent); font-weight: 600; }

.site-main { flex: 1 1 auto; min-width: 0; padding: 26px 34px 90px; }
.site-main .page-title { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: var(--fg-1); }
.site-main .page-sub { font-size: 16px; color: var(--fg-3); margin-top: 6px; }
.site-main .page-header { margin-bottom: 22px; }
.site-main img, .external-doc-body img { max-width: 100%; height: auto; }

/* Breadcrumb above a guide. */
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; font-size: 12px; }
.breadcrumb a { color: var(--fg-3); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--fg-3); opacity: .55; }
.breadcrumb [aria-current="page"] { color: var(--fg-2); }

/* Justify body paragraphs for an even reading column; hyphenate to avoid rivers. */
.external-doc-body p { text-align: justify; text-justify: inter-word; -webkit-hyphens: auto; hyphens: auto; }

/* Coming-soon note on the landing page. */
.coming-soon {
  margin: 26px 0 0; padding: 14px 16px; border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md); color: var(--fg-3); font-size: 13px;
}
.coming-soon-tag {
  display: inline-block; margin-right: 8px; padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--accent-soft, var(--surface)); color: var(--accent);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600;
}

/* Footer: copyright + version/date. (Site/App links live in the header.) */
.site-footer {
  margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--border-subtle);
}
.site-footer-meta { color: var(--fg-3); font-size: 12px; }

@media (max-width: 900px) {
  .site-nav { display: none; }
  .site-main { padding: 22px 18px 64px; }
  .site-header { padding: 11px 16px; }
  .site-main .page-title { font-size: 24px; }
  .site-main .page-sub { font-size: 15px; }
}

/* Phones: no horizontal scroll anywhere; data tables become stacked cards. */
@media (max-width: 640px) {
  html, body { overflow-x: hidden; }
  .site-main { padding: 18px 16px 56px; }

  /* Drop the card framing so a guide reads as a full-width article, not a boxed
     panel squeezed between the page gutter and the card's own padding. */
  .external-doc-page { max-width: none; }
  .section-card.external-doc-body {
    background: none; border: none; box-shadow: none;
    border-radius: 0; padding: 0; margin: 0; overflow: visible;
  }
  .section-card.external-doc-body::after { display: none; }

  /* Comfortable reading size on a phone (app UI defaults are dense). */
  .external-doc-body p, .external-doc-body li, .external-doc-body td { font-size: 15px; }
  .external-doc-body .external-doc-summary { font-size: 15px; }
  .external-doc-body h2 { font-size: 20px; }
  .external-doc-body h3 { font-size: 16px; }

  .external-doc-body pre { overflow-x: auto; }

  /* Tabbed routes (e.g. Console / bash / PowerShell): a wrapping, sticky strip
     is cramped on a phone. Stack the modes as full-width rows you tap to pick. */
  .external-doc-body .doc-tab-strip {
    position: static; flex-direction: column; flex-wrap: nowrap; gap: 6px;
    padding: 0; border-bottom: none; background: none;
  }
  .external-doc-body .doc-tab-btn { width: 100%; text-align: left; padding: 11px 14px; font-size: 13px; }
  .external-doc-body .doc-tab-btn.is-active { border-left: 3px solid var(--accent); }

  .external-doc-body thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .external-doc-body table,
  .external-doc-body tbody,
  .external-doc-body tr,
  .external-doc-body td { display: block; width: 100%; }
  .external-doc-body tr {
    border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
    margin: 0 0 12px; padding: 12px 14px; background: var(--surface);
  }
  .external-doc-body td { border: none; padding: 0; }
  /* First column (the service / component) becomes the card's title; its own
     "Service / component" header is redundant, so hide that one label. */
  .external-doc-body td:first-child {
    font-size: 16px; font-weight: 700; color: var(--fg-1);
    padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--border-subtle);
  }
  .external-doc-body td:first-child::before { display: none; }
  /* The remaining column(s) read as the description, each under a small caption. */
  .external-doc-body td:not(:first-child) {
    color: var(--fg-2); text-align: justify; -webkit-hyphens: auto; hyphens: auto;
  }
  .external-doc-body td:not(:first-child)::before {
    content: attr(data-label); display: block; margin-bottom: 3px;
    font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--accent); font-weight: 700; font-family: var(--font-mono);
  }

  /* Keep the header on one row: mark only (no name), compact CTAs. */
  .site-brand span { display: none; }
  .site-cta { padding: 7px 11px; font-size: 12px; }
  .site-actions { gap: 6px; }
}
