/* ==========================================================================
   VG · Laboratório — app de dimensionamento (ponta de eixo + mancal)
   Depende de base.css (tokens e componentes compartilhados)
   ========================================================================== */

:root { --appbar-h: 58px; --lab-areas-h: 42px; --side-w: 384px; --gap: 16px; }

body.app { font-size: 14px; line-height: 1.55; min-height: 100dvh; }

/* ---- Barra superior ------------------------------------------------------ */
.appbar {
  position: sticky; top: 0; z-index: 60; height: var(--appbar-h);
  display: flex; align-items: center; gap: 18px; padding: 0 18px 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 850; font-size: 1.32rem; letter-spacing: -.05em; color: var(--text); }
.brand b { color: var(--accent); font-weight: 850; }
.brand-back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: .74rem; font-weight: 650; letter-spacing: .02em; padding: 6px 8px; border-radius: var(--r-s); }
.brand-back:hover { color: var(--text); background: var(--surface-2); }
.brand-back svg { width: 14px; height: 14px; }
.appbar-sep { width: 1px; height: 26px; background: var(--line); }
.appbar-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.appbar-title .overline { font-size: .6rem; }
.appbar-title strong { font-size: .92rem; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.appbar-actions .btn { min-height: 36px; }
.theme-btn .i-moon { display: none; }
html[data-theme="light"] .theme-btn .i-sun { display: none; }
html[data-theme="light"] .theme-btn .i-moon { display: block; }
@media (prefers-color-scheme: light) {
  html:not([data-theme]) .theme-btn .i-sun { display: none; }
  html:not([data-theme]) .theme-btn .i-moon { display: block; }
}

/* ---- Navegação entre laboratórios --------------------------------------- */
.lab-areas {
  position: sticky; top: var(--appbar-h); z-index: 50; min-height: var(--lab-areas-h);
  display: flex; align-items: stretch; gap: 4px; padding: 0 16px;
  background: var(--bg-alt); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none;
}
.lab-areas::-webkit-scrollbar { display: none; }
@media (max-width: 1100px) { .lab-area-detail { display: none; } } /* cinco laboratórios na barra */
.lab-areas-label { display: inline-flex; align-items: center; margin-right: 16px; color: var(--text-3); font-size: .62rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.lab-area { display: inline-flex; align-items: center; gap: 6px; min-height: var(--lab-areas-h); padding: 0 15px;
  border-bottom: 2px solid transparent; color: var(--text-2); font-size: .78rem; font-weight: 650; white-space: nowrap; }
.lab-area:hover { color: var(--text); background: var(--surface); }
.lab-area[aria-current="page"] { border-bottom-color: var(--accent); color: var(--text); background: var(--accent-wash); }
.lab-area-number { color: var(--accent); font: 700 .63rem var(--font-mono); }
.lab-area-detail { color: var(--text-3); font-weight: 500; }

/* ---- Estrutura de duas colunas ------------------------------------------ */
.lab { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); align-items: start; }
.dados {
  position: sticky; top: calc(var(--appbar-h) + var(--lab-areas-h)); height: calc(100dvh - var(--appbar-h) - var(--lab-areas-h)); overflow-y: auto; overscroll-behavior: contain;
  border-right: 1px solid var(--line); background: var(--bg-alt); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.resultados { min-width: 0; padding: 0 26px 64px; }

/* ---- Painel de dados ----------------------------------------------------- */
.dados-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px 12px 18px; background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.dados-head h2 { font-size: .98rem; letter-spacing: -.01em; font-weight: 750; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.dados-head .live { display: inline-flex; align-items: center; gap: 7px; color: var(--text-3); font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.dados-foot { padding: 14px 18px 28px; color: var(--text-3); font-size: .74rem; line-height: 1.5; }

.grp { border-bottom: 1px solid var(--line); }
.grp-head { width: 100%; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 13px 16px 13px 18px; background: transparent; border: 0; text-align: left; color: var(--text); }
.grp-head:hover { background: var(--surface); }
.grp-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-2); font-size: .7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.grp-title { display: flex; flex-direction: column; min-width: 0; }
.grp-title strong { font-size: .86rem; font-weight: 700; letter-spacing: -.005em; }
.grp-sum { color: var(--text-3); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp-chev { width: 16px; height: 16px; color: var(--text-3); transition: transform var(--t) var(--ease); }
.grp[data-aberto="true"] .grp-chev { transform: rotate(180deg); }
.grp[data-aberto="true"] .grp-sum { display: none; }
.grp-body { padding: 2px 18px 18px; display: grid; gap: 14px; }
.grp[data-aberto="false"] .grp-body { display: none; }
.grp.has-err .grp-num { background: var(--fail-bg); border-color: var(--fail-line); color: var(--fail); }
.grp.off .grp-title strong { color: var(--text-2); }

.fld { display: grid; gap: 6px; min-width: 0; align-content: start; }
.fld-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--text-2); font-size: .76rem; font-weight: 650; letter-spacing: .005em; }
.fld-label small { color: var(--text-3); font-weight: 550; font-size: .7rem; }
.fld-hint { color: var(--text-3); font-size: .72rem; line-height: 1.45; }
.fld-hint b { color: var(--text-2); font-weight: 650; }
.fld-err { display: flex; gap: 6px; align-items: flex-start; color: var(--fail); font-size: .74rem; font-weight: 600; line-height: 1.4; }
.fld-err svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fld-row.r3 { grid-template-columns: repeat(3, 1fr); }

.inp { position: relative; display: flex; align-items: stretch; min-height: 40px; border: 1px solid var(--line-strong); border-radius: var(--r-s);
  background: var(--surface); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.inp:hover { border-color: color-mix(in srgb, var(--text-3) 60%, var(--line-strong)); }
.inp:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.inp input, .inp select { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; padding: 0 11px; font-size: .9rem; font-variant-numeric: tabular-nums; }
.inp input::placeholder { color: var(--text-3); opacity: .9; }
.inp select { appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.inp select option { background: var(--surface); color: var(--text); }
.inp .un { display: inline-flex; align-items: center; padding: 0 11px 0 4px; color: var(--text-3); font-size: .76rem; font-weight: 600; white-space: nowrap; }
.inp .un-sel { border-left: 1px solid var(--line); flex: 0 0 auto; width: auto; min-width: 84px; font-weight: 650; color: var(--text-2); }
.inp.err { border-color: var(--fail); box-shadow: 0 0 0 3px var(--fail-bg); }
.inp.auto input::placeholder { color: var(--teal); opacity: 1; font-weight: 600; }
html[data-theme="light"] .inp.auto input::placeholder { color: var(--teal); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 26px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text-2);
  font-size: .72rem; font-weight: 650; font-variant-numeric: tabular-nums; transition: all var(--t-fast); }
.chip:hover { border-color: var(--accent-line); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--accent-wash); border-color: var(--accent-line); color: var(--accent); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; gap: 3px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { min-height: 32px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-size: .78rem; font-weight: 650; white-space: nowrap; transition: background var(--t-fast), color var(--t-fast); }
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-s), 0 0 0 1px var(--line-strong); }

.sw { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.sw-txt { display: grid; gap: 1px; }
.sw-txt strong { font-size: .8rem; font-weight: 650; color: var(--text); }
.sw-txt small { color: var(--text-3); font-size: .72rem; }
.sw input { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 36px; height: 21px; margin: 0; border-radius: 999px;
  background: var(--line-strong); cursor: pointer; transition: background var(--t-fast); }
.sw input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform var(--t) var(--ease); }
.sw input:checked { background: var(--accent); }
.sw input:checked::after { transform: translateX(15px); }
.sw input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.grp-head .sw { padding: 4px 0; }

.callout { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: .76rem; line-height: 1.5; }
.callout svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--teal); }
.callout.warn { border-color: var(--warn-line); background: var(--warn-bg); color: var(--text); }
.callout.warn svg { color: var(--warn); }
.callout.fail { border-color: var(--fail-line); background: var(--fail-bg); color: var(--text); }
.callout.fail svg { color: var(--fail); }
.sub-sep { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: .64rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.sub-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---- Topo dos resultados (situação + abas) ------------------------------- */
.res-top { position: sticky; top: calc(var(--appbar-h) + var(--lab-areas-h)); z-index: 30; margin: 0 -26px; padding: 14px 26px 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.case { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.case-id { min-width: 0; }
.case-id h1 { font-size: 1.22rem; font-weight: 760; letter-spacing: -.025em; line-height: 1.25; }
.case-id h1 em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--accent); }
.case-id p { color: var(--text-3); font-size: .78rem; margin-top: 2px; font-variant-numeric: tabular-nums; }
.case-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.st-chip { display: inline-flex; align-items: center; gap: 9px; min-height: 38px; padding: 0 12px 0 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: .78rem; font-weight: 650; cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.st-chip:hover { border-color: var(--line-strong); background: var(--surface-2); }
.st-chip .ico { width: 18px; height: 18px; }
.st-chip span { color: var(--text-3); font-weight: 600; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.st-chip b { font-weight: 700; }
.st-chip.ok { border-color: var(--ok-line); } .st-chip.ok .ico { color: var(--ok); }
.st-chip.atencao { border-color: var(--warn-line); } .st-chip.atencao .ico { color: var(--warn); }
.st-chip.falha { border-color: var(--fail-line); } .st-chip.falha .ico { color: var(--fail); }
.st-chip.off .ico { color: var(--text-3); }

.tabs { display: flex; gap: 2px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px 12px; border: 0; background: transparent; color: var(--text-3);
  font-size: .84rem; font-weight: 650; white-space: nowrap; border-radius: 8px 8px 0 0; transition: color var(--t-fast); }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent); }
.tab .dot { width: 7px; height: 7px; border-radius: 50%; }
.tab .dot.ok { background: var(--ok); } .tab .dot.atencao { background: var(--warn); } .tab .dot.falha { background: var(--fail); }
.tab .n { color: var(--text-3); font-size: .7rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.tabpanel { padding-top: 22px; animation: entra .28s var(--ease); }
.tabpanel:focus { outline: none; }
@keyframes entra { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---- Bloco de erro geral ------------------------------------------------- */
.erro-geral { display: flex; gap: 14px; padding: 18px 20px; border-radius: var(--r-l); border: 1px solid var(--fail-line); background: var(--fail-bg); margin-top: 22px; }
.erro-geral svg { width: 22px; height: 22px; color: var(--fail); flex: none; }
.erro-geral h3 { font-size: 1rem; margin-bottom: 6px; }
.erro-geral ul { margin: 0; padding-left: 18px; color: var(--text-2); }
.vazio { display: grid; justify-items: start; gap: 10px; padding: 28px; border: 1px dashed var(--line-strong); border-radius: var(--r-l); color: var(--text-2); }
.vazio h3 { font-size: 1.05rem; color: var(--text); }

/* ---- Grades e seções ----------------------------------------------------- */
.sec { margin-top: 26px; }
.sec:first-child { margin-top: 0; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.sec-head h2 { font-size: 1.08rem; font-weight: 740; letter-spacing: -.02em; }
.sec-head p { color: var(--text-3); font-size: .78rem; max-width: 62ch; }
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.g-7-5 { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--gap); }
.g-5-7 { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gap); }
.span-2 { grid-column: 1 / -1; }

/* ---- Veredito (visão geral) ---------------------------------------------- */
.verdicts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.verdict { position: relative; overflow: hidden; display: grid; gap: 16px; padding: 20px 22px 20px; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--surface); }
.verdict::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--line-strong); }
.verdict.ok::before { background: var(--ok); } .verdict.atencao::before { background: var(--warn); } .verdict.falha::before { background: var(--fail); }
.verdict-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.verdict-top .overline { font-size: .66rem; }
.hero { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hero .sym { font-family: var(--font-math); font-style: italic; font-size: 1.5rem; color: var(--text-2); }
.hero .val { font-size: clamp(2.2rem, 3.4vw, 3rem); font-weight: 780; letter-spacing: -.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.hero .uni { font-size: 1rem; color: var(--text-2); font-weight: 600; }
.hero-sub { color: var(--text-2); font-size: .84rem; margin-top: -6px; font-variant-numeric: tabular-nums; }
.hero-sub b { color: var(--text); font-weight: 650; }
.minis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); padding-top: 14px; }
.mini { padding: 0 12px; border-left: 1px solid var(--line); min-width: 0; }
.mini:first-child { padding-left: 0; border-left: 0; }
.mini span { display: block; color: var(--text-3); font-size: .66rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini b { display: block; font-size: 1.02rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; }
.mini small { color: var(--text-3); font-size: .72rem; }

/* medidor horizontal: demanda × capacidade */
.meter { display: grid; gap: 7px; }
.meter-top { display: flex; justify-content: space-between; gap: 10px; font-size: .74rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.meter-top b { color: var(--text); font-weight: 700; }
.meter-bar { position: relative; height: 10px; border-radius: 999px; background: var(--surface-3); overflow: visible; }
.meter-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--c-s1); transition: width .5s var(--ease); }
.meter-fill.em { background: var(--c-em); }
.meter-fill.fail { background: var(--fail); }
.meter-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 1px; background: var(--text); }
.meter-mark::after { content: attr(data-r); position: absolute; bottom: -19px; left: 50%; transform: translateX(-50%); color: var(--text-3); font-size: .64rem; font-weight: 700; white-space: nowrap; }
.meter.has-mark { padding-bottom: 14px; }
.meter-scale { display: flex; justify-content: space-between; color: var(--text-3); font-size: .66rem; font-variant-numeric: tabular-nums; }

/* ---- Fluxo do cálculo --------------------------------------------------- */
.pipeline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(118px, 1fr); gap: 0; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.step { position: relative; display: grid; gap: 3px; padding: 12px 14px 12px 14px; background: var(--surface); border: 1px solid var(--line); border-left-width: 0; text-align: left; color: var(--text); min-width: 0; transition: background var(--t-fast); }
.step:first-child { border-left-width: 1px; border-radius: var(--r) 0 0 var(--r); }
.step:last-child { border-radius: 0 var(--r) var(--r) 0; }
.step:hover { background: var(--surface-2); }
.step:not(:last-child)::after { content: ""; position: absolute; z-index: 2; right: -6px; top: 50%; width: 10px; height: 10px; transform: translateY(-50%) rotate(45deg);
  background: inherit; border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
.step .sid { color: var(--accent); font-size: .64rem; font-weight: 800; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.step .snm { color: var(--text-3); font-size: .7rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step .sv { font-size: 1.02rem; font-weight: 740; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -.02em; }
.step .sv small { color: var(--text-3); font-size: .7rem; font-weight: 600; letter-spacing: 0; }
.step.mancal .sid { color: var(--teal); }
.step.ok .sv { color: var(--text); }
.step.falha { background: var(--fail-bg); }
.pipe-legend { display: flex; gap: 16px; margin-top: 8px; color: var(--text-3); font-size: .72rem; }
.pipe-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }

/* ---- Lista de pontos de atenção ----------------------------------------- */
.attn { display: grid; gap: 8px; }
.attn-item { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; padding: 11px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); font-size: .82rem; line-height: 1.5; color: var(--text-2); }
.attn-item svg { width: 18px; height: 18px; margin-top: 1px; }
.attn-item.fail { border-color: var(--fail-line); background: var(--fail-bg); color: var(--text); } .attn-item.fail svg { color: var(--fail); }
.attn-item.warn { border-color: var(--warn-line); background: var(--warn-bg); color: var(--text); } .attn-item.warn svg { color: var(--warn); }
.attn-item.nota svg { color: var(--teal); }
.attn-item .tag { display: inline-block; margin-right: 6px; color: var(--text-3); font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

/* ---- KPI ------------------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kpi { position: relative; display: grid; align-content: start; gap: 2px; padding: 12px 14px 13px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); min-width: 0; text-align: left; color: var(--text); }
button.kpi { cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
button.kpi:hover { border-color: var(--line-strong); background: var(--surface-2); }
.kpi-l { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--text-3); font-size: .64rem; font-weight: 780; letter-spacing: .1em; text-transform: uppercase; }
.kpi-l .ref { color: var(--accent); font-weight: 800; letter-spacing: .04em; }
.kpi-l .ref.m { color: var(--teal); }
.kpi-v { display: flex; align-items: baseline; gap: 5px; font-size: 1.42rem; font-weight: 760; letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; }
.kpi-v small { font-size: .74rem; color: var(--text-2); font-weight: 600; letter-spacing: 0; }
.kpi-s { color: var(--text-3); font-size: .72rem; line-height: 1.4; font-variant-numeric: tabular-nums; }
.kpi .ico { position: absolute; right: 12px; bottom: 12px; width: 16px; height: 16px; }
.kpi.ok .ico { color: var(--ok); } .kpi.falha .ico { color: var(--fail); } .kpi.atencao .ico { color: var(--warn); }
.kpi.falha { border-color: var(--fail-line); }
.kpi.destaque { border-color: var(--accent-line); background: linear-gradient(180deg, var(--accent-wash), transparent 70%), var(--surface); }

/* ---- Cartões de gráfico ---------------------------------------------------- */
.ccard { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); }
.ccard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.ccard-head .overline { display: block; margin-bottom: 3px; }
.ccard-head h3 { font-size: .98rem; font-weight: 720; letter-spacing: -.015em; line-height: 1.3; }
.ccard-tools { display: flex; gap: 4px; flex: none; }
.ccard-tools .btn { min-height: 30px; padding: 0 9px; font-size: .72rem; color: var(--text-2); }
.ccard-tools .btn[aria-pressed="true"] { background: var(--surface-2); border-color: var(--line-strong); color: var(--text); }
.takeaway { padding: 6px 18px 0; color: var(--text-2); font-size: .82rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
.takeaway b { color: var(--text); font-weight: 680; }
.ccard-body { padding: 10px 14px 4px 10px; min-width: 0; flex: 1; }
.ccard-body.pad { padding: 12px 18px 6px; }
.twin { padding: 10px 18px 6px; }
.twin .tbl-wrap { max-height: 340px; overflow: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0 18px; color: var(--text-2); font-size: .74rem; font-weight: 550; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.lg { display: inline-block; flex: none; }
.lg.line { width: 16px; height: 0; border-top: 2px solid var(--k); border-radius: 2px; }
.lg.dash { width: 16px; height: 0; border-top: 2px dashed var(--k); }
.lg.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--k); box-shadow: 0 0 0 2px var(--surface); }
.lg.sq { width: 10px; height: 10px; border-radius: 3px; background: var(--k); }
.lg.band { width: 14px; height: 10px; border-radius: 2px; background: var(--k); border: 1px solid color-mix(in srgb, var(--k) 40%, transparent); }
.ccard-foot { padding: 8px 18px 14px; color: var(--text-3); font-size: .72rem; line-height: 1.5; }
.ccard-foot b { color: var(--text-2); font-weight: 650; }

/* ---- Biblioteca VGCharts -------------------------------------------------- */
.vg-chart { position: relative; }
.vg-plot { position: relative; width: 100%; }
.vg-plot:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--r-s); }
.vg-svg { overflow: visible; font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
.vg-svg text { font-family: var(--font-sans); }
.vg-tick { font-size: 11.5px; font-weight: 500; }
.vg-tick-strong { font-weight: 750; }
.vg-axis-title { font-size: 11.5px; font-weight: 650; letter-spacing: .01em; }
.vg-chart-title { font-size: 12px; font-weight: 700; }
.vg-band-label { font-size: 11px; font-weight: 650; letter-spacing: .02em; }
.vg-ref-label { font-size: 11.5px; font-weight: 650; }
.vg-end-label { font-size: 11.5px; font-weight: 650; }
.vg-point-label { font-size: 12.5px; font-weight: 750; paint-order: stroke; stroke: var(--c-surface); stroke-width: 4px; stroke-linejoin: round; }
.vg-point-sub { font-size: 11.5px; font-weight: 550; paint-order: stroke; stroke: var(--c-surface); stroke-width: 4px; stroke-linejoin: round; }
.vg-value-label { font-size: 11.5px; font-weight: 600; }
.vg-value-label.strong { font-weight: 780; font-size: 12.5px; }
.vg-row-label { font-size: 12.5px; font-weight: 600; }
.vg-row-label.strong { font-weight: 780; }
.vg-row-sub { font-size: 11px; font-weight: 500; }
.vg-halo { paint-order: stroke; stroke: var(--c-surface); stroke-width: 4px; stroke-linejoin: round; }
.vg-bar { transition: opacity var(--t-fast); }
.vg-bar.hl { opacity: .78; }
.vg-hit { cursor: crosshair; }
.vg-hit-pt { cursor: pointer; }
.vg-chart-erro { padding: 24px; color: var(--text-3); font-size: .8rem; }
.vg-tip {
  position: absolute; left: 0; top: 0; z-index: 20; pointer-events: none; min-width: 140px; max-width: 280px; padding: 9px 11px 10px;
  border-radius: 9px; background: var(--surface-3); box-shadow: var(--shadow-pop); color: var(--text); font-size: .76rem; line-height: 1.35;
  opacity: 0; transition: opacity .12s; font-variant-numeric: tabular-nums;
}
.vg-tip.on { opacity: 1; }
.vg-tip-t { color: var(--text-2); font-size: .7rem; font-weight: 700; letter-spacing: .02em; margin-bottom: 5px; }
.vg-tip-r { display: flex; align-items: center; gap: 7px; padding: 1px 0; white-space: nowrap; }
.vg-tip-r b { font-weight: 750; }
.vg-tip-r span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.vg-key { display: inline-block; flex: none; width: 12px; height: 0; border-top: 2px solid var(--k); border-radius: 2px; }
.vg-key.tracejada { border-top-style: dashed; }
.vg-key.ponto { width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--k); }
.vg-key.barra { width: 9px; height: 9px; border: 0; border-radius: 2px; background: var(--k); }

/* ---- Diagramas técnicos --------------------------------------------------- */
.diag text { font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
.diag .dim { font-size: 12px; font-weight: 700; }
.diag .dim-s { font-size: 11px; font-weight: 550; }
.diag .lbl { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.diag .math { font-family: var(--font-math); font-style: italic; font-size: 14px; }

/* ---- Tabelas auxiliares --------------------------------------------------- */
.tbl .bar-cell { position: relative; min-width: 120px; }
.tbl .ibar { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.tbl .ibar i { display: block; height: 8px; border-radius: 0 4px 4px 0; background: var(--c-s1); min-width: 2px; }
.tbl .ibar i.em { background: var(--c-em); }
.tbl .ibar i.de { background: var(--c-deemph); }
.tbl td .st { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; }
.tbl td .st svg { width: 14px; height: 14px; }
.tbl td .st.ok { color: var(--ok); } .tbl td .st.falha { color: var(--fail); } .tbl td .st.atencao { color: var(--warn); }
.tbl .tag-mini { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: var(--accent-wash); color: var(--accent); border: 1px solid var(--accent-line); }
.tbl .tag-mini.t { background: var(--teal-wash); color: var(--teal); border-color: color-mix(in srgb, var(--teal) 40%, transparent); }
.tbl.compact th, .tbl.compact td { padding: 6px 10px; }
.dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0; font-size: .82rem; }
.dl > div { display: contents; }
.dl dt, .dl dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dl dt { color: var(--text-2); }
.dl dd { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; padding-left: 12px; }
.dl > div:last-child dt, .dl > div:last-child dd { border-bottom: 0; }
.dl dd small { color: var(--text-3); font-weight: 550; }

/* ---- Memória de cálculo ---------------------------------------------------- */
.mem-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 22px; align-items: start; }
.mem-index { position: sticky; top: calc(var(--appbar-h) + var(--lab-areas-h) + 132px); max-height: calc(100dvh - var(--appbar-h) - var(--lab-areas-h) - 150px); overflow-y: auto; display: grid; gap: 1px; padding-right: 4px; scrollbar-width: thin; }
.mem-index h4 { margin: 12px 0 4px; color: var(--text-3); font-size: .64rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.mem-index h4:first-child { margin-top: 0; }
.mem-index a { display: grid; grid-template-columns: 34px minmax(0, 1fr) 10px; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; color: var(--text-2); font-size: .76rem; }
.mem-index a:hover { background: var(--surface); color: var(--text); }
.mem-index a .i { color: var(--accent); font-weight: 800; font-size: .68rem; font-variant-numeric: tabular-nums; }
.mem-index a.m .i { color: var(--teal); }
.mem-index a span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mem-index a .d { width: 7px; height: 7px; border-radius: 50%; }
.mem-index a .d.ok { background: var(--ok); } .mem-index a .d.falha { background: var(--fail); } .mem-index a .d.aviso { background: var(--warn); }
.mem-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.mem-toolbar p { color: var(--text-3); font-size: .78rem; max-width: 70ch; }
.mem-group-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
.mem-group-title:first-child { margin-top: 0; }
.mem-group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.mem-list { display: grid; gap: 10px; }
.mem-item { scroll-margin-top: calc(var(--appbar-h) + var(--lab-areas-h) + 140px); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 20px; padding: 16px 18px 15px; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--surface); transition: border-color .4s, box-shadow .4s; }
.mem-item.flash { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.mem-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.mem-id { display: inline-grid; place-items: center; min-width: 34px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--accent-wash); color: var(--accent); border: 1px solid var(--accent-line); font-size: .7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.mem-item.m .mem-id { background: var(--teal-wash); color: var(--teal); border-color: color-mix(in srgb, var(--teal) 40%, transparent); }
.mem-h h3 { font-size: .94rem; font-weight: 700; letter-spacing: -.01em; }
.mem-src { color: var(--text-3); font-size: .72rem; font-weight: 550; }
.mem-src::before { content: "· "; }
.mem-res { grid-row: 1 / span 2; grid-column: 2; align-self: start; justify-self: end; display: grid; justify-items: end; gap: 6px; }
.mem-res-v { display: flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mem-res-v math { font-size: 1rem; }
.mem-res-v b { font-size: 1.02rem; font-weight: 760; letter-spacing: -.02em; }
.mem-res-v small { color: var(--text-2); font-size: .74rem; font-weight: 600; }
.mem-eq { grid-column: 1; display: grid; gap: 6px; padding: 10px 0 2px; overflow-x: auto; }
.mem-eq math { font-size: 1.08rem; margin: 0; text-align: left; }
.mem-eq .ln { display: flex; align-items: center; min-height: 30px; }
.mem-eq .ln + .ln { padding-left: 18px; }
.mem-vars { grid-column: 1 / -1; display: grid; grid-template-columns: max-content max-content minmax(0, 1fr); gap: 3px 14px; margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: .78rem; color: var(--text-2); }
.mem-vars .vs math { font-size: .98rem; }
.mem-vars .vv { color: var(--text); font-weight: 650; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mem-note { grid-column: 1 / -1; color: var(--text-3); font-size: .78rem; line-height: 1.55; margin-top: 6px; }

/* ---- Tabelas 8 · 9 (mapa de calor) ---------------------------------------- */
.tb-ctrls { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.tb-ctrls .fld { min-width: 160px; }
.tb-ctrls .fld.w { min-width: 240px; }
.tb-ctrls .sw { min-height: 40px; padding: 0 4px; }
.tb-ctrls .grow { flex: 1; }
.tb-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0 10px; }
.tb-title h3 { font-size: 1.02rem; font-weight: 740; letter-spacing: -.015em; }
.tb-title h3 span { color: var(--accent); }
.tb-title p { color: var(--text-3); font-size: .78rem; }
.heat-wrap { position: relative; overflow: auto; max-height: calc(100dvh - var(--appbar-h) - 210px); border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
table.heat { border-collapse: separate; border-spacing: 0; font-size: .78rem; font-variant-numeric: tabular-nums; width: 100%; }
.heat th, .heat td { padding: 0; height: 30px; text-align: center; white-space: nowrap; }
.heat thead th { position: sticky; top: 0; z-index: 3; padding: 8px 6px; background: var(--surface-2); color: var(--text-2); font-weight: 650; font-size: .7rem; border-bottom: 1px solid var(--line); line-height: 1.25; }
.heat thead th small { display: block; color: var(--text-3); font-weight: 550; font-size: .66rem; }
.heat th.rh { position: sticky; left: 0; z-index: 2; padding: 0 12px; background: var(--surface-2); color: var(--text-2); font-weight: 650; text-align: right; border-right: 1px solid var(--line); }
.heat thead th.rh { z-index: 4; text-align: right; }
.heat td { min-width: 62px; border-right: 1px solid color-mix(in srgb, var(--surface) 70%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--surface) 70%, transparent); position: relative; cursor: default; }
.heat tr.rsel th.rh { color: var(--accent); background: color-mix(in srgb, var(--accent-wash) 100%, var(--surface-2)); }
.heat th.csel { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.heat td.csel::before, .heat tr.rsel td::before { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 999px rgba(255,255,255,.0); }
.heat tr.rsel td { box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
.heat td.csel { box-shadow: inset 1px 0 0 var(--accent), inset -1px 0 0 var(--accent); }
.heat tr.rsel td.csel { box-shadow: inset 0 0 0 2px var(--accent); font-weight: 800; }
.heat td.err::after { content: ""; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--fail); box-shadow: 0 0 0 1.5px var(--surface); }
.heat td:hover { outline: 2px solid var(--text); outline-offset: -2px; z-index: 1; }
.heat-legend { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; color: var(--text-3); font-size: .74rem; }
.heat-legend .ramp { width: 160px; height: 10px; border-radius: 3px; }
.heat-legend .sw-cell { display: inline-block; width: 14px; height: 14px; border-radius: 3px; box-shadow: inset 0 0 0 2px var(--accent); vertical-align: -3px; margin-right: 6px; }
.heat-legend .err-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--fail); margin-right: 6px; }

/* ---- Ferramentas ------------------------------------------------------------ */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
.tool { display: grid; grid-template-rows: auto auto 1fr auto; gap: 12px; padding: 18px; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--surface); }
.tool-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tool-h .overline { display: block; margin-bottom: 3px; }
.tool-h h3 { font-size: .98rem; font-weight: 720; letter-spacing: -.015em; }
.tool-n { color: var(--text-3); font-size: .72rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tool p.desc { color: var(--text-3); font-size: .78rem; }
.tool-f { display: grid; gap: 10px; align-content: start; }
.tool-eq { padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); text-align: center; overflow-x: auto; }
.tool-out { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r); background: linear-gradient(180deg, var(--accent-wash), transparent), var(--surface-2); border: 1px solid var(--accent-line); min-height: 74px; }
.tool-out span { color: var(--text-3); font-size: .64rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.tool-out b { font-size: 1.5rem; font-weight: 780; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.tool-out b small { font-size: .8rem; color: var(--text-2); font-weight: 600; letter-spacing: 0; }
.tool-out em { font-style: normal; color: var(--text-2); font-size: .76rem; }
.tool-out.err { background: var(--fail-bg); border-color: var(--fail-line); }
.tool-out.err b { font-size: .86rem; color: var(--fail); letter-spacing: 0; }

/* ---- Referências ------------------------------------------------------------ */
.refs { display: grid; gap: var(--gap); }
.ref-card { padding: 18px 20px; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--surface); }
.ref-card > h3 { font-size: 1rem; font-weight: 720; letter-spacing: -.015em; margin-bottom: 4px; }
.ref-card > p.lead { color: var(--text-3); font-size: .78rem; margin-bottom: 12px; }
.errata { display: grid; gap: 8px; }
.errata > div { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.errata > div:first-child { border-top: 0; padding-top: 0; }
.errata .eid { align-self: start; display: inline-grid; place-items: center; height: 24px; border-radius: 6px; background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); font-weight: 800; font-size: .72rem; }
.errata h4 { font-size: .86rem; font-weight: 700; margin-bottom: 3px; }
.errata p { color: var(--text-2); font-size: .8rem; line-height: 1.55; }
.hip { margin: 0; padding-left: 18px; color: var(--text-2); font-size: .82rem; line-height: 1.6; display: grid; gap: 4px; }
.hip b { color: var(--text); font-weight: 650; }

/* ---- Aviso rápido (toast) -------------------------------------------------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 200; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 16px; border-radius: 10px; background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-pop); font-size: .82rem; font-weight: 600; transition: all .25s var(--ease); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 16px; height: 16px; color: var(--ok); }

/* ---- Alternância Dados | Resultados (celular) ------------------------------- */
.mob-switch { display: none; }

/* ---- Responsivo -------------------------------------------------------------- */
@media (max-width: 1360px) {
  .g-7-5, .g-5-7 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1180px) {
  :root { --side-w: 340px; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mem-layout { grid-template-columns: minmax(0, 1fr); }
  .mem-index { display: none; }
  .appbar-title .overline { display: none; }
}
@media (max-width: 1020px) {
  .verdicts, .g2 { grid-template-columns: minmax(0, 1fr); }
  .appbar-actions .btn .lbl { display: none; }
  .appbar-actions .btn:not(.btn-icon) { padding: 0 10px; }
}
@media (max-width: 1050px) {
  :root { --appbar-h: 54px; }
  body.app { padding-bottom: 66px; }
  .lab { display: block; }
  .dados { position: static; height: auto; overflow: visible; border-right: 0; }
  .lab[data-vista="resultados"] .dados { display: none; }
  .lab[data-vista="dados"] .resultados { display: none; }
  .resultados { padding: 0 16px 40px; }
  .res-top { margin: 0 -16px; padding: 12px 16px 0; }
  .dados-head { top: calc(var(--appbar-h) + var(--lab-areas-h)); }
  .mob-switch { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 70; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px;
    border-radius: 14px; background: var(--surface-3); box-shadow: var(--shadow-pop); }
  .mob-switch button { min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); font-weight: 700; font-size: .86rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
  .mob-switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
  .mob-switch .badge-mini { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
  .appbar-title { display: none; }
  .appbar-sep { display: none; }
  .brand-back .lbl { display: none; }
  .lab-areas-label { display: none; }
  .lab-areas { justify-content: stretch; padding: 0 10px; }
  .lab-area { flex: 1; justify-content: center; padding-inline: 10px; }
  .case-chips { width: 100%; }
  .st-chip { flex: 1; justify-content: flex-start; }
}
@media (max-width: 620px) {
  .lab-area-detail { display: none; }
  .g3 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .minis { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
  .mini:nth-child(3) { padding-left: 0; border-left: 0; }
  .fld-row.r3 { grid-template-columns: 1fr 1fr; }
  .mem-item { grid-template-columns: minmax(0, 1fr); }
  .mem-res { grid-row: auto; grid-column: 1; justify-self: start; justify-items: start; }
  .mem-vars { grid-template-columns: max-content minmax(0, 1fr); }
  .mem-vars .vd { grid-column: 1 / -1; margin: -2px 0 4px; color: var(--text-3); }
  .ccard-head { padding: 14px 14px 0; }
  .takeaway, .legend, .ccard-foot, .twin { padding-left: 14px; padding-right: 14px; }
  .ccard-body { padding: 8px 6px 2px 4px; }
  .appbar { gap: 10px; padding: 0 10px; }
  .tool { padding: 16px; }
  .tools { grid-template-columns: minmax(0, 1fr); }
  .case-id h1 { font-size: 1.06rem; }
  .hero .val { font-size: 2.2rem; }
}

/* ---- Impressão (o relatório tem página própria) ----------------------------- */
@media print {
  .appbar, .lab-areas, .dados, .mob-switch, .tabs, .ccard-tools { display: none !important; }
  .lab { display: block; }
  .res-top { position: static; background: none; backdrop-filter: none; }
}

/* ---- Ajustes finais ---------------------------------------------------------- */
#aviso-erro { margin-top: 18px; }
#aviso-erro .erro-geral { margin-top: 0; }
#aviso-erro a { color: var(--text); text-decoration: underline; text-decoration-color: var(--fail-line); text-underline-offset: 3px; }
.tabpanel { transition: opacity var(--t); }

/* ---- Refinamentos de leitura --------------------------------------------------- */
.tabpanel > :first-child { margin-top: 0; }
.tabpanel > .g2, .tabpanel > .g3, .tabpanel > .g-7-5, .tabpanel > .g-5-7 { margin-top: var(--gap); }
.kpis.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpis.k6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi-v.long { font-size: 1.14rem; letter-spacing: -.02em; }
.kpi:has(> .ico) .kpi-s { padding-right: 20px; }
.tbl td.wrap, .tbl th.wrap { white-space: normal; text-align: left; min-width: 200px; }

/* fluxo do cálculo em duas linhas (eixo · mancal) */
.pipes { display: grid; gap: 10px; }
.pipe-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: stretch; gap: 12px; }
.pipe-lbl { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding-left: 12px; border-left: 2px solid var(--accent); }
.pipe-lbl b { font-size: .8rem; font-weight: 720; }
.pipe-lbl small { color: var(--text-3); font-size: .7rem; }
.pipe-row.m .pipe-lbl { border-left-color: var(--teal); }
.pipe-row .pipeline { grid-auto-columns: minmax(0, 1fr); }

/* desenho de montagem + ficha técnica */
.mont { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 6px 22px; align-items: center; padding: 6px 18px 4px 10px; }
.mont-spec { display: grid; gap: 14px; align-content: center; }
.mont-spec h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; color: var(--text-3); font-size: .64rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.mont-spec h4 i { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.mont-spec h4.m i { background: var(--teal); }
.mont-spec .dl { font-size: .8rem; }
.mont-spec .dl dt, .mont-spec .dl dd { padding: 6px 0; }

.tb-acoes { display: flex; gap: 6px; margin-left: auto; align-self: flex-end; }
.crit-def { display: grid; gap: 8px; padding: 4px 18px 6px; }
.crit-def > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; font-size: .78rem; color: var(--text-2); line-height: 1.45; }
.crit-def b { color: var(--text); font-weight: 680; }

@media (max-width: 1360px) {
  .kpis.k6 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .kpis.k5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis.k6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mont { grid-template-columns: minmax(0, 1fr); }
  .mont-spec { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .kpis.k5, .kpis.k6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipe-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .pipe-lbl { flex-direction: row; align-items: baseline; gap: 8px; }
  .pipe-row .pipeline { grid-auto-columns: minmax(112px, 1fr); }
  .mont { padding: 4px 6px; }
  .mont-spec { grid-template-columns: minmax(0, 1fr); }
}
