/* M3E-VNEXT-20261016. Workbench structure and direct five-part business analysis. */
html[data-m3e-theme] body #moduleViewWorkbench { padding:12px clamp(16px,3vw,40px) 40px; }
html[data-m3e-theme] #moduleViewWorkbench .expressive-page-heading { margin:12px 0 24px; }
html[data-m3e-theme] #moduleViewWorkbench .expressive-page-heading>p { margin:0 0 6px; font-size:13px; letter-spacing:0; }
html[data-m3e-theme] #moduleViewWorkbench .expressive-page-heading h1 { font-size:clamp(30px,3vw,40px); line-height:1.25; letter-spacing:-1px; }
html[data-m3e-theme] #moduleViewWorkbench .expressive-page-heading>div { margin-top:8px; font-size:14px; }
/* The shell already names the overview. Keep its h1 for assistive navigation,
   without reserving a second title block above the report date. */
html[data-m3e-theme] #moduleViewWorkbench[data-workbench-view="overview"]>.expressive-page-heading {
 position:absolute; width:1px; height:1px; margin:0; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap;
}
.m3e-home-date { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:20px; }
.m3e-home-date>p { margin:0; color:var(--md-muted); font-size:13px; }
html[data-m3e-theme] #moduleViewWorkbench #workbenchDateField { display:flex; align-items:center; gap:12px; min-width:0; }
html[data-m3e-theme] #moduleViewWorkbench #workbenchDateField>label { color:var(--md-on-surface); font-size:14px; font-weight:600; white-space:nowrap; }
html[data-m3e-theme] #moduleViewWorkbench #workbenchDateField .site-select-field { width:220px; min-width:0; max-width:100%; }
html[data-m3e-theme] #moduleViewWorkbench #workbenchDateField :is(select,.site-select-trigger) { min-height:48px; background:var(--md-primary-container); color:var(--md-on-primary-container); border:0; border-radius:28px; font-size:15px; }
.m3e-home-overview { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); gap:18px; }
.m3e-home-hero { min-width:0; padding:28px; border-radius:28px; color:var(--md-on-primary); background:var(--md-primary); }
.m3e-home-hero-title { display:flex; align-items:center; justify-content:space-between; gap:16px; }
html[data-m3e-theme] #workbenchHome .m3e-home-hero h2 { margin:0; font-size:22px; color:inherit; }
.m3e-home-hero-title>.ph { padding:14px; border-radius:50%; background:color-mix(in srgb,var(--md-on-primary) 12%,transparent); font-size:28px; }
.m3e-home-total { display:flex; flex-wrap:wrap; align-items:baseline; gap:12px; margin:12px 0 4px; font-size:16px; }
.m3e-home-total strong { font-size:clamp(44px,5vw,72px); line-height:1.15; letter-spacing:-2px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
#homeHoursContext { margin:8px 0 18px; font-size:14px; line-height:1.6; }
.m3e-home-hero-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; margin:0 0 24px; }
.m3e-home-hero-facts div { min-width:0; }
.m3e-home-hero-facts dt { margin:0 0 6px; font-size:14px; }
.m3e-home-hero-facts dd { margin:0; font-size:14px; }
.m3e-home-hero-facts strong { font-size:26px; font-variant-numeric:tabular-nums; }
.m3e-home-button { display:inline-flex; align-items:center; justify-content:center; gap:12px; min-height:48px; padding:12px 22px; border:0; border-radius:28px; background:var(--md-primary); color:var(--md-on-primary); font:inherit; font-weight:600; cursor:pointer; }
.m3e-home-button.inverse { background:var(--md-primary-container); color:var(--md-on-primary-container); }
html[data-m3e-theme] #workbenchHome .m3e-home-hero :is(.m3e-home-button,.m3e-home-retry):focus-visible { outline-color:var(--md-on-primary); }
.m3e-home-button:disabled { opacity:.6; cursor:default; }
.m3e-home-retry { display:block; min-height:48px; margin-top:8px; border:0; background:transparent; color:inherit; font:inherit; text-decoration:underline; cursor:pointer; }
.m3e-home-tasks { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.m3e-home-task { display:flex; flex-direction:column; min-width:0; padding:24px 20px; border-radius:26px; gap:14px; color:var(--md-on-primary-container); background:var(--md-primary-container); }
.m3e-home-task.warm { background:var(--md-accent); color:var(--md-on-accent); }
.m3e-home-task>.ph { display:grid; place-items:center; width:48px; height:48px; padding:10px; border-radius:18px; background:color-mix(in srgb,currentColor 8%,transparent); }
.m3e-home-task>span { font-size:15px; }
.m3e-home-task>strong { display:block; margin:auto 0; font-size:clamp(24px,2.8vw,40px); line-height:1.3; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.m3e-home-task-action { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:44px; font-weight:600; }
.m3e-home-links { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:20px 0; }
.m3e-home-links>a { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:18px 20px; border-radius:20px; background:var(--md-surface-container); min-width:0; }
.m3e-home-links strong { font-size:16px; }
.m3e-home-links small { display:block; margin-top:5px; color:var(--md-muted); font-size:12px; }
.m3e-home-content { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(0,1fr); gap:20px; align-items:start; }
.m3e-business-analysis,.m3e-home-notices { min-width:0; padding:24px; border-radius:24px; background:var(--m3e-surface); }
.m3e-business-analysis { scroll-margin-top:100px; }
.m3e-business-analysis>header { margin-bottom:8px; }
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock h2 { margin:0; font-size:24px; line-height:1.4; }
#businessScopeNote { margin:8px 0 0; font-size:13px; line-height:1.6; color:var(--md-muted); }
/* One analysis region, with directly visible text rows. No six-card wall or collapsed substitute. */
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid { display:flex; flex-direction:column; min-width:0; }
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid>.kpi-card {
  display:grid; grid-template-columns:minmax(110px,.9fr) minmax(0,1.2fr); grid-template-rows:auto; grid-row:auto;
  position:relative; min-width:0; height:auto; min-height:0; gap:6px 16px; margin:0; padding:20px 0;
  border:0; border-bottom:1px solid var(--md-surface-high); border-radius:0; background:transparent; box-shadow:none; color:var(--md-on-surface); transform:none; container-type:normal; overflow:visible;
}
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid>.kpi-card::before,
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid>.kpi-card::after { display:none; }
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid .kpi-top { display:contents; }
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid :is(.kpi-icon,.kpi-order,.kpi-signal) { display:none; }
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid .kpi-label { grid-column:1; grid-row:1; color:var(--md-muted); font-size:16px; line-height:1.6; font-weight:400; }
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid .kpi-value { grid-column:2; grid-row:1; min-height:0; margin:0; padding:0; font-size:21px; line-height:1.45; font-weight:650; letter-spacing:0; color:var(--md-on-surface); overflow-wrap:anywhere; }
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid .kpi-sub { grid-column:2; grid-row:2; display:block; font-size:13px; line-height:1.6; color:var(--md-muted); overflow:visible; max-height:none; -webkit-line-clamp:unset; }
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid .kpi-card-foot { grid-column:2; grid-row:3; display:block; padding:0; margin:0; min-height:0; }
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid .compare-row { display:flex; flex-wrap:wrap; gap:6px; }
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid :is(.compare,.kpi-neutral) { font-size:12px; line-height:1.5; }
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid .work-hour-card-body { grid-column:1/-1; grid-row:4; display:block; margin-top:8px; font-size:14px; line-height:1.7; }
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid .work-hour-card-body[hidden] { display:none; }
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid :is(.work-hour-analysis-detail,.work-hour-analysis-insight,.work-hour-card-line) { font-size:14px; line-height:1.7; color:var(--md-on-surface); white-space:normal; }
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid .work-hour-card-line { display:block; margin-top:6px; }
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid .work-hour-card-rule { display:block; margin-top:8px; font-size:12px; color:var(--md-muted); }
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid .work-hour-band-summary { display:flex; flex-wrap:wrap; gap:8px 18px; }
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid .work-hour-band-group { display:inline-flex; flex-wrap:wrap; gap:4px; font-size:14px!important; }
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid .work-hour-staffing { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid .work-hour-staffing-table { width:100%; font-size:13px; border-collapse:collapse; }
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid .work-hour-staffing-table :is(th,td) { padding:6px; border-bottom:1px solid var(--md-surface-high); background:transparent; color:var(--md-on-surface); }
html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid :is(.expressive-hours-number,.expressive-hours-unit) { font-size:inherit; }
.m3e-analysis-detail-link { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:48px; margin-top:12px; color:var(--md-primary)!important; font-weight:600; }
.m3e-home-notices>header { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:12px; }
.m3e-home-notices h2 { font-size:24px; }
.m3e-home-notices>header>a { display:flex; align-items:center; gap:6px; min-height:48px; font-size:14px; }
.m3e-home-notices .home-notice { display:grid; grid-template-columns:44px minmax(0,1fr) 20px; gap:12px; align-items:center; padding:18px 0; border-bottom:1px solid var(--md-surface-high); }
.m3e-home-notices .home-notice-icon { display:grid; place-items:center; width:44px; height:44px; border-radius:16px; background:var(--md-primary-container); color:var(--md-on-primary-container); }
.m3e-home-notices .home-notice strong { display:block; font-size:15px; line-height:1.6; }
.m3e-home-notices .home-notice p { margin:4px 0; font-size:13px; color:var(--md-muted); overflow-wrap:anywhere; }
.m3e-home-notices .home-notice small { color:var(--md-muted); font-size:12px; }
.m3e-home-quality { display:flex; align-items:center; gap:12px; margin-top:20px; padding:16px; border-radius:18px; background:var(--md-surface-container); }
.m3e-home-quality>span { flex:1; }
.m3e-home-quality strong,.m3e-home-quality small { display:block; }
.m3e-home-quality small { margin-top:5px; color:var(--md-muted); font-size:12px; }
html[data-m3e-theme] #moduleViewWorkbench #routeDailyView { background:var(--md-surface); border:0; box-shadow:none; }
html[data-m3e-theme] #moduleViewWorkbench #routeDailyFrame { background:var(--md-surface); }
html[data-m3e-theme] #moduleViewWorkbench .matrix-snapshot-mode { opacity:1!important; transform:none!important; background:var(--md-surface); color:var(--md-on-surface); }
html[data-m3e-theme] body.matrix-fallback-fullscreen #moduleViewWorkbench { transform:none!important; animation:none!important; }
html[data-m3e-theme] #moduleViewWorkbench .work-matrix thead th { background:var(--md-surface-container); color:var(--md-on-surface); }
html[data-m3e-theme] #moduleViewWorkbench .shift-group-heading th { background:var(--md-surface-high); color:var(--md-on-surface); }
html[data-m3e-theme] #moduleViewWorkbench :is(.hour-detail-button,.mobile-hour-detail).status-leading { background:var(--md-primary-container); color:var(--md-on-primary-container); }
html[data-m3e-theme] #moduleViewWorkbench :is(.hour-detail-button,.mobile-hour-detail).status-below { background:var(--md-accent); color:var(--md-on-accent); }
html[data-m3e-theme] #moduleViewWorkbench :is(.hour-detail-button,.mobile-hour-detail).status-low { background:var(--md-error-container); color:var(--md-error); }
html[data-m3e-theme] #moduleViewWorkbench :is(.hour-detail-button,.mobile-hour-detail).status-neutral { background:var(--md-surface-high); color:var(--md-muted); }
html[data-m3e-theme] #moduleViewWorkbench :is(.hour-detail-button,.mobile-hour-detail).status-cleared { background:var(--m3e-surface); color:var(--md-primary); border-color:var(--md-primary); }
html[data-m3e-theme] #moduleViewWorkbench[data-analysis-section="hours"] #analysisCardSlot { display:none; }
html[data-m3e-theme] #moduleViewWorkbench #dashboard-overview .workbench-view-switch { display:flex; width:auto; background:transparent; padding:0; border:0; justify-content:flex-start; }
html[data-m3e-theme] #moduleViewWorkbench #dashboard-overview .workbench-view-switch>button { flex:0 0 auto; max-width:100%; min-height:48px; padding:12px 20px; font-size:16px; line-height:1.25; white-space:normal; background:var(--md-primary-container); color:var(--md-on-primary-container); border-radius:28px; }
@media(max-width:1099px) {
 .m3e-home-overview { grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); }
 .m3e-home-task { padding:20px 16px; }
 .m3e-home-content { grid-template-columns:1fr; }
}
@media(max-width:759px) {
 .m3e-home-overview { grid-template-columns:1fr; gap:14px; }
 .m3e-home-task { display:grid; grid-template-columns:36px minmax(0,1fr); align-items:center; padding:16px; gap:8px; }
 .m3e-home-task>.ph { width:36px; height:36px; padding:6px; border-radius:12px; }
 .m3e-home-task>span { font-size:14px; line-height:1.5; }
 .m3e-home-task>strong { grid-column:1/-1; margin:0; font-size:28px; }
 .m3e-home-task-action { grid-column:1/-1; min-height:40px; font-size:13px; line-height:1.5; }
 .m3e-home-hero { padding:24px; }
 .m3e-home-hero-title>.ph { padding:10px; }
 .m3e-home-links { gap:8px; margin:16px 0 22px; }
 .m3e-home-links>a { padding:14px 10px; gap:6px; }
 .m3e-home-links strong { font-size:13px; white-space:nowrap; }
 .m3e-home-links small { display:none; }
 .m3e-home-links .ph { font-size:18px; }
 .m3e-home-date { display:block; }
 .m3e-home-date>p { margin:8px 4px 0; }
 html[data-m3e-theme] #moduleViewWorkbench #workbenchDateField { justify-content:space-between; }
 html[data-m3e-theme] #moduleViewWorkbench #workbenchDateField .site-select-field { width:210px; }
 .m3e-business-analysis,.m3e-home-notices { padding:22px 20px; }
 html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid>.kpi-card { grid-template-columns:minmax(100px,.85fr) minmax(0,1.15fr); gap:6px 10px; }
 html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid .kpi-value { font-size:19px; }
 html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid .kpi-label { font-size:15px; }
}
@media(max-width:359px) {
 .m3e-home-task { grid-template-columns:30px minmax(0,1fr); padding:12px; gap:6px; }
 .m3e-home-task>.ph { width:30px; height:30px; padding:4px; }
 .m3e-home-task>span { font-size:13px; }
 .m3e-home-task>strong { font-size:24px; }
 .m3e-business-analysis,.m3e-home-notices { padding:20px 16px; }
 html[data-m3e-theme] #moduleViewWorkbench #workbenchDateField .site-select-field { width:180px; }
 html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid .work-hour-staffing { grid-template-columns:1fr; }
}
@media(prefers-reduced-motion:no-preference) {
 .m3e-home-button,.m3e-home-links>a { transition:background-color 160ms var(--m3e-ease),border-radius 120ms var(--m3e-ease); }
 .m3e-home-button:active { border-radius:16px; }
}

/* Actual-review correction: the matrix and its native detail sheet share the host theme. */
html[data-m3e-theme] #moduleViewWorkbench :is(.matrix-heading-sub,.matrix-hour-total,.matrix-person-rank,.matrix-shift-badge) { background:var(--md-surface-container); color:var(--md-muted); }
html[data-m3e-theme] #moduleViewWorkbench .work-matrix :is(.matrix-person-name,.matrix-person-total,.hour-detail-total) { color:var(--md-primary); }
html[data-m3e-theme] #moduleViewWorkbench .work-matrix :is(.hour-detail-clock,.hour-detail-split,.matrix-formula) { color:var(--md-muted); }
html[data-m3e-theme] #moduleViewWorkbench .work-matrix tbody th { background:var(--m3e-surface); color:var(--md-on-surface); }
html[data-m3e-theme] #moduleViewWorkbench .work-matrix .hour-detail-button.status-normal { background:var(--md-surface-container); color:var(--md-on-surface); border-color:var(--md-outline); }
html[data-m3e-theme] .work-hour-detail-sheet { background:var(--m3e-surface); color:var(--md-on-surface); border-color:var(--md-outline); box-shadow:0 -12px 60px color-mix(in srgb,var(--md-on-surface) 18%,transparent); }
html[data-m3e-theme] .work-hour-detail-sheet::backdrop { background:color-mix(in srgb,var(--md-on-surface) 35%,transparent); }
html[data-m3e-theme] .work-hour-detail-sheet :is(header,footer,.hour-sheet-peers,.hour-sheet-facts section,.hour-sheet-peers th,.hour-sheet-peers td) { border-color:var(--md-surface-high); }
html[data-m3e-theme] .work-hour-detail-sheet :is(footer,.hour-sheet-statement textarea) { background:var(--m3e-surface); color:var(--md-on-surface); }
html[data-m3e-theme] .work-hour-detail-sheet :is(button,footer a,.hour-sheet-types label,.hour-sheet-statement textarea) { border-color:var(--md-outline); }
html[data-m3e-theme] .work-hour-detail-sheet :is(button,footer a,.hour-sheet-facts section) { background:var(--md-surface-container); color:var(--md-on-surface); }
html[data-m3e-theme] .work-hour-detail-sheet :is(.hour-sheet-facts strong,.hour-sheet-peers td strong) { color:var(--md-primary); }
html[data-m3e-theme] .work-hour-detail-sheet :is(.hour-sheet-identity span,.hour-sheet-facts h3,.hour-sheet-deadline,.hour-sheet-peers>p,.hour-sheet-peers thead th) { color:var(--md-muted); }
html[data-m3e-theme] .work-hour-detail-sheet :is(.hour-peer-tag,.hour-sheet-peers .is-subject,.hour-sheet-types label:has(:checked)) { background:var(--md-primary-container); color:var(--md-on-primary-container); }
html[data-m3e-theme] .work-hour-detail-sheet .hour-peer-revised { color:var(--md-success); }
html[data-m3e-theme] .work-hour-detail-sheet .hour-sheet-message { color:var(--md-on-accent); }
html[data-m3e-theme] #workHourDetailSheet .hour-sheet-primary { background:var(--md-primary); border-color:var(--md-primary); color:var(--md-on-primary); }
html[data-m3e-theme] .work-hour-detail-sheet :focus-visible { outline-color:var(--md-primary); }
html[data-m3e-theme] .work-hour-detail-sheet :is(button,footer a) { min-height:48px; }
html[data-m3e-theme] .work-hour-detail-sheet header button { min-width:48px; }

html[data-m3e-theme] #moduleViewWorkbench .matrix-snapshot-mode { --matrix-text-size:16px; }
html[data-m3e-theme] #moduleViewWorkbench .matrix-snapshot-mode :is(.matrix-person-rank,.matrix-shift-badge,.matrix-person-split span) { font-size:14px; }
html[data-m3e-theme] #moduleViewWorkbench .matrix-snapshot-mode .matrix-person-split strong { font-size:15px; }
html[data-m3e-theme] #moduleViewWorkbench .matrix-snapshot-mode .matrix-formula { color:var(--md-muted); }
html[data-m3e-theme] #moduleViewWorkbench .matrix-snapshot-mode .panel-head { background:var(--m3e-surface); }
html[data-m3e-theme] #moduleViewWorkbench .matrix-snapshot-mode .logic-version-badge { background:var(--md-primary-container); color:var(--md-on-primary-container); }


html[data-m3e-theme] #moduleViewWorkbench #businessAnalysisBlock #kpiGrid .kpi-neutral { background:var(--md-primary-container); color:var(--md-on-primary-container); }

/* The existing intelligence dialog is mounted outside the workbench container. */
html[data-m3e-theme] .work-hour-analysis-modal { background:color-mix(in srgb,var(--md-on-surface) 45%,transparent); }
html[data-m3e-theme] :is(#workHourAnalysisDialog,[data-motion-exit-id="workHourAnalysisDialog"]),
html[data-m3e-theme] :is(#workHourAnalysisDialog,[data-motion-exit-id="workHourAnalysisDialog"])>header { background:var(--md-surface); color:var(--md-on-surface); border-color:var(--md-outline); }
html[data-m3e-theme] :is(#workHourAnalysisScope,[data-motion-exit-id="workHourAnalysisScope"]) { color:var(--md-primary); }
html[data-m3e-theme] :is(#workHourAnalysisClose,[data-motion-exit-id="workHourAnalysisClose"]) { background:var(--md-surface-high); color:var(--md-on-surface); }
html[data-m3e-theme] .work-hour-analysis-section { background:var(--m3e-surface); border-color:var(--md-surface-high); box-shadow:none; }
html[data-m3e-theme] :is(.work-hour-analysis-section-title,.work-hour-analysis-lead,.work-hour-analysis-comparison) { color:var(--md-on-surface); }
html[data-m3e-theme] :is(.work-hour-analysis-meta,.work-hour-analysis-copy,.work-hour-analysis-thresholds,.work-hour-analysis-definition,.work-hour-analysis-diagnostics,.work-hour-analysis-empty) { color:var(--md-muted); }
html[data-m3e-theme] :is(.work-hour-capacity-formula,.work-hour-analysis-evidence-item,.work-hour-breakdown-table thead) { background:var(--md-surface-container); color:var(--md-on-surface); }
html[data-m3e-theme] .work-hour-extra-details summary { color:var(--md-primary); }
html[data-m3e-theme] .work-hour-extra-details summary:focus-visible { outline-color:var(--md-primary); }
html[data-m3e-theme] .work-hour-breakdown-table :is(th,td,tr) { border-color:var(--md-outline); }
html[data-m3e-theme] .work-hour-breakdown-table tbody th { color:var(--md-on-surface); }
html[data-m3e-theme] .work-hour-breakdown-table td::before { color:var(--md-muted); }

/* Narrow hour view keeps its existing people/hour grouping, using the shared surfaces. */
html[data-m3e-theme] #moduleViewWorkbench .logic-version-badge { background:var(--md-primary-container); color:var(--md-on-primary-container); border-color:var(--md-outline); }
html[data-m3e-theme] #moduleViewWorkbench .mobile-shift-head { background:var(--md-primary-container); color:var(--md-on-primary-container); }
html[data-m3e-theme] #moduleViewWorkbench .mobile-shift-head.shift-night { background:var(--md-accent); color:var(--md-on-accent); }
html[data-m3e-theme] #moduleViewWorkbench .mobile-person-card { background:var(--m3e-surface); border-color:var(--md-outline); border-left-color:var(--md-primary); }
html[data-m3e-theme] #moduleViewWorkbench .mobile-matrix-person { background:var(--m3e-surface); color:var(--md-on-surface); }
html[data-m3e-theme] #moduleViewWorkbench :is(.mobile-person-total,.mobile-hour-count) { color:var(--md-primary); }
html[data-m3e-theme] #moduleViewWorkbench .mobile-hour-detail.status-normal { background:var(--md-surface-container); color:var(--md-on-surface); border-color:var(--md-outline); }
html[data-m3e-theme] #moduleViewWorkbench :is(.mobile-person-meta,.mobile-hour-heading small,.mobile-hour-types,.mobile-hour-status) { color:var(--md-muted); }
@media(max-width:759px) {
 html[data-m3e-theme] #moduleViewWorkbench #analysisDateSlot #workbenchDateField { display:block; }
 html[data-m3e-theme] #moduleViewWorkbench #analysisDateSlot #workbenchDateField>label { display:block; margin-bottom:8px; }
 html[data-m3e-theme] #moduleViewWorkbench #analysisDateSlot .site-select-trigger { white-space:nowrap; }
}

/* SYS-01–08: title/actions → category → query and grouped records → read status. */
html[data-m3e-theme]:has(#systemModal:not([hidden])),
html[data-m3e-theme]:has(#systemModal:not([hidden])) body { overflow:hidden!important; }
html[data-m3e-theme] #systemModal { padding:24px; background:color-mix(in srgb,var(--md-on-surface) 40%,transparent); }
html[data-m3e-theme] #systemModal .system-modal-dialog { width:min(1120px,100%); max-height:calc(100dvh - 48px); border:1px solid var(--md-outline); border-radius:28px; background:var(--m3e-surface); color:var(--md-on-surface); box-shadow:0 20px 60px color-mix(in srgb,var(--md-on-surface) 20%,transparent); }
html[data-m3e-theme] #systemModal .system-modal-head { position:relative; flex-shrink:0; padding:24px; border-color:var(--md-outline); gap:24px; }
html[data-m3e-theme] #systemModal .system-modal-head h2 { font-size:24px; line-height:32px; color:var(--md-on-surface); }
html[data-m3e-theme] #systemModal .system-modal-head p { margin-top:8px; font-size:14px; line-height:22px; color:var(--md-muted); }
html[data-m3e-theme] #systemModal :is(.system-modal-button,.system-modal-close,.system-row-action,.system-tab) { min-height:48px; font-family:inherit; font-size:14px; font-weight:600; line-height:20px; border-radius:24px; padding:12px 18px; box-shadow:none; border:1px solid transparent; cursor:pointer; }
html[data-m3e-theme] #systemModal :is(.system-modal-button,.system-modal-close,.system-row-action) { background:var(--md-primary-container); color:var(--md-on-primary-container); }
html[data-m3e-theme] #systemModal .system-modal-close { min-width:48px; padding:8px; font-size:24px; }
html[data-m3e-theme] #systemModal #systemClearResolvedButton { background:var(--md-error-container); color:var(--md-error); align-self:end; }
html[data-m3e-theme] #systemModal .system-tabs { flex-shrink:0; margin:16px 24px 0; padding:4px; gap:4px; border-radius:28px; background:var(--md-surface-container); }
html[data-m3e-theme] #systemModal .system-tab { flex:1; min-width:0; margin:0; background:transparent; color:var(--md-muted); }
html[data-m3e-theme] #systemModal .system-tab.active { background:var(--md-primary); color:var(--md-on-primary); }
html[data-m3e-theme] #systemModal .system-panel { min-height:0; flex:1 1 auto; overflow:auto; overscroll-behavior:contain; padding:20px 24px; }
html[data-m3e-theme] #systemModal .system-filter-bar { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr)); gap:16px; padding:0; margin-bottom:20px; }
html[data-m3e-theme] #systemModal .system-filter-bar label { display:grid; gap:8px; min-width:0; font-size:14px; line-height:20px; color:var(--md-muted); }
html[data-m3e-theme] #systemModal .system-filter-bar :is(input,select,.site-date-trigger) { width:100%; min-width:0; min-height:48px; height:48px; margin:0; font-size:16px; color:var(--md-on-surface); background:var(--md-surface-container); border:1px solid var(--m3e-control-outline); border-radius:16px; padding:10px 12px; }
html[data-m3e-theme] #systemModal .site-date-field { width:100%; min-width:0; }
html[data-m3e-theme] #systemModal .system-table { width:100%; min-width:0; table-layout:fixed; font-size:14px; line-height:22px; }
html[data-m3e-theme] #systemModal .system-table :is(th,td) { white-space:normal; }
html[data-m3e-theme] #systemModal #systemPanelErrors .system-table th:nth-child(4) { width:36%; }
html[data-m3e-theme] #systemModal .system-table th { background:var(--md-surface-container); color:var(--md-muted); padding:12px; border-color:var(--md-outline); font-size:14px; }
html[data-m3e-theme] #systemModal .system-table td { color:var(--md-on-surface); background:transparent; padding:16px 12px; border-color:var(--md-outline); overflow-wrap:anywhere; text-align:left; }
html[data-m3e-theme] #systemModal .system-table tbody tr:hover td { background:var(--md-surface-container); }
html[data-m3e-theme] #systemModal :is(.system-table small,.system-log-status,.system-empty,.system-resolution-note) { font-size:14px; line-height:22px; color:var(--md-muted); }
html[data-m3e-theme] #systemModal .system-empty { padding:40px 16px; }
html[data-m3e-theme] #systemModal .system-log-status { flex-shrink:0; padding:12px 24px; border-top:1px solid var(--md-outline); background:var(--md-surface-container); }
html[data-m3e-theme] #systemModal :is(.system-status-chip,.system-severity,.system-error-type,.system-version-chip) { font-size:12px; line-height:18px; padding:4px 10px; border-radius:12px; background:var(--md-surface-container); color:var(--md-muted); }
html[data-m3e-theme] #systemModal :is(.system-status-chip.open,.system-severity.error,.system-error-type.program) { background:var(--md-error-container); color:var(--md-error); }
html[data-m3e-theme] #systemModal :is(.system-status-chip.resolved,.system-version-chip.current) { background:var(--md-success-container); color:var(--md-success); }
html[data-m3e-theme] #systemModal :is(.system-severity.warning,.system-error-type.server) { background:var(--md-accent); color:var(--md-on-accent); }
html[data-m3e-theme] #systemModal .system-detail summary { color:var(--md-primary); min-height:48px; padding:12px 0; font-size:14px; }
html[data-m3e-theme] #systemModal .system-detail pre { background:var(--md-surface-container); color:var(--md-on-surface); border-radius:16px; padding:16px; font-size:14px; line-height:22px; white-space:pre-wrap; overflow-wrap:anywhere; }
html[data-m3e-theme] #systemModal .system-detail pre { width:auto; max-width:100%; text-align:left; }
html[data-m3e-theme] #systemModal .system-error-badges { display:flex; flex-wrap:wrap; gap:6px; }
html[data-m3e-theme] #systemModal :focus-visible { outline:2px solid var(--md-primary); outline-offset:3px; }
html[data-m3e-theme] #systemModal .system-tab.active:focus-visible { outline-color:var(--md-on-surface); }
html[data-m3e-theme] #systemModal button:disabled { opacity:.55; cursor:default; }
html[data-m3e-theme] #systemModal .system-cleanup-confirm { box-sizing:border-box; width:min(480px,calc(100% - 32px)); max-height:calc(100dvh - 32px); padding:24px; border:1px solid var(--md-outline); border-radius:28px; background:var(--m3e-surface); color:var(--md-on-surface); }
html[data-m3e-theme] #systemModal .system-cleanup-confirm::backdrop { background:color-mix(in srgb,var(--md-on-surface) 40%,transparent); }
html[data-m3e-theme] #systemModal .system-cleanup-confirm h2 { margin:0; font-size:24px; line-height:32px; }
html[data-m3e-theme] #systemModal .system-cleanup-confirm p { margin:16px 0 24px; font-size:16px; line-height:24px; color:var(--md-muted); }
html[data-m3e-theme] #systemModal .system-cleanup-confirm footer { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:12px; }
html[data-m3e-theme] #systemModal .system-cleanup-confirm button { min-height:48px; padding:12px 18px; border:0; border-radius:24px; background:var(--md-surface-container); color:var(--md-on-surface); font:inherit; font-size:14px; font-weight:600; }
html[data-m3e-theme] #systemModal .system-cleanup-confirm [value="clear"] { background:var(--md-error); color:var(--md-on-primary); }
@media(max-width:759px) {
 html[data-m3e-theme] #systemModal { padding:0; }
 html[data-m3e-theme] #systemModal .system-modal-dialog { width:100%; height:100dvh; max-height:100dvh; border:0; border-radius:0; }
 html[data-m3e-theme] #systemModal .system-modal-head { padding:16px; }
 html[data-m3e-theme] #systemModal .system-tabs { margin:12px 16px 0; }
 html[data-m3e-theme] #systemModal .system-tab { padding:12px 6px; white-space:nowrap; }
 html[data-m3e-theme] #systemModal .system-panel { padding:16px; }
 html[data-m3e-theme] #systemModal .system-log-status { padding:12px 16px max(12px,env(safe-area-inset-bottom)); }
 html[data-m3e-theme] #systemModal .system-table thead { display:none; }
 html[data-m3e-theme] #systemModal .system-table :is(tbody,tr,td) { display:block; width:100%; min-width:0; }
 html[data-m3e-theme] #systemModal .system-table tr { margin-bottom:16px; padding:8px 16px; border-radius:20px; background:var(--md-surface-container); }
 html[data-m3e-theme] #systemModal .system-table td { padding:8px 0; border:0; }
 html[data-m3e-theme] #systemModal .system-table td[data-label]::before { content:attr(data-label); display:block; margin-bottom:4px; color:var(--md-muted); font-size:12px; line-height:18px; font-weight:600; }
}
@media(max-width:599px) {
 html[data-m3e-theme] #systemModal .system-modal-head { display:block; }
 html[data-m3e-theme] #systemModal .system-modal-head h2 { padding-right:56px; }
 html[data-m3e-theme] #systemModal .system-modal-actions { margin-top:12px; }
 html[data-m3e-theme] #systemModal .system-modal-actions .system-modal-button { flex:1; }
 html[data-m3e-theme] #systemModal .system-modal-close { position:absolute; right:16px; top:16px; }
}

html[data-m3e-theme] #moduleViewWorkbench .mobile-person-card::before { background:var(--md-primary); }
html[data-m3e-theme] #moduleViewWorkbench #dashboard-hours .matrix-formula { color:var(--md-muted); }
html[data-m3e-theme] #moduleViewWorkbench .hour-detail-broken { color:var(--md-on-accent); }
html[data-m3e-theme] #moduleViewWorkbench .hour-detail-pollution { color:var(--md-success); }

@media(max-width:759px) {
 /* HOUR-05 / C09: a long detail/form fills the phone; short selectors remain sheets. */
 html[data-m3e-theme] .work-hour-detail-sheet { inset:0; margin:0; width:100%; height:100dvh; max-height:100dvh; border:0; border-radius:0; }
 /* HOUR-04: keep phone facts readable instead of shrinking the desktop grid. */
 html[data-m3e-theme] #moduleViewWorkbench #dashboard-hours .panel-head h3 { font-size:16px; line-height:24px; }
 html[data-m3e-theme] #moduleViewWorkbench #dashboard-hours .matrix-formula { font-size:14px; line-height:20px; }
 html[data-m3e-theme] #moduleViewWorkbench #dashboard-hours :is(.matrix-legend,.matrix-legend>span,.logic-version-badge) { font-size:12px; line-height:18px; }
 html[data-m3e-theme] #moduleViewWorkbench #dashboard-hours :is(.matrix-insight,.matrix-insight strong) { font-size:14px; line-height:20px; }
 html[data-m3e-theme] #moduleViewWorkbench .mobile-shift-head>span { font-size:14px; line-height:20px; }
 html[data-m3e-theme] #moduleViewWorkbench .mobile-shift-head>small { font-size:12px; line-height:18px; }
 html[data-m3e-theme] #moduleViewWorkbench .mobile-person-identity { flex-wrap:wrap; gap:6px; }
 html[data-m3e-theme] #moduleViewWorkbench .mobile-matrix-person :is(.matrix-person-rank,.matrix-shift-badge) { font-size:12px; line-height:18px; }
 html[data-m3e-theme] #moduleViewWorkbench .mobile-person-total { font-size:24px; line-height:32px; }
 html[data-m3e-theme] #moduleViewWorkbench .mobile-person-total small { font-size:12px; line-height:18px; }
 html[data-m3e-theme] #moduleViewWorkbench .mobile-person-meta { display:flex; flex-wrap:wrap; gap:4px 12px; font-size:14px; line-height:20px; }
 html[data-m3e-theme] #moduleViewWorkbench .mobile-person-meta>span { font-size:inherit; line-height:inherit; }
 html[data-m3e-theme] #moduleViewWorkbench .mobile-hour-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr)); }
 html[data-m3e-theme] #moduleViewWorkbench .mobile-hour-detail { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px 12px; padding:12px; min-height:112px; }
 html[data-m3e-theme] #moduleViewWorkbench .mobile-hour-heading { grid-column:1/-1; display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:4px 12px; }
 html[data-m3e-theme] #moduleViewWorkbench .mobile-hour-heading strong { font-size:16px; line-height:24px; }
 html[data-m3e-theme] #moduleViewWorkbench .mobile-hour-heading small { font-size:12px; line-height:18px; white-space:nowrap; }
 html[data-m3e-theme] #moduleViewWorkbench .mobile-hour-count { grid-column:2; grid-row:2/4; align-self:center; font-size:28px; line-height:36px; }
 html[data-m3e-theme] #moduleViewWorkbench .mobile-hour-count small { font-size:12px; line-height:18px; }
 html[data-m3e-theme] #moduleViewWorkbench .mobile-hour-types { grid-column:1; grid-row:2; display:flex; flex-wrap:wrap; gap:4px 12px; font-size:14px; line-height:20px; }
 html[data-m3e-theme] #moduleViewWorkbench .mobile-hour-types>span { font-size:inherit; line-height:inherit; }
 html[data-m3e-theme] #moduleViewWorkbench .mobile-hour-status { grid-column:1; grid-row:3; display:flex; flex-wrap:wrap; gap:4px 8px; font-size:12px; line-height:18px; }
 html[data-m3e-theme] #moduleViewWorkbench .mobile-hour-status :is(span,b) { font-size:inherit; line-height:inherit; white-space:normal; }
}
