/* My Tasks on a phone (Sam's approved mobile design, 2026-11-21). Below 640px only; the desktop layout is untouched. */
.task-actions-more { display: none; }
@media (max-width: 640px) {
  .task-inbox { padding-right: 0; }
  #task-list.work-list { padding: 8px 16px 16px; display: grid; gap: 10px; }
  #task-list .work-row[data-task-id] { border: 1px solid #dce5e4; border-radius: 12px; min-height: 44px; background: #fff; }
  #task-list .work-row[data-task-id].active, #task-list .work-row[data-task-id][aria-current] { background: var(--brand-tint, #eaf8f7); }
  .work-head { flex-direction: column; align-items: stretch; gap: 6px; }
  .work-head .head-meta { flex-direction: row; gap: 10px; text-align: left; }
  .work-back { min-height: 44px; display: inline-flex; align-items: center; }
  #form-content select, #form-content input:not([type=checkbox]):not([type=radio]), #form-content textarea { min-height: 48px; width: 100%; max-width: 100%; box-sizing: border-box; font-size: 16px; }
  #task-form { padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
  #task-actions:not([hidden]) {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; gap: 8px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #dce5e4;
  }
  #task-actions > span[data-info-tip], #task-actions > button.quiet { display: none; }
  #task-actions { flex-wrap: wrap; height: auto; max-height: none; }
  #task-actions > #task-save-state { flex: 1 1 calc(100% - 40px); font-size: 13px; }
  #task-actions > [data-info-tip-ready]:has(+ #task-save-state:empty) { display: none; }
  #task-actions > #task-save-state:empty { display: none; }
  #task-actions > button.primary:not([hidden]) { flex: 1; min-height: 48px; border-radius: 10px; }
  #task-actions .task-actions-more:not([hidden]) { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; border: 1px solid #dce5e4; border-radius: 10px; background: #fff; font-size: 20px; }
  .work-ai-rail .ai-launcher, body .conform-ai-fab { bottom: 84px; }
  dialog.task-actions-sheet { position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: none; border: 0; border-radius: 18px 18px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); }
  dialog.task-actions-sheet::backdrop { background: rgba(16, 24, 40, .4); }
  dialog.task-actions-sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: #d0d5dd; margin: 0 auto 10px; }
  dialog.task-actions-sheet button { display: block; width: 100%; min-height: 48px; border: 0; border-bottom: 1px solid #eef1f5; background: none; text-align: left; font: inherit; font-weight: 600; padding: 0 4px; }
  dialog.task-actions-sheet .task-actions-sheet-cancel { margin-top: 8px; border: 1px solid #dce5e4; border-radius: 10px; text-align: center; }
  #work-operations-dialog input, #work-operations-dialog select, #work-operations-dialog button { min-height: 48px; }
}
@media (max-width: 640px) {
  /* An open task is its own screen: the list, tabs and page head step aside until "‹ My Tasks". */
  body:has(#work-task-editor:not([hidden])) .library-head,
  body:has(#work-task-editor:not([hidden])) #work-status-tabs,
  body:has(#work-task-editor:not([hidden])) .task-inbox { display: none; }
  .work-back { font-size: 16px; font-weight: 600; }
  .work-back [data-i18n] { display: none; }
  .work-back .work-back-phone { display: inline; }
  /* Its own colour: the selected tab is a teal pill with white text (master-page.css), and the count only shows on it. */
  #work-status-tabs .work-tab-count:not([hidden]) { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #eef1f5; color: #344054; font-size: 12px; font-weight: 600; }
}


/* Outside a phone the page's own back label and no count (the approved design adds both to the phone only). */
.work-back-phone { display: none; }
#work-status-tabs .work-tab-count { display: none; }
.work-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* "‹ My Tasks" above a process's progress on a phone (tasks-phone.js); nothing above 640px. */
.work-overview-back { display: none; }
@media (max-width: 640px) {
  .work-overview-back:not([hidden]) { display: inline-flex; align-items: center; min-height: 44px; margin: 4px 0 8px; padding: 0; border: 0; background: none; color: var(--brand, #007b77); font: inherit; font-size: 16px; font-weight: 600; scroll-margin-top: 72px; }
  /* Nothing chosen yet: the desktop's "Choose a process from the list" has no list beside it on a phone. */
  .work-nothing-open .work-overview-empty { display: none; }
}
