/* ==========================================================================
   Touch / coarse-pointer adjustments (loaded last). Module stylesheet: tokens only, shared parts live in components.css.
   ========================================================================== */

/* ---- Touch devices: comfortable targets without making the desktop bigger -------------------------------------------------------- */
@media (pointer: coarse) {
  :root { --ctl-h-sm: 34px; --ctl-h: 40px; --ctl-h-lg: 44px; --row-h: 44px; }
  .icon-btn { min-width: 40px; min-height: 40px; }
  .m-table .icon-btn, .m-list .icon-btn { min-width: 36px; min-height: 36px; }
  .m-dp__day { height: 40px; }
  .m-lookup__item, .m-cs__item { min-height: 40px; }
  .app-subnav a, .subnav-link, .m-tabs a { min-height: 40px; display: inline-flex; align-items: center; }
  .bk-card__menu .icon-btn { min-width: 32px; min-height: 32px; }
}

.fin-classify { margin-block-start: var(--sp-4); padding-block-start: var(--sp-3); border-block-start: 1px solid var(--border); }
.fin-classify__title { font-weight: var(--fw-semibold); font-size: var(--fs-sm); margin-block-end: var(--sp-2); display: flex; gap: var(--sp-2); align-items: center; color: var(--text-muted); }

/* ===== Phone: app-like pass. Calm headers, one floating primary action, short list cards, no bulk/desktop-only clutter ===== */
@media (max-width: 767.98px) {
  main.page { padding-block-end: 88px; }
  /* header must never be wider than the phone (it made the whole page zoom out): logo mark only, module pages as an icon menu, no Pomodoro chip */
  .app-header .brand__name { display: none; }
  .app-header button.header-module { display: inline-flex; align-items: center; justify-content: center; width: 36px; padding: 0; margin: 0; border: 0; font-size: 0; gap: 0; }
  .app-header button.header-module > i:first-child { font-size: 1.15rem; } .app-header .header-module__caret { display: none; }
  .app-header .pm-header { display: none; }
  .app-header .header-actions { gap: 0; }
  .m-filters > * { max-width: none; }
  /* headers: title + (optional) figures only; long explanations go */
  .page-header__title p, .page-header__context, .pj-head__text p { display: none; }
  .page-header, .pj-head { gap: 8px; margin-block-end: var(--sp-2); }
  /* actions: secondary ones become icon buttons, the primary one floats (FAB) */
  .page-header__actions, .pj-head__actions { flex-wrap: wrap; gap: 6px; }
  .page-header__actions > .m-btn:not(.m-btn--primary):not(.m-btn--icon), .pj-head__actions > .m-btn:not(.m-btn--primary):not(.m-btn--icon) { font-size: 0; gap: 0; width: 40px; padding: 0; justify-content: center; }
  .page-header__actions > .m-btn:not(.m-btn--primary) .bi, .pj-head__actions > .m-btn:not(.m-btn--primary) .bi { font-size: 1.1rem; }
  .page-header__actions > .m-btn--primary, .pj-head__actions > .m-btn--primary { position: fixed; inset-block-end: calc(16px + env(safe-area-inset-bottom, 0px)); inset-inline-end: 16px; z-index: 1035; height: 52px; padding-inline: 20px; border-radius: 26px; box-shadow: 0 8px 22px rgb(0 0 0 / .45); font-size: var(--fs-md); font-weight: var(--fw-semibold); }
  /* lists: card rows show the essentials only; selection / bulk is a desktop tool */
  .m-table--stack td.m-opt, .m-table--stack td.inv-opt, .m-table--stack td.inv-col-project { display: none; }
  .m-table--stack td.col-check, .m-table--stack th.col-check, .m-table-wrap [data-check-all], .m-table-wrap .m-table__selectall, .m-table-wrap thead { display: none; }
  .m-table--stack thead, .m-table--stack thead:has([data-select-all]) { display: none !important; }
  .m-table--stack tfoot { display: none; }
  .m-filters { width: 100%; }
  .m-table--stack tr { padding: 10px 14px; }
  .m-table--stack td { padding: 2px 0; }
  .m-table--stack td:first-of-type { font-weight: var(--fw-semibold); }
  /* filters: compact two-column grid */
  .m-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .m-filters > :first-child, .m-filters > .m-btn, .m-filters > button[type=submit] { grid-column: 1 / -1; }
  /* projects page: one search icon (the page's), a single-row stats strip that scrolls */
  .app-header:has(.gsearch--page) .search-toggle { display: none; }
  .pj-stats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 4px 6px; } .pj-stats::-webkit-scrollbar { display: none; }
  .pj-stats .pj-stat { padding: 4px 10px; white-space: nowrap; } .pj-stats .pj-stats__more { margin-inline-start: 0; flex: none; }
  .pj-cards { gap: 10px; }
}
@media (max-width: 767.98px) { .gsearch--page .pj-topbar .tb-groupbtn { display: none; } }
@media (max-width: 767.98px) {
  /* the floating button already is the primary action: no second copy inside empty states */
  main:has(.page-header__actions > .m-btn--primary, .pj-head__actions > .m-btn--primary) .m-empty .m-btn--primary { display: none; }
  .pj-head { flex-wrap: wrap; align-items: center; }
  .pj-head__actions { flex: 1 1 100%; display: flex; align-items: center; justify-content: flex-start; margin: 0; }
  .pj-head__actions [data-region="projects-views"] { order: -1; margin-inline-end: auto; position: static; }
}
@media (max-width: 767.98px) {
  .pj-head { flex-wrap: nowrap; }
  .pj-head__actions { flex: 0 0 auto; margin-inline-start: auto; }
  .pj-head__actions > :not([data-region="projects-views"]):not(.m-btn--primary) { display: none; }
  .pj-head__actions [data-region="projects-views"] { order: 0; margin: 0; }
  .pj-head__actions [data-region="projects-views"] .m-segment a, .pj-head__actions [data-region="projects-views"] .m-segment button { padding-inline: 8px; }
  .pj-head__icon { display: none; }
}
@media (max-width: 767.98px) {
  .pj-ws--board [data-project-progress], .pj-ws--board .tb-bar > .ms-auto > .dropdown, .pj-ws--board .tb-bar > .ms-auto > [data-vault-open], .pj-ws--board .pj-hchips { border: 0; }
  .pj-ws--board [data-project-progress] { display: none !important; }
  .pj-ws--board .tb-bar > .ms-auto > :not(.m-segment):not(.o-segment):not([data-view-switcher]):not(.view-switcher) { display: none; }
  .pj-ws--board .ct-header__meta, .pj-ws--board .pj-hchips { padding-inline: 4px; }
}
