/* Workflow: controlled density without hiding content or changing business state.
   Load after alos-visual-standards.css. */

/* Role=button supplies keyboard access; its mobile touch minimum must not
   become a shrinking flex card's content height. */
#esteiraBody .qd-card {
  flex: 0 0 auto;
}
#esteiraBody .est-fpill {
  min-height: 36px;
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  font-size: 12px;
  line-height: 1.4;
}

/* Introductory surfaces share a compact rhythm; working text keeps its size. */
.wt4-hero,
.ag-hero-v2 {
  min-height: 0;
}
.wt4-copy,
.ag-hero-copy {
  padding: 20px 24px;
}
.wt4-copy > p,
.ag-hero-copy > p {
  margin: 9px 0 12px;
}
.wt4-signal,
.ag-next {
  padding: 18px 20px;
}
.wt4-next {
  margin: 12px;
  padding: 16px 18px;
}
.wt4-next > b,
.wt4-next > small {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}
.wt4-hero.wt5-priority {
  grid-template-columns: minmax(0, 1fr) minmax(300px, .8fr);
}
.wt5-priority .wt4-next {
  grid-column: auto;
}
.wt-context-details {
  margin: 10px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.wt-context-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 10px 14px;
  color: var(--text-bright);
  cursor: pointer;
  list-style: none;
}
.wt-context-details > summary::-webkit-details-marker {
  display: none;
}
.wt-context-details > summary > span {
  display: grid;
  gap: 3px;
}
.wt-context-details > summary b {
  font-size: 13px;
}
.wt-context-details > summary small {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}
.wt-context-details > summary > .ic {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  transition: transform .15s;
}
.wt-context-details[open] > summary > .ic {
  transform: rotate(180deg);
}
.wt-context-details > .alos-visual-details-body {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.wt-context-details .wt4-signal {
  border: 1px solid #1c3457;
  border-radius: 12px;
  background: #10263c;
}
.wt-context-details .wt-myagenda,
.wt-context-details .wt-owner-governance {
  margin: 10px 0 0;
}
.wt4-next > button,
.ag-next-open {
  margin-top: 12px;
  min-height: 40px;
  font-size: 12px;
}
.wt4-signal > span,
.wt4-next > span,
.ag-next-top > span,
.wt4-eyebrow,
.ag-hero-copy .eyebrow {
  font-size: 11.5px;
  letter-spacing: .08em;
  line-height: 1.4;
}
.wt4-signal > em,
.wt4-signal > small,
.wt4-next > small,
.ag-next-meta > span {
  font-size: 12px;
  line-height: 1.5;
}
.wt4-recorte {
  margin: 10px 0 0;
}
.wt4-recorte > small {
  display: block;
  font-size: 11.5px;
}
.wt-myagenda-person em,
.wt-myagenda-roles button,
.wt-myagenda-actions button {
  font-size: 11.5px;
  line-height: 1.4;
}
.wt-myagenda-roles button span {
  overflow: visible;
  white-space: normal;
}
.wt-myagenda-roles button b {
  font-size: 11.5px;
  flex-shrink: 0;
}
.wt-import {
  padding: 12px 15px;
}
.wt-import-main {
  gap: 12px;
}
.wt-import-copy > small,
.wt-import-skip,
.wt-import-mini > button {
  font-size: 11.5px;
}

/* Operational explanations are information, not decorative microcopy. */
.est4-command p,
.est4-command header > div > span,
.est4-path b,
.est4-path small,
.est4-command > footer > span,
.est4-command > footer .qd-rchip > span:last-child,
.est4-command button {
  font-size: 11.5px;
  line-height: 1.45;
}
.est4-path {
  align-items: stretch;
}
.est4-path small {
  white-space: normal;
  overflow: visible;
}
.est4-path > em {
  align-self: center;
}
.est4-command h2 {
  white-space: normal;
  overflow: visible;
}
.ag3-ops {
  gap: 12px;
  padding: 14px;
}
.ag3-ops > header > span,
.ag3-ops > div > button small,
.ag3-ops > div > button em,
.ag3-ops > footer > button,
.ag3-ops > footer > span {
  font-size: 11.5px;
  line-height: 1.4;
}
.ag3-ops > div > button {
  gap: 5px 8px;
  padding: 10px;
}
.ag3-ops > div > button > span {
  flex-wrap: wrap;
  gap: 3px 6px;
}
.ag3-ops > div > button small,
.ag3-ops > div > button em {
  overflow: visible;
  white-space: normal;
}
.ag-next-title {
  margin-top: 9px;
}
.ag-next-meta {
  margin-top: 8px;
}
.ag-pulse button {
  padding-top: 10px;
}
#viewAgenda .ag-chip,
.ag-day-badges span,
.ag-day-time span,
.ag-day-place {
  font-size: 11.5px;
  line-height: 1.4;
}

@media (max-width: 860px) {
  .wt4-hero.wt5-priority {
    grid-template-columns: minmax(0, 1fr);
  }
  .wt4-copy,
  .ag-hero-copy {
    padding: 17px 18px;
  }
  .wt4-signal {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 3px 12px;
    padding: 12px 18px;
  }
  .wt4-signal > span,
  .wt4-signal > em,
  .wt4-signal > div {
    grid-column: 1 / -1;
  }
  .wt4-signal > b {
    margin: 3px 0 0;
  }
  .wt4-signal > small {
    align-self: center;
  }
  .wt4-signal > div,
  .wt4-signal > em {
    margin-top: 5px;
  }
  .wt4-next {
    margin: 0 12px 12px;
    padding: 14px 16px;
  }
  .ag-next {
    padding: 15px 18px;
  }
  .wt4-kpis {
    gap: 8px;
  }
  .wt4-kpis button,
  .wt4-kpis button[class] {
    padding: 11px 12px;
  }
  .wt4-recorte {
    gap: 6px;
    padding: 8px 10px;
  }
}

@media (max-width: 720px) {
  #esteiraBody .est-fpill {
    min-height: 40px;
  }
  .wt-myagenda {
    gap: 8px;
    padding: 10px;
  }
  .wt-myagenda-roles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .wt-myagenda-roles button {
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 4px;
    padding: 7px;
  }
  .wt-import-side {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .wt-import-go {
    flex: 1;
  }
  .wt-import-skip {
    width: auto;
    margin: 0;
    padding: 8px;
  }
  .ag3-ops > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ag3-ops > div > button {
    grid-template-columns: 24px minmax(0, 1fr);
  }
  .ag3-ops > div > button > i {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 560px) {
  .est4-command > header {
    gap: 10px;
    padding: 10px 12px;
  }
  .est4-path {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 0 12px 10px;
  }
  .est4-path > div {
    align-items: flex-start;
    padding: 7px;
    gap: 6px;
  }
  .est4-path > div > .ic {
    margin-top: 2px;
  }
  .est4-command > footer {
    gap: 9px;
    padding: 9px 12px;
  }
  .est4-command > footer > div:not(.qd-radar) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .est4-command > footer button {
    min-width: 0;
    min-height: 40px;
    padding: 7px 8px;
  }
  .est4-command > footer .qd-rchip {
    padding: 5px 7px;
  }
  .est4-command > footer > .qd-radar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
  }
  .est4-command > footer .qd-rchip > span:last-child {
    overflow: visible;
    white-space: normal;
  }
  .ag-pulse {
    gap: 8px;
  }
  .ag-pulse button {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding-right: 0;
  }
  .ag-pulse span {
    font-size: 11.5px;
    line-height: 1.35;
  }
  .wt4-list-head > div:last-child {
    display: flex;
    font-size: 11.5px;
  }
  .wt4-list-head {
    flex-wrap: wrap;
    gap: 7px;
  }
}

@media (max-width: 350px) {
  .est4-path,
  .ag3-ops > div {
    grid-template-columns: minmax(0, 1fr);
  }
  .wt-myagenda-roles {
    grid-template-columns: minmax(0, 1fr);
  }
  .wt-myagenda-roles button {
    flex-direction: row;
    align-items: center;
  }
}

/* Tarefas F6 — tres decisoes primarias, complexidade somente sob demanda. */
.wt5-primary {
  position: sticky;
  top: 66px;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(210px, 1.25fr) minmax(180px, .9fr) minmax(190px, 1fr) auto;
  gap: 8px;
  margin: 12px 0 8px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  box-shadow: 0 18px 42px -36px rgba(8, 24, 43, .72);
  backdrop-filter: blur(16px);
}
.wt5-primary-field {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 48px;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
  border-radius: 10px;
  background: var(--card);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.wt5-primary-field:hover,
.wt5-primary-field:focus-within {
  z-index: 1;
  border-color: color-mix(in srgb, var(--primary) 52%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 9%, transparent);
  transform: translateY(-1px);
}
.wt5-primary-field > .ic:first-child { width: 17px; height: 17px; color: var(--primary); }
.wt5-primary-field > .ic:last-child { width: 13px; height: 13px; color: var(--muted); pointer-events: none; }
.wt5-primary-field > span { display: grid; min-width: 0; gap: 2px; }
.wt5-primary-field small { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .09em; }
.wt5-primary-field select {
  width: 100%;
  min-width: 0;
  padding: 0 20px 0 0;
  overflow: hidden;
  border: 0;
  outline: 0;
  appearance: none;
  background: transparent;
  color: var(--text-bright);
  font: 700 13px/1.35 'Manrope', 'Segoe UI', sans-serif;
  text-overflow: ellipsis;
  cursor: pointer;
}
.wt5-clear {
  display: inline-flex;
  min-width: 76px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: 750 11.5px 'Manrope', 'Segoe UI', sans-serif;
  cursor: pointer;
}
.wt5-clear:hover { border-color: var(--border); background: var(--bg2); color: var(--primary); }
.wt5-clear .ic { width: 15px; height: 15px; }
.wt5-simplified .wt4-command { position: relative; top: auto; margin-top: 8px; }
.wt5-simplified .wt4-command-top { padding: 8px; }
.wt5-simplified .wt4-command-bottom { padding-top: 0; }
.wt5-simplified .wt4-search { flex: 1; }
.wt5-simplified .wt4-command-bottom { justify-content: flex-end; }
.wt5-advanced-filters { display: grid; gap: 8px; margin-top: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg2); }
.wt5-advanced-filters > span { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .11em; }
.wt5-advanced-filters .wt-filters { display: flex; flex-wrap: wrap; gap: 5px; }
.wt5-advanced-filters .wt-filter { min-height: 34px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text); font: 700 11.5px 'Manrope', 'Segoe UI', sans-serif; cursor: pointer; }
.wt5-advanced-filters .wt-filter.active { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); background: color-mix(in srgb, var(--primary) 8%, var(--card)); color: var(--primary); }

/* A lista mostra somente a decisao: titulo, prazo, cliente/processo e responsavel.
   Origem, tipo, etiquetas, links e demais metadados continuam no detalhe. */
.wt5-simplified .wt-card { cursor: pointer; }
.wt5-simplified .wt-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.wt5-simplified .wt-card .wt-origin,
.wt5-simplified .wt-card .wt-status,
.wt5-simplified .wt-card .wt-prio,
.wt5-simplified .wt-card .wt-recor,
.wt5-simplified .wt-card .wt-tipo,
.wt5-simplified .wt-card .wt-owner-kind,
.wt5-simplified .wt-card .wt-etqs,
.wt5-simplified .wt-card .wt-astrea,
.wt5-simplified .wt-card .wt-card-foot { display: none; }
.wt5-simplified .wt-card .wt-fatal { margin-left: auto; }
.wt5-simplified .wt-card .wt-due { margin-left: auto; }
.wt5-simplified .wt-card .wt-fatal + .wt-due { margin-left: 0; }
.wt5-simplified .wt-card .wt-meta span:nth-of-type(n+4),
.wt5-simplified .wt-card .wt-meta i:nth-of-type(n+3) { display: none; }
.wt5-simplified .wt-card .wt-h3 { margin: 11px 0 8px; font-size: 15px; line-height: 1.42; }
.wt5-simplified .wt-card .wt-meta { gap: 7px; font-size: 11.5px; line-height: 1.4; }
/* O checkbox fica no extremo direito, com rotulo proprio. O check de concluir
   permanece a esquerda e visivel antes do hover para nao parecer outro checkbox. */
.wt5-simplified .wt-card-tools { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; flex: 0 0 auto; }
.wt5-simplified .wt-card-tools .wt-kebab { margin-left: 0; flex: 0 0 auto; }
.wt5-simplified .wt-card .wt-selcbwrap { gap: 7px; min-height: 32px; margin: 0; padding: 0 9px; border: 1px solid var(--border); border-radius: 7px; color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1; cursor: pointer; white-space: nowrap; }
.wt5-simplified .wt-card .wt-selcbwrap:hover,
.wt5-simplified .wt-card .wt-selcbwrap:focus-within { border-color: var(--primary); color: var(--primary); }
.wt5-simplified .wt-card.selected .wt-selcbwrap { border-color: var(--primary); color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--card)); }
.wt5-simplified .wt-card .wt-conc:not(.done) { color: var(--success); }
.wt5-simplified .wt-card .wt-conc .ic { transform: scale(1); }
.wt5-simplified .wt-card.has-today-quick { padding-bottom: 55px; }
.wt-today-quick {
  position: absolute;
  right: 15px;
  bottom: 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--border));
  border-radius: 9px;
  background: color-mix(in srgb, var(--primary) 6%, var(--card));
  color: var(--primary);
  font: 780 11px/1 'Manrope', 'Segoe UI', sans-serif;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 7px 20px -17px color-mix(in srgb, var(--primary) 78%, transparent);
  transition: transform .14s ease, border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
.wt-today-quick .ic { width: 14px; height: 14px; }
.wt-today-quick:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--card));
  box-shadow: 0 10px 24px -16px color-mix(in srgb, var(--primary) 90%, transparent);
}
.wt-today-quick:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Agenda: a remarcacao vira uma manipulacao direta e confirmada. */
.ag-drag-hint { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 700; }
.ag-drag-hint .ic { width: 14px; height: 14px; color: var(--primary); }
.ag-chip[draggable="true"] { cursor: grab; }
.ag-chip.dragging { opacity: .34; cursor: grabbing; transform: scale(.97); }
.ag-cell.ag-drop-ready,
.ag-wcol.ag-drop-ready { position: relative; background: color-mix(in srgb, var(--primary) 10%, var(--card)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 68%, transparent); }
.ag-cell.ag-drop-ready:after,
.ag-wcol.ag-drop-ready:after { content: "Soltar para remarcar"; position: absolute; z-index: 4; right: 7px; bottom: 7px; padding: 4px 7px; border-radius: 7px; background: var(--primary); color:var(--on-primary); font-size: 9px; font-weight: 800; pointer-events: none; }

@media (max-width: 860px) {
  .wt5-primary { position: relative; top: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wt5-clear { grid-column: 1 / -1; min-height: 36px; }
}
@media (max-width: 620px) {
  .wt5-primary { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 8px; }
  .wt5-primary-field { min-height: 48px; }
  .wt5-primary-field.person { grid-column: 1 / -1; }
  .wt5-clear { display: none; }
  .wt5-simplified .wt4-command-top { flex-wrap: wrap; }
  .wt5-simplified .wt4-search { order: 3; flex-basis: 100%; }
  .wt5-simplified .wt4-utilities { justify-content: flex-start; }
  .wt5-simplified .wt-card .wt-meta span:nth-of-type(3),
  .wt5-simplified .wt-card .wt-meta i:nth-of-type(2) { display: none; }
  .wt5-simplified .wt-card.has-today-quick { padding-bottom: 57px; }
  .wt5-simplified .wt-card-tools { gap: 6px; }
  .wt5-simplified .wt-card .wt-selcbwrap { min-height: 36px; padding: 0 7px; gap: 6px; }
  .wt-today-quick { right: 13px; bottom: 12px; min-height: 36px; }
  .ag-drag-hint { display: none; }
}
