/* Trinance Docs. The docs.devpire.com layout (header with search, sidebar,
   article, "On this page", pager), in the Trinance app's colours. Dark only.
   System fonts: SF Pro on Apple devices, Segoe UI on Windows. */
:root {
  --bg: #0B0D12;
  --surface: #12151D;
  --surface-2: #171B25;
  --border: rgba(148, 163, 199, 0.10);
  --border-2: rgba(148, 163, 199, 0.18);
  --accent: #89CFF0;
  --accent-ink: #07131C;
  --accent-soft: #C9E9FB;
  --deep: #3987E5;
  --text: #E9EDF5;
  --text-2: #B3BBCB;
  --text-muted: #8892A8;
  --good: #4ADE9C;
  --warn: #E6B167;
  --bad: #F0716E;
  --radius: 14px;
  --radius-sm: 8px;
  --header-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  color-scheme: dark;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  background-image: radial-gradient(56rem 30rem at 85% -10%, rgba(137, 207, 240, 0.08), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.dc-skip { position: absolute; left: 12px; top: -60px; z-index: 400; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 600; text-decoration: none; }
.dc-skip:focus { top: 10px; }

/* ── Header ── */
.dc-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  background: rgba(11, 13, 18, 0.86);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
}
.dc-header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dc-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  cursor: pointer;
  flex: none;
}
.dc-menu-btn svg { width: 18px; height: 18px; }
.dc-logo { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); flex: none; }
.dc-logo-mark { width: 26px; height: 26px; display: block; }
.dc-logo-text { font-weight: 650; font-size: 1.05rem; letter-spacing: 0.005em; }
.dc-logo-badge {
  font-size: 0.68rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  border: 1px solid rgba(137, 207, 240, 0.32);
  background: rgba(137, 207, 240, 0.08);
  border-radius: 999px;
  padding: 2px 9px;
}
.dc-header-right { margin-left: auto; flex: none; }
.dc-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  padding: 7px 16px;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.dc-back-btn:hover { color: var(--text); border-color: rgba(137, 207, 240, 0.45); }
.dc-back-btn svg { width: 14px; height: 14px; }

/* ── Search ── */
.dc-search-wrap {
  position: relative;
  flex: 1;
  max-width: 480px;
  min-width: 0;
  display: flex;
  align-items: center;
  margin-left: 40px;
}
.dc-search-icon {
  position: absolute;
  left: 12px;
  width: 15px; height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}
#dc-search {
  width: 100%;
  padding: 9px 40px 9px 36px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#dc-search::placeholder { color: var(--text-muted); }
#dc-search:focus { border-color: rgba(137, 207, 240, 0.55); box-shadow: 0 0 0 3px rgba(137, 207, 240, 0.12); }
#dc-search::-webkit-search-cancel-button { display: none; }
.dc-search-kbd {
  position: absolute;
  right: 10px;
  font-family: inherit;
  font-size: 0.7rem;
  color: var(--text-muted);
  border: 1px solid var(--border-2);
  border-radius: 5px;
  padding: 1px 7px;
  pointer-events: none;
}
.dc-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  max-height: min(440px, 70vh);
  overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  z-index: 300;
}
.dc-sr-item {
  display: block;
  padding: 11px 16px;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.dc-sr-item:last-child { border-bottom: none; }
.dc-sr-item:hover, .dc-sr-item.active { background: rgba(137, 207, 240, 0.07); }
.dc-sr-title { font-size: 0.86rem; font-weight: 600; color: var(--text); }
.dc-sr-title mark, .dc-sr-snippet mark { background: none; color: var(--accent); font-weight: 700; }
.dc-sr-group { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 2px; }
.dc-sr-snippet { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dc-sr-empty { padding: 18px 16px; font-size: 0.85rem; color: var(--text-muted); }

/* ── Layout ── */
.dc-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 230px;
  max-width: 1440px;
  margin: 0 auto;
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ── Sidebar ── */
.dc-sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 28px 12px 40px 20px;
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 199, 0.18) transparent;
}
.dc-sidebar::-webkit-scrollbar { width: 8px; }
.dc-sidebar::-webkit-scrollbar-thumb { background: rgba(148, 163, 199, 0.15); border-radius: 4px; }
.dc-nav-group { margin-bottom: 24px; }
.dc-nav-group-title {
  font-size: 0.7rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 6px;
}
.dc-nav a {
  display: block;
  padding: 5px 12px;
  font-size: 0.875rem;
  color: var(--text-2);
  text-decoration: none;
  border-radius: 7px;
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s;
}
.dc-nav a:hover { color: var(--text); background: rgba(148, 163, 199, 0.06); }
.dc-nav a.active {
  color: var(--text);
  background: rgba(137, 207, 240, 0.08);
  border-left-color: var(--accent);
  border-radius: 0 7px 7px 0;
  font-weight: 600;
}
.dc-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 140;
}

/* ── Main content ── */
.dc-main { padding: 36px 48px 48px; min-width: 0; }
.dc-breadcrumb { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 18px; }
.dc-breadcrumb a { color: inherit; text-decoration: none; }
.dc-breadcrumb a:hover { color: var(--text); }
.dc-breadcrumb span { margin: 0 6px; opacity: 0.5; }
.dc-article { max-width: 780px; }
.dc-article h1 { font-size: 2.1rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 10px; }
.dc-article .dc-lead { font-size: 1.05rem; color: var(--text-2); margin-bottom: 28px; }
.dc-article h2 {
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.dc-article h3 { font-size: 1.02rem; font-weight: 650; margin: 26px 0 8px; }
.dc-article p { margin-bottom: 14px; color: var(--text-2); font-size: 0.95rem; }
.dc-article ul, .dc-article ol { margin: 0 0 16px 22px; color: var(--text-2); font-size: 0.95rem; }
.dc-article li { margin-bottom: 7px; padding-left: 2px; }
.dc-article li::marker { color: var(--text-muted); }
.dc-article strong { color: var(--text); font-weight: 600; }
.dc-article a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(137, 207, 240, 0.35); text-underline-offset: 3px; }
.dc-article a:hover { text-decoration-color: var(--accent); }
.dc-article code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.84em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1.5px 6px;
  color: var(--text);
}
/* A path through the app, e.g. More → Settings. */
.dc-ui { color: var(--text); font-weight: 600; white-space: normal; }
.dc-article table { width: 100%; border-collapse: collapse; margin: 8px 0 20px; font-size: 0.88rem; }
.dc-article th, .dc-article td { text-align: left; padding: 9px 14px; border: 1px solid var(--border); vertical-align: top; }
.dc-article th { background: var(--surface); font-weight: 600; font-size: 0.8rem; color: var(--text); }
.dc-article td { color: var(--text-2); }
.dc-table-scroll { overflow-x: auto; margin: 8px 0 20px; }
.dc-table-scroll table { margin: 0; min-width: 480px; }
.dc-steps { counter-reset: step; list-style: none; margin-left: 0 !important; }
.dc-steps > li { counter-increment: step; position: relative; padding-left: 38px; margin-bottom: 12px; }
.dc-steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.78rem; font-weight: 700;
  color: var(--accent); background: rgba(137, 207, 240, 0.10); border: 1px solid rgba(137, 207, 240, 0.28);
}
.dc-callout {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 18px 0;
  font-size: 0.9rem;
}
.dc-callout.warn { border-left-color: var(--warn); }
.dc-callout.good { border-left-color: var(--good); }
.dc-callout p { margin: 0; font-size: 0.9rem; }
.dc-callout p + p { margin-top: 8px; }
.dc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 20px 0; }
.dc-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-decoration: none !important;
  transition: border-color 0.2s, transform 0.15s;
}
.dc-card:hover { border-color: rgba(137, 207, 240, 0.4); transform: translateY(-2px); }
.dc-card h3 { margin: 0 0 5px; font-size: 0.95rem; color: var(--text); }
.dc-card p { margin: 0; font-size: 0.84rem; color: var(--text-muted); }

/* ── Pager ── */
.dc-pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 48px; max-width: 780px; }
.dc-pager a {
  flex: 1;
  max-width: 48%;
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  text-decoration: none;
  transition: border-color 0.2s;
}
.dc-pager a:hover { border-color: rgba(137, 207, 240, 0.4); }
.dc-pager a.next { margin-left: auto; text-align: right; }
.dc-pager .dc-pager-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.dc-pager .dc-pager-title { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-top: 3px; }

/* ── Footer ── */
.dc-footer {
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 780px;
}
.dc-footer-links a { color: var(--text-muted); text-decoration: none; margin-left: 14px; }
.dc-footer-links a:first-child { margin-left: 0; }
.dc-footer-links a:hover { color: var(--text); }

/* ── TOC ── */
.dc-toc {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 36px 20px 40px 8px;
  font-size: 0.8rem;
}
.dc-toc-title { font-size: 0.7rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 10px; }
.dc-toc a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 0 4px 12px;
  border-left: 2px solid var(--border);
  transition: color 0.15s, border-color 0.15s;
}
.dc-toc a:hover { color: var(--text); }
.dc-toc a.active { color: var(--text); border-left-color: var(--accent); font-weight: 600; }

/* ── Responsive ── */
@media (max-width: 1200px) {
  .dc-shell { grid-template-columns: 250px minmax(0, 1fr); }
  .dc-toc { display: none; }
}
@media (max-width: 860px) {
  .dc-shell { grid-template-columns: minmax(0, 1fr); }
  .dc-header { gap: 12px; padding: 0 14px; }
  .dc-menu-btn { display: inline-flex; }
  .dc-search-wrap { margin-left: 0; }
  .dc-sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    width: min(300px, 86vw);
    background: var(--bg);
    z-index: 150;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
    height: auto;
  }
  .dc-sidebar.open { transform: translateX(0); visibility: visible; transition: transform 0.25s ease; }
  .dc-sidebar.open ~ .dc-sidebar-backdrop { display: block; }
  .dc-main { padding: 28px 20px 40px; }
  .dc-back-btn span { display: none; }
  .dc-back-btn { padding: 7px 11px; }
  .dc-search-kbd { display: none; }
  .dc-logo-text { display: none; }
}
/* Smaller type on phones; sizes are rem based, so everything scales together. */
@media (max-width: 768px) { html { font-size: 15px; } }
@media (max-width: 480px) {
  html { font-size: 14.5px; }
  .dc-main { padding: 24px 16px 36px; }
  .dc-logo-badge { display: none; }
  .dc-pager { flex-direction: column; }
  .dc-pager a { max-width: none; }
  .dc-pager a.next { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dc-sidebar, .dc-card { transition: none; }
}
