/* ═══════════════════════════════════════════════════════════════
   SunFlow — Design System (tema escuro)

   Hierarquia por tipografia, espaço e filete — não por caixa.
   Superfície elevada é exceção com razão semântica, não o
   recipiente padrão de toda informação.
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* ── Superfícies ────────────────────────────────────────── */
    --bg:         #0B0C0E;
    --bg-2:       #101216;
    --sidebar-bg: #0D0F12;
    --panel:      #15181D;
    --panel-2:    #1A1E24;

    /* ── Traços ─────────────────────────────────────────────── */
    --line:       #2A2F37;
    --line-soft:  #22262D;

    /* ── Tinta ──────────────────────────────────────────────── */
    --text:       #F4F5F7;
    --muted:      #9299A4;   /* ~6:1 no bg — o piso para texto real */
    --muted-2:    #6F7680;   /* decorativo: ícones, filetes, rótulos de eixo */

    /* ── Semântica de dado. Uma cor, um significado, em todo o
          produto: trocar entre telas destrói a leitura. ─────── */
    --yellow:     #F6C945;   /* geração solar + acento da marca */
    --yellow-2:   #D9A90E;
    --yellow-wash:rgba(246, 201, 69, .10);
    --blue:       #60A5FA;   /* consumo */
    --blue-wash:  rgba(96, 165, 250, .12);
    --green:      #45C98D;   /* economia, saldo positivo, saúde */
    --green-wash: rgba(69, 201, 141, .10);
    --red:        #F06B6B;   /* problema */
    --red-wash:   rgba(240, 107, 107, .10);
    --gray:       #58606B;   /* referência, período anterior */

    /* ── Forma ──────────────────────────────────────────────── */
    --radius:     14px;
    --radius-sm:  10px;
    --radius-xs:  8px;

    /* No escuro a separação vem de superfície e borda; sombra quase
       não aparece e por isso quase não é usada. */
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .30);
    --shadow-2: 0 10px 30px -8px rgba(0, 0, 0, .55);

    /* ── Espaço: múltiplos de 4 ─────────────────────────────── */
    --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
    --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;

    /* ── Tipografia ─────────────────────────────────────────── */
    --font: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --t-page:    29px;
    --t-section: 14px;
    --t-kpi:     28px;
    --t-kpi-lg:  35px;
    --t-body:    13px;
    --t-meta:    11px;

    --ease: cubic-bezier(.22, 1, .36, 1);
    --fast: 160ms;

    /* Escala semântica de empilhamento. Nunca valores arbitrários. */
    --z-sticky: 100;
    --z-drawer: 200;
    --z-modal:  300;
    --z-tip:    400;

    --sidebar: 232px;
    --sidebar-min: 72px;

    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: var(--t-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
a { color: inherit; }

:where(a, button, input, select, [tabindex]):focus-visible {
    outline: 2px solid var(--yellow);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

/* Números são leitura de instrumento: tabulares, para a casa decimal
   não dançar quando o valor atualiza. */
.num { font-variant-numeric: tabular-nums; letter-spacing: -.03em; }

/* ═══ APP SHELL ═══════════════════════════════════════════════ */

.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100svh; }
.app[data-recolhida="1"] { grid-template-columns: var(--sidebar-min) 1fr; }

/* O véu da gaveta é o TERCEIRO filho do grid. Sem `display:none` aqui
   ele ocupa a primeira coluna no desktop, empurrando a sidebar para o
   meio da tela e o conteúdo para a linha de baixo. Só existe na gaveta. */
.veu { display: none; }

/* ── Sidebar ──────────────────────────────────────────────── */

.lateral {
    position: sticky;
    top: 0;
    height: 100svh;
    display: flex;
    flex-direction: column;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--line-soft);
    padding: 18px 14px;
    overflow: hidden;
}

.lat-marca { display: flex; align-items: center; gap: 10px; padding: 6px var(--s2) var(--s5); }

.lat-logo {
    width: 32px; height: 32px; flex: none;
    border-radius: 9px;
    background: var(--yellow);
    color: #111;
    display: grid; place-items: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}

.lat-nome { min-width: 0; }
.lat-nome strong { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.lat-nome span { display: block; color: var(--muted); font-size: var(--t-meta); margin-top: 2px; white-space: nowrap; }

.lat-nav { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }

.lat-grupo { margin-top: 14px; }

.lat-rotulo {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: #646B75;
    padding: 0 10px 7px;
}

.lat-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 11px;
    margin: 2px 0;
    border-radius: 9px;
    color: #AEB4BC;
    text-decoration: none;
    font-size: var(--t-body);
    white-space: nowrap;
    transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.lat-item svg { flex: none; color: #8D949E; transition: color var(--fast) var(--ease); }
.lat-item:hover { background: #15181C; color: #fff; }
.lat-item:hover svg { color: #AEB4BC; }

.lat-item[aria-current="page"] { background: #171A1F; color: #fff; }
.lat-item[aria-current="page"] svg { color: var(--yellow); }
/* Marca de página ativa: barra curta e arredondada, colada à esquerda
   do item. Indicador de navegação — não acento decorativo de card. */
.lat-item[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: 0; top: 8px; bottom: 8px;
    width: 3px;
    border-radius: 3px;
    background: var(--yellow);
}

.lat-item[aria-disabled="true"] { color: #5E656E; cursor: default; }
.lat-item[aria-disabled="true"]:hover { background: none; color: #5E656E; }
.lat-item[aria-disabled="true"] svg { color: #4E555D; }
.lat-breve {
    margin-left: auto;
    font-size: 9px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted-2);
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    padding: 1px 6px;
}

.lat-pe { margin-top: auto; padding: 10px 0 0; border-top: 1px solid var(--line-soft); }

/* Local ativo: o contexto de tudo que a tela mostra, então mora fixo na
   navegação e não escondido num menu de perfil. */
.lat-local {
    display: block;
    width: 100%;
    background: #13161A;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px;
    margin-bottom: 10px;
    text-align: left;
    color: var(--text);
    cursor: pointer;
    transition: border-color var(--fast) var(--ease);
}
.lat-local:hover:not(:disabled) { border-color: #3A414C; }
.lat-local:disabled { cursor: default; }
.lat-local small { display: block; color: var(--muted); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.lat-local b { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lat-usuario {
    display: flex; align-items: center; gap: 10px;
    padding: 8px;
    border-radius: 9px;
    color: #AEB4BC;
    text-decoration: none;
    font-size: 12px;
    transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.lat-usuario:hover { background: #15181C; color: #fff; }
.lat-avatar {
    width: 28px; height: 28px; flex: none;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: #171A1F;
    color: var(--text);
    display: grid; place-items: center;
    font-size: 11px; font-weight: 700;
}
.lat-usuario-txt { min-width: 0; flex: 1; }
.lat-usuario-txt b { display: block; color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lat-usuario-txt span { display: block; font-size: 10px; color: var(--muted-2); }

/* Recolhida: ficam os ícones. */
.app[data-recolhida="1"] .lat-nome,
.app[data-recolhida="1"] .lat-rotulo,
.app[data-recolhida="1"] .lat-item span:not(.lat-breve),
.app[data-recolhida="1"] .lat-breve,
.app[data-recolhida="1"] .lat-local,
.app[data-recolhida="1"] .lat-usuario-txt { display: none; }
.app[data-recolhida="1"] .lateral { padding-inline: 10px; }
.app[data-recolhida="1"] .lat-marca { justify-content: center; padding-inline: 0; }
.app[data-recolhida="1"] .lat-item { justify-content: center; padding-inline: 0; }
.app[data-recolhida="1"] .lat-usuario { justify-content: center; }

/* ── Topbar ───────────────────────────────────────────────── */

.topo {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    height: 66px;
    display: flex;
    align-items: center;
    gap: var(--s4);
    padding: 0 26px;
    background: rgba(11, 12, 14, .94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line-soft);
}

.icone-btn {
    display: grid; place-items: center;
    width: 32px; height: 32px; flex: none;
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    background: none;
    color: var(--muted);
    cursor: pointer;
    transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.icone-btn:hover { background: #15181C; color: var(--text); }

.trilha { display: flex; align-items: center; gap: var(--s2); font-size: 12px; color: var(--muted); }
.trilha b { color: #fff; font-weight: 600; }
.trilha svg { color: var(--muted-2); }

.topo-dir { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.controle {
    background: #121418;
    border: 1px solid var(--line);
    color: #D8DCE1;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 12px;
}

/* Sinal de vida da coleta. Ponto + texto: nunca cor sozinha. */
.sinal { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #AEB4BC; white-space: nowrap; }
.sinal::before {
    content: "";
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px var(--green-wash);
}
.sinal[data-estado="parado"]::before { background: var(--red);   box-shadow: 0 0 0 4px var(--red-wash); }
.sinal[data-estado="noite"]::before  { background: var(--muted-2); box-shadow: 0 0 0 4px rgba(111,118,128,.12); }

@keyframes pulsar { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.sinal[data-estado="vivo"]::before { animation: pulsar 2.4s var(--ease) infinite; }

/* ── Conteúdo ─────────────────────────────────────────────── */

.conteudo { padding: 28px 30px 48px; max-width: 1500px; margin: 0 auto; }

.pag-topo {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--s5);
    margin-bottom: 26px;
}
.pag-titulo { margin: 0 0 6px; font-size: var(--t-page); font-weight: 650; letter-spacing: -.03em; }
.pag-sub { margin: 0; color: var(--muted); font-size: var(--t-body); max-width: 76ch; text-wrap: pretty; }

.secao { margin-top: var(--s4); }

.secao-cab {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--s4);
    padding: 17px 18px 14px;
    border-bottom: 1px solid var(--line-soft);
}
.secao-titulo { font-size: var(--t-section); font-weight: 600; }
.secao-nota { font-size: var(--t-meta); color: var(--muted); margin-top: 4px; }
.secao-acoes { display: flex; align-items: center; gap: var(--s2); flex: none; }

/* ═══ COMPONENTES ═════════════════════════════════════════════ */

.painel {
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
}
.painel-pad { padding: 18px; }

/* ── Régua de KPIs ────────────────────────────────────────────
   Filete no TOPO em vez de caixa: hierarquia sem recipiente. O KPI
   dominante recebe a régua âmbar e mais largura — peso vem da
   proporção, não só do tamanho da fonte. */
.regua-kpi {
    display: grid;
    grid-template-columns: 1.2fr repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}
.kpi { border-top: 1px solid var(--line); padding: 16px 4px 6px 0; min-height: 105px; }
.kpi-primario { border-top-color: var(--yellow); }

.kpi-rot {
    color: var(--muted);
    font-size: var(--t-meta);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 10px;
}
.kpi-val { font-size: var(--t-kpi); font-weight: 650; letter-spacing: -.03em; line-height: 1.1; }
.kpi-primario .kpi-val { font-size: var(--t-kpi-lg); }
.kpi-val small { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 3px; }
.kpi-primario .kpi-val small { font-size: 15px; }
.kpi-nota { display: block; color: var(--muted); font-size: var(--t-meta); margin-top: 7px; }

.delta-sobe  { color: var(--green); }
.delta-desce { color: var(--red); }

/* ── Abas de período ──────────────────────────────────────── */
.abas { display: flex; gap: 4px; }
.aba {
    border: 1px solid var(--line);
    background: transparent;
    color: #A3A9B2;
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    font-size: 10px;
    letter-spacing: .04em;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.aba:hover { color: #fff; }
.aba[aria-selected="true"] { background: #242830; color: #fff; border-color: #323844; }

/* ── Botões ───────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 34px;
    padding: 0 14px;
    color: #D8DCE1;
    background: #121418;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.btn:hover { background: #191D22; border-color: #3A414C; color: #fff; }
.btn-primario { background: var(--yellow); border-color: var(--yellow); color: #111; font-weight: 600; }
.btn-primario:hover { background: var(--yellow-2); border-color: var(--yellow-2); color: #111; }
.btn-sm { min-height: 28px; padding: 0 10px; font-size: 11px; }

/* ── Selo de estado ───────────────────────────────────────── */
.selo {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10px;
    letter-spacing: .04em;
    border: 1px solid var(--line);
    color: var(--muted);
    background: #121418;
}
.selo-ok   { color: var(--green);  border-color: rgba(69,201,141,.28);  background: var(--green-wash); }
.selo-warn { color: var(--yellow); border-color: rgba(246,201,69,.28);  background: var(--yellow-wash); }
.selo-neg  { color: var(--red);    border-color: rgba(240,107,107,.28); background: var(--red-wash); }

/* ── Achados: lista, não card por item ────────────────────── */
.achados { padding: 4px 18px 18px; }
.achado { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.achado:last-child { border-bottom: 0; }
.achado-marca { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--yellow); }
.achado-marca[data-t="ok"]   { background: var(--green); }
.achado-marca[data-t="info"] { background: var(--blue); }
.achado-marca[data-t="warn"] { background: var(--yellow); }
.achado-marca[data-t="neg"]  { background: var(--red); }
.achado-txt { flex: 1; min-width: 0; }
.achado-txt b { font-size: 12px; font-weight: 600; }
.achado-txt p { margin: 4px 0 0; color: var(--muted); font-size: var(--t-meta); line-height: 1.45; text-wrap: pretty; }

/* ── Linhas de estado (chave → valor) ─────────────────────── */
.linhas { margin-top: 18px; border-top: 1px solid var(--line-soft); }
.linha { display: flex; justify-content: space-between; gap: var(--s4); padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: var(--t-meta); }
.linha span { color: var(--muted); }
.linha b { font-weight: 600; }
.linha .ok { color: var(--green); }

/* ── Gráfico ──────────────────────────────────────────────── */
.gfx { width: 100%; display: block; overflow: visible; }
.gfx .grade  { stroke: #20242A; stroke-width: 1; }
.gfx .zero   { stroke: #252930; stroke-width: 1; }
.gfx .rot    { fill: #666E78; font-size: 10px; font-family: var(--font); }
.gfx .l-gen  { fill: none; stroke: var(--yellow); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.gfx .l-cons { fill: none; stroke: var(--blue);   stroke-width: 2; stroke-linejoin: round; }
.gfx .a-gen  { fill: var(--yellow); opacity: .10; }
.gfx .b-gen  { fill: var(--yellow); }
.gfx .b-cons { fill: var(--blue); }
.gfx .agora  { stroke: var(--muted-2); stroke-width: 1; stroke-dasharray: 3 3; }

.legenda { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; color: #8E959E; font-size: 10px; }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.chave { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.chave-gen  { background: var(--yellow); }
.chave-cons { background: var(--blue); }
.chave-hist { background: var(--gray); }

.tip {
    position: fixed;
    z-index: var(--z-tip);
    pointer-events: none;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-2);
    padding: 9px 11px;
    font-size: 11px;
    min-width: 132px;
    opacity: 0;
    transition: opacity var(--fast) var(--ease);
}
.tip[data-vis="1"] { opacity: 1; }
.tip-t { font-weight: 600; margin-bottom: 6px; font-size: 12px; }
.tip-l { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.tip-l b { margin-left: auto; color: var(--text); font-weight: 600; }

/* ── Fluxo energético ─────────────────────────────────────── */
.fluxo-topo { text-align: center; padding: 10px 0 18px; }
.fluxo-topo .valor { font-size: 42px; font-weight: 650; letter-spacing: -.04em; }
.fluxo-topo .unid { font-size: 13px; color: var(--muted); margin-left: 4px; }
.fluxo-topo small { display: block; color: var(--muted); margin-top: 6px; font-size: var(--t-meta); }

.fluxo { display: grid; grid-template-columns: 1fr 28px 1fr 28px 1fr; align-items: center; gap: var(--s2); margin-top: 18px; }
.no { background: #111418; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; text-align: center; }
.no b { font-size: 14px; }
.no small { display: block; color: var(--muted); font-size: 9px; margin-top: 5px; letter-spacing: .07em; }
.seta { color: var(--yellow); text-align: center; font-size: 18px; }

/* ── Barra de progresso ───────────────────────────────────────
   O preenchimento escala em vez de mudar a largura: animar `width`
   provoca reflow a cada quadro. `--pct` (0..1) vem inline do PHP. */
.trilho { height: 6px; background: #1D2127; border-radius: 999px; overflow: hidden; }
.trilho i {
    display: block; width: 100%; height: 100%;
    border-radius: 999px;
    background: var(--yellow);
    transform: scaleX(var(--pct, 0));
    transform-origin: left center;
    transition: transform 400ms var(--ease);
}

/* ── Estado vazio ─────────────────────────────────────────── */
.vazio { padding: var(--s10) var(--s6); text-align: center; }
.vazio-ic { color: var(--muted-2); margin-bottom: var(--s4); }
.vazio h3 { margin: 0 0 var(--s2); font-size: 14px; font-weight: 600; }
.vazio p { margin: 0 auto; max-width: 52ch; color: var(--muted); font-size: 12px; text-wrap: pretty; }

/* ── Malhas de página ─────────────────────────────────────── */
.grade-2 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, .8fr); gap: 16px; }
.grade-1-1 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }

/* ═══ RESPONSIVO ══════════════════════════════════════════════ */

@media (max-width: 1100px) {
    .app { grid-template-columns: var(--sidebar-min) 1fr; }
    .lat-nome, .lat-rotulo, .lat-item span:not(.lat-breve), .lat-breve,
    .lat-local, .lat-usuario-txt { display: none; }
    .lateral { padding-inline: 10px; }
    .lat-marca { justify-content: center; padding-inline: 0; }
    .lat-item { justify-content: center; padding-inline: 0; }
    .lat-usuario { justify-content: center; }
    #colapsa { display: none; }

    .regua-kpi { grid-template-columns: 1fr 1fr; }
    .grade-2, .grade-1-1 { grid-template-columns: 1fr; }
    .conteudo { padding: 24px 20px 40px; }
}

/* Abaixo de 720px a sidebar vira gaveta. */
@media (max-width: 720px) {
    /* `.app[data-recolhida]` tem especificidade maior que `.app`, e media
       query não acrescenta especificidade — sem repetir o seletor aqui, a
       preferência salva no desktop deixaria uma calha vazia no celular. */
    .app,
    .app[data-recolhida="1"] { grid-template-columns: 1fr; }

    .lateral {
        position: fixed;
        inset: 0 auto 0 0;
        width: var(--sidebar);
        z-index: var(--z-drawer);
        transform: translateX(-100%);
        transition: transform 220ms var(--ease);
        box-shadow: var(--shadow-2);
        padding: 18px 14px;
    }
    .app[data-gaveta="1"] .lateral { transform: none; }
    /* Na gaveta a sidebar volta a ser larga: os rótulos reaparecem. */
    .lat-nome, .lat-rotulo, .lat-item span:not(.lat-breve), .lat-breve,
    .lat-local, .lat-usuario-txt { display: revert; }
    .lat-marca, .lat-item, .lat-usuario { justify-content: flex-start; }
    .lat-item { padding: 10px 11px; }

    .veu {
        display: block;
        position: fixed; inset: 0;
        z-index: calc(var(--z-drawer) - 1);
        background: rgba(0, 0, 0, .55);
        opacity: 0; pointer-events: none;
        transition: opacity 220ms var(--ease);
    }
    .app[data-gaveta="1"] .veu { opacity: 1; pointer-events: auto; }
    .abre-gaveta { display: grid !important; }

    .topo { padding: 0 16px; height: 58px; }
    .conteudo { padding: 22px 16px 40px; }
    .pag-topo { flex-direction: column; align-items: flex-start; }
    .pag-titulo { font-size: 23px; }

    .regua-kpi { grid-template-columns: 1fr 1fr; }
    .kpi-primario { grid-column: 1 / -1; }
    .kpi-val { font-size: 23px; }
    .kpi-primario .kpi-val { font-size: 28px; }

    .fluxo { grid-template-columns: 1fr; }
    .seta { transform: rotate(90deg); }
}

.abre-gaveta { display: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* Ícone de casa abrindo a trilha, como âncora de "onde estou". */
.trilha-casa { display: inline-grid; place-items: center; color: var(--muted-2); }

/* Rótulo de medida com ícone: o glifo diz a grandeza antes de a palavra
   ser lida. Só aqui, onde três medidas se repetem lado a lado e o
   reconhecimento por forma acelera a varredura. */
.conj-medidas small svg { vertical-align: -2px; margin-right: 4px; color: var(--yellow); }

/* ═══ TOQUE E TELA PEQUENA ═════════════════════════════════════
   O dono da casa abre isto no celular muito mais do que no
   computador, então o que segue não é refinamento: é o que faz a
   página ser usável com o dedo.
   ═══════════════════════════════════════════════════════════════ */

/* Tabela larga rola dentro de si mesma. Sem isto, uma tabela de 9
   colunas empurra a PÁGINA inteira para o lado no celular — o
   cabeçalho sai da tela e a rolagem horizontal contamina tudo. */
.rola { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 720px) {
    /* Abaixo disto as colunas se esmagam a ponto de os números
       quebrarem em duas linhas; melhor rolar do que ilegível. */
    .rola > table { min-width: 560px; }
    .rola > table th, .rola > table td { padding-inline: 12px; }

    /* O texto do SVG é medido em unidades do viewBox, então ele encolhe
       junto com o gráfico: 10px num viewBox de 1000 desenhado em 350
       viram 3,5px reais. Aqui o rótulo é reescalado para voltar a ter
       tamanho de leitura na largura em que o gráfico realmente aparece. */
    .gfx .rot { font-size: 26px; }
}

@media (pointer: coarse) {
    /* Menos de 16px e o Safari do iPhone dá zoom sozinho ao focar o
       campo — a página fica torta e o usuário precisa pinçar de volta. */
    .controle, input, select, textarea { font-size: 16px; }

    /* Alvo de toque: 34px é confortável para o ponteiro do mouse e
       pequeno para a polpa do dedo. */
    .btn { min-height: 42px; padding-inline: 16px; }
    .btn-sm { min-height: 36px; padding-inline: 13px; }
    .aba, .crm-aba, .crm-view { min-height: 38px; display: inline-flex; align-items: center; }
}

/* Rótulo que só o leitor de tela lê. Um <select> sozinho no cartão é
   óbvio para quem vê e mudo para quem ouve. */
.so-leitor { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
             overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
