/* iPad-class touch screens: desktop structure, readable controls, local scrolling. */
@media screen and (min-width:769px) and (max-width:1180px) and (pointer:coarse) {
  :root { --nav-w:84px; --tablet-points:210px; --tablet-rides:250px; }
  html, body { margin:0 !important; padding:0 !important; -webkit-text-size-adjust:100%; }
  html body .themed-nav-wrapper {
    position:fixed !important; top:var(--crm-viewport-top,0px) !important; left:0; right:0;
    height:var(--crm-viewport-height,100dvh) !important; min-height:0 !important; width:100% !important;
    margin:0 !important; padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px) !important;
    border-radius:0 !important; box-sizing:border-box; overflow:hidden;
  }
  html body .themed-nav-wrapper > .ecocrm-sidebar,
  html body .themed-nav-wrapper > .ecocrm-sidebar:hover {
    width:84px !important; min-width:84px !important; flex:0 0 84px !important;
    margin-right:0 !important; padding:78px 4px 8px !important;
    overflow-y:auto; overscroll-behavior:contain; box-shadow:none; transition:none !important;
  }
  html body .ecocrm-sidebar button, html body .ecocrm-sidebar:not(:hover) button {
    display:flex !important; flex-direction:column; align-items:center; justify-content:center !important;
    min-height:44px !important; height:auto !important; padding:5px 2px !important; gap:3px !important;
    font-size:10px !important; line-height:1.15; white-space:nowrap; overflow-wrap:normal; width:100% !important;
    color:var(--tw-muted-fg,#b8b1a4) !important; touch-action:manipulation;
  }
  html body .ecocrm-sidebar button svg { width:18px; height:18px; flex-shrink:0; color:#d4a449 !important; }
  html body .ecocrm-sidebar .ecocrm-brand,html body .ecocrm-sidebar:hover .ecocrm-brand {
    top:10px !important; height:54px !important; padding:3px !important;
  }
  html body .ecocrm-sidebar .ecocrm-brand img { height:44px !important; max-height:44px !important; }
  html body .themed-nav-wrapper > .view { min-width:0; min-height:0; overflow:hidden; }
  html body .themed-nav-wrapper > .view > .page { padding:14px !important; min-width:0; min-height:0; }
  html body .themed-nav-wrapper .page--detail .detail-summary { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; }
  html body .themed-nav-wrapper .page--detail .detail-summary > * { min-width:0; }
  html body .themed-nav-wrapper .page--detail .detail-summary .kv { grid-template-columns:minmax(95px,.7fr) minmax(0,1fr); }
  html body .themed-nav-wrapper .page :is(.page-header,.toolbar,.filters,.actions) { flex-wrap:wrap; gap:8px; }
  html body .themed-nav-wrapper .page :is(button,.btn),
  html body .themed-nav-wrapper .home2 :is(.sp-tab,.btn,.point-row,.kp-edit,.kp-action-btn) {
    min-height:36px; touch-action:manipulation;
  }
  /* Fit table columns to the tablet; long values wrap instead of sideways scrolling. */
  html body .themed-nav-wrapper .page :is(.dt,.table-wrap,.table-wrapper,.table-scroll,.dt-wrap,.dt-scroll,.dt-thead-wrap) { min-width:0 !important; max-width:100%; overscroll-behavior:contain; }
  html body .themed-nav-wrapper .page .dt-table { width:100% !important; min-width:0 !important; table-layout:fixed !important; }
  html body .themed-nav-wrapper .page .dt-table col { width:auto !important; }
  html body .themed-nav-wrapper .page .dt-table :is(th,td) { padding:8px 5px !important; white-space:normal !important; overflow-wrap:anywhere; height:auto; }
  html body .themed-nav-wrapper .page .dt-table :is(.truncate,.cell,.dt-th-inner) { white-space:normal !important; overflow:visible !important; text-overflow:clip !important; overflow-wrap:anywhere; min-width:0; padding-inline:0 !important; }
  html body .themed-nav-wrapper .page .dt-th-inner { font-size:11px; line-height:1.3; gap:3px; flex-wrap:wrap; overflow-wrap:normal !important; }
  html body .themed-nav-wrapper .page .dt-th-inner svg { flex-shrink:0; }
  html body .themed-nav-wrapper .page .dt-table .cell { font-size:12px; line-height:1.4; }
  html body .themed-nav-wrapper .dt-table:has(col:nth-child(7):last-child) col:nth-child(1) { width:18% !important; }
  html body .themed-nav-wrapper .dt-table:has(col:nth-child(7):last-child) col:nth-child(2) { width:15% !important; }
  html body .themed-nav-wrapper .dt-table:has(col:nth-child(7):last-child) col:nth-child(3) { width:22% !important; }
  html body .themed-nav-wrapper .dt-table:has(col:nth-child(7):last-child) col:nth-child(4) { width:9% !important; }
  html body .themed-nav-wrapper .dt-table:has(col:nth-child(7):last-child) col:nth-child(5) { width:12% !important; }
  html body .themed-nav-wrapper .dt-table:has(col:nth-child(7):last-child) col:nth-child(6) { width:15% !important; }
  html body .themed-nav-wrapper .dt-table:has(col:nth-child(7):last-child) col:nth-child(7) { width:9% !important; }
  html body .themed-nav-wrapper .home2 { --font-size-sm:13px; --font-size-xs:12px; }
  html body .themed-nav-wrapper .home2 .sp-col { padding:9px !important; min-width:0; box-sizing:border-box; }
  html body .themed-nav-wrapper .home2 .sp-left { width:var(--tablet-points) !important; }
  html body .themed-nav-wrapper .home2 .sp-right { width:var(--tablet-rides) !important; }
  html body .themed-nav-wrapper .home2 .map-bg { left:var(--tablet-points) !important; right:var(--tablet-rides) !important; }
  html body .themed-nav-wrapper .home2 .page-topbar {
    left:calc(var(--tablet-points) + 8px) !important; right:calc(var(--tablet-rides) + 8px) !important;
    width:auto !important; top:8px !important; flex-wrap:wrap; justify-content:center; gap:6px;
  }
  html body .themed-nav-wrapper .home2 .page-topbar > * { max-width:100%; min-width:0; }
  html body .themed-nav-wrapper .home2 .sp-head { flex-wrap:wrap; gap:6px; }
  html body .themed-nav-wrapper .home2 :is(.sp-title,.acc-title) { font-size:14px !important; }
  html body .themed-nav-wrapper .home2 .sp-tabs { gap:5px; }
  html body .themed-nav-wrapper .home2 .sp-tab { padding:5px 8px; font-size:12px; }
  html body .themed-nav-wrapper .home2 :is(.sp-list,.acc) { min-height:0; overscroll-behavior:contain; }
  html body .themed-nav-wrapper .home2 .kp { padding:8px; }
  html body .themed-nav-wrapper .home2 :is(.kp-edit,.kp-action-btn) { width:32px; min-width:32px; }
  html body .themed-nav-wrapper .home2 .acc-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  html body .themed-nav-wrapper .home2 .acc-actions { flex-wrap:wrap; }
  html body :is(.pt-tile,.m2-modal) { max-width:calc(100vw - 24px) !important; max-height:calc(var(--crm-viewport-height,100dvh) - 24px) !important; }
  html body .pt-tile { width:min(740px,calc(100vw - 24px)); }
  html body .pt-tile :is(.pt-main,.pt-aside) { min-height:0; overflow:auto; }
  html body .pt-tile :is(button,.btn) { min-height:36px; }
  html body :is(.m2-head,.m2-footer-right) > button,html body .pd-eye { min-height:36px; min-width:36px; }
  html body input:not([type=checkbox]):not([type=radio]):not([type=range]),html body textarea,html body select { font-size:16px !important; max-width:100%; }
}
@media screen and (min-width:1000px) and (max-width:1180px) and (pointer:coarse) {
  :root { --tablet-points:240px; --tablet-rides:280px; }
}
