/* ==========================================================================
   OIOM — DESIGN SYSTEM & ESTILIZAÇÃO (TAURI V2 DESKTOP ARCHITECTURE)
   Tema: Basic
   Paleta: Estritamente Monocromática (Preto, Branco e Escala de Cinzas)
   Efeitos: Mica, Acrylic, Bordas Finas de 1px e Curvaturas de 8px / 12px
   Microinterações: Transições orgânicas baseadas em cubic-bezier
   Janelas: Janela Principal (Workspace) + Janela Separada do Desktop Notch
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIÁVEIS DO SISTEMA (DESIGN TOKENS)
   -------------------------------------------------------------------------- */
:root {
  /* Cores Neutras / Monocromáticas */
  --color-bg-base: #f3f3f3;
  --color-bg-surface: rgba(255, 255, 255, 0.82);
  --color-bg-surface-elevated: rgba(255, 255, 255, 0.95);
  --color-bg-subtle: rgba(0, 0, 0, 0.035);
  --color-bg-hover: rgba(0, 0, 0, 0.055);
  --color-bg-active: rgba(0, 0, 0, 0.09);

  /* Elementos Escuros e Notch Nativo */
  --notch-opacity: 0.94;
  --color-notch-bg: rgba(0, 0, 0, var(--notch-opacity));
  --color-notch-text: #ffffff;
  --color-notch-border: rgba(255, 255, 255, 0.16);
  --color-notch-subtle: rgba(255, 255, 255, 0.08);

  /* Textos Monocromáticos */
  --color-text-primary: #111111;
  --color-text-secondary: #585858;
  --color-text-tertiary: #888888;
  --color-text-inverted: #ffffff;
  --color-text-strong: #000000;   /* títulos e ícones em foco */

  /* Barra Universal: campo flutuante */
  --dock-input-bg: rgba(255, 255, 255, 0.78);
  --dock-input-bg-focus: rgba(255, 255, 255, 0.97);
  --dock-input-border: rgba(0, 0, 0, 0.07);
  --dock-input-border-focus: rgba(0, 0, 0, 0.18);
  --dock-input-shadow: 0 6px 22px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.05);
  --dock-input-shadow-focus: 0 10px 30px rgba(0, 0, 0, 0.11), 0 2px 6px rgba(0, 0, 0, 0.06);
  /* Popover da Barra Universal (vidro: translúcido + blur no CSS) */
  --glass-popover-bg: rgba(255, 255, 255, 0.72);
  --glass-popover-border: rgba(255, 255, 255, 0.65);
  --glass-popover-highlight: rgba(255, 255, 255, 0.8);

  /* Campos de formulário: tom translúcido + contorno fino, para o campo se destacar
     em qualquer superfície (fundo da janela, cartões brancos e modais) */
  --input-bg: rgba(0, 0, 0, 0.045);
  --input-bg-hover: rgba(0, 0, 0, 0.065);
  --input-bg-focus: #ffffff;
  --input-ring: rgba(0, 0, 0, 0.08);
  --input-ring-focus: rgba(0, 0, 0, 0.3);

  /* Bordas e Divisores Finos (Estilo Windows 11) */
  --border-subtle: 1px solid rgba(0, 0, 0, 0.08);
  --border-strong: 1px solid rgba(0, 0, 0, 0.2);
  --border-glass: 1px solid rgba(255, 255, 255, 0.7);
  --color-grid: rgba(0, 0, 0, 0.04);

  /* Curvaturas de Cantos (Border Radius Fluent) */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Efeitos de Sombra e Profundidade (Elevation) */
  --shadow-subtle: 0 2px 6px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 4px 14px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.13), 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-notch: 0 12px 36px rgba(0, 0, 0, 0.38);
  --shadow-dropdown: 0 10px 24px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-launcher: 0 24px 54px rgba(0, 0, 0, 0.18), 0 4px 14px rgba(0, 0, 0, 0.08);

  /* Tipografia */
  --font-main: 'Segoe UI Variable Text', 'Segoe UI', Inter, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-hand: 'Caveat', cursive, sans-serif;
  /* Notch: Segoe UI Variable (Windows 11) com Inter como alternativa */
  --font-notch: 'Segoe UI Variable Display', 'Segoe UI Variable Text', Inter, 'Segoe UI', system-ui, sans-serif;

  /* Curvas de Transição Fluent (Windows 11 Motion) */
  --ease-fluent: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 0.16s;
  --duration-normal: 0.28s;
  --duration-smooth: 0.38s;

  --clock-track: #f7f7f7;

  /* Tokens de tema (dist/themes/<id>.css). NÃO são definidos aqui: cada regra usa
     var(--token, valor do Basic), e o Basic é exatamente o valor de reserva de cada uma.
     Um tema define o token em :root[data-skin="<id>"] e muda todos os usos de uma vez
     (e também em .expansion-preview[data-preview="<id>"], a prévia em Expansões → Temas).
       --surface-card-bg / --surface-card-border          cartões, calendário, janelas, campo do chat, blocos das Configurações
       --surface-selected-bg / --surface-selected-border  item escolhido: barra lateral, modos do calendário, tema, dia do perfil, menu sob o mouse
       --surface-item-bg                                  itens soltos sobre a página: rotinas, linhas e busca das Configurações, busca das Notas
       --surface-menu-bg                                  menu de clique direito
       --menu-danger-hover-bg / --menu-danger-hover-color / --menu-danger-hover-border   "Excluir" do menu sob o mouse
       --menu-danger-color                                "Excluir" do menu em repouso (texto e ícone vermelhos)
       --nav-hover-bg                                     item da barra lateral sob o mouse
       --sidebar-bg / --sidebar-border / --sidebar-shadow barra lateral (o modo claro tem regra própria, abaixo)
       --notch-surface                                    camada sobre o fundo do Notch (background-image)
       --chat-avatar-bg / --chat-avatar-ring              fundo e contorno do logo no chat
       --radius-toast / --radius-notes-toolbar / --radius-tile   cantos do toast, da busca e "Nova nota", dos blocos das Configurações
     A barra de comando (bar.css) tem os seus: --bar-surface, --bar-border.
     Esta lista é conferida pelo tests/themes.test.js (ver docs/TEMAS.md). */
}

/* --------------------------------------------------------------------------
   2. RESET & BASE ESTILÍSTICA
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  font-family: var(--font-main);
  color: var(--color-text-primary);
  background-color: var(--color-bg-base);
  background-image: 
    radial-gradient(at 0% 0%, rgba(255, 255, 255, 0.75) 0px, transparent 65%),
    radial-gradient(at 100% 100%, rgba(222, 222, 222, 0.6) 0px, transparent 65%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: 0;
  overflow-x: hidden;
}

/* Foco Acessível Padrão Windows */
:focus-visible {
  outline: 2px solid var(--color-text-primary);
  outline-offset: 2px;
}

.handwritten-note {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  line-height: 1;
  color: var(--color-text-secondary);
  user-select: none;
}

.text-subtle {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   3. ARQUITETURA TAURI: JANELA DO NOTCH DESKTOP NATIVO (WIDGET SEPARADO)
   Configurada com decorations: false, transparent: true, alwaysOnTop: true.
   -------------------------------------------------------------------------- */

/* Fundo da janela do Notch — html E body transparentes (o WebView2 pinta
   branco por defeito se algum dos dois tiver fundo). */
html.notch-html,
html.notch-html body,
body.body-notch-window {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

/* O atributo [hidden] perdia para display:flex — corrige */
.desktop-notch-window-root[hidden] {
  display: none !important;
}

/* Mudar o Notch de lugar (moveNotchTo): is-moving = a sair; is-move-in = a chegar.
   travel: o Notch encolhe numa bolinha (::after) no sítio onde ele está, a bolinha viaja
   (o Rust encolhe a janela à volta dela e move-a) e o Notch cresce de novo no destino.
   A bolinha fica a 11px da borda de data-move-from (centrada no outro eixo): na janela da
   viagem (44×44, notch::TRAVEL_DOT) isso é o centro, seja qual for a borda.
   fade: some e aparece, com um leve encolher e desfoque para se ver a troca. */
.desktop-notch-window-root::after {
  content: '';
  position: fixed;
  top: 11px;
  left: 50%;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  border-radius: 50%;
  background: var(--color-notch-bg);
  background-image: var(--notch-surface, linear-gradient(rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.28)));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: scale(0.3);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.32, 0.72, 0, 1);
}
.desktop-notch-window-root[data-move-from="left"]::after,
.desktop-notch-window-root[data-move-from="right"]::after { top: 50%; margin: -11px 0 0; }
.desktop-notch-window-root[data-move-from="left"]::after { left: 11px; }
.desktop-notch-window-root[data-move-from="right"]::after { left: auto; right: 11px; }
.desktop-notch-window-root.is-move-travel.is-moving::after { opacity: 1; transform: none; }
/* chegou: a bolinha some na hora, antes de a janela crescer (o Notch cresce no lugar dela) */
.desktop-notch-window-root.is-move-travel.is-moving.is-landing::after { opacity: 0; transition: none; }

/* o Notch encolhe para o sítio da bolinha (centro da barra / da pílula), não para o meio da janela */
.desktop-notch-window-root .desktop-notch-container { transform-origin: 50% 23px; }
.desktop-notch-window-root[data-dock="left"] .desktop-notch-container { transform-origin: 23px 50%; }
.desktop-notch-window-root[data-dock="right"] .desktop-notch-container { transform-origin: calc(100% - 23px) 50%; }

.desktop-notch-window-root.is-moving .desktop-notch-container {
  pointer-events: none;
  animation: none !important;   /* nada (ex.: .docking) traz o Notch de volta antes da hora */
  transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.32, 0.72, 0, 1), filter 0.22s ease;
}
.desktop-notch-window-root.is-move-travel.is-moving .desktop-notch-container { opacity: 0; transform: scale(0.12); filter: blur(2px); }
.desktop-notch-window-root.is-move-fade.is-moving .desktop-notch-container { opacity: 0; transform: scale(0.94); filter: blur(4px); }
.desktop-notch-window-root.is-move-travel.is-move-in .desktop-notch-container { animation: notchArrive 0.42s cubic-bezier(0.32, 0.72, 0, 1); }
.desktop-notch-window-root.is-move-fade.is-move-in .desktop-notch-container { animation: notchFadeIn 0.42s ease-out; }
@keyframes notchArrive { from { opacity: 0; transform: scale(0.12); filter: blur(2px); } 55% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes notchFadeIn { from { opacity: 0; transform: scale(0.94); filter: blur(4px); } to { opacity: 1; transform: none; } }

/* A barra de comando está a desenhar a cópia do Notch (bar.js): o real some na hora */
.desktop-notch-window-root.is-covered-by-bar .desktop-notch-container {
  opacity: 0 !important;
  transition: none !important;
}

/* Wrapper raiz: ocupa toda a janela Tauri (600px de largura), centra o
   Notch horizontalmente e cola-o ao topo. A janela em si é ancorada na
   borda certa pelo Rust (place_notch / notch.rs). Base e laterais: ver
   "Notch · Docking" no fim do ficheiro ([data-dock]). */
.desktop-notch-window-root {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100vw;
  height: 100vh;
  box-sizing: border-box;
  /* Folga transparente à volta do Notch (sombra curta). Os cliques nesta área
     atravessam para as janelas de trás: o Rust liga set_ignore_cursor_events
     fora do retângulo do Notch (ver spawn_notch_hit_test / set_notch_hitbox).
     Topo a 0: o Notch cola no ecrã. */
  padding: 0 30px 10px;
  overflow: hidden;
  background: transparent;
  pointer-events: none;      /* área vazia não recebe eventos no DOM */
}

/* Cantos invertidos (settings.notchFlare): a mesma superfície do Notch, recortada por um círculo.
   --flare-a e --flare-b = onde a forma começa e termina no eixo da borda (placeNotchFlares). */
.notch-flare {
  --flare-r: 16px;
  position: fixed;
  width: var(--flare-r);
  height: var(--flare-r);
  background: var(--color-notch-bg);
  background-image: var(--notch-surface, linear-gradient(rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.28)));
  /* o degradê tem o tamanho do Notch e cada canto mostra o trecho ao lado dele */
  background-repeat: no-repeat;
  background-size: 100% var(--flare-img-h, 100%);
  background-position: 0 var(--flare-y, 0px);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}
.notch-flare.is-a { --flare-y: var(--flare-y-a, 0px); }
.notch-flare.is-b { --flare-y: var(--flare-y-b, 0px); }
.desktop-notch-window-root[data-flare="on"] .notch-flare { opacity: 1; }
/* na troca de borda os cantos só voltam quando o Notch já chegou */
.desktop-notch-window-root:is(.is-moving, .is-move-in, .is-covered-by-bar) .notch-flare { opacity: 0 !important; transition: none !important; }
.desktop-notch-window-root.flare-snap .notch-flare { transition: none !important; }
.desktop-notch-window-root:has(.desktop-notch-container.bedtime) .notch-flare {
  background-color: rgba(14, 16, 36, var(--notch-opacity));
  background-image: linear-gradient(180deg, rgba(26, 29, 66, 0.55) 0%, rgba(8, 9, 22, 0.35) 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* topo: à esquerda e à direita do Notch */
.desktop-notch-window-root:not([data-dock="left"]):not([data-dock="right"]) .notch-flare { top: 0; }
.desktop-notch-window-root:not([data-dock="left"]):not([data-dock="right"]) .notch-flare.is-a {
  left: calc(var(--flare-a, 50px) - var(--flare-r));
  -webkit-mask-image: radial-gradient(circle at 0 100%, transparent calc(var(--flare-r) - 0.5px), #000 var(--flare-r));
          mask-image: radial-gradient(circle at 0 100%, transparent calc(var(--flare-r) - 0.5px), #000 var(--flare-r));
}
.desktop-notch-window-root:not([data-dock="left"]):not([data-dock="right"]) .notch-flare.is-b {
  left: var(--flare-b, 550px);
  -webkit-mask-image: radial-gradient(circle at 100% 100%, transparent calc(var(--flare-r) - 0.5px), #000 var(--flare-r));
          mask-image: radial-gradient(circle at 100% 100%, transparent calc(var(--flare-r) - 0.5px), #000 var(--flare-r));
}
/* laterais: acima e abaixo da forma, que abre com a mesma transição */
.desktop-notch-window-root:is([data-dock="left"], [data-dock="right"]) .notch-flare {
  /* a mesma superfície do cartão lateral (mais densa e sem desfoque) */
  background-image: var(--notch-surface, linear-gradient(rgba(0, 0, 0, 0.36), rgba(0, 0, 0, 0.36)));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: opacity 0.16s ease, top var(--duration-smooth) var(--ease-fluent), background-position var(--duration-smooth) var(--ease-fluent);
}
.desktop-notch-window-root:is([data-dock="left"], [data-dock="right"]) .notch-flare.is-a { top: calc(var(--flare-a, 100px) - var(--flare-r)); }
.desktop-notch-window-root:is([data-dock="left"], [data-dock="right"]) .notch-flare.is-b { top: var(--flare-b, 300px); }
.desktop-notch-window-root[data-dock="left"] .notch-flare { left: 0; }
.desktop-notch-window-root[data-dock="right"] .notch-flare { right: 0; }
.desktop-notch-window-root[data-dock="left"] .notch-flare.is-a {
  -webkit-mask-image: radial-gradient(circle at 100% 0, transparent calc(var(--flare-r) - 0.5px), #000 var(--flare-r));
          mask-image: radial-gradient(circle at 100% 0, transparent calc(var(--flare-r) - 0.5px), #000 var(--flare-r));
}
.desktop-notch-window-root[data-dock="left"] .notch-flare.is-b {
  -webkit-mask-image: radial-gradient(circle at 100% 100%, transparent calc(var(--flare-r) - 0.5px), #000 var(--flare-r));
          mask-image: radial-gradient(circle at 100% 100%, transparent calc(var(--flare-r) - 0.5px), #000 var(--flare-r));
}
.desktop-notch-window-root[data-dock="right"] .notch-flare.is-a {
  -webkit-mask-image: radial-gradient(circle at 0 0, transparent calc(var(--flare-r) - 0.5px), #000 var(--flare-r));
          mask-image: radial-gradient(circle at 0 0, transparent calc(var(--flare-r) - 0.5px), #000 var(--flare-r));
}
.desktop-notch-window-root[data-dock="right"] .notch-flare.is-b {
  -webkit-mask-image: radial-gradient(circle at 0 100%, transparent calc(var(--flare-r) - 0.5px), #000 var(--flare-r));
          mask-image: radial-gradient(circle at 0 100%, transparent calc(var(--flare-r) - 0.5px), #000 var(--flare-r));
}
/* a sombra da forma marcaria a emenda com os cantos: com eles ligados, ela só desce */
.desktop-notch-window-root[data-flare="on"] .desktop-notch-container[data-axis="horizontal"] { box-shadow: 0 5px 6px -4px rgba(0, 0, 0, 0.32); }
.desktop-notch-window-root[data-flare="on"] .desktop-notch-container[data-axis="vertical"] { filter: none; }
@media (prefers-reduced-motion: reduce) { .notch-flare { transition: none !important; } }

/* Container principal do Notch — recebe cliques; NÃO é drag-region */
.desktop-notch-container {
  pointer-events: auto;
  margin: 0 auto;
  width: min(500px, 100%);
  background: var(--color-notch-bg);
  color: var(--color-notch-text);
  border-top: none;
  border-radius: 0 0 20px 20px;
  /* Blur do Notch (WebView2 + prefixo WebKit). A camada escura por baixo garante
     leitura do texto mesmo com a opacidade reduzida nas Configurações. */
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(12px);
  background-image: var(--notch-surface, linear-gradient(rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.28)));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);     /* sombra curta: cabe nos 10px de folga */
  -webkit-app-region: no-drag;                   /* o Notch não é arrastável */
  overflow: hidden;
  transition: width var(--duration-smooth) var(--ease-fluent),
              box-shadow var(--duration-normal) var(--ease-fluent);
  user-select: none;
  cursor: default;
  font-family: var(--font-notch);
  font-optical-sizing: auto;
  letter-spacing: -0.006em;
}

/* Ícones (Lucide inline) do Notch */
.notch-ico {
  flex: none;
  display: block;
  opacity: 0.9;
}

.desktop-notch-container.expanded {
  width: 100%;                                    /* largura útil = janela − margens da sombra */
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);      /* sem sombra estendida */
}

/* Barra do Notch (NÃO arrastável). Os filhos não recebem cliques,
   exceto o botão de fixar. */
.notch-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px 10px 18px;
  font-size: 0.82rem;
  cursor: default;       /* sem arrasto: a posição muda só nas Configurações */
  border-radius: 0 0 35px 35px;
  transition: background var(--duration-fast) ease;
}

.notch-summary-bar > *:not(.notch-pin-btn) {
  pointer-events: none;
}

/* Logo do OIOM na barra do Notch (versões brancas em assets/logos).
   Horizontal: LOGOTIPO_WHITE (logotipo completo). Vertical: .notch-logo-face (só o rosto). */
.notch-logo {
  flex: none;
  height: 20px;
  object-fit: contain;
  opacity: 0.95;
  -webkit-user-drag: none;
}

.desktop-notch-container .notch-badge-status,
.desktop-notch-container .notch-clock-live,
.desktop-notch-container .notch-current-task {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

/* Botão de fixar/expandir (clicável) */
.notch-pin-btn {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #cfcfcf;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}

.notch-pin-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.desktop-notch-container.pinned .notch-pin-btn {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.notch-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  letter-spacing: -0.01em;
  opacity: 0.9;
}

.notch-clock-live {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  padding: 1px 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.notch-current-task {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  max-width: 240px;
  color: #dedede;
  font-size: 0.8rem;
}

.notch-current-task > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notch-details {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 20px;
  transition: max-height var(--duration-smooth) var(--ease-fluent),
              padding var(--duration-smooth) var(--ease-fluent),
              opacity var(--duration-normal) ease;
}

.desktop-notch-container.expanded .notch-details {
  max-height: 310px;   /* inclui a folga do seletor no canto; cabe nos 374px da janela */
  opacity: 1;
  padding: 4px 20px 16px;
}

.notch-details .greeting {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.notch-details .section-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 18px;
}

.notch-details .task-title {
  font-size: 0.95rem;
  font-weight: 500;
  margin-top: 4px;
  margin-bottom: 4px;
}

.notch-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* Botões do Notch: pointer-events e cursor explícitos para garantir
   que o Tauri não trate a área como drag region */
.notch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 10;
  transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.notch-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
}

/* Ação principal do Notch (▶ Iniciar Tarefa / ✓ Concluir) */
.notch-btn-primary {
  background: #ffffff;
  color: #111111;
  border-color: #ffffff;
  font-weight: 600;
}

.notch-btn-primary:hover {
  background: #e9e9e9;
  border-color: #e9e9e9;
}

.notch-progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

/* Bloco da tarefa em foco: título + progresso + botões dentro da mesma caixa,
   para os controlos pertencerem visivelmente a ESTA tarefa */
.notch-focus-block {
  margin-top: 8px;
  padding: 10px 12px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.048);
}

.notch-focus-block.is-running {
  background: rgba(255, 255, 255, 0.075);
}

.notch-focus-block.is-empty { padding: 12px; }
.notch-focus-block.is-empty .task-title { margin: 0; color: #cfcfcf; }

.notch-details .notch-focus-block .section-title { margin-top: 0; color: #bdbdbd; }
.notch-details .notch-focus-block .task-title { font-size: 1rem; font-weight: 600; margin: 4px 0 2px; }

.notch-task-dur {
  font-weight: 400;
  font-size: 0.78rem;
  color: #a8a8a8;
  white-space: nowrap;
}

/* Botões colados ao título, separados por uma linha fina dentro da caixa */
.notch-focus-actions {
  gap: 6px;
  margin-top: 15px;
}
.notch-focus-actions .notch-btn { padding: 5px 11px; font-size: 0.84rem; }

.notch-btn-hint {
  margin-left: 2px;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.6;
}

/* Próxima tarefa: linha secundária, pequena e esbatida, fora do bloco de foco */
.notch-next {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  margin-top: 10px;
  font-size: 0.76rem;
  color: #d0d0d0;
  opacity: 0.55;
}
.notch-next-label {
  flex: none;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.notch-next-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notch-next-time { flex: none; font-variant-numeric: tabular-nums; }

/* Progresso do dia + atalho para o app: rodapé discreto, não é ação da tarefa */
.notch-meta-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 0.74rem;
  color: #9a9a9a;
}

/* Confirmação da barra de comando ("✓ Criada: … · Desfazer"): ocupa o lugar do rodapé (o script
   desenha uma OU o outro; o rodapé nunca fica escondido por classe). Mesma altura: nada é empurrado. */
.notch-meta-row { min-height: 1.6em; }
.notch-meta-row.is-back > * { animation: notchConfirmIn 0.26s var(--ease-fluent) both; }
.notch-confirm {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  font-size: 0.74rem;
  color: #bdbdbd;
  white-space: nowrap;
}
.notch-confirm .notch-ico { flex: none; opacity: 0.7; }
.notch-confirm-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.notch-confirm-undo { flex: none; }
/* Hora de dormir: o Notch não tem rodapé; a confirmação ganha uma linha só para ela */
.notch-meta-row.is-confirm-only { min-height: 1.6em; }
.notch-confirm.is-entering { animation: notchConfirmIn 0.26s var(--ease-fluent) both; }
.notch-confirm.is-leaving { animation: notchConfirmOut 0.2s ease-in both; }
@keyframes notchConfirmIn { from { opacity: 0; transform: translate3d(0, 4px, 0); } to { opacity: 1; transform: none; } }
@keyframes notchConfirmOut { to { opacity: 0; transform: translate3d(0, -3px, 0); } }
@media (prefers-reduced-motion: reduce) {
  .notch-confirm.is-entering, .notch-confirm.is-leaving, .notch-meta-row.is-back > * { animation: none; }
  .notch-confirm.is-leaving { opacity: 0; }
}

.notch-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #cfcfcf;
  font: inherit;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 10;
}
.notch-link-btn:hover { background: rgba(255, 255, 255, 0.1); color: #ffffff; }

/* --------------------------------------------------------------------------
   4. JANELA PRINCIPAL (MAIN WORKSPACE SHELL) & SIDEBAR
   -------------------------------------------------------------------------- */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;   /* nada rola aqui: a rolagem fica no .view-container */
}

.fluent-sidebar {
  width: 230px;
  flex: none;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border-right: var(--border-subtle);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  position: fixed;     /* sidebar presa à janela */
  top: 0;
  left: 0;
  bottom: 0;
  height: 100vh;
  transition: width var(--duration-smooth) var(--ease-fluent);
  z-index: 100;
  box-shadow: 1px 0 3px rgba(0, 0, 0, 0.02);
  overflow-y: auto;
  overflow-x: hidden;
}

.fluent-sidebar.collapsed {
  width: 66px;
}

/* A sidebar é fixa (fora do fluxo): o conteúdo reserva o espaço dela */
.fluent-sidebar ~ .fluent-main {
  margin-left: 230px;
}

.fluent-sidebar.collapsed ~ .fluent-main {
  margin-left: 66px;
}

.sidebar-header {

}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.brand-glyph {
  font-size: 1.25rem;
  color: #000;
}

/* Logo oficial do OIOM */
.brand-logo {
  width: 32px;
  height: 32px;
  flex: none;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}

.brand-name {
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
  transition: opacity var(--duration-normal) var(--ease-fluent);
  white-space: nowrap;
}

.fluent-sidebar.collapsed .brand-name {
  opacity: 0;
  pointer-events: none;
}

/* Marca da sidebar (só no navegador — no app desktop o símbolo vive na barra de título):
   sempre o símbolo, sem trocar ao recolher; centro em x = 32px, na coluna dos ícones. */
.brand { padding-left: 5px; }
.brand-logo { width: 34px; height: 34px; }
html.has-titlebar .sidebar-header { display: none; }

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--duration-fast) var(--ease-fluent),
              color var(--duration-fast) var(--ease-fluent);
}

.nav-item:hover {
  background: var(--nav-hover-bg, var(--color-bg-hover));
  color: var(--color-text-primary);
}

.nav-item.active {
  background: rgba(0, 0, 0, 0.08);
  color: #000000;
  font-weight: 600;
}

/* (o indicador de seleção agora é o elemento animado #nav-indicator — ver "SIDEBAR DARK") */

.nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex: none;
}

.nav-label {
  flex: 1;
  transition: opacity var(--duration-fast) var(--ease-fluent);
}

.nav-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: #000;
  color: #fff;
  margin-left: auto;
  transition: opacity var(--duration-fast) var(--ease-fluent);
}

.fluent-sidebar.collapsed .nav-label,
.fluent-sidebar.collapsed .nav-badge {
  opacity: 0;
  pointer-events: none;
}

/* Bolinha da cor do projeto */
.project-color-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

/* "ver todos (N)" / "ver menos": discreto, alinhado com os nomes dos projetos */

.sidebar-footer {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Menu da conta (nome do usuário): ocupa o resto do rodapé; o nome corta com "…" */
.nav-account {
  flex: 1;
  min-width: 0;
}
.nav-account .nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* recolhida: um botão por cima do outro, na coluna dos ícones */
.fluent-sidebar.collapsed .sidebar-footer {
  flex-direction: column;
  align-items: stretch;
}

/* Popover da conta (no menu flutuante comum): a tela aberta fica marcada */
.is-account-menu .nav-icon {
  position: relative;
  width: 16px;
  display: grid;
  place-items: center;
}
.is-account-menu .context-menu-item.active {
  border: var(--border-glass);
  background: var(--surface-selected-bg, var(--color-bg-hover));
  font-weight: 600;
}

.btn-sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: none;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--color-text-tertiary);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}

.btn-sidebar-toggle:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.toggle-icon {
  width: 20px;
  text-align: center;
  font-size: 1.1rem;
  transition: transform var(--duration-smooth) var(--ease-fluent);
}

.fluent-sidebar.collapsed .toggle-icon {
  transform: rotate(180deg);
}

/* --------------------------------------------------------------------------
   5. ÁREA PRINCIPAL (MAIN WORKSPACE) & CABEÇALHOS
   -------------------------------------------------------------------------- */
.fluent-main {
  flex: 1;
  min-width: 0;
  height: 100vh;
  padding: 24px 34px 0;      /* sem padding inferior: a barra de comandos encosta no fundo */
  display: flex;
  flex-direction: column;
  overflow: hidden;           /* cabeçalho e barra de comandos ficam fixos */
  transition: margin-left var(--duration-smooth) var(--ease-fluent);
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
  padding-bottom: 6px;
}

.header-left .greeting-tag {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  color: var(--color-text-secondary);
  line-height: 1;
  margin-bottom: 2px;
}

.header-left h1 {
  font-size: 1.95rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #000;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.current-date-badge {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.view-container {
  flex: 1;
  min-height: 0;              /* permite encolher dentro do flex e rolar */
  overflow-y: auto;           /* ÚNICA área de rolagem do Workspace */
  overflow-x: hidden;
  /* overflow corta box-shadow na borda do contentor. Solução: dar ao contentor
     "respiro" interno (20/28/36px, maior que o raio das sombras) e compensar com
     margem negativa igual, para o conteúdo não se mexer visualmente. */
  padding: 20px 28px 36px;
  margin: -20px -28px 0;
  outline: none;
  /* o texto que rola some num degradê embaixo do título (e no fim), em vez de cortar seco.
     A faixa do degradê é a própria folga do padding: parado, o conteúdo não é tocado */
  --scroll-fade-top: 20px;
  --scroll-fade-bottom: 28px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--scroll-fade-top), #000 calc(100% - var(--scroll-fade-bottom)), transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 var(--scroll-fade-top), #000 calc(100% - var(--scroll-fade-bottom)), transparent 100%);
}

/* Inbox (chat): o cartão ocupa toda a área e só a lista de mensagens rola;
   o campo de texto fica sempre no fundo, acima da barra de comandos. */
.view-container.is-chat {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-bottom: 20px;
}

.view-container.is-chat > .ai-chat-card {
  flex: 1;
  height: auto;
  min-height: 420px;
}

.view-container.fade-enter {
  animation: viewFadeIn var(--duration-normal) var(--ease-fluent) forwards;
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   6. CARDS FLUENT, SHEETS & MÓDULO "AGORA"
   -------------------------------------------------------------------------- */
.fluent-sheet {
  background: var(--surface-card-bg, var(--color-bg-surface));
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: var(--surface-card-border, var(--border-subtle));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: border-color var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease,
              transform var(--duration-fast) ease;
}

.fluent-sheet:hover {
  border-color: rgba(0, 0, 0, 0.16);
  box-shadow: var(--shadow-elevated);
}

.sheet-header {
  padding: 14px 18px;
  border-bottom: var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sheet-header b {
  font-size: 0.95rem;
  font-weight: 600;
}

.layout-split {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.agora-module {
  padding: 24px 26px;
  background-color: rgba(255, 255, 255, 0.88);
  background-image: 
    linear-gradient(var(--color-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  position: relative;
}

.agora-note-pill {
  position: absolute;
  top: 14px;
  right: 18px;
  font-family: var(--font-hand);
  font-size: 1.4rem;
  color: var(--color-text-secondary);
  transform: rotate(-3deg);
}

/* "Foco do Momento" + "Trocar" (escolher outra tarefa de hoje para o foco) */
.agora-kicker-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.agora-kicker-row .agora-kicker { margin-bottom: 0; }
.agora-switch {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px 2px 6px;
  border: 1px solid transparent; border-radius: var(--radius-full);
  background: transparent;
  font: inherit; font-size: 0.74rem; font-weight: 500; color: var(--color-text-tertiary);
  cursor: pointer;
  transition: color var(--duration-fast) ease, background var(--duration-fast) ease, border-color var(--duration-fast) ease;
}
.agora-switch svg { transition: transform 0.35s var(--ease-fluent); }
.agora-switch:hover,
.agora-switch[aria-expanded="true"] { color: var(--color-text-strong); background: var(--color-bg-subtle); border-color: color-mix(in srgb, var(--color-text-primary) 12%, transparent); }
.agora-switch:hover svg { transform: rotate(180deg); }
.agora-switch:focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .agora-switch svg { transition: none; } .agora-switch:hover svg { transform: none; } }

.agora-kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  font-weight: 600;
  margin-bottom: 4px;
}

.agora-title {
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #000;
  margin-bottom: 6px;
}

.agora-meta {
  display: flex;
  flex-wrap: wrap;    /* cartão estreito: as peças passam para a linha de baixo inteiras */
  align-items: center;
  gap: 4px 8px;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  margin-bottom: 12px;
}
.agora-meta > * { white-space: nowrap; }

.agora-tag {
  background: var(--color-bg-subtle);
  border: var(--border-subtle);
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
}

.agora-timer {
  font-size: 3.4rem;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: #000;
  margin: 10px 0 16px;
}

.agora-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

/* Contentor da tarefa em foco: título, cronómetro, checklist, detalhes e os botões
   de controlo ficam dentro da mesma caixa, para não parecerem da próxima tarefa. */
.agora-focus-task {
  margin-top: 10px;
  border-radius: var(--radius-lg);
}

.agora-focus-task .agora-timer { margin: 4px 0 12px; }

/* Zerar cronômetro: discreto ao lado do tempo; aparece de vez ao passar o mouse na tarefa */
.agora-timer-row { display: flex; align-items: center; gap: 6px; }
.agora-timer-reset {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; margin-bottom: 8px;
  border: 0; border-radius: var(--radius-full);
  background: transparent; color: var(--color-text-secondary);
  cursor: pointer; opacity: 0.35;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}
.agora-focus-task:hover .agora-timer-reset,
.agora-timer-reset:focus-visible { opacity: 0.8; }
.agora-timer-reset:hover { opacity: 1; background: var(--color-bg-hover); }

/* Botões colados à tarefa: separados do conteúdo por uma linha, dentro da caixa */
.agora-focus-task .agora-actions {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: var(--border-subtle);
}

.agora-task-section { margin-top: 10px; }

.agora-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  margin-bottom: 4px;
}

.agora-details > summary {
  cursor: pointer;
  list-style: none;
  justify-content: flex-start;
  user-select: none;
}
.agora-details > summary::-webkit-details-marker { display: none; }
.agora-details > summary::before {
  content: '▸';
  display: inline-block;
  font-size: 0.8rem;
  transition: transform var(--duration-fast) ease;
}
.agora-details[open] > summary::before { transform: rotate(90deg); }

.focus-notes {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.45;
}

/* Rodapé do dia (fora da tarefa em foco) */
.agora-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 0;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
}

.agora-next {
  display: flex;
  flex-direction: column;
  min-width: 0;
  opacity: 0.85;
}

.agora-next-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

.agora-next-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agora-footer-side {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agora-rest-btn { font-size: 0.8rem; padding: 5px 10px; }

.task-checklist {
  list-style: none;
  margin: 12px 0 16px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
  transition: opacity var(--duration-fast) ease;
}

.checklist-item:hover {
  opacity: 0.75;
}

/* Caixa da checklist: cantos suaves, ✓ em SVG que "se desenha" ao marcar */
.checklist-box {
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(0, 0, 0, 0.32);
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  background: #fff;
  color: #fff;
  flex: none;
  transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease, transform 0.12s ease;
}

.checklist-item:hover .checklist-box { border-color: rgba(0, 0, 0, 0.6); }

.checklist-check {
  display: block;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  opacity: 0;
}

.checklist-item.checked .checklist-box {
  background: #111;
  border-color: #111;
  color: #fff;
}

.checklist-item.checked .checklist-check { stroke-dashoffset: 0; opacity: 1; }

/* Só o item acabado de marcar anima (os outros já nascem marcados a cada render) */
.checklist-item.checked.just-toggled .checklist-box { animation: checklistPop 0.26s var(--ease-fluent); }
.checklist-item.checked.just-toggled .checklist-check { animation: checklistDraw 0.24s var(--ease-fluent) 0.05s both; }

@keyframes checklistPop {
  0% { transform: scale(0.85); }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes checklistDraw {
  from { stroke-dashoffset: 24; opacity: 1; }
  to { stroke-dashoffset: 0; opacity: 1; }
}

.checklist-item:active .checklist-box,
.checklist-box-btn:active .checklist-box { transform: scale(0.9); }

.checklist-item.checked .checklist-text {
  text-decoration: line-through;
  text-decoration-color: rgba(0, 0, 0, 0.35);
  color: var(--color-text-tertiary);
  transition: color var(--duration-fast) ease;
}

/* Modo "clicar no texto": a caixa é um botão próprio */
.checklist-box-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  padding: 3px;
  margin: -3px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.checklist-box-btn:focus-visible { outline: 2px solid var(--color-text-primary); outline-offset: 0; }

@media (prefers-reduced-motion: reduce) {
  .checklist-item.checked.just-toggled .checklist-box,
  .checklist-item.checked.just-toggled .checklist-check { animation: none; }
}

/* Checklist do "Foco do Momento": clicar no item marca/desmarca; o lápis (editar)
   e o lixo (apagar) aparecem só ao passar o rato sobre o item */
.focus-checklist { margin: 2px 0 2px; }

.focus-checklist .checklist-item {
  padding: 5px 4px;   /* um respiro entre os itens: não ficam colados */
  margin: 0 -4px;
  border-radius: 6px;
  transition: background var(--duration-fast) ease;
}
.focus-checklist .checklist-item:hover { opacity: 1; background: var(--color-bg-hover); }
.focus-checklist .checklist-item:focus-visible { outline: 2px solid var(--color-text-primary); outline-offset: 1px; }
/* em edição: a linha fica destacada e o campo de texto dentro dela é transparente */
.focus-checklist .checklist-item.editing { cursor: default; background: var(--color-bg-hover); }

.focus-checklist .checklist-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* Alça de reordenar: na margem à esquerda (não empurra a caixa), só com o rato por cima */
.focus-checklist .checklist-item { position: relative; }
.focus-checklist .checklist-drag-handle {
  position: absolute;
  left: -18px;
  top: 50%;
  transform: translateY(-50%);
}
.focus-checklist .checklist-item:hover .checklist-drag-handle { opacity: 1; }
.focus-checklist .checklist-item.editing .checklist-drag-handle { display: none; }
.focus-checklist.is-sorting { cursor: grabbing; user-select: none; }
.focus-checklist.is-sorting * { cursor: grabbing !important; }
.focus-checklist.is-sorting .checklist-item:not(.is-dragging) { background: transparent; }
.focus-checklist .checklist-item.is-dragging {
  opacity: 1;
  background: var(--color-bg-hover);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}
.focus-checklist .checklist-item.is-dragging .checklist-drag-handle { opacity: 1; color: var(--color-text-primary); }

/* Modo texto: o item não marca ao clicar; o texto é que é editável */
.focus-checklist .checklist-item.mode-text { cursor: default; }
.focus-checklist .checklist-item.mode-text .checklist-text {
  cursor: text;
  padding: 1px 4px;
  margin-left: -4px;
  border-radius: 5px;
}
.focus-checklist .checklist-item.mode-text .checklist-text:hover { background: var(--color-bg-hover); }

.checklist-tools {
  display: inline-flex;
  gap: 2px;
  flex: none;
  opacity: 0;
  transition: opacity var(--duration-fast) ease;
}
.checklist-item:hover .checklist-tools,
.checklist-tools:focus-within { opacity: 1; }
.checklist-item.editing .checklist-tools { display: none; }

.checklist-tool {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-tertiary);
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.checklist-tool:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }

.transparent-input{
  border: none !important;
  border-radius: 10px !important;
}

.focus-checklist-input,
.focus-subitem-edit {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--color-text-primary);
  font: inherit;
  font-size: 0.88rem;
  padding: 4px 0;
  outline: none;
}
.focus-checklist-input::placeholder { color: var(--color-text-tertiary); opacity: 0.8; }
/* em edição/criação o item já se destaca: o campo fica transparente (sem o fundo e a
   sombra do textarea:focus global) */
.focus-checklist-input:focus,
.focus-subitem-edit:focus { background: transparent; box-shadow: none; }

/* --------------------------------------------------------------------------
   Seleção múltipla na checklist do Foco (clicar e arrastar sobre os itens).
   Minimalista: só o realce dos itens; no cabeçalho, "N selecionados" + mover/apagar.
   -------------------------------------------------------------------------- */
.agora-section-head-side { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; }

.focus-checklist .checklist-item.is-selected,
.focus-checklist .checklist-item.is-selected:hover { background: var(--color-bg-active); }
.focus-checklist .checklist-item.is-selected { cursor: grab; } /* premir e arrastar move o grupo */

/* Alça única do grupo: centrada na sequência de selecionados sob o rato (as alças de
   cada item dessa sequência ficam escondidas) */
.focus-checklist { position: relative; }
.focus-checklist .checklist-item.in-hover-run .checklist-drag-handle { opacity: 0; pointer-events: none; }
.focus-checklist > .group-drag-handle {
  position: absolute;
  left: -18px;
  transform: translateY(-50%);
  opacity: 1;
  animation: groupHandleIn 0.16s ease both;
}
.focus-checklist > .group-drag-handle:hover { color: var(--color-text-primary); }
@keyframes groupHandleIn { from { opacity: 0; } to { opacity: 1; } }
/* selecionados seguidos formam um só bloco */
.focus-checklist .checklist-item.is-selected + .checklist-item.is-selected:not(.is-group-carrier) { border-top-left-radius: 0; border-top-right-radius: 0; }
.focus-checklist .checklist-item.is-selected:not(.is-group-carrier):has(+ .checklist-item.is-selected) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
/* com seleção, as ferramentas de cada item saem do caminho — mas mantêm o espaço, para o
   texto não mudar de largura (e de altura) a meio da seleção */
.focus-checklist.has-selection .checklist-tools { opacity: 0; visibility: hidden; pointer-events: none; }
/* durante o arrasto de seleção: sem hover nem "clique" visual nos outros itens */
.focus-checklist.is-sweeping .checklist-item:not(.is-selected) { background: transparent; }
.focus-checklist.is-sweeping .checklist-box { transform: none !important; }

.subitem-selpill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: -3px -4px -3px 0;
  color: var(--color-text-secondary);
  animation: selpillIn 0.2s var(--ease-fluent);
}
.subitem-selpill-count { padding-right: 4px; font-variant-numeric: tabular-nums; }
.subitem-selpill .checklist-tool { width: 22px; height: 22px; }
@keyframes selpillIn {
  from { opacity: 0; transform: translateX(4px); }
  to { opacity: 1; transform: none; }
}

/* Arrasto em grupo: os selecionados saem do lugar e juntam-se num bloco dentro da linha
   arrastada; a lista abre espaço para o bloco inteiro. O bloco são CLONES dos itens (mesmas
   classes → mesmo padding, caixa, texto e cantos "colados" dos selecionados); a linha que os
   leva não tem visual próprio além do do arrasto normal (sombra, fundo e escala). */
.focus-checklist .checklist-item.is-drag-companion { display: none; }
.focus-checklist .checklist-item.is-group-carrier {
  display: block;
  padding: 0;
}
.focus-checklist .checklist-item.is-group-carrier > :not(.drag-stack) { display: none; }
.drag-stack { position: relative; }
/* clones: ocupam a largura da linha (sem a margem negativa, que a linha já tem) e não reagem ao rato */
.focus-checklist .drag-stack > .checklist-item { margin: 0; pointer-events: none; }
.focus-checklist .drag-stack > .checklist-item .checklist-drag-handle,
.focus-checklist .drag-stack > .checklist-item .checklist-tools { visibility: hidden; }
/* alça única centrada no bloco (no mesmo sítio da alça do grupo antes de o agarrar) */
.focus-checklist .drag-stack > .group-drag-handle {
  position: absolute;
  top: 50%;
  left: -14px; /* = -18px da lista, descontando a margem de -4px da linha */
  transform: translateY(-50%);
  opacity: 1;
  color: var(--color-text-primary);
}

/* Menu "Mover para…": título da tarefa + quando */
.context-menu-heading {
  padding: 6px 10px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}
.fluent-context-menu:has(.ctx-meta) { max-width: min(360px, calc(100vw - 16px)); }
.context-menu-item .ctx-meta { flex: none; padding-left: 14px; font-size: 0.74rem; color: var(--color-text-tertiary); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .subitem-selpill { animation: none; }
}

:root[data-theme="dark"] .focus-checklist .checklist-item.is-selected,
:root[data-theme="dark"] .focus-checklist .checklist-item.is-selected:hover { background: rgba(255, 255, 255, 0.1); }
/* a arrastar, o fundo é o opaco do arrasto normal (como no tema claro), não o realce translúcido */
:root[data-theme="dark"] .focus-checklist .checklist-item.is-selected.is-dragging { background: var(--clock-track); }

/* Opções de adiar: rótulo + quando */
.snooze-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.snooze-option-when {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-secondary);
  font-size: 0.82rem;
}

/* --------------------------------------------------------------------------
   7. LISTAS DE TAREFAS, BADGES E LINHAS DE ATIVIDADE
   -------------------------------------------------------------------------- */
.task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  min-height: 48px;
  border-bottom: var(--border-subtle);
  background: transparent;
  transition: background var(--duration-fast) ease;
  position: relative;
  container-type: inline-size;   /* linha estreita: ver @container abaixo */
}

/* Cartão estreito (janela pequena): o projeto sai e o título fica legível */
@container (max-width: 360px) {
  .task-row .task-project-pill { display: none; }
}

/* Lista de tarefas estreita (ex.: "Sua Agenda de Hoje" ao lado do Foco numa janela pequena):
   cada linha vira duas — o título em cima (até 2 linhas) e hora, notas, etiquetas e prioridade
   por baixo, alinhados com ele. Os botões de passar o rato flutuam no canto (não ocupam espaço). */
.task-rows-list { container: taskrows / inline-size; }
@container taskrows (max-width: 380px) {
  .task-row { flex-wrap: wrap; column-gap: 8px; row-gap: 3px; padding-right: 12px; }
  .task-row .task-title-text {
    order: 1; flex: 1 1 calc(100% - 28px); min-width: 0;
    white-space: normal; overflow-wrap: break-word;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  }
  .task-row .task-time-col { order: 2; width: auto; margin-left: 28px; white-space: nowrap; }
  .task-row > :not(.btn-checkbox):not(.task-title-text):not(.task-time-col):not(.task-row-actions) { order: 3; }
  .task-row .item-tags { margin-left: 0; }
  .task-row .task-row-actions {
    position: absolute; top: 6px; right: 8px; transform: none; gap: 0; padding: 2px; border-radius: 9px;
    background: var(--color-bg-surface-elevated); border: var(--border-subtle); box-shadow: var(--shadow-elevated);
    pointer-events: none;
  }
  .task-row:hover .task-row-actions, .task-row-actions:focus-within { pointer-events: auto; opacity: 1; }
  .task-row .task-row-actions .btn-row-action { padding: 3px 5px; }
}

.task-row:last-child {
  border-bottom: none;
}

.task-row:hover {
  background: var(--color-bg-hover);
}

.task-row.current-active {
  background: rgba(0, 0, 0, 0.035);
  box-shadow: inset 3.5px 0 0 #000000;
}

.task-row.completed .task-title-text {
  text-decoration: line-through;
  color: var(--color-text-tertiary);
}

/* Círculo de concluir (taskCircleBtn): o ✓ desenha-se ao concluir, como na checklist; com o
   rato por cima de uma tarefa por fazer, o ✓ aparece de leve (prévia do clique) */
.btn-checkbox {
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.38);
  background: #ffffff;
  color: #111;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
  transition: transform var(--duration-fast) var(--ease-fluent), background var(--duration-fast) ease, border-color var(--duration-fast) ease;
}
.btn-check-ico { display: block; stroke-dasharray: 24; stroke-dashoffset: 24; opacity: 0; transition: opacity 0.15s ease, stroke-dashoffset 0.2s var(--ease-fluent); }
.btn-checkbox:hover { border-color: rgba(0, 0, 0, 0.65); }
.btn-checkbox:hover .btn-check-ico { opacity: 0.35; stroke-dashoffset: 0; }
.btn-checkbox:active { transform: scale(0.9); }
.task-row.completed .btn-checkbox,
.btn-checkbox[aria-checked="true"] { background: #111; border-color: #111; color: #fff; }
.task-row.completed .btn-check-ico,
.btn-checkbox[aria-checked="true"] .btn-check-ico { opacity: 1; stroke-dashoffset: 0; }
.btn-checkbox.just-done { animation: checklistPop 0.26s var(--ease-fluent); }
.btn-checkbox.just-done .btn-check-ico { animation: checklistDraw 0.24s var(--ease-fluent) 0.05s both; }
@media (prefers-reduced-motion: reduce) {
  .btn-checkbox.just-done, .btn-checkbox.just-done .btn-check-ico { animation: none; }
}

/* Caixas de marcar avulsas (consentimento, "Dia inteiro", "Sem data", lembrete de dormir,
   "Anotei a frase"…): a mesma caixa da checklist, com o ✓ como imagem de fundo. Os
   interruptores (.fluent-switch), a checklist do modal e a das notas têm estilo próprio. */
input[type="checkbox"]:not(.fluent-switch > input):not(.checklist-builder-check):not(.notes-prose input) {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 18px !important;
  height: 18px;
  margin: 0;
  border: 1.5px solid rgba(0, 0, 0, 0.32);
  border-radius: 6px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 0 0 no-repeat;
  cursor: pointer;
  vertical-align: -4px;
  transition: background-color var(--duration-fast) ease, border-color var(--duration-fast) ease, background-size 0.22s var(--ease-fluent), transform 0.12s ease;
}
input[type="checkbox"]:not(.fluent-switch > input):not(.checklist-builder-check):not(.notes-prose input):hover { border-color: rgba(0, 0, 0, 0.6); }
input[type="checkbox"]:not(.fluent-switch > input):not(.checklist-builder-check):not(.notes-prose input):active { transform: scale(0.9); }
input[type="checkbox"]:not(.fluent-switch > input):not(.checklist-builder-check):not(.notes-prose input):focus-visible { outline: 2px solid var(--color-text-primary); outline-offset: 2px; }
input[type="checkbox"]:not(.fluent-switch > input):not(.checklist-builder-check):not(.notes-prose input):checked {
  background-color: #111;
  border-color: #111;
  background-size: 12px 12px;
  animation: checklistPop 0.26s var(--ease-fluent);
}
input[type="checkbox"]:not(.fluent-switch > input):not(.checklist-builder-check):not(.notes-prose input):disabled { opacity: 0.45; cursor: default; }
:root[data-theme="dark"] input[type="checkbox"]:not(.fluent-switch > input):not(.checklist-builder-check):not(.notes-prose input) {
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  border-color: rgba(255, 255, 255, 0.4);
}
:root[data-theme="dark"] input[type="checkbox"]:not(.fluent-switch > input):not(.checklist-builder-check):not(.notes-prose input):hover { border-color: rgba(255, 255, 255, 0.7); }
:root[data-theme="dark"] input[type="checkbox"]:not(.fluent-switch > input):not(.checklist-builder-check):not(.notes-prose input):checked { background-color: #fff; border-color: #fff; }
@media (prefers-reduced-motion: reduce) {
  input[type="checkbox"]:checked { animation: none; }
}

.task-time-col {
  width: 44px;
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.task-title-text {
  flex: 1 1 auto;
  min-width: 56px;            /* em cartões estreitos o título nunca some (o projeto sai: @container acima) */
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.priority-pill {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.priority-pill.priority-alta {
  background: #000000;
  color: #ffffff;
}

.priority-pill.priority-media {
  background: #666666;
  color: #ffffff;
}

.priority-pill.priority-baixa {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.25);
  color: #555555;
}

/* projeto na linha da tarefa: só o nome, discreto (sem caixa: menos ruído na lista) */
.task-project-pill {
  font-size: 0.76rem;
  color: var(--color-text-tertiary);
  white-space: nowrap;
}

/* Editar · Mover · Excluir: flutuam no canto só no hover/foco, por cima do fim da linha (antes
   reservavam ~100px invisíveis em toda linha e cortavam o título: "Revisar…"). */
.task-row-actions {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 9px;
  background: var(--color-bg-surface-elevated);
  border: var(--border-subtle);
  box-shadow: var(--shadow-subtle);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) ease;
}

.task-row:hover .task-row-actions,
.task-row:focus-within .task-row-actions {
  opacity: 1;
  pointer-events: auto;
}
/* linha focada pelo teclado (Tab): atalhos do item (E, M, T, N, Del…) e Shift+F10 agem nela */
.task-row:focus-visible {
  outline: 2px solid var(--input-ring-focus);
  outline-offset: -2px;
  background: var(--color-bg-hover);
}

.btn-row-action {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}

.btn-row-action:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #000;
}

/* --------------------------------------------------------------------------
   8. NOVA INBOX: CHAT DE IA CONVERSACIONAL (COPILOT)
   -------------------------------------------------------------------------- */
/* Sem moldura: a conversa fica direto na página, numa coluna central */
.ai-chat-card {
  --chat-col: 850px;
  --chat-pad: max(20px, calc((100% - var(--chat-col)) / 2));
  display: flex;
  flex-direction: column;
  height: calc(100vh - 230px);
  min-height: 420px;
  overflow: hidden;
  background: transparent;
}

/* Topo da conversa: só o "limpar", à direita */
.ai-chat-header {
  min-height: 36px;
  padding: 0 0 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Motor da IA: select discreto na barra do campo (fechado mostra só ícone + nome;
   aberto, cada opção tem uma linha de descrição) */
.ai-engine-select {
  flex: none;
  width: auto;
  min-width: 0;
  height: 32px;
  padding: 0 8px 0 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  box-shadow: none;
}
.ai-engine-select:hover,
.ai-engine-select:focus-visible { background: var(--color-bg-hover); color: var(--color-text-primary); }
.ai-engine-select > button { display: inline-flex; align-items: center; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: inherit; }
.ai-engine-select selectedcontent { display: inline-flex; align-items: center; gap: 6px; }
.ai-engine-select selectedcontent .opt-ico { color: inherit; }
.ai-engine-select selectedcontent small { display: none; }
.ai-engine-select::picker(select) { min-width: 250px; }
.ai-engine-text { display: flex; flex-direction: column; gap: 1px; }
.ai-engine-text small { font-size: 0.72rem; font-weight: 400; color: var(--color-text-tertiary); }

/* Aceite da Nuvem: o botão só fica ativo com a caixa marcada (a ação também verifica) */
.cloud-consent:has(#cloud-consent-check:not(:checked)) .cloud-consent-accept { opacity: 0.4; pointer-events: none; }

/* Avatar do Copilot: "squircle" preto com o rosto do OIOM, sem sombra */
.chat-avatar,
.chat-hero-logo {
  display: grid;
  place-items: center;
  flex: none;
  background: var(--chat-avatar-bg, #111111);
}

/* Tela inicial (só a saudação): logo, pergunta e sugestões em cartões */
.chat-hero {
  margin: auto 0;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: chatMsgIn 0.32s var(--ease-fluent) backwards;
}
.chat-hero-logo { width: 44px; height: 44px; border-radius: 14px; margin-bottom: 18px; }
.chat-hero-logo img { width: 24px; height: 24px; object-fit: contain; display: block; }
.chat-hero-hello {
  margin: 0;
  font-size: 0.92rem;
  color: var(--color-text-tertiary);
}
.chat-hero-title {
  margin: 4px 0 28px;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--color-text-primary);
}
.chat-hero-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.quick-prompt-btn.chat-hero-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 86px;
  padding: 12px 14px;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  white-space: normal;
}
.chat-hero-card b {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-primary);
}
.chat-hero-card span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--color-text-tertiary);
}
.quick-prompt-btn.chat-hero-card:hover {
  background: var(--color-bg-subtle);
  box-shadow: none;
  transform: none;
}

.ai-clear-btn {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--color-text-tertiary);
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.ai-clear-btn:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }
.ai-clear-btn:focus-visible { outline: 2px solid var(--color-text-primary); outline-offset: 1px; }

/* Inbox: itens capturados sem data, acima do chat */
.inbox-tray {
  flex: 0 1 auto;
  max-height: 38%;
  display: flex;
  flex-direction: column;
  margin: 0 var(--chat-pad) 4px;
  border: var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}

.inbox-tray-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px 14px;
  font-size: 0.84rem;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.inbox-tray-head::-webkit-details-marker { display: none; }
.inbox-tray-head:hover { background: var(--color-bg-hover); }
.inbox-tray-head .ui-ico { color: var(--color-text-tertiary); transition: transform var(--duration-fast) var(--ease-fluent); }
.inbox-tray[open] > .inbox-tray-head .ui-ico { transform: rotate(90deg); }
.inbox-tray-count {
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--color-text-primary);
  color: var(--color-text-inverted);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
}
.inbox-tray[open] > .inbox-tray-list { padding-bottom: 6px; }

.inbox-tray-head .text-subtle {
  font-size: 0.76rem;
}

.inbox-tray-list {
  overflow-y: auto;
  min-height: 0;
}

.inbox-row-title {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.inbox-row-title:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.inbox-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.inbox-dest-btn {
  padding: 3px 10px;
  font-size: 0.76rem;
}

/* Tela Hoje vazia: campo de captura em linguagem natural */
.hoje-quick-form {
  display: flex;
  gap: 8px;
}

.hoje-quick-form .fluent-input {
  flex: 1;
  min-width: 0;
}
/* sugestões e prévia embaixo do campo (0.6.4): os chips da janela Nova tarefa (.tm-chip) */
.hoje-quick-hints { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.hoje-quick-hints:empty { display: none; }
.hoje-hints-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.hoje-hints-label { margin-right: 2px; font-size: 0.76rem; color: var(--color-text-tertiary); }
.hoje-hint { max-width: 100%; }
.hoje-hint > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ai-chat-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px var(--chat-pad) 18px;
  display: flex;
  flex-direction: column;
  /* mensagens somem num degradê no topo e junto da caixa de texto (mesma ideia do .view-container) */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16px, #000 calc(100% - 18px), transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 16px, #000 calc(100% - 18px), transparent 100%);
}
/* as mensagens (e os separadores de dia) ficam numa lista própria; o "↓" fica fora dela */
.ai-chat-feed-list { display: flex; flex-direction: column; gap: 4px; }
.chat-msg.is-first:not(:first-child) { margin-top: 14px; }
.chat-day + .chat-msg { margin-top: 0; }

/* Separador de dia: "Hoje", "Ontem", "12/10" */
.chat-day {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-tertiary);
}
.chat-day:first-child { margin-top: 0; }
.chat-day::before,
.chat-day::after { content: ''; flex: 1; height: 1px; background: var(--color-bg-active); }

.chat-msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: min(88%, 720px);
}
/* "backwards" (não "forwards"): no fim a animação larga o transform */
.chat-msg.is-new { animation: chatMsgIn 0.28s var(--ease-fluent) backwards; }
.chat-avatar-spacer { width: 28px; flex: none; }
/* hora: discreta, só com o rato por cima */
.chat-time {
  align-self: flex-end;
  flex: none;
  padding-bottom: 4px;
  font-size: 0.66rem;
  color: var(--color-text-tertiary);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity var(--duration-fast) ease;
}
.chat-msg:hover .chat-time { opacity: 1; }

/* "↓ ir para a mais recente": cola no fundo da conversa quando ela está rolada para cima */
.chat-jump {
  position: sticky;
  bottom: 4px;
  align-self: center;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-top: 8px;
  border: var(--border-subtle);
  border-radius: 50%;
  background: var(--color-bg-surface-elevated);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  animation: chatMsgIn 0.2s var(--ease-fluent) backwards;
}
.chat-jump[hidden] { display: none; }
.chat-jump:hover { transform: translateY(-1px); }

.chat-avatar { width: 26px; height: 26px; border-radius: 8px; margin-top: 1px; }
.chat-avatar img { width: 15px; height: 15px; object-fit: contain; display: block; }

@keyframes chatMsgIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg.assistant {
  align-self: flex-start;
}

.chat-bubble {
  padding: 9px 15px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Você: balão cinza suave */
.chat-msg.user .chat-bubble {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

/* Copilot: texto solto, sem balão, alinhado ao avatar */
.chat-msg.assistant .chat-bubble {
  padding: 3px 0 0;
  color: var(--color-text-primary);
}

/* A resposta aparece palavra por palavra (só opacidade e foco: o texto não muda de lugar);
   cartões e botões entram logo depois */
.chat-word { animation: chatWordIn 0.46s ease-out backwards; }
.chat-word.is-block { display: block; }
@keyframes chatWordIn {
  from { opacity: 0; filter: blur(3px); }
  to { opacity: 1; filter: blur(0); }
}
/* Subir: inline-block só enquanto entra (o transform não vale em texto inline) */
.chat-msg.reveal-rise .chat-word { display: inline-block; max-width: 100%; animation: chatWordRise 0.52s var(--ease-fluent) backwards; }
.chat-msg.reveal-rise .chat-word.is-block { display: block; }
@keyframes chatWordRise {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
/* Suave: a frase inteira, só opacidade */
.chat-msg.reveal-fade .chat-word { animation: chatWordFade 0.7s ease-out backwards; }
@keyframes chatWordFade { from { opacity: 0; } to { opacity: 1; } }
/* Digitar: o texto cresce de verdade (a altura acompanha), com o cursor | logo depois da última
   letra; cartões e botões entram quando a frase termina */
.chat-typed-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.chat-caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.16em;
  border-radius: 1px;
  background: var(--color-text-primary);
}
.chat-msg.is-typing .chat-bubble > :not(p) { display: none; }
.chat-msg.is-typed-done .chat-bubble > :not(p) { animation: chatRevealRest 0.36s ease-out backwards; }
/* amostras nas Configurações: tocam com o mouse em cima ou na opção escolhida */
.chat-reveal-segmented .theme-option span.chat-reveal-sample { display: inline-block; padding: 0; margin-right: 6px; font-weight: 600; color: var(--color-text-tertiary); }
.chat-reveal-segmented .theme-option:hover .chat-reveal-sample.is-focus,
.chat-reveal-segmented .theme-option input:checked + span .chat-reveal-sample.is-focus { animation: chatSampleFocus 1.8s ease-out infinite; }
.chat-reveal-segmented .theme-option:hover .chat-reveal-sample.is-rise,
.chat-reveal-segmented .theme-option input:checked + span .chat-reveal-sample.is-rise { animation: chatSampleRise 1.8s var(--ease-fluent) infinite; }
.chat-reveal-segmented .theme-option:hover .chat-reveal-sample.is-fade,
.chat-reveal-segmented .theme-option input:checked + span .chat-reveal-sample.is-fade { animation: chatSampleFade 1.8s ease-out infinite; }
.chat-reveal-segmented .theme-option:hover .chat-reveal-sample.is-type,
.chat-reveal-segmented .theme-option input:checked + span .chat-reveal-sample.is-type { animation: chatSampleType 1.8s steps(1, end) infinite; }
/* (o ciclo começa e termina visível: a amostra nunca fica como um buraco na opção) */
@keyframes chatSampleFocus { 0%, 60% { opacity: 1; filter: blur(0); } 61% { opacity: 0; filter: blur(3px); } 85%, 100% { opacity: 1; filter: blur(0); } }
@keyframes chatSampleRise { 0%, 60% { opacity: 1; transform: translateY(0); } 61% { opacity: 0; transform: translateY(6px); } 85%, 100% { opacity: 1; transform: translateY(0); } }
@keyframes chatSampleFade { 0%, 55% { opacity: 1; } 56% { opacity: 0; } 90%, 100% { opacity: 1; } }
@keyframes chatSampleType { 0%, 60% { clip-path: inset(0); } 61% { clip-path: inset(0 100% 0 0); } 72% { clip-path: inset(0 50% 0 0); } 84%, 100% { clip-path: inset(0); } }
.chat-msg.is-revealing .chat-bubble > :not(p) { animation: chatRevealRest 0.42s ease-out var(--reveal-delay, 0ms) backwards; }
@keyframes chatRevealRest {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .chat-word, .chat-msg.is-revealing .chat-bubble > :not(p), .chat-reveal-sample { animation: none !important; }
  .chat-msg.is-typed-done .chat-bubble > :not(p) { animation: none !important; }
}

/* Chat respondendo (Configurações → IA → Chat): pontos, pulso ou brilho */
.chat-thinking { animation: chatThinkIn 0.12s ease-out; }
.chat-thinking .chat-bubble { display: flex; align-items: center; min-height: 26px; }
@keyframes chatThinkIn { from { opacity: 0; } to { opacity: 1; } }
.chat-think { display: inline-flex; align-items: center; gap: 4px; color: var(--color-text-tertiary); }
.chat-think.is-dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: chatThinkDot 0.9s ease-in-out infinite; }
.chat-think.is-dots i:nth-child(2) { animation-delay: 0.12s; }
.chat-think.is-dots i:nth-child(3) { animation-delay: 0.24s; }
@keyframes chatThinkDot {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
.chat-think.is-pulse i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; animation: chatThinkPulse 0.8s ease-in-out infinite; }
@keyframes chatThinkPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.72); }
  50% { opacity: 1; transform: scale(1.08); }
}
.chat-think.is-shimmer {
  font-size: 0.86rem;
  color: transparent;
  background: linear-gradient(100deg, var(--color-text-tertiary) 35%, var(--color-text-strong) 50%, var(--color-text-tertiary) 65%) 0 0 / 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: chatThinkShimmer 1.1s linear infinite;
}
@keyframes chatThinkShimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
/* nas Configurações: a amostra só anima na opção escolhida ou com o mouse em cima */
.chat-think-segmented .theme-option span.chat-think { padding: 0; margin-right: 6px; }
.chat-think-segmented .theme-option .chat-think,
.chat-think-segmented .theme-option .chat-think i { animation-play-state: paused; }
.chat-think-segmented .theme-option:hover .chat-think,
.chat-think-segmented .theme-option:hover .chat-think i,
.chat-think-segmented .theme-option input:checked + span .chat-think,
.chat-think-segmented .theme-option input:checked + span .chat-think i { animation-play-state: running; }
@media (prefers-reduced-motion: reduce) {
  .chat-thinking, .chat-think, .chat-think i { animation: none !important; }
  .chat-think.is-shimmer { color: var(--color-text-tertiary); background: none; }
}

/* Cartão de ações sugeridas: folha branca dentro do balão */
.ai-action-card {
  margin-top: 12px;
  padding: 14px;
  border: var(--border-subtle);
  border-radius: 14px;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-action-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 2px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.ai-action-card-title { display: inline-flex; align-items: center; gap: 6px; }
.ai-action-card-header .text-subtle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--color-text-tertiary);
}

/* Cada sugestão: linha suave com uma barra de prioridade à esquerda */
.ai-task-preview-item {
  --prio-bar: rgba(0, 0, 0, 0.16);
  position: relative;
  padding: 10px 12px 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--color-bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease;
}
.ai-task-preview-item::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 3px;
  background: var(--prio-bar);
}
.ai-task-preview-item.priority-alta { --prio-bar: #111111; }
.ai-task-preview-item.priority-media { --prio-bar: rgba(0, 0, 0, 0.42); }
.ai-task-preview-item:hover { border-color: rgba(0, 0, 0, 0.08); }

.ai-task-preview-title {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
  margin: 0 -2px;
  font-weight: 600;
  font-size: 0.9rem;
  outline: none;
  border-radius: 4px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.22);
  cursor: text;
  transition: background var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.ai-task-preview-title:focus { background: var(--input-bg-focus); box-shadow: 0 0 0 3px var(--color-bg-active); border-bottom-color: transparent; }
.ai-task-preview-title.is-static { border-bottom: none; cursor: default; }

.ai-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.ai-chip-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  line-height: 1.5;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  background: var(--color-bg-surface-elevated);
  border: var(--border-subtle);
  color: var(--color-text-secondary);
}
.ai-chip-pill .ui-ico { opacity: 0.7; vertical-align: 0; }

/* Etapas da checklist sugeridas pela IA (cartões do Chat e da Barra Universal) */
.ai-checklist-preview {
  list-style: none;
  margin: 6px 0 0;
  padding: 0 0 0 2px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
}

.ai-checklist-preview li::before {
  content: "☐";
  margin-right: 6px;
  opacity: 0.6;
}

.ai-chip-warning {
  border: 1px dashed rgba(0, 0, 0, 0.35);
  background: transparent;
  color: var(--color-text-primary);
  font-weight: 500;
}

.ai-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.ai-action-buttons .fluent-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 0.8rem;
}

/* "Tarefas criadas": selo verde discreto */
.ai-confirmed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 4px 10px 4px 8px;
  border-radius: var(--radius-full);
  background: rgba(46, 158, 79, 0.1);
  color: #237a3d;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Sugestões: fila deslizante sem barra, com as pontas a desvanecer */
.chat-quick-chips-wrapper {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  margin: 0 var(--chat-pad);   /* margem (não padding): a fila corta na coluna da conversa */
  padding: 4px 0 6px;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent);
          mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent);
}
.chat-quick-chips-wrapper::-webkit-scrollbar { display: none; }

.quick-prompt-btn {
  flex: none;
  font-family: inherit;
  font-size: 0.76rem;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--color-bg-surface-elevated);
  border: var(--border-subtle);
  color: var(--color-text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--duration-fast) ease, border-color var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease, transform var(--duration-fast) var(--ease-fluent);
}

.quick-prompt-btn:hover {
  color: var(--color-text-primary);
  border-color: rgba(0, 0, 0, 0.2);
}

/* Compositor: caixa com o campo em cima e a barra (✨, dica, enviar) em baixo */
.ai-chat-input-bar {
  flex: none;                 /* nunca encolhe nem rola com as mensagens */
  padding: 6px var(--chat-pad) 14px;
}

.ai-composer {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 8px 8px 8px 10px;
  border-radius: 18px;
  background: var(--surface-card-bg, var(--color-bg-surface-elevated));
  border: var(--surface-card-border, 1px solid rgba(0, 0, 0, 0.1));
  transition: border-color var(--duration-fast) ease;
}
.ai-composer:focus-within { border-color: rgba(0, 0, 0, 0.24); }

.ai-composer-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
}

.ai-chat-input {
  width: 100%;
  resize: none;
  padding: 6px 6px 8px !important;
  font-size: 0.92rem !important;
  border: none !important;
  background: transparent !important;   /* a caixa é que tem fundo */
  box-shadow: none !important;
}

.ai-suggest-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--color-text-tertiary);
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.ai-suggest-btn:hover,
.ai-suggest-btn.is-on { background: var(--color-bg-hover); color: var(--color-text-primary); }
.ai-suggest-btn:focus-visible { outline: 2px solid var(--color-text-primary); outline-offset: 1px; }

.ai-send-btn {
  flex: none;
  width: 32px;
  height: 32px;
  margin-left: auto;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: #111111;
  color: #ffffff;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-fluent), opacity var(--duration-fast) ease, background var(--duration-fast) ease;
}
.ai-send-btn:hover { background: #000000; }
.ai-send-btn:active { transform: scale(0.93); }
.ai-send-btn:focus-visible { outline: 2px solid var(--color-text-primary); outline-offset: 2px; }
/* campo vazio: o botão fica em espera */
.ai-composer:has(.ai-chat-input:placeholder-shown) .ai-send-btn { opacity: 0.32; }

/* dica: só com o campo em foco, dentro da barra da caixa */
.ai-composer-hint {
  margin: 0 0 0 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.68rem;
  color: var(--color-text-tertiary);
  opacity: 0;
  transition: opacity var(--duration-fast) ease;
}
.ai-composer:focus-within .ai-composer-hint { opacity: 1; }
.ai-composer-hint kbd {
  font-family: inherit;
  font-size: 0.64rem;
  font-weight: 600;
  padding: 0 5px;
  border-radius: 4px;
  border: var(--border-subtle);
  background: var(--color-bg-subtle);
}
/* Tema escuro do chat */
:root[data-theme="dark"] .chat-hero-logo,
:root[data-theme="dark"] .chat-avatar { background: var(--chat-avatar-bg, #000000); box-shadow: var(--chat-avatar-ring, 0 0 0 1px rgba(255, 255, 255, 0.14)); }
:root[data-theme="dark"] .chat-msg.user .chat-bubble { background: rgba(255, 255, 255, 0.08); }
:root[data-theme="dark"] .ai-task-preview-item { --prio-bar: rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.04); }
:root[data-theme="dark"] .ai-task-preview-item.priority-alta { --prio-bar: #ffffff; }
:root[data-theme="dark"] .ai-task-preview-item.priority-media { --prio-bar: rgba(255, 255, 255, 0.45); }
:root[data-theme="dark"] .ai-task-preview-item:hover { border-color: rgba(255, 255, 255, 0.1); }
:root[data-theme="dark"] .ai-chip-warning { border-color: rgba(255, 255, 255, 0.4); }
:root[data-theme="dark"] .ai-confirmed { background: rgba(111, 191, 115, 0.12); color: #8fd493; }
:root[data-theme="dark"] .quick-prompt-btn:hover { border-color: rgba(255, 255, 255, 0.24); }
:root[data-theme="dark"] .ai-composer { border-color: rgba(255, 255, 255, 0.1); }
:root[data-theme="dark"] .ai-composer:focus-within { border-color: rgba(255, 255, 255, 0.24); }
:root[data-theme="dark"] .quick-prompt-btn.chat-hero-card:hover { background: rgba(255, 255, 255, 0.04); }
:root[data-theme="dark"] .ai-send-btn { background: #ffffff; color: #111111; }
:root[data-theme="dark"] .ai-send-btn:hover { background: #e4e4e7; }

@media (prefers-reduced-motion: reduce) {
  .chat-msg.is-new, .chat-jump, .chat-hero { animation: none; }
  .ai-composer-hint, .chat-time, .inbox-tray-head .ui-ico { transition: none; }
}

/* --------------------------------------------------------------------------
   9. BARRA UNIVERSAL
   -------------------------------------------------------------------------- */
/* A barra FLUTUA sobre o Workspace (o conteúdo rola por baixo dela). Posição escolhida
   em Configurações → Aparência: classe dock-pos-* no <main> (applyCommandBarPosition).
   O dock é transparente e não apanha cliques; só o campo, os atalhos e o popover. */
.fluent-main { position: relative; }
.universal-command-dock {
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 18px;
  margin: 0;
  padding: 0;
  background: transparent;
  pointer-events: none;
  z-index: 500;
}
.universal-command-dock .universal-bar-container { pointer-events: none; }
.universal-command-dock .universal-input-wrapper,
.universal-command-dock .universal-side-actions,
.universal-command-dock .universal-command-popover { pointer-events: auto; }

/* Em baixo (padrão): o fim da lista fica acima da barra */
.dock-pos-bottom .view-container { padding-bottom: 92px; }
.dock-pos-bottom .view-container.is-chat { padding-bottom: 78px; }

/* Em cima, ao centro: entre o título e a data */
.dock-pos-top .universal-command-dock,
.dock-pos-top-right .universal-command-dock { top: 22px; bottom: auto; }

/* Canto superior direito: a barra ocupa o lugar da data */
.dock-pos-top-right .universal-bar-container { justify-content: flex-end; max-width: none; }
.dock-pos-top-right .header-right { visibility: hidden; }

/* Janela estreita: o cabeçalho desce para a barra de cima não tapar o título */
@media (max-width: 1100px) {
  .dock-pos-top .view-header { padding-top: 54px; }
}
@media (max-width: 760px) {
  .dock-pos-top-right .view-header { padding-top: 54px; }
}

/* Três estados, todos no mesmo elemento (só transições, sem trocar DOM):
   repouso    → pílula compacta e quieta, centrada (convida sem ocupar espaço)
   .is-active → foco: abre até 760px, cresce em altura, cantos menos redondos,
                sombra mais funda; os atalhos laterais recolhem
   .has-draft → desfocada com texto: fica aberta (o rascunho nunca se esconde),
                mas volta à elevação de repouso */
.universal-bar-container {
  --bar-ease: cubic-bezier(0.2, 0.9, 0.25, 1);
  --bar-dur: 0.42s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 1080px;
  margin: 0 auto;
  position: relative;
}

.universal-input-wrapper {
  position: relative;
  flex: 0 1 340px;
  min-width: 0;
  transition: flex-basis var(--bar-dur) var(--bar-ease);
}

.universal-command-dock.has-draft .universal-input-wrapper { flex-basis: 620px; }
.universal-command-dock.is-active .universal-input-wrapper { flex-basis: 760px; }

.universal-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  color: var(--color-text-tertiary);
  font-size: 1rem;
  pointer-events: none;
  z-index: 1; /* o input (backdrop-filter = novo contexto de empilhamento) pintava por cima */
  transition: color var(--duration-fast) ease, transform var(--bar-dur) var(--bar-ease);
}

/* foco: a faísca gira um quarto de volta e ganha cor — sinal de "estou a ouvir" */
.universal-command-dock.is-active .universal-search-icon {
  color: var(--color-text-strong);
  transform: translateY(-50%) rotate(90deg);
}

.universal-cmd-input {
  width: 100%;
  padding-left: 40px !important;
  padding-right: 76px !important;
  border-radius: var(--radius-full) !important;
  font-size: 0.86rem !important;
  height: 38px;
  /* campo flutuante: vidro + borda fina + sombra suave (sem a borda inferior Fluent) */
  background: var(--dock-input-bg) !important;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--dock-input-border) !important;
  box-shadow: var(--dock-input-shadow) !important;
  transition: height var(--bar-dur) var(--bar-ease),
              border-radius var(--bar-dur) var(--bar-ease),
              font-size var(--bar-dur) var(--bar-ease),
              background var(--duration-normal) ease,
              border-color var(--duration-normal) ease,
              box-shadow var(--bar-dur) var(--bar-ease);
}

.universal-cmd-input::placeholder {
  color: var(--color-text-tertiary);
  transition: opacity 0.18s ease;
}

/* troca do exemplo do placeholder: some e volta (ver rotateBarPlaceholder) */
.universal-cmd-input.placeholder-swap::placeholder { opacity: 0; }

.universal-cmd-input:hover {
  border-color: var(--dock-input-border-focus) !important;
}

.universal-command-dock.is-active .universal-cmd-input {
  height: 46px;
  border-radius: var(--radius-lg) !important;
  font-size: 0.94rem !important;
  background: var(--dock-input-bg-focus) !important;
  border-color: var(--dock-input-border-focus) !important;
  box-shadow: var(--dock-input-shadow-focus) !important;
}

.universal-command-dock.has-draft:not(.is-active) .universal-cmd-input {
  border-radius: var(--radius-lg) !important;
}

.universal-input-right-tools {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-clear-universal {
  background: transparent;
  border: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
  padding: 3px 6px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  display: none;
  transition: color var(--duration-fast) ease, background var(--duration-fast) ease;
}

.btn-clear-universal.visible {
  display: inline-block;
}

.btn-clear-universal:hover {
  color: #000;
  background: var(--color-bg-hover);
}

.universal-kbd-shortcut {
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-full);
  color: var(--color-text-tertiary);
  user-select: none;
  white-space: nowrap;
  transition: opacity var(--duration-fast) ease;
}

/* com texto o ✕ ocupa o lugar; a dica de teclado só aparece com o campo vazio */
.universal-command-dock.has-draft .universal-kbd-shortcut { display: none; }

/* Atalhos laterais (Nova tarefa, Chat): ícones redondos que recolhem no foco */
/* overflow: hidden recolhe os ícones no foco; o padding (compensado pela margem negativa)
   dá espaço para a sombra deles não ser cortada pela borda */
.universal-side-actions {
  display: flex;
  gap: 6px;
  flex: none;
  max-width: calc(90px + 32px);
  padding: 16px;
  margin: -16px;
  overflow: hidden;
  transition: max-width var(--bar-dur) var(--bar-ease),
              opacity var(--duration-normal) ease,
              transform var(--bar-dur) var(--bar-ease);
}

.universal-command-dock.is-active .universal-side-actions,
.universal-command-dock.has-draft .universal-side-actions {
  max-width: 0;
  opacity: 0;
  transform: translateX(-6px) scale(0.9);
  pointer-events: none;
}

.dock-icon-btn {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--dock-input-border);
  background: var(--dock-input-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--dock-input-shadow);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: color var(--duration-fast) ease, border-color var(--duration-fast) ease,
              transform var(--duration-fast) var(--ease-fluent);
}

.dock-icon-btn:hover {
  color: var(--color-text-strong);
  border-color: var(--dock-input-border-focus);
}

.dock-icon-btn:active { transform: scale(0.94); }

/* Popover de resultados: vidro translúcido (o conteúdo por trás fica desfocado) */
.universal-command-popover {
  --pop-from: 12px;
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  translate: -50% 0;
  transform-origin: bottom center;
  /* 100% = largura da barra (dentro do Workspace): nunca passa por baixo da sidebar
     nem sai da janela; a altura acompanha a janela */
  width: min(780px, 100%);
  max-height: min(490px, calc(100vh - 140px));
  overflow-y: auto;
  background: var(--glass-popover-bg);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid var(--glass-popover-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-launcher), inset 0 1px 0 var(--glass-popover-highlight);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  animation: launcherPopUp 0.28s cubic-bezier(0.2, 0.9, 0.25, 1);
}

.universal-command-popover[hidden] {
  display: none !important;
}

/* Barra em cima: o popover abre para baixo */
.dock-pos-top .universal-command-popover,
.dock-pos-top-right .universal-command-popover {
  --pop-from: -12px;
  bottom: auto;
  top: calc(100% + 12px);
  transform-origin: top center;
}
.dock-pos-top-right .universal-command-popover {
  left: auto;
  right: 0;
  translate: none;
  transform-origin: top right;
}

@keyframes launcherPopUp {
  from {
    opacity: 0;
    transform: translateY(var(--pop-from)) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.launcher-section {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}

.launcher-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  padding: 6px 18px 4px;
  user-select: none;
}

.launcher-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 18px;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}

.launcher-item:hover,
.launcher-item.selected {
  background: rgba(0, 0, 0, 0.07);
  color: #000000;
}

.launcher-icon {
  width: 22px;
  text-align: center;
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  flex: none;
}

.launcher-item:hover .launcher-icon,
.launcher-item.selected .launcher-icon {
  color: #000000;
}

.launcher-content {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.launcher-label {
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.launcher-sub {
  font-size: 0.78rem;
  color: var(--color-text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.launcher-badge {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-text-tertiary);
  font-weight: 500;
  margin-left: auto;
}

/* "/" na Barra Universal: a tecla do comando e o aviso quando não há o que mostrar */
.launcher-slash-key {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font: 700 0.82rem/1 var(--font-mono, ui-monospace, monospace);
  border-radius: 5px;
  background: var(--color-bg-hover);
}
.launcher-icon .ui-ico { vertical-align: -3px; }
.launcher-slash-empty { margin: 4px 16px 10px; font-size: 0.8rem; color: var(--color-text-tertiary); }

.launcher-ai-card-wrapper {
  margin: 6px 12px 10px;
  padding: 14px 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-md);
  background: rgba(248, 248, 248, 0.95);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.launcher-ai-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: #111;
}

.launcher-ai-task-row {
  background: #ffffff;
  border: var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.launcher-ai-task-title {
  font-weight: 600;
  font-size: 0.92rem;
  outline: none;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.25);
  display: inline-block;
}

.launcher-ai-footer-buttons {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.launcher-keyboard-hints {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  background: rgba(0, 0, 0, 0.025);
  border-top: var(--border-subtle);
  font-size: 0.74rem;
  color: var(--color-text-tertiary);
  user-select: none;
}

.launcher-hint-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.launcher-hint-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.launcher-hint-item kbd {
  font-size: 0.68rem;
  padding: 1px 5px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 3px;
  color: #333;
}

/* --------------------------------------------------------------------------
   10. NOVA TELA: CONFIGURAÇÕES DO APLICATIVO (SETTINGS)
   -------------------------------------------------------------------------- */
.settings-container {
  max-width: 840px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-card {
  padding: 20px 24px;
}

.settings-card-header {
  border-bottom: var(--border-subtle);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.settings-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #000;
}

.settings-card-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: var(--border-subtle);
  gap: 16px;
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row-text {
  flex: 1;
}

.settings-row-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #111;
}

.settings-row-desc {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

/* Toggle Switch Fluent Design (Windows 11) */
.fluent-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex: none;
}

.fluent-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.fluent-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.2);
  transition: .24s var(--ease-fluent);
  border-radius: var(--radius-full);
}

.fluent-switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: .24s var(--ease-fluent);
}

.fluent-switch input:checked + .fluent-switch-slider {
  background-color: #000000;
  border-color: #000000;
}

.fluent-switch input:checked + .fluent-switch-slider:before {
  transform: translateX(20px);
}

/* Slider de Opacidade Fluent */
.fluent-range-slider {
  -webkit-appearance: none;   /* sem isto o WebView2 ignora o polegar abaixo e pinta o azul nativo */
  appearance: none;
  width: 160px;
  height: 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.15);
  outline: none;
}

.fluent-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #000000;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* --------------------------------------------------------------------------
   11. MENU CONTEXTUAL FLUENT (DROPDOWN)
   -------------------------------------------------------------------------- */
.fluent-context-menu {
  position: fixed;
  background: var(--surface-menu-bg, rgba(255, 255, 255, 0.94));
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  padding: 5px;
  z-index: 3500;
  min-width: 220px;
  max-width: min(360px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
/* entrada curta, a crescer a partir do ponto do clique (transform-origin posto pelo
   context-menu.js); também nos submenus, a partir do item que os abriu */
.fluent-context-menu.is-entering { animation: ctxMenuIn 120ms cubic-bezier(0.2, 0, 0, 1); }
@keyframes ctxMenuIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .fluent-context-menu.is-entering { animation: none; } }

@keyframes contextMenuIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 0.84rem;
  color: var(--color-text-primary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background var(--duration-fast) ease;
}

/* sob o rato ou com o foco (o context-menu.js põe o foco no item sob o rato: rato e teclado
   andam juntos) e o que tem o submenu aberto */
.context-menu-item:hover,
.fluent-context-menu .context-menu-item:focus,
.context-menu-item.is-open {
  outline: none;
  background: var(--surface-selected-bg, var(--color-bg-hover));
  border: var(--surface-selected-border, none);
}

/* Excluir/Apagar: vermelho (texto e ícone), fundo vermelho translúcido sob o rato */
.context-menu-item.danger { color: var(--menu-danger-color, #c4302b); }
.context-menu-item.danger:hover,
.fluent-context-menu .context-menu-item.danger:focus {
  background: var(--menu-danger-hover-bg, rgba(196, 48, 43, 0.1));
  color: var(--menu-danger-hover-color, #b3261e);
  border: var(--menu-danger-hover-border, var(--surface-selected-border, none));
}

/* bolinha de cor no lugar do ícone (Cor da célula ▸ das tabelas das notas) */
.ctx-color-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
:root[data-theme="dark"] .ctx-color-dot { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }

/* texto ocupa o meio; à direita, por esta ordem: ✓, atalho, seta do submenu */
.context-menu-item .ctx-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.context-menu-item .ctx-shortcut {
  flex: none;
  padding-left: 18px;
  font: 500 0.7rem/1 var(--font-main);
  letter-spacing: 0.02em;
  color: var(--color-text-tertiary);
  background: none;
  border: 0;
}
.context-menu-item.danger .ctx-shortcut { color: inherit; opacity: 0.65; }
.context-menu-item .ctx-sub-arrow { flex: none; display: inline-grid; place-items: center; margin-right: -4px; color: var(--color-text-tertiary); }
.context-menu-item.has-submenu .ctx-shortcut { padding-left: 12px; }
.context-menu-item.is-open .ctx-sub-arrow,
.context-menu-item.has-submenu:hover .ctx-sub-arrow { color: var(--color-text-primary); }

/* item liga/desliga: o check do estado fica à direita (vazio = desligado) */
.context-menu-item .ctx-check {
  flex: none;
  padding-left: 16px;
  display: inline-grid;
  place-items: center;
  color: var(--color-text-primary);
}

.context-menu-item:focus-visible {
  outline: none;
  background: var(--surface-selected-bg, var(--color-bg-hover));
}

.context-menu-item:disabled,
.context-menu-item.disabled {
  opacity: 0.4;
  cursor: default;
  background: transparent;
}

.context-menu-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  margin: 3px 0;
}

/* --------------------------------------------------------------------------
   12. BOTÕES FLUENT DESIGN (MONOCROMÁTICOS)
   -------------------------------------------------------------------------- */
.fluent-btn {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  user-select: none;
  border: var(--border-subtle);
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform var(--duration-fast) var(--ease-fluent),
              background var(--duration-fast) ease,
              border-color var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease;
}

.fluent-btn:hover {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.fluent-btn:active {
  transform: scale(0.97);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.fluent-btn-primary {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
  font-weight: 600;
}

.fluent-btn-primary:hover {
  background: #222222;
  border-color: #222222;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
}

.fluent-btn-subtle {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-secondary);
  box-shadow: none;
}

.fluent-btn-subtle:hover {
  background: var(--color-bg-hover);
  border-color: transparent;
  color: var(--color-text-primary);
  box-shadow: none;
}

/* desativado: apagado, sem hover, active nem clique (vale também no Vidro). O ocupado
   (aria-busy) fica com o tratamento do loading. O :where segura a especificidade: as regras
   próprias (.calendar-today-btn, .report-actions) continuam valendo */
.fluent-btn:disabled:where(:not([aria-busy="true"])) { opacity: 0.45; cursor: default; pointer-events: none; }

.btn-icon-danger {
  background: transparent;
  border: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: color var(--duration-fast) ease, background var(--duration-fast) ease;
}

.btn-icon-danger:hover {
  color: #000;
  background: var(--color-bg-hover);
}

/* --------------------------------------------------------------------------
   13. FORMULÁRIOS & INPUTS FLUENT DESIGN
   -------------------------------------------------------------------------- */
.fluent-input,
input[type="text"],
input[type="password"],
input[type="time"],
input[type="date"],
input[type="number"],
select,
textarea {
  font-family: inherit;
  font-size: 0.88rem;
  padding: 8px 12px;
  background: var(--input-bg);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  outline: none;
  box-shadow: inset 0 0 0 1px var(--input-ring), 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: border-bottom-color var(--duration-fast) ease,
              background var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease;
}

.fluent-input:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="time"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  background: var(--input-bg-focus);
  box-shadow: inset 0 0 0 1px var(--input-ring-focus), 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Campos "inline" sem caixa (checklist do Foco): continuam transparentes no foco */
.transparent-input,
.focus-subitem-edit {
  --input-bg-focus: transparent;
  --input-ring: transparent;
  --input-ring-focus: transparent;
}

textarea.fluent-textarea {
  resize: vertical;
  line-height: 1.5;
}

/* <select> com lista personalizável (Chromium 135+ / WebView2): a lista aberta ganha o
   mesmo visual do menu de contexto (vidro, cantos, sombra) e abre com animação. Noutros
   motores o @supports falha e fica o select nativo. */
@supports (appearance: base-select) {
  select,
  select::picker(select) { appearance: base-select; }

  select {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
  }
  select:hover { background: var(--input-bg-hover); }

  /* Seta: chevron fino que vira ao abrir */
  select::picker-icon {
    content: '';
    width: 14px;
    height: 14px;
    margin-left: auto;
    background: currentColor;
    opacity: 0.55;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: rotate 0.2s var(--ease-fluent), opacity var(--duration-fast) ease;
  }
  select:hover::picker-icon,
  select:open::picker-icon { opacity: 0.9; }
  select:open::picker-icon { rotate: 180deg; }

  /* A lista */
  select::picker(select) {
    margin-block: 6px;
    padding: 5px;
    min-width: anchor-size(width);
    max-height: min(320px, 50vh);
    overflow-y: auto;
    background: var(--color-bg-surface-elevated);
    backdrop-filter: blur(24px) saturate(180%);
    border: var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-dropdown);
    color: var(--color-text-primary);
    /* abre/fecha: surge do lado do select com fade + leve escala */
    opacity: 1;
    transform: translateY(0) scale(1);
    transform-origin: top center;
    transition: opacity 0.16s ease, transform 0.18s var(--ease-fluent),
                display 0.18s allow-discrete, overlay 0.18s allow-discrete;
  }
  select:not(:open)::picker(select) {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  @starting-style {
    select:open::picker(select) {
      opacity: 0;
      transform: translateY(-4px) scale(0.98);
    }
  }

  select option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: background var(--duration-fast) ease;
  }
  select option + option { margin-top: 2px; }
  select option:hover,
  select option:focus-visible {
    outline: none;
    background: var(--color-bg-hover);
  }
  select option:checked {
    font-weight: 600;
    background: var(--color-bg-active);
  }
  select option:disabled { opacity: 0.4; cursor: default; }

  /* ✓ à direita da opção escolhida (o lugar fica reservado nas outras: sem saltos) */
  select option::checkmark {
    order: 1;
    margin-left: auto;
    content: '';
    width: 14px;
    height: 14px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  }

  @media (prefers-reduced-motion: reduce) {
    select::picker(select),
    select::picker-icon { transition: none; }
  }
}

/* Seções que abrem e fecham (<details>): a altura anima nos dois sentidos. O
   content-visibility discreto mantém o conteúdo à vista enquanto fecha. Sem suporte
   (motor antigo): abre e fecha na hora, como antes. */
@supports selector(::details-content) {
  details { interpolate-size: allow-keywords; }
  details::details-content {
    block-size: 0;
    overflow: clip;
    overflow-clip-margin: 6px;   /* anéis de foco e sombras das linhas não ficam cortados */
    transition: block-size var(--duration-normal) var(--ease-fluent),
                content-visibility var(--duration-normal) allow-discrete;
  }
  details[open]::details-content { block-size: auto; }
  @media (prefers-reduced-motion: reduce) {
    details::details-content { transition: none; }
  }
}

/* --------------------------------------------------------------------------
   14. ABA PERFIL & RELÓGIO DE 24 HORAS INTERATIVO (SVG)
   -------------------------------------------------------------------------- */
.clock-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
}

.clock-svg-dial {
  max-width: 290px;
  width: 100%;
  display: block;
  margin: 10px auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.05));
  animation: dialFadeIn 0.4s var(--ease-fluent);
}

@keyframes dialFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.clock-needle {
  transform-origin: 120px 120px;
  transition: transform 0.6s var(--ease-fluent);
}

.clock-arc-slice {
  cursor: pointer;
  transition: opacity var(--duration-fast) ease;
}

.clock-arc-slice:hover {
  opacity: 0.85;
}

.block-color-picker {
  width: 34px !important;
  height: 34px;
  padding: 2px !important;
  border-radius: 50% !important;
  cursor: pointer;
  background: transparent !important;
  border: var(--border-subtle) !important;
}

.block-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}
.block-color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}
.block-color-picker::-moz-color-swatch {
  border: none;
  border-radius: 50%;
}

.free-hours-card {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: var(--border-subtle);
  padding-top: 14px;
  margin-top: 14px;
}

.free-hours-card b {
  font-size: 2.1rem;
  font-weight: 300;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.legend-list {
  list-style: none;
  margin-top: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.85rem;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.legend-item b {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   15. VISÃO DE PROJETOS (pastas e página do projeto) & CALENDÁRIO
   A cor de cada pasta vem do projeto (--folder, posta no HTML); o resto usa os tokens.
   -------------------------------------------------------------------------- */
.projects-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  margin-bottom: 22px;
}

/* colunas de largura fixa: as pastas ficam numa grade certa (não esticam com a janela) e a
   margem negativa alinha a 1.ª pasta com o texto de cima ((148 − 112) / 2 = 18px) */
.projects-folders {
  display: grid;
  grid-template-columns: repeat(auto-fill, 148px);
  justify-content: start;
  gap: 18px 12px;
  margin-left: -18px;
}

.project-folder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 16px 10px 14px;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: background var(--duration-fast) ease, transform var(--duration-fast) ease;
}
.project-folder:hover { background: var(--color-bg-subtle); }
.project-folder:active { transform: scale(0.97); }
.project-folder:focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: 2px; }

.project-folder-art {
  --folder: #333333;
  display: block;
  width: 112px;
  aspect-ratio: 120 / 96;
  margin-bottom: 8px;
  transition: transform 0.3s var(--ease-fluent), filter 0.3s ease;
}
/* passar o rato: a pasta sobe um pouco, com uma sombra suave */
.project-folder:hover .project-folder-art {
  transform: translateY(-3px);
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.14));
}
:root[data-theme="dark"] .project-folder:hover .project-folder-art { filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.5)); }
.project-folder-art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.project-folder-art .folder-back { fill: var(--folder); filter: brightness(0.7); }
/* escuro: um contorno fino para a pasta de cor escura não sumir no fundo */
:root[data-theme="dark"] .project-folder-art .folder-back,
:root[data-theme="dark"] .project-folder-art .folder-front { stroke: rgba(255, 255, 255, 0.16); stroke-width: 1; }
.project-folder-art .folder-paper {
  fill: #ffffff;
  opacity: 0.92;
  transform: translateY(18px);   /* parada: escondida atrás da frente */
  transition: transform 0.28s var(--ease-fluent);
}
.project-folder-art .folder-front {
  fill: var(--folder);
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition: transform 0.28s var(--ease-fluent);
}
/* passar o rato: a folha sobe e a frente da pasta abre um pouco */
.project-folder:hover .folder-paper,
.project-hero-folder:hover .folder-paper { transform: translateY(2px); }
.project-folder:hover .folder-front,
.project-hero-folder:hover .folder-front { transform: skewX(-4deg) scaleY(0.93); }
/* clique: a pasta abre-se de vez antes da página entrar (ver filter-project no script.js) */
.project-folder.is-opening .project-folder-art { transform: translateY(-4px) scale(1.06); }
.project-folder.is-opening .folder-paper { transform: translateY(-6px); }
.project-folder.is-opening .folder-front { transform: skewX(-9deg) scaleY(0.8); }

.project-folder-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--color-text-strong);
}
.project-folder-meta { font-size: 0.75rem; color: var(--color-text-tertiary); }

/* "Novo projeto" (cabeçalho): pílula minimalista, borda fina, pasta com "+" dentro.
   Ao passar o rato: fundo suave, a pasta enche-se e o "+" dá um quarto de volta. */
.project-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 15px 0 11px;
  border: 1px solid color-mix(in srgb, var(--color-text-primary) 14%, transparent);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.22s ease, border-color 0.22s ease, color 0.22s ease,
              box-shadow 0.25s ease, transform 0.25s var(--ease-fluent);
}
.project-new-btn:hover {
  background: var(--color-bg-subtle);
  border-color: color-mix(in srgb, var(--color-text-primary) 26%, transparent);
  color: var(--color-text-strong);
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}
.project-new-btn:active { transform: translateY(0) scale(0.97); box-shadow: none; transition-duration: 0.08s; }
.project-new-btn:focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: 2px; }
.project-new-ico { flex: none; overflow: visible; }
.project-new-ico .pn-folder { fill: transparent; transition: fill 0.25s ease; }
.project-new-ico .pn-plus {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.4s var(--ease-fluent);
}
.project-new-btn:hover .pn-folder { fill: color-mix(in srgb, currentColor 14%, transparent); }
.project-new-btn:hover .pn-plus { transform: rotate(90deg) scale(1.12); }

/* "Novo projeto" (sem nenhum projeto): o contorno de uma pasta, fino e tracejado, com "+" dentro */
.project-folder-art.is-ghost { color: var(--color-text-tertiary); opacity: 0.75; transition: opacity 0.25s ease, transform 0.3s var(--ease-fluent), color 0.25s ease; }
.project-folder-art.is-ghost .ghost-folder {
  fill: transparent;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
  vector-effect: non-scaling-stroke;
  transition: fill 0.3s ease;
}
.project-folder-art.is-ghost .ghost-plus {
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.45s var(--ease-fluent);
}
.project-folder.is-new:hover .project-folder-art.is-ghost { opacity: 1; filter: none; color: var(--color-text-secondary); }
.project-folder.is-new:hover .ghost-folder { fill: color-mix(in srgb, currentColor 8%, transparent); animation: ghostDash 1.2s linear infinite; }
.project-folder.is-new:hover .ghost-plus { transform: rotate(90deg); }
@keyframes ghostDash { to { stroke-dashoffset: -20; } }

/* Entrada: as pastas aparecem uma a uma; a página sobe por partes. Só ao chegar à tela ou
   ao trocar de projeto (.is-entering, posto pelo script.js), nunca a cada redesenho. */
@keyframes projFolderIn { from { opacity: 0; transform: translateY(10px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes projRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes projRowIn {
  from { opacity: 0; transform: translateY(-4px); background: var(--color-bg-active); }
  60% { opacity: 1; transform: none; }
  to { opacity: 1; transform: none; background: transparent; }
}
@keyframes projRowOut { to { opacity: 0; transform: translateX(14px); } }
.projects-view.is-entering .projects-head { animation: projRise 0.35s var(--ease-fluent) backwards; }
.projects-view.is-entering .project-folder {
  animation: projFolderIn 0.42s var(--ease-fluent) backwards;
  animation-delay: calc(var(--i, 0) * 35ms + 40ms);
}
.project-page.is-entering > * { animation: projRise 0.4s var(--ease-fluent) backwards; }
.project-page.is-entering > :nth-child(2) { animation-delay: 40ms; }
.project-page.is-entering > .project-body { animation: none; }
.project-page.is-entering .project-body > * { animation: projRise 0.4s var(--ease-fluent) backwards; animation-delay: 90ms; }
.project-page.is-entering .project-body > :nth-child(2) { animation-delay: 140ms; }
.project-task-list .task-row.is-fresh { animation: projRowIn 0.6s var(--ease-fluent) backwards; }
.project-task-list .task-row.is-leaving { animation: projRowOut 0.18s ease forwards; pointer-events: none; }

/* Página do projeto: lê-se como uma nota (título grande, descrição corrida) */
/* Centrada como a nota aberta: coluna até 1180px no meio da tela (sem vazio só de um lado);
   o padding de baixo é o espaço da Barra Universal flutuante */
.project-page { max-width: 1180px; margin: 0 auto; padding-top: 12px; padding-bottom: 96px; container: projectpage / inline-size; }
/* Com espaço, as notas vão para uma coluna ao lado das tarefas (sem área vazia à direita) */
@container projectpage (min-width: 980px) {
  .project-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 0 44px; align-items: start; }
  .project-notes { grid-template-columns: 1fr; }
  .project-note { min-height: 0; }
}

.project-crumbs { margin: -4px 0 12px -6px; }   /* a seta alinha com a margem do título */
.project-crumb-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px 5px 6px;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.project-crumb-back:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }

.project-hero {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 4px 0 24px;
  margin-bottom: 24px;
  border-bottom: var(--border-subtle);
}
.project-hero-folder { position: relative; flex-shrink: 0; padding-top: 6px; border-radius: 12px; cursor: pointer; }
.project-hero-folder .project-folder-art { --folder: inherit; width: 84px; margin: 0; }
.project-hero-folder:focus-within { outline: 2px solid var(--input-ring-focus); outline-offset: 4px; }
/* o seletor de cor ocupa a pasta inteira, invisível: clicar na pasta abre a escolha */
.project-color-input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }

.project-hero-text { flex: 1; min-width: 0; max-width: 820px; display: flex; flex-direction: column; gap: 4px; padding-right: 36px; }   /* descrição longa: linhas legíveis */
/* Campos sem caixa: os seletores são longos de propósito, para passar à frente das regras gerais
   dos campos (":root[data-theme="dark"] input[type="text"]" pesa como 3 classes) */
.project-page .project-hero-text .project-title-input.project-title-input,
.project-page .project-hero-text .project-desc-input.project-desc-input {
  width: 100%;
  margin-left: -8px;
  padding: 2px 8px;
  border: 0;
  border-radius: var(--radius-md);
  box-shadow: none;
  background: transparent;
  color: inherit;
  font: inherit;
  outline: none;
  transition: background var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.project-page .project-hero-text .project-title-input.project-title-input {
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text-strong);
}
.project-page .project-hero-text .project-desc-input.project-desc-input {
  min-height: 2em;
  overflow: hidden;
  resize: none;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-text-secondary);
}
.project-page .project-hero-text .project-title-input.project-title-input::placeholder,
.project-page .project-hero-text .project-desc-input.project-desc-input::placeholder { color: var(--color-text-tertiary); opacity: 1; }
.project-page .project-hero-text .project-title-input.project-title-input:hover,
.project-page .project-hero-text .project-desc-input.project-desc-input:hover { background: transparent; box-shadow: inset 0 0 0 1px var(--input-ring); cursor: text; }
.project-page .project-hero-text .project-title-input.project-title-input:focus,
.project-page .project-hero-text .project-desc-input.project-desc-input:focus { background: var(--color-bg-subtle); box-shadow: inset 0 0 0 1px var(--input-ring); }

.project-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--color-text-tertiary);
}
.project-progress { display: inline-flex; align-items: center; gap: 8px; }
.project-progress-bar {
  width: 96px;
  height: 5px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(--color-bg-active);
}
.project-progress-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-text-primary);
  transition: width var(--duration-smooth) var(--ease-fluent);
}

.project-hero-delete { position: absolute; top: 4px; right: 0; opacity: 0; transition: opacity var(--duration-fast) ease; }
.project-hero:hover .project-hero-delete,
.project-hero-delete:focus-visible { opacity: 1; }

.project-section { margin-bottom: 32px; }
.project-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.project-section-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--color-text-strong);
}
.project-count {
  padding: 1px 8px;
  border-radius: var(--radius-full);
  background: var(--color-bg-active);
  color: var(--color-text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
}
.project-section-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.project-section-actions .fluent-btn { font-size: 0.82rem; }

.project-quick-add {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  margin-bottom: 4px;
  border-radius: var(--radius-md);
  background: var(--input-bg);
  box-shadow: inset 0 0 0 1px var(--input-ring);
  color: var(--color-text-tertiary);
  transition: background var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.project-quick-add:hover { background: var(--input-bg-hover); }
.project-quick-add:focus-within { background: var(--input-bg-focus); box-shadow: inset 0 0 0 1px var(--input-ring-focus); }
.project-page .project-quick-add .project-quick-input.project-quick-input,
.project-page .project-quick-add .project-quick-input.project-quick-input:focus {   /* o campo é a caixa de fora: o de dentro nunca tem fundo nem sombra (nem no foco do escuro) */
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  outline: none;
}
.project-page .project-quick-add .project-quick-input.project-quick-input::placeholder { color: var(--color-text-tertiary); }

/* linhas com cantos arredondados, como o resto do app: o hover é um bloco, sem linhas a cortar */
.project-task-list .task-row { border-bottom: 0; border-radius: var(--radius-md); }
.project-task-list .task-row + .task-row { margin-top: 2px; }
.project-task-when {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--color-text-tertiary);
}
.project-task-when.is-overdue { font-weight: 600; color: var(--color-text-primary); }

.project-done-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 10px 6px 6px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.project-done-toggle:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }
.project-task-list.is-done { opacity: 0.75; }

.project-empty { padding: 14px 4px; font-size: 0.85rem; color: var(--color-text-tertiary); }

/* notas do projeto: os cartões das Notas, em miniatura */
.project-notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.project-note {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 128px;
  overflow: hidden;
  padding: 16px 16px 14px;
  border: var(--border-glass);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--note-card-top) 0%, var(--note-card-bottom) 100%);
  box-shadow: var(--note-card-shadow);
  color: var(--note-card-title);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.project-note:hover { transform: translateY(-2px); box-shadow: var(--note-card-shadow-hover); }
.project-note:focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: 3px; }
.project-note-title,
.project-note-snippet {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.project-note-title { -webkit-line-clamp: 2; line-clamp: 2; font-size: 1.02rem; font-weight: 700; line-height: 1.25; }
.project-note-snippet { -webkit-line-clamp: 3; line-clamp: 3; font-size: 0.82rem; line-height: 1.45; color: var(--note-card-text); }
.project-note-date { margin-top: auto; font-size: 0.72rem; color: var(--note-card-text); opacity: 0.8; }

/* "Vincular existente" (modal) */
.project-link-list { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; margin-top: 10px; overflow-y: auto; }
.project-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.project-link-row:hover,
.project-link-row:focus-visible { background: var(--color-bg-hover); outline: none; }
.project-link-row > svg { flex-shrink: 0; color: var(--color-text-tertiary); }
.project-link-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.project-link-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.project-link-meta { font-size: 0.76rem; color: var(--color-text-tertiary); }

@media (max-width: 640px) {
  .project-hero { gap: 14px; }
  .project-hero-folder .project-folder-art { width: 60px; }
  .project-title-input { font-size: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .project-folder,
  .project-folder-art,
  .project-folder-art .folder-front,
  .project-folder-art .folder-paper,
  .project-progress-bar > span,
  .project-new-btn,
  .project-new-ico .pn-plus,
  .project-folder-art.is-ghost .ghost-plus,
  .project-note { transition: none; }
  .project-new-btn:hover,
  .project-new-btn:hover .pn-plus,
  .project-folder.is-new:hover .ghost-plus { transform: none; }
  .project-folder.is-new:hover .ghost-folder { animation: none; }
  .projects-view.is-entering .projects-head,
  .projects-view.is-entering .project-folder,
  .project-page.is-entering > *,
  .project-page.is-entering .project-body > *,
  .project-task-list .task-row.is-fresh { animation: none; }
  .project-folder:hover .project-folder-art,
  .project-note:hover { transform: none; }
}

.calendar-scroll-wrap {
  overflow-x: auto;
  padding-bottom: 6px;
}

.calendar-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  border: var(--surface-card-border, var(--border-subtle));
  border-radius: var(--radius-lg);
  overflow: hidden;
  /* quadriculado de 22px sobre o branco; um tema com --surface-card-bg troca tudo */
  background: var(--surface-card-bg,
    linear-gradient(var(--color-grid) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, var(--color-grid) 1px, transparent 1px) 0 0 / 22px 22px rgba(255, 255, 255, 0.85));
  min-width: 980px;
}

.calendar-day-col {
  padding: 14px 12px;
  border-right: var(--border-subtle);
  min-height: 320px;
}

.calendar-day-col:last-child {
  border-right: none;
}

.calendar-event-card {
  border: var(--border-subtle);
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 8px 10px;
  margin-top: 8px;
  font-size: 0.82rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: transform var(--duration-fast) var(--ease-fluent),
              box-shadow var(--duration-fast) ease;
}

.calendar-event-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-subtle);
}

.calendar-event-card.completed {
  text-decoration: line-through;
  color: var(--color-text-tertiary);
}

/* Barra do calendário: ‹ período › Hoje ··········· [Semana | Mês] */
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.calendar-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.calendar-nav-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--color-bg-surface-elevated);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: background var(--duration-fast) ease, opacity var(--duration-fast) ease;
}
.calendar-nav-btn:hover:not(:disabled) { background: var(--color-bg-hover); }
.calendar-nav-btn:disabled { opacity: 0.35; cursor: default; }
.calendar-range-label {
  min-width: 190px;
  text-align: center;
  font-weight: 600;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.calendar-select { font-weight: 600; min-width: 0; }
.calendar-select[data-calendar-field="month"] { width: 140px; }
.calendar-select[data-calendar-field="year"] { width: 96px; }
.calendar-today-btn:disabled { opacity: 0.4; cursor: default; }
.calendar-today-btn:disabled:hover { background: transparent; color: var(--color-text-secondary); }

/* Alternador Semana | Mês (segmentado) */
.calendar-mode-toggle {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
  border: var(--border-subtle);
}
.calendar-mode-toggle button {
  border: none;
  background: transparent;
  padding: 5px 14px;
  border-radius: 7px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.calendar-mode-toggle button:hover { color: var(--color-text-primary); }
.calendar-mode-toggle button.active {
  background: var(--surface-selected-bg, var(--color-bg-surface-elevated));
  border: var(--surface-selected-border, none);
  color: var(--color-text-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ---------------- Semana: colunas por dia ---------------- */
.calendar-week-grid { grid-template-columns: repeat(7, minmax(128px, 1fr)); min-width: 900px; }
.calendar-day-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 10px 14px;
  min-height: 360px;
}
.calendar-day-col .calendar-block-chip { margin: 0; }
.calendar-day-col.is-today {
  background-image: linear-gradient(var(--color-bg-subtle), transparent 160px);
  box-shadow: inset 0 3px 0 var(--color-text-strong);
}
.calendar-day-col.is-past .calendar-day-head,
.calendar-day-col.is-past .calendar-day-summary { opacity: 0.55; }

.calendar-day-head { align-items: center; margin-bottom: 2px; }
/* Dia (abre o modal do dia) */
.calendar-day-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: -3px -6px;
  padding: 3px 6px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--duration-fast) ease;
}
.calendar-day-title:hover { background: var(--color-bg-hover); }
.calendar-day-weekday {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}
.calendar-day-num {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  font-size: 1.2rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-primary);
}
.calendar-day-col.is-today .calendar-day-weekday { color: var(--color-text-strong); }
.calendar-day-col.is-today .calendar-day-num {
  padding: 0 7px;
  border-radius: var(--radius-full);
  background: var(--color-text-strong);
  color: var(--color-text-inverted);
  font-size: 0.95rem;
}

/* Ferramentas do dia (+ e descanso): discretas, aparecem com o rato */
.calendar-day-tools { display: flex; align-items: center; gap: 2px; }
.calendar-day-tools .btn-rest-toggle {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--color-text-secondary);
  opacity: 0;
}
.calendar-day-col:hover .calendar-day-tools .btn-rest-toggle,
.calendar-day-tools .btn-rest-toggle:focus-visible { opacity: 0.45; }
.calendar-day-tools .btn-rest-toggle:hover,
.calendar-day-tools .btn-rest-toggle.active { opacity: 1; }

.calendar-add-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--color-text-tertiary);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--duration-fast) ease, background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.calendar-day-col:hover .calendar-add-btn,
.calendar-month-cell:hover .calendar-add-btn,
.calendar-add-btn:focus-visible { opacity: 1; }
.calendar-add-btn:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }

.calendar-day-summary {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--color-text-tertiary);
  font-variant-numeric: tabular-nums;
}
.calendar-day-progress {
  height: 3px;
  margin-bottom: 2px;
  border-radius: var(--radius-full);
  background: var(--color-bg-active);
  overflow: hidden;
}
.calendar-day-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-text-strong);
  transition: width 0.3s var(--ease-fluent);
}
.calendar-day-progress.is-complete { background: var(--color-text-strong); }

/* Cartão de tarefa: [✓] 09:00 · 30 min / título / ● projeto — barra à esquerda = prioridade */
.calendar-event-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 0;
  padding: 8px 9px 8px 7px;
  border-left: 3px solid var(--prio, transparent);
  cursor: pointer;
}
.calendar-event-card.priority-alta { --prio: var(--color-text-strong); }
.calendar-event-card.priority-media { --prio: rgba(0, 0, 0, 0.26); }
.calendar-event-card.priority-baixa { --prio: rgba(0, 0, 0, 0.09); }
.calendar-event-card.completed { text-decoration: none; opacity: 0.7; }
.calendar-event-body { flex: 1; min-width: 0; }
.calendar-event-meta {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--color-text-tertiary);
  font-variant-numeric: tabular-nums;
}
.calendar-event-title { margin-top: 1px; font-size: 0.82rem; line-height: 1.35; overflow-wrap: anywhere; }
.calendar-event-card.completed .calendar-event-title { text-decoration: line-through; color: var(--color-text-tertiary); }
.calendar-event-project {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-size: 0.68rem;
  color: var(--color-text-secondary);
}
.calendar-event-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; }

/* Caixa de concluir (cartões da semana e modal do dia) — a mesma do Foco */
.calendar-event-check,
.day-modal-check {
  display: inline-grid;
  place-items: center;
  flex: none;
  padding: 3px;
  margin: -2px -1px -2px -2px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.calendar-event-check:hover .checklist-box,
.day-modal-check:hover .checklist-box { border-color: rgba(0, 0, 0, 0.6); }
.calendar-event-check:focus-visible,
.day-modal-check:focus-visible { outline: 2px solid var(--color-text-primary); outline-offset: 0; }
.calendar-event-check:active .checklist-box,
.day-modal-check:active .checklist-box { transform: scale(0.9); }
.calendar-event-card.completed .checklist-box,
.day-modal-task.completed .checklist-box { background: #111; border-color: #111; color: #fff; }
.calendar-event-card.completed .checklist-check,
.day-modal-task.completed .checklist-check { stroke-dashoffset: 0; opacity: 1; }

/* Dia vazio: "+ Adicionar" tracejado, só com o rato por cima */
.calendar-empty-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px;
  border: 1px dashed rgba(0, 0, 0, 0.14);
  border-radius: var(--radius-sm);
  background: transparent;
  font: inherit;
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--duration-fast) ease, background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.calendar-day-col:hover .calendar-empty-add,
.calendar-empty-add:focus-visible { opacity: 1; }
.calendar-empty-add:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }

/* Mês: número do dia + "+" na mesma linha */
.calendar-month-cell-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.calendar-month-cell .calendar-add-btn { width: 22px; height: 22px; border-radius: 6px; }

/* Nota de retenção + "Alterar nas configurações" */
.calendar-retention-note { flex-wrap: wrap; }
.calendar-note-link {
  padding: 2px 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-decoration: underline;
  text-decoration-color: var(--color-text-tertiary);
  text-underline-offset: 2px;
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.calendar-note-link:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }

/* Configuração destacada ao chegar por um atalho */
.settings-row.setting-highlight { animation: settingFlash 2.4s ease; border-radius: var(--radius-md); }
@keyframes settingFlash {
  0%, 45% { background: var(--color-bg-active); box-shadow: inset 0 0 0 1.5px var(--color-text-strong); }
  100% { background: transparent; box-shadow: inset 0 0 0 1.5px transparent; }
}

/* ---------------- Modal do dia ----------------
   Número do dia como marca d'água + resumo numa faixa só (com barra de progresso) +
   tarefas como cartões finos com a prioridade numa barra à esquerda. */
.day-modal-head { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.day-modal-date { position: relative; display: flex; align-items: center; min-width: 0; min-height: 64px; }

/* Número do dia: enorme, fino e esmaecido em gradiente, atrás do título
   (decorativo: a data por extenso está no subtítulo) */
.day-modal-num {
  position: absolute;
  left: -6px;
  top: 50%;
  translate: 0 -50%;
  z-index: 0;
  font-size: 6.6rem;
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.07em;
  font-variant-numeric: tabular-nums;
  /* o fundo só pinta dentro da caixa, e com line-height 0.8 e letter-spacing negativo os
     algarismos saem dela (cortavam no topo e à direita): a folga aumenta a caixa (em cima e
     embaixo o translate -50% já a centra; à esquerda a margem negativa a desconta).
     As paradas em em ficam onde estavam (5% e 92% da altura de 0.8em, mais a folga). */
  padding: 0.15em 0.12em 0.15em 0.06em;
  margin-left: -0.06em;
  background: linear-gradient(180deg, var(--color-text-strong) 0.19em, transparent 0.886em);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  opacity: 0.09;
  pointer-events: none;
  user-select: none;
}
.day-modal-num.is-today { opacity: 0.16; }
:root[data-theme="dark"] .day-modal-num { opacity: 0.13; }
:root[data-theme="dark"] .day-modal-num.is-today { opacity: 0.22; }

/* o título fica por cima, a começar a meio do número */
.day-modal-date-text { position: relative; z-index: 1; min-width: 0; padding-left: 56px; }
.day-modal-date h3 { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.day-modal-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 5px;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}
.day-modal-rel {
  padding: 1px 8px;
  border-radius: var(--radius-full);
  background: var(--color-bg-active);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-primary);
}
.day-modal.is-today .day-modal-rel { background: var(--color-text-strong); color: var(--color-text-inverted); }
.day-modal-rest { margin: 0; }

.day-modal-close {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--color-text-tertiary);
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.day-modal-close:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }

/* Resumo: 4 números numa faixa com divisores, progresso por baixo */
.day-modal-summary {
  margin-top: 20px;
  border: var(--border-subtle);
  border-radius: 14px;
  background: var(--color-bg-subtle);
  overflow: hidden;
}
.day-modal-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.day-modal-stats > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 12px 14px; }
.day-modal-stats > div + div { border-left: var(--border-subtle); }
.day-modal-stats b {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.day-modal-stats span {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}
.day-modal-progress { height: 3px; background: var(--color-bg-active); }
.day-modal-progress span {
  display: block;
  height: 100%;
  border-radius: 0 3px 3px 0;
  background: var(--color-text-strong);
  transition: width 0.5s var(--ease-fluent);
}

.day-modal-section { margin-top: 20px; }
.day-modal-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}
.day-modal-section-title span {
  min-width: 18px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--color-bg-active);
  font-size: 0.66rem;
  letter-spacing: 0;
  text-align: center;
  color: var(--color-text-secondary);
}

/* Tarefas: cartões finos; a barra à esquerda é a prioridade */
.day-modal-tasks { display: flex; flex-direction: column; gap: 5px; max-height: 300px; overflow-y: auto; margin: 0 -4px; padding: 2px 4px; }
.day-modal-task {
  --prio: rgba(0, 0, 0, 0.14);
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 10px 3px 16px;
  border: var(--border-subtle);
  border-radius: 12px;
  background: var(--color-bg-surface-elevated);
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease, background var(--duration-fast) ease;
}
.day-modal-task::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 3px;
  background: var(--prio);
}
.day-modal-task.priority-alta { --prio: #111111; }
.day-modal-task.priority-media { --prio: rgba(0, 0, 0, 0.4); }
.day-modal-task:hover { border-color: rgba(0, 0, 0, 0.14); box-shadow: var(--shadow-subtle); }
.day-modal-task.is-running { border-color: var(--color-text-strong); }
.day-modal-task.completed { background: transparent; }
.day-modal-task.completed::before { opacity: 0.35; }
.day-modal-check { margin: 0; }
.day-modal-task-main {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
  padding: 8px 0;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.day-modal-task-time { flex: none; width: 40px; font-size: 0.8rem; font-weight: 600; color: var(--color-text-secondary); font-variant-numeric: tabular-nums; }
.day-modal-task-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.day-modal-task-title { font-size: 0.9rem; font-weight: 500; overflow-wrap: anywhere; }
.day-modal-task-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 2px; font-size: 0.72rem; color: var(--color-text-tertiary); }
.day-modal-task-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.day-modal-proj-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; }
.day-modal-task.completed .day-modal-task-title { text-decoration: line-through; color: var(--color-text-tertiary); }
.day-modal-task.completed .day-modal-task-time { color: var(--color-text-tertiary); }
.day-modal-running {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px 2px 7px;
  border-radius: var(--radius-full);
  background: var(--color-text-strong);
  color: var(--color-text-inverted);
  font-size: 0.66rem;
  font-weight: 600;
}
.day-modal-running::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: dayRunningBlink 1.6s ease-in-out infinite;
}
@keyframes dayRunningBlink { 50% { opacity: 0.3; } }
.day-modal-task-go {
  flex: none;
  display: grid;
  color: var(--color-text-tertiary);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--duration-fast) ease, transform var(--duration-fast) var(--ease-fluent);
}
.day-modal-task:hover .day-modal-task-go,
.day-modal-task-main:focus-visible .day-modal-task-go { opacity: 1; transform: none; }

.day-modal-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 12px;
  border: 1px dashed rgba(0, 0, 0, 0.14);
  border-radius: 14px;
  font-size: 0.85rem;
  text-align: center;
  color: var(--color-text-tertiary);
}

.day-modal-blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.day-modal-blocks .calendar-block-chip { align-items: center; margin: 0; padding: 8px 10px; border-radius: 8px; font-size: 0.78rem; }

.day-modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: var(--border-subtle);
}
.day-modal-actions .fluent-btn { display: inline-flex; align-items: center; gap: 6px; }
.day-modal-rest-toggle { margin-left: auto; }
@media (max-width: 560px) {
  .day-modal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .day-modal-stats > div:nth-child(3) { border-left: none; }
  .day-modal-stats > div:nth-child(n + 3) { border-top: var(--border-subtle); }
}

:root[data-theme="dark"] .day-modal-task { --prio: rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.04); }
:root[data-theme="dark"] .day-modal-task.priority-alta { --prio: #ffffff; }
:root[data-theme="dark"] .day-modal-task.priority-media { --prio: rgba(255, 255, 255, 0.45); }
:root[data-theme="dark"] .day-modal-task:hover { border-color: rgba(255, 255, 255, 0.16); }
:root[data-theme="dark"] .day-modal-task.completed { background: transparent; }
:root[data-theme="dark"] .day-modal-empty { border-color: rgba(255, 255, 255, 0.14); }

@media (prefers-reduced-motion: reduce) {
  .day-modal-running::before { animation: none; }
}

/* Mês: grade de 7 colunas */
.calendar-month {
  border: var(--surface-card-border, var(--border-subtle));
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-card-bg, rgba(255, 255, 255, 0.85));
}
.calendar-month-head {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: var(--border-subtle);
}
.calendar-month-head span {
  padding: 8px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}
.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: minmax(108px, auto);
}
.calendar-month-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 6px 6px 8px;
  border-right: var(--border-subtle);
  border-bottom: var(--border-subtle);
}
.calendar-month-cell:nth-child(7n) { border-right: none; }
.calendar-month-cell.rest { background: repeating-linear-gradient(135deg, rgba(58, 63, 92, 0.035) 0 8px, transparent 8px 16px); }
.calendar-month-cell.outside > * { opacity: 0.4; }
.calendar-month-daynum {
  align-self: flex-start;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.calendar-month-daynum:hover:not(:disabled) { background: var(--color-bg-hover); color: var(--color-text-primary); }
.calendar-month-daynum:disabled { cursor: default; }
.calendar-month-cell.today .calendar-month-daynum { background: var(--color-text-strong); color: var(--color-text-inverted); }
.calendar-month-chip {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--color-bg-subtle);
  font-size: 0.74rem;
  line-height: 1.3;
  cursor: pointer;
  transition: background var(--duration-fast) ease;
}
.calendar-month-chip:hover { background: var(--color-bg-active); }
.calendar-month-chip-time { flex: none; font-size: 0.68rem; font-weight: 600; color: var(--color-text-tertiary); font-variant-numeric: tabular-nums; }
.calendar-month-chip-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-month-chip.completed .calendar-month-chip-title { text-decoration: line-through; color: var(--color-text-tertiary); }
.calendar-month-more {
  align-self: flex-start;
  border: none;
  background: transparent;
  padding: 1px 6px;
  border-radius: 5px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
}
.calendar-month-more:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }
.calendar-retention-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
}

/* "Sair do OIOM?" — tarefa em andamento */
.quit-confirm-task {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
}
.quit-confirm-task .text-subtle { font-size: 0.78rem; margin-top: 2px; }
.quit-confirm-pulse {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-text-strong);
  animation: quitPulse 1.6s ease-in-out infinite;
}
@keyframes quitPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.25); }
  50% { box-shadow: 0 0 0 6px rgba(0, 0, 0, 0); }
}
.quit-confirm .modal-options-stack .fluent-btn { justify-content: center; }
@media (prefers-reduced-motion: reduce) { .quit-confirm-pulse { animation: none; } }

/* --------------------------------------------------------------------------
   16. MODAIS FLUENT (WINDOWS 11 DIALOGS)
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  /* A caixa fica sempre inteira na janela: folga que encolhe com a altura e,
     se o conteúdo não couber, rola por dentro da caixa (ver .modal-box) */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(12px, 6vh, 64px) 16px;
  z-index: 3000;
  animation: modalOverlayFadeIn 0.2s var(--ease-fluent);
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal-overlay.closing {
  animation: modalOverlayFadeOut 0.18s var(--ease-fluent) forwards;
}

.modal-box {
  background: var(--surface-card-bg, rgba(255, 255, 255, 0.95));
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: auto;
  width: 70%;
  height:fit-content;
  max-width: 100%;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: var(--shadow-elevated);
  animation: modalBoxPopIn 0.26s var(--ease-fluent);
}

/* Larguras: sm = confirmações curtas · md = formulários/detalhes · padrão = tarefa */
.modal-box.modal-sm { width: min(440px, calc(100vw - 32px)); padding: 22px; }
.modal-box.modal-md { width: min(600px, calc(100vw - 32px)); }
.modal-box.modal-lg { width: min(1040px, calc(100vw - 32px)); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Histórico de alterações (janela): cabeçalho com ícone · busca + filtros · seções por dia · linhas
   (hora | ícone colorido | título | o que mudou | Desfazer · Ver detalhes). Cores: tokens --tag-* */
.history-modal { display: flex; flex-direction: column; gap: 20px; min-height: 0; }
.history-head { display: flex; align-items: flex-start; gap: 16px; }
.history-head-icon {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
  color: var(--color-text-strong); background: var(--color-bg-subtle); border: var(--border-subtle);
}
.history-head-text { flex: 1; min-width: 0; padding-top: 2px; }
.history-head h3 { margin: 0 0 4px; font-size: 1.3rem; font-weight: 650; letter-spacing: -0.01em; color: var(--color-text-strong); }
.history-sub { margin: 0; font-size: 0.86rem; line-height: 1.5; color: var(--color-text-tertiary); }
.history-close {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px;
  background: var(--color-bg-subtle); color: var(--color-text-secondary); cursor: pointer;
}
.history-close:hover { background: var(--color-bg-hover); color: var(--color-text-strong); }
.history-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.history-search-wrap {
  flex: 1 1 260px; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 40px;
  border: var(--border-subtle); border-radius: 12px; background: var(--color-bg-subtle); color: var(--color-text-tertiary);
}
.history-search-wrap:focus-within { border-color: transparent; box-shadow: 0 0 0 2px var(--input-ring-focus); }
.history-search { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font: inherit; font-size: 0.88rem; color: var(--color-text-primary); }
.history-search::placeholder { color: var(--color-text-tertiary); }
.history-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.history-filter {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border: var(--border-subtle); border-radius: 12px;
  background: transparent; color: var(--color-text-secondary); font: inherit; font-size: 0.84rem; cursor: pointer; white-space: nowrap;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.history-filter:hover { background: var(--color-bg-hover); color: var(--color-text-strong); }
.history-filter.is-on { background: var(--color-bg-subtle); color: var(--color-text-strong); box-shadow: inset 0 0 0 1.5px var(--color-text-secondary); }
.history-filter:focus-visible, .history-close:focus-visible, .hl-btn:focus-visible, .hl-link:focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: 2px; }
.history-body { display: flex; flex-direction: column; gap: 14px; max-height: min(58vh, 560px); overflow: auto; margin: 0 -4px; padding: 0 4px 2px; }
/* um dia */
.hl-day { border: var(--border-subtle); border-radius: 16px; background: var(--color-bg-subtle); overflow: hidden; flex: none; }
.hl-day-head { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: var(--border-subtle); color: var(--color-text-tertiary); font-size: 0.84rem; }
.hl-day-head b { color: var(--color-text-strong); font-size: 0.95rem; font-weight: 600; }
.hl-list { list-style: none; margin: 0; padding: 4px 0; }
.hl-row + .hl-row { border-top: var(--border-subtle); }
.hl-row { margin: 0 14px; }
.hl-main { display: grid; grid-template-columns: 48px 34px minmax(170px, 0.9fr) minmax(0, 2fr) auto; align-items: center; gap: 14px; padding: 12px 4px; }
.hl-time { position: relative; color: var(--color-text-tertiary); font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.hl-time::after { content: ''; position: absolute; right: -8px; top: 50%; width: 1px; height: 18px; transform: translateY(-50%); background: var(--color-text-tertiary); opacity: 0.3; }
.hl-icon { --tone: var(--tag-gray); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--tone); background: color-mix(in srgb, var(--tone) 16%, transparent); }
.hl-icon.tone-green { --tone: var(--tag-green); } .hl-icon.tone-teal { --tone: var(--tag-teal); } .hl-icon.tone-red { --tone: var(--tag-red); }
.hl-icon.tone-blue { --tone: var(--tag-blue); } .hl-icon.tone-purple { --tone: var(--tag-purple); } .hl-icon.tone-orange { --tone: var(--tag-orange); }
.hl-icon.tone-yellow { --tone: var(--tag-yellow); }
.hl-icon.tone-gray { --tone: var(--color-text-secondary); }
.hl-title { font-weight: 600; color: var(--color-text-strong); font-size: 0.92rem; }
.hl-what { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hl-line { color: var(--color-text-primary); font-size: 0.88rem; line-height: 1.6; overflow-wrap: anywhere; }
.hl-name { color: var(--color-text-strong); }
.hl-sep { margin: 0 2px; color: var(--color-text-tertiary); }
.hl-ago { color: var(--color-text-tertiary); font-size: 0.76rem; }
.hl-pill { display: inline-block; padding: 1px 9px; margin: 0 2px; border-radius: 999px; font-size: 0.8rem; line-height: 1.55; color: var(--color-text-secondary); background: color-mix(in srgb, var(--color-text-secondary) 14%, transparent); }
.hl-pill.is-new { color: var(--tag-blue); background: color-mix(in srgb, var(--tag-blue) 16%, transparent); }
.hl-actions { display: flex; gap: 8px; justify-content: flex-end; }
.hl-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border: var(--border-subtle); border-radius: 10px;
  background: transparent; color: var(--color-text-primary); font: inherit; font-size: 0.82rem; cursor: pointer; white-space: nowrap;
}
.hl-btn:hover { background: var(--color-bg-hover); color: var(--color-text-strong); }
.hl-more svg { transition: transform var(--duration-fast) ease; }
.hl-more[aria-expanded="true"] svg { transform: rotate(90deg); }
.hl-badge { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; color: var(--color-text-tertiary); background: color-mix(in srgb, var(--color-text-tertiary) 14%, transparent); }
.hl-row.is-reverted .hl-title, .hl-row.is-reverted .hl-line { color: var(--color-text-tertiary); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--color-text-tertiary) 60%, transparent); }
/* detalhes: campo a campo */
.hl-details { margin: 0 0 12px calc(48px + 34px + 28px); padding: 6px 0; border-left: 2px solid color-mix(in srgb, var(--color-text-tertiary) 25%, transparent); overflow: hidden; }
/* animações (renderHistoryModal): entrada em cascata ao abrir/filtrar; a linha nova entra no topo
   com um realce; a acabada de desfazer risca-se aos poucos e o selo "Desfeita" aparece */
.history-body.is-entering .hl-row { animation: hlRowIn 0.34s var(--ease-fluent) backwards; animation-delay: calc(var(--i, 0) * 24ms); }
.history-body.is-entering .hl-day-head { animation: hlRowIn 0.3s var(--ease-fluent) backwards; }
@keyframes hlRowIn { from { opacity: 0; transform: translate3d(0, 6px, 0); } }
.hl-row { border-radius: 10px; }
.hl-row.is-fresh { animation: hlRowFresh 1.6s var(--ease-fluent) both; }
@keyframes hlRowFresh {
  0% { opacity: 0; transform: translate3d(0, -8px, 0); background: color-mix(in srgb, var(--tag-blue, #2f80ed) 16%, transparent); }
  18% { opacity: 1; transform: none; background: color-mix(in srgb, var(--tag-blue, #2f80ed) 16%, transparent); }
  100% { background: transparent; }
}
.hl-row.is-just-reverted .hl-title, .hl-row.is-just-reverted .hl-line { animation: hlStrike 0.5s ease-out backwards; }
@keyframes hlStrike { from { color: var(--color-text-primary); text-decoration-color: transparent; } }
.hl-row.is-just-reverted .hl-badge { animation: hlBadgeIn 0.3s var(--ease-fluent) 0.25s backwards; }
@keyframes hlBadgeIn { from { opacity: 0; transform: scale(0.85); } }
.hl-change { display: grid; grid-template-columns: 18px minmax(110px, auto) minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 6px 4px 6px 14px; font-size: 0.82rem; }
.hl-change-icon { color: var(--color-text-tertiary); display: inline-flex; }
.hl-change-title { color: var(--color-text-secondary); font-weight: 500; }
.hl-change-what { color: var(--color-text-primary); overflow-wrap: anywhere; }
.hl-change-time { color: var(--color-text-tertiary); font-variant-numeric: tabular-nums; font-size: 0.76rem; }
.hl-change.is-reverted .hl-change-what { color: var(--color-text-tertiary); text-decoration: line-through; }
.hl-link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 6px; border-radius: 8px; color: var(--tag-blue); font: inherit; font-size: 0.8rem; cursor: pointer; white-space: nowrap; }
.hl-link:hover { background: color-mix(in srgb, var(--tag-blue) 12%, transparent); }
.hl-details-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 4px 2px 8px; color: var(--color-text-tertiary); font-size: 0.76rem; }
.history-modal .history-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 16px; margin: 0; border: 1px dashed color-mix(in srgb, var(--color-text-tertiary) 35%, transparent); border-radius: 16px; color: var(--color-text-tertiary); text-align: center; font-size: 0.86rem; }
.history-modal .history-empty p { margin: 0; }
.history-modal .history-redo-note { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0 4px; color: var(--color-text-tertiary); font-size: 0.8rem; }
@media (prefers-reduced-motion: reduce) {
  .history-filter, .hl-more svg { transition: none; }
  .history-body.is-entering .hl-row, .history-body.is-entering .hl-day-head, .hl-row.is-fresh,
  .hl-row.is-just-reverted .hl-title, .hl-row.is-just-reverted .hl-line, .hl-row.is-just-reverted .hl-badge { animation: none; }
}
/* janela estreita: a linha empilha (hora + ícone + título em cima; o resto embaixo) */
@media (max-width: 760px) {
  .hl-main { grid-template-columns: 42px 30px 1fr; gap: 10px; }
  .hl-what, .hl-actions { grid-column: 3 / -1; }
  .hl-actions { justify-content: flex-start; }
  .hl-details { margin-left: 12px; }
  .hl-change { grid-template-columns: 18px 1fr auto; }
  .hl-change-what { grid-column: 2 / -1; }
}


/* Modais de formulário (.modal-sheet, ver modalSheetHead no script.js): cabeçalho (título e
   abas) e rodapé (Cancelar / Salvar) ficam sempre à vista; só o corpo rola */
.modal-box:has(> .modal-sheet) { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.modal-sheet { display: flex; flex-direction: column; min-height: 0; }
.modal-sheet-head { flex: none; display: flex; flex-direction: column; gap: 14px; padding: 20px 24px 14px; }
.modal-sheet-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-sheet-title { margin: 0; font-size: 1.15rem; font-weight: 600; color: var(--color-text-strong); }
.modal-sheet-sub { margin: -8px 0 0; font-size: 0.8rem; color: var(--color-text-secondary); }
.modal-sheet-body { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 24px 20px; }
.modal-sheet-body.modal-form-grid,
.modal-tab-panel.modal-form-grid { margin-top: 0; }
.modal-sheet-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 24px;
  border-top: var(--border-subtle);
}
.modal-sheet-actions { display: flex; gap: 8px; }
.modal-sheet-foot .fluent-btn { display: inline-flex; align-items: center; gap: 6px; }
/* tarefa: o corpo não muda de altura a cada aba */
.task-modal .modal-sheet-body { min-height: min(340px, 50vh); }

/* Abas do modal (a "navbar" das seções): controle segmentado, como a faixa da semana do Perfil */
.modal-tabs {
  align-self: flex-start;
  display: flex;
  gap: 2px;
  max-width: 100%;
  padding: 3px;
  overflow-x: auto;
  scrollbar-width: none;
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
}
.modal-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.modal-tab:hover { color: var(--color-text-primary); }
.modal-tab.active {
  color: var(--color-text-primary);
  background: var(--color-bg-surface);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.modal-tab:focus-visible { outline: 2px solid var(--color-text-strong); outline-offset: -2px; }
.modal-tab-badge {
  min-width: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--color-bg-active);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.modal-tab-panel[hidden] { display: none; }
.modal-tab-panel { animation: modalTabIn var(--duration-normal) var(--ease-fluent); }
@keyframes modalTabIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .modal-tab-panel { animation: none; } }

/* categoria recolhida no modal: as linhas ficam [hidden] (o display:flex delas venceria) */
.checklist-builder-row[hidden],
#modal-checklist-container > .checklist-cat-add[hidden] { display: none; }

.modal-overlay.closing .modal-box {
  animation: modalBoxPopOut 0.18s var(--ease-fluent) forwards;
}

@keyframes modalOverlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalOverlayFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes modalBoxPopIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modalBoxPopOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
}

.modal-form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.modal-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.grid-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.checklist-builder-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.modal-options-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

/* "Mover para…": onde está agora → quando (atalhos + data/hora) → projeto → prévia → Mover */
.move-modal { display: flex; flex-direction: column; gap: 16px; }
.move-head { display: flex; justify-content: space-between; align-items: center; }
.move-head h3 { font-size: 1.1rem; font-weight: 600; margin: 0; }
.move-task { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--color-bg-subtle); }
.move-task-title { font-weight: 600; color: var(--color-text-strong); overflow-wrap: anywhere; }
.move-now { font-size: 0.8rem; color: var(--color-text-tertiary); }
.move-section { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.move-label { display: inline-flex; align-items: center; gap: 6px; padding: 0; margin-bottom: 8px;   /* a legenda não entra no gap do fieldset */
  font-size: 0.78rem; font-weight: 600; color: var(--color-text-secondary); }
.move-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.move-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; white-space: nowrap;
  border: var(--border-subtle); border-radius: 999px; background: transparent;
  color: var(--color-text-primary); font: inherit; font-size: 0.8rem; cursor: pointer;
  transition: background var(--duration-fast, 0.15s) ease, color var(--duration-fast, 0.15s) ease;
}
.move-chip:hover { background: var(--color-bg-hover); }
.move-chip.is-on { background: var(--color-text-strong); border-color: transparent; color: var(--color-bg-base); }
.move-chip:focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: 2px; }
.move-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.move-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 0.75rem; color: var(--color-text-tertiary); }
.move-fields input:disabled { opacity: 0.45; }
.move-preview { display: flex; flex-direction: column; gap: 6px; min-height: 20px; font-size: 0.85rem; color: var(--color-text-secondary); }
.move-preview-text { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.move-preview-text b { color: var(--color-text-strong); font-weight: 600; }
.move-preview.is-problem { color: var(--tag-red); }
.move-warnings { display: flex; flex-wrap: wrap; gap: 6px; }
.move-warning { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; color: var(--tag-orange); background: color-mix(in srgb, var(--tag-orange) 12%, transparent); }
.move-actions { display: flex; justify-content: flex-end; gap: 8px; }
.move-actions .fluent-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .move-chip { transition: none; } }

/* --------------------------------------------------------------------------
   17. NOTIFICAÇÕES TOAST DO SISTEMA
   -------------------------------------------------------------------------- */
/* Mesma superfície dos menus (vidro do tema, borda e sombra suaves): conversa com o app nos
   dois modos e nos temas (tokens --surface-menu-bg, --border-glass, --shadow-dropdown).
   [ícone] texto  Ação  Outra  ✕  — e uma barrinha no fundo com o tempo que falta (pára com o rato). */
.fluent-toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 9px 12px 9px 14px;
  overflow: hidden;
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--color-text-primary);
  background: var(--surface-menu-bg, rgba(255, 255, 255, 0.94));
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: var(--border-glass);
  border-radius: var(--radius-toast, 12px);
  box-shadow: var(--shadow-dropdown);
  transform: translateX(-50%) translateY(10px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  z-index: 4000;
  transition: opacity 0.2s ease, transform 0.32s var(--ease-fluent);
}

.fluent-toast.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* Toast com ação (ex.: "Desfazer"): precisa receber cliques */
.fluent-toast.active.has-action { pointer-events: auto; }

.toast-icon { display: inline-grid; place-items: center; flex: none; color: var(--color-text-secondary); }
.toast-msg { min-width: 0; overflow-wrap: anywhere; }

.toast-action-btn {
  flex: none;
  padding: 5px 10px;
  border: none;
  border-radius: 8px;
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--duration-fast) ease;
}
.toast-action-btn:first-of-type { margin-left: 6px; }
.toast-action-btn:hover { background: var(--color-bg-active); }
.toast-action-btn.is-secondary { background: transparent; color: var(--color-text-secondary); }
.toast-action-btn.is-secondary:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }

.toast-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: -4px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--color-text-tertiary);
  cursor: pointer;
}
.toast-close:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }

.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--color-text-primary);
  opacity: 0.18;
  transform-origin: left;
  animation: toastCountdown linear forwards;
}
.fluent-toast:hover .toast-progress { animation-play-state: paused; }
@keyframes toastCountdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  .fluent-toast { transition: opacity 0.2s ease; }
  .toast-progress { display: none; }
}

/* --------------------------------------------------------------------------
   18. RESPONSIVIDADE E ACESSIBILIDADE
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
  .app-shell {
    flex-direction: column;
  }

  .fluent-sidebar ~ .fluent-main,
  .fluent-sidebar.collapsed ~ .fluent-main {
    margin-left: 0;
    height: auto;
    min-height: 0;
  }

  .view-container {
    padding: 16px 14px 28px;
    margin: -16px -14px 0;
    --scroll-fade-top: 16px;
    --scroll-fade-bottom: 22px;
  }

  .fluent-sidebar,
  .fluent-sidebar.collapsed {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    padding: 8px 12px;
    border-right: none;
    border-bottom: var(--border-subtle);
  }

  .brand,
  .sidebar-footer {
    display: none;
  }

  .nav-menu {
    flex-direction: row;
    width: 100%;
  }

  .nav-item {
    width: auto;
    padding: 7px 12px;
  }

  .fluent-main {
    padding: 16px 14px 0;
  }

  .layout-split {
    grid-template-columns: 1fr;
  }

  .universal-command-dock {
    left: 14px;
    right: 14px;
    bottom: 12px;
  }

  .universal-command-popover {
    width: 100%;
    max-height: min(420px, calc(100vh - 140px));
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* [hidden] precisa vencer o display:flex do menu de contexto */
.fluent-context-menu[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   SOBRE O OIOM (marca) & ZONA DE PERIGO (reset de fábrica)
   -------------------------------------------------------------------------- */
.about-udo {
  display: flex;
  align-items: center;
  gap: 18px;
}

.about-udo-logo {
  width: 60px;
  height: 60px;
  flex: none;
  object-fit: contain;
  padding: 8px;
  border-radius: var(--radius-md, 12px);
  background: #ffffff;
  border: var(--border-subtle);
  -webkit-user-drag: none;
}

.about-udo-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.about-udo-meta {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

/* Indicador discreto de atualizações (ver renderUpdateIndicator) */
.about-udo-update {
  font-size: 0.76rem;
  color: var(--color-text-tertiary);
  margin-top: 4px;
}
/* procurando / baixando / instalando: o anel antes do texto (renderUpdateIndicator) */
.about-udo-update > .ld-ring { width: 12px; height: 12px; margin: -2px 6px 0 0; }

.about-udo-update.update-available,
.about-udo-update.update-ready {
  color: var(--color-text-primary);
  font-weight: 600;
}

/* link "Licenças de terceiros" e o modal com o texto (showLicensesModal) */
.about-udo-link {
  display: inline-block;
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 0.76rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.about-udo-link:hover, .about-udo-link:focus-visible { color: var(--color-text-primary); }
.licenses-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.licenses-head h3 { font-size: 1.15rem; font-weight: 600; }
.licenses-intro { margin-top: 6px; font-size: 0.85rem; }
.licenses-text {
  margin-top: 12px;
  max-height: min(60vh, 560px);
  overflow: auto;
  padding: 12px 14px;
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
  color: var(--color-text-secondary);
  font: 0.74rem/1.55 'Cascadia Mono', Consolas, ui-monospace, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Relatório de erro (showErrorReportModal): campos, prévia exata do envio e ações */
.report-field { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; font-size: 0.85rem; font-weight: 500; }
.report-field .text-subtle { font-weight: 400; }
.report-field small { font-size: 0.74rem; }
.report-field textarea { resize: none; width: 100%; }
.report-preview { margin-top: 0; max-height: min(32vh, 260px); }
.report-status { min-height: 1.25em; margin-top: 8px; font-size: 0.8rem; color: var(--color-text-secondary); }
.report-status.is-error { color: #b3261e; font-weight: 500; }
:root[data-theme="dark"] .report-status.is-error { color: #f2a59f; }
.report-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.report-actions .fluent-btn:disabled { opacity: 0.45; cursor: default; pointer-events: none; }
.report-sent { margin-top: 10px; }
.report-recovery-note { margin-top: 8px; font-size: 0.82rem; }
.report-path { font-family: 'Cascadia Mono', Consolas, ui-monospace, monospace; font-size: 0.76rem; overflow-wrap: anywhere; }
.report-id { font-family: 'Cascadia Mono', Consolas, ui-monospace, monospace; }

.fluent-btn-danger {
  background: #b3261e;
  border-color: #b3261e;
  color: #ffffff;
}

.fluent-btn-danger:hover {
  background: #9a1f18;
  border-color: #9a1f18;
}

.fluent-btn-danger-outline {
  color: #b3261e;
  border-color: rgba(179, 38, 30, 0.45);
  background: rgba(179, 38, 30, 0.04);
}

.fluent-btn-danger-outline:hover {
  background: rgba(179, 38, 30, 0.1);
}

/* --------------------------------------------------------------------------
   LOADING (componente base). O HTML vem de UdoCore (loadingRing, loadingDots,
   loadingBar, busyLabel, busySwap). Sem cor própria: currentColor e tokens, então
   vale em claro, escuro e nos temas. Com "reduzir movimento", nada gira nem anda (só
   um fade lento); com a janela oculta (html.is-doc-hidden, do boot.js), tudo pára.
   -------------------------------------------------------------------------- */
.ld { display: inline-block; flex: none; vertical-align: middle; }
/* anel fino (14px): botões */
.ld-ring {
  width: 14px; height: 14px; box-sizing: border-box; border-radius: 50%;
  border: 1.5px solid currentColor; border-right-color: transparent; opacity: 0.85;
  animation: ld-spin 0.8s linear infinite;
}
@keyframes ld-spin { to { transform: rotate(360deg); } }
/* três pontos (4px): junto de um texto de estado */
.ld-dots { display: inline-flex; align-items: center; gap: 3px; height: 1em; margin-left: 5px; }
.ld-dots > i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.25; animation: ld-dot 1.2s ease-in-out infinite; }
.ld-dots > i:nth-child(2) { animation-delay: 0.15s; }
.ld-dots > i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ld-dot { 30% { opacity: 0.9; } }
/* barra indeterminada (2px): a borda de cima de um cartão ou de uma lista (que precisam
   de position: relative e overflow: hidden, a classe .is-busy-region) */
.ld-bar { position: absolute; top: 0; left: 0; right: 0; height: 2px; overflow: hidden; background: var(--color-bg-subtle); pointer-events: none; z-index: 1; }
.ld-bar::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 35%; border-radius: 2px; background: var(--color-text-tertiary); animation: ld-bar 1.4s ease-in-out -0.5s infinite; }
@keyframes ld-bar { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
.is-busy-region { position: relative; overflow: hidden; }
/* botão ocupado (busyLabel): o rótulo fica, invisível, e segura a largura; o anel vai por
   cima, no centro. O leitor de tela ouve o texto do estado (.ld-sr). */
.fluent-btn.is-busy { position: relative; pointer-events: none; }
.fluent-btn.is-busy > .ld-label { opacity: 0; }
.fluent-btn.is-busy > .ld-ring { position: absolute; top: 50%; left: 50%; margin: -7px 0 0 -7px; }
/* botão discreto (busySwap): os dois rótulos na mesma célula, a largura é a do maior;
   ocupado, aparece o anel com "Verificando…" */
.ld-swap { display: inline-grid; }
.ld-swap > span { grid-area: 1 / 1; justify-self: center; display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-sm); }
.ld-swap > [hidden] { display: inline-flex; visibility: hidden; }
/* a largura reservada não aparece: o contorno do foco envolve só o rótulo visível, e o hover
   muda só a cor do texto (um fundo pintaria o espaço vazio; o :root vence o glass.css) */
.fluent-btn:has(> .ld-swap):focus-visible { outline: none; }
.fluent-btn:has(> .ld-swap):focus-visible > .ld-swap > span:not([hidden]) { outline: 2px solid var(--color-text-primary); outline-offset: 4px; }
:root[data-theme="dark"] .fluent-btn:has(> .ld-swap):focus-visible > .ld-swap > span:not([hidden]) { outline-color: #ffffff; }
:root .fluent-btn.fluent-btn-subtle:has(> .ld-swap):hover { background-color: transparent; }
/* só para leitor de tela */
.ld-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@keyframes ld-fade { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) {
  .ld-ring, .ld-dots > i, .ld-bar::before { animation: ld-fade 2s ease-in-out infinite; }
  .ld-dots > i { opacity: 0.5; }
  .ld-bar::before { width: 100%; transform: none; }
}
/* Janela oculta ou minimizada (is-doc-hidden: boot.js; is-window-idle: script.js, também
   com o aviso do Rust): nenhuma animação corre (loadings, pulsos, o Notch noturno, o glass) */
html:is(.is-doc-hidden, .is-window-idle) :is(*, *::before, *::after) { animation-play-state: paused !important; }

.reset-list {
  margin: 10px 0 4px 18px;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.reset-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ==========================================================================
   SIDEBAR DARK — estilo Windows 11 (Mica escuro) + indicador animado
   ========================================================================== */
.fluent-sidebar {
  --sb-text: #f4f4f5;
  --sb-text-2: rgba(255, 255, 255, 0.66);
  --sb-text-3: rgba(255, 255, 255, 0.42);
  --sb-hover: rgba(255, 255, 255, 0.07);
  --sb-active: rgba(255, 255, 255, 0.11);
  --sb-border: rgba(255, 255, 255, 0.08);
  --sb-accent: #ffffff;
  background: var(--sidebar-bg,
    linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, #252528 0%, #1b1b1d 100%));
  backdrop-filter: blur(32px) saturate(160%);
  -webkit-backdrop-filter: blur(32px) saturate(160%);
  color: var(--sb-text);
  border-right: var(--sidebar-border, 1px solid var(--sb-border));
  box-shadow: var(--sidebar-shadow, 1px 0 0 rgba(0, 0, 0, 0.35), 6px 0 24px rgba(0, 0, 0, 0.12));
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.fluent-sidebar ::selection { background: rgba(255, 255, 255, 0.25); }

.fluent-sidebar .brand-name { color: var(--sb-text); }

.fluent-sidebar .brand-logo { filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.35)); }

/* --- navegação: ícones maiores ------------------------------------------ */
.fluent-sidebar .nav-menu {
  position: relative;          /* referência do indicador */
  gap: 4px;
}

.fluent-sidebar .nav-item {
  gap: 14px;
  padding: 8px 10px;
  font-size: 0.93rem;
  color: var(--sb-text-2);
  border-radius: 10px;
  z-index: 1;
}

.fluent-sidebar .nav-item:hover {
  background: var(--nav-hover-bg, var(--sb-hover));
  color: var(--sb-text);
}

.fluent-sidebar .nav-item.active {
  background: var(--surface-selected-bg, var(--sb-active));
  border: var(--surface-selected-border, none);
  color: #ffffff;
  font-weight: 600;
}

.fluent-sidebar .nav-icon {
  position: relative;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 1.2rem;
}

/* Atualização baixada à espera (updateDotMarkup): ponto no canto do ícone das
   Configurações. Fica no ícone para aparecer também com a barra recolhida. */
.nav-update-dot {
  position: absolute;
  top: 0;
  right: -1px;
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--sb-accent, var(--color-text-primary));
  pointer-events: none;
}

.fluent-sidebar .nav-svg {
  width: 22px;
  height: 22px;
  display: block;
  transition: transform var(--duration-normal) var(--ease-fluent);
}

.fluent-sidebar .nav-badge {
  background: #ffffff;
  color: #151517;
}

/* --- indicador de seleção (desliza com direção: ver positionNavIndicator) -- */
.nav-indicator {
  position: absolute;
  left: 0;
  top: 0;
  width: 3.5px;
  height: 22px;
  border-radius: 3px;
  background: var(--sb-accent, #ffffff);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.295);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  /* a posição e o "esticar" vêm por transform (translateY + scaleY), sem layout */
  transform-origin: 0 0;
}

@media (prefers-reduced-motion: reduce) {
  .nav-indicator { transition: transform 0.01s; }
}

/* --- resto da sidebar ---------------------------------------------------- */

.fluent-sidebar .btn-sidebar-toggle { color: var(--sb-text-2); }
.fluent-sidebar .btn-sidebar-toggle:hover { background: var(--sb-hover); color: #ffffff; }

/* ==========================================================================
   SIDEBAR NO TEMA CLARO — branca e sólida, com os mesmos tokens (--sb-*)
   O tema escuro continua a usar o Mica escuro acima.
   ========================================================================== */
:root[data-theme="light"] .fluent-sidebar {
  --sb-text: #111111;
  --sb-text-2: rgba(0, 0, 0, 0.62);
  --sb-text-3: rgba(0, 0, 0, 0.42);
  --sb-hover: rgba(0, 0, 0, 0.045);
  --sb-active: rgba(0, 0, 0, 0.07);
  --sb-border: rgba(0, 0, 0, 0.08);
  --sb-accent: #111111;
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 1px 0 0 rgba(0, 0, 0, 0.04), 4px 0 18px rgba(0, 0, 0, 0.03);
  scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}

:root[data-theme="light"] .fluent-sidebar ::selection { background: rgba(0, 0, 0, 0.12); }

/* Logotipo branco (LOGOTIPO_WHITE) → preto sobre o branco; o ícone (WHITEBORDER) já é preto */
:root[data-theme="light"] .fluent-sidebar .brand-logo { filter: none; }

:root[data-theme="light"] .fluent-sidebar .nav-item.active { color: #111111; }

:root[data-theme="light"] .fluent-sidebar .nav-badge { background: #111111; color: #ffffff; }

:root[data-theme="light"] .fluent-sidebar .btn-sidebar-toggle:hover { color: #111111; }

:root[data-theme="light"] .nav-indicator { box-shadow: none; }

/* ==========================================================================
   CHIPS DE DIAS DA SEMANA, BLOCOS RECORRENTES E DIAS DE DESCANSO
   ========================================================================== */
.day-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.day-chip {
  min-width: 38px;
  padding: 5px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-fluent), color var(--duration-fast) var(--ease-fluent), border-color var(--duration-fast) var(--ease-fluent), transform var(--duration-fast) var(--ease-fluent);
}

.day-chip:hover { background: var(--color-bg-hover); }
.day-chip:active { transform: scale(0.94); }
.day-chip.active { background: #111111; border-color: #111111; color: #ffffff; }
.day-chip.rest.active { background: #3a3f5c; border-color: #3a3f5c; }
.day-chip:disabled { opacity: 0.4; cursor: not-allowed; }

.block-allday {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  margin-left: 6px;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.ai-rest-warning {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(58, 63, 92, 0.1);
  border: 1px solid rgba(58, 63, 92, 0.28);
  color: #2f3453;
  font-size: 0.8rem;
  line-height: 1.45;
}

.ai-rest-warning[hidden] { display: none; }

/* Rotinas que se sobrepõem: aviso discreto (Perfil e modal da rotina) */
.overlap-warning-list { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; }
.overlap-warning-list[hidden] { display: none; }
.overlap-warning-list .overlap-warning { margin-top: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.overlap-warning-text { flex: 1 1 220px; }
.overlap-warning-actions { display: flex; gap: 12px; }

/* Agenda semanal */
.calendar-day-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
}

.btn-rest-toggle {
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-full);
  width: 28px;
  height: 28px;
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity var(--duration-fast) ease, background var(--duration-fast) ease;
}

.btn-rest-toggle:hover { opacity: 0.8; background: var(--color-bg-hover); }
.btn-rest-toggle.active { opacity: 1; background: rgba(58, 63, 92, 0.14); }

.calendar-day-col.rest { background: repeating-linear-gradient(135deg, rgba(58, 63, 92, 0.045) 0 8px, transparent 8px 16px); }

.calendar-rest-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(58, 63, 92, 0.14);
  color: #2f3453;
  font-size: 0.68rem;
  font-weight: 600;
}

.calendar-block-chip {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--chip-color, #444);
  background: rgba(0, 0, 0, 0.045);
  font-size: 0.72rem;
  font-weight: 500;
}
.calendar-block-chip { align-items: center; }
.calendar-block-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Rotina pulada neste dia: esmaecida, nome riscado, rótulo "pulado" + Restaurar */
.calendar-block-chip.is-skipped {
  flex-wrap: wrap;              /* coluna estreita: nome em cima, "pulado · Restaurar" em baixo */
  row-gap: 2px;
  border-left-style: dashed;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--color-bg-active);
}
.calendar-block-chip.is-skipped .calendar-block-name {
  flex: 1 0 100%;
  opacity: 0.5;
  text-decoration: line-through;
  text-decoration-color: var(--color-text-tertiary);
}
.calendar-block-skipped {
  flex: none;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}
.calendar-block-restore {
  flex: none;
  margin-left: auto;
  padding: 1px 6px;
  border: none;
  border-radius: 5px;
  background: transparent;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.calendar-block-restore:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }

/* Chat: cartão "Mover para…" (rollover) */
.move-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.move-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--color-bg-subtle);
  transition: opacity var(--duration-fast) ease;
}
.move-item.is-off { opacity: 0.55; }
.move-item:not(.is-off) .checklist-box { background: #111; border-color: #111; color: #fff; }
.move-item:not(.is-off) .checklist-check { stroke-dashoffset: 0; opacity: 1; }
.move-check { margin-top: 1px; }
.move-item-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.move-item-title { font-size: 0.86rem; font-weight: 500; overflow-wrap: anywhere; }
.move-item-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: 0.72rem; color: var(--color-text-tertiary); font-variant-numeric: tabular-nums; }
.move-badge {
  padding: 0 7px;
  border-radius: var(--radius-full);
  border: var(--border-subtle);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}
.move-badge.is-warn { border-style: dashed; border-color: rgba(0, 0, 0, 0.3); color: var(--color-text-primary); }
:root[data-theme="dark"] .move-item:not(.is-off) .checklist-box { background: #fff; border-color: #fff; color: #111; }
:root[data-theme="dark"] .move-badge.is-warn { border-color: rgba(255, 255, 255, 0.35); }

/* Aviso ao abrir: pendências de dias anteriores (1x por dia) */
.rollover-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 18px;
  padding: 12px 14px 12px 16px;
  border: var(--border-subtle);
  border-radius: 14px;
  background: var(--color-bg-surface);
  box-shadow: var(--shadow-subtle);
  animation: chatMsgIn 0.32s var(--ease-fluent) both;
}
.rollover-banner-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--color-bg-active); flex: none; }
.rollover-banner-text { flex: 1; min-width: 200px; font-size: 0.88rem; }
.rollover-banner-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.rollover-banner-actions .fluent-btn { padding: 6px 12px; font-size: 0.8rem; }

/* Histórico: mover as pendentes em lote */
.history-batch { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; padding: 10px 14px 0; font-size: 0.76rem; }
.history-batch .fluent-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: 0.78rem; }

/* Chat: escolher a rotina a pular / Desfazer */
.ai-skip-choices { flex-wrap: wrap; }
.skip-confirm-title { display: flex; align-items: center; gap: 6px; margin: 4px 0 8px; font-weight: 600; }
.ai-undo-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: 0.78rem; }

/* Cartão composto (vários comandos numa frase) e férias */
.compound-card .move-item-title { display: inline-flex; align-items: center; gap: 6px; }
.compound-card .move-item-title svg { flex: none; opacity: 0.7; }
.compound-note { margin: 0 0 8px; font-size: 0.78rem; }
.vacation-custom {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  margin-top: 10px;
}
.vacation-custom label { display: grid; gap: 4px; font-size: 0.74rem; color: var(--color-text-secondary); }
.vacation-custom .fluent-input { width: 160px; max-width: 100%; }

/* "não entendi direito": discreto, só ganha força ao passar o rato */
.chat-feedback {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 2px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.7rem;
  color: var(--color-text-tertiary);
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.chat-msg:hover .chat-feedback,
.chat-msg:focus-within .chat-feedback,
.chat-feedback:focus-visible { opacity: 1; }
.chat-feedback:hover { color: var(--color-text-primary); text-decoration: underline; }
.chat-feedback.is-sent { cursor: default; opacity: 0.8; text-decoration: none; }
.chat-feedback.is-sent:hover { color: var(--color-text-tertiary); }

.settings-row-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
.settings-row-warning {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.76rem;
  font-weight: 500;
  color: #8a5a00;
}
.settings-row-warning svg { flex: none; }

/* Configurações → atalhos globais: combinação gravada + Gravar atalho + Restaurar padrão */
.shortcut-field { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.shortcut-field .fluent-btn { padding: 6px 12px; }
.shortcut-keys {
  min-width: 132px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  box-shadow: inset 0 0 0 1px var(--input-ring);
  color: var(--color-text-primary);
  font: 600 0.8rem/1.3 var(--font-main);
  text-align: center;
  white-space: nowrap;
}
.shortcut-field.is-recording .shortcut-keys { box-shadow: inset 0 0 0 2px var(--input-ring-focus); color: var(--color-text-secondary); }
.shortcut-msg { margin-top: 6px; font-size: 0.76rem; color: var(--color-text-secondary); }
.shortcut-msg:empty { display: none; }
.shortcut-msg.is-error { color: #b3261e; font-weight: 500; }
:root[data-theme="dark"] .shortcut-msg.is-error { color: #f2a59f; }
/* Atalho em uso por outro programa: a combinação fica riscada, com um contorno de aviso */
.shortcut-field.has-conflict .shortcut-keys {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #b3261e 55%, transparent);
  color: var(--color-text-tertiary);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, #b3261e 70%, transparent);
}
:root[data-theme="dark"] .shortcut-field.has-conflict .shortcut-keys {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #f2a59f 55%, transparent);
  text-decoration-color: #f2a59f;
}

/* Importar dados: confirmação */
.import-confirm { display: grid; gap: 12px; }
.import-confirm-title { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; font-weight: 600; }
.import-confirm-summary {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: var(--border-subtle);
  background: var(--input-bg);
  font-size: 0.9rem;
}
.import-confirm .text-subtle { font-size: 0.82rem; line-height: 1.5; }
:root[data-theme="dark"] .settings-row-warning { color: #f0c46b; }

/* ==========================================================================
   ONBOARDING
   ========================================================================== */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(1200px 700px at 20% 10%, rgba(255, 255, 255, 0.08), transparent 60%), rgba(12, 12, 14, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: onbOverlayIn 260ms var(--ease-fluent) both;
}

.onboarding-overlay[hidden] { display: none; }
.onboarding-overlay.closing { animation: onbOverlayOut 200ms ease both; }
/* ao começar: o fundo clareia enquanto o cartão encolhe até ao "Primeiros passos" (morphOnboardingIntoTour) */
.onboarding-overlay.is-morphing { background-image: none; pointer-events: none; animation: onbBackdropOut 460ms ease forwards; }
/* a folha que vai do cartão das boas-vindas até ao "Primeiros passos" (o JS anima caixa, cantos, cor e sombra) */
.onb-ghost {
  position: fixed;
  z-index: 1001;              /* acima do .onboarding-overlay */
  box-sizing: border-box;
  overflow: hidden;
  pointer-events: none;
  will-change: left, top, width, height;
}
.onb-ghost-content { flex: none; }
@keyframes onbBackdropOut {
  from { background-color: rgba(12, 12, 14, 0.78); backdrop-filter: blur(14px); }
  to { background-color: transparent; backdrop-filter: blur(0); }
}

/* Primeiros passos (renderTourFloat): guia flutuante no canto inferior direito, por cima de
   todas as telas. Vidro dos menus (conversa com o modo e os temas); fica acima da Barra
   Universal quando ela está em baixo. Minimizado vira uma pílula. */
.tour-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 700;
  width: min(330px, calc(100vw - 32px));
  padding: 14px 16px 12px;
  color: var(--color-text-primary);
  background: var(--surface-menu-bg, rgba(255, 255, 255, 0.94));
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: var(--border-glass);
  border-radius: 16px;
  box-shadow: var(--shadow-dropdown);
  animation: tourFloatIn 360ms var(--ease-fluent) both;
}
body:has(.dock-pos-bottom) .tour-float { bottom: 88px; }
:root[data-theme="dark"] .tour-float { background: var(--surface-menu-bg, rgba(38, 38, 42, 0.97)); }
@keyframes tourFloatIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }

.tour-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour-kicker { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-tertiary); }
.tour-head-btns { display: flex; gap: 2px; margin-right: -6px; }
.tour-icon-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.tour-icon-btn:hover:not(:disabled) { background: var(--color-bg-hover); color: var(--color-text-primary); }
.tour-icon-btn:disabled { opacity: 0.3; cursor: default; }

.tour-dots { display: flex; gap: 4px; margin: 10px 0 12px; }
.tour-dots > span { flex: 1; height: 3px; border-radius: 3px; background: var(--color-bg-active); transition: background 0.3s ease; }
.tour-dots > span.is-done { background: color-mix(in srgb, var(--color-text-primary) 45%, transparent); }
.tour-dots > span.is-current { background: var(--color-text-primary); }

.tour-body { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 4px; align-items: start; }
.tour-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}
.tour-icon.is-done,
.tour-icon.is-finish { background: var(--color-text-primary); color: var(--color-bg-surface); animation: tourCheckIn 360ms var(--ease-fluent) both; }
.tour-title { margin: 0; font-size: 0.95rem; font-weight: 700; line-height: 1.3; }
.tour-text { margin: 0; font-size: 0.83rem; line-height: 1.5; color: var(--color-text-secondary); }
.tour-text b { color: var(--color-text-primary); font-weight: 600; }
.tour-text kbd {
  display: inline-block;
  padding: 0 5px;
  font: 600 0.74rem/1.5 var(--font-family, inherit);
  color: var(--color-text-primary);
  background: var(--color-bg-hover);
  border: 1px solid var(--color-bg-active);
  border-radius: 5px;
  white-space: nowrap;
}
.tour-done-pill {
  display: inline-block;
  margin-left: 4px;
  vertical-align: 2px;
  padding: 1px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  color: var(--color-text-secondary);
  background: var(--color-bg-hover);
}

.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }
.tour-foot-main { display: flex; gap: 6px; margin-left: auto; }
.tour-foot .fluent-btn { padding: 6px 14px; font-size: 0.8rem; }
.tour-back { margin-left: -6px; }

/* Ao lado do item do passo (placeTourFloat): posição por left/top, que desliza entre os
   passos; a setinha (::before) aponta para o item (data-side = lado do guia em relação a ele) */
.tour-float.is-placed,
body:has(.dock-pos-bottom) .tour-float.is-placed { right: auto; bottom: auto; }
.tour-float.is-placed { transition: left 0.45s var(--ease-fluent), top 0.45s var(--ease-fluent); }
.tour-float.is-tracking { transition: none; }
.tour-float::before {
  content: '';
  display: none;
  position: absolute;
  width: 12px;
  height: 12px;
  background: inherit;
  border: inherit;
  transform: rotate(45deg);
}
.tour-float[data-side="right"]::before { display: block; left: -7px; top: calc(var(--tour-arrow, 24px) - 6px); border-top: 0; border-right: 0; }
.tour-float[data-side="left"]::before { display: block; right: -7px; top: calc(var(--tour-arrow, 24px) - 6px); border-bottom: 0; border-left: 0; }
.tour-float[data-side="below"]::before { display: block; top: -7px; left: calc(var(--tour-arrow, 24px) - 6px); border-bottom: 0; border-right: 0; }
.tour-float[data-side="above"]::before { display: block; bottom: -7px; left: calc(var(--tour-arrow, 24px) - 6px); border-top: 0; border-left: 0; }

/* Holofote (placeTourRing): anel sobre o item do passo, com o resto da janela levemente
   escurecido (a sombra enorme do próprio anel). Não pega cliques. Desliza entre os itens; com
   o foco dentro do item (a escrever na barra, no Chat…) o escuro some e fica só o anel. */
.tour-ring {
  --tour-dim: rgba(18, 18, 24, 0.16);
  --tour-ring-color: var(--color-text-primary);
  position: fixed;
  z-index: 650;
  pointer-events: none;
  opacity: 0;
  box-shadow:
    0 0 0 2px var(--tour-ring-color),
    0 0 0 6px color-mix(in srgb, var(--tour-ring-color) 12%, transparent),
    0 0 0 200vmax var(--tour-dim);
  transition: left 0.45s var(--ease-fluent), top 0.45s var(--ease-fluent), width 0.45s var(--ease-fluent),
    height 0.45s var(--ease-fluent), border-radius 0.45s var(--ease-fluent), opacity 0.3s ease, box-shadow 0.3s ease;
}
:root[data-theme="dark"] .tour-ring { --tour-dim: rgba(0, 0, 0, 0.42); }
.tour-ring.is-on { opacity: 1; }
.tour-ring.is-quiet { --tour-dim: transparent; }
.tour-ring.is-tracking { transition: opacity 0.3s ease; }
/* a onda que sai do anel, de tempos a tempos */
.tour-ring::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 2px solid var(--tour-ring-color);
  opacity: 0;
  animation: tourRingWave 2.2s cubic-bezier(0.2, 0.7, 0.3, 1) infinite;
}
@keyframes tourRingWave {
  0% { inset: -2px; opacity: 0.5; }
  70%, 100% { inset: -14px; opacity: 0; }
}
.tour-grip { font-weight: 700; letter-spacing: -1px; color: var(--color-text-primary); }

/* Botões do guia: "Pular" é só texto; "Ir até lá" é uma pílula discreta */
.tour-link {
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-tertiary);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.tour-link:hover { color: var(--color-text-primary); background: var(--color-bg-hover); }
/* fim do guia: "Apagar exemplos" é um botão de verdade (antes era um link quase escondido) */
.tour-samples-note { grid-column: 2; margin-top: 6px; color: var(--color-text-tertiary); }   /* na coluna do texto (na do ícone, alargava-a e espremia o resto) */
.tour-foot .tour-clear-btn { display: inline-flex; align-items: center; gap: 6px; }
.tour-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.tour-go:hover { background: var(--color-bg-active); }
.tour-foot-main { align-items: center; }

/* Compacto: o item do passo está noutra tela; o guia encolhe para não tapar nada */
.tour-float.is-compact { width: min(290px, calc(100vw - 32px)); padding: 10px 12px 8px 14px; }
.tour-float.is-compact .tour-head { margin-bottom: 8px; }
.tour-float.is-compact .tour-body { align-items: center; row-gap: 1px; }
.tour-float.is-compact .tour-icon { width: 32px; height: 32px; border-radius: 10px; }
.tour-float.is-compact .tour-title { font-size: 0.88rem; }
.tour-float.is-compact .tour-text { font-size: 0.78rem; }
.tour-float.is-compact .tour-foot { margin-top: 8px; }

/* Passo feito: barrinha que enche até avançar sozinho */
.tour-advance-bar { display: block; height: 3px; margin-top: 12px; border-radius: 3px; background: var(--color-bg-active); overflow: hidden; }
.tour-advance-bar::after {
  content: '';
  display: block;
  height: 100%;
  background: var(--color-text-primary);
  transform-origin: left;
  animation: tourAdvance var(--tour-advance, 1600ms) linear forwards;
}
@keyframes tourAdvance { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* minimizado: só a pílula */
.tour-float.is-min { width: auto; padding: 0; border-radius: 999px; }
.tour-float.is-min::before { display: none; }
.tour-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.tour-pill b { font-weight: 700; color: var(--color-text-tertiary); }
.tour-pill:hover { background: var(--color-bg-hover); }

@keyframes tourCheckIn { from { transform: scale(0.6); } to { transform: none; } }

/* "Mostrar": o lugar do passo pulsa por um instante */
.tour-spot { animation: tourSpot 1.3s ease-out 2; border-radius: 10px; }
@keyframes tourSpot {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-text-primary) 45%, transparent); }
  100% { box-shadow: 0 0 0 12px transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .tour-spot { animation: none; outline: 2px solid var(--color-text-primary); outline-offset: 3px; }
  .tour-float, .tour-icon.is-done, .tour-icon.is-finish, .tour-ring::after { animation: none; }
  .tour-ring { transition: opacity 0.2s ease; }
  .tour-float.is-placed { transition: none; }
}

/* Boas-vindas: horário de sono (renderOnboarding) */
.onb-sleep { margin: 14px 0 0; padding: 12px 14px; border: 1px solid var(--color-bg-active); border-radius: 12px; min-width: 0; }
.onb-sleep-title { display: flex; align-items: center; gap: 6px; padding: 0 4px; margin-left: -4px; font-size: 0.82rem; font-weight: 600; color: var(--color-text-primary); }
.onb-sleep-fields { display: flex; gap: 10px; flex-wrap: wrap; }
.onb-sleep-field { flex: 1 1 120px; display: grid; gap: 4px; font-size: 0.76rem; color: var(--color-text-secondary); }
.onb-sleep-field .fluent-input { width: 100%; }
.onb-sleep-hint { margin: 8px 0 0; font-size: 0.74rem; line-height: 1.45; color: var(--color-text-tertiary); }

.onboarding-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 34px 34px 26px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.12);
  animation: onbCardIn 380ms var(--ease-fluent) both;
}

.onb-step { animation: onbStepIn 320ms var(--ease-fluent) both; }
.onb-logo { width: 54px; height: 54px; object-fit: contain; margin-bottom: 10px; }
.onb-kicker { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-tertiary); margin-bottom: 6px; }
.onb-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; margin-bottom: 8px; }
.onb-sub { font-size: 0.9rem; color: var(--color-text-secondary); line-height: 1.5; margin-bottom: 20px; }
.onb-input { width: 100%; font-size: 1.05rem; padding: 12px 14px; }
.onb-input.shake { animation: onbShake 360ms ease; }

.onb-chips { display: flex; gap: 8px; margin-bottom: 14px; }
.onb-chip {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0, 0, 0, 0.16);
  background: transparent;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.onb-chip.active { background: #111111; color: #ffffff; border-color: #111111; }

.onb-times { display: flex; gap: 14px; margin-bottom: 14px; transition: opacity var(--duration-fast) ease; }
.onb-times label { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; font-weight: 500; }
.onb-times .fluent-input { width: 120px; }
.onb-times.disabled, .onb-days.disabled { opacity: 0.4; }
.onb-days { margin-bottom: 14px; }
.onb-skip { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; color: var(--color-text-secondary); cursor: pointer; margin-bottom: 4px; }

.onb-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.onb-example { padding: 5px 12px; font-size: 0.78rem; font-weight: 500; }
.onb-preview { min-height: 64px; margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.onb-preview-label { font-size: 0.76rem; font-weight: 600; color: var(--color-text-tertiary); }
.onb-preview-task { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--color-bg-subtle); border: var(--border-subtle); font-size: 0.9rem; }

.onb-consent { margin-top: 16px; padding: 12px 14px; border-radius: 10px; border: var(--border-subtle); font-size: 0.82rem; color: var(--color-text-secondary); line-height: 1.45; }
.onb-consent-label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.onb-consent-label input { margin-top: 3px; flex: none; }
.onb-consent-label b { color: var(--color-text-primary); }
.onb-consent-details { margin-top: 8px; padding-left: 24px; }
.onb-consent-details summary { cursor: pointer; font-weight: 600; color: var(--color-text-primary); }
.onb-consent-details ul { margin: 6px 0 0 16px; display: flex; flex-direction: column; gap: 4px; }

.onb-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; gap: 12px; flex-wrap: wrap; }
.onb-dots { display: inline-flex; gap: 6px; }
.onb-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(0, 0, 0, 0.16); transition: width var(--duration-normal) var(--ease-fluent), background var(--duration-normal) ease; }
.onb-dot.active { width: 22px; border-radius: 6px; background: #111111; }
.onb-dot.done { background: #111111; }

@keyframes onbOverlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes onbOverlayOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes onbCardIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes onbStepIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes onbShake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

@media (prefers-reduced-motion: reduce) {
  .onboarding-overlay, .onboarding-card, .onb-step { animation: none; }
}

/* ==========================================================================
   TEMAS — Claro (padrão) e Escuro
   O tema vive em <html data-theme="light|dark"> (ver applyTheme no script.js).
   O tema claro é o design original; abaixo só se redefinem tokens e as cores
   que estavam fixas nas regras. O Notch e a sidebar já são escuros: não mudam.
   ========================================================================== */

/* Seletor de tema nas Configurações (controlo segmentado) */
.theme-segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--radius-full);
  background: var(--color-bg-subtle);
  border: var(--border-subtle);
  flex: none;
}

.theme-option { position: relative; }

.theme-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-option span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  user-select: none;
  transition: background var(--duration-fast) var(--ease-fluent), color var(--duration-fast) var(--ease-fluent), box-shadow var(--duration-fast) ease;
}

.theme-option span:hover { color: var(--color-text-primary); }

.theme-option input:checked + span {
  background: var(--surface-selected-bg, var(--color-bg-surface-elevated));
  border: var(--surface-selected-border, none);
  color: var(--color-text-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.theme-option input:focus-visible + span {
  outline: 2px solid var(--color-text-primary);
  outline-offset: 1px;
}

/* Posição da Barra Universal: mini-janela com a pílula no sítio escolhido */
.bar-pos-segmented .theme-option span.bar-pos-preview {
  position: relative;
  display: inline-block;
  flex: none;
  width: 22px;
  height: 15px;
  padding: 0;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  opacity: 0.55;
  box-shadow: none;
  background: transparent;
}
.bar-pos-segmented .theme-option span.bar-pos-preview::after {
  content: '';
  position: absolute;
  width: 9px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
}
.bar-pos-preview.pos-bottom::after { bottom: 2px; left: 50%; translate: -50% 0; }
.bar-pos-preview.pos-top::after { top: 2px; left: 50%; translate: -50% 0; }
.bar-pos-preview.pos-top-right::after { top: 2px; right: 2px; width: 7px; }
.theme-option input:checked + span .bar-pos-preview { opacity: 1; }

/* Configurações → Notch → Animação ao mudar de lugar: mini-tela em que o Notch vai do
   topo para a direita, do jeito de cada estilo. Anima a opção escolhida e a que está sob o rato. */
.notch-move-segmented .theme-option span.notch-move-preview {
  position: relative;
  display: inline-block;
  flex: none;
  width: 26px;
  height: 17px;
  padding: 0;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  opacity: 0.55;
  background: transparent;
  box-shadow: none;
}
.notch-move-preview i {
  position: absolute;
  left: 50%;
  top: 1px;
  width: 10px;
  height: 3px;
  margin-left: -5px;
  border-radius: 2px;
  background: currentColor;
}
.theme-option input:checked + span .notch-move-preview { opacity: 1; }
.theme-option input:checked + span .notch-move-preview.is-travel i,
.theme-option:hover .notch-move-preview.is-travel i { animation: notchPrevTravel 2.8s cubic-bezier(0.32, 0.72, 0, 1) infinite; }
.theme-option input:checked + span .notch-move-preview.is-fade i,
.theme-option:hover .notch-move-preview.is-fade i { animation: notchPrevFade 2.8s ease infinite; }
.theme-option input:checked + span .notch-move-preview.is-none i,
.theme-option:hover .notch-move-preview.is-none i { animation: notchPrevNone 2.8s steps(1, end) infinite; }
/* topo (10×3) → bolinha (3×3) → viaja → borda direita (3×9) → e volta */
@keyframes notchPrevTravel {
  0%, 12% { left: 50%; top: 1px; width: 10px; height: 3px; margin-left: -5px; margin-top: 0; }
  20% { left: 50%; top: 1px; width: 3px; height: 3px; margin-left: -1.5px; margin-top: 0; border-radius: 50%; }
  36% { left: calc(100% - 4px); top: 50%; width: 3px; height: 3px; margin-left: 0; margin-top: -1.5px; border-radius: 50%; }
  44%, 62% { left: calc(100% - 4px); top: 50%; width: 3px; height: 9px; margin-left: 0; margin-top: -4.5px; }
  70% { left: calc(100% - 4px); top: 50%; width: 3px; height: 3px; margin-left: 0; margin-top: -1.5px; border-radius: 50%; }
  86% { left: 50%; top: 1px; width: 3px; height: 3px; margin-left: -1.5px; margin-top: 0; border-radius: 50%; }
  94%, 100% { left: 50%; top: 1px; width: 10px; height: 3px; margin-left: -5px; margin-top: 0; }
}
@keyframes notchPrevFade {
  0%, 14% { opacity: 1; left: 50%; top: 1px; width: 10px; height: 3px; margin-left: -5px; margin-top: 0; }
  24% { opacity: 0; left: 50%; top: 1px; width: 10px; height: 3px; margin-left: -5px; margin-top: 0; }
  25% { opacity: 0; left: calc(100% - 4px); top: 50%; width: 3px; height: 9px; margin-left: 0; margin-top: -4.5px; }
  36%, 64% { opacity: 1; left: calc(100% - 4px); top: 50%; width: 3px; height: 9px; margin-left: 0; margin-top: -4.5px; }
  74% { opacity: 0; left: calc(100% - 4px); top: 50%; width: 3px; height: 9px; margin-left: 0; margin-top: -4.5px; }
  75% { opacity: 0; left: 50%; top: 1px; width: 10px; height: 3px; margin-left: -5px; margin-top: 0; }
  86%, 100% { opacity: 1; left: 50%; top: 1px; width: 10px; height: 3px; margin-left: -5px; margin-top: 0; }
}
@keyframes notchPrevNone {
  0% { left: 50%; top: 1px; width: 10px; height: 3px; margin-left: -5px; margin-top: 0; }
  40% { left: calc(100% - 4px); top: 50%; width: 3px; height: 9px; margin-left: 0; margin-top: -4.5px; }
  80% { left: 50%; top: 1px; width: 10px; height: 3px; margin-left: -5px; margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .notch-move-preview i { animation: none !important; }
  .desktop-notch-window-root.is-move-in .desktop-notch-container { animation: none !important; }
}

/* --------------------------------------------------------------------------
   Tema Escuro — tokens
   -------------------------------------------------------------------------- */
:root[data-theme="dark"] {
  color-scheme: dark;   /* scrollbars, seletores de data/hora e <select> nativos */

  --color-bg-base: #141416;
  --color-bg-surface: rgba(30, 30, 33, 0.82);
  --color-bg-surface-elevated: rgba(44, 44, 48, 0.96);
  --color-bg-subtle: rgba(255, 255, 255, 0.04);
  --color-bg-hover: rgba(255, 255, 255, 0.07);
  --color-bg-active: rgba(255, 255, 255, 0.11);

  --color-text-primary: #ececee;
  --color-text-secondary: #a3a3a8;
  --color-text-tertiary: #75757b;
  --color-text-inverted: #111111;
  --color-text-strong: #ffffff;
  --color-text-meta: #a3a3a8;
  --color-success: #6fbf73;
  --clock-track: #2b2b2f;

  --dock-input-bg: rgba(36, 36, 40, 0.78);
  --dock-input-bg-focus: rgba(40, 40, 44, 0.97);
  --dock-input-border: rgba(255, 255, 255, 0.08);
  --dock-input-border-focus: rgba(255, 255, 255, 0.2);
  --dock-input-shadow: 0 6px 22px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.3);
  --dock-input-shadow-focus: 0 10px 30px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  --glass-popover-bg: rgba(30, 30, 34, 0.7);
  --glass-popover-border: rgba(255, 255, 255, 0.1);
  --glass-popover-highlight: rgba(255, 255, 255, 0.06);

  /* (o escuro já tinha bom contraste: mantém o visual, sem contorno) */
  --input-bg: rgba(255, 255, 255, 0.05);
  --input-bg-hover: rgba(255, 255, 255, 0.08);
  --input-bg-focus: rgba(255, 255, 255, 0.08);
  --input-ring: transparent;
  --input-ring-focus: transparent;

  --border-subtle: 1px solid rgba(255, 255, 255, 0.08);
  --border-strong: 1px solid rgba(255, 255, 255, 0.22);
  --border-glass: 1px solid rgba(255, 255, 255, 0.09);
  --color-grid: rgba(255, 255, 255, 0.035);

  --shadow-subtle: 0 2px 6px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-card: 0 4px 14px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-dropdown: 0 10px 24px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-launcher: 0 24px 54px rgba(0, 0, 0, 0.55), 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* --------------------------------------------------------------------------
   Tema Escuro — cores que estavam fixas nas regras
   -------------------------------------------------------------------------- */
:root[data-theme="dark"],
:root[data-theme="dark"] body {
  background-color: var(--color-bg-base);
  background-image:
    radial-gradient(at 0% 0%, rgba(255, 255, 255, 0.04) 0px, transparent 65%),
    radial-gradient(at 100% 100%, rgba(0, 0, 0, 0.35) 0px, transparent 65%);
}

:root[data-theme="dark"] ::selection { background: rgba(255, 255, 255, 0.22); }
:root[data-theme="dark"] :focus-visible { outline-color: #ffffff; }

/* Títulos */
:root[data-theme="dark"] .header-left h1,
:root[data-theme="dark"] .agora-title,
:root[data-theme="dark"] .agora-timer,
:root[data-theme="dark"] .settings-card-title,
:root[data-theme="dark"] .settings-row-title,
:root[data-theme="dark"] .ai-action-card-header,
:root[data-theme="dark"] .launcher-ai-card-header { color: var(--color-text-primary); }

/* Cartões e superfícies sólidas */
:root[data-theme="dark"] .fluent-sheet:hover { border-color: rgba(255, 255, 255, 0.16); }
:root[data-theme="dark"] .agora-module { background-color: rgba(30, 30, 33, 0.88); }
:root[data-theme="dark"] .calendar-week-grid,
:root[data-theme="dark"] .calendar-month { background-color: rgba(28, 28, 31, 0.85); }
:root[data-theme="dark"] .calendar-month-cell.rest { background: repeating-linear-gradient(135deg, rgba(120, 130, 190, 0.06) 0 8px, transparent 8px 16px); }
:root[data-theme="dark"] .calendar-mode-toggle button.active { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
:root[data-theme="dark"] .calendar-event-card.priority-media { --prio: rgba(255, 255, 255, 0.32); }
:root[data-theme="dark"] .calendar-event-card.priority-baixa { --prio: rgba(255, 255, 255, 0.1); }
:root[data-theme="dark"] .calendar-event-card.completed .checklist-box,
:root[data-theme="dark"] .day-modal-task.completed .checklist-box { background: #ffffff; border-color: #ffffff; color: #111111; }
:root[data-theme="dark"] .calendar-event-check:hover .checklist-box,
:root[data-theme="dark"] .day-modal-check:hover .checklist-box { border-color: rgba(255, 255, 255, 0.7); }
:root[data-theme="dark"] .calendar-empty-add { border-color: rgba(255, 255, 255, 0.14); }
:root[data-theme="dark"] .quit-confirm-pulse { animation-name: quitPulseDark; }
@keyframes quitPulseDark {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
}
:root[data-theme="dark"] .calendar-event-card,
:root[data-theme="dark"] .launcher-ai-task-row { background: #222225; }
:root[data-theme="dark"] .calendar-block-chip { background: rgba(255, 255, 255, 0.05); }
:root[data-theme="dark"] .modal-box { background: var(--surface-card-bg, rgba(36, 36, 40, 0.97)); }
:root[data-theme="dark"] .modal-overlay { background: rgba(0, 0, 0, 0.55); }
:root[data-theme="dark"] .fluent-context-menu { background: var(--surface-menu-bg, rgba(38, 38, 42, 0.97)); }
:root[data-theme="dark"] .context-menu-item.danger { color: var(--menu-danger-color, #ff8a80); }
:root[data-theme="dark"] .context-menu-item.danger:hover,
:root[data-theme="dark"] .fluent-context-menu .context-menu-item.danger:focus { background: var(--menu-danger-hover-bg, rgba(255, 138, 128, 0.14)); color: var(--menu-danger-hover-color, #ff9c93); }
:root[data-theme="dark"] .context-menu-divider { background: rgba(255, 255, 255, 0.1); }

/* Cartão "Foco do Momento": caixa da tarefa em foco e checklist editável */
:root[data-theme="dark"] .checklist-item.checked .checklist-text { text-decoration-color: rgba(255, 255, 255, 0.35); }
:root[data-theme="dark"] .checklist-item:hover .checklist-box { border-color: rgba(255, 255, 255, 0.7); }
:root[data-theme="dark"] .fluent-toast { background: var(--surface-menu-bg, rgba(38, 38, 42, 0.97)); }

/* Listas de tarefas */
:root[data-theme="dark"] .task-row.current-active { background: rgba(255, 255, 255, 0.045); box-shadow: inset 3.5px 0 0 #ffffff; }
:root[data-theme="dark"] .btn-checkbox { background: transparent; border-color: rgba(255, 255, 255, 0.45); color: #fff; }
:root[data-theme="dark"] .btn-checkbox:hover { border-color: rgba(255, 255, 255, 0.75); }
:root[data-theme="dark"] .task-row.completed .btn-checkbox,
:root[data-theme="dark"] .btn-checkbox[aria-checked="true"] { background: #fff; color: #111; border-color: #fff; }
:root[data-theme="dark"] .checklist-box { background: transparent; border-color: rgba(255, 255, 255, 0.4); }
:root[data-theme="dark"] .checklist-item.checked .checklist-box,
:root[data-theme="dark"] .checklist-builder-row.is-done .checklist-box { background: #ffffff; border-color: #ffffff; color: #111111; }
:root[data-theme="dark"] .checklist-builder-box:hover .checklist-box { border-color: rgba(255, 255, 255, 0.7); }
:root[data-theme="dark"] .checklist-builder-row.is-dragging:not(.is-dropping),
:root[data-theme="dark"] .focus-checklist .checklist-item.is-dragging:not(.is-dropping) { box-shadow: 0 10px 24px rgba(0, 0, 0, 0.322); }
:root[data-theme="dark"] .priority-pill.priority-alta { background: #ffffff; color: #111111; }
:root[data-theme="dark"] .priority-pill.priority-media { background: #5c5c62; color: #ffffff; }
:root[data-theme="dark"] .priority-pill.priority-baixa { border-color: rgba(255, 255, 255, 0.25); color: #b4b4b9; }
:root[data-theme="dark"] .btn-row-action:hover { background: rgba(255, 255, 255, 0.08); color: #ffffff; }
:root[data-theme="dark"] .btn-icon-danger:hover { color: #ffffff; }
:root[data-theme="dark"] .project-color-dot,
:root[data-theme="dark"] .legend-swatch { border-color: rgba(255, 255, 255, 0.2); }

/* Botões */
:root[data-theme="dark"] .fluent-btn { background: rgba(255, 255, 255, 0.06); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
:root[data-theme="dark"] .fluent-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.22); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35); }
:root[data-theme="dark"] .fluent-btn-primary { background: #ffffff; color: #111111; border-color: #ffffff; }
:root[data-theme="dark"] .fluent-btn-primary:hover { background: #e4e4e7; border-color: #e4e4e7; }
:root[data-theme="dark"] .fluent-btn-subtle { background: transparent; border-color: transparent; box-shadow: none; }
:root[data-theme="dark"] .fluent-btn-subtle:hover { background: var(--color-bg-hover); border-color: transparent; box-shadow: none; }
:root[data-theme="dark"] .fluent-btn-danger { background: #c4372e; border-color: #c4372e; color: #ffffff; }
:root[data-theme="dark"] .fluent-btn-danger:hover { background: #d4463c; border-color: #d4463c; }
:root[data-theme="dark"] .fluent-btn-danger-outline { color: #ff8a80; border-color: rgba(255, 138, 128, 0.4); background: rgba(255, 138, 128, 0.06); }

/* Formulários */
:root[data-theme="dark"] .fluent-input,
:root[data-theme="dark"] input[type="text"],
:root[data-theme="dark"] input[type="password"],
:root[data-theme="dark"] input[type="time"],
:root[data-theme="dark"] input[type="date"],
:root[data-theme="dark"] input[type="number"],
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  background: rgba(255, 255, 255, 0.05);
  border-bottom-color: rgba(255, 255, 255, 0.4);
}

@supports (appearance: base-select) {
  :root[data-theme="dark"] select:hover { background: rgba(255, 255, 255, 0.08); }
}

:root[data-theme="dark"] .fluent-input:focus,
:root[data-theme="dark"] input[type="text"]:focus,
:root[data-theme="dark"] input[type="password"]:focus,
:root[data-theme="dark"] input[type="time"]:focus,
:root[data-theme="dark"] input[type="date"]:focus,
:root[data-theme="dark"] input[type="number"]:focus,
:root[data-theme="dark"] select:focus,
:root[data-theme="dark"] textarea:focus {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
/* Campos de texto dentro de um item da checklist (editar / novo item): transparentes —
   o destaque é da linha do item */
:root[data-theme="dark"] textarea.focus-subitem-edit,
:root[data-theme="dark"] textarea.focus-checklist-input,
:root[data-theme="dark"] textarea.focus-subitem-edit:focus,
:root[data-theme="dark"] textarea.focus-checklist-input:focus { background: transparent; box-shadow: none; }

:root[data-theme="dark"] .fluent-switch-slider { background-color: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.18); }
:root[data-theme="dark"] .fluent-switch input:checked + .fluent-switch-slider { background-color: #ffffff; border-color: #ffffff; }
:root[data-theme="dark"] .fluent-switch input:checked + .fluent-switch-slider:before { background-color: #111111; }
:root[data-theme="dark"] .fluent-range-slider { background: rgba(255, 255, 255, 0.15); }
:root[data-theme="dark"] .fluent-range-slider::-webkit-slider-thumb { background: #ffffff; }
:root[data-theme="dark"] .day-chip,
:root[data-theme="dark"] .onb-chip { border-color: rgba(255, 255, 255, 0.16); color: var(--color-text-secondary); }
:root[data-theme="dark"] .day-chip.active,
:root[data-theme="dark"] .onb-chip.active { background: #ffffff; border-color: #ffffff; color: #111111; }
:root[data-theme="dark"] .day-chip.rest.active { background: #5a6190; border-color: #5a6190; color: #ffffff; }
:root[data-theme="dark"] .theme-option input:checked + span { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); }

/* Dias de descanso (tom índigo) */
:root[data-theme="dark"] .ai-rest-warning { background: rgba(120, 130, 190, 0.12); border-color: rgba(120, 130, 190, 0.32); color: #c5c9e6; }
:root[data-theme="dark"] .calendar-rest-badge { background: rgba(120, 130, 190, 0.2); color: #c5c9e6; }
:root[data-theme="dark"] .btn-rest-toggle.active { background: rgba(120, 130, 190, 0.22); }
:root[data-theme="dark"] .calendar-day-col.rest { background: repeating-linear-gradient(135deg, rgba(120, 130, 190, 0.07) 0 8px, transparent 8px 16px); }

/* Chat da Inbox */
/* (o resto do chat escuro está junto do chat, na secção 8) */
:root[data-theme="dark"] .ai-task-preview-title,
:root[data-theme="dark"] .launcher-ai-task-title { border-bottom-color: rgba(255, 255, 255, 0.25); }
:root[data-theme="dark"] .ai-task-preview-title.is-static { border-bottom: none; }
:root[data-theme="dark"] .ai-chip-pill { background: rgba(255, 255, 255, 0.06); }

/* Barra Universal & popover */
:root[data-theme="dark"] .btn-clear-universal:hover { color: #ffffff; }
:root[data-theme="dark"] .universal-kbd-shortcut { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.12); }
:root[data-theme="dark"] .launcher-item:hover,
:root[data-theme="dark"] .launcher-item.selected { background: rgba(255, 255, 255, 0.07); color: #ffffff; }
:root[data-theme="dark"] .launcher-item:hover .launcher-icon,
:root[data-theme="dark"] .launcher-item.selected .launcher-icon { color: #ffffff; }
:root[data-theme="dark"] .launcher-badge { background: rgba(255, 255, 255, 0.06); }
:root[data-theme="dark"] .launcher-ai-card-wrapper { background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.1); }
:root[data-theme="dark"] .launcher-keyboard-hints { background: rgba(255, 255, 255, 0.02); }
:root[data-theme="dark"] .launcher-hint-item kbd { background: #26262a; border-color: rgba(255, 255, 255, 0.15); color: #c8c8cc; }

/* Relógio de 24h (SVG): CSS vence os atributos de apresentação */
:root[data-theme="dark"] .clock-svg-dial .clock-arc-slice { stroke: #1c1c1f; }
:root[data-theme="dark"] .clock-svg-dial > circle:first-of-type { stroke: var(--clock-track); }
:root[data-theme="dark"] .clock-svg-dial > circle:not(:first-of-type) { stroke: rgba(255, 255, 255, 0.12); }
:root[data-theme="dark"] .clock-svg-dial > line { stroke: #e6e6e9; }
:root[data-theme="dark"] .clock-svg-dial text[fill="#555555"] { fill: #a3a3a8; }
:root[data-theme="dark"] .clock-svg-dial text[fill="#111111"] { fill: #f2f2f2; }
:root[data-theme="dark"] .clock-svg-dial text[fill="#777777"] { fill: #8a8a90; }
:root[data-theme="dark"] .clock-needle line { stroke: #ffffff; }
:root[data-theme="dark"] .clock-needle circle { fill: #ffffff; }

/* Onboarding */
:root[data-theme="dark"] .onboarding-card { background: #1e1e21; }
:root[data-theme="dark"] .onb-logo { filter: invert(1); }
:root[data-theme="dark"] .onb-dot { background: rgba(255, 255, 255, 0.16); }
:root[data-theme="dark"] .onb-dot.active,
:root[data-theme="dark"] .onb-dot.done { background: #ffffff; }

/* ==========================================================================
   ÍCONES — pacote único (Lucide inline, ver ICON_PATHS no script.js)
   ========================================================================== */
.ui-ico {
  flex: none;
  display: inline-block;
  vertical-align: -0.2em;
}

/* botões só com ícone: centrar o SVG */
.btn-row-action,
.btn-icon-danger,
.btn-rest-toggle,
.toggle-icon {
  display: inline-grid;
  place-items: center;
}

.btn-clear-universal.visible { display: inline-grid; place-items: center; }
.universal-search-icon { display: grid; line-height: 0; }
.calendar-rest-badge { display: inline-flex; align-items: center; gap: 4px; }
.context-menu-item > span:first-child { display: inline-grid; place-items: center; width: 18px; }

/* ==========================================================================
   PERFIL — lista de rotinas + modais de rotina e preferências
   ========================================================================== */
.profile-routines-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-routines-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.profile-routines-head p { margin-top: 2px; }

.btn-icon-round {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: var(--border-subtle);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}

.btn-icon-round .ui-ico { transition: transform var(--duration-normal) var(--ease-fluent); }
.btn-icon-round:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }
.btn-icon-round:hover .ui-ico { transform: rotate(45deg); }

.profile-create-btn {
  width: 100%;
  padding: 11px 14px;
}

.routine-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* Perfil: "Tarefas que se repetem" por baixo das rotinas (formato 5) */
.routine-sub { margin: 18px 0 8px; font-size: 0.78rem; font-weight: 700; color: var(--color-text-secondary); }

.routine-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-item-bg, var(--color-bg-surface-elevated));
  color: var(--color-text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease,
              transform var(--duration-fast) var(--ease-fluent);
}

.routine-item:hover {
  border-color: rgba(0, 0, 0, 0.18);
  box-shadow: var(--shadow-subtle);
  transform: translateY(-1px);
}

.routine-item:active { transform: scale(0.99); }

.routine-color {
  width: 12px;
  height: 12px;
  flex: none;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.routine-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.routine-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.routine-badge {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--color-bg-subtle);
  border: var(--border-subtle);
  color: var(--color-text-tertiary);
}

.routine-summary {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.routine-chevron {
  color: var(--color-text-tertiary);
  transition: transform var(--duration-fast) var(--ease-fluent), color var(--duration-fast) ease;
}

.routine-item:hover .routine-chevron { transform: translateX(2px); color: var(--color-text-primary); }

/* ---------------- Perfil: página ---------------- */
.profile-page { display: flex; flex-direction: column; gap: 18px; width: 100%; }

/* Cabeçalho: nome + sono/descanso numa linha; Relatório e Preferências à direita */
.profile-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.profile-head-text { min-width: 0; }
.profile-name { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em; color: var(--color-text-strong); }
.profile-tagline { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; font-size: 0.84rem; color: var(--color-text-secondary); }
.profile-tagline > span { display: inline-flex; align-items: center; gap: 5px; }
.profile-tagline .ui-ico { color: var(--color-text-tertiary); }
.profile-head-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.profile-report-btn { display: inline-flex; align-items: center; gap: 6px; }
.profile-prefs-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; }

/* Duas colunas: o dia (relógio) · rotinas */
.profile-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: start;
}
.profile-card { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px; }
.profile-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.profile-card-head h3 { font-size: 1rem; font-weight: 600; }
.profile-card-head p { margin-top: 2px; font-size: 0.8rem; color: var(--color-text-tertiary); }
.profile-add-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; flex: none; }

/* Rotina (e tarefa que se repete), minimalista: uma lista só, sem caixa por item — linhas finas
   entre elas e o fundo só no hover. Ponto de cor · nome · a semana em letras (os dias dela acesos)
   · horário. A que vale no dia à vista tem o ponto cheio; as outras, esbatido. */
.profile-page .routine-list { gap: 0; }
.profile-page .routine-list > li + li .routine-item::before {
  content: '';
  position: absolute;
  left: 40px;
  right: 10px;
  top: 0;
  border-top: var(--border-subtle);
}
.profile-page .routine-item {
  position: relative;
  gap: 14px;
  padding: 11px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  transform: none;
  transition: background var(--duration-fast) ease;
}
.profile-page .routine-item:hover { background: var(--color-bg-hover); border: 0; box-shadow: none; transform: none; }
.profile-page .routine-item:hover::before, .profile-page .routine-list > li:hover + li .routine-item::before { border-top-color: transparent; }
.profile-page .routine-item:active { transform: none; background: var(--color-bg-subtle); }
.profile-page .routine-item:focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: -2px; }
.routine-dot {
  width: 16px;
  height: 16px;
  flex: none;
  display: grid;
  place-items: center;
}
.routine-dot:not(.has-icon)::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--routine-color); }
:root[data-theme="dark"] .routine-dot:not(.has-icon)::after { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28); }   /* as cores de fábrica são escuras */
.routine-dot.has-icon { color: var(--routine-color); }
:root[data-theme="dark"] .routine-dot.has-icon { color: color-mix(in srgb, var(--routine-color) 55%, var(--color-text-primary)); }
.profile-page .routine-item:not(.is-on-viewed) .routine-dot { opacity: 0.4; }
.profile-page .routine-name { font-size: 0.9rem; font-weight: 500; gap: 8px; }
.profile-page .routine-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.routine-meta { display: inline-flex; align-items: center; gap: 4px; font-size: 0.76rem; color: var(--color-text-tertiary); font-variant-numeric: tabular-nums; }
.routine-week { display: inline-flex; gap: 3px; flex: none; }
.routine-week i {
  width: 16px;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 600;
  text-align: center;
  color: var(--color-text-tertiary);
  opacity: 0.45;
}
.routine-week i.on { color: var(--color-text-primary); opacity: 1; }
.routine-time { flex: none; min-width: 84px; text-align: right; font-size: 0.82rem; color: var(--color-text-secondary); font-variant-numeric: tabular-nums; }
/* rotina encerrada ("terminou em"): apagada, mas continua lá para editar ou excluir */
.profile-page .routine-item.is-ended > :not(.routine-dot) { opacity: 0.5; }
.profile-page .routine-item.is-ended .routine-dot { opacity: 0.25; }
.profile-page .routine-item.is-ended .routine-name-text { text-decoration: line-through; text-decoration-color: var(--color-text-tertiary); }
/* janela estreita: some a semana em letras (fica no title), o horário fica */
@media (max-width: 760px) { .profile-page .routine-week { display: none; } }
/* modal da rotina: "Termina em (opcional)" */
.block-until { display: flex; flex-direction: column; gap: 4px; }
.block-until-hint { font-size: 0.76rem; }

/* "Ver detalhes do dia": a previsão completa fica recolhida */
.profile-details { border-top: var(--border-subtle); padding-top: 10px; }
.profile-details > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  border-radius: 8px;
  list-style: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  user-select: none;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.profile-details > summary::-webkit-details-marker { display: none; }
.profile-details > summary:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }
.profile-details > summary .ui-ico { transition: transform var(--duration-fast) var(--ease-fluent); }
.profile-details[open] > summary .ui-ico { transform: rotate(90deg); }
.profile-details[open] > .profile-forecast { margin-top: 10px; animation: checklist-row-in var(--duration-normal) var(--ease-fluent) backwards; }
/* Trocar de dia (selectProfileDate): a pílula ativa desliza, o resto faz crossfade */
.profile-day-btn.active { view-transition-name: profile-day; }
.profile-clock-card.is-day-switch .clock-svg-dial,
.profile-clock-card.is-day-switch .profile-forecast { animation: none; }
::view-transition { pointer-events: none; }
::view-transition-group(profile-day) { animation-duration: 260ms; animation-timing-function: var(--ease-fluent); }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 200ms; }

/* Relógio: seletor do dia (segmentado), mostrador e tempo por rotina */
.profile-day-picker {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
}
.profile-day-btn {
  position: relative;
  padding: 6px 0 8px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.profile-day-btn:hover { color: var(--color-text-primary); }
.profile-day-btn.active {
  background: var(--surface-selected-bg, var(--color-bg-surface-elevated));
  color: var(--color-text-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.profile-day-btn.is-rest { color: #4a5080; }
.profile-day-btn.is-today::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  translate: -50% 0;
  background: var(--color-text-strong);
}
/* Faixa da semana (seg–dom com datas): rola na horizontal na janela pequena */
.profile-week-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(44px, 1fr);
  gap: 2px;
  padding: 3px;
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
  overflow-x: auto;
  scrollbar-width: thin;
  max-width: 100%;
}
.profile-week-strip .profile-day-btn { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 2px 9px; min-width: 44px; }
.profile-day-name { font-size: 0.7rem; }
.profile-day-num { font-size: 0.92rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.profile-day-rest { display: inline-grid; place-items: center; line-height: 1; color: var(--night-ink, #4b5185); }
.profile-day-btn.is-past { opacity: 0.55; }
.profile-day-btn.is-past.active { opacity: 0.8; }
.profile-day-btn:focus-visible { outline: 2px solid var(--color-text-strong); outline-offset: -2px; }
.profile-readonly { font-size: 0.72rem; padding: 1px 6px; border-radius: var(--radius-full); background: var(--color-bg-subtle); }
.profile-forecast-empty { margin: 4px 0 0; font-size: 0.84rem; color: var(--color-text-secondary); text-align: center; }
.forecast-note { font-size: 0.72rem; color: var(--color-text-tertiary); }
.forecast-row.forecast-task .profile-breakdown-swatch { background: transparent; box-shadow: inset 0 0 0 1.5px var(--color-text-tertiary); border-radius: 50%; }
.forecast-row.is-done .profile-breakdown-name { text-decoration: line-through; color: var(--color-text-tertiary); }
.forecast-task-btn { font: inherit; text-align: left; }
.profile-clock-card .clock-container { padding: 0; }
.profile-clock-card .clock-svg-dial { max-width: 270px; margin: 4px auto; }
.profile-allday {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-subtle);
  font-size: 0.78rem;
  color: var(--color-text-secondary);
}
.profile-breakdown { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.profile-breakdown-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 5px 8px;
  font-size: 0.84rem;
}
.profile-breakdown-swatch { width: 10px; height: 10px; border-radius: 3px; }
.profile-breakdown-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.profile-breakdown-range { font-size: 0.74rem; color: var(--color-text-tertiary); font-variant-numeric: tabular-nums; }
.profile-breakdown-row b { min-width: 58px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.profile-breakdown-bar {
  grid-column: 2 / -1;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-bg-subtle);
  overflow: hidden;
}
.profile-breakdown-bar span { display: block; height: 100%; border-radius: inherit; }
.profile-breakdown-row.is-free { padding-top: 10px; border-top: var(--border-subtle); }
.profile-breakdown-row.is-free .profile-breakdown-swatch { background: var(--clock-track, #ebebeb); box-shadow: inset 0 0 0 1px var(--color-bg-active); }
.profile-breakdown-row.is-free .profile-breakdown-bar span { background: var(--color-text-tertiary); opacity: 0.45; }

@media (max-width: 1000px) {
  .profile-grid { grid-template-columns: 1fr; }
}

/* Relatório (janela): 4 números, barras das feitas por dia e frases úteis */
.profile-report { display: flex; flex-direction: column; gap: 18px; }
.profile-report-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.profile-report-head h3 { font-size: 1.15rem; font-weight: 600; color: var(--color-text-strong); }
.profile-report-sub { margin-top: 2px; font-size: 0.8rem; color: var(--color-text-tertiary); }
.report-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.report-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 12px 14px;
  border: var(--border-subtle);
  border-radius: 12px;
}
.report-tile-label { font-size: 0.74rem; color: var(--color-text-secondary); }
.report-tile-value { font-size: 1.25rem; font-weight: 600; color: var(--color-text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-tile-sub { font-size: 0.72rem; color: var(--color-text-tertiary); }
.report-chart { margin: 0; }
.report-chart figcaption { margin-bottom: 10px; font-size: 0.8rem; font-weight: 600; color: var(--color-text-secondary); }
.report-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.report-bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; cursor: default; }
/* barra: até 24px, topo arredondado (4px) e base reta, a crescer de uma linha de base fina */
.report-bar-track {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  height: 96px;
  border-bottom: 1px solid var(--color-bg-active);
}
.report-bar {
  width: min(24px, 70%);
  border-radius: 4px 4px 0 0;
  background: var(--color-text-tertiary);
  opacity: 0.55;
  transition: opacity var(--duration-fast) ease;
}
.report-bar-col:hover .report-bar { opacity: 0.85; }
.report-bar-col.is-today .report-bar { background: var(--color-text-primary); opacity: 1; }
.report-bar-value { margin-bottom: 4px; font-size: 0.74rem; font-weight: 600; color: var(--color-text-primary); font-variant-numeric: tabular-nums; }
.report-bar-day { font-size: 0.72rem; color: var(--color-text-tertiary); }
.report-bar-col.is-today .report-bar-day { color: var(--color-text-primary); font-weight: 600; }
.report-insights { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.report-insights li { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--color-text-secondary); }
.report-insights li .ui-ico { flex: none; color: var(--color-text-tertiary); }
.report-insights b { color: var(--color-text-primary); font-weight: 600; }
.report-link { margin-left: auto; font-size: 0.8rem; }
@media (max-width: 560px) {
  .report-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* campos dos modais */
.modal-field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.modal-form-grid .block-allday {
  flex-direction: row;
  align-items: center;
}

.modal-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

/* Barra Universal oculta nas abas administrativas (Perfil, Configurações) */
.universal-command-dock[hidden] { display: none !important; }

:root[data-theme="dark"] .routine-item:hover { border-color: rgba(255, 255, 255, 0.16); }
:root[data-theme="dark"] .routine-color { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22); }
:root[data-theme="dark"] .profile-page .routine-item .routine-color { box-shadow: none; }
:root[data-theme="dark"] .profile-day-btn.active { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); }
:root[data-theme="dark"] .profile-day-btn.is-rest { color: #a9aed8; }
:root[data-theme="dark"] .profile-day-rest { color: #a9aed8; }

/* ==========================================================================
   SONO — aviso ao agendar no descanso, chip 🌙 e Notch "Hora de desligar"
   Tom índigo discreto (o mesmo dos dias de descanso): a única cor fora do
   monocromático, reservada ao que é "noite".
   ========================================================================== */
:root {
  --night-ink: #4b5185;
  --night-soft: rgba(90, 97, 144, 0.1);
  --night-line: rgba(90, 97, 144, 0.26);
}

:root[data-theme="dark"] {
  --night-ink: #c5c9e6;
  --night-soft: rgba(120, 130, 190, 0.16);
  --night-line: rgba(120, 130, 190, 0.34);
}

.ai-chip-pill.ai-chip-sleep {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--night-soft);
  border: 1px solid var(--night-line);
  color: var(--night-ink);
}

/* Aviso "Horário de descanso" (modal) */
.sleep-guard {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6px 2px 0;
}

.sleep-guard-close {
  position: absolute;
  top: -6px;
  right: -6px;
}

.sleep-guard-orb {
  width: 54px;
  height: 54px;
  margin-bottom: 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--night-ink);
  background: radial-gradient(circle at 34% 28%, #ffffff 0%, #eceefa 58%, #dfe2f3 100%);
  box-shadow: 0 0 0 6px var(--night-soft), 0 10px 26px rgba(60, 66, 130, 0.16);
  animation: sleepOrbIn 0.5s var(--ease-fluent) both, sleepOrbBreath 4.8s ease-in-out 0.6s infinite;
}

@keyframes sleepOrbIn {
  from { opacity: 0; transform: translateY(6px) scale(0.86); }
  to { opacity: 1; transform: none; }
}

@keyframes sleepOrbBreath {
  0%, 100% { box-shadow: 0 0 0 6px var(--night-soft), 0 10px 26px rgba(60, 66, 130, 0.16); }
  50% { box-shadow: 0 0 0 11px rgba(90, 97, 144, 0.04), 0 10px 30px rgba(60, 66, 130, 0.22); }
}

.sleep-guard-title {
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sleep-guard-text {
  margin-top: 6px;
  max-width: 360px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.sleep-guard-list {
  list-style: none;
  width: 100%;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sleep-guard-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
  border: var(--border-subtle);
  font-size: 0.85rem;
  text-align: left;
}

.sleep-guard-item-title {
  min-width: 0;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sleep-guard-item-time {
  flex: none;
  font-weight: 500;
  color: var(--night-ink);
  font-variant-numeric: tabular-nums;
}

.sleep-guard-more,
.sleep-guard-window {
  margin-top: 10px;
  font-size: 0.76rem;
  color: var(--color-text-tertiary);
}

.sleep-guard-actions {
  width: 100%;
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sleep-guard-actions .fluent-btn {
  flex: 1 1 170px;
  justify-content: center;
}

:root[data-theme="dark"] .sleep-guard-orb {
  background: radial-gradient(circle at 34% 28%, #3a3e63 0%, #25283f 60%, #1b1d2e 100%);
  box-shadow: 0 0 0 6px var(--night-soft), 0 10px 26px rgba(0, 0, 0, 0.4);
}

/* --------------------------------------------------------------------------
   Notch · modo "Hora de desligar" (classe .bedtime no container)
   Céu noturno em vez do preto neutro. PARADO de propósito: fica na tela a noite inteira,
   numa janela transparente, e qualquer animação infinita (estrelas, lua, halo) ou sombra
   (box-shadow, drop-shadow) obrigava o Windows a recompor a janela a cada quadro.
   Também sem desfoque do fundo (o fundo já é quase opaco). Só a entrada anima, uma vez.
   -------------------------------------------------------------------------- */
.desktop-notch-container.bedtime {
  position: relative;
  color: #e6e7ff;
  background: rgba(14, 16, 36, var(--notch-opacity));
  background-image: linear-gradient(180deg, rgba(26, 29, 66, 0.55) 0%, rgba(8, 9, 22, 0.35) 100%);
  border-color: rgba(167, 170, 255, 0.2);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* poeira de estrelas: três pontos fixos */
.desktop-notch-container.bedtime::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.6;
  background-image:
    radial-gradient(1px 1px at 18% 34%, rgba(255, 255, 255, 0.7), transparent 60%),
    radial-gradient(1px 1px at 63% 22%, rgba(255, 255, 255, 0.55), transparent 60%),
    radial-gradient(1.4px 1.4px at 86% 70%, rgba(214, 216, 255, 0.6), transparent 60%);
}

.desktop-notch-container.bedtime .notch-summary-bar {
  position: relative;
  justify-content: flex-start;
  gap: 10px;
  animation: notchNightIn 0.9s var(--ease-fluent) both;
}

@keyframes notchNightIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.notch-moon {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #d6d8ff;
  background: rgba(167, 170, 255, 0.14);
}

.notch-bedtime-line {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: #dcdeff;
}

.desktop-notch-container.bedtime .notch-clock-live { background: rgba(167, 170, 255, 0.14); }
.desktop-notch-container.bedtime .notch-pin-btn { color: #c9cbf2; }
.desktop-notch-container.bedtime .notch-details { position: relative; }

.notch-bedtime-copy {
  margin-top: 6px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #c9cbf2;
}

.notch-bedtime-copy b { color: #ffffff; font-weight: 600; white-space: nowrap; }
.notch-bedtime-copy.subtle { font-size: 0.8rem; color: #9a9cc8; }

.notch-btn-night {
  background: #e6e7ff;
  color: #14163a;
  border-color: #e6e7ff;
  font-weight: 600;
}

.notch-btn-night:hover { background: #ffffff; border-color: #ffffff; }

.notch-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: #a9abd8;
}

.notch-btn-ghost:hover { background: rgba(167, 170, 255, 0.1); border-color: transparent; color: #e6e7ff; }

/* ==========================================================================
   CHAT — cartão "Projeto criado"
   ========================================================================== */
.ai-project-card {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-surface-elevated);
  animation: projectCardIn 0.38s var(--ease-fluent) both;
}

@keyframes projectCardIn {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.ai-project-swatch {
  flex: none;
  width: 8px;
  align-self: stretch;
  min-height: 38px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.ai-project-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-project-kicker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-success, #2e7d32);
}

.ai-project-name {
  font-size: 0.98rem;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ai-project-meta {
  font-size: 0.76rem;
  color: var(--color-text-secondary);
}

.ai-project-meta code {
  font-family: inherit;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--color-bg-subtle);
  border: var(--border-subtle);
}

.ai-project-actions {
  flex: none;
  display: flex;
  gap: 6px;
}

.ai-project-actions .fluent-btn {
  padding: 5px 10px;
  font-size: 0.78rem;
}

.ai-project-card.is-removed { opacity: 0.6; }
.ai-project-card.is-removed .ai-project-kicker { color: var(--color-text-tertiary); }

.ai-project-undone {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--color-text-tertiary);
}

:root[data-theme="dark"] .ai-project-card { background: rgba(255, 255, 255, 0.03); }
:root[data-theme="dark"] .ai-project-swatch { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
:root[data-theme="dark"] .dock-icon-btn:hover { color: #ffffff; }

/* ==========================================================================
   Notch · Docking — Topo · Esquerda · Direita
   O Rust ancora a janela na borda (notch.rs); aqui o Notch cola-se à mesma
   borda dentro da janela transparente ([data-dock] na raiz e no container,
   [data-axis] = horizontal | vertical). Fica no fim do ficheiro de propósito:
   prevalece sobre o modo "Hora de desligar".
   ========================================================================== */

/* --- Seletor de posição: ícones discretos no canto inferior do conteúdo ---
   Topo e Esquerda: canto inferior direito. Direita: canto inferior esquerdo
   (o canto virado para o centro da tela). */
.notch-details { position: relative; }

.notch-dock-switch {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 2px;
  border-radius: var(--radius-full);
  opacity: 0.8;
  transition: opacity var(--duration-fast) ease;
}

.notch-dock-switch:hover,
.notch-dock-switch:focus-within { opacity: 1; }

.desktop-notch-container[data-dock="right"] .notch-dock-switch { right: auto; left: 14px; }

/* Ocultar o Notch: no canto oposto ao seletor, quase escondido até passar o mouse */
.notch-hide-btn { position: absolute; left: 16px; bottom: 16px; opacity: 0.55; }
.notch-hide-btn:hover, .notch-hide-btn:focus-visible { opacity: 1; }
.notch-hide-btn .notch-ico { width: 13px; height: 13px; }
.desktop-notch-container[data-dock="right"] .notch-hide-btn { left: auto; right: 16px; }

.notch-dock-btn {
  width: 22px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  pointer-events: auto;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease;
}

.notch-dock-btn:hover { color: #ffffff; background: rgba(255, 255, 255, 0.1); }
.notch-dock-btn:focus-visible { outline: 1.5px solid #ffffff; outline-offset: 1px; }

/* posição ativa: pastilha branca com brilho curto (mesma linguagem do botão primário) */
.notch-dock-btn.active {
  color: #111111;
  width: 20px;
  height: 20px;
  background: #ffffff;
}

.notch-dock-glyph { display: block; width: 14px; height: 14px; }

.desktop-notch-container.bedtime .notch-dock-btn { color: rgba(214, 216, 255, 0.5); }
.desktop-notch-container.bedtime .notch-dock-btn:hover { color: #e6e7ff; background: rgba(167, 170, 255, 0.12); }
.desktop-notch-container.bedtime .notch-dock-btn.active {
  color: #14163a;
  background: #e6e7ff;
  box-shadow: none;
}

/* --- Raiz: em que borda da janela o Notch se cola --- */
.desktop-notch-window-root[data-dock="left"] {
  justify-content: flex-start;
  align-items: center;
  padding: 30px 18px 30px 0;
}

.desktop-notch-window-root[data-dock="right"] {
  justify-content: flex-end;
  align-items: center;
  padding: 30px 0 30px 18px;
}

/* --- Laterais: a pílula CRESCE até virar o cartão (como o Notch do topo) ---
   O cartão tem tamanho fixo e fica sempre por baixo; recolhido, um clip-path
   recorta-o no formato exato da pílula (46×196, colada à borda e centrada).
   Ao passar o rato o recorte abre até ao cartão inteiro: o Notch "estica" da
   borda para o centro da tela. Nenhuma largura/altura muda → zero reflow, e a
   janela nativa também não é redimensionada (notch.rs). O container é só um
   palco transparente sem cliques: recebe-os a pílula (recolhido) ou o cartão. */
.desktop-notch-container[data-axis="vertical"] {
  position: relative;
  flex: none;
  margin: 0;
  width: 382px;
  height: 380px;
  background: none;
  background-image: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
  pointer-events: none;
  transition: none;
  /* a sombra segue o recorte (box-shadow seria cortada pelo clip-path) */
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.32));
}

.desktop-notch-container[data-axis="vertical"].bedtime::before { display: none; }

/* "Hora de desligar": sem sombra (o drop-shadow refazia o filtro a cada quadro) */
.desktop-notch-container[data-axis="vertical"].bedtime {
  filter: none;
}

/* Cartão = a forma que cresce. Sem backdrop-filter: desfocar o fundo a cada frame
   de uma forma em movimento é o que custa caro; o fundo fica um pouco mais denso. */
.desktop-notch-container[data-axis="vertical"] .notch-card {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto 0;
  height: fit-content;
  min-height: 196px;      /* a pílula cabe sempre dentro do cartão */
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--color-notch-text);
  background: var(--color-notch-bg);
  background-image: var(--notch-surface, linear-gradient(rgba(0, 0, 0, 0.36), rgba(0, 0, 0, 0.36)));
  pointer-events: none;
  contain: layout paint;
  transition: clip-path var(--duration-smooth) var(--ease-fluent);
}

/* Relógio da pílula lateral: deitado, acompanhando a pílula. Fixo — não gira ao
   passar o rato (o relógio do cartão aberto é outro elemento e fica sempre direito). */
.desktop-notch-container[data-axis="vertical"] .notch-pill .notch-clock-live {
  transform: rotate(90deg) scale(1.2);
  margin: 10px 0;
}

.desktop-notch-container[data-dock="left"] .notch-card {
  clip-path: inset(calc(50% - 98px) calc(100% - 46px) calc(50% - 98px) 0 round 0 23px 23px 0);
}

.desktop-notch-container[data-dock="right"] .notch-card {
  clip-path: inset(calc(50% - 98px) 0 calc(50% - 98px) calc(100% - 46px) round 23px 0 0 23px);
}

.desktop-notch-container[data-dock="left"].expanded .notch-card { clip-path: inset(0 0 0 0 round 0 20px 20px 0); }
.desktop-notch-container[data-dock="right"].expanded .notch-card { clip-path: inset(0 0 0 0 round 20px 0 0 20px); }

.desktop-notch-container[data-axis="vertical"].expanded .notch-card { pointer-events: auto; }

/* Conteúdo do cartão: aparece enquanto a forma cresce, some logo ao recolher */
.desktop-notch-container[data-axis="vertical"] .notch-card > * {
  opacity: 0;
  transition: opacity 0.12s ease;
}

.desktop-notch-container[data-axis="vertical"].expanded .notch-card > * {
  opacity: 1;
  transition: opacity 0.2s ease 0.1s;
}

.desktop-notch-container[data-axis="vertical"].bedtime .notch-card {
  color: #e6e7ff;
  background: rgba(14, 16, 36, var(--notch-opacity));
  background-image: linear-gradient(180deg, rgba(26, 29, 66, 0.55) 0%, rgba(8, 9, 22, 0.35) 100%);
}

/* Pílula: só o conteúdo (rosto do mascote · hora · estado) por cima da forma */
.desktop-notch-container[data-axis="vertical"] .notch-pill {
  position: absolute;
  z-index: 1;
  top: calc(50% - 98px);
  width: 46px;
  height: 196px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--color-notch-text);
  pointer-events: auto;
  transition: opacity 0.16s ease 0.18s;   /* reaparece quando a forma já encolheu */
}

.desktop-notch-container[data-dock="left"] .notch-pill { left: 0; }
.desktop-notch-container[data-dock="right"] .notch-pill { right: 0; }

.desktop-notch-container[data-axis="vertical"].expanded .notch-pill {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease;
}

.notch-logo-face { width: 24px; height: 24px; }

.notch-pill .notch-clock-live {
  padding: 2px 5px;
  font-size: 0.68rem;
  letter-spacing: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.notch-pill-status { display: grid; place-items: center; color: #dedede; }

/* Cabeçalho do cartão: distribuído como no Notch do topo (logo · hora · tarefa · fixar);
   o conteúdo abaixo dele é que fica centrado */
.desktop-notch-container[data-axis="vertical"] .notch-card .notch-summary-bar {
  flex: none;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 12px 18px;
  border-radius: 0;
}

.desktop-notch-container[data-axis="vertical"] .notch-card .notch-current-task { max-width: 200px; }

/* "Hora de desligar": a animação de entrada da barra (notchNightIn, fill both) forçava
   opacity 1 e a lua do cabeçalho vazava pelo recorte da pílula (2 luas). No lateral
   quem anima é o cartão, por isso a barra não precisa dela. */
.desktop-notch-container[data-axis="vertical"] .notch-card .notch-summary-bar { animation: none; }

/* Detalhes sempre "abertos" dentro do cartão (quem anima é o recorte); rolam se a
   tarefa for longa, nada é cortado. Folga em baixo para o seletor no canto. */
.desktop-notch-container[data-axis="vertical"] .notch-card .notch-details {
  flex: 0 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding: 2px 20px 46px;
  text-align: center;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.desktop-notch-container[data-axis="vertical"] .notch-card .notch-dock-switch { bottom: 12px; }
.desktop-notch-container[data-axis="vertical"] .notch-card .notch-hide-btn { bottom: 14px; }

/* Conteúdo centrado em todas as posições (topo e laterais) */
.desktop-notch-container .notch-details { text-align: center; }

.desktop-notch-container .notch-details .section-title,
.desktop-notch-container .notch-actions {
  justify-content: center;
}

.desktop-notch-container .notch-details .task-title { overflow-wrap: anywhere; }
.desktop-notch-container .notch-actions { flex-wrap: wrap; }

/* Topo: com os botões centrados, o seletor do canto ganha folga própria por baixo
   deles (como no lateral) para nunca os tocar */
.desktop-notch-container[data-axis="horizontal"].expanded .notch-details { padding-bottom: 46px; }
.desktop-notch-container[data-axis="horizontal"] .notch-dock-switch { bottom: 12px; }
.desktop-notch-container[data-axis="horizontal"] .notch-hide-btn { bottom: 14px; }

/* --- Reancorar: o Notch desliza para dentro a partir da nova borda (só transform/opacity) --- */
.desktop-notch-container.docking[data-dock="top"] { animation: notchDockTop 0.42s var(--ease-fluent) both; }
.desktop-notch-container.docking[data-dock="left"] { animation: notchDockLeft 0.42s var(--ease-fluent) both; }
.desktop-notch-container.docking[data-dock="right"] { animation: notchDockRight 0.42s var(--ease-fluent) both; }

@keyframes notchDockTop { from { opacity: 0; transform: translate3d(0, -36px, 0); } to { opacity: 1; transform: none; } }
@keyframes notchDockLeft { from { opacity: 0; transform: translate3d(-36px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes notchDockRight { from { opacity: 0; transform: translate3d(36px, 0, 0); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .desktop-notch-container.docking { animation: none !important; }
  .desktop-notch-container[data-axis="vertical"] .notch-card { transition: none; }
}
/* ==========================================================================
   QUEBRA DE LINHA, TEXTAREAS AUTO-GROW, CHECKLIST DO MODAL,
   "DESCARTAR ALTERAÇÕES?" E HISTÓRICO ("ONTEM E DIAS ANTERIORES")
   ========================================================================== */

/* Textareas de 1 linha que crescem (autoGrow em script.js): sem alça e sem barra até ao limite */
textarea.auto-grow {
  resize: none;
  overflow-y: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Chat: mensagens longas quebram dentro do balão, nunca na horizontal */
.ai-chat-feed { overflow-x: hidden; }
.chat-msg { min-width: 0; }
.chat-bubble {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* pre-wrap só no texto (o resto do balão é HTML com indentação do template) */
.chat-bubble > p { white-space: pre-wrap; }

.ai-chat-input { line-height: 1.45; min-height: 40px; }
/* Janela estreita: o exemplo fica numa linha (com …) em vez de quebrar e ser cortado */
.ai-chat-input::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Barra Universal: 1 linha centrada nos dois estados (38px / 46px); com várias linhas
   a altura vem do autoGrow e os cantos deixam de ser de pílula */
.universal-cmd-input {
  display: block;
  line-height: 20px;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  white-space: pre-wrap;
}
.universal-command-dock.is-active .universal-cmd-input {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}
.universal-cmd-input.is-grown { border-radius: var(--radius-lg) !important; }
.universal-input-wrapper:has(.universal-cmd-input.is-grown) .universal-search-icon { top: 23px; }
.universal-input-wrapper:has(.universal-cmd-input.is-grown) .universal-input-right-tools { top: 23px; }

/* Foco do Momento: "Adicionar item" e edição inline quebram em vez de cortar */
.focus-checklist-input,
.focus-subitem-edit { line-height: 1.4; }

/* Textos de checklist (Foco, cartões da IA) quebram em qualquer ponto */
.checklist-text,
.ai-checklist-preview li { overflow-wrap: anywhere; word-break: break-word; }

/* Checklist do modal: [✓] texto ················ ↑ ↓ ✕ */
.modal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}
.checklist-builder-row {
  align-items: center;
  border-radius: 8px;
  transition: background var(--duration-fast) ease, box-shadow var(--duration-fast) ease, opacity var(--duration-fast) ease;
}

/* Alça de arrastar: discreta, aparece com o rato sobre a linha */
.checklist-drag-handle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 16px;
  height: 24px;
  margin-right: -2px;
  color: var(--color-text-tertiary);
  opacity: 0;
  cursor: grab;
  touch-action: none;
  transition: opacity var(--duration-fast) ease, color var(--duration-fast) ease;
}
.checklist-drag-handle .ui-ico { fill: currentColor; }
.checklist-builder-row:hover .checklist-drag-handle { opacity: 1; }
.checklist-drag-handle:hover { color: var(--color-text-primary); }

/* Durante o arrasto: a linha arrastada flutua e segue o ponteiro; as outras deslizam
   (transform animado) para abrir o espaço. Comum ao modal e ao "Foco do Momento". */
#modal-checklist-container.is-sorting { cursor: grabbing; user-select: none; }
#modal-checklist-container.is-sorting * { cursor: grabbing !important; }
#modal-checklist-container.is-sorting > .checklist-builder-row:not(.is-dragging),
.focus-checklist.is-sorting > .checklist-item:not(.is-dragging) {
  transition: transform 200ms cubic-bezier(0.2, 0, 0, 1);
}
.checklist-builder-row.is-dragging,
.focus-checklist .checklist-item.is-dragging {
  position: relative;
  z-index: 3;
  scale: 1.015;
  background: var(--clock-track);
  will-change: transform;
  transition: box-shadow 160ms ease, scale 160ms ease, background 160ms ease;
}
.checklist-builder-row.is-dragging {
  background: var(--clock-track);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}
/* Ao soltar: assenta no lugar (mesma duração que CHECKLIST_DROP_MS no script) */
.checklist-builder-row.is-dragging.is-dropping,
.focus-checklist .checklist-item.is-dragging.is-dropping {
  scale: 1;
  box-shadow: none;
  transition: transform 180ms cubic-bezier(0.2, 0, 0, 1), scale 180ms ease, box-shadow 180ms ease;
}
.checklist-builder-row.is-dragging .checklist-drag-handle { opacity: 1; color: var(--color-text-primary); }
@media (prefers-reduced-motion: reduce) {
  #modal-checklist-container.is-sorting > .checklist-builder-row:not(.is-dragging),
  .focus-checklist.is-sorting > .checklist-item:not(.is-dragging),
  .checklist-builder-row.is-dragging.is-dropping,
  .focus-checklist .checklist-item.is-dragging.is-dropping { transition: none; }
}

/* Caixa = a mesma do "Foco do Momento"; o checkbox nativo fica invisível por cima */
.checklist-builder-box {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  padding: 3px;
  margin: 0 4px 0 0;
  border-radius: 8px;
  cursor: pointer;
}
.checklist-builder-check {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.checklist-builder-box:hover .checklist-box { border-color: rgba(0, 0, 0, 0.6); }
.checklist-builder-box:active .checklist-box { transform: scale(0.9); }
.checklist-builder-box:has(.checklist-builder-check:focus-visible) { outline: 2px solid var(--color-text-primary); }
.checklist-builder-row.is-done .checklist-box { background: #111; border-color: #111; color: #fff; }
.checklist-builder-row.is-done .checklist-check { stroke-dashoffset: 0; opacity: 1; }
.checklist-builder-row.is-done.just-toggled .checklist-box { animation: checklistPop 0.26s var(--ease-fluent); }
.checklist-builder-row.is-done.just-toggled .checklist-check { animation: checklistDraw 0.24s var(--ease-fluent) 0.05s both; }
@media (prefers-reduced-motion: reduce) {
  .checklist-builder-row.is-done.just-toggled .checklist-box,
  .checklist-builder-row.is-done.just-toggled .checklist-check { animation: none; }
}
.checklist-builder-text {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
  color: var(--color-text-primary);
  font-weight: 400;
}
.checklist-builder-row.is-done .checklist-builder-text {
  text-decoration: line-through;
  text-decoration-color: rgba(0, 0, 0, 0.35);
  color: var(--color-text-tertiary);
}
.checklist-builder-tools {
  display: inline-flex;
  flex: none;
  gap: 1px;
  margin-top: 4px;
  opacity: 0.45;
  transition: opacity var(--duration-fast) ease;
}
.checklist-builder-row:hover .checklist-builder-tools,
.checklist-builder-tools:focus-within { opacity: 1; }

/* Aviso leve de data no passado (mesmo estilo do aviso de descanso) */
.modal-past-warning { font-size: 0.78rem; }

/* "Descartar alterações?" — por cima do modal, dentro do mesmo overlay */
.discard-confirm {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.18);
  z-index: 1;
  animation: modalOverlayFadeIn 0.16s var(--ease-fluent);
}
.discard-confirm-card {
  width: min(340px, 88vw);
  padding: 20px 22px 18px;
  background: rgba(255, 255, 255, 0.98);
  border: var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  animation: modalBoxPopIn 0.2s var(--ease-fluent);
}
.discard-confirm-title { font-size: 1rem; font-weight: 600; margin: 0 0 6px; }
.discard-confirm-text { font-size: 0.85rem; color: var(--color-text-secondary); margin: 0; }
.discard-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* Histórico: secção recolhível abaixo da agenda de hoje */
.history-sheet { margin-top: 16px; }
.history-summary {
  cursor: pointer;
  list-style: none;
  gap: 12px;
  border-bottom: none;
}
.history-summary::-webkit-details-marker { display: none; }
.history-sheet[open] > .history-summary { border-bottom: var(--border-subtle); }
.history-heading { display: inline-flex; align-items: center; gap: 8px; }
.history-summary::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin-left: 4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.5;
  transition: transform var(--duration-fast) ease;
}
.history-sheet[open] > .history-summary::after { transform: rotate(225deg); }
.history-summary > .text-subtle { margin-left: auto; font-size: 0.78rem; }

.history-day + .history-day { border-top: var(--border-subtle); }
.history-day-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px 4px;
  font-size: 0.82rem;
  font-weight: 600;
}
.history-day-head .text-subtle { font-weight: 400; font-size: 0.76rem; }
.history-subhead {
  padding: 4px 18px 2px;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}
.history-row { min-height: 42px; }
.history-status {
  flex: none;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px dashed rgba(0, 0, 0, 0.3);
}
.history-row.completed .history-status { border: none; background: #111; color: #fff; }
.history-focus {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  font-size: 0.74rem;
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}
.history-empty { padding: 14px 18px; margin: 0; font-size: 0.84rem; }
.history-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px 14px;
  border-top: var(--border-subtle);
  font-size: 0.76rem;
}

:root[data-theme="dark"] .checklist-builder-row.is-done .checklist-builder-text { text-decoration-color: rgba(255, 255, 255, 0.35); }
:root[data-theme="dark"] .discard-confirm { background: rgba(0, 0, 0, 0.35); }
:root[data-theme="dark"] .discard-confirm-card { background: rgba(40, 40, 44, 0.98); }
:root[data-theme="dark"] .history-status { border-color: rgba(255, 255, 255, 0.35); }
:root[data-theme="dark"] .history-row.completed .history-status { background: #fff; color: #111; }

/* ==========================================================================
   TELA DE CARREGAMENTO (#udo-splash)
   O logotipo manuscrito "escreve-se" da esquerda para a direita (máscara com borda
   suave, como tinta a correr), uma linha fina de progresso e uma nota em Caveat.
   Mesmo fundo do Workspace, por isso a troca para o app é só um fade.
   ========================================================================== */
.udo-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background-color: var(--color-bg-base);
  background-image:
    radial-gradient(at 0% 0%, rgba(255, 255, 255, 0.75) 0px, transparent 65%),
    radial-gradient(at 100% 100%, rgba(222, 222, 222, 0.6) 0px, transparent 65%);
  user-select: none;
  cursor: progress;
  transition: opacity 0.48s var(--ease-in-out), visibility 0s linear 0.48s;
}

:root[data-theme="dark"] .udo-splash {
  background-image:
    radial-gradient(at 0% 0%, rgba(255, 255, 255, 0.04) 0px, transparent 65%),
    radial-gradient(at 100% 100%, rgba(0, 0, 0, 0.35) 0px, transparent 65%);
}

html.notch-html .udo-splash { display: none !important; }

.udo-splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.48s var(--ease-fluent), filter 0.48s ease;
}

/* Logotipo: branco no ficheiro; no tema claro inverte para preto (como a sidebar) */
.udo-splash-logo {
  width: clamp(150px, 16vw, 210px);
  height: auto;
  -webkit-user-drag: none;
  -webkit-mask-image: linear-gradient(90deg, #000 42%, transparent 58%);
          mask-image: linear-gradient(90deg, #000 42%, transparent 58%);
  -webkit-mask-size: 260% 100%;
          mask-size: 260% 100%;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0;
          mask-position: 100% 0;
  animation: udoSplashWrite 1.15s cubic-bezier(0.55, 0.05, 0.3, 1) 0.12s forwards,
             udoSplashRise 0.9s var(--ease-fluent) 0.12s both;
}

:root:not([data-theme="dark"]) .udo-splash-logo { filter: invert(1); }

@keyframes udoSplashWrite {
  to { -webkit-mask-position: 0 0; mask-position: 0 0; }
}

@keyframes udoSplashRise {
  from { transform: translateY(6px); }
  to { transform: translateY(0); }
}

/* Linha de progresso: trilho finíssimo com um traço que desliza (indeterminado) */
.udo-splash-bar {
  position: relative;
  width: 112px;
  height: 2px;
  margin-top: 30px;
  border-radius: var(--radius-full);
  background: var(--color-bg-active);
  overflow: hidden;
  opacity: 0;
  animation: udoSplashFade 0.5s ease 0.55s forwards;
}

.udo-splash-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--color-text-strong) 50%, transparent);
  animation: udoSplashSlide 1.25s var(--ease-in-out) infinite;
}

@keyframes udoSplashSlide {
  from { transform: translateX(-110%); }
  to { transform: translateX(250%); }
}

.udo-splash-note {
  margin-top: 14px;
  font-family: var(--font-hand);
  font-size: 1.15rem;
  line-height: 1;
  color: var(--color-text-tertiary);
  opacity: 0;
  animation: udoSplashFade 0.6s ease 0.8s forwards;
}

@keyframes udoSplashFade {
  to { opacity: 1; }
}

/* Saída: o ecrã some e o conteúdo afasta-se um nada (sensação de "entrar" no app) */
.udo-splash.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.udo-splash.is-leaving .udo-splash-inner {
  transform: scale(1.04);
  filter: blur(2px);
}

@media (prefers-reduced-motion: reduce) {
  .udo-splash-logo { animation: none; -webkit-mask-image: none; mask-image: none; }
  .udo-splash-bar span { animation-duration: 2.4s; }
  .udo-splash.is-leaving .udo-splash-inner { transform: none; filter: none; }
}

/* ==========================================================================
   NOTAS (notes-ui.js): biblioteca em cards (grade) OU o editor da nota aberta (.has-open),
   em qualquer largura. Janela estreita (.notes-narrow): cards mais compactos.
   Cards: cantos de 32px, sem borda, gradiente vertical do branco ao bege quente; etiquetas
   em pílulas com a cor da paleta (TAG_COLORS do notes-core.js).
   ========================================================================== */
:root {
  --note-card-top: #ffffff;
  --note-card-bottom: #ebedf0;          /* cinza bem claro, frio/neutro */
  --note-card-title: #0d0d0e;
  --note-card-text: #9b9ea4;
  --note-card-badge: rgba(0, 0, 0, 0.06);
  --note-card-shadow: 0 1px 2px rgba(15, 20, 30, 0.03), 0 6px 18px rgba(15, 20, 30, 0.04);
  --note-card-shadow-hover: 0 2px 4px rgba(15, 20, 30, 0.06), 0 14px 32px rgba(15, 20, 30, 0.09);
  --note-image-ring: #3a69c9;   /* contorno da imagem selecionada no editor */
  --note-table-line: rgba(0, 0, 0, 0.1);         /* tabela no editor: linhas */
  --note-table-head: rgba(0, 0, 0, 0.035);       /* fundo do cabeçalho */
  --note-table-selected: rgba(58, 105, 201, 0.12);   /* células selecionadas */
  --tag-gray: #141414;
  --tag-red: #c24d5b;
  --tag-orange: #c9682a;
  --tag-yellow: #a77a08;
  --tag-green: #3b8655;
  --tag-teal: #1f7f7c;
  --tag-blue: #3a69c9;
  --tag-purple: #7651bf;
  --tag-pink: #bd4b88;
  --tag-coral: #c9553f;
  --tag-amber: #b37400;
  --tag-lime: #6a8c16;
  --tag-mint: #238a68;
  --tag-sky: #2a82b3;
  --tag-indigo: #525ac0;
  --tag-magenta: #a945a9;
  --tag-brown: #86593d;
  /* cores das notas (texto, célula e tabela: UdoNotes.NOTE_COLORS); legíveis sobre o fundo */
  --note-c-gray: #6f737a;
  --note-c-red: #d03b4e;
  --note-c-orange: #d0661f;
  --note-c-yellow: #b88a00;
  --note-c-green: #2f8a4f;
  --note-c-teal: #17847f;
  --note-c-blue: #3567d0;
  --note-c-purple: #7a4fd0;
  --note-c-pink: #c9418a;
  --note-c-coral: #d9573f;
  --note-c-amber: #c77f00;
  --note-c-lime: #6f9a12;
  --note-c-mint: #1f9d73;
  --note-c-sky: #1c8fc7;
  --note-c-indigo: #4c55c7;
  --note-c-magenta: #b83bb8;
  --note-c-brown: #8a5a3c;
}

:root[data-theme="dark"] {
  --note-card-top: #2b2c2e;
  --note-card-bottom: #1c1d1f;
  --note-card-title: #f3f4f6;
  --note-card-text: #8b8e94;
  --note-image-ring: #7ea2ee;
  --note-table-line: rgba(255, 255, 255, 0.12);
  --note-table-head: rgba(255, 255, 255, 0.045);
  --note-table-selected: rgba(126, 162, 238, 0.18);
  --note-card-badge: rgba(255, 255, 255, 0.09);
  --note-card-shadow: 0 1px 2px rgba(0, 0, 0, 0.30), 0 10px 28px rgba(0, 0, 0, 0.28);
  --note-card-shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 36px rgba(0, 0, 0, 0.38);
  --tag-gray: #4a4c50;
  --tag-red: #c85c69;
  --tag-orange: #c7713a;
  --tag-yellow: #a8811a;
  --tag-green: #46905f;
  --tag-teal: #2e8986;
  --tag-blue: #4a76d1;
  --tag-purple: #8161c8;
  --tag-pink: #c45b93;
  --tag-coral: #c96a55;
  --tag-amber: #b5842a;
  --tag-lime: #7f9b36;
  --tag-mint: #3f9577;
  --tag-sky: #3f8fbd;
  --tag-indigo: #666ed0;
  --tag-magenta: #b35cb3;
  --tag-brown: #96705a;
  --note-c-gray: #a1a5ac;
  --note-c-red: #f07583;
  --note-c-orange: #f2955a;
  --note-c-yellow: #e5be4c;
  --note-c-green: #68c387;
  --note-c-teal: #4fc6bf;
  --note-c-blue: #7ea2ee;
  --note-c-purple: #ac8cf0;
  --note-c-pink: #ee86bd;
  --note-c-coral: #f58b73;
  --note-c-amber: #f0b24a;
  --note-c-lime: #b1d75a;
  --note-c-mint: #5fd6ad;
  --note-c-sky: #62bdec;
  --note-c-indigo: #8f97f2;
  --note-c-magenta: #df85df;
  --note-c-brown: #c49a7c;
}

.view-container.is-notes {
  display: flex;
  flex-direction: column;
}

/* [hidden] perdia para os display:flex/inline-flex abaixo: aqui o atributo manda sempre */
.notes-view [hidden] { display: none !important; }

/* flex: 1 0 auto (e não 1): a coluna cresce com a nota longa em vez de ficar presa à altura
   do .view-container (que é quem rola). Presa, o texto transbordava e a barra fixa do topo
   (.notes-editor-bar, sticky) ia-se embora ao rolar além da 1.ª tela: o sticky só acompanha
   enquanto o pai dele está à vista. */
.notes-view {
  flex: 1 0 auto;
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

/* ou a biblioteca, ou o editor */
.notes-view.has-open .notes-library { display: none; }
.notes-view:not(.has-open) .notes-editor { display: none; }

.notes-library {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* busca e "Nova nota" no estilo da barra do app: pílulas de vidro (tokens --dock-input-*) */
.notes-library-head { display: flex; align-items: center; gap: 10px; }
.notes-search-wrap { position: relative; flex: 1; min-width: 0; max-width: 620px; }
.notes-search-wrap > .ui-ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-tertiary);
  pointer-events: none;
  z-index: 1;
  transition: color var(--duration-fast) ease;
}
.notes-search-wrap:focus-within > .ui-ico { color: var(--color-text-strong); }
.notes-view .notes-search {
  width: 100%;
  height: 40px;
  padding: 0 38px 0 40px !important;
  border-radius: var(--radius-notes-toolbar, var(--radius-full)) !important;
  border: 1px solid var(--dock-input-border) !important;
  background: var(--surface-item-bg, var(--dock-input-bg)) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--dock-input-shadow) !important;
  font-size: 0.86rem !important;
  transition: border-color var(--duration-normal) ease, box-shadow var(--duration-normal) ease;
}
.notes-view .notes-search:focus { border-color: var(--dock-input-border-focus) !important; outline: none; }
.notes-view .notes-search::-webkit-search-cancel-button { display: none; }
.notes-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-tertiary);
  cursor: pointer;
  z-index: 1;
}
.notes-search-clear:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }
.notes-view .notes-new {
  flex-shrink: 0;
  height: 40px;
  gap: 7px;
  padding: 0 18px 0 14px;
  border-radius: var(--radius-notes-toolbar, var(--radius-full));
  white-space: nowrap;
  box-shadow: var(--dock-input-shadow);
}
.notes-view .notes-new .notes-btn-label { font-size: 0.86rem; }
.notes-view .notes-new .ui-ico { transition: transform var(--duration-normal) var(--ease-fluent); }
.notes-view .notes-new:hover .ui-ico { transform: rotate(90deg); }
/* janela estreita: só o "+" redondo, e a busca fica com o espaço */
.notes-view.notes-narrow .notes-new { width: 40px; padding: 0; }
.notes-view.notes-narrow .notes-new .notes-btn-label { display: none; }

/* filtros: pílulas (a escolhida fica invertida) + seletor de projeto */
.notes-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.notes-filter {
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--color-bg-hover);
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.notes-filter:hover { color: var(--color-text-primary); }
.notes-filter[aria-pressed="true"],
.notes-view .notes-project-filter.is-active {
  background: var(--color-text-strong);
  color: #fff;
}
:root[data-theme="dark"] .notes-filter[aria-pressed="true"],
:root[data-theme="dark"] .notes-view .notes-project-filter.is-active { color: #141414; }
.notes-filter:focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: 2px; }

.notes-view .notes-project-filter {
  width: auto;
  max-width: 220px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* grade de cards: quase quadrados, bastante respiro */
.notes-grid {
  list-style: none;
  margin: 0;
  padding: 6px 2px 28px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 22px;
}

.notes-item { min-width: 0; display: flex; }
.notes-item > .notes-card { flex: 1; }

.notes-card {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;   /* sempre quadrado: o conteúdo se ajusta, o card não cresce */
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 28px 24px;
  border: var(--border-glass);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--note-card-top) 0%, var(--note-card-bottom) 100%);
  box-shadow: var(--note-card-shadow);
  color: var(--note-card-title);
  font: inherit;
  text-align: left;
}

/* título e etiquetas não encolhem; o resumo ocupa o meio e, sem espaço, some em degradê
   (as etiquetas ficam sempre no rodapé) */
.notes-card > * { flex-shrink: 0; }

.notes-item-btn.notes-card { cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.notes-item-btn.notes-card:hover { transform: translateY(-2px); box-shadow: var(--note-card-shadow-hover); }
.notes-item-btn.notes-card:focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: 3px; }

.notes-card-top { display: flex; justify-content: flex-end; gap: 6px; margin: -12px -12px -4px 0; }

.notes-item-pin,
.notes-card-links {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--note-card-badge);
  color: var(--note-card-title);
  font-size: 0.72rem;
  font-weight: 600;
}

.notes-card .notes-item-title {
  font-size: 2.05rem;
  font-weight: 700;
  line-height: 1.15;
  padding-bottom: 0.04em;   /* descendentes (ç, g, p) da última linha não são cortados */
  letter-spacing: -0.01em;
  color: var(--note-card-title);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.notes-card .notes-item-snippet {
  flex: 1 1 auto;
  min-height: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.2em), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 1.2em), transparent);
  font-size: 0.88rem;
  line-height: 1.32;
  color: var(--note-card-text);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.notes-card-tags { margin-top: auto; display: flex; flex-wrap: nowrap; gap: 6px; overflow: hidden; }
.notes-card-tags .notes-tag { flex-shrink: 1; min-width: 0; }

/* pílula de etiqueta (notas, tarefas, itens da checklist e "Gerenciar etiquetas") */
.notes-tag,
.tag-pill {
  display: inline-block;
  max-width: 100%;
  padding: 4px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--tag-gray);
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

:is(.notes-tag, .tag-pill, .notes-tag-swatch, .tag-dot).tag-gray { background: var(--tag-gray); }
:is(.notes-tag, .tag-pill, .notes-tag-swatch, .tag-dot).tag-red { background: var(--tag-red); }
:is(.notes-tag, .tag-pill, .notes-tag-swatch, .tag-dot).tag-orange { background: var(--tag-orange); }
:is(.notes-tag, .tag-pill, .notes-tag-swatch, .tag-dot).tag-yellow { background: var(--tag-yellow); }
:is(.notes-tag, .tag-pill, .notes-tag-swatch, .tag-dot).tag-green { background: var(--tag-green); }
:is(.notes-tag, .tag-pill, .notes-tag-swatch, .tag-dot).tag-teal { background: var(--tag-teal); }
:is(.notes-tag, .tag-pill, .notes-tag-swatch, .tag-dot).tag-blue { background: var(--tag-blue); }
:is(.notes-tag, .tag-pill, .notes-tag-swatch, .tag-dot).tag-purple { background: var(--tag-purple); }
:is(.notes-tag, .tag-pill, .notes-tag-swatch, .tag-dot).tag-pink { background: var(--tag-pink); }
:is(.notes-tag, .tag-pill, .notes-tag-swatch, .tag-dot).tag-coral { background: var(--tag-coral); }
:is(.notes-tag, .tag-pill, .notes-tag-swatch, .tag-dot).tag-amber { background: var(--tag-amber); }
:is(.notes-tag, .tag-pill, .notes-tag-swatch, .tag-dot).tag-lime { background: var(--tag-lime); }
:is(.notes-tag, .tag-pill, .notes-tag-swatch, .tag-dot).tag-mint { background: var(--tag-mint); }
:is(.notes-tag, .tag-pill, .notes-tag-swatch, .tag-dot).tag-sky { background: var(--tag-sky); }
:is(.notes-tag, .tag-pill, .notes-tag-swatch, .tag-dot).tag-indigo { background: var(--tag-indigo); }
:is(.notes-tag, .tag-pill, .notes-tag-swatch, .tag-dot).tag-magenta { background: var(--tag-magenta); }
:is(.notes-tag, .tag-pill, .notes-tag-swatch, .tag-dot).tag-brown { background: var(--tag-brown); }
/* cor própria: o fundo e o texto (branco ou escuro, o mais legível) vêm no style */
:is(.notes-tag, .tag-pill, .notes-tag-swatch, .tag-dot).tag-custom { background: var(--tag-custom); color: var(--tag-ink, #fff); }
.notes-tag-swatch.is-add {
  position: relative; display: inline-grid; place-items: center; overflow: hidden;
  background: transparent; box-shadow: inset 0 0 0 1.5px var(--note-table-line);
  color: var(--color-text-secondary); font-size: 13px; line-height: 1;
}
.notes-tag-swatch.is-add:hover { background: var(--color-bg-hover); }
.notes-tag-swatch.is-add:focus-within { outline: 2px solid var(--input-ring-focus); outline-offset: 2px; }

/* etiquetas numa linha de tarefa ou num item da checklist: pequenas, depois do título */
.item-tags { display: inline-flex; flex-wrap: nowrap; flex-shrink: 0; align-items: center; gap: 4px; margin-left: 6px; vertical-align: middle; }
/* a pílula nunca encolhe até ficar ilegível: o título é que corta (nomes longos, com reticências) */
.item-tags .tag-pill { flex-shrink: 0; max-width: 9em; padding: 1px 8px; font-size: 0.7rem; font-weight: 600; }
/* × para tirar a etiqueta: escondido; ao passar o rato na pílula (ou com o foco nele) ela abre
   um pouco e ele aparece */
.tag-pill { display: inline-flex; align-items: center; }
.tag-pill-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-pill-x {
  display: inline-grid; place-items: center; flex: none; width: 0; height: 13px; margin-left: 0; padding: 0;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.22); color: #fff; cursor: pointer; opacity: 0; overflow: hidden;
  transition: width var(--duration-fast) var(--ease-fluent), margin var(--duration-fast) var(--ease-fluent), opacity var(--duration-fast) ease, background var(--duration-fast) ease;
}
.tag-pill:hover .tag-pill-x, .tag-pill:focus-within .tag-pill-x { width: 13px; margin-left: 4px; margin-right: -3px; opacity: 1; }
.tag-pill-x:hover { background: rgba(0, 0, 0, 0.42); }
.tag-pill-x:focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { .tag-pill-x { transition: none; } }
.tag-more { flex-shrink: 0; padding: 1px 6px; border-radius: 999px; background: var(--color-bg-hover); color: var(--color-text-secondary); font-size: 0.7rem; font-weight: 600; line-height: 1.3; cursor: default; }
.agora-focus-task > .item-tags { display: flex; flex-wrap: wrap; margin: 6px 0 0; }
.checklist-item.checked .item-tags { opacity: 0.6; }
/* linha de tarefa muito estreita: bolinhas da cor, com o nome na dica, para nada sair do cartão
   (até 300px; acima disso, na linha de baixo do título, a pílula cabe) */
@container (max-width: 300px) {
  .task-row .item-tags .tag-pill { width: 9px; height: 9px; max-width: none; padding: 0; font-size: 0; }
  .task-row .tag-pill-x { display: none; }   /* (bolinha: tira-se pelo botão direito) */
  .task-row .tag-more { padding: 0 4px; font-size: 0.64rem; }
}
/* checklist estreita (Foco ao lado da agenda numa janela pequena): o texto quebra por palavras e
   corta em 2 linhas (o texto todo na dica); as etiquetas descem para a linha de baixo; os botões
   do item flutuam por cima à direita, sem roubar largura ao texto */
.focus-checklist { container: checklist / inline-size; }
@container checklist (max-width: 420px) {
  .focus-checklist .checklist-text {
    overflow-wrap: break-word;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  }
  .focus-checklist .checklist-item:has(.item-tags) { flex-wrap: wrap; row-gap: 2px; }
  .focus-checklist .checklist-item .item-tags { order: 10; flex-basis: 100%; flex-wrap: wrap; flex-shrink: 1; min-width: 0; margin: 0 0 2px 28px; }
  .focus-checklist .checklist-item .item-tags .tag-pill { flex-shrink: 1; min-width: 0; max-width: 100%; }
  .focus-checklist .checklist-tools {
    position: absolute; top: 3px; right: 4px; z-index: 1; padding: 1px; border-radius: 8px;
    background: var(--color-bg-surface-elevated); border: var(--border-subtle); box-shadow: var(--shadow-elevated);
    pointer-events: none;
  }
  .focus-checklist .checklist-item:hover .checklist-tools,
  .focus-checklist .checklist-tools:focus-within { pointer-events: auto; }
}
/* calendário (semana) e modal do dia: as pílulas quebram de linha dentro do cartão */
.calendar-event-body .item-tags,
.day-modal-task-text .item-tags { display: flex; flex-wrap: wrap; margin: 5px 0 0; }
.calendar-event-body .item-tags .tag-pill { flex-shrink: 1; min-width: 0; max-width: 100%; }
.day-modal-task-text .item-tags { align-self: flex-start; }
/* calendário (mês): bolinhas no fim do chip */
.item-tag-dots { display: inline-flex; flex: none; gap: 2px; margin-left: auto; align-self: center; }
.item-tag-dots .tag-dot { width: 6px; height: 6px; }
/* bolinha da cor (submenu "Adicionar/Remover etiqueta", janela das etiquetas) */
.tag-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }

/* pôr / tirar: a pílula entra crescendo e sai encolhendo */
@keyframes tagPop { from { opacity: 0; transform: scale(0.6); } 60% { opacity: 1; transform: scale(1.06); } to { transform: none; } }
@keyframes tagOut { to { opacity: 0; transform: scale(0.6); } }
:is(.tag-pill, .notes-tag, .notes-tag-item).is-new { animation: tagPop 0.28s var(--ease-fluent); }
:is(.tag-pill, .notes-tag-item).is-leaving { animation: tagOut 0.16s ease forwards; pointer-events: none; }

/* "Gerenciar etiquetas" e "Nova etiqueta": janela leve, sem caixas; a lista edita-se no sítio */
.tag-sheet { display: flex; flex-direction: column; gap: 14px; }
.tag-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tag-sheet-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 600; color: var(--color-text-strong); }
.tag-sheet-count { padding: 1px 8px; border-radius: 999px; background: var(--color-bg-hover); color: var(--color-text-tertiary); font-size: 0.72rem; font-weight: 600; }
.tag-sheet-count:empty { display: none; }
.tag-sheet-close {
  display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--color-text-tertiary); cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.tag-sheet-close:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }

.tag-field {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 6px 0 13px;
  border: 1px solid transparent; border-radius: 12px; background: var(--color-bg-subtle);
  transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease;
}
.tag-field:focus-within { border-color: var(--input-ring-focus); }
.tag-field-dot { width: 13px; height: 13px; flex: none; padding: 0; border: 0; border-radius: 50%; transition: transform var(--duration-fast) var(--ease-fluent); }
button.tag-field-dot { cursor: pointer; }
button.tag-field-dot:hover { transform: scale(1.2); }
button.tag-field-dot:focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: 2px; }
#fluent-modal-box .tag-field-input { flex: 1; min-width: 0; padding: 0; border: 0; outline: none; color: var(--color-text-primary); font: inherit; font-size: 0.9rem; }
#fluent-modal-box .tag-field-input,
#fluent-modal-box .tag-field-input:focus { background: transparent; box-shadow: none; }
#fluent-modal-box .tag-field-input::placeholder { color: var(--color-text-tertiary); }
.tag-new-add {
  display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--color-text-tertiary); cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.tag-new-add:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }

.tag-palette { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-palette .notes-tag-swatch { width: 20px; height: 20px; transition: transform var(--duration-fast) var(--ease-fluent); }
.tag-palette .notes-tag-swatch:hover { transform: scale(1.15); }
.tag-palette-pop[hidden] { display: none; }
.tag-palette-pop { padding: 9px 12px; margin: 2px 0 4px; border-radius: 12px; background: var(--color-bg-subtle); list-style: none; }
.tag-palette-pop:not([hidden]) { animation: contextMenuIn var(--duration-fast) var(--ease-fluent); transform-origin: top left; }

.tag-manager-list { display: flex; flex-direction: column; gap: 1px; max-height: min(50vh, 360px); margin: 0 -6px; padding: 0; overflow-y: auto; list-style: none; }
.tag-row {
  display: flex; align-items: center; gap: 10px; max-height: 44px; padding: 3px 6px 3px 13px;
  border-radius: 10px; transition: background var(--duration-fast) ease;
}
.tag-row:hover, .tag-row:focus-within { background: var(--color-bg-subtle); }
#fluent-modal-box .tag-row-name {
  flex: 1; min-width: 0; margin-left: -6px; padding: 5px 6px; border: 0; border-radius: 6px; outline: none;
  background: transparent; color: var(--color-text-primary); font: inherit; font-size: 0.88rem; font-weight: 500;
  transition: background var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
  box-shadow: none;
}
#fluent-modal-box .tag-row-name:hover { background: var(--color-bg-hover); }
#fluent-modal-box .tag-row-name:focus { background: var(--color-bg-hover); box-shadow: 0 0 0 1.5px var(--input-ring-focus); }
.tag-row-count { flex: none; font-size: 0.76rem; color: var(--color-text-tertiary); white-space: nowrap; }
.tag-row-delete {
  display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--color-text-tertiary); cursor: pointer; opacity: 0;
  transition: opacity var(--duration-fast) ease, background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.tag-row:hover .tag-row-delete, .tag-row:focus-within .tag-row-delete, .tag-row-delete:focus-visible { opacity: 1; }
.tag-row-delete:hover { background: var(--color-bg-hover); color: var(--tag-red); }
/* mudar a ordem: alça ⋮⋮ na margem esquerda da linha (aparece no hover/foco), a linha segue o rato */
.tag-row { position: relative; }
.tag-row-grip {
  position: absolute; left: -1px; top: 50%; transform: translateY(-50%);
  display: inline-grid; place-items: center; width: 14px; height: 24px; padding: 0;
  border: 0; border-radius: 4px; background: transparent; color: var(--color-text-tertiary);
  cursor: grab; opacity: 0; touch-action: none; transition: opacity var(--duration-fast) ease;
}
.tag-row:hover .tag-row-grip, .tag-row-grip:focus-visible, .tag-row.is-dragging .tag-row-grip { opacity: 1; }
.tag-row-grip:focus-visible { outline: none; box-shadow: 0 0 0 1.5px var(--input-ring-focus); }
.tag-manager-list.is-sorting { user-select: none; }
.tag-manager-list.is-sorting, .tag-manager-list.is-sorting * { cursor: grabbing !important; }
.tag-manager-list.is-sorting .tag-row { transition: transform 0.16s var(--ease-fluent); }
.tag-manager-list.is-sorting .tag-row:not(.is-dragging) { background: transparent; }
.tag-manager-list.is-sorting .tag-row.is-dragging {
  z-index: 1; transition: none; background: var(--color-bg-hover);
  box-shadow: var(--shadow-dropdown);
}
@media (hover: none) { .tag-row-grip { opacity: 0.6; } }
.tag-manager-empty { padding: 18px 12px; text-align: center; font-size: 0.84rem; color: var(--color-text-tertiary); }
.tag-sheet-hint { display: flex; align-items: center; gap: 6px; margin: 0; padding-top: 12px; border-top: var(--border-subtle); font-size: 0.76rem; color: var(--color-text-tertiary); }
.tag-sheet-actions { display: flex; justify-content: flex-end; gap: 8px; }
.tag-form-error { margin: -6px 0 0; font-size: 0.8rem; color: var(--tag-red); }

/* a lista entra em cascata ao abrir; a criada entra destacada; a excluída sai recolhendo */
@keyframes tagRowIn { from { opacity: 0; transform: translateY(4px); } }
@keyframes tagRowNew { from { opacity: 0; transform: translateY(-4px); background: var(--color-bg-active); } 40% { opacity: 1; background: var(--color-bg-active); } }
@keyframes tagRowOut { to { opacity: 0; transform: translateX(10px); max-height: 0; padding-top: 0; padding-bottom: 0; } }
@keyframes tagShake { 20%, 60% { transform: translateX(-3px); } 40%, 80% { transform: translateX(3px); } }
.tag-manager-list.is-entering .tag-row { animation: tagRowIn 0.26s var(--ease-fluent) both; animation-delay: calc(var(--i, 0) * 24ms); }
.tag-row.is-new { animation: tagRowNew 0.6s var(--ease-fluent); }
.tag-row.is-leaving { animation: tagRowOut 0.18s ease forwards; overflow: hidden; pointer-events: none; }
.is-shaking { animation: tagShake 0.3s ease; }
@media (prefers-reduced-motion: reduce) {
  :is(.tag-pill, .notes-tag, .notes-tag-item).is-new, :is(.tag-pill, .notes-tag-item).is-leaving,
  .tag-manager-list.is-entering .tag-row, .tag-row.is-new, .tag-row.is-leaving, .is-shaking, .tag-palette-pop:not([hidden]) { animation: none; }
}

/* lixeira: não abre; Restaurar / Excluir na base */
.notes-item.is-trashed .notes-card { opacity: 0.92; }
.notes-card-trash { font-size: 0.8rem; color: var(--note-card-text); }
.notes-card-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.notes-card-actions .fluent-btn { display: inline-flex; align-items: center; gap: 4px; }

.notes-empty { padding: 14px 4px; margin: 0; font-size: 0.88rem; }

/* a nota aberta é uma PÁGINA (estilo Notion): sem caixa nem campos com borda; barra mínima
   no topo e uma coluna central de até 720px com o título, as etiquetas e o texto */
.notes-editor {
  flex: 1 0 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* etiquetas logo abaixo do título, discretas (como propriedades da página) */
.notes-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 22px; min-height: 26px; }
.notes-tags .notes-tag { padding: 2px 10px; font-size: 0.74rem; }
.notes-tags .notes-tag-add { color: var(--color-text-tertiary); font-size: 0.8rem; }
.notes-tags .notes-tag-add:hover { color: var(--color-text-primary); }
.notes-tag-list { list-style: none; margin: 0; padding: 0; display: contents; }
.notes-tag-item { display: inline-flex; align-items: center; gap: 1px; min-width: 0; }
.notes-tags .notes-tag { cursor: pointer; }

.notes-tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-tertiary);
  cursor: pointer;
}

.notes-tag-remove:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }
.notes-tag-add { display: inline-flex; align-items: center; gap: 4px; }

.notes-tag-palette { display: flex; flex-wrap: wrap; gap: 6px; }

.notes-tag-swatch {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.notes-tag-swatch[aria-checked="true"] { outline: 2px solid var(--color-text-strong); outline-offset: 2px; }
.notes-tag-swatch:focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: 2px; }

.notes-editor-pane {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

/* barra mínima: "‹ Notas" à esquerda; "Salvo", fixar, vínculos e (…) à direita */
.notes-editor-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  /* fixa no topo ao rolar a nota; a sombra para cima tapa o respiro do .view-container */
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--notes-bar-bg, var(--color-bg-base));
  box-shadow: 0 -20px 0 var(--notes-bar-bg, var(--color-bg-base));
}
.notes-back { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 8px; }

.notes-status {
  flex: 1;
  min-width: 0;
  padding-right: 6px;
  text-align: right;
  font-size: 0.74rem;
  color: var(--color-text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-status.is-error { color: #b42318; white-space: normal; font-weight: 600; }
:root[data-theme="dark"] .notes-status.is-error { color: #ff8a80; }

.notes-pin, .notes-more { display: inline-flex; align-items: center; justify-content: center; }
.notes-pin[aria-pressed="true"] { color: var(--color-text-strong); background: var(--color-bg-active); }
.notes-btn-label { font-size: 0.78rem; }

.notes-links-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--color-text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
}

/* menu (…) */
.notes-menu-wrap { position: relative; }

.notes-menu,
.notes-pop {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 5;
  min-width: 200px;
  max-height: min(420px, calc(100vh - 140px));   /* abre da barra do topo: sempre inteiro, rola se for longo */
  overflow-y: auto;
  padding: 4px;
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-surface);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
}

.notes-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 0;
  border-radius: var(--radius-sm, 6px);
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
}

.notes-menu-item:hover, .notes-menu-item:focus-visible { background: var(--color-bg-hover); outline: none; }
.notes-menu-item[hidden] { display: none; }
.notes-menu-item .notes-btn-label { font-size: 0.86rem; }

/* vínculos da nota (popover da barra) */
.notes-menu-heading {
  padding: 6px 10px 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

.notes-links-pop { min-width: 240px; max-width: 340px; }
.notes-link-row { display: flex; align-items: center; gap: 2px; }
.notes-link-row .notes-link-open { flex: 1; min-width: 0; }
.notes-link-row .notes-link-open .notes-btn-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* "Notas de: <tarefa>" (filtro vindo do "Ver notas vinculadas") */
.notes-target-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 3px 4px 3px 14px;
  border-radius: 999px;
  background: var(--color-text-strong);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
}
:root[data-theme="dark"] .notes-target-chip { color: #141414; }
.notes-target-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }

.notes-target-chip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.notes-target-chip-x:hover { background: rgba(255, 255, 255, 0.18); }

/* seletor "Vincular nota existente…" */
.notes-picker-overlay {
  position: fixed;
  inset: 0;
  /* janela (seletor, "Atalhos do editor"): acima dos modais (3000), do menu "/", da barra
     flutuante e do painel da tabela (1300) e do card de Novidades (2000); abaixo das
     confirmações (3300), do menu do botão direito (3500) e dos avisos (4000) */
  z-index: 3100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  background: rgba(10, 12, 16, 0.32);
}

.notes-picker {
  width: 100%;
  max-width: 480px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--color-bg-surface);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.notes-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.notes-picker-title { margin: 0; font-size: 1.05rem; font-weight: 600; }
.notes-picker-target { margin: -6px 0 0; font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-picker-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 0; }

.notes-picker-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.notes-picker-item:hover:not(:disabled), .notes-picker-item:focus-visible { background: var(--color-bg-hover); outline: none; }
.notes-picker-item:disabled { cursor: default; opacity: 0.55; }
.notes-picker-item-title { font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-picker-item-snippet { font-size: 0.8rem; color: var(--color-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-picker-item-linked { font-size: 0.72rem; color: var(--color-text-tertiary); }
/* "Vincular a…": ícone do tipo (tarefa, item, projeto) à esquerda */
.notes-picker-target-item { flex-direction: row; align-items: flex-start; gap: 10px; }
.notes-picker-target-item > .ui-ico { flex-shrink: 0; margin-top: 2px; color: var(--color-text-secondary); }
.notes-picker-item-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notes-picker-target-item.is-done .notes-picker-item-title { color: var(--color-text-secondary); }
.notes-picker-empty { padding: 10px; font-size: 0.86rem; }

/* "+" fantasma na linha vazia (abre o menu do "/"); a página tem 32px de margem à esquerda */
.notes-view .notes-rich { position: relative; }
.notes-plus {
  position: absolute;
  left: -32px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-tertiary);
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--duration-fast) ease, background-color var(--duration-fast) ease, color var(--duration-fast) ease;
}
.notes-plus:hover { opacity: 1; background: var(--color-bg-hover); color: var(--color-text-primary); }
.notes-view.notes-narrow .notes-plus { display: none; }   /* sem margem: fica o "/" */

/* dica da primeira vez, logo abaixo do título */
.notes-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 8px 8px 8px 14px;
  border-radius: 10px;
  background: var(--color-bg-hover);
  color: var(--color-text-secondary);
  font-size: 0.84rem;
  animation: contextMenuIn var(--duration-normal) var(--ease-fluent);
}
.notes-tip-text { flex: 1; min-width: 0; }
.notes-tip-ok {
  flex-shrink: 0;
  padding: 4px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--color-text-strong);
  color: #fff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
:root[data-theme="dark"] .notes-tip-ok { color: #141414; }

/* "Atalhos" (menu …): duas listas, nome à esquerda e tecla à direita */
.notes-shortcuts-box { max-width: 520px; max-height: 76vh; overflow-y: auto; }
.notes-shortcuts-heading {
  margin: 6px 0 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}
.notes-shortcuts-list { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin: 0; font-size: 0.86rem; }
.notes-shortcuts-list dt { color: var(--color-text-primary); }
.notes-shortcuts-list dd { margin: 0; text-align: right; }
.notes-shortcuts-list kbd {
  display: inline-block;
  padding: 1px 7px;
  border: var(--border-subtle);
  border-radius: 5px;
  background: var(--color-bg-hover);
  font-family: Consolas, 'Cascadia Code', monospace;
  font-size: 0.78rem;
  white-space: pre;
}

/* contador de notas vinculadas nas tarefas e itens (≠ "Detalhes" da tarefa) */
.linked-notes-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  margin-left: 6px;
  padding: 1px 7px;
  border: 0;
  border-radius: 999px;
  background: var(--color-bg-hover);
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.5;
  vertical-align: middle;
  cursor: pointer;
}
.linked-notes-badge:hover { background: var(--color-bg-active); color: var(--color-text-primary); }
.linked-notes-badge:focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: 1px; }
.agora-title .linked-notes-badge { font-size: 0.78rem; margin-left: 10px; }

/* a página: coluna central com respiro nas laterais e no topo */
.notes-page {
  width: 100%;
  max-width: 920px;   /* era 720px: o texto também ocupa mais da tela (pedido de 17/11) */
  margin: 0 auto;
  padding: 56px 32px 96px;
  box-sizing: border-box;
}

.notes-title,
.notes-body {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--color-text-primary);
  font-family: var(--font-main);
  outline: none;
}

/* título grande direto na página (.notes-view na frente: vence o estilo global de input) */
.notes-view .notes-title {
  height: auto;
  margin: 0 0 10px;
  padding: 0;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  resize: none;           /* textarea de uma linha que quebra (fitTitle no notes-ui.js) */
  overflow: hidden;
  overflow-wrap: anywhere;
}

/* o texto começa logo abaixo, sem caixa; cresce com o conteúdo (fitBody) e quem rola é a página */
.notes-view .notes-body {
  min-height: 45vh;
  padding: 0;
  font-size: 1rem;
  line-height: 1.7;
  resize: none;
  overflow: hidden;
  box-shadow: none;
  border-radius: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;   /* texto longo (URLs, palavras enormes) quebra sem estourar */
  word-break: break-word;
}

/* em foco e no tema escuro também sem caixa (vence os estilos globais de input/textarea) */
.notes-view .notes-title:focus,
.notes-view .notes-body:focus,
:root[data-theme="dark"] .notes-view .notes-title,
:root[data-theme="dark"] .notes-view .notes-body,
:root[data-theme="dark"] .notes-view .notes-title:focus,
:root[data-theme="dark"] .notes-view .notes-body:focus { background: transparent; border: 0; box-shadow: none; outline: none; }

.notes-title::placeholder, .notes-body::placeholder { color: var(--color-text-tertiary); opacity: 0.75; }

.notes-limit {
  margin: 16px 0 0;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.notes-limit.is-full { color: #b42318; font-weight: 600; }
:root[data-theme="dark"] .notes-limit.is-full { color: #ff8a80; }

/* --------------------------------------------------------------------------
   Editor rico (notes-editor.js, Tiptap): blocos direto na página, sem barra fixa
   -------------------------------------------------------------------------- */
.notes-view .notes-rich { min-height: 45vh; }
.notes-prose {
  min-height: 45vh;
  outline: none;
  color: var(--color-text-primary);
  font-family: var(--font-main);
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* Ritmo do texto (0.6.3), de dentro para fora:
   - linhas de um parágrafo: line-height;
   - entre parágrafos: 0.6em (antes era 0: o "p { margin: 0 }" anulava o respiro e tudo colava);
   - blocos (listas, checklist, citação, código, imagem, divisor): 1em acima e abaixo, para se
     separarem do texto (as margens colapsam: bloco seguido de parágrafo = 1em, não 1.6em);
   - título: mais espaço antes (abre uma seção) e cola no que vem depois (pertence a ele). */
.notes-prose > * + * { margin-top: 0.6em; }
.notes-prose p { margin: 0; }
.notes-prose > p + p { margin-top: 0.6em; }
.notes-prose h1, .notes-prose h2, .notes-prose h3 { margin: 1.4em 0 0.3em; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; color: var(--color-text-strong); }
.notes-prose h1 { font-size: 1.85rem; }
.notes-prose h2 { font-size: 1.45rem; }
.notes-prose h3 { font-size: 1.18rem; }
.notes-prose ul, .notes-prose ol { margin: 0.2em 0; padding-left: 1.5em; }
.notes-prose > :is(ul, ol, blockquote, pre, img, hr) { margin-top: 1em; margin-bottom: 1em; }
.notes-prose > :is(h1, h2, h3) + * { margin-top: 0.4em; }
.notes-prose > :first-child { margin-top: 0; }
/* alinhamento (botão da barra flutuante, Ctrl+Shift+L/E/R): títulos e parágrafos */
.notes-prose [data-align="center"], .note-mini [data-align="center"] { text-align: center; }
.notes-prose [data-align="right"], .note-mini [data-align="right"] { text-align: right; }
.notes-prose li > p { margin: 0; }
.notes-prose blockquote {
  margin: 0.4em 0;
  padding: 0.1em 0 0.1em 1em;
  border-left: 3px solid var(--color-text-strong);
  color: var(--color-text-secondary);
}
.notes-prose code {
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: var(--color-bg-hover);
  font-family: Consolas, 'Cascadia Code', monospace;
  font-size: 0.9em;
}
.notes-prose pre {
  margin: 0.5em 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--color-bg-hover);
  overflow-x: auto;
}
.notes-prose pre code { padding: 0; background: none; font-size: 0.88rem; }
.notes-prose hr { margin: 1em 0; border: 0; border-top: 1px solid var(--color-text-tertiary); opacity: 0.4; }
.notes-prose a { color: var(--tag-blue); text-decoration: underline; text-underline-offset: 2px; cursor: text; }
.notes-prose img { display: block; max-width: 100%; height: auto; margin: 0.5em 0; border-radius: var(--radius-md); }
/* imagem selecionada: contorno inteiro, fora da imagem e com os cantos dela (o outline do
   Chromium segue o border-radius); o texto rico não esconde o que passa da caixa */
.notes-view .notes-rich { overflow: visible; }
.notes-prose img.ProseMirror-selectednode {
  outline: 2px solid var(--note-image-ring);
  outline-offset: 3px;
}
/* checklist dentro da nota */
.notes-prose ul[data-type="taskList"] { list-style: none; padding-left: 0.2em; }
/* Leitura por cima: cada item é um bloco compacto (letra um pouco menor, linhas do mesmo item
   mais juntas) e o respiro fica ENTRE os itens; assim uma lista longa não vira um parágrafo só */
.notes-prose ul[data-type="taskList"] li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.95em; line-height: 1.5; }
.notes-prose ul[data-type="taskList"] li + li { margin-top: 0.4em; }
.notes-prose ul[data-type="taskList"] li li { font-size: 1em; }   /* sublista: não encolhe de novo */
/* opção "Linhas entre os itens da checklist" (Configurações → Notas): o respiro entre itens vira
   meio acima e meio abaixo de uma linha fina, que começa no texto (a caixa fica livre) */
:root.notes-check-lines .notes-prose ul[data-type="taskList"] > li + li { margin-top: 0.4em; padding-top: 0.4em; position: relative; }
:root.notes-check-lines .notes-prose ul[data-type="taskList"] > li + li::before {
  content: ''; position: absolute; top: 0; left: 28px; right: 0;   /* 28px = caixa (18) + espaço (10) */
  border-top: var(--border-subtle);
}
:root[data-theme="dark"].notes-check-lines .notes-prose ul[data-type="taskList"] > li + li::before { border-top-color: rgba(255, 255, 255, 0.1); }
/* Caixa da checklist das notas = a das tarefas (.checklist-box): o input do Tiptap vira a
   caixa (appearance: none) e o ✓ é a imagem de fundo, que cresce ao marcar. (O <span> do
   Tiptap é o rótulo escondido para leitores de tela, com estilo inline: não se mexe nele.) */
/* a caixa fica no meio da 1.ª linha (altura da linha − caixa) / 2, também quando o texto quebra */
.notes-prose ul[data-type="taskList"] li > label { flex-shrink: 0; display: grid; margin-top: calc((1.5em - 18px) / 2); cursor: pointer; }
.notes-prose ul[data-type="taskList"] li > label input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid rgba(0, 0, 0, 0.32);
  border-radius: 6px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 0 0 no-repeat;
  cursor: pointer;
  transition: background-color var(--duration-fast) ease, border-color var(--duration-fast) ease, background-size 0.22s var(--ease-fluent), transform 0.12s ease;
}
.notes-prose ul[data-type="taskList"] li > label:hover input { border-color: rgba(0, 0, 0, 0.6); }
.notes-prose ul[data-type="taskList"] li > label input:active { transform: scale(0.9); }
.notes-prose ul[data-type="taskList"] li > label input:focus-visible { outline: 2px solid var(--color-text-primary); outline-offset: 2px; }
.notes-prose ul[data-type="taskList"] li > label input:checked { background-color: #111; border-color: #111; background-size: 12px 12px; animation: checklistPop 0.26s var(--ease-fluent); }
.notes-prose ul[data-type="taskList"] li > div { flex: 1; min-width: 0; transition: color var(--duration-fast) ease; }
.notes-prose ul[data-type="taskList"] li[data-checked="true"] > div { color: var(--color-text-tertiary); text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, 0.35); }
:root[data-theme="dark"] .notes-prose ul[data-type="taskList"] li > label input { background-color: transparent; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); border-color: rgba(255, 255, 255, 0.4); }
:root[data-theme="dark"] .notes-prose ul[data-type="taskList"] li > label:hover input { border-color: rgba(255, 255, 255, 0.7); }
:root[data-theme="dark"] .notes-prose ul[data-type="taskList"] li > label input:checked { background-color: #fff; border-color: #fff; }
:root[data-theme="dark"] .notes-prose ul[data-type="taskList"] li[data-checked="true"] > div { text-decoration-color: rgba(255, 255, 255, 0.35); }
@media (prefers-reduced-motion: reduce) {
  .notes-prose ul[data-type="taskList"] li > label input:checked { animation: none; }
  .notes-prose ul[data-type="taskList"] li > label input { transition: none; }
}
/* tabela dentro da nota: linhas finas, cantos redondos, cabeçalho discreto. Larga demais
   (muitas colunas) → rola na horizontal, sem empurrar a página */
/* (margem de baixo maior: espaço para a barra "+" de linha sem cobrir o texto seguinte) */
.notes-prose .tableWrapper { margin: 0.7em 0 30px; overflow-x: auto; }
/* a tabela tem a largura da coluna do texto (920px): página alinhada, sem a tabela "saltar"
   para fora (decisão de 18/11, no lugar da tabela até 1200px). Muitas colunas → rola dentro dela */
.notes-prose table {
  width: 100%;
  margin: 0.7em 0;
  border: 1px solid var(--note-table-line);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  table-layout: fixed;
  font-size: 0.95em;
  line-height: 1.5;
}
.notes-prose .tableWrapper > table { margin: 0; }
/* "Números das linhas e colunas" (Configurações da tabela), como numa planilha: contadores do
   CSS, que acompanham a tabela e não entram no texto copiado. A margem negativa mantém a tabela
   alinhada com o texto da nota; sem o overflow da tabela, os cantos passam a ser das células. */
.notes-prose .tableWrapper:has(> table[data-show-row-count]) { margin-left: -30px; padding: 22px 0 1px 30px; }
.notes-prose table[data-show-row-count] { overflow: visible; counter-reset: note-row; }
.notes-prose table[data-show-row-count] tr { counter-increment: note-row; }
.notes-prose table[data-show-row-count] tr:first-child { counter-reset: note-col; }
.notes-prose table[data-show-row-count] tr:first-child > * { counter-increment: note-col; }
/* os números ficam nas células: um ::before/::after direto no <tr> criaria uma coluna vazia */
.notes-prose table[data-show-row-count] tr > :first-child::before,
.notes-prose table[data-show-row-count] tr:first-child > *::after {
  position: absolute;
  display: flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--color-text-tertiary);
  background: none;
  pointer-events: none;
  user-select: none;
}
.notes-prose table[data-show-row-count] tr > :first-child::before { content: counter(note-row); top: 0; bottom: 0; left: -31px; width: 22px; justify-content: flex-end; }
.notes-prose table[data-show-row-count] tr:first-child > *::after { content: counter(note-col); top: -22px; bottom: auto; left: 0; right: 0; height: 16px; justify-content: center; }
/* na 1.ª linha o ::after é o número: o destaque da seleção vai no fundo da célula */
.notes-prose table[data-show-row-count] tr:first-child > .selectedCell { background-image: linear-gradient(var(--note-table-selected), var(--note-table-selected)); }
.notes-prose table[data-show-row-count] tr:first-child > :first-child { border-top-left-radius: calc(var(--radius-md) - 1px); }
.notes-prose table[data-show-row-count] tr:first-child > :last-child { border-top-right-radius: calc(var(--radius-md) - 1px); }
.notes-prose table[data-show-row-count] tr:last-child > :first-child { border-bottom-left-radius: calc(var(--radius-md) - 1px); }
.notes-prose table[data-show-row-count] tr:last-child > :last-child { border-bottom-right-radius: calc(var(--radius-md) - 1px); }
.notes-prose td, .notes-prose th {
  position: relative;
  min-width: 90px;
  padding: 7px 12px;
  border-right: 1px solid var(--note-table-line);
  border-bottom: 1px solid var(--note-table-line);
  text-align: left;
  vertical-align: top;
}
.notes-prose tr > :last-child { border-right: 0; }
.notes-prose tr:last-child > * { border-bottom: 0; }
.notes-prose th {
  background: var(--note-table-head);
  color: var(--color-text-strong);
  font-weight: 600;
}
.notes-prose td > p, .notes-prose th > p { margin: 0; }
/* largura das colunas (0.6.4): a borda entre duas colunas arrasta-se (prosemirror-tables põe a
   .column-resize-handle na célula sob o rato e .resize-cursor no editor). Coluna estreita = o
   texto quebra (palavras longas e links também, sem sair da célula). A largura mínima é a do
   notes-editor.js (TABLE_COL_MIN), não o min-width daqui. */
.notes-prose td, .notes-prose th { min-width: 0; overflow-wrap: anywhere; }
.notes-prose .column-resize-handle {
  position: absolute;
  top: -1px;
  bottom: -1px;
  right: -2px;
  z-index: 3;
  width: 3px;
  border-radius: 2px;
  background: var(--tag-blue);
  pointer-events: none;
}
.notes-prose.resize-cursor, .ProseMirror.resize-cursor, .resize-cursor .notes-prose { cursor: col-resize; }
/* barras "+" da tabela (notes-editor.js): à direita = coluna, embaixo = linha */
.notes-table-add,
.notes-table-menu {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--color-bg-hover);
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  animation: notes-table-add-in 0.16s ease both;
  transition: background-color var(--duration-smooth, 0.2s) ease, color var(--duration-smooth, 0.2s) ease;
}
.notes-table-add[hidden], .notes-table-menu[hidden] { display: none; }
.notes-table-menu { width: 18px; }
.notes-table-add.is-col { width: 18px; }
.notes-table-add.is-row { height: 18px; }
.notes-table-add:hover,
.notes-table-menu:hover { background: var(--color-bg-active); color: var(--color-text-strong); }
.notes-view.notes-narrow .notes-table-add.is-col,
.notes-view.notes-narrow .notes-table-menu { display: none; }   /* sem margem: coluna e opções pelo botão direito */
/* mudar colunas e linhas de lugar (0.6.4): alça ⠿ por cima da borda de cima da coluna e da
   borda esquerda da linha; ao arrastar, a sombra segue o rato e a LINHA AZUL (com bolinhas nas
   pontas, como nos editores de documentos) mostra entre quais colunas/linhas ela vai ficar */
.notes-table-grip {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 26px;
  height: 16px;
  padding: 0;
  border: var(--border-subtle);
  border-radius: 6px;
  background: var(--color-bg-surface-elevated);
  color: var(--color-text-tertiary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  cursor: grab;
  touch-action: none;
  animation: notes-table-add-in 0.16s ease both;
}
.notes-table-grip.is-row { width: 16px; height: 26px; }
.notes-table-grip[hidden], .notes-table-ghost[hidden], .notes-table-drop[hidden] { display: none; }
.notes-table-grip:hover { color: var(--color-text-strong); background: var(--color-bg-hover); }
.is-moving-table, .is-moving-table * { cursor: grabbing !important; user-select: none; }
.is-moving-col .notes-table-grip.is-col, .is-moving-row .notes-table-grip.is-row { color: #fff; background: var(--tag-blue); border-color: transparent; }
.is-moving-col .notes-table-grip.is-row, .is-moving-row .notes-table-grip.is-col { visibility: hidden; }
.notes-table-ghost {
  position: absolute;
  z-index: 2;
  border-radius: 6px;
  background: color-mix(in srgb, var(--tag-blue) 10%, transparent);
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--tag-blue) 55%, transparent), var(--shadow-dropdown);
  pointer-events: none;
}
.notes-table-drop {
  position: absolute;
  z-index: 4;
  width: 3px;
  border-radius: 2px;
  background: var(--tag-blue);
  pointer-events: none;
}
.notes-table-drop.is-row { width: auto; height: 3px; }
.notes-table-drop::before, .notes-table-drop::after {
  content: '';
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--tag-blue);
  box-shadow: 0 0 0 2px var(--color-bg-surface-elevated);
}
.notes-table-drop:not(.is-row)::before { top: -4px; left: -3px; }
.notes-table-drop:not(.is-row)::after { bottom: -4px; left: -3px; }
.notes-table-drop.is-row::before { left: -4px; top: -3px; }
.notes-table-drop.is-row::after { right: -4px; top: -3px; }
@keyframes notes-table-add-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .notes-table-add { animation: none; } }
/* células selecionadas (arrastar sobre a tabela) */
.notes-prose .selectedCell::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--note-table-selected);
  pointer-events: none;
}
/* placeholder do primeiro parágrafo vazio */
.notes-prose p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  height: 0;
  color: var(--color-text-tertiary);
  opacity: 0.75;
  pointer-events: none;
}

/* barra flutuante ao selecionar texto */
.notes-bubble {
  display: flex;
  flex-direction: column;
  padding: 4px;
  border: var(--border-subtle);
  border-radius: 10px;
  background: var(--color-bg-surface);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
  z-index: 1300;   /* acima da barra lateral (100), como o menu do "/"; abaixo dos modais e do menu do botão direito */
}
.notes-bubble-row { display: flex; align-items: center; gap: 2px; }
.notes-bubble [hidden] { display: none !important; }
.notes-bubble-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.notes-bubble-btn:hover { background: var(--color-bg-hover); }
.notes-bubble-btn[aria-pressed="true"] { background: var(--color-text-strong); color: #fff; }
:root[data-theme="dark"] .notes-bubble-btn[aria-pressed="true"] { color: #141414; }
.notes-bubble-btn.is-bold { font-weight: 800; }
.notes-bubble-btn.is-italic { font-style: italic; }
.notes-bubble-btn.is-underline { text-decoration: underline; }
.notes-bubble-btn.is-strike { text-decoration: line-through; }
.notes-bubble-btn.is-code { font-family: Consolas, monospace; font-size: 0.76rem; }
.notes-bubble-sep { width: 1px; height: 18px; margin: 0 3px; background: var(--color-text-tertiary); opacity: 0.35; }
.notes-bubble-size {
  height: 28px;
  padding: 0 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.notes-bubble-size:hover { background: var(--color-bg-hover); }
.notes-bubble-link-input {
  width: 220px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
  font: inherit;
  font-size: 0.84rem;
  outline: none;
}

/* menu do comando "/" */
/* Em categorias (Texto · Listas · Inserir): ícone num quadradinho, nome + dica, e à direita
   o atalho de Markdown que faz o mesmo sem abrir o menu. Rodapé com as teclas. */
.notes-slash {
  position: fixed;
  z-index: 1300;
  width: 296px;
  max-height: 380px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 4px 0;
  border: var(--border-subtle);
  border-radius: 12px;
  background: var(--color-bg-surface);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
  scrollbar-width: thin;
}
.notes-slash-group {
  padding: 8px 10px 4px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}
.notes-slash-group:not(:first-child) { margin-top: 4px; border-top: var(--border-subtle); padding-top: 10px; }
.notes-slash-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.notes-slash-item.is-active { background: var(--color-bg-hover); }
.notes-slash-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: var(--border-subtle);
  border-radius: 8px;
  background: var(--color-bg-subtle);
  color: var(--color-text-secondary);
  transition: color var(--duration-fast) ease, background-color var(--duration-fast) ease, transform var(--duration-fast) var(--ease-fluent);
}
.notes-slash-item.is-active .notes-slash-ico { color: var(--color-text-strong); background: var(--color-bg-surface); transform: scale(1.04); }
.notes-slash-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.notes-slash-label { font-size: 0.86rem; font-weight: 600; }
.notes-slash-hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.72rem; color: var(--color-text-tertiary); }
.notes-slash-md,
.notes-slash-foot kbd {
  flex: none;
  padding: 1px 5px;
  border: var(--border-subtle);
  border-radius: 4px;
  background: var(--color-bg-subtle);
  font: 500 0.68rem/1.4 ui-monospace, 'Cascadia Mono', Consolas, monospace;
  color: var(--color-text-tertiary);
}
.notes-slash-item.is-active .notes-slash-md { color: var(--color-text-secondary); }
.notes-slash-empty { padding: 10px; font-size: 0.84rem; color: var(--color-text-tertiary); }
.notes-slash-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 12px;
  margin: 4px -4px 0;
  padding: 7px 12px;
  border-top: var(--border-subtle);
  background: var(--color-bg-surface);
  font-size: 0.7rem;
  color: var(--color-text-tertiary);
}
.notes-slash-foot kbd { padding: 0 4px; margin-right: 2px; }

/* --------------------------------------------------------------------------
   Movimento das Notas (estilo Fluent: --ease-fluent, 0,16 s nos menus e 0,28 s
   nas trocas de tela). Com "reduzir movimento" do Windows ligado, nada se mexe.
   -------------------------------------------------------------------------- */
@keyframes notesEnter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes notesCardIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
/* abrir/fechar uma nota: a parte que aparece (classe posta pelo notes-ui.js) */
.notes-editor.is-entering,
.notes-library.is-entering { animation: notesEnter var(--duration-normal) var(--ease-fluent); }
/* troca de filtro: os cards em cascata (--i = posição, até 12) */
.notes-grid.is-entering > .notes-item { animation: notesCardIn var(--duration-normal) var(--ease-fluent) both; animation-delay: calc(var(--i, 0) * 22ms); }
/* menus, seletor e "/": como o menu do botão direito do app */
.notes-menu:not([hidden]),
.notes-pop:not([hidden]),
.notes-slash { animation: contextMenuIn var(--duration-fast) var(--ease-fluent); transform-origin: top right; }
.notes-slash { transform-origin: top left; }
.notes-picker-overlay { animation: modalOverlayFadeIn var(--duration-fast) ease; }
.notes-picker { animation: modalBoxPopIn var(--duration-normal) var(--ease-fluent); }
.notes-bubble { transition: opacity var(--duration-fast) ease; }
/* botões: cor que muda suave e um leve "afundar" ao clicar */
.notes-filter,
.notes-menu-item,
.notes-bubble-btn,
.notes-tag-swatch,
.notes-search-clear,
.notes-tag-remove,
.notes-picker-item,
.notes-slash-item,
.linked-notes-badge {
  transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease,
              transform var(--duration-fast) var(--ease-fluent), outline-color var(--duration-fast) ease;
}
.notes-filter:active,
.notes-bubble-btn:active,
.notes-tag-swatch:active,
.notes-search-clear:active,
.notes-tag-remove:active,
.linked-notes-badge:active { transform: scale(0.94); }
.notes-search-clear:active { transform: translateY(-50%) scale(0.9); }
.notes-tags .notes-tag { transition: filter var(--duration-fast) ease, transform var(--duration-fast) var(--ease-fluent); }
.notes-tags .notes-tag:hover { filter: brightness(1.08); }
.notes-tags .notes-tag:active { transform: scale(0.96); }
.notes-item-btn.notes-card:active { transform: scale(0.985); }

@media (prefers-reduced-motion: reduce) {
  .notes-view *, .notes-view, .notes-picker-overlay, .notes-picker-overlay *, .notes-slash, .notes-bubble {
    animation: none !important;
    transition: none !important;
  }
  .notes-item-btn.notes-card:hover, .notes-item-btn.notes-card:active { transform: none; }
}

/* janela estreita: cards menores (o "ou a biblioteca, ou o editor" vale sempre) */
.notes-view.notes-narrow .notes-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.notes-view.notes-narrow .notes-card { padding: 20px 20px 18px; border-radius: 26px; gap: 8px; }
.notes-view.notes-narrow .notes-card .notes-item-title { font-size: 1.45rem; }
.notes-view.notes-narrow .notes-card .notes-item-snippet { font-size: 0.82rem; }
.notes-view.notes-narrow .notes-page { padding: 28px 8px 64px; }
.notes-view.notes-narrow .notes-title { font-size: 1.9rem; }

/* ==========================================================================
   BARRA DE TÍTULO PRÓPRIA (janela principal sem moldura — ver titlebar.js)
   Faixa transparente em todo o topo da janela: arrasta em qualquer ponto livre.
   Símbolo no canto superior esquerdo, logotipo manuscrito ao centro, controles à direita.
   Fica acima de modais, onboarding e splash (sempre dá para minimizar/fechar).
   Monocromática; só o Fechar ganha vermelho no hover.
   ========================================================================== */
:root {
  --titlebar-h: 44px;
  --float-gap: 10px;        /* folga da sidebar flutuante até as bordas da janela */
  --tb-fg: var(--color-text-secondary);
  --tb-fg-hover: var(--color-text-primary);
  --tb-hover: var(--color-bg-hover);
  --tb-press: var(--color-bg-active);
}

.app-titlebar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--titlebar-h);
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  z-index: 10001;
  user-select: none;
  -webkit-user-select: none;
}

.app-titlebar[hidden] { display: none; }

/* Marca: símbolo (LOGO_WHITE) e logotipo manuscrito (LOGOTIPO_WHITE) com o mesmo traço
   branco — invertidos no tema claro. Mesma altura visual: o símbolo (redondo) um pouco
   maior que o manuscrito, que tem ascendente alto e x-height baixa. */
.titlebar-symbol,
.titlebar-logo {
  position: absolute;
  top: 50%;
  width: auto;
  opacity: 0.86;
  pointer-events: none;
  transition: opacity var(--duration-smooth) ease;
}

/* símbolo no canto superior esquerdo da janela (como o ícone de um app no Windows) */
.titlebar-symbol {
  left: 12px;
  height: 24px;
  transform: translateY(-50%);
}

/* título: logotipo manuscrito centrado na janela */
.titlebar-logo {
  left: 50%;
  height: 20px;
  transform: translate(-50%, -50%);
}

/* Estilo do título (Configurações → Aparência; classe title-* no <html>):
   split = símbolo no canto + manuscrito ao centro (padrão, regras acima) */
html.title-symbol .titlebar-logo { display: none; }
html:is(.title-wordmark, .title-corner) .titlebar-symbol { display: none; }
/* corner: só o manuscrito, no lugar do símbolo (cabe com a barra no centro) */
html.title-corner .titlebar-logo {
  left: 14px;
  transform: translateY(-50%);
}
/* together: o manuscrito encosta ao símbolo (símbolo 12px + 24px, mais 8px de respiro) */
html.title-together .titlebar-logo {
  left: 44px;
  transform: translateY(-50%);
}

/* Tela de carregamento: visual limpo, sem a marca; ela aparece com fade quando a tela sai */
html:has(#udo-splash:not(.is-leaving)) :is(.titlebar-symbol, .titlebar-logo) { opacity: 0; transition: none; }

:root:not([data-theme="dark"]) :is(.titlebar-symbol, .titlebar-logo) { filter: invert(1); }
html.window-blurred :is(.titlebar-symbol, .titlebar-logo) { opacity: 0.4; }
/* sobre o onboarding (escuro nos dois temas) fica sempre branca */
html:has(#onboarding-overlay:not([hidden])) :is(.titlebar-symbol, .titlebar-logo) { filter: none; }

/* ---- Sidebar flutuante: cartão abaixo da barra, solto das bordas da janela ---- */
html.has-titlebar .fluent-sidebar {
  top: var(--titlebar-h);
  left: var(--float-gap);
  bottom: var(--float-gap);
  height: auto;
  padding-top: 12px;
  border: 1px solid var(--sb-border);
  border-radius: 16px;
}

/* (seletores mais fortes que os dos temas, que também definem a sombra) */
html.has-titlebar .app-shell .fluent-sidebar {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.05);
}
:root[data-theme="dark"].has-titlebar .app-shell .fluent-sidebar {
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* o conteúdo começa abaixo da barra e ao lado da sidebar (com a folga dela) */
html.has-titlebar .fluent-main { padding-top: var(--titlebar-h); }
html.has-titlebar .fluent-sidebar ~ .fluent-main { margin-left: calc(230px + var(--float-gap)); }
html.has-titlebar .fluent-sidebar.collapsed ~ .fluent-main { margin-left: calc(66px + var(--float-gap)); }

/* ==========================================================================
   BARRA UNIVERSAL NA BARRA DE TÍTULO (posições "top" e "top-right" no app desktop)
   Como a busca do Windows: campo plano à altura dos controles da janela.
     top       → ao centro, no lugar do logotipo manuscrito
     top-right → encostada aos controles da janela; cresce para a esquerda
   "bottom" continua a flutuar sobre o Workspace (regras do §9).
   O dock é fixo e transparente (pointer-events: none): o espaço vazio continua a
   arrastar a janela; só o campo, os atalhos e o popover apanham cliques.
   ========================================================================== */
:root {
  --tb-search-h: 32px;
  --tb-controls-w: 136px;   /* 3 botões de 40px + espaços (.titlebar-controls) */
}

html.has-titlebar :is(.dock-pos-top, .dock-pos-top-right) .universal-command-dock {
  position: fixed;
  top: 0;
  bottom: auto;
  height: var(--titlebar-h);
  padding-top: calc((var(--titlebar-h) - var(--tb-search-h)) / 2);
  z-index: 10002;                 /* acima da faixa da barra de título */
  transition: opacity var(--duration-smooth) ease;
}

/* ao centro: margens iguais → fica centrada na janela, longe do símbolo e dos controles */
html.has-titlebar .dock-pos-top .universal-command-dock {
  left: calc(var(--tb-controls-w) + 24px);
  right: calc(var(--tb-controls-w) + 24px);
}

/* junto aos controles: alinhada à direita; ao abrir cresce para a esquerda (até ao símbolo) */
html.has-titlebar .dock-pos-top-right .universal-command-dock {
  left: 64px;
  right: calc(var(--tb-controls-w) + 4px);
}

html.has-titlebar :is(.dock-pos-top, .dock-pos-top-right) .universal-bar-container {
  align-items: flex-start;        /* várias linhas: o campo cresce para baixo, por cima do conteúdo */
  gap: 6px;
}

/* campo: repouso plano (como os botões da janela); foco ganha superfície e elevação */
html.has-titlebar :is(.dock-pos-top, .dock-pos-top-right) .universal-input-wrapper { flex-basis: 300px; }
html.has-titlebar :is(.dock-pos-top, .dock-pos-top-right) .universal-command-dock.has-draft .universal-input-wrapper { flex-basis: 520px; }
html.has-titlebar :is(.dock-pos-top, .dock-pos-top-right) .universal-command-dock.is-active .universal-input-wrapper { flex-basis: 640px; }

html.has-titlebar :is(.dock-pos-top, .dock-pos-top-right) .universal-cmd-input {
  height: var(--tb-search-h);
  padding: 5px 64px 5px 34px !important;   /* 5 + 20 (line-height) + 5 + bordas = 32px */
  font-size: 0.8rem !important;
  border-radius: 9px !important;
  background: var(--color-bg-subtle) !important;
  border-color: var(--dock-input-border) !important;
  box-shadow: none !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html.has-titlebar :is(.dock-pos-top, .dock-pos-top-right) .universal-cmd-input:hover {
  background: var(--color-bg-hover) !important;
}

html.has-titlebar :is(.dock-pos-top, .dock-pos-top-right) .universal-command-dock.is-active .universal-cmd-input {
  height: var(--tb-search-h);
  padding-top: 5px !important;
  padding-bottom: 5px !important;
  font-size: 0.84rem !important;
  border-radius: 10px !important;
  background: var(--dock-input-bg-focus) !important;
  border-color: var(--dock-input-border-focus) !important;
  box-shadow: var(--shadow-dropdown) !important;
}

html.has-titlebar :is(.dock-pos-top, .dock-pos-top-right) .universal-command-dock.has-draft:not(.is-active) .universal-cmd-input {
  border-radius: 9px !important;
  background: var(--dock-input-bg-focus) !important;
}

html.has-titlebar :is(.dock-pos-top, .dock-pos-top-right) .universal-search-icon {
  left: 11px;
  top: calc(var(--tb-search-h) / 2);
}
html.has-titlebar :is(.dock-pos-top, .dock-pos-top-right) .universal-search-icon svg { width: 14px; height: 14px; }

html.has-titlebar :is(.dock-pos-top, .dock-pos-top-right) .universal-input-right-tools {
  right: 6px;
  top: calc(var(--tb-search-h) / 2);
}

html.has-titlebar :is(.dock-pos-top, .dock-pos-top-right) .universal-kbd-shortcut {
  font-size: 0.64rem;
  padding: 1px 6px;
  border-radius: 5px;
}

/* atalhos (Nova tarefa, Chat): botões da barra de título — sem caixa, sombra nem vidro */
html.has-titlebar :is(.dock-pos-top, .dock-pos-top-right) .universal-side-actions {
  gap: 2px;
  max-width: calc(66px + 32px);   /* 2 botões de 32px + espaço, mais o padding da sombra */
}

/* recolhidos (foco/rascunho): anulam também o gap → o campo encosta à direita, alinhado ao popover */
html.has-titlebar :is(.dock-pos-top, .dock-pos-top-right) .universal-command-dock:is(.is-active, .has-draft) .universal-side-actions {
  max-width: 0;
  margin-left: -22px;
}

html.has-titlebar :is(.dock-pos-top, .dock-pos-top-right) .dock-icon-btn {
  width: var(--tb-search-h);
  height: var(--tb-search-h);
  border-radius: 8px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--tb-fg);
}

html.has-titlebar :is(.dock-pos-top, .dock-pos-top-right) .dock-icon-btn:hover {
  background: var(--tb-hover);
  color: var(--tb-fg-hover);
}

/* popover: abre logo abaixo do campo, com a mesma largura dele, sem sair da janela */
html.has-titlebar :is(.dock-pos-top, .dock-pos-top-right) .universal-command-popover {
  top: calc(var(--tb-search-h) + 12px);
  width: min(640px, 100%);
  max-height: min(490px, calc(100vh - var(--titlebar-h) - 24px));
}

/* Manuscrito ao centro (títulos "split" e "wordmark") e barra em cima:
   ao centro o campo ocupa o lugar dele (o script troca o título; isto é a rede de segurança) */
html:is(.title-split, .title-wordmark):has(#main-content.dock-pos-top) .titlebar-logo { display: none; }
/* junto aos controles: o manuscrito sai de cena enquanto a barra está aberta (não se sobrepõem) */
html:is(.title-split, .title-wordmark):has(#main-content.dock-pos-top-right :is(.is-active, .has-draft)) .titlebar-logo { opacity: 0; }
/* ...e em janelas estreitas, onde mesmo em repouso a barra chegaria ao centro */
@media (max-width: 1120px) {
  html:is(.title-split, .title-wordmark):has(#main-content.dock-pos-top-right) .titlebar-logo { display: none; }
}
/* manuscrito junto ao símbolo: a barra "junto aos controles" para antes dele ao crescer */
html.title-together.has-titlebar .dock-pos-top-right .universal-command-dock { left: 112px; }
html.title-corner.has-titlebar .dock-pos-top-right .universal-command-dock { left: 84px; }

/* o cabeçalho volta ao normal: a barra já não ocupa espaço nele */
html.has-titlebar .dock-pos-top-right .header-right { visibility: visible; }
html.has-titlebar :is(.dock-pos-top, .dock-pos-top-right) .view-header { padding-top: 0; }

/* tela de carregamento: barra limpa · modal/onboarding/"Excluir…?" abertos: a busca fica
   por baixo do véu deles (como o resto do Workspace), não por cima */
html:has(#udo-splash:not(.is-leaving)) :is(.dock-pos-top, .dock-pos-top-right) .universal-command-dock {
  opacity: 0;
  pointer-events: none;
  transition: none;
}
html:is(:has(#fluent-modal-overlay:not([hidden])), :has(#onboarding-overlay:not([hidden])), :has(.udo-confirm)).has-titlebar :is(.dock-pos-top, .dock-pos-top-right) .universal-command-dock {
  z-index: 900;
}

/* miniaturas em Configurações → posição da barra: mostram a faixa da barra de título */
html.has-titlebar .bar-pos-preview:is(.pos-top, .pos-top-right)::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 5px;
  height: 1.5px;
  background: currentColor;
  opacity: 0.45;
}
html.has-titlebar .bar-pos-preview.pos-top::after { top: 1px; height: 2.5px; }
html.has-titlebar .bar-pos-preview.pos-top-right::after { top: 1px; height: 2.5px; right: 5px; width: 6px; }

/* ---- Nada fica por baixo da barra (ela está por cima de tudo e apanha os cliques) ---- */
/* Modais, onboarding e "Excluir…?": a folga de cima nunca menor que a barra */
html.has-titlebar .modal-overlay { padding-top: max(clamp(12px, 6vh, 64px), calc(var(--titlebar-h) + 8px)); }
html.has-titlebar .onboarding-overlay,
html.has-titlebar .udo-confirm { padding-top: calc(var(--titlebar-h) + 8px); }
html.has-titlebar .onboarding-card { max-height: calc(100vh - var(--titlebar-h) - 32px); }

.titlebar-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px;
}

.titlebar-btn {
  width: 40px;
  height: 30px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--tb-fg);
  cursor: default;
  transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease;
}

.titlebar-btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.titlebar-btn:hover { background: var(--tb-hover); color: var(--tb-fg-hover); }
.titlebar-btn:active { background: var(--tb-press); }
.titlebar-btn:focus-visible { outline-offset: -2px; }

/* Selo "Versão de testes" (versões 0.x; script.js): discreto, ao lado dos controles */
.titlebar-beta {
  align-self: center;
  margin-right: 8px;
  padding: 3px 9px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--tb-fg);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--tb-fg) 35%, transparent);
  border-radius: 999px;
  cursor: default;
  transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease;
}
.titlebar-beta[hidden] { display: none; }

/* Versão nova (syncTitlebarUpdate): pílula na cor de destaque; ao passar o mouse / foco / clique,
   um cartão desce dela como o Notch (origem no canto de cima, à direita). */
.titlebar-update { position: relative; align-self: center; margin-right: 8px; }
.titlebar-update[hidden] { display: none; }
.titlebar-update-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px;
  font: inherit; font-size: 0.72rem; font-weight: 650; letter-spacing: 0.01em;
  color: var(--color-text-inverted); background: var(--tag-blue);
  border: 0; border-radius: 999px; cursor: pointer;
  transition: filter var(--duration-fast) ease, transform var(--duration-fast) ease;
}
.titlebar-update-pill:hover { filter: brightness(1.08); }
.titlebar-update-pill .ld-ring { width: 11px; height: 11px; }
.titlebar-update-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); }
.titlebar-update.is-new .titlebar-update-pill { animation: tbUpdateIn 0.5s var(--ease-fluent) backwards; }
.titlebar-update.is-new .titlebar-update-dot { animation: tbUpdatePulse 1.6s ease-out 0.4s 3; }
@keyframes tbUpdateIn { from { opacity: 0; transform: translate3d(0, -6px, 0) scale(0.9); } }
@keyframes tbUpdatePulse { 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.titlebar-update-card {
  position: absolute; top: calc(100% + 8px); right: -6px; width: 300px;
  display: grid; gap: 10px; padding: 16px;
  border: var(--border-subtle); border-radius: 18px;
  background: var(--color-bg-surface-elevated); color: var(--color-text-primary);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.12);
  text-align: left; cursor: default;
  opacity: 0; visibility: hidden; transform: translate3d(0, -6px, 0) scale(0.96); transform-origin: top right;
  transition: opacity 0.16s ease 0.18s, transform 0.2s var(--ease-fluent) 0.18s, visibility 0s linear 0.38s;
}
/* a ponte invisível entre a pílula e o cartão (o mouse atravessa sem fechar) */
.titlebar-update-card::before { content: ''; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.titlebar-update:hover .titlebar-update-card,
.titlebar-update:focus-within .titlebar-update-card,
.titlebar-update.is-open .titlebar-update-card {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 0.16s ease 0.08s, transform 0.22s var(--ease-fluent) 0.08s, visibility 0s;
}
.titlebar-update-head { display: flex; gap: 12px; align-items: center; }
.titlebar-update-head strong { display: block; font-size: 0.92rem; font-weight: 700; color: var(--color-text-strong); }
.titlebar-update-versions { font-size: 0.75rem; color: var(--color-text-tertiary); font-variant-numeric: tabular-nums; }
.titlebar-update-ico { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: color-mix(in srgb, var(--tag-blue) 16%, transparent); color: var(--tag-blue); }
.titlebar-update-card p { margin: 0; font-size: 0.82rem; line-height: 1.45; color: var(--color-text-secondary); }
.titlebar-update-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.titlebar-update-actions .fluent-btn { font-size: 0.8rem; padding: 6px 12px; gap: 6px; }
.titlebar-update-foot { font-size: 0.72rem; color: var(--color-text-tertiary); }
@media (prefers-reduced-motion: reduce) {
  .titlebar-update.is-new .titlebar-update-pill, .titlebar-update.is-new .titlebar-update-dot { animation: none; }
  .titlebar-update-card { transform: none; }
}
.titlebar-beta:hover { background: var(--tb-hover); color: var(--tb-fg-hover); }
/* Cartão da "Versão de testes" (showTestBuildModal) */
.test-build-info { display: grid; gap: 18px; }
.tb-hero { display: grid; justify-items: center; gap: 8px; text-align: center; padding-top: 4px; }
.tb-logo { width: 44px; height: 44px; object-fit: contain; }
:root:not([data-theme="dark"]) .tb-logo { filter: invert(1); }
.tb-pill {
  padding: 3px 10px;
  border: var(--border-subtle);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text-secondary);
}
.tb-title { font-size: 1.12rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; max-width: 30ch; }
.tb-sub { font-size: 0.86rem; color: var(--color-text-secondary); }
.tb-points { list-style: none; margin: 0; padding: 4px; display: grid; gap: 2px; border-radius: 14px; background: var(--color-bg-subtle); }
.tb-point { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; font-size: 0.84rem; line-height: 1.45; color: var(--color-text-secondary); }
.tb-point b { color: var(--color-text-primary); font-weight: 600; }
.tb-point-icon { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--color-bg-surface); color: var(--color-text-primary); }
.tb-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.tb-actions .fluent-btn:first-child { margin-right: auto; }
.tb-actions .fluent-btn { display: inline-flex; align-items: center; gap: 6px; }
.export-exists p { margin-top: 10px; }
.export-exists .modal-footer-row { margin-top: 18px; }

/* Sincronizar (account-ui.js): só o ícone; gira uma volta no hover e sem parar enquanto sincroniza */
.titlebar-sync { width: 32px; margin-right: 4px; }
.titlebar-sync svg { stroke-width: 1.8; }
.titlebar-sync[hidden] { display: none; }
.titlebar-sync:hover svg { animation: titlebar-sync-spin 0.7s ease-in-out 1; }
.titlebar-sync.is-syncing svg { animation: titlebar-sync-spin 0.9s linear infinite; }
.titlebar-sync.is-syncing { pointer-events: none; }
@keyframes titlebar-sync-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .titlebar-sync:hover svg { animation: none; }
  .titlebar-sync.is-syncing svg { animation-duration: 2.4s; }
}

.titlebar-btn-close:hover { background: #c42b1c; color: #ffffff; }
.titlebar-btn-close:active { background: #a8251a; color: #ffffff; }

/* Maximizar ↔ Restaurar */
.titlebar-ico-restore,
html.is-maximized .titlebar-ico-max { display: none; }
html.is-maximized .titlebar-ico-restore { display: block; }

/* janela sem foco: controles mais apagados (como no Windows) */
html.window-blurred .titlebar-btn:not(:hover) { color: var(--color-text-tertiary); }

/* por cima do onboarding (fundo escuro nos dois temas) os controles ficam claros */
html:has(#onboarding-overlay:not([hidden])) .app-titlebar {
  --tb-fg: rgba(255, 255, 255, 0.7);
  --tb-fg-hover: #ffffff;
  --tb-hover: rgba(255, 255, 255, 0.1);
  --tb-press: rgba(255, 255, 255, 0.16);
}

/* ==========================================================================
   CONFIRMAR EXCLUSÃO (confirmDelete no script.js)
   Cartão pequeno por cima de tudo — inclusive de um modal já aberto.
   ========================================================================== */
.udo-confirm {
  position: fixed;
  inset: 0;
  z-index: 3300;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: modalOverlayFadeIn 0.16s var(--ease-fluent);
}

.udo-confirm.closing {
  pointer-events: none;
  animation: modalOverlayFadeOut 0.14s var(--ease-fluent) forwards;
}

.udo-confirm-card {
  width: min(380px, 100%);
  padding: 22px 22px 18px;
  background: rgba(255, 255, 255, 0.98);
  border: var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-launcher);
  animation: modalBoxPopIn 0.22s var(--ease-fluent);
}

.udo-confirm.closing .udo-confirm-card { animation: modalBoxPopOut 0.14s var(--ease-fluent) forwards; }

/* cabeçalho: ícone + pergunta na mesma linha */
.udo-confirm-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.udo-confirm-icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #b3261e;
  background: rgba(179, 38, 30, 0.08);
}

.udo-confirm-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-strong);
}

.udo-confirm-text {
  margin: 12px 0 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--color-text-secondary);
}

.udo-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

/* --- Bandeja com as miniaturas do que vai ser apagado (renderConfirmItem) ---
   Fundo rebaixado + cartões "de verdade" por cima: lê-se como o item, não como texto. */
.udo-confirm-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
  padding: 8px;
  max-height: 232px;
  overflow-y: auto;
  border-radius: 12px;
  background: var(--color-bg-subtle);
  border: var(--border-subtle);
}

.cp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--color-bg-surface-elevated);
  border: var(--border-subtle);
  box-shadow: var(--shadow-subtle);
  animation: cpItemIn 0.24s var(--ease-fluent) both;
}
.cp-item:nth-child(2) { animation-delay: 0.03s; }
.cp-item:nth-child(3) { animation-delay: 0.06s; }
.cp-item:nth-child(4) { animation-delay: 0.09s; }
.cp-item-compact { padding: 7px 11px; }

@keyframes cpItemIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.cp-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cp-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--color-text-primary);
}
.cp-title-regular { flex: 1; font-weight: 500; }
.cp-title.is-done { color: var(--color-text-tertiary); text-decoration: line-through; }

.cp-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.74rem;
  color: var(--color-text-tertiary);
}
.cp-meta > span { flex: none; }
.cp-excerpt { display: block; text-overflow: ellipsis; }
.cp-dot { opacity: 0.7; }
.cp-count { display: inline-flex; align-items: center; gap: 3px; }

/* tarefa: círculo de concluir · item de checklist: caixinha (feitos ficam preenchidos) */
.cp-round,
.cp-box {
  width: 16px;
  height: 16px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--color-text-tertiary);
  color: transparent;
}
.cp-round { border-radius: 50%; }
.cp-box { border-radius: 5px; }
.cp-round.is-done,
.cp-box.is-done {
  background: var(--color-text-primary);
  border-color: var(--color-text-primary);
  color: var(--color-text-inverted);
}

/* rotina: faixa com a cor dela (como no Perfil) */
.cp-stripe {
  width: 4px;
  align-self: stretch;
  min-height: 28px;
  flex: none;
  border-radius: 4px;
  background: var(--cp-color);
}

/* nota, chat, chave: ícone num quadradinho */
.cp-glyph {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--color-bg-subtle);
  color: var(--color-text-secondary);
}

.cp-item .priority-pill { flex: none; }

.cp-more {
  padding: 2px 4px 0;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--color-text-tertiary);
}

.udo-confirm-actions .fluent-btn { min-width: 92px; justify-content: center; }

:root[data-theme="dark"] .udo-confirm { background: rgba(0, 0, 0, 0.5); }
:root[data-theme="dark"] .udo-confirm-card { background: rgba(40, 40, 44, 0.98); }
:root[data-theme="dark"] .udo-confirm-icon { color: #ff8a80; background: rgba(255, 138, 128, 0.1); }
:root[data-theme="dark"] .udo-confirm-preview { background: rgba(0, 0, 0, 0.22); }
:root[data-theme="dark"] .cp-item { background: rgba(255, 255, 255, 0.05); box-shadow: none; }

/* ==========================================================================
   CONFIGURAÇÕES → "Título da janela"
   Miniatura = janela com a faixa do título; ponto = símbolo, traço = manuscrito.
   ========================================================================== */
.title-style-segmented { flex-wrap: wrap; justify-content: flex-end; }

.title-style-segmented .theme-option span.title-style-preview {
  position: relative;
  display: inline-block;
  flex: none;
  width: 22px;
  height: 15px;
  padding: 0;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  opacity: 0.55;
  box-shadow: none;
  background:
    linear-gradient(currentColor, currentColor) 0 5px / 100% 1.5px no-repeat;   /* faixa do título */
}
.title-style-preview::before,
.title-style-preview::after {
  content: '';
  position: absolute;
  top: 1px;
  background: currentColor;
}
.title-style-preview::before { left: 1.5px; width: 3px; height: 3px; border-radius: 50%; }   /* símbolo */
.title-style-preview::after { width: 7px; height: 2.5px; border-radius: 2px; top: 1.25px; }  /* manuscrito */
.title-style-preview.style-symbol::after { display: none; }
.title-style-preview:is(.style-wordmark, .style-corner)::before { display: none; }
.title-style-preview.style-corner::after { left: 1.5px; }
.title-style-preview.style-together::after { left: 6px; }
.title-style-preview:is(.style-wordmark, .style-split)::after { left: 50%; translate: -50% 0; }
.theme-option input:checked + span .title-style-preview { opacity: 1; }

/* Opção bloqueada: continua visível, apagada, com cadeado; o motivo vem na dica (.udo-tooltip) */
.theme-option .lock-ico { display: none; flex: none; opacity: 0.8; }
.theme-option.is-locked .lock-ico { display: inline-block; }
.theme-option.is-locked > span { cursor: not-allowed; opacity: 0.45; }
.theme-option.is-locked > span:hover { color: var(--color-text-secondary); }
.theme-option.is-locked:focus-visible { outline: none; }
.theme-option.is-locked:focus-visible > span { outline: 2px solid var(--color-text-primary); outline-offset: 1px; opacity: 0.7; }

/* ==========================================================================
   DICA (TOOLTIP) — motivo de uma opção bloqueada (showLockTip no script.js)
   Mesmo tom do toast: escura no tema claro, clara no escuro. Seta aponta para a opção.
   ========================================================================== */
.udo-tooltip {
  --tip-x: 50%;
  position: fixed;
  z-index: 10005;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 280px;
  padding: 9px 12px;
  border-radius: 9px;
  background: #111113;
  color: #f4f4f5;
  font-size: 0.76rem;
  line-height: 1.45;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  animation: udoTipIn 0.16s var(--ease-fluent);
}
.udo-tooltip .ui-ico { flex: none; margin-top: 2px; opacity: 0.75; }
.udo-tooltip::after {
  content: '';
  position: absolute;
  left: var(--tip-x);
  top: 100%;
  translate: -50% 0;
  border: 6px solid transparent;
  border-top-color: #111113;
}
.udo-tooltip.is-below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #111113; }

@keyframes udoTipIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}
.udo-tooltip.is-below { animation-name: udoTipInBelow; }
@keyframes udoTipInBelow {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: none; }
}

:root[data-theme="dark"] .udo-tooltip { background: #f2f2f2; color: #111111; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5); }
:root[data-theme="dark"] .udo-tooltip::after { border-top-color: #f2f2f2; }
:root[data-theme="dark"] .udo-tooltip.is-below::after { border-top-color: transparent; border-bottom-color: #f2f2f2; }

/* ==========================================================================
   CANTOS ARREDONDADOS DA JANELA (app desktop: janela transparente, sem moldura)
   O <html> fica transparente e o <body> é a "janela": recortado com cantos de
   --window-radius (clip-path recorta também o que é position: fixed — modais,
   splash, barra de título) e com um contorno fino no lugar da borda do Windows.
   Maximizada: cantos retos, sem contorno.
   ========================================================================== */
:root {
  --window-radius: 15px;
  --window-edge: rgba(0, 0, 0, 0.16);
}
:root[data-theme="dark"] { --window-edge: rgba(255, 255, 255, 0.12); }

/* Transparente, mas com uma imagem (gradiente vazio): com o <html> 100% sem fundo, o CSS
   "promove" o fundo do <body> para a tela inteira — e esse fundo promovido NÃO é recortado
   pelo clip-path (os cantos ficavam quadrados, só o contorno redondo). */
html.has-titlebar,
:root[data-theme="dark"].has-titlebar {
  background: linear-gradient(transparent, transparent) !important;
}

html.has-titlebar body {
  height: 100vh;
  overflow: hidden;
  clip-path: inset(0 round var(--window-radius));
}

html.has-titlebar body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 10010;               /* por cima de tudo, até da barra de título */
  border-radius: var(--window-radius);
  box-shadow: inset 0 0 0 1px var(--window-edge);
  pointer-events: none;
}

html.has-titlebar.is-maximized body { clip-path: none; }
html.has-titlebar.is-maximized body::after { display: none; }

/* ==========================================================================
   SCROLLBAR MINIMALISTA (Workspace; o Notch mantém a sua)
   Pílula fina, sem trilho nem setas, que só aparece ao passar o rato pela área
   que rola; sobre a própria barra engrossa um pouco e escurece.
   (borda transparente + background-clip = margem à volta da pílula)
   Nota: no Chromium, scrollbar-width/scrollbar-color desligam o ::-webkit-scrollbar
   do elemento — por isso são repostos a auto abaixo onde estavam definidos.
   ========================================================================== */
html:not(.notch-html) {
  --scroll-thumb: rgba(0, 0, 0, 0.2);
  --scroll-thumb-hover: rgba(0, 0, 0, 0.38);
  --scroll-thumb-active: rgba(0, 0, 0, 0.5);
}
:root[data-theme="dark"]:not(.notch-html) {
  --scroll-thumb: rgba(255, 255, 255, 0.18);
  --scroll-thumb-hover: rgba(255, 255, 255, 0.34);
  --scroll-thumb-active: rgba(255, 255, 255, 0.46);
}

html:not(.notch-html) ::-webkit-scrollbar { width: 10px; height: 10px; background: transparent; }
html:not(.notch-html) ::-webkit-scrollbar-track,
html:not(.notch-html) ::-webkit-scrollbar-corner { background: transparent; }
html:not(.notch-html) ::-webkit-scrollbar-button { display: none; width: 0; height: 0; }

html:not(.notch-html) ::-webkit-scrollbar-thumb {
  min-height: 40px;
  min-width: 40px;
  border: 3px solid transparent;          /* pílula de 4px com 3px de folga */
  border-radius: 10px;
  background-color: transparent;
  background-clip: padding-box;
}
html:not(.notch-html) :hover::-webkit-scrollbar-thumb { background-color: var(--scroll-thumb); }
html:not(.notch-html) ::-webkit-scrollbar-thumb:hover {
  border-width: 2px;                      /* engrossa para 6px sob o rato */
  background-color: var(--scroll-thumb-hover);
}
html:not(.notch-html) ::-webkit-scrollbar-thumb:active { background-color: var(--scroll-thumb-active); }

/* usavam as propriedades padrão (que anulariam as regras acima) */
html:not(.notch-html) .app-shell .fluent-sidebar,
html:not(.notch-html) .profile-week-strip {
  scrollbar-width: auto;
  scrollbar-color: auto;
}

/* ==========================================================================
   Categorias da checklist (modal da tarefa e Foco do Momento)
   Cabeçalho: setinha (recolher/expandir) · título · "3/7" · menu (⋯)
   ========================================================================== */
.checklist-cat-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 2px;
  padding: 2px 2px 2px 0;
  border-radius: 6px;
  list-style: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}
.checklist-cat-head:first-child { margin-top: 0; }
.checklist-cat-toggle {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-tertiary);
  cursor: pointer;
}
.checklist-cat-toggle:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }
.checklist-cat-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checklist-cat-progress { flex: none; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--color-text-tertiary); }
.checklist-cat-menu-btn { opacity: 0; transition: opacity var(--duration-fast) ease; }
.checklist-cat-head:hover .checklist-cat-menu-btn,
.checklist-cat-menu-btn:focus-visible,
.checklist-cat-head.is-collapsed .checklist-cat-menu-btn { opacity: 1; }
.checklist-cat-rename { flex: 1; min-width: 0; height: 26px; padding: 2px 8px; font-size: 0.82rem; font-weight: 600; }
.checklist-cat-head.is-collapsed .checklist-cat-title { color: var(--color-text-tertiary); }

/* itens de uma categoria: um pequeno recuo para se ver a que categoria pertencem */
.focus-checklist.has-categories .checklist-item[data-category-id]:not([data-category-id=""]),
#modal-checklist-container .checklist-builder-row[data-category-id] { margin-left: 14px; }

.checklist-cat-add { align-self: flex-start; margin: 2px 0 4px 14px; font-size: 0.78rem; }
.checklist-builder-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-self: flex-start; }

/* "+" do cabeçalho: como o ⋯, aparece com o rato sobre a categoria */
.checklist-cat-add-btn { opacity: 0; transition: opacity var(--duration-fast) ease; }
.checklist-cat-head:hover .checklist-cat-add-btn,
.checklist-cat-add-btn:focus-visible { opacity: 1; }
.checklist-cat-title { cursor: default; }

/* Categoria com tudo feito: ✓ no progresso e título mais apagado. O ✓ fica sempre no HTML
   (setCategoryHeadProgress/replayChecklistBars só trocam o .is-complete): abre espaço e cresce,
   ou encolhe e some, com as cores a acompanhar. */
.checklist-cat-progress { display: inline-flex; align-items: center; }
.checklist-cat-progress,
.checklist-cat-title { transition: color 200ms ease; }
.checklist-cat-done {
  flex: none;
  width: 0;
  margin-right: 0;
  opacity: 0;
  transform: scale(0.4);
  transition: width 200ms var(--ease-fluent), margin-right 200ms var(--ease-fluent),
              opacity 160ms ease, transform 200ms var(--ease-fluent);
}
.checklist-cat-head.is-complete .checklist-cat-done { width: 12px; margin-right: 3px; opacity: 1; transform: none; }
.checklist-cat-head.is-complete .checklist-cat-progress { color: var(--color-text-secondary); }
.checklist-cat-head.is-complete .checklist-cat-title { color: var(--color-text-tertiary); }
@media (prefers-reduced-motion: reduce) {
  .checklist-cat-progress, .checklist-cat-title, .checklist-cat-done { transition: none; }
}

/* Foco: barra fina de progresso (feitos/total) abaixo do cabeçalho da checklist e em cada
   categoria (renderChecklistBar no script.js). O contador continua ao lado; 100% = sucesso. */
.checklist-bar {
  display: block;
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--color-bg-active);
  overflow: hidden;
}
.checklist-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-text-strong);
  transition: width 200ms var(--ease-fluent), background-color 200ms ease;
}
.checklist-bar.is-complete > span { background: var(--color-success, #2e7d32); }
.agora-checklist-bar { margin: 6px 0 2px; }
/* na categoria: 2px, encostada ao fundo do cabeçalho, a partir do título (depois da setinha) */
.checklist-cat-bar {
  position: absolute;
  left: 28px;
  right: 2px;
  bottom: 0;
  height: 2px;
  opacity: 0.45;
}
@media (prefers-reduced-motion: reduce) {
  .checklist-bar > span { transition: none; }
}

/* Foco: "próximos" itens por fazer, acima das categorias (renderFocusNext no script.js).
   Mesmo visual dos itens da checklist; o nome da categoria vai à direita, discreto. */
/* seção própria (cartão discreto) para não se confundir com os itens da checklist */
.focus-next { margin: 8px 0 10px; padding: 8px 12px 6px; border-radius: 10px; background: var(--color-bg-subtle); border: var(--border-subtle); }
.focus-next-head {
  display: flex; align-items: center; gap: 6px; margin-bottom: 2px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--color-text-tertiary);
}
.focus-next-list { list-style: none; margin: 0; padding: 0; }
.focus-next-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.focus-next-row .focus-next-item { flex: 1; min-width: 0; }
.focus-next-row .item-tags { flex: none; max-width: 40%; }
.focus-next-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 5px 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: opacity var(--duration-fast) ease;
}
.focus-next-item:hover { opacity: 0.75; }
.focus-next-item:hover .checklist-box { border-color: rgba(0, 0, 0, 0.6); }
:root[data-theme="dark"] .focus-next-item:hover .checklist-box { border-color: rgba(255, 255, 255, 0.7); }
.focus-next-item:active .checklist-box { transform: scale(0.9); }
.focus-next-item:focus-visible { outline: 2px solid var(--color-text-primary); outline-offset: 2px; }
.focus-next-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.focus-next-cat { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.75rem; color: var(--color-text-tertiary); }
.focus-next-more {
  margin: 2px 0 0 28px;
  padding: 2px 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  color: var(--color-text-tertiary);
  cursor: pointer;
}
.focus-next-more:hover { color: var(--color-text-primary); text-decoration: underline; }
.focus-next-more:focus-visible { outline: 2px solid var(--color-text-primary); outline-offset: 2px; border-radius: 4px; }

/* "+ Item" e "Categoria": botões próprios no cabeçalho da checklist, sempre à vista (discretos) */
.agora-section-head-end { display: inline-flex; align-items: center; gap: 2px; min-width: 0; }
.checklist-head-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-tertiary);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease, opacity var(--duration-fast) ease;
}
.checklist-head-btn:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }
/* Foco: só o ícone (discreto); a contagem fica no canto, depois deles */
.checklist-head-btn.is-icon { width: 22px; height: 22px; padding: 0; justify-content: center; opacity: 0.75; }
.checklist-head-btn.is-icon:hover,
.checklist-head-btn.is-icon:focus-visible { opacity: 1; }
.agora-section-head-end .agora-section-head-side { margin-left: 6px; }
.checklist-head-btn:focus-visible { outline: 2px solid var(--color-text-primary); outline-offset: 1px; }
.checklist-field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.checklist-head-actions { display: inline-flex; align-items: center; gap: 4px; }

/* Configurações → Tarefas → Modelos de checklist: uma linha por modelo (nome · itens · Editar · apagar) */
.settings-templates { display: flex; flex-direction: column; gap: 8px; padding: 4px 2px 2px; }
.template-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
/* cada modelo é um cartão, como as outras opções das Configurações (.settings-section .settings-row) */
.template-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 16px;
  border: var(--border-subtle);
  border-radius: 12px;
  background: var(--surface-item-bg, var(--color-bg-surface));
  transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease;
}
.template-row:hover { border-color: var(--color-bg-active); }
.template-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.template-row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-row-meta { font-size: 0.78rem; color: var(--color-text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* sem modelos: o aviso também num cartão (tracejado = lugar vazio); "Novo modelo" como uma linha a mais */
.template-empty { margin: 0; padding: 14px 16px; font-size: 0.86rem; line-height: 1.45; border: 1px dashed color-mix(in srgb, var(--color-text-tertiary) 45%, transparent); border-radius: 12px; }
.settings-templates .fluent-btn.template-new { align-self: stretch; justify-content: flex-start; gap: 10px; min-height: 48px; padding: 10px 16px; border: var(--border-subtle); border-radius: 12px; background: var(--surface-item-bg, var(--color-bg-surface)); }
/* Editor de modelo: o nome como título da página e a mesma lista da janela da tarefa, sem a caixa de
   feito (um modelo é só a base: os itens entram desmarcados) */
.template-sheet-body { display: flex; flex-direction: column; gap: 6px; }
.template-name { width: 100%; padding: 2px 0; border: 0; outline: none; background: transparent; color: var(--color-text-strong); font: inherit; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; }
.template-name::placeholder { color: var(--color-text-tertiary); }
.template-hint { margin: 0 0 8px; font-size: 0.8rem; color: var(--color-text-tertiary); }
.template-sheet .modal-field { margin-top: 6px; }
.template-sheet .checklist-builder-box { display: none; }
.template-sheet .checklist-cat-progress, .template-sheet .checklist-cat-bar { display: none; }   /* nada se marca num modelo */
.template-sheet .checklist-builder-actions + .template-hint { margin-top: 8px; }
.template-form-error { margin: 0; color: #b42318; font-size: 0.85rem; font-weight: 600; }
:root[data-theme="dark"] .template-form-error { color: #ff8a80; }

/* "+" de inserir abaixo (Foco e modal): primeira ferramenta da barra do item (à direita,
   junto de editar/mover/apagar) — sempre dentro do item, por isso sempre clicável.
   Com o rato sobre o "+", uma linha mostra onde o item novo vai entrar. */
.checklist-builder-row { position: relative; }
.checklist-insert-tool .ui-ico { transition: transform var(--duration-fast) var(--ease-fluent); }
.checklist-insert-tool:hover .ui-ico,
.checklist-insert-tool:focus-visible .ui-ico { transform: rotate(90deg) scale(1.08); }
.focus-checklist .checklist-item:has(.checklist-insert-tool:hover)::after,
.focus-checklist .checklist-item:has(.checklist-insert-tool:focus-visible)::after,
.checklist-builder-row:has(.checklist-insert-tool:hover)::after,
.checklist-builder-row:has(.checklist-insert-tool:focus-visible)::after {
  content: '';
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--color-text-tertiary);
  opacity: 0.55;
  pointer-events: none;
  transform-origin: right center;
  animation: checklist-insert-line var(--duration-normal) var(--ease-fluent) both;
}
@keyframes checklist-insert-line { from { transform: scaleX(0); opacity: 0; } }
.focus-checklist.has-selection .checklist-insert-tool,
.drag-stack .checklist-insert-tool { display: none; }

/* Campo inline de novo item: a geometria de um item (o "+" no lugar da caixa, o texto
   alinhado com o dos itens). A LINHA tem o fundo leve; o campo dentro dela é transparente
   (o mesmo que o item em edição); abre deslizando */
.checklist-insert-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  padding: 2px 4px;
  margin: 0 -4px;
  border-radius: 6px;
  list-style: none;
  color: var(--color-text-tertiary);
  background: var(--color-bg-hover);
  cursor: text;
  overflow: hidden;
  animation: checklist-insert-in var(--duration-normal) var(--ease-fluent) backwards;
}
.checklist-insert-row > .ui-ico { flex: none; width: 18px; }
.checklist-insert-row .focus-checklist-input { padding: 3px 0; line-height: 1.4; }
.focus-checklist.has-categories .checklist-insert-row:not([data-category-id=""]) { margin-left: 14px; }
@keyframes checklist-insert-in {
  from { max-height: 0; opacity: 0; transform: translateY(-3px); }
  to   { max-height: 40px; opacity: 1; transform: none; }
}

/* Checklist vazia: um convite clicável no lugar da lista */
.checklist-empty-add {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  margin-top: 2px;
  padding: 4px 10px;
  border: 1px dashed var(--color-bg-active);
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-tertiary);
  font: inherit;
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease, border-color var(--duration-fast) ease;
}
.checklist-empty-add:hover,
.checklist-empty-add:focus-visible { background: var(--color-bg-subtle); color: var(--color-text-primary); border-color: var(--color-text-tertiary); outline: none; }
.checklist-empty-add span { flex: 1; }
.checklist-empty-add kbd { font: inherit; font-size: 0.74rem; opacity: 0.7; }

/* Item acabado de criar e itens de uma categoria que abriu: entram deslizando.
   "backwards" e NÃO "both": uma animação que fica preenchida no fim continua a mandar no
   transform (por cima do estilo inline) e o arrasto deixaria de mover o item. */
.focus-checklist > .is-new,
.focus-checklist > .is-revealing,
#modal-checklist-container > .is-revealing {
  animation: checklist-row-in var(--duration-normal) var(--ease-fluent) backwards;
  animation-delay: calc(var(--i, 0) * 18ms);
}
@keyframes checklist-row-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
/* Itens de uma categoria a recolher: saem antes de sumirem (CHECKLIST_COLLAPSE_MS no script) */
.focus-checklist > .is-leaving,
#modal-checklist-container > .is-leaving {
  pointer-events: none;
  animation: checklist-row-out 200ms ease both;
}
@keyframes checklist-row-out {
  to { opacity: 0; transform: translateY(-4px); }
}

/* Arrastar: a alça do cabeçalho move a categoria (no Foco, na margem como a dos itens) */
.checklist-cat-head { position: relative; transition: background var(--duration-fast) ease, box-shadow var(--duration-fast) ease; }
.checklist-cat-head:hover .checklist-drag-handle { opacity: 1; }
.checklist-cat-head .checklist-drag-handle { margin-right: -4px; }
.focus-checklist .checklist-cat-head .checklist-drag-handle { margin-right: 0; }
/* todas as vagas (itens, cabeçalhos e "Adicionar item em…") deslizam juntas */
.focus-checklist.is-sorting > :not(.is-dragging),
#modal-checklist-container.is-sorting > :not(.is-dragging) {
  transition: transform 200ms cubic-bezier(0.2, 0, 0, 1);
}
.checklist-cat-head.is-dragging {
  z-index: 3;
  background: var(--clock-track);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
  scale: 1.015;
  will-change: transform;
  transition: box-shadow 160ms ease, scale 160ms ease;
}
.checklist-cat-head.is-dragging .checklist-drag-handle { opacity: 1; color: var(--color-text-primary); }
.checklist-cat-head.is-dragging.is-dropping {
  scale: 1;
  box-shadow: none;
  transition: transform 180ms cubic-bezier(0.2, 0, 0, 1), scale 180ms ease, box-shadow 180ms ease;
}
/* a mover uma categoria: só os cabeçalhos ficam (os itens das categorias somem) */
.focus-checklist.is-cat-sorting > :not(.checklist-cat-head)[data-category-id]:not([data-category-id=""]),
#modal-checklist-container.is-cat-sorting > [data-category-id]:not(.checklist-cat-head) { display: none; }
/* Item a caminho de outra categoria ("pasta"), discreto:
   - o cabeçalho de destino ganha só um fundo leve e o título mais forte;
   - a linha arrastada desliza para a indentação de destino e mostra "→ Nome" em texto miúdo. */
.checklist-cat-head.is-drop-target { background: var(--color-bg-hover); }
.checklist-cat-head.is-drop-target .checklist-cat-title { color: var(--color-text-primary); }
/* Item largado numa categoria fechada: enquanto ele "entra" (script.js: absorbIntoCollapsedHead)
   o cabeçalho fica destacado; depois de gravar, o contador dá um pulo de leve */
.checklist-cat-head.is-receiving { background: var(--color-bg-hover); transition: background var(--duration-fast) ease; }
.checklist-cat-head.is-receiving .checklist-cat-title { color: var(--color-text-primary); }
.checklist-cat-head.is-received { animation: catReceived 0.5s var(--ease-fluent); }
.checklist-cat-head.is-received .checklist-cat-progress { animation: catCountBump 0.42s var(--ease-fluent); }
@keyframes catReceived {
  0% { background: var(--color-bg-hover); }
  100% { background: transparent; }
}
@keyframes catCountBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.28); color: var(--color-text-strong); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .checklist-cat-head.is-received,
  .checklist-cat-head.is-received .checklist-cat-progress { animation: none; }
}
.focus-checklist .checklist-item.is-dragging:not(.is-dropping),
#modal-checklist-container .checklist-builder-row.is-dragging:not(.is-dropping) { transition: translate 160ms var(--ease-fluent), box-shadow 160ms ease, scale 160ms ease, background 160ms ease; }
.focus-checklist .checklist-item.is-dragging,
#modal-checklist-container .checklist-builder-row.is-dragging { translate: var(--drop-x, 0px) 0; }
.checklist-item.is-dragging.is-changing-cat::before,
.checklist-builder-row.is-dragging.is-changing-cat::before {
  content: attr(data-drop-label);
  position: absolute;
  right: 8px;
  top: 50%;
  z-index: 4;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 10px;
  background: linear-gradient(to right, transparent, var(--clock-track) 10px);  /* por cima das ferramentas */
  color: var(--color-text-tertiary);
  font-size: 0.72rem;
  font-weight: 500;
  pointer-events: none;
  transform: translateY(-50%);
  animation: checklist-drop-label-in 140ms var(--ease-fluent) both;
}
@keyframes checklist-drop-label-in { from { opacity: 0; transform: translate(-3px, -50%); } }
@media (prefers-reduced-motion: reduce) {
  .checklist-item.is-dragging.is-changing-cat::before,
  .checklist-builder-row.is-dragging.is-changing-cat::before { animation: none; }
  .focus-checklist .checklist-item.is-dragging:not(.is-dropping), #modal-checklist-container .checklist-builder-row.is-dragging:not(.is-dropping) { transition: none; }
}
@media (prefers-reduced-motion: reduce) {
  .focus-checklist.is-sorting > :not(.is-dragging),
  #modal-checklist-container.is-sorting > :not(.is-dragging),
  .checklist-cat-head.is-dragging.is-dropping { transition: none; }
}

/* Setinha da categoria: gira em vez de trocar de ícone */
.checklist-cat-toggle .ui-ico { transition: transform var(--duration-fast) var(--ease-fluent); }
.checklist-cat-head.is-collapsed .checklist-cat-toggle .ui-ico { transform: rotate(-90deg); }
.checklist-cat-head.just-toggled .checklist-cat-toggle .ui-ico { animation: checklist-chevron-open var(--duration-fast) var(--ease-fluent); }
.checklist-cat-head.is-collapsed.just-toggled .checklist-cat-toggle .ui-ico { animation-name: checklist-chevron-close; }
@keyframes checklist-chevron-open  { from { transform: rotate(-90deg); } to { transform: none; } }
@keyframes checklist-chevron-close { from { transform: none; } to { transform: rotate(-90deg); } }

@media (prefers-reduced-motion: reduce) {
  .checklist-insert-tool .ui-ico, .checklist-cat-toggle .ui-ico { transition: none; }
  .checklist-insert-row, .focus-checklist > .is-new, .focus-checklist > .is-revealing,
  #modal-checklist-container > .is-revealing, .focus-checklist > .is-leaving,
  #modal-checklist-container > .is-leaving, .checklist-cat-head.just-toggled .checklist-cat-toggle .ui-ico { animation: none; }
}

/* "Mover para…" das linhas do modal: só quando a tarefa tem categorias */
.checklist-row-move { display: none; }
#modal-checklist-container.has-categories .checklist-row-move { display: inline-grid; }

/* Configurações → Tarefas: os 2 botões ao lado dos itens da checklist */
.settings-quick-pair { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.settings-quick-pair .fluent-input { width: 170px; }

/* ==========================================================================
   Configurações: navegação em níveis
   Início = busca + grade de categorias → categoria = cada opção num cartão próprio,
   agrupadas por rótulos discretos. Largura fluida (até 1080px).
   ========================================================================== */
.settings-layout { width: 100%; max-width: 1280px; margin: 0 auto; }
.settings-layout .settings-container { max-width: none; margin: 0; width: 100%; gap: 14px; }

/* Entrada: ao abrir uma categoria desliza da direita; ao voltar, da esquerda */
.settings-container.is-entering-forward { animation: settings-in-forward 240ms var(--ease-fluent) backwards; }
.settings-container.is-entering-back { animation: settings-in-back 240ms var(--ease-fluent) backwards; }
@keyframes settings-in-forward { from { opacity: 0; transform: translateX(18px); } }
@keyframes settings-in-back { from { opacity: 0; transform: translateX(-18px); } }

/* Cabeçalho (o título "Configurações" já está no topo do app: aqui só o da categoria) */
.settings-section-head { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.settings-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text-strong);
}
.settings-title-icon,
.settings-tile-icon,
.settings-row-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}
.settings-section-desc { font-size: 0.86rem; color: var(--color-text-secondary); }

/* "‹ Configurações" (voltar) */
.settings-back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0 0 4px -8px;
  padding: 4px 10px 4px 4px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.settings-back .ui-ico { transition: transform var(--duration-fast) var(--ease-fluent); }
.settings-back:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }
.settings-back:hover .ui-ico { transform: translateX(-2px); }
.settings-back:focus-visible { outline: 2px solid var(--color-text-primary); outline-offset: 1px; }

/* Busca (página inicial): o mesmo visual da busca das Notas (pílula da barra do app) */
.settings-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-notes-toolbar, var(--radius-full));
  background: var(--surface-item-bg, var(--dock-input-bg));
  border: 1px solid var(--dock-input-border);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--dock-input-shadow);
  color: var(--color-text-tertiary);
  cursor: text;
  transition: border-color var(--duration-normal) ease, box-shadow var(--duration-normal) ease;
}
.settings-search:focus-within { border-color: var(--dock-input-border-focus); color: var(--color-text-strong); }
.settings-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--color-text-primary);
  font: inherit;
  font-size: 0.86rem;
  outline: none;
}
:root[data-theme="dark"] .settings-search input,
:root[data-theme="dark"] .settings-search input:focus { background: transparent; box-shadow: none; }
.settings-search input::-webkit-search-cancel-button { cursor: pointer; }
.settings-search kbd {
  flex: none;
  padding: 1px 6px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px var(--color-bg-active);
  font: inherit;
  font-size: 0.7rem;
  color: var(--color-text-tertiary);
}
.settings-search:focus-within kbd { display: none; }

/* Categorias (página inicial): lista, uma por linha, cada uma no seu cartão */
.settings-home-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.settings-home-list[hidden] { display: none; }
.settings-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 24px 16px;
  border-radius: var(--radius-tile, 12px);
  border: var(--surface-card-border, var(--border-subtle));
  background: var(--surface-card-bg, transparent);
  color: var(--color-text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease, transform var(--duration-fast) var(--ease-fluent), box-shadow var(--duration-fast) ease;
  animation: settings-tile-in 260ms var(--ease-fluent) backwards;
  animation-delay: calc(var(--i, 0) * 22ms);
}
.settings-tile:hover { background: var(--color-bg-subtle); }
.settings-tile:active { background: var(--color-bg-hover); }
.settings-tile:focus-visible { outline: 2px solid var(--color-text-primary); outline-offset: 2px; }
@keyframes settings-tile-in { from { opacity: 0; transform: translateY(4px); } }
.settings-tile-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.settings-tile-title { font-size: 1.05rem; font-weight: 600; color: var(--color-text-strong); }
.settings-tile-desc { font-size: 0.9rem; color: var(--color-text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-tile-chevron { flex: none; color: var(--color-text-tertiary); transition: transform var(--duration-fast) var(--ease-fluent), color var(--duration-fast) ease; }
.settings-tile:hover .settings-tile-chevron { transform: translateX(3px); color: var(--color-text-primary); }

/* Dentro de uma categoria: o antigo "cartão" vira só um grupo (rótulo + opções) */
.settings-section { display: flex; flex-direction: column; gap: 18px; }
.settings-section[hidden] { display: none; }
.settings-section .settings-card.fluent-sheet {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
}
.settings-section .settings-card-header { margin: 0; padding: 0 2px; border: none; }
.settings-section .settings-card-title { font-size: 0.8rem; font-weight: 600; color: var(--color-text-secondary); }
.settings-card-desc { margin: 2px 0 0; font-size: 0.76rem; line-height: 1.4; color: var(--color-text-tertiary); }
.settings-section .settings-card-subtitle { margin-top: 1px; font-size: 0.74rem; color: var(--color-text-tertiary); }

/* Cada opção: um cartão — ícone · texto · controlo */
.settings-section .settings-row {
  gap: 14px;
  padding: 14px 16px;
  border: var(--border-subtle);
  border-radius: 12px;
  background: var(--surface-item-bg, var(--color-bg-surface));
  transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease;
}
.settings-section .settings-row:last-child { border-bottom: var(--border-subtle); }
.settings-section .settings-row:hover { border-color: var(--color-bg-active); }
.settings-section .settings-row-text { min-width: 0; }
.settings-section .settings-row-title { font-size: 0.9rem; }
.settings-section .settings-row-desc { line-height: 1.4; }

/* "Sobre o OIOM" (início de Geral): o único cartão com conteúdo próprio, em destaque */
.settings-section .settings-card:has(.about-udo) {
  padding: 18px 20px;
  border: var(--border-subtle);
  border-radius: 14px;
  background: var(--color-bg-surface);
}

/* só na busca: de que categoria vem cada grupo de resultados */
.settings-section-label { display: none; }
.settings-layout.is-searching .settings-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 -8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}
/* mais específico que o display:flex dos grupos (.settings-section .settings-card.fluent-sheet) */
.settings-section .settings-card.fluent-sheet.is-filtered-out,
.settings-section .settings-row.is-filtered-out { display: none; }
.settings-search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 0;
  color: var(--color-text-tertiary);
  font-size: 0.9rem;
}
.settings-search-empty[hidden] { display: none; }

/* "Zona de perigo" (limpar todos os dados) */
.settings-card-danger .settings-card-title { color: #b3261e; }
.settings-card-danger .settings-row { border-color: rgba(179, 38, 30, 0.25); }
.settings-card-danger .settings-row-icon { background: rgba(179, 38, 30, 0.08); color: #b3261e; }
:root[data-theme="dark"] .settings-card-danger .settings-card-title { color: #ff8a80; }
:root[data-theme="dark"] .settings-card-danger .settings-row { border-color: rgba(255, 120, 110, 0.25); }
:root[data-theme="dark"] .settings-card-danger .settings-row-icon { background: rgba(255, 120, 110, 0.1); color: #ff8a80; }

/* Valores ao lado do título (opacidade, n.º de frases) e o selo do motor de linguagem */
.settings-value { margin-left: 6px; font-weight: 500; color: var(--color-text-tertiary); font-variant-numeric: tabular-nums; }
.settings-badge {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-bg-hover);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}
.settings-select { min-width: 170px; }
.settings-quick-pair .settings-select { min-width: 0; width: 180px; }
.settings-api-key { display: flex; gap: 8px; width: min(360px, 100%); }
.settings-api-key .fluent-input { flex: 1; min-width: 0; }
.settings-api-key .fluent-btn { padding: 6px 12px; }
.settings-row-actions .fluent-btn { gap: 6px; }

/* Ícones dentro dos seletores (select personalizável: na lista e na opção escolhida) */
.opt-ico { display: inline-grid; place-items: center; flex: none; color: var(--color-text-tertiary); }
option:checked .opt-ico { color: var(--color-text-primary); }
.settings-select selectedcontent { display: inline-flex; align-items: center; gap: 8px; }
.settings-select > button { display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: inherit; }

/* Sem espaço (janela pequena): o controlo desce para baixo do texto, encostado à direita, e o
   texto nunca fica com menos de ~140px (não vira uma palavra por linha). Um seletor que nem
   assim cabe (ex.: "Título da janela") rola na horizontal dentro da própria pílula. */
.settings-section .settings-row { flex-wrap: wrap; }
.settings-section .settings-row-text { flex: 1 1 140px; }
.settings-section .settings-row > :last-child:not(.settings-row-text) { margin-left: auto; max-width: 100%; }
.settings-section .settings-row > .theme-segmented {
  flex-wrap: nowrap;
  justify-content: flex-start;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.settings-section .settings-row > .theme-segmented::-webkit-scrollbar { display: none; }
.settings-section .settings-row > .theme-segmented .theme-option { flex: none; }
.settings-section .settings-row > .theme-segmented .theme-option span { white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .settings-container.is-entering-forward, .settings-container.is-entering-back, .settings-tile { animation: none; }
  .settings-back .ui-ico, .settings-tile-chevron, .settings-tile { transition: none; }
}

/* Propriedades da categoria da checklist (janela pequena) */
.checklist-cat-flag { display: inline-grid; place-items: center; flex: none; color: var(--color-text-tertiary); }
.category-props { display: flex; flex-direction: column; gap: 16px; }
.category-props-head { display: flex; align-items: center; gap: 12px; }
.category-props-head-text { flex: 1; min-width: 0; }
.category-props-title { font-size: 1.05rem; font-weight: 600; color: var(--color-text-strong); }
.category-props-summary { margin-top: 1px; font-size: 0.8rem; color: var(--color-text-tertiary); }
.category-props-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: var(--border-subtle);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease;
}
.category-props-option:hover { border-color: var(--color-bg-active); background: var(--color-bg-subtle); }
.category-props-option-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.category-props-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Calendário (mês): rotinas do dia como pontinhos ao lado do número; com o rato por cima
   afastam-se e crescem um pouco, e uma dica lista nome e horário de cada uma */
.calendar-month-daywrap { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.calendar-month-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 3px;
  border-radius: 999px;
  cursor: default;
  transition: gap var(--duration-fast) var(--ease-fluent), background var(--duration-fast) ease;
}
.calendar-month-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--dot);
  transition: transform var(--duration-fast) var(--ease-fluent);
}
.calendar-month-dots-more { font-size: 0.62rem; font-weight: 600; color: var(--color-text-tertiary); line-height: 1; }
.calendar-month-dots:hover { gap: 4px; background: var(--color-bg-hover); }
.calendar-month-dots:hover .calendar-month-dot { transform: scale(1.3); }

.udo-tooltip.routine-tip { padding: 8px 10px; }
.routine-tip-body { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
.routine-tip-title { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; opacity: 0.6; }
.routine-tip-row { display: flex; align-items: center; gap: 8px; }
.routine-tip-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--dot); }
.routine-tip-name { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.routine-tip-time { flex: none; opacity: 0.7; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .calendar-month-dots, .calendar-month-dot { transition: none; }
}

/* ==========================================================================
   EXPANSÕES (renderExpansionsView no script.js): biblioteca de recursos da equipe
   do OIOM. Por enquanto só a seção Temas: um cartão por tema de UdoCore.SKINS.
   ========================================================================== */
.expansions-view { display: flex; flex-direction: column; gap: 22px; max-width: 980px; }
.expansions-section { display: flex; flex-direction: column; gap: 12px; }
.expansions-section-title { padding: 0 2px; font-size: 0.8rem; font-weight: 600; color: var(--color-text-secondary); }
.expansions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

/* cartão = botão: prévia + nome; abre os detalhes (showExpansionDetail) */
.expansion-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: var(--surface-card-border, var(--border-subtle));
  border-radius: var(--radius-tile, var(--radius-lg));
  background: var(--surface-card-bg, var(--color-bg-surface));
  box-shadow: var(--shadow-card);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-fluent), box-shadow var(--duration-fast) ease;
}
.expansion-card:hover { transform: translateY(-2px); }
.expansion-card:active { transform: scale(0.98); }
.expansion-card:focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: 3px; }
.expansion-card.is-active { box-shadow: 0 0 0 1.5px var(--color-text-strong), var(--shadow-card); }
@media (prefers-reduced-motion: reduce) {
  .expansion-card, .expansion-card:hover, .expansion-card:active { transition: none; transform: none; }
}

/* Prévia: um Workspace em miniatura com os tokens do tema DO CARTÃO, não do que está em
   uso. Aqui os tokens voltam ao Básico (initial = sem valor → vale a reserva de cada var());
   o arquivo de cada tema os redefine em .expansion-preview[data-preview="<id>"]. */
.expansion-preview {
  --surface-card-bg: initial;
  --surface-card-border: initial;
  --surface-selected-bg: initial;
  --surface-selected-border: initial;
  --radius-tile: initial;
  display: grid;
  grid-template-columns: 0.8fr 1fr 1fr;
  align-items: start;
  gap: 10px;
  height: 88px;
  padding: 14px;
  background: var(--color-bg-base);
  border-bottom: var(--border-subtle);
}
.xp-nav { display: flex; flex-direction: column; gap: 6px; }
.xp-nav i { display: block; height: 14px; border-radius: 5px; background: var(--color-bg-subtle); }
.xp-nav i.is-sel { background: var(--surface-selected-bg, var(--color-bg-surface-elevated)); border: var(--surface-selected-border, var(--border-subtle)); }
.xp-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: var(--surface-card-border, var(--border-subtle));
  border-radius: var(--radius-tile, var(--radius-md));
  background: var(--surface-card-bg, var(--color-bg-surface));
  box-shadow: var(--shadow-card);
}
.xp-card b { display: block; width: 60%; height: 7px; border-radius: 4px; background: var(--color-text-primary); opacity: 0.55; }
.xp-card i { display: block; height: 5px; border-radius: 3px; background: var(--color-text-tertiary); opacity: 0.35; }
.xp-card i + i { width: 70%; }

.expansion-body { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; }
.expansion-title { font-size: 0.95rem; font-weight: 600; color: var(--color-text-strong); }
.expansion-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--color-text-strong);
  color: var(--color-text-inverted);
  font-size: 0.72rem;
  font-weight: 600;
}
.expansion-desc { margin: 0; font-size: 0.9rem; line-height: 1.5; color: var(--color-text-secondary); }
.expansion-meta { margin: 2px 0 0; font-size: 0.76rem; color: var(--color-text-tertiary); }

/* Detalhes de um tema (janela): prévia grande no topo */
.expansion-detail { display: flex; flex-direction: column; }
.expansion-detail .expansion-preview { height: 150px; padding: 22px; gap: 14px; border-radius: var(--radius-md); border: var(--border-subtle); }
.expansion-detail-body { display: flex; flex-direction: column; gap: 14px; padding-top: 18px; }
.expansion-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.expansion-detail-head h3 { margin: 0; font-size: 1.3rem; font-weight: 700; color: var(--color-text-strong); }
.expansion-highlights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.expansion-highlights li { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; color: var(--color-text-primary); }
.expansion-highlights .ui-ico { flex: none; color: var(--color-text-tertiary); }
.expansion-note { margin: 0; font-size: 0.78rem; color: var(--color-text-tertiary); }
.expansion-detail-foot { display: flex; justify-content: flex-end; padding-top: 4px; }

/* --------------------------------------------------------------------------
   CONTA OIOM (tela Conta: dist/account-ui.js). Reaproveita os cartões e as linhas
   das Configurações (.settings-card, .settings-row); aqui só o que é próprio dela.
   -------------------------------------------------------------------------- */
.account-view { max-width: 640px; }
.account-text { margin: 0; font-size: 0.88rem; line-height: 1.55; color: var(--color-text-primary); }
.account-hint { margin: 14px 0 0; font-size: 0.78rem; line-height: 1.5; color: var(--color-text-tertiary); }
.account-form { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.account-label { font-size: 0.78rem; font-weight: 600; color: var(--color-text-secondary); }
.account-form-row { display: flex; gap: 8px; }
.account-form-row .fluent-input { flex: 1; min-width: 0; }
.account-error { margin: 4px 0 0; font-size: 0.8rem; color: #b3261e; }
:root[data-theme="dark"] .account-error { color: #ff8a80; }
.account-slow, .account-status { margin: 6px 0 0; font-size: 0.8rem; color: var(--color-text-secondary); }
.account-code {
  margin: 18px 0 14px;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--color-text-strong);
  user-select: all;
}
.account-warn { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: 0.8rem; line-height: 1.45; color: var(--color-text-secondary); }
.account-warn .ui-ico { flex: none; margin-top: 2px; }
.account-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.account-email { font-weight: 600; overflow-wrap: anywhere; }
.account-email-toggle { padding: 2px 8px; font-size: 0.76rem; vertical-align: middle; }
.account-email-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.account-plan { font-weight: 700; }
.account-plan.is-warn { color: #8a5a00; }
:root[data-theme="dark"] .account-plan.is-warn { color: #ffcc66; }
.account-plan.is-muted { color: var(--color-text-secondary); }
.account-devices { list-style: none; margin: 0; padding: 0; }
.account-current { margin-left: 6px; vertical-align: middle; }
.account-end strong { display: block; margin-bottom: 4px; font-size: 0.92rem; color: var(--color-text-strong); }
/* Backup para outro aparelho (cartão "Levar para outro aparelho") */
.account-hint-tight { margin-top: 6px; }
/* faixa de status (há backup à espera?) e as duas opções lado a lado (empilham no estreito) */
.account-slot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding: 12px; border-radius: 8px; background: var(--color-bg-subtle); }
.account-slot .account-status, .account-slot .account-error { margin: 0; }
.account-slot.is-waiting { flex-wrap: nowrap; align-items: flex-start; }
.account-slot.is-waiting .ui-ico { flex: none; margin-top: 1px; color: var(--color-text-secondary); }
.account-slot.is-waiting .account-status { color: var(--color-text-primary); }
.account-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin-top: 16px; }
.account-option { display: flex; align-items: flex-start; justify-content: flex-start; gap: 12px; height: auto; padding: 12px 16px; text-align: left; white-space: normal; }
.account-option > .ui-ico { flex: none; margin-top: 2px; }
/* opção ocupada: o anel no lugar do ícone (18px), alinhado com o título */
.account-option > .ld-ring { margin: 4px 2px 0; }
.account-option-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.account-option-title { font-weight: 600; }
.account-option-desc { font-size: 0.78rem; font-weight: 400; line-height: 1.4; opacity: 0.8; }
.account-backup-foot { margin-top: 16px; padding-top: 8px; border-top: var(--border-subtle); }
.account-backup-foot .fluent-btn { margin-left: -8px; padding: 4px 8px; font-size: 0.82rem; }
.account-backup-panel { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: var(--border-subtle); }
.account-backup-panel .account-actions { margin-top: 4px; }
/* a frase: grupos de 4 numa grade fixa (4 + 3), sem quebrar no meio de um grupo; um clique
   seleciona tudo, e a cópia leva o texto com hífens (account-ui.js) */
.account-phrase { position: relative; margin: 4px 0; padding: 16px; border-radius: 8px; background: var(--color-bg-subtle); user-select: all; }
.account-phrase-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 5.5em)); justify-content: center; gap: 8px; }
.account-phrase-group {
  padding: 8px 4px; border-radius: 6px; border: var(--border-subtle); background: var(--color-bg-base, transparent);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.05rem; font-weight: 600;
  letter-spacing: 0.08em; text-align: center; color: var(--color-text-strong);
}
.account-warn.is-boxed { padding: 12px; border-radius: 8px; border-left: 3px solid #b26a00; background: var(--color-bg-subtle); color: var(--color-text-primary); }
.account-summary { margin: 0; font-size: 1rem; font-weight: 600; color: var(--color-text-strong); }
.account-check input { width: 18px; height: 18px; margin: 0; }
.account-phrase-input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 0.04em; }
.account-check { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; font-weight: 600; color: var(--color-text-primary); cursor: pointer; }
.account-notice { margin-top: 12px; padding: 10px 12px; border-radius: 8px; font-size: 0.82rem; line-height: 1.5; background: var(--color-bg-subtle); color: var(--color-text-primary); }
.account-notice p { margin: 0; overflow-wrap: anywhere; }
.account-notice p + p { margin-top: 4px; }
.account-notice.is-ok { border-left: 3px solid #2e7d32; }
.account-notice.is-warn { border-left: 3px solid #b26a00; }
.account-notice.is-info { border-left: 3px solid var(--color-text-tertiary); }
.account-warn-text { color: #8a5a00; }
:root[data-theme="dark"] .account-warn-text { color: #ffcc66; }
/* Enviar sem "Anotei a frase": o botão parece travado; clicado, treme (com a mensagem do motivo) */
.account-backup-panel .fluent-btn[aria-disabled="true"] { opacity: 0.55; }
.account-backup-panel .fluent-btn.is-nudged { animation: onbShake 360ms ease; }
@media (prefers-reduced-motion: reduce) { .account-backup-panel .fluent-btn.is-nudged { animation: none; } }
/* Só para leitor de tela */
.account-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Cabeçalho com algo à direita do título (o status do login); quebra na janela estreita */
.account-card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
/* "Confira o seu e-mail": dois passos numerados, o código numa caixa com o aviso colado */
.account-live { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 0.8rem; color: var(--color-text-secondary); }
.account-live-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: accountLivePulse 1.6s ease-in-out infinite; }
.account-live.is-offline { color: #8a5a00; }
:root[data-theme="dark"] .account-live.is-offline { color: #ffcc66; }
@keyframes accountLivePulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .account-live-dot { animation: none; } }
.account-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.account-step { display: flex; align-items: flex-start; gap: 12px; }
.account-step-n {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  font-size: 0.78rem; font-weight: 700; background: var(--color-bg-subtle); color: var(--color-text-secondary);
}
.account-step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding-top: 2px; }
.account-step-body .account-hint-tight { margin-top: -4px; }
.account-code-box { padding: 16px 24px; border-radius: 10px; background: var(--color-bg-subtle); }
.account-pending .account-code { margin: 0; word-spacing: 0.3em; }
.account-code-box { display: flex; flex-direction: column; align-items: center; gap: 10px; }
/* "Copiar código": pílula discreta debaixo do código; ao copiar, o ícone vira ✓ */
.account-code-copy {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px 5px 10px;
  border: var(--border-subtle); border-radius: var(--radius-full);
  background: var(--color-bg-surface);
  font: inherit; font-size: 0.78rem; font-weight: 500; color: var(--color-text-secondary);
  cursor: pointer;
  transition: color var(--duration-fast) ease, background var(--duration-fast) ease, border-color var(--duration-fast) ease, transform 0.12s ease;
}
.account-code-copy:hover { color: var(--color-text-strong); }
.account-code-copy:active { transform: scale(0.96); }
.account-code-copy:focus-visible { outline: 2px solid var(--color-text-strong); outline-offset: 2px; }
.account-code-copy-ico { position: relative; display: inline-grid; width: 14px; height: 14px; }
.account-code-copy-ico > svg { grid-area: 1 / 1; transition: opacity 0.16s ease, transform 0.2s var(--ease-fluent, ease); }
.account-code-copy-ico > svg:last-child { opacity: 0; transform: scale(0.5); }
.account-code-copy.is-copied { color: var(--color-success, #2e7d32); border-color: color-mix(in srgb, var(--color-success, #2e7d32) 45%, transparent); }
.account-code-copy.is-copied .account-code-copy-ico > svg:first-child { opacity: 0; transform: scale(0.5); }
.account-code-copy.is-copied .account-code-copy-ico > svg:last-child { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .account-code-copy, .account-code-copy-ico > svg { transition: none; } }
.account-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-top: 16px; padding-top: 12px; border-top: var(--border-subtle); }
.account-foot .account-hint { margin: 0; }
.account-foot > .fluent-btn { margin-left: auto; }
/* Fim do pedido de login (bloqueado, expirado, erro): ícone de alerta à esquerda */
.account-end { display: flex; align-items: flex-start; gap: 12px; }
.account-end > .ui-ico { flex: none; margin-top: 2px; color: #b26a00; }
:root[data-theme="dark"] .account-end > .ui-ico { color: #ffcc66; }
/* Página da conta: quem é (e-mail em destaque, plano numa linha), o backup, a manutenção */
.account-id { display: flex; align-items: flex-start; gap: 16px; }
.account-avatar {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--color-bg-hover); color: var(--color-text-primary);
}
.account-id-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.account-id-email { font-size: 1rem; color: var(--color-text-strong); }
.account-id-plan { font-size: 0.82rem; line-height: 1.5; color: var(--color-text-secondary); }
.account-id-text .account-error, .account-id-text .account-slow { margin: 0; }
.account-check-btn { margin: 4px 0 0 -8px; padding: 4px 8px; font-size: 0.8rem; }
.account-section { display: flex; flex-direction: column; gap: 12px; }
.account-section-title { margin: 0 0 0 4px; font-size: 0.86rem; font-weight: 600; color: var(--color-text-secondary); }
.account-section > .account-devices { padding: 0 16px; border: var(--border-subtle); border-radius: 10px; }
.account-section > .account-text, .account-section > .account-error { margin: 0 0 0 4px; }
.account-section > .account-actions { margin-top: 0; justify-content: flex-start; }
.account-devices > .settings-row { padding: 16px 0; }
.account-devices .settings-row-icon { width: 34px; height: 34px; border-radius: 8px; }
.account-device-remove { flex: none; padding: 4px 8px; font-size: 0.8rem; }
/* ocupado ("Removendo…"), sem hover nem cursor de clique */
.account-device-remove:disabled { pointer-events: none; }
/* rótulos com loading (busySwap): "Verificar agora" alinhado com o e-mail; "Remover" com a borda */
.account-check-btn .ld-swap > span { justify-self: start; }
.account-device-remove .ld-swap > span { justify-self: end; }
/* lista recarregando (depois de remover): a que havia fica, apagada, com a barra no topo */
.account-devices.is-busy-region > .settings-row { opacity: 0.6; transition: opacity 0.2s ease; }
.account-section > .account-devices + .account-error { margin: 0 0 0 4px; }
.account-leave { margin-top: 4px; }
.account-warn-line { display: flex; align-items: flex-start; gap: 6px; margin-top: 4px; }
.account-warn-line .ui-ico { flex: none; margin-top: 2px; }
/* Sem conta: a nota fica mais perto do formulário */
.account-form + .account-hint { margin-top: 12px; }

/* Limite de computadores do plano no login (deviceLimitView): escolher qual desconectar */
.account-limit-list { list-style: none; margin: 12px 0 0; padding: 0 14px; border: var(--border-subtle); border-radius: 10px; }
.account-limit-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.account-limit-item + .account-limit-item { border-top: var(--border-subtle); }
.account-limit-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--color-bg-subtle); color: var(--color-text-secondary); }
.account-limit-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.account-limit-body strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; color: var(--color-text-strong); }
.account-limit-item > .fluent-btn { flex: none; }
.account-limit .account-error { margin-top: 10px; }

/* ---- Beta fechado (beta-gate.js): o cartão das boas-vindas, por cima de tudo ---- */
/* acima de modais, menus e toasts (4000); abaixo só dos controles da janela (10001) */
.beta-gate { z-index: 5000; }
.beta-gate .onb-kicker { display: flex; align-items: center; gap: 6px; }
/* o login do account-ui dentro do cartão: sem cartão dentro de cartão */
.beta-gate .account-gate { display: flex; flex-direction: column; gap: 12px; }
.beta-gate .account-card { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; overflow: visible; }
.beta-gate .account-card .settings-card-header { padding: 0; margin-bottom: 6px; border: 0; }
.beta-gate-waitlist { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-top: 20px; padding-top: 16px; border-top: var(--border-subtle); font-size: 0.86rem; color: var(--color-text-secondary); }
/* já confirmou o e-mail (escolhendo o computador): a lista de espera não faz sentido ali */
.beta-gate:has(.account-limit) .beta-gate-waitlist { display: none; }
.beta-gate-actions-end { display: inline-flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.beta-gate-note { margin: 4px 0 0; font-size: 0.84rem; color: var(--color-text-secondary); }
html.has-titlebar .beta-gate { padding-top: calc(var(--titlebar-h) + 8px); }
/* "Usar outro e-mail" pede confirmação (Sair): o diálogo fica por cima da tela do beta */
html:has(#beta-gate:not([hidden])) .udo-confirm { z-index: 5100; }
/* na barra de título só ficam os controles da janela (claros sobre o fundo escuro) */
html:has(#beta-gate:not([hidden])) .universal-command-dock,
html:has(#beta-gate:not([hidden])) :is(#titlebar-beta, #titlebar-sync, #titlebar-update) { display: none !important; }
html:has(#beta-gate:not([hidden])) :is(.titlebar-symbol, .titlebar-logo) { filter: none; }
html:has(#beta-gate:not([hidden])) .app-titlebar {
  --tb-fg: rgba(255, 255, 255, 0.7);
  --tb-fg-hover: #ffffff;
  --tb-hover: rgba(255, 255, 255, 0.1);
  --tb-press: rgba(255, 255, 255, 0.16);
}

/* Calendário semanal: tarefas compactas como os chips do mês (renderCalendarWeek) */
.calendar-week-grid .calendar-event-card.calendar-event-mini {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin-top: 3px;
  padding: 3px 6px 3px 4px;
  border: none;
  border-radius: 5px;
  background: var(--color-bg-subtle);
  box-shadow: none;
  font-size: 0.74rem;
  line-height: 1.3;
  transform: none;
  transition: background var(--duration-fast) ease;
}
.calendar-week-grid .calendar-event-card.calendar-event-mini:hover { background: var(--color-bg-active); }
.calendar-event-mini .calendar-event-title { flex: 1; min-width: 0; margin: 0; font-size: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event-mini .calendar-event-check .checklist-box { transform: scale(0.85); }
.calendar-event-mini.completed { opacity: 1; }

/* Nota aberta: a barra é transparente; cada botão flutua com fundo e sombra próprios.
   O texto da nota passa por baixo ao rolar: tudo o que flutua tem fundo OPACO (a cor do cartão
   pintada sobre a da página, que é sólida em todos os temas), nunca translúcido. */
.notes-editor-bar {
  background: transparent; box-shadow: none; pointer-events: none;
  --notes-float: linear-gradient(var(--color-bg-surface-elevated), var(--color-bg-surface-elevated)) var(--color-bg-base);
  --notes-float-hover: linear-gradient(var(--color-bg-active), var(--color-bg-active)), var(--notes-float);
}
.notes-editor-bar > * { pointer-events: auto; }
.notes-editor-bar .notes-back.fluent-btn,   /* .fluent-btn: vence o "subtle" sem fundo do modo escuro */
.notes-editor-bar .notes-pin,
.notes-editor-bar .notes-links-indicator,
.notes-editor-bar .notes-more {
  min-width: 32px; height: 32px; border-radius: 10px;
  background: var(--notes-float);
  border: var(--border-subtle);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.notes-editor-bar .notes-back.fluent-btn:hover,
.notes-editor-bar .notes-pin:hover,
.notes-editor-bar .notes-links-indicator:hover,
.notes-editor-bar .notes-more:hover,
.notes-editor-bar .notes-links-indicator[aria-expanded="true"],
.notes-editor-bar .notes-more[aria-expanded="true"] { background: var(--notes-float-hover); }
.notes-editor-bar .notes-pin[aria-pressed="true"] { background: var(--notes-float); color: var(--color-text-strong); }
.notes-editor-bar .notes-pin[aria-pressed="true"]:hover { background: var(--notes-float-hover); }
/* "Salvando…/Salvo": pílula do mesmo material, encostada nos botões; vazio, não aparece */
.notes-editor-bar .notes-status {
  pointer-events: none;
  flex: 0 1 auto;
  margin-left: auto;
  display: inline-flex; align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  background: var(--notes-float);
  border: var(--border-subtle);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.notes-editor-bar .notes-status:empty { visibility: hidden; padding: 0; border: 0; }

/* Fixar: o alfinete fica preenchido (e inclinado) só quando a nota está fixada de verdade */
.notes-editor-bar .notes-pin svg { transition: transform var(--duration-fast) var(--ease-fluent), fill var(--duration-fast) ease; }
.notes-editor-bar .notes-pin[aria-pressed="true"] svg { fill: currentColor; transform: rotate(-35deg); }
.notes-editor-bar .notes-pin.is-flipping[aria-pressed="true"] svg { animation: notesPinIn 0.45s cubic-bezier(.34,1.56,.64,1); }
.notes-editor-bar .notes-pin.is-flipping[aria-pressed="false"] svg { animation: notesPinOut 0.35s cubic-bezier(.34,1.56,.64,1); }
.notes-editor-bar .notes-pin[aria-pressed="true"] { color: var(--color-text-strong); }

/* Menu (…) e popover de vínculos: mesmo material dos botões flutuantes da barra */
.notes-editor-bar .notes-menu,
.notes-editor-bar .notes-pop {
  top: calc(100% + 6px);
  border: var(--border-subtle);
  border-radius: 12px;
  background: var(--notes-float);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 10px 28px rgba(0, 0, 0, 0.08);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.notes-editor-bar .notes-menu-item { border-radius: 8px; }
.notes-editor-bar .notes-menu-item:hover,
.notes-editor-bar .notes-menu-item:focus-visible { background: var(--color-bg-active); }
@keyframes notesPinIn {
  0% { transform: rotate(0) scale(1); }
  40% { transform: rotate(-50deg) scale(1.35) translateY(-2px); }
  70% { transform: rotate(-28deg) scale(0.92); }
  100% { transform: rotate(-35deg) scale(1); }
}
@keyframes notesPinOut {
  0% { transform: rotate(-35deg) scale(1); }
  50% { transform: rotate(12deg) scale(1.15); }
  100% { transform: rotate(0) scale(1); }
}

/* Entrar e sair da nota: a página sobe crescendo com um leve "mola"; ao voltar, encolhe e
   some, e a biblioteca volta de um zoom suave */
@keyframes notesPageIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes notesPageOut {
  to { opacity: 0; transform: translateY(12px) scale(0.97); }
}
@keyframes notesLibIn {
  from { opacity: 0; transform: scale(1.025); }
  to { opacity: 1; transform: none; }
}
.notes-editor.is-entering { animation: notesPageIn 0.38s cubic-bezier(.22,1.2,.36,1); transform-origin: 50% 0; }
.notes-editor.is-leaving { animation: notesPageOut 0.2s ease-in forwards; transform-origin: 50% 0; pointer-events: none; }
.notes-library.is-entering { animation: notesLibIn 0.3s var(--ease-fluent); }
@media (prefers-reduced-motion: reduce) {
  .notes-editor.is-entering, .notes-editor.is-leaving, .notes-library.is-entering,
  .notes-editor-bar .notes-pin svg { animation: none !important; }
}

/* Notas: troca de filtro com cascata mais viva; card excluído encolhe e some */
@keyframes notesCardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  60% { opacity: 1; }
  to { opacity: 1; transform: none; }
}
.notes-grid.is-entering > .notes-item { animation-duration: 0.36s; animation-timing-function: cubic-bezier(.22,1.2,.36,1); animation-delay: calc(var(--i, 0) * 35ms); }

/* Sem notas: bloco central, ícone num quadrado suave, texto discreto */
@keyframes notesEmptyIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.notes-view .notes-empty {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  max-width: 320px; margin: 48px auto 0; padding: 0; text-align: center;
  font-size: 0.86rem; line-height: 1.5; color: var(--color-text-tertiary);
  animation: notesEmptyIn 0.4s var(--ease-fluent);
}
.notes-view .notes-empty::before {
  content: ''; width: 40px; height: 40px; opacity: 0.55; background-color: var(--color-text-tertiary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.6'/%3E%3Cpath d='M2 6h4M2 10h4M2 14h4M2 18h4'/%3E%3Cpath d='M21.4 5.6a2.1 2.1 0 1 0-3-3l-5 5a2 2 0 0 0-.5.9l-.8 2.9 2.9-.8a2 2 0 0 0 .9-.5z'/%3E%3C/svg%3E") center / 40px no-repeat;
  box-shadow: none;
}
@media (prefers-reduced-motion: reduce) {
  .notes-item.is-leaving, .notes-view .notes-empty { animation: none !important; transition: none !important; }
}

/* Excluir nota: borda vermelha + tremidinha, depois encolhe e some (o notes-ui espera 520 ms) */
@keyframes notesCardShake {
  0%, 100% { transform: none; }
  15% { transform: translateX(-5px) rotate(-1deg); }
  30% { transform: translateX(5px) rotate(1deg); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(3px); }
  75% { transform: translateX(-1px); }
}
@keyframes notesCardOut { to { opacity: 0; transform: scale(0.88); filter: blur(2px); } }
.notes-item.is-leaving { animation: notesCardShake 0.3s ease-in-out, notesCardOut 0.22s ease-in 0.3s forwards; pointer-events: none; }
.notes-item.is-leaving > .notes-card {
  box-shadow: 0 0 0 1.5px #e5484d, 0 6px 18px rgba(229, 72, 77, 0.18);
  transition: box-shadow 0.15s ease;
}

/* Categorias (filtros) e Lixeira: a pílula escolhida "acende" com um pulinho, o hover desliza */
@keyframes notesFilterOn { 0% { transform: scale(0.92); } 60% { transform: scale(1.06); } 100% { transform: none; } }
.notes-filter { transition: background-color 0.25s var(--ease-fluent), color 0.25s var(--ease-fluent), transform 0.15s var(--ease-fluent); }
.notes-filter:hover:not([aria-pressed="true"]) { background: var(--color-bg-active); }
.notes-filter[aria-pressed="true"] { animation: notesFilterOn 0.32s cubic-bezier(.34,1.56,.64,1); }
@keyframes notesFadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.notes-empty-trash:not([hidden]),
.notes-target-chip:not([hidden]) { animation: notesFadeIn 0.25s var(--ease-fluent); }
@media (prefers-reduced-motion: reduce) {
  .notes-item.is-leaving, .notes-filter[aria-pressed="true"], .notes-empty-trash, .notes-target-chip { animation: none !important; }
}

/* Filtros com ícone */
.notes-filter { display: inline-flex; align-items: center; gap: 6px; }
.notes-filter .ui-ico { flex: none; opacity: 0.75; transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), opacity 0.2s ease; }
.notes-filter:hover .ui-ico { transform: scale(1.12); }
.notes-filter[aria-pressed="true"] .ui-ico { opacity: 1; }
.notes-filter .notes-btn-label { font-size: inherit; }

/* Lixeira: excluir de vez / esvaziar — os cards caem e somem em cascata, sem tremer */
@keyframes notesCardPurge { to { opacity: 0; transform: translateY(10px) scale(0.92); filter: blur(2px); } }
.notes-item.is-purging { animation: notesCardPurge 0.24s ease-in forwards; animation-delay: calc(var(--i, 0) * 40ms); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .notes-item.is-purging { animation: none !important; } }

/* Aviso de lista vazia: um ícone para cada filtro (data-kind, posto pelo notes-ui) */
.notes-view .notes-empty[data-kind="independent"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27m18.84%2012.25%201.72-1.71h-.02a5%205%200%200%200-.12-7.07%205%205%200%200%200-6.95%200l-1.72%201.71%27%2F%3E%3Cpath%20d%3D%27m5.17%2011.75-1.71%201.71a5%205%200%200%200%20.12%207.07%205%205%200%200%200%206.95%200l1.71-1.71%27%2F%3E%3Cpath%20d%3D%27M8%202v3%27%2F%3E%3Cpath%20d%3D%27M2%208h3%27%2F%3E%3Cpath%20d%3D%27M16%2019v3%27%2F%3E%3Cpath%20d%3D%27M19%2016h3%27%2F%3E%3C%2Fsvg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27m18.84%2012.25%201.72-1.71h-.02a5%205%200%200%200-.12-7.07%205%205%200%200%200-6.95%200l-1.72%201.71%27%2F%3E%3Cpath%20d%3D%27m5.17%2011.75-1.71%201.71a5%205%200%200%200%20.12%207.07%205%205%200%200%200%206.95%200l1.71-1.71%27%2F%3E%3Cpath%20d%3D%27M8%202v3%27%2F%3E%3Cpath%20d%3D%27M2%208h3%27%2F%3E%3Cpath%20d%3D%27M16%2019v3%27%2F%3E%3Cpath%20d%3D%27M19%2016h3%27%2F%3E%3C%2Fsvg%3E"); }
.notes-view .notes-empty[data-kind="pinned"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M12%2017v5%27%2F%3E%3Cpath%20d%3D%27M9%2010.76a2%202%200%200%201-1.11%201.79l-1.78.9A2%202%200%200%200%205%2015.24V16a1%201%200%200%200%201%201h12a1%201%200%200%200%201-1v-.76a2%202%200%200%200-1.11-1.79l-1.78-.9A2%202%200%200%201%2015%2010.76V7a1%201%200%200%201%201-1%202%202%200%200%200%200-4H8a2%202%200%200%200%200%204%201%201%200%200%201%201%201z%27%2F%3E%3C%2Fsvg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M12%2017v5%27%2F%3E%3Cpath%20d%3D%27M9%2010.76a2%202%200%200%201-1.11%201.79l-1.78.9A2%202%200%200%200%205%2015.24V16a1%201%200%200%200%201%201h12a1%201%200%200%200%201-1v-.76a2%202%200%200%200-1.11-1.79l-1.78-.9A2%202%200%200%201%2015%2010.76V7a1%201%200%200%201%201-1%202%202%200%200%200%200-4H8a2%202%200%200%200%200%204%201%201%200%200%201%201%201z%27%2F%3E%3C%2Fsvg%3E"); }
.notes-view .notes-empty[data-kind="trash"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M3%206h18%27%2F%3E%3Cpath%20d%3D%27M19%206v14c0%201-1%202-2%202H7c-1%200-2-1-2-2V6%27%2F%3E%3Cpath%20d%3D%27M8%206V4c0-1%201-2%202-2h4c1%200%202%201%202%202v2%27%2F%3E%3C%2Fsvg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M3%206h18%27%2F%3E%3Cpath%20d%3D%27M19%206v14c0%201-1%202-2%202H7c-1%200-2-1-2-2V6%27%2F%3E%3Cpath%20d%3D%27M8%206V4c0-1%201-2%202-2h4c1%200%202%201%202%202v2%27%2F%3E%3C%2Fsvg%3E"); }
.notes-view .notes-empty[data-kind="project"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M20%2020a2%202%200%200%200%202-2V8a2%202%200%200%200-2-2h-7.9a2%202%200%200%201-1.69-.9L9.6%203.9A2%202%200%200%200%207.93%203H4a2%202%200%200%200-2%202v13a2%202%200%200%200%202%202Z%27%2F%3E%3C%2Fsvg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M20%2020a2%202%200%200%200%202-2V8a2%202%200%200%200-2-2h-7.9a2%202%200%200%201-1.69-.9L9.6%203.9A2%202%200%200%200%207.93%203H4a2%202%200%200%200-2%202v13a2%202%200%200%200%202%202Z%27%2F%3E%3C%2Fsvg%3E"); }
.notes-view .notes-empty[data-kind="target"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M10%2013a5%205%200%200%200%207.54.54l3-3a5%205%200%200%200-7.07-7.07l-1.72%201.71%27%2F%3E%3Cpath%20d%3D%27M14%2011a5%205%200%200%200-7.54-.54l-3%203a5%205%200%200%200%207.07%207.07l1.71-1.71%27%2F%3E%3C%2Fsvg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M10%2013a5%205%200%200%200%207.54.54l3-3a5%205%200%200%200-7.07-7.07l-1.72%201.71%27%2F%3E%3Cpath%20d%3D%27M14%2011a5%205%200%200%200-7.54-.54l-3%203a5%205%200%200%200%207.07%207.07l1.71-1.71%27%2F%3E%3C%2Fsvg%3E"); }
.notes-view .notes-empty[data-kind="search"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%2711%27%20cy%3D%2711%27%20r%3D%278%27%2F%3E%3Cpath%20d%3D%27m21%2021-4.3-4.3%27%2F%3E%3C%2Fsvg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.8%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%2711%27%20cy%3D%2711%27%20r%3D%278%27%2F%3E%3Cpath%20d%3D%27m21%2021-4.3-4.3%27%2F%3E%3C%2Fsvg%3E"); }

/* Restaurar da lixeira: o card ganha um contorno verde suave, sobe e some (volta às notas) */
@keyframes notesCardRestore {
  0% { transform: none; opacity: 1; }
  35% { transform: translateY(2px) scale(1.02); opacity: 1; }
  100% { transform: translateY(-16px) scale(0.94); opacity: 0; }
}
.notes-item.is-restoring { animation: notesCardRestore 0.36s cubic-bezier(.5,0,.75,0) forwards; pointer-events: none; }
.notes-item.is-restoring > .notes-card { box-shadow: 0 0 0 1.5px #30a46c, 0 6px 18px rgba(48, 164, 108, 0.18); transition: box-shadow 0.12s ease; }
@media (prefers-reduced-motion: reduce) { .notes-item.is-restoring { animation: none !important; } }

/* Ícones da sidebar: as animações ficam no script.js (NAV_ICON_ANIMS); aqui só o eixo e a nitidez */
.fluent-sidebar .nav-icon svg { transform-origin: 50% 50%; backface-visibility: hidden; will-change: transform; }

/* Botão da conta: círculo com a inicial do e-mail (sem sessão fica o ícone de perfil) */
.fluent-sidebar .nav-icon .nav-avatar {
  display: block; width: 24px; height: 24px; line-height: 24px; text-align: center; padding: 0; border-radius: 50%;
  font-family: var(--font-sans, inherit); font-feature-settings: normal;
  background: var(--sb-text, var(--color-text-strong)); color: #141414;
  font-size: 12px; font-weight: 700; letter-spacing: 0; user-select: none;
}
:root[data-theme="light"] .fluent-sidebar .nav-avatar { color: #ffffff; }

/* Controles segmentados com pílula deslizante (syncSegPills no script.js): a opção escolhida
   perde o fundo próprio e a pílula, por baixo, desliza até ela com uma leve mola */
.has-seg-pill { position: relative; isolation: isolate; }
.seg-pill {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  border-radius: 7px;
  background: var(--surface-selected-bg, var(--color-bg-surface-elevated));
  border: var(--surface-selected-border, none);
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.04);
  pointer-events: none;
  transition: transform 0.42s cubic-bezier(.3, 1.25, .45, 1), width 0.42s cubic-bezier(.3, 1.25, .45, 1),
              height 0.3s ease, opacity 0.2s ease;
}
.theme-segmented > .seg-pill { border-radius: var(--radius-full); }
:root[data-theme="dark"] .seg-pill { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); }
.has-seg-pill.calendar-mode-toggle > button.active,
.has-seg-pill.modal-tabs > .modal-tab.active,
.has-seg-pill .theme-option > input:checked + span {
  /* !important: as regras do modo escuro (mais específicas) punham a sombra de novo */
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.has-seg-pill.calendar-mode-toggle > button,
.has-seg-pill.modal-tabs > .modal-tab,
.has-seg-pill .theme-option > span { transition: color 0.3s ease; }
.has-seg-pill.calendar-mode-toggle > button:active,
.has-seg-pill.modal-tabs > .modal-tab:active,
.has-seg-pill .theme-option > span:active { transform: scale(0.96); transition: color 0.3s ease, transform 0.12s ease; }
@media (prefers-reduced-motion: reduce) { .seg-pill { transition: none; } }

/* Calendário: troca de semana/mês (animateCalendarPeriod no script.js) */
@keyframes calLabelNext { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
@keyframes calLabelPrev { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes calSwapMode { from { opacity: 0; transform: scale(0.97) translateY(6px); } to { opacity: 1; transform: none; } }
/* moldura do carrossel: corta só nas laterais (com folga para a sombra), nunca em cima e embaixo */
/* a moldura passa 24px para cada lado da caixa; o esmaecimento fica só nessa faixa de fora,
   onde as caixas entram e saem: a caixa parada nunca é coberta */
.cal-stage {
  position: relative; overflow-x: clip;
  margin: 0 -24px; padding: 0 24px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}
/* a semana fica numa área com rolagem horizontal: solta-a durante o deslize para a faixa não ser cortada */
.calendar-scroll-wrap.cal-animating { overflow-x: visible; }
.cal-ghost { position: absolute; top: 0; left: 24px; width: calc(100% - 48px); pointer-events: none; }
.calendar-range-label.cal-slide-next, .calendar-select.cal-slide-next { animation: calLabelNext 0.3s cubic-bezier(.22, 1, .36, 1); }
.calendar-range-label.cal-slide-prev, .calendar-select.cal-slide-prev { animation: calLabelPrev 0.3s cubic-bezier(.22, 1, .36, 1); }
.cal-swap-mode { animation: calSwapMode 0.34s cubic-bezier(.22, 1, .36, 1); transform-origin: 50% 0; }
.calendar-range-label { display: inline-block; }
@media (prefers-reduced-motion: reduce) { .cal-slide-next, .cal-slide-prev, .cal-swap-mode { animation: none !important; } }

/* ==========================================================================
   NOTAS: CORES (texto, célula, tabela) E PRÉVIA ILUSTRADA DOS CARDS
   ========================================================================== */
/* cada chave da paleta vira --nc; as regras abaixo usam-no (texto, fundo da célula, tabela, bolinhas) */
[data-text-color="gray"], [data-cell-color="gray"], [data-table-color="gray"], [data-swatch="gray"] { --nc: var(--note-c-gray); }
[data-text-color="red"], [data-cell-color="red"], [data-table-color="red"], [data-swatch="red"] { --nc: var(--note-c-red); }
[data-text-color="orange"], [data-cell-color="orange"], [data-table-color="orange"], [data-swatch="orange"] { --nc: var(--note-c-orange); }
[data-text-color="yellow"], [data-cell-color="yellow"], [data-table-color="yellow"], [data-swatch="yellow"] { --nc: var(--note-c-yellow); }
[data-text-color="green"], [data-cell-color="green"], [data-table-color="green"], [data-swatch="green"] { --nc: var(--note-c-green); }
[data-text-color="teal"], [data-cell-color="teal"], [data-table-color="teal"], [data-swatch="teal"] { --nc: var(--note-c-teal); }
[data-text-color="blue"], [data-cell-color="blue"], [data-table-color="blue"], [data-swatch="blue"] { --nc: var(--note-c-blue); }
[data-text-color="purple"], [data-cell-color="purple"], [data-table-color="purple"], [data-swatch="purple"] { --nc: var(--note-c-purple); }
[data-text-color="pink"], [data-cell-color="pink"], [data-table-color="pink"], [data-swatch="pink"] { --nc: var(--note-c-pink); }
/* a cor própria (#rrggbb) chega pronta em --nc / --bandc, no style do elemento */
[data-text-color="coral"], [data-cell-color="coral"], [data-table-color="coral"], [data-swatch="coral"] { --nc: var(--note-c-coral); }
[data-text-color="amber"], [data-cell-color="amber"], [data-table-color="amber"], [data-swatch="amber"] { --nc: var(--note-c-amber); }
[data-text-color="lime"], [data-cell-color="lime"], [data-table-color="lime"], [data-swatch="lime"] { --nc: var(--note-c-lime); }
[data-text-color="mint"], [data-cell-color="mint"], [data-table-color="mint"], [data-swatch="mint"] { --nc: var(--note-c-mint); }
[data-text-color="sky"], [data-cell-color="sky"], [data-table-color="sky"], [data-swatch="sky"] { --nc: var(--note-c-sky); }
[data-text-color="indigo"], [data-cell-color="indigo"], [data-table-color="indigo"], [data-swatch="indigo"] { --nc: var(--note-c-indigo); }
[data-text-color="magenta"], [data-cell-color="magenta"], [data-table-color="magenta"], [data-swatch="magenta"] { --nc: var(--note-c-magenta); }
[data-text-color="brown"], [data-cell-color="brown"], [data-table-color="brown"], [data-swatch="brown"] { --nc: var(--note-c-brown); }

:is(.notes-prose, .note-mini) [data-text-color] { color: var(--nc); }
/* texto com cor própria: mantém o tom e só corrige a claridade para o tema (preto no escuro continua legível) */
:is(.notes-prose, .note-mini) [data-text-color^="#"] { color: oklch(from var(--nc) min(l, 0.56) c h); }
:root[data-theme="dark"] :is(.notes-prose, .note-mini) [data-text-color^="#"] { color: oklch(from var(--nc) max(l, 0.74) c h); }
:is(.notes-prose, .note-mini) [data-cell-color] { background: color-mix(in srgb, var(--nc) 16%, transparent); }
:is(.notes-prose, .note-mini) table[data-table-color] {
  --note-table-line: color-mix(in srgb, var(--nc) 38%, transparent);
  border-color: var(--note-table-line);
}
:is(.notes-prose, .note-mini) table[data-table-color] th:not([data-cell-color]) { background: color-mix(in srgb, var(--nc) 20%, transparent); }
:is(.notes-prose, .note-mini) table[data-table-color] th { color: color-mix(in srgb, var(--nc) 70%, var(--color-text-strong)); }
/* cor própria não muda com o tema: o título do cabeçalho fica na cor normal do texto, sempre legível */
:is(.notes-prose, .note-mini) table[data-table-color^="#"] th { color: var(--color-text-strong); }

/* barra flutuante: botão "A" (com a cor atual por baixo) e a fila de cores */
.notes-bubble-btn.is-color { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.notes-bubble-color-a { font-weight: 700; line-height: 1; }
.notes-bubble-color-bar { width: 14px; height: 3px; border-radius: 2px; background: var(--color-text-strong); }
.notes-bubble-btn.is-color[data-current="gray"] .notes-bubble-color-bar { background: var(--note-c-gray); }
.notes-bubble-btn.is-color[data-current="red"] .notes-bubble-color-bar { background: var(--note-c-red); }
.notes-bubble-btn.is-color[data-current="orange"] .notes-bubble-color-bar { background: var(--note-c-orange); }
.notes-bubble-btn.is-color[data-current="yellow"] .notes-bubble-color-bar { background: var(--note-c-yellow); }
.notes-bubble-btn.is-color[data-current="green"] .notes-bubble-color-bar { background: var(--note-c-green); }
.notes-bubble-btn.is-color[data-current="teal"] .notes-bubble-color-bar { background: var(--note-c-teal); }
.notes-bubble-btn.is-color[data-current="blue"] .notes-bubble-color-bar { background: var(--note-c-blue); }
.notes-bubble-btn.is-color[data-current="purple"] .notes-bubble-color-bar { background: var(--note-c-purple); }
.notes-bubble-btn.is-color[data-current="pink"] .notes-bubble-color-bar { background: var(--note-c-pink); }
.notes-bubble-btn.is-color[data-current] .notes-bubble-color-bar { background: var(--current); }
.notes-bubble-colors { gap: 4px; padding: 2px; }
.notes-bubble-colors.is-more { flex-wrap: wrap; max-width: 292px; }
.notes-bubble-break { flex: 0 0 100%; height: 0; }
.notes-bubble-swatch.is-more, .notes-bubble-swatch.is-add {
  position: relative; display: inline-grid; place-items: center; overflow: hidden;
  background: transparent; box-shadow: inset 0 0 0 1.5px var(--note-table-line);
  color: var(--color-text-secondary); font-weight: 500;
}
.notes-bubble-swatch.is-more:hover, .notes-bubble-swatch.is-add:hover { background: var(--color-bg-hover); }
.notes-bubble-swatch.is-add:focus-within { outline: 2px solid var(--input-ring-focus); outline-offset: 2px; }
.notes-bubble-swatch {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--nc);
  color: var(--color-text-strong);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s var(--ease-fluent), box-shadow 0.15s ease;
}
.notes-bubble-swatch.is-default { background: var(--color-bg-hover); }
.notes-bubble-swatch:hover { transform: scale(1.12); }
.notes-bubble-swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--color-bg-surface), 0 0 0 3.5px var(--color-text-strong); }

/* bolinhas de cor (painel "Configurações da tabela" das notas) */
.ctx-swatch {
  flex: none;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--nc) 70%, transparent);
  color: var(--color-text-tertiary);
  cursor: pointer;
  transition: transform 0.15s var(--ease-fluent), box-shadow 0.15s ease;
}
.ctx-swatch.is-none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--note-table-line); }
.ctx-swatch:hover { transform: scale(1.15); }
.ctx-swatch:focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: 2px; }
.ctx-swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--color-bg-surface), 0 0 0 3.5px var(--color-text-strong); }


/* A nota em miniatura (UdoNotes.previewHtml): as mesmas proporções da página (títulos 1.85 /
   1.45 / 1.18 do texto), num tamanho de card; corta embaixo num degradê */
.note-mini {
  display: block;
  min-height: 0;
  overflow: hidden;
  color: var(--color-text-primary);
  font-size: 0.74rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2.2em), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 2.2em), transparent);
}
.note-mini > * + * { margin-top: 0.4em; }
.note-mini p { margin: 0; }
.note-mini .np-gap { height: 0.5em; }
.note-mini h1, .note-mini h2, .note-mini h3 { margin: 0.5em 0 0.1em; font-weight: 700; line-height: 1.22; letter-spacing: -0.01em; color: var(--color-text-strong); }
.note-mini > :first-child { margin-top: 0; }
.note-mini h1 { font-size: 1.85em; }
.note-mini h2 { font-size: 1.45em; }
.note-mini h3 { font-size: 1.18em; }
.note-mini .np-sm { font-size: 0.875em; }
.note-mini .np-lg { font-size: 1.25em; }
.note-mini .np-xl { font-size: 1.62em; }
.note-mini .np-link { color: var(--tag-blue); text-decoration: underline; text-underline-offset: 2px; }
.note-mini code, .note-mini pre { font-family: Consolas, monospace; font-size: 0.92em; border-radius: 4px; background: var(--color-bg-hover); }
.note-mini code { padding: 0 3px; }
.note-mini pre { margin: 0; padding: 5px 7px; white-space: pre-wrap; }
.note-mini ul, .note-mini ol { margin: 0; padding-left: 1.3em; }
.note-mini ul.np-tasks { list-style: none; padding-left: 0; }
.note-mini .np-tasks li { display: flex; align-items: flex-start; gap: 0.45em; }
.note-mini .np-check { flex: none; width: 0.95em; height: 0.95em; margin-top: 0.27em; border: 1.5px solid var(--color-text-tertiary); border-radius: 3px; box-sizing: border-box; }
.note-mini .np-tasks li.is-done { color: var(--color-text-tertiary); text-decoration: line-through; }
.note-mini .np-tasks li.is-done .np-check { border-color: var(--color-text-strong); background: var(--color-text-strong); }
.note-mini blockquote { margin: 0; padding-left: 0.7em; border-left: 2px solid var(--color-text-tertiary); color: var(--color-text-secondary); }
.note-mini hr { margin: 0.5em 0; border: 0; border-top: 1px solid var(--note-table-line); }
.note-mini .np-img { display: block; width: 100%; max-height: 7.5em; object-fit: cover; border-radius: 8px; background: var(--color-bg-hover); }
.note-mini .np-img-empty { display: grid; place-items: center; height: 4.5em; color: var(--color-text-tertiary); font-size: 0.9em; }
.note-mini table {
  width: 100%;
  border: 1px solid var(--note-table-line);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 6px;
  overflow: hidden;
  table-layout: fixed;
  font-size: 0.9em;
  line-height: 1.35;
}
.note-mini td, .note-mini th {
  padding: 2px 6px;
  border-right: 1px solid var(--note-table-line);
  border-bottom: 1px solid var(--note-table-line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-mini tr > :last-child { border-right: 0; }
.note-mini tr:last-child > * { border-bottom: 0; }
.note-mini th { background: var(--note-table-head); color: var(--color-text-strong); font-weight: 600; }

/* no card da biblioteca: ocupa o meio do card (título em cima, etiquetas embaixo); o título
   fica do tamanho de um título de página em miniatura, para sobrar espaço para a nota */
.notes-card .notes-item-mini { flex: 1 1 auto; }
.notes-card.has-mini { gap: 10px; padding-top: 24px; }
.notes-card.has-mini .notes-item-title { font-size: 1.42rem; line-height: 1.18; }
.notes-card.has-mini .notes-card-top { margin-top: -8px; }
.notes-view.notes-narrow .notes-card .notes-item-mini { font-size: 0.68rem; }
.notes-view.notes-narrow .notes-card.has-mini .notes-item-title { font-size: 1.15rem; }
/* no card da página do projeto: altura limitada; o degradê só aparece quando passa da altura
   (medido do topo: uma nota curta não esmaece) */
.project-note-mini {
  flex: none;
  max-height: 150px;
  font-size: 0.72rem;
  -webkit-mask-image: linear-gradient(to bottom, #000 120px, transparent 150px);
  mask-image: linear-gradient(to bottom, #000 120px, transparent 150px);
}

/* Prévia ilustrada mais apagada: o destaque do card é o título da nota, não o conteúdo;
   ao passar o rato, a prévia aparece um pouco mais */
.notes-card .notes-item-mini,
.project-note-mini { opacity: 0.5; transition: opacity 0.2s var(--ease-fluent); }
.notes-card:hover .notes-item-mini,
.project-note:hover .project-note-mini { opacity: 0.75; }
@media (prefers-reduced-motion: reduce) { .notes-card .notes-item-mini, .project-note-mini { transition: none; } }

/* ==========================================================================
   NOTAS: ESTILO DA TABELA (faixas) E O PAINEL "CONFIGURAÇÕES DA TABELA"
   ========================================================================== */
/* faixas: data-band-rows (alt | same | rainbow), data-band-cols (alt | rainbow) e a cor delas
   (data-band-color → --bandc). Linhas pintam o fundo; colunas, uma camada por cima (as duas
   juntas misturam-se). A cor da própria célula (data-cell-color) vale sempre mais. */
[data-band-color="gray"] { --bandc: var(--note-c-gray); }
[data-band-color="red"] { --bandc: var(--note-c-red); }
[data-band-color="orange"] { --bandc: var(--note-c-orange); }
[data-band-color="yellow"] { --bandc: var(--note-c-yellow); }
[data-band-color="green"] { --bandc: var(--note-c-green); }
[data-band-color="teal"] { --bandc: var(--note-c-teal); }
[data-band-color="blue"] { --bandc: var(--note-c-blue); }
[data-band-color="purple"] { --bandc: var(--note-c-purple); }
[data-band-color="pink"] { --bandc: var(--note-c-pink); }
[data-band-color="coral"] { --bandc: var(--note-c-coral); }
[data-band-color="amber"] { --bandc: var(--note-c-amber); }
[data-band-color="lime"] { --bandc: var(--note-c-lime); }
[data-band-color="mint"] { --bandc: var(--note-c-mint); }
[data-band-color="sky"] { --bandc: var(--note-c-sky); }
[data-band-color="indigo"] { --bandc: var(--note-c-indigo); }
[data-band-color="magenta"] { --bandc: var(--note-c-magenta); }
[data-band-color="brown"] { --bandc: var(--note-c-brown); }
:is(.notes-prose table, .note-mini table, table.notes-tp-thumb)[data-band-rows="alt"] tr:nth-child(even) > td:not([data-cell-color]) { background-color: color-mix(in srgb, var(--bandc, var(--note-c-gray)) 16%, transparent); }
:is(.notes-prose table, .note-mini table, table.notes-tp-thumb)[data-band-rows="same"] td:not([data-cell-color]) { background-color: color-mix(in srgb, var(--bandc, var(--note-c-gray)) 12%, transparent); }
:is(.notes-prose table, .note-mini table, table.notes-tp-thumb)[data-band-rows="rainbow"] tr:nth-child(8n+2) > td:not([data-cell-color]) { background-color: color-mix(in srgb, var(--note-c-red) 16%, transparent); }
:is(.notes-prose table, .note-mini table, table.notes-tp-thumb)[data-band-rows="rainbow"] tr:nth-child(8n+3) > td:not([data-cell-color]) { background-color: color-mix(in srgb, var(--note-c-orange) 16%, transparent); }
:is(.notes-prose table, .note-mini table, table.notes-tp-thumb)[data-band-rows="rainbow"] tr:nth-child(8n+4) > td:not([data-cell-color]) { background-color: color-mix(in srgb, var(--note-c-yellow) 16%, transparent); }
:is(.notes-prose table, .note-mini table, table.notes-tp-thumb)[data-band-rows="rainbow"] tr:nth-child(8n+5) > td:not([data-cell-color]) { background-color: color-mix(in srgb, var(--note-c-green) 16%, transparent); }
:is(.notes-prose table, .note-mini table, table.notes-tp-thumb)[data-band-rows="rainbow"] tr:nth-child(8n+6) > td:not([data-cell-color]) { background-color: color-mix(in srgb, var(--note-c-teal) 16%, transparent); }
:is(.notes-prose table, .note-mini table, table.notes-tp-thumb)[data-band-rows="rainbow"] tr:nth-child(8n+7) > td:not([data-cell-color]) { background-color: color-mix(in srgb, var(--note-c-blue) 16%, transparent); }
:is(.notes-prose table, .note-mini table, table.notes-tp-thumb)[data-band-rows="rainbow"] tr:nth-child(8n+8) > td:not([data-cell-color]) { background-color: color-mix(in srgb, var(--note-c-purple) 16%, transparent); }
:is(.notes-prose table, .note-mini table, table.notes-tp-thumb)[data-band-rows="rainbow"] tr:nth-child(8n+1) > td:not([data-cell-color]) { background-color: color-mix(in srgb, var(--note-c-pink) 16%, transparent); }
:is(.notes-prose table, .note-mini table, table.notes-tp-thumb)[data-band-cols="alt"] td:nth-child(even):not([data-cell-color]) { background-image: linear-gradient(color-mix(in srgb, var(--bandc, var(--note-c-gray)) 13%, transparent), color-mix(in srgb, var(--bandc, var(--note-c-gray)) 13%, transparent)); }
:is(.notes-prose table, .note-mini table, table.notes-tp-thumb)[data-band-cols="rainbow"] td:nth-child(8n+1):not([data-cell-color]) { background-image: linear-gradient(color-mix(in srgb, var(--note-c-red) 14%, transparent), color-mix(in srgb, var(--note-c-red) 14%, transparent)); }
:is(.notes-prose table, .note-mini table, table.notes-tp-thumb)[data-band-cols="rainbow"] td:nth-child(8n+2):not([data-cell-color]) { background-image: linear-gradient(color-mix(in srgb, var(--note-c-orange) 14%, transparent), color-mix(in srgb, var(--note-c-orange) 14%, transparent)); }
:is(.notes-prose table, .note-mini table, table.notes-tp-thumb)[data-band-cols="rainbow"] td:nth-child(8n+3):not([data-cell-color]) { background-image: linear-gradient(color-mix(in srgb, var(--note-c-yellow) 14%, transparent), color-mix(in srgb, var(--note-c-yellow) 14%, transparent)); }
:is(.notes-prose table, .note-mini table, table.notes-tp-thumb)[data-band-cols="rainbow"] td:nth-child(8n+4):not([data-cell-color]) { background-image: linear-gradient(color-mix(in srgb, var(--note-c-green) 14%, transparent), color-mix(in srgb, var(--note-c-green) 14%, transparent)); }
:is(.notes-prose table, .note-mini table, table.notes-tp-thumb)[data-band-cols="rainbow"] td:nth-child(8n+5):not([data-cell-color]) { background-image: linear-gradient(color-mix(in srgb, var(--note-c-teal) 14%, transparent), color-mix(in srgb, var(--note-c-teal) 14%, transparent)); }
:is(.notes-prose table, .note-mini table, table.notes-tp-thumb)[data-band-cols="rainbow"] td:nth-child(8n+6):not([data-cell-color]) { background-image: linear-gradient(color-mix(in srgb, var(--note-c-blue) 14%, transparent), color-mix(in srgb, var(--note-c-blue) 14%, transparent)); }
:is(.notes-prose table, .note-mini table, table.notes-tp-thumb)[data-band-cols="rainbow"] td:nth-child(8n+7):not([data-cell-color]) { background-image: linear-gradient(color-mix(in srgb, var(--note-c-purple) 14%, transparent), color-mix(in srgb, var(--note-c-purple) 14%, transparent)); }
:is(.notes-prose table, .note-mini table, table.notes-tp-thumb)[data-band-cols="rainbow"] td:nth-child(8n+8):not([data-cell-color]) { background-image: linear-gradient(color-mix(in srgb, var(--note-c-pink) 14%, transparent), color-mix(in srgb, var(--note-c-pink) 14%, transparent)); }

/* o painel: flutua ao lado da tabela, no <body> (como a barra flutuante) */
.notes-table-panel {
  position: fixed;
  z-index: 1300;
  width: 330px;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 12px 14px 14px;
  border: var(--border-subtle);
  border-radius: 14px;
  background: var(--color-bg-surface);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
  color: var(--color-text-primary);
  font-size: 0.84rem;
  animation: notesTpIn 0.16s var(--ease-fluent) both;
}
@keyframes notesTpIn { from { opacity: 0; transform: translateY(4px) scale(0.98); } to { opacity: 1; transform: none; } }
.notes-tp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.notes-tp-title { font-weight: 700; font-size: 0.9rem; color: var(--color-text-strong); }
.notes-tp-close {
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--color-text-secondary); font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.notes-tp-close:hover { background: var(--color-bg-hover); color: var(--color-text-strong); }
.notes-tp-body { display: flex; flex-direction: column; gap: 12px; }
.notes-tp-field { display: flex; flex-direction: column; gap: 6px; transition: opacity 0.2s ease; }
.notes-tp-field.is-off { opacity: 0.4; }
.notes-tp-label { font-size: 0.74rem; font-weight: 600; color: var(--color-text-secondary); }
.notes-tp-swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.notes-tp-swatches .ctx-swatch { width: 20px; height: 20px; }
.notes-tp-colors { display: flex; flex-direction: column; gap: 7px; }
.notes-tp-sublabel { font-size: 0.7rem; color: var(--color-text-tertiary); }
.ctx-swatch.is-more, .ctx-swatch.is-add {
  position: relative; overflow: hidden; background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--note-table-line);
  color: var(--color-text-secondary); font-size: 13px; line-height: 1;
}
.ctx-swatch.is-more:hover, .ctx-swatch.is-add:hover { background: var(--color-bg-hover); }
.notes-tp-color-input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.ctx-swatch.is-add:focus-within { outline: 2px solid var(--input-ring-focus); outline-offset: 2px; }
.notes-tp-seg { display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--color-bg-hover); }
.notes-tp-seg-btn {
  flex: 1 1 auto; padding: 5px 6px; border: 0; border-radius: 7px; white-space: nowrap;
  background: transparent; color: var(--color-text-secondary); font: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.notes-tp-seg-btn:hover { color: var(--color-text-primary); }
.notes-tp-seg-btn[aria-checked="true"] { background: var(--color-bg-surface); color: var(--color-text-strong); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
:root[data-theme="dark"] .notes-tp-seg-btn[aria-checked="true"] { background: rgba(255, 255, 255, 0.12); }
.notes-tp-section { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: var(--border-subtle); }
.notes-tp-empty { margin: 0; font-size: 0.76rem; line-height: 1.4; color: var(--color-text-tertiary); }
.notes-tp-styles { display: flex; flex-direction: column; gap: 2px; }
.notes-tp-style { display: flex; align-items: center; gap: 2px; border-radius: 9px; transition: background-color 0.15s ease; }
.notes-tp-style:hover, .notes-tp-style.is-current { background: var(--color-bg-hover); }
.notes-tp-style-apply {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 5px 6px; border: 0;
  background: transparent; color: var(--color-text-primary); font: inherit; text-align: left; cursor: pointer;
}
.notes-tp-style-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.notes-tp-style.is-current .notes-tp-style-name { font-weight: 600; }
.notes-tp-style-default, .notes-tp-style-del {
  flex: none; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px;
  background: transparent; color: var(--color-text-tertiary); font-size: 0.95rem; line-height: 1; cursor: pointer;
}
.notes-tp-style-default:hover, .notes-tp-style-del:hover { background: var(--color-bg-active); color: var(--color-text-strong); }
.notes-tp-style-default.is-on { color: #e2a400; }
.notes-tp-thumb {
  flex: none; width: 38px; height: 26px; border: 1px solid var(--note-table-line); border-collapse: separate; border-spacing: 0;
  border-radius: 5px; overflow: hidden; table-layout: fixed;
}
.notes-tp-thumb td, .notes-tp-thumb th { padding: 0; border-right: 1px solid var(--note-table-line); border-bottom: 1px solid var(--note-table-line); }
.notes-tp-thumb tr > :last-child { border-right: 0; }
.notes-tp-thumb tr:last-child > * { border-bottom: 0; }
.notes-tp-thumb th { background: var(--note-table-head); }
.notes-tp-thumb[data-table-color] { --note-table-line: color-mix(in srgb, var(--nc) 38%, transparent); }
.notes-tp-thumb[data-table-color] th { background: color-mix(in srgb, var(--nc) 30%, transparent); }
.notes-tp-save { display: flex; gap: 6px; }
.notes-table-panel .notes-tp-save .notes-tp-name.notes-tp-name {
  flex: 1; min-width: 0; height: 30px; padding: 0 10px; border: var(--border-subtle); border-radius: 8px;
  background: var(--color-bg-hover); box-shadow: none; color: var(--color-text-primary); font: inherit; font-size: 0.8rem;
}
.notes-tp-save-btn {
  flex: none; height: 30px; padding: 0 12px; border: 0; border-radius: 8px;
  background: var(--color-text-strong); color: var(--color-bg-surface); font: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer;
}
.notes-tp-save-btn:hover { opacity: 0.88; }
:is(.notes-tp-close, .notes-tp-seg-btn, .notes-tp-style-apply, .notes-tp-style-default, .notes-tp-style-del, .notes-tp-save-btn):focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .notes-table-panel { animation: none; } }

/* ==========================================================================
   NOVIDADES (changelog): a "aba" das notas de versão e a pílula da barra lateral
   ========================================================================== */
/* card de aviso: topo direito, em azul (a cor da estrelinha); por baixo dos modais e menus */
.news-card {
  position: fixed;
  top: 16px;
  right: 22px;
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 340px;
  box-sizing: border-box;
  padding: 14px 12px 14px 14px;
  border-radius: 18px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, 0.16), transparent 60%),
    linear-gradient(135deg, var(--tag-blue), color-mix(in srgb, var(--tag-blue) 70%, var(--tag-purple)));
  color: #fff;
  box-shadow: 0 18px 44px color-mix(in srgb, var(--tag-blue) 38%, transparent), 0 2px 6px rgba(0, 0, 0, 0.12);
}
html.has-titlebar .news-card { top: calc(var(--titlebar-h) + 10px); }
.news-card.is-entering { animation: newsCardIn 0.55s cubic-bezier(.22, 1.2, .36, 1) 0.8s backwards; }
.news-card.is-leaving { animation: newsCardOut 0.22s ease forwards; pointer-events: none; }
@keyframes newsCardIn { from { opacity: 0; transform: translateY(-14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes newsCardOut { to { opacity: 0; transform: translateY(-10px) scale(0.97); } }
.news-card-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.news-card.is-entering .news-card-ico svg { animation: newsSpark 1.2s ease 1.3s; }
@keyframes newsSpark { 0%, 100% { transform: none; } 40% { transform: rotate(-14deg) scale(1.18); } 70% { transform: rotate(8deg) scale(0.96); } }
.news-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.news-card-kicker { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.85; }
.news-card-title { font-size: 0.98rem; font-weight: 700; line-height: 1.25; }
.news-card-text { font-size: 0.8rem; line-height: 1.4; opacity: 0.9; }
.news-card-actions { display: flex; gap: 6px; margin-top: 10px; }
.news-card-open, .news-card-later {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s var(--ease-fluent), background-color 0.15s ease;
}
.news-card-open { background: #fff; color: var(--tag-blue); }
.news-card-open:hover { transform: translateY(-1px); }
.news-card-later { background: transparent; color: rgba(255, 255, 255, 0.9); }
.news-card-later:hover { background: rgba(255, 255, 255, 0.16); }
.news-card-x {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: -4px -2px 0 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}
.news-card-x:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
:is(.news-card-open, .news-card-later, .news-card-x):focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 820px) { .news-card { left: 12px; right: 12px; width: auto; } }

/* a página: uma aba (com ×) e as novidades em blocos foto + texto, alternando os lados */
.changelog-page { max-width: 980px; margin: 0 auto; padding: 0 4px 110px; container: changelog / inline-size; }
.changelog-tabbar { display: flex; margin-bottom: 30px; border-bottom: var(--border-subtle); }
.changelog-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -1px;
  padding: 6px 6px 6px 14px;
  border: var(--border-subtle);
  border-bottom-color: transparent;
  border-radius: 10px 10px 0 0;
  background: var(--color-bg-surface);
  color: var(--color-text-strong);
  font-size: 0.82rem;
  font-weight: 600;
}
.changelog-tab-ico { display: grid; color: var(--tag-blue); }
.changelog-tab-version { color: var(--color-text-tertiary); font-weight: 500; }
.changelog-tab-close {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-left: 4px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-tertiary);
  cursor: pointer;
}
.changelog-tab-close:hover { background: var(--color-bg-hover); color: var(--color-text-strong); }
.changelog-kicker { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tag-blue); }
.changelog-hero h2 { margin: 6px 0 8px; font-size: 2.1rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; color: var(--color-text-strong); }
.changelog-hero p { margin: 0 0 18px; font-size: 1rem; color: var(--color-text-secondary); }
.changelog-toc { display: flex; flex-wrap: wrap; gap: 6px; }
.changelog-toc-item {
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--color-bg-hover);
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.changelog-toc-item:hover { background: var(--color-bg-active); color: var(--color-text-primary); }
.changelog-list { display: flex; flex-direction: column; gap: 48px; margin: 40px 0 0; padding: 0; list-style: none; }
.changelog-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; scroll-margin-top: 20px; }
@container changelog (min-width: 760px) {
  .changelog-item { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 36px; align-items: center; }
  .changelog-item:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
  .changelog-item:nth-child(even) .changelog-shot { order: 2; }
}
.changelog-shot {
  margin: 0;
  overflow: hidden;
  border: var(--border-glass);
  border-radius: 16px;
  background: var(--color-bg-surface);
  box-shadow: var(--note-card-shadow);
}
.changelog-shot { display: grid; place-items: center; }
/* a foto no tamanho real (srcset 1.5x); as grandes encolhem para caber */
.changelog-shot > img { display: block; max-width: 100%; height: auto; max-height: 420px; object-fit: contain; transition: transform 0.5s var(--ease-fluent); }
.changelog-item:hover .changelog-shot > img { transform: scale(1.015); }
/* Mini vídeo (frames): os quadros empilhados no mesmo lugar e trocados com um fade; por baixo,
   a barra com Pausar, a legenda do passo, os pontos e o progresso do quadro (--reel-ms) */
.changelog-reel { display: flex; flex-direction: column; place-items: stretch; }
.changelog-reel-stage { display: grid; place-items: center; padding: 10px; min-height: 160px; }
.changelog-reel-stage > img {
  grid-area: 1 / 1;
  display: block; max-width: 100%; height: auto; max-height: 400px; object-fit: contain;
  opacity: 0; transform: scale(0.985);
  transition: opacity 0.45s ease, transform 0.6s var(--ease-fluent);
}
.changelog-reel-stage > img.is-on { opacity: 1; transform: none; }
.changelog-reel-bar {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px 11px;
  border-top: var(--border-subtle);
  font-size: 0.8rem; color: var(--color-text-secondary);
}
.changelog-reel-play {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0;
  border: var(--border-subtle); border-radius: 50%; background: var(--color-bg-surface); color: var(--color-text-primary);
  cursor: pointer; transition: background var(--duration-fast) ease, transform 0.12s ease;
}
.changelog-reel-play:hover { background: var(--color-bg-hover); }
.changelog-reel-play:active { transform: scale(0.92); }
.changelog-reel-caption { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.changelog-reel-caption b { margin-right: 4px; font-variant-numeric: tabular-nums; color: var(--color-text-tertiary); font-weight: 600; }
.changelog-reel-dots { flex: none; display: flex; gap: 6px; }
.changelog-reel-dot {
  width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%;
  background: color-mix(in srgb, var(--color-text-primary) 22%, transparent); cursor: pointer;
  transition: background var(--duration-fast) ease, width 0.25s var(--ease-fluent);
}
.changelog-reel-dot.is-on { width: 18px; border-radius: 4px; background: var(--color-text-strong); }
.changelog-reel-dot:hover { background: color-mix(in srgb, var(--color-text-primary) 45%, transparent); }
:is(.changelog-reel-play, .changelog-reel-dot):focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: 2px; }
.changelog-reel-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; overflow: hidden; }
.changelog-reel-progress > i { display: block; height: 100%; width: 100%; background: var(--color-text-strong); opacity: 0.35; transform: scaleX(0); transform-origin: left; }
.changelog-reel-progress.is-running > i { animation: reelProgress var(--reel-ms, 2800ms) linear forwards; }
.changelog-reel:hover .changelog-reel-progress > i { animation-play-state: paused; }
@keyframes reelProgress { to { transform: scaleX(1); } }
/* "Antes" e "Agora": mensagens do Chat de verdade (os mesmos cartões), uma em cima da outra */
.changelog-demo { display: flex; flex-direction: column; gap: 14px; padding: 16px; place-items: stretch; text-align: left; }
.changelog-demo-context { color: var(--color-text-tertiary); font-size: 0.78rem; }
.changelog-demo-pane { display: flex; flex-direction: column; gap: 8px; }
.changelog-demo-pane + .changelog-demo-pane { padding-top: 14px; border-top: var(--border-subtle); }
.changelog-demo-label { align-self: flex-start; padding: 2px 9px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; background: var(--color-bg-active); color: var(--color-text-secondary); }
.changelog-demo-pane[data-when="after"] .changelog-demo-label { background: color-mix(in srgb, var(--tag-green) 14%, transparent); color: var(--tag-green); }
.changelog-demo-pane[data-when="before"] .ai-chat-feed-list { opacity: 0.78; }
.changelog-demo .chat-time, .changelog-demo .chat-feedback { display: none; }
.changelog-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tone, var(--tag-blue)) 14%, transparent);
  color: var(--tone, var(--tag-blue));
  font-size: 0.7rem;
  font-weight: 700;
}
.changelog-tag[data-tone="purple"] { --tone: var(--tag-purple); }
.changelog-tag[data-tone="green"] { --tone: var(--tag-green); }
.changelog-text h3 { margin: 10px 0 6px; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; color: var(--color-text-strong); }
.changelog-text p { margin: 0 0 14px; line-height: 1.5; color: var(--color-text-secondary); }
.changelog-steps { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; counter-reset: step; }
.changelog-steps li { counter-increment: step; display: flex; gap: 10px; font-size: 0.88rem; line-height: 1.45; color: var(--color-text-primary); }
.changelog-steps li::before {
  content: counter(step);
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 999px;
  background: var(--color-text-strong);
  color: var(--color-bg-surface);
  font-size: 0.7rem;
  font-weight: 700;
}
.changelog-steps b { font-weight: 650; color: var(--color-text-strong); }
.changelog-cta { display: inline-flex; align-items: center; gap: 4px; font-size: 0.84rem; }
.changelog-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 52px; padding-top: 18px; border-top: var(--border-subtle); color: var(--color-text-tertiary); font-size: 0.82rem; }
.changelog-page.is-entering .changelog-hero { animation: projRise 0.4s var(--ease-fluent) backwards; }
.changelog-page.is-entering .changelog-item { animation: projRise 0.45s var(--ease-fluent) backwards; animation-delay: calc(var(--i, 0) * 70ms + 90ms); }
:is(.changelog-tab-close, .changelog-toc-item):focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .news-card.is-entering, .news-card.is-leaving, .news-card-ico svg, .changelog-page.is-entering .changelog-hero, .changelog-page.is-entering .changelog-item { animation: none; }
  .changelog-shot > img { transition: none; }
  .changelog-reel-stage > img { transition: none; transform: none; }
  .changelog-reel-progress > i { animation: none !important; }
}

/* Novidades: "Também nesta versão" e "Correções" (sem foto, uma linha cada) */
/* "Também nesta versão" (19/11): cartõezinhos em grade (ícone · título · uma frase) e, por baixo,
   as correções recolhidas numa linha. Antes era uma lista de parágrafos longos. */
.changelog-extra { margin-top: 56px; }
.changelog-extra-title { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 1.05rem; font-weight: 700; color: var(--color-text-strong); }
.changelog-extra-title .ui-ico { color: var(--tag-blue); }
.changelog-tiles { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 0; padding: 0; list-style: none; }
@container changelog (min-width: 620px) { .changelog-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container changelog (min-width: 960px) { .changelog-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.changelog-tile { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: var(--border-subtle); border-radius: 16px; background: var(--color-bg-surface); }
.changelog-tile-ico { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: color-mix(in srgb, var(--tag-blue) 14%, transparent); color: var(--tag-blue); }
.changelog-tile strong { display: block; margin: 5px 0 4px; font-size: 0.9rem; font-weight: 650; color: var(--color-text-strong); }
.changelog-tile p { margin: 0; font-size: 0.82rem; line-height: 1.45; color: var(--color-text-secondary); }
.changelog-fixes { margin-top: 16px; border: var(--border-subtle); border-radius: 14px; background: var(--color-bg-surface); }
.changelog-fixes > summary { display: flex; align-items: center; gap: 8px; padding: 13px 16px; list-style: none; cursor: pointer; font-size: 0.9rem; font-weight: 650; color: var(--color-text-strong); }
.changelog-fixes > summary::-webkit-details-marker { display: none; }
.changelog-fixes > summary > .ui-ico:first-child { color: var(--tag-green); }
.changelog-fixes-count { padding: 1px 8px; border-radius: 999px; background: var(--color-bg-subtle); font-size: 0.75rem; font-weight: 600; color: var(--color-text-secondary); }
.changelog-fixes-chevron { margin-left: auto; color: var(--color-text-tertiary); transition: transform var(--duration-fast) ease; }
.changelog-fixes[open] .changelog-fixes-chevron { transform: rotate(180deg); }
.changelog-fixes ul { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0 20px 16px 40px; }
.changelog-fixes li { font-size: 0.85rem; line-height: 1.45; color: var(--color-text-secondary); }
.changelog-fixes li::marker { color: var(--color-text-tertiary); }
/* Hierarquia por importância (renderChangelogCurrent / renderChangelogHistory):
   1) a versão atual (patch) no topo, aberta e em destaque, com o aviso de mudança;
   2) os patches anteriores em linhas compactas, recolhidas;
   3) a grande atualização (fotos, vídeos), aberta. Toda seção recolhe/expande. */
.changelog-section .changelog-collapse {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s var(--ease-fluent, ease);
}
.changelog-section.is-open > .changelog-collapse { grid-template-rows: 1fr; }
/* clip com margem: as sombras das fotos não ficam cortadas com a seção aberta */
.changelog-collapse-inner { min-height: 0; overflow: clip; overflow-clip-margin: 32px; }
.changelog-section:not(.is-open) > .changelog-collapse .changelog-collapse-inner { visibility: hidden; transition: visibility 0s 0.28s; }
.changelog-toggle {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: var(--border-subtle); border-radius: 999px; background: transparent; color: var(--color-text-secondary); cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.changelog-toggle:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }
.changelog-toggle .ui-ico, .changelog-row-chevron .ui-ico { transition: transform 0.25s var(--ease-fluent, ease); }
.changelog-section.is-open .changelog-toggle .ui-ico,
.changelog-row.is-open .changelog-row-chevron .ui-ico { transform: rotate(180deg); }
.changelog-toggle:focus-visible, .changelog-row-head:focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: 2px; }

/* 1) a versão atual */
.changelog-current { margin-bottom: 40px; }
.changelog-current-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.changelog-current h2 { margin: 6px 0 0; font-size: 1.9rem; font-weight: 700; line-height: 1.18; letter-spacing: -0.02em; color: var(--color-text-strong); }
.changelog-current-lead { margin: 10px 0 0; font-size: 1rem; color: var(--color-text-secondary); }
.changelog-notice {
  display: flex; gap: 12px; margin-top: 20px; padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--tag-blue) 26%, transparent); border-radius: 14px;
  background: color-mix(in srgb, var(--tag-blue) 7%, transparent);
}
.changelog-notice-ico { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: color-mix(in srgb, var(--tag-blue) 16%, transparent); color: var(--tag-blue); }
.changelog-notice strong { display: block; font-size: 0.92rem; color: var(--color-text-strong); }
.changelog-notice p { margin: 3px 0 0; font-size: 0.88rem; line-height: 1.5; color: var(--color-text-secondary); }
.changelog-notice-action { display: inline-flex; align-items: center; gap: 2px; margin-top: 8px; font-size: 0.85rem; font-weight: 600; color: var(--tag-blue); }
/* lista de mudanças de um patch: só texto, com um ponto discreto */
.changelog-notes { display: flex; flex-direction: column; gap: 9px; margin: 20px 0 0; padding: 0; list-style: none; }
.changelog-notes li { position: relative; padding-left: 18px; font-size: 0.92rem; line-height: 1.5; color: var(--color-text-primary); }
.changelog-notes li::before { content: ""; position: absolute; left: 4px; top: 0.62em; width: 5px; height: 5px; border-radius: 50%; background: var(--color-text-tertiary); }
.changelog-notes-head { margin: 22px 0 -8px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-tertiary); }

/* 2) as anteriores: linhas finas (versão · título · n mudanças · ⌄) */
.changelog-history { margin: 0 0 28px; }
.changelog-history-title { margin: 0 0 6px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-tertiary); }
.changelog-row { border-top: var(--border-subtle); }
.changelog-row:last-child { border-bottom: var(--border-subtle); }
.changelog-row-head {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto 20px; align-items: center; gap: 12px;
  width: 100%; padding: 11px 6px; border: 0; border-radius: 8px; background: transparent;
  color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background-color 0.15s ease;
}
.changelog-row-head:hover { background: var(--color-bg-hover); }
.changelog-row-ver { font-size: 0.8rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--color-text-tertiary); }
.changelog-row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; font-weight: 600; color: var(--color-text-primary); }
.changelog-row-count { font-size: 0.78rem; color: var(--color-text-tertiary); }
.changelog-row-chevron { display: grid; place-items: center; color: var(--color-text-tertiary); }
.changelog-row .changelog-collapse-inner { padding: 0 6px 0 70px; }
.changelog-row .changelog-notes { margin: 2px 0 14px; }
.changelog-row .changelog-notes li { font-size: 0.87rem; color: var(--color-text-secondary); }
.changelog-row .changelog-notes-head { margin: 4px 0 6px; }
@container changelog (max-width: 560px) {
  .changelog-row-head { grid-template-columns: 44px minmax(0, 1fr) 20px; }
  .changelog-row-count { display: none; }
  .changelog-row .changelog-collapse-inner { padding-left: 6px; }
}

/* 3) a grande atualização, depois da versão atual: separada por uma linha e um pouco menor */
.changelog-release.is-earlier { padding-top: 36px; border-top: var(--border-subtle); }
.changelog-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.changelog-release.is-earlier .changelog-hero h2 { font-size: 1.6rem; }
.changelog-release .changelog-toc { margin-bottom: 4px; }
@media (prefers-reduced-motion: reduce) {
  .changelog-section .changelog-collapse, .changelog-toggle .ui-ico, .changelog-row-chevron .ui-ico { transition: none; }
}

/* ==================================================================== PERÍODOS (formato 5)
   "Casa da minha avó" (sáb manhã → dom noite), "Praia" (qui–sáb): faixa em cima da lista do dia
   (Hoje, semana, mês, janela do dia). Clicável: abre a edição. Ocupa a agenda = borda cheia. */
.period-band { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.period-band.is-compact { flex-direction: column; gap: 4px; margin: 4px 0 6px; }
/* na agenda do Hoje: alinhada ao cabeçalho e às linhas do cartão */
.fluent-sheet > .period-band { margin: 10px 18px 4px; }
.period-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  padding: 4px 10px;
  border: 1px dashed color-mix(in srgb, var(--tag-blue) 45%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--tag-blue) 10%, transparent);
  color: var(--color-text-primary);
  font: inherit;
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
  transition: background var(--duration-fast) ease;
}
.period-chip svg { flex: none; color: var(--tag-blue); }
.period-chip:hover { background: color-mix(in srgb, var(--tag-blue) 18%, transparent); }
.period-chip:focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: 2px; }
.period-chip.is-blocking { border-style: solid; }
.period-chip-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.period-chip-range { flex: none; color: var(--color-text-secondary); }
.period-band.is-compact .period-chip { border-radius: 5px; padding: 3px 6px; font-size: 0.72rem; }
/* formulário da tarefa: linhas de caixa (como "Enviar para a Inbox") e campos que só aparecem às vezes */
#task-modal-form .modal-check-row { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; margin: 4px 0; cursor: pointer; }
#task-modal-form .modal-check-row input { width: auto; margin: 0; }
#task-modal-form [hidden] { display: none !important; }
.ai-blocks-toggle { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 0.78rem; cursor: pointer; }
.ai-blocks-toggle input { width: auto; margin: 0; }

/* ======================================== FOCO DO MOMENTO: "esperando" e chegada pelo lembrete
   A hora de outra tarefa chegou com esta no foco: uma linha compacta (não um 2.º cartão).
   Neutra ("Começou às 15:00"); âmbar só depois da folga ("Atrasada há 15 min"). */
.agora-waiting {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: var(--border-subtle);
  border-radius: var(--radius-sm, 8px);
  background: var(--color-bg-subtle);
}
.agora-waiting.is-late { border-color: color-mix(in srgb, var(--tag-orange) 45%, transparent); background: color-mix(in srgb, var(--tag-orange) 8%, transparent); }
.agora-waiting-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.agora-waiting-label { display: inline-flex; align-items: center; gap: 4px; font-size: 0.74rem; font-weight: 600; color: var(--color-text-secondary); }
.agora-waiting.is-late .agora-waiting-label { color: var(--tag-orange); }
.agora-waiting-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--color-text-strong); }
.agora-waiting-more { font-size: 0.72rem; color: var(--color-text-tertiary); }
.agora-waiting-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.agora-waiting-actions .fluent-btn { padding: 5px 10px; font-size: 0.78rem; }
.notch-next.is-late .notch-next-label { color: var(--tag-orange); }
/* chegou pelo clique no lembrete: um contorno no CARTÃO que some sozinho */
.agora-module.is-called { animation: calledPulse 2.2s var(--ease-fluent, ease) 1; }
@keyframes calledPulse {
  0%, 60% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tag-blue) 45%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .agora-module.is-called { animation: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--tag-blue) 45%, transparent); }
}

/* ==================================== Formulário da tarefa: o essencial à vista, o resto em "Mais opções" */
#task-modal-form .tm-when { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 0.8fr); gap: 12px; }
@media (max-width: 560px) { #task-modal-form .tm-when { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
#task-modal-form .tm-slot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: -4px; font-size: 0.78rem; }
#task-modal-form .tm-slot .link-btn { display: inline-flex; align-items: center; gap: 4px; }
#task-modal-form .tm-more { margin-top: 4px; padding-top: 12px; border-top: var(--border-subtle); }
#task-modal-form .tm-more > summary { display: flex; align-items: center; gap: 6px; min-width: 0; list-style: none; cursor: pointer; font-size: 0.86rem; font-weight: 600; color: var(--color-text-primary); }
#task-modal-form .tm-more > summary::-webkit-details-marker { display: none; }
#task-modal-form .tm-more > summary svg { flex: none; transition: transform var(--duration-fast, 0.15s) ease; }
#task-modal-form .tm-more[open] > summary svg { transform: rotate(90deg); }
#task-modal-form .tm-more-hint { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; font-size: 0.78rem; color: var(--color-text-tertiary); }
#task-modal-form .tm-more-hint::before { content: '·'; margin-right: 6px; }
#task-modal-form .tm-more-body { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }
#task-modal-form .modal-check-row .text-subtle { font-weight: 400; }
/* Rótulos com ícone: localizar o campo de relance */
#task-modal-form .tm-label { display: inline-flex; align-items: center; gap: 6px; }
#task-modal-form .tm-dur-hint { margin-left: -2px; color: var(--color-text-tertiary); font-weight: 400; font-variant-numeric: tabular-nums; }
#task-modal-form .tm-dur-hint.is-bad { color: var(--tag-red); }
#task-modal-form .tm-label svg { flex: none; color: var(--color-text-tertiary); }
#task-modal-form label:focus-within > .tm-label svg,
#task-modal-form .modal-field:focus-within > .tm-label svg { color: var(--color-text-strong); }
/* Seletores com ícone (projeto, repetir): a opção escolhida mostra o ícone também */
#task-modal-form select.has-icons > button { display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: inherit; }
#task-modal-form select.has-icons selectedcontent { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#task-modal-form select.has-icons option { display: flex; align-items: center; gap: 8px; }
/* pasta do projeto na cor dele (contorno + preenchimento suave) */
#task-modal-form .opt-ico[style*="--proj"] { color: var(--proj); }
#task-modal-form .opt-ico[style*="--proj"] svg path { fill: color-mix(in srgb, var(--proj) 28%, transparent); }
/* Prioridade: controlo segmentado com barras de sinal (1–3), um clique em vez de abrir a lista */
#task-modal-form .tm-prio {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
}
#task-modal-form .tm-prio-opt {
  position: relative;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 5px 6px;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  user-select: none;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease, box-shadow var(--duration-fast) ease, transform 0.12s ease;
}
#task-modal-form .tm-prio-opt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#task-modal-form .tm-prio-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
#task-modal-form .tm-prio-opt:hover { color: var(--color-text-primary); background: color-mix(in srgb, var(--color-bg-surface) 55%, transparent); }
#task-modal-form .tm-prio-opt:active { transform: scale(0.97); }
#task-modal-form .tm-prio-opt:has(input:checked) {
  color: var(--color-text-strong);
  background: var(--color-bg-surface);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
#task-modal-form .tm-prio-opt:has(input:focus-visible) { outline: 2px solid var(--color-text-strong); outline-offset: -2px; }
.tm-prio-bars { flex: none; }
.tm-prio-bars rect { fill: currentColor; opacity: 0.22; transition: opacity var(--duration-fast) ease; }
.tm-prio-bars rect.on { opacity: 0.55; }
#task-modal-form .tm-prio-opt:has(input:checked) .tm-prio-bars rect.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { #task-modal-form .tm-prio-opt { transition: none; } #task-modal-form .tm-prio-opt:active { transform: none; } }
/* "‹ Voltar para …": a tarefa que estava no foco antes do lembrete */
/* só depois de um lembrete trocar o foco: discreto, numa linha, sem sublinhado */
.agora-back {
  display: inline-flex; align-items: center; gap: 3px;
  max-width: 100%;
  margin: 0 0 4px -4px; padding: 1px 8px 1px 4px;
  border: 0; border-radius: var(--radius-full);
  background: transparent;
  font: inherit; font-size: 0.72rem; color: var(--color-text-tertiary);
  cursor: pointer;
  transition: color var(--duration-fast) ease, background var(--duration-fast) ease;
}
.agora-back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agora-back svg { flex: none; transition: transform var(--duration-fast) var(--ease-fluent); }
.agora-back:hover { color: var(--color-text-strong); background: var(--color-bg-subtle); }
.agora-back:hover svg { transform: translateX(-2px); }
.agora-back:focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: 1px; }

/* ==========================================================================
   ZOOM NA FOTO (image-viewer.js): a imagem por cima de tudo, ajustada à janela. Fundo escuro
   nos dois modos (é uma "sala escura" para a foto); a barra usa os tokens dos menus.
   z-index acima dos modais e das janelas das notas (3100), abaixo da trava do beta (5000).
   ========================================================================== */
.img-viewer {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 10, 0.86);
  animation: imgViewerIn 0.18s ease-out both;
  user-select: none;
}
.img-viewer.is-closing { animation: imgViewerOut 0.16s ease-in both; }
.img-viewer-stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 48px 24px 8px;
  overflow: hidden;
}
.img-viewer-img {
  max-width: min(92vw, 100%);
  max-height: calc(100vh - 140px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform-origin: center;
  cursor: zoom-in;
  animation: imgViewerImgIn 0.24s var(--ease-fluent) backwards;
  will-change: transform;
}
.img-viewer-img.is-animating { transition: transform 0.22s var(--ease-fluent); }
.img-viewer.is-zoomed .img-viewer-img { cursor: grab; border-radius: 0; }
.img-viewer.is-dragging .img-viewer-img { cursor: grabbing; }
.img-viewer-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 10px 0 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-menu-bg, rgba(32, 32, 36, 0.94));
  border: var(--border-glass);
  box-shadow: var(--shadow-dropdown);
  color: var(--color-text-primary);
}
.img-viewer-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.img-viewer-btn:hover { background: var(--color-bg-hover); }
.img-viewer-btn:focus-visible { outline: 2px solid var(--input-ring-focus); outline-offset: 1px; }
.img-viewer-zoom { min-width: 48px; text-align: center; font-size: 0.8rem; font-variant-numeric: tabular-nums; color: var(--color-text-secondary); }
.img-viewer-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--color-border-subtle, rgba(127, 127, 127, 0.3)); }
.img-viewer-hint { margin: 0 0 14px; font-size: 0.74rem; color: rgba(255, 255, 255, 0.55); }
@keyframes imgViewerIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes imgViewerOut { to { opacity: 0; } }
@keyframes imgViewerImgIn { from { opacity: 0; transform: scale(0.96); } }
@media (prefers-reduced-motion: reduce) {
  .img-viewer, .img-viewer.is-closing, .img-viewer-img { animation: none; }
  .img-viewer-img.is-animating { transition: none; }
}
/* fotos das Novidades: um clique abre ampliada (nas notas é o duplo clique: o clique seleciona) */
.changelog-shot.is-zoomable > img { cursor: zoom-in; }

/* ==========================================================================
   NOVA TAREFA: "Escreva do seu jeito" (applyQuickCapture no script.js). Um campo grande, como o
   título de uma nota; por baixo, os chips do que foi entendido (clicar leva ao campo); depois,
   "ou preencha à mão" e o formulário de sempre.
   ========================================================================== */
.tm-quick { display: flex; flex-direction: column; gap: 8px; margin-bottom: 2px; }
.tm-quick-field { position: relative; display: block; margin: 0; }
.tm-quick-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--color-text-tertiary); display: grid; pointer-events: none; }
.tm-quick-input,
.task-modal .tm-quick-field .tm-quick-input {   /* vence as regras gerais dos campos da janela */
  width: 100%;
  padding: 13px 14px 13px 42px;
  border: none;
  border-radius: 14px;
  background: var(--color-bg-subtle);
  color: var(--color-text-strong);
  font: inherit;
  font-size: 1.02rem;
  font-weight: 500;
  outline: none;
  transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.tm-quick-input::placeholder { color: var(--color-text-tertiary); font-weight: 400; }
.task-modal .tm-quick-field .tm-quick-input:focus { background: var(--color-bg-surface-elevated); border-color: var(--input-ring-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--input-ring-focus) 18%, transparent); }
.tm-quick-field:focus-within .tm-quick-ico { color: var(--color-text-primary); }
.tm-quick-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; align-items: center; }
.tm-quick-hint { font-size: 0.76rem; color: var(--color-text-tertiary); }
.tm-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border: var(--border-subtle);
  border-radius: 999px;
  background: var(--color-bg-surface-elevated);
  color: var(--color-text-primary);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.tm-chip.is-new { animation: tmChipIn 0.22s var(--ease-fluent) backwards; }
.tm-chip .ui-ico { color: var(--color-text-secondary); }
button.tm-chip:hover { background: var(--color-bg-hover); }
.tm-chip.is-ignored { opacity: 0.55; text-decoration: line-through; }
.tm-chip.is-note { cursor: default; border-style: dashed; color: var(--color-text-secondary); }
@keyframes tmChipIn { from { opacity: 0; transform: translate3d(0, 3px, 0) scale(0.97); } }
.tm-or { margin: 4px 0 2px; border: 0; border-top: var(--border-subtle); }

/* Modo compacto (criação por texto ligada, 19/11): só o campo e a prévia do que foi entendido.
   O formulário (.tm-manual) fica escondido até "Todos os campos" (rodapé) ou um clique num chip;
   os avisos (data passada, hora de descanso) continuam à vista. */
#task-modal-form.is-compact .modal-tabs,
#task-modal-form.is-compact .tm-or,
#task-modal-form.is-compact .tm-manual > :not(.ai-rest-warning) { display: none; }   /* #id: vence o .tm-when/.tm-slot */
.task-modal.is-compact .modal-sheet-body { min-height: 0; padding-bottom: 16px; }   /* sem a altura das abas: a janela encolhe */
.task-modal.is-compact .tm-quick-field .tm-quick-input { padding-top: 16px; padding-bottom: 16px; font-size: 1.08rem; }
.tm-manual { display: contents; }
.tm-manual.is-opening > * { animation: tmManualIn 0.24s var(--ease-fluent) backwards; }
@keyframes tmManualIn { from { opacity: 0; transform: translate3d(0, -4px, 0); } }
/* prévia: a tarefa como vai ficar (bolinha + título), seguida dos chips */
.tm-preview-title { display: inline-flex; align-items: center; gap: 8px; margin-right: 4px; max-width: 100%; font-size: 0.9rem; font-weight: 600; color: var(--color-text-strong); }
.tm-preview-title > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-modal:not(.is-compact) .tm-preview-title { display: none; }   /* com o formulário à vista, o campo Título já mostra */
.tm-quick-hint.is-bad { color: var(--tag-red); }
.tm-preview-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--color-text-tertiary); }
/* o que vale por padrão (o dia de hoje, o projeto de onde abriu): apagado, sem caixa */
.tm-chip.is-default { background: transparent; border-color: transparent; color: var(--color-text-tertiary); }
.tm-chip.is-default .ui-ico { color: var(--color-text-tertiary); }
button.tm-chip.is-default:hover { color: var(--color-text-primary); }
/* "Todos os campos" / "Menos campos" no rodapé: texto discreto, sem sublinhado */
.task-modal .tm-expand { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; font-size: 0.85rem; text-decoration: none; color: var(--color-text-secondary); cursor: pointer; }
.task-modal .tm-expand:hover { color: var(--color-text-primary); }
/* rodapé: "Todos os campos" e o modelo da checklist lado a lado; com modelo, o nome dele em destaque */
.task-modal .tm-foot-left { display: inline-flex; align-items: center; gap: 16px; min-width: 0; }
.task-modal .tm-template { display: inline-flex; align-items: center; gap: 6px; margin: 0; max-width: 220px; font-weight: 500; font-size: 0.85rem; text-decoration: none; color: var(--color-text-secondary); cursor: pointer; }
.task-modal .tm-template span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-modal .tm-template:hover { color: var(--color-text-primary); }
.task-modal .tm-template.is-set { color: var(--color-text-strong); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .tm-chip.is-new, .tm-manual.is-opening > * { animation: none; } }

/* Chat: sugestões ao citar ("apaga a tarefa…"): lista pequena logo acima do campo, no material dos menus */
.chat-mention { position: absolute; left: 8px; bottom: calc(100% + 6px); z-index: 20; width: min(380px, calc(100% - 16px)); padding: 4px; border-radius: 12px; background: var(--surface-menu-bg, var(--color-bg-surface-elevated)); border: var(--border-glass, var(--border-subtle)); box-shadow: var(--shadow-dropdown, 0 8px 28px rgba(0, 0, 0, 0.14)); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); animation: chatMentionIn 0.14s var(--ease-fluent); }
.chat-mention[hidden] { display: none; }
.chat-mention-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 2px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em; color: var(--color-text-tertiary); }
.chat-mention-head kbd { font: inherit; font-weight: 600; padding: 0 4px; border-radius: 4px; background: var(--color-bg-hover); }
.chat-mention-item { display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--color-text-primary); font: inherit; font-size: 0.86rem; text-align: left; cursor: pointer; }
.chat-mention-item:hover, .chat-mention-item.is-active { background: var(--color-bg-hover); }
.chat-mention-item.is-active { box-shadow: inset 2px 0 0 var(--color-text-strong); }
.chat-mention-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-mention-meta { flex-shrink: 0; font-size: 0.74rem; color: var(--color-text-tertiary); }
@keyframes chatMentionIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .chat-mention { animation: none; } }
