/* =============================================================================
   OIOM web — ajustes sobre o styles.css do desktop (carregado por último)
   html.is-web: sempre na web (platform.js). html.is-touch: tela de toque.
   Regra: só AJUSTAR o que o desktop já desenha (celular, toque, o que é só do desktop);
   nada de redesenhar telas aqui.
   ============================================================================= */

/* Segunda aba aberta: aviso por cima do app (platform.js) */
.web-other-tab {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 24px; text-align: center;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text-primary, #111); background: var(--bg-app, #f6f6f7);
}
.web-other-tab h1 { margin: 0; font-size: 20px; font-weight: 600; }
.web-other-tab p { margin: 0; max-width: 360px; color: var(--text-secondary, #555); line-height: 1.5; }
.web-other-tab button {
  margin-top: 8px; padding: 10px 20px; border: 0; border-radius: 10px;
  font: inherit; font-weight: 600; color: #fff; background: #111; cursor: pointer;
}
:root[data-theme="dark"] .web-other-tab img { filter: invert(1); }

/* ==========================================================================
   CELULAR (até 820px, a mesma quebra do styles.css)
   O menu lateral vira a barra de abas EMBAIXO (alcance do polegar, como os apps do
   Android); a Barra Universal fica logo acima dela. O conteúdo rola entre o topo e a barra.
   ========================================================================== */
@media (max-width: 820px) {
  html.is-web {
    --web-tab-h: 62px;
    --web-safe-b: env(safe-area-inset-bottom, 0px);
  }
  html.is-web body { overscroll-behavior-y: none; }

  /* o conteúdo ocupa a tela menos a barra de abas; só o .view-container rola */
  html.is-web .fluent-sidebar ~ .fluent-main,
  html.is-web .fluent-sidebar.collapsed ~ .fluent-main {
    flex: 0 0 auto; /* com flex: 1 a coluna esticava até a tela toda, por trás das abas */
    height: calc(100dvh - var(--web-tab-h) - var(--web-safe-b));
    min-height: 0;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 14px 0;
  }

  /* barra de abas */
  html.is-web .fluent-sidebar,
  html.is-web .fluent-sidebar.collapsed {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 600;
    width: 100%;
    height: calc(var(--web-tab-h) + var(--web-safe-b));
    padding: 0 4px var(--web-safe-b);
    flex-direction: row;
    align-items: stretch;
    overflow: hidden;
    border-right: none;
    border-bottom: none;
    border-top: 1px solid var(--sb-border, rgba(0, 0, 0, 0.08));
    box-shadow: none;
  }
  html.is-web .fluent-sidebar .sidebar-header,
  html.is-web .fluent-sidebar .btn-sidebar-toggle,
  html.is-web .nav-indicator { display: none; }
  html.is-web .nav-menu {
    flex: 1;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    width: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
  }
  /* a conta (Perfil, Expansões, Configurações) é a última aba */
  html.is-web .fluent-sidebar .sidebar-footer {
    display: flex;
    flex: 0 0 auto;
    padding: 0;
    margin: 0;
    border: 0;
  }
  html.is-web .fluent-sidebar .nav-item {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    height: 100%;
    margin: 0;
    padding: 8px 0 6px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    border-radius: 0;
    background: none;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0;
  }
  html.is-web .fluent-sidebar .sidebar-footer .nav-item { flex: 0 0 56px; }
  html.is-web .fluent-sidebar .nav-item .nav-label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 1;
  }
  html.is-web .fluent-sidebar .nav-item .nav-icon { margin: 0; position: relative; }
  /* aba ativa: pílula atrás do ícone (como no Android), sem mexer no tamanho */
  html.is-web .fluent-sidebar .nav-item .nav-icon::before {
    content: '';
    position: absolute;
    inset: -4px -16px;
    z-index: -1;
    border-radius: 999px;
    background: var(--sb-active, rgba(0, 0, 0, 0.07));
    opacity: 0;
    transform: scaleX(0.6);
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.2, 0.9, 0.25, 1);
  }
  html.is-web .fluent-sidebar .nav-item { isolation: isolate; }
  html.is-web .fluent-sidebar .nav-item.active .nav-icon::before { opacity: 1; transform: none; }
  html.is-web .fluent-sidebar .nav-item.active { font-weight: 600; }
  html.is-web .fluent-sidebar .nav-badge {
    position: absolute;
    top: 6px;
    left: calc(50% + 6px);
    margin: 0;
  }

  /* Aviso (toast): a largura da tela, logo acima da Barra Universal. No desktop ele se ajusta
     ao texto a partir do meio da janela; num celular sobravam ~195px e o texto quebrava a
     cada letra. */
  html.is-web .fluent-toast {
    left: 12px;
    right: 12px;
    bottom: calc(var(--web-tab-h) + var(--web-safe-b) + 66px);
    max-width: none;
    transform: translateY(10px) scale(0.98);
  }
  html.is-web .fluent-toast.active { transform: none; }
  html.is-web .fluent-toast .toast-msg { flex: 1; }

  /* ---- Cabeçalho das telas: mais baixo (no celular cada linha de tela conta) ---- */
  html.is-web .view-header { margin-bottom: 0; padding-bottom: 2px; align-items: baseline; }
  /* respiro entre o título e o conteúdo (28px parado); ao rolar, o texto some num degradê
     nessa faixa em vez de cortar seco embaixo do título (--scroll-fade-* do styles.css) */
  html.is-web .view-container { margin-top: 0; padding-top: 28px; --scroll-fade-top: 28px; }
  html.is-web .header-left .greeting-tag { font-size: 1.12rem; }
  html.is-web .header-left h1 { font-size: 1.6rem; }
  html.is-web .current-date-badge { font-size: 0.74rem; }

  /* ---- Toque: alvos de pelo menos ~44px (o mínimo confortável para o dedo) ---- */
  html.is-web .fluent-btn { min-height: 42px; padding: 9px 16px; font-size: 0.9rem; }
  html.is-web .fluent-context-menu .context-menu-item { min-height: 44px; padding: 10px 12px; font-size: 0.92rem; }
  html.is-web .calendar-nav-btn { min-width: 42px; min-height: 42px; }
  html.is-web .modal-box input.fluent-input,
  html.is-web .modal-box select.fluent-input { min-height: 44px; font-size: 16px; } /* 16px: o Android não dá zoom ao focar */

  /* ---- Janelas (nova tarefa, editar, confirmações): folha que sobe de baixo, na largura toda.
     No desktop a janela tem 70% da largura; num celular sobravam ~250px e os botões eram cortados. */
  html.is-web .modal-overlay {
    align-items: flex-end;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 0 0;
  }
  html.is-web .modal-box,
  html.is-web .modal-box.modal-sm,
  html.is-web .modal-box.modal-md {
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    padding: 22px 18px calc(18px + var(--web-safe-b));
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    animation: web-sheet-in 0.32s cubic-bezier(0.2, 0.9, 0.25, 1);
  }
  /* janelas de formulário (.modal-sheet: cabeçalho e rodapé fixos): a caixa não tem margem
     própria no desktop; aqui também não (senão a margem dobrava) */
  html.is-web .modal-box:has(> .modal-sheet) { padding: 0 0 var(--web-safe-b); }
  html.is-web .modal-sheet-head { padding: 8px 18px 12px; }
  html.is-web .modal-sheet-body { padding: 4px 18px 18px; }
  html.is-web .modal-sheet-foot { padding: 12px 18px; flex-wrap: wrap; }
  html.is-web .modal-sheet-foot .fluent-btn,
  html.is-web .modal-footer-row .fluent-btn { white-space: nowrap; }
  html.is-web .modal-sheet-actions { margin-left: auto; }
  /* Projeto e Prioridade: um em cada linha (lado a lado, a prioridade virava "B." "M" "A") */
  html.is-web .modal-sheet .grid-two-cols { grid-template-columns: 1fr; }
  html.is-web .task-modal .modal-sheet-body { min-height: 0; }
  /* alça da folha (só visual) */
  html.is-web .modal-box::before {
    content: '';
    display: block;
    width: 38px;
    height: 4px;
    margin: -10px auto 12px;
    border-radius: 2px;
    background: var(--color-text-tertiary);
    opacity: 0.35;
  }
  html.is-web .modal-box:has(> .modal-sheet)::before { margin: 10px auto 0; flex: none; }

  /* aviso de quanto tempo o OIOM guarda as tarefas (embaixo do calendário): é configuração;
     no celular ocupa espaço e continua em Configurações → Tarefas */
  html.is-web .calendar-retention-note { display: none; }

  /* ---- Calendário ---- */
  /* cabeçalho: ‹ mês/semana › e "Hoje" numa linha; Semana | Mês embaixo, na largura toda */
  html.is-web .calendar-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  html.is-web .calendar-nav { display: flex; align-items: center; gap: 6px; width: 100%; }
  html.is-web .calendar-nav .calendar-range-label { flex: 1; text-align: center; font-size: 0.95rem; }
  html.is-web .calendar-nav .calendar-select { flex: 1; min-width: 0; min-height: 42px; }
  html.is-web .calendar-nav .calendar-today-btn { margin-left: auto; }
  html.is-web .calendar-mode-toggle { width: 100%; }
  html.is-web .calendar-mode-toggle > button { flex: 1; min-height: 38px; }
  /* mês: em vez de nomes cortados ("Be…"), um pontinho por tarefa; tocar no número abre o dia */
  html.is-web .calendar-month-grid { grid-auto-rows: minmax(58px, auto); }
  html.is-web .calendar-month-cell {
    flex-direction: row;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 3px;
    padding: 4px 3px 6px;
  }
  html.is-web .calendar-month-cell-head,
  html.is-web .calendar-month-daynum { width: 100%; }
  html.is-web .calendar-month-daynum {
    align-self: stretch;
    height: 30px;
    padding: 0;
    font-size: 0.82rem;
    border-radius: 999px;
  }
  html.is-web .calendar-month-cell.today .calendar-month-daynum { width: 30px; margin: 0 auto; }
  html.is-web .calendar-month-cell .calendar-add-btn { display: none; }
  html.is-web .calendar-month-chip {
    width: 7px;
    height: 7px;
    padding: 0;
    margin: 0 auto 0 0;
    border-radius: 50%;
    background: var(--color-text-secondary);
    flex: none;
  }
  html.is-web .calendar-month-chip.completed { background: var(--color-text-tertiary); opacity: 0.5; }
  html.is-web .calendar-month-chip > * { display: none; }
  html.is-web .calendar-month-cell { justify-content: center; }
  html.is-web .calendar-month-cell .calendar-month-chip { margin: 0; }
  html.is-web .calendar-month-more { width: 100%; text-align: center; font-size: 0.66rem; padding: 0; }
  html.is-web .calendar-month-head span { font-size: 0.66rem; letter-spacing: 0.02em; }

  /* ---- Foco do momento: menos altura e botões iguais (grade 2×2, fáceis de acertar) ---- */
  html.is-web .agora-timer { font-size: 2.8rem; }
  html.is-web .agora-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  html.is-web .agora-actions > .fluent-btn { width: 100%; min-height: 46px; }
  /* "ou cole uma lista": dica de teclado de computador */
  html.is-touch .checklist-empty-add kbd { display: none; }

  /* ---- Chat: a caixa do próprio Chat basta (a Barra Universal embaixo era uma 2.ª caixa) ---- */
  html.is-web .fluent-main:has(.view-container.is-chat) .universal-command-dock { display: none; }
  /* Chat na tela toda: sem a coluna centrada com margem própria (--chat-pad) e sem a folga
     da Barra Universal embaixo (escondida aqui), a caixa de texto fica junto das abas */
  html.is-web .view-container.is-chat,
  html.is-web .dock-pos-bottom .view-container.is-chat,
  html.is-web.dock-pos-bottom .view-container.is-chat { padding-bottom: 8px; }
  html.is-web .view-container.is-chat > .ai-chat-card { --chat-pad: 0px; min-height: 0; }
  html.is-web .ai-chat-input-bar { padding-bottom: 4px; }
  /* sugestões mais compactas: o exemplo continua inteiro, com menos margem */
  html.is-web .chat-hero-card { padding: 12px 14px; }
  html.is-web .chat-hero-title { font-size: 1.5rem; }

  /* Barra Universal: logo acima das abas */
  html.is-web .universal-command-dock { left: 10px; right: 10px; bottom: 10px; }
  html.is-web.dock-pos-bottom .view-container,
  html.is-web .dock-pos-bottom .view-container { padding-bottom: 96px; }
}

/* ==========================================================================
   TOQUE: sem as dicas de teclado (Ctrl K, atalhos nos menus)
   ========================================================================== */
html.is-touch .universal-kbd-shortcut,
html.is-touch .settings-search kbd,
html.is-touch .fluent-context-menu .ctx-shortcut { display: none !important; }

/* ==========================================================================
   SÓ NO OIOM PARA WINDOWS (desktopOnlyHtml, desktopOnlyBadge e webDesktopNudgeHtml no
   script.js, com IS_WEB): a função aparece trancada, com o que faz e o convite para baixar.
   ========================================================================== */
.desktop-only-badge {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.01em;
  color: var(--color-text-secondary); background: var(--color-bg-hover);
}
.desktop-only-card {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 24px 22px 22px; gap: 0;
}
.desktop-only-icon {
  display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 14px;
  border-radius: 14px; color: var(--color-text-primary); background: var(--color-bg-hover);
}
.desktop-only-kicker {
  display: inline-flex; align-items: center; gap: 5px; margin: 0 0 4px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--color-text-tertiary);
}
.desktop-only-title { margin: 0 0 6px; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; }
.desktop-only-text { margin: 0 0 16px; font-size: 0.92rem; line-height: 1.5; color: var(--color-text-secondary); }
.desktop-only-perks { list-style: none; margin: 0 0 18px; padding: 14px 0 0; width: 100%; border-top: 1px solid var(--color-bg-hover); display: grid; gap: 10px; }
.desktop-only-perks li { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; color: var(--color-text-secondary); }
.desktop-only-perks li svg { flex: none; color: var(--color-text-primary); }
.desktop-only-cta { width: 100%; justify-content: center; min-height: 44px; font-weight: 600; }
.desktop-only-note { margin: 10px 0 0; width: 100%; text-align: center; font-size: 0.8rem; color: var(--color-text-tertiary); }
.desktop-only-page { max-width: 520px; margin: 8px auto 0; }

/* convite na tela Hoje */
.web-nudge {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 16px; padding: 12px 14px;
  border-radius: var(--radius-lg, 14px);
  background: var(--color-bg-surface-elevated); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 18px rgba(0, 0, 0, 0.05);
  animation: web-nudge-in 0.35s cubic-bezier(0.2, 0.9, 0.25, 1);
}
.web-nudge-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--color-bg-hover); }
.web-nudge-text { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 0.86rem; line-height: 1.35; }
.web-nudge-text span { color: var(--color-text-secondary); }
.web-nudge-actions { display: flex; gap: 6px; margin-left: auto; }
@keyframes web-nudge-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes web-sheet-in { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .web-nudge { animation: none; } }
