/* ═══════════ DeskProxy developer docs ═══════════ */
:root {
  --bg: #0b0d10;
  --bg-raise: #14171c;
  --bg-card: #1a1e24;
  --line: #262b33;
  --text: #f2f4f7;
  --text-dim: #9aa3b0;
  --accent: #ff6b2c;
  --accent-soft: rgba(255, 107, 44, 0.12);
  --green: #3ecf8e;
  --red: #ff5c5c;
  --blue: #79c0ff;
  --radius: 14px;
  --font: -apple-system, "SF Pro Display", "Inter", "Segoe UI", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, monospace;
  --sidebar: 264px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── top bar ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  backdrop-filter: blur(16px);
  background: rgba(11, 13, 16, 0.8);
  border-bottom: 1px solid var(--line);
}
.topbar .logo { font-weight: 700; font-size: 17px; }
.topbar .logo span { color: var(--accent); }
.topbar .back { font-size: 14px; color: var(--text-dim); }
.topbar .back:hover { color: var(--text); text-decoration: none; }

/* ── layout ── */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; max-width: 1280px; margin: 0 auto; }

/* ── sidebar TOC ── */
.toc {
  position: sticky; top: 56px; align-self: start;
  height: calc(100vh - 56px); overflow-y: auto;
  padding: 32px 20px 60px; border-right: 1px solid var(--line);
}
.toc .group {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim); margin: 24px 0 8px; opacity: 0.7;
}
.toc .group:first-child { margin-top: 0; }
.toc a {
  display: block; padding: 5px 10px; border-radius: 8px;
  font-size: 14px; color: var(--text-dim);
}
.toc a:hover { color: var(--text); background: var(--bg-raise); text-decoration: none; }
.toc a.active { color: var(--accent); background: var(--accent-soft); }

/* ── content ── */
main { padding: 48px 56px 120px; min-width: 0; max-width: 860px; }
main > section { padding-top: 24px; margin-top: 24px; scroll-margin-top: 72px; }
main > section:first-of-type { margin-top: 0; border-top: none; }

.doc-hero { margin-bottom: 12px; }
.kicker {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
h1 { font-size: clamp(34px, 5vw, 48px); line-height: 1.08; letter-spacing: -0.02em; margin-bottom: 16px; }
h2 { font-size: 27px; letter-spacing: -0.01em; margin-bottom: 14px; padding-top: 8px; }
h3 { font-size: 19px; margin: 28px 0 10px; }
.lede { font-size: 19px; color: var(--text-dim); max-width: 640px; }
p { margin-bottom: 14px; color: #d7dce3; }
ul, ol { margin: 0 0 16px 22px; }
li { margin-bottom: 7px; color: #d7dce3; }
strong { color: var(--text); font-weight: 650; }
hr { border: none; border-top: 1px solid var(--line); margin: 8px 0; }

/* ── inline + block code ── */
code {
  font-family: var(--mono); font-size: 13.5px;
  background: var(--bg-card); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 6px; color: #e6c07b;
}
pre {
  background: #0d1117; border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 22px; overflow-x: auto; margin: 4px 0 20px;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.6;
}
pre code { background: none; border: none; padding: 0; color: #c9d1d9; font-size: inherit; }
/* light syntax accents */
pre .c { color: #6a7684; }
pre .k { color: #ff7b72; }
pre .s { color: #a5d6ff; }
pre .t { color: #7ee787; }
pre .a { color: #79c0ff; }
pre .f { color: #d2a8ff; }
pre .n { color: #79c0ff; }

/* ── tables ── */
.tbl-wrap { overflow-x: auto; margin: 4px 0 22px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--text-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
td code { white-space: nowrap; }

/* ── callouts ── */
.callout {
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  background: var(--bg-raise); border-radius: 10px;
  padding: 14px 18px; margin: 4px 0 22px;
}
.callout .title { font-weight: 650; margin-bottom: 4px; font-size: 14px; }
.callout p:last-child { margin-bottom: 0; }
.callout.tip { border-left-color: var(--green); }
.callout.tip .title { color: var(--green); }
.callout.warn { border-left-color: #f0b429; }
.callout.warn .title { color: #f0b429; }

/* ── step cards / feature grid ── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 6px 0 22px; }
.card { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card p { font-size: 14px; color: var(--text-dim); margin: 0; }

.diagram {
  font-family: var(--mono); font-size: 13px; line-height: 1.5; color: var(--text-dim);
  background: #0d1117; border: 1px solid var(--line); border-radius: 12px;
  padding: 20px; overflow-x: auto; white-space: pre; margin: 4px 0 22px;
}

.pagefoot { margin-top: 60px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--text-dim); font-size: 13px; }

/* ── responsive ── */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .toc { display: none; }
  main { padding: 40px 22px 80px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
