/* FluxDeploy docs site. Brand palette from fluxdeploy.app; light and dark follow the reader's
   system setting. No web fonts, no JavaScript. */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-elevated: #f8fafc;
  --bg-code: #f1f5f9;
  --text: #1e293b;
  --text-strong: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #0891b2;
  --link: #0e7490;
  --link-hover: #155e75;
  --accent-tint: #ecfeff;
  --target: #fef9c3;
  --header-h: 3.5rem;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f172a;
    --bg-elevated: #1e293b;
    --bg-code: #1a2438;
    --text: #e2e8f0;
    --text-strong: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --border-strong: #475569;
    --accent: #06b6d4;
    --link: #22d3ee;
    --link-hover: #67e8f9;
    --accent-tint: rgba(6, 182, 212, 0.1);
    --target: rgba(250, 204, 21, 0.18);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.skip-link { position: absolute; left: -9999px; top: 0.5rem; z-index: 20; padding: 0.4rem 0.8rem; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 6px; }
.skip-link:focus { left: 1rem; }

/* ---- header ---------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 90rem;
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.brand { display: flex; align-items: baseline; gap: 0.75rem; color: var(--text-strong); text-decoration: none; }
.brand:hover { color: var(--text-strong); }
.wordmark { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.015em; }
.wordmark span { color: var(--link); }
.brand-docs { padding-left: 0.75rem; border-left: 1px solid var(--border-strong); color: var(--text-muted); font-size: 0.95rem; font-weight: 500; }

.header-links { display: flex; align-items: center; gap: 1.5rem; margin-left: auto; font-size: 0.9rem; }
.header-links a { color: var(--text-muted); text-decoration: none; font-weight: 500; }
.header-links a:hover { color: var(--text-strong); }

.version-badge {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.6;
}

/* ---- page grid ------------------------------------------------------------------------- */

.page {
  display: grid;
  grid-template-columns: 16.5rem minmax(0, 1fr) 14rem;
  max-width: 90rem;
  margin: 0 auto;
}
.page.no-toc { grid-template-columns: 16.5rem minmax(0, 1fr); }

/* ---- sidebar --------------------------------------------------------------------------- */

.sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.75rem 1rem 2.5rem 1.5rem;
  border-right: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.45;
}

.nav-section {
  margin: 1.75rem 0 0.5rem;
  padding-left: 0.75rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav-section:first-child { margin-top: 0; }

.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: block;
  padding: 0.32rem 0.75rem;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  color: var(--text);
  text-decoration: none;
}
.nav-list a:hover { color: var(--text-strong); background: var(--bg-elevated); }
.nav-list a.active { border-left-color: var(--accent); background: var(--accent-tint); color: var(--link); font-weight: 600; }

.mobile-nav { display: none; }

/* ---- content --------------------------------------------------------------------------- */

.content { min-width: 0; padding: 2rem 3rem 4rem; }
/* Tables and code blocks may use the column's full width; running text keeps a ~72ch measure. */
.doc { max-width: 52rem; margin: 0 auto; }
.doc > p, .doc > ul, .doc > ol, .doc > dl, .doc > blockquote { max-width: 72ch; }

.crumbs { margin: 0 0 1.25rem; color: var(--text-muted); font-size: 0.85rem; }
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--link); text-decoration: underline; }
.crumbs .sep { margin: 0 0.4rem; color: var(--border-strong); }
.crumbs [aria-current] { color: var(--text); }

.doc h1, .doc h2, .doc h3, .doc h4 { color: var(--text-strong); line-height: 1.3; letter-spacing: -0.01em; scroll-margin-top: calc(var(--header-h) + 1rem); }
.doc h1 { margin: 0 0 1rem; font-size: 2.1rem; font-weight: 700; letter-spacing: -0.02em; }
.doc h2 { margin: 2.5rem 0 0.75rem; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: 1.45rem; font-weight: 650; }
.doc h3 { margin: 2rem 0 0.5rem; font-size: 1.15rem; font-weight: 600; }
.doc h4 { margin: 1.5rem 0 0.5rem; font-size: 1rem; font-weight: 600; }
.doc h1 + p { color: var(--text); font-size: 1.08rem; }

.doc p, .doc ul, .doc ol, .doc dl { margin: 0 0 1.1rem; }
.doc ul, .doc ol { padding-left: 1.5rem; }
.doc li { margin: 0.3rem 0; }
.doc li > ul, .doc li > ol { margin: 0.3rem 0 0; }
.doc strong { color: var(--text-strong); font-weight: 600; }
.doc hr { margin: 2.5rem 0; border: 0; border-top: 1px solid var(--border); }

.anchor {
  margin-left: 0.4rem;
  color: var(--text-muted);
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
}
.anchor:hover { color: var(--link); }
:is(h2, h3, h4):hover > .anchor, .anchor:focus-visible { opacity: 1; }

.doc code {
  padding: 0.12em 0.38em;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-code);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}
.doc a code { color: inherit; }

.doc pre {
  margin: 0 0 1.25rem;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  line-height: 1.55;
}
.doc pre code { padding: 0; border: 0; background: none; font-size: 0.85rem; overflow-wrap: normal; white-space: pre; }

/* A table scrolls on its own when it is wider than the column; no wrapper element, so the article
   HTML stays exactly what the in-app Help renders. */
.doc table {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 0 0 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}
.doc th, .doc td { padding: 0.6rem 0.9rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.doc th { background: var(--bg-elevated); color: var(--text-strong); font-weight: 600; white-space: nowrap; }
.doc tr:last-child td { border-bottom: 0; }
.doc td code { overflow-wrap: normal; white-space: nowrap; }

.doc blockquote {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  background: var(--accent-tint);
  color: var(--text);
}
.doc blockquote > :last-child { margin-bottom: 0; }

.doc img { display: block; max-width: 100%; height: auto; margin: 1.25rem 0; border: 1px solid var(--border); border-radius: 8px; }

.doc kbd {
  padding: 0.1em 0.4em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: 0.82em;
}

.doc :target { scroll-margin-top: calc(var(--header-h) + 1rem); }
.doc code:target { background: var(--target); border-color: var(--accent); }

.help-screenshot { margin: 1.25rem 0; padding: 2rem; border: 1px dashed var(--border-strong); border-radius: 8px; color: var(--text-muted); text-align: center; font-size: 0.9rem; }
.help-screenshot i { display: none; }

/* ---- index ----------------------------------------------------------------------------- */

.lead { max-width: 60ch; color: var(--text-muted); font-size: 1.1rem; }

.doc .categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; max-width: none; margin-top: 2rem; }
.page.no-toc .doc { max-width: 64rem; }
.category { padding: 1.25rem 1.4rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.doc .category h2 { margin: 0 0 0.6rem; padding: 0; border: 0; font-size: 1rem; }
.category ul { margin: 0; padding: 0; list-style: none; font-size: 0.92rem; }
.category li { margin: 0.25rem 0; }
.category a { text-decoration: none; }
.category a:hover { text-decoration: underline; }

/* ---- prev / next ----------------------------------------------------------------------- */

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.pager a {
  display: block;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-strong);
  font-weight: 600;
  text-decoration: none;
}
.pager a:hover { border-color: var(--accent); color: var(--link); }
.pager a::before { display: block; margin-bottom: 0.15rem; color: var(--text-muted); font-size: 0.78rem; font-weight: 500; }
.pager .prev::before { content: "Previous"; }
.pager .next { grid-column: 2; text-align: right; }
.pager .next::before { content: "Next"; }

/* ---- on this page ---------------------------------------------------------------------- */

.on-this-page {
  position: sticky;
  top: var(--header-h);
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 2rem 1.5rem 2.5rem 0.5rem;
  font-size: 0.84rem;
  line-height: 1.45;
}
.otp-title { margin: 0 0 0.6rem; color: var(--text-strong); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.on-this-page ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.on-this-page a { display: block; padding: 0.25rem 0 0.25rem 0.85rem; margin-left: -1px; border-left: 1px solid transparent; color: var(--text-muted); text-decoration: none; }
.on-this-page a:hover { border-left-color: var(--text-muted); color: var(--text-strong); }
.on-this-page .h3 a { padding-left: 1.7rem; }

/* ---- footer ---------------------------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.85rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; max-width: 90rem; margin: 0 auto; padding: 1.75rem 1.5rem; }
.footer-brand { color: var(--text-strong); font-weight: 600; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-left: auto; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--link); text-decoration: underline; }

/* ---- narrower screens ------------------------------------------------------------------ */

@media (max-width: 1199.98px) {
  .page { grid-template-columns: 16.5rem minmax(0, 1fr); }
  .on-this-page { display: none; }
}

@media (max-width: 899.98px) {
  .page, .page.no-toc { display: block; }
  .sidebar { display: none; }
  .header-links .optional { display: none; }

  .mobile-nav { display: block; border-bottom: 1px solid var(--border); background: var(--bg-elevated); font-size: 0.92rem; }
  .mobile-nav > summary { padding: 0.7rem 1.25rem; cursor: pointer; color: var(--text-strong); font-weight: 600; }
  .mobile-nav-body { max-height: 70vh; overflow-y: auto; padding: 0.25rem 1.25rem 1.25rem; border-top: 1px solid var(--border); background: var(--bg); line-height: 1.45; }
  .mobile-nav .nav-section:first-child { margin-top: 1rem; }

  .content { padding: 1.5rem 1.25rem 3rem; }
  .doc h1 { font-size: 1.75rem; }
  .doc h2 { font-size: 1.3rem; }
}

@media (max-width: 559.98px) {
  .header-inner { gap: 1rem; padding: 0 1rem; }
  .header-links { gap: 1rem; }
  .brand-docs { display: none; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .footer-links { margin-left: 0; }
}

@media print {
  .site-header, .sidebar, .mobile-nav, .on-this-page, .pager, .site-footer, .anchor { display: none !important; }
  .page { display: block; }
  .content { padding: 0; }
}
