/* Layout móvel: leitura em uma coluna e fila em cartões legíveis. */
@media (max-width: 760px) {
  .app-shell,
  .app-main,
  .page,
  #protocol-detail-page {
    min-width: 0;
    max-width: 100%;
  }

  body.review-workspace-mode {
    height: auto;
    min-height: 100%;
    overflow: auto;
  }

  body.review-workspace-mode .app-main {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  body.review-workspace-mode #protocol-detail-page.page-visible {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  #protocol-detail-page .review-stepper {
    display: grid;
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
  }

  #protocol-detail-page .review-step {
    min-width: 0;
    justify-content: flex-start;
    overflow-wrap: normal;
    word-break: normal;
  }

  #protocol-detail-page .review-step strong,
  #protocol-detail-page .review-step small {
    min-width: 0;
    overflow-wrap: normal;
    word-break: normal;
  }

  #protocol-detail-page .review-layout,
  #protocol-detail-page[data-review-step="BENEFICIARY"] .review-layout,
  #protocol-detail-page[data-review-step="REQUEST"] .review-layout,
  #protocol-detail-page[data-review-step="PROCEDURES"] .review-layout,
  body.review-workspace-mode #protocol-detail-page .review-layout,
  body.review-workspace-mode #protocol-detail-page[data-review-step] .review-layout {
    display: grid;
    width: 100%;
    height: auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    gap: 12px;
    overflow: visible;
  }

  #protocol-detail-page .document-panel,
  body.review-workspace-mode #protocol-detail-page .document-panel {
    position: relative;
    top: auto;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 14px;
    overflow: visible;
  }

  #protocol-detail-page .document-stage,
  body.review-workspace-mode #protocol-detail-page .document-stage {
    height: min(48dvh, 420px);
    min-height: 260px;
    max-height: 420px;
    flex: 0 0 auto;
  }

  #protocol-detail-page .data-panel,
  body.review-workspace-mode #protocol-detail-page .data-panel {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    margin: 0;
    padding: 16px;
    overflow: visible;
    scrollbar-gutter: auto;
  }

  #protocol-detail-page .data-panel > .card-heading,
  #protocol-detail-page .procedures-container > .card-heading,
  body.review-workspace-mode #protocol-detail-page .data-panel > .card-heading,
  body.review-workspace-mode #protocol-detail-page .procedures-container > .card-heading {
    position: static;
    margin: 0 0 12px;
    padding: 0 0 10px;
    backdrop-filter: none;
  }

  #protocol-detail-page .document-toolbar {
    min-width: 0;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding: 7px;
  }

  #protocol-detail-page .document-toolbar .icon-only {
    flex: 0 0 36px;
  }

  #protocol-detail-page .procedure-heading-actions {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 7px;
  }

  #protocol-detail-page .procedure-heading-actions .button {
    flex: 1 1 145px;
    width: auto;
    min-width: 0;
  }

  #protocol-list-page .protocol-table-scroll-hint { display: none; }

  #protocol-list-page .table-wrap {
    max-width: 100%;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  #protocol-list-page .protocol-list-table {
    display: block;
    width: 100%;
    min-width: 0;
    border-collapse: separate;
  }

  #protocol-list-page .protocol-list-table thead { display: none; }
  #protocol-list-page .protocol-list-table tbody { display: grid; gap: 10px; }

  #protocol-list-page .protocol-list-table tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--gcn-border);
    border-radius: 13px;
    background: var(--gcn-surface);
    box-shadow: 0 3px 12px rgba(16, 42, 67, .045);
  }

  #protocol-list-page .protocol-list-table tbody td,
  #protocol-list-page .protocol-list-table tbody td.selection-column,
  #protocol-list-page .protocol-list-table tbody td:last-child {
    position: static;
    display: block;
    width: auto;
    min-width: 0;
    padding: 8px 2px;
    border: 0;
    background: transparent;
    box-shadow: none;
    white-space: normal;
  }

  #protocol-list-page .protocol-list-table tbody td.selection-column {
    position: absolute;
    top: 11px;
    left: 10px;
    z-index: 2;
    width: 28px;
    padding: 4px;
  }

  #protocol-list-page .protocol-list-table .protocol-request-cell {
    min-width: 0;
    padding: 8px 66px 8px 38px;
  }

  #protocol-list-page .protocol-list-table .protocol-number {
    display: block;
    overflow-wrap: anywhere;
    font-size: .88rem;
  }

  #protocol-list-page .protocol-list-table .protocol-meta,
  #protocol-list-page .protocol-list-table .beneficiary-cell,
  #protocol-list-page .protocol-list-table .protocol-stage-cell,
  #protocol-list-page .protocol-list-table .protocol-assignee-stack {
    overflow-wrap: break-word;
    word-break: normal;
  }

  #protocol-list-page .protocol-list-table .beneficiary-cell strong {
    font-size: .84rem;
    line-height: 1.35;
    overflow-wrap: break-word;
    word-break: normal;
  }

  #protocol-list-page .protocol-list-table .protocol-stage-cell,
  #protocol-list-page .protocol-list-table .assignee-column {
    border-top: 1px solid var(--gcn-border) !important;
  }

  #protocol-list-page .protocol-list-table .protocol-actions-cell {
    display: flex !important;
    justify-content: flex-end;
    padding-top: 8px;
  }

  #protocol-list-page .protocol-list-table .row-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  html.ignex-demo .environment-banner {
    min-height: 32px;
    padding: 5px 8px;
    font-size: 10px;
    white-space: normal;
  }

  html.ignex-demo .mobile-topbar {
    top: 0;
    min-height: 52px;
  }

  html.ignex-demo .app-main { padding-top: 18px; }
}
