/* Touch ergonomics. Layout changes stay below the compact-navigation breakpoint. */
.mobile-nav-toggle{display:none}

@media(max-width:1000px){
  html{scroll-padding-top:88px}
  .sidebar{position:sticky;inset:0 0 auto;width:100%;padding:10px 16px;display:grid;grid-template-columns:100px minmax(0,1fr);align-items:center;gap:10px 12px;z-index:20}
  .sidebar .brand{font-size:28px;margin:0;display:block}
  .sidebar .brand span{display:block;font-size:7px;margin:0;padding:3px 0 0 2px;letter-spacing:.32em}
  .sidebar .workspace-label,.sidebar .sidebar-bottom,.sidebar .nav-symbol{display:none}
  .mobile-nav-toggle{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0;width:100%;min-height:44px;padding:9px 11px;border:1px solid #ffffff40;border-radius:6px;background:#ffffff0c;color:var(--cloud);font-size:13px;text-align:left}
  #mobile-current-view{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700}
  .mobile-nav-toggle>span:last-child{flex-shrink:0}
  .sidebar #workspace-navigation{display:none;grid-column:1/-1;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%;margin:0;padding:10px 0 0;overflow-x:hidden;overflow-y:auto;max-height:calc(100dvh - 86px);border-top:1px solid #ffffff25}
  .sidebar.is-nav-open #workspace-navigation{display:grid}
  .sidebar .nav-item{width:100%;min-height:44px;margin:0;padding:10px 12px;font-size:13px;line-height:1.35;white-space:normal;min-width:0;gap:6px}
  .sidebar .nav-count{flex-shrink:0}
  .workspace{margin-left:0}
  .topbar{height:auto;min-height:112px;display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;padding:12px 16px;align-items:center}
  .search-wrap{grid-column:1/-1;max-width:none;min-width:0;width:100%;gap:8px;padding:0 10px;border:1px solid var(--mist);border-radius:6px;background:var(--cloud)}
  .search-wrap input{min-height:44px;padding:0;min-width:0}
  .search-wrap>span{font-size:25px}
  .search-wrap kbd{display:none}
  .owner-control{grid-column:1;grid-row:2;margin:0;justify-self:start;min-width:0;font-size:0}
  .owner-control select{margin:0;min-height:44px;max-width:135px;padding:8px 10px;background:var(--cloud);border:1px solid var(--mist)}
  .workspace-people{grid-column:2;grid-row:2;gap:4px;align-items:center}
  .workspace-people .person-header{min-width:32px;min-height:44px;align-items:center;justify-content:center;padding:0}
  .workspace-people button.person-header{min-width:44px}
  .workspace-people .person-portrait{width:28px;height:28px}
  .account-controls{grid-column:3;grid-row:2;min-width:0;max-width:none;align-items:flex-end}
  .account-controls #account-label{display:none}
  .account-controls #signout{min-width:60px;min-height:44px;padding:8px 4px;font-size:12px;white-space:nowrap}
  .prototype-bar{padding:8px 16px;line-height:1.5;gap:4px;flex-wrap:wrap}
  .prototype-bar #changes-label{white-space:normal}
  main{padding:22px 16px}
  .view,.page-heading,.view h1{scroll-margin-top:88px}
  .page-heading{margin-bottom:20px}
  .page-heading h1{font-size:clamp(30px,8vw,39px);line-height:1.12}
  .page-heading p{font-size:14px;line-height:1.55}
  .task-toolbar{gap:10px;margin-bottom:16px}
  .task-toolbar>p{min-width:0;font-size:12px}
  .work-filters .filter-bar{gap:10px}
  .work-filters .filter-bar label{flex:1 1 calc(50% - 5px);min-width:0}
  .work-filters .filter-bar select{width:100%}
  .work-filters .filter-bar>span{flex-basis:100%;margin:0}
  .work-filter-panel{margin-bottom:16px}
  .work-filter-panel>summary{display:flex;align-items:center;gap:12px;min-height:44px;padding:11px 12px;list-style:none;background:var(--paper);border:1px solid var(--mist);border-radius:8px;font-size:13px;font-weight:700;color:var(--pine);cursor:pointer}
  .work-filter-panel>summary::before{content:'+';font-size:20px;line-height:1;flex-shrink:0}
  .work-filter-panel[open]>summary{border-radius:8px 8px 0 0;border-bottom:0}
  .work-filter-panel[open]>summary::before{content:'−'}
  .work-filter-panel .work-filters{margin-bottom:0;border-radius:0 0 8px 8px}
  #work-filter-summary{margin-left:auto;font-size:11px;font-weight:400;text-align:right;color:var(--body)}
  .resource-toolbar{gap:10px;flex-wrap:wrap}
  .resource-form-row{grid-template-columns:1fr;gap:0}
  .resource-card{padding:22px}
  .resource-add .button,.meeting-notes>.button{width:100%}
  .workspace-footer>div{flex-wrap:wrap;gap:8px 16px}
}

@media(max-width:1000px),(pointer:coarse){
  input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px!important;min-height:44px;max-width:100%}
  button,.button,summary{min-height:44px}
  .workspace-people button.person-header{min-width:44px;min-height:44px;align-items:center;justify-content:center}
  .view-switch button,.date-filters button{min-height:44px;font-size:12px}
  .button{font-size:14px}
  .drag-handle{min-width:44px;min-height:44px;padding:8px;font-size:24px}
  .card-complete{appearance:none;-webkit-appearance:none;position:relative;display:grid;place-content:center;width:44px;height:44px;min-width:44px;margin:0;border:0;background:transparent;border-radius:6px}
  .card-complete::before{content:'';display:block;width:22px;height:22px;border:1px solid #7b9380;border-radius:4px;background:var(--paper)}
  .card-complete:checked::before{background:var(--pine);border-color:var(--pine)}
  .card-complete:checked::after{content:'';position:absolute;left:18px;top:13px;width:7px;height:12px;border:solid var(--paper);border-width:0 2px 2px 0;transform:rotate(45deg)}
  .card-top{gap:6px}
  .card-owner{min-width:0;overflow-wrap:anywhere}
  .card-title{font-size:15px;line-height:1.5;min-height:44px}
  .card-due{font-size:13px;min-height:44px}
  .card-move{padding:8px;max-width:170px}
  .card-move-label{font-size:12px}
  .board-stack{overscroll-behavior-y:auto}
  .board-column{height:clamp(460px,calc(100dvh - 120px),780px)}
  .resource-review{min-height:64px}
  .resource-review input{min-height:20px}
  .resource-review strong{font-size:13px}
  .resource-review small{font-size:11px}
  .document-card>a,.source-link,.resource-open,.auth-info-links a{display:inline-flex;align-items:center;min-height:44px}
  .timeline-owner select{min-width:0;max-width:100%;padding:6px 0;flex:1}
  .timeline-owner{min-width:0;max-width:100%}
  .timeline-task-title{font-size:12px;min-height:44px;line-height:1.45}
  .timeline-row,.timeline-track{min-height:124px}
  .timeline-row>.timeline-task-label{display:block}
  .timeline-row .timeline-owner{margin-top:5px}
  .timeline-completed{min-height:44px}
  .timeline-navigation button{min-width:44px;min-height:44px;padding:10px 2px;font-size:12px}
  .timeline-mark.is-range{height:44px;top:40px;line-height:42px}
  .timeline-mark.is-deadline,.timeline-mark.is-start{width:44px;height:44px;top:40px;margin-left:-22px;padding:0;border:0;border-radius:0;transform:none;background:transparent;overflow:visible}
  .timeline-mark.is-deadline::before,.timeline-mark.is-start::before{content:'';position:absolute;left:16px;top:16px;width:12px;height:12px;border:1px solid var(--pine);border-radius:2px;background:var(--pine);transform:rotate(45deg)}
  .timeline-mark.is-start::before{border-width:2px;border-radius:50%;background:var(--paper);transform:none}
  .timeline-mark.is-provisional::before{border-style:dashed;border-color:#6d8066;background:var(--paper)}
  .timeline-mark.is-overdue::before{border-color:#9e4c42;background:#9e4c42}
  .timeline-point-label{top:54px}
  body:has(dialog[open]){overflow:hidden}
  dialog{width:min(620px,calc(100vw - 16px));max-height:calc(100dvh - 16px);padding:0 16px 16px;scroll-padding:76px 0 80px;overscroll-behavior:contain}
  .dialog-head{position:sticky;top:0;z-index:3;min-height:64px;margin:0 -16px 16px;padding:10px 16px;background:var(--paper);border-bottom:1px solid var(--mist)}
  .dialog-head .close-button{display:grid;place-content:center;width:44px;min-width:44px;height:44px;padding:0}
  dialog h2{font-size:30px}
  .local-editor{padding-top:16px}
  .local-editor #save-task{position:sticky;bottom:0;z-index:2;min-height:48px;width:100%;margin-top:16px;box-shadow:0 -6px 12px var(--paper)}
  .task-editor-row{grid-template-columns:1fr;gap:0}
  #portrait-file{padding:8px 0}
  #save-portrait{width:100%;min-height:48px}
  .profile-preview,.profile-preview .person-portrait{width:96px;height:96px}
  .profile-explanation{font-size:14px;line-height:1.55}
}

@media(max-width:1000px) and (max-height:500px){
  .sidebar{padding:6px 12px;gap:8px 12px}
  .sidebar .brand{font-size:25px}
  .sidebar #workspace-navigation{max-height:calc(100dvh - 72px)}
  .board-column{height:calc(100dvh - 88px);min-height:280px}
  dialog{max-height:calc(100dvh - 8px)}
  .dialog-head{min-height:58px;padding-block:7px}
  .profile-preview,.profile-preview .person-portrait{width:72px;height:72px}
}

@media print{.mobile-nav-toggle{display:none!important}}
