@media screen and (min-width:851px){.swift-bottom-nav{display:none!important}}
/* Swift Desk · mobile-only UX layer
   Safe additive styles: desktop and printed medical documents remain unchanged.
   Theme source: Suwasetha EMR Swift Desk (Concept C), 29 Oct 2026. */
@media screen and (max-width:850px){
  :root{--swift-navy:#153449;--swift-blue:#286a92;--swift-blue-pale:#e1eef7;--swift-ink:#1a3145;--swift-grey:#6e8290;--swift-border:#dce5ec;--swift-bg:#eef2f5}
  html{scroll-padding-top:92px}
  body{background:var(--swift-bg);color:var(--swift-ink);font-size:14px}
  .topbar{background:var(--swift-navy)!important;color:#fff!important;border-bottom:0;box-shadow:0 4px 18px #0b28372b}
  .top-inner{min-height:58px!important;padding:7px 13px!important}
  .top-inner .brand{color:#fff!important;text-decoration:none}
  .top-inner .brand b{font-size:13px!important;letter-spacing:.7px}
  .top-inner .brand small{color:#c5d5df!important;letter-spacing:0;font-size:10px!important}
  .top-inner .brand-logo{background:#286a92!important;color:white!important;border-radius:10px!important;width:36px!important;height:36px!important}
  .mobile-nav-toggle{background:#25475a!important;border-color:#34596c!important;color:#fff!important;border-radius:9px!important;min-width:65px!important}
  .top-inner>nav{background:#153449!important;border-color:#37596b!important}
  .top-inner>nav a{background:#25475a!important;color:#fff!important;border-color:#34596c!important}
  .top-inner .userbar{background:#153449!important;color:#fff!important}
  .top-inner .user-chip{color:#e0ebf0!important}
  .shell{padding:13px 11px calc(92px + env(safe-area-inset-bottom))!important;max-width:760px;margin:0 auto;overflow-x:clip}
  .shell h1{font-size:23px!important;line-height:1.15;letter-spacing:-.55px;margin:0 0 4px}
  .shell h2{font-size:16px;line-height:1.3}
  .shell h3{font-size:15px}
  .heading-row{margin:0 0 11px!important;align-items:flex-start}
  .heading-row .eyebrow{font-size:10px;letter-spacing:.8px;color:var(--swift-blue)}
  .heading-row p.muted{font-size:11px;margin:4px 0 0;line-height:1.35}
  .panel,.panel.pad,.editor-layout .panel.pad{border:1px solid var(--swift-border)!important;border-radius:11px!important;background:#fff!important;box-shadow:0 1px 4px #29455a0c!important}
  .panel.pad,.editor-layout .panel.pad{padding:12px!important}
  .panel:not(.pad)>.section-header{padding:12px 12px 7px}
  .panel:not(.pad)>.pad{padding:12px}
  .section-header h2{font-weight:750;margin:0}
  .section-header{gap:7px}
  .btn,.control,button:not(.phrase-tab):not(.phrase-chip){border-radius:9px}
  .btn.primary,button.btn.primary{background:var(--swift-blue)!important;border-color:var(--swift-blue)!important;color:#fff!important}
  .btn.secondary{background:#f3f8fc;border:1px solid #d7e6f0;color:var(--swift-ink)}
  .btn.danger.secondary{color:#9f2336!important;background:#fff5f5!important;border-color:#dfb1b6!important}
  .btn:not(.tiny){min-height:43px;padding:9px 12px}
  .btn.tiny{min-height:39px;padding:8px 10px}
  .control,input.control,select.control,textarea.control{border:1px solid #cddae4;background:#fff;color:var(--swift-ink);min-height:43px;font-size:16px;border-radius:9px}
  .control:focus-visible,.btn:focus-visible,.swift-bottom-nav a:focus-visible,.swift-bottom-nav button:focus-visible,.swift-note-tabs button:focus-visible,.swift-stock-toggle:focus-visible{outline:3px solid #60a9d5!important;outline-offset:2px}
  .muted,.small{color:var(--swift-grey)}
  .form-actions,.heading-actions{gap:7px}
  .heading-actions{flex-wrap:wrap}
  .heading-actions>.btn{min-height:39px;font-size:12px}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .stat{border:1px solid var(--swift-border);background:#fff;border-radius:9px;box-shadow:none;padding:10px 11px}
  .stat span{color:var(--swift-grey);font-size:11px}
  .stat strong{font-size:20px}
  .table-wrap{max-width:100%;min-width:0}
  .tag{border-radius:7px;padding:5px 7px;font-size:11px}
  .footer{display:none!important}
  /* Primary role-aware navigation; all secondary links remain accessible in top Menu. */
  .swift-bottom-nav{position:fixed;left:0;right:0;bottom:0;z-index:88;display:flex;align-items:stretch;justify-content:space-around;gap:0;min-height:60px;padding:4px max(8px,env(safe-area-inset-left)) calc(4px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-right));background:#fff;border-top:1px solid #d5e0e8;box-shadow:0 -3px 18px #183e4b12}
  .swift-bottom-nav a,.swift-bottom-nav button{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;min-width:0;flex:1;border:0;background:transparent;color:#708292;text-decoration:none!important;font-size:10px;line-height:1.2;font-weight:700;font-family:inherit;padding:5px 3px;min-height:48px;cursor:pointer}
  .swift-bottom-nav .swift-ico{font-size:19px;font-weight:650;line-height:1.1}
  .swift-bottom-nav a[aria-current="page"]{color:var(--swift-blue);background:#e8f3fa;border-radius:9px}
  .swift-bottom-nav a.swift-extra{display:none}
  body.swift-keyboard .swift-bottom-nav{display:none}
  .shell .alert,.shell .callout{border-radius:9px;line-height:1.45}
  dialog{border-radius:16px!important}
  /* Queue: mobile task cards instead of a horizontally scrolling table */
  .swift-queue-list .table-wrap{overflow-x:visible}
  .swift-queue-list table,.swift-queue-list tbody{display:block;width:100%}
  .swift-queue-list thead{position:absolute!important;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .swift-queue-list tbody tr{display:grid;grid-template-columns:1fr 1fr;gap:5px 10px;padding:12px;margin:0 10px 9px;border:1px solid var(--swift-border);border-radius:10px;background:#fff;min-width:0}
  .swift-queue-list tbody td{display:block;border:none!important;min-width:0;overflow-wrap:anywhere;padding:2px 0;font-size:12px}
  .swift-queue-list tbody td:nth-child(2){grid-column:1/-1;grid-row:1;font-size:15px;font-weight:750}
  .swift-queue-list tbody td:nth-child(2) a{color:var(--swift-ink)}
  .swift-queue-list tbody td:nth-child(2) small{font-size:11px;font-weight:400;color:var(--swift-grey)}
  .swift-queue-list tbody td:nth-child(1){grid-row:2;color:var(--swift-grey)}
  .swift-queue-list tbody td:nth-child(3){grid-column:2;grid-row:2}
  .swift-queue-list tbody td:nth-child(4){grid-column:1;grid-row:3}
  .swift-queue-list tbody td:nth-child(5){grid-column:2;grid-row:3;text-align:right}
  .swift-queue-list tbody td:nth-child(6){grid-column:1/-1;grid-row:4;display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:4px;padding-top:7px;border-top:1px solid #edf2f5!important}
  .swift-queue-list tbody td:nth-child(6) form{display:inline-flex}
  .swift-queue-list tbody td:nth-child(6) .btn.primary{flex:1}
  .swift-queue-list tbody tr:has(>td[colspan]){display:block}
  .queue-dashboard-grid .queue-calendar{order:2}
  .queue-dashboard-grid .recent-patients{order:1}
  .queue-date-form{gap:7px}
  .queue-calendar-grid{gap:2px}
  .calendar-day{min-height:55px}
  /* Clinical: one note section at a time with reachable phrase drawer. */
  .clinical-visit-head{margin-bottom:10px}
  .clinical-visit-head .clinical-history{font-size:12px}
  #visit-editor .note-field[hidden]{display:none!important}
  .swift-note-tabs{display:flex;gap:5px;overflow-x:auto;padding:4px 1px 10px;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch}
  .swift-note-tabs button{flex:0 0 auto;border:1px solid #d9e4eb;background:#f0f4f7;color:#536b7d;border-radius:8px;min-height:41px;padding:8px 12px;font-size:12px;font-weight:700}
  .swift-note-tabs button[aria-selected="true"]{background:var(--swift-blue);color:#fff;border-color:var(--swift-blue)}
  #visit-editor .note-field{margin-bottom:8px}
  #visit-editor textarea{min-height:170px;font-size:16px;line-height:1.5}
  body.swift-enhanced .editor-layout .phrase-panel:not(.swift-phrase-open){display:none!important}
  body.swift-enhanced .editor-layout .phrase-panel.swift-phrase-open{display:block!important;position:fixed!important;inset:auto 0 calc(62px + env(safe-area-inset-bottom)) 0!important;z-index:92!important;max-width:760px;margin:0 auto;height:auto!important;max-height:70dvh!important;min-height:0!important;border-radius:17px 17px 0 0!important;border-bottom:0!important;box-shadow:0 -8px 40px #15344945!important;overflow:auto!important}
  body.swift-enhanced .editor-layout .phrase-panel.swift-phrase-open .phrase-scroller{max-height:45dvh}
  .swift-phrase-toggle{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;border:1px solid #cddfea;background:#e5f0f7;color:#174f71;font-weight:750;padding:10px 13px;border-radius:9px;min-height:44px;margin-bottom:9px}
  .swift-phrase-close{border:1px solid #b8cedc!important;background:#eef5fa!important;color:#174f71!important;border-radius:7px!important;min-height:36px;padding:4px 10px}
  .swift-phrase-backdrop{position:fixed;inset:0;z-index:91;background:#0c273c73;display:none}
  body.swift-phrase-visible .swift-phrase-backdrop{display:block}
  .editor-layout .phrase-panel-header{padding:11px 12px}
  .editor-layout .phrase-nav-tabs{display:flex;overflow-x:auto;flex-wrap:nowrap}
  .phrase-group-grid{max-width:100%}
  .finalize .form-actions{display:grid;grid-template-columns:1fr 1fr}
  .finalize .form-actions form{min-width:0}
  .finalize .form-actions .btn{width:100%;min-height:43px;white-space:normal}
  .finalize .form-actions form:first-child{grid-column:1/-1}
  .finalize .form-actions form:first-child .btn{min-height:50px}
  /* Patient page: concise scan-first cards, previous billing remains in demographic column. */
  .patient-bill-mini .patient-bill-scroll{max-height:210px}
  .info-list{font-size:12px}
  /* Billing and POS: use compact touch cards, retain all existing pricing / autosave JS. */
  #unified-new-bill>.panel.pad{margin-bottom:11px}
  #new-bill-autosave-panel{padding:9px 12px!important;background:#eef7fc!important}
  #new-bill-autosave-panel h2{font-size:12px;margin:0}
  #new-bill-autosave-panel p{font-size:11px}
  #unified-new-bill #new-pos-entry{gap:8px}
  #unified-new-bill #new-item-name,#unified-new-bill #new-manual-description{font-size:16px}
  #unified-new-bill .bill-cart-table tbody tr{background:#fff;border-color:#dce5ec;border-radius:10px;padding:11px;margin:9px 0;gap:7px 9px}
  #unified-new-bill .bill-cart-table tbody td:first-child{font-size:13px}
  #unified-new-bill .bill-cart-table tbody td:nth-child(4) output{font-size:16px}
  #unified-new-bill .bill-cart-table tbody td::before{font-size:10px;color:#647c8d}
  #unified-new-bill .invoice-summary{border-radius:11px;background:#fff;padding:13px}
  #unified-new-bill .invoice-summary .total-row strong{font-size:23px}
  #unified-new-bill .bill-final-actions [data-next="payment"]{min-height:50px;background:var(--swift-blue)!important}
  .swift-bill-optional{background:#fff;border:1px solid var(--swift-border);border-radius:10px;margin-bottom:9px;padding:0}
  .swift-bill-optional>summary{list-style:none;cursor:pointer;padding:12px 13px;display:flex;justify-content:space-between;align-items:center;gap:6px;font-weight:740;color:var(--swift-ink);min-height:45px}
  .swift-bill-optional>summary::-webkit-details-marker{display:none}
  .swift-bill-optional>summary::after{content:"＋";font-size:20px;color:var(--swift-blue)}
  .swift-bill-optional[open]>summary::after{content:"−"}
  .swift-bill-optional>.panel{border:none!important;box-shadow:none!important;margin:0!important}
  #unified-new-bill .bill-create-item-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  #unified-new-bill .bill-create-item-grid .pos-add-search{grid-column:1/-1}
  #unified-new-bill .bill-create-people{grid-template-columns:1fr}
  #unified-new-bill .field{margin-bottom:5px}
  /* Bills list is a compact mobile inbox rather than a desktop grid. */
  .swift-billing-list>.table-wrap{overflow-x:visible}
  .swift-billing-list table,.swift-billing-list tbody{display:block}
  .swift-billing-list thead{position:absolute!important;clip-path:inset(50%);width:1px;height:1px;overflow:hidden}
  .swift-billing-list tbody tr{display:grid;grid-template-columns:1fr auto;gap:3px 9px;padding:12px;margin:0 10px 9px;border:1px solid var(--swift-border);border-radius:9px;background:white}
  .swift-billing-list tbody td{display:block;padding:2px 0;border:0!important;font-size:12px}
  .swift-billing-list tbody td:nth-child(1){font-weight:800;color:var(--swift-ink)}
  .swift-billing-list tbody td:nth-child(2){grid-column:1/-1;grid-row:2;font-size:14px}
  .swift-billing-list tbody td:nth-child(3){grid-column:1;grid-row:3;color:var(--swift-grey)}
  .swift-billing-list tbody td:nth-child(4){grid-column:2;grid-row:3;color:var(--swift-grey)}
  .swift-billing-list tbody td:nth-child(5){grid-column:2;grid-row:1;text-align:right;font-weight:800}
  .swift-billing-list tbody td:nth-child(6){grid-column:1/-1;grid-row:4;display:flex;flex-wrap:wrap;gap:6px;align-items:center;border-top:1px solid #e8eff3!important;padding-top:8px;margin-top:5px}
  .swift-billing-list tbody tr:has(>td[colspan]){display:block}
  /* Stock catalogue: essential fields first; advanced editing on demand. */
  #stock-editor-table,#stock-editor-table tbody{display:block;width:100%;min-width:0!important}
  #stock-editor-table thead{position:absolute!important;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  #stock-editor-table tr[data-stock-row]{display:grid;grid-template-columns:1fr 1fr;gap:5px 9px;background:#fff;border:1px solid var(--swift-border);border-radius:10px;margin:0 0 9px;padding:10px}
  #stock-editor-table tr[data-stock-row] td{display:block;min-width:0;padding:2px;border:0!important}
  #stock-editor-table tr[data-stock-row] td::before{display:block;color:var(--swift-grey);font-size:10px;font-weight:600;margin-bottom:3px}
  #stock-editor-table tr[data-stock-row] td:nth-child(1){grid-column:2;grid-row:1;text-align:right}
  #stock-editor-table tr[data-stock-row] td:nth-child(2){grid-column:1/-1;grid-row:2}
  #stock-editor-table tr[data-stock-row] td:nth-child(2)::before{content:"Stock item"}
  #stock-editor-table tr[data-stock-row] td:nth-child(5){grid-column:1;grid-row:3}
  #stock-editor-table tr[data-stock-row] td:nth-child(5)::before{content:"Quantity"}
  #stock-editor-table tr[data-stock-row] td:nth-child(6){grid-column:2;grid-row:3}
  #stock-editor-table tr[data-stock-row] td:nth-child(6)::before{content:"Price (Rs.)"}
  #stock-editor-table tr[data-stock-row] td:nth-child(7){grid-column:1/-1;grid-row:4}
  #stock-editor-table tr[data-stock-row] td:nth-child(7)::before{content:"Expiry date"}
  #stock-editor-table tr[data-stock-row] td:nth-child(15){grid-column:1/-1;grid-row:5;margin-top:4px;border-top:1px solid #edf1f4!important;padding-top:7px}
  #stock-editor-table tr[data-stock-row] td:nth-child(15) .stock-row-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
  body.swift-enhanced #stock-editor-table tr[data-stock-row] td:nth-child(3),
  body.swift-enhanced #stock-editor-table tr[data-stock-row] td:nth-child(4),
  body.swift-enhanced #stock-editor-table tr[data-stock-row] td:nth-child(8),
  body.swift-enhanced #stock-editor-table tr[data-stock-row] td:nth-child(9),
  body.swift-enhanced #stock-editor-table tr[data-stock-row] td:nth-child(10),
  body.swift-enhanced #stock-editor-table tr[data-stock-row] td:nth-child(11),
  body.swift-enhanced #stock-editor-table tr[data-stock-row] td:nth-child(12),
  body.swift-enhanced #stock-editor-table tr[data-stock-row] td:nth-child(13),
  body.swift-enhanced #stock-editor-table tr[data-stock-row] td:nth-child(14){display:none}
  #stock-editor-table tr[data-stock-row].swift-stock-expanded td:nth-child(3),
  #stock-editor-table tr[data-stock-row].swift-stock-expanded td:nth-child(4),
  #stock-editor-table tr[data-stock-row].swift-stock-expanded td:nth-child(8),
  #stock-editor-table tr[data-stock-row].swift-stock-expanded td:nth-child(9),
  #stock-editor-table tr[data-stock-row].swift-stock-expanded td:nth-child(10),
  #stock-editor-table tr[data-stock-row].swift-stock-expanded td:nth-child(11),
  #stock-editor-table tr[data-stock-row].swift-stock-expanded td:nth-child(12),
  #stock-editor-table tr[data-stock-row].swift-stock-expanded td:nth-child(13),
  #stock-editor-table tr[data-stock-row].swift-stock-expanded td:nth-child(14){display:block;grid-column:1/-1;grid-row:auto}
  #stock-editor-table tr[data-stock-row].swift-stock-expanded td:nth-child(3)::before{content:"Display name"}
  #stock-editor-table tr[data-stock-row].swift-stock-expanded td:nth-child(4)::before{content:"Unit"}
  #stock-editor-table tr[data-stock-row].swift-stock-expanded td:nth-child(8)::before{content:"Low stock alert"}
  #stock-editor-table tr[data-stock-row].swift-stock-expanded td:nth-child(9)::before{content:"Medication"}
  #stock-editor-table tr[data-stock-row].swift-stock-expanded td:nth-child(10)::before{content:"Medicine form"}
  #stock-editor-table tr[data-stock-row].swift-stock-expanded td:nth-child(11)::before{content:"Single-form strength"}
  #stock-editor-table tr[data-stock-row].swift-stock-expanded td:nth-child(12)::before{content:"Strength unit"}
  #stock-editor-table tr[data-stock-row].swift-stock-expanded td:nth-child(13)::before{content:"When to take"}
  #stock-editor-table tr[data-stock-row].swift-stock-expanded td:nth-child(14)::before{content:"Special instructions"}
  .swift-stock-toggle{min-height:39px;border:1px solid #cbdfea;background:#eef6fa;border-radius:9px;padding:8px 10px;color:#205c7d;font-weight:750;font-size:12px}
  .stock-page-controls{display:flex;flex-wrap:wrap;gap:8px}
  .stock-bulk-toolbar{display:flex;flex-wrap:wrap;gap:7px}
  /* Cashier: active session, activity and shift operations as compact sections. */
  .swift-cash-tabs{display:flex;gap:4px;overflow-x:auto;margin:0 0 11px;padding:3px;background:#e3ebf1;border-radius:10px}
  .swift-cash-tabs button{flex:1 1 0;min-width:95px;min-height:42px;font-size:12px;font-weight:750;border:0;border-radius:8px;background:transparent;color:#59748a}
  .swift-cash-tabs button[aria-selected="true"]{background:white;color:var(--swift-blue);box-shadow:0 1px 4px #173e5115}
  body.swift-enhanced .swift-cash-hidden{display:none!important}
  #cashier-session-control-v56 .cashier-session-buttons-v56{gap:7px}
  #cashier-session-control-v56 .cashier-session-buttons-v56 .btn{min-height:43px}
  .cashier-movement-panel-v57{border:1px solid #dbe6ee;border-radius:10px;background:#f9fbfc;margin-top:10px}
  .cashier-movement-panel-v57 summary{min-height:44px;color:var(--swift-ink)}
  .cashbook-table-v56{min-width:760px}
  .cashier-session-modal-v56{padding:15px;width:calc(100vw - 24px);max-width:480px}
  .payment-simple .payment-total-banner{background:#e6f1f8;border-radius:11px}
  .payment-simple .payment-mode-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  /* Inventory / purchasing retains all cost, batch and bonus details, with card-like stacking. */
  .inventory-dashboard .table-wrap,.inventory-po-detail .table-wrap{max-width:100%}
  .table-wrap:focus-visible{outline:2px solid var(--swift-blue)}
}
@media screen and (max-width:380px){
  .swift-bottom-nav a,.swift-bottom-nav button{font-size:9px}
  #unified-new-bill .bill-cart-table tbody tr{padding:9px}
  .swift-queue-list tbody tr{margin-left:6px;margin-right:6px}
  .swift-cash-tabs button{min-width:83px;font-size:11px}
}
@media print{
 .swift-bottom-nav,.swift-note-tabs,.swift-phrase-toggle,.swift-stock-toggle,.swift-cash-tabs,.swift-phrase-backdrop{display:none!important}
 #visit-editor .note-field[hidden]{display:block!important}
 #stock-editor-table tr[data-stock-row] td{display:table-cell!important}
}