/* Typography for the signed-in workspace.
   One token set, three text sizes. Small, Normal and Large only change these
   custom properties. Components below read the tokens; they do not invent a
   second scale. Normal is the readable default. Nothing here is below 12px. */

body.design-workspace {
  --fs-title: 24px;
  --fs-dossier-heading: 22px;
  --fs-dossier: 20px;
  --fs-section: 18px;
  --fs-sub: 16px;
  --fs-body: 15px;
  --fs-value: 15px;
  --fs-cell: 14px;
  --fs-cell-meta: 13px;
  --fs-th: 13px;
  --fs-label: 13px;
  --fs-control: 14px;
  --fs-badge: 12px;
  --fs-nav: 14px;
  --fs-nav-group: 12px;
  --fs-crumb: 13px;
  --fs-note: 13px;
  --fs-meta: 14px;
  --fs-min: 12px;
  --lh-body: 1.45;
  --lh-table: 1.35;
  --lh-tight: 1.25;
  --text-ink: var(--ink, #202b39);
  --text-muted: #596577;
  --text-placeholder: #596577;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

/* Compact density: close to the previous workspace, never under the 12px floor. */
body.design-workspace[data-text-size="small"] {
  --fs-title: 22px;
  --fs-dossier-heading: 20px;
  --fs-dossier: 18px;
  --fs-section: 16px;
  --fs-sub: 14px;
  --fs-body: 14px;
  --fs-value: 14px;
  --fs-cell: 13px;
  --fs-cell-meta: 12px;
  --fs-th: 12px;
  --fs-label: 12px;
  --fs-control: 13px;
  --fs-badge: 12px;
  --fs-nav: 13px;
  --fs-nav-group: 12px;
  --fs-crumb: 12px;
  --fs-note: 12px;
  --fs-meta: 13px;
  --fs-min: 12px;
}

/* About +15–20% for low vision. Tables 16px, body 17px. */
body.design-workspace[data-text-size="large"] {
  --fs-title: 28px;
  --fs-dossier-heading: 24px;
  --fs-dossier: 22px;
  --fs-section: 21px;
  --fs-sub: 19px;
  --fs-body: 17px;
  --fs-value: 17px;
  --fs-cell: 16px;
  --fs-cell-meta: 15px;
  --fs-th: 15px;
  --fs-label: 15px;
  --fs-control: 16px;
  --fs-badge: 14px;
  --fs-nav: 16px;
  --fs-nav-group: 14px;
  --fs-crumb: 15px;
  --fs-note: 15px;
  --fs-meta: 16px;
  --fs-min: 13px;
}

/* Headings */
body.design-workspace .heading h1,
body.design-workspace h1#title {
  font-size: var(--fs-title);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.2px;
}
body.design-workspace h1#title .title-count {
  font-size: var(--fs-meta);
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
}
body.design-workspace p#subtitle { font-size: var(--fs-meta); color: var(--text-muted); }
body.design-workspace p { line-height: var(--lh-body); }

body.design-workspace #order-panel .dossier-identification h2,
body #order-panel.intuitive-dossier .dossier-identification h2,
body #order-panel.compact-linehaul .dossier-identification h2 {
  font-size: var(--fs-dossier-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-ink);
}
body.design-workspace #order-panel .dossier-identification h2 > span,
body #order-panel.compact-linehaul .dossier-identification h2 > span {
  font-size: var(--fs-value);
  font-weight: 500;
  color: var(--text-muted);
}
body.design-workspace #order-panel .dossier-identification h2 > span:first-child,
body #order-panel.compact-linehaul .dossier-identification h2 > span:first-child {
  font-size: var(--fs-dossier);
  font-weight: 600;
  color: var(--text-ink);
  letter-spacing: -.2px;
}

body.design-workspace #order-panel .block-heading > h3,
body.design-workspace #order-panel h3,
body.design-workspace section.panel.workspace-card > h3,
body.design-workspace .records-block h3,
body.design-workspace .compact-linehaul .form-block h3,
body.design-workspace .compact-linehaul .entry-booking h3 {
  font-size: var(--fs-section);
  font-weight: 600;
  line-height: 1.3;
}
body.design-workspace #order-panel h4,
body.design-workspace .workflow-goods-title > h4,
body.design-workspace section.compact-filter-more > h4 {
  font-size: var(--fs-sub);
  font-weight: 600;
  line-height: 1.3;
}
body.design-workspace section.panel.workspace-card > p,
body.design-workspace section.cmr-drop-card > p,
body.design-workspace section.panel.task-workspace-tools > p { font-size: var(--fs-meta); }

/* Tables. Horizontal padding stays at 10px so Normal still fits 1440.
   Wide tables scroll inside .table-wrap; the page itself does not. */
body.design-workspace .table-wrap { max-width: 100%; overflow-x: auto; }
body.design-workspace .shell,
body.design-workspace .shell > main,
body.design-workspace #workspace { min-width: 0; max-width: 100%; }
body.design-workspace th,
body.design-workspace th > button.column-sort,
body.design-workspace th button {
  font-size: var(--fs-th);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  line-height: var(--lh-tight);
  white-space: nowrap;
}
body.design-workspace td { font-size: var(--fs-cell); line-height: var(--lh-table); }
body.design-workspace th,
body.design-workspace td { padding-left: 10px; padding-right: 10px; }
body.design-workspace td { padding-top: 12px; padding-bottom: 12px; }
body.design-workspace #order-list-results td { padding-top: 10px; padding-bottom: 10px; }
body.design-workspace td small,
body.design-workspace td .schedule-window,
body.design-workspace td small.order-reference,
body.design-workspace td small.cmr-age {
  font-size: var(--fs-cell-meta);
  color: var(--text-muted);
  line-height: var(--lh-table);
}
body.design-workspace td .schedule-cell > strong,
body.design-workspace td > strong { font-size: var(--fs-cell); }
body.design-workspace td small.attention { color: inherit; }
body.design-workspace td small.attention.planning-blocker { color: #b42332; }
body.design-workspace td > button.row-open,
body.design-workspace td > button.cmr-general-upload,
body.design-workspace .work-row-actions > button { font-size: var(--fs-note); line-height: var(--lh-tight); }
body.design-workspace .table-footer,
body.design-workspace .table-footer > span,
body.design-workspace .table-footer label { font-size: var(--fs-meta); }

/* Labels and values */
body.design-workspace label,
body.design-workspace .field-label,
body.design-workspace .party-field-label,
body.design-workspace #order-panel.workflow-redesign label,
body.design-workspace label.search-field > span,
body.design-workspace label.view-field > span,
body.design-workspace .shared-order-controls > label {
  font-size: var(--fs-label);
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.35;
}
body.design-workspace label :is(input, select, textarea),
body.design-workspace #order-panel :is(input:not([type=checkbox]):not([type=radio]), select, textarea),
body.design-workspace .party-selector > span { font-size: var(--fs-value); font-weight: 400; color: var(--text-ink); }
body.design-workspace .clean-address-selector > span { font-size: var(--fs-control); color: var(--text-ink); }
body.design-workspace #workspace label > select,
body.design-workspace #workspace label > input { font-size: var(--fs-control); font-weight: 400; color: var(--text-ink); }
body.design-workspace :is(input, select, textarea):is([readonly], :disabled) {
  color: var(--text-ink);
  -webkit-text-fill-color: var(--text-ink);
  opacity: 1;
}
body.design-workspace :is(input, textarea)::placeholder { color: var(--text-placeholder); opacity: 1; }
body.design-workspace span.awb-placeholder { font-size: var(--fs-meta); color: var(--text-placeholder); }
body.design-workspace .timing-label {
  font-size: var(--fs-min);
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
}
body.design-workspace small.ldm-mode-note,
body.design-workspace .compact-booked-hint,
body.design-workspace .automatic-stop-label,
body.design-workspace .block-heading > small,
body.design-workspace .block-body > small,
body.design-workspace .save-note { font-size: var(--fs-note); color: var(--text-muted); }
body.design-workspace small { font-size: var(--fs-cell-meta); }

/* Badges, pills, meta */
body.design-workspace .badge,
body.design-workspace #order-panel .dossier-meta > .badge,
body.design-workspace #order-panel .dossier-meta .badge,
body.design-workspace .arrangement-indicator,
body.design-workspace .operation-label {
  font-size: var(--fs-badge);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.3;
}
body.design-workspace .badge:not(.red):not(.green):not(.amber):not(.blue):not(.orange) { color: var(--text-muted); }
body.design-workspace .release-badge,
body.design-workspace .queue-count,
body.design-workspace .entity-caption,
body.design-workspace .goods-card-head > .goods-line-number,
body.design-workspace .data-freshness,
body.design-workspace .freshness-time,
body.design-workspace .data-freshness > small { font-size: var(--fs-min); color: var(--text-muted); }
body.design-workspace .stop-title > .stop-number,
body.design-workspace .stop-title > .stop-location { font-size: var(--fs-note); color: var(--text-muted); }
body.design-workspace .goods-card-head > strong { font-size: var(--fs-meta); }
body.design-workspace details.record-metadata > summary,
body.design-workspace details.record-metadata > summary span,
body.design-workspace details.task-more-actions > summary,
body.design-workspace details.task-filters > summary,
body.design-workspace .compact-disclosure > summary,
body.design-workspace #order-panel details.compact-disclosure > summary,
body.design-workspace #order-panel details.workflow-address-details > summary { font-size: var(--fs-note); color: var(--text-muted); }

/* Controls */
body.design-workspace #order-panel .dossier-tabs > button,
body.design-workspace #order-panel details.entry-more-sections > summary { font-size: var(--fs-control); }
body.design-workspace #order-panel .dossier-tabs > button:not(.active) { color: var(--text-muted); }
body.design-workspace .about-view,
body.design-workspace #order-panel .dossier-top > button.about-view,
body #order-panel.compact-linehaul .dossier-top > .about-view,
body #order-panel .dossier-top > button.about-view { font-size: var(--fs-note); }
body.design-workspace #order-panel .save-actions > .save-note,
body #order-panel.compact-linehaul .dossier-foot .save-note,
body #order-panel .save-actions > span.save-note { font-size: var(--fs-note); color: var(--text-muted); }
body.design-workspace .period-editor-navigation > button,
body.design-workspace .filter-chips > button,
body.design-workspace .inline-actions > button,
body.design-workspace .work-action-tabs > button,
body.design-workspace summary > .period-control-label,
body.design-workspace summary > .period-change-label { font-size: var(--fs-note); }
body.design-workspace button:disabled { font-size: inherit; }
body.design-workspace .global-order-search input { font-size: var(--fs-control); color: var(--text-ink); }
body.design-workspace .global-order-search label { font-size: var(--fs-label); color: var(--text-muted); }

/* Known small chrome that the older sheets still size in pixels. */
body.design-workspace :is(.block-kicker, .filter-help, .creation-strip p, .creation-strip label, .planning-stat small, .planning-stat > span, .heading p, .nav-order-hint, .limit-hint, .date-basis-caption, .source-record, .compact-status, .label-note) {
  font-size: var(--fs-label);
  color: var(--text-muted);
}
body.design-workspace .compact { font-size: var(--fs-min); }

/* Sidebar and top bar. 10px side padding keeps long items on one line at Normal. */
body.design-workspace .sidebar .nav-item,
body.design-workspace .sidebar .nav-item > span { font-size: var(--fs-nav); }
body.design-workspace .sidebar .nav-item { padding-left: 10px; padding-right: 10px; }
body.design-workspace .sidebar .nav-item:not(.active) { color: var(--text-muted); }
body.design-workspace .sidebar .nav-item:not(.active) > span { color: inherit; }
body.design-workspace .sidebar .nav-section-toggle,
body.design-workspace .sidebar .nav-section-toggle > span { font-size: var(--fs-nav); }
body.design-workspace .sidebar .workspace-label { font-size: var(--fs-nav-group); letter-spacing: .6px; color: var(--text-muted); }
body.design-workspace .sidebar .sidebar-foot,
body.design-workspace .sidebar .sidebar-foot small { font-size: var(--fs-min); line-height: 1.35; color: var(--text-muted); }
body.design-workspace .workspace-header #breadcrumb,
body.design-workspace .workspace-header .breadcrumb { font-size: var(--fs-crumb); }
body.design-workspace .workspace-header .entity-caption,
body.design-workspace .workspace-header .account-avatar,
body.design-workspace .account-menu > summary { font-size: var(--fs-min); }
body.design-workspace .account-menu .account-label { font-size: var(--fs-note); color: var(--text-muted); }
body.design-workspace .account-menu .release-badge { font-size: var(--fs-min); }
body.design-workspace .nav-attention > summary,
body.design-workspace .nav-attention > summary > .queue-count,
body.design-workspace .nav-attention > summary:before { font-size: var(--fs-min); }
body.design-workspace .nav-attention .nav-item { font-size: var(--fs-nav); }

/* Large may wrap a control rather than clip it or widen the page. */
body.design-workspace[data-text-size="large"] :is(.dossier-tabs > button, .sidebar .nav-item, .badge, .filter-chips > button, .work-action-tabs > button, .account-menu-content .interface-switch) {
  white-space: normal;
  height: auto;
  max-width: 100%;
}

body.design-workspace .nav-arrange { color: var(--text-muted); font-size: var(--fs-control); }
body.design-workspace .badge.blue,
body.design-workspace .arrangement-badge.neutral { color: #243b53; }
body.design-workspace .cmr-drop-zone span,
body.design-workspace .text-button,
body.design-workspace .source-field-tools small { font-size: var(--fs-note); color: var(--text-muted); }

/* Keep density independent of the user's text size, including the mobile list. */
body.design-workspace .mobile-select-visible > button,
body.design-workspace #page-actions button > span,
body.design-workspace .data-freshness,
body.design-workspace .data-freshness :is(span,small),
body.design-workspace .global-action-count,
body.design-workspace .header-search-key { font-size: var(--fs-min); }
body.design-workspace .workspace-metric > span,
body.design-workspace .phone-order-entity,
body.design-workspace #order-panel .execution-action-status strong,
body.design-workspace .mobile-records td::before,
body.design-workspace .mobile-invoice-details td::before,
body.design-workspace .invoice-allocation-table td::before { font-size: var(--fs-label); }
body.design-workspace #page-actions button > span { font-size: var(--fs-control); }
body.design-workspace :is(button,summary) { font-weight: 500; }
body.design-workspace #order-panel .party-selector > span { font-weight: 500; }
html[data-tms-interface="current"] body.design-workspace aside.sidebar .workspace-label {
  color: #c6cedb !important;
  white-space: normal !important;
}
