/* Celular (até 800 px): barra de navegação flutuante, botão "+", topo compacto e as telas Departamentos e Mais */
.mobile-nav, .mobile-fab, #mobile-avatar, #mobile-title { display: none; }

@media (max-width: 800px) {
  :root { --m-bar-h: 64px; --m-safe: env(safe-area-inset-bottom, 0px); --m-top: env(safe-area-inset-top, 0px); }   /* --m-top: margem de cima (barra de status / ilha do iPhone); o mobile.js corrige quando o sistema informa 0 mas a tela vai até o topo */

  /* ---- topo: foto | título | Mensagens | Delegações | sino ---- */
  .topbar { height: 56px; padding: 0 0.75rem; gap: 0.35rem; display: flex; align-items: center; justify-content: flex-start; }
  .topbar-left, .topbar-right { display: contents; }
  .btn-toggle-sidebar, .search-box, #btn-theme-toggle, #btn-sound-toggle, #user-switch-wrap { display: none !important; }
  #mobile-avatar { display: inline-flex; order: 1; width: 38px; height: 38px; padding: 0; border: 2px solid var(--accent-primary); border-radius: 50%; background: transparent; overflow: hidden; flex-shrink: 0; cursor: pointer; }
  #mobile-avatar img { width: 100%; height: 100%; object-fit: cover; }
  #mobile-title { display: block; order: 2; flex: 1; min-width: 0; text-align: center; font-size: 1.05rem; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #top-asks-wrap { order: 3; }
  #top-deleg-wrap { order: 4; }
  .topbar-right { }
  #btn-notifications-bell { order: 5; }
  .btn-top-asks { padding: 0.45rem; border-radius: 12px; min-width: 40px; min-height: 40px; justify-content: center; }
  .btn-top-asks .asks-label { display: none; }
  .asks-popover { display: none !important; }
  #btn-notifications-bell { min-width: 40px; min-height: 40px; }
  body.m-search .search-box { display: flex !important; position: fixed; top: calc(60px + var(--m-top, 0px)); left: 12px; right: 12px; width: auto; z-index: 70; box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18); }
  body.m-search .search-box:focus-within { width: auto; }

  /* ---- conteúdo: sobra espaço para a barra de baixo ---- */
  .page-container { padding: 1rem 0.9rem calc(var(--m-bar-h) + 56px + var(--m-safe)); }

  /* ---- barra de baixo flutuante ---- */
  .mobile-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--m-bar-h) + var(--m-safe)); padding: 6px 6px var(--m-safe); gap: 2px; z-index: 55;
                background: var(--bg-side, #e8edf3); border-top: 1px solid var(--border-card, #d3dce8); border-radius: 0; box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.10); }
  .mobile-tab { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: transparent; border-radius: 20px; color: var(--text-secondary); font-family: inherit; font-size: 0.66rem; font-weight: 600; cursor: pointer; padding: 4px 2px; -webkit-tap-highlight-color: transparent; }
  .mobile-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-tab.active { background: color-mix(in srgb, var(--accent-primary) 12%, transparent); color: var(--accent-primary); }

  /* ---- botão + ---- */
  .mobile-fab { display: inline-flex; align-items: center; justify-content: center; position: fixed; right: 16px; bottom: calc(var(--m-bar-h) + 16px + var(--m-safe)); width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent-primary); color: #fff; box-shadow: 0 8px 22px rgba(79, 70, 229, 0.45); z-index: 56; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .mobile-fab:active { transform: scale(0.95); }
  body.m-hide-fab .mobile-fab { display: none; }
  /* some quando algo está aberto por cima: janelas, tarefa aberta, conversa aberta */
  body:has(.modal-overlay.active) .mobile-nav, body:has(.modal-overlay.active) .mobile-fab,
  body:has(.task-modal-overlay.active) .mobile-nav, body:has(.task-modal-overlay.active) .mobile-fab,
  body:has(.msg-layout.has-open) .mobile-nav, body:has(.msg-layout.has-open) .mobile-fab,
  body:has(.sidebar.open) .mobile-nav, body:has(.sidebar.open) .mobile-fab { display: none; }

  /* ---- telas Departamentos e Mais ---- */
  .m-list-wrap { display: flex; flex-direction: column; gap: 0.9rem; }
  .m-card { background: var(--bg-card, var(--bg-surface)); border: 1px solid var(--border-card, var(--border-color)); border-radius: 18px; box-shadow: var(--shadow-card, none); overflow: hidden; }
  .m-row { display: flex; align-items: center; gap: 0.8rem; width: 100%; min-height: 52px; padding: 0.55rem 1rem; border: 0; background: transparent; font-family: inherit; font-size: 1rem; color: var(--text-primary); text-align: left; cursor: pointer; border-top: 1px solid rgba(15, 23, 42, 0.07); -webkit-tap-highlight-color: transparent; }
  .m-card > .m-row:first-child, .m-rows > .m-row:first-child { border-top: 0; }
  .m-row:active { background: rgba(15, 23, 42, 0.05); }
  .m-row-icon { flex-shrink: 0; color: var(--text-secondary); }
  .m-row-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-chev { color: var(--text-muted); flex-shrink: 0; }
  .m-hash { font-weight: 700; font-size: 1.15rem; width: 20px; text-align: center; flex-shrink: 0; }
  .m-count { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); background: var(--bg-surface-elevated); border-radius: 999px; padding: 1px 8px; }
  .m-count.is-alert { background: #dc2626; color: #fff; }
  .m-danger { color: #dc2626; }
  .m-danger .m-row-icon { color: #dc2626; }
  .m-empty { padding: 1rem; color: var(--text-muted); font-size: 0.9rem; text-align: center; }
  .m-profile { display: flex; align-items: center; gap: 0.85rem; padding: 0.9rem 1rem; }
  .m-profile-ava { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent-primary); }
  .m-profile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .m-profile-text small { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }
  .m-dept-head { display: flex; align-items: stretch; }
  .m-dept-toggle { flex: 1; display: flex; align-items: center; gap: 0.7rem; min-height: 54px; padding: 0.5rem 1rem; border: 0; background: transparent; font-family: inherit; font-size: 1.02rem; color: var(--text-primary); text-align: left; cursor: pointer; }
  .m-dept-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
  .m-dept-add { width: 54px; border: 0; border-left: 1px solid rgba(15, 23, 42, 0.07); background: transparent; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
  .m-rows { border-top: 1px solid rgba(15, 23, 42, 0.07); }
}

@media (max-width: 800px) {
  .mobile-tab { font-size: 0.6rem; }
  .mobile-tab span { white-space: normal; text-align: center; line-height: 1.05; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}

/* ---- etapa 2: listas e cartoes para o toque, titulo so no topo, faixa da semana ---- */
@media (max-width: 800px) {
  body[data-view="today"] .today-main-title,
  body[data-view="inbox"] .view-title-group h1, body[data-view="upcoming"] .view-title-group h1 { display: none; }
  body[data-view="inbox"] .view-subtitle, body[data-view="upcoming"] .view-subtitle { display: none; }
  body[data-view="today"] .today-header-container, body[data-view="inbox"] .view-header, body[data-view="upcoming"] .view-header { margin-bottom: 0.6rem; justify-content: flex-end; }
  .today-summary { gap: 0.35rem; }
  .today-progress { display: none; }

  /* grupos (Atrasada, Hoje, dias) */
  .task-group { margin-bottom: 1.1rem; }
  .group-title { font-size: 1rem; font-weight: 700; padding: 0.35rem 0.1rem; }
  .task-list { display: flex; flex-direction: column; gap: 0.55rem; }

  /* cartao da tarefa: maior, facil de tocar */
  .task-card { padding: 0.8rem 0.9rem; gap: 0.8rem; min-height: 60px; border-radius: 16px; -webkit-tap-highlight-color: transparent; }
  .task-card .task-title { font-size: 1.02rem; line-height: 1.3; }
  .task-card .task-description { font-size: 0.86rem; }
  .task-card .meta-chip { font-size: 0.8rem; padding: 0.2rem 0.5rem; }
  .task-card .task-checkbox, .task-card .task-check { width: 26px; height: 26px; flex-shrink: 0; }
  .btn-reagendar-text { padding: 0.5rem 0.7rem; font-size: 0.9rem; margin-left: auto; }
  .btn-inline-add { min-height: 48px; font-size: 0.98rem; }

  /* faixa da semana (Em Breve) */
  .m-week { background: var(--bg-card, var(--bg-surface)); border: 1px solid var(--border-card, var(--border-color)); border-radius: 18px; padding: 0.7rem 0.6rem 0.5rem; margin-bottom: 0.9rem; box-shadow: var(--shadow-card, none); }
  .m-week-head { display: flex; align-items: center; justify-content: space-between; padding: 0 0.4rem 0.5rem; font-size: 1rem; }
  .m-week-nav { border: 0; background: transparent; color: var(--text-secondary); width: 36px; height: 36px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
  .m-week-nav:disabled { opacity: 0.3; }
  .m-week-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
  .m-day { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: transparent; font-family: inherit; padding: 4px 0; border-radius: 14px; cursor: pointer; color: var(--text-primary); }
  .m-day small { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); }
  .m-day span { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 1.05rem; font-weight: 500; }
  .m-day.is-today span { background: var(--accent-primary); color: #fff; font-weight: 700; }
  .m-day.is-picked span { box-shadow: 0 0 0 2px var(--accent-primary); }
  .m-day.is-off { opacity: 0.35; }
  .m-dot { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
  .m-dot.on { background: var(--text-muted); }
  .task-group.m-flash { animation: mFlash 1.2s ease; }
  @keyframes mFlash { 0% { background: color-mix(in srgb, var(--accent-primary) 16%, transparent); } 100% { background: transparent; } }
}

@media (max-width: 800px) { .mobile-tab { flex: 1 1 0; padding: 4px 0; font-size: 0.56rem; letter-spacing: -0.01em; } .mobile-tab svg { width: 21px; height: 21px; } }

/* ---- etapa 3: gestos e folha de adiar ---- */
@media (max-width: 800px) {
  .task-card:not(.completed) { touch-action: pan-y; position: relative; overflow: hidden; }
  .task-card.m-swiping { transition: none; user-select: none; }
  .m-swipe-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 1.1rem; pointer-events: none; border-radius: inherit; font-weight: 700; font-size: 0.95rem; opacity: 0; }
  .m-swipe-hint span { display: none; align-items: center; gap: 0.4rem; }
  .m-swipe-hint.is-right { background: rgba(22, 163, 74, 0.16); color: #15803d; }
  .m-swipe-hint.is-right .l { display: inline-flex; }
  .m-swipe-hint.is-left { background: rgba(245, 158, 11, 0.2); color: #b45309; justify-content: flex-end; }
  .m-swipe-hint.is-left .r { display: inline-flex; }
  .m-swipe-hint.is-ready { background: rgba(22, 163, 74, 0.3); }
  .m-swipe-hint.is-left.is-ready { background: rgba(245, 158, 11, 0.36); }
  .m-sheet-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 1500; display: flex; align-items: flex-end; }
  .m-sheet { width: 100%; background: var(--bg-surface); border-radius: 22px 22px 0 0; padding: 0.6rem 1rem calc(1rem + var(--m-safe, 0px)); display: flex; flex-direction: column; gap: 0.3rem; animation: mSheetUp 0.18s ease; }
  @keyframes mSheetUp { from { transform: translateY(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }
  .m-sheet-grip { align-self: center; width: 40px; height: 4px; border-radius: 4px; background: var(--border-color); margin-bottom: 0.4rem; }
  .m-sheet-title { font-size: 1rem; padding: 0.2rem 0.4rem 0.4rem; }
  .m-sheet-btn { display: flex; align-items: center; gap: 0.8rem; min-height: 52px; padding: 0.5rem 0.7rem; border: 0; border-radius: 14px; background: transparent; font-family: inherit; font-size: 1rem; color: var(--text-primary); text-align: left; cursor: pointer; }
  .m-sheet-btn:active { background: var(--bg-surface-elevated); }
  .m-sheet-btn span { flex: 1; }
  .m-sheet-btn small { color: var(--text-muted); font-size: 0.85rem; }
  .m-sheet-danger { color: #dc2626; }
  .m-sheet-danger i { color: #dc2626; }
  body { overscroll-behavior-y: contain; }
  .m-ptr { position: fixed; top: calc(56px + var(--m-top, 0px)); left: 50%; width: 38px; height: 38px; margin-top: -30px; border-radius: 50%; background: var(--bg-surface); border: 1px solid var(--border-card, var(--border-color)); box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18); display: flex; align-items: center; justify-content: center; color: var(--text-muted); z-index: 60; pointer-events: none; transition: color 0.15s; }
  .m-ptr.is-ready, .m-ptr.is-loading { color: var(--accent-primary); }
  .m-ptr.is-loading { transition: transform 0.2s ease; animation: mSpin 0.8s linear infinite; }
  @keyframes mSpin { to { filter: hue-rotate(0deg); opacity: 0.85; } }
  .m-update { position: fixed; left: 12px; right: 12px; bottom: calc(var(--m-bar-h) + 16px + var(--m-safe)); z-index: 1600; display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.7rem 0.9rem; border-radius: 14px; background: #1e1b4b; color: #fff; font-size: 0.95rem; box-shadow: 0 10px 28px rgba(15, 23, 42, 0.35); }
  .m-update button { border: 0; border-radius: 10px; background: var(--accent-primary); color: #fff; font-family: inherit; font-weight: 700; font-size: 0.95rem; padding: 0.5rem 0.9rem; cursor: pointer; }
  .m-sheet-cancel { margin-top: 0.3rem; min-height: 50px; border: 0; border-radius: 14px; background: var(--bg-surface-elevated); font-family: inherit; font-size: 1rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
}

@media (max-width: 800px) {
  .topbar { padding-top: var(--m-top, 0px); height: calc(56px + var(--m-top, 0px)); }
  /* telas cheias (tarefa aberta, menu lateral): o topo delas também não pode ficar embaixo da barra de status */
  .task-modal-overlay { padding-top: var(--m-top, 0px) !important; }
  .sidebar { padding-top: var(--m-top, 0px); }
  .modal-overlay { padding-top: var(--m-top, 0px); }
}

/* avisos com Desfazer / Abrir tarefa: botões do tamanho do toque no celular */
@media (max-width: 800px) { .toast-undo { flex-wrap: wrap; } .toast-undo button { min-height: 40px; min-width: 40px; } }
/* avisos (toast) acima da barra de baixo no celular */
@media (max-width: 800px) { .toast { bottom: calc(var(--m-bar-h) + 16px + var(--m-safe)) !important; left: 12px !important; right: 12px !important; max-width: none !important; } }

/* ===== Hoje no celular (como no Todoist): colunas Atrasada | Hoje lado a lado; deslize o dedo para o lado para trocar ===== */
@media (max-width: 800px) {
  .page-container:has(.today-kanban-board) { display: flex; flex-direction: column; overflow: hidden; padding: 0.4rem 0 calc(var(--m-bar-h) + var(--m-safe)); }
  .page-container:has(.today-kanban-board) .today-header-container { padding: 0 0.9rem; flex-shrink: 0; }
  .today-pager { display: flex; gap: 0.5rem; margin: 0.3rem 0.9rem 0.2rem; padding: 3px; border-radius: 14px; background: var(--bg-surface-elevated); flex-shrink: 0; }
  .today-pager button { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 38px; border: 0; border-radius: 11px; background: transparent; color: var(--text-secondary); font-family: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color 0.15s, color 0.15s; }
  .today-pager button b { min-width: 22px; padding: 0.05rem 0.4rem; border-radius: 999px; background: var(--border-color); color: var(--text-secondary); font-size: 0.78rem; font-weight: 700; text-align: center; }
  .today-pager button.on { background: var(--bg-surface); color: var(--text-primary); box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12); }
  .today-pager button b.is-late { background: rgba(220, 38, 38, 0.12); color: #dc2626; }
  .today-pager button.on b:not(.is-late) { background: color-mix(in srgb, var(--accent-primary) 14%, transparent); color: var(--accent-primary); }
  .today-kanban-board, .today-kanban-board.overdue-empty { display: flex !important; flex: 1 1 auto; min-height: 0; height: auto; margin-top: 0.2rem; padding: 0 0.9rem; gap: 24px; align-items: stretch; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-padding-left: 0.9rem; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: none; }
  .today-kanban-board::-webkit-scrollbar { display: none; }
  .today-kanban-board .today-kanban-column { flex: 0 0 100%; min-width: 0; min-height: 0; scroll-snap-align: start; scroll-snap-stop: always; }
  .today-kanban-board .today-col-header { flex-shrink: 0; margin-bottom: 0.5rem; justify-content: flex-end; }
  .today-kanban-board .today-col-header:not(:has(button)) { display: none; }   /* as abas no topo ja dizem Atrasada / Hoje e quantas */
  .today-kanban-board .today-col-title, .today-kanban-board .today-col-count { display: none; }
  .today-kanban-board .today-cards-container { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; padding: 0.1rem 0 5.5rem; }
  .today-kanban-board .btn-today-inline-add { flex-shrink: 0; }
}

/* ===== Em Breve no celular (painel): uma coluna por vez com encaixe, cabeçalho do dia em duas linhas, prioridades em selo compacto ===== */
@media (max-width: 800px) {
  .page-container:has(.upcoming-kanban-board) { display: flex; flex-direction: column; overflow: hidden; padding: 0.4rem 0 calc(var(--m-bar-h) + var(--m-safe)); }
  .page-container:has(.upcoming-kanban-board) .view-header { padding: 0 0.9rem; flex-shrink: 0; }
  .page-container:has(.upcoming-kanban-board) #m-week-host { padding: 0 0.9rem; flex-shrink: 0; }
  .page-container:has(.upcoming-kanban-board) .m-week { padding: 0.45rem 0.4rem 0.3rem; margin-bottom: 0.4rem; border-radius: 14px; }
  .page-container:has(.upcoming-kanban-board) .m-week-head { padding-bottom: 0.2rem; font-size: 0.9rem; }
  .upcoming-kanban-board { flex: 1 1 auto; min-height: 0; height: auto; margin-top: 0.2rem; padding: 0 0.9rem; gap: 24px; align-items: stretch; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-padding-left: 0.9rem; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: none; }
  .upcoming-kanban-board::-webkit-scrollbar { display: none; }
  .upcoming-kanban-column, .upcoming-kanban-column.is-empty { flex: 0 0 100%; width: auto; min-width: 0; height: auto; scroll-snap-align: start; scroll-snap-stop: always; }
  .upcoming-kanban-column .today-cards-container { padding-bottom: 5.5rem; }
  .upcoming-kanban-column .today-col-title-group { flex-wrap: wrap; row-gap: 0.15rem; }
  .upcoming-kanban-column .today-col-title { max-width: none; }
  .upcoming-kanban-column .today-col-sub { flex: 0 0 auto; order: 3; display: inline-flex; align-items: center; font-size: 0.78rem; }
  .upcoming-kanban-column .today-col-sub::before { content: '\00b7'; margin-right: 0.4rem; color: var(--text-muted); }
  .upcoming-kanban-column .dp-word { display: none; }
  .m-swipe-tip { display: flex; align-items: center; justify-content: center; gap: 0.4rem; margin: 0 0.9rem 0.3rem; padding: 0.3rem 0.6rem; border-radius: 999px; background: color-mix(in srgb, var(--accent-primary) 10%, transparent); color: var(--accent-primary); font-size: 0.78rem; font-weight: 600; flex-shrink: 0; }
}

/* ===== Hoje no celular: números do dia recolhíveis (recolhido por padrão), cartões em uma linha, "Mostrar" só com o ícone ===== */
.today-fold-btn { display: none; }
@media (max-width: 800px) {
  .today-header-tools { flex: 1 1 auto; min-width: 0; gap: 0.5rem !important; }
  .today-fold-btn { display: inline-flex; align-items: center; gap: 0.5rem; flex: 0 1 auto; min-width: 0; border: 0; background: transparent; color: var(--text-secondary); font-family: inherit; font-size: 0.82rem; padding: 0.35rem 0.1rem; min-height: 36px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  [data-today-fold="closed"] .today-fold-btn { flex: 1 1 auto; }
  .today-fold-btn .today-mini { display: none; align-items: center; gap: 0.6rem; min-width: 0; white-space: nowrap; overflow: hidden; }
  [data-today-fold="closed"] .today-fold-btn .today-mini { display: inline-flex; }
  .today-mini b { color: var(--text-primary); font-weight: 700; }
  .today-mini .is-late, .today-mini .is-late b { color: #b91c1c; }
  .tm-bar { width: 44px; height: 4px; border-radius: 999px; background: var(--border-color); overflow: hidden; flex-shrink: 0; }
  .tm-bar i { display: block; height: 100%; background: color-mix(in srgb, #6366f1 65%, transparent); }
  .tm-bar.is-full i { background: #f59e0b; } .tm-bar.is-over i { background: #dc2626; }
  .tm-load { color: var(--text-muted); }
  .tm-chev { flex-shrink: 0; transition: transform 0.15s; }
  [data-today-fold="open"] .tm-chev { transform: rotate(180deg); }
  [data-today-fold="closed"] .day-load { display: none; }
  .today-summary { display: none !important; }   /* os cartoes de filtro viraram a folha Filtro (ao lado do Mostrar) */
  .today-mini .tm-n { display: none; }   /* 'para hoje' e 'atrasadas' ja estao nas abas */
  .today-summary .today-chip { flex-shrink: 0; white-space: nowrap; }
  .today-header-tools .btn-view-settings { flex-shrink: 0; padding: 0.4rem 0.6rem; }
  .page-container .day-load { padding: 0 0.9rem; margin-bottom: 0.4rem; }
  .day-load-extra { display: none; }
}

/* ===== Tarefa aberta no celular = folha que sobe de baixo (como no Todoist): X à esquerda, ... à direita, propriedades em linhas, comentar fixo embaixo ===== */
@media (max-width: 800px) {
  .task-modal-overlay { align-items: flex-end !important; padding: var(--m-top, 0px) 0 0 !important; background: rgba(15, 23, 42, 0.45); }
  .task-detail-modal { position: relative; display: flex !important; flex-direction: column; height: auto !important; max-height: calc(100vh - var(--m-top, 0px) - 22px) !important; max-height: calc(100dvh - var(--m-top, 0px) - 22px) !important; border-radius: 22px 22px 0 0 !important; box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.28); animation: mSheetUp 0.22s ease; overflow: hidden; }
  .task-detail-modal::before { content: ""; position: absolute; top: 7px; left: 50%; width: 42px; height: 5px; margin-left: -21px; border-radius: 3px; background: rgba(100, 116, 139, 0.45); z-index: 5; }
  .task-modal-header { flex-wrap: nowrap !important; align-items: center; padding: 20px 10px 2px !important; border-bottom: 0 !important; background: transparent; flex-shrink: 0; touch-action: none; }
  .task-modal-actions-right { display: contents; }
  #btn-modal-close-task { order: -2; }
  .task-modal-header-left { order: -1; flex: 1 1 auto; justify-content: center; min-width: 0; }
  #btn-modal-more-options { order: 2; }
  #btn-modal-prev-task, #btn-modal-next-task, .task-modal-breadcrumb { display: none !important; }
  .task-modal-grid { display: flex !important; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .task-modal-main { display: contents; }
  .task-sticky-head { order: 1; position: static !important; padding-left: 14px; padding-right: 14px; }
  .task-detail-modal .task-modal-sidebar { background: transparent !important; }
  .task-modal-sidebar { order: 2; width: auto !important; max-width: none; border: 0 !important; padding: 2px 14px 6px !important; display: flex; flex-direction: column; gap: 0; }
  .task-modal-sidebar .task-prop-grid { display: flex !important; flex-direction: column; gap: 0; }
  .task-modal-sidebar .task-modal-prop-group { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 10px; padding: 7px 0; margin: 0; border: 0; border-bottom: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.07)); }
  .task-modal-sidebar .task-modal-prop-label { flex: 0 0 96px; font-size: 0.76rem; }
  .task-modal-sidebar .task-modal-prop-row { flex: 1 1 0; min-width: 0; justify-content: flex-start; }
  .task-modal-sidebar .task-prop-late { flex: 1 0 100%; text-align: left; padding-left: 106px; }
  .task-modal-sidebar .deleg-banner { display: block; }
  .task-details-toggle { order: 3; margin-left: 14px; margin-right: 14px; }
  .task-details-block { order: 4; margin: 0 14px; }
  .task-modal-comments-wrap { order: 5; margin: 0 14px; padding-bottom: 0; }
  .task-detail-modal .chat-messages { max-height: none; min-height: 0; }
  .task-detail-modal .task-modal-comment-input-row { position: sticky; bottom: 0; z-index: 4; margin: 0 -14px; padding: 8px 14px calc(8px + var(--m-safe, 0px)); background: var(--bg-surface); border-top: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.07)); }
  .task-detail-modal .chat-dock { order: 6; bottom: 0; z-index: 4; margin: 0; padding: 6px 14px calc(8px + var(--m-safe, 0px)); border-top: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.07)); box-shadow: none; }
  .task-detail-modal .chat-dock .task-modal-comment-input-row { position: static; margin: 0; padding: 0; border: 0; background: none; }
  .chat-jump { bottom: 8rem; }
}

/* ===== Folha da tarefa enxuta no celular (15/10): cartao unico, propriedades secundarias em botoes, tamanho parcial que expande ao arrastar ===== */
@media (max-width: 800px) {
  .task-detail-modal { background: var(--bg-surface-elevated) !important; max-height: calc((100vh - var(--m-top, 0px)) * 0.68) !important; max-height: calc((100dvh - var(--m-top, 0px)) * 0.68) !important; transition: max-height .2s ease; }
  .task-detail-modal.is-expanded { height: calc(100vh - var(--m-top, 0px) - 22px) !important; height: calc(100dvh - var(--m-top, 0px) - 22px) !important; max-height: calc(100vh - var(--m-top, 0px) - 22px) !important; max-height: calc(100dvh - var(--m-top, 0px) - 22px) !important; }
  /* cartao: titulo + descricao + propriedades, um bloco branco so */
  .task-sticky-head { order: 1; margin: 6px 12px 0 !important; padding: 12px 14px 2px !important; background: var(--bg-surface) !important; border-radius: 16px 16px 0 0; box-shadow: none !important; gap: 0; }
  .task-last-change { display: none !important; }
  .task-modal-title-input { font-size: 1.2rem !important; font-weight: 600 !important; line-height: 1.3; max-height: 4.2em; overflow: hidden; }
  .task-modal-title-input:focus { max-height: none; overflow: auto; }
  .task-modal-check { margin-top: 1px; }
  .task-details-toggle { display: none !important; }
  .task-details-block, .task-details-block.collapsed { display: contents !important; }
  .task-modal-desc-input { order: 2; width: auto !important; margin: 0 12px !important; padding: 0 14px 10px 48px !important; border: 0 !important; border-radius: 0 !important; background: var(--bg-surface) !important; min-height: 2.2rem; font-size: 0.9rem; }
  .task-detail-modal .task-modal-sidebar { order: 3; margin: 0 12px; padding: 0 14px 12px !important; background: var(--bg-surface) !important; border-radius: 0 0 16px 16px; }
  /* Projeto, Executor e Data: linhas compactas, sem rotulo */
  .task-modal-sidebar .task-prop-grid { flex-direction: row !important; flex-wrap: wrap; align-items: center; gap: 6px; }
  .task-modal-sidebar .task-prop-grid > * { order: 3; }
  .task-modal-sidebar .task-modal-prop-group > .task-modal-prop-label { display: none; }
  .task-modal-sidebar .task-modal-prop-group:has(#btn-modal-open-projectpicker, .task-assignee-row, #btn-modal-open-datepicker) { order: 1; flex: 1 0 100%; padding: 6px 0; min-height: 42px; border-bottom: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.07)); }
  .task-modal-sidebar .task-modal-prop-group:has(#btn-modal-open-projectpicker, .task-assignee-row, #btn-modal-open-datepicker) .task-modal-prop-row { font-size: 0.95rem; }
  .task-modal-sidebar .task-prop-late { padding-left: 24px; flex: 1 0 100%; }
  .task-modal-sidebar .task-prop-deleg { order: 2; flex: 1 0 100%; }
  /* Prazo final, Prioridade, Etiquetas, Lembretes: botoes em linha */
  .task-modal-sidebar .task-modal-prop-group:not(:has(#btn-modal-open-projectpicker, .task-assignee-row, #btn-modal-open-datepicker)) { flex: 0 0 auto; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 5px 11px; margin: 0; border: 1px solid var(--border-color); border-radius: 999px; }
  .task-modal-sidebar .task-modal-prop-group:has(#btn-modal-add-label, #btn-modal-add-reminder) { border-radius: 16px; }
  .task-modal-sidebar .task-modal-prop-group:not(:has(#btn-modal-open-projectpicker, .task-assignee-row, #btn-modal-open-datepicker)) .task-modal-prop-value { font-size: 0.85rem; }
  .task-modal-sidebar .task-modal-prop-group:not(:has(#btn-modal-open-projectpicker, .task-assignee-row, #btn-modal-open-datepicker)) .task-prop-late { flex: 1 0 100%; padding-left: 0; font-size: 0.72rem; }
  .task-modal-sidebar #task-modal-labels-chips:empty, .task-modal-sidebar #task-modal-reminders-list:empty { display: none !important; }
  .task-modal-sidebar .task-modal-prop-group div:has(> #btn-modal-add-label, > #btn-modal-add-reminder) { gap: 8px; }
  .task-modal-sidebar .task-modal-prop-group div:has(> #btn-modal-add-label, > #btn-modal-add-reminder) .task-modal-prop-label { display: inline; flex: 0 0 auto; font-size: 0.85rem; }
  /* Subtarefas: secao propria */
  .task-modal-subtasks-wrap { order: 4; margin: 10px 12px 0 !important; gap: 6px; }
  .task-sub-head { display: block; font-size: 0.85rem; font-weight: 700; color: var(--text-secondary); padding: 4px 2px 0; }
  .btn-modal-add-subtask { width: 100%; padding: 12px 14px; font-size: 0.95rem; background: var(--bg-surface); border-radius: 14px; }
  .task-modal-comments-wrap { order: 5; margin: 10px 12px 0 !important; }
  .task-modal-grid > *, .task-details-block > * { flex-shrink: 0; }
  .task-detail-modal .chat-dock { order: 6; background: var(--bg-surface) !important; }
  .task-detail-modal .chat-dock .chat-bar { background: none !important; }
}

/* Celular: botoes de propriedades numa fileira so, com rolagem para o lado (o ultimo aparece cortado de proposito) */
@media (max-width: 800px) {
  .task-modal-sidebar .task-prop-chips { order: 3; flex: 1 0 100%; min-width: 0; display: flex; flex-wrap: nowrap; gap: 6px; margin: 4px -14px 0 0; padding: 0 14px 2px 0; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: none; }
  .task-modal-sidebar .task-prop-chips::-webkit-scrollbar { display: none; }
  .task-modal-sidebar .task-prop-chips > .task-modal-prop-group { flex: 0 0 auto !important; flex-wrap: nowrap !important; white-space: nowrap; }
  .task-modal-sidebar .task-prop-chips #task-modal-labels-chips { flex-wrap: nowrap !important; margin: 0 !important; }
  .task-modal-sidebar .task-prop-chips #task-modal-reminders-list { flex-direction: row !important; flex-wrap: nowrap; margin: 0 !important; }
  .task-modal-sidebar .task-prop-chips .task-modal-prop-group div:has(> #btn-modal-add-label, > #btn-modal-add-reminder) { flex-wrap: nowrap; }
}

/* Celular: delegacao numa linha so, sem fundo nem moldura; toca para abrir o passo a passo */
@media (max-width: 800px) {
  .task-modal-sidebar .task-prop-deleg { order: 2; flex: 1 0 100%; margin: 0 !important; }
  .task-modal-sidebar .task-prop-deleg .deleg-banner { display: flex !important; flex-wrap: wrap; align-items: center; gap: 0; margin: 0 !important; padding: 8px 0 !important; background: none !important; border: 0 !important; border-bottom: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.07)) !important; border-radius: 0 !important; box-shadow: none !important; }
  .deleg-banner .deleg-head { order: 2; flex: 0 0 auto; padding: 0 !important; border: 0 !important; }
  .deleg-banner .deleg-head .task-modal-prop-label, .deleg-banner .deleg-head .task-state-pill { display: none !important; }
  .deleg-banner .deleg-toggle { width: 32px; height: 32px; }
  .deleg-banner .deleg-people { order: 1; flex: 1 1 0; min-width: 0; display: block !important; margin: 0 !important; padding: 0 !important; font-size: 0.92rem !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
  .deleg-banner .deleg-people .dl-full { display: none; }
  .deleg-banner .deleg-people .dl-arrow { display: inline; font-style: normal; color: var(--text-muted); }
  .deleg-banner .deleg-people em { font-style: normal; }
  .deleg-banner .deleg-people .deleg-oneline-date { display: inline; color: var(--text-secondary); font-size: 0.85rem; }
  .deleg-banner .deleg-people .deleg-oneline-date::before { content: " · "; }
  .deleg-banner > :not(.deleg-head):not(.deleg-people) { order: 3; flex: 1 0 100%; min-width: 0; }
  .deleg-banner .deleg-actions-row { margin-top: 6px !important; padding-top: 0 !important; border-top: 0 !important; }
  .deleg-banner .deleg-detail { padding-top: 6px; }
  .task-detail-modal .deleg-detail > .deleg-flow { border-top: 0; padding: 10px 0 6px; }
  .task-detail-modal .deleg-step-dot { width: 22px; height: 22px; }
  .task-detail-modal .deleg-step + .deleg-step::before { top: 10px; }
  .task-detail-modal .deleg-step-label { margin-top: 4px; font-size: 0.78rem; }
  .task-detail-modal .deleg-step-date { font-size: 0.72rem; margin-top: 1px; }
  .deleg-banner .deleg-dates { font-size: 0.85rem; }
  .deleg-banner .deleg-people .deleg-oneline-date span { text-transform: none; letter-spacing: 0; font-size: inherit; }
  .deleg-banner .deleg-people .deleg-late { color: #dc2626 !important; }
  .deleg-banner .deleg-actions-row .deleg-collapsed-reply { flex: 1 1 100%; justify-content: center; padding: 12px 16px; border-radius: 10px; background: var(--accent-primary); border-color: var(--accent-primary); color: #fff; font-size: 0.92rem; font-weight: 700; }
}

/* Celular: os botoes de propriedades ficam logo abaixo da Data; a delegacao vem depois */
@media (max-width: 800px) {
  .task-modal-sidebar .task-prop-chips { order: 2; }
  .task-modal-sidebar .task-prop-deleg { order: 3; }
}

/* Celular: a linha "Termino" de baixo sai (o termino fica na linha de cima, com as acoes) */
@media (max-width: 800px) {
  .deleg-banner .deleg-detail > .deleg-more, .deleg-banner .deleg-detail > .deleg-dates { display: none !important; }
  .deleg-banner .deleg-people .deleg-oneline-date.has-more { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
  .deleg-banner .deleg-people .deleg-oneline-date.has-more::before { content: " · ▶ "; font-size: 0.7em; text-decoration: none; display: inline-block; }
}

/* Celular: linha separando a delegacao dos botoes de cima; sem botao Responder (a etapa Aceite responde); sem linha solta no fim */
@media (max-width: 800px) {
  .task-modal-sidebar .task-prop-deleg .deleg-banner { border-top: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.07)) !important; border-bottom: 0 !important; margin-top: 8px !important; }
  .deleg-banner .deleg-actions-row.only-collapsed, .deleg-banner .deleg-collapsed-reply { display: none !important; }
}

/* ===== Celular v3 (21/10): folha alta e UMA propriedade por linha (nome à esquerda, valor à direita); Prioridade e Tipo lado a lado ===== */
@media (max-width: 800px) {
  .task-detail-modal { height: calc((100vh - var(--m-top, 0px)) * 0.92) !important; height: calc((100dvh - var(--m-top, 0px)) * 0.92) !important; max-height: calc((100vh - var(--m-top, 0px)) * 0.92) !important; max-height: calc((100dvh - var(--m-top, 0px)) * 0.92) !important; }
  .task-detail-modal.is-expanded { height: calc(100vh - var(--m-top, 0px) - 22px) !important; height: calc(100dvh - var(--m-top, 0px) - 22px) !important; max-height: calc(100vh - var(--m-top, 0px) - 22px) !important; max-height: calc(100dvh - var(--m-top, 0px) - 22px) !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid { display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; align-items: stretch !important; gap: 0 14px !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > * { order: 20 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-prop-project { order: 1 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-prop-exec { order: 2 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-prop-date { order: 3 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-prop-deadline { order: 4 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-prop-prio { order: 5 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-prop-dp { order: 7 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-prop-type { order: 6 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-prop-labels { order: 7 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-prop-deleg { order: 8 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-prop-reminders { order: 9 !important; }
  /* cada propriedade é uma linha inteira: nome (cinza, pequeno) à esquerda, valor à direita */
  .task-detail-modal .task-modal-sidebar .task-modal-prop-group { display: flex !important; flex: 1 0 100% !important; flex-direction: row !important; flex-wrap: wrap !important; align-items: center !important; justify-content: space-between !important; gap: 2px 12px !important; padding: 10px 0 !important; margin: 0 !important; min-height: 48px; border: 0 !important; border-bottom: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.07)) !important; border-radius: 0 !important; background: none !important; }
  .task-detail-modal .task-modal-sidebar .task-modal-prop-group > .task-modal-prop-label { display: block !important; flex: 0 0 auto; min-width: 84px; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); }
  .task-detail-modal .task-modal-sidebar .task-modal-prop-group .task-modal-prop-row { flex: 1 1 0 !important; min-width: 0; justify-content: flex-end !important; text-align: right; font-size: 0.95rem !important; }
  .task-detail-modal .task-modal-sidebar .task-modal-prop-value { flex-wrap: wrap; justify-content: flex-end; row-gap: 2px; white-space: normal !important; font-size: 0.95rem !important; min-width: 0; }
  /* Prioridade e Tipo lado a lado (nome em cima, valor embaixo) */
  .task-detail-modal .task-modal-sidebar .task-prop-prio, .task-detail-modal .task-modal-sidebar .task-prop-type { flex: 1 1 calc(50% - 7px) !important; flex-direction: column !important; align-items: flex-start !important; justify-content: center !important; gap: 4px !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-prio .task-modal-prop-row, .task-detail-modal .task-modal-sidebar .task-prop-type .task-modal-prop-row { justify-content: flex-start !important; text-align: left; flex: 0 0 auto !important; }
  /* Data: o horário (início → fim) acompanha a data; recorrência e duração em chips pequenos na linha de baixo; atraso em vermelho embaixo */
  .task-detail-modal .task-modal-sidebar .task-prop-date .task-prop-subrow { flex: 1 0 100%; justify-content: flex-end; margin-top: 2px; }
  .task-detail-modal .task-modal-sidebar .task-prop-late { flex: 1 0 100% !important; box-sizing: border-box; max-width: 100%; text-align: right !important; padding: 0 !important; margin: 0 !important; font-size: 0.78rem !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-range { margin-left: 0.4rem; }
  /* Etiquetas e Lembretes: título + "+" em cima, a lista embaixo em largura total */
  .task-detail-modal .task-modal-sidebar .task-prop-labels > div, .task-detail-modal .task-modal-sidebar .task-prop-reminders > div { flex: 1 0 100%; }
  .task-detail-modal .task-modal-sidebar .task-prop-labels .task-modal-prop-label, .task-detail-modal .task-modal-sidebar .task-prop-reminders .task-modal-prop-label { display: inline !important; }
  /* delegação: resumo numa linha, a linha do tempo abre ao tocar (já era assim); só encaixa na lista */
  .task-detail-modal .task-modal-sidebar .task-prop-deleg { flex: 1 0 100% !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-deleg .deleg-banner { border-top: 0 !important; margin-top: 0 !important; border-bottom: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.07)) !important; }
}

/* Celular: campos do tipo de tarefa num cartao proprio, abaixo do cartao do topo */
@media (max-width: 800px) {
  .task-fields-wrap { order: 4; margin: 10px 12px 0 !important; }
  .task-modal-subtasks-wrap { order: 5; }
  .task-fields-wrap .tf-card { border: 0; border-radius: 16px; padding: 12px 14px 14px; }
  .tf-input { font-size: 16px; }
}

/* ---- Em Breve e cartoes no celular: mais limpos (horario em destaque, uma linha miuda de detalhes, largura toda) ---- */
@media (max-width: 800px) {
  /* titulo do dia: dia grande; embaixo "8 tarefas . 7h15" */
  .upcoming-kanban-column .today-col-header { margin-bottom: 0.6rem; padding-bottom: 0; }
  .upcoming-kanban-column .today-col-title-group { align-items: center; column-gap: 0.35rem; }
  .upcoming-kanban-column .today-col-title { flex: 0 0 100%; font-size: 1.3rem; line-height: 1.2; }
  .upcoming-kanban-column .today-col-count { order: 2; font-size: 0.78rem; color: var(--text-muted); }
  .m-only { display: inline; }
  .upcoming-kanban-column .col-load { font-size: 0.78rem; }

  /* cartao */
  .today-task-card { padding: 0.8rem 0.85rem; gap: 0.75rem; border-radius: 16px; }
  .today-task-card .today-card-checkbox { width: 24px; height: 24px; margin-top: 1px; }
  .today-task-card .today-card-title { font-size: 1rem; line-height: 1.3; font-weight: 600; }
  .today-task-card .today-card-description { display: none; }
  .today-card-when { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.6rem; margin-bottom: 0.2rem; font-size: 0.82rem; }
  .today-card-when .appt-when { font-size: 0.86rem; }
  .today-card-when .appt-when b { font-weight: 700; }
  .today-card-when .duration { font-size: 0.78rem; }
  .today-task-card .today-card-meta { gap: 0.2rem 0.65rem; margin-top: 0.35rem; font-size: 0.72rem; }
  .today-task-card .today-meta-item.label-item { padding: 0; background: transparent !important; font-size: 0.72rem; }
  .today-task-card.has-conflict { box-shadow: inset 4px 0 0 #dc2626, var(--shadow-card, none); }
  .today-card-when .appt-tag.is-conflict { font-size: 0.72rem; }

  /* semana (Em Breve): mais baixa e leve */
  .page-container:has(.upcoming-kanban-board) .m-week { background: transparent; border: 0; box-shadow: none; padding: 0.1rem 0 0.1rem; margin-bottom: 0.3rem; }
  .page-container:has(.upcoming-kanban-board) .m-week-head { padding: 0 0.2rem 0; font-size: 0.85rem; color: var(--text-secondary); }
  .page-container:has(.upcoming-kanban-board) .m-week-nav { width: 30px; height: 30px; }
  .page-container:has(.upcoming-kanban-board) .m-day { padding: 1px 0; gap: 1px; }
  .page-container:has(.upcoming-kanban-board) .m-day small { font-size: 0.66rem; font-weight: 600; }
  .page-container:has(.upcoming-kanban-board) .m-day span { width: 30px; height: 30px; font-size: 0.95rem; }
  .page-container:has(.upcoming-kanban-board) .m-dot { width: 4px; height: 4px; }

  /* filtros do topo: so icone + numero (a palavra aparece no filtro ligado); cabem todos ao lado do Mostrar */
  .cf-strip .cf-w { display: none; }
  .cf-strip .cf-chip.is-on .cf-w { display: inline; }
  .cf-strip .cf-mi { display: inline-block; }
  .view-actions .cf-strip { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; gap: 0.35rem; scrollbar-width: none; }
  .view-actions .cf-strip::-webkit-scrollbar { display: none; }
  .cf-strip .today-chip { flex: 0 0 auto; padding: 0.25rem 0.5rem; gap: 0.25rem; font-size: 0.8rem; white-space: nowrap; }
  .cf-strip .cf-clear { flex: 0 0 auto; white-space: nowrap; }
}

/* ---- botao e folha de Filtro (celular) ---- */
@media (max-width: 800px) {
  .cf-strip { display: none !important; }
  .m-filter-btn { flex-shrink: 0; margin-left: auto; padding: 0.4rem 0.6rem; }
  .m-filter-btn + .btn-view-settings { margin-left: 0; }
  .m-filter-group { display: flex; flex-direction: column; }
  .m-filter-head { padding: 0.5rem 0.7rem 0.1rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
  #m-filter-sheet .m-sheet { max-height: 88vh; overflow-y: auto; }
  .m-filter-item small { font-size: 0.9rem; font-weight: 600; }
  .m-filter-item.is-on { background: color-mix(in srgb, var(--accent-primary) 9%, transparent); color: var(--accent-primary); font-weight: 600; }
  .m-filter-item.is-late { color: #b91c1c; }
  .m-filter-item.is-late.is-on { background: rgba(220, 38, 38, 0.08); color: #dc2626; }
  .m-filter-check { width: 22px; display: inline-flex; justify-content: center; font-style: normal; }
  .m-filter-foot { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
  .m-filter-foot .m-sheet-cancel { flex: 1 1 0; margin-top: 0; }
  .m-filter-done { flex: 1 1 0; min-height: 50px; border: 0; border-radius: 14px; background: var(--accent-primary); color: #fff; font-family: inherit; font-size: 1rem; font-weight: 700; cursor: pointer; }
}

/* ===== Celular v4 (22/10): gaveta da tarefa em 3 blocos (Quando | Quem e onde | Classificação); toda linha com o nome em cima e o valor embaixo, à esquerda ===== */
.task-prop-sect, .task-prop-addtime { display: none; }
@media (max-width: 800px) {
  /* ordem: Quando (Data, Prazo) | Quem e onde (Projeto, Executor) | Classificação (Prioridade, Tipo, Etiquetas, Delegação, Lembretes) */
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-sect-when { order: 1 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-prop-date { order: 2 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-prop-deadline { order: 3 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-sect-who { order: 4 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-prop-project { order: 5 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-prop-exec { order: 6 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-sect-class { order: 7 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-prop-prio { order: 8 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-prop-dp { order: 10 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-prop-type { order: 9 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-prop-labels { order: 10 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-prop-deleg { order: 11 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-prop-reminders { order: 12 !important; }
  .task-modal-sidebar { margin-bottom: 1rem; }

  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-prop-sect { display: block; flex: 1 0 100%; padding: 14px 0 2px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-primary); border-bottom: 1px solid var(--border-subtle, rgba(15, 23, 42, 0.07)); }
  .task-detail-modal .task-modal-sidebar .task-prop-grid > .task-sect-when { padding-top: 4px; }

  /* linha: nome (cinza, pequeno) em cima; valor embaixo, à esquerda */
  .task-detail-modal .task-modal-sidebar .task-modal-prop-group:not(.deleg-banner) { flex-direction: column !important; flex-wrap: nowrap !important; align-items: flex-start !important; justify-content: flex-start !important; gap: 3px !important; padding: 10px 0 !important; min-height: 56px; }
  .task-detail-modal .task-modal-sidebar .task-modal-prop-group:not(.deleg-banner) > .task-modal-prop-label { min-width: 0; font-size: 0.74rem; }
  .task-detail-modal .task-modal-sidebar .task-modal-prop-group:not(.deleg-banner) .task-modal-prop-row { flex: 0 0 auto !important; width: 100%; justify-content: flex-start !important; text-align: left; }
  .task-detail-modal .task-modal-sidebar .task-modal-prop-value { justify-content: flex-start !important; font-size: 1rem !important; font-weight: 600; column-gap: 0.45rem; }
  .task-detail-modal .task-modal-sidebar .task-prop-prio, .task-detail-modal .task-modal-sidebar .task-prop-type { flex: 1 1 calc(50% - 7px) !important; }
  /* sem os "x" soltos: tocar no valor abre o seletor, que tem a opcao de tirar */
  .task-detail-modal .task-modal-sidebar .task-prop-clear { display: none !important; }
  /* campo vazio: cinza claro com + */
  .task-detail-modal .task-modal-sidebar .is-empty .task-modal-prop-value { color: var(--text-muted) !important; font-weight: 500; }
  .task-detail-modal .task-modal-sidebar .task-prop-deadline.is-empty .task-modal-prop-value span::after, .task-detail-modal .task-modal-sidebar .task-prop-date.is-empty .task-modal-prop-value span::after { content: '  +'; font-weight: 700; color: var(--accent-primary); }
  .task-detail-modal .task-modal-sidebar .task-prop-in-days { color: #d97706; font-weight: 600; font-size: 0.8rem; }

  /* Data: dia (linha 1); horário e duração juntos (linha 2); repetição (linha 3) */
  .task-detail-modal .task-modal-sidebar .task-prop-date:not(.deleg-banner) { flex-direction: row !important; flex-wrap: wrap !important; align-items: center !important; column-gap: 0.5rem !important; row-gap: 5px !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-date > .task-modal-prop-label { order: 1; flex: 1 0 100%; }
  .task-detail-modal .task-modal-sidebar .task-prop-date .task-modal-prop-row, .task-detail-modal .task-modal-sidebar .task-prop-date .task-modal-prop-value, .task-detail-modal .task-modal-sidebar .task-prop-date .task-prop-subrow { display: contents; }
  .task-detail-modal .task-modal-sidebar .task-prop-date .task-modal-prop-value > svg { order: 2; flex: 0 0 auto; }
  .task-detail-modal .task-modal-sidebar .task-prop-date .task-modal-prop-value > span:not(.task-prop-range):not(.task-prop-addtime) { order: 3; flex: 1 0 calc(100% - 30px); min-width: 0; font-size: 1.05rem; font-weight: 700; }
  .task-detail-modal .task-modal-sidebar .task-prop-date .task-prop-range { order: 4; margin: 0; flex: 0 0 auto; font-size: 1rem; font-weight: 700; color: var(--accent-primary); }
  .task-detail-modal .task-modal-sidebar .task-prop-date .task-prop-range .task-prop-end { color: inherit; font-size: 1rem; border-bottom-color: currentColor; }
  .task-detail-modal .task-modal-sidebar .task-prop-date .task-prop-addtime { order: 4; display: inline-flex; align-items: center; margin: 0; padding: 0.15rem 0.6rem; border: 1px dashed var(--border-color); border-radius: 999px; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
  .task-detail-modal .task-modal-sidebar .task-prop-date .task-prop-dur { order: 5; margin-left: 0; }
  .task-detail-modal .task-modal-sidebar .task-prop-date .task-prop-rec { order: 6; flex: 1 0 100%; font-size: 0.85rem; color: var(--text-secondary); }
  .task-detail-modal .task-modal-sidebar .task-prop-date .task-prop-late { order: 7; text-align: left !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-deadline .task-prop-late { text-align: left !important; }

  /* Executor: avatar e nome inteiros, em linha cheia */
  .task-detail-modal .task-modal-sidebar .task-assignee-row { width: 100%; }
  .task-detail-modal .task-modal-sidebar .task-modal-header-assignee { max-width: 100% !important; width: 100%; box-sizing: border-box; }
  .task-detail-modal .task-modal-sidebar .task-modal-header-assignee span { max-width: none !important; overflow: visible; text-overflow: clip; white-space: normal; flex: 1 1 auto; }

  /* Etiquetas e Lembretes: nome em cima; itens e o "+ Etiqueta" / "+ Lembrete" na mesma linha */
  .task-detail-modal .task-modal-sidebar .task-prop-labels:not(.deleg-banner), .task-detail-modal .task-modal-sidebar .task-prop-reminders:not(.deleg-banner) { flex-direction: row !important; flex-wrap: wrap !important; align-items: center !important; column-gap: 0.4rem !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-labels > div:first-child, .task-detail-modal .task-modal-sidebar .task-prop-reminders > div:first-child { display: contents !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-labels .task-modal-prop-label, .task-detail-modal .task-modal-sidebar .task-prop-reminders .task-modal-prop-label { order: 1; flex: 1 0 100% !important; display: block !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-labels > #task-modal-labels-chips, .task-detail-modal .task-modal-sidebar .task-prop-reminders > #task-modal-reminders-list { order: 2; flex: 0 1 auto !important; margin: 0 !important; }
  .task-detail-modal .task-modal-sidebar .task-prop-labels > #task-modal-labels-chips:empty, .task-detail-modal .task-modal-sidebar .task-prop-reminders > #task-modal-reminders-list:empty { display: none; }
  .task-detail-modal .task-modal-sidebar .task-modal-prop-add-btn { order: 3; display: inline-flex; align-items: center; gap: 0.25rem; width: auto; height: auto; padding: 0.25rem 0.65rem; border: 1px dashed var(--border-color); border-radius: 999px; background: transparent; color: var(--text-muted); font-family: inherit; font-size: 0.85rem; font-weight: 600; }
  .task-detail-modal .task-modal-sidebar #btn-modal-add-label::after { content: 'Etiqueta'; }
  .task-detail-modal .task-modal-sidebar #btn-modal-add-reminder::after { content: 'Lembrete'; }
}
