/* Shared screen components. Parameters live in ui-tokens.css. Never applies to the technologist workspace or its table.
   Keep numeric columns intact; wide reports scroll instead of shrinking text. */
body:not(.technologist-mode) .page-display-tools {
  display:flex;align-items:end;gap:var(--ui-space-md);flex-wrap:wrap;
}
body:not(.technologist-mode) .display-density {
  display:grid;gap:4px;font-size:var(--ui-label);color:var(--brown2);
}
body:not(.technologist-mode) .display-density select {
  min-height:var(--ui-control-height);padding:6px 30px 6px 10px;border:1px solid var(--line);
  border-radius:var(--ui-radius-control);background:var(--paper);color:var(--brown);font:inherit;font-size:var(--ui-control-text);
}
body:not(.technologist-mode) .table-wrap:not(.technologist-plan-table) {
  overscroll-behavior-x:contain;scrollbar-width:auto;max-height:var(--ui-table-max-height);
}
body:not(.technologist-mode) .table-wrap:not(.technologist-plan-table) table {
  font-size:var(--report-text);font-variant-numeric:tabular-nums;line-height:var(--ui-line-height);
}
body:not(.technologist-mode) .table-wrap:not(.technologist-plan-table) td {
  font-size:var(--report-text);padding:var(--report-padding) var(--ui-cell-inline);height:var(--ui-row-height);
}
body:not(.technologist-mode) .table-wrap:not(.technologist-plan-table) th {
  font-size:var(--report-heading);line-height:var(--ui-heading-line-height);padding:var(--ui-cell-heading);
  text-transform:none;letter-spacing:normal;white-space:normal;min-width:var(--ui-column-min);
}
body:not(.technologist-mode) .table-wrap:not(.technologist-plan-table) td :is(b,strong,a) {font-size:inherit}
body:not(.technologist-mode) .table-wrap:not(.technologist-plan-table) td>small {display:block;margin-top:var(--ui-space-xs)}
body:not(.technologist-mode) .fraud-document-table :is(table,td) {font-size:var(--report-text);line-height:var(--ui-line-height)}
body:not(.technologist-mode) .fraud-document-table th {font-size:var(--report-heading);text-transform:none}
body:not(.technologist-mode) :is(.fraud-signal-main small,.fraud-signal-context small,.fraud-signal-time,.fraud-document-meta,.fraud-document-payments,.fraud-document-comment,.fraud-document-note,.fraud-review-existing span,.fraud-review-existing p,.fraud-review-actions span,.fraud-method-note) {font-size:var(--report-note);line-height:var(--ui-note-line-height)}
body:not(.technologist-mode) :is(.fraud-signal-main b,.fraud-signal-context b,.fraud-document>summary b,.fraud-document>summary strong,.fraud-evidence b) {font-size:var(--report-text)}
body:not(.technologist-mode) .table-wrap:not(.technologist-plan-table) :is(small,.tree-subtitle,.production-coverage,.production-cost-source,.regional-metric-cell>small,.inventory-delta,.fraud-tag,.table-progress span) {
  font-size:var(--report-note);line-height:var(--ui-line-height);
}
body:not(.technologist-mode) :is(.regional-signal-tags i,.admin-role,.admin-warning,.admin-key-state,.inventory-estimate) {
  font-size:var(--report-note);line-height:var(--ui-line-height);
}
body:not(.technologist-mode) :is(.regional-product-table,.production-plan-table,.procurement-table) td:first-child {
  position:sticky;left:0;z-index:1;background:var(--paper);white-space:normal;
  min-width:var(--ui-name-min);max-width:var(--ui-name-max);overflow-wrap:break-word;box-shadow:5px 0 8px -8px var(--brown2);
}
body:not(.technologist-mode) :is(.regional-product-table,.production-plan-table,.procurement-table) th:first-child {
  left:0;z-index:5;min-width:var(--ui-name-min);
}
body:not(.technologist-mode) .regional-product-table .regional-deviation-row.critical td:first-child {background:var(--ui-critical-surface)}
body:not(.technologist-mode) .regional-product-table .regional-deviation-row.warning td:first-child {background:var(--ui-warning-surface)}
body:not(.technologist-mode) .regional-product-table .regional-deviation-row.ahead td:first-child {background:var(--ui-ahead-surface)}
body:not(.technologist-mode) :is(.production-plan-table,.procurement-table) tr[data-level="0"] td:first-child {background:var(--ui-group-surface)}
body:not(.technologist-mode) :is(.production-plan-table,.procurement-table) tr[data-level="1"] td:first-child {background:var(--ui-subgroup-surface)}
body:not(.technologist-mode) .inventory-matrix thead tr:first-child th:not([rowspan]) {
  height:var(--report-header-height);padding-block:8px;white-space:nowrap;
}
body:not(.technologist-mode) .inventory-matrix thead tr:nth-child(2) th {top:var(--report-header-height)}
body:not(.technologist-mode) :is(.kpis,.regional-kpis,.planning-kpis,#production-planning-kpis,.pace-kpis,.main-dashboard-kpis,.director-kpis) {
  grid-template-columns:repeat(auto-fit,minmax(min(100%,var(--ui-kpi-min)),1fr));
}
body:not(.technologist-mode) .kpi {
  display:grid;grid-template-columns:var(--ui-kpi-icon) minmax(0,1fr);
  gap:var(--ui-kpi-gap);align-content:start;align-items:center;
  padding:var(--ui-kpi-padding);height:auto;min-width:0;
}
body:not(.technologist-mode) .kpi>div {display:contents}
body:not(.technologist-mode) .kpi>.kpi-icon {
  grid-column:1;grid-row:1;width:var(--ui-kpi-icon);height:var(--ui-kpi-icon);
}
body:not(.technologist-mode) .kpi small {grid-column:2;grid-row:1;min-width:0;overflow-wrap:anywhere}
body:not(.technologist-mode) .kpi :is(strong,div>span) {
  grid-column:1/-1;min-width:0;max-width:100%;white-space:normal;
  overflow-wrap:anywhere;
}
body:not(.technologist-mode) .kpi small {font-size:var(--ui-label);line-height:var(--ui-line-height)}
body:not(.technologist-mode) .kpi div span {font-size:var(--report-note);line-height:var(--ui-line-height);color:#70594c}
body:not(.technologist-mode) .kpi strong {font-size:var(--ui-kpi-value);line-height:var(--ui-line-height)}
body:not(.technologist-mode) :is(.flight-status,.pace-pulse,.regional-today-summary,
  .regional-plan-metrics,.finance-analysis-summary,.signal-overview,.signal-breakdown,.signal-context) {
  grid-template-columns:repeat(auto-fit,minmax(min(100%,var(--ui-metric-min)),1fr));
}
body:not(.technologist-mode) :is(.flight-status,.pace-pulse,.regional-plan-panel,
  .regional-today-summary,.finance-analysis-summary,.signal-overview,.signal-breakdown,.signal-context) :is(div,b,strong,small,span,p) {
  min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;
}
body:not(.technologist-mode) :is(.card h2,.planning-today-heading b) {font-size:var(--ui-section-title);line-height:var(--ui-line-height)}
body:not(.technologist-mode) :is(.card-heading span,.card-tools small,.note,.planning-method span,.planning-method p,.planning-method small,.planning-calculation small,.planning-steps span,.planning-steps b,.planning-history-layers span,.planning-history-layers strong,.planning-method-facts small,.regional-plan-panel small,.regional-plan-panel span,.regional-recommendation p,.regional-task-row small) {
  font-size:var(--report-note);line-height:var(--ui-note-line-height);
}
body:not(.technologist-mode) :is(.regional-recommendation b,.regional-task-row b,.planning-method-facts b) {font-size:var(--report-text)}
body:not(.technologist-mode) :is(.regional-recommendation-actions button,.regional-task-tools select,.regional-product-heading-tools button,.table-action) {
  font-size:var(--report-note);min-height:var(--ui-control-height);
}
body:not(.technologist-mode) .regional-plan-panel h2 {font-size:var(--ui-display)}
body:not(.technologist-mode) :is(.filters>label,.filter-field>label) {font-size:var(--ui-label)}
body:not(.technologist-mode) :is(.filters input:not([type="checkbox"]):not([type="radio"]),.multi-button,.date-preset-button,.multi-option,.date-preset-panel button,.search,.filter-actions button) {font-size:var(--ui-control-text);min-height:var(--ui-control-height)}
body:not(.technologist-mode) :is(.multi-panel,.date-preset-panel) {top:calc(100% + 5px)}
body:not(.technologist-mode) .card-heading {gap:var(--ui-space-md);flex-wrap:wrap;padding-block:6px}
body:not(.technologist-mode) .regional-today-details {grid-template-columns:1fr}
body:not(.technologist-mode) :is(.production-tree-toggle,.inventory-tree-toggle) {
  width:var(--ui-tree-control);height:var(--ui-tree-control);flex-basis:var(--ui-tree-control);font-size:var(--ui-icon-text);
}
@media (max-width:1400px) {
  body:not(.technologist-mode) .grid.two {grid-template-columns:1fr}
  body:not(.technologist-mode) .planning-method {grid-template-columns:1fr}
}
@media (max-width:1100px) {
  body:not(.technologist-mode) .page-head {align-items:start;gap:var(--ui-space-md);flex-wrap:wrap}
  body:not(.technologist-mode) :is(.filters input:not([type="checkbox"]):not([type="radio"]),.multi-button,.date-preset-button,.multi-option,.date-preset-panel button,.search,.filter-actions button,.table-action,.display-density select,.regional-recommendation-actions button) {min-height:var(--ui-touch-height);font-size:var(--ui-control-text)}
  body:not(.technologist-mode) :is(.production-tree-toggle,.inventory-tree-toggle) {width:var(--ui-touch-height);height:var(--ui-touch-height);flex-basis:var(--ui-touch-height)}
}

/* Shared geometry. Local sections own only their column layout and domain state. */
body:not(.technologist-mode) .page-head h1 {font-size:var(--ui-page-title)}
body:not(.technologist-mode) .card {
  border-radius:var(--ui-radius-card);margin-bottom:var(--ui-grid-gap);
}
body:not(.technologist-mode) .grid {gap:var(--ui-grid-gap)}
body:not(.technologist-mode) :is(.filters,.selector-grid,.card-tools) {gap:var(--ui-space-sm)}
body:not(.technologist-mode) :is(.admin-form,.source-editor,.user-editor,.modal-body) :is(
  input:not([type="checkbox"]):not([type="radio"]),select,textarea
) {
  font-size:var(--report-text);min-height:var(--ui-control-height);
  border-radius:var(--ui-radius-control);line-height:var(--ui-line-height);
}
body:not(.technologist-mode) :is(.admin-form label,.source-editor label,
  .user-editor>label,.modal-body>label,.modal-grid label) {font-size:var(--report-note)}
body:not(.technologist-mode) :is(.admin-form button,.source-editor>button,
  .user-editor>button,.modal-form footer button) {
  font-size:var(--report-note);min-height:var(--ui-control-height);
  border-radius:var(--ui-radius-control);
}
body:not(.technologist-mode) .fraud-document-table :is(td,th) {
  padding:var(--report-padding) var(--ui-cell-inline);height:var(--ui-row-height);
}
@media (max-width:760px) {
  body:not(.technologist-mode) .page-head h1 {font-size:var(--ui-page-title-mobile)}
}

/* Lists, summaries and pickers are reports too; do not inherit tiny label fonts. */
body:not(.technologist-mode) :is(
  .searchable-control input,.searchable-option,.selector-grid select,
  .report-product-filters select,.signal b,.signal-detail>summary>strong,
  .signal-overview b,.signal-context b,.signal-breakdown b,.signal-products li,
  .quality-node>summary b,.quality-node>summary strong,
  .fraud-rule b,.fraud-signal>summary>strong,.fraud-document>summary b,
  .fraud-document>summary strong,.fraud-document-meta b,.fraud-document-payments b,
  .finance-insight,.finance-insight b,.finance-insight span,.finance-analysis-summary b,
  .finance-trend-analysis h4,.regional-attention b,.regional-region-list b,
  .regional-region-list strong,.pace-driver b,.pace-driver>strong,
  .product-ranking-item b,.product-ranking-item strong,.product-ranking-item small
) {font-size:var(--report-text);line-height:var(--ui-line-height)}
body:not(.technologist-mode) :is(
  .selector-grid label,.report-product-filters label,.searchable-empty,
  .signal p,.signal-severity,.signal-tags span,.signal-overview small,
  .signal-context small,.signal-products>small,.signal-breakdown small,
  .signal-breakdown span,.quality-node>summary span:not(.quality-node-icon),
  .quality-control-note,.quality-receipt-meta,.fraud-rule small,
  .fraud-evidence small,.fraud-documents h4,.fraud-document>summary small,
  .fraud-review-heading small,.fraud-review-fields legend,.fraud-review-fields>label,
  .fraud-review-fields fieldset label,.fraud-tools>span,
  .fraud-document>summary>span,.finance-insight small,.finance-insight i,
  .finance-analysis-empty,.finance-trend-status,
  .finance-trend-note,.finance-trends-heading small,.finance-trend-analysis h5,
  .finance-trend-analysis>header span,.finance-analysis-summary small,
  .finance-analysis-summary span,.regional-attention small,.regional-attention strong,
  .regional-region-list small,.regional-region-list span,.regional-health,
  .regional-empty-state span,.pace-driver span,.pace-driver span strong
) {font-size:var(--report-note);line-height:var(--ui-note-line-height)}
body:not(.technologist-mode) :is(
  .quality-tree-actions button,.regional-attention>button,.fraud-tools select,
  .fraud-review-fields textarea,.fraud-review-actions button,
  .finance-trend-modes button,.finance-insight
) {min-height:var(--ui-touch-height);font-size:var(--report-note)}
body:not(.technologist-mode) .searchable-control {height:var(--ui-row-height)}
body:not(.technologist-mode) .searchable-option {min-height:var(--ui-touch-height)}
body:not(.technologist-mode) .searchable-panel {top:calc(100% + 5px)}
body:not(.technologist-mode) :is(.quality-node>summary,.fraud-document>summary) {min-height:var(--ui-summary-height)}
body:not(.technologist-mode) :is(.signal-main b,.quality-node>summary b,
  .regional-attention b,.pace-driver b,.product-ranking-item b) {
  white-space:normal;overflow-wrap:anywhere;
}
body:not(.technologist-mode) .product-ranking-item {
  grid-template-columns:28px minmax(0,1fr) minmax(110px,auto) minmax(180px,auto);
  min-height:var(--ui-summary-height);
}
body:not(.technologist-mode) .finance-insight {font-size:var(--report-text)}
body:not(.technologist-mode) .finance-trends-heading {flex-wrap:wrap}
body:not(.technologist-mode) .finance-trend-modes {flex-wrap:wrap;max-width:100%}
body:not(.technologist-mode) .finance-insight :is(b,span) {overflow-wrap:anywhere}
@media (max-width:1100px) {
  body:not(.technologist-mode) .product-ranking-item {grid-template-columns:28px minmax(0,1fr) auto}
  body:not(.technologist-mode) .product-ranking-item strong {grid-column:2/-1}
  body:not(.technologist-mode) .finance-intro {grid-template-columns:minmax(0,1fr)}
}
@media (max-width:600px) {
  body:not(.technologist-mode) .product-ranking-item {grid-template-columns:28px minmax(0,1fr)}
  body:not(.technologist-mode) .product-ranking-item :is(small,strong) {grid-column:2;text-align:left;white-space:normal}
  body:not(.technologist-mode) .regional-attention {grid-template-columns:28px minmax(0,1fr)}
  body:not(.technologist-mode) .regional-attention>button {grid-column:2;justify-self:start}
  body:not(.technologist-mode) .pace-driver {align-items:start;flex-wrap:wrap}
}
@media (max-width:600px) {
  body:not(.technologist-mode) .page-display-tools {width:100%;justify-content:space-between}
  body:not(.technologist-mode) .kpis {grid-template-columns:1fr}
  body:not(.technologist-mode) .card-tools {flex-wrap:wrap;gap:8px;padding:10px}
  body:not(.technologist-mode) .card-tools .search {width:100%;max-width:none;margin:0}
  body:not(.technologist-mode) :is(.regional-product-table,.production-plan-table,.procurement-table) td:first-child,
  body:not(.technologist-mode) :is(.regional-product-table,.production-plan-table,.procurement-table) th:first-child {
    min-width:var(--ui-name-mobile-min);max-width:var(--ui-name-mobile-max);
  }
  body:not(.technologist-mode) .card-heading>span {padding-inline:12px}
}
/* Canvas typography is applied by charts.js; the control stays outside the canvas. */
body:not(.technologist-mode) .chart-box.chart-expandable {cursor:default}
body:not(.technologist-mode) .chart-box.chart-expandable::after {display:none}
body:not(.technologist-mode) .chart-fullscreen-button {
  position:absolute;right:8px;top:8px;z-index:8;width:var(--ui-chart-control);height:var(--ui-chart-control);
  display:grid;place-items:center;border:1px solid var(--line);border-radius:var(--ui-radius-control);
  background:var(--paper);color:var(--brown2);font-size:var(--ui-icon-text);cursor:pointer;
}
body:not(.technologist-mode) .chart-fullscreen-button:focus-visible {outline:2px solid var(--gold)}
body:not(.technologist-mode) .chart-box.pie-chart {height:var(--ui-chart-pie-height)}
body:not(.technologist-mode) .topbar {
  grid-template-columns:100px minmax(0,1fr) auto;gap:12px;padding:0 12px;height:var(--ui-nav-height);
}
body:not(.technologist-mode) .brand-logo {transform:none;height:64px}
body:not(.technologist-mode) .nav-shell {
  position:relative;inset:auto;width:100%;max-width:none;height:100%;transform:none;gap:12px;
}
body:not(.technologist-mode) .nav-shell .nav-scroll {display:none!important}
body:not(.technologist-mode) .nav-shell nav {overflow:visible;gap:4px;justify-content:center}
body:not(.technologist-mode) .nav-shell nav button {
  min-width:100px;min-height:var(--ui-nav-control);padding:10px 14px;flex:1 0 auto!important;width:auto!important;
}
body:not(.technologist-mode) .nav-shell nav span {display:block;font-size:var(--ui-nav-text);white-space:nowrap;text-transform:none;letter-spacing:0}
body:not(.technologist-mode) .topbar svg {width:var(--ui-nav-icon);height:var(--ui-nav-icon);flex:0 0 var(--ui-nav-icon)}
body:not(.technologist-mode) :is(.sections-toggle,.nav-current) {display:none}
body:not(.technologist-mode) .nav-menu .sections-toggle {
  display:flex;align-items:center;gap:10px;min-height:var(--ui-nav-control);padding:0 14px;border:1px solid #795b4e;
  border-radius:var(--ui-radius-control);background:transparent;color:#fff;font:inherit;font-size:var(--ui-nav-text);cursor:pointer;
}
body:not(.technologist-mode) .sections-toggle>span {font-size:var(--ui-nav-icon)}
body:not(.technologist-mode) .nav-menu .nav-current {display:block;min-width:0;font-size:var(--ui-nav-text);line-height:1.4;color:#fff;overflow-wrap:anywhere}
body:not(.technologist-mode) .nav-menu nav {display:none}
body:not(.technologist-mode) .nav-menu.nav-open nav {
  display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));position:absolute;top:100%;left:0;
  width:min(720px,calc(100vw - 24px));height:auto;max-height:70dvh;overflow-y:auto;overscroll-behavior:contain;
  padding:8px;background:var(--brown);border:1px solid #795b4e;border-radius:12px;box-shadow:0 12px 32px #0005;z-index:85;
}
body:not(.technologist-mode) .nav-menu nav button {flex-direction:row;justify-content:flex-start;gap:12px;border-radius:8px}
body:not(.technologist-mode) .nav-menu nav button span {white-space:normal;text-align:left}
body:not(.technologist-mode) .updated {gap:8px}
body:not(.technologist-mode) .updated :is(button,.admin-link,.user-menu>button) {
  min-width:var(--ui-nav-control);height:var(--ui-nav-control);font-size:var(--ui-nav-text);
}
body:not(.technologist-mode) .updated b {font-size:var(--ui-nav-text)}
@media(max-width:650px) {
  body:not(.technologist-mode) .topbar {grid-template-columns:80px minmax(0,1fr);height:auto;padding:8px;gap:8px}
  body:not(.technologist-mode) .brand-logo {height:56px}
  body:not(.technologist-mode) .nav-shell {grid-column:1/-1;grid-row:2;min-height:56px}
  body:not(.technologist-mode) .updated {grid-column:2;grid-row:1}
  body:not(.technologist-mode) .updated>b {display:none}
  body:not(.technologist-mode) .nav-menu.nav-open nav {width:calc(100vw - 16px);grid-template-columns:1fr}
  body:not(.technologist-mode) .updated .user-menu>button {max-width:110px}
}
@media(max-width:380px) {
  body:not(.technologist-mode) .updated .user-menu>button {max-width:80px;padding:0 6px}
  body:not(.technologist-mode) .updated #current-user {max-width:48px}
}
