/* ===================================================================
   Trilho: moldura única da área logada (fase 1 da nova jornada).
   Computador: trilho fixo à esquerda, com o nome ao passar o mouse.
   Celular (< 760px): barra de cinco ícones embaixo.
   Paleta própria e fixa: o trilho é igual em todas as telas, qualquer que
   seja o tema da página. Só aparece com sessão ativa (body.tem-trilho).
   =================================================================== */
:root {
  --tr-l: 76px;            /* largura do trilho */
  --tr-h: 64px;            /* altura da barra no celular */
  --tr-fundo: #14262f;
  --tr-fundo-2: #1d3540;
  --tr-texto: #dfe7ea;
  --tr-apagado: #93a7af;
  --tr-acento: #f2b33d;
  --tr-foco: #ffd27a;
}

body.tem-trilho { padding-left: var(--tr-l); }

.trilho {
  position: fixed; inset: 0 auto 0 0; width: var(--tr-l); z-index: 260;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 0 14px; background: var(--tr-fundo); color: var(--tr-texto);
  font: 500 12px/1.2 Inter, "Segoe UI", system-ui, sans-serif;
  box-shadow: 1px 0 0 rgba(0, 0, 0, .25);
  height: auto; margin: 0; border: 0; backdrop-filter: none; text-align: left;   /* defesa contra estilos genéricos das páginas */
}
.trilho * { box-sizing: border-box; }
.tr-marca {
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 10px; border-radius: 12px;
  background: var(--tr-acento); color: var(--tr-fundo); font: 800 15px/1 "Bricolage Grotesque", Inter, sans-serif;
  text-decoration: none; letter-spacing: -.02em;
}
.tr-lista { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; width: 100%; align-items: center; }
.tr-item {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 64px; min-height: 56px; padding: 6px 2px; border-radius: 12px; color: var(--tr-apagado);
  text-decoration: none; text-align: center; background: none; border: 0; cursor: pointer; font: inherit;
}
.tr-item svg { width: 22px; height: 22px; flex: none; }
.tr-item .tr-rot { font-size: 10.5px; line-height: 1.15; letter-spacing: .01em; }
.tr-item:hover { color: var(--tr-texto); background: var(--tr-fundo-2); }
.tr-item[aria-current="page"] { color: var(--tr-fundo); background: var(--tr-acento); }
.tr-item:focus-visible { outline: 2px solid var(--tr-foco); outline-offset: 2px; }
.tr-dica {                                   /* nome completo ao passar o mouse */
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); white-space: nowrap;
  padding: 6px 10px; border-radius: 8px; background: var(--tr-fundo); color: var(--tr-texto); font-size: 12.5px;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .45); opacity: 0; pointer-events: none; transition: opacity .12s;
}
.tr-item:hover .tr-dica, .tr-item:focus-visible .tr-dica { opacity: 1; }
.tr-esp { flex: 1; }
.tr-cred {
  display: block; width: 64px; padding: 6px 2px; border-radius: 10px; text-align: center; text-decoration: none;
  color: var(--tr-acento); font-size: 11px; line-height: 1.2; border: 1px solid rgba(242, 179, 61, .35);
}
.tr-cred b { display: block; font-size: 15px; color: var(--tr-texto); }
.tr-cred:hover { background: var(--tr-fundo-2); }

/* menu de administração: à parte, só para quem administra */
.tr-admin { position: relative; }
.tr-menu {
  position: absolute; left: calc(100% + 10px); bottom: 0; min-width: 220px; padding: 8px; border-radius: 12px;
  background: #fff; color: #14262f; box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .45); z-index: 270;
}
.tr-menu[hidden] { display: none; }
.tr-menu p { margin: 4px 8px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #5d6f76; }
.tr-menu a { display: block; padding: 9px 10px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 14px; }
.tr-menu a:hover, .tr-menu a:focus-visible { background: #f2f4f0; outline: none; }
.tr-menu a[aria-current="page"] { font-weight: 700; }

@media (max-width: 759px) {
  body.tem-trilho { padding-left: 0; padding-bottom: calc(var(--tr-h) + env(safe-area-inset-bottom, 0px)); }
  .trilho {
    inset: auto 0 0 0; width: auto; height: calc(var(--tr-h) + env(safe-area-inset-bottom, 0px));
    flex-direction: row; padding: 0 4px env(safe-area-inset-bottom, 0px); gap: 0;
    box-shadow: 0 -1px 0 rgba(0, 0, 0, .25);
  }
  .tr-marca, .tr-esp, .tr-cred, .tr-sair, .tr-dica { display: none; }
  .tr-lista { flex-direction: row; justify-content: space-around; gap: 0; }
  .tr-lista > li { flex: 1; display: flex; justify-content: center; }
  .tr-item { width: 100%; max-width: 84px; min-height: 52px; }
  .tr-admin { display: flex; }
  .tr-menu { left: auto; right: 4px; bottom: calc(100% + 8px); }
  /* elementos fixos das páginas sobem para não ficar sob a barra */
  body.tem-trilho .toast { bottom: calc(var(--tr-h) + 14px); }
  body.tem-trilho #stb { bottom: calc(var(--tr-h) + 16px); }
}

@media print { .trilho { display: none; } body.tem-trilho { padding: 0; } }

/* ---- ajustes nas páginas quando o trilho está ativo (a navegação passa a ser só o trilho) ---- */
body.tem-trilho .tabbar a.tab[href],      /* boletim: links para outras telas */
body.tem-trilho .tabbar .tab-cred,
body.tem-trilho .topo nav[aria-label="Seções"],   /* simulador e contato */
body.tem-trilho .so-sem-trilho { display: none !important; }
