/* Phone density: reduce framing, preserve readable inputs and touch targets. */
@media (max-width: 660px) {
  html { scroll-padding-bottom: 140px; }
  .workspace :is(input, select, textarea, button, a) { scroll-margin-block: 16px 140px; }
  .workspace { padding: 12px 12px 100px; }
  .topbar { gap: 10px; margin-bottom: 12px; }
  .topbar h1, .topbar-title { font-size: 22px; line-height: 1.2; }
  .topbar .search { min-height: 44px; }
  .workspace input:not([type=checkbox]):not([type=radio]),
  .workspace select, .workspace textarea { font-size: 16px; }
  .home-page .home-grid { gap: 12px; }
  .home-page .home-next-action { flex-direction: row; align-items: center; gap: 10px; padding: 12px 14px; }
  .home-page .home-next-action h2 { font-size: 16px; margin: 0; }
  .home-page .home-next-action > a { flex-shrink: 0; min-height: 44px; }
  .home-page .home-work > header, .home-page .home-calendar > .side-card-header { padding: 14px 16px; }
  .home-page .card-title { font-size: 18px; }
  .home-page .quick-actions > summary { min-height: 44px; }
  .my-project-summary { margin-bottom: 12px; box-shadow: none; }
  .my-project-summary > span { min-height: 58px; padding: 10px 12px; font-size: 12px; gap: 3px; }
  .my-project-summary b { font-size: 22px; }
  .my-project-toolbar { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding: 12px; margin-bottom: 12px; }
  /* A desktop flex-basis becomes a height when the toolbar stacks on phones. */
  .my-project-toolbar label:first-child { grid-column: 1 / -1; flex: none; min-width: 0; min-height: 44px; }
  .my-project-toolbar label:not(:first-child) { min-width: 0; flex-direction: column; align-items: stretch; gap: 4px; }
  .my-project-toolbar select { width: 100%; min-width: 0; min-height: 44px; padding-left: 8px; }
  .my-project-toolbar label.my-project-update-filter { flex-direction: row; align-items: center; align-self: end; min-height: 44px; padding: 0 8px; }
  .my-project-count { margin: 0; align-self: center; }
  .my-project-toolbar .my-project-directory-actions { grid-column: 1 / -1; justify-content: space-between; flex-wrap: nowrap; gap: 8px; }
  .my-project-directory-actions .text-button { min-height: 44px; padding: 8px 4px; font-size: 12px; }
  .my-project-viewbar { gap: 8px; margin-bottom: 12px; }
  .my-project-viewbar .segmented button, .my-project-group-control select, .my-project-board-more { min-height: 44px; }
  .my-project-viewbar p { display: none; }
  .my-project-row { padding: 12px; gap: 8px 10px; box-shadow: none; }
  .my-project-main h2 { font-size: 16px; line-height: 1.3; }
  .my-project-main p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 5px; }
  .my-project-row > a { min-height: 44px; display: inline-flex; align-items: center; }
  body[data-route=project] .project-breadcrumb p strong { display: none; }
  body[data-route=project] .project-identity-art { height: 80px; min-height: 80px; }
  body[data-route=project] .project-heading-copy { padding: 14px 14px 10px; }
  body[data-route=project] .project-heading h1 { font-size: 24px; }
  body[data-route=project] .project-actions { padding: 0 14px 12px; }
  body[data-route=project] .project-actions .button { min-height: 44px; }
  body[data-route=project] #simple-quick { padding: 12px 14px; gap: 10px; }
  body[data-route=project] .phase-sequence { flex-wrap: wrap; overflow: visible; row-gap: 10px; }
  body[data-route=project] .phase-sequence li { flex: 1 0 58px; min-width: 0; }
  .resource-card, .resource-submit-card { min-height: 0; padding: 16px; }
  .resource-card h3 { margin-top: 14px; font-size: 20px; }
  .resource-article h1 { font-size: 28px; }
}
