/* Original document tables: generous spacing, consistent 18px reading size. */
.table-scroll {
  margin: 28px 0 42px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid #dce5df;
  border-radius: 16px;
  background: #ffffff;
  scrollbar-width: thin;
  scrollbar-color: #b6c9bf #edf3ef;
}

.source-table {
  --table-accent: #347466;
  width: 100%;
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  color: #203c35;
  background: #ffffff;
  font-size: 18px;
  line-height: 1.85;
  text-align: left;
}

.source-table th,
.source-table td {
  padding: 24px 28px;
  border: 0;
  vertical-align: top;
  font-size: 18px;
}

.source-table thead th {
  padding-top: 22px;
  padding-bottom: 22px;
  border-top: 3px solid var(--table-accent);
  border-bottom: 1px solid #dce5df;
  background: #edf3ef;
  color: #203c35;
  font-weight: 650;
  line-height: 1.65;
}

.source-table tbody tr + tr > td {
  border-top: 1px solid #e7ede9;
}

.source-table tbody tr:nth-child(even) > td {
  background: #f8faf8;
}

.source-table .source-cell {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.source-table:not(.flow-table) th:first-child {
  width: 23%;
}

.source-table:not(.flow-table) tbody td:first-child {
  color: #203c35;
  font-weight: 600;
}

.source-table:not(.flow-table) tbody td + td {
  color: #385148;
}

/* Team colors distinguish existing A / B tables without adding text. */
.source-table:has([data-source^="33-"]) {
  --table-accent: #347466;
}

.source-table:has([data-source^="33-"]) tbody td:first-child {
  color: #347466;
}

.source-table:has([data-source^="35-"]) {
  --table-accent: #b39363;
}

.source-table:has([data-source^="35-"]) thead th {
  background: #f5f1e9;
}

.source-table:has([data-source^="35-"]) tbody td:first-child {
  color: #80653e;
}

.source-table:has([data-source^="35-"]) tbody tr:nth-child(even) > td {
  background: #fbf9f5;
}

/* Comparison columns retain their original order and use quiet color cues. */
.source-table:has([data-source^="41-"]) thead th:first-child {
  border-top-color: #dce5df;
  background: #f8faf8;
}

.source-table:has([data-source^="41-"]) thead th:nth-child(2) {
  border-top-color: #347466;
  background: #edf3ef;
}

.source-table:has([data-source^="41-"]) thead th:nth-child(3) {
  border-top-color: #b39363;
  background: #f5f1e9;
}

.source-table:has([data-source^="41-"]) tbody td:nth-child(2) {
  border-left: 1px solid #e7ede9;
}

.source-table:has([data-source^="41-"]) tbody td:nth-child(3) {
  border-left: 1px solid #eee9df;
}

/* Story sketch / original story / original play / play sketch. */
.table-scroll:has(.flow-table) {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.flow-table {
  min-width: 1280px;
  border-spacing: 0 16px;
  background: transparent;
}

.flow-table .sketch-col {
  width: 24%;
}

.flow-table .text-col {
  width: 26%;
}

.flow-table thead th {
  border-top: 0;
  border-bottom: 1px solid #dce5df;
  background: #edf3ef;
  padding: 20px 26px;
}

.flow-table thead th:first-child {
  border-radius: 12px 0 0 12px;
}

.flow-table thead th:last-child {
  border-radius: 0 12px 12px 0;
}

.flow-table tbody tr > td,
.flow-table tbody tr:nth-child(even) > td,
.flow-table tbody tr + tr > td {
  border-top: 1px solid #dce5df;
  border-bottom: 1px solid #dce5df;
  padding: 32px 26px;
  background: #ffffff;
  vertical-align: middle;
}

.flow-table tbody tr > td:nth-child(2) {
  background: #f8faf8;
}

.flow-table tbody tr > td:nth-child(3) {
  background: #fcfbf8;
  color: #385148;
}

.flow-table tbody tr > td:first-child {
  border-left: 1px solid #dce5df;
  border-radius: 14px 0 0 14px;
}

.flow-table tbody tr > td:last-child {
  border-right: 1px solid #dce5df;
  border-radius: 0 14px 14px 0;
}

.flow-table tbody td:nth-child(2) .source-cell {
  line-height: 2;
}

.flow-table tbody td:nth-child(2) .source-cell::first-line {
  color: #203c35;
  font-weight: 750;
}

.flow-table tbody tr > .sketch-cell {
  padding: 20px;
  background: #ffffff;
}

.flow-table .sketch-cell .sketch {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid #edf1ee;
  border-radius: 8px;
  background-color: #ffffff;
  background-repeat: no-repeat;
}

@media (max-width: 760px) {
  .table-scroll {
    margin-top: 22px;
    margin-bottom: 34px;
    border-radius: 12px;
  }

  .source-table,
  .source-table th,
  .source-table td {
    font-size: 18px;
  }

  .table-scroll:has(.flow-table) {
    border-radius: 0;
  }
}
