/* ============================================
   MediQuo Docs — editorial technical
   Hairlines, Geist + Instrument Serif italic accent,
   monochrome with #2A0050 used sparingly.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&family=Instrument+Serif:ital@0;1&display=swap');

/* ============================================
   Tokens
   ============================================ */
:root {
  /* Type */
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* Light palette */
  --color-bg: #FCFCFD;
  --color-bg-subtle: #F4F4F5;
  --color-bg-card: #FFFFFF;
  --color-fg: #09090B;
  --color-fg-muted: #52525B;
  --color-fg-faint: #A1A1AA;
  --color-border: rgba(9, 9, 11, 0.08);
  --color-border-strong: rgba(9, 9, 11, 0.14);

  --color-accent: #2A0050;
  --color-accent-hover: #3A0070;
  --color-accent-soft: rgba(42, 0, 80, 0.06);
  --color-accent-softer: rgba(42, 0, 80, 0.03);

  /* Background hatching color — light theme: brand purple, very subtle */
  --pattern-color: rgba(42, 0, 80, 0.04);

  /* Semantic */
  --color-success: #16A34A;
  --color-warning: #D97706;
  --color-danger: #DC2626;
  --color-info: #2563EB;
  --color-tip: #14B8A6;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Radius — small for crispness */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* Material overrides */
  --md-primary-fg-color: var(--color-accent);
  --md-primary-bg-color: var(--color-bg);
  --md-accent-fg-color: var(--color-accent);
  --md-default-bg-color: var(--color-bg);
  --md-default-fg-color: var(--color-fg);
  --md-default-fg-color--light: var(--color-fg-muted);
  --md-default-fg-color--lighter: var(--color-fg-faint);
  --md-default-fg-color--lightest: var(--color-border);
  --md-typeset-color: var(--color-fg);
  --md-typeset-a-color: var(--color-accent);
}

/* Dark palette */
[data-md-color-scheme="slate"] {
  --color-bg: #0A0A0A;
  --color-bg-subtle: #131316;
  --color-bg-card: #131316;
  --color-fg: #FAFAFA;
  --color-fg-muted: #A1A1AA;
  --color-fg-faint: #52525B;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.14);

  --color-accent: #C4B5FD;
  --color-accent-hover: #DDD6FE;
  --color-accent-soft: rgba(196, 181, 253, 0.1);
  --color-accent-softer: rgba(196, 181, 253, 0.05);

  /* Background hatching color — dark theme: subtle white lines */
  --pattern-color: rgba(255, 255, 255, 0.035);

  --md-default-bg-color: var(--color-bg);
  --md-default-fg-color: var(--color-fg);
  --md-default-fg-color--light: var(--color-fg-muted);
  --md-default-fg-color--lighter: var(--color-fg-faint);
  --md-default-fg-color--lightest: var(--color-border);
  --md-typeset-color: var(--color-fg);
  --md-typeset-a-color: var(--color-accent);
}

/* ============================================
   Global
   ============================================ */
html, body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--color-bg);
  color: var(--color-fg);
  /* Diagonal hatching — color comes from --pattern-color so each theme can override */
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0,
    transparent 14px,
    var(--pattern-color, rgba(42, 0, 80, 0.035)) 14px,
    var(--pattern-color, rgba(42, 0, 80, 0.035)) 15px
  );
  background-attachment: fixed;
}

/* Let Material containers reveal the body texture instead of painting over it */
.md-container,
.md-main,
.md-main__inner,
.md-content {
  background: transparent;
}

/* ============================================
   Header — always graphite, sticky, hairline border
   (kept the same in both light and dark themes)
   ============================================ */
.md-header {
  background: rgba(9, 9, 11, 0.94);
  color: #FAFAFA;
  box-shadow: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
}

.md-header[hidden] { transform: translateY(-100%); }

.md-header__inner {
  display: flex;
  align-items: center;
  padding: 0.2rem var(--space-6);
  max-width: none;
  gap: var(--space-6);
}

/* Brand: logo image + italic "Docs" suffix */
.md-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--color-fg);
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.md-header__logo-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.md-header__logo {
  height: 28px;
  width: auto;
  display: block;
  /* Force the SVG to render as solid white in both themes */
  filter: brightness(0) invert(1);
}

/* Brazilian flag badge (overlapping the logo's top-right corner) */
.md-header__brand-flag {
  position: absolute;
  top: -3px;
  right: -11px;
  display: inline-flex;
  width: 16px;
  height: 11px;
  border-radius: 2px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px #09090B,
    0 1px 3px rgba(0, 0, 0, 0.4);
  line-height: 0;
}

.md-header__brand-flag svg {
  display: block;
  width: 100%;
  height: 100%;
}

.md-header__brand-divider {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: var(--color-border-strong);
  align-self: center;
}

.md-header__brand-suffix {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--color-fg-muted);
  letter-spacing: 0;
  line-height: 1;
}

/* Hide default Material logo button (we ship our own inside .md-header__brand) */
.md-header__button.md-logo {
  display: none;
}

/* Header nav — underline indicator on active, hairline-aligned */
.md-header-nav {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  margin-left: var(--space-2);
  height: 100%;
  align-self: stretch;
}

.md-header-nav__item {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.8rem;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 0;
  transition: color 0.12s ease;
  letter-spacing: -0.005em;
  position: relative;
}

.md-header-nav__item svg { display: none; }

/* Underline reveal — fixed lavender, visible against the always-dark header */
.md-header-nav__item::after {
  content: '';
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  bottom: calc(-0.2rem - 1px);
  height: 2px;
  background: #C4B5FD;
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.18s ease;
}

.md-header-nav__item:hover {
  color: #FAFAFA;
  background: transparent;
}

.md-header-nav__item:hover::after {
  transform: scaleX(0.3);
  background: rgba(255, 255, 255, 0.45);
}

.md-header-nav__item--active {
  color: #FAFAFA;
  background: transparent;
  font-weight: 600;
}

.md-header-nav__item--active::after {
  transform: scaleX(1);
  background: #C4B5FD;
}

.md-header__spacer { flex: 1; }

.md-header__button {
  color: rgba(255, 255, 255, 0.65);
  transition: color 0.12s ease, background 0.12s ease;
  margin: 0.1rem;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
}

.md-header__button:hover {
  color: #FAFAFA;
  background: rgba(255, 255, 255, 0.08);
  opacity: 1;
}

/* Theme toggle (palette) — discreet icon */
.md-header__option .md-header__button {
  color: rgba(255, 255, 255, 0.55);
  padding: 0.4rem;
}

.md-header__option .md-header__button svg,
.md-header__option .md-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform 0.25s ease;
}

.md-header__option .md-header__button:hover {
  color: #FAFAFA;
  background: rgba(255, 255, 255, 0.08);
}

.md-header__option .md-header__button:hover svg {
  transform: rotate(15deg);
}

.md-tabs { display: none; }

/* ============================================
   Layout — three-zone grid
   (keep Material's sidebar widths; only restyle visuals)
   ============================================ */
.md-grid { max-width: 1440px; }

.md-main__inner { margin-top: 0; }

.md-sidebar--primary {
  background: transparent;
  border-right: 1px solid var(--color-border);
}

.md-content { max-width: none; }

.md-content__inner {
  margin: 0 auto;
  padding: var(--space-10) var(--space-8);
  max-width: 48rem;
}

.md-content__inner::before { display: none; }

/* ============================================
   Sidebar nav (left)
   ============================================ */
.md-nav {
  font-size: 0.85rem;
}

.md-sidebar--primary .md-nav__title {
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-fg-faint);
  padding: var(--space-3) var(--space-4) var(--space-2);
  background: transparent;
  box-shadow: none;
}

/* Hide drawer title ("MediQuo Brasil") on desktop — logo in header is enough */
.md-sidebar--primary .md-nav__title[for="__drawer"] {
  display: none;
}

@media screen and (max-width: 76.25em) {
  .md-sidebar--primary .md-nav__title[for="__drawer"] {
    display: block;
    background: transparent;
    color: var(--color-fg);
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.9rem;
    font-weight: 600;
    padding: var(--space-4);
  }
}

/* Hide expand/collapse chevron icons next to section titles for a cleaner, uniform look */
.md-sidebar--primary .md-nav__icon {
  display: none;
}

.md-nav__item { padding: 0; }

.md-nav__list { padding: 0 var(--space-2); }

/* Default link style — applies to subitems; root rule below is more specific */
.md-sidebar--primary .md-nav__link {
  font-size: 0.74rem;
  padding: 0.3rem 0.5rem 0.3rem 1.4rem;
  margin: 1px 0;
  border-radius: var(--radius-sm);
  color: var(--color-fg-muted);
  font-weight: 400;
  transition: color 0.12s ease, background 0.12s ease;
  position: relative;
  letter-spacing: -0.005em;
}

.md-sidebar--primary .md-nav__link:hover {
  color: var(--color-fg);
  background: var(--color-bg-subtle);
}

.md-sidebar--primary .md-nav__link--active {
  color: var(--color-accent);
  font-weight: 500;
  background: var(--color-accent-soft);
}

[data-md-color-scheme="slate"] .md-sidebar--primary .md-nav__link--active {
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

/* Root items (top-level entries: Home, ID MediQuo, SDK MediQuo, Referência) — bold + uniform */
.md-sidebar--primary .md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__link,
.md-sidebar--primary .md-nav--primary > .md-nav__list > .md-nav__item.md-nav__item--section > .md-nav__link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-fg);
  text-transform: none;
  letter-spacing: -0.01em;
  padding: 0.4rem 0.5rem;
  margin: var(--space-3) 0 0.2rem;
  background: transparent !important;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
}

.md-sidebar--primary .md-nav--primary > .md-nav__list > .md-nav__item:first-child > .md-nav__link {
  margin-top: 0;
}

/* Section roots (those that have children) are not clickable navigation targets */
.md-sidebar--primary .md-nav--primary > .md-nav__list > .md-nav__item.md-nav__item--section > .md-nav__link {
  cursor: default;
}

.md-sidebar--primary .md-nav--primary > .md-nav__list > .md-nav__item.md-nav__item--section > .md-nav__link:hover {
  color: var(--color-fg);
  background: transparent !important;
}

/* Active state on root items (e.g. Home page) */
.md-sidebar--primary .md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__link--active {
  color: var(--color-accent);
}

/* Hide leaf root items (Home, Referência) from the sidebar — they're already
   in the header nav. Only sections with subitems remain in the sidebar. */
.md-sidebar--primary .md-nav--primary > .md-nav__list > .md-nav__item:not(.md-nav__item--section):not(.md-nav__item--nested) {
  display: none;
}

.md-sidebar--primary .md-nav--secondary .md-nav__title {
  display: none;
}

/* ============================================
   Typography
   ============================================ */
.md-typeset {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--color-fg);
}

/* Anchor scroll offset — keep heading clear of the sticky header when
   the user jumps from the TOC. Header is ~38px; add a small buffer. */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
  scroll-margin-top: 64px;
}

.md-typeset h1 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.875rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 0 0 var(--space-6);
  color: var(--color-fg);
  border-bottom: none;
  background: none;
  -webkit-text-fill-color: var(--color-fg);
  -webkit-background-clip: initial;
  background-clip: initial;
}

.md-typeset h2 {
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: var(--space-12) 0 var(--space-3);
  padding-bottom: 0;
  border-bottom: none;
  color: var(--color-fg);
}

.md-typeset h2::before {
  content: '';
  display: block;
  width: 28px;
  height: 2px;
  background: var(--color-accent);
  opacity: 0.55;
  margin-bottom: var(--space-3);
  border-radius: 1px;
}

.md-typeset h3 {
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.4;
  letter-spacing: -0.015em;
  margin: var(--space-8) 0 var(--space-2);
  color: var(--color-fg);
}

.md-typeset h4 {
  font-weight: 600;
  font-size: 0.9375rem;
  margin: var(--space-6) 0 var(--space-2);
  color: var(--color-fg);
  letter-spacing: -0.01em;
}

.md-typeset p {
  margin: 0 0 var(--space-4);
  color: var(--color-fg);
}

.md-typeset a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--color-accent) 30%, transparent);
  transition: text-decoration-color 0.12s ease;
  font-weight: 500;
}

.md-typeset a:hover {
  text-decoration-color: var(--color-accent);
}

.md-typeset ul, .md-typeset ol {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-6);
}

.md-typeset li { margin-bottom: var(--space-1); }

.md-typeset ul > li::marker {
  color: var(--color-accent);
}

.md-typeset ol > li::marker {
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.md-typeset hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-10) 0;
}

.md-typeset strong { font-weight: 600; color: var(--color-fg); }

.md-typeset em {
  font-style: italic;
}

/* Permalink (heading anchors / ¶) — hidden completely */
.md-typeset .headerlink,
.md-typeset h1 .headerlink,
.md-typeset h2 .headerlink,
.md-typeset h3 .headerlink,
.md-typeset h4 .headerlink,
.md-typeset h5 .headerlink,
.md-typeset h6 .headerlink {
  display: none !important;
}

/* ============================================
   Code — inline + blocks
   ============================================ */
.md-typeset code {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.12em 0.4em;
  font-size: 0.86em;
  font-family: var(--font-mono);
  color: color-mix(in srgb, var(--color-accent) 75%, var(--color-fg));
  font-weight: 500;
  letter-spacing: -0.01em;
}

[data-md-color-scheme="slate"] .md-typeset code {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--color-border);
  color: color-mix(in srgb, var(--color-accent) 60%, var(--color-fg));
}

/* Code blocks always dark — Vercel pattern */
.md-typeset pre {
  border-radius: var(--radius-md);
  box-shadow: none;
  border: 1px solid var(--color-border);
  background: #0B0B0F;
  margin: var(--space-5) 0;
  overflow: hidden;
}

[data-md-color-scheme="slate"] .md-typeset pre {
  background: #0B0B0F;
  border-color: var(--color-border);
}

.md-typeset pre > code {
  background: transparent !important;
  color: #E4E4E7;
  padding: var(--space-4) var(--space-5);
  font-size: 0.75rem;
  line-height: 1.6;
  border: none;
  font-weight: 400;
  letter-spacing: 0;
  font-feature-settings: 'liga' 0, 'calt' 0;
}

/* Filename header — terminal window style with 3 dots */
.md-typeset .highlight > .filename {
  background: #161B22;
  color: #A1A1AA;
  padding: 0.5rem 1rem 0.5rem 0.85rem;
  font-size: 0.68rem;
  font-weight: 500;
  font-family: var(--font-mono);
  border: 1px solid var(--color-border);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  margin-bottom: 0;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  text-transform: none;
}

/* macOS-style window controls before the filename */
.md-typeset .highlight > .filename::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FF5F57;
  box-shadow:
    12px 0 0 #FEBC2E,
    24px 0 0 #28C840;
  margin-right: 30px;
  flex-shrink: 0;
}

.md-typeset .highlight .filename + pre {
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  margin-top: 0;
}

/* ===== Syntax tokens — recalibrated for clarity =====
   Strings = green (values)   |  Keys/tags = blue (identifiers)
   Numbers = amber             |  Keywords/booleans = lavender
   Comments = muted gray italic
*/
.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .sb,
.highlight .se,
.highlight .sd { color: #86EFAC; }

.highlight .nt,
.highlight .na,
.highlight .nl { color: #93C5FD; }

.highlight .nf,
.highlight .nx { color: #93C5FD; }

.highlight .nb { color: #FDE68A; }

.highlight .nv,
.highlight .vi,
.highlight .vg { color: #FCD34D; }

.highlight .k,
.highlight .kn,
.highlight .kd,
.highlight .kt,
.highlight .kc,
.highlight .kr { color: #C4B5FD; }

.highlight .mi,
.highlight .mf,
.highlight .il,
.highlight .m { color: #FCD34D; }

.highlight .c,
.highlight .c1,
.highlight .cm,
.highlight .cs,
.highlight .cp { color: #6B7280; font-style: italic; }

.highlight .o,
.highlight .ow { color: #E4E4E7; }

.highlight .p { color: #71717A; }

.highlight .err {
  color: #FCA5A5;
  background: transparent;
  border: none;
}

/* Copy button */
.md-clipboard {
  color: rgba(255, 255, 255, 0.4);
  opacity: 1;
  transition: color 0.15s ease;
  background: transparent;
}

.md-clipboard:hover {
  color: #FFFFFF;
}

.md-clipboard::after {
  background-color: currentColor;
}

/* ============================================
   Tables — hairline elegance, full-width consistent
   ============================================ */
.md-typeset__scrollwrap {
  margin: var(--space-5) 0;
  width: 100%;
  overflow-x: auto;
}

.md-typeset__table {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
}

.md-typeset table:not([class]),
.md-typeset table {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: none;
  width: 100% !important;
  min-width: 100%;
  margin: 0;
  font-size: 0.78rem;
  border-collapse: separate;
  border-spacing: 0;
  display: table;
  table-layout: auto;
}

.md-typeset table:not([class]) th,
.md-typeset table th {
  background: var(--color-bg-subtle);
  color: var(--color-fg);
  font-weight: 600;
  text-transform: none;
  font-size: 0.72rem;
  letter-spacing: -0.005em;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  white-space: normal;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) th,
[data-md-color-scheme="slate"] .md-typeset table th {
  background: rgba(255, 255, 255, 0.04);
}

.md-typeset table:not([class]) td,
.md-typeset table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-fg);
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.md-typeset table:not([class]) tr:last-child td,
.md-typeset table tr:last-child td {
  border-bottom: none;
}

.md-typeset table:not([class]) tbody tr:hover,
.md-typeset table tbody tr:hover {
  background: var(--color-accent-softer);
}

.md-typeset table code {
  font-size: 0.8em;
  padding: 0.08em 0.3em;
  word-break: break-word;
}

/* ============================================
   Admonitions — minimal hairline boxes
   ============================================ */
.md-typeset .admonition,
.md-typeset details {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  border-left-width: 3px;
  background: var(--color-bg-card);
  box-shadow: none;
  margin: var(--space-5) 0;
  font-size: 0.875rem;
  padding: var(--space-3) var(--space-4) var(--space-2);
}

[data-md-color-scheme="slate"] .md-typeset .admonition,
[data-md-color-scheme="slate"] .md-typeset details {
  background: var(--color-bg-card);
}

.md-typeset .admonition-title,
.md-typeset details summary {
  font-weight: 600;
  font-size: 0.815rem;
  padding: 0 0 var(--space-1);
  margin: 0;
  border-radius: 0;
  background: transparent !important;
  color: var(--color-fg);
  text-transform: none;
  letter-spacing: -0.005em;
}

.md-typeset .admonition > .admonition-title::before,
.md-typeset details > summary::before {
  width: 0.95rem;
  height: 0.95rem;
  top: 0.05rem;
}

.md-typeset .admonition > p:last-child,
.md-typeset details > p:last-child {
  margin-bottom: var(--space-1);
}

.md-typeset .admonition > p,
.md-typeset details > p {
  padding: 0;
  margin: var(--space-1) 0 var(--space-2);
  color: var(--color-fg-muted);
}

.md-typeset .admonition.note,
.md-typeset details.note { border-left-color: var(--color-accent); }
.md-typeset .note > .admonition-title::before,
.md-typeset .note > summary::before { background-color: var(--color-accent); }

.md-typeset .admonition.info,
.md-typeset details.info { border-left-color: var(--color-info); }
.md-typeset .info > .admonition-title::before,
.md-typeset .info > summary::before { background-color: var(--color-info); }

.md-typeset .admonition.warning,
.md-typeset details.warning { border-left-color: var(--color-warning); }
.md-typeset .warning > .admonition-title::before,
.md-typeset .warning > summary::before { background-color: var(--color-warning); }

.md-typeset .admonition.success,
.md-typeset details.success { border-left-color: var(--color-success); }
.md-typeset .success > .admonition-title::before,
.md-typeset .success > summary::before { background-color: var(--color-success); }

.md-typeset .admonition.danger,
.md-typeset details.danger { border-left-color: var(--color-danger); }
.md-typeset .danger > .admonition-title::before,
.md-typeset .danger > summary::before { background-color: var(--color-danger); }

.md-typeset .admonition.tip,
.md-typeset details.tip { border-left-color: var(--color-tip); }
.md-typeset .tip > .admonition-title::before,
.md-typeset .tip > summary::before { background-color: var(--color-tip); }

/* ============================================
   HTTP method badges — tinted bordered chips
   ============================================ */
.method-get,
.method-post,
.method-put,
.method-delete,
.method-patch {
  display: inline-flex;
  align-items: center;
  padding: 0.18em 0.55em;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  margin-right: var(--space-2);
  border: 1px solid;
}

.method-get    { background: rgba(37, 99, 235, 0.08);  color: #1D4ED8; border-color: rgba(37, 99, 235, 0.22); }
.method-post   { background: rgba(22, 163, 74, 0.08);  color: #15803D; border-color: rgba(22, 163, 74, 0.22); }
.method-put    { background: rgba(217, 119, 6, 0.08);  color: #B45309; border-color: rgba(217, 119, 6, 0.22); }
.method-delete { background: rgba(220, 38, 38, 0.08);  color: #B91C1C; border-color: rgba(220, 38, 38, 0.22); }
.method-patch  { background: rgba(20, 184, 166, 0.08); color: #0F766E; border-color: rgba(20, 184, 166, 0.22); }

[data-md-color-scheme="slate"] .method-get    { color: #93C5FD; }
[data-md-color-scheme="slate"] .method-post   { color: #86EFAC; }
[data-md-color-scheme="slate"] .method-put    { color: #FCD34D; }
[data-md-color-scheme="slate"] .method-delete { color: #FCA5A5; }
[data-md-color-scheme="slate"] .method-patch  { color: #5EEAD4; }

/* ============================================
   AI-First panel — "Integre em 5 minutos com IA"
   Promotes llms-full.txt + deep-links to ChatGPT/Claude
   ============================================ */
.ai-integrate {
  margin: 0 0 0;
  padding: var(--space-6) var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background:
    linear-gradient(to bottom right, var(--color-accent-softer), transparent 60%),
    var(--color-bg-card);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  position: relative;
  overflow: hidden;
}

.ai-integrate::before {
  /* corner shimmer */
  content: '';
  position: absolute;
  inset: -50% -30% auto auto;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, var(--color-accent-soft), transparent 65%);
  pointer-events: none;
  opacity: 0.55;
}

.ai-integrate__intro {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
  z-index: 1;
}

.ai-integrate__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--color-accent-soft);
}

.ai-integrate__badge::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M12 2 14.5 9.5 22 12 14.5 14.5 12 22 9.5 14.5 2 12 9.5 9.5z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M12 2 14.5 9.5 22 12 14.5 14.5 12 22 9.5 14.5 2 12 9.5 9.5z'/></svg>");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.md-typeset .ai-integrate__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-fg);
  line-height: 1.2;
}

.md-typeset .ai-integrate__title::before {
  display: none;
}

.ai-integrate__lead {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--color-fg-muted);
  max-width: 48rem;
}

.ai-integrate__lead code {
  font-size: 0.82em;
  padding: 0.08em 0.35em;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: color-mix(in srgb, var(--color-accent) 75%, var(--color-fg));
  font-family: var(--font-mono);
}

.ai-integrate__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

.ai-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-fg) !important;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none !important;
  border-bottom: 1px solid var(--color-border) !important;
  cursor: pointer;
  font-family: var(--font-sans);
  letter-spacing: -0.005em;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  position: relative;
}

.ai-action:hover {
  border-color: var(--color-accent) !important;
  background: var(--color-accent-softer);
  color: var(--color-fg) !important;
}

[data-md-color-scheme="slate"] .ai-action {
  background: rgba(255, 255, 255, 0.02);
}

[data-md-color-scheme="slate"] .ai-action:hover {
  background: rgba(196, 181, 253, 0.06);
}

.ai-action__icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  background-color: var(--color-fg);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  flex-shrink: 0;
  opacity: 0.9;
}

.ai-action:hover .ai-action__icon { opacity: 1; }

/* Per-button icons */
.ai-action--chatgpt .ai-action__icon {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><path d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><path d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/></svg>");
}

.ai-action--claude .ai-action__icon {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3v3M12 18v3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M3 12h3M18 12h3M5.6 18.4l2.1-2.1M16.3 7.7l2.1-2.1'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3v3M12 18v3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M3 12h3M18 12h3M5.6 18.4l2.1-2.1M16.3 7.7l2.1-2.1'/></svg>");
}

.ai-action--copy .ai-action__icon {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><rect x='9' y='9' width='13' height='13' rx='2' ry='2'/><path d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><rect x='9' y='9' width='13' height='13' rx='2' ry='2'/><path d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/></svg>");
}

.ai-action--copy {
  border-style: dashed;
}

.ai-action--copy.is-copied {
  border-style: solid;
  border-color: var(--color-success);
  color: var(--color-success);
}

.ai-action--copy.is-copied .ai-action__icon {
  background-color: var(--color-success);
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  opacity: 1;
}

.ai-action__feedback {
  display: none;
}

.ai-action--copy.is-copied .ai-action__label { display: none; }
.ai-action--copy.is-copied .ai-action__feedback { display: inline; }

@media screen and (max-width: 44em) {
  .ai-integrate { padding: var(--space-4); }
  .ai-action { width: 100%; justify-content: center; }
}

/* ============================================
   Platform cards — icon + title + short description
   Icons via CSS mask (responds to theme via currentColor on accent)
   ============================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
  margin: var(--space-4) 0 var(--space-6);
  padding: 0;
  border: none;
  background: none;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 0.95rem 1rem 0.9rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: none;
  transition: border-color 0.15s ease, background 0.15s ease;
  position: relative;
  min-height: 0;
}

.card:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-softer);
}

[data-md-color-scheme="slate"] .card:hover {
  background: rgba(196, 181, 253, 0.04);
}

/* Icon (masked SVG, colored with brand accent) */
.card::before {
  content: '';
  display: block;
  width: 22px;
  height: 22px;
  background-color: var(--color-accent);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: left center;
  mask-position: left center;
  -webkit-mask-size: 22px 22px;
  mask-size: 22px 22px;
  margin-bottom: 0.7rem;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.card:hover::before { opacity: 1; }

/* Per-card icons (assumes the typical 4-card platform grid + 2-card resources grid) */
/* Grid with 4+ cards = platforms */
.grid:has(.card:nth-child(4)) .card:nth-child(1)::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><polyline points='16 18 22 12 16 6'/><polyline points='8 6 2 12 8 18'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><polyline points='16 18 22 12 16 6'/><polyline points='8 6 2 12 8 18'/></svg>");
}
.grid:has(.card:nth-child(4)) .card:nth-child(2)::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><rect x='5' y='2' width='14' height='20' rx='2'/><line x1='12' y1='18' x2='12.01' y2='18'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><rect x='5' y='2' width='14' height='20' rx='2'/><line x1='12' y1='18' x2='12.01' y2='18'/></svg>");
}
.grid:has(.card:nth-child(4)) .card:nth-child(3)::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='3' width='20' height='14' rx='2'/><line x1='8' y1='21' x2='16' y2='21'/><line x1='12' y1='17' x2='12' y2='21'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='3' width='20' height='14' rx='2'/><line x1='8' y1='21' x2='16' y2='21'/><line x1='12' y1='17' x2='12' y2='21'/></svg>");
}
.grid:has(.card:nth-child(4)) .card:nth-child(4)::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><polygon points='13 2 3 14 12 14 11 22 21 10 12 10 13 2'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><polygon points='13 2 3 14 12 14 11 22 21 10 12 10 13 2'/></svg>");
}

/* Grid with fewer than 4 cards = secondary resources (Referência + Suporte) */
.grid:not(:has(.card:nth-child(4))) .card:nth-child(1)::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><path d='M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z'/><path d='M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><path d='M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z'/><path d='M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z'/></svg>");
}
.grid:not(:has(.card:nth-child(4))) .card:nth-child(2)::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><path d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><path d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/></svg>");
}

.card h3 {
  margin: 0 0 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-fg);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.card h3 .twemoji,
.card h3 svg { display: none; }

.card p:nth-of-type(1) {
  display: block;
  margin: 0;
  font-size: 0.74rem;
  color: var(--color-fg-muted);
  line-height: 1.5;
}

/* First link inside the card becomes a transparent overlay — entire card is clickable */
.card p:has(a) {
  display: block;
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  font-size: 0;
  line-height: 0;
  pointer-events: none;
}

.card p:has(a) a {
  display: block;
  width: 100%;
  height: 100%;
  font-size: 0;
  color: transparent !important;
  text-decoration: none !important;
  border: none !important;
  pointer-events: auto;
  cursor: pointer;
}

.card p:has(a) a ~ a { display: none; }

@media screen and (max-width: 60em) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media screen and (max-width: 40em) {
  .grid { grid-template-columns: 1fr; }
}

/* ============================================
   Hero (homepage)
   ============================================ */
.hero {
  text-align: left;
  padding: var(--space-10) 0 0;
  margin-bottom: 0;
}

/* Dividers around the AI-First panel — symmetric breathing room top/bottom */
.hero + hr,
.ai-integrate + hr,
.ai-integrate ~ hr:first-of-type {
  margin-top: var(--space-10);
  margin-bottom: var(--space-10);
  border-top-color: var(--color-border-strong);
}

/* Section header right after the hero / AI panel — give it room */
.content-justified > h2:first-of-type {
  margin-top: var(--space-6);
}

.hero h1 {
  font-family: var(--font-sans);
  font-size: 2.75rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0 0 var(--space-4);
  color: var(--color-fg) !important;
  -webkit-text-fill-color: var(--color-fg);
  background: none;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--color-fg-muted);
  max-width: 36rem;
  margin: 0 0 var(--space-6);
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-start;
  flex-wrap: wrap;
}

.hero-buttons a,
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.85rem;
  text-decoration: none !important;
  border: 1px solid transparent;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  white-space: nowrap;
  letter-spacing: -0.005em;
  min-width: 11rem;
  box-sizing: border-box;
}

/* Shared icon slot — same masked-SVG technique as the platform cards */
.hero-buttons a::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

/* Primary CTA — solid black/white, play icon */
.btn-primary {
  background: var(--color-fg);
  color: var(--color-bg) !important;
  border-color: var(--color-fg);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--color-fg) 88%, transparent);
  color: var(--color-bg) !important;
  border-color: transparent;
}

.hero-buttons a.btn-primary::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><polygon points='6 3 20 12 6 21 6 3'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><polygon points='6 3 20 12 6 21 6 3'/></svg>");
}

.hero-buttons a.btn-primary:hover::before {
  transform: translateX(2px);
}

/* Secondary outline — kept for completeness */
.btn-secondary {
  background: transparent;
  color: var(--color-fg) !important;
  border: 1px solid var(--color-border-strong);
}

.btn-secondary:hover {
  background: var(--color-bg-subtle);
  color: var(--color-fg) !important;
  border-color: var(--color-fg-muted);
}

/* Ghost button — now card-style: hairline border, accent on hover */
.hero-buttons a.btn-ghost,
.btn-ghost {
  background: var(--color-bg);
  color: var(--color-fg) !important;
  border: 1px solid var(--color-border);
  padding: 0.55rem 1rem;
}

.hero-buttons a.btn-ghost:hover,
.btn-ghost:hover {
  background: var(--color-accent-softer);
  color: var(--color-fg) !important;
  border-color: var(--color-accent);
}

[data-md-color-scheme="slate"] .hero-buttons a.btn-ghost:hover {
  background: rgba(196, 181, 253, 0.05);
}

.hero-buttons a.btn-ghost::before {
  background-color: var(--color-accent);
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><polygon points='16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><polygon points='16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76'/></svg>");
  opacity: 0.85;
}

.hero-buttons a.btn-ghost:hover::before {
  opacity: 1;
  transform: rotate(15deg);
}

/* ============================================
   Footer — refined two-tier layout
   ============================================ */
.md-footer {
  background: var(--color-bg);
  color: var(--color-fg-muted);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-12);
  position: relative;
  z-index: 4;
}

.md-footer-meta {
  position: relative;
  z-index: 4;
}

/* Stop the sticky primary sidebar from running past the content into the footer */
.md-sidebar--primary {
  max-height: 100vh;
}

/* Tier 1: prev/next as flanking hairline cards */
.md-footer__inner {
  padding: var(--space-6);
  background: transparent;
  display: flex;
  gap: var(--space-3);
  max-width: 1440px;
  margin: 0 auto;
}

.md-footer__link {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--color-fg);
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
  transition: border-color 0.15s ease, background 0.15s ease;
  opacity: 1;
  min-width: 0;
}

.md-footer__link:hover {
  color: var(--color-fg);
  background: var(--color-accent-softer);
  border-color: var(--color-accent);
  opacity: 1;
}

[data-md-color-scheme="slate"] .md-footer__link:hover {
  background: rgba(196, 181, 253, 0.05);
}

.md-footer__link--prev { text-align: left; }
.md-footer__link--next {
  text-align: right;
  flex-direction: row;
  justify-content: flex-end;
}

/* Arrow icon on each side */
.md-footer__button {
  flex-shrink: 0;
  color: var(--color-fg-faint);
  margin: 0;
  padding: 0;
  width: 22px;
  height: 22px;
  transition: color 0.15s ease, transform 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.md-footer__button svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.md-footer__link:hover .md-footer__button { color: var(--color-accent); }
.md-footer__link--prev:hover .md-footer__button { transform: translateX(-3px); }
.md-footer__link--next:hover .md-footer__button { transform: translateX(3px); }

.md-footer__title {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0;
  min-width: 0;
}

.md-footer__direction {
  color: var(--color-accent);
  opacity: 0.7;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font-mono);
  margin: 0;
  visibility: visible;
  position: static;
}

.md-footer__title .md-ellipsis,
.md-footer__title > div:not(.md-footer__direction) {
  color: var(--color-fg);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tier 2: meta (copyright + social) */
.md-footer-meta {
  background: var(--color-bg);
  color: var(--color-fg-faint);
  font-size: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.md-footer-meta__inner {
  border-top: none;
  padding: var(--space-3) var(--space-6);
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.md-copyright {
  color: var(--color-fg-faint);
  font-size: 0.72rem;
  letter-spacing: -0.005em;
  margin: 0;
  padding: 0;
  width: auto;
}

.md-copyright__highlight { color: var(--color-fg-muted); }

.md-copyright a {
  color: var(--color-fg-muted);
  text-decoration: none;
  border-bottom: none;
}

.md-copyright a:hover { color: var(--color-fg); }

/* Social icons */
.md-social {
  display: inline-flex;
  gap: 2px;
  padding: 0;
  margin: 0;
}

.md-social__link {
  color: var(--color-fg-muted);
  transition: color 0.12s ease, background 0.12s ease;
  width: 28px;
  height: 28px;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.md-social__link svg {
  fill: currentColor;
  width: 16px;
  height: 16px;
  max-height: 16px;
}

.md-social__link:hover {
  color: var(--color-fg);
  background: var(--color-bg-subtle);
  transform: none;
  opacity: 1;
}

@media screen and (max-width: 60em) {
  .md-footer__inner {
    flex-direction: column;
    padding: var(--space-4);
  }
  .md-footer__link--next { margin-left: 0; }
}

@media screen and (max-width: 44em) {
  .md-footer-meta__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
}

/* ============================================
   TOC (right sidebar)
   ============================================ */
.md-sidebar--secondary .md-nav__title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-fg-faint);
  font-weight: 600;
  background: transparent;
  box-shadow: none;
  padding: 0 0 var(--space-2);
}

.md-nav--secondary {
  border-left: none;
  padding-left: var(--space-4);
}

.md-nav--secondary .md-nav__list {
  border-left: 1px solid var(--color-border);
  padding-left: 0;
  margin-left: 0;
}

.md-nav--secondary .md-nav__link {
  font-size: 0.68rem;
  color: var(--color-fg-muted);
  padding: 0.24rem var(--space-3);
  border-left: 1px solid transparent;
  margin-left: -1px;
  font-weight: 400;
  border-radius: 0;
  transition: color 0.12s ease, border-color 0.12s ease;
  line-height: 1.5;
}

/* Top-level TOC entries (h2 sections) — bold + dark for hierarchy */
.md-nav--secondary > .md-nav__list > .md-nav__item > .md-nav__link {
  font-weight: 600;
  color: var(--color-fg);
  font-size: 0.72rem;
  letter-spacing: -0.005em;
}

.md-nav--secondary .md-nav__link:hover {
  color: var(--color-fg);
  background: transparent;
}

.md-nav--secondary .md-nav__link--active {
  color: var(--color-accent);
  font-weight: 500;
  border-left-color: var(--color-accent);
  background: transparent;
}

/* ============================================
   Search — collapsed trigger in header,
   centered modal when open
   ============================================ */
.md-search {
  margin-left: auto;
  position: static;
}

/* Trigger pill in the header (when closed) — always over graphite header */
.md-search__form {
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
  transition: border-color 0.15s ease, background 0.15s ease;
  position: relative;
}

.md-search__form:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.md-search__input {
  background: transparent;
  font-size: 0.82rem;
  font-family: var(--font-sans);
  color: #FAFAFA;
}

.md-search__input::placeholder {
  color: rgba(255, 255, 255, 0.45);
  font-weight: 400;
}

.md-search__input + .md-search__icon {
  color: rgba(255, 255, 255, 0.55);
}

.md-search__input:focus,
.md-search__input:focus + .md-search__icon {
  color: #FFFFFF;
}

/* Keyboard shortcut hint (⌘K / Ctrl+K) — only on the closed trigger */
.md-search__form::after {
  content: '⌘ K';
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.05em;
  pointer-events: none;
  line-height: 1;
}

@media screen and (max-width: 60em) {
  .md-search__form::after { display: none; }
}

/* Hide shortcut hint when search modal is open */
[data-md-toggle="search"]:checked ~ * .md-search__form::after,
.md-search[data-md-state="active"] .md-search__form::after {
  display: none;
}

/* ===== Centered modal — only when search is OPEN ===== */
/* Backdrop */
.md-search__overlay {
  background: rgba(9, 9, 11, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

[data-md-color-scheme="slate"] .md-search__overlay {
  background: rgba(0, 0, 0, 0.7);
}

/* Reposition .md-search__inner as a centered modal ONLY when toggle is checked */
#__search:checked ~ .md-header .md-search__inner {
  position: fixed;
  top: 12vh;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translateX(-50%);
  width: min(620px, 92vw);
  max-height: 70vh;
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  box-shadow:
    0 24px 60px -12px rgba(0, 0, 0, 0.22),
    0 8px 24px -8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 6;
}

[data-md-color-scheme="slate"] #__search:checked ~ .md-header .md-search__inner {
  background: var(--color-bg-card);
  box-shadow:
    0 24px 60px -12px rgba(0, 0, 0, 0.6),
    0 8px 24px -8px rgba(0, 0, 0, 0.4);
}

/* Modal-only form styling */
#__search:checked ~ .md-header .md-search__form {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  height: 52px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

#__search:checked ~ .md-header .md-search__form::after {
  display: none;
}

#__search:checked ~ .md-header .md-search__input {
  font-size: 0.95rem;
  height: 100%;
  padding: 0 1rem 0 2.75rem;
  border-radius: 0;
}

#__search:checked ~ .md-header .md-search__icon[for="__search"] {
  left: 0.85rem;
  width: 18px;
  height: 18px;
}

/* Results scroll area (only when modal is open) */
#__search:checked ~ .md-header .md-search__output {
  position: static;
  background: transparent;
  flex: 1;
  overflow-y: auto;
  max-height: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Result item styling — applies always when results render, but harmless when closed */
.md-search-result__meta {
  background: var(--color-bg-subtle);
  color: var(--color-fg-muted);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.75rem;
  padding: 0.5rem 1rem;
}

[data-md-color-scheme="slate"] .md-search-result__meta {
  background: rgba(255, 255, 255, 0.04);
}

.md-search-result__link {
  background: transparent;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.12s ease;
}

.md-search-result__link:hover,
.md-search-result__link[data-md-state="active"] {
  background: var(--color-accent-softer);
}

[data-md-color-scheme="slate"] .md-search-result__link:hover,
[data-md-color-scheme="slate"] .md-search-result__link[data-md-state="active"] {
  background: rgba(196, 181, 253, 0.06);
}

/* Result title + highlighted matches */
.md-search-result__title {
  color: var(--color-fg);
  font-weight: 600;
  font-size: 0.85rem;
}

.md-search-result__teaser {
  color: var(--color-fg-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.md-search-result mark,
.md-search-result__teaser mark,
.md-search-result__title mark {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-weight: 600;
  padding: 0.1em 0.25em;
  border-radius: 3px;
}

/* Dark theme — replace dim purple with bright/white for readability */
[data-md-color-scheme="slate"] .md-search-result__title {
  color: #FFFFFF;
  font-weight: 700;
}

[data-md-color-scheme="slate"] .md-search-result__teaser {
  color: rgba(255, 255, 255, 0.72);
}

[data-md-color-scheme="slate"] .md-search-result mark,
[data-md-color-scheme="slate"] .md-search-result__teaser mark,
[data-md-color-scheme="slate"] .md-search-result__title mark {
  background: rgba(196, 181, 253, 0.18);
  color: #FFFFFF;
  font-weight: 700;
}

@media screen and (max-width: 44em) {
  #__search:checked ~ .md-header .md-search__inner {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
  #__search:checked ~ .md-header .md-search__output { border-radius: 0; }
}

/* ============================================
   Tabs (pymdownx tabbed)
   ============================================ */
.md-typeset .tabbed-set {
  margin: var(--space-5) 0;
}

.md-typeset .tabbed-labels {
  border-bottom: 1px solid var(--color-border);
  gap: 0;
}

.md-typeset .tabbed-labels > label {
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--color-fg-muted);
  padding: var(--space-3) var(--space-4);
  margin-right: 0;
  letter-spacing: -0.005em;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.md-typeset .tabbed-labels > label:hover { color: var(--color-fg); }

.md-typeset .tabbed-set > input:checked + label {
  color: var(--color-fg);
  border-color: var(--color-fg);
  font-weight: 600;
}

.md-typeset .tabbed-content { padding: var(--space-4) 0 0; }

/* ============================================
   Mermaid Diagrams
   ============================================ */
.mermaid {
  background: var(--color-bg-card) !important;
  text-align: center;
  margin: var(--space-5) 0;
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

/* ============================================
   Platform flow — theme-aware HTML/CSS diagram
   (Parceiro → Cliente → Filial/Plano → Licença → Paciente)
   ============================================ */
.platform-flow {
  margin: var(--space-6) 0;
  padding: var(--space-8) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
  overflow-x: auto;
}

.platform-flow .flow-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-family: var(--font-sans);
}

.platform-flow .flow-step {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-fg);
  background: var(--color-bg);
  white-space: nowrap;
  letter-spacing: -0.005em;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.platform-flow .flow-step:hover {
  border-color: var(--color-accent);
}

/* Terminal node (Paciente) — filled with brand purple */
.platform-flow .flow-step--terminal {
  background: var(--color-accent);
  color: #FFFFFF;
  border-color: var(--color-accent);
  font-weight: 600;
}

[data-md-color-scheme="slate"] .platform-flow .flow-step--terminal {
  color: #0A0A0A;
}

/* Stacked branch (Filial / Plano) */
.platform-flow .flow-step-group {
  display: inline-flex;
  flex-direction: column;
  gap: 0.35rem;
}

.platform-flow .flow-arrow {
  color: var(--color-fg-faint);
  font-size: 1rem;
  font-family: var(--font-mono);
  line-height: 1;
  user-select: none;
}

@media screen and (max-width: 60em) {
  .platform-flow {
    padding: var(--space-5) var(--space-3);
  }
  .platform-flow .flow-row {
    flex-direction: column;
    gap: var(--space-2);
  }
  .platform-flow .flow-arrow {
    transform: rotate(90deg);
  }
}

/* ============================================
   Page entrance animation
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
  .md-main {
    animation: page-fade 0.35s ease-out;
  }
}

@keyframes page-fade {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Scrollbars — show only when content actually overflows
   ============================================ */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-strong) transparent;
}

/* Material reserves a permanent gutter on sidebars; release it so the
   track only shows when the content is actually scrollable */
.md-sidebar__scrollwrap,
.md-sidebar--primary .md-sidebar__scrollwrap,
.md-sidebar--secondary .md-sidebar__scrollwrap {
  scrollbar-gutter: auto;
  overflow-y: auto;
}

/* Don't reserve a gutter on the page's root scroller either */
html { scrollbar-gutter: auto; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*:hover > ::-webkit-scrollbar-thumb,
::-webkit-scrollbar:hover > ::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-fg-muted);
  background-clip: padding-box;
}
/* Always-visible thumb on the main viewport (so users see they can scroll) */
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
}

/* ============================================
   Selection
   ============================================ */
::selection {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

[data-md-color-scheme="slate"] ::selection {
  background: var(--color-accent-soft);
  color: var(--color-fg);
}

/* ============================================
   Responsive
   ============================================ */
@media screen and (max-width: 76.25em) {
  .md-content__inner {
    padding: var(--space-8) var(--space-6);
  }

  .hero { padding: var(--space-10) 0 var(--space-8); }
  .hero h1 { font-size: 2.25rem; }
  .hero-subtitle { font-size: 0.95rem; }

  .md-header__inner { padding: 0 var(--space-4); gap: var(--space-4); }
}

@media screen and (max-width: 60em) {
  .md-typeset h1 { font-size: 1.625rem; }

  .grid { grid-template-columns: 1fr; }

  .hero h1 { font-size: 1.875rem; }

  .md-header__brand-divider,
  .md-header__brand-suffix { display: none; }

  .md-search__form { width: auto; }

  .md-header-nav__item {
    padding: 0.4rem 0.55rem;
    font-size: 0.78rem;
  }
}

/* ============================================
   Print
   ============================================ */
@media print {
  .md-header,
  .md-footer,
  .md-sidebar { display: none !important; }
  .md-content { margin: 0 !important; }
}

/* ============================================
   Accessibility
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ============================================
   Postman download button (header)
   ============================================ */
.md-header__postman {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(255, 108, 55, 0.25);
  border-radius: var(--radius-md);
  color: rgba(255, 108, 55, 0.6) !important;
  text-decoration: none !important;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font-sans);
  letter-spacing: -0.005em;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.md-header__postman:hover {
  color: rgba(255, 108, 55, 0.8) !important;
  border-color: rgba(255, 108, 55, 0.35);
  background: rgba(255, 108, 55, 0.05);
}

.md-header__postman-icon {
  display: inline-block;
  width: 13px;
  height: 13px;
  background-color: currentColor;
  flex-shrink: 0;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/><polyline points='7 10 12 15 17 10'/><line x1='12' y1='15' x2='12' y2='3'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/><polyline points='7 10 12 15 17 10'/><line x1='12' y1='15' x2='12' y2='3'/></svg>");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
}

@media screen and (max-width: 60em) {
  .md-header__postman-label { display: none; }
  .md-header__postman { padding: 0.3rem; border: none; }
  .md-header__postman-icon { width: 18px; height: 18px; }
}

/* ============================================
   Theme switching — direct body overrides
   CSS vars + background-attachment:fixed can
   skip repaints on toggle; these rules force it.
   ============================================ */
body[data-md-color-scheme="default"] {
  background-color: #FCFCFD;
  color: #09090B;
  --color-bg: #FCFCFD;
  --color-bg-subtle: #F4F4F5;
  --color-bg-card: #FFFFFF;
  --color-fg: #09090B;
  --color-fg-muted: #52525B;
  --color-fg-faint: #A1A1AA;
  --color-accent: #2A0050;
  --color-accent-hover: #3A0070;
  --color-accent-soft: rgba(42, 0, 80, 0.06);
  --color-accent-softer: rgba(42, 0, 80, 0.03);
  --color-border: rgba(9, 9, 11, 0.08);
  --color-border-strong: rgba(9, 9, 11, 0.14);
  --pattern-color: rgba(42, 0, 80, 0.04);
}

body[data-md-color-scheme="slate"] {
  background-color: #0A0A0A;
  color: #FAFAFA;
  --color-bg: #0A0A0A;
  --color-bg-subtle: #131316;
  --color-bg-card: #131316;
  --color-fg: #FAFAFA;
  --color-fg-muted: #A1A1AA;
  --color-fg-faint: #52525B;
  --color-accent: #C4B5FD;
  --color-accent-hover: #DDD6FE;
  --color-accent-soft: rgba(196, 181, 253, 0.1);
  --color-accent-softer: rgba(196, 181, 253, 0.05);
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.14);
  --pattern-color: rgba(255, 255, 255, 0.035);
}

[data-md-color-scheme="default"] .md-typeset {
  color: #09090B;
}

[data-md-color-scheme="slate"] .md-typeset {
  color: #FAFAFA;
}
