/* Comunicação interna: contenção da grade e busca sem crescimento vertical. */
.tp {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: minmax(0, 1fr);
}
.tp > *, .tp .gw-head > div, .tp .tp-list,
.tp .tp-card, .tp .tp-sector, .tp .tp-settings,
.tp .tp-grid2, .tp .tp-duty-wrap, .tp .tp-notices, .tp .tp-team {
  min-width: 0;
  max-width: 100%;
}
.tp > .gw-toolbar { display: block; }
.tp > .gw-toolbar > .gw-tabs {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.tp .tp-list > .gw-search {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 44px;
  min-height: 44px;
  margin: 0;
  box-sizing: border-box;
}
.tp .tp-list > .gw-search input {
  width: 100%;
  min-width: 0;
  height: 40px;
  min-height: 0;
  padding: 0;
}
.tp .gw-head p, .tp .tp-empty p, .tp .tp-notice p,
.tp .tp-sched-main, .tp .tp-toggle small { overflow-wrap: anywhere; }
.tp .tp-card { overflow-x: auto; }
.tm-modal { min-width: 0; max-width: 100%; }
.tm-modal > header, .tm-modal > footer { flex-shrink: 0; }
.tm-modal .tm-body { min-height: 0; min-width: 0; overscroll-behavior: contain; }
.tm-modal .tm-body > *, .tm-modal .tm-field,
.tm-modal .tm-opts, .tm-modal .tm-people-search { min-width: 0; max-width: 100%; }

@media (max-width: 640px) {
  .tp { gap: 14px; }
  .tp .gw-head { align-items: stretch; gap: 12px; }
  .tp .gw-head > div { width: 100%; }
  .tp .gw-head h1 { font-size: 22px; line-height: 1.3; }
  .tp .gw-head p { font-size: 13px; line-height: 1.55; }
  .tp .gw-head-actions, .tp .gw-head-actions > .btn { width: 100%; }
  .tp .gw-head-actions > .btn { min-height: 44px; }
  .tp > .gw-toolbar > .gw-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 5px;
    overflow: visible;
  }
  .tp > .gw-toolbar > .gw-tabs button {
    min-width: 0;
    min-height: 42px;
    padding: 8px;
    white-space: normal;
    line-height: 1.35;
    font-size: 12px;
    overflow-wrap: anywhere;
  }
  .tp .tp-inbox { min-height: 0; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .tp .tp-list { align-self: start; gap: 10px; }
  .tp .tp-list > .gw-search input { font-size: 16px; }
  .tp .tp-filters { gap: 6px; }
  .tp .tp-filters button { min-height: 38px; padding: 7px 10px; font-size: 12px; }
  .tp .tp-inbox > .tp-empty { min-height: 200px; align-content: center; padding: 24px 16px; }
  .tp .tp-empty { padding: 28px 16px; gap: 8px; }
  .tp .tp-empty p { margin: 0; font-size: 13px; line-height: 1.55; }
  .tp .tp-notices, .tp .tp-team, .tp .tp-grid2 { grid-template-columns: minmax(0, 1fr); }
  .tp .tp-push { padding: 12px; position: relative; }
  .tp .tp-push > div { padding-right: 24px; }
  .tp .tp-push > .tm-x { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; }
  .tp .tp-push > .btn { flex: 1 1 100%; min-height: 44px; white-space: normal; }
  .tp .tp-detail > header, .tp .tp-timeline, .tp .tp-reply { padding: 14px; }
  .tp .tp-actions .btn { flex: 1 1 120px; white-space: normal; }
  .tp .tp-toggle { align-items: flex-start; }
  .tp .tp-toggle > div { min-width: 0; }
  .tp .tp-sched-act { flex-wrap: wrap; }
  .tm-modal { max-height: calc(100dvh - 12px); }
  .tm-modal > header { padding: 16px; gap: 10px; }
  .tm-modal > header p { font-size: 12px; overflow-wrap: anywhere; }
  .tm-modal .tm-x { width: 40px; height: 40px; }
  .tm-modal .tm-body { padding: 16px; }
  .tm-modal .tm-sectors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tm-modal .tm-sectors button { min-width: 0; min-height: 64px; overflow-wrap: anywhere; }
  .tm-modal .tm-quick { min-width: 0; }
  .tm-modal .tm-quick input[type="datetime-local"] { flex: 1 1 100%; width: 100%; min-width: 0; max-width: 100%; }
  .tm-modal input:not([type="checkbox"]):not([type="radio"]),
  .tm-modal select, .tm-modal textarea { min-width: 0; max-width: 100%; font-size: 16px; }
  .tm-modal .tm-mention-hint { align-items: flex-start; line-height: 1.45; }
  .tm-modal > footer { padding: 12px 16px max(14px, env(safe-area-inset-bottom)); gap: 8px; }
  .tm-modal > footer .btn { min-height: 44px; white-space: normal; }
}
