/* SimplyPIM API documentation — self-contained stylesheet.

   No build step, no external assets, no webfonts. Light theme ONLY (the app surface is
   light-only per the owner's 1.6 directive), using the same shadcn zinc tokens as
   public/dashboard/app.css so the docs and the dashboard read as one product. */

:root {
  color-scheme: light;

  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --ink: #111827;
  --muted: #5b6676;
  --faint: #8a94a4;
  --line: #e3e8ef;

  --accent: #2f5bd7;
  --accent-ink: #ffffff;
  --accent-soft: #e8eefc;
  --accent-hover: #2749b4;

  --ok: #147d57;
  --ok-soft: #dcf3e9;
  --warn: #b26a00;
  --warn-soft: #fbeeda;
  --danger: #c02f28;
  --danger-soft: #fbe5e3;
  --violet: #5b45c9;
  --violet-soft: #ece8fb;

  --code-bg: #0f1523;
  --code-ink: #e6ecf7;
  --code-line: #1f2a3f;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  --shadow-sm: 0 1px 2px rgb(16 24 40 / .05);
  --shadow-md: 0 4px 14px rgb(16 24 40 / .08);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --side-w: 268px;
  --top-h: 58px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + 16px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--top-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: rgb(255 255 255 / .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 650; }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), #6f8ff0);
  color: #fff; font-size: 13px; font-weight: 700;
  display: grid; place-items: center;
}
.brand .sub { color: var(--faint); font-weight: 500; }

.topbar nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.topbar nav a {
  padding: 6px 10px; border-radius: var(--radius-xs);
  color: var(--muted); font-size: 14px; font-weight: 500;
}
.topbar nav a:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.topbar nav a.cta { background: var(--accent); color: var(--accent-ink); }
.topbar nav a.cta:hover { background: var(--accent-hover); color: #fff; }

/* -------------------------------------------------------------------- shell */

.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); gap: 0; }

.sidebar {
  position: sticky;
  top: var(--top-h);
  align-self: start;
  height: calc(100vh - var(--top-h));
  overflow-y: auto;
  padding: 22px 14px 60px 20px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.sidebar h4 {
  margin: 20px 0 6px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
}
.sidebar h4:first-child { margin-top: 0; }

.sidebar a {
  display: block;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  color: var(--muted);
  font-size: 13.5px;
}
.sidebar a:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.sidebar a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidebar code { font-size: 12px; }

main { min-width: 0; padding: 34px 40px 120px; }
.wrap { max-width: 900px; }

/* ------------------------------------------------------------------ typography */

h1 { font-size: 34px; line-height: 1.2; margin: 0 0 10px; letter-spacing: -.02em; }
h2 {
  font-size: 24px; margin: 54px 0 8px; letter-spacing: -.01em;
  padding-top: 10px; border-top: 1px solid var(--line);
}
h2:first-of-type { border-top: 0; }
h3 { font-size: 17px; margin: 30px 0 6px; }
h4 { font-size: 15px; margin: 24px 0 4px; color: var(--ink); }
p { margin: 10px 0; color: #26303d; }
.lede { font-size: 17px; color: var(--muted); }
.muted { color: var(--muted); }
ul, ol { margin: 10px 0; padding-left: 22px; color: #26303d; }
li { margin: 4px 0; }

code {
  font-family: var(--mono);
  font-size: 13px;
  background: #eef2f8;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

/* ------------------------------------------------------------------ callouts */

.note, .warn {
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.note { border-left: 3px solid var(--accent); }
.warn { border-left: 3px solid var(--warn); background: #fffdf7; }
.note b, .warn b { color: var(--ink); }
.note p:first-child, .warn p:first-child { margin-top: 0; }
.note p:last-child, .warn p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ tables */

table.t {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 14px;
}
table.t th {
  text-align: left;
  padding: 9px 12px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t td code { background: #f1f5fb; }
table.t td:first-child { white-space: nowrap; }

/* ------------------------------------------------------------------ endpoints */

.endpoint {
  margin: 22px 0 34px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.endpoint > .head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.endpoint > .body { padding: 4px 16px 16px; }
.endpoint > .body > p:first-child { margin-top: 12px; }

.verb {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid transparent;
}
.verb.get { background: var(--accent-soft); color: var(--accent); border-color: #cfdcfa; }
.verb.post { background: var(--ok-soft); color: var(--ok); border-color: #bfe8d6; }
.verb.patch { background: var(--warn-soft); color: var(--warn); border-color: #f0dcb8; }
.verb.put { background: var(--violet-soft); color: var(--violet); border-color: #d9d2f6; }
.verb.delete { background: var(--danger-soft); color: var(--danger); border-color: #f4cdc9; }

.head .path { font-family: var(--mono); font-size: 14px; background: none; border: 0; padding: 0; }
.head .scope {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  background: #eef2f8;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
.head .scope.pub { background: var(--ok-soft); color: var(--ok); border-color: #bfe8d6; }
.head .scope.session { background: var(--violet-soft); color: var(--violet); border-color: #d9d2f6; }
/* Owner-gated: an elevated privilege, not merely a different credential. */
.head .scope.owner { background: var(--warn-soft); color: var(--warn); border-color: #f0dcb8; }

/* ------------------------------------------------------------------ code blocks */

.tabs { margin: 14px 0 0; }
.tabbar { display: flex; gap: 4px; margin-bottom: -1px; }
.tabbar button {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-bottom-color: transparent;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  padding: 5px 12px;
  cursor: pointer;
}
.tabbar button[aria-selected="true"] { background: var(--code-bg); color: #fff; border-color: var(--code-bg); }

pre {
  margin: 0;
  padding: 14px 16px;
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.8px;
  line-height: 1.65;
  tab-size: 2;
}
.tabs pre { border-top-left-radius: 0; }
pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
[hidden] { display: none !important; }

.block { position: relative; margin: 14px 0; }
.block > .label {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.block > .label .status {
  font-family: var(--mono); font-weight: 700; letter-spacing: 0;
  color: var(--ok); background: var(--ok-soft); border: 1px solid #bfe8d6;
  border-radius: 999px; padding: 1px 8px; text-transform: none;
}
.block > .label .status.err { color: var(--danger); background: var(--danger-soft); border-color: #f4cdc9; }

.copy {
  position: absolute; top: 0; right: 0;
  font: inherit; font-size: 11.5px; font-weight: 600;
  color: var(--muted); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-xs);
  padding: 2px 8px; cursor: pointer;
}
.copy:hover { color: var(--ink); border-color: var(--faint); }
.copy.done { color: var(--ok); border-color: #bfe8d6; background: var(--ok-soft); }

/* ------------------------------------------------------------------ misc */

.pill {
  display: inline-block;
  font-size: 12px;
  font-family: var(--mono);
  background: #eef2f8;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 9px;
  color: var(--muted);
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 16px 0; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow-sm);
}
.card h3 { margin: 0 0 4px; font-size: 15px; }
.card p { margin: 0; font-size: 13.5px; color: var(--muted); }

footer.docs-foot {
  margin-top: 60px; padding-top: 18px; border-top: 1px solid var(--line);
  color: var(--faint); font-size: 13px;
}

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line);
    padding: 16px 20px;
  }
  main { padding: 24px 20px 90px; }
}
