/* Touch-first preventive areas and expandable work orders, mobile only. */
@media (max-width: 700px) {
  #app:has(>.mn-preventive), #app:has(>.mn-orders) { width:100%; max-width:100%; min-width:0; outline:none; }
  .mn-preventive, .mn-orders { min-width:0; max-width:100%; }
  .mn-preventive [hidden], .mn-orders [hidden] { display:none!important; }
  .mn-preventive button, .mn-orders button, .mn-preventive summary { touch-action:manipulation; }
  .mn-preventive .wf-heading, .mn-orders .wf-heading { margin-bottom:18px; }
  .mn-preventive .wf-heading p { font-size:13px; line-height:1.5; }
  .mn-preventive .wf-heading .wf-new { min-height:46px; font-size:14px!important; }
  .mn-plan-browser h2 { margin:16px 0 12px; font-size:18px; color:var(--wf-text); }
  .mn-plan-browser { display:contents; }
  .mn-plan-browser>p { font-size:13px; color:var(--wf-soft); line-height:1.5; }
  .mn-preventive .pf-areas { grid-template-columns:minmax(0,1fr); gap:10px; }
  .mn-preventive .pf-area { min-height:78px; padding:13px; }
  .mn-preventive .pf-area-copy b { font-size:16px; }
  .mn-preventive .pf-area-copy small { font-size:12px; }
  .mn-preventive .pf-area-icon { width:44px; height:44px; flex-basis:44px; }
  .mn-preventive .pf-area-icon svg { width:25px; height:25px; }
  .mn-preventive .pf-area strong { font-size:23px; }
  .mn-preventive .mn-navigation { position:sticky; top:70px; z-index:10; display:flex; align-items:center; gap:12px; padding:10px; margin-bottom:12px; border:1px solid var(--wf-edge); border-radius:12px; background:var(--wf-panel); }
  .mn-navigation button { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:46px; padding:10px; flex:0 0 auto; color:var(--wf-text); background:var(--wf-panel2); border:1px solid var(--wf-edge); font-size:14px; }
  .mn-navigation>span { min-width:0; display:grid; gap:4px; }
  .mn-navigation small { color:var(--wf-soft); font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .mn-navigation b { font-size:14px; overflow-wrap:anywhere; }
  .mn-level-list { display:grid; gap:12px; margin:0 0 18px; }
  .mn-level { display:flex; align-items:center; gap:12px; width:100%; min-width:0; min-height:88px; padding:15px; border:1px solid var(--wf-edge); border-radius:12px; color:var(--wf-text); background:var(--wf-panel2); text-align:left; cursor:pointer; }
  .mn-level>span:not([data-app-icon]) { flex:1; min-width:0; }
  .mn-level>[data-app-icon] { color:var(--wf-blue); margin:0; }
  .mn-level>b, .mn-level b { display:block; font-size:16px; line-height:1.4; overflow-wrap:anywhere; }
  .mn-level small { display:block; font-size:12px; color:var(--wf-soft); margin-top:6px; }
  .mn-level:active { background:var(--wf-panel); border-color:var(--wf-blue); }
  .mn-fold { min-width:0; border:1px solid var(--wf-edge); border-radius:11px; background:var(--wf-panel); margin:12px 0; }
  .mn-fold>summary { display:flex; align-items:center; gap:10px; padding:13px; min-height:48px; color:var(--wf-text); font-size:14px; list-style:none; cursor:pointer; }
  .mn-fold>summary::-webkit-details-marker { display:none; }
  .mn-fold>summary>span:not([data-app-icon]) { flex:1; min-width:0; }
  .mn-fold>summary>[data-app-icon] { color:var(--wf-blue); }
  .mn-fold>summary small { display:block; margin-top:4px; font-size:12px; color:var(--wf-soft); line-height:1.4; }
  .mn-fold[open]>summary { border-bottom:1px solid var(--wf-edge); }
  .mn-fold[open]>summary>[data-app-icon]:last-child { transform:rotate(180deg); }
  .mn-fold .pf-filters { margin:0; border:0; border-radius:0; box-shadow:none; }
  .mn-preventive .pf-filters .wf-toolbar { padding:12px; gap:10px; }
  .mn-preventive .wf-search input, .mn-preventive .wf-filter select, .mn-orders .wf-search input, .mn-orders .wf-filter select { font-size:16px; }
  .mn-preventive .pf-factory.mn-current-factory { border:0; background:none; box-shadow:none; overflow:visible; }
  .mn-current-factory>.pf-factory-head, .mn-current-factory .pf-line-head, .mn-current-machine>summary { display:none!important; }
  .mn-current-factory .pf-line { border:0; }
  .mn-preventive .mn-current-machine { margin:0; padding:0; border:0; border-radius:0; background:none; overflow:visible; }
  .mn-current-machine .pw-machine-body { padding:0; }
  .mn-preventive:has(.mn-current-machine) .wf-heading { margin-bottom:12px; }
  .mn-preventive:has(.mn-current-machine) .wf-heading h1 { font-size:24px; }
  .mn-preventive:has(.mn-current-machine) .wf-heading p, .mn-preventive:has(.mn-current-machine) .wf-heading>.wf-new { display:none; }
  .mn-current-machine .mn-fold>summary::before { content:none; display:none; }
  .mn-current-machine .pw-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .mn-current-machine .pw-tabs button { min-height:46px; padding:9px; font-size:13px; white-space:normal; }
  .mn-current-machine .pw-machine-tools>.secondary { min-height:46px; font-size:14px; }
  .mn-current-machine .pw-frequency-pills { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); padding:12px; margin:0; gap:8px; }
  .mn-current-machine .pw-frequency-pills>span { display:none; }
  .mn-current-machine .pw-frequency-pills button { min-height:44px; padding:9px; font-size:14px; }
  .mn-current-machine .pw-selection { padding:10px 0 14px; font-size:12px; line-height:1.5; }
  .mn-current-machine .pw-selection button { min-height:46px; font-size:14px; width:100%; }
  .mn-current-machine .pw-plan { padding:14px; }
  .mn-current-machine .pw-plan-heading label { gap:10px; }
  .mn-current-machine .pw-plan-heading label>input { width:24px; height:24px; flex-basis:24px; margin-top:0; }
  .mn-current-machine .pw-plan-heading b { font-size:13px; }
  .mn-current-machine .pw-plan-heading strong { font-size:16px; }
  .mn-current-machine .pw-plan-heading small { font-size:13px; line-height:1.5; }
  .mn-current-machine .pw-plan-status { padding-left:34px; }
  .mn-current-machine .pw-plan-deadline { font-size:13px; }
  .mn-current-machine .pw-plan footer>details { width:100%; }
  .mn-current-machine .pw-plan footer summary { min-height:44px; display:flex; align-items:center; font-size:14px; }
  .mn-current-machine .pw-plan .wf-actions { justify-content:flex-start; }
  .mn-current-machine .pw-plan .wf-actions button, .mn-current-machine .pw-plan-status button { min-height:44px; font-size:14px; padding:8px 10px; }
  .mn-current-machine .pw-plan .record-row-actions { flex-wrap:wrap!important; }
  .mn-prepare-shortcut { display:flex; align-items:center; justify-content:center; gap:9px; width:100%; margin:12px 0; min-height:46px; color:var(--wf-blue); background:var(--wf-panel2); border:1px solid var(--wf-edge); font-size:14px; }
  .mn-prepare-shortcut strong { padding:3px 8px; border:1px solid var(--wf-edge); border-radius:20px; }
  .mn-prepare { scroll-margin-top:155px; }
  .mn-current-machine .pw-order-fields { grid-template-columns:minmax(0,1fr); margin:0; border:0; border-radius:0; background:none; }
  .mn-current-machine .pw-order-fields input, .mn-current-machine .pw-order-fields select { min-height:46px; font-size:16px; }
  .mn-current-machine .pw-order-fields button { min-height:48px; font-size:15px; }
  .mn-current-machine .pw-meter-list input, .mn-current-machine .pw-meter-list button { min-height:46px; font-size:16px; }
  .mn-orders .wf-stats { margin-bottom:16px; }
  .mn-orders .wf-stat { min-height:82px; padding:11px; }
  .mn-orders .wf-stat-copy>span { white-space:normal; font-size:12px; }
  .mn-orders .wf-toolbar { padding:12px; gap:10px; }
  .mn-orders .wf-orders-table tbody { padding:12px; }
  .mn-orders .wf-orders-table tr[data-wf-status] { display:block; padding:0; overflow:hidden; background:var(--wf-panel); }
  .mn-orders .wf-orders-table tr[data-wf-status] td:first-child { padding:0; border:0!important; }
  .mn-orders .wf-orders-table tr[data-wf-status] td:first-child:before { display:none; }
  .mn-orders .wf-orders-table tr[data-wf-status]:not(.is-open) td:not(:first-child) { display:none; }
  .mn-orders .wf-orders-table tr.is-open { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 10px; }
  .mn-orders .wf-orders-table tr.is-open td:not(:first-child) { margin:0 13px 14px; }
  .mn-order-open { display:flex; flex-direction:column; gap:8px; width:100%; padding:15px; color:var(--wf-text); background:transparent; border:0; text-align:left; cursor:pointer; font-family:inherit; }
  .mn-order-top { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; }
  .mn-orders .wf-table .mn-order-top>b { font-size:16px; }
  .mn-orders .wf-table td:first-child .mn-order-top>b { min-width:0; white-space:normal; overflow-wrap:anywhere; }
  .mn-orders .mn-order-open>.wf-priority { align-self:flex-start; margin:0; font-size:12px; }
  .mn-order-open>strong { font-size:16px; line-height:1.4; overflow-wrap:anywhere; }
  .mn-order-title { color:var(--wf-soft); font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
  .mn-order-meta { display:flex; align-items:center; gap:7px; color:var(--wf-soft); font-size:12px; flex-wrap:wrap; }
  .mn-order-meta em { margin-left:auto; font-style:normal; overflow-wrap:anywhere; }
  .mn-order-hint { display:flex; align-items:center; justify-content:space-between; color:var(--wf-blue); font-size:13px; padding-top:6px; }
  .is-open .mn-order-hint>[data-app-icon] { transform:rotate(180deg); }
  .mn-orders .wf-table td:first-child .badge { white-space:normal; }
  .mn-orders .wf-orders-table tr.is-open .wf-actions, .mn-orders .wf-orders-table .wf-actions .record-row-actions { flex-wrap:wrap!important; gap:8px!important; max-width:none; }
  .mn-orders .wf-orders-table .wf-actions button { min-height:46px; font-size:14px; padding:9px 12px; border:1px solid var(--wf-edge); }
  .mn-orders .wf-tech { white-space:normal; overflow-wrap:anywhere; font-size:13px; }
  .mn-orders .wf-specialty { max-width:100%; width:auto; overflow-wrap:anywhere; }
  .mn-empty { padding:22px 14px; margin:0; border:1px dashed var(--wf-edge); border-radius:12px; color:var(--wf-soft); font-size:14px; text-align:center; line-height:1.5; }
  .mn-orders-empty { margin:12px; }
  .mn-preventive button:focus-visible, .mn-orders button:focus-visible, .mn-preventive summary:focus-visible { outline:2px solid var(--wf-blue); outline-offset:2px; }
}
@media (max-width:620px) { .mn-preventive .mn-navigation { top:63px; } }
