/* ========================================================================
   ServiceNow integration tables

   Used by:
     docs/settings/integrations/ticketing/servicenow/deep-dive/how-it-works.md
     docs/settings/integrations/ticketing/servicenow/deep-dive/permissions.md
     docs/settings/integrations/ticketing/servicenow/deep-dive/requirements.md
     docs/settings/integrations/ticketing/servicenow/how-tos/connection/add-connection.md
     docs/settings/integrations/ticketing/servicenow/how-tos/connection/edit-connection.md
     docs/settings/integrations/ticketing/servicenow/deep-dive/sync-behavior.md
     docs/settings/integrations/ticketing/servicenow/how-tos/ticket/create-ticket.md

   Only a min-width here, never overflow-x: the theme already wraps every table
   in .md-typeset__scrollwrap, which scrolls and carries a -0.8rem side margin.
   A second scrolling wrapper around it shows a stray scrollbar even when the
   table fits.
   ======================================================================== */

/* What Gets Synced: direction and action read as labels, so neither wraps and
   the result column takes what is left. */
.servicenow-sync-table table {
  width: 100%;
  min-width: 52rem;
}

.servicenow-sync-table table th,
.servicenow-sync-table table td {
  vertical-align: top;
}

.servicenow-sync-table table th:nth-child(1),
.servicenow-sync-table table td:nth-child(1),
.servicenow-sync-table table th:nth-child(2),
.servicenow-sync-table table td:nth-child(2) {
  white-space: nowrap;
}

.servicenow-sync-table table th:nth-child(3),
.servicenow-sync-table table td:nth-child(3) {
  width: 100%;
}

.servicenow-sync-table table th:nth-child(4),
.servicenow-sync-table table td:nth-child(4) {
  white-space: nowrap;
  text-align: center;
}

/* Create a Ticket field reference: the field name and the ServiceNow field it
   maps to are short, so the description column takes the rest. */
.servicenow-ticket-fields-table table {
  width: 100%;
  min-width: 44rem;
}

.servicenow-ticket-fields-table table th,
.servicenow-ticket-fields-table table td {
  vertical-align: top;
}

.servicenow-ticket-fields-table table th:nth-child(1),
.servicenow-ticket-fields-table table td:nth-child(1),
.servicenow-ticket-fields-table table th:nth-child(3),
.servicenow-ticket-fields-table table td:nth-child(3) {
  white-space: nowrap;
}

.servicenow-ticket-fields-table table th:nth-child(2),
.servicenow-ticket-fields-table table td:nth-child(2) {
  white-space: nowrap;
  text-align: center;
}

.servicenow-ticket-fields-table table th:nth-child(4),
.servicenow-ticket-fields-table table td:nth-child(4) {
  width: 100%;
}

/* Incident states: the code, the name, and the recognition mark are all short,
   so the description column takes the rest. */
.servicenow-states-table table {
  width: 100%;
  /* Without a floor the three narrow columns squash the description instead of
     letting the theme's wrapper scroll. */
  min-width: 46rem;
}

.servicenow-states-table table th:nth-child(1),
.servicenow-states-table table td:nth-child(1),
.servicenow-states-table table th:nth-child(2),
.servicenow-states-table table td:nth-child(2),
.servicenow-states-table table th:nth-child(3),
.servicenow-states-table table td:nth-child(3) {
  white-space: nowrap;
  text-align: center;
}

.servicenow-states-table table th:nth-child(2),
.servicenow-states-table table td:nth-child(2) {
  text-align: left;
}

.servicenow-states-table table th:nth-child(4),
.servicenow-states-table table td:nth-child(4) {
  width: 100%;
}

/* Requirements: the label column holds short names, so it stays on one line and
   the details column takes the rest. Below the floor the theme's wrapper scrolls. */
.servicenow-requirements-table table {
  width: 100%;
  min-width: 40rem;
}

.servicenow-requirements-table table th,
.servicenow-requirements-table table td {
  vertical-align: top;
}

.servicenow-requirements-table table th:nth-child(1),
.servicenow-requirements-table table td:nth-child(1) {
  white-space: nowrap;
}

.servicenow-requirements-table table th:nth-child(2),
.servicenow-requirements-table table td:nth-child(2) {
  width: 100%;
}

/* Permissions: the role columns hold a single mark each, so they size to it and
   the action or scenario column takes the rest. */
.servicenow-permissions-table table {
  width: 100%;
  min-width: 42rem;
}

.servicenow-permissions-table table th,
.servicenow-permissions-table table td {
  vertical-align: top;
}

.servicenow-permissions-table table th:nth-child(1),
.servicenow-permissions-table table td:nth-child(1) {
  width: 100%;
}

.servicenow-permissions-table table th:nth-child(n + 2),
.servicenow-permissions-table table td:nth-child(n + 2) {
  white-space: nowrap;
  text-align: center;
}

/* Two of the four tables pair a label with prose rather than with marks, so the
   second column reads as text and takes the room instead. */
.servicenow-permissions-table--prose table th:nth-child(1),
.servicenow-permissions-table--prose table td:nth-child(1) {
  width: auto;
  white-space: nowrap;
}

.servicenow-permissions-table--prose table th:nth-child(2),
.servicenow-permissions-table--prose table td:nth-child(2) {
  width: 100%;
  white-space: normal;
  text-align: left;
}

/* Status Mapping guidance: the anomaly status is a short label, so it stays on
   one line and the two prose columns share what is left. */
.servicenow-mapping-table table {
  width: 100%;
  min-width: 46rem;
}

.servicenow-mapping-table table th,
.servicenow-mapping-table table td {
  vertical-align: top;
}

.servicenow-mapping-table table th:nth-child(1),
.servicenow-mapping-table table td:nth-child(1) {
  white-space: nowrap;
}

.servicenow-mapping-table table th:nth-child(2),
.servicenow-mapping-table table td:nth-child(2),
.servicenow-mapping-table table th:nth-child(3),
.servicenow-mapping-table table td:nth-child(3) {
  width: 50%;
}
