/* Welisa DocGen documentation — design tokens follow the Welisa website (2026): primary #384494, navy #151a37,
   Poppins headings on an Inter body, 8px radius, soft shadows. Dark theme keeps the same hue family. */
:root {
  --w-primary: #384494;
  --w-primary-strong: #2c3677;
  --w-navy: #151a37;
  --w-mid: #234e9e;
  --w-tint: #f0f1f9;
  --w-tint-2: #ecf2fa;
  --w-line: #c8ccea;
  --w-line-soft: #e3e6f3;
  --w-muted: #5b6075;
  --w-accent: #e49007;
  --w-danger: #bb1313;
  --w-ok: #0f7a4a;
  --bg: #ffffff;
  --bg-elev: #ffffff;
  --bg-code: #f6f7fb;
  --fg: #151a37;
  --fg-muted: var(--w-muted);
  --link: #384494;
  --shadow: 0 5px 30px rgba(21, 26, 55, 0.08);
  --radius: 8px;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: Poppins, Inter, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --topbar-h: 64px;
  --sidebar-w: 280px;
  --rightbar-w: 240px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0f1226; --bg-elev: #161a36; --bg-code: #1b2040; --fg: #e8eaf5; --fg-muted: #a3a8c6; --link: #9aa6ff; --w-tint: #1b2040; --w-tint-2: #1f2448; --w-line: #2d3461; --w-line-soft: #272d55; --w-primary: #6f7cff; --w-primary-strong: #8a95ff; --w-navy: #e8eaf5; --shadow: 0 5px 30px rgba(0,0,0,.35); color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #0f1226; --bg-elev: #161a36; --bg-code: #1b2040; --fg: #e8eaf5; --fg-muted: #a3a8c6; --link: #9aa6ff; --w-tint: #1b2040; --w-tint-2: #1f2448; --w-line: #2d3461; --w-line-soft: #272d55; --w-primary: #6f7cff; --w-primary-strong: #8a95ff; --w-navy: #e8eaf5; --shadow: 0 5px 30px rgba(0,0,0,.35); color-scheme: dark; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 16px/1.6 var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--w-primary); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; height: var(--topbar-h); display: flex; align-items: center; gap: 16px; padding: 0 20px; background: var(--bg-elev); border-bottom: 1px solid var(--w-line-soft); box-shadow: 0 1px 0 rgba(21,26,55,.03); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--fg); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { height: 24px; width: auto; display: block; }
[data-theme="dark"] .brand img { filter: brightness(0) invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand img { filter: brightness(0) invert(1); } }
.brand-product { font: 600 15px/1 var(--font-head); padding-left: 12px; border-left: 1px solid var(--w-line); color: var(--fg-muted); letter-spacing: .01em; }
.search { position: relative; flex: 1; max-width: 520px; margin-left: auto; }
.search input { width: 100%; height: 38px; border: 1px solid var(--w-line); border-radius: var(--radius); padding: 0 14px 0 38px; font: 400 14px var(--font-body); background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b6075' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 12px center no-repeat; color: var(--fg); }
.search input:focus { outline: 2px solid var(--w-primary); outline-offset: 1px; }
.search-results { position: absolute; top: 44px; left: 0; right: 0; max-height: 70vh; overflow: auto; background: var(--bg-elev); border: 1px solid var(--w-line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 60; }
.search-results a { display: block; padding: 10px 12px; border-radius: 6px; color: var(--fg); }
.search-results a:hover, .search-results a.focus { background: var(--w-tint); text-decoration: none; }
.search-results .r-title { font: 600 14px var(--font-body); }
.search-results .r-title small { font-weight: 400; color: var(--fg-muted); margin-left: 6px; }
.search-results .r-snip { font-size: 13px; color: var(--fg-muted); margin-top: 2px; }
.search-results .r-snip mark { background: #fff2cc; color: inherit; padding: 0 1px; border-radius: 2px; }
.search-results .r-none { padding: 12px; color: var(--fg-muted); font-size: 14px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.version-badge { font: 600 12px/1 var(--font-body); background: var(--w-tint); color: var(--w-primary); border: 1px solid var(--w-line-soft); padding: 6px 10px; border-radius: 999px; }
.site-link { font: 600 14px var(--font-body); color: var(--fg); }
.theme-toggle { width: 34px; height: 34px; border: 1px solid var(--w-line); border-radius: 50%; background: var(--bg) center/18px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23384494' stroke-width='2'%3E%3Cpath d='M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z'/%3E%3C/svg%3E"); cursor: pointer; }
.menu-toggle { display: none; width: 40px; height: 40px; border: 0; background: transparent; cursor: pointer; flex-direction: column; justify-content: center; gap: 5px; padding: 8px; }
.menu-toggle span { display: block; height: 2px; background: var(--fg); border-radius: 2px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--rightbar-w); max-width: 1440px; margin: 0 auto; }
.sidebar { position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 24px 16px 40px 20px; border-right: 1px solid var(--w-line-soft); }
.nav-section { margin-bottom: 18px; }
.nav-section-title { font: 600 11px/1.2 var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: var(--fg-muted); padding: 0 10px 8px; }
.nav-section ul { list-style: none; margin: 0; padding: 0; }
.nav-section li a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--fg); font-size: 14px; line-height: 1.35; }
.nav-section li a:hover { background: var(--w-tint); text-decoration: none; }
.nav-section li a.active { background: var(--w-primary); color: #fff; font-weight: 600; }
.content { padding: 28px 48px 60px; min-width: 0; }
.breadcrumb { font: 600 12px/1 var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--w-primary); margin-bottom: 14px; }
.rightbar { position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 28px 20px 40px 8px; }
.toc-title { font: 600 11px/1.2 var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--w-line-soft); }
.toc li a { display: block; padding: 4px 0 4px 12px; font-size: 13px; color: var(--fg-muted); border-left: 2px solid transparent; margin-left: -2px; line-height: 1.4; }
.toc li.toc-3 a { padding-left: 24px; font-size: 12.5px; }
.toc li a:hover { color: var(--fg); text-decoration: none; }
.toc li a.active { color: var(--w-primary); border-left-color: var(--w-primary); font-weight: 600; }

/* ---------- prose ---------- */
.prose { max-width: 820px; }
.prose h1 { font: 700 34px/1.2 var(--font-head); color: var(--w-navy); margin: 0 0 14px; letter-spacing: -.01em; }
.prose h1 + p { font-size: 18px; color: var(--fg-muted); margin-top: 0; }
.prose h2 { font: 600 24px/1.3 var(--font-head); color: var(--w-navy); margin: 44px 0 12px; padding-top: 14px; border-top: 1px solid var(--w-line-soft); }
.prose h3 { font: 600 18px/1.35 var(--font-head); color: var(--w-navy); margin: 30px 0 8px; }
.prose h4 { font: 600 15px/1.4 var(--font-head); color: var(--w-navy); margin: 22px 0 6px; }
.prose h5 { font: 600 14px/1.4 var(--font-head); margin: 18px 0 6px; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose li { margin: 4px 0; }
.prose li > p { margin-bottom: 6px; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--w-line-soft); }
.prose hr { border: 0; border-top: 1px solid var(--w-line-soft); margin: 32px 0; }
.prose strong { font-weight: 600; }
.anchor { margin-left: 8px; color: var(--w-line); font-weight: 400; opacity: 0; text-decoration: none; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor { opacity: 1; }
.prose code { font: 400 0.88em var(--font-mono); background: var(--bg-code); border: 1px solid var(--w-line-soft); border-radius: 4px; padding: 1px 5px; color: var(--fg); overflow-wrap: anywhere; }
.code { position: relative; margin: 0 0 18px; }
.code pre { margin: 0; background: var(--bg-code); border: 1px solid var(--w-line-soft); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; font: 400 13px/1.55 var(--font-mono); }
.code pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.copy { position: absolute; top: 8px; right: 8px; font: 600 11px var(--font-body); color: var(--fg-muted); background: var(--bg-elev); border: 1px solid var(--w-line); border-radius: 5px; padding: 4px 8px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.code:hover .copy, .copy:focus { opacity: 1; }
.copy.done { color: var(--w-ok); border-color: var(--w-ok); }
.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--w-line-soft); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; background: var(--w-tint); font: 600 13px var(--font-body); color: var(--w-navy); padding: 10px 12px; border-bottom: 1px solid var(--w-line-soft); }
td { padding: 9px 12px; border-bottom: 1px solid var(--w-line-soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--w-tint) 45%, transparent); }
blockquote { margin: 0 0 18px; padding: 10px 18px; border-left: 4px solid var(--w-line); background: var(--w-tint); border-radius: 0 var(--radius) var(--radius) 0; color: var(--fg); }
blockquote p:last-child { margin-bottom: 0; }
.callout { margin: 0 0 20px; padding: 14px 18px 12px; border-radius: var(--radius); border: 1px solid var(--w-line-soft); border-left: 4px solid var(--w-primary); background: var(--w-tint); }
.callout p:last-child { margin-bottom: 0; }
.callout-title { font: 600 12px/1 var(--font-head); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px; color: var(--w-primary); }
.callout-tip { border-left-color: var(--w-ok); } .callout-tip .callout-title { color: var(--w-ok); }
.callout-warning, .callout-important { border-left-color: var(--w-accent); background: color-mix(in srgb, var(--w-accent) 8%, var(--bg)); }
.callout-warning .callout-title, .callout-important .callout-title { color: var(--w-accent); }
.callout-example { border-left-color: var(--w-mid); }
kbd { font: 500 12px var(--font-mono); background: var(--bg-code); border: 1px solid var(--w-line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; }

/* cards on the overview page */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 18px 0 26px; }
.card { display: block; padding: 16px 18px; border: 1px solid var(--w-line-soft); border-radius: var(--radius); background: var(--bg-elev); color: var(--fg); box-shadow: 0 1px 2px rgba(21,26,55,.04); transition: box-shadow .15s, transform .15s; }
.card:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-1px); border-color: var(--w-line); }
.card strong { display: block; font: 600 15px var(--font-head); color: var(--w-primary); margin-bottom: 4px; }
.card span { font-size: 13.5px; color: var(--fg-muted); }
.hero { background: linear-gradient(135deg, var(--w-navy) 0%, #2a3372 100%); color: #fff; border-radius: 12px; padding: 34px 36px; margin: 6px 0 28px; }
.hero h1 { color: #fff; margin-bottom: 8px; }
.prose .hero p, .hero p { color: #d7dbf3; font-size: 17px; margin: 0; max-width: 640px; }
.hero .actions { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-block; font: 600 15px var(--font-body); padding: 11px 20px; border-radius: var(--radius); background: #fff; color: var(--w-navy) !important; }
.btn:hover { text-decoration: none; background: var(--w-tint); }
.btn.ghost { background: transparent; border: 1px solid rgba(255,255,255,.45); color: #fff !important; }
.btn.ghost:hover { background: rgba(255,255,255,.1); }
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 18px; }
.badge { font: 600 12px var(--font-body); padding: 5px 10px; border-radius: 999px; background: var(--w-tint); color: var(--w-primary); border: 1px solid var(--w-line-soft); }

/* pager + footer */
.pager { display: flex; justify-content: space-between; gap: 16px; margin: 48px 0 24px; max-width: 820px; }
.pager a { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--w-line-soft); border-radius: var(--radius); color: var(--fg); }
.pager a:hover { text-decoration: none; border-color: var(--w-line); box-shadow: var(--shadow); }
.pager a span { font-size: 12px; color: var(--fg-muted); }
.pager-next { text-align: right; }
.page-footer { max-width: 820px; border-top: 1px solid var(--w-line-soft); padding-top: 16px; font-size: 12.5px; color: var(--fg-muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) { .shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); } .rightbar { display: none; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .menu-toggle { display: flex; }
  .sidebar { position: fixed; left: 0; top: var(--topbar-h); width: min(320px, 86vw); background: var(--bg-elev); transform: translateX(-105%); transition: transform .2s; z-index: 40; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .content { padding: 20px 16px 48px; }
  .brand-product { display: none; }
  .site-link { display: none; }
  .search { max-width: none; }
  .prose h1 { font-size: 27px; }
  .hero { padding: 24px 20px; }
}
@media print {
  .topbar, .sidebar, .rightbar, .pager, .copy, .anchor { display: none !important; }
  .shell { display: block; } .content { padding: 0; } .prose { max-width: none; }
  a { color: inherit; } .code pre { white-space: pre-wrap; }
}
