/* ══════════════════════════════════════════════════════════════════════════
   Triagem do técnico (proposta A) — faixa no topo da ficha.
   Enquanto ninguém triou, a faixa mostra Tipo · Assunto · Impacto como o
   solicitante abriu: "Está certo, confirmar" em 1 clique, ou "Trocar" abre no
   lugar os mesmos componentes da abertura (.cht-type-seg, lista de assuntos,
   .cht-criticality-card, de chamados.css). Depois de salva, vira o selo
   "Triado por …" no cabeçalho, com o antes → depois num popover.
   Tudo escopado em .cht-tec .chtri-*; movimento só por intenção do usuário
   (chamados/motion.js) e nada contínuo.
   ══════════════════════════════════════════════════════════════════════════ */

.cht-tec .chtri {
  --chtri-navy: light-dark(#17325c, #a6c2ee);
  --chtri-line: light-dark(#cfdaf0, #2e3643);
  margin: 14px 22px 0;
  padding: 14px 16px 16px;
  border-radius: 14px;
  background: light-dark(#f2f6ff, #1b232f);
  border: 1px solid var(--chtri-line);
  min-width: 0;
  /* A coluna da ficha varia muito (aside, sheet, split): a faixa se ajusta à
     própria largura, não à da tela. */
  container-type: inline-size;
}
.cht-tec .chtri.is-flash { animation: chtri-flash 1.2s var(--cht-ease, ease) 1; }
@keyframes chtri-flash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(69, 98, 143, 0); }
  30% { box-shadow: 0 0 0 5px rgba(69, 98, 143, .28); }
}

.cht-tec .chtri-hd { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cht-tec .chtri-hd .chtri-btn { flex: none; }
.cht-tec .chtri-ic {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px; background: var(--chtri-navy); color: light-dark(#fff, #12161d);
}
.cht-tec .chtri-ic svg { width: 19px; height: 19px; }
.cht-tec .chtri-tt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cht-tec .chtri-eb {
  font: 700 10.5px/1.2 var(--cht-fu);
  letter-spacing: .08em; text-transform: uppercase; color: var(--cht-accent-ink);
}
.cht-tec .chtri-tt b { font: 800 16.5px/1.25 var(--cht-fd); color: var(--cht-ink); letter-spacing: -.005em; }
.cht-tec .chtri-sp { flex: 1; }
.cht-tec .chtri-keys {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--cht-ink-3); white-space: nowrap;
}
.cht-tec .chtri-keys .sep { color: #b3bccd; }
.cht-tec .chtri kbd {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box;
  border-radius: 5px; border: 1px solid var(--cht-line-2); border-bottom-width: 2px;
  background: light-dark(#fff, #171e29); font: 600 11px/1 var(--cht-fm); color: var(--cht-ink-2);
}

/* Botões próprios: neutraliza o button global (min-height 44, fundo de marca,
   sombra e translateY no hover) — também nas opções de assunto da abertura. */
.cht-tec :is(.chtri, .chtri-sealwrap) :is(.chtri-btn, .chtri-card, .chtri-chip, .chtri-seal, .cht-cat-opt) {
  margin: 0; min-height: 0; box-shadow: none; transform: none;
  text-align: left; cursor: pointer;
  -webkit-appearance: none; appearance: none; background-image: none;
}
.cht-tec :is(.chtri, .chtri-sealwrap) :is(.chtri-btn, .chtri-card, .chtri-chip, .chtri-seal, .cht-cat-opt):hover:not(:disabled) {
  box-shadow: none; transform: none; background-image: none;
}
.cht-tec .chtri-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--cht-line-2); background: light-dark(#fff, #171e29); color: var(--cht-ink);
  font: 600 13.5px/1 var(--cht-fu); white-space: nowrap;
}
.cht-tec .chtri-btn svg { width: 16px; height: 16px; flex: none; }
.cht-tec .chtri-btn--go { background: var(--chtri-navy); border-color: var(--chtri-navy); color: light-dark(#fff, #12161d); padding: 0 18px; }
.cht-tec .chtri-btn:disabled { opacity: .6; cursor: default; }
@media (hover: hover) {
  .cht-tec .chtri-btn:hover:not(:disabled) { border-color: var(--cht-line-3); }
  .cht-tec .chtri-btn--go:hover:not(:disabled) { background: #10264a; border-color: light-dark(#10264a, #6781ac); }
}
.cht-tec .chtri :is(.chtri-btn, .chtri-card, .chtri-chip, .chtri-x):focus-visible {
  outline: 2px solid var(--cht-accent); outline-offset: 2px;
}

/* Os três campos */
.cht-tec .chtri-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 13px; }
.cht-tec .chtri-card {
  display: flex; flex-direction: column; gap: 7px; min-width: 0;
  padding: 11px 13px 12px; border-radius: 12px;
  border: 1px solid var(--cht-line-2); background: light-dark(#fff, #171e29); color: var(--cht-ink);
  font: inherit;
  transition: border-color var(--cht-dur, .18s) var(--cht-ease, ease), box-shadow var(--cht-dur, .18s) var(--cht-ease, ease);
}
@media (hover: hover) {
  .cht-tec .chtri-card:hover { border-color: var(--cht-accent); }
}
.cht-tec .chtri-card.is-mod { border-color: light-dark(#9fb3d6, #444d5a); background: light-dark(#f7f9ff, #1a212d); }
.cht-tec .chtri-card[aria-expanded="true"] { border-color: var(--cht-accent); box-shadow: 0 0 0 4px rgba(69, 98, 143, .16); }
.cht-tec .chtri-card .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cht-tec .chtri-card .lb {
  font: 700 10.5px/1.2 var(--cht-fu); letter-spacing: .08em; text-transform: uppercase; color: var(--cht-ink-3);
}
.cht-tec .chtri-card .tr { display: inline-flex; align-items: center; gap: 4px; font: 600 12.5px/1 var(--cht-fu); color: var(--cht-accent); }
.cht-tec .chtri-card .tr svg { width: 14px; height: 14px; }
.cht-tec .chtri-card .v {
  display: flex; align-items: center; gap: 9px; min-width: 0;
  font: 800 15px/1.25 var(--cht-fd); color: var(--cht-ink);
}
/* Caminho longo ("Sistemas › ERP Senior › Relatórios"): quem encolhe é o
   prefixo; o nome final do assunto fica inteiro. */
.cht-tec .chtri-card .v .pfx {
  flex: 0 1 auto; min-width: 0;
  color: var(--cht-ink-4); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cht-tec .chtri-card .v .nm { flex: 0 0 auto; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cht-tec .chtri-card .s { font-size: 12.5px; line-height: 1.35; color: var(--cht-ink-3); }
.cht-tec .chtri-card .s b { color: var(--cht-ink); font-weight: 700; }
.cht-tec .chtri-vic {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border-radius: 8px; background: var(--cht-accent-weak); color: var(--cht-accent-ink);
}
.cht-tec .chtri-vic svg { width: 15px; height: 15px; }
.cht-tec .chtri-card.is-mod .chtri-vic { background: var(--cht-accent); color: light-dark(#fff, #12161d); }
.cht-tec .chtri-card.is-mod .chtri-vic .cht-crit-meter i { background: light-dark(#7f97bd, #555e6c); }
.cht-tec .chtri-card.is-mod .chtri-vic .cht-crit-meter i.on { background: light-dark(#fff, #171e29); }

.cht-tec .chtri-was { color: var(--cht-ink-4); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.cht-tec .chtri-tag {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 3px 8px;
  font: 700 10px/1.2 var(--cht-fu); letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.cht-tec .chtri-tag--chg { background: var(--chtri-navy); color: light-dark(#fff, #12161d); }
.cht-tec .chtri-tag--same { background: var(--cht-ok-weak); color: light-dark(#17663a, #87c59a); }

/* Campo aberto, no lugar (mesmos componentes da abertura) */
.cht-tec .chtri-edit {
  margin-top: 10px; padding: 14px 14px 12px;
  border: 1px solid var(--cht-line-2); border-radius: 12px; background: light-dark(#fff, #171e29);
}
.cht-tec .chtri-edit-hd { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cht-tec .chtri-edit-hd b { font: 700 14.5px var(--cht-fu); color: var(--cht-ink); }
.cht-tec .chtri-edit-hd span { font-size: 12.5px; color: var(--cht-ink-3); }
.cht-tec .chtri-edit .cht-criticality-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cht-tec .chtri-edit .cht-criticality-card { text-align: left; font: inherit; color: inherit; margin: 0; min-height: 0; }
.cht-tec .chtri-de {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
  font: 700 11px/1 var(--cht-fu); color: var(--cht-ink-3); white-space: nowrap;
}
.cht-tec .chtri-de .cht-avatar, .cht-tec .chtri-de .chtri-av {
  width: 17px; height: 17px; border-radius: 50%; display: inline-grid; place-items: center;
  font: 700 7.5px/1 var(--cht-fd); color: #fff; background: #2f7d6d;
}
/* Lista de assuntos inline (as mesmas peças do seletor da abertura) */
.cht-tec .chtri-cats { border: 1px solid var(--cht-line); border-radius: 10px; overflow: hidden; }
.cht-tec .chtri-cats .cht-catpicker-list { max-height: 260px; overflow-y: auto; padding: 4px 12px 12px; }
.cht-tec .chtri-cats .cht-cat-opt { font: inherit; text-align: left; margin: 0; min-height: 0; }

/* O que muda (prazo, equipe) */
.cht-tec .chtri-efeito {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
  margin-top: 12px; padding: 10px 14px;
  border-radius: 12px; background: light-dark(#fff, #171e29); border: 1px solid var(--cht-line);
  font-size: 13px; color: var(--cht-ink-2);
}
.cht-tec .chtri-efeito svg { width: 17px; height: 17px; color: var(--cht-accent-ink); flex: none; }
.cht-tec .chtri-efeito b { color: var(--cht-ink); }
.cht-tec .chtri-efeito .n { font: 600 12.5px var(--cht-fm); color: var(--cht-ink); font-variant-numeric: tabular-nums; }
.cht-tec .chtri-efeito .sep { color: #b3bccd; }
.cht-tec .chtri-efeito .ref { margin-left: auto; font-size: 12px; color: var(--cht-ink-3); }

/* Motivo (opcional) */
.cht-tec .chtri-motivo { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cht-tec .chtri-motivo .lb {
  margin-right: 4px; font: 700 10.5px/1.2 var(--cht-fu); letter-spacing: .08em; text-transform: uppercase; color: var(--cht-ink-3);
}
.cht-tec .chtri-motivo .lb span { text-transform: none; letter-spacing: 0; font-weight: 500; }
.cht-tec .chtri-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--cht-line-2); background: light-dark(#fff, #171e29); color: var(--cht-ink-2);
  font: 600 12.5px/1 var(--cht-fu); white-space: nowrap;
}
.cht-tec .chtri-chip svg { width: 13px; height: 13px; display: none; }
.cht-tec .chtri-chip[aria-pressed="true"] { background: var(--chtri-navy); border-color: var(--chtri-navy); color: light-dark(#fff, #12161d); }
.cht-tec .chtri-chip[aria-pressed="true"] svg { display: block; }
.cht-tec .chtri-nota {
  flex: 1 1 220px; min-width: 180px; height: 32px; box-sizing: border-box;
  padding: 0 12px; border-radius: 999px; border: 1px solid var(--cht-line-2); background: light-dark(#fff, #171e29);
  font: 500 12.5px var(--cht-fu); color: var(--cht-ink);
}
.cht-tec .chtri-nota:focus { outline: none; border-color: var(--cht-accent); box-shadow: var(--cht-glow); }
.cht-tec .chtri-err { margin: 10px 0 0; font-size: 12.5px; color: var(--cht-breach, light-dark(#b3261e, #ff8878)); }

/* ── Depois: o selo no cabeçalho + popover antes → depois ── */
.cht-tec .chtri-sealwrap { position: relative; display: inline-flex; }
.cht-tec .chtri-seal {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--cht-ok-line, light-dark(#a7ddc0, #1e4432)); background: var(--cht-ok-weak); color: light-dark(#17663a, #87c59a);
  font: 700 12px/1 var(--cht-fu); white-space: nowrap;
}
.cht-tec .chtri-seal svg { width: 13px; height: 13px; flex: none; }
.cht-tec .chtri-seal .chev { transition: transform var(--cht-dur, .18s) var(--cht-ease, ease); }
.cht-tec .chtri-seal[aria-expanded="true"] .chev { transform: rotate(180deg); }
.cht-tec .chtri-pop {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 30;
  width: min(440px, 86vw); padding: 12px 14px;
  border: 1px solid var(--cht-line-2); border-radius: 12px; background: light-dark(#fff, #171e29);
  box-shadow: 0 10px 22px light-dark(rgba(16, 26, 45, .12), rgba(0, 0, 0, .18)), 0 3px 6px light-dark(rgba(16, 26, 45, .1), rgba(0, 0, 0, .15));
  font-size: 13px; color: var(--cht-ink-2);
}
.cht-tec .chtri-pop[hidden] { display: none; }
.cht-tec .chtri-pop-hd { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.cht-tec .chtri-pop-hd b { color: var(--cht-ink); }
.cht-tec .chtri-pop-hd .t { margin-left: auto; font: 600 12px var(--cht-fm); color: var(--cht-ink-3); }
.cht-tec .chtri-cmp {
  display: grid; grid-template-columns: 70px minmax(0, 1fr) 18px minmax(0, 1fr);
  gap: 9px 8px; align-items: center; margin-top: 12px;
}
.cht-tec .chtri-cmp .h {
  font: 700 10px/1.2 var(--cht-fu); letter-spacing: .08em; text-transform: uppercase; color: var(--cht-ink-3);
}
.cht-tec .chtri-cmp .k { color: var(--cht-ink-3); }
.cht-tec .chtri-cmp .b { font-weight: 700; color: var(--cht-ink); }
.cht-tec .chtri-cmp .eq { color: light-dark(#1c7f4d, #76c092); font-weight: 800; text-align: center; }
.cht-tec .chtri-cmp .ar { color: var(--chtri-navy, light-dark(#17325c, #a6c2ee)); display: grid; place-items: center; }
.cht-tec .chtri-cmp .ar svg { width: 14px; height: 14px; }
.cht-tec .chtri-cmp .same { color: light-dark(#17663a, #87c59a); font-weight: 600; }
.cht-tec .chtri-pop-ft {
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--cht-line-2);
  font-size: 12.5px; line-height: 1.5;
}
.cht-tec .chtri-pop-ft b { color: var(--cht-ink); }
.cht-tec .chtri-pop-acoes { display: flex; justify-content: flex-end; margin-top: 12px; }
.cht-tec .chtri-pop-acoes .chtri-btn { height: 34px; padding: 0 12px; font-size: 12.5px; }

/* Pela largura da própria faixa: primeiro some a dica de teclas, depois os
   campos e os níveis de impacto empilham, e no estreito o botão vai para baixo. */
@container (max-width: 900px) {
  .cht-tec .chtri-keys { display: none; }
}
@container (max-width: 620px) {
  .cht-tec .chtri-cards { grid-template-columns: 1fr; }
  .cht-tec .chtri-edit .cht-criticality-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 460px) {
  .cht-tec .chtri-hd { flex-wrap: wrap; }
  .cht-tec .chtri-hd .chtri-btn--go { width: 100%; }
}
@media (max-width: 900px) {
  .cht-tec .chtri { margin: 12px 14px 0; padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .cht-tec .chtri.is-flash { animation: none; outline: 3px solid rgba(69, 98, 143, .4); }
  .cht-tec .chtri-card, .cht-tec .chtri-seal .chev { transition: none; }
}
