/* Touch screens (iPad, tablets, phones): larger targets and no hover-only controls. Applies only where the main pointer is a finger, so a mouse
   keeps the denser desktop layout. Menus already open by tap on touch, and by hover only for a mouse. */
@media (pointer: coarse) {
    button, select, input, textarea, [role="button"], a.ck-btn, .ck-menu-button, .ck-menu-item, .ck-segmented > button, .e-btn, .e-input-group, .e-ddl.e-input-group { touch-action: manipulation; }
    .ck-btn, .e-btn, .ab-btn, .ck-segmented > button, .ck-menu-button, .ck-menu-item, .ck-popover-item { min-height: 44px; }
    .ck-menu-item { padding-block: 0.6rem; }
    input:not([type="checkbox"]):not([type="radio"]), select, .e-input-group, .e-input-group.e-control-wrapper { min-height: 44px; }
    .e-checkbox-wrapper .e-frame, .e-radio + label::before { transform: scale(1.25); transform-origin: left center; }
    .e-checkbox-wrapper, .e-radio-wrapper { min-height: 32px; display: inline-flex; align-items: center; }
    /* Lists and grids: taller rows so a finger lands on one row. */
    .e-grid .e-row .e-rowcell { padding-block: 0.55rem; }
    .e-grid .e-headercell { padding-block: 0.6rem; }
    /* Dialogs use the screen on a tablet rather than a desktop-sized box. */
    .e-dialog { max-width: calc(100vw - 1rem); }
    /* The diary's side rails and dock buttons. */
    .book-dock .ck-btn, .book-toolbar .ck-btn, .book-toolbar .e-btn { min-height: 44px; }
    .pe-tab { min-height: 48px; }
    .visit-person { padding-block: var(--ck-space-3); }
}

/* Tablets in portrait: the patient record and lists keep one column, and long toolbars wrap instead of running off the screen. */
@media (pointer: coarse) and (max-width: 1100px) {
    .book-toolbar, .pt-toolbar, .pt-subbar { flex-wrap: wrap; }
    .pe-shell { grid-template-columns: minmax(0, 1fr); height: auto; }
    .pe-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--ck-border); }
    .pe-tab-hint { display: none; }
}
