/* OnZen — tema Natureza no estilo Windows 11 (Fluent)
   Camadas: paisagem ao fundo → Mica (janela) → camada de conteúdo → cartões */
:root {
  --font: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  --wall: var(--wall-light, url(/wallpapers/minimal/colinas-claro.svg));
  --acrylic: rgba(240, 246, 238, .62);
  --veil: transparent;
  --veil-foto: transparent;
  --mica: rgba(236, 244, 234, .50);
  --layer: rgba(255, 255, 255, .30);
  --card: rgba(255, 255, 255, .74);
  --card-hover: rgba(255, 255, 255, .92);
  --solid: #F6FAF4;
  --fill: rgba(22, 64, 34, .045);
  --fill-2: rgba(22, 64, 34, .085);
  --stroke: rgba(22, 52, 32, .10);
  --stroke-2: rgba(22, 52, 32, .24);
  --text: #16251B;
  --muted: #546659;
  --faint: #7B8B80;
  --danger: #B3261E;
  /* paleta natural (nomes das chaves mantidos por compatibilidade) */
  --ultra: #2A6C93;      /* Lago */
  --magenta: #A43E70;    /* Flor do campo */
  --teal: #2D774A;       /* Musgo */
  --amber: #9E6A00;      /* Girassol */
  --tangerine: #A5502A;  /* Terra */
  --graphite: #5A6760;   /* Pedra */
  --star: #C08400;
  --accent: var(--accent-auto, var(--teal));
  --on-accent: #FFFFFF;
  --shadow-flyout: 0 8px 32px rgba(10, 30, 16, .16), 0 2px 8px rgba(10, 30, 16, .06);
  --r-ctl: 4px;
  --r-card: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wall: var(--wall-dark, url(/wallpapers/minimal/colinas-escuro.svg));
    --acrylic: rgba(24, 32, 27, .64); --veil-foto: rgba(0, 0, 0, .28);
    --mica: rgba(18, 28, 22, .56); --layer: rgba(34, 46, 38, .32); --card: rgba(44, 58, 49, .64); --card-hover: rgba(54, 70, 59, .80);
    --solid: #202B24; --fill: rgba(255, 255, 255, .05); --fill-2: rgba(255, 255, 255, .085);
    --stroke: rgba(255, 255, 255, .08); --stroke-2: rgba(255, 255, 255, .20);
    --text: #E5EFE7; --muted: #A5B6AA; --faint: #7E9084; --danger: #FF8C82;
    --ultra: #7FBDE2; --magenta: #E690BB; --teal: #7DD09B; --amber: #F0C35E; --tangerine: #EE9F76; --graphite: #AFBBB4;
    --star: #F0C35E; --on-accent: #0D1A12;
    --shadow-flyout: 0 8px 32px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --wall: var(--wall-dark, url(/wallpapers/minimal/colinas-escuro.svg));
  --acrylic: rgba(24, 32, 27, .64); --veil-foto: rgba(0, 0, 0, .28);
  --mica: rgba(18, 28, 22, .56); --layer: rgba(34, 46, 38, .32); --card: rgba(44, 58, 49, .64); --card-hover: rgba(54, 70, 59, .80);
  --solid: #202B24; --fill: rgba(255, 255, 255, .05); --fill-2: rgba(255, 255, 255, .085);
  --stroke: rgba(255, 255, 255, .08); --stroke-2: rgba(255, 255, 255, .20);
  --text: #E5EFE7; --muted: #A5B6AA; --faint: #7E9084; --danger: #FF8C82;
  --ultra: #7FBDE2; --magenta: #E690BB; --teal: #7DD09B; --amber: #F0C35E; --tangerine: #EE9F76; --graphite: #AFBBB4;
  --star: #F0C35E; --on-accent: #0D1A12;
  --shadow-flyout: 0 8px 32px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

:root[data-theme="black"] {
  --wall: var(--wall-dark, url(/wallpapers/minimal/colinas-escuro.svg));
  --mica: rgba(0, 0, 0, .70); --layer: rgba(0, 0, 0, .35); --card: rgba(18, 18, 18, .78); --card-hover: rgba(34, 34, 34, .88);
  --acrylic: rgba(0, 0, 0, .78); --veil-foto: rgba(0, 0, 0, .40);
  --solid: #000000; --fill: rgba(255, 255, 255, .06); --fill-2: rgba(255, 255, 255, .10);
  --stroke: rgba(255, 255, 255, .10); --stroke-2: rgba(255, 255, 255, .22);
  --text: #F2F2F2; --muted: #A9A9A9; --faint: #7A7A7A; --danger: #FF8C82;
  --ultra: #7FBDE2; --magenta: #E690BB; --teal: #7DD09B; --amber: #F0C35E; --tangerine: #EE9F76; --graphite: #BDBDBD;
  --star: #F0C35E; --on-accent: #0A0A0A;
  --shadow-flyout: 0 8px 32px rgba(0, 0, 0, .7), 0 2px 8px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
/* Transparência: sólido (sem vidro), acrílico (padrão) e vidro (mais transparente) */
:root[data-glass="solid"] { --acrylic: var(--solid); --card: var(--solid); --card-hover: var(--fill-2); --veil-foto: transparent; }
:root[data-glass="solid"] .titlebar, :root[data-glass="solid"] .side, :root[data-glass="solid"] .detail,
:root[data-glass="solid"] .task, :root[data-glass="solid"] .composer, :root[data-glass="solid"] .done-toggle,
:root[data-glass="solid"] .auth-card { -webkit-backdrop-filter: none; backdrop-filter: none; }
:root[data-glass="glass"] { --acrylic: rgba(248, 252, 247, .34); --card: rgba(255, 255, 255, .38); --card-hover: rgba(255, 255, 255, .60); }
@media (prefers-color-scheme: dark) {
  :root[data-glass="glass"]:not([data-theme="light"]) { --acrylic: rgba(16, 24, 19, .34); --card: rgba(40, 52, 45, .32); --card-hover: rgba(52, 66, 57, .55); }
}
:root[data-glass="glass"][data-theme="dark"] { --acrylic: rgba(16, 24, 19, .34); --card: rgba(40, 52, 45, .32); --card-hover: rgba(52, 66, 57, .55); }
:root[data-glass="glass"][data-theme="black"] { --acrylic: rgba(0, 0, 0, .46); --card: rgba(14, 14, 14, .46); --card-hover: rgba(30, 30, 30, .66); }
:root[data-glass="glass"] .titlebar, :root[data-glass="glass"] .side, :root[data-glass="glass"] .detail {
  -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
}
:root[data-glass="glass"] .task, :root[data-glass="glass"] .composer { -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); }
:root[data-glass="glass"].style-foto .task-desc, :root[data-glass="glass"].style-foto .task-meta { color: var(--text); opacity: .82; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--text); font-family: var(--font); font-size: 14px; line-height: 20px;
  background: var(--solid); -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-color: var(--solid);
  background-image: linear-gradient(var(--veil), var(--veil)), var(--wall);
  background-size: cover; background-position: center bottom; background-repeat: no-repeat;
  transition: background-image .6s ease;
}
:root[data-accent="lista"] { --accent: var(--accent-view, var(--teal)); }
/* Fundo dinâmico: a paisagem muda com a hora e se move devagar */
.dynamic body::before { inset: -4%; animation: drift 120s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.07) translate(-1.5%, -1%); } }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; border-radius: var(--r-ctl); }
svg { flex: none; }

/* ---------- Janela ---------- */
.shell {
  display: grid; grid-template-columns: 288px minmax(0, 1fr); grid-template-rows: 48px minmax(0, 1fr);
  height: 100dvh; background: transparent;
}
/* Painéis em acrílico (estilo Windows 11); a paisagem aparece na área das tarefas */
.titlebar, .side, .detail {
  background: var(--acrylic); -webkit-backdrop-filter: blur(30px) saturate(1.4); backdrop-filter: blur(30px) saturate(1.4);
}
.task, .composer, .done-toggle { -webkit-backdrop-filter: blur(22px) saturate(1.3); backdrop-filter: blur(22px) saturate(1.3); }
.shell.has-detail { grid-template-columns: 288px minmax(0, 1fr) 400px; }

/* Barra de título */
.titlebar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px; min-width: 0; }
.app-title { display: flex; align-items: center; gap: 10px; font-size: 12px; width: 264px; flex: none; }
.app-icon { width: 18px; height: 18px; border-radius: 5px; background: linear-gradient(160deg, #4FA06A, #2A6B44); color: #fff; display: grid; place-items: center; flex: none; }
.search {
  flex: 1; max-width: 460px; margin: 0 auto; display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px; border-radius: var(--r-ctl); background: var(--card); border: 1px solid var(--stroke);
  color: var(--muted); box-shadow: inset 0 -1px 0 var(--stroke-2);
}
.search:focus-within { background: var(--solid); box-shadow: inset 0 -2px 0 var(--accent); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--text); }
.search input::placeholder { color: var(--faint); }
.tb-btn { width: 36px; height: 32px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--text); display: none; place-items: center; flex: none; }
.tb-btn:hover { background: var(--fill); }

/* ---------- Painel de navegação ---------- */
.side { grid-row: 2; grid-column: 1; display: flex; flex-direction: column; min-height: 0; padding: 4px 8px 12px; }
.nav { overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 2px; padding: 2px; }
.nav-item {
  position: relative; width: 100%; display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 12px;
  border: 0; border-radius: var(--r-ctl); background: none; text-align: left; color: var(--text); flex: none;
}
.nav-item:hover { background: var(--fill); }
.nav-item[aria-current="true"] { background: var(--fill-2); }
.nav-item[aria-current="true"]::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--c);
}
.nav-item .ico { color: var(--c); display: grid; place-items: center; width: 18px; }
.nav-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav-sep { height: 1px; background: var(--stroke); margin: 8px 12px; flex: none; }
.leaf { width: 12px; height: 12px; border-radius: 0 7px 0 7px; background: var(--c); }

.goal-card {
  margin: 10px 2px 8px; padding: 12px 14px; border-radius: var(--r-card); background: var(--card); border: 1px solid var(--stroke);
  text-align: left; width: calc(100% - 4px); color: var(--text); display: block;
}
.goal-top { display: flex; align-items: center; gap: 8px; }
.goal-top svg { color: var(--teal); }
.goal-title { font-weight: 600; flex: 1; }
.goal-num { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.progress { height: 4px; border-radius: 2px; background: var(--fill-2); margin-top: 10px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 2px; background: var(--teal); transition: width .4s ease; }
.goal-sub { margin-top: 8px; font-size: 12px; line-height: 16px; color: var(--muted); }
.side-foot { display: flex; gap: 4px; padding: 0 2px; }
.side-btn { flex: 1; display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 12px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--text); }
.side-btn:hover { background: var(--fill); }
.side-btn.icon-only { flex: 0 0 40px; padding: 0; justify-content: center; }
.demo-note { margin: 0 2px 8px; padding: 8px 12px; border-radius: var(--r-card); border: 1px dashed var(--stroke-2); color: var(--muted); font-size: 12px; line-height: 16px; }

/* ---------- Conteúdo ---------- */
.main {
  grid-row: 2; grid-column: 2; min-width: 0; min-height: 0; overflow-y: auto; background: transparent;
  border-top: 1px solid var(--stroke); border-left: 1px solid var(--stroke); border-top-left-radius: var(--r-card);
}
.main-inner { width: 100%; max-width: 880px; margin: 0 auto; padding: 32px 40px 160px; }
.head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.head-text { flex: 1; min-width: 0; }
.title-big {
  margin: 0; color: var(--accent); font-family: var(--font-display); font-weight: 600;
  font-size: 40px; line-height: 52px; overflow-wrap: anywhere; text-wrap: balance;
}
.title-big[contenteditable="true"] { outline: none; box-shadow: inset 0 -2px 0 var(--accent); }
.subhead { margin-top: 2px; color: var(--muted); }
.head-actions { display: flex; gap: 4px; padding-bottom: 8px; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--text); flex: none; }
.icon-btn:hover { background: var(--fill); }
.icon-btn:active { background: var(--fill-2); }

/* ---------- Nova tarefa ---------- */
.composer {
  background: var(--card); border: 1px solid var(--stroke); border-radius: var(--r-card); margin-bottom: 24px;
  box-shadow: inset 0 -1px 0 var(--stroke-2); transition: background .12s;
}
.composer:focus-within { background: var(--card-hover); box-shadow: inset 0 -2px 0 var(--accent); }
.composer-row { display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.composer-plus { color: var(--accent); display: grid; place-items: center; }
.composer input.c-title { flex: 1; min-width: 0; border: 0; outline: none; background: none; padding: 14px 0; font-size: 15px; }
.composer input.c-title::placeholder { color: var(--muted); }
.composer-more { display: none; padding: 0 16px 14px 46px; }
.composer.open .composer-more { display: block; }
.textbox {
  width: 100%; border: 1px solid var(--stroke); border-radius: var(--r-ctl); background: var(--fill);
  padding: 8px 12px; outline: none; resize: none; line-height: 20px; box-shadow: inset 0 -1px 0 var(--stroke-2);
}
.textbox:focus { background: var(--solid); box-shadow: inset 0 -2px 0 var(--accent); }
.textbox::placeholder { color: var(--faint); }
.c-desc { min-height: 64px; max-height: 240px; }
.composer-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: var(--r-ctl);
  border: 1px solid var(--stroke); background: var(--card); color: var(--text); font-size: 13px; position: relative;
}
.chip:hover { background: var(--card-hover); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.chip input[type="date"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.spacer { flex: 1; }
.hint { font-size: 12px; color: var(--faint); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 32px; padding: 5px 14px;
  border-radius: var(--r-ctl); border: 1px solid var(--stroke); background: var(--card); color: var(--text);
  box-shadow: inset 0 -1px 0 var(--stroke-2); white-space: nowrap;
}
.btn:hover { background: var(--card-hover); }
.btn:active { background: var(--fill-2); box-shadow: none; }
.btn.accent { background: var(--accent); color: var(--on-accent); border-color: transparent; font-weight: 600; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .18); }
.btn.accent:hover { filter: brightness(1.07); }
.btn.danger-solid { background: var(--danger); color: var(--solid); border-color: transparent; font-weight: 600; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .45; cursor: default; filter: none; }
.btn.block { width: 100%; }

/* ---------- Tarefas ---------- */
.tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.task {
  position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 12px 10px 12px 16px;
  background: var(--card); border: 1px solid var(--stroke); border-radius: 6px; cursor: pointer;
}
.task:hover, .task.selected { background: var(--card-hover); }
.task.selected::before, .task.focusing::before {
  content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px; border-radius: 2px; background: var(--accent);
}
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 15px; line-height: 22px; overflow-wrap: anywhere; }
.task-desc {
  margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 18px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  white-space: pre-line; overflow-wrap: anywhere;
}
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12px; line-height: 16px; color: var(--muted); }
.task-meta span { display: inline-flex; align-items: center; gap: 4px; }
.task-meta .late { color: var(--danger); }
.task-meta .today, .task-meta .live { color: var(--accent); font-weight: 600; }
.task-meta .live { font-variant-numeric: tabular-nums; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task.done .task-desc { opacity: .75; }
.task-actions { display: flex; align-items: center; gap: 4px; align-self: center; margin: -4px 0; }

/* Botão Começar (inicia o foco da tarefa): o principal de cada linha */
.start-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px 0 11px; border-radius: var(--r-ctl);
  border: 1px solid transparent; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 13px;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .18); white-space: nowrap; flex: none;
}
.start-btn:hover { filter: brightness(1.08); }
.start-btn:active { filter: brightness(.95); box-shadow: none; }
.start-btn.running .t { font-variant-numeric: tabular-nums; }
.start-btn.paused { background: var(--card-hover); color: var(--accent); border-color: var(--accent); box-shadow: none; }
.start-btn .t { font-variant-numeric: tabular-nums; }
.btn.start-big { width: 100%; min-height: 44px; font-size: 15px; gap: 10px; }
.focus-hint { color: var(--muted); font-size: 12px; text-align: center; }

.check {
  position: relative; touch-action: manipulation;
  width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; flex: none; padding: 0;
  border: 1.5px solid var(--faint); background: transparent; display: grid; place-items: center; color: transparent;
}
.check::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; } /* área de toque maior que o desenho */
@media (pointer: coarse) {
  .task > .check { width: 24px; height: 24px; margin-top: -1px; }
  .task > .check::after { inset: -14px -16px -14px -14px; border-radius: 12px; }
}
@media (hover: hover) { .check:hover { border-color: var(--accent); color: var(--accent); } }
.check[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.mini-btn { width: 30px; height: 30px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; border-radius: var(--r-ctl); padding: 0; }
.mini-btn:hover { background: var(--fill); color: var(--text); }
.mini-btn.star[aria-pressed="true"] { color: var(--star); }
.mini-btn.star[aria-pressed="true"] svg { fill: currentColor; }

.done-toggle {
  display: inline-flex; align-items: center; gap: 8px; margin: 20px 0 8px; height: 32px; padding: 0 12px 0 8px;
  border: 0; border-radius: var(--r-ctl); background: var(--fill); color: var(--text); font-weight: 600;
}
.done-toggle { background: var(--acrylic); }
.done-toggle:hover { background: var(--card-hover); }
.done-toggle svg { transition: transform .15s; }
.done-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.empty { padding: 28px 4px; color: var(--muted); max-width: 46ch; }
.empty strong { display: block; color: var(--text); font-size: 20px; line-height: 28px; font-family: var(--font-display); font-weight: 600; margin-bottom: 4px; }

/* Arrastar para reordenar ou mover para uma lista */
.task[draggable="true"] { cursor: grab; }
/* Alça de arrastar: só com mouse, e sem empurrar o círculo (no celular o primeiro toque vira "hover") */
.task { -webkit-tap-highlight-color: transparent; }
.task.dragging { opacity: .45; cursor: grabbing; }
.task.drop-before { box-shadow: 0 -3px 0 0 var(--accent); }
.task.drop-after { box-shadow: 0 3px 0 0 var(--accent); }
.nav-item.drop-target { background: var(--fill-2); outline: 2px solid var(--accent); outline-offset: -2px; }
.grip { color: var(--faint); display: none; position: absolute; left: 0; top: 50%; transform: translateY(-50%); pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .task:hover .grip { display: grid; } }

/* Lixeira e retrospectiva */
.trash-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--stroke); border-radius: var(--r-ctl); background: var(--card); }
.trash-row .t { flex: 1; min-width: 0; }
.trash-row .t strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-row .t small { color: var(--muted); font-size: 12px; }
.retro-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { padding: 10px 12px; border: 1px solid var(--stroke); border-radius: var(--r-ctl); background: var(--card); }
.stat b { display: block; font-family: var(--font-display); font-size: 20px; line-height: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.retro-chart { width: 100%; height: auto; display: block; margin: 6px 0 4px; }
.retro-chart text { font-family: var(--font); fill: var(--muted); font-size: 11px; }
.retro-chart .bar { fill: var(--accent); }
.retro-chart .bar.today { fill: var(--accent); opacity: .55; }
.retro-chart .goal { stroke: var(--stroke-2); stroke-dasharray: 3 3; }
.retro-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.retro-list li { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.retro-list li span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.retro-note { margin-top: 12px; padding: 10px 12px; border-radius: var(--r-ctl); background: var(--fill); font-size: 13px; line-height: 18px; }
.goal-link { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 12px; padding: 0; margin-top: 8px; }

/* Datas em linguagem natural: dica no composer */
.nl-hint { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--muted); }
.nl-hint .pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-weight: 600; }
.nl-hint .link-btn { font-size: 12px; }

/* Repetição e lembrete */
.wd-row { display: flex; gap: 4px; }
.wd { width: 30px; height: 28px; border-radius: var(--r-ctl); border: 1px solid var(--stroke); background: var(--card); font-size: 12px; padding: 0; }
.wd[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.row .mini-select { border: 0; background: none; outline: none; color: var(--muted); text-align: right; }
.row input[type="time"], .row input[type="datetime-local"] { border: 0; background: none; outline: none; color: var(--muted); }
.row.stack-row { flex-direction: column; align-items: stretch; gap: 8px; }
.row .row-line { display: flex; align-items: center; gap: 14px; }
.row .row-line .r-label { flex: 1; }
.step .step-due { font-size: 11px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.step .step-due.late { color: var(--danger); }
.step .step-due input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.step .step-due { position: relative; }
.task-meta .repeat svg, .task-meta .bell svg { opacity: .8; }

/* ---------- Painel de detalhes ---------- */
.detail { grid-row: 2; grid-column: 3; border-top: 1px solid var(--stroke); border-left: 1px solid var(--stroke); min-height: 0; display: flex; flex-direction: column; }
.detail-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 0 20px; color: var(--muted); font-size: 12px; }
.detail-scroll { flex: 1; overflow-y: auto; padding: 4px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.d-card { background: var(--card); border: 1px solid var(--stroke); border-radius: var(--r-card); padding: 14px 16px; }
.d-title-row { display: flex; gap: 12px; align-items: flex-start; }
.d-title-row .check { margin-top: 5px; }
.d-title { flex: 1; border: 0; outline: none; background: none; resize: none; overflow: hidden; font-family: var(--font-display); font-size: 20px; line-height: 28px; font-weight: 600; padding: 0; }
.section-label { font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 6px 2px; }
.d-desc { min-height: 120px; }
.steps { list-style: none; margin: 10px 0 0; padding: 0; }
.step { display: flex; align-items: center; gap: 10px; min-height: 34px; border-top: 1px solid var(--stroke); }
.step .check { width: 16px; height: 16px; border-width: 1.5px; margin: 0; }
.step input { flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 6px 0; }
.step.done input { text-decoration: line-through; color: var(--muted); }
.step .x { opacity: 0; width: 28px; height: 28px; }
.step:hover .x, .step:focus-within .x { opacity: 1; }
.add-step { display: flex; align-items: center; gap: 10px; min-height: 34px; color: var(--accent); border-top: 1px solid var(--stroke); }
.add-step input { flex: 1; border: 0; background: none; outline: none; padding: 6px 0; }
.add-step input::placeholder { color: var(--accent); }
.rows { display: flex; flex-direction: column; gap: 2px; }
.row {
  display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 6px 14px; width: 100%;
  border: 1px solid var(--stroke); background: var(--card); text-align: left; position: relative; border-radius: var(--r-ctl); color: var(--text);
}
.rows .row:first-child { border-radius: var(--r-card) var(--r-card) var(--r-ctl) var(--r-ctl); }
.rows .row:last-child { border-radius: var(--r-ctl) var(--r-ctl) var(--r-card) var(--r-card); }
button.row:hover, label.row:hover { background: var(--card-hover); }
.row .r-label { flex: 1; }
.row.on { color: var(--accent); }
.row select, .row input[type="date"] { border: 0; background: none; outline: none; text-align: right; color: var(--muted); max-width: 60%; }
.row select option { color: #16251B; background: #fff; }
.detail-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 20px; border-top: 1px solid var(--stroke); color: var(--muted); font-size: 12px; }
.saved { margin-left: 8px; color: var(--faint); }

/* Cartão de foco no detalhe */
.focus-card { display: flex; flex-direction: column; gap: 12px; }
.focus-card-top { display: flex; align-items: center; gap: 12px; }
.focus-card-ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--fill-2); color: var(--accent); flex: none; }
.focus-card-text { flex: 1; min-width: 0; }
.focus-card-text strong { display: block; font-weight: 600; }
.focus-card-text span { color: var(--muted); font-size: 12px; }
.focus-card-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.focus-card-btns .btn { flex: 1; }

/* ---------- Relógio de foco (widget) ---------- */
.focus-widget {
  position: fixed; right: 20px; bottom: 20px; z-index: 25; width: 340px; max-width: calc(100vw - 32px);
  background: var(--solid); border: 1px solid var(--stroke); border-radius: var(--r-card); box-shadow: var(--shadow-flyout);
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.shell.has-detail .focus-widget { right: 420px; }
.fw-top { display: flex; align-items: center; gap: 14px; }
.ring { position: relative; width: 64px; height: 64px; flex: none; color: var(--accent); }
.ring svg.ring-svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring .track { stroke: var(--fill-2); }
.ring .bar { stroke: currentColor; transition: stroke-dashoffset .9s linear; }
.ring .ring-ico { position: absolute; inset: 0; display: grid; place-items: center; }
.fw-info { flex: 1; min-width: 0; }
.fw-phase { font-size: 12px; color: var(--muted); }
.fw-time { font-family: var(--font-display); font-size: 34px; line-height: 40px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fw-task { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fw-collapse { align-self: flex-start; margin: -8px -8px 0 0; }
.fw-tip { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-ctl); background: var(--fill); font-size: 13px; line-height: 18px; }
.fw-tip svg { color: var(--accent); margin-top: 1px; }
.fw-btns { display: flex; gap: 8px; }
.fw-btns .btn { flex: 1; padding: 5px 8px; }
.fw-goal { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.fw-goal .progress { margin: 0; }
.focus-widget.collapsed { width: auto; padding: 6px 6px 6px 14px; gap: 0; }
.focus-widget.collapsed .fw-tip, .focus-widget.collapsed .fw-btns, .focus-widget.collapsed .fw-goal,
.focus-widget.collapsed .ring, .focus-widget.collapsed .fw-task, .focus-widget.collapsed .fw-phase { display: none; }
.focus-widget.collapsed .fw-time { font-size: 18px; line-height: 24px; }
.focus-widget.collapsed .fw-collapse { margin: 0; align-self: center; }
.focus-widget.break { --accent: var(--ultra); }
.focus-widget.attention { animation: nudge .45s ease 3; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- Acesso (estilo tela de bloqueio) ---------- */
.auth {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px; padding: 40px 16px;
  background: transparent;
}
.lock-clock { text-align: center; }
.lock-time { font-family: var(--font-display); font-size: 88px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.lock-date { font-size: 18px; line-height: 24px; margin-top: 12px; color: var(--muted); }
.auth-card {
  width: 100%; max-width: 380px; padding: 28px; border-radius: var(--r-card); background: var(--mica); border: 1px solid var(--stroke);
  box-shadow: var(--shadow-flyout); -webkit-backdrop-filter: blur(40px) saturate(1.4); backdrop-filter: blur(40px) saturate(1.4);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.auth-brand .app-icon { width: 40px; height: 40px; border-radius: 10px; }
.auth-brand h1 { margin: 0; font-family: var(--font-display); font-size: 20px; line-height: 28px; font-weight: 600; }
.auth-card p { color: var(--muted); margin: 0 0 18px; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; margin-bottom: 4px; }
.input {
  width: 100%; height: 34px; padding: 0 10px; border-radius: var(--r-ctl); border: 1px solid var(--stroke);
  background: var(--card); outline: none; box-shadow: inset 0 -1px 0 var(--stroke-2);
}
.input:focus { background: var(--solid); box-shadow: inset 0 -2px 0 var(--accent); }
.form-error { color: var(--danger); font-size: 13px; min-height: 20px; margin: 2px 0 8px; }

/* ---------- Diálogos ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .32); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { width: 100%; max-width: 540px; background: var(--solid); border-radius: var(--r-card); border: 1px solid var(--stroke); box-shadow: var(--shadow-flyout); max-height: 90dvh; display: flex; flex-direction: column; overflow: hidden; }
.modal-body { padding: 24px; overflow-y: auto; }
.modal h2 { margin: 0 0 12px; font-family: var(--font-display); font-size: 20px; line-height: 28px; font-weight: 600; }
.modal p { margin: 0; color: var(--muted); }
.modal h3 { font-size: 14px; font-weight: 600; margin: 20px 0 8px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 20px 24px; background: var(--fill); border-top: 1px solid var(--stroke); }
.modal-foot .btn { flex: 1; max-width: 200px; }
.modal-hero { display: flex; gap: 14px; align-items: flex-start; }
.modal-hero .focus-card-ico { width: 44px; height: 44px; }
.seg { display: flex; background: var(--fill); border: 1px solid var(--stroke); border-radius: var(--r-ctl); padding: 2px; gap: 2px; }
.seg button { flex: 1; border: 0; background: none; height: 28px; border-radius: 3px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--card-hover); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.stack { display: flex; flex-direction: column; gap: 2px; }
.set-row {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; background: var(--card);
  border: 1px solid var(--stroke); border-radius: var(--r-ctl);
}
.set-row .r-text { flex: 1; min-width: 0; }
.set-row .r-text small { display: block; color: var(--muted); font-size: 12px; line-height: 16px; }
.set-row .num { width: 72px; text-align: right; }
.set-row .unit { color: var(--muted); font-size: 12px; min-width: 22px; }
.toggle { position: relative; width: 40px; height: 20px; border-radius: 10px; border: 1px solid var(--stroke-2); background: var(--fill); padding: 0; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); transition: left .15s; }
.toggle[aria-checked="true"] { background: var(--accent); border-color: transparent; }
.toggle[aria-checked="true"]::after { left: 23px; background: var(--on-accent); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch.small { width: 56px; }
.swatch.small i { width: 28px; height: 28px; border-radius: 50%; }
.swatch i.auto { background: conic-gradient(var(--teal), var(--ultra), var(--magenta), var(--amber), var(--teal)); }
.swatch i.lista { background: linear-gradient(135deg, var(--teal) 50%, var(--ultra) 50%); }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; padding: 6px; border-radius: var(--r-ctl); font-size: 12px; color: var(--muted); width: 64px; }
.swatch:hover { background: var(--fill); }
.swatch i { width: 36px; height: 36px; border-radius: 0 18px 0 18px; background: var(--c); outline: 2px solid transparent; outline-offset: 2px; }
.swatch[aria-pressed="true"] i { outline-color: var(--text); }
.menu { position: absolute; z-index: 40; background: var(--solid); border-radius: var(--r-card); padding: 4px; box-shadow: var(--shadow-flyout); min-width: 200px; border: 1px solid var(--stroke); }
.menu button { display: flex; width: 100%; align-items: center; gap: 12px; height: 36px; padding: 0 12px; border: 0; background: none; border-radius: var(--r-ctl); text-align: left; }
.menu button:hover { background: var(--fill); }
.menu .danger { color: var(--danger); }

/* ---------- Aviso (toast) ---------- */
#toast {
  position: fixed; left: 50%; top: 56px; transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  background: var(--solid); color: var(--text); border: 1px solid var(--stroke); box-shadow: var(--shadow-flyout);
  padding: 10px 16px; border-radius: var(--r-card); transition: opacity .18s, transform .18s; z-index: 60;
  display: flex; gap: 16px; align-items: center; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { border: 0; background: none; color: var(--accent); font-weight: 600; padding: 0; }

/* Windows com "Efeitos de transparência" desligado: só vale enquanto o usuário não escolheu Acrílico ou Vidro */
@media (prefers-reduced-transparency: reduce) {
  :root:not([data-glass]) .titlebar, :root:not([data-glass]) .side, :root:not([data-glass]) .detail,
  :root:not([data-glass]) .auth-card, :root:not([data-glass]) .task, :root:not([data-glass]) .composer {
    background: var(--solid); -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}

/* ---------- Responsivo ---------- */
@media (max-width: 1180px) {
  .shell.has-detail { grid-template-columns: 288px minmax(0, 1fr); }
  .shell.has-detail .detail {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100%); z-index: 30; background: var(--solid); box-shadow: var(--shadow-flyout);
  }
  .shell.has-detail .focus-widget { right: 20px; }
}
@media (max-width: 560px) { .retro-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 820px) {
  .shell, .shell.has-detail { grid-template-columns: minmax(0, 1fr); }
  .app-title { width: auto; }
  .app-title .app-name { display: none; }
  .tb-btn { display: grid; }
  .titlebar { padding: 0 8px; gap: 8px; }
  .search { max-width: none; margin: 0; }
  .side {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 35; background: var(--solid); padding-top: 12px;
    transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-flyout);
  }
  .shell.nav-open .side { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .32); z-index: 32; }
  .main { grid-column: 1; border-radius: 0; border-left: 0; }
  .main-inner { padding: 20px 16px 220px; }
  .title-big { font-size: 32px; line-height: 40px; }
  .composer-more { padding-left: 16px; }
  .focus-widget, .shell.has-detail .focus-widget { left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; }
  .focus-widget.collapsed { left: auto; }
  .lock-time { font-size: 64px; }
  .start-btn:not(.running):not(.paused) .lbl { display: none; }
  .start-btn:not(.running):not(.paused) { padding: 0 9px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .dynamic body::before { animation: none; }
}

/* ---------- Escolha de estilo (Configurações) ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 10px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 0; border: 0; background: none; text-align: left; color: var(--text); font-size: 12px; border-radius: var(--r-card); }
.tile .pic {
  aspect-ratio: 16 / 10; width: 100%; border-radius: 6px; background: var(--fill-2) center / cover no-repeat;
  outline: 2px solid transparent; outline-offset: 2px; position: relative; display: grid; place-items: center; color: var(--muted);
}
.tile:hover .pic { outline-color: var(--stroke-2); }
.tile[aria-pressed="true"] .pic { outline-color: var(--accent); }
.tile[aria-pressed="true"] { font-weight: 600; }
.tile .pic.upload { border: 1.5px dashed var(--stroke-2); background-color: var(--fill); }
.tile .badge { position: absolute; left: 6px; top: 6px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 3px; }
.style-note { margin-top: 10px; font-size: 12px; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; font-size: 12px; }
.photo-credit { margin: 0 4px 8px; font-size: 11px; line-height: 14px; color: var(--muted); }

/* ---------- Estilo "Paisagens reais": a foto aparece de verdade ---------- */
.style-foto body { background-position: center; --veil: var(--veil-foto); }
.style-foto .main {
  background: linear-gradient(180deg, rgba(0, 0, 0, .40) 0, rgba(0, 0, 0, .14) 230px, rgba(0, 0, 0, 0) 440px);
  border-color: transparent;
}
.style-foto .title-big { color: #FFFFFF; text-shadow: 0 2px 18px rgba(0, 0, 0, .35); }
.style-foto .title-big[contenteditable="true"] { box-shadow: inset 0 -2px 0 #FFFFFF; }
.style-foto .subhead { color: rgba(255, 255, 255, .92); text-shadow: 0 1px 8px rgba(0, 0, 0, .45); }
.style-foto .head .icon-btn { color: #FFFFFF; }
.style-foto .head .icon-btn:hover { background: rgba(255, 255, 255, .16); }
.style-foto .empty { color: rgba(255, 255, 255, .92); text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
.style-foto .empty strong { color: #FFFFFF; }
.style-foto .lock-clock { color: #FFFFFF; text-shadow: 0 2px 24px rgba(0, 0, 0, .35); }
.style-foto .lock-date { color: rgba(255, 255, 255, .92); }
.style-foto .auth-card { background: var(--acrylic); }
@media (max-width: 820px) {
  .style-foto .side { background: var(--solid); }
}

/* =====================================================================
   Atmosfera: luz do céu, nuvens, pôr do sol dourado e chuva no vidro
   (camadas entre a paisagem e a interface)
   ===================================================================== */
#atmos { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
#atmos > * { position: absolute; inset: 0; }
.sky-tint { opacity: 0; transition: opacity 3s ease, background 3s ease; mix-blend-mode: soft-light; }
.dynamic .sky-tint { opacity: 1; }
[data-sky="aurora"] .sky-tint { background: linear-gradient(180deg, rgba(255, 150, 170, .55), rgba(255, 196, 140, .35) 45%, rgba(255, 220, 180, 0) 80%); }
[data-sky="manha"] .sky-tint { background: linear-gradient(180deg, rgba(255, 230, 190, .35), rgba(255, 255, 255, 0) 70%); }
[data-sky="dia"] .sky-tint { background: linear-gradient(180deg, rgba(190, 225, 255, .25), rgba(255, 255, 255, 0) 60%); }
[data-sky="dourada"] .sky-tint { background: linear-gradient(180deg, rgba(255, 170, 70, .55), rgba(255, 130, 60, .35) 55%, rgba(120, 50, 20, .25)); }
[data-sky="crepusculo"] .sky-tint { background: linear-gradient(180deg, rgba(120, 90, 200, .55), rgba(230, 120, 140, .35) 55%, rgba(30, 20, 60, .35)); }
[data-sky="noite"] .sky-tint { background: linear-gradient(180deg, rgba(20, 30, 80, .55), rgba(10, 15, 40, .45)); mix-blend-mode: multiply; }

/* Nuvens suaves que atravessam o céu devagar (densidade vem do clima) */
.clouds { opacity: 0; transition: opacity 4s ease; }
.dynamic .clouds { opacity: var(--cloud-opacity, .35); }
.clouds::before, .clouds::after {
  content: ""; position: absolute; top: 0; left: 0; width: 200%; height: 55%;
  background-repeat: repeat-x; background-size: 50% 100%;
  background-image:
    radial-gradient(ellipse 12% 9% at 12% 30%, rgba(255, 255, 255, .85), transparent 70%),
    radial-gradient(ellipse 18% 11% at 20% 34%, rgba(255, 255, 255, .7), transparent 70%),
    radial-gradient(ellipse 10% 7% at 46% 18%, rgba(255, 255, 255, .75), transparent 70%),
    radial-gradient(ellipse 16% 9% at 55% 22%, rgba(255, 255, 255, .6), transparent 70%),
    radial-gradient(ellipse 14% 8% at 80% 38%, rgba(255, 255, 255, .7), transparent 70%),
    radial-gradient(ellipse 20% 10% at 88% 42%, rgba(255, 255, 255, .55), transparent 70%);
  filter: blur(6px); animation: clouds 240s linear infinite;
}
.clouds::after { top: 8%; opacity: .6; animation-duration: 380s; transform: scaleY(.8); background-size: 70% 100%; }
[data-sky="noite"] .clouds { filter: brightness(.35); }
[data-sky="dourada"] .clouds, [data-sky="aurora"] .clouds { filter: sepia(.6) saturate(2) hue-rotate(-20deg); }
@keyframes clouds { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Pôr do sol dourado ao cumprir a meta do dia */
.golden-glow { opacity: 0; transition: opacity 4s ease; mix-blend-mode: soft-light;
  background: radial-gradient(ellipse 80% 60% at 70% 75%, rgba(255, 190, 90, .85), transparent 70%),
              linear-gradient(180deg, rgba(255, 160, 60, .5), rgba(255, 110, 50, .35) 60%, rgba(110, 40, 10, .35)); }
.golden .golden-glow { opacity: 1; }
#rain { opacity: 0; transition: opacity 3s ease; }
.raining #rain { opacity: 1; }
.raining body::before { filter: saturate(.8) brightness(.92); }

/* =====================================================================
   Recompensa ao concluir: brilho e folhas caindo
   ===================================================================== */
.task.celebrate { animation: glow 1.1s ease-out; }
@keyframes glow {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); }
  40% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 35%, transparent), 0 0 28px 6px color-mix(in srgb, var(--accent) 35%, transparent); }
  100% { box-shadow: 0 0 0 14px transparent; }
}
.leaves { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.leaf-fx { position: absolute; width: 16px; height: 16px; color: var(--c); opacity: 0;
  animation: leaf-fall var(--dur, 1.8s) cubic-bezier(.25, .6, .4, 1) var(--delay, 0s) forwards; }
@keyframes leaf-fall {
  0% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(.6); }
  12% { opacity: 1; transform: translate(calc(var(--dx) * .15), -18px) rotate(calc(var(--rot) * .2)) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(.9); }
}
.sparkle-fx { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #FFF6C8; box-shadow: 0 0 10px 3px rgba(255, 230, 140, .9);
  animation: sparkle .9s ease-out forwards; }
@keyframes sparkle { 0% { opacity: 0; transform: scale(.2); } 30% { opacity: 1; transform: scale(1.2); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); } }

/* =====================================================================
   Modo foco profundo: o resto fica desfocado durante o foco
   ===================================================================== */
.deep .task:not(.focusing):not(:hover):not(.selected) { filter: blur(2.5px) saturate(.6); opacity: .45; }
.deep .task { transition: filter .6s ease, opacity .6s ease; }
.deep .composer:not(:focus-within), .deep .nav, .deep .head .subhead { opacity: .5; transition: opacity .6s ease; }
.deep .nav:hover { opacity: 1; }
.held-note { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }

/* =====================================================================
   Modo Zen: tela cheia, só a paisagem, a tarefa e o relógio
   ===================================================================== */
.zen { position: fixed; inset: 0; z-index: 80; color: #FFFFFF; display: grid; place-items: center; overflow: hidden;
  opacity: 0; visibility: hidden; transition: opacity 1.1s ease, visibility 0s linear 1.1s; cursor: default; }
.zen-on .zen { opacity: 1; visibility: visible; transition: opacity 1.1s ease .15s, visibility 0s; }
.zen-on .shell, .zen-on .focus-widget, .zen-on #toast { opacity: 0; pointer-events: none; }
.shell { transition: opacity .8s ease; }
.zen-bg { position: absolute; inset: -3%; background-color: #10180F; background-image: var(--wall); background-size: cover; background-position: center;
  transform-origin: 50% 55%; will-change: transform; }
.zen-bg.zooming { animation: zen-zoom var(--zen-dur, 1500s) linear forwards; animation-delay: var(--zen-delay, 0s); }
.zen-bg.paused { animation-play-state: paused; }
@keyframes zen-zoom { from { transform: scale(1); } to { transform: scale(1.14); } }
.zen-veil { position: absolute; inset: 0; background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(0, 0, 0, .28), rgba(0, 0, 0, .05) 70%),
  linear-gradient(180deg, rgba(0, 0, 0, .25), rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, .35)); }
.zen .zen-rain { position: absolute; inset: 0; pointer-events: none; }
.zen-center { position: relative; text-align: center; padding: 24px; max-width: min(900px, 92vw); display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .35); }
.zen-phase { font-size: 15px; letter-spacing: .04em; opacity: .9; }
.zen-clock { font-family: var(--font-display); font-weight: 200; font-size: clamp(96px, 19vw, 240px); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.zen-task { font-family: var(--font-display); font-weight: 400; font-size: clamp(20px, 2.4vw, 30px); line-height: 1.25; max-width: 30ch; opacity: .96; text-wrap: balance; }
.zen-tip { margin-top: 18px; font-size: 16px; line-height: 1.5; max-width: 46ch; padding: 12px 18px; border-radius: 14px; background: rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); text-shadow: none; }
.zen-held { margin-top: 10px; font-size: 13px; opacity: .8; }
.zen-bar { position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%); display: flex; gap: 8px; padding: 8px; border-radius: 16px;
  background: rgba(20, 24, 20, .32); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .18); transition: opacity .6s ease, transform .6s ease; }
.zen-idle .zen-bar, .zen-idle .zen-top { opacity: 0; transform: translateX(-50%) translateY(12px); }
.zen-idle .zen-top { transform: none; }
.zen-idle { cursor: none; }
.zen-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 10px; border: 0; background: transparent; color: #FFFFFF; font-size: 14px; }
.zen-btn:hover { background: rgba(255, 255, 255, .16); }
.zen-btn.primary { background: rgba(255, 255, 255, .92); color: #14201A; font-weight: 600; }
.zen-btn.primary:hover { background: #FFFFFF; }
.zen-top { position: absolute; top: 22px; left: 26px; right: 26px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; opacity: .85; transition: opacity .6s ease; }
.zen-progress { position: absolute; left: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .85); width: 0; transition: width 1s linear; }
.zen-goal { display: inline-flex; align-items: center; gap: 8px; }

/* =====================================================================
   Jardim do foco (painel lateral)
   ===================================================================== */
.garden { margin: 0 2px 8px; border-radius: var(--r-card); background: var(--card); border: 1px solid var(--stroke); padding: 10px 12px 8px; cursor: pointer; }
.garden:hover { background: var(--card-hover); }
.garden-top { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 8px; font-size: 12px; color: var(--muted); }
.garden-top strong { color: var(--text); font-weight: 600; font-size: 13px; white-space: nowrap; }
.garden svg { display: block; width: 100%; height: 64px; margin-top: 4px; overflow: visible; }
.garden .soil { fill: #A9805A; opacity: .55; }
.garden .grass { stroke: #6FAE6E; stroke-width: 1.1; fill: none; stroke-linecap: round; opacity: .55; }
.garden .stem { stroke: #4E8F5A; stroke-width: 1.6; fill: none; stroke-linecap: round; }
.garden .leafp { fill: #5FA36B; }
.garden .wilt .stem { stroke: #8C7A52; }
.garden .wilt .leafp { fill: #9C8A5E; }
.garden .bud { transform-box: fill-box; transform-origin: 50% 100%; animation: grow .9s ease-out both; }
@keyframes grow { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
.garden-empty { font-size: 12px; color: var(--muted); padding: 6px 0 2px; }

/* Botões pequenos extras do relógio */
.fw-tools { display: flex; gap: 4px; margin: -6px -8px 0 0; }
.weather-chip { margin: 0 4px 6px; font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* =====================================================================
   Captura rápida (janela pequena)
   ===================================================================== */
.capture-page { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.capture-card { width: 100%; max-width: 520px; padding: 18px; border-radius: 12px; background: var(--acrylic); border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(30px) saturate(1.4); backdrop-filter: blur(30px) saturate(1.4); box-shadow: var(--shadow-flyout); }
.capture-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-weight: 600; }
.capture-head .app-icon { width: 22px; height: 22px; border-radius: 6px; }
.capture-head .spacer { flex: 1; }
.capture-card .c-input { width: 100%; height: 42px; font-size: 16px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--stroke); background: var(--card); outline: none;
  box-shadow: inset 0 -1px 0 var(--stroke-2); }
.capture-card .c-input:focus { background: var(--solid); box-shadow: inset 0 -2px 0 var(--accent); }
.capture-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.capture-row select { height: 30px; border-radius: var(--r-ctl); border: 1px solid var(--stroke); background: var(--card); padding: 0 8px; }
.capture-msg { min-height: 18px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.capture-msg.ok { color: var(--accent); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .zen-bg.zooming, .clouds::before, .clouds::after, .leaf-fx, .sparkle-fx, .garden .bud { animation: none !important; }
  .leaf-fx, .sparkle-fx { display: none; }
}

/* ---------- Contas, pessoas e instalação ---------- */
.auth-links { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 16px; text-align: center; }
.auth-hint { font-size: 12px; line-height: 16px; color: var(--muted); }
.auth-ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--muted); margin: 4px 0 14px; }
.link-btn { border: 0; background: none; padding: 2px 4px; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; border-radius: 3px; }
.link-btn:hover { text-decoration-thickness: 2px; }
.field input[readonly] { color: var(--muted); background: var(--fill); }
.avatar {
  --av: 28px; --hue: 140;
  width: var(--av); height: var(--av); flex: none; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(145deg, hsl(var(--hue) 48% 46%), hsl(calc(var(--hue) + 40) 52% 34%));
  color: #fff; font-weight: 600; font-size: calc(var(--av) * .4); letter-spacing: .02em; line-height: 1; user-select: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.avatar.invite { background: var(--fill); color: var(--muted); box-shadow: inset 0 0 0 1px var(--stroke); }
.side-btn.account-btn { flex-basis: 40px; }
.account-menu { min-width: 240px; }
.menu-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--stroke); }
.menu-head > div { min-width: 0; }
.menu-head strong, .menu-head small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-head small { color: var(--muted); font-size: 12px; }
.account-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.account-hero h2 { margin: 0; }
.note { background: color-mix(in srgb, var(--amber) 14%, transparent); border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent); color: var(--text) !important; padding: 10px 12px; border-radius: var(--r-ctl); font-size: 13px; margin-bottom: 14px !important; }
.btn.danger { color: var(--danger); }
.person { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 10px 8px 12px; background: var(--card); border: 1px solid var(--stroke); border-radius: var(--r-ctl); }
.person.off { opacity: .6; }
.person .p-text { flex: 1; min-width: 0; }
.person .p-text strong, .person .p-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .p-text small { color: var(--muted); font-size: 12px; line-height: 16px; }
.person .p-me { font-weight: 400; color: var(--muted); }
.person .btn { flex: none; }
.badge { flex: none; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.badge.muted { background: var(--fill); color: var(--muted); }
.invite-row { display: flex; gap: 6px; }
.invite-row .input:first-child { flex: 1; min-width: 0; }
.invite-row select.input { width: auto; flex: none; }
.invite-row .btn { flex: none; }
.link-card { margin-top: 10px; padding: 12px; border-radius: var(--r-ctl); background: color-mix(in srgb, var(--accent) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); display: flex; flex-direction: column; gap: 8px; animation: pop-in .25s ease; }
.link-card strong { display: flex; align-items: center; gap: 8px; }
.link-card small { color: var(--muted); font-size: 12px; line-height: 16px; }
.link-row { display: flex; gap: 6px; }
.link-row .input { flex: 1; min-width: 0; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; }
.link-row .btn { flex: none; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
.install-card {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: start; margin: 0 2px 8px; padding: 12px;
  border-radius: var(--r-card); background: var(--card); border: 1px solid var(--stroke); box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}
.install-card .app-icon { width: 28px; height: 28px; border-radius: 7px; }
.install-card .ic-text strong { display: block; font-size: 13px; }
.install-card .ic-text small { display: block; font-size: 12px; line-height: 16px; color: var(--muted); }
.install-card .ic-btns { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; }
.install-card .ic-btns .btn { flex: 1; height: 30px; }
.install-steps { margin: 16px 0 0; padding: 0; list-style: none; counter-reset: st; display: flex; flex-direction: column; gap: 10px; }
.install-steps li { counter-increment: st; display: grid; grid-template-columns: 28px 1fr; gap: 2px 12px; }
.install-steps li::before { content: counter(st); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 13px; }
.install-steps strong { font-size: 14px; }
.install-steps span { color: var(--muted); font-size: 13px; line-height: 18px; }
@media (max-width: 560px) {
  .invite-row { flex-wrap: wrap; }
  .invite-row .input:first-child { flex-basis: 100%; }
  .invite-row .btn { flex: 1; }
  .person small:last-child { white-space: normal; }
}

/* ---------- Zerar foco ---------- */
.warn-box {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-ctl); color: var(--text);
  background: color-mix(in srgb, var(--danger) 10%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
}
.warn-box > span:first-child { color: var(--danger); flex: none; margin-top: 1px; }
.warn-box strong { display: block; margin-bottom: 2px; }
.warn-box span { font-size: 13px; line-height: 18px; }
.reset-opt { cursor: pointer; }
.reset-opt input { accent-color: var(--danger); width: 18px; height: 18px; flex: none; margin: 0; }
.reset-opt:has(input:checked) { border-color: color-mix(in srgb, var(--danger) 55%, transparent); background: color-mix(in srgb, var(--danger) 6%, var(--card)); }
.retro-reset { margin-top: 14px; text-align: center; }
.link-btn.danger { color: var(--danger); font-weight: 400; font-size: 13px; }
