/* Mobile UX refinements for m-ops views (owned by one agent; loaded after admin.css) */
.m-wk, .m-more, .m-moveto, .m-stages, .m-pick { display: none; }
.m-empty, .qchips, .qb-sugg { display: none; }

@media (max-width: 900px) {
  .m-more { display: block; }
  .m-moveto { display: flex; }
  .m-stages { display: flex; }
  .m-pick { display: grid; }
  .m-more { width: 100%; margin-top: 10px; min-height: 48px; border: 1px dashed #cfc8b8; background: #fff; border-radius: 10px; font: 600 14px/1 var(--body); color: var(--navy); cursor: pointer; }
  .panel .m-more { margin: 0; border: 0; border-top: 1px solid var(--line-2); border-radius: 0 0 var(--radius) var(--radius); }
  .page-head p { font-size: 13.5px; }

  /* ---- Dashboard */
  .attn li { gap: 10px; padding: 12px 14px; align-items: center; }
  .attn li.m-extra { display: none; }
  .attn.all li.m-extra { display: flex; }
  .attn li .btn { flex: none; min-height: 44px; min-width: 64px; }
  .attn .tx small { font-size: 12.5px; margin-top: 1px; }
  .agenda li { min-height: 60px; }
  .agenda li.is-done { opacity: .6; }
  .agenda li > .badge { grid-column: 2; }
  .panel > header .btn.sm { min-height: 40px; padding: 8px 14px; }
  .kpis > .kpi { flex-basis: 46%; }

  /* ---- Enquiries */
  .m-stages { position: sticky; top: 0; z-index: 5; margin: 0 -12px 12px; padding: 8px 12px; gap: 6px; overflow-x: auto; background: var(--bg); scrollbar-width: none; border-bottom: 1px solid var(--line-2); }
  .m-stages::-webkit-scrollbar { display: none; }
  .m-stages button { flex: none; min-height: 44px; display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; border: 1px solid var(--line); background: #fff; border-radius: 999px; font: 600 13.5px/1 var(--body); color: var(--ink-2); cursor: pointer; }
  .m-stages button i { font: 700 11px/1 var(--mono); font-style: normal; background: #eeebe4; border-radius: 999px; padding: 3px 7px; color: var(--muted); }
  .m-stages button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
  .m-stages button.on i { background: rgba(255,255,255,.2); color: #fff; }
  .board { display: block; overflow: visible; margin: 0; padding: 0; }
  .col { display: none; background: transparent; padding: 0; min-height: 0; gap: 10px; }
  .col.m-cur { display: flex; }
  .col > h3 { display: none; }
  .card { cursor: default; padding: 13px; border-radius: 12px; }
  .card .row1 { font-size: 15.5px; }
  .card .msg { font-size: 14px; -webkit-line-clamp: 3; }
  .card .meta { font-size: 12.5px; gap: 5px; }
  .card .acts { gap: 8px; }
  .card .acts .btn { flex: 1; min-height: 46px; font-size: 13.5px; }
  .m-moveto { width: 100%; margin-top: 10px; min-height: 44px; align-items: center; justify-content: space-between; padding: 0 12px; border: 1px solid var(--line); background: #fcfbf8; border-radius: 8px; font: 600 13.5px/1 var(--body); color: var(--ink); cursor: pointer; }
  .m-moveto span { color: var(--muted); font-weight: 500; font-size: 12.5px; }
  .m-moveto span::after { content: " ›"; }
  .m-empty { display: block; text-align: center; color: var(--muted); padding: 36px 12px; background: #fff; border: 1px dashed var(--line); border-radius: 12px; }
  .m-pick { gap: 8px; }
  .m-pick button { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 16px; border: 1px solid var(--line); background: #f6f4ef; border-radius: 12px; font: 600 15px/1 var(--body); color: var(--ink); cursor: pointer; }
  .m-pick button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
  .m-pick button em { font: 500 12px var(--body); font-style: normal; opacity: .75; }

  /* ---- Schedule */
  .page-head:has(.m-wk) { flex-wrap: nowrap; align-items: center; }
  .page-head:has(.m-wk) > div:first-child { min-width: 0; flex: 1; }
  .m-wk { display: flex; flex: none; width: auto !important; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
  .m-wk button { min-width: 44px; min-height: 44px; border: 0; background: none; font: 600 14px/1 var(--body); color: var(--ink); cursor: pointer; border-right: 1px solid var(--line-2); padding: 0 12px; }
  .m-wk button:last-child { border-right: 0; }
  .m-wk button[disabled] { color: var(--muted); }
  .m-wk button:first-child, .m-wk button:last-child { font-size: 22px; padding: 0 14px; }
  .m-link { color: var(--red); font-weight: 600; text-decoration: none; white-space: nowrap; }
  .weekstrip { gap: 4px; }
  .weekstrip button { min-height: 58px; padding: 6px 2px; }
  .weekstrip button .c { display: block; font: 600 10.5px/1 var(--mono); opacity: .6; margin-top: 2px; }
  .weekstrip button.is-today:not(.on) { border-color: var(--red); }
  .weekstrip button.is-today:not(.on) .n { color: var(--red); }
  .m-techs { margin: 0 -12px 12px; padding: 0 12px 2px; scrollbar-width: none; }
  .m-techs::-webkit-scrollbar { display: none; }
  .m-techs button { min-height: 44px; padding: 0 16px; font-size: 13.5px; }
  .m-techs.wrap { margin: 0; padding: 0; flex-wrap: wrap; overflow: visible; }
  .m-slot { grid-template-columns: 50px 1fr; gap: 8px; }
  .m-job .s { font-size: 13px; }
  .m-emptyday { text-align: center; padding: 28px 12px; background: #fff; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }
  .m-emptyday p { margin: 0 0 12px; }
  .tray { margin-top: 20px; scroll-margin-top: 12px; }
  .tray header h2 { display: flex; align-items: center; gap: 8px; }
  .tray .items .card { display: flex; align-items: center; gap: 10px; padding: 11px 12px; }
  .tray .items .card > div { flex: 1; min-width: 0; }
  .tray .items .card .n { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .tray .items .card .btn { flex: none; min-height: 46px; min-width: 76px; }
  .qb { display: grid; gap: 12px; }
  .qb .f { display: grid; gap: 6px; font-weight: 600; font-size: 12.5px; color: var(--ink-2); }
  .qb .f input { padding: 12px; border: 1px solid var(--line); border-radius: 10px; min-height: 48px; font-weight: 400; }
  .qb-sugg { display: flex; gap: 6px; margin-top: -4px; }
  .qb-sugg button { flex: 1; min-height: 44px; border: 1px solid var(--line); background: #f6f4ef; border-radius: 10px; font: 600 13px var(--body); cursor: pointer; }

  /* ---- Jobs list */
  .filters .seg { width: 100%; }
  .filters .seg button { min-height: 44px; padding: 0 14px; flex: none; }
  .t tbody tr.click:active { background: var(--hover); }
  .t tbody tr.click td:last-child:not([data-label]) { display: none; }

  /* ---- Job drawer */
  .drawer-close { width: 44px; height: 44px; right: 6px; top: 6px; }
  .d-head h2 { font-size: 1.25rem; }
  .d-sec > h3 .btn { min-height: 40px; }
  .steps { gap: 6px; }
  .steps button { min-height: 48px; font-size: 12.5px; }
  .kv dd a { padding: 2px 0; }
  .kv dd a[href^="tel"] { font-weight: 600; }
  .kv dd a.muted { display: inline-block; padding: 8px 4px 4px 0; }
  .d-sec .btn-row .btn.sm { min-height: 44px; }
  .find-row { grid-template-columns: 1fr 46px; gap: 8px; }
  .find-row > input[data-k=area], .find-row > .note { grid-column: 1 / -1; }
  .find-row input, .find-row select { padding: 11px 10px; min-height: 46px; }
  .find-row .icon-btn { width: 46px; height: 46px; border: 1px solid var(--line); background: #fff; }
  .find-block { padding: 10px; }
  .photos { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .photos label.add-photo { border-color: var(--navy); color: var(--navy); font-weight: 600; background: #f6f4ef; }
  .sig { height: 200px; background: #fff; }
  .sig-img { max-height: 120px; }
  .d-sec .t td .icon-btn { width: 44px; height: 44px; }
  .d-sec .t tr { flex-wrap: nowrap; align-items: center; justify-content: space-between; }
  .d-sec .t td:first-child { flex: 1; min-width: 0; }
  .d-sec .t tbody tr { padding: 4px 0; }
  .d-sec .t td.num { white-space: nowrap; font-weight: 600; }
  .drawer .d-sec:last-of-type .btn { flex: 1 1 40%; }
  .drawer-body > .actbar { margin-top: 0; }

  /* ---- Modals */
  dialog { max-height: 94dvh; }
  .modal-body { max-height: calc(94dvh - 132px); padding: 14px 16px; gap: 14px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .modal-form > header { padding: 12px 16px; position: sticky; top: 0; background: #fff; z-index: 2; }
  .modal-form > header .icon-btn { width: 44px; height: 44px; }
  .modal-form > footer { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .modal-form > footer .btn { min-height: 50px; }
  .modal-form > footer .btn.primary { flex: 2; }
  .modal-body .f input, .modal-body .f select, .modal-body .f textarea { min-height: 48px; padding: 11px 12px; }
  .modal-body .f textarea { min-height: 76px; }
  .modal-body .f2, .modal-body .f3 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .modal-body .f3 > :last-child { grid-column: 1 / -1; }
  .qchips { display: flex; gap: 6px; }
  .qchips button { flex: 1; min-height: 44px; border: 1px solid var(--line); background: #f6f4ef; border-radius: 10px; font: 600 14px var(--body); cursor: pointer; }
  .qchips button:active { background: var(--navy); color: #fff; }
}
@media (max-width: 360px) {
  .m-wk button:nth-child(2) { padding: 0 8px; }
  .modal-body .f2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .jobs-t .t tbody tr { display: flex; flex-direction: column; padding: 13px 14px; }
  .jobs-t .t td.lead { order: -3; font-size: 16px; padding-bottom: 4px; }
  .jobs-t .t td.mono:first-child { order: -2; margin-bottom: 2px; }
  .jobs-t .t td.mono:first-child::before { content: "Job "; }
  .jobs-t .t td[data-label="When"] { order: -1; margin-bottom: 4px; }
}
@media (max-width: 900px) {
  .drawer-close { position: static; width: 100%; height: 42px; flex: none; border-radius: 0; justify-content: flex-end; padding-right: 14px; display: flex; align-items: center; background: #fcfbf8; }
  .drawer-close::before { content: "Close"; font: 600 13px var(--body); color: var(--muted); margin-right: 8px; }
  .d-head { padding-top: 6px; padding-right: 16px; }
  .modal-body .f2, .modal-body .f3 { align-items: start; }
}
