/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/bi/fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/bi/fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/bi/fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/bi/fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/bi/fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/bi/fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/bi/fonts/jetbrains-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/bi/fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/bi/fonts/jetbrains-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/bi/fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/bi/fonts/space-grotesk-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/bi/fonts/space-grotesk-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/bi/fonts/space-grotesk-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/bi/fonts/space-grotesk-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* BI privado de ideias e projetos — estilos.
   Usa os tokens do site Ideias (tokens.css, sem alteração) e acrescenta só o
   que é de gráfico. Mobile-first: 720px = tabelas; 1024px = duas colunas. */

/* ---------- tokens de gráfico (validados para daltonismo nos dois temas) ---------- */
:root {
  --v-aprov: #69A60F;   /* nota com resultado confirmado */
  --v-origem: #8B6CFF;  /* originou projeto */
  --v-contrib: #159DB0; /* contribuiu com projeto */
  --v-pend: #BF851B;    /* vínculo pendente de classificação */
  --v-rest: #3B4260;    /* o que sobra: trilho, sem resultado, sem classificação */
  --v-c3: #C9CFE6;      /* classificação: implementada */
  --v-c2: #8A92AE;      /* em implementação */
  --v-c1: #565E7C;      /* futura */
  --grid: #1E2334;
  --bad: #FF6B7A;
  --shadow: 0 18px 50px rgba(0, 0, 0, .5);
}
:root[data-theme="light"] {
  --v-aprov: #5E9E00;
  --v-origem: #6B4DFF;
  --v-contrib: #0093A8;
  --v-pend: #B86E00;
  --v-rest: #D3D8E6;
  --v-c3: #3A4160;
  --v-c2: #7C84A3;
  --v-c1: #B3B9CF;
  --grid: #E6E9F2;
  --bad: #C4213A;
  --shadow: 0 18px 50px rgba(20, 24, 50, .16);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 118px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--fs-body)/1.5 var(--font-body); font-synthesis: none; }
h1, h2, h3, p, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; z-index: 60; left: 12px; top: -80px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--lime); color: var(--on-accent); font-weight: 600; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--font-mono); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--ink-2); }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nd { font-family: var(--font-mono); color: var(--ink-2); border-bottom: 1px dotted var(--ink-2); cursor: help; }
kbd { display: inline-block; min-width: 20px; padding: 0 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); font: 500 .72rem/18px var(--font-mono); text-align: center; color: var(--ink-2); }

/* ---------- topo ---------- */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; gap: var(--s2); min-height: 60px; padding-block: var(--s3); }
.logo { display: flex; align-items: center; gap: 10px; margin-right: var(--s3); font: 700 1.15rem var(--font-display); letter-spacing: -.02em; text-decoration: none; }
.logo img { width: 30px; height: 30px; filter: drop-shadow(0 0 10px var(--glow)); }
.logo span { display: none; }
.sw { display: inline-flex; margin-right: auto; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); font: 500 .78rem var(--font-mono); }
.sw a { padding: 5px 11px; border-radius: var(--r-pill); color: var(--ink-2); text-decoration: none; transition: color var(--dur-fast), background var(--dur-fast); }
.sw a:hover { color: var(--ink); }
.sw a.on { background: var(--lime); color: var(--on-accent); font-weight: 700; }
.nav .sw { order: -1; flex-shrink: 0; margin-right: var(--s2); }
.nav .sw a { display: flex; align-items: center; min-height: 44px; padding-inline: 10px; }
.nav .sw a:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
@media (max-width: 420px) { .nav { flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) { .nav .sw a { transition: none; } }
@media (prefers-reduced-motion: no-preference) { main { animation: area-entrada .16s ease-out; } @keyframes area-entrada { from { opacity: .82; } to { opacity: 1; } } }
.private { display: none; align-items: center; gap: 7px; font: 500 .78rem var(--font-mono); color: var(--ink-2); white-space: nowrap; }
.private i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 25%, transparent); }
.icon-btn { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); transition: color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast) var(--ease-spring); }
.icon-btn:hover { color: var(--lime-text); border-color: var(--lime); transform: translateY(-2px); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); font: 600 .85rem var(--font-mono); white-space: nowrap; text-decoration: none; transition: border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast) var(--ease-spring); }
.btn:hover { border-color: var(--lime); color: var(--lime-text); transform: translateY(-1px); }
.btn.primary { background: var(--lime); border-color: var(--lime); color: var(--on-accent); }
.btn.primary:hover { color: var(--on-accent); box-shadow: 0 6px 24px var(--glow); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.busy svg { animation: spin .8s linear infinite; }
.btn .lbl { display: none; }
.jump { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
.jump::-webkit-scrollbar { display: none; }
.jump a { flex: none; padding: 9px 11px; border-bottom: 2px solid transparent; font: 500 .8rem var(--font-mono); color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.jump a:hover { color: var(--ink); }
.jump a.on { color: var(--lime-text); border-bottom-color: var(--lime); }

/* ---------- estado da conexão ---------- */
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: var(--s4); padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); font-size: .875rem; color: var(--ink-2); }
.notice .light { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-2); animation: pulse 1s ease-in-out infinite alternate; }
.notice.success .light { background: var(--lime); animation: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 22%, transparent); }
.notice.warn { border-color: color-mix(in srgb, var(--amber) 55%, var(--line)); color: var(--ink); }
.notice.warn .light { background: var(--amber); animation: none; }
.notice.error { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); color: var(--ink); }
.notice.error .light { background: var(--bad); animation: none; }
.notice span:nth-child(2) { flex: 1; min-width: 200px; }
.notice a { font: 600 .82rem var(--font-mono); color: var(--lime-text); }

/* ---------- cabeçalho da página ---------- */
.hero { display: grid; gap: var(--s4); padding-block: var(--s6) var(--s4); }
.eyebrow { font: 500 .8rem var(--font-mono); color: var(--lime-text); }
.hero h1 { margin-top: var(--s2); font: 700 clamp(2rem, 5vw + .5rem, 3.5rem)/1.04 var(--font-display); letter-spacing: -.03em; }
.grad { background: linear-gradient(90deg, var(--lime), var(--cyan), var(--violet), var(--pink), var(--lime)); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: slide 9s linear infinite; }
:root[data-theme="light"] .grad { background-image: linear-gradient(90deg, var(--lime-text), var(--cyan), var(--violet), var(--pink), var(--lime-text)); }
.hero p { margin-top: var(--s3); max-width: 46ch; color: var(--ink-2); }

/* ---------- filtros ---------- */
.filters { display: grid; gap: var(--s3); padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.filters > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; font: 600 .85rem var(--font-mono); list-style: none; }
.filters > summary::-webkit-details-marker { display: none; }
.filters > summary b { padding: 0 7px; border-radius: 9px; background: var(--lime); color: var(--on-accent); font-size: .72rem; line-height: 18px; }
.filters > summary span:last-child { margin-left: auto; color: var(--ink-2); font-weight: 400; }
.frow { display: grid; gap: var(--s3); }
.fl { display: grid; gap: 5px; font: 500 .72rem var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.fl select, .fl input, .field { width: 100%; min-height: 40px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg-2); font: 400 .9rem var(--font-body); letter-spacing: 0; text-transform: none; color: var(--ink); }
.fl select:focus-visible, .fl input:focus-visible { outline-offset: 0; border-color: var(--lime); }
.seg { display: flex; padding: 3px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg-2); overflow-x: auto; scrollbar-width: none; }
.seg button { flex: 1 0 auto; min-height: 32px; padding: 0 10px; border-radius: 5px; font: 500 .8rem var(--font-mono); letter-spacing: 0; text-transform: none; white-space: nowrap; color: var(--ink-2); }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
#periodo { display: grid; grid-template-columns: 1fr 1fr; }
.dates { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.clear { justify-self: start; min-height: 40px; font: 500 .8rem var(--font-mono); color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.clear:hover { color: var(--lime-text); }

/* ---------- indicadores ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin-top: var(--s4); }
.kpi { position: relative; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.kpi::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: var(--c, var(--line)); transform-origin: left; animation: grow 1s var(--ease-out) both; }
.kpi span { display: block; font-size: .8125rem; color: var(--ink-2); }
.kpi strong { display: block; margin-top: 4px; font: 700 clamp(1.7rem, 4vw, 2.4rem)/1.1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi small { display: block; margin-top: 4px; font-size: .78rem; line-height: 1.35; color: var(--ink-2); }
.kpi.hero-kpi, .kpi:nth-child(2) { grid-column: 1 / -1; }
.kpi .meter { height: 6px; margin-top: 10px; border-radius: 3px; background: var(--v-rest); overflow: hidden; }
.kpi .meter i { display: block; height: 100%; border-radius: 3px; background: var(--v-aprov); }

/* ---------- seções e painéis ---------- */
section.block { padding-top: var(--s7); }
.sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s3); margin-bottom: var(--s4); }
.sec-head > div:first-child { flex: 1; min-width: 240px; }
.sec-head h2 { margin-top: 4px; font: 700 clamp(1.4rem, 2.4vw + .5rem, 2rem)/1.15 var(--font-display); letter-spacing: -.02em; }
.sec-head p { margin-top: 6px; color: var(--ink-2); max-width: 60ch; }
.grid { display: grid; gap: var(--s4); }
.panel { min-width: 0; padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.panel > header { display: flex; align-items: flex-start; gap: var(--s3); margin-bottom: var(--s4); }
.panel > header div { flex: 1; min-width: 0; }
.panel h3 { font: 600 1.0625rem/1.25 var(--font-display); letter-spacing: -.01em; }
.panel header p { margin-top: 3px; font-size: .85rem; color: var(--ink-2); }
.tag { flex: none; padding: 2px 9px; border: 1px solid var(--line); border-radius: var(--r-pill); font: 500 .72rem/18px var(--font-mono); color: var(--ink-2); white-space: nowrap; }
.foot { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); font-size: .8rem; line-height: 1.5; color: var(--ink-2); }
.empty { padding: 34px 16px; text-align: center; font-size: .9rem; color: var(--ink-2); }
.empty b { display: block; margin-bottom: 4px; font: 600 1rem var(--font-display); color: var(--ink); }
.skel { border-radius: 6px; background: var(--surface-2); animation: pulse .9s ease-in-out infinite alternate; }

/* ---------- barra segmentada: um todo dividido em partes ---------- */
.measure + .measure { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--line); }
.measure h4 { margin: 0 0 2px; font: 600 .9rem var(--font-body); }
.measure > p { margin-bottom: 10px; font-size: .8rem; color: var(--ink-2); }
.segbar { display: flex; gap: 2px; height: 26px; border-radius: 6px; overflow: hidden; background: var(--surface); }
.segbar button { min-width: 3px; height: 100%; background: var(--k); transition: filter var(--dur-fast); }
.segbar button:hover, .segbar button:focus-visible { filter: brightness(1.18); outline-offset: -2px; }
.hatch { background-image: repeating-linear-gradient(135deg, var(--k) 0 4px, transparent 4px 8px) !important; background-color: var(--v-rest) !important; }
.legend { display: grid; gap: 6px 18px; margin-top: 12px; font-size: .85rem; }
.legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--k); }
.legend b { font: 600 .85rem var(--font-mono); font-variant-numeric: tabular-nums; }
.legend em { min-width: 46px; text-align: right; font: 400 .78rem var(--font-mono); font-style: normal; color: var(--ink-2); }
.keys { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; font-size: .8rem; color: var(--ink-2); }
.keys span { display: inline-flex; align-items: center; gap: 7px; }
.keys i { width: 10px; height: 10px; border-radius: 3px; background: var(--k); }

/* ---------- colunas por mês de captura ---------- */
.plot { position: relative; height: 190px; margin: 6px 0 0 30px; }
.plot .gl { position: absolute; left: 0; right: 0; height: 1px; background: var(--grid); }
.plot .gl span { position: absolute; right: calc(100% + 8px); top: -8px; font: 400 .72rem/16px var(--font-mono); color: var(--ink-2); }
.cols { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.col { position: relative; flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; }
.col:hover, .col:focus-visible { background: color-mix(in srgb, var(--ink) 5%, transparent); outline: none; }
.col i { display: block; width: 62%; max-width: 24px; min-height: 2px; background: var(--k); }
.col i:first-of-type { border-radius: 4px 4px 0 0; }
.col b { margin-bottom: 1px; font: 600 .72rem var(--font-mono); white-space: nowrap; pointer-events: none; }
.xaxis { display: flex; margin: 6px 0 0 30px; }
.xaxis span { flex: 1; min-width: 0; overflow: hidden; text-align: center; font: 400 .72rem var(--font-mono); color: var(--ink-2); white-space: nowrap; }
details.tv { margin-top: var(--s3); font-size: .82rem; }
details.tv summary { cursor: pointer; font: 500 .78rem var(--font-mono); color: var(--ink-2); }
details.tv table { margin-top: 8px; }

/* ---------- barras horizontais ---------- */
.hb { display: grid; gap: 14px; }
.hb .r { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; align-items: baseline; }
.hb .r span { font-size: .9rem; }
.hb .r strong { font: 700 1.25rem var(--font-display); font-variant-numeric: tabular-nums; }
.hb .r small { grid-column: 1 / -1; font-size: .78rem; color: var(--ink-2); }
.track { grid-column: 1 / -1; height: 12px; border-radius: 0 4px 4px 0; background: var(--v-rest); overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--k); transition: width var(--dur-slow) var(--ease-out); }
.insight { display: flex; gap: 10px; margin-top: var(--s4); padding: 12px; border-radius: var(--r-md); background: var(--surface-2); font-size: .85rem; color: var(--ink-2); }
.insight b { color: var(--ink); font-weight: 600; }

/* ---------- tabelas (cartões no telefone) ---------- */
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-bottom: var(--s3); }
.tools .seg { flex: 0 1 auto; }
.tools .search { position: relative; flex: 1 1 220px; }
.tools .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-2); }
.tools .search input { width: 100%; min-height: 40px; padding: 0 38px 0 36px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg-2); }
.tools .search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); }
.tools select { min-height: 40px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg-2); font-size: .9rem; }
.tools .count { margin-left: auto; font: 500 .78rem var(--font-mono); color: var(--ink-2); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead { display: none; }
.tbl tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tbl tbody tr:last-child { border-bottom: 0; }
.tbl td { display: flex; gap: 10px; padding: 3px 0; font-size: .9rem; }
.tbl td[data-l]::before { content: attr(data-l); flex: 0 0 104px; font: 500 .72rem/1.6rem var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.tbl td.main { display: block; padding-bottom: 6px; }
.src { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 500; }
.src .av { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font: 600 .75rem var(--font-mono); color: var(--ink-2); }
.src small { display: block; font: 400 .72rem var(--font-mono); color: var(--ink-2); }
.ratio { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.ratio .track { flex: 1; min-width: 40px; height: 8px; border-radius: 4px; }
.ratio .track i { border-radius: 4px; }
.ratio span { flex: none; min-width: 52px; text-align: right; }
.vol { display: flex; align-items: center; gap: 10px; flex: 1; }
.vol .track { flex: 1; max-width: 120px; height: 4px; border-radius: 2px; }
.vol .track i { background: var(--ink-2); border-radius: 2px; }
.small-n { margin-left: 6px; padding: 0 6px; border: 1px solid color-mix(in srgb, var(--amber) 55%, var(--line)); border-radius: var(--r-pill); font: 400 .72rem/18px var(--font-mono); color: var(--ink-2); white-space: nowrap; }
.idea { font-weight: 500; }
.proj { display: block; margin-top: 2px; font-size: .82rem; color: var(--ink-2); }
.sub { display: block; font-size: .78rem; color: var(--ink-2); }
.badge { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); border: 1px solid color-mix(in srgb, var(--k) 45%, var(--line)); background: color-mix(in srgb, var(--k) 14%, transparent); font-size: .78rem; font-weight: 500; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--k); }
.k-origem { --k: var(--v-origem); } .k-contrib { --k: var(--v-contrib); } .k-pend { --k: var(--v-pend); } .k-aprov { --k: var(--v-aprov); } .k-rest { --k: var(--v-rest); }
.k-c3 { --k: var(--v-c3); } .k-c2 { --k: var(--v-c2); } .k-c1 { --k: var(--v-c1); }
.link { color: var(--lime-text); font-weight: 500; text-underline-offset: 3px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); font: 500 .8rem var(--font-mono); color: var(--ink-2); }
.pager div { display: flex; gap: 6px; }

/* ---------- projetos: três trilhos separados ---------- */
.projects { display: grid; gap: var(--s3); }
.pcard { display: flex; flex-direction: column; gap: 12px; padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); text-align: left; transition: border-color var(--dur-fast), transform var(--dur-fast) var(--ease-spring); }
.pcard:hover { border-color: var(--lime); transform: translateY(-2px); }
.pcard h3 { font: 600 1.05rem var(--font-display); }
.pcard .counts { display: flex; flex-wrap: wrap; gap: 6px; }
.pcard .counts span { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: var(--r-pill); background: var(--surface-2); font-size: .78rem; }
.pcard .counts span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--k); }
.pcard .counts b { font-family: var(--font-mono); }
.rails { display: grid; gap: 1px; width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--line); overflow: hidden; }
.rails div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 10px; background: var(--bg-2); }
.rails dt { flex: none; font: 500 .72rem var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.rails dd { min-width: 0; overflow: hidden; font: 600 .76rem var(--font-mono); white-space: nowrap; text-overflow: ellipsis; text-align: right; }
.rails dd.none { font-weight: 400; color: var(--ink-2); }
.rails dd.ok { color: var(--lime-text); } .rails dd.bad { color: var(--bad); } .rails dd.wait { color: var(--amber); }
.pcard .go { margin-top: auto; font: 500 .76rem var(--font-mono); color: var(--ink-2); }
.pcard:hover .go { color: var(--lime-text); }

/* ---------- qualidade dos dados ---------- */
.quality { display: grid; gap: var(--s3); }
.q { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: baseline; padding-bottom: var(--s3); border-bottom: 1px solid var(--line); }
.q:last-child { border-bottom: 0; padding-bottom: 0; }
.q span { font-weight: 500; }
.q strong { justify-self: end; font: 700 1.15rem var(--font-display); font-variant-numeric: tabular-nums; }
.q small { font-size: .8rem; color: var(--ink-2); }
.q em { font: 400 .76rem var(--font-mono); font-style: normal; color: var(--ink-2); text-align: right; }
.q .track { height: 6px; border-radius: 3px; }
.q .track i { background: var(--v-pend); border-radius: 3px; }
.q.done strong { color: var(--lime-text); }

/* ---------- rodapé, dica e estados do protótipo ---------- */
footer { margin-top: var(--s8); padding-block: var(--s5) var(--s8); border-top: 1px solid var(--line); font: 400 .78rem var(--font-mono); color: var(--ink-2); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
#tip { position: fixed; z-index: 70; left: 0; top: 0; max-width: 260px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); box-shadow: var(--shadow); font-size: .8rem; pointer-events: none; opacity: 0; transition: opacity var(--dur-fast); }
#tip.on { opacity: 1; }
#tip h5 { margin: 0 0 6px; font: 500 .72rem var(--font-mono); color: var(--ink-2); }
#tip p { display: flex; align-items: center; gap: 8px; }
#tip p i { flex: none; width: 12px; height: 3px; border-radius: 2px; background: var(--k); }
#tip p b { font: 700 .9rem var(--font-mono); }
#tip p span { color: var(--ink-2); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { from { opacity: 1; } to { opacity: .45; } }
@keyframes slide { to { background-position: 300% 0; } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
[data-fresh] .panel, [data-fresh] .kpi { animation: rise var(--dur) var(--ease-out) both; }
#data-region[data-stale] { opacity: .45; pointer-events: none; }

/* ---------- 720px ---------- */
@media (min-width: 720px) {
  .logo span { display: inline; }
  .private { display: inline-flex; }
  .btn .lbl { display: inline; }
  .hero { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .filters { padding: var(--s4); }
  .filters > summary { display: none; }
  #periodo { display: flex; }
  .frow { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
  .frow > .fl:first-child { grid-column: 1 / 3; }
  .frow .clear { justify-self: end; }
  .frow .dates { grid-column: 1 / 3; }
  .kpis { grid-template-columns: 1.25fr 1fr 1fr 1fr; }
  .kpi.hero-kpi, .kpi:nth-child(2) { grid-column: auto; }
  .panel { padding: var(--s5); }
  .legend { grid-template-columns: 1fr 1fr; }
  .tbl thead { display: table-header-group; }
  .tbl tr { display: table-row; padding: 0; }
  .tbl th { padding: 10px 12px; border-bottom: 1px solid var(--line); font: 500 .72rem var(--font-mono); letter-spacing: .06em; text-transform: uppercase; text-align: left; color: var(--ink-2); white-space: nowrap; }
  .tbl th button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
  .tbl th button.on, .tbl th button:hover { color: var(--ink); }
  .tbl th.r, .tbl td.r { text-align: right; }
  .tbl td, .tbl td.main { display: table-cell; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
  .tbl tbody tr:last-child td { border-bottom: 0; }
  .tbl tbody tr:hover td { background: color-mix(in srgb, var(--ink) 3%, transparent); }
  .tbl td[data-l]::before { display: none; }
  .tbl td.r { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  .ratio { min-width: 150px; }
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ---------- 1024px ---------- */
@media (min-width: 1024px) {
  .frow { grid-template-columns: minmax(390px, 1.7fr) repeat(3, minmax(0, 1fr)) auto; }
  .frow > .fl:first-child { grid-column: auto; }
  .grid.two { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
  .grid.two .wide { grid-column: 1 / -1; }
  .projects { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quality { grid-template-columns: 1fr 1fr; gap: var(--s4) var(--s6); }
  .q { border-bottom: 0; padding-bottom: 0; }
}
@media print {
  .top, .filters, .tools, .pager, #tip { display: none !important; }
  body { background: #fff; color: #000; }
  .panel, .kpi { break-inside: avoid; }
}

/* Tabelas largas rolam na própria região, sem aumentar a largura da página. */
.table-scroll { width:100%; max-width:100%; overflow-x:auto; overscroll-behavior-inline:contain; }
.src > div { min-width:0; overflow-wrap:anywhere; }

.project-summary{font-size:.84rem;color:var(--ink-2);line-height:1.5;overflow-wrap:anywhere}
.project-extraction{border-top:1px solid var(--line);padding-top:12px;font-size:.82rem;line-height:1.5;overflow-wrap:anywhere}
.project-extraction small{display:block;color:var(--ink-2);font-family:var(--font-mono);margin-bottom:8px}
.survey-list{display:grid;gap:var(--s3);margin-top:var(--s3)}
.survey-item h3{font-size:1.05rem;overflow-wrap:anywhere}
.survey-item>p{margin:10px 0;overflow-wrap:anywhere}
.survey-item blockquote{margin:14px 0;padding:8px 16px;border-left:2px solid var(--amber);font-size:.9rem;overflow-wrap:anywhere}
.survey-item cite{display:block;color:var(--ink-2);font-size:.8rem;font-style:normal;margin-top:6px}
