/* Concord documentation theme overrides.
   Tailwind + DaisyUI provide the shell (navbar, drawer, buttons, inputs,
   dropdown, menu). This file styles the DocFX-rendered content (article
   typography, syntax highlighting, callouts, tables, TOC, breadcrumb, affix,
   search results) and the landing page, all keyed off the brand palette in
   assets/PALETTE.md. */

/* Design tokens (kept in sync with assets/PALETTE.md) */
:root,
:root[data-bs-theme="dark"],
[data-bs-theme="dark"] {
  --cc-teal: #2BB8A8;
  --cc-teal-light: #6FE0D2;
  --cc-mint: #34d399;
  --cc-amber: #fbbf24;
  --cc-rose: #fb7185;
  --cc-purple: #7E5BD6;
  --cc-bg: #0d0f17;
  --cc-bg-elevated: #141823;
  --cc-bg-card: #1a1f2e;
  --cc-bg-hover: #232938;
  --cc-bg-code: #111420;
  --cc-border: rgba(255, 255, 255, 0.08);
  --cc-border-strong: rgba(255, 255, 255, 0.14);
  --cc-border-accent: rgba(43, 184, 168, 0.3);
  --cc-text: #e2e8f0;
  --cc-text-secondary: #94a3b8;
  --cc-text-muted: #7d8ba0;
  --cc-text-bright: #f1f5f9;
  --cc-link: #6FE0D2;
  --cc-link-hover: #8FEDE0;
  --cc-action: #147f75;
  --cc-action-hover: #0d6b63;
  --cc-action-text: #ffffff;
  --cc-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --cc-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --cc-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
  --cc-scrollbar-thumb: rgba(148, 163, 184, 0.25);
}

:root[data-bs-theme="light"],
[data-bs-theme="light"] {
  --cc-bg: #f8f7fc;
  --cc-bg-elevated: #ffffff;
  --cc-bg-card: #ffffff;
  --cc-bg-hover: #f1eff7;
  --cc-bg-code: #f5f3fa;
  --cc-border: rgba(15, 15, 30, 0.08);
  --cc-border-strong: rgba(15, 15, 30, 0.14);
  --cc-border-accent: rgba(43, 184, 168, 0.25);
  --cc-text: #1e1b2e;
  --cc-text-secondary: #4b5563;
  --cc-text-muted: #6b7280;
  --cc-text-bright: #0f0a1e;
  --cc-link: #0d6b63;
  --cc-link-hover: #0a5a53;
  --cc-action: #147f75;
  --cc-action-hover: #0d6b63;
  --cc-action-text: #ffffff;
  --cc-shadow-sm: 0 1px 3px rgba(15, 15, 30, 0.06);
  --cc-shadow-md: 0 4px 16px rgba(15, 15, 30, 0.08);
  --cc-shadow-lg: 0 12px 40px rgba(15, 15, 30, 0.10);
  --cc-scrollbar-thumb: rgba(100, 116, 139, 0.3);
}

* { scrollbar-color: var(--cc-scrollbar-thumb) transparent; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body { letter-spacing: 0; }

/* Theme toggle icon visibility (only the active preference's icon shows) */
.cc-theme-icon { display: none; }
:root[data-theme-pref="light"] .cc-theme-icon-light,
:root[data-theme-pref="dark"] .cc-theme-icon-dark,
:root[data-theme-pref="auto"] .cc-theme-icon-auto { display: inline-block; }
.cc-toolbar-button { min-width: 2.75rem !important; min-height: 2.75rem !important; }
.cc-mobile-brand { display: inline-flex; min-height: 2.75rem; align-items: center; padding: 0.5rem 0.25rem; }
#cc-version-dropdown > summary { min-height: 2.75rem; }
@media (min-width: 1024px) { .cc-mobile-brand { display: none; } }

.navbar { font-family: var(--font-sans, "Atkinson Hyperlegible Next", ui-sans-serif, sans-serif); letter-spacing: 0; }

/* Navbar brand logo */
.cc-nav-logo { width: auto; border-radius: 4px; object-fit: contain; }

/* Desktop: keep the DaisyUI drawer side a fixed width */
.drawer.lg\:drawer-open .drawer-side { --tw-border-style: solid; }

/* Body grid: content + affix (affix only on xl) */
@media (min-width: 1280px) {
  .cc-body-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 15rem;
    gap: 2rem;
    align-items: start;
  }
}

/* Content area */
.content { position: relative; z-index: 1; }
.cc-container { width: 100%; margin: auto; }
@media (min-width: 1024px) {
  .cc-container { max-width: 80%; }
}
body[data-layout="landing"] .content {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}
body[data-layout="landing"] .cc-actionbar,
body[data-layout="landing"] .cc-affix { display: none !important; }
body[data-layout="landing"] .cc-container { max-width: none; }
body[data-layout="landing"] .cc-body-grid { display: block; }

/* Article typography */
.cc-article { color: var(--cc-text); }
.cc-article h1, .cc-article h2, .cc-article h3,
.cc-article h4, .cc-article h5, .cc-article h6 {
  color: var(--cc-text-bright);
  font-weight: 700;
  letter-spacing: -0.02em;
  scroll-margin-top: 90px;
}
.cc-article h1 {
  font-size: 2.25rem;
  font-weight: 800;
  margin: 0 0 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--cc-border);
  position: relative;
}
.cc-article h1::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 60px; height: 2px;
  background: var(--cc-teal);
  border-radius: 2px;
}
.cc-article h2 {
  font-size: 1.6rem;
  margin: 2.5rem 0 1rem;
}
.cc-article h3 { font-size: 1.25rem; margin: 2rem 0 0.75rem; }
.cc-article h4 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; color: var(--cc-text-secondary); font-weight: 600; }
.cc-article p { line-height: 1.75; margin: 0 0 1rem; }
.cc-article a { color: var(--cc-link); font-weight: 500; text-decoration: none; transition: color 0.15s; }
.cc-article a:hover { color: var(--cc-link-hover); text-decoration: underline; text-underline-offset: 3px; }
.cc-article ul,
.cc-article ol {
  margin: 0 0 1.25rem;
  padding-inline-start: 1.5rem;
  list-style-position: outside;
}
.cc-article ul { list-style-type: disc; }
.cc-article ol { list-style-type: decimal; padding-inline-start: 1.75rem; }
.cc-article li { line-height: 1.75; padding-inline-start: 0.25rem; }
.cc-article li + li { margin-top: 0.5rem; }
.cc-article li::marker { color: var(--cc-link); font-weight: 700; }
.cc-article ul li::marker { font-size: 0.8em; }
.cc-article ol li::marker {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.85em;
}
.cc-article li > ul,
.cc-article li > ol { margin: 0.5rem 0 0.25rem; }
.cc-article ul ul { list-style-type: circle; }
.cc-article ul ul ul { list-style-type: square; }
.cc-article ol ol { list-style-type: lower-alpha; }
.cc-article strong { color: var(--cc-text-bright); font-weight: 700; }
.cc-article blockquote {
  border: 1px solid rgba(43, 184, 168, 0.35);
  background: rgba(43, 184, 168, 0.06);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 10px;
  color: var(--cc-text-secondary);
  font-style: italic;
}
.cc-article blockquote p { margin-bottom: 0; }
.cc-article hr { border: none; height: 1px; background: var(--cc-border-strong); margin: 2.5rem 0; }

/* Tables (DocFX wraps tables in .table-responsive and adds .table classes) */
.cc-article .table-responsive { overflow-x: auto; margin: 1.5rem 0; border-radius: 12px; }
.cc-article table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--cc-shadow-sm);
  border: 1px solid var(--cc-border);
}
.cc-article table thead { background: var(--cc-bg-card); }
.cc-article table th {
  color: var(--cc-text-bright);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--cc-border-accent);
  text-align: left;
}
.cc-article table td { color: var(--cc-text); padding: 0.75rem 1rem; border-bottom: 1px solid var(--cc-border); }
.cc-article table tbody tr { transition: background 0.15s; }
.cc-article table tbody tr:hover { background: var(--cc-bg-hover); }
.cc-article table tbody tr:last-child td { border-bottom: none; }

/* Code blocks */
.cc-article pre {
  background: var(--cc-bg-code);
  border: 1px solid var(--cc-border);
  border-radius: 12px;
  max-width: calc(120ch + 3rem);
  margin: 1.25rem 0;
  position: relative;
  box-shadow: var(--cc-shadow-sm);
  display: flex;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.875rem;
  padding: 0;
  overflow: hidden;
}
.cc-article pre::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--cc-teal);
  border-radius: 12px 12px 0 0;
  opacity: 0.6;
  z-index: 1;
}
.cc-article pre > code {
  flex: 1;
  overflow-x: auto;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--cc-text);
  background: transparent;
  padding: 1.25rem 1.5rem;
}
.cc-article code:not(pre code) {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.85em;
  color: var(--cc-teal);
  background: rgba(43, 184, 168, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  border: 1px solid rgba(43, 184, 168, 0.15);
  font-weight: 500;
}
[data-bs-theme="light"] .cc-article code:not(pre code) { color: var(--cc-link); background: rgba(43, 184, 168, 0.06); }

/* Syntax highlighting */
.cc-article pre .hljs-keyword { color: #9D7FE8; font-weight: 600; }
.cc-article pre .hljs-built_in { color: #9D7FE8; }
.cc-article pre .hljs-string, .cc-article pre .hljs-attr { color: #E8C547; }
.cc-article pre .hljs-comment { color: #828fa3; font-style: italic; }
.cc-article pre .hljs-number, .cc-article pre .hljs-literal { color: #F0883E; }
.cc-article pre .hljs-title, .cc-article pre .hljs-title.function_, .cc-article pre .hljs-function .hljs-title { color: #2BB8A8; }
.cc-article pre .hljs-type, .cc-article pre .hljs-class .hljs-title { color: #9D7FE8; }
.cc-article pre .hljs-params { color: var(--cc-text); }
.cc-article pre .hljs-meta { color: #828fa3; }
.cc-article pre .hljs-variable, .cc-article pre .hljs-property { color: #6FE0D2; }

/* Callouts / admonitions (DocFX adds .alert classes at runtime) */
.cc-article .alert,
.cc-article div.NOTE, .cc-article div.WARNING, .cc-article div.TIP,
.cc-article div.IMPORTANT, .cc-article div.CAUTION {
  border-radius: 12px;
  border: 1px solid var(--cc-border);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  background: var(--cc-bg-card);
  box-shadow: var(--cc-shadow-sm);
}
.cc-article .alert h5,
.cc-article div.NOTE > h5, .cc-article div.WARNING > h5, .cc-article div.TIP > h5,
.cc-article div.IMPORTANT > h5, .cc-article div.CAUTION > h5 {
  font-size: 0.85rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 0.5rem;
}
.cc-article div.NOTE, .cc-article .alert-info { border-color: rgba(43, 184, 168, 0.4); }
.cc-article div.NOTE > h5, .cc-article .alert-info h5 { color: var(--cc-teal); }
.cc-article div.WARNING, .cc-article .alert-warning { border-color: rgba(251, 191, 36, 0.4); }
.cc-article div.WARNING > h5, .cc-article .alert-warning h5 { color: var(--cc-amber); }
.cc-article div.TIP { border-color: rgba(52, 211, 153, 0.4); }
.cc-article div.TIP > h5 { color: var(--cc-mint); }
.cc-article div.CAUTION, .cc-article .alert-danger { border-color: rgba(251, 113, 133, 0.4); }
.cc-article div.CAUTION > h5, .cc-article .alert-danger h5 { color: var(--cc-rose); }
.cc-article div.IMPORTANT { border-color: rgba(111, 224, 210, 0.4); }
.cc-article div.IMPORTANT > h5 { color: var(--cc-teal-light); }

/* DocFX copy button on code blocks */
.cc-article .code-action { position: absolute; top: 0.25rem; right: 0.25rem; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; background: transparent !important; border: none !important; box-shadow: none !important; color: var(--cc-text-muted); padding: 0.5rem; opacity: 0.7; border-radius: 6px; }
.cc-article pre:hover .code-action { opacity: 1; color: var(--cc-link); }
.cc-article .code-action:hover { background: transparent !important; color: var(--cc-link); }
.cc-article .code-action:focus-visible { outline: 2px solid var(--cc-link); outline-offset: 1px; opacity: 1; }
.cc-article .code-action.link-success { color: var(--cc-mint); }

/* AnchorJS links */
.cc-article .anchorjs-link { color: var(--cc-text-muted); text-decoration: none; }
.cc-article .anchorjs-link:hover { color: var(--cc-link); }

/* Breadcrumbs (rendered by theme.js from navrel + tocrel) */
#cc-breadcrumb .cc-breadcrumb-list { display: flex; flex-wrap: wrap; gap: 0; padding: 0; margin: 0; list-style: none; }
#cc-breadcrumb .cc-breadcrumb-item { color: var(--cc-text-muted); }
#cc-breadcrumb .cc-breadcrumb-item + .cc-breadcrumb-item::before { content: '›'; padding: 0 0.4rem; color: var(--cc-text-muted); }
#cc-breadcrumb .cc-breadcrumb-item a { color: var(--cc-text-muted); text-decoration: none; }
#cc-breadcrumb .cc-breadcrumb-item a:hover { color: var(--cc-link); }
#cc-breadcrumb .cc-breadcrumb-item.active { color: var(--cc-text-secondary); }

/* Dropdowns use native <details> show/hide; styled by DaisyUI */

/* TOC sidebar (DocFX-rendered) */
.toc { font-size: 0.875rem; }
.toc .filter { position: relative; margin-bottom: 0.9rem; }
.toc .filter .bi-filter { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); color: var(--cc-text-muted); pointer-events: none; opacity: 0.7; }
.toc .filter input {
  background: var(--cc-bg-card); border: 1px solid var(--cc-border); border-radius: 9px;
  color: var(--cc-text); padding: 0.42rem 0.7rem 0.42rem 2rem; font-size: 0.8rem; width: 100%;
  transition: border-color 0.15s, outline-color 0.15s;
}
.toc .filter input::placeholder { color: var(--cc-text-muted); }
.toc .filter input:focus { outline: 3px solid rgba(43, 184, 168, 0.18); outline-offset: 2px; border-color: var(--cc-border-accent); }
.toc ul { list-style: none; padding-left: 0; margin: 0; }
.toc ul ul { padding-left: 0.95rem; margin-top: 2px; border-left: 1px solid var(--cc-border); margin-left: 0.6rem; }
.toc li { margin: 0; }
.toc .nav-link {
  display: flex; align-items: center; gap: 0.4rem;
  color: var(--cc-text-secondary); border-radius: 8px;
  padding: 0.45rem 0.7rem; font-weight: 500; line-height: 1.35;
  text-decoration: none; transition: color 0.15s, background 0.15s;
}
.toc .nav-link:hover { color: var(--cc-text-bright); background: var(--cc-bg-hover); }
.toc li.active > .nav-link, .toc .nav-link.active {
  color: var(--cc-link); font-weight: 600; background: rgba(43, 184, 168, 0.12);
  box-shadow: inset 2px 0 0 var(--cc-teal);
}
.toc .expander > .nav-link { cursor: pointer; }
.toc .expand-stub { display: inline-flex; align-items: center; justify-content: center; width: 0.9rem; flex-shrink: 0; cursor: pointer; color: var(--cc-text-muted); user-select: none; }
.toc .expand-stub::before { content: '▸'; }
.toc .expander.expanded > .expand-stub::before { content: '▾'; }
.toc .expander:not(.expanded) > ul { display: none; }
.toc .name-only { color: var(--cc-text-muted); font-weight: 700; text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.06em; padding: 0.5rem 0.7rem 0.25rem; }
.toc .no-result { color: var(--cc-text-muted); padding: 0.5rem 0.7rem; font-size: 0.8rem; font-style: italic; }

/* Table of contents */
#affix h2 { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--cc-text-muted); margin: 0 0 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--cc-border); }
#affix ul { list-style: none; padding: 0; margin: 0; }
#affix ul ul { margin-left: 0.35rem; padding-left: 0.55rem; border-left: 1px solid var(--cc-border); }
#affix li { margin: 0; }
#affix a { position: relative; display: block; color: var(--cc-text-muted); font-size: 0.8rem; line-height: 1.35; padding: 0.3rem 0.5rem 0.3rem 0.9rem; border-radius: 6px; text-decoration: none; transition: color 0.15s, background 0.15s; }
#affix a::before { content: ''; position: absolute; left: 0.3rem; top: 50%; width: 3px; height: 3px; border-radius: 50%; background: transparent; transform: translateY(-50%); }
#affix a:hover { color: var(--cc-text); }
#affix a:hover::before { background: var(--cc-teal-light); }
#affix .cc-affix-level-2 { color: var(--cc-text-secondary); font-weight: 500; }
#affix .cc-affix-level-3 { font-size: 0.78rem; }
#affix .cc-affix-level-4 { font-size: 0.75rem; }
#affix a.cc-affix-active { color: var(--cc-link); font-weight: 600; background: rgba(43, 184, 168, 0.08); }
#affix a.cc-affix-active::before { width: 4px; height: 4px; background: var(--cc-teal); }

/* Contribution / next article */
.contribution { color: var(--cc-text-secondary); }
.next-article { color: var(--cc-text-secondary); }
.next-article .next, .next-article .prev { display: inline-block; margin-right: 1rem; color: var(--cc-text-muted); font-size: 0.85rem; }
.next-article a { color: var(--cc-link); font-weight: 600; }

.cc-footer-brand,
.cc-footer-nav a { min-height: 2.75rem; display: inline-flex; align-items: center; }

/* Search results */
/* Command palette search results */
.search-results { padding: 0.5rem; }
.search-results:empty::before { content: 'Type to search the docs…'; display: block; padding: 2rem 1rem; text-align: center; color: var(--cc-text-muted); font-size: 0.875rem; }
.search-results .search-list { padding: 0.4rem 0.6rem 0.6rem; color: var(--cc-text-muted); font-size: 0.75rem; }
.search-results .sr-items { padding: 0; }
.search-results .sr-item { padding: 0.65rem 0.75rem; border-radius: 8px; margin-bottom: 2px; transition: background 0.12s; cursor: pointer; }
.search-results .sr-item:hover { background: var(--cc-bg-hover); }
.search-results .item-title a { color: var(--cc-text-bright); font-weight: 600; font-size: 0.875rem; text-decoration: none; display: block; }
.search-results .item-href { color: var(--cc-teal); font-size: 0.7rem; font-family: var(--font-mono, 'JetBrains Mono', monospace); margin-top: 0.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-results .item-brief { color: var(--cc-text-secondary); font-size: 0.8rem; line-height: 1.5; margin-top: 0.3rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-results .sr-item b { background: rgba(43, 184, 168, 0.20); color: var(--cc-link); border-radius: 3px; padding: 0 2px; font-weight: 600; }
.search-results .pagination { list-style: none; display: flex; gap: 0.25rem; justify-content: center; padding: 0.5rem; }
.search-results .pagination .page-item { padding: 0.2rem 0.5rem; border-radius: 6px; color: var(--cc-text-secondary); cursor: pointer; font-size: 0.8rem; }
.search-results .pagination .page-item:hover { background: var(--cc-bg-hover); }
.search-results .pagination .page-item.disabled { opacity: 0.4; cursor: default; }
.search-results .no-result { padding: 2rem 1rem; text-align: center; color: var(--cc-text-muted); font-size: 0.875rem; }

/* Version selector tweaks */
#cc-version-selector { appearance: none; -webkit-appearance: none; }
#cc-nav .cc-nav-active { color: var(--cc-link); font-weight: 600; background: rgba(43, 184, 168, 0.1); }

/* Code line numbers */
.cc-line-gutter {
  flex-shrink: 0;
  padding: 1.25rem 0.75rem 1.25rem 1rem;
  text-align: right;
  user-select: none;
  color: var(--cc-text-muted);
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.875rem;
  line-height: 1.65;
  border-right: 1px solid var(--cc-border);
  opacity: 0.5;
  white-space: pre;
}
.cc-line-gutter span { display: block; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--cc-scrollbar-thumb); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--cc-teal); background-clip: padding-box; }

/* API reference pages */
.cc-article h1[data-uid] { font-family: var(--font-mono, 'JetBrains Mono', monospace); font-size: 1.75rem; }
.cc-article dl > dt { font-weight: 700; color: var(--cc-text-bright); font-family: var(--font-mono, monospace); font-size: 0.9rem; margin-top: 1rem; }
.cc-article dl > dd { margin: 0 0 0.5rem 1rem; }
.cc-article .summary, .cc-article .declaration { background: var(--cc-bg-card); border: 1px solid var(--cc-border); border-radius: 10px; padding: 1rem 1.25rem; margin: 1rem 0; }
.cc-article .summary:empty, .cc-article .declaration:empty { display: none; }

/* Landing page */
body[data-layout="landing"] .cc-article { text-align: left; }
body[data-layout="landing"] .anchorjs-link { display: none !important; }

.cc-home-hero {
  display: grid;
  grid-template-columns: minmax(17rem, 0.82fr) minmax(28rem, 1.18fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  max-width: 76rem;
  margin: clamp(1.5rem, 4vw, 4rem) auto clamp(4rem, 8vw, 7rem);
}
.cc-home-wordmark {
  margin: 0 0 1.75rem !important;
  padding: 0 !important;
  border: 0 !important;
}
.cc-home-wordmark::after { display: none; }
.cc-home-wordmark img { width: min(100%, 30rem); height: auto; }
.cc-home-lead {
  max-width: 34rem;
  margin: 0 0 1.75rem !important;
  color: var(--cc-text-secondary);
  font-size: 1.2rem;
  line-height: 1.65;
  text-wrap: pretty;
}
.cc-home-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.cc-article a.cc-btn, .cc-article a.cc-btn:hover { text-decoration: none; }
.cc-article a.cc-btn-primary, .cc-article a.cc-btn-primary:hover { color: var(--cc-action-text); }
.cc-article a.cc-btn-secondary, .cc-article a.cc-btn-secondary:hover { color: var(--cc-text-bright); }
.cc-btn {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.18s ease-out, border-color 0.18s ease-out, color 0.18s ease-out;
}
.cc-btn-primary { background: var(--cc-action); color: var(--cc-action-text); }
.cc-btn-primary:hover { background: var(--cc-action-hover); color: var(--cc-action-text); }
.cc-btn-secondary { background: transparent; border-color: var(--cc-border-strong); color: var(--cc-text-bright); }
.cc-btn-secondary:hover { background: var(--cc-bg-hover); border-color: var(--cc-border-accent); color: var(--cc-text-bright); }
.cc-btn:focus-visible,
.cc-guide-link:focus-visible { outline: 2px solid var(--cc-link); outline-offset: 3px; }

.cc-code-preview {
  max-width: 45rem;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--cc-border-strong);
  border-radius: 10px;
  background: var(--cc-bg-code);
  text-align: left;
}
.cc-code-preview .header {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--cc-border);
  background: var(--cc-bg-card);
}
.cc-code-preview .header .filename { font-family: var(--font-mono, monospace); font-size: 0.8rem; color: var(--cc-text-muted); }
.cc-code-language { font-family: var(--font-mono, monospace); font-size: 0.7rem; font-weight: 600; color: var(--cc-text-muted); }
.cc-code-preview pre { margin: 0; border: none; border-radius: 0; box-shadow: none; }
.cc-code-preview pre::before { display: none; }
.cc-home-example { width: 100%; max-width: none; }

.cc-home-section { max-width: 76rem; margin: 0 auto clamp(4rem, 8vw, 7rem); }
.cc-home-section-heading {
  display: grid;
  grid-template-columns: minmax(14rem, 0.45fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: end;
  margin-bottom: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--cc-border-strong);
}
.cc-home-section-heading h2 { margin: 0; font-size: 1.65rem; text-wrap: balance; }
.cc-home-section-heading p { max-width: 42rem; margin: 0; color: var(--cc-text-secondary); font-size: 1rem; line-height: 1.65; text-wrap: pretty; }

.cc-runtime-stage {
  display: grid;
  grid-template-columns: minmax(12rem, 0.34fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: start;
  padding: 1.5rem 0;
  border-top: 1px solid var(--cc-border);
}
.cc-runtime-stage:last-child { border-bottom: 1px solid var(--cc-border); }
.cc-runtime-stage-copy h3 { margin: 0 0 0.4rem; font-size: 1.1rem; }
.cc-runtime-stage-copy p { margin: 0; color: var(--cc-text-secondary); font-size: 0.95rem; line-height: 1.6; }
.cc-runtime-stage .cc-code-preview { width: 100%; max-width: 54rem; }

.cc-guide-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 6vw, 5rem); }
.cc-guide-group h3 { margin: 0 0 0.75rem; font-size: 1.1rem; color: var(--cc-text-secondary); }
.cc-guide-link {
  display: grid;
  gap: 0.25rem;
  min-height: 4.75rem;
  padding: 1rem 0.25rem;
  border-top: 1px solid var(--cc-border);
  border-radius: 6px;
  text-decoration: none !important;
  transition: background-color 0.18s ease-out;
}
.cc-guide-group .cc-guide-link:last-child { border-bottom: 1px solid var(--cc-border); }
.cc-guide-link:hover { background: var(--cc-bg-hover); }
.cc-guide-link strong { color: var(--cc-text-bright); font-size: 1rem; }
.cc-guide-link span { color: var(--cc-text-secondary); font-size: 0.9rem; line-height: 1.5; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

@media (max-width: 960px) {
  .cc-home-hero { grid-template-columns: 1fr; max-width: 50rem; }
  .cc-home-wordmark img { width: min(100%, 26rem); }
}
@media (max-width: 768px) {
  .cc-home-section-heading,
  .cc-runtime-stage { grid-template-columns: 1fr; gap: 1rem; }
  .cc-guide-groups { grid-template-columns: 1fr; }
}
@media (max-width: 576px) {
  .cc-home-hero { margin-top: 0; }
  .cc-home-lead { font-size: 1.05rem; }
  .cc-home-actions { display: grid; grid-template-columns: 1fr; }
  .cc-btn { width: 100%; justify-content: center; }
}

/* Bootstrap Icons that DocFX's docfx.min.js injects dynamically.
   We don't ship the Bootstrap Icons font, so render these few glyphs as
   inline SVG masks (currentColor) instead. */
.bi { display: inline-block; width: 1em; height: 1em; vertical-align: -.125em; background-color: currentColor; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.bi::before { content: ""; }
.bi-chevron-left{ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E"); }
.bi-chevron-right{ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E"); }
.bi-filter{ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3'/%3E%3C/svg%3E"); }
.bi-clipboard{ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3C/svg%3E"); }
.bi-check-lg{ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }

/* DocFX-injected utility classes (formerly Bootstrap) — minimal compat */
.text-break { overflow-wrap: anywhere; }
.flex-fill { flex: 1 1 auto; min-height: 0; }
.text-body-tertiary { color: var(--cc-text-muted); }
.link-body-emphasis, .link-secondary { color: var(--cc-text-muted); }
.cc-article .external { color: var(--cc-link); }

/* ─────────────────────────────────────────────────────────────────────────
   Protocol-style layout: fixed full-height sidebar + top bar + content
   ───────────────────────────────────────────────────────────────────────── */

#cc-toc { scrollbar-width: thin; }
#cc-toc::-webkit-scrollbar { width: 8px; }
#cc-toc::-webkit-scrollbar-thumb { background: var(--cc-border); border-radius: 8px; }

/* Sidebar navigation (custom-rendered, docs + api) */
.cc-toc-section + .cc-toc-section { margin-top: 1.5rem; }
.cc-toc-group { font-size: 0.875rem; line-height: 1.25; font-weight: 700; color: var(--cc-text-bright); margin: 0 0 0.5rem; padding: 0 0.5rem; }
.cc-toc-list { list-style: none; padding: 0; margin: 0; }
.cc-toc-root { margin-left: 0.5rem; padding-left: 0.5rem; border-inline-start: 1px solid var(--cc-border); }
.cc-toc-item { margin: 0; position: relative; }
.cc-toc-link {
  display: flex; min-height: 2.75rem; align-items: center; padding: 0.5rem 0.75rem; font-size: 0.875rem; line-height: 1.35;
  color: var(--cc-text-secondary); text-decoration: none; border-radius: 0.5rem;
  transition: color 0.15s, background 0.15s;
}
.cc-toc-link:hover { color: var(--cc-text-bright); background: var(--cc-bg-hover); }
.cc-toc-link.active { color: var(--cc-link); font-weight: 700; background: rgba(43, 184, 168, 0.10); }
.cc-toc-heading { color: var(--cc-text-muted); font-weight: 700; text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.05em; cursor: default; }

.cc-toc-expandable { display: flex; flex-wrap: wrap; align-items: center; }
.cc-toc-expandable > .cc-toc-link { flex: 1 1 auto; padding-left: 0.5rem; min-width: 0; }
.cc-toc-toggle {
  background: transparent; border: none; cursor: pointer; color: var(--cc-text-muted);
  padding: 0.5rem; width: 2.75rem; min-height: 2.75rem; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; border-radius: 4px;
}
.cc-toc-toggle:hover { color: var(--cc-text); }
.cc-toc-link:focus-visible,
.cc-toc-toggle:focus-visible { outline: 2px solid var(--cc-link); outline-offset: 1px; }
.cc-toc-toggle svg { transition: transform 0.15s; width: 0.85rem; height: 0.85rem; }
.cc-toc-toggle.open svg { transform: rotate(90deg); }
.cc-toc-children { width: 100%; padding-left: 0.75rem; margin-top: 0.25rem; }

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .cc-toc-link { min-height: 2rem; padding: 0.25rem 0.5rem; }
  .cc-toc-toggle { width: 2rem; min-height: 2rem; padding: 0.25rem; }
}

/* Inner content container + landing override */
body[data-layout="landing"] .cc-prose { max-width: none; }
body[data-layout="landing"] .cc-affix { display: none !important; }
