/* ═══════════════════════════════════════════════════════════════════
   Panel AVANZA™ — El compañero diario del Método AVANZA™
   Design system: tokens, base, onboarding, tela principal, componentes
   ═══════════════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────────────── */
:root {
  /* Superfícies */
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --surface-2: #F3F2EE;

  /* Tinta */
  --ink: #17170F;
  --ink-2: #5C5B54;
  --ink-3: #83827A; /* auditoria: escurecido p/ contraste legível em rótulos pequenos */

  /* Marca (dourado discreto — 3Alpha) */
  --gold: #B08D3E;
  --gold-soft: rgba(176, 141, 62, 0.12);

  /* Semáforo do método */
  --go-back: #D64545;
  --go-forward: #D9A514;
  --go-ahead: #2E9E63;
  --go-back-soft: rgba(214, 69, 69, 0.10);
  --go-forward-soft: rgba(217, 165, 20, 0.12);
  --go-ahead-soft: rgba(46, 158, 99, 0.10);

  /* Traços e sombras */
  --line: rgba(23, 23, 15, 0.08);
  --shadow-sm: 0 1px 2px rgba(23, 23, 15, 0.04), 0 2px 8px rgba(23, 23, 15, 0.04);
  --shadow-md: 0 2px 6px rgba(23, 23, 15, 0.05), 0 12px 32px rgba(23, 23, 15, 0.08);

  /* Tipografia */
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-serif, "New York", Georgia, "Times New Roman", serif;

  /* Ritmo */
  --radius: 14px;
  --radius-lg: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121210;
    --surface: #1B1B18;
    --surface-2: #232320;
    --ink: #F2F1EC;
    --ink-2: #A5A49B;
    --ink-3: #8B8A81; /* auditoria: idem, no tema escuro */
    --gold: #C9A55A;
    --gold-soft: rgba(201, 165, 90, 0.14);
    --go-back: #E06060;
    --go-forward: #E0B133;
    --go-ahead: #46B67C;
    --go-back-soft: rgba(224, 96, 96, 0.14);
    --go-forward-soft: rgba(224, 177, 51, 0.14);
    --go-ahead-soft: rgba(70, 182, 124, 0.14);
    --line: rgba(242, 241, 236, 0.09);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
  }
}

/* ── Base ───────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font: inherit; color: inherit; }
ul { list-style: none; }

.screen { min-height: 100dvh; }
[hidden] { display: none !important; }

/* Entrada suave de telas e blocos */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.55s var(--ease) both; }

/* ── Botões ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 15px 34px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), opacity 0.2s;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { box-shadow: var(--shadow-md); }
.btn-primary:disabled { opacity: 0.35; pointer-events: none; }

.btn-ghost { color: var(--ink-2); padding: 12px 20px; }
.btn-ghost:hover { color: var(--ink); }

.btn-sm { padding: 10px 20px; font-size: 14px; }

/* ═══════════════════ ONBOARDING ═══════════════════ */
.screen-onboarding {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.onboarding-shell {
  width: 100%;
  max-width: 460px;
  min-height: 78dvh;
  display: flex;
  flex-direction: column;
}

.onboarding-brand {
  text-align: center;
  padding: 28px 0 8px;
  animation: fadeUp 0.7s var(--ease) both;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  border-radius: 22px;
  background: var(--ink);
  color: var(--gold);
  margin-bottom: 18px;
  box-shadow: var(--shadow-md);
}

.brand-name {
  font-size: 15px;
  letter-spacing: 0.32em;
  color: var(--ink-2);
  font-weight: 400;
}
.brand-name strong { color: var(--ink); font-weight: 700; }
.brand-name .tm { font-size: 9px; vertical-align: super; letter-spacing: 0; }

.brand-tagline {
  margin-top: 8px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-2);
}

.ob-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 0;
}

.ob-question {
  font-family: var(--font-display);
  font-size: clamp(26px, 6vw, 32px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.ob-hint {
  color: var(--ink-2);
  font-size: 15px;
  margin-bottom: 28px;
}

.ob-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-size: 18px;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.3s var(--ease);
}
.ob-input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.ob-input::placeholder { color: var(--ink-3); }

input[type="time"].ob-input { font-variant-numeric: tabular-nums; }

.ob-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
}
.ob-actions:has(.btn-primary:only-child) { justify-content: flex-end; }

/* Seleção de idioma */
.lang-list { display: flex; flex-direction: column; gap: 12px; }

.lang-option {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  font-size: 17px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), border-color 0.2s, box-shadow 0.25s var(--ease);
}
.lang-option:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.lang-option:active { transform: scale(0.98); }
.lang-flag { font-size: 24px; }

/* Lembretes (chips de horários) */
.reminder-row { display: flex; gap: 10px; }
.reminder-row .ob-input { flex: 1; }
.reminder-row .btn { flex-shrink: 0; }

.reminder-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold-soft);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  animation: fadeUp 0.3s var(--ease) both;
}
.chip button { color: var(--ink-2); font-size: 15px; line-height: 1; padding: 6px 8px; margin: -6px -8px -6px -2px; }
.chip button:hover { color: var(--go-back); }

/* Indicador de progresso do onboarding */
.ob-footer { padding: 24px 0 8px; display: flex; justify-content: center; }
.ob-dots { display: flex; gap: 8px; }
.ob-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--line);
  transition: background 0.3s, transform 0.3s var(--ease);
}
.ob-dot.active { background: var(--gold); transform: scale(1.25); }
.ob-dot.done { background: var(--ink-3); }

/* Boas-vindas finais */
.ob-welcome { text-align: center; }
.ob-welcome .ob-question { margin-bottom: 14px; }
.ob-welcome .ob-hint { margin-bottom: 36px; }

/* ═══════════════════ TELA PRINCIPAL ═══════════════════ */
.main-shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 20px calc(48px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 2px 26px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.26em;
  color: var(--ink-2);
}
.topbar-brand strong { color: var(--ink); }
.topbar-brand svg { color: var(--gold); }

.topbar-method {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-3);
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

.settings-link {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  transition: color 0.2s, background 0.2s, transform 0.4s var(--ease);
}
.settings-link:hover { color: var(--ink); background: var(--surface-2); transform: rotate(40deg); }

/* Saudação */
.hero { padding: 6px 2px 24px; animation: fadeUp 0.6s var(--ease) both; }

.greeting {
  font-family: var(--font-display);
  font-size: clamp(30px, 7vw, 40px);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.today-date {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 15px;
  text-transform: capitalize;
}

/* Frase do dia (Método AVANZA™) */
.daily-phrase {
  margin-top: 14px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-2);
  animation: fadeUp 0.7s var(--ease) 0.15s both;
}

/* Indicadores */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
  animation: fadeUp 0.6s var(--ease) 0.08s both;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

/* Banner de lembrete */
.reminder-banner {
  background: var(--gold-soft);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14.5px;
  margin-bottom: 24px;
  animation: fadeUp 0.5s var(--ease) both;
}

/* Seções de tarefas */
.tasks-section { margin-bottom: 30px; animation: fadeUp 0.6s var(--ease) 0.14s both; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 2px 12px;
}
.section-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.section-sub { font-size: 12.5px; color: var(--ink-3); }

.task-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.task-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px 8px 20px;
  border-bottom: 1px solid var(--line);
  transition: background 0.3s;
}
.task-row:last-child { border-bottom: none; }
.task-row.is-ahead { background: var(--go-ahead-soft); }

.task-name {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
  padding: 12px 0;
}
.task-name::placeholder { color: var(--ink-3); font-weight: 400; }
.task-row.is-ahead .task-name { color: var(--ink-2); }

/* ⭐ Prioridade Principal do Dia (indicador dourado discreto) */
#list-required .task-row { padding-left: 10px; }

.focus-btn {
  width: 30px;
  height: 42px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  opacity: 0.4;
  transition: opacity 0.2s, color 0.2s, transform 0.25s var(--ease);
}
.focus-btn svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.focus-btn:hover { opacity: 1; transform: scale(1.1); }
.focus-btn.active { color: var(--gold); opacity: 1; }
.focus-btn.active svg { fill: currentColor; }
.focus-btn.unnamed { visibility: hidden; }
.focus-btn.just-set { animation: statusPulse 0.45s var(--ease); }

.task-row.is-focus { box-shadow: inset 3px 0 0 var(--gold); }

/* Dica de primeiro uso (some para sempre após o primeiro toque) */
.status-hint {
  font-size: 13px;
  color: var(--ink-3);
  padding: 10px 4px 0;
  text-align: right;
  animation: fadeUp 0.6s var(--ease) 0.4s both;
}

/* Semáforo GO BACK / GO FORWARD / GO AHEAD */
.status-group { display: flex; gap: 6px; flex-shrink: 0; }

.status-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s var(--ease), background 0.25s;
  position: relative;
}
.status-btn::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid;
  transition: all 0.25s var(--ease);
}
.status-btn.s-back::before    { border-color: var(--go-back); }
.status-btn.s-forward::before { border-color: var(--go-forward); }
.status-btn.s-ahead::before   { border-color: var(--go-ahead); }

.status-btn:hover { transform: scale(1.12); }
.status-btn:active { transform: scale(0.92); }

.status-btn.active::before { width: 16px; height: 16px; border-width: 0; }
.status-btn.s-back.active    { background: var(--go-back-soft); }
.status-btn.s-back.active::before    { background: var(--go-back); }
.status-btn.s-forward.active { background: var(--go-forward-soft); }
.status-btn.s-forward.active::before { background: var(--go-forward); }
.status-btn.s-ahead.active   { background: var(--go-ahead-soft); }
.status-btn.s-ahead.active::before   { background: var(--go-ahead); }

@keyframes statusPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.status-btn.just-set::before { animation: statusPulse 0.45s var(--ease); }

/* Placar */
.scoreboard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  animation: fadeUp 0.6s var(--ease) 0.2s both;
}

.score-counts { display: flex; gap: 22px; }

.count {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.count span {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 7px;
}
.count label { font-size: 10px; letter-spacing: 0.1em; color: var(--ink-3); font-weight: 600; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-ahead   { background: var(--go-ahead); }
.dot-forward { background: var(--go-forward); }
.dot-back    { background: var(--go-back); }

.score-daily { text-align: right; }
.score-daily-label { display: block; font-size: 11.5px; color: var(--ink-3); margin-bottom: 2px; }
.score-daily-value {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

@keyframes scoreBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.score-daily-value.bump { display: inline-block; animation: scoreBump 0.4s var(--ease); }

/* Nota de avanço */
.advance-note {
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  color: var(--ink-2);
  padding: 26px 0 4px;
  animation: fadeUp 0.7s var(--ease) both;
}

.main-footer { padding-top: 40px; text-align: center; }
.footer-method {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

/* ── Evolução (histórico + indicadores) ─────────────────────────── */
.evo-link-row { display: flex; justify-content: flex-end; margin: -16px 0 24px; }

.evo-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 6px 2px;
  transition: color 0.2s;
}
.evo-link:hover { color: var(--gold); }

.hist-back {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 2px;
  transition: color 0.2s;
}
.hist-back:hover { color: var(--ink); }

.evo-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 16px 10px;
  margin-bottom: 24px;
  animation: fadeUp 0.6s var(--ease) both;
}

.evo-chart { width: 100%; height: auto; display: block; }

.evo-empty {
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-2);
  padding: 30px 16px;
}

.stats-row-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .stats-row-4 { grid-template-columns: repeat(4, 1fr); } }

/* Alternância Diário / Semanal / Mensal */
.seg-control {
  display: flex;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  margin: 4px 0 18px;
}

.seg-btn {
  flex: 1;
  text-align: center;
  padding: 9px 0;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background 0.25s var(--ease), color 0.2s, box-shadow 0.25s;
}
.seg-btn.active { background: var(--ink); color: var(--bg); box-shadow: var(--shadow-sm); }

.hist-content { animation: fadeUp 0.45s var(--ease) both; }

/* Lista diária */
.hist-day-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.hist-day-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.hist-day-row:last-child { border-bottom: none; }

.hist-day-date { flex: 1; font-size: 15px; text-transform: capitalize; }

.hist-day-counts {
  display: flex;
  gap: 12px;
  font-size: 13.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.hist-day-counts i { margin-right: 5px; }

.hist-day-score {
  min-width: 36px;
  text-align: right;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.hist-day-score.has-score { color: var(--gold); }

/* Cartões de período (semana / mês) */
.period-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
  margin-bottom: 14px;
}

.period-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.period-title { font-size: 16px; font-weight: 700; text-transform: capitalize; }
.period-score {
  font-size: 24px;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.period-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 12px;
}
.period-item { display: flex; flex-direction: column; gap: 1px; }
.period-item b {
  font-size: 16px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-transform: capitalize;
}
.period-item span { font-size: 11.5px; color: var(--ink-3); }

@media (max-width: 420px) { .period-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── Convite noturno + ações do dia ─────────────────────────────── */
.close-invite {
  width: 100%;
  text-align: left;
  background: var(--gold-soft);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 22px 0 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14.5px;
  color: var(--ink-2);
  animation: fadeUp 0.5s var(--ease) both;
  transition: transform 0.25s var(--ease);
}
.close-invite:hover { transform: translateY(-2px); }
.close-invite strong {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  color: var(--ink);
}

.day-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 26px 0 4px;
}

/* ── Cierre del Día (overlay) ───────────────────────────────────── */
.closure-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 60;
  overflow-y: auto;
  animation: fadeUp 0.4s var(--ease) both;
}

.closure-shell {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.closure-dismiss {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 22px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}
.closure-dismiss:hover { color: var(--ink); background: var(--surface-2); }
.closure-shell { position: relative; }

.closure-header { text-align: center; padding: 36px 0 8px; }

.closure-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.closure-subtitle { margin-top: 6px; color: var(--ink-2); font-size: 14.5px; }

.cl-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 0;
}

.cl-label {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-soft);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 16px;
}

.cl-question {
  font-family: var(--font-display);
  font-size: clamp(24px, 6vw, 29px);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 24px;
}

.cl-textarea {
  width: 100%;
  min-height: 116px;
  resize: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 16.5px;
  line-height: 1.5;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.3s var(--ease);
  font-family: var(--font-ui);
}
.cl-textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.cl-textarea::placeholder { color: var(--ink-3); }

.cl-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 26px;
}
.cl-actions:has(.btn-primary:only-child) { justify-content: flex-end; }

.cl-final { text-align: center; }
.cl-final .cl-question { margin-bottom: 10px; }
.cl-final-text { color: var(--ink-2); font-size: 15.5px; margin-bottom: 8px; }
.cl-final-score {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  display: block;
  margin: 18px 0 30px;
}

/* ── Cartão do dia encerrado ────────────────────────────────────── */
.closure-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  margin-top: 26px;
  animation: fadeUp 0.5s var(--ease) both;
}

.closure-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.closed-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-soft);
  border-radius: 999px;
  padding: 6px 14px;
}

.closure-points {
  font-size: 14px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.closure-answers { margin: 0 0 6px; }
.closure-answers dt {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 14px;
}
.closure-answers dd { font-size: 15.5px; margin-top: 3px; line-height: 1.5; }

.closure-card-actions { padding-top: 16px; text-align: center; }

.newday-note {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15.5px;
  color: var(--ink-2);
  animation: fadeUp 0.5s var(--ease) both;
}

/* ── Ajustes ────────────────────────────────────────────────────── */
.set-group { margin-bottom: 26px; animation: fadeUp 0.5s var(--ease) both; }

.set-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.set-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

#set-langs .seg-btn { padding: 10px 0; }

/* ── Banner de instalação ───────────────────────────────────────── */
.install-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  animation: fadeUp 0.5s var(--ease) both;
  z-index: 50;
}
.install-text { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.install-text span { color: var(--ink-2); font-size: 13px; }
.install-actions { display: flex; gap: 6px; }

/* ── Responsividade fina ────────────────────────────────────────── */
@media (max-width: 420px) {
  .score-counts { gap: 16px; }
  .status-btn { width: 40px; height: 40px; }
  .status-group { gap: 2px; }
  .task-row { padding-left: 16px; gap: 8px; }
}

/* ── Momento GO AHEAD (celebração sóbria, uma vez por dia) ──────── */
.goahead-moment {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.goahead-moment::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0.92;
}
.goahead-moment::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, var(--gold-soft), transparent 55%);
}
.goahead-moment.play { animation: goaheadFade 2.6s var(--ease) both; }

.goahead-inner { position: relative; z-index: 1; text-align: center; padding: 0 24px; }
.goahead-moment.play .goahead-inner { animation: goaheadRise 2.6s var(--ease) both; }

.goahead-title {
  display: block;
  font-size: clamp(34px, 9vw, 46px);
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--gold);
  margin-bottom: 10px;
}
.goahead-sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-2);
}

@keyframes goaheadFade {
  0% { opacity: 0; }
  14% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes goaheadRise {
  0% { transform: translateY(12px) scale(0.97); }
  20% { transform: none; }
}

/* ── Campos editáveis: cursor e seleção com identidade ──────────── */
input, textarea { caret-color: var(--gold); }
::selection { background: var(--gold-soft); }

.task-row:focus-within { background: var(--surface-2); }
.task-row.is-ahead:focus-within { background: var(--go-ahead-soft); }

/* ── Acessibilidade: usuários que preferem menos movimento ──────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
