/* Text-layout reliability layer.
   Keep labels, amounts, dates and actions readable while letting genuine prose wrap. */

body {
  word-break: normal;
  overflow-wrap: break-word;
}

button,
.btn,
.status,
.badge,
.service-badge,
.ai-confidence-tag,
.channel-apply-badge,
.channel-state-tag,
.channel-status-pill,
.die-status,
.home-image-status-chip,
.home-session-badge,
.industry-chip,
.industry-workflow-badge,
.inquiry-attachment-status,
.jl-dieline-3d__badge,
.jl-dieline-3d__status,
.jl-vector-badge,
.order-purchase-badge,
.preflight-status,
.preflight-version-badge,
.price-import-status,
.pro-badge,
.pro-tag,
.production-step-outsource-status,
.quote-outcome-status,
.quote-record-badge,
.quote-reliability-badge,
.vector-job-status,
.visual-version-status,
.header-alert-button,
.task-priority-badge,
.task-phase-substatus,
.filter-tabs button,
.workflow-nav button,
th {
  word-break: keep-all;
  overflow-wrap: normal;
  white-space: nowrap;
}

.table-scroll,
.table-wrap,
.cost-library-table-wrap,
.channel-table-wrap,
.pro-table-wrap,
.quote-cost-lines-scroll {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.table-scroll > table {
  min-width: 860px;
}

.table-wrap > table {
  min-width: 760px;
}

td[data-label="编号"],
td[data-label="金额"],
td[data-label="负责人"],
td[data-label="截止/跟进"] {
  font-variant-numeric: tabular-nums;
  word-break: keep-all;
  overflow-wrap: normal;
}

.ai-loading {
  width: min(100%, 760px);
  max-width: 760px;
}

.ai-loading-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ai-loading-copy strong {
  overflow-wrap: break-word;
  word-break: normal;
}

.ai-loading-copy em {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  min-width: 0;
}

.ai-elapsed-time,
.usability-elapsed {
  display: inline-flex;
  flex: 0 0 auto;
  word-break: keep-all;
  overflow-wrap: normal;
  white-space: nowrap;
}

.ai-elapsed-note {
  min-width: 180px;
  overflow-wrap: break-word;
  word-break: normal;
}

.task-studio-page .table-scroll {
  scrollbar-gutter: stable;
}

.task-studio-page table {
  min-width: 1440px;
  table-layout: fixed;
}

/* The old medium-width shortcut removed amount and risk entirely.  The table now
   scrolls horizontally, so every business-critical column stays available. */
.task-studio-page th:nth-child(7),
.task-studio-page th:nth-child(8),
.task-studio-page td[data-label="金额"],
.task-studio-page td[data-label="风险"] {
  display: table-cell;
}

.task-table-columns .task-col-id { width: 140px; }
.task-table-columns .task-col-customer { width: 165px; }
.task-table-columns .task-col-status { width: 105px; }
.task-table-columns .task-col-next { width: 255px; }
.task-table-columns .task-col-owner { width: 105px; }
.task-table-columns .task-col-due { width: 170px; }
.task-table-columns .task-col-money { width: 105px; }
.task-table-columns .task-col-risk { width: 165px; }
.task-table-columns .task-col-actions { width: 230px; }

.task-studio-page th,
.task-studio-page td {
  word-break: normal;
  overflow-wrap: break-word;
}

.task-cell-id,
.task-cell-owner,
.task-cell-due,
.task-cell-money,
.task-priority-badge,
.task-phase-substatus,
.task-studio-page .status {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  word-break: keep-all;
  overflow-wrap: normal;
  white-space: nowrap;
}

.task-cell-customer,
.task-cell-next,
.task-cell-risk {
  line-height: 1.65;
  word-break: normal;
  overflow-wrap: break-word;
}

.task-phase-substatus {
  margin-top: 7px;
}

.task-row-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.task-row-actions .btn {
  width: 100%;
  min-width: 0;
  padding-inline: 8px;
}

@media (max-width: 620px) {
  .table-scroll > table {
    min-width: 0;
  }

  .task-studio-page table {
    min-width: 0;
    table-layout: auto;
  }

  .task-table-columns {
    display: none;
  }

  .task-studio-page tbody td[data-label="操作"] {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .task-row-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-loading {
    width: 100%;
  }

  .ai-elapsed-note {
    min-width: 0;
  }
}
