/* XGuardian Docs — interface isolada da central compartilhada */
:root {
  --xg-purple-950: #1c0d3b;
  --xg-purple-900: #2c1161;
  --xg-purple-800: #3f1f7a;
  --xg-purple-700: #5830a8;
  --xg-purple-600: #6d3fd0;
  --xg-purple-500: #844cf2;
  --xg-purple-400: #a172ff;
  --xg-violet: #7b66d4;
  --xg-pink: #bb6acb;
  --xg-green: #1f9d72;
  --xg-amber: #c77b18;
  --xg-red: #c84b5b;
  --xg-gradient: var(--xg-purple-700);
  --bg: #f8f8fb;
  --surface: #ffffff;
  --surface-2: #f3f1f7;
  --surface-3: #ebe7f1;
  --text: #221c2b;
  --text-strong: #17121f;
  --muted: #6e6678;
  --border: #e3dfea;
  --border-strong: #d6d0df;
  --shadow-sm: 0 1px 2px rgba(28, 13, 59, .04);
  --shadow-md: 0 12px 32px rgba(28, 13, 59, .11);
  --header-height: 64px;
  --sidebar-width: 286px;
  --toc-width: 225px;
  --content-width: 780px;
  --xg-content-max-width: 780px;
  --xg-radius-sm: 8px;
  --xg-radius-md: 12px;
  --xg-radius-lg: 18px;
  --radius-sm: var(--xg-radius-sm);
  --radius: var(--xg-radius-md);
  --radius-lg: var(--xg-radius-lg);
  --xg-space-1: 4px;
  --xg-space-2: 8px;
  --xg-space-3: 12px;
  --xg-space-4: 16px;
  --xg-space-6: 24px;
  --xg-text-body: 15px;
  --xg-text-muted: #6e6678;
  --focus: 0 0 0 3px rgba(132, 76, 242, .28);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #100d16;
  --surface: #18131f;
  --surface-2: #201927;
  --surface-3: #2a2133;
  --text: #e8e3ed;
  --text-strong: #ffffff;
  --muted: #aaa0b5;
  --border: #332a3d;
  --border-strong: #443650;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.18);
  --shadow-md: 0 14px 38px rgba(0,0,0,.32);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 20px); }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Montserrat", Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--xg-text-body);
  line-height: 1.68;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
a { color: var(--xg-purple-700); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--xg-purple-500); }
html[data-theme="dark"] a { color: #b89afc; }
img { max-width: 100%; }
svg { display: block; }
::selection { background: rgba(132, 76, 242, .24); }

.sr-only { position: absolute!important; width: 1px!important; height: 1px!important; padding: 0!important; margin: -1px!important; overflow: hidden!important; clip: rect(0,0,0,0)!important; white-space: nowrap!important; border: 0!important; }
.skip-link { position: fixed; z-index: 9999; top: 10px; left: 10px; transform: translateY(-150%); background: var(--surface); color: var(--text-strong); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-md); }
.skip-link:focus { transform: none; }

/* Header */
.site-header { position: sticky; z-index: 1000; top: 0; height: var(--header-height); border-bottom: 1px solid color-mix(in srgb, var(--border) 82%, transparent); background: color-mix(in srgb, var(--surface) 91%, transparent); backdrop-filter: blur(18px) saturate(150%); }
.site-header__inner { height: 100%; max-width: 1660px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: var(--sidebar-width) minmax(260px, 560px) 1fr; gap: 24px; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text-strong)!important; text-decoration: none; width: max-content; }
.brand img { object-fit: contain; }
.brand__text { display: flex; align-items: baseline; gap: 7px; line-height: 1; }
.brand__text strong { font-size: 17px; letter-spacing: -.02em; }
.brand__text small { color: var(--muted); font-size: 13px; font-weight: 650; }
.header-search, .sidebar-search { border: 1px solid var(--border); color: var(--muted); background: var(--surface-2); border-radius: 12px; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.header-search { width: 100%; height: 40px; padding: 0 11px; }
.header-search:hover, .sidebar-search:hover { border-color: var(--xg-purple-400); background: var(--surface); }
.header-search svg, .sidebar-search svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.header-search span { flex: 1; text-align: left; }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.header-link { color: var(--muted)!important; text-decoration: none; font-size: 13px; font-weight: 650; padding: 8px 10px; border-radius: 9px; white-space: nowrap; }
.header-link:hover { color: var(--text-strong)!important; background: var(--surface-2); }
.header-link--portal { border: 1px solid var(--border); color: var(--xg-purple-700)!important; background: var(--surface); }
html[data-theme="dark"] .header-link--portal { color: #c9b3ff!important; }
.icon-button { width: 39px; height: 39px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.icon-button:hover { color: var(--text-strong); background: var(--surface-2); border-color: var(--border); }
.icon-button:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible { outline: none; box-shadow: var(--focus); }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
html[data-theme="dark"] .icon-sun, html[data-theme="light"] .icon-moon { display: none; }
.mobile-menu-button { display: none; }

/* Layout */
.docs-shell { max-width: 1660px; margin: 0 auto; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, var(--content-width)) var(--toc-width); justify-content: center; gap: 40px; padding: 0 24px; min-height: calc(100vh - var(--header-height)); }
.sidebar { position: sticky; top: var(--header-height); height: calc(100vh - var(--header-height)); overflow: auto; padding: 24px 12px 40px 0; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.sidebar__top { display: none; }
.docs-nav { display: grid; gap: 5px; }
.docs-nav__home, .docs-nav__items a { display: flex; align-items: center; min-height: 35px; padding: 7px 10px; border-radius: 9px; color: var(--muted)!important; text-decoration: none; font-size: 13px; line-height: 1.35; }
.docs-nav__home { color: var(--text-strong)!important; font-weight: 650; }
.docs-nav__items a:hover, .docs-nav__home:hover { background: var(--surface-2); color: var(--text-strong)!important; }
.docs-nav__items a.is-active, .docs-nav__home.is-active { background: rgba(132,76,242,.1); color: var(--xg-purple-700)!important; font-weight: 650; box-shadow: inset 2px 0 0 var(--xg-purple-500); }
html[data-theme="dark"] .docs-nav__items a.is-active, html[data-theme="dark"] .docs-nav__home.is-active { color: #cebaff!important; }
.docs-nav__section { border-top: 1px solid var(--border); padding-top: 5px; margin-top: 5px; }
.docs-nav__section summary { list-style: none; cursor: pointer; min-height: 38px; display: flex; justify-content: space-between; align-items: center; padding: 8px 9px; color: var(--text-strong); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .055em; border-radius: 8px; }
.docs-nav__section summary::-webkit-details-marker { display: none; }
.docs-nav__section summary:hover { background: var(--surface-2); }
.docs-nav__section summary svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; transition: transform .18s ease; }
.docs-nav__section[open] > summary svg { transform: rotate(180deg); }
.docs-nav__items { display: grid; gap: 1px; padding: 0 0 7px 5px; }
.docs-nav__subsection { margin: 2px 0 5px 0; }
.docs-nav__subsection summary { list-style: none; cursor: pointer; min-height: 35px; display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.35; text-transform: none; letter-spacing: 0; }
.docs-nav__subsection summary::-webkit-details-marker { display: none; }
.docs-nav__subsection summary:hover { background: transparent; color: var(--text-strong); }
.docs-nav__subsection summary:focus-visible { outline: 2px solid rgba(132,76,242,.35); outline-offset: 2px; }
.docs-nav__subsection summary svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.8; transition: transform .18s ease; }
.docs-nav__subsection[open] summary { background: transparent; color: var(--text-strong); }
.docs-nav__subsection[open] > summary svg { transform: rotate(180deg); }
.docs-nav__subitems { display: grid; gap: 2px; margin: 0 0 7px 16px; padding-left: 6px; border-left: 0; }
.docs-nav__subitems a { min-height: 31px; padding-left: 9px; font-size: 12.5px; border-radius: 7px; color: var(--muted)!important; }
.docs-nav__subitems a.is-active { box-shadow: none; }
.sidebar__footer { margin-top: 24px; padding: 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.sidebar__footer a { font-weight: 650; text-decoration: none; }
.main-content { min-width: 0; padding: 26px 0 80px; }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-height: 30px; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.breadcrumbs a { color: var(--muted)!important; text-decoration: none; }
.breadcrumbs a:hover { color: var(--text-strong)!important; }
.breadcrumbs > span:last-child { color: var(--text); }
.page-meta { margin-bottom: -2px; }
.page-meta__labels { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--muted); font-size: 11.5px; }
.page-meta__labels > span + span::before { content: ""; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); margin: 0 9px 2px 0; }

/* Article typography */
.doc-article { min-width: 0; }
.doc-article > h1:first-of-type, .doc-article > span + h1 { margin-top: 12px; }
.doc-article h1 { color: var(--text-strong); font-size: clamp(1.9rem, 3.5vw, 2.65rem); letter-spacing: -.04em; line-height: 1.12; margin: 20px 0 18px; max-width: 720px; }
.doc-article h2 { color: var(--text-strong); font-size: clamp(1.35rem, 2vw, 1.62rem); letter-spacing: -.024em; line-height: 1.22; margin: 46px 0 15px; padding-top: 6px; }
.doc-article h3 { color: var(--text-strong); font-size: 1.08rem; letter-spacing: -.012em; line-height: 1.35; margin: 30px 0 10px; }
.doc-article h4 { color: var(--text-strong); font-size: 1rem; margin: 28px 0 10px; }
.doc-article p { margin: 0 0 18px; }
.doc-article > p:first-of-type { color: var(--muted); font-size: 1.06rem; line-height: 1.75; }
.doc-article strong { color: var(--text-strong); font-weight: 650; }
.doc-article ul, .doc-article ol { padding-left: 1.35rem; margin: 0 0 20px; }
.doc-article li { margin: 6px 0; padding-left: .25rem; }
.doc-article li::marker { color: var(--xg-purple-500); font-weight: 700; }
.doc-article hr { border: 0; border-top: 1px solid var(--border); margin: 44px 0; }
.doc-article blockquote { margin: 24px 0; padding: 15px 18px; border-left: 3px solid var(--xg-purple-500); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--muted); }
.doc-article blockquote > :last-child { margin-bottom: 0; }
.doc-article mark { background: rgba(187,106,203,.18); color: var(--text-strong); border-radius: 4px; padding: 0 3px; }
.doc-article code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .86em; padding: .16em .38em; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: color-mix(in srgb, var(--xg-purple-700) 76%, var(--text)); overflow-wrap: anywhere; }
html[data-theme="dark"] .doc-article code { color: #d2c1ff; }
pre { position: relative; margin: 22px 0; border: 1px solid var(--border); border-radius: 14px; overflow: auto; background: #17121f; color: #eee7f5; box-shadow: var(--shadow-sm); }
pre code { display: block; border: 0!important; padding: 20px!important; background: transparent!important; color: inherit!important; font-size: 13px!important; line-height: 1.7; white-space: pre; overflow-wrap: normal!important; }
.code-copy { position: absolute; top: 9px; right: 9px; border: 1px solid #43364e; background: #241c2d; color: #cfc4da; border-radius: 8px; padding: 5px 9px; font-size: 11px; cursor: pointer; opacity: .2; transition: opacity .15s ease; }
pre:hover .code-copy, .code-copy:focus-visible { opacity: 1; }
.doc-article table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 24px 0 30px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; font-size: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
.doc-article th { background: var(--surface-2); color: var(--text-strong); text-align: left; font-size: 12px; letter-spacing: .02em; }
.doc-article th, .doc-article td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc-article tr:last-child td { border-bottom: 0; }
.doc-article tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 65%, transparent); }
.doc-article input[type="checkbox"] { accent-color: var(--xg-purple-600); }

/* Callouts */
.xg-callout { margin: 24px 0; padding: 16px 17px 15px 19px; border: 1px solid var(--border); border-left-width: 4px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.xg-callout__title { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; color: var(--text-strong); font-weight: 800; }
.xg-callout__title::before { content: "i"; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: currentColor; color: white; font-size: 12px; font-family: Georgia, serif; font-weight: 800; }
.xg-callout > :last-child { margin-bottom: 0; }
.xg-callout--info, .xg-callout--note { border-left-color: var(--xg-purple-500); background: color-mix(in srgb, var(--surface) 92%, var(--xg-purple-500)); }
.xg-callout--warning { border-left-color: var(--xg-amber); background: color-mix(in srgb, var(--surface) 94%, var(--xg-amber)); }
.xg-callout--warning .xg-callout__title { color: #986015; }
.xg-callout--danger, .xg-callout--failure { border-left-color: var(--xg-red); background: color-mix(in srgb, var(--surface) 94%, var(--xg-red)); }
.xg-callout--danger .xg-callout__title, .xg-callout--failure .xg-callout__title { color: #a33d4b; }
.xg-callout--success { border-left-color: var(--xg-green); background: color-mix(in srgb, var(--surface) 94%, var(--xg-green)); }
.xg-callout--success .xg-callout__title { color: #157453; }
html[data-theme="dark"] .xg-callout--warning .xg-callout__title { color: #f0bd74; }
html[data-theme="dark"] .xg-callout--danger .xg-callout__title, html[data-theme="dark"] .xg-callout--failure .xg-callout__title { color: #f2a0aa; }
html[data-theme="dark"] .xg-callout--success .xg-callout__title { color: #7dddbb; }

/* Images and media */
.doc-article figure { margin: 28px 0 34px; }
.doc-article figcaption { margin-top: 9px; color: var(--muted); font-size: 12px; text-align: center; line-height: 1.5; }
.xg-image-button { width: 100%; display: block; padding: 0; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; cursor: zoom-in; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.xg-image-button:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--xg-purple-500) 45%, var(--border)); box-shadow: var(--shadow-md); }
.xg-image-button img { display: block; width: auto; max-width: 100%; max-height: 720px; margin: 0 auto; object-fit: contain; }
.xguardian-screenshot-grid, .xg-screenshot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 26px 0; }
.xguardian-screenshot-grid > .xguardian-screenshot--wide, .xg-screenshot-grid > .xg-screenshot--wide { grid-column: 1 / -1; }
.xguardian-screenshot-grid figure, .xg-screenshot-grid figure { margin: 0; }
.lightbox { width: min(94vw, 1380px); max-width: none; border: 1px solid var(--border); border-radius: 18px; padding: 18px; background: var(--surface); color: var(--text); box-shadow: 0 30px 100px rgba(0,0,0,.5); }
.lightbox::backdrop, .search-dialog::backdrop { background: rgba(14,10,20,.68); backdrop-filter: blur(6px); }
.lightbox img { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto; object-fit: contain; border-radius: 10px; }
.lightbox p { margin: 12px auto 0; max-width: 900px; text-align: center; color: var(--muted); }
.lightbox__close { position: absolute; z-index: 2; top: 10px; right: 10px; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text); font-size: 23px; cursor: pointer; box-shadow: var(--shadow-sm); }

/* Home */
.doc-article--home { max-width: 980px; }
.is-home .docs-shell { grid-template-columns: var(--sidebar-width) minmax(0, 980px); }
.is-home .main-content { padding-top: 22px; }
.xg-page-theme { display: none; }
.xg-hero { padding: clamp(28px, 5vw, 52px); border: 1px solid var(--border); border-radius: var(--xg-radius-lg); background: var(--surface); }
.xg-hero__content { max-width: 720px; }
.xg-hero__identity { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 650; }
.xg-hero__identity img { display: block; }
.xg-kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--xg-purple-700); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .12em; }
.xg-kicker::before { content: ""; width: 20px; height: 2px; background: var(--xg-gradient); border-radius: 2px; }
html[data-theme="dark"] .xg-kicker { color: #cdb5ff; }
.xg-hero h1 { max-width: 680px; margin: 16px 0!important; font-size: clamp(2.1rem, 4.6vw, 3.25rem)!important; letter-spacing: -.05em!important; }
.xg-hero p { max-width: 650px; color: var(--muted); font-size: 1rem!important; line-height: 1.7; }
.xg-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 0; }
.xg-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; border-radius: var(--xg-radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-strong)!important; font-weight: 650; font-size: 13px; text-decoration: none; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.xg-button:hover { border-color: var(--xg-purple-400); background: var(--surface-2); }
.xg-button--primary { color: white!important; border-color: var(--xg-purple-700); background: var(--xg-purple-700); }
.xg-button--primary:hover { background: var(--xg-purple-800); }
.xg-button--secondary { background: var(--surface); }
.xg-hero__meta { display: flex; flex-wrap: wrap; gap: 11px 22px; color: var(--muted); font-size: 11.5px; }
.xg-hero__meta span { display: flex; align-items: center; gap: 7px; }
.xg-hero__meta strong { font-size: 12px; color: var(--text-strong); }
.xg-hero__visual { position: relative; min-height: 330px; display: grid; place-items: center; }
.xg-status-strip { margin: 18px 0 42px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px 14px; padding: 12px 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 12px; box-shadow: var(--shadow-sm); }
.xg-status-strip strong { color: var(--text-strong); }.xg-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--xg-green); box-shadow: 0 0 0 4px rgba(31,157,114,.12); }
.xg-path-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin: 20px 0 50px; }
.xg-path-card { min-height: 158px; display: flex; flex-direction: column; gap: 9px; padding: 18px; border: 1px solid var(--border); border-radius: var(--xg-radius-md); background: var(--surface); color: var(--text)!important; text-decoration: none; transition: border-color .15s ease, background-color .15s ease; }
.xg-path-card:hover { border-color: rgba(132,76,242,.55); background: var(--surface-2); }
.xg-path-card > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--xg-purple-700); font-size: 11px; font-weight: 850; }
.xg-path-card strong { margin-top: 9px; font-size: 15px; }.xg-path-card small { color: var(--muted); font-size: 12px; line-height: 1.55; }
.xg-capability-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin: 20px 0 50px; }
.xg-capability-grid article { padding: 20px; border: 1px solid var(--border); border-radius: var(--xg-radius-md); background: var(--surface); }
.xg-capability-grid h3 { margin: 0 0 8px!important; }.xg-capability-grid p { min-height: 72px; color: var(--muted); font-size: 12.5px; }.xg-capability-grid a { font-size: 12px; font-weight: 650; text-decoration: none; }
.xg-flow, .xguardian-flow { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; margin: 20px 0 50px; }
.xg-flow > div, .xguardian-flow > div { position: relative; min-height: 145px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.xg-flow > div:not(:last-child)::after, .xguardian-flow > div:not(:last-child)::after { content: "→"; position: absolute; z-index: 2; top: 31px; right: -16px; width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--bg); color: var(--xg-purple-500); font-size: 11px; }
.xg-flow span, .xguardian-flow span { color: var(--xg-purple-600); font-size: 11px; font-weight: 850; }.xg-flow strong, .xguardian-flow strong { display: block; margin: 13px 0 6px; font-size: 13px; }.xg-flow small, .xguardian-flow small { color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.xg-role-grid, .xguardian-persona-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin: 20px 0 46px; }
.xg-role-grid article, .xguardian-persona-grid article { padding: 22px; border: 1px solid var(--border); border-radius: 17px; background: var(--surface); }
.xg-role-grid article > span, .xguardian-persona-grid article > span { color: var(--xg-purple-600); font-size: 10.5px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }.xg-role-grid h3, .xguardian-persona-grid strong { display: block; margin: 10px 0!important; font-size: 16px; }.xg-role-grid p, .xguardian-persona-grid p { color: var(--muted); font-size: 12.5px; min-height: 68px; }.xg-role-grid a, .xguardian-persona-grid a { font-size: 12px; font-weight: 750; text-decoration: none; }

/* Reusable cards from migrated content */
.xg-card-grid, .xmart-card-grid, .xg-next-grid, .xguardian-next-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin: 22px 0 32px; }
.xg-card-grid--three, .xmart-card-grid--three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.xg-card, .xmart-card, .xguardian-next-card, .xg-next-card { display: flex; flex-direction: column; gap: 8px; min-height: 130px; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text)!important; text-decoration: none; box-shadow: var(--shadow-sm); }
.xg-card:hover, .xmart-card:hover, .xguardian-next-card:hover, .xg-next-card:hover { border-color: rgba(132,76,242,.4); transform: translateY(-2px); }
.xg-card strong, .xmart-card h3, .xguardian-next-card strong, .xg-next-card strong { color: var(--text-strong); }.xg-card span, .xmart-card p, .xguardian-next-card small, .xg-next-card small { color: var(--muted); font-size: 12.5px; }
.xg-card__icon, .xmart-card__icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--xg-gradient); color: white; }
.xguardian-process, .xg-process { display: grid; gap: 12px; margin: 24px 0; }
.xguardian-process__step, .xg-process__step { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; padding: 16px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.xguardian-process__step > span, .xg-process__step > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--xg-purple-600); font-weight: 800; }
.xguardian-path-grid, .xg-path-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.xguardian-path-card, .xg-path-card { text-decoration: none; }

/* TOC */
.toc-panel { position: sticky; top: calc(var(--header-height) + 25px); align-self: start; max-height: calc(100vh - var(--header-height) - 50px); overflow: auto; padding: 7px 0 18px 19px; border-left: 1px solid var(--border); scrollbar-width: thin; }
.toc-panel > strong { display: block; margin-bottom: 10px; color: var(--text-strong); font-size: 12px; }
.toc-panel nav { display: grid; gap: 2px; }
.toc-panel nav a { padding: 5px 7px; border-radius: 7px; color: var(--muted)!important; text-decoration: none; font-size: 11.5px; line-height: 1.38; }
.toc-panel nav a:hover, .toc-panel nav a.is-active { color: var(--xg-purple-700)!important; background: var(--surface-2); }
html[data-theme="dark"] .toc-panel nav a.is-active { color: #cbb3ff!important; }
.toc-level-3 { padding-left: 18px!important; }.toc-level-4 { padding-left: 29px!important; }
.toc-edit { display: inline-flex; margin-top: 17px; padding-top: 13px; border-top: 1px solid var(--border); color: var(--muted)!important; font-size: 11px; text-decoration: none; }

/* Feedback / pagination */
.article-feedback { margin: 60px 0 28px; padding: 22px; border: 1px solid var(--border); border-radius: 17px; background: linear-gradient(145deg, var(--surface), var(--surface-2)); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.article-feedback h2 { margin: 6px 0 2px; font-size: 18px; }.article-feedback p { margin: 0; color: var(--muted); font-size: 11.5px; }.article-feedback__actions { display: flex; gap: 8px; }.article-feedback__actions button { min-width: 65px; height: 36px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); cursor: pointer; }.article-feedback__actions button:hover { border-color: var(--xg-purple-400); color: var(--xg-purple-700); }
.page-pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
.page-pagination a { min-height: 92px; display: flex; flex-direction: column; justify-content: center; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text)!important; text-decoration: none; box-shadow: var(--shadow-sm); }
.page-pagination a:hover { border-color: rgba(132,76,242,.44); transform: translateY(-2px); }.page-pagination__next { text-align: right; }.page-pagination span { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }.page-pagination strong { margin-top: 4px; font-size: 13px; }

/* Search */
.search-dialog { width: min(720px, calc(100vw - 28px)); max-width: none; max-height: min(720px, 82vh); padding: 0; border: 1px solid var(--border); border-radius: 17px; background: var(--surface); color: var(--text); box-shadow: 0 32px 110px rgba(0,0,0,.5); overflow: hidden; }
.search-dialog__header { display: grid; grid-template-columns: 25px 1fr auto; align-items: center; gap: 10px; padding: 14px 15px; border-bottom: 1px solid var(--border); }
.search-dialog__header svg { width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 1.8; }.search-dialog__header input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text-strong); font-size: 16px; }.search-dialog__header button { border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: 10px; padding: 4px 7px; cursor: pointer; }
.search-dialog__body { min-height: 290px; max-height: 560px; overflow: auto; padding: 9px; }
.search-empty { min-height: 270px; display: grid; place-content: center; text-align: center; color: var(--muted); }.search-empty strong { color: var(--text-strong); }.search-empty span { font-size: 12px; }
.search-result { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 13px; border-radius: 11px; color: var(--text)!important; text-decoration: none; }.search-result:hover, .search-result.is-selected { background: var(--surface-2); }.search-result strong { display: block; font-size: 13px; }.search-result p { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; }.search-result span { align-self: start; padding: 2px 7px; border-radius: 999px; background: rgba(132,76,242,.1); color: var(--xg-purple-700); font-size: 9.5px; font-weight: 750; }.search-result mark { background: rgba(132,76,242,.19); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-dialog__footer { display: flex; gap: 18px; padding: 9px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 9.5px; }

/* Footer / utility */
.site-footer { max-width: 1660px; margin: 0 auto; padding: 32px 24px 36px calc(var(--sidebar-width) + 64px); border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; gap: 14px 30px; color: var(--muted); }
.site-footer p { margin: 6px 0 0; font-size: 11.5px; }.brand--footer .brand__text strong { font-size: 14px; }.brand--footer .brand__text small { font-size: 11px; }.site-footer__links { display: flex; align-items: start; gap: 18px; }.site-footer__links a { color: var(--muted)!important; text-decoration: none; font-size: 11.5px; }.site-footer > small { grid-column: 1 / -1; font-size: 10.5px; }
.toast { position: fixed; z-index: 2000; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-md); font-size: 12px; transition: opacity .18s ease, transform .18s ease; }.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.back-to-top { position: fixed; z-index: 300; right: 20px; bottom: 20px; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); color: var(--text); cursor: pointer; box-shadow: var(--shadow-sm); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .18s ease; }.back-to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.mobile-overlay { position: fixed; z-index: 980; inset: var(--header-height) 0 0; background: rgba(10,7,14,.52); backdrop-filter: blur(3px); }
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }.error-page main { max-width: 620px; text-align: center; }.error-page img { filter: none; }.error-page h1 { margin: 15px 0 10px; font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -.045em; }.error-page p { color: var(--muted); }.error-page main > div { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* Responsive */
@media (max-width: 1320px) {
  .docs-shell { grid-template-columns: var(--sidebar-width) minmax(0, var(--content-width)); max-width: 1230px; }
  .toc-panel { display: none; }
  .is-home .docs-shell { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
}
@media (max-width: 1000px) {
  .site-header__inner { grid-template-columns: 1fr minmax(240px, 460px) auto; padding: 0 18px; }
  .header-link { display: none; }
  .docs-shell, .is-home .docs-shell { display: block; max-width: 930px; padding: 0 20px; }
  .sidebar { position: fixed; z-index: 990; top: var(--header-height); left: 0; width: min(340px, 88vw); height: calc(100vh - var(--header-height)); padding: 16px 14px 30px; background: var(--surface); border-right: 1px solid var(--border); box-shadow: var(--shadow-md); transform: translateX(-105%); transition: transform .22s ease; }
  .sidebar.is-open { transform: none; }
  .sidebar__top { display: block; margin-bottom: 12px; }.sidebar-search { width: 100%; padding: 10px 12px; }
  .mobile-menu-button { display: grid; }
  .main-content { max-width: var(--content-width); margin: 0 auto; }
  .site-footer { padding-left: 24px; }
  .xg-hero { padding: 38px; }
  .xg-path-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.xg-flow, .xguardian-flow { grid-template-columns: repeat(3,minmax(0,1fr)); }.xg-flow > div:nth-child(3)::after, .xguardian-flow > div:nth-child(3)::after { display: none; }
}
@media (max-width: 720px) {
  :root { --header-height: 62px; }
  .site-header__inner { grid-template-columns: 1fr auto; padding: 0 12px; gap: 8px; }.header-search { display: none; }.brand img { width: 33px; height: 33px; }.brand__text strong { font-size: 15px; }.brand__text small { font-size: 11px; }.header-actions { gap: 2px; }
  .docs-shell, .is-home .docs-shell { padding: 0 15px; }.main-content { padding-top: 18px; padding-bottom: 55px; }.breadcrumbs { font-size: 10.5px; }.page-meta__labels { font-size: 10.5px; }
  .doc-article h1 { font-size: 2.25rem; }.doc-article h2 { margin-top: 42px; }.doc-article table { display: block; overflow-x: auto; white-space: normal; }.doc-article th, .doc-article td { min-width: 145px; }
  .xg-hero { padding: 28px 22px; border-radius: 16px; }.xg-hero h1 { font-size: clamp(2rem, 11vw, 2.75rem)!important; }.xg-hero__actions .xg-button { flex: 1; min-width: 144px; }
  .xg-status-strip { align-items: flex-start; }.xg-path-grid, .xg-capability-grid, .xg-role-grid, .xguardian-persona-grid, .xg-card-grid--three, .xmart-card-grid--three { grid-template-columns: 1fr; }.xg-path-card { min-height: 145px; }.xg-capability-grid p, .xg-role-grid p { min-height: 0; }
  .xg-flow, .xguardian-flow { grid-template-columns: 1fr; }.xg-flow > div, .xguardian-flow > div { min-height: 110px; }.xg-flow > div:not(:last-child)::after, .xguardian-flow > div:not(:last-child)::after { display: grid!important; top: auto; bottom: -17px; right: 24px; transform: rotate(90deg); }
  .xguardian-screenshot-grid, .xg-screenshot-grid, .xg-card-grid, .xmart-card-grid, .xg-next-grid, .xguardian-next-grid { grid-template-columns: 1fr; }
  .article-feedback { align-items: flex-start; flex-direction: column; }.page-pagination { grid-template-columns: 1fr; }.page-pagination__next { text-align: left; }.site-footer { grid-template-columns: 1fr; padding: 28px 15px; }.site-footer__links { flex-wrap: wrap; }.site-footer > small { grid-column: 1; }
  .search-dialog { max-height: 90vh; }.search-dialog__body { max-height: 68vh; }.search-dialog__footer { display: none; }
}
@media (max-width: 430px) {
  .brand__text small { display: none; }.doc-article h1 { font-size: 1.9rem; }.xg-hero { padding: 24px 18px; }.xg-path-grid { grid-template-columns: 1fr; }.article-feedback__actions { width: 100%; }.article-feedback__actions button { flex: 1; }
}

@media (max-width: 340px) {
  .docs-shell, .is-home .docs-shell { padding: 0 12px; }
  .xg-hero__actions { display: grid; }
  .xg-hero__actions .xg-button { width: 100%; }
  .doc-article th, .doc-article td { min-width: 132px; padding: 10px 11px; }
}

@media print {
  .site-header, .sidebar, .toc-panel, .breadcrumbs, .page-meta, .article-feedback, .page-pagination, .site-footer, .back-to-top { display: none!important; }
  .docs-shell { display: block; max-width: none; padding: 0; }.main-content { padding: 0; }.doc-article { max-width: none; color: #000; }.doc-article a { color: #000; text-decoration: underline; }.doc-article a::after { content: " (" attr(href) ")"; font-size: 9px; }.xg-hero { box-shadow: none; border: 1px solid #ccc; }.xg-image-button { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto!important; animation-duration: .01ms!important; animation-iteration-count: 1!important; transition-duration: .01ms!important; }
}

@media (prefers-contrast: more) {
  :root { --border: #a79eae; --border-strong: #756d7b; --muted: #4f4857; }
  html[data-theme="dark"] { --border: #766a81; --border-strong: #a69bad; --muted: #d0c6d7; }
  .xg-button--primary { border-color: currentColor; }
}

/* Correções de compatibilidade para componentes migrados */
.xguardian-path-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.xguardian-process__step,
.xg-process__step { display: block; padding: 0; overflow: hidden; }
.xguardian-process__step > summary,
.xg-process__step > summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 13px;
  align-items: center;
  min-height: 72px;
  padding: 13px 16px;
}
.xguardian-process__step > summary::-webkit-details-marker,
.xg-process__step > summary::-webkit-details-marker { display: none; }
.xguardian-process__step > summary > span,
.xg-process__step > summary > span {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--xg-purple-600);
  font-weight: 850;
}
.xguardian-process__step > summary > strong,
.xg-process__step > summary > strong { grid-column: 2; grid-row: 1; margin: 0; font-size: 13px; }
.xguardian-process__step > summary > small,
.xg-process__step > summary > small { grid-column: 2; grid-row: 2; color: var(--muted); font-size: 11px; }
.xguardian-process__step > p,
.xg-process__step > p { margin: 0; padding: 0 16px 16px 67px; color: var(--muted); font-size: 12px; }
.xguardian-process__step[open] > summary,
.xg-process__step[open] > summary { background: color-mix(in srgb, var(--surface-2) 65%, transparent); }

/* DAST flows */
.dast-flow { margin: 22px 0 30px; padding: 18px; border: 1px solid var(--border); border-radius: var(--xg-radius-lg); background: var(--surface-2); }
.dast-flow__title { display: block; margin: 0 0 14px; color: var(--text-strong); font-size: 12px; font-weight: 750; letter-spacing: .02em; }
.dast-flow__steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.dast-flow__step { position: relative; min-height: 126px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.dast-flow__step:not(:last-child)::after { content: ""; position: absolute; z-index: 1; top: 34px; right: -11px; width: 12px; height: 1px; background: var(--border-strong); }
.dast-flow__step:not(:last-child)::before { content: ""; position: absolute; z-index: 1; top: 30px; right: -11px; width: 7px; height: 7px; border-top: 1px solid var(--xg-purple-500); border-right: 1px solid var(--xg-purple-500); transform: rotate(45deg); }
.dast-flow__number { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; background: color-mix(in srgb, var(--xg-purple-500) 11%, var(--surface)); color: var(--xg-purple-700); font-size: 10px; font-weight: 850; letter-spacing: .04em; }
.dast-flow__step strong { display: block; margin: 12px 0 5px; color: var(--text-strong); font-size: 12.5px; line-height: 1.35; }
.dast-flow__step small { display: block; color: var(--muted); font-size: 11px; line-height: 1.48; }
.dast-flow--branch .dast-flow__steps { grid-template-columns: minmax(120px, .8fr) minmax(145px, 1fr) minmax(0, 1.7fr) minmax(120px, .9fr); align-items: stretch; }
.dast-flow--branch .dast-flow__step { min-height: 152px; }
.dast-flow__step--decision { border-color: color-mix(in srgb, var(--xg-purple-500) 46%, var(--border)); background: color-mix(in srgb, var(--surface) 92%, var(--xg-purple-500)); }
.dast-flow__step--decision .dast-flow__number { background: var(--xg-purple-700); color: #fff; }
.dast-flow__paths { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.dast-flow__paths::before { content: ""; position: absolute; top: 34px; left: -11px; width: 12px; height: 1px; background: var(--border-strong); }
.dast-flow__paths::after { content: ""; position: absolute; top: 30px; right: -11px; width: 7px; height: 7px; border-top: 1px solid var(--xg-purple-500); border-right: 1px solid var(--xg-purple-500); transform: rotate(45deg); }
.dast-flow__path { min-height: 152px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.dast-flow__path > span { display: inline-flex; padding: 3px 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 9.5px; font-weight: 750; letter-spacing: .02em; }
.dast-flow__path strong { display: block; margin: 12px 0 5px; color: var(--text-strong); font-size: 12.5px; line-height: 1.35; }
.dast-flow__path small { display: block; color: var(--muted); font-size: 11px; line-height: 1.48; }
.dast-flow__step--outcome { border-color: color-mix(in srgb, var(--xg-green) 46%, var(--border)); }
.dast-flow__step--outcome .dast-flow__number { background: color-mix(in srgb, var(--xg-green) 13%, var(--surface)); color: #167353; }
html[data-theme="dark"] .dast-flow__step--outcome .dast-flow__number { color: #83dcbf; }

@media (max-width: 720px) {
  .dast-flow { padding: 14px; }
  .dast-flow__steps, .dast-flow--branch .dast-flow__steps { grid-template-columns: 1fr; gap: 16px; }
  .dast-flow__step, .dast-flow--branch .dast-flow__step, .dast-flow__path { min-height: 0; }
  .dast-flow__step:not(:last-child)::after { top: auto; right: auto; bottom: -17px; left: 24px; width: 1px; height: 12px; }
  .dast-flow__step:not(:last-child)::before { top: auto; right: auto; bottom: -17px; left: 21px; transform: rotate(135deg); }
  .dast-flow__paths { grid-template-columns: 1fr; gap: 9px; }
  .dast-flow__paths::before { top: -17px; left: 24px; width: 1px; height: 12px; }
  .dast-flow__paths::after { top: auto; right: auto; bottom: -17px; left: 21px; transform: rotate(135deg); }
}

@media (min-width: 1001px) {
  .xg-path-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
