.material-tracking-module { min-width:0; max-width:100%; }
.material-tracking-module.panel { padding:0 !important; }
/* POST-080: the worksheet scrolls; its tabs stay at the visible bottom. */
body[data-active-module="material_tracking"],
body[data-active-module="material_tracking"] .app-shell { height:var(--mobile-viewport-height,100dvh); min-height:0; overflow:hidden; }
body[data-active-module="material_tracking"] .content { height:var(--mobile-viewport-height,100dvh); min-height:0; display:flex; flex-direction:column; gap:0; padding-bottom:env(safe-area-inset-bottom,0px); overflow:hidden; }
body[data-active-module="material_tracking"] #materialTrackingPanel.active-panel { display:flex !important; flex-direction:column; flex:1 1 auto; min-height:0; overflow:hidden; }
.material-tracking-module .mt-topbar { flex:none; }
.mt-topbar { width:100%; box-sizing:border-box; min-height:62px; padding:9px 20px; display:flex; align-items:center; gap:12px; color:#fff; background:linear-gradient(105deg,#29487d,#4168ad); border-radius:7px 7px 0 0; }
.mt-topbar h2 { margin:0; font-size:23px; line-height:1.25; color:#fff; white-space:nowrap; }
.mt-topbar p { margin:0; font-size:13px; line-height:1.4; color:#d8e3f7; }
/* Same in-page module fullscreen as production scheduling; body-level pickers remain usable. */
body.material-tracking-fullscreen .app-shell { display:block !important; width:100vw !important; max-width:none !important; }
body.material-tracking-fullscreen .sidebar,
body.material-tracking-fullscreen .content > :not(#materialTrackingPanel) { display:none !important; }
body.material-tracking-fullscreen .content { width:100vw !important; max-width:none !important; padding:0 !important; margin:0 !important; }
body.material-tracking-fullscreen #materialTrackingPanel.active-panel { width:100%; height:var(--mobile-viewport-height,100dvh); max-width:none; margin:0 !important; border:0; border-radius:0; }
body.material-tracking-fullscreen .mt-topbar { border-radius:0; }
.mt-content { padding:clamp(16px,2.4vw,24px) clamp(16px,2.4vw,24px) 0; display:flex; flex-direction:column; flex:1 1 auto; min-height:0; overflow:hidden; }
.mobile-preview .mt-content { padding:10px 12px 0; }
.mt-controls { flex:0 0 auto; min-height:0; max-height:55%; overflow:auto; overscroll-behavior:contain; }
.material-tracking-module button { border:1px solid #d3dfed; border-radius:7px; background:#f2f6fb; color:#31567e; cursor:pointer; padding:8px 14px; }
.material-tracking-module button:disabled { opacity:.5; cursor:default; }
.mt-topbar-actions { margin-left:auto; display:flex; align-items:center; gap:8px; flex:none; }
.material-tracking-module .mt-topbar-actions > button { width:44px; height:44px; display:grid; place-items:center; padding:10px; border:1px solid #ffffff66; border-radius:6px; color:#fff; background:transparent; box-shadow:none; }
.material-tracking-module .mt-topbar-actions > button:hover { background:#ffffff1f; }
.material-tracking-module .mt-topbar-actions > button:focus-visible { outline:2px solid #fff; outline-offset:2px; }
.material-tracking-module .mt-topbar-actions > button:disabled { background:transparent; opacity:.5; }
.mt-topbar-actions svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
#mtFullscreen .mt-collapse-icon,
#mtFullscreen[aria-pressed="true"] .mt-expand-icon { display:none; }
#mtFullscreen[aria-pressed="true"] .mt-collapse-icon { display:initial; }
.material-tracking-module #mtSearch { background:#286fc2; border-color:#286fc2; color:#fff; height:42px; min-width:80px; }
.mt-filters { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:20px; }
.mt-filters[hidden] { display:none; }
.mt-filters h3 { margin:0; font-size:16px; line-height:1.4; color:#233c59; white-space:nowrap; }
.mt-date-range { display:flex; align-items:center; gap:12px; flex:none; min-width:0; }
.mt-date-item { display:flex; align-items:center; gap:6px; }
.mt-date-item label { font-size:13px; color:#526277; white-space:nowrap; }
.mt-date-field { position:relative; width:140px; flex:none; }
.mt-date-field input { width:100%; min-width:0; height:40px; box-sizing:border-box; border:1px solid #d6dfe9; border-radius:7px; padding:8px 30px 8px 9px; background:#fff; color:#152a43; font-size:14px; font-variant-numeric:tabular-nums; }
.material-tracking-module .mt-date-open { position:absolute; right:1px; top:1px; display:grid; place-items:center; width:30px; height:38px; padding:5px; border:0; background:transparent; }
.mt-date-open svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.7; }
.material-tracking-module #mtSearch { min-width:64px; height:40px; padding:8px 12px; }
.mt-filters :focus-visible { outline:2px solid #286fc2; outline-offset:2px; }
.mt-calendar { position:fixed; z-index:10020; width:302px; max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); overflow:auto; box-sizing:border-box; padding:12px; background:#fff; color:#213950; border:1px solid #c4d3e4; border-radius:8px; box-shadow:0 8px 28px #17345133; font-size:14px; }
.mt-calendar[hidden] { display:none; }
.mt-calendar button { border:0; border-radius:4px; background:#fff; color:inherit; padding:4px; min-width:0; cursor:pointer; font:inherit; }
.mt-calendar button:hover { background:#edf4fc; }
.mt-calendar button:disabled { opacity:.4; cursor:default; }
.mt-calendar :focus-visible { outline:2px solid #286fc2; outline-offset:-2px; }
.mt-calendar-title { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.mt-calendar-title button { width:32px; height:32px; font-size:22px; }
.mt-calendar-month { display:flex; align-items:center; justify-content:space-between; gap:3px; margin-bottom:8px; }
.mt-calendar-month button { width:30px; height:36px; font-size:24px; }
.mt-calendar-month input,.mt-calendar-month select { width:72px; min-width:0; padding:5px 2px; height:34px; border:1px solid #d6dfe9; border-radius:4px; color:inherit; background:#fff; font:inherit; box-sizing:border-box; }
.mt-calendar-month select { width:64px; }
.mt-calendar-week,.mt-calendar-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); text-align:center; gap:2px; }
.mt-calendar-week span { padding:4px 0; color:#6e8093; font-size:12px; }
.mt-calendar-days button { height:36px; font-variant-numeric:tabular-nums; }
.mt-calendar-days .is-adjacent { color:#95a2b0; }
.mt-calendar-days .is-in-range { background:#eef4fc; }
.mt-calendar-days [aria-current="date"] { box-shadow:inset 0 0 0 1px #5784bb; }
.mt-calendar-days .is-selected { background:#286fc2; color:#fff; }
.mt-calendar-ranges { display:flex; gap:8px; border-top:1px solid #e1e8ef; margin-top:10px; padding-top:10px; }
.mt-calendar-ranges button { flex:1; min-height:38px; background:#edf4fc; color:#245e9c; }
.mt-calendar-footer { display:flex; justify-content:space-between; margin-top:6px; }
.mt-calendar-footer button { min-height:34px; padding:5px 8px; color:#286fc2; }
.mt-message { color:#66788b; font-size:13px; line-height:1.6; }
.mt-error { padding:10px; background:#fff1f0; color:#a52921; border-radius:7px; margin:8px 0; white-space:pre-wrap; }
/* POST-081: keep query state internally without displaying the three notice rows. */
#materialTrackingPanel #mtMessage,
#materialTrackingPanel #mtError,
#materialTrackingPanel #mtFilterSummary { display:none !important; }
.mt-grid-tools { display:flex; align-items:center; gap:12px; min-height:0; margin-bottom:0; font-size:12px; color:#62758a; flex-wrap:wrap; }
.mt-grid-tools button { font-size:12px; padding:4px 10px; margin-bottom:6px; }
.mt-table-wrap { width:100%; flex:1 1 0; min-height:0; overflow:auto; border:1px solid var(--st-grid); border-radius:0; overscroll-behavior:contain; scrollbar-gutter:stable; container-type:inline-size; }
.mt-table { --mt-order:82px; --mt-salesperson:72px; --mt-code:104px; --mt-quantity:72px; --mt-date:74px; --mt-workshop:78px; --mt-status:92px; --mt-reserved:44px; width:100%; min-width:0; table-layout:fixed; border-collapse:separate; border-spacing:0; font-family:var(--st-font-family); font-size:14px; color:var(--st-ink); }
.mt-col-order { width:var(--mt-order); }
.material-tracking-module .mt-order-link { appearance:none; display:inline; width:auto!important; min-width:0!important; max-width:100%!important; height:auto!important; min-height:0!important; margin:0; padding:0!important; border:0!important; border-radius:0!important; box-shadow:none!important; color:inherit!important; background:transparent!important; font:inherit!important; font-weight:inherit!important; line-height:inherit; text-decoration:none; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer; }
.material-tracking-module .mt-order-link:hover { color:inherit!important; background:transparent!important; text-decoration:underline; text-underline-offset:2px; }
.material-tracking-module .mt-order-link:focus-visible { outline:2px solid #4775cb; outline-offset:2px; border-radius:2px; }
.mt-col-select { width:30px; }
.mt-col-salesperson { width:var(--mt-salesperson); }
.mt-col-code { width:var(--mt-code); }
.mt-col-quantity { width:var(--mt-quantity); }
.mt-col-date,.mt-col-order-date,.mt-col-delivery { width:var(--mt-date); }
.mt-table[data-sheet="automatic"] .mt-col-date { width:86px; }
.mt-table[data-sheet="automatic"] .mt-col-order-date,
.mt-table[data-sheet="automatic"] .mt-col-delivery { width:78px; }
.mt-col-workshop { width:var(--mt-workshop); }
.mt-col-status { width:var(--mt-status); }
.mt-col-reserved { width:var(--mt-reserved); }
.mt-table th,.mt-table td { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; padding:3px 4px; border-bottom:1px solid var(--st-grid); border-right:1px solid var(--st-grid); text-align:center; vertical-align:middle; font-size:var(--st-body-font); line-height:var(--st-body-line); height:var(--st-row-height); box-sizing:border-box; }
.mt-table th { position:sticky; top:0; background:var(--st-head-bg); color:var(--st-head-ink); z-index:2; height:var(--st-head-height); line-height:var(--st-head-line); padding-right:24px; padding-left:4px; font-size:var(--st-head-font); font-weight:700; }
.mt-table th:last-child,.mt-table td:last-child { border-right:0; }
.mt-table th.mt-reserved { padding-right:4px; }
.mt-table tbody td { background:#fff; }
.mt-table tbody tr:hover td { background:#f8faff; }
.mt-table th.mt-select-heading,.mt-table td.mt-select-cell { padding:0!important; overflow:visible; text-overflow:clip; }
.mt-table th.mt-select-heading { z-index:3; }
.mt-table .mt-select-heading input,.mt-table .mt-select-cell input {
  display:block;
  width:16px;
  height:16px;
  margin:auto;
  accent-color:#286fc2;
  cursor:pointer;
}
.mt-table .mt-select-heading input:disabled,.mt-table .mt-select-cell input:disabled { cursor:default; opacity:.55; }
.mt-table tbody tr.mt-row-selected>td { background:#eef5ff; }
.mt-table tbody tr.mt-row-selected:hover>td { background:#e5efff; }
.mt-table tbody td[data-column="name"] { text-align:left; }
.mt-heading { display:block; min-width:0; overflow:hidden; text-overflow:ellipsis; }
.mt-table .mt-filter-button { position:absolute; top:50%; right:4px; display:inline-grid; place-items:center; width:var(--st-filter-size); height:var(--st-filter-size); min-width:0; font-family:var(--st-font-family); font-size:var(--st-filter-font); font-weight:700; line-height:var(--st-head-line); padding:0; transform:translateY(-50%); border:0; border-radius:2px; background:#fff; color:#24704f; box-shadow:none; }
.mt-filter-button svg { width:14px; height:14px; fill:currentColor; }
.mt-table .mt-filter-button:hover,.mt-table .mt-filter-button.is-filtered,.mt-table th[aria-sort]:not([aria-sort="none"]) .mt-filter-button { background:#1b7452; color:#fff; }
.mt-table th[aria-sort="ascending"] .mt-heading>span::after { content:' ↑'; color:#1b7452; }
.mt-table th[aria-sort="descending"] .mt-heading>span::after { content:' ↓'; color:#1b7452; }
.mt-table .mt-number { text-align:center; font-variant-numeric:tabular-nums; }
.mt-table .mt-empty { text-align:center; color:#77889b; padding:40px; }
.mt-badge { display:inline-block; padding:3px 8px; border-radius:4px; background:#eef1f5; color:#66768a; font-size:var(--st-body-font); }
.mt-badge:is([data-status="未采购"],[data-status="未审核"],[data-status="未入库"]) { background:#fff0ed; color:#b83423; }
.mt-badge[data-status="库存够用"] { background:#eaf2ff; color:#2166b6; }
.mt-badge[data-status="已领足"] { background:#e7f6ee; color:#237348; }
.mt-badge[data-status="查询失败"] { background:#fff0ed; color:#b83423; }
.mt-overdue { color:#b83423; font-weight:600; }
.mt-sheet-foot { min-width:0; min-height:var(--st-footer-height); display:flex; flex:none; align-items:center; gap:12px; overflow:hidden; color:#6b7890; background:#fff; font-size:12px; padding:0 11px var(--st-footer-bottom) 0; }
/* POST-145/153: wide screens keep all four tabs visible; narrow screens scroll the tab strip itself. */
.mt-sheet-tabs { min-width:0; max-width:100%; height:var(--st-tabs-height); display:flex; flex:0 0 auto; align-items:end; gap:2px; overflow-x:auto; overflow-y:hidden; background:#e4e8ef; }
.material-tracking-module .mt-sheet-tab { flex:none; min-width:112px; height:var(--st-tab-height); font-size:var(--st-tab-font); padding:0 15px; border:1px solid #aebbd0; border-bottom:0; border-radius:0; color:#31569f; border-top:3px solid var(--st-tab-green); background:#fff; font-weight:700; white-space:nowrap; }
.material-tracking-module .mt-sheet-tab:not(.active) { border-top-color:#aebbd0; background:#dfe5ed; color:#68778d; }
.material-tracking-module .mt-sheet-tab:focus-visible { outline:2px solid #286fc2; outline-offset:-2px; }
.mt-sheet-tab b { min-width:20px; margin-left:4px; padding:1px 5px; display:inline-block; border-radius:99px; background:#dce4f1; font-size:11px; }
#mtSummary { flex:none; white-space:nowrap; }
/* POST-153: only the result time and remaining review count follow the tabs. */
.mt-sheet-status { min-width:0; height:var(--st-tabs-height); flex:1 1 auto; display:flex; align-items:center; gap:12px; overflow-x:auto; overflow-y:hidden; white-space:nowrap; overscroll-behavior:contain; }
.mt-sheet-status > span { flex:none; }
.mt-sheet-status:focus-visible { outline:2px solid #286fc2; outline-offset:-2px; }
@media (max-width:900px) {
  .mt-sheet-foot { min-height:calc(var(--st-footer-height) + 24px); flex-wrap:wrap; gap:0; padding-right:0; }
  .mt-sheet-tabs { flex:0 0 100%; }
  .mt-sheet-status { flex:0 0 100%; height:24px; padding:0 8px; }
}
.mt-column-popup { position:fixed; z-index:10000; width:288px; max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); box-sizing:border-box; padding:12px; border:1px solid #afc3da; border-radius:6px; background:#fff; color:#263c52; box-shadow:0 8px 28px #17345133; font-size:13px; display:flex; flex-direction:column; gap:10px; }
.mt-column-popup[hidden] { display:none; }
.mt-popup-title { font-weight:600; }
.mt-popup-sort,.mt-popup-footer { display:flex; gap:6px; }
.mt-popup-footer { justify-content:flex-end; border-top:1px solid #e1e8ef; padding-top:10px; }
.mt-column-popup button { min-height:34px; padding:5px 9px; border:1px solid #c7d4e3; border-radius:3px; background:#f5f8fc; color:#31567e; font:inherit; cursor:pointer; }
.mt-column-popup [data-apply] { color:#fff; background:#286fc2; border-color:#286fc2; }
.mt-column-popup .mt-value-search { width:100%; box-sizing:border-box; min-height:36px; padding:7px 9px; border:1px solid #c7d4e3; border-radius:3px; color:#263c52; font:inherit; }
.mt-value-list { max-height:220px; min-height:40px; flex:1 1 auto; overflow:auto; border:1px solid #e1e8ef; overscroll-behavior:contain; }
.mt-column-popup label { display:flex; align-items:center; gap:8px; min-height:34px; padding:4px 6px; cursor:pointer; box-sizing:border-box; }
.mt-column-popup input[type="checkbox"] { appearance:auto; flex:none; width:16px; height:16px; margin:0; accent-color:#286fc2; }
.mt-value-list label:hover { background:#edf4fc; }
.mt-value-list span { overflow-wrap:anywhere; min-width:0; }
.mt-no-values { padding:8px; color:#7c8b9d; }
.mt-filter-button:focus-visible,.mt-column-popup :focus-visible { outline:2px solid #286fc2; outline-offset:2px; }
@media(pointer:coarse) {
  .mt-table .mt-filter-button::before { content:''; position:absolute; inset:-8px; }
  .mt-column-popup button,.mt-column-popup label { min-height:40px; }
  .mt-column-popup .mt-value-search { font-size:16px; }
}
@media(max-width:600px) {
  .mt-content,.mobile-preview .mt-content { padding:14px 14px 0; }
  .mt-topbar { min-height:70px; padding:8px 14px; display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"title actions" "subtitle subtitle"; align-items:center; gap:3px 8px; }
  .mt-topbar h2 { font-size:18px; }
  .mt-topbar p { font-size:12px; }
  .mt-topbar h2 { grid-area:title; }
  .mt-topbar p { grid-area:subtitle; }
  .mt-topbar-actions { grid-area:actions; }
  .material-tracking-module .mt-topbar-actions > button { width:44px; height:44px; padding:10px; }
  .mt-filters { display:flex; gap:12px; }
  .mt-filters h3 { width:100%; font-size:16px; }
  .mt-date-range { flex-direction:column; align-items:flex-start; gap:10px; }
  .mt-date-item label { font-size:14px; }
  .mt-date-field { width:148px; }
  .mt-date-field input { font-size:16px; height:44px; }
  .material-tracking-module .mt-date-open { height:42px; }
  .material-tracking-module #mtSearch { align-self:flex-end; height:44px; }
  .mt-filters>#mtCancel { min-height:44px; }
}

body.mobile-preview.mobile-phone .mt-table th,body.mobile-preview.mobile-phone .mt-table td { padding-top:2px; padding-bottom:2px; }
.mt-table td .mt-status-query { margin-left:6px; }
.mt-sheet-foot { font-family:var(--st-tab-font-family); }
.material-tracking-module .mt-topbar { position:relative; }
/* POST-089: only the material name grows; compact columns follow available table width. */
@container (max-width:900px) {
  .mt-table { --mt-order:72px; --mt-salesperson:62px; --mt-code:88px; --mt-quantity:62px; --mt-date:70px; --mt-workshop:72px; --mt-status:78px; --mt-reserved:36px; }
  .mt-table th { padding-right:22px; padding-left:3px; }
  .mt-table th.mt-reserved { padding-left:2px; padding-right:2px; }
  .mt-badge { padding-left:4px; padding-right:4px; }
  .mt-table td .mt-status-query { margin-left:4px; }
}
body.mobile-preview.mobile-phone .mt-table { --mt-order:90px; --mt-salesperson:72px; --mt-code:112px; --mt-quantity:84px; --mt-date:84px; --mt-workshop:90px; --mt-status:128px; --mt-reserved:44px; min-width:900px; }

/* POST-104: dates are assistant-owned replies; keep scheduling typography and row height. */
.mt-table { min-width:840px; }
.mt-table[data-sheet="automatic"] { min-width:0; }
.mt-col-reply { width:140px; }
.mt-table[data-sheet="automatic"] .mt-col-reply { width:90px; }
.mt-table .mt-reply-date { width:100%; min-width:0; height:calc(var(--st-row-height) - 8px); min-height:0; box-sizing:border-box; padding:1px 3px; font-family:var(--st-font-family); font-size:var(--st-body-font); line-height:var(--st-body-line); color:var(--st-ink); border:1px solid #becce2; border-radius:4px; background:#fff; box-shadow:none; }
.mt-table .mt-reply-date:disabled { opacity:.65; }
@container(max-width:900px) {
  .mt-col-reply { width:132px; }
  .mt-table[data-sheet="automatic"] { min-width:960px; }
}
/* POST-108: phone only; every business column remains in a <= 2 viewport-width table. */
.mt-reply-editor { display:block; position:relative; }
.mt-reply-editor .mt-reply-date { display:block; }
.mt-reply-short { display:none; }
body.mobile-preview.mobile-phone .mt-table { width:200%; min-width:0; --mt-order:54px; --mt-salesperson:46px; --mt-code:58px; --mt-quantity:40px; --mt-date:48px; --mt-workshop:42px; --mt-status:64px; --mt-reserved:26px; }
body.mobile-preview.mobile-phone .mt-col-reply { width:66px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-order { width:54px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-salesperson { width:44px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-order-date,
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-delivery,
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-date { width:42px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-code { width:52px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-quantity { width:34px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-status { width:48px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-reply { width:54px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-operation,
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-note { width:40px; }
body.mobile-preview.mobile-phone .mt-table th { padding:1px 16px 1px 1px; }
body.mobile-preview.mobile-phone .mt-table .mt-heading>span { display:block; max-height:28px; overflow:hidden; white-space:normal; line-height:14px; overflow-wrap:anywhere; }
body.mobile-preview.mobile-phone .mt-table th[aria-sort] .mt-heading>span::after { display:none; }
body.mobile-preview.mobile-phone .mt-table th.mt-reserved { padding:1px; white-space:normal; line-height:14px; }
body.mobile-preview.mobile-phone .mt-table .mt-filter-button { right:1px; }
body.mobile-preview.mobile-phone .mt-table td { padding:2px; }
body.mobile-preview.mobile-phone .mt-table .mt-badge { padding:1px; }
body.mobile-preview.mobile-phone .mt-table .mt-purchase { padding:0 2px; }
body.mobile-preview.mobile-phone .mt-table .mt-status-query { width:18px; min-width:18px; padding:0; margin-left:2px; }
body.mobile-preview.mobile-phone .mt-reply-editor { height:27px; border:1px solid #becce2; border-radius:4px; }
body.mobile-preview.mobile-phone .mt-table .mt-reply-date { position:absolute; inset:0; width:100%; height:100%; opacity:0; padding:0; z-index:1; cursor:pointer; }
body.mobile-preview.mobile-phone .mt-reply-short { display:flex; height:100%; align-items:center; justify-content:center; gap:1px; white-space:nowrap; font:inherit; }
body.mobile-preview.mobile-phone .mt-reply-short svg { flex:none; width:10px; height:10px; fill:none; stroke:currentColor; stroke-width:1.2; }
body.mobile-preview.mobile-phone .mt-reply-editor:focus-within { outline:2px solid #286fc2; outline-offset:1px; }
body.mobile-preview.mobile-phone [data-mt-full-value]:focus-visible { outline:2px solid #286fc2; outline-offset:-2px; }
.mt-cell-detail { width:min(360px,calc(100vw - 24px)); max-height:calc(100dvh - 32px); padding:14px; box-sizing:border-box; border:1px solid #becce2; border-radius:6px; color:#263c52; background:#fff; }
.mt-cell-detail::backdrop { background:#172b4d66; }
.mt-cell-detail>div { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.mt-cell-detail button { width:36px; height:36px; padding:0; font-size:24px; border:1px solid #becce2; border-radius:4px; background:#f5f8fc; color:#31567e; }
.mt-cell-detail p { margin:12px 0 0; font-size:15px; line-height:1.6; overflow-wrap:anywhere; white-space:pre-wrap; }
/* POST-109: replace the two reserved columns without changing scheduling row metrics. */
.mt-col-operation { width:62px; }
.mt-col-note { width:90px; }
.mt-table td.mt-note-cell { text-align:left; cursor:pointer; }
.mt-note-cell,.mt-operation { position:relative; }
.mt-has-note::after,.mt-has-urge::after { content:''; position:absolute; top:1px; right:1px; border-top:6px solid #c78028; border-left:6px solid transparent; }
.mt-note-cell:focus-visible { outline:2px solid #286fc2; outline-offset:-2px; }
.mt-note-editor { width:min(480px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); padding:16px; box-sizing:border-box; border:1px solid #becce2; border-radius:6px; background:#fff; color:#263c52; font:14px 'Microsoft YaHei',sans-serif; }
.mt-note-editor::backdrop { background:#172b4d66; }
.mt-note-heading,.mt-note-actions { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.mt-note-editor p { margin:8px 0; line-height:1.5; overflow-wrap:anywhere; white-space:pre-wrap; }
.mt-note-editor textarea { display:block; box-sizing:border-box; width:100%; margin:6px 0; padding:8px; border:1px solid #becce2; border-radius:4px; font:16px/1.5 'Microsoft YaHei',sans-serif; resize:vertical; }
.mt-note-editor [data-note-history] { min-height:120px; background:#f5f7fb; color:#52647a; }
.mt-note-editor button { min-height:36px; padding:6px 12px; border:1px solid #869cd0; border-radius:5px; background:#fff; color:#31569f; font:700 14px 'Microsoft YaHei',sans-serif; cursor:pointer; }
.mt-note-editor [data-note-save] { background:#476ebd; color:#fff; }
.mt-note-editor [data-note-close] { padding:0; width:36px; font-size:24px; }
.mt-note-actions { justify-content:flex-end; }
.mt-note-editor [data-note-latest],.mt-note-editor [data-note-message] { color:#9e422d; }
.mt-note-editor [hidden] { display:none!important; }
.mt-note-editor button:disabled { opacity:.6; cursor:default; }
@container(max-width:900px) { .mt-col-operation { width:58px; } .mt-col-note { width:72px; } }
body.mobile-preview.mobile-phone .mt-col-operation,body.mobile-preview.mobile-phone .mt-col-note { width:44px; }
body.mobile-preview.mobile-phone .mt-table .mt-urge { padding:0 7px; }

/* POST-110/111: one status action; empty reply is readable on every terminal. */
.mt-table td .mt-status-query { margin-left:0; }
.mt-table .mt-status-query:is([data-status="未采购"],[data-status="未审核"],[data-status="未入库"]) { color:#b83423; }
.mt-table .mt-status-query[data-query-failed] { border-style:dashed; }
.mt-table .mt-reply-unhandled { color:#b83423; }
.mt-reply-unhandled .mt-reply-editor { height:calc(var(--st-row-height) - 8px); border:1px solid #becce2; border-radius:4px; box-sizing:border-box; }
.mt-table .mt-reply-unhandled .mt-reply-date { position:absolute; inset:0; width:100%; height:100%; opacity:0; z-index:1; cursor:pointer; }
.mt-reply-unhandled .mt-reply-short { display:flex; height:100%; align-items:center; justify-content:center; gap:3px; font:inherit; }
.mt-reply-unhandled .mt-reply-short svg { flex:none; width:12px; height:12px; fill:none; stroke:currentColor; stroke-width:1.2; }
.mt-reply-unhandled .mt-reply-editor:focus-within { outline:2px solid #286fc2; outline-offset:1px; }
body.mobile-preview.mobile-phone .mt-table { --mt-status:62px; }
body.mobile-preview.mobile-phone .mt-col-reply { width:84px; }
body.mobile-preview.mobile-phone .mt-table .mt-status-query { width:auto; min-width:0; max-width:100%; padding:0 2px; margin-left:0; }
body.mobile-preview.mobile-phone .mt-reply-unhandled .mt-reply-short { gap:0; }
body.mobile-preview.mobile-phone .mt-reply-unhandled .mt-reply-short svg { display:none; }
/* A new urge can be answered explicitly with an already-filled date, without clearing it first. */
.mt-reply-needs-confirm { padding-right:20px; }
.mt-table .mt-reply-confirm { position:absolute; right:0; top:0; height:100%; width:18px; min-height:0; padding:0; border:1px solid #849ad0; border-radius:3px; background:#fff; color:#355998; font:inherit; cursor:pointer; }
body.mobile-preview.mobile-phone .mt-reply-needs-confirm .mt-reply-date { width:calc(100% - 20px); }
body.mobile-preview.mobile-phone .mt-reply-needs-confirm .mt-reply-short svg { display:none; }
/* Explicit purchase signature: keep urgency until the separate receipt commits. */
#mtRows tr.mt-purchase-urgent > td {
  background: #821f28 !important;
  color: #fff !important;
  animation: mt-purchase-urge-pulse 4s ease-in-out infinite;
}
#mtRows tr.mt-purchase-urgent > td button,
#mtRows tr.mt-purchase-urgent > td input,
#mtRows tr.mt-purchase-urgent > td .mt-reply-short {
  color: #fff !important;
  background: transparent !important;
  border-color: #f3c8cd !important;
}
#mtRows tr.mt-purchase-urgent > td svg { stroke: #fff !important; }
@keyframes mt-purchase-urge-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
}
@media (prefers-reduced-motion: reduce) {
  #mtRows tr.mt-purchase-urgent > td { animation: none; }
}

/* POST-180: row context actions use one compact system menu on all four sheets. */
.mt-row-context-menu {
  position:fixed;
  z-index:100000;
  min-width:132px;
  padding:5px;
  border:1px solid #aebbd0;
  border-radius:6px;
  background:#fff;
  box-shadow:0 8px 24px rgba(24,45,80,.22);
  font-family:var(--st-font-family,'Microsoft YaHei',sans-serif);
}
.mt-row-context-menu[hidden],.mt-row-context-menu button[hidden] { display:none!important; }
.mt-row-context-menu button {
  display:block;
  width:100%;
  min-height:36px;
  padding:6px 12px;
  border:0;
  border-radius:4px;
  background:#fff;
  color:#263c52;
  text-align:left;
  font:700 14px/1.4 var(--st-font-family,'Microsoft YaHei',sans-serif);
  cursor:pointer;
}
.mt-row-context-menu button:hover,.mt-row-context-menu button:focus-visible {
  outline:0;
  background:#eaf1fb;
  color:#244f9b;
}
.mt-row-context-menu button[data-mt-row-action="cancel"] { color:#9e422d; }
.mt-row-context-menu button:disabled { opacity:.55; cursor:default; }
#mtRows tr.mt-row-querying>td { background:#eef5ff; }
#mtRows tr.mt-row-querying>td:first-child { box-shadow:inset 3px 0 #4d73bd; }
/* POST-120: keep the scheduling metrics, give only the released width to the name. */
@container(max-width:1200px) {
  .mt-table { --mt-status:87px; }
  .mt-col-reply { width:108px; }
  /* Keep every automatic worksheet column visible on tablet landscape after
     adding the selection column.  Remarks remain readable through their
     existing full-value interaction, so this is the safest width to release. */
  .mt-table[data-sheet="automatic"] .mt-col-note { width:60px; }
  .mt-reply-editor { height:calc(var(--st-row-height) - 8px); border:1px solid #becce2; border-radius:4px; box-sizing:border-box; }
  .mt-table .mt-reply-date { position:absolute; inset:0; width:100%; height:100%; opacity:0; padding:0; z-index:1; cursor:pointer; }
  .mt-reply-short { display:flex; height:100%; align-items:center; justify-content:center; gap:2px; white-space:nowrap; font:inherit; }
  .mt-reply-short svg { flex:none; width:10px; height:10px; fill:none; stroke:currentColor; stroke-width:1.2; }
  .mt-reply-editor:focus-within { outline:2px solid #286fc2; outline-offset:1px; }
  .mt-reply-needs-confirm .mt-reply-date { width:calc(100% - 20px); }
}
/* Purchase reply owns the current urge-cycle state. Rebalance the phone-only
   material-status/reply pair without increasing the two-screen table width. */
body.mobile-preview.mobile-phone .mt-table { --mt-status:73px; }
body.mobile-preview.mobile-phone .mt-col-reply { width:76px; }
.mt-table [data-mt-followup] { white-space:nowrap; }
/* Wide screens keep compact status/reply columns, complete values and the
   released note width. */
@container (min-width:1201px) {
  .mt-table { --mt-status:87px; }
  .mt-col-reply { width:108px; }
  .mt-col-note { width:158px; }
  .mt-reply-editor { height:calc(var(--st-row-height) - 8px); border:1px solid #becce2; border-radius:4px; box-sizing:border-box; }
  .mt-table .mt-reply-date { position:absolute; inset:0; width:100%; height:100%; opacity:0; padding:0; z-index:1; cursor:pointer; }
  .mt-reply-short { display:flex; height:100%; align-items:center; justify-content:center; gap:2px; white-space:nowrap; font:inherit; }
  .mt-reply-short svg { flex:none; width:10px; height:10px; fill:none; stroke:currentColor; stroke-width:1.2; }
  .mt-reply-editor:focus-within { outline:2px solid #286fc2; outline-offset:1px; }
  .mt-reply-needs-confirm .mt-reply-date { width:calc(100% - 20px); }
}

/* POST-181: every worksheet header stays complete.  The filter owns its own
   grid track so short labels never disappear behind it; labels may use two
   lines while the body keeps the accepted compact column widths. */
.mt-table { --mt-date:80px; }
.mt-table[data-sheet="automatic"] .mt-col-date { width:92px; }
.mt-table[data-sheet="automatic"] .mt-col-order-date,
.mt-table[data-sheet="automatic"] .mt-col-delivery { width:80px; }
.mt-table th { padding-left:3px; padding-right:3px; }
.mt-table th.mt-reserved { padding-left:3px; padding-right:3px; }
.mt-table .mt-heading {
  display:grid;
  grid-template-columns:minmax(0,1fr) var(--st-filter-size);
  align-items:center;
  column-gap:3px;
  width:100%;
  height:100%;
  min-width:0;
  overflow:visible;
  text-overflow:clip;
}
.mt-table .mt-heading > span {
  display:block;
  min-width:0;
  max-width:100%;
  overflow:visible;
  text-overflow:clip;
  white-space:normal;
  overflow-wrap:anywhere;
  text-align:center;
}
.mt-table .mt-filter-button {
  position:static;
  right:auto;
  top:auto;
  justify-self:end;
  transform:none;
}
@container (max-width:900px) {
  .mt-table { --mt-date:74px; }
}
body.mobile-preview.mobile-phone .mt-table {
  --mt-order:50px;
  --mt-code:52px;
  --mt-quantity:36px;
  --mt-date:50px;
  --mt-workshop:50px;
  --mt-status:64px;
}
body.mobile-preview.mobile-phone .mt-col-select { width:18px; }
body.mobile-preview.mobile-phone .mt-col-reply { width:72px; }
body.mobile-preview.mobile-phone .mt-col-operation,
body.mobile-preview.mobile-phone .mt-col-note { width:40px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-order { width:50px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-salesperson { width:50px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-code { width:42px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-quantity { width:32px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-status { width:50px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-reply { width:46px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-date { width:64px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-order-date,
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-delivery { width:50px; }
body.mobile-preview.mobile-phone .mt-table th,
body.mobile-preview.mobile-phone .mt-table th.mt-reserved { padding:1px; }
body.mobile-preview.mobile-phone .mt-table .mt-heading { column-gap:1px; }

/* POST-286: readable phone columns replace POST-108's two-screen width cap.
   Keep the shared scheduling typography, row metrics and all business columns. */
body.mobile-preview.mobile-phone .mt-content { padding:6px 0 0; }
body.mobile-preview.mobile-phone .mt-topbar {
  display:flex; min-height:52px; padding:4px 8px; gap:8px;
}
body.mobile-preview.mobile-phone .mt-topbar h2 { font-size:16px; }
body.mobile-preview.mobile-phone .mt-topbar p { display:none; }
body.mobile-preview.mobile-phone .mt-topbar-actions { gap:4px; }
body.mobile-preview.mobile-phone .mt-controls { padding:0 8px; }
body.mobile-preview.mobile-phone .mt-filters { margin-bottom:8px; gap:8px; }
body.mobile-preview.mobile-phone .mt-table-wrap { scrollbar-gutter:auto; }
body.mobile-preview.mobile-phone .mt-table {
  --mt-phone-width:1120px; width:var(--mt-phone-width); min-width:100%;
  --mt-order:92px; --mt-salesperson:72px; --mt-code:100px;
  --mt-quantity:88px; --mt-date:90px; --mt-workshop:90px; --mt-status:88px;
}
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] { --mt-phone-width:1224px; width:var(--mt-phone-width); min-width:100%; }
body.mobile-preview.mobile-phone .mt-table .mt-col-name { width:220px; }
body.mobile-preview.mobile-phone .mt-table .mt-col-select { width:32px; }
body.mobile-preview.mobile-phone .mt-table .mt-col-reply { width:110px; }
body.mobile-preview.mobile-phone .mt-table .mt-col-operation { width:64px; }
body.mobile-preview.mobile-phone .mt-table .mt-col-note { width:106px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-order { width:92px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-salesperson { width:72px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-code { width:100px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-quantity { width:88px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-date { width:100px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-order-date,
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-delivery { width:90px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-status { width:88px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-reply { width:100px; }
body.mobile-preview.mobile-phone .mt-table[data-sheet="automatic"] .mt-col-note { width:152px; }
body.mobile-preview.mobile-phone .mt-table th,
body.mobile-preview.mobile-phone .mt-table th.mt-reserved { padding:2px 5px; }
body.mobile-preview.mobile-phone .mt-table td { padding:2px 6px; }
/* A colspan empty/error message must remain readable in the first viewport. */
body.mobile-preview.mobile-phone .mt-table td.mt-empty {
  text-align:left; white-space:normal; overflow-wrap:anywhere; height:auto;
  padding:16px max(12px,calc(var(--mt-phone-width) - 100vw + 36px)) 16px 12px;
}
body.mobile-preview.mobile-phone .mt-table .mt-heading { column-gap:4px; }
body.mobile-preview.mobile-phone .mt-table .mt-heading > span {
  max-height:none; white-space:nowrap; overflow-wrap:normal;
}
body.mobile-preview.mobile-phone .mt-table th[data-column="replyDate"] .mt-heading > span {
  white-space:normal;
}
body.mobile-preview.mobile-phone .mt-sheet-foot {
  flex-direction:column; align-items:stretch; flex-wrap:nowrap;
  gap:0; padding:0 0 env(safe-area-inset-bottom,0px); min-height:0;
}
body.mobile-preview.mobile-phone .mt-sheet-tabs { flex:0 0 var(--st-tabs-height); width:100%; }
body.mobile-preview.mobile-phone .mt-sheet-tab { padding-left:10px; padding-right:10px; }
body.mobile-preview.mobile-phone .mt-sheet-status {
  flex:0 1 auto; width:100%; height:auto; min-height:24px; max-height:64px;
  display:flex; flex-direction:column; align-items:stretch; gap:2px;
  padding:4px 8px; box-sizing:border-box; overflow-x:hidden; overflow-y:auto;
  white-space:normal; line-height:18px;
}
body.mobile-preview.mobile-phone .mt-sheet-status > span { white-space:normal; overflow-wrap:anywhere; }
body.mobile-preview.mobile-phone #mtSummary { font-variant-numeric:tabular-nums; }

/* POST-290: phones use the existing home/module navigation, not two headers.
   The duplicate desktop refresh remains bound to the same operation. */
#mtMobileRefresh { display:none; }
body.mobile-preview.mobile-phone[data-active-module="material_tracking"] #mtMobileRefresh {
  display:grid; margin-left:auto; padding:8px; box-shadow:none;
}
body.mobile-preview.mobile-phone #mtMobileRefresh:disabled { opacity:.5; cursor:default; }
body.mobile-preview.mobile-phone .mt-topbar { display:none; }
body.mobile-preview.mobile-phone .mt-filters {
  display:grid; grid-template-columns:minmax(0,1fr) 48px; gap:8px 6px;
}
body.mobile-preview.mobile-phone .mt-filters[hidden] { display:none; }
body.mobile-preview.mobile-phone .mt-filters h3 { grid-column:1 / -1; font-size:15px; }
body.mobile-preview.mobile-phone .mt-date-range {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px;
  width:100%; min-width:0;
}
body.mobile-preview.mobile-phone .mt-date-item { position:relative; min-width:0; }
body.mobile-preview.mobile-phone .mt-date-field { width:100%; min-width:0; }
body.mobile-preview.mobile-phone .mt-date-field input {
  height:40px; padding:8px 25px 8px 5px; font-size:13px; letter-spacing:0;
}
body.mobile-preview.mobile-phone .mt-date-field input::placeholder { color:transparent; }
body.mobile-preview.mobile-phone .mt-date-item label {
  position:absolute; z-index:1; left:6px; top:50%; transform:translateY(-50%);
  margin:0; padding:0; font-size:13px; font-weight:400; pointer-events:none;
}
body.mobile-preview.mobile-phone .mt-date-item:has(input:not(:placeholder-shown)) label { visibility:hidden; }
body.mobile-preview.mobile-phone .material-tracking-module .mt-date-open {
  width:24px; height:38px; padding:3px;
}
body.mobile-preview.mobile-phone .material-tracking-module #mtSearch {
  width:48px; min-width:0; height:40px; margin:0; padding:8px 4px; font-size:13px;
}
