/* Zopy docs & support — design system
   Palette mirrors the Regimen theme (navy / clinical blue). */

:root {
  --bg: #ffffff;
  --surface: #f7f9fb;
  --surface-2: #eef2f6;
  --text: #16202b;
  --muted: #5b6b7a;
  --primary: #1b4965;
  --primary-ink: #ffffff;
  --accent: #0a66c2;
  --border: #e6eaee;
  --code-bg: #f2f5f8;
  --note: #0a66c2;
  --warn: #b4690e;
  --ok: #1a7f52;
  --radius: 10px;
  --maxw: 1180px;
  --sidebar-w: 250px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10171f;
    --surface: #16202b;
    --surface-2: #1d2937;
    --text: #e8edf2;
    --muted: #9bacba;
    --primary: #4f9cc9;
    --primary-ink: #0b141c;
    --accent: #6bb3ec;
    --border: #263241;
    --code-bg: #1a2531;
    --note: #6bb3ec;
    --warn: #e0a458;
    --ok: #5fc79a;
  }
}

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

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .bar {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
  height: 62px; display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand img { height: 26px; width: auto; }
.brand .tag { font-weight: 500; color: var(--muted); font-size: 13px; border-left: 1px solid var(--border); padding-left: 10px; }
.header-links { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.header-links a { color: var(--muted); font-size: 14px; font-weight: 500; }
.header-links a:hover { color: var(--text); text-decoration: none; }
.btn {
  display: inline-block; background: var(--primary); color: var(--primary-ink);
  padding: 9px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; border: 0; cursor: pointer;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }

/* ---------- Layout ---------- */
.layout { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: var(--sidebar-w) 1fr; gap: 40px; padding: 0 20px; }
.sidebar { position: sticky; top: 62px; align-self: start; height: calc(100vh - 62px); overflow-y: auto; padding: 28px 0; }
.sidebar .group { margin-bottom: 22px; }
.sidebar .group h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sidebar a { display: block; padding: 6px 12px; color: var(--muted); font-size: 14.5px; border-radius: 7px; }
.sidebar a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.sidebar a.active { background: var(--surface-2); color: var(--text); font-weight: 600; }
.content { min-width: 0; padding: 34px 0 80px; }

/* ---------- Content typography ---------- */
.content h1 { font-size: 34px; line-height: 1.15; margin: 0 0 6px; letter-spacing: -.02em; }
.content h2 { font-size: 23px; margin: 42px 0 12px; padding-top: 10px; letter-spacing: -.01em; }
.content h3 { font-size: 17px; margin: 26px 0 8px; }
.content .lead { font-size: 18px; color: var(--muted); margin: 0 0 8px; }
.content p, .content li { font-size: 15.5px; }
.content ul, .content ol { padding-left: 22px; }
.content li { margin: 5px 0; }
.content code { font-family: var(--mono); font-size: .87em; background: var(--code-bg); padding: 2px 6px; border-radius: 5px; }
.content pre { background: var(--code-bg); padding: 16px; border-radius: var(--radius); overflow-x: auto; border: 1px solid var(--border); }
.content pre code { background: none; padding: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 34px 0; }

/* ---------- Components ---------- */
.callout { border: 1px solid var(--border); border-left: 3px solid var(--note); background: var(--surface); padding: 12px 16px; border-radius: var(--radius); margin: 18px 0; font-size: 14.5px; }
.callout.warn { border-left-color: var(--warn); }
.callout.ok { border-left-color: var(--ok); }
.callout strong { color: var(--text); }

table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14.5px; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
td code { white-space: nowrap; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin: 22px 0; }
.card { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; background: var(--surface); }
.card h3 { margin: 0 0 6px; font-size: 15.5px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }

details { border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 16px; margin: 10px 0; background: var(--surface); }
details summary { cursor: pointer; font-weight: 600; padding: 10px 0; font-size: 15.5px; }
details[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 8px; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }

.hero { padding: 30px 0 6px; }
.hero h1 { font-size: 42px; }
.hero .lead { font-size: 20px; max-width: 620px; }
.hero .actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

.pagenav { display: flex; justify-content: space-between; gap: 12px; margin-top: 50px; padding-top: 20px; border-top: 1px solid var(--border); }
.pagenav a { font-size: 14px; }

/* ---------- Form ---------- */
.form { max-width: 620px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit; font-size: 15px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field textarea { min-height: 150px; resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin-top: 14px; padding: 12px 16px; border-radius: 8px; font-size: 14.5px; display: none; }
.form-status.show { display: block; }
.form-status.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); border: 1px solid var(--ok); }
.form-status.err { background: color-mix(in srgb, var(--warn) 14%, transparent); border: 1px solid var(--warn); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; }
.site-footer .inner { max-width: var(--maxw); margin: 0 auto; padding: 28px 20px; display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; color: var(--muted); font-size: 13.5px; }
.site-footer a { color: var(--muted); }
.site-footer .spacer { margin-left: auto; }

/* ---------- Responsive ---------- */
.menu-toggle { display: none; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .sidebar {
    position: static; height: auto; overflow: visible; padding: 14px 0;
    border-bottom: 1px solid var(--border); display: none;
  }
  .sidebar.open { display: block; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 7px; background: none; border: 1px solid var(--border); color: var(--text); padding: 7px 12px; border-radius: 8px; font: inherit; font-size: 14px; cursor: pointer; }
  .header-links .hide-sm { display: none; }
  .hero h1 { font-size: 32px; }
  .content h1 { font-size: 28px; }
}
