/* Mobile alternatives share the same project, task and report records. */
.ph-stage-label, .ph-stage-toggle, .ph-report-switch, .ph-work-feed,
.blueprint-actions .ph-work-switch, .pw-phone-wire, .pw-phone-only, .pw-extra-dot { display:none }

@media (max-width:760px), (max-width:960px) and (max-height:540px) {
  .pl-shell .pl-page { display:block; padding:14px 12px max(24px,env(safe-area-inset-bottom)) }
  .pl-shell .pl-board { display:block }
  .pl-shell .pl-scroll { overflow:visible; max-height:none; min-height:0; scrollbar-gutter:auto }
  .pl-shell .pl-table, .dp79 .dp79-table, .dp79 .dp79-tasks, .wi-shell .wi-table {
    width:100%; min-width:0; display:block; position:relative;
  }
  .pl-table colgroup { display:none }
  .pl-table thead, .dp79 table thead, .wi-shell .wi-table thead {
    position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap;
  }
  .pl-shell .pl-table tbody { display:grid; gap:12px }
  .pl-shell .pl-table tbody tr {
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; height:auto;
    padding:10px; background:#193fb6; border:1px solid #7194ed; border-radius:9px;
  }
  .pl-shell .pl-table .pl-project {
    display:grid; grid-column:1/-1; grid-template-columns:minmax(0,1fr) auto; align-items:center;
    position:static; padding:0 1px 6px; background:none; width:auto; height:auto; min-width:0;
  }
  .pl-project .pl-project-name { min-width:0; min-height:44px; white-space:normal; overflow-wrap:anywhere; font-size:16px }
  .pl-project .pl-meta { grid-column:1/-1; grid-row:2; flex-wrap:wrap; gap:4px 12px; margin:0; text-align:left }
  .pl-project .pl-extras { min-height:40px }
  .pl-project .ph-stage-toggle {
    display:block; grid-column:2; grid-row:1; min-height:44px; padding:4px 8px;
    background:none; border:0; color:#e9efff; font:inherit; font-size:13px; cursor:pointer;
  }
  .pl-shell .pl-table .pl-track { display:block; height:auto; min-width:0; width:auto }
  .pl-shell .pl-table tr:not(.ph-show-all) .pl-track:is([data-process-state=skipped],[data-process-state=unrecorded],[data-process-state=cancelled]) { display:none }
  .pl-shell .pl-track>button {
    display:grid; grid-template-columns:11px minmax(0,1fr); grid-template-rows:auto auto; align-content:center;
    justify-content:start; column-gap:8px; min-height:49px; height:100%; padding:5px 8px; text-align:left;
    border:1px solid #5279d7; border-radius:5px; background:#2148bd; color:#fff;
  }
  .pl-shell .pl-track>button:is(:hover,:focus-visible,[aria-expanded=true]) { background:#3c64ce }
  .pl-shell .pl-track>button::before, .pl-shell .pl-track>button::after, .pl-shell .pl-track::before, .pl-shell .pl-track::after { display:none }
  .pl-shell .pl-track .pl-dot { width:9px; height:9px; grid-row:1/3; box-shadow:none }
  .pl-shell .pl-track .ph-stage-label { display:block; grid-column:2; font:600 13px/1.45 var(--font-ui,system-ui) }
  .pl-shell .pl-track small.ph-stage-label { font-size:12px; font-weight:400; color:#d4e2ff }
  .pl-shell .pl-node-key { display:none }
  .pl-shell .pl-legend { padding:2px 0 11px }
  .pl-shell .pl-task-key { gap:4px 12px; font-size:12px }
  .pl-shell .pl-task-key .pl-count-total { font-size:13px }
  .pl-shell .po-header :is(.compact-search,.compact-filter-toggle,.po-view,.po-close) { min-height:44px }
  .pl-shell .pl-popup [data-pl-close], .pw-flow [data-pw-close],
  .dp79 :is([data-dp-note-edit],[data-dp-note-cancel],[data-dp-note-save]) { min-width:44px; min-height:44px }
  :is(.pl-shell,.ph-work-list) .compact-search { height:46px }
  :is(.pl-shell,.ph-work-list) .compact-search>button { width:44px; height:44px }
  :is(.pl-shell,.ph-work-list) .compact-search input { height:44px; font-size:16px }
  .pl-shell .pl-popup.pl-pinned { max-height:min(58dvh,460px); overscroll-behavior:contain }

  .rd-project-detail .sections > [data-project-workflow] + .compact-list { display:none }
  .pw-flow { margin:6px 0 14px; border-radius:10px }
  .pw-flow .pw-header { padding:11px 13px; border-bottom:0 }
  .pw-header h2 { font-size:14px }
  .pw-header > span { font-size:12px }
  .pw-flow .pw-scroll { position:relative; isolation:isolate; margin:1px 6px 13px; overflow:visible }
  .pw-phone-wire { display:block; position:absolute; left:0; top:27px; width:100%; height:70px; overflow:visible; pointer-events:none }
  .pw-phone-wire path { stroke:color-mix(in srgb,var(--pl-dot,#afbdd0) 65%,#bdcadc); stroke-width:1.3; stroke-linecap:round }
  .pw-phone-wire .pw-current { stroke:#407bb75e; stroke-width:1.6; stroke-dasharray:2 98; animation:pw-current 6s linear infinite }
  .pw-flow .pw-nodes {
    position:relative; min-width:0; grid-template-columns:repeat(5,minmax(0,1fr));
    grid-template-rows:repeat(2,54px); gap:16px 0; margin:0; padding:0;
  }
  .pw-nodes > :nth-child(6) {grid-area:2/5}
  .pw-nodes > :nth-child(7) {grid-area:2/4}
  .pw-nodes > :nth-child(8) {grid-area:2/3}
  .pw-nodes > :nth-child(9) {grid-area:2/2}
  .pw-nodes > :nth-child(10) {grid-area:2/1}
  .pw-flow .pw-node {
    display:grid; grid-template-rows:repeat(3,18px); justify-items:center; align-items:center;
    width:100%; min-height:54px; gap:0; padding:0; border:0; background:transparent;
    text-align:center; border-radius:6px;
  }
  .pw-flow .pw-node:is(:hover,:focus-visible,[aria-expanded=true]) { background:#2454d90a }
  .pw-flow .pw-node[aria-expanded=true] strong { color:#194cce; text-decoration:underline; text-underline-offset:3px }
  .pw-node .pw-index, .pw-node .pw-track::before, .pw-flow [data-pw-guide], .pw-extras .pw-extra-arrow { display:none }
  .pw-flow .pw-node strong { margin:0; font-size:clamp(11px,3.15vw,13px); line-height:18px; white-space:nowrap }
  .pw-node .pw-track { width:100%; height:18px }
  .pw-flow .pw-track .pw-dot { width:9px; height:9px }
  .pw-node .pw-node-status { color:#50617a; font-size:clamp(10px,2.65vw,11px); line-height:16px; white-space:nowrap }
  .pw-flow .pw-foot { display:none }
  .pw-flow .pw-foot.pw-has-extras { display:flex; align-items:center; padding:0 13px; min-height:0 }
  .pw-flow .pw-extras { min-height:44px; color:#365374; font-size:12px; display:inline-flex; align-items:center; gap:3px }
  .pw-flow .pw-extra-dot { display:inline-block; width:7px; height:7px; margin-right:4px; border-radius:50%; background:#718ba9 }
  .pw-flow .pw-phone-only { display:revert }
  .pw-flow .pw-extras.pw-phone-only { display:inline-flex }
  .pw-panel { padding:12px 13px }
  .pw-panel-head .pw-index { display:none }
  .pw-flow :is(.pw-action,.pw-extras,.pw-close,.pw-task-link,.pw-primary,.pw-secondary) { min-height:44px }
  .pw-flow .pw-tasks { max-height:none; overflow:visible }
  .pw-flow .pw-action-row input { min-height:44px; font-size:16px }

  .wi-shell .ph-report-switch {
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px; padding:3px;
    margin:0 0 12px; border:1px solid #cddaf1; border-radius:7px; background:#eff3fb;
  }
  .wi-shell .ph-report-switch button {
    min-height:44px; border:0; border-radius:4px; color:var(--wi-muted); background:transparent; font:inherit; font-size:14px;
  }
  .wi-shell .ph-report-switch button[aria-pressed=true] { background:#fff; color:var(--wi-blue); font-weight:650; box-shadow:0 1px 3px #23448121 }
  .wi-scroll[data-ph-report=plans]>:not(.ph-report-switch):not([data-department-plans]),
  .wi-scroll[data-ph-report=review]>[data-department-plans], .wi-scroll[data-ph-report=review]>.wi-review-heading { display:none }
  .wi-shell .wi-scroll { padding-bottom:max(24px,env(safe-area-inset-bottom)) }
  .wi-shell .wi-table-scroll, .dp79 .dp79-table-scroll, .dp79 .dp79-task-scroll { overflow:visible; max-height:none; border:0 }
  .wi-shell .wi-table tbody, .dp79 .dp79-table>tbody, .dp79 .dp79-tasks tbody { display:grid; min-width:0; gap:8px }
  .wi-shell .wi-table tbody tr, .dp79 .dp79-tasks tbody tr {
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-content:start; gap:5px 12px;
    padding:10px 12px; border:1px solid #d7e2f3; border-radius:7px; background:white;
  }
  .wi-shell .wi-table tbody td, .dp79 .dp79-tasks tbody td {
    position:static; display:block; width:auto; height:auto; max-width:none; min-width:0;
    padding:0; border:0; box-shadow:none; background:transparent; white-space:normal; overflow-wrap:anywhere;
  }
  .wi-shell .wi-table tbody td:first-child, .wi-shell .wi-members tbody td:nth-child(2),
  .dp79 .dp79-tasks tbody td:first-child { grid-column:1/-1 }
  .wi-shell .wi-table td[data-ph-label]::before, .dp79 td[data-ph-label]::before {
    display:block; color:#596f8d; font:500 12px/1.45 var(--font-ui,system-ui); content:attr(data-ph-label);
    content:attr(data-ph-label) / "";
  }
  .wi-shell .wi-table td:first-child::before { display:none }
  .wi-shell .wi-work-cell small { max-width:none; white-space:normal }
  .wi-shell :is(.wi-tabs button,.wi-select select,.wi-filter-controls button,.wi-person,.wi-textlink,.wi-count-link,.wi-paging button,.wi-chips button,.wi-segments button,.wi-banner-link) { min-height:44px }
  .wi-shell .wi-tabs { flex-wrap:wrap; gap:0 10px; overflow:visible }
  .wi-shell .wi-person { width:100%; font-size:15px }
  .wi-shell .wi-metric-top { line-height:1.45 }
  .wi-shell .wi-metric>small { font-size:12px }

  .dp79 .dp79-table>tbody { padding:0 10px 10px }
  .dp79 .dp79-department {
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px 8px;
    padding:7px 10px; border:1px solid #d8e2f2; border-radius:7px; background:#fbfcff;
  }
  .dp79 .dp79-department>:is(th,td) {
    display:block; position:static; width:auto; min-width:0; padding:0; box-shadow:none; border:0; background:transparent; overflow-wrap:anywhere;
  }
  .dp79 .dp79-department>th, .dp79 .dp79-department>td:last-child { grid-column:1/-1 }
  .dp79 .dp79-department>th>button { width:100%; min-height:44px; font-size:16px }
  .dp79 .dp79-department>td:last-child { border-top:1px solid #e4eaf5; margin-top:4px; padding-top:4px }
  .dp79 .dp79-department>td[data-ph-label] { display:flex; flex-wrap:wrap; align-items:center; gap:0 6px }
  .dp79 .dp79-count, .dp79 .dp79-unplanned, .dp79 .dp79-periods button, .dp79 .dp79-refresh,
  .dp79 :is(.dp79-note-display button,.dp79-note-actions button,.dp79-unscheduled>button,.dp79-task-link) { min-height:44px }
  .dp79 .dp79-unplanned, .dp79 .dp79-progress { flex-basis:100%; max-width:100% }
  .dp79 .dp79-detail-row, .dp79 .dp79-detail-row>td { display:block; min-width:0 }
  .dp79 .dp79-detail { padding:8px; border:0; background:#eef3fc; border-radius:6px }
  .dp79 .dp79-tasks td.dp79-dates { grid-column:1/-1; grid-row:3 }
  .dp79 .dp79-dates>span { display:inline; white-space:normal }
  .dp79 .dp79-dates>span+span::before { content:" – " }
  .dp79 .dp79-custom input, .dp79 .dp79-note-edit textarea { min-height:44px; font-size:16px }

  .blueprint-space.ph-work-list {
    overflow:auto; overscroll-behavior:contain; padding:15px 14px max(24px,env(safe-area-inset-bottom));
    background:#234fda; scrollbar-gutter:auto;
  }
  .blueprint-space.ph-work-list :is(.blueprint-canvas,.blueprint-footer,.blueprint-popover) { display:none }
  .compact-map-ui.ph-work-list .blueprint-header, .compact-map-ui.ph-work-list .map-toolbar,
  .compact-map-ui.ph-work-list .blueprint-empty { position:relative; inset:auto; display:block; width:100%; height:auto; padding:0; margin:0 }
  .compact-map-ui.ph-work-list .blueprint-header { pointer-events:auto }
  .compact-map-ui.ph-work-list .blueprint-empty { padding:24px 8px }
  .compact-map-ui.ph-work-list .map-toolbar { z-index:8; margin:12px 0 }
  .compact-map-ui.ph-work-list .blueprint-heading { padding:0 42px 0 0 }
  .compact-map-ui.ph-work-list .blueprint-actions { margin-top:9px; justify-content:flex-start; gap:6px }
  .compact-map-ui.ph-work-list .blueprint-actions .blueprint-exit { inset:0 0 auto auto; position:absolute; min-width:40px }
  .compact-map-ui.ph-work-list .map-toolbar .compact-summary { justify-content:flex-start; flex-wrap:wrap }
  .compact-map-ui.ph-work-list .map-toolbar .compact-tools { max-width:100%; flex:1 1 100% }
  .compact-map-ui.ph-work-list .map-toolbar .compact-filter-panel { max-height:min(55dvh,420px); overflow-y:auto }
  .blueprint-space:is(.ph-work-list,.ph-work-map) .blueprint-actions .ph-work-switch { display:inline-block }
  .compact-map-ui.ph-work-list :is(.blueprint-actions button,.compact-filter-toggle,.compact-search) { min-height:44px }
  .ph-work-list .ph-work-feed { display:grid; gap:7px; color:#19356a }
  .ph-work-feed h2 { margin:0 0 2px; color:white; font-size:17px; line-height:1.5 }
  .ph-work-feed h2 small { padding-inline-start:5px; font-size:14px; color:#d6e4ff }
  .ph-work-feed [data-ph-task] {
    display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:4px 10px;
    width:100%; padding:11px 12px; border:0; border-radius:7px; color:#203d72; background:#fff;
    text-align:left; font:inherit; cursor:pointer; overflow-wrap:anywhere;
  }
  .ph-work-task { display:grid; gap:3px }
  .ph-work-task strong { font-size:15px; line-height:1.45 }
  .ph-work-task small, .ph-work-date { color:#526888; font-size:12px; line-height:1.5 }
  .ph-work-status { color:#234eac; background:#edf3ff; border-radius:4px; padding:2px 6px; font-size:12px; line-height:1.5 }
  .ph-work-status[data-urgent] { color:#983b26; background:#fff0e7 }
  .ph-work-date { grid-column:1/-1 }
  .ph-work-pages { display:flex; gap:12px; justify-content:center; align-items:center; color:white; font-size:13px }
  .ph-work-pages button { min-height:44px; padding:4px 12px; color:white; border:1px solid #a0baff; border-radius:5px; background:transparent }

  .pd-shell .pc-console { grid-template-columns:minmax(0,1fr); grid-template-areas:"next" "tasks" "entry" "department" "log" "energy" }
  .pd-shell .pc-console.pc-no-queue { grid-template-areas:"next" "tasks" "entry" "log" "energy" }
  .pd-shell :is(.pd-title,.pd-detail,.pd-legend button,.pc-next button) { min-height:44px }
}

@keyframes pw-current { from { stroke-dashoffset:0 } to { stroke-dashoffset:-100 } }
@media (prefers-reduced-motion:reduce) { .pw-phone-wire .pw-current { display:none; animation:none } }
