/* HostTenant documentation website – uses the same design tokens as the panel */
:root {
  --brand: #7c5cff;
  --accent: var(--brand);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 38%, transparent);
  --accent-text: color-mix(in srgb, var(--accent) 70%, white);
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "SF Mono", Consolas, monospace;
  --top: 60px;
  --side: 272px;

  --bg: #0a0c12;
  --bg-2: #0e1119;
  --surface: #12151f;
  --surface-2: #171b27;
  --surface-3: #1e2331;
  --border: #20263a;
  --border-2: #2b3247;
  --text: #e8eaf2;
  --text-2: #a4aac0;
  --text-3: #6c7389;
  --good: #22c55e;
  --warn: #f5a524;
  --bad: #f04f5f;
  --info: #4c8dff;
  --code-bg: #0d1017;
  --tk-kw: #c792ea;
  --tk-str: #a5e07a;
  --tk-num: #f7a35c;
  --tk-com: #5f6884;
  --tk-fn: #82aaff;
  --tk-key: #7fdbca;
  --tk-type: #ffcb6b;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --surface-3: #eef0f5;
  --border: #e5e7ef;
  --border-2: #d7dae5;
  --text: #141724;
  --text-2: #4f566d;
  --text-3: #8a90a5;
  --accent-text: color-mix(in srgb, var(--accent) 85%, black);
  --code-bg: #f4f5f9;
  --tk-kw: #8a3ffc;
  --tk-str: #237a3b;
  --tk-num: #b5530c;
  --tk-com: #8a90a5;
  --tk-fn: #2155d6;
  --tk-key: #0f7b78;
  --tk-type: #9a6700;
  color-scheme: light;
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
html { scroll-padding-top: calc(var(--top) + 20px); }
body { margin: 0; font: 15px/1.7 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
kbd { font: 11px var(--mono); padding: 2px 6px; border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 6px; color: var(--text-3); background: var(--surface-2); }
::selection { background: var(--accent-soft); }

/* ---------------------------------------------------------------- top bar */
.top {
  position: sticky; top: 0; z-index: 30; height: var(--top);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; letter-spacing: -.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand small { color: var(--text-3); font-weight: 500; margin-left: 4px; }
.logo { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #22d3ee)); box-shadow: 0 6px 18px -6px var(--accent); }
.logo svg { width: 16px; height: 16px; stroke: white; fill: white; }
.search-trigger {
  margin-left: 28px; flex: 0 1 380px; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px 0 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-3); font: inherit; font-size: 14px; cursor: pointer;
}
.search-trigger:hover { border-color: var(--border-2); color: var(--text-2); }
.search-trigger span { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-links { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.top-links a { color: var(--text-2); font-size: 14px; padding: 6px 10px; border-radius: 8px; }
.top-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 9px; background: none; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.menu { display: none; }
:root[data-theme="dark"] .sun, :root[data-theme="light"] .moon { display: none; }

/* ---------------------------------------------------------------- layout */
.layout { display: grid; grid-template-columns: var(--side) minmax(0, 1fr) 230px; max-width: none; margin: 0; }
.side { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 22px 14px 40px 20px; border-right: 1px solid var(--border); }
.side .group { margin-bottom: 18px; }
.side .group-title { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); padding: 0 10px; margin-bottom: 6px; }
.side .group-title svg { width: 14px; height: 14px; }
.side a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--text-2); font-size: 14px; line-height: 1.45; }
.side a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.side a.active { color: var(--accent-text); background: var(--accent-soft); font-weight: 560; }
.main { min-width: 0; padding: 28px 28px 70px; }
.doc { max-width: none; margin: 0; }
.pager { max-width: none; margin: 48px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pager a { display: block; padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); }
.pager a:hover { border-color: var(--accent-line); text-decoration: none; }
.pager a small { display: block; color: var(--text-3); font-size: 12.5px; }
.pager a.next { text-align: right; grid-column: 2; }
.toc { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 36px 20px 40px 8px; font-size: 13px; }
.toc .title { font-size: 11.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.toc a { display: block; padding: 3px 0 3px 12px; color: var(--text-3); border-left: 2px solid var(--border); line-height: 1.45; }
.toc a.l3 { padding-left: 24px; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.on { color: var(--accent-text); border-left-color: var(--accent); }

/* ---------------------------------------------------------------- article */
.doc .crumb { font-size: 13px; color: var(--text-3); margin-bottom: 6px; }
.doc h1 { font-size: 34px; line-height: 1.2; letter-spacing: -.025em; margin: 0 0 10px; font-weight: 700; }
.doc .lead { font-size: 17px; color: var(--text-2); margin: 0 0 28px; }
.doc h2 { font-size: 23px; letter-spacing: -.018em; margin: 48px 0 12px; padding-top: 6px; font-weight: 660; }
.doc h3 { font-size: 18px; margin: 32px 0 8px; font-weight: 640; letter-spacing: -.01em; }
.doc h4 { font-size: 15px; margin: 24px 0 6px; font-weight: 640; }
.doc h2 + h3 { margin-top: 18px; }
.doc :is(h2, h3, h4) .anchor { margin-left: 8px; color: var(--text-3); opacity: 0; font-weight: 400; }
.doc :is(h2, h3, h4):hover .anchor { opacity: 1; text-decoration: none; }
.doc p { margin: 0 0 16px; }
.doc ul, .doc ol { margin: 0 0 18px; padding-left: 24px; }
.doc li { margin: 4px 0; }
.doc li > ul, .doc li > ol { margin: 4px 0; }
.doc li::marker { color: var(--text-3); }
.doc strong { font-weight: 640; }
.doc hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }
.doc code { font: .86em var(--mono); padding: 2px 6px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--border); white-space: break-spaces; }
.doc a code { color: var(--accent-text); }
.doc img { max-width: 100%; border-radius: 12px; border: 1px solid var(--border); }
.doc ol.steps { list-style: none; counter-reset: step; padding-left: 0; }
.doc ol.steps > li { counter-increment: step; position: relative; padding-left: 44px; margin: 0 0 14px; }
.doc ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 650; background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-line); }

/* code blocks */
.code { position: relative; margin: 0 0 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--code-bg); overflow: hidden; }
.code .code-head { display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px 14px; border-bottom: 1px solid var(--border); font: 12px var(--mono); color: var(--text-3); background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.code .code-head .lang { margin-left: auto; text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13px/1.65 var(--mono); tab-size: 4; }
.code pre code { all: unset; white-space: pre; }
.copy { position: absolute; top: 7px; right: 8px; height: 26px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text-2); font: 12px var(--font); cursor: pointer; opacity: 0; transition: opacity .15s; }
.code:hover .copy, .copy:focus { opacity: 1; }
.code .code-head ~ .copy { top: 40px; }
.copy.done { color: var(--good); }
.tk-kw { color: var(--tk-kw); }
.tk-str { color: var(--tk-str); }
.tk-num { color: var(--tk-num); }
.tk-com { color: var(--tk-com); font-style: italic; }
.tk-fn { color: var(--tk-fn); }
.tk-key { color: var(--tk-key); }
.tk-type { color: var(--tk-type); }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--border); border-radius: 12px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc th { text-align: left; font-weight: 620; font-size: 12.5px; color: var(--text-2); background: var(--surface-2); padding: 9px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.doc td { padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc tr:last-child td { border-bottom: 0; }
.doc td code { white-space: nowrap; }

/* callouts */
.callout { display: flex; gap: 12px; padding: 14px 16px; margin: 0 0 20px; border: 1px solid var(--border); border-left: 3px solid var(--info); border-radius: 10px; background: color-mix(in srgb, var(--info) 7%, var(--surface)); }
.callout > svg { margin-top: 3px; color: var(--info); }
.callout > div { min-width: 0; }
.callout > div > :last-child { margin-bottom: 0; }
.callout .callout-title { font-weight: 640; margin-bottom: 2px; }
.callout.tip { border-left-color: var(--good); background: color-mix(in srgb, var(--good) 7%, var(--surface)); }
.callout.tip > svg { color: var(--good); }
.callout.warn { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
.callout.warn > svg { color: var(--warn); }
.callout.danger { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 7%, var(--surface)); }
.callout.danger > svg { color: var(--bad); }

/* landing page elements */
.hero { position: relative; padding: 38px 36px; margin: 0 0 30px; border: 1px solid var(--border); border-radius: 20px; overflow: hidden;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%), radial-gradient(90% 120% at 100% 100%, color-mix(in srgb, #22d3ee 13%, transparent), transparent 60%), var(--surface); }
.hero h1 { font-size: 36px; margin-bottom: 10px; }
.hero p { font-size: 17px; color: var(--text-2); max-width: 620px; }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; font-weight: 600; font-size: 14px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); }
.btn:hover { text-decoration: none; border-color: var(--accent-line); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: white; box-shadow: 0 8px 22px -10px var(--accent); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 0 0 26px; }
.cards a { display: block; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); transition: border-color .15s, transform .15s; }
.cards a:hover { text-decoration: none; border-color: var(--accent-line); transform: translateY(-2px); }
.cards .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 12px; }
.cards b { display: block; font-weight: 640; margin-bottom: 4px; }
.cards span { display: block; font-size: 13.5px; color: var(--text-2); line-height: 1.55; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-line); vertical-align: 2px; }
.diagram { font: 12.5px/1.5 var(--mono); color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; overflow-x: auto; white-space: pre; margin: 0 0 20px; }

/* ---------------------------------------------------------------- search */
.search-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(5, 7, 12, .55); backdrop-filter: blur(4px); display: flex; justify-content: center; padding: 10vh 16px 16px; }
.search-overlay[hidden] { display: none; }
.search-box { width: min(680px, 100%); max-height: 72vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-2); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); overflow: hidden; }
.search-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--text-3); }
.search-input input { flex: 1; height: 56px; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 16px; }
.search-input input::-webkit-search-cancel-button { display: none; }
.search-results { overflow-y: auto; padding: 8px; }
.search-results .hint { padding: 26px 16px; text-align: center; color: var(--text-3); font-size: 14px; }
.search-results a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--text); }
.search-results a:hover, .search-results a.sel { background: var(--accent-soft); text-decoration: none; }
.search-results .r-page { font-size: 12px; color: var(--text-3); }
.search-results .r-title { font-weight: 600; }
.search-results .r-text { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-results mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

.loading { height: 240px; border-radius: 14px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .layout { grid-template-columns: var(--side) minmax(0, 1fr); }
  .toc { display: none; }
  .main { padding: 32px 40px 70px; }
}
@media (max-width: 860px) {
  .layout { display: block; }
  .icon-btn.menu { display: grid; }
  .side { position: fixed; top: var(--top); left: 0; bottom: 0; height: auto; width: 290px; z-index: 25; background: var(--bg-2); transform: translateX(-100%); transition: transform .22s ease; box-shadow: 20px 0 50px -20px rgba(0, 0, 0, .5); }
  body.nav-open .side { transform: none; }
  .main { padding: 26px 20px 60px; }
  .search-trigger { margin-left: auto; flex: 0 0 auto; width: 38px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .top-links { margin-left: 0; }
  .top-links a { display: none; }
  .brand small { display: none; }
  .doc h1, .hero h1 { font-size: 28px; }
  .hero { padding: 26px 22px; }
  .pager { grid-template-columns: 1fr; }
  .pager a.next { grid-column: 1; }
}
@media print {
  .top, .side, .toc, .pager, .copy { display: none !important; }
  .layout { display: block; }
  .main { padding: 0; }
}
