/* Confluence-like documentation chrome (inspired by docs.restera.com) */
:root {
  --text: #172b4d;
  --text-subtle: #44546f;
  --text-muted: #626f86;
  --link: #0c66e4;
  --link-hover: #0055cc;
  --border: #dfe1e6;
  --sidebar-bg: #f7f8f9;
  --sidebar-hover: #ebecf0;
  --sidebar-active: #e9f2ff;
  --sidebar-active-text: #0c66e4;
  --page-bg: #ffffff;
  --header-bg: #ffffff;
  --accent-bar: #0c66e4;
  --chip-bg: #f1f2f4;
  --shadow-img: 0 1px 1px rgba(9, 30, 66, 0.08), 0 0 1px rgba(9, 30, 66, 0.16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  --sidebar-width: 285px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--page-bg);
  min-height: 100vh;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Top header */
.docs-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}

.docs-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
}

.docs-brand:hover {
  text-decoration: none;
  color: var(--text);
}

.docs-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: linear-gradient(135deg, #0c66e4 0%, #1d7afc 55%, #579dff 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.docs-header-space {
  color: var(--text-subtle);
  font-size: 14px;
  font-weight: 500;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.docs-header-meta {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

/* Shell */
.docs-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: calc(100vh - 56px);
}

/* Sidebar */
.docs-sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 16px 0 32px;
  overflow: auto;
}

.docs-sidebar-title {
  padding: 4px 20px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.docs-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-nav a {
  display: block;
  padding: 7px 20px;
  color: var(--text-subtle);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.35;
  border-left: 3px solid transparent;
}

.docs-nav a:hover {
  background: var(--sidebar-hover);
  color: var(--text);
  text-decoration: none;
}

.docs-nav a.is-current {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
  font-weight: 600;
  border-left-color: var(--accent-bar);
}

.docs-nav .nav-home {
  margin-bottom: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-left: 0;
  margin-right: 0;
}

.docs-nav ul {
  list-style: none;
  margin: 0;
  padding: 0 0 4px;
}

.docs-nav ul a {
  padding-left: 32px;
  font-size: 13px;
}

.docs-nav .nav-group > a {
  font-weight: 600;
}

.feature-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 8px 12px;
  background: #e9f2ff;
  border: 1px solid #cce0ff;
  border-radius: 3px;
  color: #0c66e4;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.feature-badge strong {
  font-weight: 700;
}

.callout {
  margin: 0 0 24px;
  padding: 14px 16px;
  border-radius: 3px;
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-subtle);
  max-width: 820px;
}

.callout p {
  margin: 0 0 8px;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-title {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.callout--agora {
  background: #fff7e6;
  border-color: #ffe0a3;
  border-left: 3px solid #cf9f02;
}

.callout--agora .callout-title {
  color: #974f0c;
}

.callout--info {
  background: #f8fafc;
  border-left: 3px solid var(--accent-bar);
}

.callout--wip {
  background: #f1f2f4;
  border-left: 3px solid #8993a4;
}

.prose {
  max-width: 820px;
  font-size: 15px;
  color: var(--text-subtle);
}

.prose h2 {
  margin: 28px 0 10px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.prose h3 {
  margin: 20px 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.prose p {
  margin: 0 0 12px;
}

.prose ul,
.prose ol {
  margin: 0 0 16px 1.25rem;
  padding: 0;
}

.prose li {
  margin: 0 0 8px;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: #f1f2f4;
  padding: 1px 5px;
  border-radius: 3px;
}

.docs-figure {
  margin: 16px 0 0;
  max-width: min(100%, 560px);
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.docs-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.docs-figure figcaption {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: #fff;
}

.claims-table {
  width: 100%;
  max-width: 820px;
  border-collapse: collapse;
  margin: 12px 0 24px;
  font-size: 14px;
}

.claims-table th,
.claims-table td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}

.claims-table th {
  background: var(--sidebar-bg);
  font-weight: 600;
  color: var(--text);
}

.claims-table td code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: #f1f2f4;
  padding: 1px 5px;
  border-radius: 3px;
}

.claims-table .claim-icon {
  width: 48px;
  height: 48px;
  display: block;
  object-fit: contain;
}

.claims-layout {
  display: inline-grid;
  grid-template-columns: 64px 64px;
  grid-template-rows: 64px 64px;
  gap: 6px;
  margin: 8px 0 16px;
  padding: 10px;
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 3px;
}

.claims-layout span {
  display: grid;
  place-items: center;
  background: #e9f2ff;
  border: 1px dashed #cce0ff;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 700;
  color: #0c66e4;
}

.status-chip {
  display: inline-block;
  margin: 0 0 16px;
  padding: 4px 10px;
  border-radius: 3px;
  background: #dcfff1;
  color: #216e4e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Main */
.docs-main {
  overflow: auto;
  padding: 24px 40px 64px;
}

.docs-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.docs-breadcrumb a {
  color: var(--link);
}

.docs-breadcrumb .sep {
  color: var(--border);
}

.docs-title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
}

.docs-byline {
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.docs-intro {
  margin: 0 0 28px;
  max-width: 720px;
  font-size: 15px;
  color: var(--text-subtle);
}

.docs-intro p {
  margin: 0 0 10px;
}

.docs-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
}

.docs-flow span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--chip-bg);
  border-radius: 3px;
  font-size: 13px;
  color: var(--text-subtle);
}

.docs-flow .arrow {
  color: var(--text-muted);
  background: transparent;
  padding: 0;
}

/* Children list (hub) */
.childpages {
  list-style: disc;
  margin: 8px 0 0 22px;
  padding: 0;
  font-size: 15px;
}

.childpages li {
  margin: 0 0 8px;
}

/* Overview + invisible 2-column compare table */
.topic-overview {
  max-width: 820px;
  margin-bottom: 8px;
}

.topic-overview h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.topic-overview p {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--text-subtle);
}

.topic-overview code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: #f1f2f4;
  padding: 1px 5px;
  border-radius: 3px;
}

/* Invisible 1×2 table: Deliverect | r_keeper — always two cells side by side */
.compare-table {
  display: table;
  table-layout: fixed;
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 20px 0 0;
  border: 0;
}

.compare-table td {
  width: 50%;
  vertical-align: top;
  border: 0;
  padding: 0;
  background: transparent;
}

.compare-table td:first-child {
  padding-right: 14px;
}

.compare-table td:last-child {
  padding-left: 14px;
}

.compare-col-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.compare-col-text {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text-subtle);
  line-height: 1.45;
}

.compare-col-text p {
  margin: 0 0 6px;
}

.compare-col-text p:last-child {
  margin-bottom: 0;
}

.compare-col-text p:empty {
  display: none;
  margin: 0;
}

.compare-col-text code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: #f1f2f4;
  padding: 1px 5px;
  border-radius: 3px;
}

.compare-shots {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.compare-shots figure {
  margin: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.compare-shots img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: min(70vh, 720px);
  /* width:auto + max-* avoids letterboxed empty bands inside the figure */
  object-fit: contain;
  object-position: top left;
  cursor: zoom-in;
  vertical-align: top;
  background: #fff;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(9, 30, 66, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}

.lightbox.is-open {
  display: flex;
}

.lightbox img {
  max-width: min(1200px, 96vw);
  max-height: 92vh;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  background: #fff;
}

.docs-footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.docs-footer-legal {
  margin: 10px 0 0;
  max-width: 720px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
  opacity: 0.9;
}

@media (max-width: 960px) {
  .docs-shell {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 220px;
  }

  .docs-main {
    padding: 20px 18px 48px;
  }

  .docs-header-meta {
    display: none;
  }

  /* Keep both compare columns visible; only tighten spacing */
  .compare-table td:first-child {
    padding-right: 8px;
  }

  .compare-table td:last-child {
    padding-left: 8px;
  }

  .compare-shots img {
    max-height: min(55vh, 560px);
  }
}


/* Collapse leftover empty blocks from Word cell padding */
.compare-col-text:empty,
.topic-overview p:empty,
.compare-col-text p:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
}
