/* Rafa OS — app.
 *
 * Direção (2026-09-17): centro pessoal de decisões. Cinza mineral, texto grafite, um acento azul
 * profundo. O VIDRO ficou só nas camadas de navegação (topo, tabbar, moldura da folha); conteúdo,
 * cartão, formulário e diff são superfície SÓLIDA — vidro sobre lista é o que fazia a leitura
 * cansar. Cor semântica só para estado (vencido, erro, ok); área se distingue por nome + ícone.
 */
:root {
  color-scheme: light;
  --bg: #f2f4f7;
  --bg2: #e9edf2;
  --surface: #ffffff;
  --surface2: #f7f9fb;
  --ink: #17212f;
  --ink2: #526173;
  --ink3: #7c8899;
  --accent: #2456a6;
  --accent-ink: #ffffff;
  --accent-soft: rgba(36, 86, 166, .10);
  --ok: #17754a;
  --warn: #9a6408;
  --bad: #b3352f;
  --line: #d7dee7;
  --line2: #e6ebf1;
  --chip: #eef1f6;
  --nav-glass: rgba(255, 255, 255, .86);
  --nav-edge: rgba(23, 33, 47, .10);
  --shadow: 0 1px 2px rgba(23, 33, 47, .06);
  --shadow-up: 0 -8px 28px rgba(23, 33, 47, .10);
  --r: 14px;
  --r-sm: 10px;
  --tab-h: 62px;
}
/* O tema é resolvido cedo pelo script inline do index.html (auto -> claro/escuro) e gravado em
   data-theme; assim um único bloco de tokens escuros basta. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11151b;
  --bg2: #0d1116;
  --surface: #1b222c;
  --surface2: #202834;
  --ink: #f1f5f9;
  --ink2: #b6c2d0;
  --ink3: #8b98a8;
  --accent: #9fc2ff;
  --accent-ink: #0e1620;
  --accent-soft: rgba(159, 194, 255, .14);
  --ok: #58cf95;
  --warn: #f0b355;
  --bad: #f5837c;
  --line: #333f4e;
  --line2: #29323d;
  --chip: #262f3b;
  --nav-glass: rgba(27, 34, 44, .90);
  --nav-edge: rgba(255, 255, 255, .12);
  --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-up: 0 -8px 28px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  min-height: 100dvh; padding-top: env(safe-area-inset-top, 0px); overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
[hidden] { display: none !important; }

/* Foco visível em tudo que se opera por teclado. */
:where(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px;
}

/* Fundo: chapado. Os três blobs animados saíram em 2026-09-17 — composite contínuo no celular
   e nenhum ganho de leitura. */
.bg { position: fixed; inset: 0; z-index: -1; background: var(--bg); }

/* Ícones: família única, traço, currentColor. Mapa fechado em icons.js. */
.ic { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: -4px; }
.ic.lg { width: 22px; height: 22px; }

/* Bolinha de estado — substitui 🟢/🔴/🟡 no texto. */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink3); flex: none; vertical-align: 1px; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }

/* Superfície de conteúdo: sólida. A classe continua se chamando .glass porque é o que o app.js
   emite; o vidro de verdade mudou de endereço (.top e .tabbar, abaixo). */
.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* topo — camada de navegação, vidro discreto */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--surface); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none;
}
.top-row { display: flex; align-items: center; gap: 4px; padding: 10px 12px; max-width: 760px; margin: 0 auto; }
.top-title { flex: 1; font-weight: 640; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 38px; height: 38px; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--ink2); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--chip); }
.icon-btn:active { background: var(--chip); transform: scale(.96); }

.main { max-width: 760px; margin: 0 auto; padding: 14px 16px calc(var(--tab-h) + 28px + env(safe-area-inset-bottom, 0px)); }

/* tabbar — a outra camada de navegação */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; width: 100%;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 0 env(safe-area-inset-bottom, 0px);
  border: 0; border-top: 1px solid var(--line); border-radius: 0;
  background: var(--surface); box-shadow: var(--shadow-up);
  display: flex; z-index: 30;
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink3); font-size: 11px; font-weight: 550; letter-spacing: .01em; }
.tabbar a .ic { width: 21px; height: 21px; }
.tabbar a.on { color: var(--accent); }

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .top, .tabbar {
    background: var(--nav-glass);
    -webkit-backdrop-filter: blur(20px) saturate(118%); backdrop-filter: blur(20px) saturate(118%);
  }
}
/* Preferência do sistema e chave manual ("Reduzir transparência" em Mais): volta ao opaco. */
@media (prefers-reduced-transparency: reduce) {
  .top, .tabbar { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
:root[data-transparencia="reduzida"] .top,
:root[data-transparencia="reduzida"] .tabbar { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }

/* blocos */
.card { border-radius: var(--r); padding: 12px 14px; margin: 0 0 12px; }
.card h2 { margin: 0 0 6px; font-size: 14px; font-weight: 640; letter-spacing: -.005em; color: var(--ink); }
.card h2 .n { float: right; font-weight: 550; color: var(--ink3); font-size: 13px; }
.sec-title { margin: 20px 2px 8px; font-size: 14px; font-weight: 640; letter-spacing: -.005em; color: var(--ink); display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sec-title a, .sec-title .muted { font-weight: 500; font-size: 13px; color: var(--ink3); }
.sec-title a { color: var(--accent); }
.sec-title > span:first-child { display: flex; align-items: center; gap: 7px; }

.hello { padding: 6px 2px 14px; }
.hello h1 { margin: 0; font-size: 26px; font-weight: 650; letter-spacing: -.02em; }
.hello p { margin: 5px 0 0; color: var(--ink2); font-size: 14px; }
.hello .saude { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink2); font-size: 13px; text-decoration: none; max-width: 100%; }

.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line2); cursor: pointer; }
.row:first-child, .card h2 + .row { border-top: 0; }
a.row { color: inherit; display: flex; }
.row:hover { background: var(--surface2); }
.row .em { width: 22px; display: grid; place-items: center; flex: none; color: var(--ink3); }
.row .tx { flex: 1; min-width: 0; }
.row .t { font-weight: 550; font-size: 15px; line-height: 1.32; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.row .s { color: var(--ink3); font-size: 12.5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.row .rt { flex: none; text-align: right; font-size: 12.5px; color: var(--ink2); font-weight: 550; font-variant-numeric: tabular-nums; }
.row .chev { color: var(--ink3); flex: none; display: grid; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--chip); color: var(--ink2); white-space: nowrap; letter-spacing: .01em; }
.pill.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--bad); }
.pill.acc { background: var(--accent-soft); color: var(--accent); }
/* Área não ganha cor própria: o nome e o ícone já distinguem. As classes seguem existindo porque
   o app.js as emite — só deixaram de pintar. */
.pill.verde, .pill.roxo, .pill.laranja, .pill.azul, .pill.rosa, .pill.amarelo, .pill.cinza { background: var(--chip); color: var(--ink2); }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
/* Vendas (2026-11-16): cores por imóvel = slots 1–3 da paleta categórica validada (dataviz), passos próprios no escuro. */
:root { --v-sala: #2a78d6; --v-praia: #eb6834; --v-natureza: #1baf7a; }
:root[data-theme="dark"] { --v-sala: #3987e5; --v-praia: #d95926; --v-natureza: #199e70; }
.vz-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.vz-kpi { border-radius: var(--r); padding: 12px 14px; }
.vz-kpi .big { font-size: 26px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--ink); }
.vz-kpi .lab { font-size: 12px; color: var(--ink3); font-weight: 500; }
.vz-kpi.warn .big { color: var(--warn); }
.vz-leg { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink2); margin: 2px 0 8px; }
.vz-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.vz-chart svg { display: block; width: 100%; height: auto; }
.vz-chart .eixo { font-size: 10px; fill: var(--ink3); }
.vz-chart rect.b:hover { opacity: .8; }
.vz-funil { display: grid; gap: 10px; }
.vz-funil .nome { font-weight: 600; font-size: 14px; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.vz-funil .nome i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.vz-barra { display: grid; grid-template-columns: 92px 1fr 52px; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink2); margin: 3px 0; }
.vz-barra .trilho { height: 10px; border-radius: 4px; background: var(--chip); overflow: hidden; }
.vz-barra .trilho span { display: block; height: 100%; border-radius: 4px; }
.vz-barra b { font-variant-numeric: tabular-nums; color: var(--ink); text-align: right; font-weight: 600; }
.tile { border-radius: var(--r); padding: 12px 14px; min-height: 84px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; color: inherit; }
.tile:hover { border-color: var(--ink3); }
.tile .top-line { display: flex; align-items: center; justify-content: space-between; color: var(--ink3); }
.tile .big { font-size: 24px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile .lab { font-size: 12px; color: var(--ink3); font-weight: 500; line-height: 1.3; }
.tile .em { color: var(--ink3); }
.tile.bad .big { color: var(--bad); } .tile.warn .big { color: var(--warn); } .tile.ok .big { color: var(--ink); }

.quick { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick button { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--r-sm); padding: 9px 13px; font-weight: 550; font-size: 13.5px; cursor: pointer; }
.quick button:hover { background: var(--surface2); }
.quick button.p { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.quick button.p .ic { color: var(--accent-ink); }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button, .chips a { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; min-height: 34px; font-size: 13px; font-weight: 550; cursor: pointer; color: var(--ink2); text-decoration: none; white-space: nowrap; }
.chips .ic { width: 16px; height: 16px; }
.chips button.on, .chips a.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* Escolha do lado de um contato (tela Contatos). Botão alto, alvo grande: é a operação que se
   repete uma centena de vezes na primeira passada, e boa parte dela num celular. */
.lados { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.lados button { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--r-sm); padding: 12px 14px; font-size: 15px; min-height: 44px; cursor: pointer; }
.lados button.on { border-color: var(--accent); background: var(--accent-soft); }
.lados button .s { display: block; font-size: 12.5px; font-weight: 400; color: var(--ink2); margin-top: 2px; }
.lados button .ic { color: var(--ink3); margin-top: 1px; }
.lados button.on .ic { color: var(--accent); }

.seg { display: flex; background: var(--chip); border-radius: var(--r-sm); padding: 3px; margin: 4px 0 10px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 7px; font-weight: 550; font-size: 13.5px; color: var(--ink2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.search { width: 100%; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); padding: 11px 13px; font-size: 16px; margin-bottom: 10px; outline: none; }
.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.empty { text-align: center; color: var(--ink3); padding: 32px 14px; font-size: 14px; }
.empty .ic { width: 26px; height: 26px; opacity: .55; display: block; margin: 0 auto 10px; }
.muted { color: var(--ink3); font-size: 13px; }
.warnbox { border-radius: var(--r-sm); padding: 11px 13px; background: color-mix(in srgb, var(--warn) 10%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 34%, transparent); font-size: 14px; margin-bottom: 12px; }
.badbox { border-radius: var(--r-sm); padding: 11px 13px; background: color-mix(in srgb, var(--bad) 9%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 34%, transparent); font-size: 14px; margin-bottom: 12px; }

/* markdown */
.md { font-size: 15.5px; line-height: 1.55; overflow-wrap: anywhere; }
.md h1 { font-size: 21px; font-weight: 650; letter-spacing: -.02em; margin: 6px 0 12px; }
.md h2 { font-size: 17.5px; font-weight: 640; margin: 22px 0 8px; }
.md h3 { font-size: 16px; font-weight: 620; margin: 18px 0 6px; }
.md h4 { font-size: 15px; font-weight: 600; margin: 14px 0 4px; }
.md p { margin: 0 0 10px; }
.md blockquote { margin: 10px 0; padding: 8px 12px; border-left: 3px solid var(--line); background: var(--surface2); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.md blockquote p:last-child { margin: 0; }
.md ul, .md ol { padding-left: 22px; margin: 0 0 10px; }
.md li { margin: 4px 0; }
.md li.done { color: var(--ink3); text-decoration: line-through; }
.md code { background: var(--chip); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.md pre { background: var(--surface2); border: 1px solid var(--line2); padding: 10px 12px; border-radius: var(--r-sm); overflow-x: auto; font-size: 12.5px; }
.md pre code { background: none; padding: 0; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.md .tw { overflow-x: auto; margin: 10px 0; border-radius: var(--r-sm); border: 1px solid var(--line); }
.md table { border-collapse: collapse; font-size: 13.5px; min-width: 100%; font-variant-numeric: tabular-nums; }
.md th, .md td { padding: 7px 9px; border-bottom: 1px solid var(--line2); text-align: left; vertical-align: top; }
.md th { background: var(--surface2); font-weight: 620; }
.md a.wiki { border-bottom: 1px dashed var(--accent); }
.md img { max-width: 100%; }

/* sheet — a moldura pode ter vidro; o conteúdo dela, não */
.sheet-bg { position: fixed; inset: 0; background: rgba(12, 17, 24, .48); z-index: 40; animation: fade .16s ease; }
.sheet {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: min(760px, 100%);
  max-height: 92dvh; z-index: 41; border-radius: 16px 16px 0 0;
  padding: 8px 18px calc(18px + env(safe-area-inset-bottom, 0px)); overflow-y: auto;
  animation: up .2s cubic-bezier(.2,.8,.2,1);
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0;
  box-shadow: 0 -12px 40px rgba(12, 17, 24, .18);
}
.sheet .grip { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 14px; }
.sheet h3 { margin: 0 0 6px; font-size: 18px; font-weight: 640; letter-spacing: -.01em; line-height: 1.3; display: flex; align-items: center; gap: 8px; }
.sheet h3 .ic { color: var(--ink3); }
.sheet .meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.sheet .body { font-size: 15px; line-height: 1.5; margin-bottom: 14px; }
.sheet .sub-title { margin: 16px 0 6px; font-size: 12px; font-weight: 620; color: var(--ink3); letter-spacing: .02em; }
.sheet .perigo { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

.actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.actions button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--r-sm); padding: 11px; min-height: 44px; font-weight: 550; font-size: 14px; cursor: pointer; }
.actions button:hover, .btn:hover { background: var(--surface2); }
.actions button .ic, .btn .ic { color: var(--ink3); }
.actions button.p, .btn.p { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.actions button.ok, .btn.ok { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.actions button.p .ic, .btn.p .ic, .actions button.ok .ic, .btn.ok .ic { color: var(--accent-ink); }
.actions button.bad, .btn.bad { background: var(--surface); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.actions button.bad .ic, .btn.bad .ic { color: var(--bad); }
.actions button.wide, .btn.wide { grid-column: 1 / -1; }
.actions button[disabled], .btn[disabled] { opacity: .55; cursor: default; }
.btn.full { width: 100%; }

/* "Mais ações": o que não é o caminho comum fica fechado até ser pedido. */
.mais-acoes { margin-top: 10px; border-top: 1px solid var(--line2); padding-top: 8px; }
.mais-acoes > summary { cursor: pointer; list-style: none; color: var(--ink2); font-size: 13.5px; font-weight: 550; padding: 6px 2px; min-height: 32px; display: flex; align-items: center; gap: 6px; }
.mais-acoes > summary::-webkit-details-marker { display: none; }
.mais-acoes > summary::after { content: ""; width: 7px; height: 7px; border-right: 1.75px solid currentColor; border-bottom: 1.75px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); }
.mais-acoes[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
/* Apps: bastidores (rotinas e filas) fechados por padrão — 2026-10-20 */
.bastidores { margin-top: 12px; }
.bastidores > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; min-height: 32px; }
.bastidores > summary::-webkit-details-marker { display: none; }
.bastidores > summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 1.75px solid currentColor; border-bottom: 1.75px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); }
.bastidores[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.app-card .tx { min-width: 0; }

.form label { display: block; font-size: 13px; font-weight: 550; color: var(--ink2); margin: 12px 0 5px; }
.form input, .form textarea, .form select { width: 100%; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); padding: 11px 12px; font-size: 16px; outline: none; }
.form textarea { min-height: 96px; resize: vertical; }
.form input:focus, .form textarea:focus, .form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.campo-senha { position: relative; }
.campo-senha input { padding-right: 46px; }
.campo-senha .icon-btn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); }
.form .hint { font-size: 12.5px; color: var(--ink3); margin-top: 5px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
textarea.raw { min-height: 60dvh; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.4; }

@keyframes up { from { transform: translate(-50%, 28px); opacity: .5; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + 20px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: var(--r-sm); font-weight: 550; font-size: 14px; z-index: 50; max-width: calc(100% - 32px); box-shadow: 0 6px 24px rgba(12, 17, 24, .28); }
.toast.bad { background: var(--bad); color: #fff; }
/* toast com Desfazer: alvo de toque confortavel, do lado do texto */
.toast { display: flex; align-items: center; gap: 12px; }
.toast.com-undo { width: calc(100% - 32px); justify-content: space-between; }
.toast.com-undo span { flex: 1 1 auto; }
.toast .undo { background: transparent; color: var(--bg); border: 1px solid currentColor; border-radius: 8px;
  padding: 6px 12px; font-weight: 600; font-size: 14px; min-height: 36px; cursor: pointer; white-space: nowrap; }
.toast.bad .undo { color: #fff; }

.diff { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface2); border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 10px; max-height: 50dvh; overflow: auto; }
.diff .add { color: var(--ok); } .diff .del { color: var(--bad); } .diff .hunk { color: var(--accent); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; font-size: 14px; }
.kv b { color: var(--ink3); font-weight: 550; }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: rot .8s linear infinite; vertical-align: middle; }
@keyframes rot { to { transform: rotate(360deg); } }
.loading { text-align: center; padding: 40px 0; color: var(--ink3); font-size: 14px; }
.switch { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line2); gap: 12px; }
.switch:first-child { border-top: 0; }
.switch .lab { font-weight: 550; }
.switch .sub { font-size: 12.5px; color: var(--ink3); }
.tog { width: 48px; height: 28px; border-radius: 14px; background: var(--chip); border: 1px solid var(--line); position: relative; cursor: pointer; flex: none; transition: background .18s; }
.tog::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .18s; }
.tog.on { background: var(--accent); border-color: transparent; }
.tog.on::after { left: 22px; }

/* Movimento reduzido: nada anima, nem o spinner (que ganha texto ao lado no app.js). */
@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-bg { animation: none; }
  .spin { animation: none; }
  .icon-btn, .tog, .tog::after, .row, .tile { transition: none; }
}

/* Desktop: a lista deixa de ser uma coluna de celular esticada. */
@media (min-width: 640px) { .grid { grid-template-columns: repeat(4, 1fr); } .actions { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) {
  .top-row, .main { max-width: 980px; }
  .tabbar { width: min(980px, 100%); left: 50%; transform: translateX(-50%); }
}

/* Links (2026-10-05) */
.row.lk { cursor: default; }
.row.lk a.tx { color: inherit; text-decoration: none; display: block; }
.row.lk[hidden], .lk-grupo[hidden] { display: none; }
.busca-links { width: 100%; box-sizing: border-box; margin: 4px 0 6px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; font-size: 15px; }
.links-hoje { margin-top: 2px; }

/* Cofre de logins (2026-10-05) */
.cofre-it { padding: 10px 0; border-top: 1px solid var(--line2); }
.cofre-it:first-of-type { border-top: 0; }
.cofre-it .t { font-weight: 600; margin-bottom: 4px; }
.kv2 { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.kv2 span { width: 58px; flex: none; color: var(--ink3); font-size: 12.5px; }
.kv2 code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }

/* Vitrine Solvewise (2026-10-10): widgets de celular, um por app do portfolio.md. A cor vem do
   nome (--h, matiz 0-360) e o texto é sempre branco sobre gradiente escuro — o widget fica igual
   no claro e no escuro, como os da tela inicial do Android. Produto da casa ocupa a largura toda. */
.vgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.vw { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; aspect-ratio: 1 / 1; padding: 14px; border-radius: 22px; color: #fff; text-decoration: none; overflow: hidden; cursor: pointer;
  background: radial-gradient(120% 90% at 100% 0%, hsl(calc(var(--h) + 40) 75% 58% / .55), transparent 60%), linear-gradient(150deg, hsl(var(--h) 62% 40%), hsl(calc(var(--h) + 28) 70% 24%));
  box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 8px 22px -10px hsl(var(--h) 60% 30% / .7); transition: transform .12s ease; }
.vw:active { transform: scale(.97); }
.vw.largo { grid-column: span 2; aspect-ratio: auto; min-height: 150px; }
.vw.sem-link { filter: saturate(.55); }
.vw-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.vw-ic { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-weight: 750; font-size: 17px; letter-spacing: -.02em; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(6px); }
.vw-fase { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; padding: 4px 8px; border-radius: 999px; background: rgba(0,0,0,.26); white-space: nowrap; margin-bottom: 7px; }
.vw-fase i { width: 7px; height: 7px; border-radius: 50%; background: #9ff0c4; }
.vw-fase.warn i { background: #ffd27a; } .vw-fase.info i { background: #b9d3ff; }
.vw-nome { font-size: 16px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vw-sub { margin-top: 3px; font-size: 12.5px; line-height: 1.3; color: rgba(255,255,255,.82); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vw.largo .vw-nome { font-size: 19px; } .vw.largo .vw-sub { font-size: 13.5px; -webkit-line-clamp: 2; max-width: 46ch; }
.vw-mais { flex: none; margin: -6px -6px 0 0; width: 34px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #fff; }
.vw-mais .ic { width: 20px; height: 20px; }
.vw-mais:hover { background: rgba(255,255,255,.16); }
@media (min-width: 640px) { .vgrid { grid-template-columns: repeat(4, 1fr); } }
@media (prefers-reduced-motion: reduce) { .vw { transition: none; } }
.vw:not(.largo) .vw-ic { width: 40px; height: 40px; border-radius: 12px; font-size: 15px; }
.vw:not(.largo) .vw-sub { -webkit-line-clamp: 1; }

/* Caixa de decisões (D1, 2026-10-20) e as 4 telas (D2). Mesmo desenho dos botões de "lado" do contato. */
.decisao .opcoes { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.decisao .opcoes button { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--r-sm); padding: 11px 14px; font-size: 15px; min-height: 44px; cursor: pointer; }
.decisao .opcoes button.p { border-color: var(--accent); background: var(--accent-soft); }
.decisao .opcoes button:disabled { opacity: .55; cursor: not-allowed; }
.decisao .opcoes button .s { display: block; font-size: 12.5px; font-weight: 400; color: var(--ink2); margin-top: 2px; }
.decisao .actions { margin-top: 8px; }
.search.busca-link { display: flex; align-items: center; gap: 8px; color: var(--ink3); text-decoration: none; }
.app-card .kv { font-size: 13.5px; }

/* marcar vários na Fila (2026-11-04) */
.tica { flex: none; width: 44px; height: 44px; margin: -8px -8px -8px -10px; display: grid; place-items: center; cursor: pointer; }
.tica input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.grupo-acao { font-weight: 500; font-size: 13px; color: var(--ink3); white-space: nowrap; }
.grupo-acao .lk { all: unset; color: var(--accent); cursor: pointer; padding: 6px 0 6px 2px; }
.grupo-acao .lk:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.barra-lote { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px)); z-index: 29; display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--surface); border-top: 1px solid var(--line); box-shadow: var(--shadow-up); }
.barra-lote[hidden] { display: none; }
.barra-lote .lote-n { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.barra-lote.ocupada { opacity: .55; pointer-events: none; }
body.com-lote .main { padding-bottom: calc(var(--tab-h) + 96px + env(safe-area-inset-bottom, 0px)); }
