/* No desktop or BOM overrides. Enhancements are opt-in, attached by mobile-layout.js. */
.ml-list-tools,.ml-filter-disclosure,.ml-matrix-panel { display:none; }
@media (max-width:820px) {
  .ml-list-tools [hidden],.ml-matrix-panel [hidden] {display:none!important;}
  body #moduleView .ml-compact-filter {
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px 8px!important;padding:12px!important;width:auto!important;min-width:0!important;
    align-items:end!important;flex:initial!important;
  }
  body #moduleView .ml-compact-filter > label {
    display:flex!important;flex-direction:column!important;align-items:stretch!important;
    width:auto!important;min-width:0!important;max-width:none!important;flex:initial!important;
    gap:5px!important;margin:0!important;grid-column:auto!important;color:#304f70!important;font-size:13px!important;font-weight:600;
  }
  body #moduleView .ml-compact-filter > label > span {color:#304f70!important;font-size:13px!important;}
  body #moduleView .ml-compact-filter input:not([type=checkbox]),
  body #moduleView .ml-compact-filter select {
    box-sizing:border-box;width:100%!important;min-width:0!important;max-width:100%!important;
    min-height:44px!important;height:44px!important;margin:0!important;padding:8px 10px!important;
    font-size:16px!important;line-height:1.3!important;border-radius:8px!important;
  }
  body #moduleView .ml-compact-filter > button {min-width:0!important;width:100%!important;min-height:44px!important;margin:0!important;white-space:normal!important;}
  body #moduleView .ml-compact-filter > .ml-filter-full {grid-column:1/-1!important;}
  body #moduleView .ml-compact-filter:not(.ml-filter-expanded) > .ml-advanced-filter {display:none!important;}
  body #moduleView .ml-compact-filter > label:has(input[type=checkbox]) {flex-direction:row!important;align-items:center!important;min-height:44px;}
  .ml-filter-disclosure {display:flex;align-items:center;gap:10px;padding:8px 12px 0;min-width:0;flex-wrap:wrap;}
  .ml-filter-summary {font-size:12px;color:#4c6580;overflow-wrap:anywhere;flex:1;min-width:120px;}
  body .ml-button {display:inline-flex!important;align-items:center;justify-content:center;min-height:44px!important;min-width:44px!important;width:auto!important;padding:8px 12px!important;line-height:1.25!important;background:#fff!important;color:#274c74!important;border:1px solid #c9d9e9!important;border-radius:8px!important;font-size:13px!important;font-weight:650;white-space:nowrap!important;}
  body .ml-button[aria-pressed=true] {background:#194d7c!important;border-color:#194d7c!important;color:#fff!important;}
  .ml-button:focus-visible {outline:3px solid #60a5fa;outline-offset:2px;}
  body #moduleView :is(.vp-toolbar,.vp-result-toolbar) {display:block!important;padding:0!important;min-width:0!important;}
  body #moduleView .vp-toolbar-actions {display:grid!important;grid-template-columns:1fr 1fr;gap:8px;padding:0 12px 12px;margin:0!important;}
  body #moduleView .vp-toolbar-actions button {width:100%!important;min-height:44px!important;}
  body #moduleView :is(.vendor-work-hero,.vendor-matching-hero) {padding:14px!important;gap:12px!important;display:block!important;}
  body #moduleView :is(.vendor-work-hero,.vendor-matching-hero) h2 {font-size:18px!important;line-height:1.4!important;margin:0 0 8px!important;}
  body #moduleView :is(.vendor-work-hero,.vendor-matching-hero) > div:first-child > :is(p,span) {display:none!important;}
  body #moduleView .vendor-work-hero > button {min-height:44px!important;}
  body #moduleView .vendor-work-attention.is-clear {display:none!important;}
  body #moduleView :is(.vendor-work-list-head,.vendor-matching-list > header) p {display:none!important;}
  body #moduleView :is(.vendor-work-summary,.vp-metrics) {display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;}
  body #moduleView :is(.vendor-work-summary > button,.vp-metric) {min-width:0!important;min-height:62px!important;padding:8px!important;border-radius:9px!important;}
  body #moduleView :is(.vendor-work-summary,.vp-metrics) :is(small,span) {font-size:11px!important;white-space:normal!important;}
  body #moduleView :is(.vendor-work-summary,.vp-metrics) strong {font-size:19px!important;line-height:1.25!important;}
  body #moduleView .vp-metric-dot {display:none!important;}
  body #moduleView .vendor-matching-stats {gap:8px!important;}
  body #moduleView .vendor-matching-stats article {padding:10px!important;min-height:70px!important;}
  body #moduleView .vendor-matching-list-head {display:flex!important;flex-wrap:wrap!important;gap:8px!important;padding:12px!important;}
  body #moduleView :is(.vendor-matching-list-actions,.vendor-matching-actions) {display:flex!important;flex-wrap:wrap!important;gap:6px!important;min-width:0!important;}
  body #moduleView :is(.vendor-matching-list-actions,.vendor-matching-actions) button {min-height:44px!important;white-space:normal!important;flex:1 1 130px;}
  body #moduleView .dq-statuses {display:flex!important;overflow-x:auto;flex-wrap:nowrap!important;gap:6px;}
  body #moduleView .dq-statuses button {flex:0 0 auto;min-height:44px!important;}
  body #moduleView .dq-list-heading {display:block!important;padding:12px!important;}
  body #moduleView .dq-list-heading .dq-actions {margin-top:10px;}
  body #moduleView .dq-list-heading p {display:flex;flex-wrap:wrap;gap:4px 10px;}
  body #moduleView .dq-list-footer {flex-wrap:wrap;gap:8px!important;}
  body #moduleView .product-inventory-filter-actions {display:flex!important;flex-wrap:wrap!important;gap:8px!important;}
  body #moduleView .product-inventory-filter-actions label {width:100%;min-width:0;min-height:44px;white-space:normal!important;}
  body #moduleView .product-inventory-filter-actions button {flex:1;min-height:44px!important;}
  body #moduleView :is(.vendor-matching-filters,.hfr-settings-toolbar) {margin-top:8px!important;}
  /* Card mode uses original cells. Table/export widths remain untouched. */
  .ml-list-tools {display:flex;align-items:center;flex-wrap:wrap;gap:6px;padding:10px 12px;background:#f3f7fb;border-block:1px solid #e1eaf3;}
  .ml-list-hint {flex:1 1 110px;font-size:12px;font-weight:600;color:#466583;}
  .ml-view-modes {display:flex;gap:4px;}
  body :is(#moduleView,dialog) .ml-cards-host {height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;contain:none!important;padding:8px!important;box-sizing:border-box;}
  body :is(#moduleView,dialog) table.ml-list-table[data-mobile-mode=cards] {
    --ml-table-width:100%;--ml-table-min-width:0px;--ml-table-max-width:100%;
    display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;
    height:auto!important;table-layout:auto!important;border:0!important;background:transparent!important;
  }
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] > colgroup {display:none!important;}
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] > thead {
    position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)!important;
  }
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards].ml-has-selection > thead {position:static!important;width:100%!important;height:auto!important;clip-path:none!important;display:block!important;}
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards].ml-has-selection > thead tr {display:block!important;}
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards].ml-has-selection th {display:none!important;}
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards].ml-has-selection .ml-selection-head {display:flex!important;position:static!important;width:100%!important;min-height:44px!important;background:#edf4fc!important;color:#1d456e!important;}
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] .ml-selection-head .rs-th-inner {display:flex!important;align-items:center!important;position:static!important;min-height:44px!important;overflow:visible!important;padding:0 12px!important;}
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] .ml-selection-head :is(.rs-th-filter,.rs-col-resize) {display:none!important;}
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] .ml-selection-head .rs-th-label {display:flex!important;align-items:center;gap:10px;overflow:visible!important;min-height:44px!important;}
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] .ml-selection-head .rs-th-label::after {content:"전체 선택";font-size:13px;color:#234d74;}
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] > tbody {display:grid!important;gap:10px!important;width:100%!important;}
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] > tbody > tr {
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:0 12px!important;
    padding:12px!important;border:1px solid #d6e3f0!important;border-radius:11px!important;background:#fff!important;
    width:auto!important;min-height:0!important;height:auto!important;overflow:hidden!important;position:relative!important;
  }
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] > tbody > tr[hidden],
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] > tbody > tr[style*="display: none"] {display:none!important;}
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] > tbody > tr.selected {border-color:#4287c5!important;background:#f3f8ff!important;}
  body dialog .ml-list-table[data-mobile-mode=cards] > tbody > tr.pass {background:#f0fbf3!important;border-color:#bfe4cc!important;}
  body dialog .ml-list-table[data-mobile-mode=cards] > tbody > tr.fail {background:#fff2f3!important;border-color:#f0bdc3!important;}
  body dialog .ml-list-table[data-mobile-mode=cards] > tbody > tr:is(.waiting,.blocked) {background:#f5f7fa!important;}
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] > tbody > tr > :is(td,th) {
    display:block!important;position:static!important;inset:auto!important;width:auto!important;min-width:0!important;max-width:100%!important;
    height:auto!important;min-height:0!important;padding:8px 0!important;border:0!important;border-top:1px solid #edf2f7!important;
    white-space:normal!important;text-align:left!important;line-height:1.5!important;font-size:13px!important;
    color:#243f5d;background:transparent!important;box-shadow:none!important;overflow:visible!important;clip-path:none!important;contain:none!important;
  }
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] td::before {
    content:attr(data-mobile-label);display:block;font-size:11px;font-weight:600;line-height:1.4;color:#58728d;margin-bottom:4px;
  }
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] :is(.rs-cell-text,.hfr-cell-text) {
    display:block!important;white-space:normal!important;overflow:visible!important;clip-path:none!important;contain:none!important;
    width:auto!important;min-width:0!important;max-width:100%!important;overflow-wrap:anywhere!important;
  }
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] td :is(strong,small,span,b) {white-space:normal!important;overflow-wrap:anywhere;max-width:100%;}
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] .ml-card-title {grid-column:1/-1!important;order:-1;border-top:0!important;color:#103d67!important;font-size:15px!important;font-weight:700;}
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] .ml-full-cell {grid-column:1/-1!important;}
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] .ml-card-actions {grid-column:1/-1!important;order:20;display:flex!important;gap:8px;align-items:center;flex-wrap:wrap;}
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] .ml-card-actions::before {display:none;}
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] button {min-width:44px!important;min-height:44px!important;width:auto!important;white-space:normal!important;padding:8px 12px!important;}
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards]:not(.ml-all-fields) td.ml-secondary-cell {display:none!important;}
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] .ml-empty-row {display:block!important;text-align:center!important;}
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] .ml-empty-row td {text-align:center!important;}
  body :is(#moduleView,dialog) .ml-list-table[data-mobile-mode=cards] .ml-empty-row td::before {display:none;}
  body .ml-inactive-grip {display:none!important;}
  /* LOT flow: metadata above an independent, touch-scrollable route. */
  body #moduleView .ml-flow-table[data-mobile-mode=cards] .process-chain-cell {grid-column:1/-1!important;overflow-x:auto!important;overscroll-behavior-x:contain;max-width:100%!important;padding-top:12px!important;}
  body #moduleView .ml-flow-table[data-mobile-mode=cards] .process-chain-cell::before {content:"공정 · 좌우로 밀어서 보기";}
  /* Generic table-child clipping must not contain the route before its scroll cell can. */
  body #moduleView .ml-flow-table[data-mobile-mode=cards] .process-flow-chain {width:max-content!important;min-width:max-content!important;max-width:none!important;overflow:visible!important;gap:16px!important;}
  body #moduleView .ml-flow-table[data-mobile-mode=cards] .process-flow-step {width:140px!important;flex:0 0 140px!important;min-height:60px!important;}
  body #moduleView .ml-flow-table[data-mobile-mode=cards] .process-parallel-list {display:flex!important;gap:8px!important;}
  body #moduleView .process-flow-footer {display:flex!important;flex-wrap:wrap!important;gap:8px!important;padding:12px!important;}
  body #moduleView .process-flow-footer .pager {display:none;}
  body #moduleView .process-legend {flex-wrap:wrap;gap:8px;font-size:12px;}
  body #moduleView .vp-result-workspace {display:block!important;}
  body #moduleView .vp-result-detail {margin-top:12px;max-height:none!important;}
  /* Transpose a selected process into dates x metrics, without any additional requests. */
  .ml-matrix-panel {display:block;padding:12px;background:#f8fbff;}
  .ml-matrix-controls {display:flex;align-items:end;gap:8px;margin-bottom:12px;}
  .ml-matrix-controls label {display:grid;gap:4px;flex:1;min-width:0;font-size:12px;color:#385976;}
  .ml-matrix-controls select {width:100%;min-width:0;min-height:44px;font-size:16px;padding:8px;border:1px solid #c9d9e9;border-radius:8px;background:white;}
  .ml-matrix-summary {font-size:12px;color:#304e6e;margin:6px 0 10px;line-height:1.5;}
  body #moduleView .ml-matrix-hidden {display:none!important;}
  body #moduleView table.ml-date-table {width:100%!important;min-width:0!important;max-width:100%!important;table-layout:fixed!important;border-collapse:collapse;}
  body #moduleView table.ml-date-table :is(th,td) {position:static!important;min-width:0!important;width:auto!important;height:auto!important;white-space:normal!important;word-break:break-word;padding:10px 4px!important;font-size:12px!important;text-align:center!important;border:1px solid #dce7f2!important;}
  body #moduleView table.ml-date-table thead th {background:#194d7c!important;color:white!important;}
  body #moduleView table.ml-date-table tbody th {color:#294f75;background:#eef4fa!important;font-weight:600;}
  body #moduleView table.ml-date-table td {background:white!important;}
  body #moduleView table.ml-date-table .ml-good {color:#138454!important;}
  body #moduleView table.ml-date-table .ml-bad {color:#c63349!important;}
  /* In the editable/full matrix, sticky columns must not cover every date on a phone. */
  body #moduleView .vp-range-table .fixed:not(.metric) {position:static!important;}
  body #moduleView .vp-range-table .fixed.metric {position:sticky!important;left:0!important;z-index:4;}
  body #moduleView .vp-range-table thead .fixed.metric {top:0!important;z-index:5;}
  /* System editor forms: keep inputs readable and actions together. */
  body #moduleView :is(.customer-form,.hfr-product-editor-grid) {display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;}
  body #moduleView :is(.customer-form,.hfr-product-editor-grid) > label {width:auto!important;min-width:0!important;grid-column:auto!important;}
  body #moduleView :is(.customer-form,.hfr-product-editor-grid) > label:has([name=product_name]),
  body #moduleView :is(.customer-form,.hfr-product-editor-grid) > :is(button,.form-actions) {grid-column:1/-1!important;}
  body #moduleView :is(.customer-form,.hfr-product-editor-grid) :is(input:not([type=checkbox]),select) {min-width:0!important;width:100%!important;min-height:44px!important;font-size:16px!important;}
  body #moduleView :is(.customer-form,.hfr-product-editor-grid) button {min-height:44px!important;}
  body #moduleView :is(.system-master-search,.customer-product-search) > button {position:static!important;transform:none!important;margin:0!important;}
  body #moduleView .system-access-toolbar > * {min-width:0!important;max-width:100%!important;}
  body #moduleView .permission-page-tabs {display:flex;gap:4px;flex-wrap:wrap;}
  body #moduleView .permission-page-tabs button {min-height:44px!important;white-space:normal!important;flex:1;}
  body #moduleView .permission-user-select-actions {display:flex;flex-wrap:wrap;gap:4px;}
  body #moduleView .permission-user-select-actions button {min-height:44px!important;}
  body #moduleView :is(.ea-toolbar,.purchase-toolbar) {display:flex!important;flex-wrap:wrap!important;gap:8px!important;min-width:0!important;}
  body #moduleView :is(.ea-toolbar,.purchase-toolbar) :is(button,input,select) {min-height:44px!important;min-width:0!important;}
  body #moduleView :is(.ea-toolbar,.purchase-toolbar) input {flex:1 1 180px!important;width:100%!important;font-size:16px!important;}
  body #moduleView :is(.ea-toolbar,.purchase-toolbar) button {white-space:normal!important;}
  body #moduleView .system-log-filter-actions {display:flex!important;flex-wrap:wrap!important;gap:6px!important;}
  body #moduleView .system-log-filter-actions button {min-height:44px!important;white-space:normal!important;}
  body dialog.vp-process-dialog {width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px)!important;max-height:90dvh!important;}
  body dialog.vp-process-dialog > form {display:flex!important;flex-direction:column!important;height:85dvh!important;max-height:85dvh!important;overflow:hidden!important;gap:0!important;}
  body dialog.vp-process-dialog > form > :is(header,.vp-dialog-metrics,.ml-list-tools,.rs-table-pagination) {flex:0 0 auto!important;}
  body dialog.vp-process-dialog > form > .ml-cards-host {flex:1 1 auto!important;overflow-y:auto!important;overscroll-behavior:contain;min-height:0!important;}
  body dialog.vp-process-dialog .ml-list-tools {padding:6px 8px!important;}
  body dialog.vp-process-dialog .vp-dialog-metrics strong {font-size:20px!important;}
  body dialog.vp-process-dialog .vp-metric {min-height:54px!important;}
  body dialog.vp-process-dialog .vp-dialog-metrics {grid-template-columns:repeat(3,minmax(0,1fr))!important;padding:10px!important;gap:6px!important;}
  body dialog.vp-process-dialog .vp-dialog-metrics > * {min-width:0!important;padding:8px!important;}
  body dialog.vp-process-dialog .vp-dialog-head {padding:14px!important;}
  body dialog.vp-process-dialog .vp-dialog-head button {min-width:44px!important;min-height:44px!important;}
  body .ml-list-table[data-mobile-mode=cards] .vendor-work-order-link {margin:0!important;text-align:left!important;padding-left:0!important;}
}
