/* Generated by ops/build-workplace-css.py; edit the named source files. */
/* Source: unified-ui.css */
/* Shared portal language. Layouts, colour-coded states and machine inputs stay local. */
:root{
  --navy:var(--ui-ink);--navy2:var(--ui-secondary);--bg:#f7f0df;--card:var(--ui-surface);
  --text:var(--ui-ink);--muted:var(--ui-muted);--line:var(--ui-line);
  --green:var(--ui-success);--orange:var(--ui-danger);--danger:#a94e35;
  --milk-line:var(--ui-line);
  --milk-shadow:3px 3px 0 #e7d7bb;
  --ui-corner:5px;
}
body.milk-app{font-variant-numeric:tabular-nums;line-height:1.45}
body.milk-app :is(button,input,select,textarea){font-family:inherit}
body.milk-app :is(h1,h2,h3){text-wrap:balance}
body.milk-app :is(.muted,.hint,.text-muted){color:var(--ui-muted)}

/* The common navigation is available even on older worker and customer pages. */
body.milk-app .site-navigation{background:#f6eddb;border-bottom-color:var(--ui-line)}
body.milk-app .site-navigation a{border-radius:var(--ui-corner)}
body.milk-app :is(.management-shell,.workplace-header,.master-console-header,.warm-header,
  .milk-header,.control-v2-header,.section-home-header){
  border-radius:7px;background:var(--ui-surface);box-shadow:var(--milk-shadow);backdrop-filter:none;
}
body.milk-app :is(.workplace-nav,.management-nav,.management-primary,.master-console-nav,.warm-nav,.milk-nav){border-radius:var(--ui-corner)}
body.milk-app :is(.workplace-nav,.management-nav,.management-primary,.master-console-nav,.warm-nav,.milk-nav) a{border-radius:3px}
body.milk-app .management-primary-item.is-active{box-shadow:2px 2px 0 #cfaf78}
body.milk-app .management-search{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;border-radius:var(--ui-corner)}
body.milk-app .management-search input{border:0;border-radius:0;background:transparent;box-shadow:none}
body.milk-app .management-search button{white-space:nowrap}
body.milk-app .management-tools-menu{flex:1;min-width:0}
body.milk-app .management-tools-menu>summary{display:none}
body.milk-app .workplace-shell .workplace-nav a[aria-current=page]{box-shadow:2px 2px 0 #cfaf78}
body.milk-app :is(.workplace-mark,.module-mark,.pixel-avatar){font-family:ui-monospace,SFMono-Regular,Consolas,monospace}
body.milk-app :is(.management-location h1,.workplace-identity h1){letter-spacing:-.5px}

/* Compact squared cards match the factory stations, without changing their grid. */
body.milk-app :is(.card,.milk-panel,.warm-panel,.control-v2-panel,.control-section,
  .management-shell,.workplace-header,.worker-task,.modern-task-card,.master-task,
  .order-card,.customer-order-card,.customer-order-tile,.customer-order-form,
  .customer-orders-section,.smoke-card,.smoke-process-card,.smoke-queue-card,
  .warehouse-stock-card,.transfer-row,.shift-start-card,.login-card,.master-login-card,
  .customer-login-card,.friendly-error-card,.service-panel,.performance-panel,
  .assistant-panel,.employee-history-panel,.error-detail-panel,.error-resolution-panel,
  .error-trace-panel,.guide-role-card,.filter-card,.global-search-form,.warm-side-menu){
  border-radius:7px;border-color:var(--milk-line);box-shadow:var(--milk-shadow);
}
body.milk-app :is(.card,.worker-task,.master-task,.order-card,.customer-order-card,
  .customer-order-form,.smoke-card,.event,.transfer-row,.filter-card){background:var(--milk-paper);color:var(--milk-brown)}
body.milk-app :is(.kpi,.control-kpi,.summary-strip article,.milk-kpis article,
  .summary-cards>div,.stat,.warehouse-summary article,.flow-report-kpis article,
  .area-output-kpis article,.performance-kpis article,.assistant-kpis article,
  .backup-summary article,.service-health-grid article,.error-summary-grid article,
  .employee-activity-kpis article){
  min-width:0;border-radius:var(--ui-corner);border-color:var(--milk-line);box-shadow:var(--milk-shadow);
}
body.milk-app :is(.kpi,.control-kpi,.summary-cards>div,.stat){background:var(--milk-paper);color:var(--milk-brown)}
body.milk-app :is(.kpi,.control-kpi,.stat,.summary-cards)>:is(span,small){color:var(--ui-muted)}
body.milk-app :is(.module-card,.admin-quick-links a,.control-card,.pipeline-stage,.task-numbers>div,
  .trace-weights>div,.trace-people>div,.metrics>div,.mini-stats article,.batch-composition,
  .search-result,.system-error-row,.service-log-list article,.backup-list>article,
  .service-actions-grid form,.employee-card,.notification-card,.operation-form){border-radius:var(--ui-corner)}
body.milk-app :is(.module-card,.module-card:hover,.customer-order-tile:hover){transform:none;transition:none}
body.milk-app .module-card{border-color:var(--milk-line);background:var(--milk-paper);color:var(--milk-brown)}
body.milk-app .module-card p{color:var(--ui-muted)}
body.milk-app :is(.module-card strong,.text-link,.back){color:var(--milk-brown)}

/* Preserve touch sizes and input payloads; only visible controls get styling. */
body.milk-app :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]),select,textarea){
  border-color:var(--ui-line);border-radius:var(--ui-corner);background:var(--ui-field);color:var(--milk-brown);
  box-shadow:inset 1px 1px 0 #f0e6d3;max-width:100%;
}
body.milk-app :is(input,textarea)::placeholder{color:var(--ui-muted);opacity:1}
body.milk-app :is(input[type=checkbox],input[type=radio]){accent-color:#698449}
body.milk-app :is(.btn,.workplace-shell button,.workplace-shell .butter-button,.keypad button){
  border-radius:var(--ui-corner);box-shadow:2px 2px 0 #d8c39f;
}
body.milk-app :is(.btn,.workplace-shell button,.workplace-shell .butter-button):not(:disabled){touch-action:manipulation}
body.milk-app :is(.btn,.workplace-shell button,.workplace-shell .butter-button):disabled{box-shadow:none;cursor:not-allowed}
body.milk-app :is(.milk-notice,.alert,.success-card,.work-status,.shift-duration-line,.muted-note,
  .warm-pill,.status-chip,.live-pill,.butter-status,.milk-subnav a,.milk-pages a){border-radius:var(--ui-corner)}
body.milk-app .progress{border-radius:2px;background:#e8dcc7}
body.milk-app .progress i{border-radius:1px;background:var(--milk-green)}
body.milk-app .muted-note{background:#f3ead9;color:var(--ui-muted)}
body.milk-app :is(.workplace-shell,.unified-page,.master-console,.mobile-shell,.customer-app)
  :is(a,button,input,select,textarea,summary):focus-visible{outline:3px solid #b77c25;outline-offset:3px}

/* Table wrappers own horizontal scrolling; long numbers are not split in half. */
body.milk-app :is(.milk-table-wrap,.report-table-wrap,.table-wrap,.service-table-wrap,.perf-table){
  border-radius:var(--ui-corner);scrollbar-width:thin;scrollbar-color:#cdb58c #fff4df;
}
body.milk-app :is(.report-table,.service-table-wrap table,.perf-table table){font-variant-numeric:tabular-nums}
body.milk-app :is(.report-table,.service-table-wrap table,.perf-table table) th{background:var(--ui-soft);color:var(--ui-muted)}
body.milk-app :is(.report-table,.service-table-wrap table,.perf-table table) :is(th,td){border-bottom-color:var(--milk-line)}
body.milk-app :is(.report-table,.service-table-wrap table,.perf-table table) tbody tr:nth-child(even){background:#fbf5e9}
body.milk-app .formatted-number{white-space:nowrap;font-variant-numeric:tabular-nums}

@media(max-width:600px){
  body.milk-app .management-tools-menu{width:100%}
  body.milk-app .management-tools-menu>summary{display:flex;align-items:center;justify-content:space-between;min-height:44px;padding:10px 12px;border:1px solid var(--milk-line);border-radius:var(--ui-corner);background:var(--ui-surface);cursor:pointer;font-size:var(--ui-type-meta);font-weight:800;list-style:none}
  body.milk-app .management-tools-menu>summary::-webkit-details-marker{display:none}
  body.milk-app .management-tools-menu>summary i{font-style:normal;font-size:16px;color:var(--milk-brown-2)}
  body.milk-app .management-tools-menu[open]>summary{margin-bottom:8px}
  body.milk-app .management-tools-menu[open]>summary i{transform:rotate(45deg)}
  body.milk-app .management-tools a{border-radius:var(--ui-corner)}
  body.milk-app .unified-page .management-primary{grid-template-columns:repeat(3,minmax(0,1fr))}
  body.milk-app .management-primary-item{gap:6px;padding:8px;min-height:48px}
  body.milk-app .management-primary-item b{font-size:var(--ui-type-meta)}
  body.milk-app .management-primary-item small{display:none}
  body.milk-app .management-primary-item>i{width:23px;height:23px;flex-basis:23px;font-size:var(--ui-type-meta)}
  body.milk-app .workplace-shell .milk-panel{padding:14px}
  body.milk-app :is(.workplace-shell,.mobile-shell,.master-console) :is(input:not([type=checkbox]):not([type=radio]),select,textarea){font-size:16px}
  body.milk-app :is(.kpi,.milk-kpis article,.summary-strip article){overflow-wrap:anywhere}
}
@media(prefers-reduced-motion:reduce){html,body.milk-app{scroll-behavior:auto}}
@media print{
  body.milk-app{background:white;color:#000}
  body.milk-app .site-navigation{display:none}
  body.milk-app :is(.card,.milk-panel,.warm-panel,.workplace-header,.management-shell){box-shadow:none}
}

/* Source: safari-compat.css */
/* Measured WebKit touch controls; keep the common cream/brown pixel frame. */
@media (pointer:coarse), (max-width:600px) {
  body.milk-app
    :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not(.qty-input),select,textarea),
  body.milk-app .quick-menu .quick-menu-search input {
    font-size:16px;
  }
  body.milk-app .stock-opening .stock-opening-edit input {
    font-size:16px!important;
  }

  /* Native WebKit menulists measured 25–27px despite the existing 44px rule. */
  body.milk-app select {
    -webkit-appearance:none;
    appearance:none;
    min-height:44px;
    min-width:0;
    max-width:100%;
    box-sizing:border-box;
    padding-right:34px;
    /* The shared controls use a more specific background shorthand. */
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%2363432d' d='M0 0h10v2H8v2H6v2H4V4H2V2H0z'/%3E%3C/svg%3E")!important;
    background-repeat:no-repeat!important;
    background-size:10px 6px!important;
    background-position:right 12px center!important;
  }
  body.milk-app .quick-menu .quick-menu-close {
    flex-basis:44px;
    width:44px;
    height:44px;
    min-height:44px;
  }
}

/* Keep the complete forming form reachable on short landscape screens. */
body.milk-app .sheet {background:rgba(76,47,33,.48)}
body.milk-app .sheet-card {
  background:var(--milk-paper,var(--ui-surface));
  border:1px solid var(--milk-line,#d5bd94);
  border-radius:4px;
  box-shadow:3px 3px 0 #b99568;
  max-height:calc(100vh - 32px);
  max-height:calc(100dvh - 32px);
  overflow-y:auto;
  overscroll-behavior:contain;
}
body.milk-app .sheet-card>small,
body.milk-app .sheet-card>h2 {padding-right:44px}
body.milk-app .sheet-close {
  width:44px;height:44px;min-height:44px;padding:0;
  display:flex;align-items:center;justify-content:center;
}

/* Results must shrink inside the dialog, rather than be clipped below it. */
body.milk-app .command-search-dialog {
  display:flex;flex-direction:column;
}
body.milk-app .command-search-dialog>header,
body.milk-app .command-search-dialog>footer {flex-shrink:0}
body.milk-app .command-search-results {
  flex:1 1 auto;min-height:0;overflow-y:auto;
}


/* A hidden employee switch must stay inside its label when details are open. */
body.milk-app .employee-active-toggle {position:relative}
body.milk-app .employee-active-toggle input[type=checkbox] {
  left:0;top:0;width:1px;height:1px;padding:0;margin:0;border:0;
}
body.milk-app :is(.employee-active-toggle,.access-checks) input:focus-visible+i {
  outline:2px solid #b77c25;outline-offset:3px;
}

/* Grid cards must shrink before their own table scroll area takes over. */
body.milk-app .performance-grid>.performance-panel,
body.milk-app .service-layout>.service-panel {min-width:0}
body.milk-app .performance-period {flex-wrap:wrap}
body.milk-app .performance-panel>header,
body.milk-app .service-panel>header {flex-wrap:wrap;gap:12px}
body.milk-app .performance-panel>header>div,
body.milk-app .service-panel>header>div,
body.milk-app .service-info-list>div>* {min-width:0;max-width:100%}
body.milk-app .performance-panel h2,
body.milk-app .service-panel h2 {overflow-wrap:anywhere}
body.milk-app .service-actions-grid form {min-width:0}
body.milk-app .service-actions-grid form>div {min-width:0;overflow-wrap:anywhere}

@media (max-width:600px) {
  body.milk-app .flow-report-app .report-filter {
    grid-template-columns:repeat(2,minmax(0,1fr));max-width:100%;
  }
  body.milk-app .flow-report-app .report-filter label {min-width:0}
  body.milk-app .flow-report-app .report-filter input {
    min-width:0;width:100%;box-sizing:border-box;
  }
  body.milk-app .flow-report-app .report-filter button {
    grid-column:1/-1;min-width:0;width:100%;
  }
}

/* Source: portal-theme.css */
/* Complete the portal's static cream/brown frame on legacy work areas.
   Status backgrounds, form dimensions and each table's scroll area stay local. */
body.milk-app {
  --ui-corner:4px;
  --portal-card-radius:4px;
  --portal-card-shadow:3px 3px 0 #e7d7bb;
}

/* The customer's header and the older shop cards used large rounded corners. */
body.milk-app :is(
  .customer-header,.customer-new-order,.customer-orders-section,.customer-order-form,
  .customer-order-tile,.master-console-header,.master-console-panel,.warm-header,
  .warm-panel,.milk-panel,.management-shell,.workplace-header,.filter-card,
  .card,.login-card,.master-login-card,.customer-login-card,.shift-start-card,
  .modern-task-card,.master-task,.pending-task-card,.worker-task,.order-card,
  .smoke-card,.smoke-process-card,.smoke-queue-card,.warehouse-stock-card,
  .warehouse-product-card,.trace-batch-card,.control-section,.control-v2-panel,
  .control-v2-hero,.scheme-dashboard-head,.scheme-flow-summary,.scheme-active-team,
  .scheme-stage-card,.guide-role-card,.friendly-error-card,.assistant-panel,
  .employee-history-panel,.service-panel,.performance-panel,.error-detail-panel,
  .error-resolution-panel,.error-trace-panel,.global-search-form,.warm-side-menu,
  .transfer-row,.unified-event-list,.journal-filter,.milk-header,.flow-board
) {
  border-radius:var(--portal-card-radius);
  box-shadow:var(--portal-card-shadow);
}
body.milk-app .customer-header {
  background:var(--ui-surface);
}
body.milk-app :is(.empty,.customer-new-order,.metrics>div,.workers-now-list>div) {
  border-radius:var(--ui-corner);
  background:var(--ui-surface);
  color:var(--ui-muted);
}
body.milk-app .empty {
  border:1px dashed var(--ui-line);
}
body.milk-app :is(.control-v2-hero,.scheme-dashboard-head) {
  background:#fff4d9;
}
body.milk-app :is(.login-screen,.customer-login-page,.master-login-page) {
  background:transparent;
}

/* Nested counters and document statuses use the same small squared frame. */
body.milk-app :is(
  .summary-strip article,.summary-cards>div,.milk-kpis a,.milk-kpis article,.kpi,
  .control-kpi,.stat,.warehouse-summary article,.flow-report-kpis article,
  .area-output-kpis article,.performance-kpis article,.assistant-kpis article,
  .backup-summary article,.service-health-grid article,.error-summary-grid article,
  .employee-activity-kpis article,.cash-kpis article,.activity-card,.activity-filters,
  .cash-sync,.guide-stat,.task-numbers>div,.trace-weights>div,.trace-people>div,
  .metrics>div,.mini-stats article,.batch-composition,.scheme-head-stats section,
  .scheme-stage-metrics section,.scheme-flow-summary section,.report-quantities,
  .incoming-batch-row,.customer-order-tile-head>span,.task-title>span,
  .trace-batch-card>header>span,.order-card-top span,.control-list-row span,
  .people-group h3 span,.deadline-chip,.task-deadline,.age-chip,.status-chip,
  .warm-pill,.live-pill,.stage-state-label,.scheme-stage-status,.scheme-live-status,
  .overproduction-note,.auto-transfer-note,.automatic-flow-note,.shift-start-message,
  .success-card,.work-status,.shift-duration-line,.muted-note,.alert,
  .scheme-active-team>div>a
) {
  border-radius:var(--ui-corner);
}

/* Interactive cards remain still, as the portal stations do. */
body.milk-app :is(
  .management-primary-item,.management-tool-link,.master-console-nav a,
  .module-card,.customer-order-tile,.live-stage,.selectable-batch
) {
  transition:none;
}
body.milk-app :is(
  .management-primary-item,.management-tool-link,.master-console-nav a,
  .module-card,.customer-order-tile,.live-stage,.selectable-batch
):hover {
  transform:none;
}
body.milk-app :is(.status-dot,.timeline-item>span,.mobile-timeline-item i,
  .scheme-active-team>div>a>i) {
  border-radius:0;
}
body.milk-app :is(.scheme-stage-card,.live-stage) :is(footer>i,.stage-load>i),
body.milk-app .warm-progress {
  border-radius:2px;
}

@media print {
  body.milk-app :is(
    .customer-header,.customer-new-order,.customer-orders-section,.customer-order-form,
    .master-console-header,.master-console-panel,.warm-panel,.milk-panel,.card,
    .management-shell,.workplace-header,.warehouse-product-card,.trace-batch-card,
    .scheme-stage-card,.summary-strip article,.milk-kpis article,.kpi,.cash-kpis article
  ) {
    box-shadow:none;
  }
}

/* Source: compact-ui.css */
/* Calm, compact work areas. Keep print, PIN keypads and production boards local.
   Explicit scope wins over the older stylesheets loaded inside page content.
   No zoom, transform, smaller table fonts, or hidden financial warnings. */
@media screen {
  body.milk-app .site-navigation-inner { min-height:52px; padding:4px 0; gap:10px; }
  body.milk-app .document-history-links { margin-top:6px; gap:8px; font-size:var(--ui-type-meta); }
  body.milk-app .platform-shell.workplace-shell { padding-top:14px; padding-bottom:28px; }
  body.milk-app .workplace-header .workplace-main-row.workplace-global-navigation {
    grid-template-columns:190px minmax(0,1fr); gap:18px; padding:10px 14px;
  }
  body.milk-app .workplace-shell .workplace-brand img { width:190px; max-width:100%; }
  body.milk-app .workplace-shell .workplace-identity { padding-left:18px; }
  body.milk-app .workplace-shell .workplace-identity h1 { font-size:23px; overflow-wrap:anywhere; }
  body.milk-app .workplace-shell .workplace-nav { padding:6px; gap:4px; }
  body.milk-app .workplace-shell .workplace-nav a { padding:6px 8px; gap:7px; }
  body.milk-app .workplace-shell .workplace-mark { flex-basis:21px; height:21px; box-shadow:1px 1px 0 #b69560; }
  body.milk-app .workplace-shell .workplace-more { padding:4px 12px; }
  body.milk-app .workplace-shell .workplace-more summary {
    display:flex; align-items:center; gap:7px; min-height:36px; font-size:var(--ui-type-meta); list-style:none;
  }
  body.milk-app .workplace-shell .workplace-more summary::-webkit-details-marker { display:none; }
  body.milk-app .workplace-shell .workplace-more summary::before { content:"▸"; font-size:13px; }
  body.milk-app .workplace-shell .workplace-more[open]>summary::before { content:"▾"; }
  body.milk-app .workplace-shell .workplace-secondary { gap:6px; padding:6px 0 4px; font-size:var(--ui-type-meta); }
  body.milk-app .workplace-shell .workplace-secondary a { display:inline-flex; align-items:center; padding:7px 10px; }
  body.milk-app .workplace-shell .workplace-content { margin-top:14px; }
  body.milk-app .workplace-shell .milk-panel { padding:14px 16px; margin:12px 0; box-shadow:2px 2px 0 #e7d7bb; }
  body.milk-app .workplace-shell h2 { font-size:20px; margin-bottom:10px; }
  body.milk-app .workplace-shell .milk-panel h2::before { width:7px; height:7px; margin-right:8px; }
  body.milk-app .workplace-shell .milk-form { gap:10px 14px; }
  body.milk-app .workplace-shell label { gap:5px; }
  body.milk-app .workplace-shell .milk-kpis { gap:10px; margin:12px 0; }
  body.milk-app .workplace-shell .milk-kpis article { padding:10px 12px; box-shadow:1px 1px 0 #e7d7bb; }
  body.milk-app .workplace-shell .milk-kpis span { margin-bottom:5px; }
  body.milk-app .workplace-shell .milk-kpis strong { font-size:23px; }
  body.milk-app .workplace-shell .milk-kpis small { margin-top:4px; }
  body.milk-app .workplace-shell :is(.milk-notice,.fat-reference,.milk-calculation) { padding:10px 12px; margin-top:10px; margin-bottom:10px; }
  body.milk-app .workplace-shell .milk-calculation strong { font-size:20px; }
  body.milk-app .workplace-shell :is(.milk-filters,.butter-filters) { gap:10px; }
  body.milk-app .workplace-shell .butter-filters { margin:12px 0; }
  body.milk-app .workplace-shell .butter-heading { gap:12px; margin:12px 0; }
  body.milk-app .workplace-shell .butter-section-heading { margin-bottom:10px; }
  body.milk-app .workplace-shell .butter-date-panel { gap:14px; }
  body.milk-app .workplace-shell .butter-milk-inputs { gap:10px; }
  body.milk-app .workplace-shell .butter-quantity-grid { gap:8px 10px; }
  body.milk-app .workplace-shell .butter-quantity { padding:6px 8px; }
  body.milk-app .workplace-shell .butter-fat { padding:8px 10px; }
  body.milk-app .workplace-shell .butter-fat strong { font-size:21px; }
  body.milk-app .workplace-shell .sale-heading { margin-bottom:12px; }
  body.milk-app .workplace-shell .sale-heading h2 { font-size:24px; }
  body.milk-app .workplace-shell .sale-section-title { margin-bottom:12px; gap:10px; }
  body.milk-app .workplace-shell .sale-summary { gap:10px; margin-top:12px; padding:12px 14px; }
  body.milk-app .workplace-shell .sale-summary strong { font-size:22px; }
  body.milk-app .workplace-shell .sale-journal-row { padding:12px 0; gap:12px; }
  body.milk-app .workplace-shell .sale-detail-lines article { padding:12px 0; gap:12px; }
  body.milk-app .workplace-shell .stock-receive-tools { margin:10px 0; gap:12px; }

  /* The admin area already has a global searchable menu. Its duplicate links
     remain available in a normal details disclosure instead of a large banner. */
  body.milk-app .management-tools-menu>summary {
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    min-height:44px; padding:7px 10px; border:1px solid var(--ui-line);
    background:var(--ui-surface); color:#6f5038; font-size:var(--ui-type-meta); font-weight:750; cursor:pointer; list-style:none;
  }
  body.milk-app .management-tools-menu>summary::-webkit-details-marker { display:none; }
  body.milk-app .management-tools-menu:not([open])>.management-tools { display:none; }
  body.milk-app .management-tools-menu[open]>summary { margin-bottom:8px; }
  body.milk-app .unified-page .management-main-row { padding:12px 16px; gap:20px; }
  body.milk-app .unified-page .management-secondary-row { padding:10px 16px; gap:14px; align-items:start; }
  body.milk-app .unified-page .management-location { margin:12px 0 16px; gap:16px; }
  body.milk-app .unified-page .management-location h1 { font-size:29px; margin:5px 0; }
  body.milk-app .unified-page .management-location p { font-size:14px; margin:6px 0; }
  body.milk-app .unified-page .warm-panel { padding:16px; margin-bottom:14px; }
  body.milk-app .unified-page :is(.kpi,.summary-cards>div) { padding:12px; }
  body.milk-app .unified-page .kpi b { font-size:26px; }
  body.milk-app .master-console .master-console-header { padding:10px 14px; }
  body.milk-app .master-console .master-console-title { margin-top:14px; margin-bottom:18px; }
  body.milk-app .master-console .master-console-title h1 { font-size:30px; }
  body.milk-app .master-console :is(.warm-panel,.master-console-panel) { padding:16px; }
  body.milk-app .master-console h2 { font-size:21px; margin:10px 0; }
  body.milk-app .master-console .summary-strip article { padding:12px; }
  body.milk-app .mobile-shell .welcome { margin-top:14px; margin-bottom:18px; }
  body.milk-app .mobile-shell .welcome h1 { font-size:28px; }
  body.milk-app .mobile-shell h2 { font-size:21px; margin:16px 0 12px; }
  body.milk-app .customer-app .customer-hero h1 { font-size:28px; }
}

/* Desktop controls may be denser; touch and narrow-screen fields keep their
   original tap targets and Safari-safe type size. Tables keep their fonts. */
@media screen and (min-width:761px) and (pointer:fine) {
  body.milk-app .site-navigation :is(a,.quick-menu-toggle) { min-height:38px; padding:7px 11px; font-size:var(--ui-type-meta); }
  body.milk-app .document-history-links a { min-height:30px; padding:5px 9px; }
  body.milk-app .workplace-shell .workplace-nav a { min-height:38px; }
  body.milk-app .workplace-shell .workplace-more summary { min-height:30px; }
  body.milk-app .workplace-shell .workplace-secondary a { min-height:34px; }
  body.milk-app .workplace-shell :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]),select) {
    min-height:38px; padding:7px 10px; font-size:var(--ui-type-body);
  }
  body.milk-app .workplace-shell textarea { padding:8px 10px; min-height:66px; font-size:var(--ui-type-body); }
  body.milk-app .workplace-shell :is(button,.butter-button) { min-height:38px; padding:7px 12px; }
  body.milk-app .workplace-shell :is(th,td) { padding-top:8px; padding-bottom:8px; }
  body.milk-app .workplace-shell td a { padding-top:3px; padding-bottom:3px; }
  body.milk-app .workplace-shell .sale-line { padding:10px 0; gap:12px; }
  body.milk-app .workplace-shell .sale-line .sale-remove { min-width:36px; width:36px; min-height:38px; padding:4px; }
  body.milk-app .management-tools-menu>summary { min-height:38px; }
  body.milk-app .nomenclature-picker .nomenclature-input { min-height:38px; font-size:var(--ui-type-body); padding:7px 10px; }
  body.milk-app .nomenclature-popup { font-size:14px; }
  body.milk-app .nomenclature-option { min-height:38px; padding:8px 12px; }
}

@media screen and (min-width:761px) and (max-width:1100px) {
  body.milk-app .workplace-shell .workplace-nav { grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); }
}
@media screen and (max-width:760px) {
  body.milk-app .platform-shell.workplace-shell { padding-top:10px; }
  body.milk-app .workplace-header .workplace-main-row.workplace-global-navigation {
    grid-template-columns:minmax(120px,160px) minmax(0,1fr); gap:12px; padding:10px 12px;
  }
  body.milk-app .workplace-shell .workplace-identity { padding-left:12px; }
  body.milk-app .workplace-shell .workplace-identity h1 { font-size:20px; }
  body.milk-app .workplace-shell .workplace-content { margin-top:12px; }
  body.milk-app .workplace-shell .milk-panel { padding:12px; margin:10px 0; }
  body.milk-app .workplace-shell .workplace-nav a { min-height:44px; }
  body.milk-app .workplace-shell .workplace-more summary { min-height:44px; }
  body.milk-app .workplace-shell .workplace-secondary a { min-height:44px; }
  body.milk-app .workplace-shell :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]),select,textarea) { font-size:16px; min-height:44px; }
  body.milk-app .workplace-shell :is(button,.butter-button) { min-height:44px; }
  body.milk-app .workplace-shell .sale-heading h2 { font-size:22px; }
  body.milk-app .workplace-shell .milk-kpis strong { font-size:21px; }
  body.milk-app .workplace-shell .milk-calculation strong { font-size:18px; }
  body.milk-app .unified-page .management-location h1 { font-size:25px; }
  body.milk-app .master-console .master-console-title h1 { font-size:25px; }
  body.milk-app .mobile-shell .welcome h1 { font-size:25px; }
}
@media screen and (pointer:coarse) {
  body.milk-app .workplace-shell :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]),select,textarea) { min-height:44px; font-size:16px; }
  body.milk-app .workplace-shell :is(button,.butter-button,.workplace-secondary a,.workplace-nav a,.workplace-more summary) { min-height:44px; }
  body.milk-app .nomenclature-picker .nomenclature-input { min-height:44px; font-size:16px; }
  body.milk-app .nomenclature-option { min-height:44px; }
}
@media screen and (max-width:520px) {
  body.milk-app .workplace-header .workplace-main-row.workplace-global-navigation {
    grid-template-columns:minmax(105px,130px) minmax(0,1fr); gap:10px;
  }
  body.milk-app .workplace-shell .workplace-identity { padding-left:10px; }
}

/* Source: workplace-navigation.css */
/* The global Home/Menu bar is followed by one compact section toolbar. */
body.milk-app .workplace-header { overflow:visible; }
body.milk-app .workplace-shell .workplace-section-bar .workplace-section-toggle { display:none; }
body.milk-app .workplace-header .workplace-section-bar {
  display:flex; align-items:center; flex-wrap:wrap; gap:4px 12px; padding:6px 10px;
}
body.milk-app .workplace-header .workplace-section-title { flex:0 1 auto; padding:4px 6px; min-width:0; }
body.milk-app .workplace-header .workplace-section-title h1 {
  margin:0; font-size:17px; line-height:1.3; overflow-wrap:anywhere;
}
body.milk-app .workplace-shell .workplace-section-bar .workplace-nav {
  display:flex; flex:1 1 auto; flex-wrap:wrap; gap:4px; padding:0; border:0; background:none;
}
body.milk-app .workplace-shell .workplace-section-bar .workplace-nav a {
  min-height:38px; padding:6px 10px; border-radius:4px; font-size:var(--ui-type-meta);
}
body.milk-app .workplace-section-bar .workplace-mark { display:none; }
body.milk-app .workplace-shell .workplace-section-bar .workplace-more {
  position:relative; flex:0 1 auto; min-width:0; max-width:100%; padding:0; border:0; background:none;
}
body.milk-app .workplace-shell .workplace-section-bar .workplace-more>summary {
  min-height:38px; padding:6px 10px; border:1px solid var(--milk-line); border-radius:4px;
  background:var(--milk-paper); box-sizing:border-box; line-height:1.3;
}
body.milk-app .workplace-shell .workplace-section-bar .workplace-more[data-current-section]>summary {
  background:var(--milk-brown); border-color:var(--milk-brown); color:var(--milk-paper);
}
body.milk-app .workplace-more-current { max-width:240px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body.milk-app .workplace-more-current::before { content:"· "; }
body.milk-app .workplace-shell .workplace-section-bar .workplace-secondary {
  position:absolute; z-index:45; top:calc(100% + 6px); right:0; display:grid; gap:2px;
  width:max-content; min-width:240px; max-width:min(360px,calc(100vw - 44px));
  max-height:65vh; overflow:auto; padding:6px; border:1px solid var(--milk-line);
  background:var(--milk-paper); box-shadow:3px 3px 0 #d7c29e;
}
body.milk-app .workplace-shell .workplace-section-bar .workplace-more:not([open])>.workplace-secondary { display:none; }
body.milk-app .workplace-shell .workplace-section-bar .workplace-secondary a {
  display:flex; align-items:center; min-height:38px; padding:7px 10px; border:0;
  background:transparent; white-space:normal; line-height:1.35; box-sizing:border-box;
}
body.milk-app .workplace-shell .workplace-section-bar .workplace-secondary a:hover { background:#f8efdd; }
body.milk-app .workplace-shell .workplace-section-bar .workplace-secondary a[aria-current=page] {
  background:#f1d69b; font-weight:800; border-left:3px solid var(--milk-brown);
}
/* A resize must not discard focus before matchMedia can move it to a link. */
@media(min-width:761px) {
  body.milk-app .workplace-shell .workplace-section-bar .workplace-section-toggle:focus { display:flex; }
}
@media(max-width:760px) {
  body.milk-app .workplace-header .workplace-section-bar { gap:5px; padding:7px; }
  body.milk-app .workplace-header .workplace-section-title { flex-basis:100%; }
  body.milk-app .workplace-shell .workplace-section-bar .workplace-nav { flex-basis:100%; }
  body.milk-app .workplace-shell .workplace-section-bar .workplace-nav a { flex:1 1 auto; justify-content:center; }
  body.milk-app .workplace-shell .workplace-section-bar .workplace-more { flex:1 1 auto; }
  body.milk-app .workplace-shell .workplace-section-bar .workplace-secondary { right:auto; left:0; }
  body.milk-app .workplace-more-current { max-width:none; white-space:normal; overflow-wrap:anywhere; }
  body.milk-app .workplace-header .workplace-sections-enhanced .workplace-section-title { flex:0 1 auto; }
  body.milk-app .workplace-shell .workplace-sections-enhanced .workplace-section-toggle {
    display:flex; flex:1 1 150px; min-width:0; min-height:44px; margin:0; padding:7px 10px;
    justify-content:space-between; text-align:left; line-height:1.3; font-size:var(--ui-type-meta);
    border:1px solid #b99b6d; background:#f5ecd9; color:#553b29; box-shadow:none;
  }
  body.milk-app .workplace-section-toggle::after { content:"▾"; flex-shrink:0; }
  body.milk-app .workplace-section-toggle[aria-expanded=true]::after { content:"▴"; }
  /* Keep an in-use link visible until the viewport handler restores its group. */
  body.milk-app .workplace-shell .workplace-sections-enhanced:not(.workplace-sections-open) :is(.workplace-nav,.workplace-more):not(:focus-within) { display:none; }
  body.milk-app .workplace-shell .workplace-sections-enhanced.workplace-sections-open .workplace-nav { padding-top:5px; }
}
@media(max-width:760px),(pointer:coarse) {
  body.milk-app .workplace-shell .workplace-section-bar :is(.workplace-nav a,.workplace-more>summary,.workplace-secondary a) { min-height:44px; }
}
@media print { body.milk-app .workplace-shell .workplace-section-bar :is(.workplace-nav,.workplace-more,.workplace-section-toggle) { display:none; } }

/* Source: workplace-calm.css */
/* Quiet working surfaces; factory map, safety colours and printed forms retain
   their own visual rules. Density comes from fewer frames, not smaller text. */
@media screen {
  body.milk-app .workplace-shell .milk-panel,
  body.milk-app :is(.warm-panel,.master-console-panel,.customer-new-order,.customer-orders-section) {
    box-shadow:none;
    border-color:var(--ui-line-soft);
  }
  body.milk-app .workplace-shell .milk-panel .milk-panel { border:0; border-top:1px solid #dfd3bf; padding-left:0; padding-right:0; }
  body.milk-app .workplace-shell :is(.milk-kpis article,.butter-price-summary>article,.butter-raw-cards article) { box-shadow:none; border-width:1px; }
  body.milk-app .workplace-shell .milk-kpis article { border-top:2px solid #d4ad67; }
  body.milk-app .workplace-shell :is(.milk-eyebrow,.butter-help) { letter-spacing:normal; }
  body.milk-app .workplace-shell .milk-panel h2::before { display:none; }
  body.milk-app .workplace-shell :is(.milk-panel,.milk-kpis) :is(h2,h3) { font-weight:700; }
  body.milk-app .workplace-shell tbody td strong { font-weight:600; }
  body.milk-app .workplace-shell :is(input,select,textarea) { font-weight:500; }
  body.milk-app .workplace-shell :is(.milk-panel,.milk-kpis) small { line-height:1.5; }
  body.milk-app .workplace-shell :is(button,.butter-button,.sale-button) { box-shadow:1px 1px 0 #d1b585; }
  body.milk-app .workplace-shell :is(.secondary,.sale-secondary,.workflow-secondary) { box-shadow:none; }
  body.milk-app .document-history-menu { max-width:1600px; margin:6px auto 0; padding:0 16px; font-size:var(--ui-type-meta); }
  body.milk-app .document-history-menu>summary { cursor:pointer; display:list-item; min-height:30px; padding:6px 0; color:#76583e; }
  body.milk-app .document-history-menu .document-history-links { margin:0; padding:4px 0 8px; }
  body.milk-app .workplace-shell .filter-disclosure,
  body.milk-app .workplace-shell .filter-selection-summary { display:none; }
  body.milk-app .comparison-table-wrap { isolation:isolate; }
  body.milk-app .comparison-table-wrap thead th { position:sticky; top:0; z-index:2; background:#f1e5cd; }
  body.milk-app .comparison-table-wrap.table-scrollable :is(th,td):first-child { position:sticky; left:0; z-index:1; background:var(--ui-field); box-shadow:1px 0 var(--ui-line-soft); }
  body.milk-app .comparison-table-wrap.table-scrollable thead th:first-child { z-index:3; background:#f1e5cd; }
}
@media screen and (min-width:761px) {
  body.milk-app .comparison-table-long { max-height:70vh; overflow:auto; }
}
@media screen and (max-width:760px) {
  body.milk-app :is(.unified-page,.mobile-shell,.master-console,.customer-app) :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]),select,textarea) {
    font-size:16px; min-height:44px;
  }
  body.milk-app .workplace-shell .responsive-filters .filter-disclosure {
    display:flex; grid-column:1/-1; justify-content:space-between;
    background:#f5ecd9; color:#553b29; border:1px solid #ccb994; box-shadow:none;
    min-height:44px; text-align:left;
  }
  body.milk-app .workplace-shell .responsive-filters .filter-selection-summary {
    display:block; grid-column:1/-1; font-size:var(--ui-type-meta); line-height:1.5; margin:0 0 6px; overflow-wrap:anywhere;
  }
  body.milk-app .workplace-shell .responsive-filters .filter-selection-pending { color:#8a4e24; font-weight:600; }
  body.milk-app .workplace-shell .responsive-filters:not(.filters-expanded) .filter-extra-field { display:none; }
  body.milk-app .workplace-shell .responsive-filters.filters-expanded .filter-extra-field { grid-column:1/-1; }
  body.milk-app .workplace-shell .mobile-card-wrap { overflow:visible; border:0; background:transparent; }
  body.milk-app .workplace-shell table.mobile-document-cards { display:block; min-width:0; width:100%; }
  body.milk-app .workplace-shell .mobile-document-cards colgroup { display:none; }
  body.milk-app .workplace-shell .mobile-document-cards thead {
    position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
    clip-path:inset(50%); white-space:nowrap;
  }
  body.milk-app .workplace-shell .mobile-document-cards tbody { display:block; }
  body.milk-app .workplace-shell .mobile-document-cards tbody tr {
    display:grid; grid-template-columns:minmax(0,1fr); margin:0 0 10px; padding:8px 12px;
    background:var(--ui-field); border:1px solid var(--ui-line-soft); border-radius:4px;
  }
  body.milk-app .workplace-shell .mobile-document-cards tbody tr.cash-row-warning { background:#fff3d9; border-left:3px solid #b78034; }
  body.milk-app .workplace-shell .mobile-document-cards tbody tr.cash-row-error { background:#fbe8df; border-left-color:#a04530; }
  body.milk-app .workplace-shell .mobile-document-cards tbody :is(td,th) {
    display:block; min-width:0; width:auto; max-width:none; padding:5px 0;
    text-align:left; border:0; white-space:normal; overflow-wrap:anywhere; font-size:13px;
    background:transparent; position:static; box-shadow:none;
  }
  body.milk-app .workplace-shell .mobile-document-cards tbody :is(td,th)::before {
    content:attr(data-column-label); display:block; font-size:var(--ui-type-meta); color:#755b43; font-weight:500; margin-bottom:2px;
  }
  body.milk-app .workplace-shell .mobile-document-cards tbody tr>:first-child { border-bottom:1px solid #e5dac6; padding-bottom:7px; margin-bottom:3px; }
  body.milk-app .workplace-shell .mobile-document-cards :is(a,summary) { min-height:44px; display:inline-flex; align-items:center; }
  body.milk-app .workplace-shell .mobile-document-cards .cash-warning-list { max-width:100%; }
  /* Explicit card layout wins over the older report-specific table padding. */
  body.milk-app .platform-shell.workplace-shell .mobile-card-wrap table.mobile-document-cards tbody tr {
    grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px 12px; padding:8px 10px;
  }
  body.milk-app .platform-shell.workplace-shell .mobile-card-wrap table.mobile-document-cards tbody tr>:is(td,th) {
    padding:4px 0; font-size:13px;
  }
  body.milk-app .platform-shell.workplace-shell .mobile-card-wrap table.mobile-document-cards tbody tr>:first-child {
    grid-column:1/-1; display:flex; align-items:center; flex-wrap:wrap; gap:5px 12px;
    padding:2px 0 5px;
  }
  body.milk-app .platform-shell.workplace-shell .mobile-card-wrap table.mobile-document-cards tbody tr>:first-child::before { display:none; }
  body.milk-app .platform-shell.workplace-shell .mobile-card-wrap table.report-sales-table tbody tr>:nth-child(2),
  body.milk-app .platform-shell.workplace-shell .mobile-card-wrap table.document-table tbody tr>:is(:nth-child(2),:nth-child(5)),
  body.milk-app .platform-shell.workplace-shell .mobile-card-wrap table.cash-ledger tbody tr>:nth-child(3),
  body.milk-app .platform-shell.workplace-shell .mobile-card-wrap table.efficiency-documents tbody tr>:is(:nth-child(2),:nth-child(3)) { grid-column:1/-1; }
}
@media print {
  .filter-disclosure,.filter-selection-summary,.document-history-menu { display:none!important; }
  .comparison-table-wrap { max-height:none!important; overflow:visible!important; }
}

/* Source: workplace-usability.css */
/* Focus and table guidance share the portal palette; retain touch sizes. */
@media screen {
  body.milk-app :is(a,button,summary,input,select,textarea,[tabindex="0"]):focus-visible {
    outline:2px solid var(--ui-focus);
    outline-offset:3px;
  }
  body.milk-app .table-scrollable:focus-visible { outline-offset:2px; }
  body.milk-app .table-scroll-help {
    margin:6px 0 10px; color:#765a40; font-size:var(--ui-type-meta); line-height:1.5;
  }
  body.milk-app .table-scroll-help[hidden] { display:none; }
  body.milk-app .workplace-shell .receipt-date-inactive input:disabled {
    background:#f2ebdc; color:#796b57; cursor:not-allowed;
  }
  body.milk-app .workplace-shell .stock-receive-list :is(th,td):is(:nth-child(2),:nth-child(3)) {
    text-align:left;
  }
  /* The selectable card is the large tap target. Its transparent checkbox
     must not inherit the full-width text-input sizing on narrow screens. */
  body.milk-app .selectable-batch>.merge-checkbox {
    width:1px; height:1px; min-height:0; padding:0; margin:0;
    clip-path:inset(50%); overflow:hidden;
  }
  body.milk-app .selectable-batch:focus-within {
    outline:2px solid var(--ui-focus); outline-offset:3px;
  }
}
@media print { .table-scroll-help { display:none!important; } }

/* Inline links carry a permanent non-colour cue. */
body.milk-app :is(p,.pay-report-context,.shipment-report-context) a:not(.btn):not(.butter-button) {
 text-decoration:underline; text-underline-offset:.2em;
}
body.milk-app .task-edit>summary {
 display:flex; align-items:center; min-height:32px; padding:6px 0; cursor:pointer;
}
body.milk-app .task-edit>summary::before { content:'▸'; margin-inline-end:8px; }
body.milk-app .task-edit[open]>summary::before { content:'▾'; }
@media (pointer:coarse),(max-width:760px) {
 body.milk-app .task-edit>summary { min-height:44px; }
}
.skip-link {
 position:fixed; inset-block-start:8px; inset-inline-start:8px; z-index:20000;
 padding:12px 16px; background:var(--ui-ink); color:var(--ui-surface);
 transform:translateY(-200%); text-decoration:underline;
}
.skip-link:focus { transform:none; }
@media print { .skip-link { display:none; } }
/* Native modal supplies background inertness; the local backdrop retains the visual world. */
dialog.command-search {
 width:100%; height:100%; max-width:none; max-height:none; margin:0;
 border:0; background:transparent; box-sizing:border-box; color:var(--ui-ink);
}
dialog.command-search:not([open]) { display:none; }
dialog.command-search::backdrop { background:transparent; }
.command-search-dialog>header .command-search-close {
 flex:0 0 auto; min-height:44px; padding:8px 12px; font-size:var(--ui-type-label);
 background:var(--ui-surface); color:var(--ui-ink); border:1px solid var(--ui-line);
}

/* Section navigation keeps distinct touch areas when the labels wrap. */
body.milk-app .cost-control .milk-subnav { gap:10px; align-items:stretch; }
body.milk-app .cost-control .milk-subnav a {
 display:inline-flex; align-items:center; box-sizing:border-box;
 min-height:38px; max-width:100%; padding:9px 13px; line-height:1.5;
}
@media (pointer:coarse),(max-width:760px) {
 body.milk-app .cost-control .milk-subnav a { min-height:44px; }
}

/* Source: nomenclature-search.css */
.nomenclature-picker{position:relative;display:block;min-width:0;width:100%;isolation:isolate}
.nomenclature-picker .nomenclature-source{position:absolute!important;width:1px!important;height:1px!important;min-height:0!important;padding:0!important;margin:0!important;opacity:0;overflow:hidden;clip-path:inset(50%);pointer-events:none}
.nomenclature-picker .nomenclature-input{display:block;width:100%;min-width:0;margin:0;padding-right:2.6rem!important;text-overflow:ellipsis;background:var(--ui-field);font:inherit;font-weight:600}
.nomenclature-picker .nomenclature-toggle{position:absolute;right:2px;top:2px;bottom:2px;min-height:0!important;width:2.4rem;margin:0;padding:0;border:0;box-shadow:none;background:transparent;color:var(--ui-focus);cursor:pointer}
.nomenclature-picker .nomenclature-toggle:hover{background:#f4e6c9}
.nomenclature-picker .nomenclature-input:focus-visible{outline:2px solid #83613a;outline-offset:2px}
.nomenclature-popup{position:fixed;z-index:10010;box-sizing:border-box;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;background:var(--ui-surface);border:2px solid #b79b68;box-shadow:4px 4px 0 #ddc9a4;color:#503724;font-family:inherit;font-size:16px;line-height:1.4}
.nomenclature-popup[hidden]{display:none!important}
.nomenclature-option{padding:.65rem .85rem;min-height:44px;box-sizing:border-box;cursor:pointer;overflow-wrap:anywhere}
.nomenclature-option:hover,.nomenclature-option[aria-selected="true"]{background:#ead4a8;color:#3c281d;outline:1px solid #a68450;outline-offset:-1px}
.nomenclature-empty{padding:1rem;color:#805e40}
@media(max-width:640px){.nomenclature-picker .nomenclature-input{font-size:16px!important}.nomenclature-option{padding:.75rem}}
@media print{.nomenclature-popup,.nomenclature-toggle{display:none!important}}

.nomenclature-source + .form-guard-note{display:none!important}
