:root {
  --bg: oklch(1 0 0);
  --surface: oklch(0.97 0.006 235);
  --border: oklch(0.855 0.018 235);
  --ink: oklch(0.20 0.022 235);
  --muted: oklch(0.40 0.028 235);
  --blue: oklch(0.48 0.12 230);
  --blue-hover: oklch(0.41 0.12 230);
  --blue-tint: oklch(0.938 0.032 230);
  --orange: oklch(0.55 0.16 45);
  --orange-hover: oklch(0.48 0.155 45);
  --orange-ink: oklch(0.42 0.135 50);
  --orange-tint: oklch(0.93 0.06 60);
  --danger: oklch(0.50 0.18 25);
  --danger-tint: oklch(0.94 0.04 25);
  --ok-ink: oklch(0.34 0.105 155);
  --ok-tint: oklch(0.93 0.065 155);
  --warn-ink: oklch(0.38 0.10 70);
  --warn-tint: oklch(0.94 0.075 85);
  --azul-escuro: oklch(0.36 0.085 240); /* faixa do cabecalho e rodape */
  --ambar: oklch(0.82 0.135 68);        /* laranja claro, legivel sobre azul escuro */
  --primary: var(--blue); /* links, foco, cabeçalho de tabela */
  --radius: 14px;
  --z-modal: 100;
  --z-toast: 200;
  --shadow: 0 1px 2px oklch(0.2 0.02 235 / .06), 0 6px 20px oklch(0.2 0.02 235 / .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: oklch(0.925 0.020 235);
}
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
a { color: var(--primary); }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
.btn:disabled {
  opacity: 1;
  background: oklch(0.945 0.004 235);
  color: oklch(0.62 0.012 235);
  border-color: oklch(0.90 0.008 235);
  box-shadow: none;
}
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 1.25rem; }

/* ── Header ──
   Faixa azul solida: da identidade ao site e impede que a pagina
   vire um amontoado de caixas brancas sobre fundo quase branco. */
header.site {
  background: var(--azul-escuro);
  border-bottom: 4px solid var(--orange);
  padding: 2rem 0 1.7rem;
  color: #fff;
}
header.site .wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1rem; }
header.site h1 { font-size: 1.75rem; font-weight: 750; margin: 0; letter-spacing: -0.01em; color: #fff; }
header.site h1 .brand-blue { color: #fff; }
header.site h1 .brand-orange { color: var(--ambar); }
.badge-free {
  font-size: .78rem; font-weight: 650;
  color: var(--ambar); background: oklch(1 0 0 / .13);
  border: 1px solid oklch(1 0 0 / .28);
  padding: .22rem .65rem; border-radius: 99px;
}
header.site p.tagline {
  flex-basis: 100%; margin: .35rem 0 0;
  color: oklch(0.92 0.02 235); max-width: 70ch;
}

/* ── Backup notice ── */
.notice {
  background: var(--blue-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .8rem 1.1rem;
  margin: 1.5rem 0;
  font-size: .92rem;
}
.notice strong { font-weight: 650; color: var(--blue-hover); }

/* ── Cards / timers ── */
.timers { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
/* Card branco = contraste máximo para tudo que está dentro.
   A cor identifica o card numa faixa no topo e no título. */
.card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.35rem 1.6rem;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 5px;
  background: var(--card-accent, var(--blue));
}
.card-jornada { --card-accent: var(--blue); }
.card-atividades { --card-accent: var(--orange); }
.card h2 { font-size: 1.1rem; font-weight: 700; color: var(--card-accent); }
.card p.hint { color: var(--muted); font-size: .88rem; margin-bottom: 1rem; }
.clock {
  font-size: 2.8rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .015em;
  margin: .25rem 0 .35rem;
  transition: color .2s ease-out;
}
.clock.running { color: var(--blue); }
.clock.paused { color: var(--orange); }
.pill {
  display: inline-block; font-size: .72rem; font-weight: 700;
  letter-spacing: .04em; padding: .22rem .65rem; border-radius: 99px;
  background: var(--surface); color: var(--muted);
  transition: background .18s ease-out, color .18s ease-out;
}
.pill.running { background: var(--ok-tint); color: var(--ok-ink); }
.pill.paused  { background: var(--warn-tint); color: var(--warn-ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.btn {
  position: relative;
  border-radius: 10px; padding: .6rem 1.25rem; font-weight: 650; font-size: .9rem;
  border: 1px solid transparent;
  transition: background .15s ease-out, border-color .15s ease-out,
              box-shadow .15s ease-out, transform .1s ease-out;
  --sb-line: oklch(0.82 0.07 230);
}
.btn:not(:disabled):active { transform: translateY(1px); }
/* Preenchido: ação principal. Herda a cor do card em que está. */
.btn-primary {
  background: var(--card-accent, var(--orange)); color: #fff;
  box-shadow: 0 2px 6px oklch(0.4 0.08 60 / .28);
  --sb-line: oklch(0.95 0.06 60);
}
.btn-primary:not(:disabled):hover { filter: brightness(0.9); box-shadow: 0 3px 10px oklch(0.4 0.08 60 / .38); }
.btn-blue {
  background: var(--blue); color: #fff;
  box-shadow: 0 2px 6px oklch(0.48 0.12 230 / .3);
  --sb-line: oklch(0.9 0.06 230);
}
.btn-blue:not(:disabled):hover { background: var(--blue-hover); box-shadow: 0 3px 10px oklch(0.48 0.12 230 / .4); }
/* Contornado: ação secundária. Borda escura o bastante para ler como botão. */
.btn-outline {
  background: var(--bg); color: var(--ink);
  border-color: oklch(0.58 0.025 235); border-width: 1.5px;
}
.btn-outline:not(:disabled):hover { border-color: var(--blue); color: var(--blue-hover); background: var(--blue-tint); }
.btn-danger {
  background: var(--bg); color: var(--danger);
  border-color: oklch(0.62 0.15 25); border-width: 1.5px;
  --sb-line: oklch(0.75 0.12 25);
}
.btn-danger:not(:disabled):hover { background: var(--danger-tint); border-color: var(--danger); }

/* Brilho especular na borda, seguindo o mouse (versão CSS do SpecularButton) */
.btn::after {
  content: ""; position: absolute; inset: -2px; border-radius: 12px;
  padding: 2px; pointer-events: none;
  background: conic-gradient(from calc(var(--sb-a, 0deg) - 32deg),
    transparent 0deg, var(--sb-line) 32deg, transparent 64deg,
    transparent 180deg, var(--sb-line) 212deg, transparent 244deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: var(--sb-o, 0);
  transition: opacity .2s ease-out;
}
.btn:disabled::after { display: none; }
.field { margin-top: .6rem; }
.field label { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: .2rem; }
.field input {
  width: 100%; padding: .5rem .7rem; font: inherit; font-size: .92rem;
  border: 1px solid var(--border); border-radius: 8px; color: var(--ink); background: var(--bg);
}
.field input::placeholder { color: var(--muted); }

/* ── Ad slot (fica oculto até o AdSense ser configurado) ── */

/* ── History ── */
section.history {
  margin: 2.25rem 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.5rem 1.25rem;
}
.hist-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.tabs { display: flex; gap: .25rem; background: var(--surface); border: 1px solid var(--border); border-radius: 99px; padding: .2rem; }
.tabs button {
  border: 0; background: transparent; color: var(--muted);
  border-radius: 99px; padding: .4rem .9rem; font-size: .88rem; font-weight: 600;
  transition: background .15s ease-out, color .15s ease-out;
}
.tabs button[aria-selected="true"] { background: var(--blue); color: #fff; box-shadow: var(--shadow); }
.tabs button[aria-selected="true"] .count { color: oklch(0.88 0.04 230); }
.tabs .count { font-weight: 400; color: var(--muted); font-size: .8rem; }
.hist-head .exports { margin-left: auto; display: flex; gap: .5rem; }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .87rem; min-width: 680px; }
thead th {
  text-align: left; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--blue-hover); font-weight: 700;
  background: var(--blue-tint);
  padding: .6rem .75rem; border-bottom: 2px solid oklch(0.66 0.09 230);
  white-space: nowrap;
}
tbody td { padding: .55rem .75rem; border-bottom: 1px solid var(--border); vertical-align: top; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: var(--surface); }
tbody tr:hover { background: var(--blue-tint); }
td .sub { color: var(--muted); font-size: .8rem; }
td.actions { white-space: nowrap; text-align: right; }
td.actions button {
  border: 0; background: transparent; color: var(--muted);
  padding: .15rem .35rem; border-radius: 6px; font-size: .82rem;
}
td.actions button:hover { color: var(--ink); background: var(--border); }
td.actions button.del:hover { color: var(--danger); background: var(--danger-tint); }
.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); font-size: .92rem; }
.hist-foot { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin-top: .6rem; font-size: .85rem; color: var(--muted); }
.hist-foot .clear { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: .82rem; text-decoration: underline; padding: .2rem; }
.hist-foot .clear:hover { color: var(--danger); }

/* ── Info / FAQ ── */
section.info {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 2rem;
}
section.info .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem 2.5rem; }
section.info h2 { font-size: 1rem; }
section.info p, section.info li { font-size: .92rem; color: var(--muted); max-width: 65ch; }
section.info ol { padding-left: 1.2rem; margin: 0; }
details { border-bottom: 1px solid var(--border); padding: .55rem 0; }
details summary { cursor: pointer; font-size: .92rem; font-weight: 600; color: var(--ink); }
details p { margin: .5rem 0 .25rem; }

/* ── Footer ── */
footer.site {
  background: var(--azul-escuro);
  border-top: 4px solid var(--orange);
  margin-top: 2rem; padding: 1.5rem 0 2rem;
  font-size: .85rem; color: oklch(0.88 0.02 235);
}
footer.site .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
footer.site button.link { border: 0; background: none; color: var(--ambar); text-decoration: underline; padding: 0; font-size: inherit; cursor: pointer; }

/* ── Dialogs ── */
dialog {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 0; max-width: min(640px, calc(100vw - 2rem));
  color: var(--ink);
  box-shadow: 0 10px 40px oklch(0.2 0.02 235 / .2);
}
dialog::backdrop { background: oklch(0.2 0.02 235 / .45); }
.dlg-body { padding: 1.5rem; max-height: min(65vh, 560px); overflow-y: auto; }
.dlg-body h2 { font-size: 1.15rem; }
.dlg-body h3 { font-size: .95rem; margin-top: 1.25rem; }
.dlg-body p, .dlg-body li { font-size: .9rem; color: var(--ink); }
.dlg-body ul { padding-left: 1.2rem; }
.dlg-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
  padding: 1rem 1.5rem; border-top: 1px solid var(--border); background: var(--surface);
  border-radius: 0 0 12px 12px;
}
.dlg-foot label { display: flex; align-items: flex-start; gap: .5rem; font-size: .85rem; }
.dlg-foot label input { margin-top: .2rem; }
.dlg-foot .btn { margin-left: auto; }
.warn-box {
  background: var(--warn-tint); color: var(--warn-ink);
  border-radius: 8px; padding: .7rem .9rem; font-size: .88rem; font-weight: 500;
}

/* ── Toast ── */
#toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: var(--bg);
  padding: .6rem 1.1rem; border-radius: 8px; font-size: .88rem;
  opacity: 0; pointer-events: none; z-index: var(--z-toast);
  transition: opacity .2s ease-out, transform .2s ease-out;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Popup de pausa ── */
.pause-pop {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: grid; place-items: center; padding: 1rem;
  background: oklch(0.25 0.03 235 / .4);
}
.pause-pop[hidden] { display: none; }
.pause-card {
  background: oklch(0.93 0.115 98);
  border: 2px solid oklch(0.78 0.14 90);
  color: oklch(0.30 0.075 85);
  border-radius: 16px;
  box-shadow: 0 12px 48px oklch(0.2 0.05 90 / .35);
  max-width: 26rem; width: 100%;
  padding: 1.75rem 1.5rem;
  text-align: center;
  animation: pausePulse 2.2s ease-in-out infinite;
}
@keyframes pausePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}
.pause-card .pause-icon { font-size: 2.4rem; line-height: 1; }
.pause-card h3 { font-size: 1.25rem; margin: .5rem 0 .4rem; color: oklch(0.25 0.07 85); }
.pause-card p { font-size: .95rem; margin-bottom: 1.1rem; }
.pause-card .clock-mini { font-variant-numeric: tabular-nums; font-weight: 750; }
.pause-card .btn-row { justify-content: center; margin-top: 0; }
.pause-card .btn-ghost {
  border: 0; background: none; color: oklch(0.38 0.07 85);
  text-decoration: underline; font-size: .85rem; padding: .5rem;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ── Menu de navegação (compartilhado entre as páginas) ── */
nav.menu { margin-top: .9rem; flex-basis: 100%; }
nav.menu ul {
  display: flex; flex-wrap: wrap; gap: .35rem;
  list-style: none; margin: 0; padding: 0;
}
nav.menu a {
  /* min-height 44px: area de toque confortavel no celular */
  display: flex; align-items: center; min-height: 44px;
  padding: .4rem .85rem;
  font-size: .89rem; font-weight: 600;
  color: var(--muted); text-decoration: none;
  border-radius: 8px;
  transition: background .15s ease-out, color .15s ease-out;
}
/* Menu vive dentro da faixa azul: cores claras */
nav.menu a { color: oklch(0.90 0.02 235); }
nav.menu a:hover { background: oklch(1 0 0 / .15); color: #fff; }
nav.menu a[aria-current="page"] { background: #fff; color: var(--azul-escuro); }

/* ── Páginas de conteúdo (contato, doação) ── */
.pagina {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.6rem;
  margin: 1.5rem 0;
}
.pagina > h2 { font-size: 1.35rem; font-weight: 700; }
.pagina > p, .pagina li { max-width: 68ch; }
.pagina h3 { font-size: 1.02rem; margin-top: 1.5rem; color: var(--blue); }
.pagina h3:first-of-type { margin-top: 1rem; }

/* Caixa de destaque para e-mail e chave PIX */
.destaque {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: .85rem 1rem;
  margin: .75rem 0 1.25rem;
}
.destaque code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 1rem; font-weight: 600; color: var(--ink);
  word-break: break-all;
}
.destaque .btn { margin-left: auto; }

/* Motivos / itens com ícone */
.lista-icones { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .85rem; }
.lista-icones li { display: flex; gap: .7rem; align-items: flex-start; font-size: .95rem; }
.lista-icones .ico { font-size: 1.15rem; line-height: 1.3; flex-shrink: 0; }

/* Aviso de que a doação é voluntária */
.aviso-suave {
  background: var(--blue-tint);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .85rem 1rem;
  font-size: .9rem;
  margin-top: 1.5rem;
}

/* Links do rodapé com o mesmo peso do botão de termos */
footer.site a { color: var(--ambar); text-decoration: underline; }

/* Marcador de versao: permite saber na hora qual versao esta no ar */
.versao { opacity: .6; font-size: .78rem; }
