@charset "utf-8";

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
  color: #111827;
  background: #f1f5f9;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  padding: 0.5rem 1rem;
  background: #ffffff;
  border: 1px solid #e2e6ee;
  border-radius: 10px;
  z-index: 100;
}

.skip-link:focus {
  left: 1rem;
}

.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

/* Single header row: brand + doc toolbar selects */
.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: #0f172a;
  text-decoration: none;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.site-brand--logo-only {
  gap: 0;
}

.site-brand__logo {
  display: block;
  flex-shrink: 0;
}

/* path_light vs path_dark in _config.yml — hide dark variant in light UI, swap in dark */
.site-brand__logo--dark {
  display: none;
}

html[data-theme="dark"] .site-brand__logo--light {
  display: none;
}

html[data-theme="dark"] .site-brand__logo--dark {
  display: block;
}

.site-brand:hover {
  color: #1d4ed8;
}

/* Doc toolbar: three selects (hints via title on hover; aria-label for AT) */
.doc-toolbar {
  flex: 1 1 280px;
  min-width: 0;
  border-top: none;
  background: transparent;
}

.doc-toolbar__controls {
  display: flex;
  align-items: center;
  gap: 1rem 1.25rem;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
}

.doc-toolbar__field {
  min-width: min(100%, 200px);
}

.doc-toolbar__field--version {
  min-width: min(100%, 240px);
}

.doc-toolbar__field--theme {
  min-width: min(100%, 120px);
  max-width: 180px;
}

.toolbar-select-wrap {
  position: relative;
  width: 100%;
}

.toolbar-select-wrap::after {
  content: "";
  position: absolute;
  right: 0.75rem;
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: -0.2rem;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  pointer-events: none;
  opacity: 0.85;
}

.toolbar-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  margin: 0;
  padding: 0.5rem 2.25rem 0.5rem 0.75rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.toolbar-select:hover:not(:disabled) {
  border-color: #94a3b8;
}

.toolbar-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.toolbar-select--empty {
  opacity: 0.65;
  cursor: not-allowed;
  background: #f8fafc;
}

.sidebar__hint--toolbar {
  font-size: 0.82rem;
  line-height: 1.45;
  margin: 0;
}

.layout--has-doc-toolbar .sidebar {
  top: 5.25rem;
  max-height: calc(100vh - 6.25rem);
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
}

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

  .sidebar {
    position: static;
  }
}

.sidebar {
  position: sticky;
  top: 4.75rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  font-size: 0.92rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar__version-nav {
  margin-bottom: 1.15rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e6ee;
}

.sidebar__section-title {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5c6578;
  font-weight: 600;
}

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

.sidebar__version-item {
  margin: 0.25rem 0;
}

.sidebar__version-link {
  color: #2563eb;
  text-decoration: none;
  display: inline-block;
  padding: 0.2rem 0;
  border-radius: 4px;
}

.sidebar__version-link:hover {
  text-decoration: underline;
}

.sidebar__version-text {
  font-weight: 600;
  color: #1a1d26;
}

.sidebar__heading {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5c6578;
  font-weight: 600;
}

.sidebar__block + .sidebar__block {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e6ee;
}

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

.sidebar__list li {
  margin: 0.2rem 0;
}

.sidebar__list a {
  color: #2563eb;
  text-decoration: none;
  display: inline-block;
  padding: 0.2rem 0;
  border-radius: 4px;
}

.sidebar__list a:hover {
  text-decoration: underline;
}

.sidebar__list a.is-active {
  font-weight: 600;
  color: #1a1d26;
}

.sidebar__list--compact {
  font-size: 0.88rem;
}

.sidebar__hint {
  margin: 0 0 0.5rem;
  color: #5c6578;
  font-size: 0.85rem;
  line-height: 1.45;
}

.sidebar__hint code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: #f6f7f9;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.main-wrap {
  min-width: 0;
}

.breadcrumbs {
  margin: 0 0 1rem;
}

.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.88rem;
  color: #5c6578;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.breadcrumbs li::before {
  content: "\203a";
  color: #94a3b8;
  font-size: 0.95em;
  margin-right: 0.2rem;
}

.breadcrumbs li:first-child::before {
  content: none;
}

.breadcrumbs__text {
  color: #64748b;
}

.content {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.65rem 1.85rem 2.25rem;
  min-height: 40vh;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.content table th,
.content table td {
  border: 1px solid #e2e6ee;
  padding: 0.55rem 0.65rem;
  text-align: left;
}

.content table th {
  background: #f6f7f9;
}

.doc-header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e6ee;
}

.doc-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #5c6578;
  font-weight: 600;
}

.doc-title {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.doc-version {
  margin: 0.5rem 0 0;
  color: #5c6578;
  font-size: 0.95rem;
}

.version-chip {
  display: inline-block;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #e8f0f7;
  color: #1e5a8a;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}

.doc-body {
  max-width: 68ch;
}

.doc-body h2 {
  margin-top: 1.5rem;
  font-size: 1.2rem;
}

.doc-body h3 {
  margin-top: 1.15rem;
  font-size: 1.05rem;
}

.doc-body pre,
.doc-body code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
}

/* Plain fenced blocks (no Rouge) + default pre shell; highlighted blocks get bg from syntax.css */
.doc-body pre {
  background: #f6f8fa;
  color: #24292f;
  padding: 1rem 1.1rem;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
}

html[data-theme="dark"] .doc-body pre {
  background: #0f141c;
  color: #e8ecf1;
  border-color: #1e293b;
}

/* Kramdown + Rouge: token colors live in syntax.css; pre must not paint over spans */
.doc-body .highlighter-rouge {
  margin: 1rem 0;
  border-radius: 8px;
  overflow-x: auto;
}

.doc-body .highlighter-rouge .highlight {
  border-radius: 8px;
}

.doc-body .highlighter-rouge pre {
  background: transparent;
  color: inherit;
  margin: 0;
  border: none;
}

/* Must beat html[data-theme="dark"] .doc-body pre so the .highlight panel shows syntax.css bg */
html[data-theme="dark"] .doc-body .highlighter-rouge pre {
  background: transparent;
  color: inherit;
  border: none;
}

.doc-body code {
  background: #f6f7f9;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.doc-body pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.doc-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #e2e6ee;
}

/* Mermaid (assets/js/mermaid-init.js): fenced ```mermaid → .doc-mermaid
   .doc-body is 68ch wide; Mermaid's default useMaxWidth squeezes into that and clips labels — JS sets useMaxWidth: false; scroll here if needed. */
.doc-body .doc-mermaid {
  display: block;
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.doc-body .doc-mermaid svg {
  display: block;
  max-width: none;
  height: auto;
  overflow: visible;
}

/* If any diagram still uses HTML labels (foreignObject), avoid clipping */
.doc-body .doc-mermaid svg foreignObject {
  overflow: visible;
}

.doc-body .doc-mermaid .node rect,
.doc-body .doc-mermaid .node circle,
.doc-body .doc-mermaid .node polygon {
  overflow: visible;
}

html[data-theme="dark"] .doc-body .doc-mermaid {
  background: #0f172a;
  border-color: #334155;
}

.doc-body blockquote {
  margin: 1rem 0;
  padding: 0.5rem 0 0.5rem 1rem;
  border-left: 4px solid #e8f0f7;
  color: #5c6578;
}

/* Same max-width as .doc-body — aside is a sibling, not inside .doc-body, so it must be constrained or it spans the full .content card and looks broken */
.doc .doc-aside {
  max-width: 68ch;
}

.doc-aside {
  margin-top: 2rem;
  padding: 1rem 1.15rem 1.1rem;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.doc-aside h2 {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.doc-aside p {
  margin: 0 0 0.65rem;
  color: #5c6578;
}

.doc-aside ul {
  margin: 0;
  padding-left: 1.2rem;
}

.doc-aside li {
  margin: 0.25rem 0;
}

.doc-aside--functional {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #22c55e;
}

.doc-aside--technical {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #6366f1;
}

html[data-theme="dark"] .doc-aside h2 {
  color: #94a3b8;
}

html[data-theme="dark"] .doc-aside p {
  color: #94a3b8;
}

html[data-theme="dark"] .doc-aside--functional {
  background: #0f172a;
  border-color: #334155;
  border-left-color: #22c55e;
}

html[data-theme="dark"] .doc-aside--technical {
  background: #0f172a;
  border-color: #334155;
  border-left-color: #818cf8;
}

.site-footer {
  margin-top: 1.25rem;
  padding: 0.75rem 0;
  font-size: 0.85rem;
  color: #5c6578;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.layout--functional .doc-kicker {
  color: #1f6b4a;
}

.layout--technical .doc-kicker {
  color: #4b3d8a;
}

/* Anchor offset under sticky header (PDF-style jump links) */
#main h2,
#main h3,
.content h2,
.content h3 {
  scroll-margin-top: 6.5rem;
}

/* Sidebar: search + outline (TOC from headings) */
.sidebar__label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.sidebar__search-block {
  margin-bottom: 1.15rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.sidebar__search-wrap {
  position: relative;
}

.sidebar__search-input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.875rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
}

.sidebar__search-input::placeholder {
  color: #94a3b8;
}

.sidebar__search-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  max-height: 16rem;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12);
  padding: 0.35rem 0;
}

.search-results__msg {
  margin: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  color: #64748b;
}

.search-results__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.search-results__list a {
  display: block;
  padding: 0.45rem 0.75rem;
  font-size: 0.84rem;
  color: #1e40af;
  text-decoration: none;
}

.search-results__list a:hover {
  background: #eff6ff;
}

.search-results__list li + li {
  border-top: 1px solid #f1f5f9;
}

.toc-nav__title {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  font-weight: 600;
}

.toc-nav__empty {
  margin: 0;
  font-size: 0.82rem;
  color: #94a3b8;
}

.toc-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-nav__item {
  margin: 0.15rem 0;
}

.toc-nav__item--h3 {
  padding-left: 0.65rem;
  border-left: 2px solid #e2e8f0;
  margin-left: 0.15rem;
}

.toc-nav__link {
  display: block;
  padding: 0.25rem 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: #475569;
  text-decoration: none;
  border-radius: 4px;
}

.toc-nav__link:hover {
  color: #1d4ed8;
}

.toc-nav__item--h2 > .toc-nav__link {
  font-weight: 500;
  color: #334155;
}

/* --- Dark theme (effective palette; preference stored as data-theme-pref on <html>) --- */
html[data-theme="dark"] body {
  color: #e5e7eb;
  background: #0f172a;
}

html[data-theme="dark"] .site-header {
  background: #1e293b;
  border-bottom-color: #334155;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .site-brand {
  color: #f1f5f9;
}

html[data-theme="dark"] .site-brand:hover {
  color: #93c5fd;
}

html[data-theme="dark"] .toolbar-select {
  color: #e2e8f0;
  background: #0f172a;
  border-color: #475569;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .toolbar-select:hover:not(:disabled) {
  border-color: #64748b;
}

html[data-theme="dark"] .toolbar-select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
}

html[data-theme="dark"] .toolbar-select--empty {
  background: #1e293b;
  color: #94a3b8;
}

html[data-theme="dark"] .toolbar-select-wrap::after {
  border-color: #94a3b8;
}

html[data-theme="dark"] .sidebar {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .sidebar__version-nav,
html[data-theme="dark"] .sidebar__search-block {
  border-bottom-color: #334155;
}

html[data-theme="dark"] .sidebar__section-title,
html[data-theme="dark"] .sidebar__heading,
html[data-theme="dark"] .sidebar__label,
html[data-theme="dark"] .toc-nav__title {
  color: #94a3b8;
}

html[data-theme="dark"] .sidebar__search-input {
  background: #0f172a;
  border-color: #475569;
  color: #e2e8f0;
}

html[data-theme="dark"] .sidebar__search-input:focus {
  background: #1e293b;
  border-color: #60a5fa;
}

html[data-theme="dark"] .sidebar__list a,
html[data-theme="dark"] .sidebar__version-link {
  color: #93c5fd;
}

html[data-theme="dark"] .sidebar__list a.is-active {
  color: #f1f5f9;
}

html[data-theme="dark"] .sidebar__version-text {
  color: #e2e8f0;
}

html[data-theme="dark"] .sidebar__hint,
html[data-theme="dark"] .sidebar__hint code {
  color: #94a3b8;
}

html[data-theme="dark"] .sidebar__hint code {
  background: #0f172a;
}

html[data-theme="dark"] .breadcrumbs,
html[data-theme="dark"] .breadcrumbs__text {
  color: #94a3b8;
}

html[data-theme="dark"] .content {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .doc-kicker {
  color: #94a3b8;
}

html[data-theme="dark"] .doc-title {
  color: #f8fafc;
}

html[data-theme="dark"] .doc-version {
  color: #94a3b8;
}

html[data-theme="dark"] .doc-body code {
  background: #0f172a;
  color: #e2e8f0;
}

html[data-theme="dark"] .doc-body table th,
html[data-theme="dark"] .doc-body table td {
  border-color: #334155;
}

html[data-theme="dark"] .doc-body table th {
  background: #0f172a;
}

html[data-theme="dark"] .doc-body img {
  border-color: #334155;
}

html[data-theme="dark"] .doc-body blockquote {
  border-left-color: #334155;
  color: #94a3b8;
}

html[data-theme="dark"] .version-chip {
  background: #1e3a5f;
  color: #93c5fd;
}

html[data-theme="dark"] .site-footer {
  color: #94a3b8;
}

html[data-theme="dark"] .search-results {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .search-results__list a {
  color: #93c5fd;
}

html[data-theme="dark"] .search-results__list a:hover {
  background: #334155;
}

html[data-theme="dark"] .search-results__list li + li {
  border-top-color: #334155;
}

html[data-theme="dark"] .toc-nav__link {
  color: #cbd5e1;
}

html[data-theme="dark"] .toc-nav__link:hover {
  color: #93c5fd;
}

html[data-theme="dark"] .toc-nav__item--h3 {
  border-left-color: #475569;
}

html[data-theme="dark"] .toc-nav__item--h2 > .toc-nav__link {
  color: #e2e8f0;
}

html[data-theme="dark"] .toc-nav__empty {
  color: #64748b;
}

html[data-theme="dark"] .skip-link {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}
