:root {
  --bg: #f6f6f3;
  --panel: #ffffff;
  --ink: #1d1f23;
  --muted: #6a6f78;
  --line: #e3e3de;
  --soft: #f0f0eb;
  --accent: #2f5bd3;
  --b0: #c2410c;
  --b1: #b7791f;
  --b2: #2f8a4c;
  --b3: #13706a;
  --ok: #2f8a4c;
  --rev: #b7791f;
  --bad: #c2410c;
  --unk: #9aa0a8;
  --sim: #7c3aed;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.2; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel); border-radius: 7px; padding: .35rem .7rem; }
button:hover { border-color: #c9c9c2; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
input[type=number] { width: 5.5rem; }
input[type=number], input[type=text], select, textarea { border: 1px solid var(--line); border-radius: 6px; padding: .25rem .4rem; background: #fff; }
textarea { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.pad { padding: 1rem; }
.small { font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 1.2rem; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.tag { font-size: 11px; background: var(--soft); border: 1px solid var(--line); border-radius: 99px; padding: .05rem .5rem; color: var(--muted); }
.status { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.pill { border-radius: 99px; padding: .05rem .5rem; font-size: 11px; border: 1px solid var(--line); background: var(--soft); white-space: nowrap; }
.pill.warn { background: #fff4e0; border-color: #f1d49a; color: #7a4d00; }
.pill.sim { background: #f1ebff; border-color: #d8c6ff; color: var(--sim); }
.pill.err { background: #fde8e1; border-color: #f3b9a6; color: var(--bad); }

.tabs { display: flex; gap: .25rem; padding: 0 1.2rem; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: .6rem .8rem; background: none; color: var(--muted); white-space: nowrap; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

main { padding: 1.2rem; max-width: 1400px; margin: 0 auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.grid { display: grid; gap: 1rem; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.cols-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 1rem; }
.scroll { overflow-x: auto; }

table { border-collapse: collapse; width: 100%; }
th, td { padding: .4rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; background: var(--panel); position: sticky; top: 0; }
th[data-act=sort] { cursor: pointer; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fafaf6; }

.kpi { display: flex; flex-direction: column; gap: .15rem; }
.kpi b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.bandbar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--soft); }
.bandbar i { display: block; height: 100%; }
.b0 { --c: var(--b0); } .b1 { --c: var(--b1); } .b2 { --c: var(--b2); } .b3 { --c: var(--b3); }
.chip { display: inline-flex; align-items: center; gap: .3rem; border-radius: 99px; padding: .05rem .5rem; font-size: 12px; font-weight: 600; color: var(--c, var(--muted)); background: color-mix(in srgb, var(--c, #999) 12%, white); border: 1px solid color-mix(in srgb, var(--c, #999) 35%, white); white-space: nowrap; }
.scorecell { display: flex; align-items: center; gap: .5rem; }
.scorecell b { font-size: 1rem; min-width: 1.8rem; text-align: right; font-variant-numeric: tabular-nums; }
.minis { display: flex; gap: 3px; }
.mini { width: 34px; height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; display: inline-block; }
.mini i { display: block; height: 100%; background: #7d8796; }
.mini.null { background: repeating-linear-gradient(45deg, var(--soft), var(--soft) 3px, #e6e6e0 3px, #e6e6e0 6px); }

.eleg { font-size: 12px; white-space: nowrap; }
.eleg.alerta { color: var(--bad); }
.eleg.revisao { color: var(--rev); }
.eleg.info { color: var(--muted); }
.eleg.ok { color: var(--ok); }

.hero { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: center; }
.gauge { --v: 0; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--soft) 0); }
.gauge > div { width: 102px; height: 102px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; text-align: center; }
.gauge b { font-size: 2rem; line-height: 1; }
.flags { display: flex; flex-direction: column; gap: .35rem; }
.flag { border-left: 3px solid var(--unk); padding: .25rem .6rem; background: var(--soft); border-radius: 0 6px 6px 0; font-size: 13px; }
.flag.alerta { border-color: var(--bad); }
.flag.revisao { border-color: var(--rev); }
.flag.ok { border-color: var(--ok); }

.dim { display: flex; flex-direction: column; gap: .35rem; }
.bar { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.driver { display: grid; grid-template-columns: 1fr 5.5rem; gap: .5rem; padding: .45rem 0; border-bottom: 1px dashed var(--line); }
.driver:last-child { border-bottom: 0; }
.driver .pts { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.driver .meta { font-size: 11px; color: var(--muted); }
.up .pts { color: var(--ok); }
.down .pts { color: var(--bad); }
.dbar { height: 4px; border-radius: 99px; margin-top: .25rem; }
.up .dbar { background: var(--ok); }
.down .dbar { background: var(--bad); }
.formula { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--soft); border-radius: 6px; padding: .5rem .7rem; overflow-x: auto; white-space: nowrap; }

.g { font-weight: 700; }
.g.ok { color: var(--ok); } .g.revisao { color: var(--rev); } .g.bloqueio { color: var(--bad); } .g.null { color: var(--unk); }
.sim-tag { font-size: 10px; color: var(--sim); border: 1px solid #d8c6ff; border-radius: 4px; padding: 0 .25rem; margin-left: .25rem; vertical-align: 1px; }
.st { font-size: 12px; font-weight: 600; white-space: nowrap; }
.st.Acessível { color: var(--ok); } .st.Revisão { color: var(--rev); } .st.Bloqueada { color: var(--bad); } .st.Indeterminada, .st.Não.aderente { color: var(--unk); }

.timeline { display: flex; flex-direction: column; gap: .4rem; }
.tl { display: grid; grid-template-columns: 9rem 1fr; gap: .6rem; font-size: 13px; }

.params { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1rem; align-items: start; }
@media (max-width: 1000px) { .params { grid-template-columns: 1fr; } .side { position: static !important; } }
.side { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
.toolbar { position: sticky; top: 0; z-index: 3; }
.slider { display: flex; align-items: center; gap: .4rem; }
.slider input[type=range] { width: 140px; }
.slider output { min-width: 2rem; font-variant-numeric: tabular-nums; font-weight: 600; }
details.feat { border: 1px solid var(--line); border-radius: 8px; padding: .4rem .6rem; background: #fcfcfa; }
details.feat + details.feat { margin-top: .4rem; }
details.feat summary { cursor: pointer; list-style: none; }
details.feat summary::-webkit-details-marker { display: none; }
.feat-head { display: grid; grid-template-columns: auto 1fr auto auto; gap: .6rem; align-items: center; }
.feat-body { padding: .6rem 0 .2rem; display: grid; gap: .6rem; }
.kv { display: grid; grid-template-columns: minmax(8rem, max-content) auto; gap: .25rem .6rem; align-items: center; }
.pts-table td, .pts-table th { padding: .15rem .3rem; border: 0; }
.delta.pos { color: var(--ok); } .delta.neg { color: var(--bad); }
.pipeline { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.pipeline span { background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: .3rem .55rem; font-size: 13px; }
.pipeline em { color: var(--muted); font-style: normal; }
.hist { display: flex; align-items: flex-end; gap: 2px; height: 26px; }
.hist i { width: 10px; background: #8793a3; border-radius: 2px 2px 0 0; display: block; }
.toast { position: fixed; bottom: 1rem; right: 1rem; background: var(--ink); color: #fff; padding: .6rem .9rem; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 420px; }
.toast.err { background: var(--bad); }
