/* intouchvas developer docs — shared design system
   Palette: intouchvas green (brand), warm paper neutrals, a true
   monospace for code. Layout: fixed left sidebar (product switcher +
   section TOC), single flowing content column, inline tabbed code
   samples instead of Slate's old fixed dark right-rail. */

:root {
  --green-900: #0f3320;
  --green-800: #154527;
  --green-700: #1a5c33;
  --green-600: #1f7a3f;
  --green-500: #279950;
  --green-tint: #e7f5ec;
  --green-tint-strong: #d1ead9;

  --ink: #16211b;
  --ink-soft: #4a564e;
  --ink-faint: #7c8882;
  --line: #e2e6e1;
  --paper: #f6f8f5;
  --surface: #ffffff;

  --critical: #b3261e;
  --critical-tint: #fbeceb;
  --warn: #8a5a00;
  --warn-tint: #fdf2de;
  --good: #1a7a3f;
  --good-tint: #e7f5ec;

  --code-bg: #1c2420;
  --code-bg-raised: #242f29;
  --code-ink: #e6ede8;
  --code-line: #35433b;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  --topbar-h: 60px;
  --sidebar-w: 272px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---------- Top bar ---------- */
.docs-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--green-900);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  z-index: 40;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.docs-topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.docs-topbar .brand img { height: 26px; display: block; }
.docs-topbar .brand-divider {
  width: 1px; height: 22px;
  background: rgba(255,255,255,0.18);
}
.docs-topbar .brand-sub {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.product-switcher {
  display: flex;
  gap: 4px;
  flex: 1;
}
.product-switcher a {
  color: rgba(255,255,255,0.68);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 7px;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.product-switcher a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.product-switcher a.active {
  background: var(--green-600);
  color: #fff;
}

.docs-topbar .nav-toggle {
  display: none;
  flex: none;
  width: 34px; height: 34px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: #fff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ---------- Shell / sidebar ---------- */
.docs-shell {
  display: flex;
  padding-top: var(--topbar-h);
  min-height: 100vh;
}

.docs-sidebar {
  position: fixed;
  top: var(--topbar-h);
  bottom: 0;
  left: 0;
  width: var(--sidebar-w);
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px 14px 60px;
}
.docs-sidebar .sidebar-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 10px 10px;
}

ul#toc, .toc-list-h2 {
  list-style: none;
  margin: 0;
  padding: 0;
}
ul#toc > li { margin: 0; }
.toc-link {
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.3;
}
.toc-link.toc-h1 { font-weight: 600; color: var(--ink); margin-top: 4px; }
.toc-list-h2 { padding-left: 14px; border-left: 1px solid var(--line); margin: 2px 0 6px 20px; }
.toc-list-h2 .toc-link { font-weight: 400; font-size: 0.82rem; padding: 5px 10px; }
.toc-link:hover { background: var(--paper); text-decoration: none; color: var(--ink); }
.toc-link.active { background: var(--green-tint); color: var(--green-800); font-weight: 600; }

/* ---------- Content ---------- */
.docs-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
}
.docs-content {
  width: 100%;
  max-width: 760px;
  padding: 44px 32px 120px;
}

.docs-content h1, .docs-content h2, .docs-content h3, .docs-content h4 {
  font-family: var(--font-sans);
  color: var(--ink);
  line-height: 1.25;
  scroll-margin-top: calc(var(--topbar-h) + 18px);
}
.docs-content h1[id] {
  font-size: 1.68rem;
  font-weight: 800;
  margin: 56px 0 14px;
  padding-top: 8px;
}
.docs-content h1[id]:first-child,
.docs-content > h1[id]:first-of-type { margin-top: 4px; }
.docs-content h2[id] {
  font-size: 1.28rem;
  font-weight: 700;
  margin: 42px 0 12px;
  color: var(--green-800);
}
.docs-content h3 { font-size: 1.08rem; font-weight: 700; margin: 28px 0 10px; }
.docs-content h4 { font-size: 0.92rem; font-weight: 700; margin: 22px 0 8px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.03em; }

.docs-content p { font-size: 0.95rem; line-height: 1.65; color: var(--ink-soft); margin: 0 0 16px; }
.docs-content p code, .docs-content li code, .docs-content td code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: var(--green-tint);
  color: var(--green-800);
  padding: 2px 6px;
  border-radius: 5px;
}
.docs-content ul, .docs-content ol { font-size: 0.95rem; line-height: 1.65; color: var(--ink-soft); margin: 0 0 16px; padding-left: 22px; }
.docs-content li { margin-bottom: 5px; }
.docs-content blockquote {
  margin: 0 0 16px;
  padding: 10px 16px;
  border-left: 3px solid var(--green-500);
  background: var(--green-tint);
  border-radius: 0 8px 8px 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.docs-content blockquote p { margin: 0; color: inherit; }

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 0.86rem;
}
.docs-content table th {
  text-align: left;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
.docs-content table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  vertical-align: top;
}
.docs-content table tr:last-child td { border-bottom: none; }

.req, .opt {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
}
.req { background: var(--critical-tint); color: var(--critical); }
.opt { background: var(--line); color: var(--ink-faint); }

/* aside callouts */
aside {
  display: block;
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.55;
}
aside.warning { background: var(--warn-tint); color: #5c3d00; border: 1px solid #f0dca8; }
aside.success { background: var(--good-tint); color: var(--green-800); border: 1px solid var(--green-tint-strong); }
aside.notice { background: var(--paper); color: var(--ink-soft); border: 1px solid var(--line); }
aside code { background: rgba(0,0,0,0.06); }

hr.api-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 40px 0;
}

/* endpoint line */
.endpoint-line {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  background: var(--green-900);
  padding: 11px 14px;
  border-radius: 9px;
  margin: 0 0 18px;
}
.endpoint-line code {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: #fff;
  background: none !important;
  padding: 0 !important;
}
.method-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 5px;
  color: #fff;
  flex: none;
}
.badge-get { background: #2563eb; }
.badge-post { background: #15803d; }
.badge-delete { background: #b3261e; }
.badge-put, .badge-patch { background: #a15c00; }

.workflow-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 0 0 18px;
}
.workflow-box strong {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--green-700);
  margin-bottom: 8px;
}
.workflow-box ol { margin: 0; padding-left: 20px; }

/* ---------- code tabs ---------- */
.code-tabs {
  background: var(--code-bg);
  border-radius: 12px;
  margin: 0 0 20px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
.code-tabs-bar {
  display: flex;
  align-items: center;
  background: var(--code-bg-raised);
  border-bottom: 1px solid var(--code-line);
  padding: 0 6px;
  overflow-x: auto;
}
.code-tab {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(230,237,232,0.55);
  background: none;
  border: none;
  padding: 10px 13px;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.code-tab:hover { color: var(--code-ink); }
.code-tab.active { color: #fff; border-bottom-color: var(--green-500); }
.code-copy-btn {
  margin-left: auto;
  flex: none;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  color: rgba(230,237,232,0.6);
  background: none;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
}
.code-copy-btn:hover { color: #fff; }
.code-copy-btn.copied { color: var(--green-500); }

.code-panel {
  display: none;
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
}
.code-panel.active { display: block; }
.code-panel code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--code-ink);
  background: none !important;
  padding: 0 !important;
}

/* Pygments syntax colors (dark theme, adapted from the original
   Slate/Rouge "monokai"-leaning palette) */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cp, .highlight .cs { color: #7f9188; }
.highlight .err { color: #ff8080; }
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt { color: #7ec4e8; }
.highlight .o, .highlight .ow { color: #ff79b8; }
.highlight .p { color: var(--code-ink); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sa, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .ss, .highlight .dl { color: #e8d478; }
.highlight .na, .highlight .nc, .highlight .nd, .highlight .ne, .highlight .nf, .highlight .fm { color: #a8e26a; }
.highlight .nb, .highlight .no { color: #f6aa11; }
.highlight .nt { color: #ff79b8; }
.highlight .nv, .highlight .vm, .highlight .vc, .highlight .vg, .highlight .vi, .highlight .bp { color: var(--code-ink); }
.highlight .m, .highlight .mb, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .mo, .highlight .il { color: #c79bff; }
.highlight .w { color: var(--code-ink); }
.highlight .n, .highlight .nx, .highlight .py { color: var(--code-ink); }

/* ---------- landing page (index) ---------- */
.landing {
  max-width: 920px;
  margin: 0 auto;
  padding: 90px 24px 100px;
  text-align: center;
}
.landing .kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-700);
  margin-bottom: 14px;
}
.landing h1 {
  font-size: 2.3rem;
  font-weight: 800;
  margin: 0 0 14px;
  line-height: 1.15;
}
.landing .lead {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 0 auto 50px;
  line-height: 1.6;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  text-align: left;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 24px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.14s, transform 0.14s, box-shadow 0.14s;
}
.product-card:hover {
  text-decoration: none;
  border-color: var(--green-500);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15,51,32,0.1);
}
.product-card .picon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--green-tint);
  color: var(--green-700);
  font-size: 1.3rem;
  margin-bottom: 4px;
}
.product-card h3 { margin: 0; font-size: 1.08rem; }
.product-card p { margin: 0; font-size: 0.86rem; color: var(--ink-faint); line-height: 1.5; }
.product-card .go { margin-top: auto; font-size: 0.8rem; font-weight: 700; color: var(--green-700); }

/* ---------- mobile ---------- */
@media (max-width: 880px) {
  .docs-topbar .nav-toggle { display: flex; }
  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    z-index: 35;
    box-shadow: 10px 0 30px rgba(0,0,0,0.15);
  }
  .docs-sidebar.is-open { transform: translateX(0); }
  .docs-main { margin-left: 0; }
  .docs-content { padding: 32px 18px 100px; }
  .product-switcher { display: none; }
  .product-grid { grid-template-columns: 1fr; }
  .landing { padding: 60px 20px 80px; }
  .landing h1 { font-size: 1.8rem; }
}
