/* Panegrip docs (/apps, /apps/<name>): plain documentation — a sidebar, one
   readable column, an outline. The site's colours and fonts, nothing else. */

:root {
  --bg: #070708; --surface: #111113; --surface-2: #18181c;
  --line: #26262c; --line-strong: #3a3a42;
  --ink: #f4f4f2; --soft: #c2c2c8; --muted: #8b8b93;
  --signal: #ff5a24; --ok: #3ddc84;
  --f-text: "Geist", system-ui, -apple-system, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --top: 60px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 24px); }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.7 var(--f-text); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }

/* top bar */
.d-top { position: sticky; top: 0; z-index: 10; height: var(--top); display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 24px; background: rgba(7, 7, 8, .9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.d-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.d-brand span:last-child { color: var(--muted); font-weight: 400; }
.d-logo { display: inline-grid; grid-template-columns: repeat(2, 7px); gap: 2px; }
.d-logo i { width: 7px; height: 7px; border-radius: 1.5px; background: var(--ink); }
.d-logo i:last-child { background: var(--signal); }
.d-top nav { display: flex; align-items: center; gap: 20px; font-size: 14px; color: var(--soft); }
.d-top nav a:hover { color: var(--ink); }
.d-top .d-cta { padding: 6px 12px; border-radius: 8px; background: var(--ink); color: var(--bg); font-weight: 500; }
.d-top .d-cta:hover { color: var(--bg); opacity: .9; }

/* three columns: sidebar, the page, its outline */
.d-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px; max-width: 1240px; margin: 0 auto; }
.d-side, .d-toc { position: sticky; top: var(--top); align-self: start; max-height: calc(100vh - var(--top)); overflow-y: auto; padding: 32px 24px; font-size: 14px; }
.d-side { border-right: 1px solid var(--line); }
.d-side ul, .d-toc ul { list-style: none; }
.d-group { margin: 20px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.d-group:first-child { margin-top: 0; }
.d-side a { display: block; padding: 5px 10px; margin: 0 -10px; border-radius: 6px; color: var(--soft); }
.d-side a:hover { color: var(--ink); background: var(--surface); }
.d-side a[aria-current="page"] { color: var(--ink); background: var(--surface-2); font-weight: 500; }
.d-toc p { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.d-toc a { display: block; padding: 3px 0; color: var(--muted); }
.d-toc a:hover { color: var(--ink); }

/* the page */
.d-main { padding: 40px 48px 80px; }
.d-doc { max-width: 720px; }
.d-crumbs { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.d-crumbs a { color: var(--soft); }
.d-crumbs a:hover { color: var(--ink); }
.d-doc h1 { font-size: 36px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; margin-bottom: 16px; }
.d-lead { font-size: 18px; color: var(--soft); margin-bottom: 8px; }
.d-doc h2 { font-size: 24px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; margin: 48px 0 16px; padding-top: 24px; border-top: 1px solid var(--line); }
.d-doc h3 { font-size: 17px; font-weight: 600; margin: 28px 0 8px; }
.d-doc p, .d-doc ul, .d-doc ol, .d-doc table, .d-doc pre, .d-note { margin-bottom: 16px; }
.d-doc p, .d-doc li { color: var(--soft); }
.d-doc strong { color: var(--ink); font-weight: 600; }
.d-doc ul, .d-doc ol { padding-left: 24px; }
.d-doc li + li { margin-top: 6px; }
.d-doc li > p { margin-bottom: 8px; }
.d-doc a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.d-doc a:hover { text-decoration-color: var(--signal); }
.d-doc :not(pre) > code { font: 400 .875em var(--f-mono); padding: 2px 6px; border-radius: 4px; background: var(--surface-2); color: var(--ink); }

/* setup steps: numbered, each with room for its command */
.d-steps { counter-reset: step; list-style: none; padding-left: 0 !important; }
.d-steps > li { counter-increment: step; position: relative; padding-left: 44px; margin-top: 24px !important; }
.d-steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 600 14px/1 var(--f-text); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-strong); }

/* code */
.d-doc pre { position: relative; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow-x: auto; }
.d-doc pre code { font: 400 14px/1.6 var(--f-mono); color: var(--ink); }
.d-copy { position: absolute; top: 8px; right: 8px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--soft); font: 500 12px/1.4 var(--f-text); cursor: pointer; }
.d-copy:hover { color: var(--ink); }

/* tables */
.d-doc table { width: 100%; border-collapse: collapse; font-size: 15px; }
.d-doc th { text-align: left; font-weight: 600; color: var(--ink); padding: 10px 12px; border-bottom: 1px solid var(--line-strong); }
.d-doc td { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--soft); vertical-align: top; }
.d-doc td:first-child { color: var(--ink); white-space: nowrap; }

/* notes */
.d-note { padding: 12px 16px; border: 1px solid var(--line); border-left: 3px solid var(--signal); border-radius: 6px; background: var(--surface); }
.d-note p { margin: 0; }

/* previous / next */
.d-pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.d-pager a { display: flex; flex-direction: column; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; min-width: 180px; text-decoration: none !important; color: var(--ink); font-weight: 500; }
.d-pager a:hover { border-color: var(--line-strong); }
.d-pager a small { color: var(--muted); font-weight: 400; font-size: 13px; }
.d-pager .next { margin-left: auto; text-align: right; }

.d-foot { padding: 24px; border-top: 1px solid var(--line); text-align: center; font-size: 13px; color: var(--muted); }
.d-foot a:hover { color: var(--ink); }

@media (max-width: 1100px) { .d-layout { grid-template-columns: 220px minmax(0, 1fr); } .d-toc { display: none; } }
@media (max-width: 760px) {
  .d-layout { grid-template-columns: 1fr; }
  .d-side { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); padding: 16px 20px; }
  .d-side ul { display: flex; flex-wrap: wrap; gap: 4px 12px; }
  .d-side a { margin: 0; padding: 4px 8px; }
  .d-main { padding: 28px 20px 64px; }
  .d-doc h1 { font-size: 30px; }
  .d-top { padding: 0 16px; }
  .d-top nav { gap: 16px; }
  .d-top .d-cta { display: none; }
  .d-doc td:first-child { white-space: normal; }
}
