/* Agenda Pessoal · app.css (Agente H) — SPEC §4.5
   Página de Doc, não painel: sem caixas na lista, linha de 1 px só entre grupos,
   sombra só no que flutua, um destaque só. Depende de tokens.css.               */

/* =========================================================
   0. Base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
  color: var(--text);
  /* puxar para baixo no topo não recarrega o app (perderia o que está sendo digitado) */
  overscroll-behavior-y: contain;
  /* foco por teclado nunca fica escondido atrás da captura/nav (embaixo) nem da barra de visões (em cima) */
  scroll-padding-top: 56px;
  scroll-padding-bottom: calc(var(--nav-h) + var(--capture-h) + var(--safe-b) + 8px);
}
/* computador: sem "elástico" na página (diretriz: só com ponteiro fino) */
@media (pointer: fine) {
  html { overscroll-behavior: none; }
}
body {
  margin: 0;
  overscroll-behavior-y: contain;
  overflow-wrap: break-word;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-2);
  line-height: var(--lh-ui);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
/* sem atraso/zoom de duplo toque nos controles; destaque do toque segue o desenho (:active de cada um) */
a, button, input, select, textarea, label, summary, [role="button"], [role="switch"], [tabindex] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:disabled { cursor: default; }
a { color: inherit; }
/* K: caixas de seleção na cor do app (pauta do André, revisão) */
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }
::selection { background: var(--accent-tint-2); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
/* grupos de controles (chips, chave) mostram onde está o foco */
.chips:focus-within { outline: none; }

/* Ícones (ui.icon → <span class="ico">svg</span>) */
.ico {
  display: inline-flex;
  flex: none;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  vertical-align: -0.2em;
  line-height: 1;
}
.ico svg { width: 100%; height: 100%; }
.ico:empty { display: none; }
.small .ico, .item-meta .ico, .link .ico, .sug-src .ico, .muted .ico { width: 14px; height: 14px; vertical-align: -0.15em; }
.item-text > .ico { width: 15px; height: 15px; color: var(--text-3); margin-left: 2px; vertical-align: -0.1em; }

/* =========================================================
   1. Casca: .app, .app-main, .nav (celular), .side (computador)
   ========================================================= */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
}
.app-main {
  min-width: 0;
  padding-bottom: calc(var(--nav-h) + var(--capture-h) + var(--safe-b) + var(--s-6));
}

/* Barra inferior: texto, sem botão redondo flutuante */
.nav {
  position: fixed;
  z-index: 30;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  height: calc(var(--nav-h) + var(--safe-b));
  padding: 0 calc(var(--s-2) + var(--safe-r)) var(--safe-b) calc(var(--s-2) + var(--safe-l));
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.nav-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--tap);
  color: var(--text-2);
  font-family: var(--font-ui);
  font-size: var(--fs-1);
  letter-spacing: .01em;
  text-decoration: none;
  border-radius: var(--r-field);
  position: relative;
}
.nav-item .ico { width: 22px; height: 22px; }
.nav-item.is-active { color: var(--text); font-weight: var(--w-strong); }
.nav-item.is-active::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 24px;
  height: 2px;
  margin-left: -12px;
  border-radius: 0 0 2px 2px;
  background: var(--accent);
}
.nav-item:active { background: var(--press); }
.nav .count { position: absolute; top: 6px; margin-left: 28px; }

/* Lateral (só computador) */
.side { display: none; }

/* Sincronização: discreta, nunca chama atenção — mas tocável (abre Configurações › Conexão).
   Celular: texto de 12 px no alto, centralizado; o alvo de toque tem 48 px de altura e fica
   ATRÁS do título e dos ícones da topbar (que estão acima dele), então só pega o toque no meio. */
.sync-pill {
  position: fixed;
  z-index: 25;
  top: var(--safe-t);
  left: 50%;
  transform: translateX(-50%);
  display: block;
  max-width: calc(100vw - 2 * var(--gutter));
  min-height: var(--tap);
  padding: 4px 12px 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--font-ui);
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  color: var(--text-hint);
  letter-spacing: .01em;
  cursor: pointer;
  border-radius: 0 0 var(--r-card) var(--r-card);
}
.sync-pill:empty { display: none; }
.sync-pill:active { color: var(--text); }
.sync-pill::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 6px;
  vertical-align: 1px;
  border-radius: 50%;
  background: currentColor;
  opacity: .7;
}
/* estados (data-estado vem de app.js): forma (o ponto) + texto + cor, nunca só a cor */
.sync-pill[data-estado="salvo"]::before { background: var(--ok); opacity: .9; }
.sync-pill[data-estado="enviando"]::before { animation: ap-pulsar 1.2s ease-in-out infinite; }
.sync-pill[data-estado="offline"] { color: var(--text-2); }
.sync-pill[data-estado="offline"]::before { background: transparent; border: 1.5px solid currentColor; width: 7px; height: 7px; }
.sync-pill[data-estado="erro_servidor"],
.sync-pill[data-estado="erro"],
.sync-pill[data-estado="chave"] { color: var(--late); font-weight: var(--w-strong); }
.sync-pill[data-estado="erro_servidor"]::before,
.sync-pill[data-estado="erro"]::before,
.sync-pill[data-estado="chave"]::before { opacity: 1; border-radius: 1px; transform: rotate(45deg); }
.sync-pill[data-estado="chave"] { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
@keyframes ap-pulsar { 50% { opacity: .2; } }
/* K: no celular a pílula fica abaixo da barra de visões presa no topo (z 10), para não sobrepor "Prazo" ao rolar */
@media (max-width: 899.98px) {
  .sync-pill { z-index: 9; }
  /* tudo o que a topbar tem fica ACIMA do alvo da pílula: o toque no ícone/título vai para ele */
  .topbar > *, .topbar-actions { position: relative; z-index: 11; }
}
.topbar .sync-pill, .side .sync-pill { position: static; transform: none; max-width: none; }

/* Modo apresentação: faixa discreta flutuante */
.present-banner {
  position: fixed;
  z-index: 40;
  top: calc(var(--safe-t) + 8px);
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: 32px;
  padding: 0 6px 0 12px;
  border-radius: var(--r-round);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-float);
  color: var(--text-2);
  font-family: var(--font-ui);
  font-size: var(--fs-1);
  white-space: nowrap;
  max-width: calc(100vw - 2 * var(--gutter));
}
.present-banner::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.present-banner a, .present-banner button {
  display: inline-flex;
  align-items: center;
  height: var(--tap);
  margin: -8px 0;  /* alvo de 48 px numa faixa de 32 */
  background-clip: content-box;
  padding: 0 10px;
  border-radius: var(--r-round);
  color: var(--accent);
  font-weight: var(--w-strong);
  text-decoration: none;
}
.present-banner a:hover, .present-banner button:hover { color: var(--text); }
.app.is-present .topbar { padding-top: calc(var(--safe-t) + var(--s-6) + 28px); }

/* =========================================================
   2. Página (coluna de Doc)
   ========================================================= */
.page {
  width: 100%;
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.page-narrow { max-width: calc(var(--col) + 2 * var(--gutter)); }
.page-wide { max-width: calc(var(--col-wide) + 2 * var(--gutter)); }

.topbar {
  display: flex;
  flex-wrap: wrap;          /* fonte grande / tela estreita: os ícones descem, o título nunca é cortado */
  align-items: center;
  gap: 0 var(--s-1);
  min-height: 64px;
  padding: calc(var(--safe-t) + var(--s-4)) 0 var(--s-2);
}
.topbar-title, .page-title {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  font-family: var(--font-texto);
  font-size: var(--fs-4);
  font-weight: var(--w-strong);
  line-height: 1.25;
  letter-spacing: -0.012em;
  color: var(--text);
  overflow-wrap: anywhere;
}
.topbar-title a { text-decoration: none; }
/* telas que desenham a .topbar fora da .page (ex.: Pautas): mesma coluna */
.app-main > .topbar {
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
@media (max-width: 899.98px) {
  /* título inteiro: quebra em duas linhas ("Agenda / Pessoal") ao lado dos ícones; se nem assim
     couber (fonte 130–150 %), os ícones descem para a linha de baixo, alinhados à direita */
  .topbar { padding-top: calc(var(--safe-t) + 28px); } /* faixa da pílula de sync acima */
  .topbar { column-gap: 0; }
  .topbar-title { font-size: 20px; flex: 1 1 4.2em; min-width: 4.2em; overflow-wrap: break-word; }
  .topbar-actions { gap: 0; margin-left: auto; margin-right: -12px; max-width: calc(100% + 12px); }
  .capture-input, .capture-input::placeholder { font-size: 16px; }
  /* K: o placeholder inteiro ("… (sem nomes de alunos)") cabe em 390 px, sem cortar no meio da palavra */
  .capture-input::placeholder { font-size: 14px; letter-spacing: -0.1px; }
}
.capture-input { text-overflow: ellipsis; }
.topbar > .icon-btn:first-child { margin-left: -12px; }
.topbar-actions {
  position: relative;
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  margin-right: -6px;
}
.topbar-actions > .btn { margin-left: var(--s-1); }
.topbar-actions > .btn:last-child { margin-right: 6px; }
.page-title { margin: var(--s-5) 0 var(--s-2); }
.page-sub {
  color: var(--text-2);
  font-size: var(--fs-2);
  line-height: 1.45;
  margin: 0 0 var(--s-3);
}
.topbar + .page-sub { margin-top: -2px; }

/* Botão de ícone */
.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border-radius: var(--r-round);
  color: var(--text-2);
  flex: none;
  font-family: var(--font-ui);
  font-size: var(--fs-1);
  text-decoration: none;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:active { background: var(--press); }
.icon-btn:disabled { color: var(--text-3); opacity: .45; background: none; }
.icon-btn.is-active, .icon-btn[aria-pressed="true"] { color: var(--accent); }
.icon-btn .item-star { position: static; color: var(--star); }

/* Contagem cinza (nunca badge vermelho) */
.count {
  display: inline-block;
  min-width: 1ch;
  font-family: var(--font-ui);
  font-size: var(--fs-1);
  font-weight: var(--w-regular);
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  letter-spacing: 0;
}
.icon-btn .count { margin-left: -2px; }

/* Seletor Área | Pessoa | Prazo — texto, ativa sublinhada */
.seg {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: var(--s-5);
  margin: 0 calc(-1 * var(--gutter)) var(--s-2);
  padding: 0 var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.seg-btn {
  position: relative;
  height: 44px;
  min-width: 0;
  padding: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-2);
  color: var(--text-2);
  transition: color var(--t-fast) var(--ease);
}
.seg-btn:hover { color: var(--text); }
.seg-btn.is-active { color: var(--text); font-weight: var(--w-strong); }
.seg-btn.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
}
.seg-btn .kbd { margin-left: 6px; }

/* =========================================================
   3. Faixa "Hoje"
   ========================================================= */
.hoje {
  margin: var(--s-4) 0 var(--s-2);
  padding: var(--s-2) 0 var(--s-3);
  border-bottom: 1px solid var(--line);
}
.hoje:empty { display: none; }
.hoje-title {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: var(--w-strong);
  text-transform: uppercase; font-size: 12px; /* K: maiúsculas reais (small-caps sintético saía irregular) */
  letter-spacing: .07em;
  color: var(--accent);
  margin-bottom: var(--s-1);
}
.hoje-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 40px;
  font-family: var(--font-texto);
  font-size: var(--fs-2);
  line-height: 1.4;
  color: var(--text);
  text-decoration: none;
}
a.hoje-row:hover { color: var(--accent); }
.hoje-row .item-check { margin: -4px -8px -4px -14px; }
.hoje-row .link { font-family: inherit; text-decoration: none; color: var(--text); text-align: left; overflow-wrap: anywhere; min-width: 0; }
.hoje-row .link:hover { color: var(--accent); }
.hoje-row .item-star { position: static; width: 14px; height: 14px; }
.hoje-row .muted { font-family: var(--font-ui); font-size: var(--fs-1); }

/* =========================================================
   4. Lista agrupada (página de Doc)
   ========================================================= */
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain > li { padding: var(--s-2) 0; }
.list-plain > li.muted { color: var(--text-hint); }
.list-plain > .card + .card,
.list-plain > li + li > .card { margin-top: var(--s-3); }

.group { margin-top: var(--s-2); }
.group + .group,
.section + .group,
.group + .section { border-top: 1px solid var(--line); }
.group-head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  min-height: 44px;
  padding: var(--s-4) 0 0;
  font-family: var(--font-ui);
  text-align: left;
}
button.group-head { cursor: pointer; }
.group-title {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  gap: var(--s-2);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: var(--w-strong);
  text-transform: uppercase; font-size: 12px; /* K: maiúsculas reais (small-caps sintético saía irregular) */
  letter-spacing: .07em;
  line-height: 24px;
  color: var(--text-2);
  text-align: left;
  overflow-wrap: anywhere;
}
button.group-title { min-height: 40px; cursor: pointer; }
.group-head:hover .group-title,
button.group-title:hover { color: var(--text); }
/* chevron discreto: aberto ▾ / recolhido ▸ */
button.group-title::after,
button.group-head > .group-title:first-child::before {
  content: "";
  flex: none;
  align-self: center;
  width: 6px; height: 6px;
  margin: 0 2px 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0;
  transition: transform var(--t-med) var(--ease), opacity var(--t-fast) var(--ease);
}
.group-head:hover button.group-title::after, button.group-title:focus-visible::after,
button.group-head:hover > .group-title:first-child::before { opacity: .55; }
button.group-head > .group-title:first-child::before { order: 9; }
.group.is-collapsed button.group-title::after,
.group.is-collapsed > button.group-head > .group-title:first-child::before,
button.group-title[aria-expanded="false"]::after,
button.group-head[aria-expanded="false"] > .group-title:first-child::before { transform: rotate(-45deg); margin-bottom: 0; opacity: .55; }
.group-meta {
  font-family: var(--font-ui);
  font-size: var(--fs-1);
  font-weight: var(--w-regular);
  font-variant-caps: normal;
  letter-spacing: 0;
  color: var(--text-2);
  white-space: nowrap;
  text-transform: none;
}
.group-meta .meta-late { color: var(--late); }
/* meta solta no cabeçalho (Sugestões: "ter 27/10 · <título da nota>"): encolhe e quebra em vez de empurrar a página
   de lado a 390 px (robô h2). A contagem dentro do título (Pautas) continua sem quebrar. */
.group-head > .group-meta { flex: 0 1 auto; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.group-action {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 var(--s-2);
  margin-right: calc(-1 * var(--s-2));
  border-radius: var(--r-field);
  color: var(--accent);
  font-size: var(--fs-1);
  font-weight: var(--w-strong);
  text-decoration: none;
  white-space: nowrap;
}
.group-action:hover { background: var(--accent-tint); }
.group.is-collapsed > :not(.group-head) { display: none; }
.group.muted .item-text, .group.muted .group-title { color: var(--text-2); }
.group:last-child { padding-bottom: var(--s-2); }

.subgroup-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2);
  margin: var(--s-3) 0 0 32px;
  font-family: var(--font-ui);
  font-size: var(--fs-1);
  font-weight: var(--w-strong);
  line-height: 20px;
  color: var(--text-2);
  letter-spacing: .01em;
}
.subgroup-title > span { min-width: 0; overflow-wrap: anywhere; }
.subgroup-title > [data-acao="virar-projeto"] {
  flex: none;
  font-weight: var(--w-regular, 400);
  letter-spacing: 0;
  color: var(--text-hint); /* discreto, mas com contraste ≥ 4,5:1 (sem opacidade) */
  margin-block: -6px;
}
.subgroup-title > [data-acao="virar-projeto"]:hover,
.subgroup-title > [data-acao="virar-projeto"]:focus-visible { color: var(--text); }

/* ---------- Linha de item ---------- */
.item {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 0;
  min-height: var(--tap);
  padding: 11px 0 10px;
  transform-origin: top;
}
.item > .item-body { grid-column: 2; }
.item > .item-body { grid-row: 1; } /* K: botões no fim da linha ficam na mesma linha do texto */
.item > .item-body:first-child { grid-column: 1 / span 2; grid-row: 1; } /* K: o ícone do fim não sobe para a 1ª coluna */
/* K: linha que é link (lista de pessoas da Reunião): sem sublinhado, chevron discreto */
a.item { color: inherit; text-decoration: none; }
a.item:hover .item-text { color: var(--accent); }
a.item > .ico { color: var(--text-3); }
.item > :nth-child(n+3):not(.item-body):not(.item-star),
.item > .item-body ~ :not(.item-star) {
  grid-row: 1;
  align-self: center;
  margin: -12px -8px -12px 4px;
}
.item > .item-body ~ .link, .item > .item-body ~ .btn { margin: -12px 0 -12px var(--s-2); }
/* ação em texto no fim da linha (ex.: "Reabrir" em Concluídos): alvo de 48 px */
.item > .item-body ~ .link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 var(--s-1);
  white-space: nowrap;
}
.item > .item-body ~ .icon-btn + .icon-btn { margin-left: -6px; }

.item-check {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  width: var(--tap);
  height: var(--tap);
  margin: -11px 0 -11px -14px;   /* alvo de 48 px; o círculo (20 px) fica no lugar de sempre */
  border-radius: 50%;
  color: var(--st-pendente);
  flex: none;
}
/* círculo visível (20 px) */
.item-check::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: var(--check);
  height: var(--check);
  margin: calc(var(--check) / -2) 0 0 calc(var(--check) / -2);
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background-color: transparent;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
/* marca interna (relógio / ✓) */
.item-check::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease);
}
.item-check:hover::before { border-color: var(--text-2); }
.item-check:active::before { transform: scale(.9); }
@media (hover: hover) {
  /* prévia do ✓ ao passar o mouse sobre um pendente */
  .item-check.st-pendente:hover::after,
  .item-check.st-fazendo:hover::after {
    opacity: .5;
    width: 5px; height: 9px;
    margin: -6.5px 0 0 -2.5px;
    border: solid var(--text-2);
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
  }
}

.item-check.st-pendente { color: var(--st-pendente); }

/* Fazendo: meio cheio (metade esquerda) */
.item-check.st-fazendo { color: var(--st-fazendo); }
.item-check.st-fazendo::before {
  background-image: linear-gradient(90deg, currentColor 50%, transparent 50%);
}
.item-check.st-fazendo:hover::after { border-color: var(--accent-ink); opacity: .8; margin-left: -1px; }

/* Com terceiro: círculo com relógio */
.item-check.st-terceiro { color: var(--st-terceiro); }
.item-check.st-terceiro::after {
  opacity: 1;
  width: 4.5px;
  height: 5.5px;
  margin: -5.5px 0 0 -0.75px;
  border: solid currentColor;
  border-width: 0 0 1.5px 1.5px;
  border-bottom-left-radius: 1px;
}

/* Concluído: cheio com ✓ */
.item-check.st-concluido { color: var(--st-concluido); }
.item-check.st-concluido::before { background-color: currentColor; border-color: currentColor; }
.item-check.st-concluido::after {
  opacity: 1;
  width: 5px; height: 9.5px;
  margin: -6.5px 0 0 -2.5px;
  border: solid var(--bg);
  border-width: 0 1.75px 1.75px 0;
  transform: rotate(45deg);
}
.editor .item-check.st-concluido::after { border-color: var(--surface); }

/* ★ na margem esquerda */
.item-star {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: var(--star);
}
.item-star .ico { width: 100%; height: 100%; vertical-align: 0; }
.item > .item-star {
  position: absolute;
  top: 16px;
  left: -16px;
  width: 12px;
  height: 12px;
}

.item-body { min-width: 0; }
/* K: ★ que é botão (passo "A semana" da revisão): na coluna do círculo, alvo de 44 px; cinza desligada, dourada ligada */
.item > .icon-btn.item-star {
  position: relative; top: auto; left: auto;
  grid-column: 1; grid-row: 1;
  width: var(--tap); height: var(--tap); min-width: var(--tap);
  margin: -11px 0 -11px -14px; padding: 0;
  justify-content: center;
  color: var(--text-3);
}
.item > .icon-btn.item-star[aria-pressed="true"] { color: var(--star); }
.item > .icon-btn.item-star .ico { width: 18px; height: 18px; }
.item-text {
  display: block;
  font-family: var(--font-texto);
  font-size: var(--fs-3);
  line-height: var(--lh-text);
  color: var(--text);
  overflow-wrap: anywhere;
  cursor: text;
  border-radius: 3px;
  transition: color var(--t-med) var(--ease), opacity var(--t-med) var(--ease), text-decoration-color var(--t-med) var(--ease);
  text-decoration: line-through transparent;
  text-decoration-thickness: 1px;
}
.item-text:focus-visible { outline-offset: 3px; }
/* Toque no texto abre o editor: o alvo cresce para cima e para baixo (48 px) e cobre também a
   linha cinza de baixo (sem "zona morta"); o desenho da linha não muda. */
.item-body > .item-text[role="button"] { padding: 12px 0; margin: -12px 0; }
.item-body > .item-text[role="button"][data-meta] { padding-bottom: 31px; margin-bottom: -31px; }
.item-body > .item-text[role="button"] + .item-meta { position: relative; pointer-events: none; }
.item-body > .item-text[role="button"]:focus-visible { outline-offset: -2px; }
.item-text .link { font-family: var(--font-ui); font-size: .82em; }
.item-meta {
  margin-top: 1px;
  font-family: var(--font-ui);
  font-size: var(--fs-1);
  line-height: 18px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.meta-late { color: var(--late); }
.meta-wait { color: var(--st-terceiro); }

/* Com terceiro: a ação não é dele → texto mais claro */
.item[data-status="terceiro"]:not(.is-editing) .item-text { color: var(--text-2); }

/* Falar pessoalmente (boca) */
.item.is-private .item-text { text-decoration-style: solid; }

/* Concluir: círculo enche (150 ms) → risca e esmaece → linha recolhe (~600 ms) */
.item.is-done { animation: ap-recolher var(--t-collapse) var(--ease-in) both; overflow: hidden; pointer-events: none; }
.item.is-done .item-text {
  color: var(--text-2);
  text-decoration-color: currentColor;
  opacity: .6;
}
.item.is-done .item-meta { opacity: .5; transition: opacity var(--t-med) var(--ease); }
.item.is-done .item-star { opacity: .4; }
@keyframes ap-recolher {
  0%, 55% { max-height: 160px; opacity: 1; padding-top: 11px; padding-bottom: 10px; min-height: var(--tap); }
  100% { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; min-height: 0; }
}
/* Em listas de concluídos (renderConcluidos/Projetos), o item já nasce concluído: não recolhe */
.item[data-status="concluido"]:not(.is-done) .item-text { color: var(--text-2); }

/* Edição na própria linha */
.item.is-editing {
  margin: var(--s-2) calc(-1 * var(--s-3));
  padding: var(--s-3) var(--s-3) var(--s-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  grid-template-columns: 32px minmax(0, 1fr);
}
.item.is-editing > .item-check { margin-top: -12px; }
.item.is-editing > .editor { grid-column: 2; grid-row: 1; min-width: 0; }

/* =========================================================
   5. Editor, campos, chips, botões
   ========================================================= */
.editor {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  min-width: 0;
}
.editor.section {
  margin: var(--s-3) 0 var(--s-4);
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  gap: var(--s-3);
}
.editor-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-1) var(--s-3);
  min-width: 0;
}
.editor-row > .field-label {
  flex: 0 0 64px;
  margin: 0;
  padding-top: 0;
}
.editor-row > .chips { flex: 1 1 220px; min-width: 0; }
@media (max-width: 899.98px) {
  .editor-row > .field-label { flex-basis: 100%; }
}
@media (min-width: 900px) {
  .editor-row:has(> .field-label) { align-items: flex-start; }
  .editor-row > .field-label { padding-top: 9px; }
}
/* 1ª linha do editor: o próprio texto, sem moldura (parece a linha virando editável) */
.editor > .editor-row:first-child .textarea {
  font-family: var(--font-texto);
  font-size: var(--fs-3);
  line-height: var(--lh-text);
  padding: 0 0 6px;
  min-height: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.editor > .editor-row:first-child .textarea { resize: none; overflow: hidden; }
.editor > .editor-row:first-child .textarea:focus { border-bottom-color: var(--accent); box-shadow: none; }
.editor > .btn-row { margin-top: var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--line); }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: var(--s-3) 0;
  min-width: 0;
}
.editor .field { margin: 0; }
.field-label {
  font-family: var(--font-ui);
  font-size: var(--fs-1);
  line-height: 18px;
  color: var(--text-2);
}

.input, .textarea {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  font-family: var(--font-ui);
  font-size: 16px; /* evita zoom do iOS */
  line-height: 1.4;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-field);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-hint); opacity: 1; }
.input:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
.input:focus-visible, .textarea:focus-visible { outline: none; }
.textarea { resize: vertical; min-height: 72px; font-family: var(--font-texto); font-size: var(--fs-3); line-height: var(--lh-text); }
.editor .textarea[rows="2"] { font-family: var(--font-ui); font-size: var(--fs-2); min-height: 0; }
.input[type="date"] { min-width: min(150px, 100%); width: auto; max-width: 100%; flex: 0 1 auto; }
.input[type="date"]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
.chips .input { width: auto; flex: 1 1 140px; min-width: min(120px, 100%); min-height: 36px; padding: 6px 10px; font-size: var(--fs-2); }
.list-plain > li > .input { margin-bottom: var(--s-1); }

.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: max(0px, calc(var(--s-2) - 2 * var(--hit))) var(--s-2);
  margin-block: calc(-1 * var(--hit));
  min-width: 0;
}
/* Chip: o desenho tem 36 px; no toque, uma borda transparente de --hit em cima e embaixo leva o
   alvo a 48 px sem mudar o desenho (o fundo não pinta a borda; o contorno é uma sombra interna). */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: calc(36px + 2 * var(--hit));
  min-width: calc(36px + 2 * var(--hit));
  justify-content: center;
  padding: 8px 14px;
  border-radius: var(--r-round);
  border: 0 solid transparent;
  border-block-width: var(--hit);
  background: transparent;
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-family: var(--font-ui);
  font-size: var(--fs-2);
  line-height: 20px;
  color: var(--text);
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: background-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.chip:hover { background-color: var(--hover); box-shadow: inset 0 0 0 1px var(--text-3); }
.chip:active { background-color: var(--press); }
.chip.is-active, .chip[aria-pressed="true"] {
  background-color: var(--accent-tint);
  box-shadow: none;
  color: var(--accent);
  font-weight: var(--w-strong);
}
.chip:focus-visible { outline-offset: calc(2px - var(--hit)); }
label.chip { cursor: pointer; }
label.chip > input[type="checkbox"], label.chip > input[type="radio"] { margin: 0; }
.chip .ico { width: 16px; height: 16px; }
.chip .item-star { position: static; width: 14px; height: 14px; }
.chip .count { margin-left: 2px; }
.chip.is-active .count { color: inherit; opacity: .8; }

.btn {
  display: inline-flex;
  flex-wrap: wrap;           /* rótulo comprido (nome de pessoa, resumo) quebra linha em vez de rolar de lado */
  align-items: center;
  justify-content: center;
  gap: 0 6px;
  max-width: 100%;
  min-height: 40px;
  padding: 4px 14px;
  border-radius: var(--r-field);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-family: var(--font-ui);
  font-size: var(--fs-2);
  line-height: 1.2;
  color: var(--text);
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn[aria-expanded] { justify-content: flex-start; text-align: left; }
.btn:hover { border-color: var(--text-3); background: var(--bg); }
.btn:active { background: var(--press); }
.btn:disabled { opacity: .5; }
.btn .ico { width: 18px; height: 18px; }
.btn.is-active { background: var(--accent-tint); border-color: transparent; color: var(--accent); font-weight: var(--w-strong); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: var(--w-strong);
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); filter: brightness(1.08); }
.btn-primary:active { filter: brightness(.95); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--hover); border-color: transparent; color: var(--text); }
.btn-danger { color: var(--late); background: transparent; border-color: transparent; }
.btn-danger:hover { background: color-mix(in srgb, var(--late) 9%, transparent); border-color: transparent; }
.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-3);
}
.btn-row > .small, .btn-row > .muted { margin-right: auto; }
.btn-row > .btn-primary:last-child:not(:first-child) { margin-left: auto; }
.editor .btn-row > .btn-danger { margin-right: auto; }
/* lista de áreas/pessoas da Configuração: li > input + btn-row */
.list-plain > li > .btn-row { margin-top: 0; justify-content: flex-end; column-gap: var(--s-1); }
/* celular: a contagem ("4 abertas") fica numa linha própria e os controles cabem numa linha só */
@media (max-width: 899.98px) {
  .list-plain > li > .btn-row:has(> .switch) > .small:first-child { flex: 1 0 100%; margin-bottom: -6px; }
  .list-plain > li > .btn-row > .btn-ghost { padding-inline: 8px; }
}

.link {
  display: inline;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}
button.link { font: inherit; }
.link:hover { text-decoration-color: currentColor; }
.link-muted {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  color: var(--text-2);
  font-family: var(--font-ui);
  font-size: var(--fs-2);
  text-decoration: none;
  cursor: pointer;
}
.link-muted:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link-muted.small { font-size: var(--fs-1); min-height: 32px; }
.link-muted { overflow-wrap: anywhere; }

/* =========================================================
   6. Captura ("Escreva ou busque…")
   Celular: fixa embaixo, acima da .nav, sobe com o teclado
   (viewport com interactive-widget=resizes-content: o fixo
   acompanha a viewport que encolhe). Computador: topo da coluna.
   ========================================================= */
.capture {
  position: fixed;
  z-index: 31;
  left: 0; right: 0;
  bottom: calc(var(--nav-h) + var(--safe-b));
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: var(--capture-h);
  padding: 6px max(var(--s-2), calc((100vw - var(--col)) / 2)) 6px;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.capture-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0 var(--s-3);
  font-family: var(--font-texto);
  font-size: var(--fs-3);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-round);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.capture-input::placeholder { color: var(--text-hint); opacity: 1; font-family: var(--font-texto); }
.capture-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.capture-star { flex: none; color: var(--text-3); }
.capture-star.is-active, .capture-star[aria-pressed="true"] { color: var(--star); }
.capture > .icon-btn:not(.capture-star) { color: var(--accent); }
.capture-hint {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-ui);
  font-size: var(--fs-1);
  color: var(--text-hint);
  padding: 0 var(--s-2);
}
.capture-hint:empty { display: none; }
/* Teclado do celular: --ap-teclado (px cobertos pelo teclado, via visualViewport) vem de capture.js.
   A captura fica no MAIOR entre "encostada no teclado" e "acima da barra de navegação": com o teclado
   aberto ela sobe junto (a nav fica atrás do teclado); com o teclado recolhido e o campo ainda focado,
   volta para cima da nav, que continua visível (nunca cai sobre a barra de gestos). */
@media (max-width: 899.98px) {
  .capture { bottom: max(var(--ap-teclado, 0px), calc(var(--nav-h) + var(--safe-b))); }
  :root .toast-stack, :root body > .toast, :root .app > .toast {
    bottom: calc(max(var(--ap-teclado, 0px), calc(var(--nav-h) + var(--safe-b))) + var(--capture-h) + 12px);
  }
}
/* captura dentro de um passo da revisão: no fluxo */
.review-step .capture, .section .capture, .editor .capture {
  position: relative;
  left: auto; right: auto; bottom: auto;
  padding: 0;
  border: 0;
  margin: var(--s-3) 0;
  background: transparent;
}

/* Autocompletar (@pessoa, #área) — flutua */
.ac {
  position: absolute;
  z-index: 50;
  left: max(var(--s-2), calc((100vw - var(--col)) / 2));
  right: max(var(--s-2), calc((100vw - var(--col)) / 2));
  bottom: calc(100% + 4px);
  max-height: 40vh;
  overflow-y: auto;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-field);
  box-shadow: var(--shadow-float);
  overscroll-behavior: contain;
}
.ac-item {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  overflow-wrap: anywhere;
  padding: 0 var(--s-3);
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: var(--fs-2);
  color: var(--text);
  cursor: pointer;
}
.ac-item:hover { background: var(--hover); }
.ac-item.is-active, .ac-item[aria-selected="true"] { background: var(--accent-tint); color: var(--accent); }
.ac-item .small { color: var(--text-2); }

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-family: var(--font-ui);
  font-size: 11px;
  line-height: 1;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
}

/* =========================================================
   7. Toast (flutua acima da captura e da nav)
   ========================================================= */
.toast-stack {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--capture-h) + var(--safe-b) + 12px);
  transform: translateX(-50%);
  width: min(calc(100vw - 2 * var(--gutter)), 440px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  max-width: 100%;
  min-height: 48px;
  padding: 6px 6px 6px var(--s-4);
  border-radius: var(--r-card);
  background: var(--toast-bg);
  color: var(--toast-text);
  box-shadow: var(--shadow-float);
  font-family: var(--font-ui);
  font-size: var(--fs-2);
  line-height: 1.35;
  animation: ap-toast-in var(--t-med) var(--ease) both;
}
.toast:not(:has(.toast-action)) { padding-right: var(--s-4); }
.toast-msg { flex: 1 1 auto; min-width: 0; padding: 6px 0; overflow-wrap: anywhere; }
.toast-action {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-field);
  color: var(--toast-action);
  font-weight: var(--w-strong);
  letter-spacing: .01em;
}
.toast-action:hover { background: rgba(127, 127, 127, .16); }
.toast-action:focus-visible { outline-color: var(--toast-action); }
@keyframes ap-toast-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}
/* com o autocompletar aberto, o toast vai para o topo para não cobrir as opções */
html.ap-ac-aberto .toast-stack { bottom: auto; top: calc(var(--safe-t) + 24px); }
/* toast solto (sem pilha), caso a casca use .toast direto */
body > .toast, .app > .toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--capture-h) + var(--safe-b) + 12px);
  transform: translateX(-50%);
  animation: none;
}

/* =========================================================
   8. Vazio, seções, utilitários
   ========================================================= */
.empty {
  padding: var(--s-7) 0 var(--s-6);
  max-width: 420px;
}
.empty-title {
  font-family: var(--font-texto);
  font-size: var(--fs-3);
  line-height: 1.4;
  color: var(--text);
  margin-bottom: var(--s-1);
}
.empty-sub {
  font-size: var(--fs-2);
  line-height: 1.5;
  color: var(--text-2);
}
.empty .btn-row { margin-top: var(--s-4); }

.section { margin-top: var(--s-6); }
.section:first-child { margin-top: var(--s-3); }
.section-title {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  margin: 0 0 var(--s-2);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: var(--w-strong);
  text-transform: uppercase; font-size: 12px; /* K: maiúsculas reais (small-caps sintético saía irregular) */
  letter-spacing: .07em;
  line-height: 24px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.section-title > * { min-width: 0; }
.section-title .count { font-variant-caps: normal; letter-spacing: 0; }

.muted { color: var(--text-2); }
.small { font-family: var(--font-ui); font-size: var(--fs-1); line-height: 18px; }
p.small, div.small { margin: var(--s-1) 0; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Menu flutuante */
.menu-wrap { position: relative; display: inline-flex; }
.menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 4px);
  right: 0;
  min-width: 200px;
  max-width: calc(100vw - 2 * var(--gutter));
  padding: 4px;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-field);
  box-shadow: var(--shadow-float);
  animation: ap-menu-in var(--t-fast) var(--ease) both;
  transform-origin: top right;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  min-height: 44px;
  padding: 0 var(--s-3);
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: var(--fs-2);
  color: var(--text);
  text-align: left;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.menu-item:hover, .menu-item:active { background: var(--hover); }
.menu-item:focus-visible { background: var(--hover); outline-offset: -2px; }
.menu-item .ico { color: var(--text-2); width: 18px; height: 18px; }
.menu-item.btn-danger, .menu-item[data-perigo] { color: var(--late); }
@keyframes ap-menu-in { from { opacity: 0; transform: scale(.97) translateY(-2px); } to { opacity: 1; transform: none; } }

/* =========================================================
   9. Cartões (Painéis e Projetos)
   ========================================================= */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
}
.card-grid > * { min-width: 0; position: relative; }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 100%;
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--t-fast) var(--ease);
}
a.card:hover { border-color: var(--line-strong); }
a.card:active { background: var(--bg); }
.card-title {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  padding-right: 28px;
  font-family: var(--font-texto);
  font-size: var(--fs-2);
  font-weight: var(--w-strong);
  line-height: 1.35;
  color: var(--text);
  /* anywhere (não break-word): o texto solto dentro do flex também encolhe — palavra enorme sem espaço
     ("xxxx…", link colado) quebra em vez de empurrar a página de lado (robô h2, #/projetos a 390 px). */
  overflow-wrap: anywhere;
  /* cartão estreito (2 colunas no celular): hifeniza em pt-BR ("Inadimplên-cia") antes de cortar a palavra no meio */
  hyphens: auto;
}
.card-title > * { min-width: 0; }
.list-plain .card-title, .review-card .card-title { font-size: var(--fs-3); padding-right: 0; }
.card-number {
  margin-top: var(--s-3);
  font-family: var(--font-texto);
  font-size: var(--fs-5);
  font-weight: var(--w-strong);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--text);
  overflow-wrap: anywhere;
}
.card-label {
  font-family: var(--font-ui);
  font-size: var(--fs-1);
  line-height: 18px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.card-foot {
  margin-top: auto;
  padding-top: var(--s-3);
  font-family: var(--font-ui);
  font-size: var(--fs-1);
  line-height: 18px;
  color: var(--text-2);
}
.card:not(:has(.card-number)) .card-foot { color: var(--accent); }
.card .progress { margin: var(--s-3) 0 var(--s-2); }
.card .small { margin: 0; color: var(--text); }
.card .small.muted, .card .small .muted { color: var(--text-2); }
.card .small + .small { margin-top: 2px; }
/* "…" do cartão: sempre no DOM; no computador aparece no hover/foco.
   .card-wrap = cartão-link + botão irmão (o botão não pode ficar dentro do <a>). */
.card-wrap { position: relative; min-width: 0; }
.card-wrap > .card { height: 100%; }
.card-wrap > .card .card-title { padding-right: 36px; }
.card > .icon-btn, .card-wrap > .icon-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 40px;
  height: 40px;
}
@media (hover: hover) {
  .card > .icon-btn, .card-wrap > .icon-btn { opacity: 0; transition: opacity var(--t-fast) var(--ease); }
  .card:hover > .icon-btn, .card:focus-within > .icon-btn, .card > .icon-btn[aria-expanded="true"],
  .card-wrap:hover > .icon-btn, .card-wrap:focus-within > .icon-btn, .card-wrap > .icon-btn[aria-expanded="true"] { opacity: 1; }
}
.card > .menu { top: 44px; right: 6px; }
.card-grid > * > .menu { top: 44px; right: 6px; }

.progress {
  position: relative;
  height: 4px;
  border-radius: var(--r-round);
  background: var(--line);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width var(--t-med) var(--ease);
}
.progress-bar[style*="width:100%"], .progress-bar[style*="width: 100%"] { background: var(--ok); }

.dot-late {
  flex: none;
  display: inline-block;
  align-self: center;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--late);
}

/* =========================================================
   10. Notas (folha livre)
   ========================================================= */
.note-head {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-2) 0 var(--s-4);
  margin-bottom: var(--s-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-ui);
  font-size: var(--fs-1);
  color: var(--text-2);
}
.note-head .chips .chip { --hit-c: calc(var(--hit) * 4 / 3); border-block-width: var(--hit-c); min-height: calc(32px + 2 * var(--hit-c)); min-width: calc(32px + 2 * var(--hit-c)); padding: 6px 12px; font-size: var(--fs-1); }
.note-area {
  display: block;
  width: 100%;
  min-height: 62vh;
  padding: var(--s-4) 0 var(--s-7);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-texto);
  font-size: var(--fs-note);
  line-height: 1.7;
  resize: none;
  caret-color: var(--accent);
  -webkit-appearance: none;
  appearance: none;
}
.note-area:focus, .note-area:focus-visible { outline: none; box-shadow: none; }
.note-area::placeholder { color: var(--text-hint); opacity: 1; }
.note-lines { list-style: none; margin: 0; padding: var(--s-3) 0 var(--s-7); }
.note-line {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: start;
  min-height: 40px;
  padding: 4px 0;
  font-family: var(--font-texto);
  font-size: var(--fs-note);
  line-height: 1.7;
  color: var(--text);
  overflow-wrap: anywhere;
}
.note-line > :not(.note-dot) { grid-column: 2; }
.note-line:has(.note-dot.is-item) { color: var(--text); }
.note-line .item-text { font-size: var(--fs-note); line-height: 1.7; cursor: default; }
.note-line .link-muted { min-height: 28px; }
.note-head .editor-row .input { width: auto; flex: 1 1 12em; min-width: 0; max-width: 100%; }
.note-head .editor-row .input[type="date"] { flex: 0 1 auto; }
.note-head .editor-row > .small, .note-head .editor-row > .muted { margin-left: auto; }
.note-dot {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  width: var(--tap);
  height: var(--tap);
  margin: -8px 0 -8px -17px;
  border-radius: 50%;
  color: var(--text-3);
}
.note-dot::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.note-dot:hover { color: var(--accent); }
.note-dot:active::before { transform: scale(.85); }
.note-dot.is-item { color: var(--accent); }
.note-dot.is-item::before { background: currentColor; }

/* =========================================================
   11. Sugestões e Radar
   ========================================================= */
.sug-card {
  margin: var(--s-2) 0 var(--s-3);
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.sug-type {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: var(--w-strong);
  text-transform: uppercase; font-size: 12px; /* K: maiúsculas reais (small-caps sintético saía irregular) */
  letter-spacing: .07em;
  line-height: 20px;
  color: var(--accent);
  margin-bottom: var(--s-1);
  overflow-wrap: anywhere;
}
.sug-diff {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-ui);
  font-size: var(--fs-2);
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: anywhere;
}
.sug-diff .item-text { cursor: default; }
.sug-diff .list-plain > li { padding: 4px 0; font-family: var(--font-texto); font-size: var(--fs-3); line-height: 1.45; }
.sug-quote {
  margin: var(--s-3) 0 0;
  padding: 2px 0 2px var(--s-3);
  border-left: 2px solid var(--line-strong);
  font-family: var(--font-texto);
  font-size: var(--fs-2);
  line-height: 1.55;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.sug-src {
  margin-top: var(--s-2);
  font-family: var(--font-ui);
  font-size: var(--fs-1);
}
.sug-src .link { text-decoration: none; }
.sug-src .link:hover { text-decoration: underline; }
.sug-card .btn-row { margin-top: var(--s-4); }

.radar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  padding: var(--s-3) 0;
}
.radar-row + .radar-row { border-top: 1px solid var(--line); }
.radar-row > .item-body { flex: 1 1 260px; min-width: 0; }
.radar-row .item-text { cursor: default; }
.radar-row > .btn-row { margin-top: 0; flex: none; gap: var(--s-1); }
.radar-row .btn { min-height: 36px; padding: 0 12px; font-size: var(--fs-1); }

/* =========================================================
   12. Revisão de segunda
   ========================================================= */
.review-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--s-1);
  margin: var(--s-2) 0 var(--s-4);
  font-family: var(--font-ui);
  font-size: var(--fs-1);
  font-weight: var(--w-strong);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.review-bar > .muted { font-weight: var(--w-regular); }
.review-bar > .progress { flex: 1 0 100%; margin-top: var(--s-2); }
.review-step { padding-bottom: var(--s-5); }
.review-step > .page-title { margin-top: 0; }
.review-step > .btn-row:last-child {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}
.review-step > .btn-row:last-child > .btn-primary { margin-left: auto; min-width: 120px; }
.review-card {
  margin: var(--s-2) 0 var(--s-3);
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.review-card > .item-text { cursor: default; }
.review-card .btn-row { margin-top: var(--s-4); }
.review-card .chips { margin-top: var(--s-3); }

/* =========================================================
   13. Modo apresentação (casca põe .is-present no .app)
   ========================================================= */
.app.is-present .item.is-private,
.app.is-present .item > .item-star,
.app.is-present .capture-star { display: none; }

/* =========================================================
   14. Computador (≥ 900 px): lateral 220 px + coluna 680 px
   ========================================================= */
@media (min-width: 900px) {
  .app {
    display: grid;
    grid-template-columns: var(--side-w) minmax(0, 1fr);
    align-items: start;
  }
  .app-main { padding-bottom: var(--s-7); grid-column: 2; }
  .nav { display: none; }

  .side {
    grid-column: 1;
    grid-row: 1 / span 3;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    padding: var(--s-5) var(--s-3) var(--s-4);
    background: var(--bg);
    font-family: var(--font-ui);
    font-size: var(--fs-2);
    scrollbar-width: thin;
  }
  .side .nav-item {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--s-3);
    min-height: 36px;
    padding: 0 var(--s-3);
    font-size: var(--fs-2);
    color: var(--text-2);
    letter-spacing: 0;
  }
  .side .nav-item .ico { width: 18px; height: 18px; }
  .side .nav-item:hover { background: var(--hover); color: var(--text); }
  .side .nav-item.is-active { background: var(--press); color: var(--text); }
  .side .nav-item.is-active::after { display: none; }
  .side .nav-item .count { position: static; margin-left: auto; }
  .side-section {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: var(--s-5);
  }
  .side-section:last-child, .side-section.is-foot { margin-top: auto; padding-top: var(--s-4); }
  .side-section > .section-title,
  .side-section > h2, .side-section > h3, .side-section > .side-title {
    padding: 0 var(--s-3);
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: var(--w-strong);
    text-transform: uppercase; font-size: 12px; /* K: maiúsculas reais (small-caps sintético saía irregular) */
    letter-spacing: .07em;
    color: var(--text-hint);
  }
  .side-person {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    min-height: 34px;
    padding: 0 var(--s-3);
    border-radius: var(--r-field);
    color: var(--text);
    font-size: var(--fs-2);
    text-decoration: none;
    overflow-wrap: anywhere;
  }
  .side-person > span:first-child { min-width: 0; }
  .side-person:hover { background: var(--hover); }
  .side-person.is-active { background: var(--press); font-weight: var(--w-strong); }
  .side-person .count { margin-left: auto; }
  .side .sync-pill { padding: var(--s-3) var(--s-3) 0; font-size: 12px; }
  .sync-pill {
    top: auto; bottom: 8px; left: var(--s-3); transform: none;
    max-width: calc(var(--side-w) - 2 * var(--s-3));
    min-height: 32px; padding: 8px var(--s-3); text-align: left;
    border-radius: var(--r-field);
  }
  .sync-pill:hover { background: var(--hover); color: var(--text); }
  .side { padding-bottom: 48px; }

  .page { padding: 0 var(--s-6); max-width: calc(var(--col) + 2 * var(--s-6)); }
  .app-main > .topbar { padding-left: var(--s-6); padding-right: var(--s-6); max-width: calc(var(--col) + 2 * var(--s-6)); }
  .page-wide { max-width: calc(var(--col-wide) + 2 * var(--s-6)); }
  .topbar { min-height: 72px; padding-top: var(--s-6); }
  .seg { margin: 0 0 var(--s-2); padding: 0; }

  /* captura = 1ª linha do Doc, presa no topo */
  .capture {
    position: sticky;
    top: 0;
    left: auto; right: auto; bottom: auto;
    z-index: 12;
    margin: var(--s-5) 0 var(--s-2);
    padding: var(--s-2) 0;
    border-top: 0;
    border-bottom: 0;
  }
  .topbar + .capture { margin-top: var(--s-2); }
  .capture-input { height: 48px; border-radius: var(--r-field); padding: 0 56px 0 var(--s-4); }
  .capture > .icon-btn:not(.capture-star) { display: none; }
  .capture-hint { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; padding: 0; }
  .capture-star { margin-left: -12px; }
  .capture:has(+ .seg) { margin-bottom: 0; }
  .capture + .seg, .capture + * + .seg { top: 64px; }
  .ac { left: 0; right: 0; top: calc(100% - 4px); bottom: auto; }
  .review-step .capture, .section .capture { position: relative; top: auto; }

  .toast-stack, body > .toast, .app > .toast {
    bottom: var(--s-5);
    left: calc(50% + var(--side-w) / 2);
  }

  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }

  .item > .item-star { left: -26px; top: 15px; width: 14px; height: 14px; }
  .item-check { margin-top: -12px; }
  .item { padding: 10px 0 9px; }

  .note-area, .note-lines { padding-left: 0; }
  .present-banner { left: calc(50% + var(--side-w) / 2); }
  .app.is-present .topbar { padding-top: calc(var(--s-6) + 24px); }
}

@media (max-width: 899.98px) {
  /* 2 colunas no celular; 1 coluna quando cada cartão ficaria estreito demais (fonte grande) */
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr)); }
  .card-grid .card { padding: 14px; }
  .card-grid .card-number { font-size: 24px; }
}
/* telas muito estreitas */
@media (max-width: 380px) {
  .capture-input::placeholder { font-size: 13px; letter-spacing: -0.2px; }
}
/* tela "estreita" por fonte grande (zoom 130–150 %): o pixel CSS já é maior que o físico,
   então ícones de 44 px CSS continuam com mais de 48 px de verdade */
@media (max-width: 320px) {
  .topbar-actions .icon-btn { min-width: 44px; padding: 0 6px; }
}
@media (max-width: 360px) {
  :root { --gutter: 14px; }
  .seg { gap: var(--s-4); }
  .chip { padding-inline: 12px; }
}

/* =========================================================
   15. Movimento reduzido
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
  .item.is-done { animation: none; opacity: .5; }
  .sync-pill[data-estado="enviando"]::before { animation: none; opacity: .4; }
}

/* Impressão: só a página */
@media print {
  .nav, .side, .capture, .toast-stack, .sync-pill, .present-banner, .topbar-actions, .seg { display: none !important; }
  .app { display: block; }
  .app-main { padding: 0; }
  body, .app { background: #fff; color: #000; }
}

/* K: revisão · Entrada — chips de área de um toque mais leves: uma linha por pauta, alinhada ao texto,
   deslizando de lado se não couber (a página continua sem rolagem horizontal). */
[data-sem-area] > .chips {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 6px;
  margin: -4px 0 var(--s-3) 32px;
  padding-bottom: 2px;
}
[data-sem-area] > .chips::-webkit-scrollbar { display: none; }
[data-sem-area] > .chips .chip { --hit-c: calc(var(--hit) * 4 / 3); border-block-width: var(--hit-c); min-height: calc(32px + 2 * var(--hit-c)); min-width: calc(32px + 2 * var(--hit-c)); padding: 6px 11px; font-size: var(--fs-1); color: var(--text-2); flex: none; white-space: nowrap; }

/* =========================================================
   16. Tela de toque (pointer: coarse): todo alvo com ≥ 48 px
   (SPEC §4.5; FIX_PLAN D8). O desenho continua o mesmo onde dá:
   chips ganham borda transparente (--hit), ícones e links ganham
   folga com margem negativa. No computador (mouse) nada muda.
   ========================================================= */
@media (pointer: coarse) {
  .icon-btn { min-width: var(--tap); height: var(--tap); }
  .card > .icon-btn, .card-wrap > .icon-btn { min-width: var(--tap); height: var(--tap); top: 0; right: 0; }
  .card > .menu, .card-grid > * > .menu { top: 48px; }

  .seg-btn { height: var(--tap); min-width: var(--tap); padding: 0 7px; margin: 0 -7px; }
  .seg-btn.is-active::after { left: 7px; right: 7px; }

  .btn, .input, .chips .input, .radar-row .btn { min-height: var(--tap); }
  .textarea { min-height: var(--tap); }
  .editor .textarea[rows="2"] { min-height: var(--tap); }
  .editor > .editor-row:first-child .textarea { min-height: var(--tap); padding-top: 11px; }

  .link-muted, .link-muted.small { min-height: var(--tap); }
  .subgroup-title > [data-acao="virar-projeto"] { margin-block: -14px; }
  .note-line .link-muted { min-height: var(--tap); margin: -10px 0; }
  .group-head { min-height: var(--tap); padding-top: var(--s-2); }
  button.group-title, .group-action { min-height: var(--tap); }
  .hoje-row { min-height: var(--tap); }
  .hoje-row .link { display: inline-flex; align-items: center; min-height: var(--tap); }

  /* links soltos (fora de frase): alvo de 48 px sem mudar a altura da linha */
  .sug-src .link, .btn-row > .link, .field > .link, .card .link, .review-bar .link,
  .section > .link, .radar-row .link, .review-card .link, .card-title > .link {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    margin-block: -14px;
    vertical-align: middle;
  }
  .sug-src { min-height: 20px; }

  .menu-item, .ac-item { min-height: var(--tap); }
  .toast:has(.toast-action) { padding-block: 0; }
  .toast-action { height: var(--tap); margin-right: -6px; padding: 0 16px; }

  .capture-input { height: var(--tap); }
  label:has(> input[type="checkbox"]):not(.chip), label:has(> input[type="radio"]):not(.chip) {
    display: flex; align-items: center; gap: var(--s-2); min-height: var(--tap);
  }
  .side .nav-item, .side-person { min-height: var(--tap); }
}

/* =========================================================
   17. Novidades pós-caça (contrato em NOTAS_FIX_5.md)
   ========================================================= */

/* Faixa fixa "Armazenamento do aparelho cheio — …" (D2) e outros avisos que não podem passar
   despercebidos. Fica no topo, acima da topbar, e empurra nada (flutua sobre a área segura). */
.faixa-aviso, .storage-banner, .quota-banner {
  position: fixed;
  z-index: 70;
  top: 0; left: 0; right: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-1) var(--s-3);
  min-height: var(--tap);
  padding: calc(var(--safe-t) + var(--s-2)) max(var(--gutter), var(--safe-r)) var(--s-2) max(var(--gutter), var(--safe-l));
  background: color-mix(in srgb, var(--late) 12%, var(--bg));
  border-bottom: 1px solid color-mix(in srgb, var(--late) 35%, var(--bg));
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-2);
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.faixa-aviso::before, .storage-banner::before, .quota-banner::before {
  content: "";
  flex: none;
  width: 8px; height: 8px;
  border-radius: 1px;
  transform: rotate(45deg);
  background: var(--late);
}
.faixa-aviso > :not(.faixa-acao):not(button):not(a), .storage-banner > span, .quota-banner > span { flex: 1 1 14em; min-width: 0; }
.faixa-aviso.is-info { background: var(--accent-tint); border-bottom-color: var(--line); }
.faixa-aviso.is-info::before { background: var(--accent); border-radius: 50%; transform: none; }
.faixa-acao, .faixa-aviso > button, .faixa-aviso > a, .storage-banner > button, .quota-banner > button {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  margin: -8px 0;
  padding: 0 var(--s-3);
  border-radius: var(--r-field);
  color: var(--accent);
  font-weight: var(--w-strong);
  text-decoration: none;
}
.faixa-acao:hover, .faixa-aviso > button:hover { background: var(--accent-tint); }
/* Celular: a faixa entra no fluxo, no topo (qualquer posição dentro de .app), e gruda no alto ao
   rolar — nada fica escondido atrás dela. Computador: flutua sobre a coluna e a topbar desce. */
@media (max-width: 899.98px) {
  .app.is-cheio,
  .app:has(> .faixa-aviso:not([hidden]), > .storage-banner:not([hidden]), > .quota-banner:not([hidden])) { display: flex; flex-direction: column; }
  .app > .faixa-aviso, .app > .storage-banner, .app > .quota-banner { position: sticky; order: -1; }
  .app > .app-main { flex: 1 0 auto; }
}
@media (min-width: 900px) {
  .faixa-aviso, .storage-banner, .quota-banner { left: var(--side-w); padding-left: var(--s-6); padding-right: var(--s-6); }
  .app:has(> .faixa-aviso:not([hidden]), > .storage-banner:not([hidden]), > .quota-banner:not([hidden])) .topbar { margin-top: var(--s-7); }
}

/* Toasts com mensagem que pede leitura (conflito de nota, erro de gravação) */
.toast.is-conflito, .toast[data-tipo="conflito"],
.toast.is-erro, .toast[data-tipo="erro"] { align-items: flex-start; }
.toast.is-conflito .toast-msg, .toast[data-tipo="conflito"] .toast-msg,
.toast.is-erro .toast-msg, .toast[data-tipo="erro"] .toast-msg { padding: 12px 0; }
.toast.is-erro::before, .toast[data-tipo="erro"]::before,
.toast.is-conflito::before, .toast[data-tipo="conflito"]::before {
  content: "";
  flex: none;
  width: 8px; height: 8px;
  margin: 20px 0 0 -4px;
  border-radius: 1px;
  transform: rotate(45deg);
  background: var(--toast-action);
}
.toast.is-erro::before, .toast[data-tipo="erro"]::before { background: #F08B74; }
:root[data-tema="escuro"] .toast.is-erro::before, :root[data-tema="escuro"] .toast[data-tipo="erro"]::before { background: #B3402A; }
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) .toast.is-erro::before, :root:not([data-tema="claro"]) .toast[data-tipo="erro"]::before { background: #B3402A; }
}

/* Chave liga/desliga (Config › Áreas › "Privada"): checkbox com role="switch" */
.switch {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: var(--tap);
  font-family: var(--font-ui);
  font-size: var(--fs-2);
  color: var(--text);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
input[type="checkbox"][role="switch"] {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 36px;
  height: 22px;
  margin: 0;
  border-radius: var(--r-round);
  background: var(--line-strong);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease);
}
input[type="checkbox"][role="switch"]::before {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
  transition: transform var(--t-fast) var(--ease);
}
input[type="checkbox"][role="switch"]:checked { background: var(--accent); }
input[type="checkbox"][role="switch"]:checked::before { transform: translateX(14px); background: var(--accent-ink); }
input[type="checkbox"][role="switch"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="checkbox"][role="switch"]:disabled { opacity: .45; cursor: default; }
.field-help {
  margin: 2px 0 var(--s-2);
  font-family: var(--font-ui);
  font-size: var(--fs-1);
  line-height: 18px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

/* Uso do armazenamento (Config › Dados) */
meter, .uso-meter {
  display: block;
  width: 100%;
  height: 4px;
  margin: var(--s-2) 0;
  border: 0;
  border-radius: var(--r-round);
  background: var(--line);
  -webkit-appearance: none;
  appearance: none;
  overflow: hidden;
}
meter::-webkit-meter-bar { background: var(--line); border: 0; border-radius: var(--r-round); height: 4px; }
meter::-webkit-meter-optimum-value, meter::-webkit-meter-suboptimum-value, meter::-webkit-meter-even-less-good-value {
  background: var(--accent); border-radius: var(--r-round);
}
meter::-moz-meter-bar { background: var(--accent); border-radius: var(--r-round); }
.uso-meter.is-alto::-webkit-meter-optimum-value, .uso-meter[data-alto]::-webkit-meter-optimum-value,
meter.is-alto::-webkit-meter-optimum-value, meter::-webkit-meter-suboptimum-value,
meter::-webkit-meter-even-less-good-value { background: var(--late); }
.uso-meter.is-alto::-moz-meter-bar, .uso-meter[data-alto]::-moz-meter-bar { background: var(--late); }
.progress.is-alto > .progress-bar, .progress[data-alto] > .progress-bar { background: var(--late); }

/* Texto comprido sem espaço (link colado, nome sem espaço) nunca empurra a página para o lado */
.page, .app-main, .editor, .note-head, .sug-card, .review-card, .radar-row, .empty, .field { overflow-wrap: anywhere; }
.page-sub, .empty-title, .empty-sub, .small, .muted { overflow-wrap: anywhere; }

/* =========================================================
   18. Revisão de interface (Web Interface Guidelines) — NOTAS_REVISAO_UI.md
   ========================================================= */

/* "Pular para o conteúdo": .sr-only (app.js) até receber o foco no 1º Tab; não ocupa célula da grade da casca */
.skip-link {
  position: absolute;
  z-index: 80;
  top: calc(var(--safe-t) + 8px);
  left: 8px;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 16px;
  border-radius: var(--r-field);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-float);
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: var(--fs-2);
  font-weight: var(--w-strong);
  text-decoration: none;
}
.app-main:focus { outline: none; }

/* Títulos com quebra equilibrada; parágrafos curtos sem palavra órfã na última linha */
.topbar-title, .page-title, .empty-title, .card-title, .section-title, .sug-type, .hoje-title { text-wrap: balance; }
.page-sub, .empty-sub, .field-help, .sug-quote, .small, p { text-wrap: pretty; }

/* Números tabulares em contagens e datas (colunas não "dançam" ao mudar) */
.item-meta, .group-meta, .card-label, .card-foot, .note-head, .hoje-row .muted, .sync-pill, .progress + .small, .toast-msg {
  font-variant-numeric: tabular-nums;
}

/* Celular: nenhum campo abaixo de 16 px (o iOS dá zoom ao focar) */
@media (max-width: 899.98px) {
  .chips .input, .editor .textarea[rows="2"], .radar-row .input, .note-head .chips .input { font-size: 16px; }
}

/* Título do tema ("Virar projeto") fica por cima da folga de toque do texto da 1ª pauta do tema */
.subgroup-title { position: relative; z-index: 1; }

/* Com aviso (toast) na tela, o foco por teclado não fica atrás dele */
html.ap-toast { scroll-padding-bottom: calc(var(--nav-h) + var(--capture-h) + var(--safe-b) + 80px); }
@media (min-width: 900px) {
  html.ap-toast { scroll-padding-bottom: 96px; }
}

/* Campo com erro: borda na cor de atraso + texto ao lado (nunca só a cor) */
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--late); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--late) 18%, transparent); }
.field-erro { color: var(--late); }

/* Botão em andamento: mantém o rótulo e mostra um ponto pulsando (sem trocar o texto) */
.btn[aria-busy="true"]::after {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: ap-pulsar 1.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .btn[aria-busy="true"]::after { animation: none; opacity: .6; } }

/* Cabeçalho de grupo como <h2> (Pautas): mesmo desenho do <div> de antes */
h2.group-head { font-size: inherit; font-weight: inherit; line-height: inherit; margin: 0; }

/* Pautas no computador: captura (64 px) + visões (44 px) presas no topo → o foco por Tab para abaixo delas */
@media (min-width: 900px) {
  html[data-rota="pautas"] { scroll-padding-top: 124px; }
}

/* Computador: a ★ da margem (−26 px) de uma pauta rolando por baixo da captura/visões presas no topo
   aparecia solta ao lado do campo. Uma faixa da cor do papel à esquerda delas cobre essa margem. */
@media (min-width: 900px) {
  .capture:not(.review-step .capture):not(.section .capture):not(.editor .capture),
  .capture + .seg, .capture + * + .seg { box-shadow: -40px 0 0 var(--bg); }
}
