.collab-main {
  max-width: 1620px;
  min-width: 0;
}
.collab-nav {
  margin-top: 16px;
}
.collab-nav a {
  display: block;
  padding: 11px 12px;
  text-decoration: none;
  color: #bdd0d7;
  border-radius: 7px;
  font-size: 13px;
}
.collab-nav a:hover,
.collab-nav a:focus {
  background: #204957;
  color: white;
}
.collab-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 20px 22px;
  margin-bottom: 22px;
  box-shadow: 0 1px 2px #102f3c05;
}
.collab-card h2 {
  font-size: 19px;
}
.collab-card h3 {
  font-size: 13px;
  margin: 16px 0 10px;
}
.collab-card h4 {
  font-size: 12px;
  margin: 15px 0 7px;
}
.collab-card small {
  font-size: 11px;
  color: var(--teal);
}
.collab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 10px 12px;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--line);
}
.fields h3 {
  grid-column: 1/-1;
  margin: 0 0 2px;
}
.fields > label {
  min-width: 0;
}
.fields button {
  max-width: 100%;
  white-space: normal;
  text-align: center;
}
.wide-fields {
  grid-template-columns:
    minmax(180px, 2fr) 1fr minmax(120px, 1fr) minmax(140px, 1fr) minmax(140px, 1fr)
    auto;
}
.wide-fields button {
  align-self: end;
}
.wide-fields label:first-child {
  min-width: 180px;
}
.card-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}
.status-pill {
  background: #e8f5f2;
  color: #235e56;
  font-size: 11px;
  letter-spacing: 0.03em;
  padding: 7px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.actions-block {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 14px 0 10px;
  align-items: end;
}
.actions-block label {
  width: 100%;
}
.actions-block button {
  background: #f2f7f8;
  border-color: #cadfe1;
  color: #24555d;
  padding: 8px 11px;
  white-space: normal;
}
.actions-block button.primary {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
}
.detail {
  background: #f5f9fa;
  border: 1px solid #e5edef;
  padding: 13px 15px;
  margin-top: 13px;
  border-radius: 7px;
  color: #476473;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.detail h3 {
  margin: 0 0 6px;
  color: var(--ink);
}
.detail p {
  margin: 7px 0;
}
.event-lines {
  padding-left: 21px;
  margin: 8px 0;
}
.event-lines li {
  padding: 6px 0;
  border-bottom: 1px solid #e7eef1;
}
.event-lines li:last-child {
  border: 0;
}
.event-lines small {
  display: block;
  color: #6f8390;
  font-size: 11px;
}
.cooperation-page input:invalid {
  border-color: #cae0dc;
}
#operation-log {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 340px;
  overflow: auto;
  background: #f2f7f8;
  color: #23434d;
  border-radius: 7px;
  padding: 16px;
  font:
    12px/1.8 Consolas,
    "Microsoft YaHei",
    monospace;
}
@media (max-width: 1200px) {
  .wide-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 980px) {
  .collab-grid {
    grid-template-columns: 1fr;
  }
  .fields {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 760px) {
  .wide-fields {
    grid-template-columns: 1fr 1fr;
  }
  .cooperation-page aside {
    min-height: 0;
  }
  .collab-nav {
    display: flex;
    overflow-x: auto;
  }
  .collab-nav a {
    white-space: nowrap;
  }
  .collab-card {
    padding: 17px;
  }
}
@media (max-width: 800px) {
  .collab-main,
  .collab-grid,
  .collab-card,
  .fields,
  .wide-fields {
    min-width: 0;
  }
  .fields,
  .wide-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .fields > *,
  .wide-fields > * {
    min-width: 0;
    max-width: 100%;
  }
  .collab-nav {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
}
@media (max-width: 530px) {
  .fields,
  .wide-fields {
    grid-template-columns: 1fr;
  }
  .collab-main {
    padding: 18px 12px;
  }
}
/* Batch10 source-evidence table: preserve short identifiers and readable stages. */
#adoption-table {
  overflow-x: auto;
}
#adoption-table table {
  table-layout: auto;
  width: 100%;
  min-width: 740px;
}
#adoption-table th:first-child,
#adoption-table td:first-child {
  width: 64px;
  white-space: nowrap;
  word-break: normal;
}
#adoption-table th:nth-child(2),
#adoption-table td:nth-child(2) {
  width: 26%;
}
#adoption-table th:nth-child(3),
#adoption-table td:nth-child(3) {
  width: 112px;
  white-space: nowrap;
  word-break: normal;
}
#adoption-table td small {
  display: block;
  margin-top: 4px;
}
#combo-work .fields label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 8px;
}
#combo-work input[type="checkbox"] {
  width: auto;
  margin: 0;
}
/* Preserve exact long source-version IDs while keeping the mobile page within the viewport. */
#p05-deliverables-view {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
#p05-deliverables-view table {
  min-width: 620px;
  max-width: none;
}
/* Keep source-ledger tables horizontally scrollable without expanding the 375px viewport. */
#finance-service-condition-view,
#finance-service-ledger {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
#finance-service-ledger {
  display: block;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
#finance-service-ledger table {
  min-width: 680px;
  max-width: none;
}

/* RC2: long source-adoption status must wrap rather than expand the 375px layout viewport. */
@media (max-width: 530px) {
  #adoption-summary {
    white-space: normal;
    overflow-wrap: anywhere;
    max-width: 100%;
    min-width: 0;
  }
  .card-heading {
    flex-wrap: wrap;
  }
  .collab-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .collab-grid > .collab-card {
    min-width: 0;
  }
  .collab-card {
    min-width: 0;
  }
  .detail button {
    white-space: normal;
    overflow-wrap: anywhere;
    max-width: 100%;
  }
}
