/* ==========================================================================
   DataFrugal Docs — design system
   Loaded only on docs/index.html. Builds on the sitewide tokens defined in
   main.css (--accent-color, --heading-color, --default-color, etc.) and
   adds a small set of docs-specific semantic tokens below, rather than
   redefining the sitewide ones under different names.
   ========================================================================== */

:root {
  --docs-border: color-mix(in srgb, var(--default-color), transparent 85%);
  --docs-border-strong: color-mix(in srgb, var(--default-color), transparent 72%);
  --docs-muted: color-mix(in srgb, var(--default-color), transparent 32%);
  --docs-surface: var(--surface-color, #ffffff);
  --docs-surface-alt: #f7fafc;
  --docs-radius: 10px;
  --docs-radius-sm: 6px;
  --docs-transition: 0.2s ease;
  --docs-sidebar-width: 280px;

  --docs-info: #1e88e5;
  --docs-info-bg: #eaf4fc;
  --docs-success: #1a7f4e;
  --docs-success-bg: #eafaf0;
  --docs-warning: #9a6400;
  --docs-warning-bg: #fff6e6;
  --docs-danger: #c22a2a;
  --docs-danger-bg: #fdecea;
}

/* --------------------------------------------------------------------
   Page scaffold
   -------------------------------------------------------------------- */

.docs-layout {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

section[id],
div[id] {
  scroll-margin-top: 96px;
}

.docs-content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 0 3rem;
  max-width: 880px;
}

/* :where() keeps these at effectively element-level specificity, so any
   component with its own heading rules (mockups, onboarding steps, card
   titles) always wins regardless of stylesheet load order. */
:where(.docs-content) h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--heading-color);
  margin: 0 0 1rem;
}

:where(.docs-content) h3 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--heading-color);
  margin: 2.75rem 0 0.9rem;
  scroll-margin-top: 96px;
}

.docs-content > div:first-child h3:first-child,
.docs-content h2:first-child {
  margin-top: 0;
}

:where(.docs-content) h4 {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--heading-color);
  margin: 2rem 0 0.7rem;
}

:where(.docs-content) h5 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--heading-color);
  margin: 1.4rem 0 0.5rem;
}

:where(.docs-content) h6 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--heading-color);
  margin: 1.1rem 0 0.4rem;
}

:where(.docs-content) p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--default-color);
}

.docs-content .docs-lede {
  font-size: 1.05rem;
  line-height: 1.7;
  color: color-mix(in srgb, var(--default-color), transparent 8%);
}

.docs-divider {
  border: none;
  border-top: 1px solid var(--docs-border);
  margin: 2.5rem 0;
}

.docs-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-color);
  margin-bottom: 0.35rem;
}

/* --------------------------------------------------------------------
   Mobile topbar (menu toggle) — hidden on desktop
   -------------------------------------------------------------------- */

.docs-mobile-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--docs-surface);
  border-bottom: 1px solid var(--docs-border);
  padding: 12px 16px;
  margin: 0 0 1.25rem;
}

.docs-mobile-bar__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--heading-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--docs-border-strong);
  background: var(--docs-surface);
  color: var(--heading-color);
  border-radius: var(--docs-radius-sm);
  padding: 7px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.docs-menu-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.docs-sidebar-backdrop {
  display: none;
}

/* --------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------- */

.sidebar {
  width: 100%;
  max-width: var(--docs-sidebar-width);
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  background: var(--docs-surface);
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius);
  padding: 1rem;
  overflow-y: auto;
}

.docs-nav-filter {
  position: relative;
  margin-bottom: 0.9rem;
}

.docs-nav-filter i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--docs-muted);
  font-size: 14px;
  pointer-events: none;
}

.docs-nav-filter input {
  width: 100%;
  border: 1px solid var(--docs-border-strong);
  border-radius: var(--docs-radius-sm);
  padding: 8px 12px 8px 32px;
  font-size: 13.5px;
  color: var(--default-color);
  background: var(--docs-surface-alt);
}

.docs-nav-filter input:focus {
  outline: none;
  border-color: var(--accent-color);
  background: var(--docs-surface);
}

.docs-nav-empty {
  display: none;
  font-size: 13px;
  color: var(--docs-muted);
  padding: 10px 8px;
}

.services-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown + .dropdown {
  margin-top: 2px;
}

.dropdown-toggle {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--docs-muted);
  border-radius: var(--docs-radius-sm);
  transition: background-color var(--docs-transition), color var(--docs-transition);
}

.dropdown-toggle a {
  color: inherit;
  pointer-events: none;
}

.dropdown-toggle:hover {
  background-color: var(--docs-surface-alt);
  color: var(--heading-color);
}

.dropdown-toggle::after {
  content: "";
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  display: inline-block;
  padding: 3px;
  transform: rotate(45deg);
  transition: transform var(--docs-transition);
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.6;
}

.dropdown.active > .dropdown-toggle::after {
  transform: rotate(-135deg);
}

.dropdown.active > .dropdown-toggle {
  color: var(--heading-color);
}

.no-toggle {
  text-transform: none;
  letter-spacing: normal;
  font-size: 13.5px;
}

.no-toggle::after {
  display: none;
}

.no-toggle a {
  pointer-events: auto;
}

.subnav {
  display: none;
  flex-direction: column;
  gap: 1px;
  padding: 2px 0 8px;
}

.dropdown.active .subnav {
  display: flex;
}

.subnav a {
  display: block;
  color: var(--default-color);
  text-decoration: none;
  font-size: 13.5px;
  line-height: 1.4;
  padding: 7px 10px 7px 20px;
  border-radius: var(--docs-radius-sm);
  border-left: 2px solid transparent;
  transition: background-color var(--docs-transition), color var(--docs-transition),
    border-color var(--docs-transition);
}

.subnav a:hover {
  background-color: var(--docs-surface-alt);
  color: var(--accent-color);
}

.subnav a.active {
  background-color: color-mix(in srgb, var(--accent-color), transparent 90%);
  border-left-color: var(--accent-color);
  color: var(--accent-color);
  font-weight: 600;
}

.subnav a[target="_blank"]::after {
  content: "\2197";
  margin-left: 4px;
  opacity: 0.6;
}

/* --------------------------------------------------------------------
   Sidebar — mobile drawer
   -------------------------------------------------------------------- */

@media (max-width: 991px) {
  .docs-mobile-bar {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    max-height: 100vh;
    width: 300px;
    max-width: 84vw;
    border-radius: 0;
    border-right: 1px solid var(--docs-border);
    border-top: none;
    border-bottom: none;
    border-left: none;
    padding: 1.1rem 1rem 1.5rem;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 60;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 30px rgba(15, 23, 42, 0.18);
  }

  .docs-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 55;
  }

  .docs-sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .docs-sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    background: var(--docs-surface-alt);
    color: var(--heading-color);
    border-radius: 50%;
    margin: 0 0 10px auto;
    font-size: 15px;
  }
}

@media (min-width: 992px) {
  .docs-sidebar-close {
    display: none;
  }
}

/* --------------------------------------------------------------------
   Callouts (replaces the old plain-box .note-box)
   -------------------------------------------------------------------- */

.docs-callout,
.note-box {
  position: relative;
  background: var(--docs-info-bg);
  border: 1px solid color-mix(in srgb, var(--docs-info), transparent 70%);
  border-left: 4px solid var(--docs-info);
  border-radius: var(--docs-radius-sm);
  padding: 14px 16px 14px 42px;
  margin: 1.25rem 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--default-color);
}

.docs-callout::before,
.note-box::before {
  position: absolute;
  left: 16px;
  top: 15px;
  font: normal normal normal 1rem/1 "bootstrap-icons";
  content: "\f431"; /* info-circle */
  color: var(--docs-info);
}

.note-box strong,
.docs-callout strong {
  font-weight: 700;
  color: var(--heading-color);
}

.note-warning,
.docs-callout--warning {
  background: var(--docs-warning-bg);
  border-color: color-mix(in srgb, var(--docs-warning), transparent 65%);
  border-left-color: var(--docs-warning);
}

.note-warning::before,
.docs-callout--warning::before {
  content: "\f33a"; /* exclamation-triangle */
  color: var(--docs-warning);
}

.note-success,
.docs-callout--success {
  background: var(--docs-success-bg);
  border-color: color-mix(in srgb, var(--docs-success), transparent 65%);
  border-left-color: var(--docs-success);
}

.note-success::before,
.docs-callout--success::before {
  content: "\f26a"; /* check-circle */
  color: var(--docs-success);
}

.note-danger,
.docs-callout--danger {
  background: var(--docs-danger-bg);
  border-color: color-mix(in srgb, var(--docs-danger), transparent 65%);
  border-left-color: var(--docs-danger);
}

.note-danger::before,
.docs-callout--danger::before {
  content: "\f332"; /* dash-circle / x */
  color: var(--docs-danger);
}

/* --------------------------------------------------------------------
   Lists — quiet, tidy checklist style (kept for short 2-4 item lists;
   longer lists are converted to .feature-card-grid in the markup)
   -------------------------------------------------------------------- */

:where(.docs-content) ul:not(.docs-steps):not(.subnav) {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  column-gap: 24px;
  row-gap: 2px;
  margin: 1.1rem 0;
  padding: 14px 18px;
  background: var(--docs-surface-alt);
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius);
}

:where(.docs-content) ul:not(.docs-steps):not(.subnav) > li {
  position: relative;
  padding: 8px 0 8px 32px;
  font-size: 14px;
  line-height: 1.5;
}

:where(.docs-content) ul:not(.docs-steps):not(.subnav) > li > i.bi-check-circle-fill {
  position: absolute;
  left: 0;
  top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--docs-success-bg);
  color: var(--docs-success);
  font-size: 11.5px;
}

/* --------------------------------------------------------------------
   Steps
   -------------------------------------------------------------------- */

.docs-steps {
  counter-reset: docs-step;
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.5rem;
  border-left: 2px solid var(--docs-border);
}

.docs-steps li {
  counter-increment: docs-step;
  position: relative;
  padding: 2px 0 18px 34px;
  font-size: 15px;
  line-height: 1.6;
}

.docs-steps li::before {
  content: counter(docs-step);
  position: absolute;
  left: -15px;
  top: -1px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-color);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.docs-steps li:last-child {
  padding-bottom: 2px;
}

/* --------------------------------------------------------------------
   Table
   -------------------------------------------------------------------- */

.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 14px;
}

.docs-table th,
.docs-table td {
  border: 1px solid var(--docs-border);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}

.docs-table th {
  background-color: var(--docs-surface-alt);
  font-weight: 700;
  color: var(--heading-color);
}

.docs-table tbody tr:nth-child(even) {
  background-color: #fafafa;
}

/* --------------------------------------------------------------------
   Code blocks
   -------------------------------------------------------------------- */

.docs-code-block {
  position: relative;
  margin: 12px 0 20px;
}

.docs-code-block .docs-pre {
  margin: 0;
  padding-right: 3rem;
}

.docs-pre {
  background-color: var(--docs-surface-alt);
  border: 1px solid var(--docs-border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.55;
  margin: 12px 0 20px;
}

.docs-pre code {
  font-family: "JetBrains Mono", Consolas, Monaco, "Courier New", monospace;
  color: #1f2937;
  background: none;
  padding: 0;
  white-space: pre;
}

.docs-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px;
  border: 1px solid var(--docs-border-strong);
  border-radius: 6px;
  background-color: #fff;
  color: #5a6268;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease,
    border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.docs-code-block:hover .docs-copy-btn,
.docs-code-block:focus-within .docs-copy-btn,
.docs-copy-btn:focus-visible {
  opacity: 1;
  transform: translateY(0);
}

.docs-copy-btn:hover {
  background-color: #f8fafc;
  border-color: color-mix(in srgb, var(--accent-color), transparent 55%);
  color: var(--accent-color);
}

.docs-copy-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-color), transparent 40%);
  outline-offset: 2px;
}

.docs-copy-btn.is-copied {
  opacity: 1;
  transform: translateY(0);
  background-color: var(--docs-success-bg);
  border-color: #86efac;
  color: var(--docs-success);
  box-shadow: none;
}

@media (hover: none) {
  .docs-copy-btn {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------
   Wireframe mockups (.docs-mock family) — CSS/HTML stand-ins for
   product screenshots, not raster images.
   -------------------------------------------------------------------- */

.docs-mock-figure {
  margin: 1.75rem 0;
}

.docs-mock {
  position: relative;
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius);
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  max-width: 460px;
  margin: 0 auto;
}

.docs-mock__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.45rem 0.7rem;
  background: #f4f6f8;
  border-bottom: 1px solid var(--docs-border);
}

.docs-mock__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d1d5db;
  flex-shrink: 0;
}

.docs-mock__bar-title {
  margin-left: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--docs-muted);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-mock__body {
  padding: 0.85rem 0.9rem 1rem;
}

.docs-mock-caption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0.6rem auto 0;
  max-width: 640px;
  font-size: 0.82rem;
  color: var(--docs-muted);
  text-align: center;
}

.docs-mock-caption i {
  color: var(--accent-color);
}

.docs-mock-pointer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--docs-border);
  border-left: 4px solid var(--accent-color);
  border-radius: var(--docs-radius);
  background: #f8fbfe;
  padding: 12px 16px;
  margin: 1.1rem 0 1.5rem;
  font-size: 0.9rem;
  color: var(--default-color);
}

.docs-mock-pointer i {
  color: var(--accent-color);
  font-size: 1.1rem;
  margin-top: 2px;
  flex-shrink: 0;
}

.docs-mock-pointer a {
  font-weight: 600;
}

.docs-mock--terminal {
  background: #1e2530;
  max-width: 640px;
}

.docs-mock--terminal .docs-mock__bar {
  background: #262e3a;
  border-color: #323a46;
}

.docs-mock--terminal .docs-mock__bar-title {
  color: #9aa5b1;
}

.docs-mock--terminal .docs-mock__body {
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.78rem;
  line-height: 1.9;
  color: #d7dde3;
}

.docs-mock--terminal .tm-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.docs-mock--terminal .tm-prompt {
  color: #59c774;
}

.docs-mock--terminal .tm-cmd {
  color: #f4f6f8;
}

.docs-mock--terminal .tm-flag {
  color: #58a6ff;
  min-width: 3.5em;
}

.docs-mock--terminal .tm-desc {
  color: #9aa5b1;
}

.docs-mock:not(.docs-mock--terminal) .docs-mock__bar {
  justify-content: center;
}

.docs-mock:not(.docs-mock--terminal) .docs-mock__bar-title {
  margin-left: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #e2e5e9;
  border-radius: 999px;
  padding: 4px 16px;
  font-weight: 500;
  letter-spacing: normal;
  color: #5a6268;
  max-width: 70%;
}

.docs-mock:not(.docs-mock--terminal) .docs-mock__bar-title::before {
  content: "\1F512";
  font-size: 10px;
  color: #8a9099;
  flex-shrink: 0;
}

@media (forced-colors: active) {
  .docs-mock,
  .docs-mock * {
    forced-color-adjust: auto;
  }
}

/* --------------------------------------------------------------------
   ARIA tabs — used for onboarding (Business/Individual) and any
   Web/CLI style content tabs. Visual styling mirrors .app-preview-tabs
   for consistency; this class targets non-app-preview tab groups.
   -------------------------------------------------------------------- */

.docs-tabs[role="tablist"] {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--docs-border);
  padding-bottom: 2px;
}

.docs-tab {
  border: none;
  background: none;
  color: var(--docs-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 4px;
  margin-right: 18px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color var(--docs-transition), border-color var(--docs-transition);
}

.docs-tab:hover {
  color: var(--heading-color);
}

.docs-tab[aria-selected="true"] {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

.docs-tabpanel[hidden] {
  display: none;
}

/* --------------------------------------------------------------------
   Section-icon header (used by a few Integrations/Security subsections)
   -------------------------------------------------------------------- */

.section-icon-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.section-icon-head i {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--docs-info-bg);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.section-icon-head h4 {
  margin: 0;
}

/* --------------------------------------------------------------------
   Diagram wrapper — inline SVG flow diagrams
   -------------------------------------------------------------------- */

.docs-diagram {
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius);
  background: var(--docs-surface-alt);
  padding: 1.25rem 1rem;
  margin: 1.5rem 0;
  overflow-x: auto;
}

.docs-diagram svg {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

.docs-diagram figcaption {
  text-align: center;
  font-size: 0.82rem;
  color: var(--docs-muted);
  margin-top: 0.6rem;
}

.docs-diagram--compact {
  padding: 1rem;
}

.docs-diagram--compact svg {
  max-width: 460px;
}

/* --------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------- */

.docs-content .btn.btn-primary {
  color: var(--contrast-color, #fff);
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  border-radius: 50px;
  padding: 8px 25px;
  font-size: 14px;
  transition: 0.3s;
}

.docs-content .btn.btn-primary:hover,
.docs-content .btn.btn-primary:focus,
.docs-content .btn.btn-primary:active {
  color: var(--contrast-color, #fff);
  background-color: color-mix(in srgb, var(--accent-color), transparent 15%);
  border-color: color-mix(in srgb, var(--accent-color), transparent 15%);
}

/* --------------------------------------------------------------------
   Headings
   -------------------------------------------------------------------- */

/* --------------------------------------------------------------------
   FAQ mini-accordion (native <details>, no JS dependency)
   -------------------------------------------------------------------- */

.docs-faq {
  border-top: 1px solid var(--docs-border);
  margin: 1.25rem 0 1.75rem;
}

.docs-faq details {
  border-bottom: 1px solid var(--docs-border);
  padding: 4px 0;
}

.docs-faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--heading-color);
}

.docs-faq summary::-webkit-details-marker {
  display: none;
}

.docs-faq summary::after {
  content: "\002B";
  font-size: 18px;
  color: var(--docs-muted);
  flex-shrink: 0;
  transition: transform var(--docs-transition);
}

.docs-faq details[open] summary::after {
  content: "\2212";
}

.docs-faq p {
  margin: 0 4px 14px;
  font-size: 14px;
  color: var(--docs-muted);
  line-height: 1.65;
}

/* --------------------------------------------------------------------
   Support cards
   -------------------------------------------------------------------- */

.docs-support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 1.25rem 0;
}

.docs-support-card {
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius);
  padding: 18px;
  background: var(--docs-surface);
}

.docs-support-card i {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--docs-info-bg);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 10px;
}

.docs-support-card h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.docs-support-card p {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--docs-muted);
}

.docs-support-card a.docs-support-link {
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

@media (max-width: 991px) {
  .docs-content {
    max-width: 100%;
  }
}

/* ====================================================================
   Typography scale — three sizes, matching the DataFrugal app
   (IBM Plex Sans; --form-text-xl / -lg / -md in vite-gui tokens):
     heading     22px  page title (h1) and section titles (h3)
     subheading  17px  topic titles (h4)
     body        14px  everything else: text, lists, tables, notes,
                       cards, captions, minor headings (h5/h6, bold)
   Wireframe interiors (.docs-mock, .app-shell) keep their own sizes
   because they imitate app screens. Kept last so it overrides the
   component rules above.
   ==================================================================== */

.docs-content,
.sidebar {
  --docs-font: "IBM Plex Sans", "Open Sans", system-ui, sans-serif;
  --docs-fs-heading: 1.375rem;
  --docs-fs-subheading: 1.0625rem;
  --docs-fs-body: 0.875rem;
  font-family: var(--docs-font);
}

.docs-content :is(h1, h2, h3, h4, h5, h6) {
  font-family: var(--docs-font);
  color: var(--heading-color);
}

/* Heading */
.docs-content h1,
.docs-content h3 {
  font-size: var(--docs-fs-heading);
  font-weight: 700;
  line-height: 1.3;
}

/* Subheading */
.docs-content h4:not(.docs-support-card h4) {
  font-size: var(--docs-fs-subheading);
  font-weight: 700;
  line-height: 1.4;
}

/* Body — text and every component that carries text */
.docs-content :is(p, li, td, th, summary, figcaption),
.docs-content :is(h5, h6):not(.docs-mock *),
.docs-content .docs-support-card h4,
.docs-content .docs-lede,
.docs-content .note-box,
.docs-content .feature-card strong,
.docs-content .feature-card span,
.docs-content .docs-mock-caption,
.docs-content .app-preview-subtext,
.docs-content .app-preview-note,
.docs-content .onboard-step__body > p,
.docs-content .docs-support-card a.docs-support-link,
.docs-content .btn,
.docs-content .docs-pre,
.docs-mobile-bar__title,
.docs-menu-btn,
.sidebar :is(a, input, .docs-nav-empty),
.sidebar .dropdown-toggle {
  font-size: var(--docs-fs-body);
}

.docs-content :is(p, li, td, .note-box) {
  line-height: 1.7;
}

.docs-content :is(h5, h6):not(.docs-mock *) {
  font-weight: 700;
}

/* Inline code sits in running text, so size it to the text around it. */
.docs-content :not(pre) > code {
  font-size: 0.92em;
}

/* Sidebar group labels: same size as the links, set apart by weight. */
.sidebar .dropdown-toggle {
  text-transform: none;
  letter-spacing: normal;
}

/* ====================================================================
   df-agent upload demo (#agent-demo)
   Without JS or with reduced motion: both screens stacked, final state.
   With .is-animated (set by initAgentDemo in docs.js): screens share one
   frame and cross-fade, driven by data-screen on the figure.
   ==================================================================== */

.agent-demo .docs-mock {
  width: 100%;
  max-width: 640px;
}

.agent-demo__stage {
  display: grid;
  gap: 14px;
  max-width: 640px;
  margin: 0 auto;
}

.agent-demo.is-animated .agent-demo__stage {
  gap: 0;
}

.agent-demo.is-animated .agent-demo__screen {
  grid-area: 1 / 1;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.agent-demo.is-animated[data-screen="terminal"] .agent-demo__dashboard,
.agent-demo.is-animated[data-screen="dashboard"] .agent-demo__terminal {
  opacity: 0;
  transform: scale(0.98);
  pointer-events: none;
}

.agent-demo__terminal .docs-mock__body {
  min-height: 190px;
  white-space: normal;
}

.agent-demo__line {
  word-break: break-all;
}

.agent-demo__line .tm-prompt {
  margin-right: 6px;
}

.agent-demo__cursor {
  display: none;
  width: 0.55em;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: #d7dde3;
}

.agent-demo.is-animated .agent-demo__cursor {
  display: inline-block;
  animation: agent-demo-blink 1s steps(1) infinite;
}

@keyframes agent-demo-blink {
  50% { opacity: 0; }
}

.agent-demo__out {
  color: #9aa5b1;
}

.agent-demo.is-animated .agent-demo__out:not(.is-shown) {
  visibility: hidden;
}

.agent-demo__ok {
  color: #59c774;
  font-weight: 700;
}

.agent-demo__progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-demo__track {
  flex: 1 1 auto;
  max-width: 260px;
  height: 6px;
  border-radius: 999px;
  background: #323a46;
  overflow: hidden;
}

.agent-demo__fill {
  display: block;
  height: 100%;
  width: 100%;
  background: #58a6ff;
}

.agent-demo__pct {
  color: #d7dde3;
  min-width: 3.2em;
}

.agent-demo__dashboard .docs-mock__body {
  position: relative;
  min-height: 190px;
  font-size: 13px;
}

.agent-demo__crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #5a6268;
  margin-bottom: 10px;
}

.agent-demo__crumb .bi-folder-fill {
  color: #f0b429;
}

.agent-demo__crumb .bi-chevron-right {
  font-size: 10px;
  color: #9aa5b1;
}

.agent-demo__table {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.agent-demo__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7.5em 4.5em;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid #eef0f2;
  color: #1f2937;
  align-items: center;
}

.agent-demo__row > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-demo__row--head {
  border-top: none;
  background: #f7fafc;
  font-weight: 600;
  color: #5a6268;
}

.agent-demo__row .bi {
  color: #5a6268;
  margin-right: 4px;
}

.agent-demo__row--new {
  background: #eaf4fc;
}

.agent-demo__badge {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--accent-color);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 6px;
}

.agent-demo.is-animated .agent-demo__row--new {
  max-height: 3em;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.4s ease 0.15s,
    background-color 1.2s ease;
}

/* Before arrival the row takes no space, so it opens up in place. */
.agent-demo.is-animated:not(.is-arrived) .agent-demo__row--new {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top-width: 0;
  opacity: 0;
  background: #fff;
}

.agent-demo__toast {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #1f2937;
  color: #fff;
  font-size: 12px;
}

.agent-demo__toast .bi {
  color: #59c774;
}

.agent-demo.is-animated .agent-demo__toast {
  transition: opacity 0.4s ease 0.3s;
}

.agent-demo.is-animated:not(.is-arrived) .agent-demo__toast {
  opacity: 0;
}

.agent-demo__controls {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.agent-demo__replay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--docs-border-strong);
  background: var(--docs-surface);
  color: var(--heading-color);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: var(--docs-fs-body, 0.875rem);
  cursor: pointer;
}

.agent-demo__replay:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* Header brand is a <span> on the docs page so the page has a single <h1>
   (the content title); mirror main.css `.header .logo h1`. */
.header .logo .sitename {
  font-family: var(--heading-font);
  font-size: 30px;
  font-weight: 700;
  margin: 0;
  color: var(--heading-color);
}

/* Use cases (Overview) — scenario cards: who, their problem, how
   DataFrugal helps, link to the relevant section. */
.use-case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  margin: 1rem 0 1.25rem;
}

.use-case {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius);
  background: var(--docs-surface);
  padding: 16px 18px;
}

.use-case > i {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--docs-info-bg);
  color: var(--accent-color);
  font-size: 16px;
  margin-bottom: 10px;
}

.docs-content .use-case h4 {
  margin: 0 0 6px;
}

.docs-content .use-case p {
  margin: 0 0 8px;
}

.docs-content .use-case .use-case__problem {
  font-weight: 600;
  color: var(--heading-color);
}

.use-case > a {
  margin-top: auto;
  font-size: var(--docs-fs-body);
  font-weight: 600;
}

.use-case > a::after {
  content: " \2192";
}

/* Four outcome cards: always a balanced 2 x 2 (1 column on phones). */
.feature-card-grid--2x2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 575px) {
  .feature-card-grid--2x2 {
    grid-template-columns: 1fr;
  }
}
