/* LatexDo documentation (/docs/). Only the documentation layout; the site header,
   footer and base styles come from /style.css. Every rule is scoped to .docs. */

.docs {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --ink: #050505;
  --muted: #5f5f5f;
  --line: #d8d8d8;
  --line-strong: #8a8a8a;
  --accent: #050505;
  --accent-strong: #000000;
  --state-muted-bg: #f4f4f4;
  --state-strong-bg: #e9e9e9;
  --code-bg: #0a0a0a;
  --code-ink: #f6f6f6;
  --header-bg: rgb(246 247 249 / 82%);
  --header-border: rgb(215 221 231 / 76%);
  --header-ink: #111318;
  --header-muted: #667085;
  --header-surface: #ffffff;
  --inline-code-bg: #f4f4f4;
  --inline-code-border: #d7d7d7;
  --inline-code-ink: #111111;
  --table-head: #efefef;
  --copy-border: #6b6b6b;
  --copy-ink: #f6f6f6;
  --lead: #383838;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.08);
  --nav-max: 1180px;
  --max: 1180px;
  --radius: 8px;
  --header-hover-border: rgb(17 19 24 / 10%);
  --header-hover-shadow: 0 8px 20px rgb(17 19 24 / 8%);
  --header-focus-ring: rgb(15 111 255 / 42%);

}

.docs input,
.docs a {
  font: inherit;
}

.docs a {
  color: var(--accent-strong);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.docs code,
.docs pre,
.docs kbd {
  font-family:
    "SFMono-Regular", "Cascadia Code", "Fira Code", Menlo, Monaco, Consolas,
    monospace;
}

.docs code,
.docs kbd {
  background: var(--inline-code-bg);
  border: 1px solid var(--inline-code-border);
  border-radius: 5px;
  color: var(--inline-code-ink);
  padding: 0.1rem 0.28rem;
}

.docs pre {
  margin: 0;
  overflow-x: auto;
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: 8px;
  padding: 1rem;
}

.docs pre code {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
}

.docs .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.docs .nav-search {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: inherit;
  padding: 8px 10px;
  text-decoration: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    width 180ms ease;
}

.docs .nav-search:hover,
.docs .nav-search:focus-within {
  border-color: var(--header-hover-border);
  background: var(--header-surface);
  box-shadow: var(--header-hover-shadow);
  color: var(--header-ink);
  transform: translateY(-1px);
}

.docs .nav-search:focus-within {
  outline: 2px solid var(--header-focus-ring);
  outline-offset: 2px;
}

.docs .nav-search {
  width: 38px;
  max-width: 220px;
  justify-content: center;
  gap: 0;
  overflow: hidden;
  cursor: text;
}

.docs .nav-search:hover,
.docs .nav-search:focus-within,
.docs .nav-search.has-value {
  width: 220px;
  justify-content: flex-start;
  gap: 7px;
}

.docs .nav-search input {
  width: 0;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--header-ink);
  opacity: 0;
  outline: 0;
  padding: 0;
  transition:
    opacity 140ms ease,
    width 180ms ease;
}

.docs .nav-search:hover input,
.docs .nav-search:focus-within input,
.docs .nav-search.has-value input {
  width: 158px;
  opacity: 1;
}

.docs .nav-search input::placeholder {
  color: var(--header-muted);
}

.docs .nav-search input:focus-visible {
  outline: 0;
}

.docs .layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  align-items: start;
  max-width: 1440px;
  margin: 0 auto;
}

.docs .sidebar {
  position: sticky;
  top: 66px;
  height: calc(100vh - 66px);
  overflow-y: auto;
  border-right: 1px solid var(--line);
  padding: 1.5rem 1rem 2rem 1.25rem;
}

.docs .sidebar h2 {
  margin: 0 0 0.6rem;
  color: var(--header-muted);
  font-size: 0.76rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.docs .toc {
  display: grid;
  gap: 0.15rem;
}

.docs .toc-link {
  display: block;
  border-radius: 7px;
  color: var(--muted);
  padding: 0.42rem 0.55rem;
  text-decoration: none;
}

.docs .toc-link:hover,
.docs .toc-link.active {
  background: var(--state-muted-bg);
  color: var(--accent-strong);
}

.docs .main {
  min-width: 0;
  padding: 2rem 1.5rem 5rem;
}

.docs .docs-hero {
  border-bottom: 1px solid var(--line);
  padding: 2rem 0 2.4rem;
}

.docs .docs-eyebrow {
  margin: 0 0 0.8rem;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.docs h1 {
  max-width: 820px;
  margin: 0;
  font-size: 3.25rem;
  line-height: 1.04;
  letter-spacing: 0;
}

.docs .lead {
  max-width: 840px;
  margin: 1.2rem 0 0;
  color: var(--lead);
  font-size: 1.13rem;
}

.docs .docs-hero-actions,
.docs .button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.docs .docs-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 700;
  padding: 0.55rem 0.85rem;
  text-decoration: none;
}

.docs .docs-button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}

.docs .section {
  border-bottom: 1px solid var(--line);
  padding: 2.4rem 0;
  scroll-margin-top: 140px;
}

.docs .section.is-filtered {
  display: none;
}

.docs .section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.75rem;
  line-height: 1.22;
  letter-spacing: 0;
}

.docs .section h3 {
  margin: 1.5rem 0 0.55rem;
  font-size: 1.12rem;
  line-height: 1.3;
  letter-spacing: 0;
}

.docs .section p,
.docs .section ul,
.docs .section ol,
.docs .section dl {
  max-width: 920px;
}

.docs .section p {
  margin: 0.65rem 0;
}

.docs .grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.docs .grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.docs .card,
.docs .callout,
.docs .table-wrap,
.docs .code-wrap,
.docs .diagram,
.docs .repo-map {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.docs .card {
  padding: 1rem;
}

.docs .card h3 {
  margin-top: 0;
}

.docs .card p:last-child,
.docs .callout p:last-child {
  margin-bottom: 0;
}

.docs .tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.docs .tag {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--state-muted-bg);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.22rem 0.5rem;
}

.docs .tag.amber {
  background: var(--state-strong-bg);
  color: var(--ink);
}

.docs .tag.green {
  background: var(--surface-strong);
  color: var(--ink);
}

.docs .callout {
  border-left: 4px solid var(--accent);
  margin: 1rem 0;
  padding: 0.85rem 1rem;
}

.docs .callout.warning {
  border-left-color: var(--line-strong);
}

.docs .callout.danger {
  border-left-color: var(--ink);
}

.docs .repo-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 1.4rem 0;
  overflow: hidden;
}

.docs .repo-node {
  border-right: 1px solid var(--line);
  padding: 1rem;
}

.docs .repo-node:last-child {
  border-right: 0;
}

.docs .repo-node strong {
  display: block;
  margin-bottom: 0.35rem;
}

.docs .diagram {
  margin: 1.25rem 0;
  padding: 1rem;
}

.docs .flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: stretch;
}

.docs .flow-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 0.85rem;
  min-height: 112px;
}

.docs .flow-step strong {
  display: block;
  color: var(--accent-strong);
}

.docs .table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

.docs table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.docs th,
.docs td {
  border-bottom: 1px solid var(--line);
  padding: 0.72rem 0.85rem;
  text-align: left;
  vertical-align: top;
}

.docs th {
  background: var(--table-head);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.docs tr:last-child td {
  border-bottom: 0;
}

.docs .code-wrap {
  margin: 1rem 0;
  overflow: hidden;
}

.docs .code-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--line-strong);
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 0.55rem 0.75rem;
  font-size: 0.86rem;
}

.docs .copy {
  border: 1px solid var(--copy-border);
  border-radius: 6px;
  background: transparent;
  color: var(--copy-ink);
  cursor: pointer;
  font: inherit;
  padding: 0.25rem 0.5rem;
}

.docs .definition-list {
  display: grid;
  gap: 0.75rem;
}

.docs .definition-list div {
  border-left: 3px solid var(--line-strong);
  padding-left: 0.75rem;
}

.docs .definition-list dt {
  font-weight: 760;
}

.docs .definition-list dd {
  margin: 0.15rem 0 0;
  color: var(--muted);
}

.docs .docs-faq-list {
  display: grid;
  max-width: 920px;
  gap: 0.75rem;
  margin-top: 1rem;
}

.docs .docs-faq-list details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 0.85rem 1rem;
}

.docs .docs-faq-list summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 760;
}

.docs .docs-faq-list p {
  margin: 0.65rem 0 0;
  color: var(--lead);
}

@media (max-width: 1080px) {
  .docs .layout {
      grid-template-columns: 1fr;
    }
  .docs .sidebar {
      position: static;
      height: auto;
      border-right: 0;
      border-bottom: 1px solid var(--line);
    }
  .docs .toc {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  .docs .grid,
  .docs .grid.two,
  .docs .repo-map,
  .docs .flow {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.docs .docs-tools {
  display: flex;
  width: min(var(--nav-max, 1180px), calc(100% - 32px));
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 14px auto 0;
}

.docs .docs-tools .nav-search,
.docs .docs-tools .nav-search:hover,
.docs .docs-tools .nav-search:focus-within,
.docs .docs-tools .nav-search.has-value {
  width: min(360px, 100%);
  max-width: 360px;
  justify-content: flex-start;
  gap: 7px;
  border-color: var(--header-hover-border);
  background: var(--header-surface);
  box-shadow: none;
  transform: none;
}

.docs .docs-tools .nav-search input,
.docs .docs-tools .nav-search:hover input,
.docs .docs-tools .nav-search:focus-within input,
.docs .docs-tools .nav-search.has-value input {
  width: 100%;
  opacity: 1;
}

@media (max-width: 760px) {
  .docs .docs-tools {
      align-items: stretch;
      flex-direction: column;
    }
  .docs .docs-tools .nav-search,
  .docs .docs-tools .nav-search:hover,
  .docs .docs-tools .nav-search:focus-within,
  .docs .docs-tools .nav-search.has-value {
      max-width: none;
    }
}
