/* Naqaa phone app — design handoff tokens */
#mShell { display: none; }

@media all {
  body.m-app .mobile-tabbar,
  body.m-app .mobile-drawer-backdrop,
  body.m-app .install-card { display: none !important; }
  body.m-shell-on .app-shell { display: none !important; }
  body.m-shell-on { background: #F5F6F9 !important; overflow: hidden; }

  #mShell {
    --navy: #0B1B3D; --blue: #2563EB; --bg: #F5F6F9; --line: #EDEFF4; --field: #E7E9EF; --sep: #F2F4F8; --soft: #F3F4F8;
    --text: #0B1B3D; --text2: #5C6478; --text3: #6B7489; --green: #15803D; --red: #E5484D; --red2: #B42318; --amber: #B45309;
    position: fixed; inset: 0; z-index: 70; display: block; background: var(--bg); color: var(--text);
    font-family: "Cairo", system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  }
  #mShell[hidden] { display: none !important; }
  #mShell button { font: inherit; color: inherit; }
  #mShell .m-screen { position: absolute; inset: 0; display: flex; flex-direction: column; animation: m-rise 0.28s ease; }
  #mShell .m-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(110px + env(safe-area-inset-bottom)); scrollbar-width: none; }
  #mShell .m-scroll::-webkit-scrollbar { display: none; }
  #mShell .m-screen.is-stack .m-scroll { padding-bottom: 24px; }
  #mShell .m-scroll.m-has-bar { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  #mShell .m-pad { padding: 14px 14px 0; display: flex; flex-direction: column; gap: 12px; }
  #mShell .m-pad > .m-scroll-inner { display: contents; }
  #mShell .m-muted { color: var(--text3); font-size: 12px; margin: 0; }
  #mShell .m-pad-s { padding: 12px 16px; }

  /* headers */
  #mShell .m-home-head { flex: none; background: var(--navy); color: #fff; padding: calc(18px + env(safe-area-inset-top)) 20px 22px; border-radius: 0 0 26px 26px; box-shadow: 0 8px 24px rgba(11, 27, 61, 0.18); }
  #mShell .m-home-row { display: flex; align-items: center; gap: 14px; }
  #mShell .m-logo-box { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 19px; background: #fff; overflow: hidden; }
  #mShell .m-logo-box img { width: 100%; height: 100%; object-fit: cover; }
  #mShell .m-logo-box.is-sm { width: 34px; height: 34px; border-radius: 10px; }
  #mShell .m-logo-box.is-md { width: 52px; height: 52px; border-radius: 17px; }
  #mShell .m-home-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  #mShell .m-home-who small { font-size: 12px; color: rgba(255, 255, 255, 0.55); }
  #mShell .m-home-who b { font-size: 21px; font-weight: 700; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #mShell .m-home-who span { font-size: 12px; color: rgba(255, 255, 255, 0.6); }
  #mShell .m-home-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
  #mShell .m-home-date { display: flex; flex-direction: column; align-items: flex-end; }
  #mShell .m-home-date b { font-size: 13px; font-weight: 600; }
  #mShell .m-home-date small { font-size: 11px; color: rgba(255, 255, 255, 0.6); }
  #mShell .m-head { flex: none; display: flex; align-items: center; gap: 10px; background: var(--navy); color: #fff; padding: calc(16px + env(safe-area-inset-top)) 18px 16px; border-radius: 0 0 22px 22px; }
  #mShell .m-head-title { flex: 1; min-width: 0; }
  #mShell .m-head h1 { margin: 0; font-size: 18px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #mShell .m-head.is-inner h1 { font-size: 16px; }
  #mShell .m-head p { margin: 1px 0 0; font-size: 11.5px; color: rgba(255, 255, 255, 0.6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #mShell .m-icon-btn { position: relative; flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, 0.1); color: #fff !important; cursor: pointer; transition: transform 0.18s; }
  #mShell .m-head.is-inner .m-icon-btn { width: 38px; height: 38px; border-radius: 13px; }
  #mShell .m-icon-btn:active { transform: scale(0.93); }
  #mShell [data-m-back] svg { transform: scaleX(-1); }
  #mShell .m-badge { position: absolute; top: -4px; left: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; line-height: 18px; text-align: center; }

  /* cards and common */
  #mShell .m-card { display: block; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 16px; box-shadow: 0 2px 10px rgba(11, 27, 61, 0.05); text-align: right; }
  #mShell .m-list-card { padding: 4px 0; }
  #mShell .m-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 16px 6px; }
  #mShell .m-card > .m-card-head:first-child { padding-top: 4px; }
  #mShell .m-card:not(.m-list-card) > .m-card-head { padding: 0 0 10px; }
  #mShell .m-card-head b { font-size: 14.5px; font-weight: 700; }
  #mShell .m-card-head small { font-size: 11.5px; color: var(--text3); }
  #mShell .m-avatar { flex: none; display: grid; place-items: center; color: var(--navy); font-weight: 700; font-size: 14px; }
  #mShell .m-avatar.is-blue { width: 40px; height: 40px; border-radius: 14px; background: #EEF3FE; color: var(--blue); }
  #mShell .m-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 11px 14px; border: 0; border-radius: 14px; font-size: 13.5px; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform 0.18s, opacity 0.18s; }
  #mShell .m-btn:active { transform: scale(0.97); }
  #mShell .m-btn-primary { background: var(--navy); color: #fff !important; }
  #mShell .m-btn-primary svg { transform: scaleX(-1); }
  #mShell .m-btn-soft { background: var(--soft); color: var(--navy) !important; }
  #mShell .m-btn-blue-soft { background: #EEF3FE; color: var(--blue) !important; }
  #mShell .m-btn-green { background: var(--green); color: #fff !important; }
  #mShell .m-btn-dashed { background: #fff; border: 1px dashed #DDE1EA; color: var(--text2) !important; font-size: 12.5px; }
  #mShell .m-btn-dashed.is-done { border-style: solid; border-color: #BFE3CD; background: #E8F5EE; color: var(--green) !important; }
  #mShell .m-btn-lg { min-height: 52px; border-radius: 15px; font-size: 14.5px; }
  #mShell .m-btn-sm { flex: none; min-height: 36px; padding: 6px 12px; border-radius: 11px; font-size: 12px; }
  #mShell .m-btn.is-static { cursor: default; color: var(--green) !important; background: #E8F5EE; }
  #mShell .m-btn:disabled { opacity: 0.6; }
  #mShell .m-square { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 14px; background: var(--soft); color: var(--navy) !important; cursor: pointer; }
  #mShell .m-two, #mShell .m-three { display: flex; gap: 8px; margin-top: 12px; }
  #mShell .m-sep { height: 1px; background: var(--sep); margin: 12px 0; }
  #mShell .m-chev { color: #C3C8D4; display: grid; place-items: center; }
  #mShell .m-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 16px; border: 1px dashed #DDE1EA; border-radius: 20px; text-align: center; background: #fff; }
  #mShell .m-empty span { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 16px; background: var(--soft); color: var(--text3); }
  #mShell .m-empty b { font-size: 13.5px; font-weight: 600; }
  #mShell .m-empty small { font-size: 11.5px; color: var(--text3); }

  /* tags */
  #mShell .m-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 600; white-space: nowrap; background: #EFF1F6; color: var(--text2); }
  #mShell .m-tag i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
  #mShell .tag-new, #mShell .tag-pending { background: #FEF3E2; color: var(--amber); }
  #mShell .tag-assigned, #mShell .tag-scheduled { background: #EAF1FE; color: var(--blue); }
  #mShell .tag-in-progress { background: #EEE6F8; color: #6D28D9; }
  #mShell .tag-complete { background: #E8F5EE; color: var(--green); }
  #mShell .tag-delayed, #mShell .tag-cancelled { background: #FDECEA; color: var(--red2); }
  #mShell .m-pay { font-size: 11.5px; font-weight: 600; color: var(--text2); }
  #mShell .m-pay.is-paid { color: var(--green); }
  #mShell .m-pay.is-pending { color: var(--amber); }

  /* today */
  #mShell .m-focus-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  #mShell .m-focus-top small { font-size: 11px; color: var(--text3); }
  #mShell .m-focus-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; }
  #mShell .m-focus-tag i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: m-pulse 1.8s infinite; }
  #mShell .tone-red { color: var(--red); } #mShell .tone-green { color: var(--green); } #mShell .tone-blue { color: var(--blue); }
  #mShell .m-focus-big { font-size: 42px; font-weight: 700; letter-spacing: -1.4px; line-height: 1.2; margin-top: 4px; }
  #mShell .m-focus-title { display: block; font-size: 15px; font-weight: 600; }
  #mShell .m-focus-text { margin: 4px 0 0; font-size: 12px; color: var(--text3); line-height: 1.7; }
  #mShell .m-focus-actions { display: flex; gap: 8px; margin-top: 14px; }
  #mShell .m-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  #mShell .m-kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #mShell .m-kpi { display: flex; flex-direction: column; gap: 2px; padding: 13px 12px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
  #mShell .m-kpi b { font-size: 21px; font-weight: 700; line-height: 1.3; }
  #mShell .m-kpi b small { font-size: 11px; font-weight: 600; color: var(--text3); }
  #mShell .m-kpi span { font-size: 10.5px; color: var(--text2); }
  #mShell .is-green { color: var(--green); } #mShell .is-blue { color: var(--blue); } #mShell .is-amber { color: var(--amber); } #mShell .is-red { color: var(--red2); }
  #mShell .m-tl-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--sep); }
  #mShell .m-card-head + .m-tl-row { border-top: 0; }
  #mShell .m-tl-time { flex: none; width: 44px; display: flex; flex-direction: column; }
  #mShell .m-tl-time b { font-size: 12px; font-weight: 700; }
  #mShell .m-tl-time small { font-size: 9.5px; color: var(--text3); }
  #mShell .m-tl-dot { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: #EFF1F6; }
  #mShell .m-tl-dot i { width: 9px; height: 9px; border-radius: 50%; background: #9BA3B4; }
  #mShell .m-tl-dot.tone-urgent { background: #FDE7E5; } #mShell .m-tl-dot.tone-urgent i { background: var(--red); }
  #mShell .m-tl-dot.tone-mid { background: #FBEBD4; } #mShell .m-tl-dot.tone-mid i { background: var(--amber); }
  #mShell .m-tl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; border: 0; background: none; padding: 0; text-align: right; cursor: pointer; }
  #mShell .m-tl-main b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #mShell .m-tl-main small { font-size: 11px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #mShell .m-tl-act { flex: none; min-height: 32px; padding: 6px 12px; border: 0; border-radius: 11px; background: #EEF3FE; color: var(--blue) !important; font-size: 11.5px; font-weight: 600; cursor: pointer; }
  #mShell .m-tl-act.is-strong { background: var(--navy); color: #fff !important; }
  #mShell .m-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  #mShell .m-quick-item { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 13px 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff; cursor: pointer; text-align: right; }
  #mShell .m-quick-item span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: #EEF3FE; color: var(--blue); margin-bottom: 4px; }
  #mShell .m-quick-item b { font-size: 12px; font-weight: 600; }
  #mShell .m-quick-item small { font-size: 10px; color: var(--text3); }

  /* work */
  #mShell .m-sticky { position: sticky; top: 0; z-index: 5; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 10px; background: var(--bg); }
  #mShell .m-seg { display: flex; gap: 3px; padding: 3px; border-radius: 14px; background: #E9EBF1; }
  #mShell .m-seg button { flex: 1; min-height: 38px; border: 0; border-radius: 11px; background: transparent; font-size: 12.5px; font-weight: 600; color: var(--text2) !important; cursor: pointer; }
  #mShell .m-seg button.is-active { background: #fff; color: var(--navy) !important; box-shadow: 0 1px 3px rgba(11, 27, 61, 0.12); }
  #mShell .m-search { display: flex; align-items: center; gap: 8px; padding: 0 14px; min-height: 46px; border: 1px solid var(--field); border-radius: 14px; background: #fff; color: var(--text3); }
  #mShell .m-search input { flex: 1; min-width: 0; border: 0 !important; outline: 0; background: transparent !important; font: inherit; font-size: 16px !important; color: var(--text); padding: 0 !important; box-shadow: none !important; }
  #mShell .m-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; }
  #mShell .m-chips::-webkit-scrollbar { display: none; }
  #mShell .m-chips button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border: 1px solid var(--field); border-radius: 12px; background: #fff; color: var(--text2) !important; font-size: 12px; font-weight: 600; cursor: pointer; }
  #mShell .m-chips button b { font-size: 11px; opacity: 0.7; }
  #mShell .m-chips button.is-active { background: var(--navy); border-color: var(--navy); color: #fff !important; }
  #mShell .m-cards { gap: 10px; padding-top: 4px; }
  #mShell .m-item { padding: 15px; border-radius: 20px; box-shadow: 0 2px 8px rgba(11, 27, 61, 0.04); }
  #mShell .m-item-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  #mShell .m-item-id { margin-inline-start: auto; border: 0; background: none; padding: 0; color: var(--blue) !important; font-size: 11.5px; font-weight: 600; cursor: pointer; }
  #mShell .m-item-main { display: flex; align-items: center; gap: 11px; width: 100%; margin-top: 12px; border: 0; background: none; padding: 0; text-align: right; cursor: pointer; }
  #mShell .m-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  #mShell .m-item-text b { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #mShell .m-item-text small { font-size: 11.5px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #mShell .m-item-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; }
  #mShell .m-item-side b { font-size: 13.5px; font-weight: 700; }
  #mShell .m-item-side small { font-size: 10.5px; color: var(--text3); }
  #mShell .m-item-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--sep); }

  /* details */
  #mShell .m-cust { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
  #mShell .m-cust > span { display: flex; flex-direction: column; min-width: 0; }
  #mShell .m-cust b { font-size: 16px; font-weight: 600; }
  #mShell .m-cust small { font-size: 11.5px; color: var(--text2); }
  #mShell .m-rows { display: flex; flex-direction: column; gap: 10px; }
  #mShell .m-rows div { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
  #mShell .m-rows span { color: var(--text2); }
  #mShell .m-rows b { font-weight: 600; text-align: left; }
  #mShell .m-loc { display: flex; align-items: center; gap: 10px; }
  #mShell .m-loc > span { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px; background: #EEF3FE; color: var(--blue); }
  #mShell .m-loc > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  #mShell .m-loc b { font-size: 12.5px; font-weight: 600; }
  #mShell .m-loc small { font-size: 11px; color: var(--text3); }
  #mShell .m-steps { list-style: none; margin: 0; padding: 0; }
  #mShell .m-steps li { position: relative; display: flex; gap: 12px; padding-bottom: 14px; }
  #mShell .m-steps li:last-child { padding-bottom: 0; }
  #mShell .m-steps li::before { content: ""; position: absolute; top: 22px; bottom: 0; right: 9px; width: 2px; background: var(--line); }
  #mShell .m-steps li:last-child::before { display: none; }
  #mShell .m-steps li.is-done::before { background: var(--blue); }
  #mShell .m-steps i { position: relative; z-index: 1; flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #DDE1EA; background: #fff; }
  #mShell .m-steps li.is-done i { border-color: var(--blue); background: var(--blue); box-shadow: inset 0 0 0 4px var(--blue), inset 0 0 0 7px #fff; }
  #mShell .m-steps li.is-current i { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15); }
  #mShell .m-steps div { display: flex; flex-direction: column; min-height: 26px; }
  #mShell .m-steps b { font-size: 13px; font-weight: 600; }
  #mShell .m-steps li:not(.is-done):not(.is-current) b { color: var(--text3); }
  #mShell .m-steps small { font-size: 11px; color: var(--text3); }
  #mShell .m-steps.is-field li.is-done::before { background: var(--green); }
  #mShell .m-steps.is-field li.is-done i { border-color: var(--green); background: var(--green); box-shadow: inset 0 0 0 4px var(--green), inset 0 0 0 7px #fff; }
  #mShell .m-tech { display: flex; align-items: center; gap: 12px; }
  #mShell .m-tech > div { flex: 1; display: flex; flex-direction: column; }
  #mShell .m-tech small { font-size: 11px; color: var(--text3); }
  #mShell .m-tech b { font-size: 13.5px; font-weight: 600; }
  #mShell .m-evidence { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  #mShell .m-evidence a { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text2); font-size: 11px; }
  #mShell .m-evidence img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); }
  #mShell .m-bar { position: absolute; z-index: 6; inset-inline: 0; bottom: 0; display: flex; gap: 8px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: rgba(245, 246, 249, 0.94); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  #mShell .m-bar .m-btn-soft { flex: 0.7; }

  /* rows (customers / more) */
  #mShell .m-row { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 16px; border: 0; border-top: 1px solid var(--sep); background: none; text-align: right; cursor: pointer; }
  #mShell .m-card-head + .m-row, #mShell .m-list-card > .m-row:first-child { border-top: 0; }
  #mShell .m-row.is-current { background: #F6F9FF; }
  #mShell .m-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  #mShell .m-row-text b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #mShell .m-row-text small { font-size: 11.5px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #mShell .m-row-count { flex: none; display: flex; flex-direction: column; align-items: center; }
  #mShell .m-row-count b { font-size: 14px; font-weight: 700; }
  #mShell .m-row-count small { font-size: 10px; color: var(--text3); }
  #mShell .m-row-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: var(--navy); }
  #mShell .m-pill-red { flex: none; min-width: 24px; padding: 2px 8px; border-radius: 999px; background: #FDECEA; color: var(--red2); font-size: 11px; font-weight: 700; text-align: center; }
  #mShell .m-profile-card { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
  #mShell .m-profile-card > b { font-size: 17px; font-weight: 600; margin-top: 8px; }
  #mShell .m-profile-card > small { font-size: 11.5px; color: var(--text2); }
  #mShell .m-profile-card .m-three { width: 100%; }
  #mShell .m-me { display: flex; align-items: center; gap: 12px; cursor: pointer; }
  #mShell .m-me-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  #mShell .m-me-text b { font-size: 15px; font-weight: 600; }
  #mShell .m-me-text small { font-size: 11.5px; color: var(--text2); }
  #mShell .m-me-text em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--blue); margin-top: 2px; }
  #mShell .m-logout { display: flex; align-items: center; justify-content: center; gap: 8px; border-color: #F6DEDC; color: var(--red2) !important; font-size: 13.5px; font-weight: 700; cursor: pointer; }
  #mShell .m-foot { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 18px; text-align: center; }
  #mShell .m-foot img { width: 26px; height: 26px; border-radius: 8px; margin-bottom: 4px; }
  #mShell .m-foot b { font-size: 11.5px; font-weight: 600; color: var(--text2); }
  #mShell .m-foot small { font-size: 10.5px; color: var(--text3); }

  /* bottom nav */
  #mShell .m-nav { position: absolute; z-index: 8; right: 14px; left: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; gap: 2px; padding: 6px; border: 1px solid rgba(11, 27, 61, 0.07); border-radius: 24px; background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 14px 34px rgba(11, 27, 61, 0.16); }
  #mShell .m-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; padding: 6px 2px; border: 0; border-radius: 17px; background: transparent; color: #9BA3B4 !important; font-size: 9.5px; font-weight: 600; cursor: pointer; }
  #mShell .m-nav-item.is-active { background: #EAF1FE; color: var(--blue) !important; }
  #mShell .m-nav-icon { position: relative; display: grid; place-items: center; }
  #mShell .m-nav-item.is-active svg { fill: rgba(37, 99, 235, 0.16); }
  #mShell .m-nav .m-badge { top: -6px; left: -10px; background: var(--green); }

  /* sheet */
  #mShell .m-sheet-backdrop { position: absolute; inset: 0; z-index: 20; background: rgba(8, 16, 36, 0.5); animation: m-fade 0.2s; }
  #mShell .m-sheet { position: absolute; z-index: 21; inset-inline: 0; bottom: 0; max-height: 78%; display: flex; flex-direction: column; padding: 14px 16px calc(32px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: #fff; animation: m-sheet 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
  #mShell .m-sheet-handle { align-self: center; width: 42px; height: 4px; border-radius: 4px; background: #DDE1EA; margin-bottom: 12px; }
  #mShell .m-sheet h2 { margin: 0; font-size: 16.5px; font-weight: 700; }
  #mShell .m-sheet p { margin: 2px 0 12px; font-size: 11.5px; color: var(--text2); }
  #mShell .m-sheet-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
  #mShell .m-team-row { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 16px; background: #fff; text-align: right; cursor: pointer; }
  #mShell .m-team-row.is-current { border-color: #C9D8F7; background: #F6F9FF; }
  #mShell .m-team-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  #mShell .m-team-text b { font-size: 13.5px; font-weight: 600; }
  #mShell .m-team-text small { font-size: 11px; color: var(--text2); }
  #mShell .m-load { display: block; height: 4px; border-radius: 4px; background: var(--sep); overflow: hidden; margin-top: 3px; }
  #mShell .m-load em { display: block; height: 100%; border-radius: 4px; }

  /* field route */
  #mShell .m-track-pill { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 999px; background: rgba(255, 255, 255, 0.1); color: #fff !important; font-size: 11.5px; font-weight: 700; cursor: pointer; }
  #mShell .m-track-pill.is-on { background: rgba(21, 128, 61, 0.9); border-color: transparent; }
  #mShell .m-track-pill i { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: m-pulse 1.6s infinite; }
  #mShell .m-map-card { position: relative; height: 252px; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); background: #DEE5ED; }
  #mShell .m-field-map { position: absolute; inset: 0; }
  #mShell .m-map-refresh { position: absolute; z-index: 500; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, 0.92); box-shadow: 0 4px 12px rgba(11, 27, 61, 0.12); font-size: 11.5px; font-weight: 600; color: var(--navy) !important; cursor: pointer; }
  #mShell .m-map-next { position: absolute; z-index: 500; bottom: 10px; inset-inline: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 14px; border-radius: 14px; background: rgba(11, 27, 61, 0.92); color: #fff; font-size: 12px; }
  #mShell .m-map-next span { font-size: 11.5px; opacity: 0.8; }
  #mShell .m-map-error { position: absolute; z-index: 500; top: 50px; inset-inline: 10px; padding: 8px 12px; border-radius: 12px; background: #FEF6E7; color: #8A5A0B; font-size: 11.5px; font-weight: 600; }
  #mShell .m-field-name { margin: 10px 0 2px; font-size: 17px; font-weight: 700; }
  #mShell .m-evidence-btns { margin-top: 14px; }
  #mShell .m-stop-num { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--soft); font-size: 12.5px; font-weight: 700; }
  #mShell .m-stop-num.is-done { background: #E8F5EE; color: var(--green); }
  .m-me-tip { background: #0B1B3D !important; color: #fff !important; border: 0 !important; font-size: 10.5px !important; padding: 2px 8px !important; }
  .m-me-tip::before { border-top-color: #0B1B3D !important; }

  /* performance */
  #mShell .m-bars { display: flex; align-items: flex-end; gap: 8px; height: 132px; padding-top: 8px; }
  #mShell .m-bars > div { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
  #mShell .m-bars em { font-style: normal; font-size: 10px; font-weight: 700; }
  #mShell .m-bars i { width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; }
  #mShell .m-bars small { font-size: 9.5px; color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  #mShell .m-perf { border-top: 1px solid var(--sep); padding: 12px 16px; }
  #mShell .m-card-head + .m-perf { border-top: 0; }
  #mShell .m-perf.is-open { background: #FBFCFF; box-shadow: inset 0 0 0 1px #C9D8F7; border-radius: 16px; }
  #mShell .m-perf-head { display: flex; align-items: center; gap: 11px; width: 100%; border: 0; background: none; padding: 0; text-align: right; cursor: pointer; }
  #mShell .m-perf-head .m-tag { margin-inline-start: 6px; vertical-align: middle; }
  #mShell .m-perf-score { flex: none; display: flex; flex-direction: column; align-items: center; }
  #mShell .m-perf-score b { font-size: 17px; font-weight: 700; }
  #mShell .m-perf-score small { font-size: 10px; color: var(--text3); }
  #mShell .m-perf-metrics { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
  #mShell .m-perf-metrics div, #mShell .m-waste { display: grid; grid-template-columns: 96px 1fr 48px; align-items: center; gap: 8px; font-size: 11px; color: var(--text2); }
  #mShell .m-perf-metrics i, #mShell .m-waste i { height: 4px; border-radius: 4px; background: var(--sep); overflow: hidden; }
  #mShell .m-perf-metrics em { display: block; height: 100%; border-radius: 4px; background: var(--blue); }
  #mShell .m-perf-metrics b, #mShell .m-waste b { font-size: 11px; font-weight: 700; color: var(--text); text-align: left; }
  #mShell .m-perf-more { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
  #mShell .m-perf-more > div:not(.m-two) { display: flex; justify-content: space-between; font-size: 12px; color: var(--text2); }
  #mShell .m-perf-more b { color: var(--text); }
  #mShell .m-dark { background: var(--navy); border-color: var(--navy); color: #fff; display: flex; flex-direction: column; gap: 10px; }
  #mShell .m-dark > b { font-size: 14.5px; }
  #mShell .m-dark > small { font-size: 11px; color: rgba(255, 255, 255, 0.6); }
  #mShell .m-waste { color: rgba(255, 255, 255, 0.75); grid-template-columns: 110px 1fr 48px; }
  #mShell .m-waste i { height: 6px; background: rgba(255, 255, 255, 0.12); }
  #mShell .m-waste em { display: block; height: 100%; border-radius: 6px; }
  #mShell .m-waste b { color: #fff; }

  /* signature pad */
  .m-sign-overlay { position: fixed; inset: 0; z-index: 120; display: flex; align-items: flex-end; background: rgba(8, 16, 36, 0.55); font-family: "Cairo", system-ui, sans-serif; }
  .m-sign { width: 100%; display: flex; flex-direction: column; gap: 10px; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: #fff; animation: m-sheet 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .m-sign h2 { margin: 0; font-size: 16.5px; color: #0B1B3D; }
  .m-sign p { margin: 0; font-size: 12px; color: #5C6478; }
  .m-sign canvas { width: 100%; height: auto; aspect-ratio: 2 / 1; border: 1px dashed #C3C8D4; border-radius: 16px; background: #FAFBFD; touch-action: none; }
  .m-sign .m-two { display: flex; gap: 8px; }
  .m-sign .m-btn { flex: 1; min-height: 46px; border: 0; border-radius: 14px; font: inherit; font-weight: 600; font-size: 13.5px; }
  .m-sign .m-btn-soft { background: #F3F4F8; color: #0B1B3D; }
  .m-sign .m-btn-primary { background: #0B1B3D; color: #fff; }

  /* legacy pages opened from the app */
  body.m-legacy .sidebar, body.m-legacy .topbar { display: none !important; }
  body.m-legacy .main { padding-top: calc(66px + env(safe-area-inset-top)) !important; }
  .m-legacy-bar { position: fixed; top: 0; inset-inline: 0; z-index: 60; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; background: #0B1B3D; color: #fff; font-family: "Cairo", system-ui, sans-serif; border-radius: 0 0 20px 20px; box-shadow: 0 6px 18px rgba(11, 27, 61, 0.16); }
  .m-legacy-bar[hidden] { display: none; }
  .m-legacy-bar b { flex: 1; font-size: 16px; font-weight: 700; }
  .m-legacy-bar .m-icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 13px; background: rgba(255, 255, 255, 0.1); color: #fff; }
  .m-legacy-bar .m-icon-btn svg { transform: scaleX(-1); }
  .m-legacy-bar .m-logo-box { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #fff; overflow: hidden; }
  .m-legacy-bar .m-logo-box img { width: 100%; height: 100%; }

  /* toasts in app style */
  body.m-app .toast-stack { bottom: calc(106px + env(safe-area-inset-bottom)) !important; left: 14px !important; right: 14px !important; }
  body.m-app .toast { background: #0B1B3D !important; color: #fff !important; border: 0 !important; border-radius: 16px !important; animation: m-pop 0.3s; }
  body.m-app .toast strong, body.m-app .toast span { color: #fff !important; }
}

@keyframes m-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes m-sheet { from { transform: translateY(100%); } to { transform: none; } }
@keyframes m-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes m-pop { 0% { transform: scale(0.9); opacity: 0; } 60% { transform: scale(1.03); } 100% { transform: scale(1); opacity: 1; } }
@keyframes m-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@media all {
  #mShell .m-home-head, #mShell .m-home-head b, #mShell .m-head, #mShell .m-head h1, #mShell .m-head b { color: #fff !important; }
  #mShell .m-dark, #mShell .m-dark b { color: #fff !important; }
}
@media all { #mShell .m-sheet-list { flex: 1 1 auto; } }
@media all {
  #mShell .m-pad > * { flex-shrink: 0; }
  #mShell #mFieldMap .leaflet-control-zoom { display: none; }
  #mShell .m-map-card .leaflet-control-attribution { font-size: 9px; }
}
@media all { #mShell .m-map-next, #mShell .m-map-next b, #mShell .m-map-next span { color: #fff !important; } }
@media all { .m-legacy-bar b, .m-legacy-bar { color: #fff !important; } }

/* Field staff on a desktop: the app in a centered phone-width column */
body.m-desktop.m-shell-on { background: #E9EBF0 !important; }
body.m-desktop #mShell { right: 0; left: 0; margin: 0 auto; width: min(480px, 100%); border-inline: 1px solid #DDE1EA; box-shadow: 0 0 40px rgba(11, 27, 61, 0.12); }
body.m-desktop.m-legacy .main { max-width: 960px; margin: 0 auto; }
body.m-desktop .m-legacy-bar { max-width: 960px; margin: 0 auto; }

/* scrolling screens keep their last content clear of the floating tab bar */
#mShell .m-scroll.m-pad { padding-bottom: calc(126px + env(safe-area-inset-bottom)) !important; }
#mShell .m-screen.is-stack .m-scroll.m-pad { padding-bottom: calc(28px + env(safe-area-inset-bottom)) !important; }
#mShell .m-screen.is-stack .m-scroll.m-pad.m-has-bar { padding-bottom: calc(112px + env(safe-area-inset-bottom)) !important; }
#mShell .m-scroll > .m-pad:last-child { padding-bottom: calc(126px + env(safe-area-inset-bottom)); }
#mShell .m-screen.is-stack .m-scroll > .m-pad:last-child { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }

/* messages must appear above the app */
body.m-app .toast-stack { z-index: 300 !important; position: fixed !important; }
#mShell .m-shift-error { display: flex; align-items: flex-start; gap: 8px; width: 100%; margin: 4px 0 8px; padding: 10px 12px; border: 1px solid #F5C2C7; border-radius: 14px; background: #FFF4F5; color: #B42318; font-size: 12.5px; font-weight: 600; line-height: 1.7; text-align: right; }
#mShell .m-shift-error svg { flex: none; margin-top: 3px; }
