/* Shared transport workflows: allow real content widths on desktop and phone. */
.workflow-templates { margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--border, #d5e1e8); }
.workflow-templates > label { display:block; margin-bottom:8px; font-weight:700; color:var(--muted,#64748b); }
.workflow-inline { display:flex; flex-wrap:wrap; gap:8px; min-width:0; }
.workflow-inline select { flex:1 1 200px; min-width:0; }
.metric-secondary { display:block; font-size:.78rem; line-height:1.4; margin-top:6px; color:var(--muted,#64748b); }
.history-worklist { padding:16px 0; }
.workflow-filters { display:grid; grid-template-columns:repeat(2,minmax(125px,.8fr)) repeat(2,minmax(160px,1.2fr)) auto; gap:12px; align-items:end; }
.workflow-filters label { display:grid; gap:6px; font-weight:650; font-size:.8rem; min-width:0; }
.workflow-filters input, .workflow-filters select { min-width:0; width:100%; }
.workflow-bulk { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-top:12px; font-size:.8rem; }
.workflow-bulk label { display:flex; align-items:center; gap:8px; }
.workflow-bulk input, .history-selection-cell input { width:18px; height:18px; accent-color:#2e7184; }
.history-selection-cell { text-align:center; }
.workflow-bulk .btn { padding:8px 12px; }
.workflow-list { display:grid; gap:10px; }
.workflow-list-row { display:flex; align-items:center; flex-wrap:wrap; gap:10px; padding:14px; border:1px solid #d5e1e8; border-radius:10px; }
.workflow-list-row > div { flex:1 1 180px; min-width:0; display:grid; gap:4px; overflow-wrap:anywhere; }
.workflow-list-row > div > span { color:#64748b; font-size:.85rem; }
.workflow-reconciliation, .workflow-readiness { display:grid; gap:6px; padding:14px 16px; border:1px solid #cde1e8; border-radius:10px; background:#f3f9fb; margin-bottom:16px; overflow-wrap:anywhere; }
.workflow-reconciliation span, .workflow-readiness span { font-size:.85rem; color:#64748b; }
.workflow-form-error { color:#ad3627; background:#fff2ef; padding:12px; border-radius:8px; }
.workflow-stats-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; margin-top:18px; }
.workflow-stats-grid .stats-insight-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.excluded-carrier-row > .btn { justify-self:start; }
@media (max-width:1100px) {
  .workflow-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .workflow-filters > .btn { grid-column:1/-1; justify-self:start; }
  .workflow-stats-grid { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:700px) {
  .workflow-inline > .btn { flex:1 1 140px; }
  .workflow-inline select { flex-basis:100%; width:100%; }
  .workflow-bulk { gap:8px; }
  .workflow-bulk > label { width:100%; }
  .workflow-bulk > .btn { flex:1 1 140px; }
  .history-table .history-selection-cell { grid-column:1/-1; display:flex; justify-content:flex-end; }
  .workflow-list-row > .btn { flex:1 1 120px; }
  .workflow-stats-grid .stats-insight-grid { grid-template-columns:minmax(0,1fr); }
}
#invoiceEditor { grid-template-columns:repeat(2,minmax(0,1fr)); }
#invoiceEditor .field { min-width:0; justify-content:flex-end; }
.invoice-field-label { font-size:.82rem; color:#344054; font-weight:800; }
.invoice-received-control { display:flex; align-items:center; gap:8px; height:42px; padding:5px 10px; border:1px solid #cfd7e2; border-radius:7px; background:#fff; color:var(--ink); cursor:pointer; line-height:1.15; }
.invoice-received-control:focus-within { border-color:var(--brand); box-shadow:0 0 0 3px rgba(47,111,131,.12); }
.invoice-received-control input[type="checkbox"] { width:18px; min-width:18px; height:18px; min-height:18px; flex:0 0 18px; margin:0; padding:0; accent-color:var(--brand); }
.history-invoice-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.history-invoice-fields > .field { min-width:0; justify-content:flex-end; }
#invoiceEditor #invoiceDate { height:42px; }
#invoiceEditor .invoice-difference-preview { margin:0; color:var(--muted); font-size:.82rem; line-height:1.4; }
@media (max-width:480px) {
  #invoiceEditor { grid-template-columns:minmax(0,1fr); }
}
.comparison-savings { padding:10px 12px; margin:12px 0 0; background:#f3f9fb; color:#64748b; border-radius:8px; font-size:.8rem; line-height:1.5; overflow-wrap:anywhere; }
.comparison-savings strong { color:#245c70; }
.workflow-confirm-overlay { position:fixed; inset:0; z-index:15000; display:grid; place-items:center; padding:16px; background:rgba(15,30,43,.42); }
.workflow-confirm-dialog { width:min(100%,480px); max-height:calc(100dvh - 32px); overflow:auto; padding:24px; border-radius:16px; background:white; box-shadow:0 20px 60px #10203030; }
.workflow-confirm-dialog h2 { font-size:1.25rem; margin:0 0 12px; }
.workflow-confirm-dialog p { line-height:1.5; margin:0 0 20px; }
.workflow-confirm-dialog .form-actions { display:flex; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
@media (max-width:700px) { .workflow-confirm-dialog .btn { flex:1 1 120px; } }
.stats-history-link { appearance:none; border:0; background:none; color:#245c70; font:inherit; padding:0; text-align:left; cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
.stats-history-link:hover { color:#173a48; }
.excluded-carrier-reason > .btn { justify-self:start; min-height:32px; padding:5px 10px; margin-top:8px; font-size:.78rem; }
body[data-workspace-view] select:not([multiple]):not(#historyPageSize) {
  padding-right:38px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 11px center; background-size:18px;
}

/* History detail: invoice figures and transport actions stay distinct and compact. */
.workflow-reconciliation.history-invoice-summary { background:#fff; border-color:var(--line); margin:12px 0; padding:12px; container-type:inline-size; }
.history-invoice-heading { display:grid; grid-template-columns:minmax(0,1fr) max-content auto; align-items:center; gap:16px; }
.history-invoice-title { min-width:0; }
.history-invoice-heading h3 { margin:0; font-size:.9rem; line-height:1.4; }
.history-invoice-heading h3 span { margin-left:5px; color:var(--muted); font-size:.72rem; font-weight:500; }
.history-invoice-title .history-invoice-meta { margin-top:2px; overflow-wrap:anywhere; }
.history-invoice-heading .history-invoice-edit-btn { width:36px; height:36px; min-height:36px; padding:8px; }
.history-invoice-edit-btn svg { width:18px; height:18px; }
.history-invoice-metrics { display:grid; grid-template-columns:repeat(3,max-content); gap:16px; margin:0; }
.history-invoice-metrics > div { display:grid; gap:2px; min-width:0; }
.history-invoice-metrics > div + div { border-left:1px solid var(--line); padding-left:16px; }
.history-invoice-metrics dt { color:var(--muted); font-size:.78rem; margin:0; }
.history-invoice-metrics dd { margin:0; font-size:1rem; font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; }
.history-invoice-metrics .invoice-overrun { color:#b45309; }
.history-invoice-metrics .invoice-saving { color:#187348; }
.history-invoice-meta { margin:0; color:var(--muted); font-size:.78rem; line-height:1.35; }
@container (max-width:650px) {
  .history-invoice-heading { grid-template-columns:minmax(0,1fr) auto; gap:10px 12px; }
  .history-invoice-edit-btn { grid-column:2; grid-row:1; }
  .history-invoice-metrics, .history-invoice-empty { grid-column:1 / -1; grid-row:2; }
  .history-invoice-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@container (max-width:360px) {
  .history-invoice-metrics { grid-template-columns:1fr; gap:5px; }
  .history-invoice-metrics > div { display:flex; justify-content:space-between; gap:12px; align-items:baseline; }
  .history-invoice-metrics > div + div { border-left:0; padding-left:0; }
}
.history-detail-actions { position:relative; border-top:0; padding-top:0; justify-content:space-between; align-items:center; }
.history-detail-tools { position:static; flex:none; margin-left:auto; }
.history-detail-tools > .history-edit-icon-btn { width:42px; height:42px; min-height:42px; padding:10px; }
.history-detail-tools .history-tools-popover { top:auto; right:0; bottom:calc(100% + 8px); max-width:100%; max-height:min(60vh,350px); overflow-y:auto; }
.history-detail-actions #historyDetailDeleteBtn { margin-right:0; }
@media(max-width:480px) {
  .history-detail-actions > #historyRepeatBtn { flex:1; width:auto; min-width:0; }
}

/* Compact transport template picker and management rows. */
.workflow-templates { margin-bottom:14px; padding-bottom:12px; }
.workflow-templates > label { margin-bottom:5px; font-size:.8rem; }
.workflow-templates .workflow-inline { display:flex; flex-wrap:nowrap; align-items:center; gap:8px; }
.workflow-templates .workflow-inline select { flex:1 1 0; width:0; min-width:0; min-height:38px; }
.workflow-templates .workflow-inline > .btn { flex:0 0 auto; width:auto; min-width:0; min-height:38px; padding:8px 12px; font-size:.8rem; }
.transport-template-list { display:grid; gap:8px; padding-bottom:4px; }
.transport-template-row { display:flex; align-items:center; gap:10px; padding:10px 12px; border:1px solid var(--line); border-radius:8px; min-width:0; }
.transport-template-info { flex:1; min-width:0; display:grid; gap:3px; overflow-wrap:anywhere; }
.transport-template-info strong { font-size:.9rem; line-height:1.3; }
.transport-template-info > span { color:var(--muted); font-size:.78rem; }
.template-transport-details { display:flex; flex-wrap:wrap; gap:3px 14px; margin:0; font-size:.78rem; color:var(--muted); }
.template-transport-details > div { display:flex; flex-wrap:wrap; gap:4px; min-width:0; }
.template-transport-details dt { font-weight:600; }
.template-transport-details dd { margin:0; }
.template-transport-packages, .template-transport-note { margin:0; color:var(--muted); font-size:.78rem; line-height:1.4; }
.template-transport-packages b, .template-transport-note b { font-weight:600; }
.template-transport-note { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; white-space:pre-line; }
.transport-template-row > .template-use { flex:none; width:auto; padding:7px 10px; min-height:36px; font-size:.8rem; }
.template-row-tools { position:relative; flex:none; }
.template-row-tools > .btn { width:36px; min-width:36px; height:36px; min-height:36px; padding:8px; }
.template-row-tools .history-tools-popover { position:fixed; top:auto; right:auto; z-index:140; }
.template-package-field { gap:4px; }
.template-package-field > .template-package-hint { margin:0 0 4px; }
.template-package-hint { margin:4px 0 10px; color:var(--muted); font-size:.78rem; line-height:1.45; }
.template-extras .switch-control { white-space:normal; align-items:center; }
.template-extras .switch-control em { display:grid; gap:3px; min-width:0; overflow-wrap:anywhere; line-height:1.35; }
.template-extras .switch-control em small { color:var(--muted); font-size:.72rem; font-weight:500; }
.template-extras .switch-control:focus-within { outline:2px solid var(--brand); outline-offset:2px; }
.template-package-empty { grid-column:1/-1; margin:0; color:var(--muted); font-size:.8rem; }
.template-input-summary { color:var(--muted); margin:0; font-size:.85rem; }
.template-save-summary { gap:4px; overflow-wrap:anywhere; }
@media(max-width:480px) {
  .transport-template-row { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:7px 8px; padding:10px; }
  .transport-template-info { grid-column:1/-1; }
  .template-row-tools { grid-column:2; }
  .transport-template-row > .template-use { grid-column:3; }
  .template-extras { grid-template-columns:1fr; }
}

/* Match the compact template rows while retaining the history test hook. */
.history-trash-row { flex-wrap:nowrap; }
.history-trash-row > .history-trash-actions { display:flex; flex:none; align-items:center; justify-content:flex-end; gap:8px; }
.history-trash-actions > .btn { width:auto; min-height:36px; padding:7px 10px; font-size:.8rem; white-space:nowrap; }
.history-trash-row .transport-template-info > span { font-size:.78rem; }
.history-trash-footer { display:flex; justify-content:flex-end; padding-top:0; margin-top:16px; border-top:0; }
.history-trash-footer .btn { min-height:36px; padding:7px 10px; font-size:.8rem; }
@media(max-width:480px) {
  .history-trash-row > .history-trash-actions { grid-column:1/-1; }
  .history-trash-footer .btn { width:100%; white-space:normal; }
}

/* Compact settings filters share the history filter trigger and dialog layout. */
.workspace-header-controls .btn.admin-filter-trigger,
.fuel-admin-diesel-actions .btn.admin-filter-trigger {
  flex: 0 0 38px;
  width: 38px;
  min-width: 38px;
  padding: 0;
}
.modal:has(#adminFiltersMenu, #statsFiltersMenu) { width: min(680px, calc(100vw - 24px)); }
:is(#adminFiltersMenu, #statsFiltersMenu) .workflow-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
:is(#adminFiltersMenu, #statsFiltersMenu) input, :is(#adminFiltersMenu, #statsFiltersMenu) select { width: 100%; min-width: 0; }
#adminFiltersMenu label:has(input[type="search"]) { grid-column: 1 / -1; }
.fuel-admin-diesel-actions { display: flex; align-items: center; gap: 8px; }
.fuel-rate-field { position: relative; width: 78px; min-width: 0; }
.fuel-rate-field input { width: 100%; padding-left: 6px; padding-right: 23px; text-align: center; }
.fuel-rate-field > span { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); color: var(--muted); pointer-events: none; font-size: .8rem; }
.fuel-admin-form .fuel-country-control-row { grid-template-columns: minmax(0, 1fr) 78px auto; }
.fuel-admin-form .fuel-country-control-row > .fuel-rate-field { width: 78px; }
.fuel-country-control-row .fuel-assigned-link {
  display: inline; border: 0; background: none; padding: 0; color: inherit;
  font: inherit; text-align: left; white-space: normal; overflow-wrap: anywhere;
  cursor: pointer; text-decoration: underline; text-decoration-color: #bdd2ca; text-underline-offset: 2px;
}
.fuel-assigned-link:hover { text-decoration-color: currentColor; }
.fuel-assigned-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 2px; }
.transport-optional-fields { min-width: 0; }
.transport-optional-fields summary { display: none; }
.transport-optional-fields > .field { margin-top: 0; }
@media (max-width: 700px) {
  .transport-optional-fields summary { display: list-item; cursor: pointer; padding: 10px 0; color: var(--primary); font-weight: 750; }
  .transport-optional-fields[open] > .field { margin-top: 8px; }
}
@container fuel-card (max-width: 360px) {
  .fuel-admin-form .fuel-country-control-row { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (max-width: 700px) {
  .workspace-header-controls > .toolbar-actions:has(.admin-filter-trigger):not(.fuel-admin-diesel) {
    flex-wrap: nowrap;
  }
  .workspace-header-controls > .toolbar-actions:has(.admin-filter-trigger):not(.fuel-admin-diesel) > .btn:not(.admin-filter-trigger) {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }
}

/* Header actions use one compact height across every workspace view. */
.topbar .top-actions .btn {
  height: 38px;
  min-height: 38px;
  padding-block: 0;
  font-size: .84rem;
  line-height: 1.2;
}

/* Shared controls and responsive transport workflows. */
.section-demo-notice.subscription-banner { margin:0 0 14px; }
.subscription-banner.archive span { color:inherit; }
.active-filter-chips { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:0 0 14px; min-width:0; }
.active-filter-chips[hidden] { display:none; }
.filter-chip { border:1px solid #c9dfe6; border-radius:20px; background:#edf6f9; color:#245c70; padding:6px 10px; font:inherit; font-size:.78rem; cursor:pointer; max-width:100%; overflow-wrap:anywhere; text-align:left; }
.filter-chip:hover { background:#dfedf2; }
.stats-drill-label { border:0; background:none; font:inherit; padding:0; color:var(--brand,#245c70); text-align:left; cursor:pointer; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.stats-drill-label:hover { text-decoration:underline; text-underline-offset:3px; }
.stats-visual-toggle, .mobile-matrix-zone-select, .comparison-package-toggle { display:none; }
.selected-packages-summary { color:var(--muted,#64748b); font-size:.78rem; margin:4px 0; overflow-wrap:anywhere; }

/* Package names lead; carrier prices are quiet secondary information, not pills. */
#extrasGrid .extra-card { --package-meta-color: var(--muted); padding: 10px 12px; }
#extrasGrid .extra-card-body { gap: 7px; }
#extrasGrid .extra-card-head { align-items: baseline; gap: 10px; }
#extrasGrid .extra-card-title strong { color: var(--ink); font-size: .94rem; font-weight: 800; line-height: 1.3; }
#extrasGrid .extra-group-badge {
  min-height: 0; max-width: 42%; padding: 0; border: 0; border-radius: 0;
  background: transparent; color: var(--brand-dark); font-size: .78rem; font-weight: 700;
  line-height: 1.3; text-align: right;
}
#extrasGrid .extra-price-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 16px; }
#extrasGrid .extra-price-pill {
  min-width: 0; min-height: 0; max-width: 100%; padding: 0; gap: 6px;
  align-items: baseline; border: 0; border-radius: 0; background: transparent;
  color: var(--package-meta-color); font-size: .72rem; line-height: 1.45; box-shadow: none;
}
#extrasGrid .extra-price-pill b {
  flex: 0 1 auto; color: var(--package-meta-color); font-weight: 400;
  overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere;
}
#extrasGrid .extra-price-pill em { color: var(--package-meta-color); font-weight: 500; font-size: inherit; }
@media screen {
  html:not([data-theme="dark"]) #extrasGrid .extra-card:not(:has(input:checked)) {
    background: #fbfcfd; border-color: var(--line); box-shadow: none;
  }
  html:not([data-theme="dark"]) #extrasGrid .extra-card:not(:has(input:checked)):hover {
    background: #fff; border-color: #98a2b3;
  }
  html:not([data-theme="dark"]) #extrasGrid .extra-card:is(:focus-visible, :has(input:focus-visible)) {
    outline: 2px solid #667085; outline-offset: 2px;
  }
  html:not([data-theme="dark"]) #extrasGrid .extra-card:has(input:checked) {
    --package-meta-color: #596a7a;
    background: #e4f2f5; border-color: var(--brand);
    box-shadow: inset 4px 0 0 var(--brand);
  }
  html[data-theme="dark"] #extrasGrid .extra-card:not(:has(input:checked)) {
    background: var(--surface); border-color: var(--line); box-shadow: none;
  }
  html[data-theme="dark"] #extrasGrid .extra-card:not(:has(input:checked)):hover {
    background: #233543; border-color: #688b9f;
  }
  html[data-theme="dark"] #extrasGrid .extra-card:is(:focus-visible, :has(input:focus-visible)) {
    outline: 2px solid var(--brand); outline-offset: 2px;
  }
  html[data-theme="dark"] #extrasGrid .extra-card:has(input:checked) {
    --package-meta-color: #c8d8e4;
    background: #244454;
    border-color: #83c9dc;
    box-shadow: inset 4px 0 0 #83c9dc;
  }
  html[data-theme="dark"] #extrasGrid .extra-card:has(input:checked):is(:hover, :focus-within, :focus-visible) {
    background: #244454;
    border-color: #a3deef;
  }
}

.field-error { display:block; font-size:.76rem; line-height:1.35; color:#ab3028; margin-top:4px; font-weight:500; }
.field-error[hidden] { display:none; }
input[aria-invalid="true"],textarea[aria-invalid="true"] { border-color:#bf4d41; }
.zone-ranges-details { margin:10px 0; font-size:.8rem; }
.zone-ranges-details summary { color:var(--brand,#245c70); cursor:pointer; font-weight:650; }
.zone-ranges-details .zone-card-ranges { margin-top:8px; }
.table-validity { display:block; color:var(--muted,#64748b); font-size:.78rem; margin-top:8px; }
.transport-secondary-fields { display:block; }
.transport-secondary-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; min-width:0; }
.transport-secondary-grid .field:has(textarea) { grid-column:1/-1; }
.transport-secondary-fields:not([open]) > :not(summary) { display:none; }
.password-input-wrap { position:relative; min-width:0; }
.password-input-wrap input { width:100%; padding-right:88px; }
.password-toggle { position:absolute; right:6px; top:50%; transform:translateY(-50%); padding:6px 8px; border:0; border-radius:6px; color:var(--brand,#245c70); background:transparent; font:inherit; font-size:.78rem; cursor:pointer; }
#loginPasswordHint { color:var(--muted,#64748b); }
#toast { display:flex; align-items:center; gap:12px; max-width:min(640px,calc(100vw - 24px)); white-space:normal; }
#toast > span { min-width:0; overflow-wrap:anywhere; }
.toast-action,.toast-close { color:inherit; border:0; background:transparent; font:inherit; cursor:pointer; padding:5px; flex:none; }
.toast-action { font-weight:750; text-decoration:underline; text-underline-offset:3px; }
.toast-close { font-size:1.3rem; line-height:1; }
#toast.toast-error { background:#862e25; }
.template-search { width:100%; margin-bottom:12px; }
@media (max-width:700px) {
  .history-table .history-row { position:relative; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:8px 14px; padding:12px; }
  .history-table .history-row > td.history-mobile-secondary { display:none; }
  .history-table .history-row > td.history-mobile-primary { background:none; border:0; margin:0; padding:0; min-width:0; }
  .history-table .history-row > .history-cell-carrier { order:1; font-weight:750; }
  .history-table .history-row > .history-cell-total { order:2; text-align:right; padding-right:30px; font-size:1rem; font-weight:750; }
  .history-table .history-row > .history-cell-date { order:3; color:var(--muted); font-size:.8rem; }
  .history-table .history-row > .history-cell-destination { order:4; text-align:right; color:var(--muted); font-size:.8rem; }
  .history-table .history-row > .history-cell-customer { order:5; }
  .history-table .history-row > .history-cell-invoiceReceived { order:6; text-align:right; }
  .history-table .history-row > :is(.history-cell-carrier,.history-cell-total,.history-cell-date,.history-cell-destination)::before { display:none; }
  .history-table .history-row > .history-selection-cell { position:absolute; right:12px; top:12px; display:block; padding:0; border:0; width:20px; }
  .history-table .history-row > .history-selection-cell::before { display:none; }
  .history-table .history-row > .history-cell-invoiceReceived::before { display:none; }
  #zoneMatrixTableWrap { overflow:visible; }
  .mobile-matrix-zone-select { display:grid; gap:6px; margin-bottom:14px; font-weight:650; font-size:.82rem; }
  .mobile-matrix-zone-select select { width:100%; }
  #zoneMatrixTableWrap .zone-matrix-table { width:100%; min-width:0; table-layout:fixed; }
  #zoneMatrixTableWrap .zone-matrix-table tr > :first-child { width:34%; min-width:0; }
  #zoneMatrixTableWrap .zone-matrix-table tr > :not(:first-child):not(.matrix-other-zone) { width:66%; min-width:0; }
  #zoneMatrixTableWrap .zone-matrix-table .matrix-other-zone { display:none; }
  #zoneMatrixTableWrap .zone-matrix-table input, #zoneMatrixTableWrap .zone-matrix-table textarea { min-width:0; width:100%; overflow-wrap:normal; word-break:normal; font-size:.88rem; }
  #zoneMatrixTableWrap .zone-matrix-table textarea { min-height:70px; }
  .comparison-package-toggle { display:inline-flex; width:100%; justify-content:space-between; white-space:normal; margin-bottom:6px; }
  .extra-step-heading { flex-wrap:wrap; }
  #extrasGrid { max-height:none; overflow:visible; }
  #extrasGrid.mobile-packages-collapsed, #extrasFilter.mobile-packages-collapsed { display:none; }
  #extrasGrid .extra-card-head { display:grid; grid-template-columns:minmax(0,1fr); gap:3px; }
  #extrasGrid .extra-group-badge { max-width:100%; justify-self:start; text-align:left; overflow-wrap:break-word; word-break:normal; }
  #extrasGrid .extra-price-list { grid-template-columns:minmax(0,1fr); }
  #extrasGrid .extra-price-pill { justify-content:space-between; }
  #extrasGrid .extra-price-pill b { flex:1; overflow-wrap:break-word; word-break:normal; }
  #extrasGrid .extra-price-pill em { flex:none; }
  .zone-matrix-actions .matrix-weight-field:not([hidden]) { display:grid; grid-template-columns:minmax(0,1fr) 74px; gap:6px; min-width:0; width:100%; flex:1 1 100%; }
  .zone-matrix-actions .matrix-weight-field > span { grid-column:1/-1; }
  .zone-matrix-actions .matrix-weight-field :is(input,select) { width:100%; min-width:0; max-width:100%; }
  .comparison-diesel-refresh { min-width:40px; min-height:40px; }
  .stats-visual-toggle { display:block; border:0; border-radius:6px; background:#edf6f9; color:var(--brand); padding:8px 10px; font:inherit; font-size:.78rem; cursor:pointer; margin:8px 0; }
  .stats-visual-card:not(.is-expanded) > .stats-visual-body { display:none; }
  body[data-workspace-view="stats"] .workspace-header-controls { flex-wrap:nowrap; }
  body[data-workspace-view="stats"] #statsExportBtn { flex:1 1 auto; width:auto; min-width:0; }
  .transport-secondary-fields > summary { font-size:.8rem; }
  #modalContent :is(#manualHistoryForm,#historyEditForm,#invoiceEditor,#transportTemplateForm,#zoneMatrixForm,#serviceEditorForm) > .form-actions {
    position:sticky; bottom:-1px; z-index:5; background:var(--panel); border-top:0; margin-top:4px; padding:12px 0 max(12px,env(safe-area-inset-bottom)); display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px;
  }
  #modalContent :is(#manualHistoryForm,#historyEditForm,#invoiceEditor,#transportTemplateForm,#zoneMatrixForm,#serviceEditorForm) > .form-actions .btn { width:100%; min-width:0; min-height:42px; margin:0; white-space:normal; overflow-wrap:normal; word-break:normal; }
  #modalContent :is(#manualHistoryForm,#historyEditForm,#invoiceEditor,#transportTemplateForm,#zoneMatrixForm,#serviceEditorForm) > .form-actions:has(> .btn:nth-child(3)) > .btn-primary { grid-column:1/-1; }
}

.import-preview-counts { display:flex; flex-wrap:wrap; gap:16px; padding:14px 0; }

.comparison-result-count { margin:0; color:var(--muted); font-size:.8rem; }
