/* Responsive workspace. One brand and the same workflow at every size. */
.mobile-queue-header, .mobile-task-card-content, .mobile-work-queue,
.mobile-workspace-bar, .mobile-more-sections, .mobile-task-filter,
.mobile-executor-filter, .mobile-quick-scopes, .mobile-reset-filters { display: none; }

.platform-shell .platform-content { min-width: 0; }
.platform-shell .workspace-section, .platform-shell .panel,
.platform-shell .task-main, .platform-shell .member-primary { min-width: 0; }
.platform-shell :is(input, select, textarea) { max-width: 100%; }
.platform-shell :is(h1, h2, h3, .task-main b) { overflow-wrap: anywhere; }
.platform-shell .section-tabs { max-width: 100%; overflow-x: auto; }
.platform-shell .section-tabs button { flex-shrink: 0; }
.platform-shell .task-toolbar { grid-template-columns: minmax(180px,1fr) auto auto; }
.platform-shell .task-toolbar .filter-pills { grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; }
.platform-shell.light .workflow-badge.info { color: #2d60a5; }
.platform-shell.light .workflow-badge.warning { color: #855013; }
.platform-shell.light .workflow-badge.danger { color: #b82e43; }
.platform-shell.light .workflow-badge.success { color: #267454; }
.platform-shell.light .workflow-badge.purple,
.platform-shell.light .board-quick-filters button.active,
.platform-shell.light .board-view-switch button.active { color: #6750c6; }
.platform-shell.light .board-priority.low { color: #646a7b; }
.platform-shell.light .board-priority.high { background: #bd3044; }

/* Room for content on tablets, readable detail on desktop. */
@media (min-width: 681px) {
  .platform-shell .task-row-card { grid-template-columns: 50px minmax(180px,1fr) minmax(130px,.6fr) 125px 120px; gap: 16px; padding: 18px; }
  .platform-shell .task-main b { font-size: 14px; line-height: 1.5; white-space: normal; }
  .platform-shell .task-main small, .platform-shell .task-copy small,
  .platform-shell .task-number, .platform-shell .task-id { font-size: 11px; }
  .platform-shell .task-copy b { font-size: 14px; white-space: normal; line-height: 1.45; }
  .platform-shell .task-due b, .platform-shell .assignee-stack small { font-size: 12px; }
  .platform-shell .workflow-badge { white-space: normal; font-size: 11px; line-height: 1.45; }
  .platform-shell .dashboard-scope > div b { font-size: 16px; }
  .platform-shell .dashboard-scope > div span, .platform-shell .dashboard-scope label,
  .platform-shell .stat-card span, .platform-shell .stat-card small { font-size: 12px; }
  .platform-shell .stat-card { min-height: 130px; padding: 20px; }
  .platform-shell .team-load-person b, .platform-shell .workflow-roadmap strong { font-size: 13px; }
  .platform-shell .team-load-person small, .platform-shell .workflow-roadmap small { font-size: 11px; }
  .platform-shell .board-search-form input, .platform-shell .board-quick-filters button { font-size: 12px; }
  .platform-shell .board-commandbar { display: flex; flex-wrap: wrap; }
  .platform-shell .board-search-form { flex: 1 1 240px; }
  .platform-shell .board-quick-filters { flex: 0 1 auto; }
  .platform-shell .board-tools { margin-left: auto; }
  .platform-shell .kanban-card h3 { font-size: 14px; line-height: 1.5; }
  .platform-shell .kanban-card > p, .platform-shell .kanban-card-footer time,
  .platform-shell .kanban-card-top > span, .platform-shell .board-priority { font-size: 11px; }
}
@media (min-width: 681px) and (max-width: 1100px) {
  .platform-shell .platform-content { padding: 20px 18px 32px; }
  .platform-shell .dashboard-grid { grid-template-columns: 1fr; }
  .platform-shell .task-focus-panel { grid-row: auto; }
  .platform-shell .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .platform-shell .task-row-card { grid-template-columns: 42px minmax(0,1fr) 112px; gap: 12px; }
  .platform-shell .task-row-card > .assignee-stack { display: none; }
  .platform-shell .task-row-card > .task-due { display: grid; grid-column: 3; grid-row: 1 / 3; }
  .platform-shell .task-row-card > .workflow-badge { grid-column: 2; justify-self: start; }
  .platform-shell .task-toolbar { grid-template-columns: minmax(0,1fr) auto; }
  .platform-shell .task-toolbar .executor-filter { grid-column: 1; grid-row: 3; }
  .platform-shell .task-toolbar .task-create-inline { grid-column: 2; grid-row: 1; }
  .platform-shell .member-directory-toolbar { grid-template-columns: 1fr; }
  .platform-shell .member-filter-row { flex-wrap: wrap; }
  .platform-shell .member-grid { grid-template-columns: 1fr; }
  .platform-shell .profile-view { grid-template-columns: 1fr; }
  .platform-shell .dashboard-scope { flex-wrap: wrap; }
  .platform-shell .dashboard-scope-actions { flex-wrap: wrap; }
}

/* 16px inputs avoid unwanted iOS zoom. Touch targets also apply to tablets. */
@media (max-width: 1024px) {
  .platform-shell :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { font-size: 16px; }
  .platform-shell :is(.primary-button, .secondary-button, .danger-button, .section-tabs button, .filter-pills button) { min-height: 44px; }
  .platform-shell .board-scroll-tools button { width: 44px; height: 44px; }
  .platform-shell .board-quick-filters button, .platform-shell .board-view-switch button { min-height: 44px; }
  .platform-shell .board-view-switch { height: 50px; }
}

@media (max-width: 680px) {
  html { --mobile-page-background: #101114; background: var(--mobile-page-background); }
  html[data-theme="light"] { --mobile-page-background: #f4f5f9; color-scheme: light; }
  body { background: var(--mobile-page-background); }
  .platform-shell:not(.light) {
    --bg: #101114;
    --surface: #191b22;
    --surface-raised: #20232c;
    --surface-soft: #272b35;
    --muted: #a0a5b4;
    --muted-2: #8c92a2;
    --purple: #b3a3ff;
    --purple-strong: #846cf2;
    --purple-soft: rgba(155,135,245,.14);
  }
  .platform-shell {
    --mobile-accent: var(--purple);
    --mobile-action-bg: #7960e8;
    --mobile-action-text: #fff;
    --mobile-nav-bg: var(--surface);
    --mobile-avatar-bg: var(--purple-soft);
    --mobile-avatar-text: var(--purple);
    --mobile-danger-text: #ff929b;
    --mobile-warning-text: #eabd7a;
    min-height: 100dvh;
    background: var(--bg);
  }
  .platform-shell.light {
    --bg: #f4f5f9;
    --surface: #fff;
    --surface-raised: #f1f2f7;
    --surface-soft: #e9ebf2;
    --text: #20212b;
    --text-soft: #454957;
    --muted: #646a7b;
    --muted-2: #747b8d;
    --purple: #6750c6;
    --purple-strong: #745bdc;
    --purple-soft: #eee9ff;
    --line: rgba(31,35,52,.1);
    --line-strong: rgba(31,35,52,.18);
    --mobile-accent: var(--purple);
    --mobile-action-bg: #745bdc;
    --mobile-action-text: #fff;
    --mobile-nav-bg: var(--surface);
    --mobile-avatar-bg: var(--purple-soft);
    --mobile-avatar-text: var(--purple);
    --mobile-danger-text: #b82e43;
    --mobile-warning-text: #885a13;
  }
  .platform-shell .platform-content, .platform-shell .platform-content:has(.board-view) {
    min-height: 100dvh; margin-left: 0;
    padding: max(12px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));
  }
  .platform-shell .platform-content > section { animation: none; }
  .mobile-workspace-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 25px; }
  .mobile-workspace-bar > button:first-child { display: flex; align-items: center; min-width: 0; gap: 10px; min-height: 44px; padding: 0; text-align: left; }
  .mobile-workspace-bar .brand-emblem { width: 30px; height: 30px; flex-shrink: 0; }
  .mobile-workspace-bar > button > span:not(.brand-emblem):not(.avatar) { min-width: 0; display: grid; gap: 3px; }
  .mobile-workspace-bar small { color: var(--muted); font-size: 8px; letter-spacing: .12em; }
  .mobile-workspace-bar b { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 650; }
  .mobile-workspace-bar > button:last-child { min-width: 44px; min-height: 44px; padding: 0; }
  .mobile-workspace-bar .avatar { width: 36px; height: 36px; margin-left: auto; background: var(--purple-soft); color: var(--purple); }
  .mobile-work-queue, .mobile-queue-header, .mobile-task-card-content { display: flex; flex-direction: column; min-width: 0; }
  .desktop-dashboard-content { display: none; }
  .mobile-queue-header { margin: 0 0 20px; }
  .mobile-day-date { color: var(--muted); font-size: 12px; text-transform: capitalize; margin-bottom: 8px; }
  .mobile-queue-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .mobile-queue-heading > div:first-child { min-width: 0; }
  .mobile-queue-heading h1 { color: var(--text); font-size: clamp(26px,7vw,32px); font-weight: 760; line-height: 1.15; letter-spacing: -.04em; }
  .mobile-queue-heading p { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.5; }
  .mobile-queue-actions { display: flex; gap: 6px; }
  .mobile-queue-actions button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--text-soft); }
  .mobile-queue-actions button.active { background: var(--purple-soft); color: var(--purple); border-color: var(--purple); }
  .mobile-day-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-bottom: 25px; }
  .mobile-day-summary button { min-height: 88px; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); text-align: left; }
  .mobile-day-summary button > span { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
  .mobile-day-summary b { font-size: 24px; font-weight: 700; line-height: 1; color: var(--text); }
  .mobile-day-summary small { display: block; margin-top: 14px; font-size: 10px; color: var(--muted); white-space: nowrap; }
  .mobile-day-summary .blue .app-icon { color: var(--blue); }
  .mobile-day-summary .red .app-icon { color: var(--mobile-danger-text); }
  .mobile-day-summary .purple .app-icon { color: var(--purple); }
  .mobile-focus-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 10px; }
  .mobile-focus-heading h2 { font-size: 17px; letter-spacing: -.02em; }
  .mobile-focus-heading button { min-height: 44px; display: flex; align-items: center; gap: 5px; padding: 0; color: var(--purple); font-size: 12px; }
  .mobile-queue-more { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--purple); font-size: 13px; }

  .platform-shell .task-toolbar { display: none; grid-template-columns: minmax(0,1fr); margin: 0 0 16px; padding: 0; border: 0; background: transparent; box-shadow: none; gap: 12px; }
  .platform-shell .task-toolbar.mobile-search-open, .platform-shell .task-toolbar.mobile-filters-open, .platform-shell .tasks-view > .task-toolbar { display: grid; }
  .task-toolbar .task-search-form, .platform-shell .task-toolbar .filter-pills,
  .task-toolbar .executor-filter, .task-toolbar .task-create-inline { display: none; }
  .platform-shell .task-toolbar .filter-pills { grid-column: 1; grid-row: auto; flex-wrap: nowrap; overflow-x: auto; }
  .task-toolbar.mobile-search-open .task-search-form, .tasks-view .task-toolbar .task-search-form,
  .mobile-work-queue .task-toolbar.mobile-filters-open .filter-pills { display: flex; }
  .task-toolbar .task-search-form { min-height: 48px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); padding-left: 13px; }
  .task-toolbar .task-search-form input { width: 100%; min-width: 0; font-size: 16px; }
  .task-toolbar .task-search-form button { min-height: 44px; padding: 0 12px; font-size: 12px; color: var(--purple); }
  .task-toolbar .filter-pills button { min-height: 44px; flex-shrink: 0; padding-inline: 14px; font-size: 12px; }
  .tasks-view .mobile-quick-scopes { display: flex; gap: 7px; overflow-x: auto; max-width: 100%; padding-bottom: 3px; scrollbar-width: thin; }
  .mobile-quick-scopes button { flex-shrink: 0; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--muted); font-size: 12px; }
  .mobile-quick-scopes button[aria-pressed="true"] { border-color: transparent; background: var(--purple-soft); color: var(--purple); }
  .task-toolbar.mobile-filters-open .mobile-executor-filter,
  .task-toolbar.mobile-filters-open .mobile-task-filter { display: flex; flex-direction: column; gap: 7px; min-width: 0; color: var(--muted); font-size: 12px; }
  .task-toolbar select { width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 12px; background: var(--surface); }
  .executor-picker { position: relative; min-width: 0; }
  .executor-picker summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 44px;
    padding: 9px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    list-style: none;
  }
  .executor-picker summary::-webkit-details-marker { display: none; }
  .executor-picker summary > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .executor-picker summary .app-icon { flex-shrink: 0; transform: rotate(90deg); }
  .executor-picker[open] summary { border-color: var(--mobile-accent); }
  .executor-picker-panel {
    position: absolute;
    z-index: 30;
    right: 0;
    top: calc(100% + 6px);
    width: min(310px, calc(100vw - 40px));
    padding: 10px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface-raised);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .22);
  }
  .executor-picker-search {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 16px;
  }
  .executor-picker-options { max-height: min(240px, 30dvh); overflow-y: auto; overscroll-behavior: contain; margin-top: 8px; }
  .executor-picker-options button {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    text-align: left;
    font-size: 13px;
  }
  .executor-picker-options button[hidden] { display: none; }
  .executor-picker-options button[aria-pressed="true"],
  .executor-picker-options button:hover { background: var(--purple-soft); color: var(--mobile-accent); }
  .executor-picker-empty { margin: 10px; font-size: 12px; color: var(--muted); }

  .tasks-view > .task-list, .mobile-work-queue > .task-list { display: grid; gap: 12px; margin: 0; }
  .platform-shell .task-row-card[data-deadline] { width: 100%; min-width: 0; min-height: 0; display: block; position: relative; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 3px 12px rgba(0,0,0,.04); transform: none; }
  .platform-shell .task-row-card[data-deadline]:hover { border-color: var(--line-strong); background: var(--surface); transform: none; }
  .platform-shell .task-row-card[data-deadline]:active { background: var(--surface-raised); }
  .task-row-card > .task-status-line, .task-row-card > .task-id, .task-row-card > .task-main,
  .task-row-card > .assignee-stack, .task-row-card > .task-due, .task-row-card > .workflow-badge { display: none; }
  .mobile-task-card-content { padding: 15px; text-align: left; }
  .mobile-task-card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
  .mobile-task-number { color: var(--muted); font: 500 11px ui-monospace,SFMono-Regular,monospace; flex-shrink: 0; }
  .mobile-task-deadline { display: flex; justify-content: flex-end; color: var(--muted); font-size: 10px; line-height: 1.5; text-align: right; }
  [data-deadline="overdue"] .mobile-task-deadline { color: var(--mobile-danger-text); background: color-mix(in srgb,var(--mobile-danger-text) 10%,transparent); padding: 3px 7px; border-radius: 6px; }
  [data-deadline="today"] .mobile-task-deadline { color: var(--mobile-warning-text); }
  .mobile-task-title { display: block; color: var(--text); font-size: 15px; font-weight: 650; line-height: 1.5; letter-spacing: -.015em; overflow-wrap: anywhere; white-space: normal; }
  .mobile-task-details { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); }
  .mobile-task-workflow { display: inline-flex; gap: 5px; align-items: center; min-width: 0; color: var(--text-soft); font-size: 10px; line-height: 1.5; font-style: normal; }
  .mobile-task-workflow::before { content: ""; width: 5px; height: 5px; flex-shrink: 0; background: var(--purple); border-radius: 50%; }
  .mobile-task-workflow.warning::before { background: var(--orange); }
  .mobile-task-workflow.success::before { background: var(--green); }
  .mobile-task-people { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
  .mobile-task-people > span:last-child { overflow-wrap: anywhere; }
  .mobile-task-people .avatar { width: 23px; height: 23px; flex-shrink: 0; font-size: 10px; background: var(--purple-soft); color: var(--purple); }

  .platform-shell .mobile-nav { position: fixed; z-index: 70; inset: auto 0 0; min-height: calc(70px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); align-items: start; gap: 0; padding: 7px max(8px,env(safe-area-inset-right)) max(7px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left)); border: 0; border-top: 1px solid var(--line); border-radius: 0; background: var(--mobile-nav-bg); box-shadow: 0 -8px 28px rgba(0,0,0,.05); }
  .platform-shell .mobile-nav:not(:has(.mobile-nav-create)) { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .platform-shell .mobile-nav > button { min-width: 0; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border-radius: 12px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 600; }
  .platform-shell .mobile-nav > button.active { background: transparent; color: var(--mobile-accent); }
  .platform-shell .mobile-nav-create .app-icon { width: 40px; height: 32px; color: #fff; background: var(--mobile-action-bg); border-radius: 10px; }
  .mobile-nav-create .ph-plus-circle::before { display: none; }
  .mobile-nav-create .ph-plus-circle::after { margin-left: 0; }
  .platform-shell .mobile-nav > .mobile-nav-create { gap: 2px; color: var(--text-soft); }
  .platform-shell:has(.platform-modal, .board-settings-modal, .mobile-drawer) .mobile-nav { visibility: hidden; }

  /* Secondary pages use the same spacing and legible controls. */
  .platform-shell .workspace-section { padding: 0; }
  .platform-shell .workspace-section-header { margin-bottom: 20px; }
  .platform-shell .workspace-section-header h1 { font-size: 28px; }
  .platform-shell .section-tabs { gap: 8px; margin-top: 16px; padding-bottom: 4px; }
  .platform-shell .section-tabs button { font-size: 12px; min-height: 44px; }
  .platform-shell .settings-controls { padding: 18px; gap: 18px; }
  .platform-shell .settings-controls > div { align-items: stretch; flex-direction: column; gap: 12px; }
  .platform-shell .settings-picker { grid-template-columns: 1fr; gap: 8px; }
  .platform-shell .profile-card, .platform-shell .password-card { padding: 20px; }
  .platform-shell .profile-details h2 { font-size: 24px; }
  .platform-shell .profile-details p { font-size: 14px; }
  .platform-shell .profile-details dt { font-size: 12px; }
  .platform-shell .profile-details dd { font-size: 14px; }
  .platform-shell .avatar-upload { min-height: 44px; }
  .platform-shell.light .member-filter-pills button.active { color: var(--purple); }
  .platform-shell.light .member-status.ready { color: #267454; }
  .platform-shell .mobile-reset-filters { display: flex; align-items: center; justify-content: flex-start; gap: 8px; min-height: 44px; color: var(--purple); border: 0; background: transparent; font-size: 12px; text-align: left; }
  .platform-shell .profile-details dl { text-align: left; }
  .platform-shell .profile-details dl div { grid-template-columns: 1fr; gap: 6px; }
  .platform-shell .password-card p { font-size: 13px; line-height: 1.6; }
  .platform-shell .member-directory-toolbar { padding: 14px; gap: 12px; }
  .platform-shell .member-filter-pills { max-width: 100%; overflow-x: auto; }
  .platform-shell .member-filter-pills button { min-height: 44px; flex-shrink: 0; font-size: 12px; }
  .platform-shell .member-card-v2 { grid-template-columns: 42px minmax(0,1fr) 16px; padding: 15px; gap: 10px; }
  .platform-shell .member-primary b { font-size: 14px; white-space: normal; line-height: 1.4; }
  .platform-shell .member-status { font-size: 11px; }
  .platform-shell .member-metrics { grid-column: 2; grid-row: 2; gap: 20px; }
  .platform-shell .member-chevron { grid-column: 3; grid-row: 1 / 3; }
  .platform-shell .seat-banner { padding: 18px; gap: 16px; }
  .platform-shell .seat-actions { display: flex; flex-wrap: wrap; }
  .platform-shell .organization-card, .platform-shell .rule-card { padding: 18px; }
  .platform-shell .organization-head h2 { font-size: 19px; }
  .platform-shell .organization-head p { overflow-wrap: anywhere; }
  .platform-shell .limit-form { grid-template-columns: 1fr; }
  .platform-shell .automation-hero { flex-wrap: wrap; padding: 18px; }
  .platform-shell .automation-hero h2 { font-size: 20px; }

  /* Full-screen task detail; forms stay scrollable above the browser keyboard. */
  .platform-shell .modal-backdrop { padding: 0; }
  .platform-shell .platform-modal { width: 100%; max-height: 100dvh; border-radius: 18px 18px 0 0; }
  .platform-shell .modal-backdrop:not(.task-drawer-backdrop) { align-items: end; }
  .platform-shell .platform-modal > header { padding: max(16px,env(safe-area-inset-top)) 18px 14px; }
  .platform-shell .platform-modal > header .modal-close { width: 44px; height: 44px; flex-shrink: 0; }
  .platform-shell .task-create-form, .platform-shell .member-create-form { padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
  .platform-shell .field, .platform-shell .assignee-picker legend { font-size: 13px; line-height: 1.5; }
  .platform-shell .form-grid { gap: 20px; }
  .platform-shell .field :is(input,select,textarea), .platform-shell .assignee-search-field input { font-size: 16px; }
  .platform-shell .assignee-option { padding: 12px; min-height: 64px; }
  .platform-shell .assignee-option b { font-size: 13px; }
  .platform-shell .assignee-option small, .platform-shell .assignee-option em { font-size: 11px; }
  .platform-shell .task-create-form > footer button, .platform-shell .member-create-form > footer button { flex: 1; min-height: 48px; }
  .platform-shell .task-drawer-backdrop { display: grid; grid-template-columns: minmax(0,1fr); padding: 0; }
  .platform-shell .task-detail-drawer { grid-column: 1; width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .platform-shell .task-detail-drawer > .task-drawer-header { gap: 8px; grid-template-columns: minmax(0,1fr) 44px; max-height: 36dvh; overflow-y: auto; padding: max(16px,env(safe-area-inset-top)) 18px 18px; }
  .platform-shell .task-detail-drawer > .task-drawer-header h2 { font-size: 21px; line-height: 1.35; text-wrap: auto; }
  .platform-shell .task-drawer-header .modal-close { margin: 0; }
  .platform-shell .task-drawer-facts dl { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
  .platform-shell .task-drawer-facts dl > div:last-child { grid-column: 1 / -1; }
  .platform-shell .task-drawer-action { padding: 16px 18px max(16px,env(safe-area-inset-bottom)); max-height: 45dvh; overflow-y: auto; }
  .platform-shell .task-drawer-assignees .assignment-item { min-height: 65px; }
  .platform-shell .task-drawer-section { padding: 22px 0; }
  .platform-shell .task-attachment-preview { grid-column: 1; min-width: 0; }
  .platform-shell .toast, .platform-shell .global-error { right: 16px; left: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); max-width: none; font-size: 13px; line-height: 1.5; padding: 12px; }
  .platform-shell .mobile-drawer { width: min(340px,92vw); }
  .platform-shell .mobile-drawer > header { padding-top: max(12px,env(safe-area-inset-top)); }
  .platform-shell .mobile-drawer > nav button { font-size: 14px; }
}
@media (max-width: 370px) {
  .mobile-workspace-bar b { max-width: 165px; }
  .mobile-queue-heading h1 { font-size: 26px; }
  .mobile-queue-actions { gap: 4px; }
  .mobile-day-summary button { padding: 10px; }
  .mobile-task-card-content { padding: 13px; }
}

/* Public pages retain the established hero, with touch-friendly controls. */
@media (max-width: 680px) {
  .public-shell input, .login-page input, .login-page select { font-size: 16px; }
  .public-shell .public-login, .public-shell .public-register { min-height: 44px; }
}
