/* Mobile layouts have their own density and hierarchy; desktop styles remain in theme.css. */
.mobile-label,.mobile-nav-icon,.mobile-calendar,.mobile-order-sort,.mobile-calendar-move,.stage-reorder-controls,.mobile-calendar-hint { display:none; }
.calendar-scroll { min-width:0; }
.day-number,.order-name-link { color:inherit; text-decoration:none; }
.order-name-link:hover { text-decoration:underline; }
#picker-feedback { margin:12px 0; color:var(--muted); font-size:13px; line-height:1.4; }
#picker-quarter-panel[hidden] { display:none; }
.mobile-filter-backdrop { display:none; }

@media(max-width:900px) {
 .desktop-label { display:none; }
 .mobile-label { display:inline; }
 .calendar-scroll { display:none; }
 .mobile-calendar { display:block; }
 .mobile-calendar-weekdays,.mobile-calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:4px; }
 .mobile-calendar-weekdays { margin-bottom:8px; text-align:center; font-size:11px; color:var(--muted); }
 .mobile-calendar-grid { padding:10px; border:1px solid var(--border); border-radius:12px; background:var(--surface); }
 .mobile-calendar-day { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px; min-width:0; min-height:48px; padding:6px 0; border:1px solid transparent; border-radius:7px; background:transparent; color:var(--text); font:inherit; font-size:14px; cursor:pointer; }
 .mobile-calendar-day.has-conflict { border-color:var(--danger); }
 .mobile-calendar-day.is-outside { color:var(--muted); opacity:.45; }
 .mobile-calendar-day.is-today > span:first-child { font-weight:750; text-decoration:underline; text-underline-offset:4px; }
 .mobile-calendar-day[aria-pressed=true] { background:var(--primary); color:var(--primary-text); opacity:1; }
 .mobile-day-dots { display:flex; gap:2px; }
 .mobile-day-dots i { width:5px; height:5px; border-radius:50%; background:var(--border); }
 .mobile-calendar-caption { margin:10px 0 22px; color:var(--muted); font-size:12px; line-height:1.4; }
 .mobile-agenda-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin:0 0 12px; }
 .mobile-agenda-heading h3 { font-size:17px; margin:0; }
 .mobile-agenda-heading a { font-size:12px; text-decoration:none; flex:none; padding:10px 0; }
 .mobile-agenda { display:grid; gap:10px; }
 .mobile-agenda-card { display:block; padding:14px; border:1px solid var(--border); border-radius:10px; background:var(--surface); color:var(--text); text-decoration:none; }
 .mobile-agenda-card > div { display:flex; justify-content:space-between; align-items:baseline; gap:12px; color:var(--muted); font-size:12px; }
 .mobile-agenda-card strong { display:block; margin:8px 0; font-size:15px; line-height:1.4; overflow-wrap:anywhere; }
 .mobile-agenda-card p { margin:0; color:var(--muted); font-size:12px; line-height:1.5; }
 .mobile-agenda-conflict { margin:0; padding:12px; border:1px solid var(--danger); border-radius:10px; color:var(--danger); font-size:13px; line-height:1.4; }
 .mobile-agenda-empty { padding:20px 14px; border:1px dashed var(--border); border-radius:10px; color:var(--muted); text-align:center; font-size:14px; }
 .mobile-agenda-add { justify-self:start; margin-top:4px; }
 .table-container:has(> .mobile-card-table) { overflow:visible; border:0; background:transparent; box-shadow:none; }
 .mobile-card-table { display:block; width:100%; min-width:0 !important; }
 .mobile-card-table thead { display:none; }
 .mobile-card-table tbody { display:grid; gap:10px; }
 .mobile-card-table tbody tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 12px; padding:14px; border:1px solid var(--border); border-radius:10px; background:var(--surface); }
 .mobile-card-table tbody tr > td { display:block; width:auto !important; min-width:0; max-width:none; padding:0 !important; border:0 !important; white-space:normal !important; overflow-wrap:anywhere; text-align:left !important; }
 .mobile-card-table td[colspan] { grid-column:1/-1; }
 .orders-list-table .order-row { grid-template-areas:'number date' 'title title' 'client client' 'type status' 'amount quantity'; }
 .orders-list-table .order-row td:nth-child(1) { grid-area:number; font-size:12px; color:var(--muted) !important; }
 .orders-list-table .order-row td:nth-child(2) { grid-area:date; text-align:right !important; font-size:12px !important; }
 .orders-list-table .order-name-cell { grid-area:title; font-size:16px; line-height:1.4; }
 .orders-list-table .order-row > td { white-space:normal !important; }
 .orders-list-table .order-name-link { white-space:normal; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
 .orders-list-table .order-client-cell { grid-area:client; font-size:13px; color:var(--muted); }
 .orders-list-table td[data-label='Тип заказа'] { grid-area:type; }
 .orders-list-table td[data-label='Статус'] { grid-area:status; text-align:right !important; }
 .orders-list-table td[data-label='Сумма'] { grid-area:amount; margin-top:4px; font-size:15px; }
 .orders-list-table td[data-label='Количество'] { grid-area:quantity; text-align:right !important; align-self:end; font-size:13px; font-weight:400 !important; color:var(--muted); }
 .orders-list-table .trash-action-cell { grid-column:1/-1; grid-row:6; padding-top:8px !important; border-top:1px solid var(--border) !important; }
 .orders-list-table .trash-action-cell .btn { min-height:40px; width:auto; }
 .mobile-card-table .order-type-badge,.mobile-card-table .order-status-badge { font-size:11px; white-space:normal !important; }
 .clients-table .client-row { grid-template-columns:minmax(0,1fr) minmax(0,.65fr) minmax(0,1fr); gap:10px 8px; }
 .clients-table td:first-child { grid-column:1/-1; font-size:16px; line-height:1.4; }
 .clients-table td:nth-child(2) { grid-column:1/-1; color:var(--muted); font-size:13px; }
 .clients-table td.no-brand { display:none; }
 .clients-table td:nth-child(2)::before { content:'Бренд: '; }
 .clients-table td:nth-child(n+3)::before { content:attr(data-label); display:block; color:var(--muted); font-size:10px; margin-bottom:4px; font-weight:400; }
 .clients-table td:nth-child(3) { font-size:12px; }
 .clients-table td:nth-child(4) { text-align:center !important; font-size:14px; }
 .clients-table td:nth-child(5) { text-align:right !important; font-size:14px; font-weight:600; }
 .clients-orders-table td:nth-child(1) { grid-column:1; font-size:12px; }
 .clients-orders-table td:nth-child(2) { grid-column:2; text-align:right !important; color:var(--muted); font-size:12px; }
 .clients-orders-table td:nth-child(3) { grid-column:1/-1; font-size:15px; font-weight:600; line-height:1.4; }
 .clients-orders-table td:nth-child(4) { color:var(--muted); font-size:12px; }
 .clients-orders-table td:nth-child(5) { text-align:right !important; font-weight:600; }
 .clients-orders-table td:nth-child(6) { grid-column:1/-1; }
 .drafts-table td:first-child,.drafts-table td:last-child { grid-column:1/-1; }
 .drafts-table td:nth-child(2) { color:var(--muted); font-size:12px; }
 .mobile-order-sort { display:flex; justify-content:flex-end; align-items:center; gap:6px; margin:0 0 12px; }
 .mobile-order-sort label { display:flex; align-items:center; gap:8px; min-width:0; color:var(--muted); font-size:12px; }
 .mobile-order-sort select { max-width:180px; min-height:40px; padding:6px 9px; border:1px solid var(--border); border-radius:7px; background:var(--surface); color:var(--text); font:inherit; font-size:16px !important; }
 .mobile-order-sort button { width:40px; min-height:40px; padding:0; }
 .orders-toolbar { gap:12px; margin-bottom:12px; }
 .orders-tabs { display:flex; width:100%; gap:4px; flex-wrap:nowrap; }
 .orders-tabs > .tab-btn,.orders-tabs > .orders-more { flex:1; min-width:0; }
 .orders-tabs .tab-btn { display:flex; align-items:center; justify-content:center; gap:5px; min-height:42px; padding:8px 5px; font-size:12px !important; white-space:nowrap; }
 .orders-tabs .tab-count { font-size:11px; }
 .orders-tabs > .orders-more > summary { width:100%; }
 .orders-tabs .orders-more-menu .tab-btn { justify-content:space-between; }
 .orders-tools,.clients-tools { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px; width:100%; min-width:0; }
 .orders-search,.clients-tools #clients-search { grid-column:1; grid-row:1; width:100%; min-width:0; max-width:none; }
 .orders-period-control { grid-column:2; grid-row:1; min-width:0; max-width:100%; }
 .orders-search input[type=search],.clients-tools #clients-search { height:44px; min-height:44px; font-size:16px; padding:10px 12px; }
 .orders-filter-trigger { display:flex; align-items:center; justify-content:center; min-height:44px; font-size:12px !important; padding:8px 10px; }
 .orders-period-clear { height:36px; width:28px; }
 .orders-period-control.has-date .orders-filter-trigger { max-width:146px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
 .orders-filter-menu { position:fixed; z-index:2000; top:50%; left:50%; right:auto; transform:translate(-50%,-50%); width:min(360px,calc(100vw - 24px)); max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); overflow-y:auto; overscroll-behavior:contain; }
 .mobile-filter-backdrop.is-open { display:block; position:fixed; inset:0; z-index:1900; border:0; padding:0; background:#0006; }
 .range-day { height:40px; }
 .range-month-nav .btn { width:40px; min-height:40px; }
 .stage-reorder-controls { display:flex; justify-content:flex-end; gap:8px; grid-column:1/-1; }
 .stage-reorder-controls .btn { width:40px; min-height:40px; padding:0; }
 .mobile-calendar-move { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); gap:8px; width:100%; }
 .mobile-calendar-move label { display:grid; gap:5px; font-size:12px; }
 .mobile-calendar-move input,.mobile-calendar-move select { min-width:0; width:100%; min-height:44px; padding:8px; border:1px solid var(--border); border-radius:7px; background:var(--field); color:var(--text); }
 .mobile-calendar-move .btn { grid-column:1/-1; }
 #moveControlBar { left:12px !important; right:12px !important; bottom:80px !important; max-width:560px; margin-inline:auto; transform:none !important; padding:14px !important; flex-wrap:wrap; gap:10px !important; }
 #moveInfoText { width:100%; color:var(--text) !important; font-size:13px !important; line-height:1.4; }
 #moveControlBar > div:last-child,#moveControlBar > div:last-child .btn { width:100%; }
}

@media(max-width:700px) {
 :root { --mobile-nav-height:calc(64px + env(safe-area-inset-bottom)); }
 .container { width:100%; padding:0 14px; min-width:0; }
 .header { padding:0 14px; }
 .header-inner { display:flex; min-height:60px; height:60px; padding:0; flex-wrap:nowrap; gap:12px; }
 .header-inner > div:first-child { flex:1; min-width:0; }
 .header-inner > div:last-child { flex:none; gap:6px !important; }
 .header-inner .logo { font-size:18px; }
 .header-inner .nav { position:fixed; z-index:500; inset:auto 0 0; height:var(--mobile-nav-height); padding:6px 12px max(6px,env(safe-area-inset-bottom)); background:var(--surface); border-top:1px solid var(--border); display:grid !important; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px !important; }
 .nav-link { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; min-height:50px; font-size:11px; line-height:1.2; border-radius:8px; }
 .nav-link[style] { background:var(--hover); }
 .mobile-nav-icon { display:block; }
 .header-inner .btn { min-height:40px; padding:8px 10px; font-size:12px; }
 body .dark-mode-toggle { width:40px; min-width:40px; height:40px; }
 .footer { margin-bottom:var(--mobile-nav-height); padding-block:16px; }
 .footer > div { gap:12px; }
 main.container { padding-top:16px; }
 h1,h2 { line-height:1.3; }
 .clients-page-heading,.list-page-heading { flex-wrap:nowrap !important; gap:12px !important; margin-bottom:16px !important; }
 .clients-page-heading h1,.list-page-heading h2 { font-size:22px; margin:0; }
 .clients-page-heading .btn,.list-page-heading .btn { flex:none; min-height:44px; padding:10px 12px; font-size:13px; }
 .btn { min-height:44px; border-radius:7px; }
 .card-box { padding:16px; border-radius:10px; }
 .calendar-header { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; margin-bottom:18px; }
 .calendar-header .month-nav { position:static !important; min-width:0; }
 .calendar-header .month-nav:first-child { grid-column:1/-1; width:100%; }
 .calendar-header .month-nav:first-child > div { width:100%; display:grid !important; grid-template-columns:1fr 1fr; gap:4px !important; }
 .calendar-header .tab-btn { display:flex; align-items:center; justify-content:center; min-height:42px; padding:8px; font-size:11px !important; }
 .calendar-header .month-nav:nth-child(2) { display:grid; grid-template-columns:40px minmax(0,1fr) 40px; gap:6px; }
 .calendar-header h2 { min-width:0; font-size:17px; text-align:center; }
 .calendar-header .month-nav .btn { padding:8px; min-height:40px; }
 .calendar-header .month-nav:last-child { justify-self:end; }
 .stats-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:18px; }
 .stat-card { padding:12px 10px; }
 .stat-card-title { font-size:10px; line-height:1.4; }
 .stat-card-value { font-size:17px; }
 .load-track { margin-top:8px; }
 .order-detail-toolbar { margin-bottom:12px !important; }
 .order-detail-toolbar > a.btn-outline,.order-form-back a.btn-outline { min-height:36px; padding:6px 0; border:0 !important; background:transparent !important; font-size:13px; }
 .order-detail-heading { gap:10px !important; margin-bottom:16px !important; padding-bottom:14px !important; }
 .order-detail-heading h1 { font-size:21px !important; line-height:1.35; overflow-wrap:anywhere; }
 .order-detail-heading .order-type-badge { padding:4px 8px !important; font-size:10px !important; }
 .order-action-panel { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-bottom:20px; width:100%; }
 .order-action-panel > a { display:flex; align-items:center; justify-content:center; font-size:12px; padding:8px 6px; text-align:center; white-space:normal; }
 .order-action-panel > a:nth-child(3) { grid-column:1; grid-row:2; }
 .order-action-panel > .order-create-batch { box-shadow:none; grid-column:1/-1; grid-row:3; }
 .order-actions-more { grid-column:2; grid-row:2; margin:0; justify-self:end; }
 .order-actions-more > summary { display:flex; align-items:center; justify-content:center; height:100%; min-height:44px; font-size:12px; }
 .order-action-panel:has(> a[href$='/restore']) .order-actions-more { grid-row:1; }
 .order-detail-facts { padding:14px; }
 .order-detail-facts .info-row { display:grid; grid-template-columns:minmax(0,.85fr) minmax(0,1.4fr); gap:8px; margin-bottom:12px; font-size:13px; }
 .order-detail-facts .info-row strong { min-width:0; text-align:right; overflow-wrap:anywhere; }
 .order-detail-facts .order-delivery-row { grid-template-columns:1fr; gap:6px; }
 .order-detail-facts .order-delivery-row strong { max-width:none; text-align:left; line-height:1.5; font-weight:500; }
 .history-list { max-height:60dvh; padding-right:8px; }
 .history-entry { flex-wrap:wrap; gap:10px; padding:14px 0; }
 .history-entry-text { flex-basis:100%; }
 .history-entry > .btn { min-height:40px; width:100%; font-size:12px; white-space:normal; }
 .restore-scopes,.restore-panel .form-actions { display:flex; flex-wrap:wrap; gap:8px; }
 .restore-scopes a { flex:1 1 100%; }
 .day-page-heading { display:grid !important; grid-template-columns:1fr auto; gap:12px; }
 .day-page-heading h2 { grid-column:1/-1; grid-row:1; font-size:20px; }
 .day-order-card { padding:14px !important; }
 .day-order-card > div:last-child { flex-wrap:wrap; }
 .day-order-card > div:last-child > a { flex:1; font-size:12px; padding:8px; }
 .day-order-card > div:last-child > form { flex:1; }
 .client-detail-page > h1 { margin-top:4px; font-size:23px; line-height:1.35; overflow-wrap:anywhere; }
 .client-brand-caption,.client-type-caption { font-size:13px; }
 .client-stats { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:18px 0; }
 .client-stat { padding:12px 9px; }
 .client-stat span { font-size:10px; }
 .client-stat strong { margin-top:6px; font-size:14px; line-height:1.4; overflow-wrap:anywhere; }
 .client-details-card h2,.client-logistics-card h2,.client-documents-card h2,.client-orders-card h2 { font-size:17px; }
 .client-details-grid { gap:14px; }
 .client-details-grid .client-optional-empty { display:none; }
 .client-details-grid dd { font-size:14px; }
 .client-legal-row { gap:8px; }
 .client-legal-row strong { min-width:0; overflow-wrap:anywhere; }
 .client-documents-heading { align-items:flex-start; gap:12px; }
 .client-document-upload { width:100%; min-height:44px; text-align:center; }
 .client-document-actions { width:100%; gap:8px; }
 .client-document-actions .btn { flex:1; min-height:40px; }
 .client-document-delete { padding-inline:12px; }
 .order-form-back { margin-bottom:10px !important; }
 .order-section-heading { margin-bottom:12px; font-size:18px; }
 .order-form-shell .form-block-card { padding:16px; margin-bottom:18px; border-radius:10px; }
 .passport-row { display:grid !important; grid-template-columns:minmax(0,1fr) minmax(0,1.4fr); gap:12px !important; }
 .passport-row > .form-group { min-width:0 !important; }
 .passport-row #group-name { grid-column:1/-1; }
 .passport-client-row .client-picker-group { grid-column:1/-1; grid-row:1; }
 .passport-client-row > .form-group:first-child { grid-column:1/-1; }
 .order-form-shell .position-card { padding:14px; margin-bottom:12px; border-radius:10px; }
 .order-form-shell .position-heading { margin-bottom:14px; padding-bottom:10px; align-items:center; gap:8px; }
 .position-toggle { flex-wrap:nowrap; min-height:40px; gap:8px; }
 .pos-header-title { font-size:15px; }
 .position-toggle-label { margin-left:auto; width:auto; font-size:11px !important; flex:none; }
 .position-heading .pos-delete-btn { min-height:40px; font-size:11px; padding:6px 8px; }
 .position-reference-fields { grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:12px !important; }
 .position-reference-fields > div:nth-child(3) { grid-column:1/-1; }
 .order-form-shell .field-title { font-size:12px; margin-bottom:6px; }
 .order-form-shell input:not([type=checkbox]):not([type=radio]):not([type=hidden]),.order-form-shell select { min-height:44px; }
 .order-form-shell select { appearance:auto !important; padding-right:10px !important; }
 .order-form-shell .emb-row { display:grid !important; grid-template-columns:80px minmax(0,1fr) 40px; }
 .emb-row > select:first-child { grid-column:1/-1; width:100%; }
 .emb-row > select:nth-child(2) { grid-column:1; width:100%; }
 .emb-row .unit-price-field { grid-column:2; min-width:0; }
 .emb-row .unit-price-field input { flex:1; min-width:0; width:100%; }
 .emb-row .unit-price-field span { font-size:12px; white-space:nowrap; }
 .emb-row > .btn-danger { grid-column:3; width:40px; padding:0; }
 .order-form-shell .mobile-size-table,.mobile-size-table { display:block; min-width:0; width:100%; border-spacing:0; }
 .mobile-size-table thead { display:none; }
 .mobile-size-table tbody { display:block; }
 .mobile-size-table tbody tr { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
 .mobile-size-table tbody td { display:block; padding:0 !important; border:0 !important; min-width:0 !important; width:auto !important; text-align:center; }
 .mobile-size-table td::before { content:attr(data-label); display:block; margin:0 0 5px; font-size:11px; color:var(--muted); font-weight:400; }
 html body .order-form-shell .mobile-size-table td.pos-total-cell { border-left:0 !important; }
 .mobile-size-table td.pos-total-cell { grid-column:1/-1; min-width:0 !important; max-width:none !important; width:100% !important; padding:8px !important; border-left:0 !important; }
 .mobile-size-table .size-cell-box { width:100%; }
 .mobile-size-table .size-input { min-height:44px; width:100%; text-align:center; }
 .mobile-size-table .stepper-btn { display:none; }
 .size-grid-wrapper { overflow:visible; }
 .position-price-summary { gap:8px; flex-wrap:wrap; }
 .honest-sign-option { align-items:flex-start !important; }
 .order-checkout { bottom:calc(var(--mobile-nav-height) + 8px); margin-top:18px; padding:12px; border-radius:10px; }
 .order-checkout .pricing-total { display:flex; justify-content:space-between; padding-bottom:10px; gap:8px; }
 .order-checkout .pricing-total > div:nth-child(-n+2) { display:none; }
 .order-checkout .checkout-quantity { font-size:11px; }
 .order-checkout .pricing-grand-total { font-size:16px; }
 .order-checkout .form-actions { display:flex; flex-wrap:nowrap; gap:8px !important; }
 .order-checkout .form-actions .btn { flex:1; margin:0; font-size:12px; padding:10px 8px; white-space:normal; }
 .order-checkout .form-actions .btn-primary { flex:1.4; margin:0; }
 .order-checkout .checkout-cancel { display:none; }
 #sortable-stages .stage-item-row { grid-template-columns:minmax(0,1fr) 68px 40px; gap:8px; padding:12px; }
 #sortable-stages .stage-item-row > span:first-child { display:none; }
 #sortable-stages .stage-item-row > input[readonly] { grid-column:1/3; grid-row:1; }
 #sortable-stages .btn-danger { grid-column:3; grid-row:1; min-height:40px; width:40px; }
 #sortable-stages .stage-dates-display { grid-column:1/-1; grid-row:2; font-size:11px !important; line-height:1.4; }
 #sortable-stages .duration-select { grid-column:1; grid-row:3; width:100% !important; min-width:0; max-width:none; }
 #sortable-stages .custom-duration { grid-column:2/4; grid-row:3; width:100% !important; }
 #sortable-stages .stage-item-row:not(:has(.custom-duration[style*='inline-block'])) .duration-select { grid-column:1/-1; }
 #sortable-stages .btn-outline { grid-column:1; grid-row:4; min-height:40px; font-size:12px; padding:8px; }
 #sortable-stages .stage-reorder-controls { grid-column:2/4; grid-row:4; }
 #sortable-stages .stage-reorder-controls .btn { min-height:40px; width:40px; padding:0; }
 .modal-overlay,.confirm-modal-overlay { padding:12px; overflow-y:auto; overscroll-behavior:contain; }
 .modal-content,.confirm-modal-content { width:100%; max-width:calc(100vw - 24px) !important; max-height:calc(100dvh - 24px); margin:auto; padding:18px; overflow-y:auto; border-radius:12px; }
 .modal-content h3 { padding-right:34px; font-size:18px; }
 .modal-close { display:grid; place-items:center; top:8px; right:8px; width:36px; height:36px; }
 #summaryModal .modal-content,#calendarModal .modal-content { display:flex; flex-direction:column; overflow:hidden; }
 #summaryContent { min-height:0; max-height:none !important; overflow-y:auto; }
 #summaryModal .modal-content > div:last-child { flex-shrink:0; display:flex; gap:8px !important; }
 #summaryModal .modal-content > div:last-child .btn { flex:1; font-size:12px; white-space:normal; }
 #calendarModal .modal-content > * { flex-shrink:0; }
 #calendarModal #pickerGrid { flex-shrink:1; min-height:0; overflow-y:auto; max-height:42dvh; }
 .confirm-modal-buttons { gap:8px !important; }
 .confirm-modal-buttons .btn { flex:1; font-size:13px; }
 .client-modal { width:calc(100vw - 24px); max-height:calc(100dvh - 24px); border-radius:12px; }
 .client-modal form { max-height:calc(100dvh - 26px); }
 .client-modal-heading,.client-modal-body,.client-modal-actions { padding-inline:16px; }
 .client-modal-heading h2 { font-size:19px; }
 .client-modal-close { width:36px; height:36px; }
 .client-type-switch span { min-height:44px; font-size:12px; padding:8px 5px; }
 .client-contact-row { grid-template-columns:96px minmax(0,1fr) 36px; gap:8px; }
 .client-contact-row select { grid-column:auto; }
 .client-contact-row input,.client-contact-row select { min-height:44px; }
 .client-row-remove,.client-legal-remove { width:36px; height:44px; }
 .client-modal-actions .btn { flex:1; font-size:13px; }
 .client-text-action { min-height:40px; }
 .orders-more-menu a,.orders-more-menu button { min-height:40px; }
 #moveControlBar { bottom:calc(var(--mobile-nav-height) + 10px) !important; }
}

@media(max-width:700px),(pointer:coarse) {
 input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea { font-size:16px !important; }
 .client-picker-toggle { width:44px; }
 .client-picker #client-search { padding-right:46px !important; }
 .picker-mobile-day { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; min-height:44px; min-width:0; padding:6px 0; border:1px solid var(--border); border-radius:6px; background:var(--field); color:var(--text); font:inherit; font-size:14px; cursor:pointer; }
 .picker-mobile-day[aria-pressed=true],.picker-mobile-day.selected { background:var(--hover); border-color:var(--accent); }
 .picker-mobile-day:disabled { opacity:.4; }
 .picker-availability { display:flex; gap:2px; }
 .picker-availability i { width:5px; height:4px; border-radius:1px; background:var(--accent); }
 .picker-availability i.occupied { background:var(--muted); }
 #picker-quarter-panel { margin-bottom:12px; }
 #picker-quarter-date { display:block; margin:0 0 8px; font-size:13px; }
 #picker-quarter-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
 #picker-quarter-choices .btn { min-height:44px; font-size:14px; padding:8px; }
 #picker-quarter-choices [aria-pressed=true] { border-color:var(--accent); background:var(--hover); }
 .attachment-dialog .attachment-close { width:40px; min-height:40px; }
 .btn-file-upload { display:inline-flex; align-items:center; min-height:44px; }
 .login-card button { min-height:44px; }
}
@media(min-width:601px) and (max-width:900px) {
 .mobile-card-table tbody,.mobile-agenda { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .mobile-card-table .clients-empty-row { grid-column:1/-1; }
 .mobile-agenda-add,.mobile-agenda-empty,.mobile-agenda-conflict { grid-column:1/-1; }
}
@media(max-width:360px) {
 .container { padding-inline:12px; }
 .mobile-calendar-grid { gap:2px; padding:8px; }
 .mobile-day-dots { gap:1px; }
 .mobile-day-dots i { width:4px; height:4px; }
 .client-contact-row { grid-template-columns:minmax(0,1fr) 36px; }
 .client-contact-row select { grid-column:1/-1; }
 .clients-table td:nth-child(5) { font-size:12px; }
}
@media(max-height:600px) and (max-width:900px) {
 .order-checkout { position:static; }
 #pickerGrid { max-height:26dvh !important; overflow-y:auto; }
 #calendarModal .modal-content { padding:14px; overflow-y:auto; }
 #moveControlBar { max-height:calc(100dvh - 24px); overflow-y:auto; bottom:12px !important; }
}

@media(max-width:700px) { .mobile-keyboard-open .header-inner .nav { display:none !important; } .mobile-keyboard-open .order-checkout { position:static; } }
