/* ================================================================ THEMES ================================================================ */

/* ----- LIGHT THEME (Default) ----- */
:root {
  color-scheme: light;
  --paper: #ecebff91;
  --panel: #e4ddf1;
  --general-background: #f9ede0;
  --toolbar-background: #e9ddcf;
  --content-background: #fff4e9;
  --bg-surface: #ffffff;
  --bg-button: #02090f;
  --color-button: #e0e6ec;
  --panel-solid: #dee5ff;
  --sunken: #ffffff;
  --veil: rgba(246, 248, 249, 0.82);
  --ink: #101a22;
  --ink-2: #02090f;
  --muted: #262d32;
  --rule: #96a4ac;
  --rule-firm: #666f74;
  --accent: #0b3d33;
  --accent-lift: #0d5c4b;
  --accent-wash: rgba(18, 112, 92, 0.08);
  --danger: #a3271f;
  --shadow-sm: 0 1px 2px rgba(27, 31, 35, 0.05);
  --shadow-lg: 0 24px 60px -28px rgba(16, 26, 34, 0.45);
  --sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono",
    monospace;
  --bar: 3.5rem;
  --code-bg: #202131;
  --code-plain: orange;
  --code-com: #5f8296;
  --code-str: #8ce99a;
  --code-key: #7cc7ff;
  --code-fun: #c4b5ff;
  --code-var: #f8a5c2;
  --code-typ: #ffd08a;
  --code-num: #ffd08a;
  --code-tag: #7cc7ff;
  --code-att: #c4b5ff;
  --code-prop: #8ce99a;
  --code-sel: #ffd08a;
  --code-op: #9fb6c4;
}

/* ----- LIGHT GRAY THEME ----- */
:root[data-theme="light-gray"] {
  color-scheme: light;
  --paper: #f0f0f0;
  --panel: #e8e8e8;
  --general-background: #f5f5f5;
  --toolbar-background: #ebebeb;
  --content-background: #fafafa;
  --bg-surface: #ffffff;
  --bg-button: #2d2d2d;
  --color-button: #f0f0f0;
  --panel-solid: #e0e0e0;
  --sunken: #ffffff;
  --veil: rgba(245, 245, 245, 0.82);
  --ink: #1a1a1a;
  --ink-2: #0d0d0d;
  --muted: #4d4d4d;
  --rule: #cccccc;
  --rule-firm: #999999;
  --accent: #3d3d3d;
  --accent-lift: #555555;
  --accent-wash: rgba(61, 61, 61, 0.08);
  --danger: #a3271f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 24px 60px -28px rgba(0, 0, 0, 0.35);
  --code-bg: #202131;
  --code-plain: orange;
  --code-com: #5f8296;
  --code-str: #8ce99a;
  --code-key: #7cc7ff;
  --code-fun: #c4b5ff;
  --code-var: #f8a5c2;
  --code-typ: #ffd08a;
  --code-num: #ffd08a;
  --code-tag: #7cc7ff;
  --code-att: #c4b5ff;
  --code-prop: #8ce99a;
  --code-sel: #ffd08a;
  --code-op: #9fb6c4;
}

/* ----- LIGHT BLUE THEME ----- */
:root[data-theme="light-blue"] {
  color-scheme: light;
  --paper: #e8f0fe;
  --panel: #d4e4f7;
  --general-background: #eef5fb;
  --toolbar-background: #dce8f5;
  --content-background: #f5f9ff;
  --bg-surface: #ffffff;
  --bg-button: #0a2a4a;
  --color-button: #e0ecf5;
  --panel-solid: #c8ddf0;
  --sunken:  #edf7ff;
  --veil: rgba(232, 240, 254, 0.82);
  --ink: #0a1e2e;
  --ink-2: #05121e;
  --muted: #3a5a7a;
  --rule: #8ab0d4;
  --rule-firm: #5a8ab0;
  --accent: #0a4a7a;
  --accent-lift: #1a6a9a;
  --accent-wash: rgba(10, 74, 122, 0.08);
  --danger: #a3271f;
  --shadow-sm: 0 1px 2px rgba(10, 30, 46, 0.05);
  --shadow-lg: 0 24px 60px -28px rgba(10, 30, 46, 0.45);
  --code-bg: #0a1e2e;
  --code-plain: #8ab0d4;
  --code-com: #5a8ab0;
  --code-str: #8ce99a;
  --code-key: #7cc7ff;
  --code-fun: #c4b5ff;
  --code-var: #f8a5c2;
  --code-typ: #ffd08a;
  --code-num: #ffd08a;
  --code-tag: #7cc7ff;
  --code-att: #c4b5ff;
  --code-prop: #8ce99a;
  --code-sel: #ffd08a;
  --code-op: #9fb6c4;
}

/* ----- DARK THEME ----- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0b1116;
  --panel: #10181f;
  --general-background: #0b1116;
  --toolbar-background: #0b1116;
  --content-background: #0b1116;
  --bg-surface: #1a2530;
  --panel-solid: #10181f;
  --sunken: #0a1117;
  --veil: rgba(11, 17, 22, 0.78);
  --ink: #e4edf3;
  --ink-2: #b4c3ce;
  --muted: #b4c5d1;
  --rule: #7b96ab;
  --rule-firm: #869aa9;
  --accent: #4fd1aa;
  --accent-lift: #6fdcbb;
  --accent-wash: rgba(79, 209, 170, 0.13);
  --danger: #ff9c8f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px -28px rgba(0, 0, 0, 0.75);
  --code-bg: #0a151f;
  --code-plain: #e4edf3;
  --code-com: #5f8296;
  --code-str: #8ce99a;
  --code-key: #7cc7ff;
  --code-fun: #c4b5ff;
  --code-var: #f8a5c2;
  --code-typ: #ffd08a;
  --code-num: #ffd08a;
  --code-tag: #7cc7ff;
  --code-att: #c4b5ff;
  --code-prop: #8ce99a;
  --code-sel: #ffd08a;
  --code-op: #9fb6c4;
}

/* ----- DARK GRAY THEME ----- */
:root[data-theme="dark-gray"] {
  color-scheme: dark;
  --paper: #0d0d0d;
  --panel: #1a1a1a;
  --general-background: #0d0d0d;
  --toolbar-background: #0d0d0d;
  --content-background: #0d0d0d;
  --bg-surface: #1a1a1a;
  --bg-button: #2d2d2d;
  --color-button: #e0e0e0;
  --panel-solid: #1a1a1a;
  --sunken: #0a0a0a;
  --veil: rgba(13, 13, 13, 0.78);
  --ink: #e6e6e6;
  --ink-2: #b3b3b3;
  --muted: #fde3e3;
  --rule: #404040;
  --rule-firm: #555555;
  --accent: #6b6b6b;
  --accent-lift: #8a8a8a;
  --accent-wash: rgba(107, 107, 107, 0.13);
  --danger: #ff6b6b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 60px -28px rgba(0, 0, 0, 0.85);
  --code-bg: #0a0a0a;
  --code-plain: #e6e6e6;
  --code-com: #666666;
  --code-str: #8ce99a;
  --code-key: #7cc7ff;
  --code-fun: #c4b5ff;
  --code-var: #f8a5c2;
  --code-typ: #ffd08a;
  --code-num: #ffd08a;
  --code-tag: #7cc7ff;
  --code-att: #c4b5ff;
  --code-prop: #8ce99a;
  --code-sel: #ffd08a;
  --code-op: #9fb6c4;
}

/* ----- DARK BLUE THEME ----- */
:root[data-theme="dark-blue"] {
  color-scheme: dark;
  --paper: #0a1628;
  --panel: #0f1f3a;
  --general-background: #0a1628;
  --toolbar-background: #0a1628;
  --content-background: #0a1628;
  --bg-surface: #142a4a;
  --bg-button: #1a3a5a;
  --color-button: #c8dce8;
  --panel-solid: #0f1f3a;
  --sunken: #06101f;
  --veil: rgba(10, 22, 40, 0.78);
  --ink: #d4e4f0;
  --ink-2: #a8c4d8;
  --muted: #d3d3d3;
  --rule: #2a4a6a;
  --rule-firm: #3a5a7a;
  --accent: #4d9fd9;
  --accent-lift: #6db5e8;
  --accent-wash: rgba(77, 159, 217, 0.13);
  --danger: #ff8a7a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 60px -28px rgba(0, 0, 0, 0.8);
  --code-bg: #06101f;
  --code-plain: #d4e4f0;
  --code-com: #4a6a8a;
  --code-str: #8ce99a;
  --code-key: #7cc7ff;
  --code-fun: #c4b5ff;
  --code-var: #f8a5c2;
  --code-typ: #ffd08a;
  --code-num: #ffd08a;
  --code-tag: #7cc7ff;
  --code-att: #c4b5ff;
  --code-prop: #8ce99a;
  --code-sel: #ffd08a;
  --code-op: #9fb6c4;
}

/* ----- SEPIA THEME ----- */
:root[data-theme="sepia"] {
  color-scheme: light;
  --paper: #f4e8d8;
  --panel: #e8d5b8;
  --general-background: #f2e3cf;
  --toolbar-background: #e8d5b8;
  --content-background: #faf0e1;
  --bg-surface: #fdf6ed;
  --bg-button: #5a3e2b;
  --color-button: #f5ede6;
  --panel-solid: #e8d5b8;
  --sunken: #eae3da;
  --veil: rgba(244, 232, 216, 0.82);
  --ink: #3d2b1f;
  --ink-2: #2b1f16;
  --muted: #6b5a4a;
  --rule: #b8a48c;
  --rule-firm: #8a7a68;
  --accent: #8b5e3c;
  --accent-lift: #a8734a;
  --accent-wash: rgba(139, 94, 60, 0.12);
  --danger: #8b3a2a;
  --shadow-sm: 0 1px 2px rgba(61, 43, 31, 0.08);
  --shadow-lg: 0 24px 60px -28px rgba(61, 43, 31, 0.4);
  --code-bg: #2d241c;
  --code-plain: #e8d5b8;
  --code-com: #8a7a68;
  --code-str: #b8a48c;
  --code-key: #d4b896;
  --code-fun: #c9b89c;
  --code-var: #e8c9a8;
  --code-typ: #d4b896;
  --code-num: #e8c9a8;
  --code-tag: #d4b896;
  --code-att: #c9b89c;
  --code-prop: #b8a48c;
  --code-sel: #e8c9a8;
  --code-op: #b8a48c;
}

/* ----- FOREST THEME ----- */
:root[data-theme="forest"] {
  color-scheme: dark;
  --paper: #0d1a12;
  --panel: #142818;
  --general-background: #0d1a12;
  --toolbar-background: #0d1a12;
  --content-background: #0d1a12;
  --bg-surface: #1a2d20;
  --bg-button: #2d4a38;
  --color-button: #d4e8dc;
  --panel-solid: #142818;
  --sunken: #0a1a10;
  --veil: rgba(13, 26, 18, 0.78);
  --ink: #d4e8dc;
  --ink-2: #a8c4b4;
  --muted: #bbd9c8;
  --rule: #2d4a38;
  --rule-firm: #3d5a48;
  --accent: #5dbf8a;
  --accent-lift: #7ad4a0;
  --accent-wash: rgba(93, 191, 138, 0.15);
  --danger: #e88a7a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 60px -28px rgba(0, 0, 0, 0.8);
  --code-bg: #0a1a10;
  --code-plain: #d4e8dc;
  --code-com: #4a6a58;
  --code-str: #8ad4a8;
  --code-key: #7cc7ff;
  --code-fun: #b8d49c;
  --code-var: #f8a5c2;
  --code-typ: #ffd08a;
  --code-num: #ffd08a;
  --code-tag: #7cc7ff;
  --code-att: #b8d49c;
  --code-prop: #8ad4a8;
  --code-sel: #ffd08a;
  --code-op: #6a8a78;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-lift);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ----------------------------------------------------------------- shell -- */
.doc-menu-state {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.doc-shell {
  display: flex;
  min-height: 100vh;
  background: var(--general-background);
}

.doc-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 80;
  padding: 0.6rem 1rem;
  background: var(--panel);
  border-radius: 0 0 8px 0;
}

.doc-skip:focus {
  left: 0;
  top: 0;
}

.doc-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 18.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem 1rem 2rem;
  overflow-y: auto;
  border-right: 1px solid var(--rule);
  transform: translateX(-101%);
  background: var(--general-background);
}

.doc-sidebar-header {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.doc-brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.doc-brand {
  display: block;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.015em;
  font-size: 1.1rem;
  text-decoration: none;
}

.doc-brand:hover {
  color: var(--accent);
}

.doc-version-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.6rem;
  font-size: 0.65rem;
  font-weight: 600;
  font-family: var(--mono);
  color: var(--muted);
  background: var(--sunken);
  border-radius: 20px;
  border: 1px solid var(--rule);
  letter-spacing: 0.02em;
}

.doc-tagline {
  font-size: 0.78rem;
  margin: 0.15rem 0 0;
  opacity: 0.7;
}

.doc-sidebar-tools {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.doc-search-wrapper {
  position: relative;
  flex: none;
}

.doc-search-input {
  width: 100%;
  padding: 0.5rem 2.1rem 0.5rem 0.75rem;
  font: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--sunken);
  border: 1px solid var(--rule);
  border-radius: 8px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  box-shadow: rgb(119 126 132) 0px 4px 0px;
}

.doc-search-input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.doc-search-input:focus {
  outline: none;
  background: var(--panel);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.doc-search-key {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0 0.35rem;
  pointer-events: none;
  background: var(--general-background);
  opacity: 0.6;
}

.doc-search-input:focus ~ .doc-search-key {
  display: none;
}

.doc-btn-empty {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.doc-btn-empty:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-wash);
}

.doc-btn-empty .btn-label {
  display: inline;
}

.doc-nav-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -0.35rem;
  padding: 0.25rem 0.35rem 0;
}

.doc-nav-scroll::-webkit-scrollbar {
  width: 4px;
}

.doc-nav-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.doc-nav-scroll::-webkit-scrollbar-thumb {
  background: var(--rule);
  border-radius: 10px;
}

/* Navigation Tree */
#doc-tree {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-radius: 12px;
}

.doc-group {
  margin-bottom: 0.1rem;
}

.doc-group--folder {
  margin-bottom: 0.1rem;
}

.doc-group--root {
  margin-bottom: 0.25rem;
  border-radius: 12px;
  padding: 1rem 0.5rem;
  border: solid thin var(--rule);
}

.doc-group-summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.3rem;
  border-radius: 6px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: 0.85rem;
  color: var(--ink-2);
  transition: background 0.15s;
  border: solid thin #acbfc6;
}

.doc-group-summary:hover {
  background: var(--sunken);
  border: solid thin;
}

.doc-group-summary::-webkit-details-marker {
  display: none;
}

.doc-group-summary::marker {
  content: "";
}

.doc-group-icon {
  display: inline-flex;
  flex: none;
  color: var(--muted);
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 0.3rem;
}

.doc-group-icon svg {
  width: 18px;
  height: 18px;
}

details[open] > .doc-group-summary .doc-group-icon {
  color: var(--accent);
}

.doc-group-name {
  flex: 1;
  font-size: 0.9rem;
  color: var(--ink);
}

.doc-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--sunken);
  border-radius: 12px;
  border: 1px solid var(--rule);
}

details[open] > .doc-group-summary .doc-group-count {
  background: var(--accent-wash);
  color: var(--accent);
  border-color: var(--accent);
}

.doc-folder-del {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}

.doc-group-summary:hover .doc-folder-del {
  opacity: 0.5;
}

.doc-folder-del:hover {
  opacity: 1 !important;
  color: var(--danger);
  background: var(--sunken);
}

.doc-folder-del svg {
  width: 14px;
  height: 14px;
}

/* Group Items */
.doc-group-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.doc-group--folder .doc-group-items {
  padding-left: 1.5rem;
  border-left: 1px solid var(--rule);
  margin-left: 0.6rem;
}

.doc-page-item {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.05rem 0;
  position: relative;
}

.doc-page-item:hover {
  border: solid thin;
  border-radius: 6px;
}

.doc-page-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.15s;
}

.doc-page-link:hover {
  background: var(--sunken);
  color: var(--ink);
}

.doc-page-item--active .doc-page-link {
  background: var(--accent-wash);
  color: var(--accent);
  font-weight: 500;
}

.doc-page-item--active .doc-page-link::before {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 1.2rem;
  border-radius: 2px;
  background: var(--accent);
}

.doc-page-icon {
  display: inline-flex;
  flex: none;
  opacity: 0.5;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
}

.doc-page-item--active .doc-page-icon {
  color: var(--accent);
  opacity: 0.8;
}

.doc-page-icon svg {
  width: 18px;
  height: 18px;
}

.doc-page-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-page-move {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 0.15rem;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}

.doc-page-item:hover .doc-page-move {
  opacity: 0.4;
}

.doc-page-move:hover {
  opacity: 1 !important;
  color: var(--accent);
  background: var(--sunken);
}

.doc-page-move svg {
  width: 14px;
  height: 14px;
}

.doc-empty {
  margin: 0;
  padding: 0.9rem;
  border: 1px dashed var(--rule-firm);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.doc-empty code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--sunken);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

/* Search results */
.doc-results {
  list-style: none;
  margin: 0;
  padding: 0;
}

.doc-results li {
  margin-bottom: 0.1rem;
}

.doc-result {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
}

.doc-result:hover {
  background: var(--accent-wash);
  color: var(--ink);
}

.doc-result .r-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.3;
}

.doc-result .r-path {
  display: block;
  margin: 0.05rem 0 0.15rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
}

.doc-result .r-snippet {
  display: block;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
}

.doc-result mark {
  background: var(--accent-wash);
  color: var(--accent);
  border-radius: 2px;
  padding: 0 0.1em;
}

.doc-search-note {
  margin: 0;
  padding: 0.6rem 0.2rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 899.98px) {
  .doc-menu-state:checked ~ .doc-shell .doc-sidebar {
    transform: none;
    box-shadow: var(--shadow-lg);
  }
  .doc-menu-state:checked ~ .doc-shell .doc-scrim {
    opacity: 1;
    pointer-events: auto;
  }
}

.doc-scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(6, 12, 17, 0.5);
  opacity: 0;
  pointer-events: none;
}

.doc-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.doc-cols {
  display: flex;
  flex: 1;
  min-width: 0;
}

.doc-main {
  flex: 1;
  min-width: 0;
  padding: 2rem;
  overflow-x: scroll;
}

/* --------------------------------------------------------------- app bar -- */
.doc-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--bar);
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  background: var(--general-background);
  font-size: 14px;
  font-weight: 500;
  box-shadow: rgba(99, 99, 99, 0.2) 0px 1px 0px 0px;
}

@supports (
  (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))
) {
  .doc-topbar {
    -webkit-backdrop-filter: saturate(1.6) blur(12px);
    backdrop-filter: saturate(1.6) blur(12px);
  }
}

.doc-crumb {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}

.doc-crumb .node {
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-crumb .sep {
  display: flex;
  align-items: center;
  opacity: 0.4;
}

.doc-crumb .sep svg {
  width: 13px;
  height: 13px;
  stroke-width: 2;
}

.doc-crumb .leaf {
  color: var(--ink-2);
  font-weight: 500;
  max-width: 24ch;
}

.doc-bar-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: none;
  border: none;
  border-radius: 4rem;
  padding-inline: 12px;
  box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;
}

.doc-bar-rule {
  width: 1px;
  height: 1.4rem;
  background: var(--rule-firm);
  margin: 0 0.2rem;
}

/* --------------------------------------------------------------- buttons -- */
.doc-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.52rem 0.8rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.2;
  height: 35px;
}

.doc-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-wash);
}

.doc-btn:active {
  transform: translateY(1px);
}

.doc-btn.active {
  background: var(--general-background, #fff);
  opacity: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  color: var(--accent-color, #0073aa);
}

.doc-btn:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
  border-color: var(--rule);
  color: var(--muted);
  background: var(--panel);
}

.doc-btn--icon {
  padding: 0.42rem;
  border-radius: 9px;
}

.doc-btn--primary {
  background: var(--bg-button);
  border-color: var(--accent);
  color: var(--color-button);
}

.doc-btn--primary:hover {
  background: var(--accent-lift);
  border-color: var(--accent-lift);
  color: #fff;
}

:root[data-theme="dark"] .doc-btn--primary:hover {
  color: #05231c;
}

.doc-btn--danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: transparent;
}

.doc-btn svg {
  flex: none;
}

#doc-theme .i-sun {
  display: none;
}

:root[data-theme="dark"] #doc-theme .i-moon {
  display: none;
}

:root[data-theme="dark"] #doc-theme .i-sun {
  display: inline-flex;
}

#doc-theme span {
  display: inline-flex;
}

.doc-menu-btn {
  display: inline-flex;
}

.doc-menu-state:focus-visible ~ .doc-shell .doc-menu-btn {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------- body -- */
.doc-body > *:first-child {
  margin-top: 0;
}

.doc-body h1 {
  margin: 1.35rem 0 1.35rem;
  font-size: clamp(1.95rem, 1.4rem + 1.6vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 690;
  text-wrap: balance;
}

.doc-body h2,
.doc-body h3 {
  scroll-margin-top: calc(var(--bar) + 1.25rem);
  position: relative;
}

.doc-body h2 {
  border-left: solid 2px var(--rule);
  padding-inline: 1rem;
  font-size: 1.34rem;
  letter-spacing: -0.02em;
  font-weight: 660;
  text-wrap: balance;
}

.doc-body h3 {
  margin: 2.1rem 0 0.65rem;
  font-size: 1.06rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.doc-body p {
  text-wrap: pretty;
}

.doc-body ul,
.doc-body ol {
  margin: 0 0 1.25rem;
  padding-left: 1.3rem;
}

.doc-body li {
  margin-bottom: 0.4rem;
}

.doc-body li::marker {
  color: var(--muted);
}

.doc-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent-wash);
}

.doc-body a:hover {
  text-decoration-color: currentColor;
}

.doc-body strong {
  font-weight: 650;
  color: var(--ink);
}

.doc-body hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.6rem 0;
}

.h-anchor {
  position: absolute;
  left: -1.15rem;
  top: auto;
  font-family: var(--mono);
  font-weight: 400;
  color: var(--rule-firm);
  text-decoration: none;
  opacity: 0;
}

.doc-body h2:hover .h-anchor,
.doc-body h3:hover .h-anchor,
.h-anchor:focus {
  opacity: 1;
}

.h-anchor:hover {
  color: var(--accent);
  text-decoration: none;
}

.doc-body code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--sunken);
  border: 1px solid var(--rule);
  padding: 0.1em 0.36em;
  border-radius: 5px;
}

.doc-body pre {
  margin: 0 0 1.5rem;
  padding: 1.05rem 1.15rem;
  overflow-x: auto;
  line-height: 1.6;
  position: relative;
  background: var(--code-bg);
  color: var(--code-plain);
  border: 1px solid var(--rule);
  border-radius: 11px;
}

.doc-body pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--code-com);
  pointer-events: none;
}

.doc-body pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
}

.doc-body pre .tok-com {
  color: var(--code-com);
  font-style: italic;
  font-weight: 400;
}
.doc-body pre .tok-str {
  color: var(--code-str);
}
.doc-body pre .tok-key {
  color: var(--code-key);
}
.doc-body pre .tok-fun {
  color: var(--code-fun);
}
.doc-body pre .tok-var {
  color: var(--code-var);
}
.doc-body pre .tok-typ {
  color: var(--code-typ);
}
.doc-body pre .tok-num {
  color: var(--code-num);
}
.doc-body pre .tok-tag {
  color: var(--code-tag);
}
.doc-body pre .tok-att {
  color: var(--code-att);
}
.doc-body pre .tok-prop {
  color: var(--code-prop);
}
.doc-body pre .tok-sel {
  color: var(--code-sel);
}
.doc-body pre .tok-op {
  color: var(--code-op);
  font-weight: 400;
}

.doc-body blockquote {
  margin: 0 0 1.5rem;
  padding: 0.9rem 1.1rem;
  background: var(--accent-wash);
  border-left: 2px solid var(--accent);
  border-radius: 0 10px 10px 0;
  color: var(--ink-2);
}

.doc-body blockquote p:last-child {
  margin-bottom: 0;
}

.doc-body table {
  width: 100%;
  margin: 0 0 1.7rem;
  border-collapse: collapse;
  font-size: 0.9rem;
  overflow-x: auto;
}

.doc-body th {
  padding: 0.55rem 0.9rem 0.55rem 0;
  border-bottom: 1px solid var(--rule-firm);
  white-space: nowrap;
  text-align: left;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.doc-body td {
  padding: 0.6rem 0.9rem 0.6rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.doc-body tr:last-child td {
  border-bottom: 0;
}

.doc-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

/* ------------------------------------------------------------------ home -- */
.doc-home {
  max-width: 62rem;
  margin: 0 auto;
}

.doc-hero {
  position: relative;
  max-width: 46rem;
  margin: 1rem auto 2.75rem;
  text-align: center;
}

.doc-hero > * {
  position: relative;
  z-index: 1;
}

.doc-hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -7rem;
  z-index: 0;
  width: min(46rem, 130%);
  height: 22rem;
  transform: translateX(-50%);
  pointer-events: none;
  background: radial-gradient(
    closest-side,
    var(--accent-wash),
    transparent 72%
  );
}

.doc-hero .eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.doc-hero h1 {
  margin: 0.7rem 0 0;
  font-size: clamp(2.1rem, 1.4rem + 2.8vw, 3.35rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  font-weight: 700;
  text-wrap: balance;
}

.doc-hero p {
  margin: 1.05rem auto 0;
  max-width: 34rem;
  font-size: 1.06rem;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* Quick Links */
.doc-quick-links {
  margin: 2.5rem 0 3.5rem;
}

.doc-quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.doc-quick-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  position: relative;
  overflow: hidden;
  box-shadow: -8px -5px 0px rgb(149 155 167);
}

.doc-quick-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--accent-wash), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.doc-quick-link:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  color: var(--ink);
}

.doc-quick-link:hover::before {
  opacity: 1;
}

.doc-quick-link-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-wash);
  border-radius: 10px;
  color: var(--accent);
  transition: all 0.25s ease;
  position: relative;
  z-index: 1;
}

.doc-quick-link:hover .doc-quick-link-icon {
  background: var(--accent);
  color: #fff;
  transform: scale(1.05);
}

.doc-quick-link-icon svg {
  width: 20px;
  height: 20px;
}

.doc-quick-link-content {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.doc-quick-link-title {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  margin-bottom: 0.15rem;
}

.doc-quick-link-note {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.doc-quick-link-arrow {
  flex-shrink: 0;
  font-size: 1.2rem;
  color: var(--muted);
  transition: all 0.25s ease;
  position: relative;
  z-index: 1;
}

.doc-quick-link:hover .doc-quick-link-arrow {
  color: var(--accent);
  transform: translateX(4px);
}

/* Sponsors */
.doc-sponsors {
  max-width: 62rem;
  margin: 3.5rem auto 0;
  padding: 2.5rem 0 1.5rem;
  border-top: 1px solid var(--rule);
}

.doc-sponsors-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.doc-sponsors-label {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.doc-sponsors-divider {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--rule), transparent);
}

.doc-sponsor-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

.doc-sponsor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 11px;
  background: var(--panel);
  color: var(--ink-2);
  font-size: 0.92rem;
  font-weight: 550;
  transition: all 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  text-decoration: none;
}

.doc-sponsor:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  color: var(--ink);
}

.doc-sponsor img {
  display: block;
  height: 2rem;
  width: auto;
  max-width: 10rem;
  object-fit: contain;
  filter: grayscale(0.2);
  transition: filter 0.3s ease;
}

.doc-sponsor:hover img {
  filter: grayscale(0);
}

.doc-sponsor-text {
  font-weight: 550;
  color: var(--ink-2);
}

.doc-sponsor:hover .doc-sponsor-text {
  color: var(--accent);
}

/* --------------------------------------------------------------- pagenav -- */
.doc-pagenav {
  display: grid;
  gap: 0.7rem;
  margin-top: 3.5rem;
  max-width: 45rem;
}

.doc-pagenav a {
  display: block;
  padding: 0.85rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 11px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.doc-pagenav a:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.doc-pagenav .dir {
  display: block;
  margin-bottom: 0.15rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.doc-pagenav .to-next {
  text-align: right;
}

/* ------------------------------------------------------------------- toc -- */
.doc-toc {
  display: none;
  flex: none;
  width: 14.5rem;
  padding-left:0.5rem;
}

.doc-toc-inner {
  position: sticky;
  top: calc(var(--bar) + 1.5rem);
  padding: 2rem 1.25rem 2rem 0;
}

.doc-toc-label {
  margin-bottom: 0.55rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.doc-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--rule);
}

.doc-toc a {
  display: block;
  padding: 0.24rem 0 0.24rem 0.8rem;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.doc-toc a:hover {
  color: var(--ink);
}

.doc-toc a.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 550;
}

.doc-toc .lvl-3 a {
  padding-left: 1.55rem;
  font-size: 0.79rem;
}

/* -------------------------------------------------------------- breakpts -- */
@media (min-width: 900px) {
  .doc-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    flex: none;
    transform: none;
    box-shadow: none;
  }
  .doc-scrim {
    display: none;
  }
  .doc-menu-btn {
    display: none;
  }
  .doc-topbar {
    padding: 0.5rem 1.6rem;
  }
  .doc-main {
    padding: 2.75rem 4.5rem 5rem;
    overflow-x: scroll;
  }
}

@media (min-width: 1240px) {
  .doc-toc {
    display: block;
  }
  .doc-main {
    padding: 2.75rem 4rem 5rem;
    overflow-x: scroll;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .doc-link,
  .doc-btn,
  .doc-pagenav a,
  .doc-result,
  .doc-toc a,
  .h-anchor,
  .doc-card,
  .doc-sponsor {
    transition:
      background-color 0.14s ease,
      color 0.14s ease,
      border-color 0.14s ease,
      opacity 0.14s ease;
  }
  .g-chevron {
    transition: transform 0.16s ease;
  }
  .doc-sidebar {
    transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1);
  }
  .doc-scrim {
    transition: opacity 0.22s ease;
  }
  .doc-editor-panel {
    animation: doc-slide 0.2s cubic-bezier(0.32, 0.72, 0, 1);
  }
  @keyframes doc-slide {
    from {
      transform: translateX(2rem);
      opacity: 0.4;
    }
    to {
      transform: none;
      opacity: 1;
    }
  }
  .doc-dialog-panel {
    animation: doc-pop 0.16s cubic-bezier(0.32, 0.72, 0, 1);
  }
  @keyframes doc-pop {
    from {
      transform: translateY(0.6rem) scale(0.98);
      opacity: 0.5;
    }
    to {
      transform: none;
      opacity: 1;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  .doc-sidebar,
  .doc-topbar,
  .doc-toc,
  .doc-pagenav,
  .doc-editor {
    display: none;
  }
  .doc-main {
    padding: 0;
  }
}

/* Hide/Show logic based on screen size */
.doc-mobile-actions-wrapper {
  display: none;
  position: relative;
}

.doc-desktop-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

@media (max-width: 768px) {
  .doc-desktop-actions {
    display: none !important;
  }
  .doc-mobile-actions-wrapper {
    display: inline-block;
  }
  .doc-mobile-actions-wrapper .doc-mobile-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    left: -14rem;
    background: var(--general-background);
    border: 1px solid var(--border-color, #ccc);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    z-index: 100;
    min-width: 180px;
    flex-direction: column;
    gap: 0.4rem;
  }
  .doc-mobile-actions-wrapper .doc-mobile-dropdown.open {
    display: flex;
  }
  .doc-mobile-actions-wrapper .doc-mobile-dropdown .doc-btn {
    width: 100%;
    justify-content: flex-start;
  }
  .doc-quick-links-grid {
    grid-template-columns: 1fr;
  }
  .doc-quick-link {
    padding: 1rem 1.25rem;
  }
  .doc-sponsor-grid {
    gap: 0.75rem;
  }
  .doc-sponsor {
    padding: 0.6rem 1rem;
    min-height: 3rem;
  }
  .doc-sponsor img {
    height: 1.5rem;
    max-width: 7rem;
  }
}

@media (max-width: 480px) {
  .doc-quick-link {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .doc-quick-link-content {
    flex: 1 1 100%;
    order: 2;
  }
  .doc-quick-link-icon {
    order: 1;
  }
  .doc-quick-link-arrow {
    order: 3;
  }
}

/* Professional Business Footer */
.doc-footer {
  border-top: 1px solid rgba(128, 128, 128, 0.2);
  color: inherit;
  font-size: 0.88rem;
  margin-top: 3rem;
  padding: 2.5rem 1.5rem 1.25rem;
}

.doc-footer-container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}

.doc-footer-brand .doc-footer-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: var(--accent-color, #1d475a);
}

.doc-footer-motto {
  margin: 0;
  opacity: 0.75;
  line-height: 1.45;
  max-width: 340px;
}

.doc-footer-heading {
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.85;
}

.doc-footer-info {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.doc-footer-info a {
  color: inherit;
  text-decoration: none;
}

.doc-footer-info a:hover {
  text-decoration: underline;
}

.doc-footer-label {
  opacity: 0.6;
}

.doc-footer-address {
  font-style: normal;
  line-height: 1.5;
  opacity: 0.75;
}

.doc-footer-bottom {
  max-width: 1100px;
  margin: 2rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(128, 128, 128, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  opacity: 0.65;
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .doc-footer-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .doc-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

.doc-footer-sm-bottom-column-1,
.doc-footer-sm-bottom-column-2 {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Cookie Consent Banner */
.doc-cookie-banner {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2.5rem);
  max-width: 900px;
  background: var(--general-background, #1c2128);
  border: 1px solid rgba(128, 128, 128, 0.25);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 99990;
}

.doc-cookie-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.doc-cookie-banner-text {
  flex: 1;
  min-width: 260px;
}

.doc-cookie-banner-text strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.95rem;
}

.doc-cookie-banner-text p {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.8;
  line-height: 1.4;
}

.doc-cookie-banner-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Preference Items inside Modal */
.doc-cookie-pref-group {
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(128, 128, 128, 0.15);
}

.doc-cookie-pref-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.doc-cookie-pref-title {
  font-weight: 600;
  font-size: 0.92rem;
  text-transform: capitalize;
}

.doc-cookie-pref-desc {
  font-size: 0.82rem;
  opacity: 0.75;
  margin: 0;
}

/* Custom dialogs + toast */
.doc-btn--danger-solid {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.doc-btn--danger-solid:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  opacity: 0.9;
}

.doc-dialog[hidden] {
  display: none;
}

.doc-dialog {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.doc-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 12, 17, 0.55);
}

.doc-dialog-panel {
  position: relative;
  width: min(30rem, 100%);
  padding: 1.4rem;
  background: var(--general-background);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}

.doc-dialog-title {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 660;
  letter-spacing: -0.015em;
}

.doc-dialog-msg {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.92rem;
  line-height: 1.55;
}

.doc-dialog-file {
  margin: 0 0 1rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  word-break: break-all;
}

.doc-dialog-preview {
  margin: 0.2rem 0 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
}

.doc-dialog-preview strong {
  color: var(--accent);
  font-weight: 600;
}

.doc-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.3rem;
}

.doc-dialog-status {
  margin-right: auto;
  font-size: 0.82rem;
  color: var(--muted);
}

.doc-dialog-status[data-tone="error"] {
  color: var(--danger);
}

.doc-field2 {
  display: block;
  margin-bottom: 0.8rem;
}

.doc-field2 span {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.doc-field2 select,
.doc-field2 input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--sunken);
  border: 1px solid var(--rule);
  border-radius: 9px;
}

.doc-field2 select:focus,
.doc-field2 input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.doc-toast[hidden] {
  display: none;
}

.doc-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 90;
  transform: translateX(-50%);
  max-width: 90vw;
  padding: 0.7rem 1.1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 10px;
  font-size: 0.88rem;
  box-shadow: var(--shadow-lg);
}

.doc-toast[data-tone="error"] {
  background: var(--danger);
  color: #fff;
}

/* Dark theme adjustments for enhanced sections */
:root[data-theme="dark"] .doc-quick-link {
  background: var(--panel);
  border-color: var(--rule);
}
:root[data-theme="dark"] .doc-quick-link:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
:root[data-theme="dark"] .doc-sponsor {
  background: var(--panel);
  border-color: var(--rule);
}
:root[data-theme="dark"] .doc-sponsor:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
:root[data-theme="dark"] .doc-sponsor img {
  filter: brightness(0.9);
}
:root[data-theme="dark"] .doc-sponsor:hover img {
  filter: brightness(1);
}
:root[data-theme="dark"] .doc-sponsors-divider {
  background: linear-gradient(to right, var(--rule), transparent);
}

/* Professional Editor Styles */
.doc-editor[hidden] {
  display: none;
}

.doc-editor {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: flex-end;
}

.doc-editor-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 12, 17, 0.55);
}

.doc-editor-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 1200px !important;
  width: 100%;
  height: 100%;
  padding: 0 !important;
  background: var(--general-background) !important;
  border-left: 1px solid var(--rule);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}

.doc-editor-head {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--rule);
  background: var(--general-background);
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.doc-editor-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 660;
  letter-spacing: -0.015em;
}

.doc-editor-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-editor-file {
  margin-top: 0.15rem;
  font-family: var(--mono);
  font-size: 0.71rem;
  color: var(--muted);
  word-break: break-all;
}

/* Toolbar */
.doc-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  background: var(--toolbar-background);
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.toolbar-group--right {
  margin-left: auto;
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--rule);
  margin: 0 0.3rem;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.toolbar-btn:hover {
  background: var(--accent-wash);
  border-color: var(--rule);
}

.toolbar-btn:active {
  transform: scale(0.95);
}

.toolbar-btn--active {
  border-color: var(--accent);
  color: var(--accent);
}

.toolbar-btn--dropdown {
  gap: 0.15rem;
}

.toolbar-btn .btn-label {
  font-weight: 700;
  font-size: 0.9rem;
}

/* Toolbar Dropdown */
.toolbar-dropdown {
  position: relative;
  display: inline-block;
}

.toolbar-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  background: var(--bg-surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  padding: 0.3rem 0;
  z-index: 100;
}

.toolbar-dropdown:hover .toolbar-dropdown-menu,
.toolbar-dropdown-menu:hover {
  display: block;
}

.toolbar-dropdown-menu button {
  display: block;
  width: 100%;
  padding: 0.4rem 1rem;
  border: none;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}

.toolbar-dropdown-menu button:hover {
  background: var(--accent-wash);
  color: var(--accent);
}

/* Editor Container - Split View */
.doc-editor-container {
  display: flex;
  flex: 1;
  min-height: 0;
  background: var(--sunken);
}

.doc-editor-pane {
  flex: 1;
  display: flex;
  min-width: 0;
}

.doc-preview-pane {
  flex: 1;
  display: flex;
  min-width: 0;
  background: var(--bg-surface);
  border-left: 1px solid var(--rule);
}

.doc-preview-content {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-y: auto;
  background: var(--bg-surface);
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Split View States */
.doc-editor-container.split-view .doc-editor-pane {
  flex: 1;
}
.doc-editor-container.split-view .doc-preview-pane {
  display: flex !important;
}
.doc-editor-container.preview-view .doc-editor-pane {
  display: none !important;
}
.doc-editor-container.preview-view .doc-preview-pane {
  display: flex !important;
  border-left: none;
}
.doc-editor-container.edit-view .doc-preview-pane {
  display: none !important;
}

/* Editor Textarea */
.doc-editor-body {
  flex: 1;
  min-height: 0;
  resize: none;
  padding: 1.5rem 2rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg-surface);
  border: none;
  border-radius: 0;
  white-space: pre-wrap;
  overflow-x: hidden;
  overflow-y: auto;
}

.doc-editor-body:focus {
  outline: none;
  box-shadow: none;
}

.doc-editor-body::selection {
  background: var(--accent-wash);
}

/* Preview Styles */
.doc-preview-content h1,
.doc-preview-content h2,
.doc-preview-content h3,
.doc-preview-content h4,
.doc-preview-content h5,
.doc-preview-content h6 {
  margin: 1.5rem 0 0.75rem;
  line-height: 1.3;
}
.doc-preview-content h1 {
  font-size: 2.2rem;
}
.doc-preview-content h2 {
  font-size: 1.7rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.3rem;
}
.doc-preview-content h3 {
  font-size: 1.3rem;
}
.doc-preview-content h4 {
  font-size: 1.1rem;
}
.doc-preview-content h5 {
  font-size: 1rem;
}
.doc-preview-content h6 {
  font-size: 0.9rem;
  color: var(--muted);
}
.doc-preview-content p {
  margin: 0 0 1rem;
}
.doc-preview-content ul,
.doc-preview-content ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}
.doc-preview-content li {
  margin-bottom: 0.3rem;
}
.doc-preview-content blockquote {
  padding: 0.5rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-wash);
  margin: 0 0 1rem;
}
.doc-preview-content pre {
  background: var(--code-bg);
  color: var(--code-plain);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0 0 1rem;
  font-weight: 600;
}
.doc-preview-content code {
  font-family: var(--mono);
  background: var(--sunken);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.85em;
}
.doc-preview-content pre code {
  background: none;
  padding: 0;
}
.doc-preview-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1rem;
}
.doc-preview-content th,
.doc-preview-content td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rule);
  text-align: left;
}
.doc-preview-content th {
  background: var(--panel);
  font-weight: 600;
}
.doc-preview-content img {
  max-width: 100%;
  border-radius: 6px;
}
.doc-preview-content hr {
  border: none;
  border-top: 2px solid var(--rule);
  margin: 2rem 0;
}
.doc-preview-content .task-list-item {
  list-style: none;
}
.doc-preview-content .task-list-item input[type="checkbox"] {
  margin-right: 0.5rem;
}

/* Editor Stats */
.doc-editor-status-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.doc-editor-stats {
  display: flex;
  gap: 0.5rem;
}

.doc-editor-actions {
  display: flex;
  gap: 0.5rem;
}

.doc-editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--rule);
  background: var(--general-background);
  flex-shrink: 0;
}

.doc-editor-status {
  font-size: 0.82rem;
  color: var(--muted);
}

.doc-editor-status[data-tone="error"] {
  color: var(--danger);
}

.doc-editor-status[data-tone="done"] {
  color: var(--accent);
}

/* Responsive Editor */
@media (max-width: 768px) {
  .doc-editor-toolbar {
    gap: 0.15rem;
    padding: 0.3rem 0.4rem;
  }
  .toolbar-btn {
    padding: 0.2rem 0.4rem;
    min-width: 26px;
    height: 26px;
    font-size: 0.75rem;
  }
  .toolbar-divider {
    margin: 0 0.15rem;
  }
  .doc-editor-body,
  .doc-preview-content {
    padding: 1rem;
  }
  .doc-editor-head {
    padding: 0.75rem 1rem;
  }
  .doc-editor-container.split-view {
    flex-direction: column;
  }
  .doc-editor-container.split-view .doc-preview-pane {
    border-left: none;
    border-top: 1px solid var(--rule);
    max-height: 50vh;
  }
}

/* Dark theme editor adjustments */
:root[data-theme="dark"] .doc-preview-content {
  background: var(--bg-surface);
}
:root[data-theme="dark"] .doc-preview-content pre {
  background: #0a1a2a;
}
:root[data-theme="dark"] .doc-preview-content th {
  background: var(--panel);
}

/* ----------------------------------------------------------------- topnav -- */
.doc-topnav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  padding-inline: 6px;
}

.doc-nav-item {
  position: relative;
  display: flex;
  align-items: center;
}

.doc-nav-toggle {
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem;
}

.doc-nav-toggle span {
  display: flex;
  align-items: center;
}

.doc-nav-toggle .chevron-icon svg {
  transition: transform 0.2s ease;
  width: 14px;
  height: 14px;
}

.doc-nav-item.open .doc-nav-toggle .chevron-icon svg {
  transform: rotate(90deg);
}

.doc-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--general-background);
  border: 1px solid var(--doc-border, #ddd);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  min-width: 180px;
  padding: 0.5rem 0;
  z-index: 100;
}

.doc-nav-item.open .doc-dropdown-menu {
  display: block;
}

.doc-dropdown-menu a {
  display: block;
  padding: 0.2rem 1rem;
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
}

.doc-dropdown-menu a:hover {
  background: var(--doc-hover, rgba(0, 0, 0, 0.05));
}

/* Mobile Nav */
.doc-mobile-nav-wrapper {
  position: relative;
  display: none;
}

.doc-mobile-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  left: -14rem;
  background: var(--general-background);
  border: 1px solid var(--doc-border, #ddd);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  min-width: 220px;
  padding: 0.75rem;
  z-index: 1000;
}

.doc-mobile-nav-wrapper.open .doc-mobile-dropdown {
  display: block;
}

.mobile-nav-node a,
.mobile-nav-label {
  display: block;
  padding: 0.4rem 0.5rem;
  text-decoration: none;
  color: inherit;
}

.mobile-nav-node.has-sub > .mobile-sub-items {
  display: none;
}

.mobile-nav-node.has-sub.open > .mobile-sub-items {
  display: block;
}

.mobile-nav-label {
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mobile-nav-arrow {
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.mobile-nav-node.has-sub.open > .mobile-nav-label .mobile-nav-arrow {
  transform: rotate(90deg);
}

.mobile-sub-items {
  padding-left: 1rem;
  border-left: 2px solid var(--doc-border, #eee);
  margin-left: 0.5rem;
  margin-top: 0.2rem;
}

@media (max-width: 768px) {
  .doc-topnav {
    display: none !important;
  }
  .doc-mobile-nav-wrapper {
    display: inline-block;
  }
}
.doc-preview-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.doc-preview-content th,
.doc-preview-content td {
  border: 1px solid var(--border, rgba(128, 128, 128, 0.3));
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.doc-preview-content thead th {
  background: var(--general-background, #f8fafc);
  font-weight: 600;
}
.doc-preview-content tbody tr:nth-child(even) {
  background: rgba(128, 128, 128, 0.05);
}
.doc-preview-content blockquote {
  border-left: 3px solid var(--accent, #0073aa);
  margin: 1rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  opacity: 0.85;
}

.doc-preview-content code {
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
}
/* ================================================================ THEME DROPDOWN ================================================================ */

.doc-theme-wrapper {
  position: relative;
  display: inline-block;
}

.doc-theme-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.5rem;
  min-width: 180px;
  background: var(--general-background);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  z-index: 100;
}

.doc-theme-wrapper:hover .doc-theme-dropdown,
.doc-theme-dropdown:hover {
  display: block;
}

.doc-theme-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.doc-theme-option:hover {
  background: var(--accent-wash);
}

.doc-theme-option .theme-icon {
  font-size: 1.1rem;
  flex: none;
  width: 24px;
  text-align: center;
}

.doc-theme-option .theme-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink);
}

.doc-theme-option .theme-desc {
  font-size: 0.7rem;
  color: var(--muted);
  margin-left: auto;
}

.doc-theme-option.active {
  background: var(--accent-wash);
  border: 1px solid var(--accent);
}

/* When a theme is active, show its icon in the button */
#doc-theme-icon {
  font-size: 1.1rem;
  line-height: 1;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .doc-theme-dropdown {
    right: -0.5rem;
    min-width: 160px;
  }
  .doc-theme-option .theme-desc {
    display: none;
  }
}
/* ------------------------------------------------- collapsible sidebar -- */
:root {
  --sidebar-w: 18.5rem;
  --sidebar-rail: 4.25rem;
}

.doc-sidebar {
  width: var(--sidebar-w);
  transition: width 0.22s cubic-bezier(0.32, 0.72, 0, 1);
}

.doc-brand-mark,
.doc-rail-search,
.doc-rail-toggle {
  display: none;
}

.doc-brand-mark {
  flex: none;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--accent-wash);
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
}

.doc-rail-toggle {
  margin-left: auto;
  flex: none;
  padding: 0.25rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  line-height: 0;
}

.doc-rail-toggle:hover {
  color: var(--accent);
  background: var(--accent-wash);
  border-color: var(--rule);
}

.doc-rail-toggle svg {
  width: 16px;
  height: 16px;
  transform: rotate(180deg);
  transition: transform 0.2s ease;
}

.doc-rail-search {
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 34px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--sunken);
  color: var(--muted);
  cursor: pointer;
}

.doc-rail-search:hover {
  color: var(--accent);
  border-color: var(--accent);
}

@media (min-width: 900px) {
  .doc-rail-toggle {
    display: inline-flex;
  }

  :root[data-sidebar="collapsed"] .doc-sidebar {
    width: var(--sidebar-rail);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    overflow-x: hidden;
  }

  :root[data-sidebar="collapsed"] .doc-rail-toggle svg {
    transform: rotate(0deg);
  }
  :root[data-sidebar="collapsed"] .doc-brand-mark,
  :root[data-sidebar="collapsed"] .doc-rail-search {
    display: inline-flex;
  }

  :root[data-sidebar="collapsed"] .doc-brand,
  :root[data-sidebar="collapsed"] .doc-version-badge,
  :root[data-sidebar="collapsed"] .doc-tagline,
  :root[data-sidebar="collapsed"] .doc-search-wrapper,
  :root[data-sidebar="collapsed"] .doc-btn-empty .btn-label,
  :root[data-sidebar="collapsed"] .doc-group-name,
  :root[data-sidebar="collapsed"] .doc-group-count,
  :root[data-sidebar="collapsed"] .doc-page-title,
  :root[data-sidebar="collapsed"] .doc-folder-del,
  :root[data-sidebar="collapsed"] .doc-page-move,
  :root[data-sidebar="collapsed"] .doc-results,
  :root[data-sidebar="collapsed"] .doc-search-note,
  :root[data-sidebar="collapsed"] .doc-empty {
    display: none !important;
  }

  :root[data-sidebar="collapsed"] .doc-brand-wrapper {
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0;
  }
  :root[data-sidebar="collapsed"] .doc-rail-toggle {
    margin-left: 0;
  }

  :root[data-sidebar="collapsed"] .doc-group-summary,
  :root[data-sidebar="collapsed"] .doc-page-link,
  :root[data-sidebar="collapsed"] .doc-btn-empty {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  :root[data-sidebar="collapsed"] .doc-group--folder .doc-group-items {
    padding-left: 0;
    margin-left: 0;
    border-left: 0;
  }
  :root[data-sidebar="collapsed"] .doc-group--root {
    padding: 0.5rem 0.25rem;
  }
  :root[data-sidebar="collapsed"] .doc-nav-scroll {
    margin: 0;
    padding-left: 0;
    padding-right: 0;
  }
  :root[data-sidebar="collapsed"]
    .doc-page-item--active
    .doc-page-link::before {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .doc-sidebar {
    transition: none;
  }
}
/* Path input inside header */
.doc-editor-path {
    margin-top: 0.6rem;
    border-radius: 8px;
    width: 80%;
}

.doc-editor-path label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.3rem;
    letter-spacing: 0.02em;
}

.doc-editor-path-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.doc-editor-path-prefix {
    position: absolute;
    left: 0.6rem;
    font-size: 1rem;
    opacity: 0.5;
    pointer-events: none;
}

#doc-editor-path-input {
    width: 100%;
    padding: 0.55rem 0.8rem 0.55rem 2.2rem;
    font-family: var(--mono);
    font-size: 0.9rem;
    background: var(--bg-surface);
    border: 1px solid var(--rule);
    border-radius: 6px;
    color: var(--ink);
    transition: border-color 0.2s, box-shadow 0.2s;
}

#doc-editor-path-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-wash);
}

.doc-editor-path-hint {
    margin: 0.3rem 0 0 0;
    font-size: 0.75rem;
    color: var(--muted);
}

.doc-editor-path-hint code {
    font-family: var(--mono);
    background: var(--panel);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-size: 0.75rem;
}
/* ---- Location summary in the editor header ---- */
.sp-loc-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: .35rem;
}

.sp-loc-label {
    font-size: .75rem;
    opacity: .65;
}

.sp-loc-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .82rem;
    padding: .25rem .5rem;
    border-radius: 6px;
    border: 1px dashed rgba(128, 128, 128, .4);
    background: rgba(128, 128, 128, .1);
    color: inherit;
    cursor: pointer;
    max-width: 32ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-loc-value:hover {
    border-color: var(--accent-color, #0073aa);
}

.sp-loc-value[data-empty="true"] {
    color: #dc3545;
    border-color: rgba(220, 53, 69, .5);
}

/* ---- Modal shell ---- */
.sp-fp-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.sp-fp-modal[hidden] {
    display: none;
}

.sp-fp-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    backdrop-filter: blur(2px);
}

.sp-fp-card {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 88vh;
    overflow: auto;
    box-sizing: border-box;
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(128, 128, 128, .2);
    background: var(--general-background, #fff);
    color: inherit;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .28);
}

.sp-fp-title {
    margin: 0 0 1rem;
    font-size: 1.05rem;
}

/* ---- Numbered steps ---- */
.sp-fp-steps {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sp-fp-modal.is-manual .sp-fp-steps {
    display: none;
}

.sp-fp-step {
    position: relative;
    padding: 0 0 1rem 2rem;
}

.sp-fp-step::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 26px;
    bottom: 2px;
    width: 1px;
    background: rgba(128, 128, 128, .25);
}

.sp-fp-step:last-child {
    padding-bottom: 0;
}

.sp-fp-step:last-child::before {
    display: none;
}

.sp-fp-step-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 24px;
}

.sp-fp-num {
    position: absolute;
    left: 0;
    width: 23px;
    height: 23px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    border: 1px solid rgba(128, 128, 128, .35);
    background: var(--general-background, #fff);
    opacity: .55;
}

.sp-fp-step-name {
    font-size: .88rem;
    font-weight: 600;
    opacity: .6;
}

.sp-fp-step-note {
    font-size: .76rem;
    opacity: .55;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-fp-step[data-state="active"] .sp-fp-num {
    opacity: 1;
    color: #fff;
    background: var(--accent-color, #0073aa);
    border-color: var(--accent-color, #0073aa);
}

.sp-fp-step[data-state="done"] .sp-fp-num {
    opacity: 1;
    color: var(--accent-color, #0073aa);
    border-color: var(--accent-color, #0073aa);
}

.sp-fp-step[data-state="active"] .sp-fp-step-name,
.sp-fp-step[data-state="done"] .sp-fp-step-name {
    opacity: 1;
}

.sp-fp-step-body {
    margin-top: .5rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.sp-fp-step[data-state="todo"] .sp-fp-step-body {
    opacity: .6;
}

/* ---- Controls ---- */
.sp-fp-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .15rem;
    font-size: .82rem;
}

.sp-fp-crumb {
    background: none;
    border: none;
    padding: .12rem .3rem;
    border-radius: 5px;
    color: var(--accent-color, #0073aa);
    cursor: pointer;
    font: inherit;
}

.sp-fp-crumb:hover {
    background: rgba(128, 128, 128, .14);
}

.sp-fp-crumb[aria-current="true"] {
    color: inherit;
    font-weight: 600;
    cursor: default;
}

.sp-fp-sep {
    opacity: .4;
}

.sp-fp-filter,
.sp-fp-row input,
#sp-fp-filename,
#sp-fp-manual-input {
    padding: .45rem .55rem;
    border-radius: 7px;
    border: 1px solid rgba(128, 128, 128, .3);
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: .85rem;
    box-sizing: border-box;
    width: 100%;
}

.sp-fp-list {
    min-height: 110px;
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .18rem;
    border: 1px solid rgba(128, 128, 128, .18);
    border-radius: 8px;
    padding: .3rem;
}

.sp-fp-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    text-align: left;
    padding: .42rem .5rem;
    border: 1px solid transparent;
    border-radius: 7px;
    background: none;
    color: inherit;
    font: inherit;
    font-size: .87rem;
    cursor: pointer;
}

.sp-fp-item:hover {
    background: rgba(128, 128, 128, .14);
    border-color: rgba(128, 128, 128, .2);
}

.sp-fp-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-fp-item-count {
    font-size: .72rem;
    opacity: .55;
}

.sp-fp-item-chevron {
    opacity: .5;
}

.sp-fp-empty {
    margin: 0;
    padding: .6rem .5rem;
    font-size: .82rem;
    opacity: .65;
}

.sp-fp-row {
    display: flex;
    gap: .4rem;
    align-items: center;
}

.sp-fp-row input {
    flex: 1;
    min-width: 0;
}

.sp-fp-tip {
    margin: 0;
    font-size: .75rem;
    opacity: .55;
}

.sp-fp-final {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .84rem;
    padding: .45rem .6rem;
    border-radius: 7px;
    background: rgba(128, 128, 128, .12);
    overflow-wrap: anywhere;
}

.sp-fp-manual-wrap {
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.sp-fp-manual-wrap[hidden] {
    display: none;
}

.sp-fp-manual-wrap label {
    font-size: .82rem;
    font-weight: 600;
}

.sp-fp-msg {
    margin: .75rem 0 0;
    font-size: .78rem;
    opacity: .7;
}

.sp-fp-msg[data-tone="error"] {
    color: #dc3545;
    opacity: 1;
}

.sp-fp-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1rem;
}

.sp-fp-spacer {
    flex: 1;
}

.sp-fp-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: .8rem;
    color: var(--accent-color, #0073aa);
    text-decoration: underline;
    cursor: pointer;
}

@media (max-width: 560px) {
    .sp-fp-list {
        max-height: 160px;
    }
    .sp-fp-actions {
        flex-wrap: wrap;
    }
    .sp-fp-spacer {
        flex-basis: 100%;
    }
}

/* ============================================================================
   ANIMATED HOME PAGE — stats, features, customers, steps, testimonials, faq,
   cta. These are NEW section styles. They do not touch the topbar, sidebar,
   editor, or theme dropdown.
   ============================================================================ */

/* --- Section wrapper --------------------------------------------------- */
.doc-section {
    position: relative;
    isolation: isolate;
    max-width: 62rem;
    margin: 3.5rem auto 0;
    padding: 2.5rem 2rem;
    border-radius: 16px;
    overflow: hidden;
}

.doc-home > .doc-section {
    background: var(--panel);
}
.doc-section-head {
    text-align: center;
    margin-bottom: 2.25rem;
}

.doc-section-title {
    margin: 0;
    font-size: clamp(1.5rem, 1.2rem + 1vw, 1.95rem);
    line-height: 1.15;
    letter-spacing: -0.025em;
    font-weight: 680;
    text-wrap: balance;
}

.doc-section-sub {
    margin: 0.5rem 0 0;
    font-size: 1rem;
    color: var(--ink-2);
    opacity: 0.75;
    text-wrap: pretty;
}

/* --- Stats band -------------------------------------------------------- */
.doc-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    max-width: 62rem;
}

.doc-stat { text-align: center; }

.doc-stat-value {
    font-size: clamp(1.85rem, 1.4rem + 1.4vw, 2.5rem);
    font-weight: 720;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--accent);
    font-feature-settings: "tnum" 1;
}

.doc-stat-label {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.doc-stat-note {
    margin-top: 0.2rem;
    font-size: 0.76rem;
    color: var(--muted);
}

/* --- Features grid ----------------------------------------------------- */
.doc-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.doc-feature {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.5rem 1.5rem 1.75rem;
    border: 1px solid var(--rule);
    border-radius: 14px;
    background: var(--panel);
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: -4px -4px 0px rgba(149, 155, 167, 0.4);
}

.doc-feature:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: -4px -4px 0px var(--accent);
}

.doc-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: var(--accent-wash);
    color: var(--code-var);
    flex: none;
    transition: transform 0.25s ease, background 0.25s ease;
}

.doc-feature:hover .doc-feature-icon {
    background: var(--accent);
    color: #fff;
    transform: scale(1.08) rotate(-3deg);
}

.doc-feature-icon svg { width: 22px; height: 22px; }

.doc-feature-title {
    margin: 0.3rem 0 0;
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.doc-feature-note {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--ink-2);
    opacity: 0.85;
    text-wrap: pretty;
}

/* --- Customers --------------------------------------------------------- */
.doc-customers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    align-items: center;
}

.doc-customer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.25rem;
    min-height: 4.5rem;
    border: 1px solid var(--rule);
    border-radius: 12px;
    background: var(--panel);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.doc-customer:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.doc-customer img {
    max-width: 100%;
    max-height: 2.5rem;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: grayscale(0.4) opacity(0.75);
    transition: filter 0.25s ease;
}

.doc-customer:hover img { filter: grayscale(0) opacity(1); }

.doc-customer-name {
    font-weight: 650;
    font-size: 0.95rem;
    color: var(--ink-2);
    text-align: center;
}

/* --- Steps ------------------------------------------------------------- */
.doc-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.doc-step {
    position: relative;
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1.25rem 1.25rem 4rem;
    border: 1px solid var(--rule);
    border-radius: 14px;
    background: var(--panel);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.doc-step:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.doc-step-num {
    position: absolute;
    left: 1.25rem;
    top: 1.25rem;
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}

.doc-step-body { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.doc-step-label { font-weight: 650; font-size: 1rem; color: var(--ink); line-height: 1.35; }
.doc-step-note { font-size: 0.88rem; line-height: 1.55; color: var(--ink-2); opacity: 0.85; }

/* --- Testimonials ------------------------------------------------------ */
.doc-testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.doc-testimonial {
    margin: 0;
    padding: 1.75rem 1.5rem 1.25rem;
    border: 1px solid var(--rule);
    border-radius: 14px;
    background: var(--panel);
    position: relative;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.doc-testimonial::before {
    content: "“";
    position: absolute;
    top: -0.6rem;
    left: 1rem;
    font-family: Georgia, serif;
    font-size: 3.5rem;
    line-height: 1;
    color: var(--accent);
    opacity: 0.25;
    pointer-events: none;
}

.doc-testimonial:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.doc-testimonial-quote {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.6;
    color: var(--ink);
    text-wrap: pretty;
}

.doc-testimonial-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--rule);
}

.doc-testimonial-author { font-weight: 650; font-size: 0.9rem; color: var(--ink); }
.doc-testimonial-role { font-size: 0.8rem; color: var(--muted); }

/* --- FAQ --------------------------------------------------------------- */
.doc-faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 46rem;
    margin: 0 auto;
}

.doc-faq {
    border: 1px solid var(--rule);
    border-radius: 12px;
    background: var(--panel);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.doc-faq[open] { border-color: var(--accent); }

.doc-faq-q {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.98rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background 0.15s ease;
}

.doc-faq-q::-webkit-details-marker { display: none; }
.doc-faq-q::marker { content: ""; }

.doc-faq-q::after {
    content: "›";
    margin-left: auto;
    font-size: 1.3rem;
    line-height: 1;
    color: var(--muted);
    transition: transform 0.2s ease;
}

.doc-faq[open] .doc-faq-q::after {
    transform: rotate(90deg);
    color: var(--accent);
}

.doc-faq-q:hover { background: var(--accent-wash); }

.doc-faq-a {
    padding: 0 1.25rem 1.25rem;
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--ink-2);
    opacity: 0.9;
    text-wrap: pretty;
}

/* --- CTA --------------------------------------------------------------- */
.doc-cta {
    background: linear-gradient(135deg, var(--accent-wash), transparent 70%);
    text-align: center;
}

.doc-cta-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.doc-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    border: 1px solid var(--accent);
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 6px 20px -8px var(--accent);
}

.doc-cta-btn:hover {
    color: #fff;
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 10px 28px -8px var(--accent);
}

.doc-cta-btn-label { font-weight: 650; }
.doc-cta-btn-note { font-weight: 500; opacity: 0.85; font-size: 0.85rem; }
.doc-cta-btn-arrow { transition: transform 0.2s ease; }
.doc-cta-btn:hover .doc-cta-btn-arrow { transform: translateX(4px); }

/* --- Section-only pages (no hero) -------------------------------------- */
.doc-home--sections {
    max-width: none;
    margin: 0;
}

.doc-home--sections .doc-section:first-child,
.doc-home--sections .doc-stats:first-child {
    margin-top: 0;
}

/* ============================================================================
   SCROLL REVEAL — animation for elements with .doc-reveal ONLY.
   The topbar, sidebar, editor, and theme dropdown are NOT affected by these
   rules, because none of them carry the .doc-reveal class.
   ============================================================================ */

.doc-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition:
        opacity 0.55s cubic-bezier(0.22, 0.9, 0.3, 1),
        transform 0.55s cubic-bezier(0.22, 0.9, 0.3, 1);
    transition-delay: var(--reveal-delay, 0s);
}

.doc-reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* No-JS fallback: visible immediately */
html:not(.js) .doc-reveal {
    opacity: 1;
    transform: none;
}

/* Safety net: after load, force-show anything the observer missed */
html.doc-reveal-done .doc-reveal {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .doc-reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* --- Section responsive tweaks ----------------------------------------- */
@media (max-width: 640px) {
    .doc-section { 
         margin-top: 2.5rem;
         padding: 1.75rem 1.25rem;
         border-radius: 12px;
    }
    .doc-feature { padding: 1.25rem 1.25rem 1.4rem; }
    .doc-stat-value { font-size: 1.8rem; }
    .doc-cta { padding: 2rem 1rem; }
    .doc-cta-btn { width: 100%; justify-content: center; }
    .doc-steps { grid-template-columns: 1fr; }
    .doc-step { padding: 1rem 1rem 1rem 3.5rem; }
    .doc-step-num { left: 1rem; top: 1rem; width: 2rem; height: 2rem; font-size: 0.85rem; }
    .doc-customers-grid { grid-template-columns: repeat(2, 1fr); }
}
.doc-admin-tools {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.3rem 0.3rem;
    border-radius: 6px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    font-size: 0.85rem;
    color: var(--ink-2);
    transition: background 0.15s;
    border: solid thin #acbfc6;
    margin-bottom: 0.2rem;
    background: var(--toolbar-background);
}
.doc-admin-tool {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: solid 2px var(--accent);
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
    padding: 0.4rem;
}
.doc-admin-tool:hover {
    background: rgba(0,115,170,0.08);
    border-color: rgba(0,115,170,0.35);
    color: var(--accent-color, #0073aa);
}
.doc-editor-template {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}
.doc-editor-template label {
    opacity: 0.75;
    white-space: nowrap;
}
.doc-editor-template select {
    min-width: 220px;
    padding: 0.3rem 0.5rem;
    border: 1px solid rgba(128,128,128,0.25);
    border-radius: 6px;
    background: var(--bg-input, transparent);
    color: inherit;
    font: inherit;
    font-size: 0.85rem;
    outline: none;
}
.doc-editor-template select:focus {
    border-color: var(--accent-color, #0073aa);
}
/* ============================================================
   SEARCH COMMAND PALETTE (overlay)
   ------------------------------------------------------------
   Results now render into a centered overlay instead of replacing
   the sidebar tree. Nothing in the existing sidebar styling is
   touched — the sidebar search input is still styled as before,
   it just acts as a trigger now.
   ============================================================ */

.doc-search-overlay[hidden] { display: none; }

.doc-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(3rem, 12vh, 9rem) 1rem 2rem;
}

.doc-search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 12, 17, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.doc-search-panel {
    position: relative;
    width: min(40rem, 100%);
    max-height: min(70vh, 40rem);
    display: flex;
    flex-direction: column;
    background: var(--general-background);
    border: 1px solid var(--rule);
    border-radius: 14px;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: doc-search-in 0.16s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes doc-search-in {
    from { transform: translateY(-0.5rem) scale(0.985); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

.doc-search-field {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--rule);
}

.doc-search-field-icon { flex: none; color: var(--muted); }

.doc-search-overlay-input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 1rem;
    outline: none;
}
.doc-search-overlay-input::placeholder { color: var(--muted); opacity: 0.65; }

.doc-search-overlay-esc {
    flex: none;
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--muted);
    border: 1px solid var(--rule);
    border-radius: 5px;
    padding: 0.1rem 0.4rem;
    opacity: 0.7;
}

.doc-search-overlay-hint {
    margin: 0;
    padding: 0.5rem 1rem 0;
    font-size: 0.75rem;
    color: var(--muted);
    opacity: 0.7;
}
.doc-search-overlay-hint kbd {
    font-family: var(--mono);
    font-size: 0.7em;
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 0 0.25em;
}

.doc-search-overlay-results {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0.25rem 0.5rem 0.75rem;
    overflow-y: auto;
    flex: 1;
}
.doc-search-overlay-results::-webkit-scrollbar { width: 6px; }
.doc-search-overlay-results::-webkit-scrollbar-thumb {
    background: var(--rule);
    border-radius: 10px;
}

.doc-search-overlay-results li { margin: 0; }

.doc-search-result {
    display: block;
    padding: 0.65rem 0.85rem;
    border-radius: 9px;
    color: var(--ink);
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.doc-search-result:hover,
.doc-search-result.is-selected {
    background: var(--accent-wash);
    border-color: var(--accent);
    color: var(--ink);
}

.doc-search-result .r-title {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.35;
}
.doc-search-result .r-path {
    display: block;
    margin: 0.1rem 0 0.25rem;
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--muted);
}
.doc-search-result .r-snippet {
    display: block;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--ink-2);
    opacity: 0.85;
}
.doc-search-result mark {
    background: var(--accent-wash);
    color: var(--accent);
    border-radius: 3px;
    padding: 0 0.15em;
    font-weight: 600;
}

.doc-search-overlay-status {
    margin: 0;
    padding: 0 1rem 0.9rem;
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
    min-height: 1.2em;
}
.doc-search-overlay-status[data-tone="error"] { color: var(--danger); }

@media (max-width: 640px) {
    .doc-search-overlay { padding-top: 1.5rem; }
    .doc-search-panel { max-height: 80vh; }
    .doc-search-overlay-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .doc-search-panel { animation: none; }
}
.doc-search-overlay-close {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.doc-search-overlay-close:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: var(--accent-wash);
}
.doc-search-overlay-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
/* ============================================================================
   LAYOUTS — attribute-driven shapes.

   Everything below is scoped by [data-layout="…"] on <html>, so it only fires
   for the active layout and cannot affect any other. The default
   (sidebar-rail) needs no block: the rules above already describe it.

   The list of layouts is closed and lives in Docs.php::$__docLayouts. Adding
   one means adding a row there AND a block here, plus a small amount of
   layout-gated JS in docs.js. Nothing else changes.

   MOBILE CONTRACT
   Below 900px every layout degrades to the same off-canvas drawer driven by
   the #doc-menu checkbox. That is why:
     - every rule that hides .doc-sidebar on desktop is scoped to >=900px
     - every rule that positions/flips the sidebar is scoped to >=900px
     - the base rules (unscoped, above this block) own the mobile presentation
   Nothing in this block should hide .doc-sidebar below 900px. If a layout
   needs to hide it on desktop, the display:none goes inside the media query.
   ============================================================================ */

/* ---------------------------------------------------------------------------
   sidebar-right — the shell is mirrored via data-sidebar-side="right".

   FIX: the entire block is now scoped to >=900px. Previously it was
   unscoped, which pinned the sidebar to the right edge on mobile while the
   base transform slid it off the LEFT edge — the sidebar was visible and
   non-toggleable on phones. On mobile, "right" is meaningless; the standard
   off-canvas drawer applies.
   --------------------------------------------------------------------------- */
@media (min-width: 900px) {
    :root[data-sidebar-side="right"] .doc-shell {
        flex-direction: row-reverse;
    }
    :root[data-sidebar-side="right"] .doc-sidebar {
        inset: 0 0 0 auto;
        border-right: 0;
        border-left: 1px solid var(--rule);
    }
    :root[data-sidebar-side="right"] .doc-cols {
        flex-direction: row-reverse;
    }
    :root[data-sidebar-side="right"] .doc-toc {
        padding-right: 0;
        padding-left: 1.25rem;
    }
    :root[data-sidebar-side="right"] .doc-toc-inner {
        padding: 2rem 0 2rem 1.25rem;
    }
    :root[data-sidebar-side="right"] .doc-toc ul {
        border-left: 0;
        border-right: 1px solid var(--rule);
    }
    :root[data-sidebar-side="right"] .doc-toc a {
        padding: 0.24rem 0.8rem 0.24rem 0;
        margin-left: 0;
        margin-right: -1px;
        border-left: 0;
        border-right: 1px solid transparent;
    }
    :root[data-sidebar-side="right"] .doc-toc a.is-active {
        border-left-color: transparent;
        border-right-color: var(--accent);
    }
    :root[data-sidebar-side="right"] .doc-toc .lvl-3 a {
        padding-left: 0;
        padding-right: 1.55rem;
    }
}

/* ---------------------------------------------------------------------------
   no-sidebar — content only, centered.

   FIX: the display:none rules are scoped to >=900px. On mobile the sidebar
   must render as the off-canvas drawer so the hamburger has something to
   open. The sidebar element is now always rendered by Body.php (Insertion 1
   no longer gates it), so this block only controls desktop visibility.
   --------------------------------------------------------------------------- */
@media (min-width: 900px) {
    [data-layout="no-sidebar"] .doc-shell {
        display: block;
    }
    [data-layout="no-sidebar"] .doc-sidebar,
    [data-layout="no-sidebar"] .doc-scrim {
        display: none !important;
    }
    [data-layout="no-sidebar"] .doc-cols {
        justify-content: center;
    }
    [data-layout="no-sidebar"] .doc-main {
        max-width: 52rem;
        margin: 0 auto;
        padding: 2.75rem 2rem 5rem;
        flex: 0 1 auto;
        width: 100%;
    }
    [data-layout="no-sidebar"] .doc-toc {
        position: sticky;
        top: calc(var(--bar) + 1.5rem);
        align-self: flex-start;
    }
}

/* ---------------------------------------------------------------------------
   sidebar-drawer — the sidebar is hidden on desktop until the topbar
   hamburger opens it. On mobile the existing #doc-menu checkbox owns it.
   --------------------------------------------------------------------------- */
@media (min-width: 900px) {
    [data-layout="sidebar-drawer"] .doc-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 50;
        transform: translateX(-101%);
        transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1),
                    box-shadow 0.22s ease;
        box-shadow: none;
    }
    [data-layout="sidebar-drawer"][data-drawer-open="true"] .doc-sidebar {
        transform: none;
        box-shadow: var(--shadow-lg);
    }
    [data-layout="sidebar-drawer"] .doc-menu-btn {
        display: inline-flex;
    }
    [data-layout="sidebar-drawer"] .doc-scrim {
        display: block;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.22s ease;
    }
    [data-layout="sidebar-drawer"][data-drawer-open="true"] .doc-scrim {
        opacity: 1;
        pointer-events: auto;
    }
    [data-layout="sidebar-drawer"] .doc-content {
        width: 100%;
    }
    [data-layout="sidebar-drawer"] .doc-rail-toggle {
        display: none;
    }
}

/* ---------------------------------------------------------------------------
   sidebar-float — a translucent panel that overlays the content. Pinned
   state is remembered per layout; unpinned reveals a peek button.
   --------------------------------------------------------------------------- */
@media (min-width: 900px) {
    [data-layout="sidebar-float"] .doc-sidebar {
        position: fixed;
        inset: 1rem auto 1rem 1rem;
        z-index: 50;
        width: min(18rem, 26vw);
        height: auto;
        max-height: calc(100vh - 2rem);
        border: 1px solid var(--rule);
        border-radius: 14px;
        background: var(--veil);
        -webkit-backdrop-filter: blur(18px) saturate(1.5);
        backdrop-filter: blur(18px) saturate(1.5);
        box-shadow: 0 20px 60px -22px rgba(0, 0, 0, 0.45);
        padding: 1rem 0.85rem 1.25rem;
        transform: translateX(0);
        transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1),
                    opacity 0.26s ease;
    }
    [data-layout="sidebar-float"][data-drawer-open="false"] .doc-sidebar {
        transform: translateX(calc(-100% - 1.5rem));
        opacity: 0;
        pointer-events: none;
    }
    [data-layout="sidebar-float"] .doc-content {
        transition: padding-left 0.26s cubic-bezier(0.32, 0.72, 0, 1);
        padding-left: 0;
    }
    [data-layout="sidebar-float"][data-drawer-open="true"] .doc-content {
        padding-left: calc(min(18rem, 26vw) + 2rem);
    }
    [data-layout="sidebar-float"] .doc-float-peek {
        display: inline-flex;
        position: fixed;
        left: 0.75rem;
        top: calc(var(--bar) + 1rem);
        z-index: 45;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 0 12px 12px 0;
        background: var(--veil);
        -webkit-backdrop-filter: blur(14px) saturate(1.4);
        backdrop-filter: blur(14px) saturate(1.4);
        border: 1px solid var(--rule);
        border-left: 0;
        color: var(--ink-2);
        cursor: pointer;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease;
        box-shadow: 0 8px 24px -14px rgba(0, 0, 0, 0.35);
    }
    [data-layout="sidebar-float"][data-drawer-open="false"] .doc-float-peek {
        opacity: 1;
        pointer-events: auto;
    }
    [data-layout="sidebar-float"] .doc-float-peek:hover {
        color: var(--accent);
        transform: translateX(2px);
    }
    [data-layout="sidebar-float"] .doc-rail-toggle {
        display: none;
    }
    [data-layout="sidebar-float"] .doc-menu-btn {
        display: inline-flex;
    }
}
/* Peek button is hidden outside the float layout and on mobile. */
.doc-float-peek { display: none; }

/* ---------------------------------------------------------------------------
   topnav-only — no sidebar, mega-menu topbar, floating TOC pill, maximal
   content canvas.

   FIX: the display:none rules are scoped to >=900px, exactly like no-sidebar.
   Below 900px the sidebar renders as the off-canvas drawer so the hamburger
   works on phones. The sidebar element is now always rendered by Body.php.
   --------------------------------------------------------------------------- */
@media (min-width: 900px) {
    [data-layout="topnav-only"] .doc-shell {
        display: block;
    }
    [data-layout="topnav-only"] .doc-sidebar,
    [data-layout="topnav-only"] .doc-scrim,
    [data-layout="topnav-only"] .doc-float-peek {
        display: none !important;
    }
    [data-layout="topnav-only"] .doc-cols {
        justify-content: center;
    }
    [data-layout="topnav-only"] .doc-main {
        max-width: var(--canvas-max, 72rem);
        margin: 0 auto;
        padding: 2.75rem 3rem 5rem;
        flex: 0 1 auto;
        width: 100%;
    }
    [data-layout="topnav-only"] .doc-toc {
        display: none;
    }
    [data-layout="topnav-only"] .doc-topnav {
        display: flex;
        flex: 1;
        justify-content: center;
        gap: 0.25rem;
    }
    [data-layout="topnav-only"] .doc-mega-menu {
        min-width: 34rem;
        padding: 1rem 0.75rem;
    }
    [data-layout="topnav-only"] .doc-mega-columns {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
        gap: 0.5rem 1.25rem;
        max-width: 52rem;
    }
    [data-layout="topnav-only"] .doc-mega-columns:has(.doc-mega-col:nth-child(4)) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-height: 24rem;
        overflow-y: auto;
    }
    [data-layout="topnav-only"] .doc-mega-col {
        min-width: 0;
    }
    [data-layout="topnav-only"] .doc-mega-head {
        display: block;
        padding: 0.3rem 0.5rem;
        font-weight: 650;
        font-size: 0.9rem;
        color: var(--ink);
        text-decoration: none;
        border-radius: 6px;
    }
    [data-layout="topnav-only"] .doc-mega-head:hover {
        background: var(--accent-wash);
        color: var(--accent);
    }
    [data-layout="topnav-only"] .doc-mega-head--solo {
        font-weight: 500;
    }
    [data-layout="topnav-only"] .doc-mega-list {
        list-style: none;
        margin: 0.15rem 0 0;
        padding: 0 0 0 0.5rem;
    }
    [data-layout="topnav-only"] .doc-mega-list a {
        display: block;
        padding: 0.2rem 0.5rem;
        font-size: 0.85rem;
        color: var(--ink-2);
        text-decoration: none;
        border-radius: 6px;
    }
    [data-layout="topnav-only"] .doc-mega-list a:hover {
        background: var(--accent-wash);
        color: var(--accent);
    }
}

/* ---------------------------------------------------------------------------
   Mobile fallback — every layout gets the off-canvas drawer.

   FIX (new block): below 900px, force the sidebar, scrim and hamburger to
   their mobile states for EVERY layout, overriding any desktop-scoped rules
   that might otherwise leak. This is defensive; the media-query scoping above
   should already cover it, but a business adding a seventh layout without
   reading this file will not accidentally break the phone.
   --------------------------------------------------------------------------- */
@media (max-width: 899.98px) {
    /* The sidebar is the off-canvas drawer, positioned from the left, hidden
       until the checkbox is checked. */
    .doc-sidebar {
        display: flex;
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 40;
        width: 18.5rem;
        transform: translateX(-101%);
    }
    /* The hamburger is always available on phones. */
    .doc-menu-btn {
        display: inline-flex;
    }
    /* No flip on phones — the drawer always slides from the left. */
    :root[data-sidebar-side="right"] .doc-shell,
    :root[data-sidebar-side="right"] .doc-cols {
        flex-direction: row;
    }
    :root[data-sidebar-side="right"] .doc-sidebar {
        inset: 0 auto 0 0;
        border-right: 1px solid var(--rule);
        border-left: 0;
    }
    /* The float peek button has no meaning on phones. */
    .doc-float-peek {
        display: none !important;
    }
}

/* ---------------------------------------------------------------------------
   TOC pill (used by topnav-only).
   --------------------------------------------------------------------------- */
.doc-toc-pill {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 45;
}
.doc-toc-pill-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: var(--veil);
    -webkit-backdrop-filter: blur(14px) saturate(1.5);
    backdrop-filter: blur(14px) saturate(1.5);
    color: var(--ink-2);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 24px -14px rgba(0, 0, 0, 0.35);
    transition: color 0.15s ease, border-color 0.15s ease;
}
.doc-toc-pill-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.doc-toc-pill-toggle svg {
    width: 14px;
    height: 14px;
}
.doc-toc-pill-panel {
    position: absolute;
    bottom: calc(100% + 0.6rem);
    right: 0;
    width: min(20rem, 80vw);
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.75rem 0.5rem;
    border: 1px solid var(--rule);
    border-radius: 12px;
    background: var(--general-background);
    box-shadow: var(--shadow-lg);
}
.doc-toc-pill-panel[hidden] {
    display: none;
}
.doc-toc-pill-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.doc-toc-pill-panel a {
    display: block;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    color: var(--ink-2);
    font-size: 0.85rem;
    text-decoration: none;
}
.doc-toc-pill-panel a:hover {
    background: var(--accent-wash);
    color: var(--accent);
}
.doc-toc-pill-panel .lvl-3 a {
    padding-left: 1.5rem;
    font-size: 0.8rem;
}

/* ---------------------------------------------------------------------------
   Theme + layout picker. Two tabs, one panel visible at a time.
   The existing .doc-theme-option styles above still apply inside the panel.
   --------------------------------------------------------------------------- */
.doc-theme-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem 0.5rem;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 0.35rem;
}
.doc-theme-tab {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}
.doc-theme-tab:hover {
    color: var(--ink-2);
    background: var(--accent-wash);
}
.doc-theme-tab.is-active {
    color: var(--accent);
    background: var(--accent-wash);
}
.doc-theme-panel[hidden] {
    display: none;
}
.doc-theme-panel {
    max-height: 24rem;
    overflow-y: auto;
}
.doc-layout-option {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.doc-layout-option:hover {
    background: var(--accent-wash);
}
.doc-layout-option.is-active {
    background: var(--accent-wash);
    border: 1px solid var(--accent);
}
.doc-layout-option .layout-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex: none;
    color: var(--muted);
}
.doc-layout-option.is-active .layout-glyph {
    color: var(--accent);
}
.doc-layout-option .layout-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.doc-layout-option .layout-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--ink);
    line-height: 1.3;
}
.doc-layout-option .layout-desc {
    font-size: 0.72rem;
    color: var(--muted);
    line-height: 1.35;
    margin-top: 0.1rem;
}
/* ==========================================================================
   Cover band — full-bleed image behind hero + stats; ends where stats end.
   It sits OUTSIDE .doc-home (which is capped at 62rem), and bleeds out to the
   edges of .doc-main using variables that mirror .doc-main's real padding.
   The band must NOT redeclare --doc-main-pad-*: it has to inherit them.
   ========================================================================== */
.doc-main {
    --doc-main-pad-x: 2rem;
    --doc-main-pad-top: 2rem;
}

@media (min-width: 900px) {
    .doc-main {
        --doc-main-pad-x: 4.5rem;
        --doc-main-pad-top: 2.75rem;
    }
    [data-layout="no-sidebar"] .doc-main {
        --doc-main-pad-x: 2rem;
    }
    [data-layout="topnav-only"] .doc-main {
        --doc-main-pad-x: 3rem;
    }
}

@media (min-width: 1240px) {
    .doc-main {
        --doc-main-pad-x: 4rem;
    }
    [data-layout="no-sidebar"] .doc-main {
        --doc-main-pad-x: 2rem;
    }
    [data-layout="topnav-only"] .doc-main {
        --doc-main-pad-x: 3rem;
    }
}

/* ============================================================================
   COVER BAND — index cover (hero + stats) and page cover (title on image).

   The band is rendered by Body.php BETWEEN the topbar and .doc-cols, i.e.
   outside .doc-main. That is what makes it full width in every layout
   (sidebar-rail, no-sidebar, topnav-only, ...): it spans .doc-content, and
   .doc-main / .doc-toc only size the content below it.
   Replaces the old .doc-cover-band rules (negative margins are gone).
   ============================================================================ */
.doc-cover-band {
    --doc-band-pad-x: 2rem;
    position: relative;
    isolation: isolate;
    flex: none;
    width: 100%;
    margin: 0;
    padding: 3.5rem var(--doc-band-pad-x) 2.5rem;
    background-color: var(--sunken);
    background-image: var(--doc-cover);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
@media (min-width: 900px)  { .doc-cover-band { --doc-band-pad-x: 4.5rem; } }
@media (min-width: 1240px) { .doc-cover-band { --doc-band-pad-x: 4rem; } }
@media (min-width: 900px) {
    [data-layout="no-sidebar"]  .doc-cover-band { --doc-band-pad-x: 2rem; }
    [data-layout="topnav-only"] .doc-cover-band { --doc-band-pad-x: 3rem; }
}

/* legibility overlay */
.doc-cover-band::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, calc(var(--doc-cover-overlay, 0.55) * 0.82)),
        rgba(0, 0, 0, var(--doc-cover-overlay, 0.55))
    );
}

/* text column: readable on very wide screens, centred in the full-width band */
.doc-cover-inner {
    max-width: 62rem;
    margin: 0 auto;
}

/* content that follows the band no longer needs the main's top padding */
.doc-cover-band + .doc-cols .doc-main { padding-top: 2rem; }

/* --- index cover: hero + stats -------------------------------------------- */
.doc-cover-band .doc-hero { margin-bottom: 1.75rem; }

.doc-cover-band .doc-hero,
.doc-cover-band .doc-hero h1,
.doc-cover-band .doc-hero p,
.doc-cover-band .doc-hero .eyebrow,
.doc-cover-band .doc-version-label { color: #fff; }

.doc-cover-band .doc-hero::before { display: none; }   /* glow is invisible on a photo */

.doc-section .doc-stats,
.doc-cover-band .doc-stats { margin: 0 auto; padding: 0; border: 0; }

.doc-cover-band .doc-stat {
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .22);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.doc-cover-band .doc-stat-value,
.doc-cover-band .doc-stat-label,
.doc-cover-band .doc-stat-note { color: #fff; }

.doc-home--after-cover > :first-child { margin-top: 0.5rem; }

/* --- page cover: any other page, title on the image ----------------------- */
.doc-cover-band--page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: clamp(13rem, 26vw, 18rem);
    padding-block: 3rem 2.5rem;
    text-align: center;
}
.doc-cover-band--page .doc-cover-inner { width: 100%; max-width: 52rem; }

.doc-cover-title {
    margin: 0;
    color: #fff;
    font-size: clamp(2rem, 1.3rem + 2.6vw, 3.1rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    text-wrap: balance;
    text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35);
}
.doc-cover-sub {
    margin: 0.9rem auto 0;
    max-width: 38rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.05rem;
    line-height: 1.55;
    text-wrap: pretty;
}

@media (max-width: 768px) {
    .doc-cover-band { padding-top: 2.5rem; padding-bottom: 1.75rem; }
    .doc-cover-band--page { min-height: 11rem; }
}
/* ============================================================================
   SECTION BACKGROUNDS — per-section cover image, optional parallax.
   Opt-in via front matter (_bg, _bg_parallax, _bg_overlay, _bg_size,
   _bg_position). Sections without a background render exactly as before.

   Layering model:
     .doc-section           → rounded frame, positioning context
       .doc-section-bg      → image + gradient overlay, as two stacked
                              background-image layers on ONE element, so the
                              overlay tracks the image pixel-for-pixel once
                              the image starts sliding
       .doc-section-bg-inner → the section's content, above the layer
   ============================================================================ */
/* Background layer. Taller than the section so the ±40px parallax travel
   never exposes an edge. transform is compositor-driven; background-position
   would repaint on the main thread and, under a clip-path parent, appear
   not to move at all. */
.doc-section-bg {
    position: absolute;
    left: 0;
    right: 0;
    top: -20%;
    bottom: -20%;
    z-index: -2;
    pointer-events: none;
    background-image: var(--doc-section-bg);
    background-size: var(--doc-section-bg-size, cover);
    background-position: var(--doc-section-bg-position, center);
    background-repeat: no-repeat;
    background-color: var(--panel);
    will-change: transform;
    transform: translate3d(0, var(--doc-parallax-y, 0px), 0);
}

/* Legibility overlay, on the same element as the image, so it slides with it. */
.doc-section-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, calc(var(--doc-section-bg-overlay, 0.55) * 0.85)),
        rgba(0, 0, 0, var(--doc-section-bg-overlay, 0.55))
    );
}

@media (prefers-reduced-motion: reduce) {
    .doc-section-bg {
        transform: none;
        will-change: auto;
    }
}

/* Content sits above the background layer. */
.doc-section-bg-inner {
    position: relative;
    z-index: 1;
}

/* --- Parallax --------------------------------------------------------------
   The JS writes --doc-parallax-y in pixels. We consume it via
   background-position-y, NOT transform: a translated element with a
   background re-anchors its background to the nearest scroll container on
   repaint, which cancels the visual motion. background-position is not
   re-anchored, so it actually moves.

   Both background layers must be positioned together — passing two values
   keeps the gradient locked to the image. A single value would collapse the
   list and the gradient would stop tracking the image, exposing a seam.
   ------------------------------------------------------------------------ */

/* --- Text legibility on a photo ------------------------------------------- */
.doc-section--has-bg .doc-section-title,
.doc-section--has-bg .doc-section-sub,
.doc-section--has-bg .doc-stat-value,
.doc-section--has-bg .doc-stat-label,
.doc-section--has-bg .doc-stat-note,
.doc-section--has-bg .doc-feature-title,
.doc-section--has-bg .doc-feature-note,
.doc-section--has-bg .doc-step-label,
.doc-section--has-bg .doc-step-note,
.doc-section--has-bg .doc-testimonial-quote,
.doc-section--has-bg .doc-testimonial-author,
.doc-section--has-bg .doc-testimonial-role,
.doc-section--has-bg .doc-faq-q,
.doc-section--has-bg .doc-faq-a,
.doc-section--has-bg .doc-quick-link-title,
.doc-section--has-bg .doc-quick-link-note {
    color: #fff;
}

.doc-section--has-bg .doc-section-sub,
.doc-section--has-bg .doc-stat-note,
.doc-section--has-bg .doc-feature-note,
.doc-section--has-bg .doc-step-note,
.doc-section--has-bg .doc-testimonial-role,
.doc-section--has-bg .doc-quick-link-note {
    opacity: 0.88;
}

/* Cards on a photo get a translucent panel so they stay readable without
   the overlay swallowing the image. */
.doc-section--has-bg .doc-feature,
.doc-section--has-bg .doc-step,
.doc-section--has-bg .doc-faq,
.doc-section--has-bg .doc-testimonial,
.doc-section--has-bg .doc-quick-link,
.doc-section--has-bg .doc-customer,
.doc-section--has-bg .doc-stat {
    background: rgba(15, 20, 28, 0.45);
    border-color: rgba(255, 255, 255, 0.22);
    -webkit-backdrop-filter: blur(8px) saturate(1.3);
    backdrop-filter: blur(8px) saturate(1.3);
}

.doc-section--has-bg .doc-faq[open] {
    border-color: rgba(255, 255, 255, 0.45);
}

/* The quote mark on testimonials should read on a photo. */
.doc-section--has-bg .doc-testimonial::before {
    color: #fff;
    opacity: 0.45;
}

/* Stats band: soften the top/bottom rules on a photo. */
.doc-section--has-bg .doc-stats {
    border-top-color: rgba(255, 255, 255, 0.22);
    border-bottom-color: rgba(255, 255, 255, 0.22);
}

/* --- Hero cover band parallax --------------------------------------------- */
.doc-cover-band--parallax {
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
}

@media (max-width: 768px) {
    /* Mobile Safari refuses to repaint fixed backgrounds; fall back to
       scroll on phones so the band doesn't smear. */
    .doc-cover-band--parallax {
        background-attachment: scroll;
    }
}

@media (prefers-reduced-motion: reduce) {
    .doc-cover-band--parallax {
        background-attachment: scroll;
    }
}
/* ============================================================================
   SITE-WIDE BACKGROUND
   Painted on .doc-shell. Driven by the docs index page's front matter:
     docs_background           image path
     docs_background_overlay   0..1 veil strength (default 0.85)
     docs_background_parallax  bool, fixed attachment (default true)

   Layering: the shell is an isolated stacking context. The image is its own
   background, the veil is a fixed ::before at z-index -1 (above the image,
   below every child). No child gets a z-index or position override, so the
   fixed / sticky positioning that every layout depends on is left alone.

   The veil is tinted with the theme's own content colour, so light themes get
   a light veil and dark themes a dark one — text stays readable in all eight.
   ============================================================================ */

/* Base layer colours (apply to every page). */
.doc-cols    { background: var(--content-background); }
.doc-sidebar { background: var(--general-background); }

.doc-shell[data-site-bg="true"] {
    isolation: isolate;
    background-image: var(--doc-site-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: var(--doc-site-bg-attachment, fixed);
}

.doc-shell[data-site-bg="true"]::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: rgba(0, 0, 0, var(--doc-site-bg-overlay, 0.85));
}

@supports (background: color-mix(in srgb, red 50%, transparent)) {
    .doc-shell[data-site-bg="true"]::before {
        background: color-mix(
            in srgb,
            var(--content-background) calc(var(--doc-site-bg-overlay, 0.85) * 100%),
            transparent
        );
    }
}

/* Surfaces that were opaque now let the image show through. */
.doc-shell[data-site-bg="true"] .doc-cols {
    background: transparent;
}

.doc-shell[data-site-bg="true"] .doc-sidebar,
.doc-shell[data-site-bg="true"] .doc-topbar {
    background: var(--veil);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    backdrop-filter: blur(14px) saturate(1.3);
}

.doc-shell[data-site-bg="true"] .doc-footer {
    background: var(--veil);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
    backdrop-filter: blur(12px) saturate(1.3);
    color: inherit;
}

@media (max-width: 768px) {
    /* iOS refuses to repaint fixed backgrounds smoothly; fall back to scroll. */
    .doc-shell[data-site-bg="true"] {
        background-attachment: scroll;
    }
}
/* -------------------------------------------------------- media picker -- */

.doc-media-picker { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 20px; }
.doc-media-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }

.doc-media-card {
    position: relative;
    width: min(880px, 100%);
    max-height: 88vh;
    background: var(--general-background, #fff);
    color: var(--ink, #222);
    border: 1px solid rgba(128, 128, 128, .28);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .5);
}

.doc-media-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(128, 128, 128, .22);
    flex-wrap: wrap;
}
.doc-media-head h3 { margin: 0; font-size: 1rem; font-weight: 640; flex: 0 0 auto; }
.doc-media-search {
    flex: 1 1 200px;
    min-width: 140px;
    padding: 7px 10px;
    border: 1px solid rgba(128, 128, 128, .35);
    border-radius: 7px;
    background: var(--general-background, #fff);
    color: inherit;
    font: inherit;
    font-size: .88rem;
}
.doc-media-upload { cursor: pointer; }

.doc-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    padding: 14px 16px 20px;
    overflow-y: auto;
}
.doc-media-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 30px 10px;
    text-align: center;
    opacity: .7;
    font-size: .9rem;
}

.doc-media-item {
    display: grid;
    grid-template-rows: 120px auto;
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(128, 128, 128, .22);
    border-radius: 8px;
    background: var(--general-background, #fff);
    color: inherit;
    cursor: pointer;
    text-align: left;
    font: inherit;
}
.doc-media-item:hover { border-color: var(--bg-button, #0073aa); }
.doc-media-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.doc-media-pdf {
    display: grid;
    place-items: center;
    height: 100%;
    border-radius: 6px;
    background: rgba(128, 128, 128, .08);
    font-family: ui-monospace, monospace;
    font-size: .8rem;
    letter-spacing: .1em;
    opacity: .75;
}
.doc-media-meta {
    font-size: .72rem;
    font-family: ui-monospace, monospace;
    opacity: .7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-media-status {
    margin: 0;
    padding: 8px 16px 12px;
    font-size: .82rem;
    opacity: .7;
    min-height: 1.2em;
}
.doc-media-status[data-tone="error"] { color: #cf4a44; opacity: 1; }
.doc-media-status[data-tone="done"]  { color: #2ea043; opacity: 1; }
.doc-media-item { position: relative; }

.doc-media-del {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s ease, background 0.12s ease;
}
.doc-media-item:hover .doc-media-del,
.doc-media-del:focus-visible { opacity: 1; }
.doc-media-del:hover { background: #e06c75; }

/* Touch screens have no hover, so keep the button visible. */
@media (hover: none) {
    .doc-media-del { opacity: 1; }
}
/* ============================================================================
   BLOCKS — styles for [[block:TYPE …]] (Content/BlockShortcodes.php)

   REPLACES the earlier block styles at the end of docs.css: delete everything
   from the "BLOCKS — styles for [[block:TYPE …]]" comment to the end of the
   file, then paste this in.

   Design notes: "dev meets business"
   - Flat surfaces: crisp 1px borders on --bg-surface, no drop shadows. Depth
     comes from borders and a hover border colour, like a code editor or a
     product dashboard.
   - Monospace for the small technical details (labels, tags, dates, times,
     column headers, figures in tables), the page's sans for everything you read.
   - The accent is used sparingly: one solid colour, no gradients.
   - Every colour comes from the theme tokens, so all eight palettes work.
   - Pack blocks (JSON) can reuse these classes and the --blk-* tokens below.
   ============================================================================ */

.doc-blk {
    /* tokens a pack block can use too */
    --blk-line: var(--rule);
    --blk-surface: var(--bg-surface, var(--panel));
    --blk-radius: 10px;
    --blk-on-accent: #fff;
    --blk-mono: var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);

    position: relative;
    margin: 2.5rem 0;
}

@supports (color: color-mix(in srgb, red 50%, transparent)) {
    .doc-blk { --blk-line: color-mix(in srgb, var(--rule) 60%, transparent); }
}

/* Dark palettes have a light accent: text on it must be dark. */
:root[data-theme="dark"] .doc-blk      { --blk-on-accent: #04231b; }
:root[data-theme="dark-blue"] .doc-blk { --blk-on-accent: #06182b; }
:root[data-theme="forest"] .doc-blk    { --blk-on-accent: #06210f; }

.doc-blk-inner { min-width: 0; }

/* Section designs reused through the block shortcode keep their own spacing. */
.doc-body .doc-blk > .doc-section { margin-top: 0; }

/* --- heading ------------------------------------------------------------ */
.doc-blk-head { margin-bottom: 1.25rem; text-align: left; max-width: 44rem; }
.doc-blk--center .doc-blk-head { margin-inline: auto; text-align: center; }

.doc-blk-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.65rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
    text-wrap: balance;
}
.doc-blk-title::before {                 /* editor-caret accent */
    content: "";
    flex: none;
    width: 4px;
    height: 1.1em;
    border-radius: 1px;
    background: var(--accent);
}
.doc-blk--center .doc-blk-title { justify-content: center; }
.doc-blk-head .doc-section-sub {
    margin: 0.45rem 0 0;
    font-size: 0.98rem;
    line-height: 1.6;
    color: var(--muted);
    text-wrap: pretty;
}

/* --- shared grid -------------------------------------------------------- */
.doc-blk-grid {
    display: grid;
    grid-template-columns: repeat(var(--blk-cols, 3), minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}
@media (max-width: 900px) {
    .doc-blk-grid { grid-template-columns: repeat(min(var(--blk-cols, 3), 2), minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .doc-blk-grid { grid-template-columns: 1fr; }
}

/* --- shared surface: flat, bordered ------------------------------------ */
.doc-blk-card,
.doc-blk-plan,
.doc-blk-kpi,
.doc-blk-person {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1.25rem;
    border: 1px solid var(--blk-line);
    border-radius: var(--blk-radius);
    background: var(--blk-surface);
    color: var(--ink);
    text-decoration: none;
    box-shadow: none;
    transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}
.doc-body a.doc-blk-card { text-decoration: none; }

a.doc-blk-card:hover,
.doc-blk-plan:hover,
.doc-blk-kpi:hover,
.doc-blk-person:hover {
    border-color: var(--accent);
    color: var(--ink);
}
a.doc-blk-card:hover { transform: translateY(-2px); }

/* --- cards -------------------------------------------------------------- */
.doc-blk-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 0.3rem;
    border: 1px solid var(--blk-line);
    border-radius: 9px;
    background: var(--accent-wash);
    color: var(--accent);
}
.doc-blk-card-icon svg { width: 20px; height: 20px; }
.doc-blk-card-title { font-weight: 650; font-size: 1.02rem; letter-spacing: -0.012em; line-height: 1.3; }
.doc-blk-card-text { margin: 0; font-size: 0.92rem; line-height: 1.6; color: var(--muted); }
.doc-blk-card-arrow {
    margin-top: auto;
    padding-top: 0.5rem;
    font-family: var(--blk-mono);
    font-weight: 600;
    color: var(--accent);
    transition: transform 0.18s ease;
}
a.doc-blk-card:hover .doc-blk-card-arrow { transform: translateX(4px); }

.doc-blk-chip {
    align-self: flex-start;
    padding: 0.12rem 0.5rem;
    border: 1px solid var(--blk-line);
    border-radius: 5px;
    background: var(--accent-wash);
    color: var(--accent);
    font-family: var(--blk-mono);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.doc-blk-card > .doc-blk-chip { position: absolute; top: 1.1rem; right: 1.1rem; }

/* --- buttons ------------------------------------------------------------ */
.doc-blk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    padding: 0.65rem 1.1rem;
    border: 1px solid var(--blk-line);
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font-weight: 620;
    font-size: 0.92rem;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.doc-body a.doc-blk-btn { text-decoration: none; }
.doc-blk-btn:hover { border-color: var(--accent); background: var(--accent-wash); color: var(--accent); }
.doc-blk-btn--primary { border-color: var(--accent); background: var(--accent); color: var(--blk-on-accent); }
.doc-blk-btn--primary:hover { border-color: var(--accent); background: var(--accent); color: var(--blk-on-accent); filter: brightness(1.12); }

/* --- pricing ------------------------------------------------------------ */
.doc-blk-plan { padding: 1.5rem 1.4rem; gap: 0.3rem; }
.doc-blk-plan-name { font-family: var(--blk-mono); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.doc-blk-plan-cost { display: flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.doc-blk-plan-price {
    font-size: clamp(2.1rem, 1.7rem + 1.2vw, 2.7rem);
    font-weight: 740;
    line-height: 1;
    letter-spacing: -0.04em;
    font-feature-settings: "tnum" 1;
}
.doc-blk-plan-period { font-family: var(--blk-mono); font-size: 0.78rem; color: var(--muted); }
.doc-blk-plan-list {
    list-style: none;
    margin: 0.4rem 0 1.3rem;
    padding: 1rem 0 0;
    border-top: 1px dashed var(--blk-line);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.doc-blk-plan-list li { position: relative; margin: 0; padding-left: 1.5rem; font-size: 0.92rem; line-height: 1.45; }
.doc-blk-plan-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    font-family: var(--blk-mono);
    font-weight: 700;
    color: var(--accent);
}

.doc-blk-plan--featured { border: 2px solid var(--accent); padding: calc(1.5rem - 1px) calc(1.4rem - 1px); }
.doc-blk-plan-badge {
    position: absolute;
    top: 0;
    right: 1.1rem;
    padding: 0.2rem 0.6rem;
    border-radius: 0 0 6px 6px;
    background: var(--accent);
    color: var(--blk-on-accent);
    font-family: var(--blk-mono);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* --- timeline ----------------------------------------------------------- */
.doc-blk-timeline { position: relative; list-style: none; margin: 0; padding: 0; }
.doc-blk-timeline::before {
    content: "";
    position: absolute;
    left: 0.34rem;
    top: 0.5rem;
    bottom: 0.5rem;
    border-left: 1px dashed var(--rule-firm);
}
.doc-blk-tl-item { position: relative; display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.4rem 1.1rem; padding: 0 0 1.25rem 1.9rem; }
.doc-blk-tl-item:last-child { padding-bottom: 0; }
.doc-blk-tl-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45rem;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 2px;
    background: var(--accent);
    outline: 4px solid var(--content-background, var(--general-background));
}
.doc-blk-tl-when {
    align-self: start;
    justify-self: start;
    padding: 0.15rem 0.55rem;
    border: 1px solid var(--blk-line);
    border-radius: 5px;
    background: var(--accent-wash);
    color: var(--accent);
    font-family: var(--blk-mono);
    font-size: 0.76rem;
    font-weight: 600;
    font-feature-settings: "tnum" 1;
}
.doc-blk-tl-body {
    padding: 0.75rem 1rem;
    border: 1px solid var(--blk-line);
    border-radius: var(--blk-radius);
    background: var(--blk-surface);
}
.doc-blk-tl-title { font-weight: 650; letter-spacing: -0.01em; }
.doc-blk-tl-text { margin: 0.2rem 0 0; font-size: 0.91rem; line-height: 1.55; color: var(--muted); }
@media (max-width: 640px) { .doc-blk-tl-item { grid-template-columns: 1fr; } }

/* --- table / compare ---------------------------------------------------- */
.doc-blk-tablewrap {
    overflow-x: auto;
    border: 1px solid var(--blk-line);
    border-radius: var(--blk-radius);
    background: var(--blk-surface);
}
.doc-blk-table { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; font-size: 0.92rem; }
.doc-blk-table th,
.doc-blk-table td { padding: 0.7rem 1rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--blk-line); }
.doc-blk-table thead th {
    position: sticky;
    top: 0;
    white-space: nowrap;
    background: var(--sunken);
    font-family: var(--blk-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
}
.doc-blk-table tbody th { font-weight: 640; color: var(--ink); white-space: nowrap; }
.doc-blk-table tbody tr { transition: background 0.12s ease; }
.doc-blk-table tbody tr:hover { background: var(--accent-wash); }
.doc-blk-table tbody tr:last-child > * { border-bottom: 0; }
.doc-blk-table.is-striped tbody tr:nth-child(even) { background: rgba(128, 128, 128, 0.05); }
.doc-blk-table.is-striped tbody tr:hover { background: var(--accent-wash); }
.doc-blk-table .is-num { text-align: right; font-family: var(--blk-mono); font-size: 0.88rem; font-feature-settings: "tnum" 1; }
.doc-blk-table .is-hl { background: var(--accent-wash); }
.doc-blk-table thead .is-hl { color: var(--accent); box-shadow: inset 0 2px 0 var(--accent); }
.doc-blk-table tr.is-total > * { border-top: 1px solid var(--rule-firm); font-weight: 720; background: var(--sunken); }

.doc-blk-yes,
.doc-blk-no,
.doc-blk-dash {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 5px;
    font-family: var(--blk-mono);
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1;
}
.doc-blk-yes  { background: rgba(46, 160, 67, 0.16); color: #2ea043; }
.doc-blk-no   { background: rgba(163, 39, 31, 0.12); color: var(--danger); }
.doc-blk-dash { color: var(--muted); }

/* --- schedule ----------------------------------------------------------- */
.doc-blk-schedule {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--blk-line);
    border-radius: var(--blk-radius);
    background: var(--blk-surface);
}
.doc-blk-sch-row {
    display: grid;
    grid-template-columns: 6rem 1fr;
    gap: 1.1rem;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--blk-line);
    transition: background 0.12s ease;
}
.doc-blk-sch-row:hover { background: var(--accent-wash); }
.doc-blk-sch-row:last-child { border-bottom: 0; }
.doc-blk-sch-time {
    align-self: start;
    font-family: var(--blk-mono);
    font-size: 0.84rem;
    font-weight: 650;
    color: var(--accent);
    font-feature-settings: "tnum" 1;
    padding-top: 0.12rem;
}
.doc-blk-sch-title { font-weight: 650; letter-spacing: -0.01em; }
.doc-blk-sch-meta { margin-top: 0.1rem; font-family: var(--blk-mono); font-size: 0.76rem; color: var(--muted); }
.doc-blk-sch-note { margin: 0.3rem 0 0; font-size: 0.9rem; line-height: 1.55; color: var(--muted); }
@media (max-width: 640px) { .doc-blk-sch-row { grid-template-columns: 1fr; gap: 0.2rem; } }

/* --- KPIs and bars ------------------------------------------------------ */
.doc-blk-kpi { gap: 0.25rem; padding: 1.15rem 1.25rem 1.25rem; }
.doc-blk-kpi-label { font-family: var(--blk-mono); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.doc-blk-kpi-value {
    margin: 0.25rem 0 0.1rem;
    font-size: clamp(1.9rem, 1.5rem + 1.4vw, 2.5rem);
    font-weight: 740;
    line-height: 1;
    letter-spacing: -0.04em;
    font-feature-settings: "tnum" 1;
    color: var(--ink);
}
.doc-blk-kpi-target { font-family: var(--blk-mono); font-size: 0.74rem; color: var(--muted); }
.doc-blk-kpi-note { margin-top: 0.25rem; font-size: 0.84rem; color: var(--muted); }
.doc-blk-kpi .doc-blk-bar { margin-top: 0.6rem; }

.doc-blk-bar {
    height: 6px;
    overflow: hidden;
    border-radius: 2px;
    background: var(--accent-wash);
    border: 1px solid var(--blk-line);
}
.doc-blk-bar > span {
    display: block;
    height: 100%;
    background: var(--accent);
    transform-origin: left;
    animation: doc-blk-grow 0.8s cubic-bezier(0.32, 0.72, 0, 1) both;
}
@keyframes doc-blk-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.doc-blk-bars {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding: 1.3rem 1.4rem;
    border: 1px solid var(--blk-line);
    border-radius: var(--blk-radius);
    background: var(--blk-surface);
}
.doc-blk-barrow { display: flex; flex-direction: column; gap: 0.4rem; }
.doc-blk-barrow .doc-blk-bar { height: 8px; }
.doc-blk-barrow-top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.doc-blk-barrow-label { font-weight: 620; font-size: 0.94rem; }
.doc-blk-barrow-val { font-family: var(--blk-mono); font-size: 0.8rem; font-weight: 600; color: var(--accent); font-feature-settings: "tnum" 1; }

/* --- people ------------------------------------------------------------- */
.doc-blk-person { align-items: flex-start; text-align: left; gap: 0.2rem; padding: 1.4rem 1.3rem; }
.doc-blk-avatar {
    width: 56px;
    height: 56px;
    margin-bottom: 0.6rem;
    border-radius: 12px;
    object-fit: cover;
    flex: none;
    border: 1px solid var(--blk-line);
}
.doc-blk-avatar--text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-wash);
    color: var(--accent);
    font-family: var(--blk-mono);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}
.doc-blk-person-name { font-weight: 680; font-size: 1.02rem; letter-spacing: -0.012em; }
.doc-blk-person-name a { color: inherit; text-decoration: none; }
.doc-body .doc-blk-person-name a { text-decoration: none; }
.doc-blk-person-name a:hover { color: var(--accent); }
.doc-blk-person-role { font-family: var(--blk-mono); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent); }
.doc-blk-person-bio { margin: 0.45rem 0 0; font-size: 0.9rem; line-height: 1.6; color: var(--muted); }

/* --- checklist ---------------------------------------------------------- */
.doc-blk-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.doc-blk-check-row {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin: 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--blk-line);
    border-radius: 8px;
    background: var(--blk-surface);
    transition: border-color 0.15s ease;
}
.doc-blk-check-row:hover { border-color: var(--accent); }
.doc-blk-check {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.3rem;
    height: 1.3rem;
    margin-top: 0.05rem;
    border: 1.5px solid var(--rule-firm);
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
}
.doc-blk-check-row.is-done .doc-blk-check { border-color: #2ea043; background: #2ea043; }
.doc-blk-check-row.is-done .doc-blk-check-text { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--rule-firm); }
.doc-blk-check-main { display: flex; flex-direction: column; min-width: 0; gap: 0.1rem; }
.doc-blk-check-text { font-weight: 550; }
.doc-blk-check-note { font-size: 0.84rem; color: var(--muted); }

/* --- callout ------------------------------------------------------------
   Self-contained: sets its own surface AND its own text colours from the
   theme tokens, with !important on the colours so an older .doc-callout or
   .doc-body rule can never leave dark text on a dark surface.
   ------------------------------------------------------------------------- */
.doc-body aside.doc-callout,
aside.doc-callout {
    --c: var(--accent);
    display: flex;
    gap: 0.85rem;
    margin: 1.5rem 0;
    padding: 0.9rem 1.15rem;
    border: 1px solid var(--blk-line, var(--rule));
    border-left: 3px solid var(--c);
    border-radius: 8px;
    background: var(--bg-surface, var(--panel, transparent));
    color: var(--ink) !important;
}
@supports (color: color-mix(in srgb, red 50%, transparent)) {
    .doc-body aside.doc-callout,
    aside.doc-callout {
        border-color: color-mix(in srgb, var(--c) 30%, var(--rule));
        border-left-color: var(--c);
        background: color-mix(in srgb, var(--c) 9%, var(--bg-surface, var(--panel, transparent)));
    }
}
aside.doc-callout.doc-callout--info    { --c: #3b82f6; }
aside.doc-callout.doc-callout--tip,
aside.doc-callout.doc-callout--success { --c: #2ea043; }
aside.doc-callout.doc-callout--warning { --c: #d29922; }
aside.doc-callout.doc-callout--danger  { --c: var(--danger); }

.doc-callout-icon { flex: none; font-size: 1.05rem; line-height: 1.55; }
.doc-callout-main { min-width: 0; }

.doc-body aside.doc-callout .doc-callout-main,
aside.doc-callout .doc-callout-main { color: var(--ink) !important; background: transparent; }

.doc-body aside.doc-callout .doc-callout-title,
aside.doc-callout .doc-callout-title {
    margin: 0 0 0.1rem;
    background: transparent;
    font-family: var(--blk-mono, var(--mono));
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c) !important;
}

.doc-body aside.doc-callout p.doc-callout-body,
aside.doc-callout p.doc-callout-body {
    margin: 0.2rem 0 0;
    background: transparent;
    font-size: 0.94rem;
    line-height: 1.6;
    color: var(--ink) !important;
    opacity: 1;
}
aside.doc-callout p.doc-callout-body:first-child { margin-top: 0; }

.doc-body aside.doc-callout code,
aside.doc-callout code {
    padding: 0.1em 0.4em;
    border: 1px solid var(--blk-line, var(--rule));
    border-radius: 4px;
    background: var(--bg, rgba(128, 128, 128, 0.14));
    color: var(--ink) !important;
    font-family: var(--blk-mono, var(--mono));
    font-size: 0.85em;
    word-break: break-all;
    white-space: normal;
}

/* --- section-based blocks (stats, features, steps, testimonials, faq, cta, links, logos)
   Same markup and data as the index-page sections, restyled flat to match the
   other blocks. Scoped to .doc-blk--sect, so the index page keeps its own look. */
.doc-blk--sect .doc-section:not(.doc-section--has-bg) {
    max-width: none;
    margin: 0;
    padding: 0;
    border-radius: 0;
    overflow: visible;
    background: none;
}
.doc-blk--sect .doc-section-head { margin-bottom: 1.25rem; text-align: left; max-width: 44rem; }
.doc-blk--sect .doc-section-title {
    margin: 0;
    padding: 0;
    border: 0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.65rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}
.doc-blk--sect .doc-section-title::before {
    content: "";
    flex: none;
    width: 4px;
    height: 1.1em;
    border-radius: 1px;
    background: var(--accent);
}
.doc-blk--sect .doc-section-sub { margin: 0.45rem 0 0; font-size: 0.98rem; line-height: 1.6; color: var(--muted); opacity: 1; }

/* shared flat surface */
.doc-blk--sect .doc-stat,
.doc-blk--sect .doc-feature,
.doc-blk--sect .doc-step,
.doc-blk--sect .doc-testimonial,
.doc-blk--sect .doc-faq,
.doc-blk--sect .doc-customer,
.doc-blk--sect .doc-quick-link {
    border: 1px solid var(--blk-line);
    border-radius: var(--blk-radius);
    background: var(--blk-surface);
    color: var(--ink);
    box-shadow: none;
    transition: border-color 0.18s ease, background-color 0.18s ease;
}
.doc-blk--sect .doc-feature:hover,
.doc-blk--sect .doc-step:hover,
.doc-blk--sect .doc-testimonial:hover,
.doc-blk--sect .doc-customer:hover,
.doc-blk--sect .doc-quick-link:hover,
.doc-blk--sect .doc-stat:hover {
    transform: none;
    border-color: var(--accent);
    box-shadow: none;
}

/* stats */
.doc-blk--sect .doc-stats { gap: 1rem; max-width: none; padding: 0; border: 0; }
.doc-blk--sect .doc-stat { display: flex; flex-direction: column; gap: 0.2rem; padding: 1.15rem 1.25rem 1.25rem; text-align: left; }
.doc-blk--sect .doc-stat-label {
    order: -1;
    font-family: var(--blk-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.doc-blk--sect .doc-stat-value {
    font-size: clamp(1.9rem, 1.5rem + 1.4vw, 2.5rem);
    font-weight: 740;
    line-height: 1;
    letter-spacing: -0.04em;
    font-feature-settings: "tnum" 1;
    color: var(--ink);
}
.doc-blk--sect .doc-stat-note { margin-top: 0.2rem; font-size: 0.84rem; color: var(--muted); }

/* features */
.doc-blk--sect .doc-features-grid { gap: 1rem; }
.doc-blk--sect .doc-feature { gap: 0.45rem; padding: 1.25rem; }
.doc-blk--sect .doc-feature-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 0.3rem;
    border: 1px solid var(--blk-line);
    border-radius: 9px;
    background: var(--accent-wash);
    color: var(--accent);
}
.doc-blk--sect .doc-feature:hover .doc-feature-icon { background: var(--accent-wash); color: var(--accent); transform: none; }
.doc-blk--sect .doc-feature-icon svg { width: 20px; height: 20px; }
.doc-blk--sect .doc-feature-title { margin: 0.15rem 0 0; font-weight: 650; font-size: 1.02rem; letter-spacing: -0.012em; line-height: 1.3; }
.doc-blk--sect .doc-feature-note { margin: 0; font-size: 0.92rem; line-height: 1.6; color: var(--muted); opacity: 1; }

/* steps */
.doc-blk--sect .doc-steps { gap: 1rem; margin: 0; padding: 0; list-style: none; }
.doc-blk--sect .doc-step { padding: 1.15rem 1.25rem 1.15rem 4rem; }
.doc-blk--sect .doc-step-num {
    left: 1.15rem;
    top: 1.1rem;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: var(--accent-wash);
    color: var(--accent);
    font-family: var(--blk-mono);
    font-size: 0.85rem;
    font-weight: 700;
}
.doc-blk--sect .doc-step-label { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
.doc-blk--sect .doc-step-note { color: var(--muted); opacity: 1; }

/* testimonials */
.doc-blk--sect .doc-testimonials-grid { gap: 1rem; }
.doc-blk--sect .doc-testimonial { padding: 1.25rem 1.3rem 1.15rem; border-left: 3px solid var(--accent); }
.doc-blk--sect .doc-testimonial::before { display: none; }
.doc-blk--sect .doc-testimonial-quote {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    font-size: 0.97rem;
    line-height: 1.6;
    color: var(--ink);
}
.doc-blk--sect .doc-testimonial-author { font-weight: 650; }
.doc-blk--sect .doc-testimonial-role { font-family: var(--blk-mono); font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }

/* faq */
.doc-blk--sect .doc-faq-list { gap: 0.5rem; max-width: none; margin: 0; }
.doc-blk--sect .doc-faq { border-radius: 8px; }
.doc-blk--sect .doc-faq[open] { border-color: var(--accent); }
.doc-blk--sect .doc-faq-q { padding: 0.85rem 1.1rem; font-weight: 620; font-size: 0.97rem; }
.doc-blk--sect .doc-faq-q::after {
    content: "+";
    font-family: var(--blk-mono);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--muted);
}
.doc-blk--sect .doc-faq[open] .doc-faq-q::after { content: "−"; transform: none; color: var(--accent); }
.doc-blk--sect .doc-faq-a { padding: 0 1.1rem 1.1rem; color: var(--muted); opacity: 1; }

/* call to action */
.doc-blk--sect .doc-cta:not(.doc-section--has-bg) {
    padding: 1.4rem 1.5rem;
    border: 1px solid var(--blk-line);
    border-radius: var(--blk-radius);
    background: var(--blk-surface);
    text-align: left;
}
.doc-blk--sect .doc-cta-inner { justify-content: flex-start; gap: 0.75rem; }
.doc-blk--sect .doc-cta-btn {
    padding: 0.7rem 1.15rem;
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: var(--accent);
    color: var(--blk-on-accent);
    font-size: 0.92rem;
    box-shadow: none;
    transform: none;
}
.doc-blk--sect .doc-cta-btn:hover { color: var(--blk-on-accent); transform: none; filter: brightness(1.12); box-shadow: none; }

/* quick links */
.doc-blk--sect .doc-quick-links { margin: 0; }
.doc-blk--sect .doc-quick-links-grid { gap: 1rem; }
.doc-blk--sect .doc-quick-link { padding: 1.1rem 1.25rem; gap: 0.9rem; }
.doc-blk--sect .doc-quick-link::before { display: none; }
.doc-blk--sect .doc-quick-link:hover { transform: none; }
.doc-blk--sect .doc-quick-link-icon {
    border: 1px solid var(--blk-line);
    border-radius: 9px;
    background: var(--accent-wash);
    color: var(--accent);
}
.doc-blk--sect .doc-quick-link:hover .doc-quick-link-icon { background: var(--accent-wash); color: var(--accent); transform: none; }
.doc-blk--sect .doc-quick-link,
.doc-blk--sect .doc-quick-link * { text-decoration: none; }
.doc-blk--sect .doc-quick-link-title { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
.doc-blk--sect .doc-quick-link-arrow { font-family: var(--blk-mono); color: var(--accent); }

/* logos */
.doc-blk--sect .doc-customers-grid { gap: 1rem; }
.doc-blk--sect .doc-customer { border-radius: 8px; }
.doc-blk--sect .doc-customer-name { font-family: var(--blk-mono); font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

@media (max-width: 600px) {
    .doc-blk--sect .doc-section-head { max-width: none; }
}

/* --- helpers ------------------------------------------------------------ */
.doc-blk-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- with a background image (bg=…) ------------------------------------- */
.doc-section--has-bg.doc-blk { color: #fff; }
.doc-section--has-bg.doc-blk .doc-blk-title,
.doc-section--has-bg.doc-blk .doc-section-sub,
.doc-section--has-bg.doc-blk .doc-blk-card-title,
.doc-section--has-bg.doc-blk .doc-blk-card-text,
.doc-section--has-bg.doc-blk .doc-blk-plan-name,
.doc-section--has-bg.doc-blk .doc-blk-plan-period,
.doc-section--has-bg.doc-blk .doc-blk-plan-list li,
.doc-section--has-bg.doc-blk .doc-blk-kpi-label,
.doc-section--has-bg.doc-blk .doc-blk-kpi-target,
.doc-section--has-bg.doc-blk .doc-blk-kpi-note,
.doc-section--has-bg.doc-blk .doc-blk-person-name,
.doc-section--has-bg.doc-blk .doc-blk-person-bio,
.doc-section--has-bg.doc-blk .doc-blk-barrow-label,
.doc-section--has-bg.doc-blk .doc-blk-check-text,
.doc-section--has-bg.doc-blk .doc-blk-check-note,
.doc-section--has-bg.doc-blk .doc-blk-tl-title,
.doc-section--has-bg.doc-blk .doc-blk-tl-text,
.doc-section--has-bg.doc-blk .doc-blk-sch-title,
.doc-section--has-bg.doc-blk .doc-blk-sch-meta,
.doc-section--has-bg.doc-blk .doc-blk-sch-note { color: #fff; }

.doc-section--has-bg.doc-blk .doc-blk-card,
.doc-section--has-bg.doc-blk .doc-blk-plan:not(.doc-blk-plan--featured),
.doc-section--has-bg.doc-blk .doc-blk-kpi,
.doc-section--has-bg.doc-blk .doc-blk-person,
.doc-section--has-bg.doc-blk .doc-blk-check-row,
.doc-section--has-bg.doc-blk .doc-blk-tl-body,
.doc-section--has-bg.doc-blk .doc-blk-bars,
.doc-section--has-bg.doc-blk .doc-blk-schedule,
.doc-section--has-bg.doc-blk .doc-blk-tablewrap {
    background: rgba(15, 20, 28, 0.5);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: none;
    color: #fff;
    -webkit-backdrop-filter: blur(10px) saturate(1.3);
    backdrop-filter: blur(10px) saturate(1.3);
}
.doc-section--has-bg.doc-blk .doc-blk-plan--featured { background: rgba(15, 20, 28, 0.5); border-color: #fff; }
.doc-section--has-bg.doc-blk .doc-blk-table th,
.doc-section--has-bg.doc-blk .doc-blk-table td { color: #fff; border-color: rgba(255, 255, 255, 0.2); }
.doc-section--has-bg.doc-blk .doc-blk-table thead th { background: rgba(255, 255, 255, 0.1); }
.doc-section--has-bg.doc-blk .doc-blk-kpi-value,
.doc-section--has-bg.doc-blk .doc-blk-plan-price { color: #fff; }
.doc-section--has-bg.doc-blk .doc-blk-bar { background: rgba(255, 255, 255, 0.22); }

@media (prefers-reduced-motion: reduce) {
    a.doc-blk-card:hover,
    .doc-blk-plan:hover,
    .doc-blk-kpi:hover,
    .doc-blk-person:hover { transform: none; }
    .doc-blk-bar > span { animation: none; }
}

@media print {
    .doc-blk-card,
    .doc-blk-plan,
    .doc-blk-kpi,
    .doc-blk-person,
    .doc-blk-tl-body,
    .doc-blk-check-row { box-shadow: none; break-inside: avoid; }
}
/* ------------------------------------------------------------------ */
/* Media picker — bulk upload                                          */
/* ------------------------------------------------------------------ */

.doc-media-card {
    position: relative;
}

/* "N files just uploaded" bar, between the head and the grid. */
.doc-media-bulk {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0;
    border: 1px solid var(--rule, rgba(128,128,128,.25));
    border-radius: 8px;
    background: rgba(128,128,128,.06);
    font-size: 0.85rem;
}
.doc-media-bulk[hidden] { display: none; }
.doc-media-bulk-text { flex: 1; min-width: 0; }

/* Files uploaded in this session: pinned first and outlined. */
.doc-media-item.is-new {
    outline: 2px solid var(--accent, #0073aa);
    outline-offset: 2px;
}

/* Upload button while a batch is running. */
.doc-media-upload.is-busy {
    opacity: 0.55;
    pointer-events: none;
}

/* Long failure lists wrap rather than widening the card. */
.doc-media-status {
    overflow-wrap: anywhere;
}

/* Drop target. The hint only shows while files are dragged over the card. */
.doc-media-drop-hint {
    display: none;
}
.doc-media-card.is-dropping {
    outline: 2px dashed var(--accent, #0073aa);
    outline-offset: -6px;
}
.doc-media-card.is-dropping .doc-media-drop-hint {
    display: flex;
    position: absolute;
    inset: 0;
    margin: 0;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--accent, #0073aa);
    background: color-mix(in srgb, var(--general-background, #fff) 85%, transparent);
    border-radius: inherit;
    pointer-events: none;
    z-index: 2;
}