/* User values never determine the width of the surrounding workspace.
   These are visual limits only: source values, accessible names and exports
   remain intact. Full values can be read in the record or a disclosure. */
:root {
  --field-identifier-cap: 20ch;
  --field-name-cap: 24ch;
  --field-label-cap: 28ch;
}

:is(.content, #view, .table-wrap, .overview-content, .workspace-stack,
    .profile-overview, .workspace-team-grid, .core-module-grid,
    .panel-header > div, .workspace-section-heading > div,
    .workspace-banner > div, .core-platform-hero > div:first-child,
    .page-heading > div:first-child, .dialog-header > div,
    .video-analysis-heading > div, .ptt-transcript-heading > div) {
  min-inline-size: 0;
  max-inline-size: 100%;
}
.table-wrap { inline-size: 100%; }
:where(.content, dialog) :where(p, dd, li) { overflow-wrap: anywhere; }

/* A table's columns are sized by its worklist, not by an unbroken hash.
   Narrow screens retain the existing keyboard-accessible table scrollbar. */
.product-table {
  table-layout: fixed;
  inline-size: 100%;
}
.product-table :is(th, td) {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}
.product-table th { white-space: normal; }
.product-table td { overflow: hidden; text-overflow: ellipsis; }
.product-table .media-id,
.product-table .media-id-sub,
.product-table .cell-user strong,
.product-table .cell-channel,
.product-table .media-ai-summary > :is(strong, small),
.workspace-video-item .workspace-video-item-copy > :is(strong, span, small),
.bounded-value {
  display: block;
  min-inline-size: 0;
  max-inline-size: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.product-table .media-id {
  max-inline-size: min(100%, var(--field-identifier-cap));
  text-align: start;
}
.product-table .media-id-sub { max-inline-size: 100%; }
.product-table .cell-user {
  min-inline-size: 0;
  max-inline-size: 100%;
}
.product-table .cell-user strong {
  max-inline-size: min(100%, var(--field-name-cap));
}
.product-table .cell-channel {
  display: table-cell;
  max-inline-size: var(--field-name-cap);
}
.product-table .cell-user .user-avatar { flex-shrink: 0; }
.product-table .badge {
  min-inline-size: 0;
  max-inline-size: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.product-table .row-actions { overflow: visible; white-space: normal; }
.product-table .row-actions :is(.button, .row-button) {
  max-inline-size: 100%;
  white-space: normal;
}

/* Evidence rows keep AI observations separate from saved human judgments. */
.merged-product-table { min-inline-size: 1120px; }
.merged-product-table th:nth-child(1) { inline-size: 8%; }
.merged-product-table th:nth-child(2) { inline-size: 13%; }
.merged-product-table th:nth-child(3) { inline-size: 11%; }
.merged-product-table th:nth-child(4) { inline-size: 13%; }
.merged-product-table th:nth-child(5) { inline-size: 8%; }
.merged-product-table th:nth-child(6) { inline-size: 10%; }
.merged-product-table th:nth-child(7) { inline-size: 14%; }
.merged-product-table th:nth-child(8) { inline-size: 14%; }
.merged-product-table th:nth-child(9) { inline-size: 9%; }
.merged-product-table :is(.media-ai-summary, .media-human-summary) {
  min-inline-size: 0;
  max-inline-size: 100%;
}
.merged-product-table .media-human-summary { line-height: 1.45; }
.merged-product-table .media-human-summary > :is(strong, small) {
  display: block;
  min-inline-size: 0;
  max-inline-size: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 11px;
}
.merged-product-table .media-human-summary > strong { font-weight: 600; }
.merged-product-table .media-human-summary > small { margin-block-start: 4px; color: var(--muted); }
.merged-product-table .media-human-summary > strong.ok { color: #2b8065; }
.merged-product-table .media-human-summary > strong.error { color: #a84440; }
.merged-product-table .evidence-duration > span,
.merged-product-table .evidence-duration > .evidence-ptt-count { display: block; }
.merged-product-table .evidence-duration > .evidence-ptt-count {
  min-inline-size: 0;
  margin-block-start: 4px;
  font-size: 10px;
  white-space: normal;
  line-height: 1.4;
}
.merged-product-table .row-actions .evidence-play-action {
  white-space: nowrap;
  padding-inline: 8px;
  gap: 5px;
}
.workspace-video-library,
.workspace-video-item,
.workspace-video-item-copy,
.workspace-selected-video,
.workspace-control-title {
  min-inline-size: 0;
  max-inline-size: 100%;
}
.workspace-video-item .workspace-video-item-copy > strong {
  max-inline-size: min(100%, var(--field-label-cap));
}
.workspace-selected-video :is(h2, h3) {
  max-inline-size: min(100%, 48ch);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Full detail is intentionally allowed to wrap; clipping is for compact cells. */
:is(.detail-grid, .workspace-data-grid, .player-source-meta) > div,
.workspace-team-card,
.workspace-pill-list,
.stat-card > div,
.account-profile > span:last-child {
  min-inline-size: 0;
}
:is(.dialog-header h2, #detail-title, .workspace-section-heading h2,
    .workspace-banner strong, .workspace-banner p, .core-platform-hero h2,
    .profile-card h2, .profile-card p, .workspace-team-card h3,
    .workspace-control-title h2, .workspace-selected-video-meta,
    .workspace-team-card p, .workspace-data-grid dd, .detail-grid dd,
    .player-source-meta dd, .inspector-profile legend,
    .video-analysis-heading h3, .ptt-transcript-heading h3) {
  max-inline-size: 100%;
  overflow-wrap: anywhere;
}
.workspace-pill { min-inline-size: 0; max-inline-size: 100%; white-space: normal; overflow-wrap: anywhere; }
.workspace-source-detail td {
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
}
.topbar :is(.workspace, .account, .account-profile) { min-inline-size: 0; }
.account-profile { max-inline-size: 100%; }
.topbar .workspace strong,
.account-profile strong,
.account-profile small {
  min-inline-size: 0;
  max-inline-size: var(--field-name-cap);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-profile small { display: block; }

/* Native disclosures give compact read-only fields a touch/keyboard expansion. */
.field-disclosure { min-inline-size: 0; max-inline-size: 100%; }
.field-disclosure > summary { min-inline-size: 0; max-inline-size: 100%; cursor: pointer; }
.field-disclosure > .field-full-value,
.field-disclosure[open] > summary .bounded-value {
  max-inline-size: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.field-full-value { margin-block: .45rem; line-height: 1.5; }

/* National counters stay separate from their icons at mobile widths. */
.stat-value {
  max-inline-size: 100%;
  font-size: clamp(20px, 2.1vw, 29px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 720px) {
  .stat-card { grid-template-columns: minmax(0, 1fr) 30px; gap: 6px; padding: 12px; }
  .stat-icon { padding: 6px; }
  .stat-icon svg { inline-size: 18px; block-size: 18px; }
  .stat-value { font-size: clamp(17px, 4.6vw, 24px); }
}

/* Work-order context stays bounded while the evidence table gains one column. */
.merged-product-table.has-work-orders { min-inline-size: 1160px; }
.merged-product-table.has-work-orders th:nth-child(1) { inline-size: 7%; }
.merged-product-table.has-work-orders th:nth-child(2) { inline-size: 14%; }
.merged-product-table.has-work-orders th:nth-child(3) { inline-size: 11%; }
.merged-product-table.has-work-orders th:nth-child(4) { inline-size: 10%; }
.merged-product-table.has-work-orders th:nth-child(5) { inline-size: 12%; }
.merged-product-table.has-work-orders th:nth-child(6) { inline-size: 7%; }
.merged-product-table.has-work-orders th:nth-child(7) { inline-size: 9%; }
.merged-product-table.has-work-orders th:nth-child(8) { inline-size: 12%; }
.merged-product-table.has-work-orders th:nth-child(9) { inline-size: 11%; }
.merged-product-table.has-work-orders th:nth-child(10) { inline-size: 7%; }
.record-work-order-cell { min-inline-size: 120px; max-inline-size: 220px; }
.player-record-work-orders { padding: 18px; border-block-start: 1px solid var(--border); }

.record-origin-ai_generated{color:var(--accent);background:var(--accent-soft,#f2eafb)}
