/* Aspecto de AgentGate: tokens de agentgate-platform/ui/src/styles/_tokens.scss (naranja de marca, tipografía del sistema, tema claro). */
:root {
	--brand: #f26522; --action: #c2410c; --action-hover: #9a3412; --slate: #54595f; --tint: #fdece0; --ink: #2b2f33; --muted: #5f6368;
	--line: #e3e3e1; --bg: #f6f6f5; --surface: #ffffff; --neutral-bg: #ececea; --ok: #1f7a3d; --ok-bg: #e7f4ec; --warn: #6a4300; --warn-bg: #fff4e0;
	--radius: 6px; --radius-lg: 8px; --sidebar-width: 18rem; --topbar: 3.5rem;
	--font-sans: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
	--font-mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar) + 1rem); }
body { margin: 0; font-family: var(--font-sans); font-size: 1rem; line-height: 1.65; color: var(--ink); background: var(--bg); }
html[data-lang="es"] [data-lang="en"], html[data-lang="en"] [data-lang="es"] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
a { color: var(--action); text-underline-offset: 2px; }
a:hover { color: var(--action-hover); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 0.5rem; top: -4rem; background: var(--surface); padding: 0.5rem 1rem; z-index: 30; border-radius: var(--radius); }
.skip:focus { top: 0.5rem; }

.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar); display: flex; align-items: center; gap: 1rem; padding: 0 1.25rem; background: var(--surface); border-bottom: 3px solid var(--brand); }
.logo { height: 2rem; width: auto; }
.brand { font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.brand-sub { font-weight: 400; color: var(--muted); margin-left: 0.5rem; }
.search { margin-left: auto; flex: 0 1 22rem; }
.search input { width: 100%; padding: 0.4rem 0.75rem; font: inherit; border: 1px solid #c9c9c6; border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.search input:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.langs { display: flex; border: 1px solid #c9c9c6; border-radius: var(--radius); overflow: hidden; }
.lang-btn { font: inherit; font-weight: 600; font-size: 0.875rem; padding: 0.35rem 0.75rem; border: 0; background: var(--surface); color: var(--slate); cursor: pointer; }
.lang-btn[aria-pressed="true"] { background: var(--action); color: #fff; }
.menu-btn { display: none; font: inherit; padding: 0.35rem 0.75rem; border: 1px solid #c9c9c6; border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; }

.layout { display: flex; align-items: flex-start; }
.sidebar { position: sticky; top: var(--topbar); width: var(--sidebar-width); flex: none; height: calc(100vh - var(--topbar)); overflow-y: auto; padding: 1rem 1rem 2rem; background: var(--surface); border-right: 1px solid var(--line); font-size: 0.9rem; }
.toc, .toc ul { list-style: none; margin: 0; padding: 0; }
.toc > li { margin-bottom: 0.75rem; }
.toc a { display: block; padding: 0.2rem 0.5rem; border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.toc a:hover { background: var(--tint); }
.toc a.chap { font-weight: 600; }
.toc ul { margin-left: 0.5rem; border-left: 2px solid var(--line); }
.toc ul a { color: var(--slate); }
.ver { color: var(--muted); font-size: 0.8rem; margin-top: 1.5rem; }
.results { background: var(--tint); border-radius: var(--radius); padding: 0.5rem; margin-bottom: 1rem; }
.results ul { list-style: none; margin: 0; padding: 0; }
.results li { padding: 0.25rem 0; }
.results small { display: block; color: var(--muted); padding: 0 0.5rem; }
.results p { margin: 0.25rem 0.5rem; }

.content { flex: 1; min-width: 0; max-width: 56rem; padding: 2rem clamp(1rem, 4vw, 3rem) 4rem; }
.content:focus { outline: none; }
.chapter { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.5rem clamp(1rem, 3vw, 2.25rem); margin-bottom: 2rem; }
h1, h2, h3, h4 { line-height: 1.3; letter-spacing: -0.01em; }
h1 { font-size: 1.9rem; margin: 0 0 1rem; padding-bottom: 0.5rem; border-bottom: 3px solid var(--brand); }
h2 { font-size: 1.4rem; margin: 2.25rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 1.75rem 0 0.5rem; }
p, li, dd, td, th, pre, blockquote { overflow-wrap: anywhere; }
li { margin: 0.25rem 0; }
code { font-family: var(--font-mono); font-size: 0.85em; background: var(--neutral-bg); padding: 0.1em 0.35em; border-radius: 4px; }
pre { background: #2b2f33; color: #f6f6f5; padding: 0.9rem 1rem; border-radius: var(--radius); overflow-x: auto; line-height: 1.5; }
pre code { background: none; padding: 0; color: inherit; font-size: 0.85rem; }
blockquote { margin: 1.25rem 0; padding: 0.75rem 1rem; background: var(--tint); border-left: 4px solid var(--brand); border-radius: 0 var(--radius) var(--radius) 0; }
blockquote p { margin: 0.25rem 0; }
table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: 0.93rem; display: block; overflow-x: auto; }
th, td { text-align: left; vertical-align: top; padding: 0.5rem 0.75rem; border: 1px solid var(--line); }
th { background: var(--neutral-bg); }
figure { margin: 1.5rem 0; padding: 1rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); }
figure svg { width: 100%; height: auto; display: block; }
figcaption { color: var(--muted); font-size: 0.875rem; margin-top: 0.5rem; text-align: center; }
svg text { font-family: var(--font-sans); }

@media (max-width: 60rem) {
	.menu-btn { display: inline-block; }
	.brand-sub, .logo { display: none; }
	.search { flex: 1; }
	.sidebar { display: none; position: fixed; z-index: 15; top: var(--topbar); left: 0; bottom: 0; height: auto; max-width: 90vw; box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
	.sidebar.open { display: block; }
}
@media print {
	body { background: #fff; font-size: 11pt; }
	.topbar, .sidebar, .skip { display: none !important; }
	.content { max-width: none; padding: 0; }
	.chapter { border: 0; padding: 0; page-break-before: always; }
	.chapter:first-child { page-break-before: auto; }
	pre { background: #f2f2f2; color: #000; border: 1px solid #ccc; white-space: pre-wrap; }
	a { color: #000; }
	a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
	h2, h3, figure, table { page-break-inside: avoid; page-break-after: avoid; }
}

/* capturas de pantalla: la imagen y, debajo, su pie en cursiva */
.chapter p > img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 1px 4px rgba(0,0,0,0.12); }
.chapter p:has(> img) { margin-bottom: 0.4rem; }
.chapter p:has(> img) + p > em:only-child { display: block; color: var(--muted); font-size: 0.875rem; margin-bottom: 1rem; }

.draft { background: #fff4e0; color: var(--warn); border-bottom: 1px solid #e0b060; padding: 0.4rem 1.25rem; font-size: 0.875rem; font-weight: 600; }
@media print { .draft { display: none !important; } }

/* salida web: selector de idioma con enlaces */
a.lang-btn { display: inline-block; text-decoration: none; }
a.lang-btn[aria-current="true"] { background: var(--action); color: #fff; }
