#task-mobile,#task-mobile-cards { display:none; }
@media(max-width:700px) {
 body:has(#tasks.active.task-mobile-ready) .topbar { display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 16px; }
 body:has(#tasks.active.task-mobile-ready) .topbar-title > :not(img),
 body:has(#tasks.active.task-mobile-ready) #current-user,
 body:has(#tasks.active.task-mobile-ready) #seed-data,
 body:has(#tasks.active.task-mobile-ready) #clear-data { display:none; }
 body:has(#tasks.active.task-mobile-ready) .topbar-brand-logo { width:100px;height:auto; }
 body:has(#tasks.active.task-mobile-ready) .topbar .actions { display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px; }
 body:has(#tasks.active.task-mobile-ready) .cloud-user-summary { font-size:10px; }
 body:has(#tasks.active.task-mobile-ready) #cloud-logout { padding:6px 9px;font-size:11px; }
 body:has(#tasks.active.task-mobile-ready) .sidebar nav { display:flex;flex-wrap:wrap;gap:4px; }
 body:has(#tasks.active.task-mobile-ready) .sidebar nav button { font-size:11px; }
 #task-mobile-cards { display:grid;gap:12px; }
 #tasks.task-mobile-ready { min-width:0; }
 #tasks.task-mobile-ready > .panel { padding:0;border:0;background:transparent;box-shadow:none; }
 #tasks.task-mobile-ready > .panel > .panel-head,
 #tasks.task-mobile-ready .task-space-nav,
 #tasks.task-mobile-ready #tasks-list-view,
 #tasks.task-mobile-ready #tasks-board-view,
 #tasks.task-mobile-ready > .lower-module { display:none!important; }
 #tasks.task-mobile-ready .task-view-content > .task-view-switch,
 #tasks.task-mobile-ready .task-view-content > p { display:none; }
 #tasks.task-mobile-filters-open .task-view-content > .task-view-switch,
 #tasks.task-mobile-filters-open .task-view-content > p { display:flex;flex-wrap:wrap; }
 #tasks.task-mobile-filters-open .task-view-content > .task-view-switch { background:#fff;padding:12px;border:1px solid var(--line);border-radius:12px; }
 #tasks.task-mobile-filters-open .task-view-switch label { flex:1 1 130px;min-width:0; }
 #tasks.task-mobile-filters-open .task-view-switch select { width:100%;max-width:100%; }
 #tasks.task-mobile-filters-open #show-task-list,
 #tasks.task-mobile-filters-open #show-task-board { display:none; }
 #tasks.task-mobile-ready .task-workspace { gap:0; }
 #tasks.task-mobile-ready .task-view-content { width:100%; }
 #task-mobile { display:block;min-width:0;padding:4px 0 18px; }
 #tasks button { -webkit-tap-highlight-color:transparent;touch-action:manipulation; }
 #tasks svg { width:22px;height:22px;flex-shrink:0; }
 #tasks .tm-head { display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px; }
 #tasks .tm-eyebrow { font-size:10px;letter-spacing:.11em;font-weight:800;color:var(--brand-dark); }
 #tasks h2 { font-size:28px;line-height:1.15;margin:6px 0 0;letter-spacing:-.6px;overflow-wrap:anywhere; }
 #tasks .tm-add { width:44px;height:44px;display:grid;place-items:center;border-radius:50%;padding:0;flex-shrink:0;box-shadow:0 4px 12px #008c9526; }
 #tasks .tm-create { display:flex;gap:8px;flex-wrap:wrap;margin:0 0 14px; }
 #tasks .tm-create.hidden-field { display:none!important; }
 #tasks .tm-create button { min-height:44px;flex:1; }
 #tasks .tm-search { display:flex;flex-direction:row;align-items:center;gap:9px;padding:0 12px;border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--muted); }
 #tasks .tm-search input { border:0;background:transparent;min-width:0;min-height:46px;padding:10px 0;box-shadow:none;font-size:16px; }
 #tasks .tm-shortcuts { display:flex;gap:9px;overflow-x:auto;padding:17px 0 20px;scrollbar-width:none; }
 #tasks .tm-shortcut { display:flex;align-items:center;gap:9px;flex:0 0 auto;text-align:left;background:white;color:var(--ink);border:1px solid var(--line);border-radius:14px;padding:12px;min-height:64px; }
 #tasks .tm-shortcut > span:first-child { display:grid;place-items:center;background:#e2f3f4;color:var(--brand-dark);width:35px;height:35px;border-radius:10px; }
 #tasks .tm-shortcut > span:last-child { display:grid;font-size:12px;gap:2px; }
 #tasks .tm-shortcut strong { font-size:20px;line-height:1; }
 #tasks .tm-overdue > span:first-child { background:#ffeded;color:#ac333f; }
 #tasks .tm-priority > span:first-child { background:#fff4dd;color:#a96e00; }
 #tasks .tm-section-heading { display:flex;justify-content:space-between;align-items:center;margin:4px 0 8px; }
 #tasks .tm-section-heading h3 { margin:0;font-size:17px; }
 #tasks .tm-section-heading > span { max-width:58%;font-size:11px;line-height:1.2;color:var(--muted);text-align:right; }
 #tasks .tm-list-reorder { display:grid; }
 #tasks .tm-department { color:var(--brand-dark);font-size:11px;text-transform:uppercase;letter-spacing:.08em;margin:23px 0 6px; }
 #tasks .tm-list-row { display:grid;grid-template-columns:36px minmax(0,1fr) auto 24px;align-items:center;gap:12px;width:100%;padding:13px 5px;min-height:67px;border-radius:0;background:transparent;color:var(--ink);text-align:left;border-bottom:1px solid var(--line);font-size:15px; }
 #tasks .tm-list-row:active { background:#e2f3f4; }
 #tasks .tm-list-icon { width:36px;height:36px;background:#e8f3f4;color:var(--brand-dark);border-radius:10px;display:grid;place-items:center; }
 #tasks .tm-personal .tm-list-icon { background:#fff1cb;color:#936000; }
 #tasks .tm-list-row small { display:block;color:var(--muted);font-size:11px;font-weight:400;margin-top:3px; }
 #tasks .tm-list-row b { font-size:14px;font-weight:500;color:var(--muted);padding:0 6px; }
 #tasks .tm-drag-handle { display:grid;place-items:center;width:24px;min-height:38px;color:var(--muted);font-size:17px;letter-spacing:-4px;cursor:grab;touch-action:none;user-select:none; }
 #tasks .tm-list-row.tm-list-moving { opacity:.58;background:#dff1f2;border:1px dashed var(--brand);border-radius:10px; }
 #tasks .tm-list-tools { display:flex;align-items:center;justify-content:space-between;gap:6px;margin:14px 0; }
 #tasks .tm-list-tools button { display:flex;align-items:center;gap:3px;background:transparent;color:var(--brand-dark);padding:6px 0;min-height:44px;font-size:12px; }
 #tasks .tm-list-tools > span { color:var(--muted);font-size:11px; }
 #tasks .tm-cards { display:grid;gap:12px; }
 #tasks .tm-status-group { border:1px solid var(--line);border-radius:14px;background:#fff;overflow:hidden; }
 #tasks .tm-status-group > summary { display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:48px;padding:10px 12px;cursor:pointer;list-style:none;font-weight:800;color:var(--ink); }
 #tasks .tm-status-group > summary::-webkit-details-marker { display:none; }
 #tasks .tm-status-group > summary::before { content:'▸';color:var(--brand);font-size:18px;transition:transform .15s ease; }
 #tasks .tm-status-group[open] > summary::before { transform:rotate(90deg); }
 #tasks .tm-status-group > summary > span { flex:1; }
 #tasks .tm-status-group > summary > b { min-width:25px;padding:3px 7px;border-radius:999px;background:#e9f3f4;color:var(--brand-dark);font-size:12px;text-align:center; }
 #tasks .tm-status-group-working > summary { background:#edf4ff; }
 #tasks .tm-status-group-done > summary { background:#edf8f0; }
 #tasks .tm-status-group-cards { display:grid;gap:10px;padding:0 10px 10px; }
 #tasks .tm-status-group-cards .tm-card { box-shadow:none; }
 #tasks .tm-group-empty { padding:10px 8px 12px;color:var(--muted);font-size:12px;text-align:center; }
 #tasks .tm-card { border:1px solid var(--line);border-radius:15px;background:white;padding:14px;box-shadow:0 2px 5px #163c4305;min-width:0; }
 #tasks .tm-card-open { display:grid;gap:6px;width:100%;text-align:left;background:transparent;color:var(--ink);padding:0; }
 #tasks .tm-card-open strong { font-size:16px;line-height:1.35;overflow-wrap:anywhere; }
 #tasks .tm-card-location { font-size:10px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted); }
 #tasks .tm-card-meta { display:flex;align-items:center;justify-content:space-between;gap:10px;margin:16px 0 12px;font-size:12px; }
 #tasks .task-person-display { min-width:0;gap:6px; }
 #tasks .task-person-display > span:last-child { overflow-wrap:anywhere; }
 #tasks .task-avatar { width:25px;height:25px;font-size:11px;flex-shrink:0; }
 #tasks .tm-card-due { text-align:right;font-size:11px;flex-shrink:0; }
 #tasks .tm-card-bottom { display:flex;justify-content:space-between;align-items:center;gap:8px; }
 #tasks .tm-status { font-size:11px;line-height:1.3;padding:5px 9px;border-radius:6px;background:#eef2f4;color:#374151; }
 #tasks .tm-status.task-status-working { background:#e8f0ff;color:#1d4ed8; }
 #tasks .tm-status.task-status-complete { background:#e3f6e9;color:#16703c; }
 #tasks .tm-status.task-status-missing { background:#fff3d6;color:#875600; }
 #tasks .tm-tags { margin-top:10px;display:flex;flex-wrap:wrap;gap:5px; }
 #tasks .tm-empty { padding:30px 18px;text-align:center;border:1px dashed var(--line);border-radius:14px;color:var(--muted); }
 #tasks .tm-empty small { display:block;margin-top:8px;line-height:1.5; }
 /* Touch-friendly task detail: title and main actions stay reachable. */
 #task-detail.open .task-detail-editor { width:100%;max-width:100%;inset:0;border-radius:0;max-height:100dvh; }
 #task-detail .task-detail-window-head { padding:10px 12px;gap:8px; }
 #task-detail .task-detail-window-actions { display:flex;gap:5px; }
 #task-detail .task-detail-window-actions button { min-height:42px;padding:8px 10px;font-size:12px; }
 #task-detail .task-detail-breadcrumb { font-size:10px;line-height:1.4; }
 #task-detail input,#task-detail textarea,#task-detail select { font-size:16px; }
 #task-detail .task-detail-title { font-size:23px; }
}

.task-mobile-overview-toggle,.task-mobile-drag-hint { display:none; }
@media (orientation:landscape) and (max-width:1100px) {
 body.task-app-mode #task-mobile-drag-hint { display:inline-flex;align-items:center;color:var(--muted);font-size:11px;line-height:1.25; }
 body.task-app-mode #task-mobile-overview-toggle { display:inline-flex;align-items:center;justify-content:center;white-space:nowrap; }
 body.task-app-mode #tasks .task-workspace { grid-template-columns:minmax(180px,220px) minmax(0,1fr); }
 body.task-app-mode #tasks.task-overview-collapsed .task-workspace { grid-template-columns:minmax(0,1fr); }
 body.task-app-mode #tasks.task-overview-collapsed .task-space-nav { display:none; }
 body.task-app-mode #tasks .task-board { grid-template-columns:repeat(auto-fit,minmax(138px,1fr)); }
 body.task-app-mode #tasks .task-card[data-task-id] { touch-action:none; }
 body.task-app-mode #tasks .task-card.dragging { opacity:.35; }
 body.task-app-mode.task-touch-dragging { overflow:hidden;user-select:none; }
 .task-touch-drag-ghost { position:fixed!important;z-index:20000!important;top:0;left:0;width:min(210px,38vw);margin:0!important;pointer-events:none;opacity:.94;box-shadow:0 12px 28px #102a3240;transform-origin:top left; }
}

@media(max-width:700px) {
 body.task-app-mode:has(#tasks.active.task-mobile-ready) .topbar-title > h1 { display:block; }
 body.task-app-mode:has(#tasks.active.task-mobile-ready) .task-app-brand-icon { display:block; }
 body.task-app-mode:has(#tasks.active.task-mobile-ready) .topbar-brand-logo { display:none; }
 body.task-app-mode:has(#tasks.active.task-mobile-ready) .topbar-title { display:grid;grid-template-columns:42px minmax(0,1fr);grid-template-rows:auto;column-gap:9px;align-items:center; }
 body.task-app-mode:has(#tasks.active.task-mobile-ready) .topbar-title h1 { grid-column:2;grid-row:1;font-size:18px;white-space:nowrap; }
 body.task-app-mode:has(#tasks.active.task-mobile-ready) .topbar .actions { flex-wrap:nowrap; }
 body.task-app-mode:has(#tasks.active.task-mobile-ready) #tasks { padding-bottom:max(18px,env(safe-area-inset-bottom)); }
 body.task-app-mode #tasks .tm-head { margin-bottom:14px; }
 body.task-app-mode #tasks h2 { font-size:24px;letter-spacing:-.35px; }
 body.task-app-mode #tasks .tm-add { width:40px;height:40px; }
 body.task-app-mode #tasks .tm-shortcuts { padding:13px 0 15px; }
 body.task-app-mode #tasks .tm-shortcut { min-height:56px;padding:9px 10px; }
 body.task-app-mode #tasks .tm-shortcut > span:first-child { width:31px;height:31px; }
 body.task-app-mode #tasks .tm-shortcut strong { font-size:18px; }
 body.task-app-mode #tasks .tm-department { margin-top:18px; }
 body.task-app-mode #tasks .tm-list-row { grid-template-columns:32px minmax(0,1fr) auto 22px;gap:9px;min-height:58px;padding:9px 4px;font-size:14px; }
 body.task-app-mode #tasks .tm-list-icon { width:32px;height:32px; }
 body.task-app-mode #tasks .tm-card { padding:12px; }
 body.task-app-mode #tasks .tm-card-open strong { font-size:15px; }
 body.task-app-mode #tasks .tm-card-meta { margin:12px 0 10px; }
 body.task-app-mode .task-activity-notice,
 body.task-app-mode .task-activity-notice:popover-open {
  position:fixed;
  inset:auto max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));
  z-index:10000;
  width:auto;
  max-width:none;
  max-height:min(52dvh,460px);
  margin:0;
  padding:13px;
  overflow:auto;
  border:1px solid #b9d4d7;
  border-radius:18px;
  background:#fff;
  color:var(--ink);
  box-shadow:0 14px 42px #102a3240;
  font-size:13px;
  line-height:1.4;
  box-sizing:border-box;
  -webkit-overflow-scrolling:touch;
 }
 body.task-app-mode .task-activity-notice[hidden] { display:none!important; }
 body.task-app-mode .task-activity-notice > strong { display:block;color:var(--brand-dark);font-size:12px;text-transform:uppercase;letter-spacing:.05em; }
 body.task-app-mode .task-activity-notice h3 { margin:4px 0 8px;font-size:16px;line-height:1.25;overflow-wrap:anywhere; }
 body.task-app-mode .task-activity-notice p { margin:8px 0;overflow-wrap:anywhere; }
 body.task-app-mode .task-activity-notice .task-notice-message { max-height:5.6em;overflow:auto;padding:8px;border-radius:10px;background:#f1f7f7;white-space:pre-wrap; }
 body.task-app-mode .task-activity-notice > div { display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:10px; }
 body.task-app-mode .task-activity-notice > div button { width:100%;min-width:0;min-height:40px;padding:7px 8px;font-size:13px;line-height:1.2;white-space:normal; }
 body.task-app-mode .task-activity-notice > div button:last-child { grid-column:1 / -1; }
}
