/* D167: docs.hi-client.com layout. Tokens of the main site (wwwroot/css/site.css, _AccountAppearance dark palette). */
:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --surface: #ffffff;
  --surface-alt: #f5f5f7;
  --text: #1d1d1f;
  --text-muted: #646469;
  --border: #dedee3;
  --accent: #0066cc;
  --accent-strong: #0055ad;
  --accent-text: #ffffff;
  --accent-soft: #edf4fc;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --ok: #166534;
  --ok-soft: #ecfdf3;
  --warn: #92400e;
  --warn-soft: #fffbeb;
  --focus: #1d4ed8;
  --code-bg: #f5f5f7;
  --radius: 14px;
  --radius-small: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  --topbar: 60px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171719; --bg-soft: #242428; --surface: #1d1d1f; --surface-alt: #2c2c30; --text: #f5f5f7; --text-muted: #b7b7bd;
  --border: #46464c; --accent: #8fc4ff; --accent-strong: #a9d1ff; --accent-text: #000000; --accent-soft: #152c45;
  --danger: #fca5a5; --danger-soft: #3b171b; --ok: #86efac; --ok-soft: #102d20; --warn: #fcd34d; --warn-soft: #35280f;
  --focus: #8fc4ff; --code-bg: #242428;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 1rem; line-height: 1.65;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.docs-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.docs-skip { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 8px 14px; background: var(--accent); color: var(--accent-text); border-radius: var(--radius-small); text-decoration: none; }
.docs-skip:focus { top: 10px; }

/* Top bar */
.docs-topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar); display: flex; align-items: center; gap: 16px;
  padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.docs-brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; flex: none; }
.docs-logo { height: 28px; width: auto; display: block; }
.docs-logo-dark { display: none; }
:root[data-theme="dark"] .docs-logo-light { display: none; }
:root[data-theme="dark"] .docs-logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .docs-logo-light { display: none; }
  :root:not([data-theme="light"]) .docs-logo-dark { display: block; }
}
.docs-brand-label { font-weight: 600; font-size: 1.05rem; padding-left: 10px; border-left: 1px solid var(--border); }
.docs-menu-button {
  display: none; flex: none; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: var(--radius-small);
  background: var(--surface); color: var(--text); font-size: 1.2rem; cursor: pointer;
}
.docs-search { position: relative; flex: 1 1 auto; max-width: 460px; margin-left: 12px; }
.docs-search input {
  width: 100%; height: 38px; padding: 0 36px 0 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-soft); color: var(--text); font: inherit; font-size: .95rem;
}
.docs-search input::placeholder { color: var(--text-muted); }
.docs-kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: .75rem;
  color: var(--text-muted); border: 1px solid var(--border); border-radius: 5px; padding: 0 6px; pointer-events: none;
}
.docs-search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; max-height: 70vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-small); box-shadow: 0 12px 32px rgb(0 0 0 / 14%);
}
.docs-search-results a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.docs-search-results a small { display: block; color: var(--text-muted); font-size: .8rem; }
.docs-search-results [aria-selected="true"] a, .docs-search-results a:hover { background: var(--accent-soft); }
.docs-search-results .docs-search-empty { padding: 8px 10px; color: var(--text-muted); }
.docs-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; flex: none; }
.docs-languages { display: flex; gap: 2px; border: 1px solid var(--border); border-radius: 999px; padding: 2px; }
.docs-languages a { padding: 2px 9px; border-radius: 999px; color: var(--text-muted); text-decoration: none; font-size: .8rem; font-weight: 600; }
.docs-languages a[aria-current="true"] { background: var(--accent); color: var(--accent-text); }
.docs-theme-button {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); font: inherit; font-size: .85rem; cursor: pointer;
}
.docs-main-site { font-size: .9rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.docs-main-site:hover { color: var(--accent); }

/* Three columns */
.docs-layout {
  flex: 1; display: grid; grid-template-columns: 270px minmax(0, 1fr) 230px; width: 100%; max-width: 1440px; margin: 0 auto;
}
.docs-sidebar {
  position: sticky; top: var(--topbar); align-self: start; height: calc(100vh - var(--topbar)); overflow-y: auto;
  padding: 24px 16px 40px 24px; border-right: 1px solid var(--border);
}
.docs-nav-home { margin: 0 0 18px; }
.docs-nav-home a, .docs-nav-section a { display: block; padding: 4px 10px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: .93rem; line-height: 1.4; }
.docs-nav-section { margin-bottom: 18px; }
.docs-nav-section h2 { margin: 0 0 6px; padding: 0 10px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.docs-nav-section ul { list-style: none; margin: 0; padding: 0; }
.docs-sidebar a:hover { background: var(--bg-soft); }
.docs-sidebar a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.docs-main { min-width: 0; padding: 32px 48px 64px; outline: none; }
.docs-main > * { max-width: 780px; }
.docs-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 14px; padding: 0; font-size: .85rem; color: var(--text-muted); }
.docs-breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: var(--border); }
.docs-breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.docs-title-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; }
.docs-title-row h1 { margin: 0; font-size: clamp(1.75rem, 3.5vw, 2.4rem); line-height: 1.2; letter-spacing: -.02em; }
.docs-lead { margin: 10px 0 28px; font-size: 1.15rem; color: var(--text-muted); }
.docs-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 6px; }
.docs-tool {
  display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text); font: inherit; font-size: .8rem; text-decoration: none; cursor: pointer;
}
.docs-tool:hover { border-color: var(--accent); color: var(--accent); }
.docs-tool[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.docs-tool-status { font-size: .8rem; color: var(--text-muted); }
.docs-fallback { padding: 10px 14px; border: 1px solid var(--warn); border-radius: var(--radius-small); background: var(--warn-soft); color: var(--text); }
.docs-agent-view {
  margin: 0; padding: 18px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: .85rem; line-height: 1.55;
  background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-small);
}
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.docs-pager a { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-small); text-decoration: none; color: var(--text); }
.docs-pager a:hover { border-color: var(--accent); }
.docs-pager small { display: block; color: var(--text-muted); font-size: .8rem; }
.docs-pager span { font-weight: 600; color: var(--accent); }
.docs-pager-next { text-align: right; grid-column: 2; }
.docs-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 8px; }
.docs-card { padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.docs-card h2 { margin: 0 0 10px; font-size: 1.05rem; }
.docs-card ul { list-style: none; margin: 0; padding: 0; }
.docs-card li { margin: 0 0 10px; }
.docs-card li a { font-weight: 600; text-decoration: none; }
.docs-card li span { display: block; font-size: .88rem; color: var(--text-muted); line-height: 1.45; }
.docs-toc { position: sticky; top: var(--topbar); align-self: start; max-height: calc(100vh - var(--topbar)); overflow-y: auto; padding: 32px 20px 40px 8px; }
.docs-toc h2 { margin: 0 0 8px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.docs-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.docs-toc a { display: block; padding: 3px 0 3px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--text-muted); text-decoration: none; font-size: .85rem; line-height: 1.4; }
.docs-toc .docs-toc-h3 a { padding-left: 24px; }
.docs-toc a:hover { color: var(--text); }
.docs-toc a[aria-current="true"] { color: var(--accent-strong); border-left-color: var(--accent); }
.docs-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 20px 24px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .85rem; }
.docs-footer p { margin: 0; }

@media (max-width: 1180px) {
  .docs-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .docs-toc { display: none; }
}
@media (max-width: 860px) {
  :root { --topbar: 56px; }
  .docs-topbar { gap: 8px; padding: 0 12px; }
  .docs-js .docs-menu-button { display: inline-flex; align-items: center; justify-content: center; }
  .docs-brand-label { display: none; }
  .docs-logo { height: 24px; }
  .docs-search { margin-left: 4px; min-width: 0; }
  .docs-kbd, .docs-theme-text, .docs-main-site { display: none; }
  .docs-actions { gap: 6px; }
  .docs-layout { grid-template-columns: minmax(0, 1fr); }
  .docs-sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .docs-js .docs-sidebar {
    position: fixed; z-index: 25; border-bottom: 0; top: var(--topbar); left: 0; bottom: 0; width: min(320px, 86vw); height: auto; align-self: stretch;
    background: var(--surface); box-shadow: 0 0 0 100vmax rgb(0 0 0 / 35%); transform: translateX(-105%); visibility: hidden;
    transition: transform .2s ease, visibility .2s;
  }
  .docs-js .docs-sidebar[data-open="true"] { transform: none; visibility: visible; }
  .docs-main { padding: 20px 16px 48px; }
  .docs-pager { grid-template-columns: 1fr; }
  .docs-pager-next { grid-column: 1; }
}
@media (max-width: 560px) {
  /* Search on its own row: beside the logo, language and theme it was a few characters wide. */
  :root { --topbar: 104px; }
  .docs-topbar { flex-wrap: wrap; align-content: center; row-gap: 8px; }
  .docs-actions { margin-left: auto; }
  .docs-search { order: 10; flex: 1 0 100%; max-width: none; margin-left: 0; }
}
@media (max-width: 420px) {
  .docs-languages a { padding: 2px 6px; }
  .docs-theme-button { padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) { .docs-sidebar { transition: none; } }
@media print {
  .docs-topbar, .docs-sidebar, .docs-toc, .docs-tools, .docs-pager, .docs-footer { display: none !important; }
  .docs-layout { display: block; }
}

.docs-nav-section summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.docs-language-select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px; max-width: 130px; }
