:root {
  --c1: #6d28d9;
  --c2: #0284c7;
  --c3: #dc2626;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --heading: #1e293b;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Segoe UI", system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
/* overflow visível: painel de busca (position absolute) não pode ser recortado pela barra */
.top-nav { position: sticky; top: 0; z-index: 100; background: #0f172a; display: flex; flex-wrap: wrap; gap: 2px; row-gap: 0; align-items: stretch; overflow: visible; }
.top-nav a { color: #94a3b8; text-decoration: none; padding: 10px 10px; font-size: 11px; line-height: 1.25; max-width: 11.5em; text-align: center; white-space: normal; border-bottom: 2px solid transparent; position: relative; }
.top-nav a.active, .top-nav a:hover { color: #f1f5f9; border-bottom-color: var(--c1); }
.top-nav a[data-trilha="servicos"] { border-top: 3px solid #14b8a6; }
.top-nav a[data-trilha="contratual"] { border-top: 3px solid #f59e0b; }
.top-nav a[data-trilha="comum"] { border-top: 3px solid #64748b; }
.top-nav .trilha-sep { width: 1px; background: #334155; align-self: stretch; }

.trilha-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #1e293b;
  color: #f1f5f9;
  text-transform: uppercase;
  margin: 8px 12px 0;
}
.trilha-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.trilha-badge[data-trilha="servicos"] { background: #064e3b; color: #5eead4; }
.trilha-badge[data-trilha="servicos"]::before { background: #14b8a6; }
.trilha-badge[data-trilha="contratual"] { background: #422006; color: #fbbf24; }
.trilha-badge[data-trilha="contratual"]::before { background: #f59e0b; }
.trilha-badge[data-trilha="comum"] { background: #1e293b; color: #cbd5e1; }
.trilha-badge[data-trilha="comum"]::before { background: #64748b; }
.trilha-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  padding: 6px 16px;
}
.trilha-legend strong { color: var(--text); }
.trilha-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.trilha-legend-item .swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.trilha-legend-item[data-trilha="servicos"] .swatch { background: #14b8a6; }
.trilha-legend-item[data-trilha="contratual"] .swatch { background: #f59e0b; }
.trilha-legend-item[data-trilha="comum"] .swatch { background: #64748b; }
.top-nav-search {
  flex: 1 1 200px;
  min-width: 160px;
  max-width: 360px;
  padding: 6px 10px 8px;
  display: flex;
  align-items: center;
  position: relative;
  align-self: stretch;
  overflow: visible;
  z-index: 2;
}
.site-search-input {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #475569;
  background: #1e293b;
  color: #f1f5f9;
  padding: 8px 10px;
  font-size: 12px;
  outline: none;
}
.site-search-input::placeholder { color: #94a3b8; }
.site-search-input:focus {
  border-color: var(--c1);
  box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.25);
}
.site-search-results {
  position: absolute;
  left: 10px;
  right: 10px;
  top: calc(100% - 2px);
  max-height: min(70vh, 420px);
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  z-index: 500;
  margin-top: 4px;
}
.site-search-list { list-style: none; margin: 0; padding: 6px 0; }
.site-search-list li { margin: 0; }
.site-search-hit {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid #f1f5f9;
}
.site-search-hit:hover,
.site-search-hit:focus {
  background: #f8fafc;
  outline: none;
}
.site-search-hit-title { display: block; font-weight: 600; font-size: 13px; color: var(--heading); }
.site-search-hit-section { display: block; font-size: 11px; color: var(--c1); margin-top: 2px; }
.site-search-hit-snippet { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.site-search-empty { padding: 12px 14px; font-size: 13px; color: var(--muted); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.site-search-fallback {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0f172a;
  padding: 8px 12px;
  display: flex;
  justify-content: flex-end;
  overflow: visible;
}
.site-search-fallback .top-nav-search { max-width: 400px; flex: 1 1 280px; }
.hero { background: linear-gradient(135deg, #0f172a 0%, #1e293b 70%, #1e3a5f 100%); color: #fff; padding: 28px 24px; }
.hero h1 { font-size: 24px; margin-bottom: 6px; }
.hero p { color: #cbd5e1; max-width: 860px; line-height: 1.6; }
.hero-rule { text-align: center; font-size: 13px; font-style: italic; color: #94a3b8; margin: 14px 0 8px; }
.hero-figure { max-width: 800px; margin: 0 auto; padding: 0 8px; }
.diagram-wrap { display: flex; flex-direction: column; align-items: center; margin: 14px 0 10px; }
.diagram-wrap.tight { margin: 8px 0; }
.diagram-wrap svg { max-width: 100%; height: auto; display: block; }
.diagram-wrap.bordered svg { background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; }
.diagram-caption { font-size: 12px; color: var(--muted); text-align: center; margin: 6px 0 0; max-width: 48rem; line-height: 1.5; }
.diagram-legend { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 10px; font-size: 12px; color: var(--muted); }
.diagram-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.diagram-legend .dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.dot-c1 { background: #6d28d9; } .dot-c2 { background: #0284c7; } .dot-c3 { background: #dc2626; } .dot-adm { background: #059669; }
.layout { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 240px 1fr; gap: 20px; padding: 20px; }
.side-nav { position: sticky; top: 64px; align-self: start; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.side-nav h3 { font-size: 12px; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .4px; }
.side-nav a { display: block; text-decoration: none; color: #334155; font-size: 12px; padding: 8px 10px; border-radius: 8px; }
.side-nav a.active, .side-nav a:hover { background: #eef2ff; color: #312e81; }
.content section { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.content h2 { font-size: 18px; color: var(--heading); margin-bottom: 8px; }
.content p { line-height: 1.7; margin-bottom: 12px; }
.content ul { padding-left: 20px; line-height: 1.7; margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.card { border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.table th, .table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.table th { background: #f1f5f9; color: var(--muted); text-transform: uppercase; font-size: 11px; }
.links { font-size: 12px; color: var(--muted); }
.links a { color: var(--c2); text-decoration: none; }
.links a:hover { text-decoration: underline; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 22px; }
footer a { color: var(--c2); text-decoration: none; }
footer a:hover { text-decoration: underline; }
.footer-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
abbr.sigla, abbr[title] { cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; }
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .side-nav { position: static; }
  .grid-2 { grid-template-columns: 1fr; }
}
