.mobile-order label { display: grid; gap: 5px; min-width: 0; }
.mobile-order input, .mobile-order textarea {
 width: 100%; min-height: 44px; padding: 9px; font: inherit; color: inherit;
 border: 1px solid #cbd9e8; border-radius: 8px; box-sizing: border-box;
}
.order-search { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 6px; }
.order-search button { display: flex; align-items: center; gap: 4px; }
.order-matches:not([hidden]) {
 display: grid; max-height: 260px; overflow: auto; border: 1px solid #cbd9e8;
 background: white; border-radius: 8px; margin-top: 4px;
}
.order-matches button {
 text-align: left; min-height: 44px; padding: 9px; background: white; color: inherit;
 font: inherit; border: 0; border-bottom: 1px solid #dce4ee;
}
.mobile-order article {
 display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px;
 padding: 10px; margin-top: 8px; border: 1px solid #cbd9e8; border-radius: 8px; background: white;
}
.mobile-order article strong { grid-column: 1 / -1; }
.mobile-order article input { width: 84px; }
.order-actions { display: flex; gap: 8px; }
.mobile-order dialog > label { margin: 10px; }
.mobile-order [data-order-status]:empty { display: none; }
.mobile-order-screen .mobile-header {
 display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 4px 10px;
}
.mobile-order-screen .mobile-header > div { display: contents; }
.mobile-order-screen .mobile-header img { width: 72px; height: 28px; }
.mobile-order-screen .mobile-header > div > span { display: none; }
.mobile-order-screen .mobile-company { margin: 0; min-width: 0; min-height: 44px; padding: 4px 8px; gap: 0 4px; }
.mobile-order-screen .mobile-company > span:first-child { display: none; }
.mobile-order-screen .mobile-company strong { font-size: .8rem; line-height: 1.15; align-self: center; }
.mobile-order-screen #mobile-content { padding: 6px 10px 12px; }
.mobile-order-screen .mobile-order h1 { font-size: 1.125rem; margin: 0 0 4px; }
.mobile-order [data-list] { margin-block: 4px 8px; font-size: .82rem; }
.mobile-order article {
 grid-template-columns: minmax(0, 1fr) auto 44px; gap: 4px; padding: 6px 8px;
}
.mobile-order article strong { grid-column: 1 / 3; font-size: .92rem; }
.mobile-order article > span { grid-column: 1; font-size: .79rem; }
.order-quantity { display: flex; grid-column: 2; align-items: center; }
.order-quantity button, .order-remove {
 min-width: 44px; min-height: 44px; border: 0; border-radius: 8px;
 background: #eaf1fb; color: #164ba2; font: 600 1.15rem system-ui;
}
.order-quantity button:disabled { opacity: .4; }
.mobile-order article .order-quantity input { width: 53px; text-align: center; padding-inline: 3px; appearance: textfield; }
.order-quantity input::-webkit-inner-spin-button { appearance: none; }
.order-remove { grid-column: 3; grid-row: 1 / span 2; background: transparent; color: #4a6079; }
.mobile-order .order-remove {
 width: 44px; min-width: 44px; height: 44px; padding: 0;
 border: 1px solid #dce4ee; background: #fff; color: #164ba2; font-size: 1.2rem;
}
.order-client-dialog form { margin: 0; }
.order-client-fields { display: grid; gap: 9px; padding: 12px; max-height: 55dvh; overflow: auto; }
.order-client-fields select { min-height: 44px; width: 100%; font: inherit; }
.order-client-dialog [role="status"] { margin-block: 6px; }

/* Mobile order: customer actions stay with the customer, quantities with the price. */
.order-client-card { background:#fff; border:1px solid #dce4ee; border-radius:10px; padding:4px 8px 6px; margin-bottom:6px; }
.order-client-heading { display:flex; align-items:center; justify-content:space-between; gap:4px; margin-bottom:4px; }
.order-client-heading strong { font-size:.85rem; }
.order-client-label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.order-client-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:4px; }
.order-client-actions button { color:#164ba2; padding:4px 7px; font-size:.8rem; }
.order-client-actions button[hidden] { display:none; }
.mobile-order .order-client-card [data-list] { margin:3px 0 0; }
.mobile-order article strong { grid-column:1 / -1; padding-bottom:4px; }
.mobile-order .order-remove { grid-column:3; grid-row:2; align-self:center; margin:0; display:grid; place-items:center; }
.order-quantity { grid-row:2; }
.mobile-order .order-client-dialog { box-sizing:border-box; width:540px; max-width:calc(100vw - 16px); height:min(800px,calc(100dvh - 16px)); max-height:calc(100dvh - 16px); padding:0; overflow:hidden; }
.mobile-order .order-client-dialog[open] { display:flex; flex-direction:column; }
.order-client-dialog::backdrop { background:#132d465c; }
.mobile-order .order-client-dialog > header { flex:none; padding:10px 14px; min-height:48px; gap:8px; }
.order-client-dialog > header strong { flex:1; }
.order-client-dialog > header button { width:44px; height:44px; padding:0; flex-shrink:0; }
.order-client-dialog > header .nv-window-help { width:auto; padding:6px 8px; border:1px solid #dce4ee; border-radius:8px; background:white; color:#164ba2; font:inherit; }
.mobile-order .order-client-dialog form { display:flex; flex-direction:column; flex:1; min-height:0; overflow:hidden; }
.mobile-order .order-client-fields { flex:1; min-height:0; max-height:none; overflow:auto; padding:14px 16px 24px; gap:12px; align-content:start; }
.order-client-fields h2 { margin:10px 0 0; font-size:1rem; padding-bottom:8px; border-bottom:1px solid #dce4ee; }
.order-client-fields h2:first-child { margin-top:0; }
.order-client-fields label { font-size:.86rem; gap:5px; }
.order-client-fields input,.order-client-fields select { background:#fff; border:1px solid #cbd9e8; border-radius:8px; padding:10px; font-size:16px; color:#182b45; box-sizing:border-box; min-width:0; }
.order-client-dialog form > footer { display:grid; grid-template-columns:auto 1fr; gap:8px; padding:12px 16px max(12px,env(safe-area-inset-bottom)); border-top:1px solid #dce4ee; flex:none; background:#fff; }
.order-client-dialog form > [role=status]:empty { display:none; }
.order-client-dialog form > [role=status] { padding:8px 16px; max-height:90px; overflow:auto; font-size:.85rem; }
.order-tax { padding:10px; border-radius:10px; background:#eef4fb; }
.order-tax p { font-size:.8rem; line-height:1.4; }
.order-tax > button { width:100%; padding:8px; color:#164ba2; }
.order-client-fields .order-tax-choice { display:flex; align-items:center; gap:10px; padding:7px 0; }
.order-client-fields .order-tax-choice input { width:22px; min-height:22px; height:22px; flex:none; }
@media(max-width:600px) {
 .mobile-order .order-client-dialog { width:100vw; max-width:100vw; height:100dvh; max-height:100dvh; margin:0; border:0; border-radius:0; }
}

.order-review-client:not([hidden]) { display:grid; gap:3px; background:#fff; border:1px solid #cbd9e8; border-radius:10px; padding:10px; margin-bottom:10px; }
.order-review-client small,.order-review-client span { color:#54647a; font-size:.8rem; }

.mobile-order [data-branch-wrap]:not([hidden]) { margin:10px 0; }
.mobile-order [data-branch] { min-height:44px; border:1px solid #cbd9e8; border-radius:8px; padding:9px; background:white; color:inherit; font:inherit; }

.mobile-order .order-history { width:540px; max-width:calc(100vw - 16px); max-height:calc(100dvh - 24px); overflow:auto; }
.order-history [data-results] { padding:10px; }
.order-history article { display:flex; flex-direction:column; align-items:stretch; }
.order-history footer { position:sticky; bottom:0; background:white; }

.mobile-order .order-send-button { display:inline-flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; width:calc(50% - 5px); min-height:96px; margin:12px 4px 0 0; padding:12px 8px; border-radius:8px; color:#164ba2; font-size:.85rem; }
.order-send-button svg { width:28px; height:28px; }

.order-client-dialog > footer {display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:12px;background:white;border-top:1px solid #dce4ee;flex:none;}
.mobile-order .order-client-dialog > footer .order-send-button {width:100%;margin:0;min-height:72px;}
.order-client-dialog [data-detail] p {padding:12px;border:1px solid #dce4ee;border-radius:8px;}

.mobile-order .order-edit-prices {grid-column:1 / -1;display:grid;grid-template-columns:1fr 1fr;gap:12px;width:100%;}
.mobile-order .order-edit-prices label {min-width:0;font-size:.8rem;}
.mobile-order .order-edit-prices input {width:100%;box-sizing:border-box;text-align:right;}
.order-client-dialog [data-total] {font-weight:700;color:#182b45;}

.mobile-shared-customer[open] {
 position: fixed;
 inset: 0;
 margin: auto;
 width: calc(100% - 16px);
 max-width: 650px;
 height: min(850px, calc(100dvh - 24px));
 padding: 0;
 border: 0;
 background: white;
 display: flex;
 flex-direction: column;
}
.mobile-shared-customer .customer-footer { flex-wrap: wrap; }

.mobile-shared-customer .window-title,
.mobile-shared-customer .customer-toolbar { padding: 6px 12px; }
.mobile-shared-customer .customer-toolbar h2 { margin: 0; font-size: 1rem; }
.mobile-shared-customer .customer-breadcrumb,
.mobile-shared-customer .customer-section-heading { display: none; }

/* Compact order workspace, with the existing controls available from the client row. */
.mobile-order-screen .mobile-header {padding:6px 12px;gap:6px;}
.mobile-order-screen .mobile-header > div > span {display:none;}
.mobile-order-screen .mobile-header img {width:82px;height:30px;}
.mobile-order-screen .mobile-header .nv-window-help {padding:6px;min-width:44px;}
.mobile-order-screen .mobile-header .nv-window-help span {display:none;}
.mobile-order-screen #mobile-content {padding:16px 14px 190px;}
.mobile-order-screen .mobile-bottom {position:fixed;bottom:0;width:100%;max-width:540px;z-index:10;padding:5px 10px calc(5px + env(safe-area-inset-bottom));height:calc(72px + env(safe-area-inset-bottom));}
.mobile-order h1 {font-size:23px;margin:0 0 14px;}
.order-client-toggle {width:100%;min-height:44px;border:0;background:white;text-align:left;font:600 14px system-ui;color:#173b4b;padding:4px;}
.order-client-toggle[hidden], [data-client-controls][hidden] {display:none;}
.mobile-order .order-client-card {padding:9px 12px;margin-bottom:16px;}
.mobile-order .order-client-card [data-list] {margin:0 4px;font-size:12px;}
.mobile-order .order-search {gap:8px;}
.mobile-order .order-search label {font-size:12px;}
.mobile-order .order-search input {font-size:16px;background:white;}
.mobile-order article {padding:13px;margin-top:10px;border-radius:13px;grid-template-columns:minmax(0,1fr) auto 36px;gap:8px;}
.mobile-order article > strong {grid-column:1 / 3;font-size:14px;line-height:1.4;}
.mobile-order .order-remove {grid-column:3;grid-row:1;width:36px;min-width:36px;height:36px;min-height:36px;}
.mobile-order article > span {grid-column:1;font-size:14px;}
.mobile-order .order-quantity {grid-column:2 / 4;grid-row:2;gap:4px;}
.mobile-order .order-quantity input {width:46px;font-size:16px;}
.order-quantity button {background:#edf5f7;color:#125267;}
.order-dock {position:fixed;bottom:calc(72px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:100%;max-width:540px;background:white;border-top:1px solid #d4e2e7;padding:12px 14px;display:flex;align-items:center;justify-content:space-between;gap:10px;z-index:9;}
.order-dock > strong {font-size:17px;min-width:0;}
.order-dock .order-actions {gap:5px;}
.order-dock button {font-size:13px;padding:10px;white-space:nowrap;}
.mobile-order .mobile-main {background:#125267;border-color:#125267;}
@media(max-width:360px){.order-dock{flex-wrap:wrap}.order-dock .order-actions{flex:1;justify-content:flex-end}.mobile-order article > span{font-size:12px}}

.mobile-order-screen .mobile-header {display:flex;}
.mobile-order-screen .mobile-header > div {display:flex;}

.mobile-finance-host{position:fixed;inset:0;z-index:50000;background:#f4f8fb;display:flex;flex-direction:column;}
.mobile-finance-host[hidden]{display:none;}
.mobile-finance-host>header{display:flex;align-items:center;gap:12px;padding:6px 12px;background:white;border-bottom:1px solid #d4e2e7;}
.mobile-finance-host>header strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.mobile-finance-host iframe{flex:1;width:100%;border:0;min-height:0;}

/* Match the approved compact mockup; these override the base mobile controls. */
.nuvile-mobile-body.mobile-order-screen .mobile-order h1{font-size:23px;line-height:1.25;margin:0 0 14px;}
.nuvile-mobile-body.mobile-order-screen .mobile-order [data-order-status]{font-size:12px;line-height:1.4;margin:6px 0;color:#477384;}
.nuvile-mobile-body.mobile-order-screen .mobile-order [data-order-status]:empty{display:none;}
.nuvile-mobile-body.mobile-order-screen .order-client-toggle{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0;min-height:30px;font-size:14px;border:0;border-radius:0;}
.nuvile-mobile-body.mobile-order-screen .order-client-toggle[hidden]{display:none;}
.nuvile-mobile-body.mobile-order-screen .order-client-toggle strong{font-size:14px;line-height:1.4;text-align:left;}
.nuvile-mobile-body.mobile-order-screen .order-client-card{padding:12px;margin:0 0 16px;}
.nuvile-mobile-body.mobile-order-screen .order-client-card [data-list]{font-size:12px;margin:4px 0 0;color:#64808c;}
.nuvile-mobile-body.mobile-order-screen .order-search label{font-size:0;gap:0;}
.nuvile-mobile-body.mobile-order-screen .order-search input{font-size:16px;min-height:46px;padding:12px;}
.nuvile-mobile-body.mobile-order-screen [data-catalog]{background:#125267;color:white;border-color:#125267;min-width:48px;width:48px;padding:10px;font-size:0;}
.nuvile-mobile-body.mobile-order-screen [data-catalog] svg{width:22px;height:22px;}
.order-search-hint{display:block;font-size:12px;color:#68818b;margin:8px 0 14px;}
.nuvile-mobile-body.mobile-order-screen .mobile-order article{padding:13px;gap:8px;margin-top:10px;}
.nuvile-mobile-body.mobile-order-screen .mobile-order article>strong{font-size:14px;line-height:1.4;}
.order-unit-price b{display:block;font-size:17px;font-weight:650;white-space:nowrap;}
.order-unit-price small{display:block;font-size:11px;color:#64808c;}
.order-line-subtotal{grid-column:1/-1;font-size:12px;color:#64808c;}
.nuvile-mobile-body.mobile-order-screen .order-quantity button{width:42px;min-width:42px;min-height:44px;height:44px;padding:0;font-size:22px;}
.nuvile-mobile-body.mobile-order-screen .order-quantity input{width:48px;min-height:44px;height:44px;font-size:16px;padding:6px;}
.nuvile-mobile-body.mobile-order-screen .order-dock>strong{font-size:20px;}
.nuvile-mobile-body.mobile-order-screen .order-dock button{font-size:13px;min-height:46px;font-weight:600;}
.nuvile-mobile-body.mobile-order-screen .mobile-bottom button{font-size:11px;min-height:56px;gap:3px;}

/* Clear separation between the completed order actions. */
.mobile-order-completed > button{display:flex!important;width:100%;margin:12px 0!important;min-height:48px;}
.mobile-order-completed > button:first-of-type{background:white!important;color:var(--nuvile-primary,#125267)!important;border:1px solid #d8e4e8!important;}
.mobile-invoice-host{background:rgba(16,44,55,.42)!important;backdrop-filter:blur(3px);}
.mobile-invoice-host>header{background:white;border-radius:14px;margin:8px 12px;padding:8px 12px;}
.mobile-invoice-host iframe{background:transparent!important;}
