/* Dias Úteis — design system do protótipo */

/* A Inter é alojada aqui, não pedida ao Google — ver D40. Este @import
 * apontava para fonts.googleapis.com, o que entregava o IP de cada
 * visitante ao Google em todas as páginas, antes de qualquer banner de
 * consentimento. O ficheiro vem de build/obter_fontes.py. */
@import url('./fonts/inter.css');

:root {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-soft-2: #f1f5f9;
  --ink: #0f172a;
  --ink-muted: #64748b;
  --ink-faint: #94a3b8;
  --border: #e2e8f0;

  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --primary-2: #7c3aed;
  --btn-secondary-hover: #e0e7ff;

  --accent: #f97316;
  --accent-dark: #ea580c;
  --accent-soft: #fff7ed;

  --success: #10b981;
  --success-soft: #ecfdf5;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 1px rgba(15, 23, 42, .04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, .08);
  --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, .22);

  --container: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Rede de segurança: scroll horizontal "ligeiro" reportado num Oppo
     Find N5 (foldable) na página de Sintra, sem nenhum elemento a
     ultrapassar o ecrã numa varredura automática a 10 larguras — cheira
     a arredondamento de sub-pixel específico do aparelho/browser, não a
     um elemento identificável. `.table-wrap` e `.tab-row` continuam com
     o próprio overflow-x interno, não são afetados por isto. */
}

img, svg { display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 72px 0; }
.section-soft { background: var(--bg-soft); }
.section-tight { padding: 48px 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 6px 12px;
  border-radius: 999px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.brand-mark svg { width: 18px; height: 18px; stroke: white; }

.brand small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-faint);
  letter-spacing: .01em;
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

nav.main-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-muted);
  transition: all .15s ease;
}

nav.main-nav a:hover { color: var(--ink); background: var(--bg-soft-2); }
nav.main-nav a.active { color: var(--primary); background: var(--primary-soft); }

.header-cta {
  flex-shrink: 0;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
  white-space: nowrap;
}

.btn svg { width: 18px; height: 18px; }

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 14px rgba(249, 115, 22, .35);
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }

.btn-secondary {
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.btn-secondary:hover { background: var(--btn-secondary-hover); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--ink-muted); }

.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 80px;
}

.hero::before {
  content: '';
  position: absolute;
  top: -180px;
  right: -160px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 70, 229, .16), transparent 70%);
  filter: blur(10px);
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -220px;
  left: -180px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249, 115, 22, .14), transparent 70%);
  filter: blur(10px);
  z-index: 0;
}

.hero .container { position: relative; z-index: 1; }

.hero-content { max-width: 680px; }

.hero h1 {
  font-size: 56px;
  margin: 18px 0 20px;
}

.hero p.lead {
  font-size: 19px;
  color: var(--ink-muted);
  max-width: 540px;
  margin-bottom: 32px;
}

.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }

/* ---------- Info / status chip card ---------- */

.chip-card {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: white;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-md);
  padding: 14px 20px;
}

.chip-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--success-soft);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chip-icon svg { width: 20px; height: 20px; }

.chip-card .chip-label { font-size: 12px; color: var(--ink-faint); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.chip-card .chip-value { font-size: 15px; font-weight: 700; }

.chip-count {
  margin-left: 6px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}

@media (max-width: 560px) {
  .chip-card { flex-wrap: wrap; padding: 18px 20px !important; }
  .chip-card > div { flex: 1 1 auto; min-width: 0; }
  .chip-card .chip-value { font-size: 16px !important; }
  .chip-count { margin-left: 0; margin-top: 10px; flex-basis: 100%; }
}

/* ---------- Section headings ---------- */

.section-head {
  max-width: 620px;
  margin: 0 auto 44px;
  text-align: center;
}

.section-head h2 { font-size: 34px; margin-bottom: 12px; }
.section-head p { color: var(--ink-muted); font-size: 16px; }

.section-head.align-left { margin: 0 0 36px; text-align: left; }

/* ---------- Cards / grids ---------- */

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.card-icon svg { width: 22px; height: 22px; }

.card h3 { font-size: 17px; margin-bottom: 8px; }
.card p { color: var(--ink-muted); font-size: 14.5px; }

/* Year selector cards */

.year-card {
  text-align: center;
  padding: 26px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: white;
  position: relative;
}
.year-card .year-num { font-size: 28px; font-weight: 800; }
.year-card .year-tag {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--ink-faint);
}
.year-card.is-current {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .08);
}
.year-card.is-current .year-num { color: var(--primary-dark); }
.year-card.is-current .year-tag { color: var(--primary); }
.year-card.is-next .year-tag { color: var(--accent-dark); }

/* Bridge / ponte cards */

.ponte-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: white;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ponte-card.featured {
  background: linear-gradient(135deg, #eef2ff, #fff7ed);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}

.ponte-dates { font-size: 13px; color: var(--ink-muted); font-weight: 600; }
.ponte-title { font-size: 19px; font-weight: 800; }

.ponte-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-pill {
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
}
.stat-pill.spend { background: var(--accent-soft); color: var(--accent-dark); }
.stat-pill.gain { background: var(--success-soft); color: var(--success); }

/* ---------- Bloco de descanso (mini-calendário, página de município) ---------- */
.bloco-calendario {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 460px;
  margin: 16px auto 0;
}
.bloco-dia {
  flex: 1 1 0;
  min-width: 42px;
  text-align: center;
  padding: 9px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
}
.bloco-dia-semana {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--ink-faint);
  margin-bottom: 4px;
}
.bloco-dia-numero { display: block; font-size: 16px; font-weight: 700; color: var(--ink); }
.bloco-dia.descanso { background: var(--success-soft); border-color: transparent; }
.bloco-dia.descanso .bloco-dia-semana,
.bloco-dia.descanso .bloco-dia-numero { color: var(--success); }
.bloco-dia.municipal { background: var(--primary); border-color: transparent; }
.bloco-dia.municipal .bloco-dia-semana,
.bloco-dia.municipal .bloco-dia-numero { color: white; }
.bloco-dia.proposta { background: var(--accent-soft); border: 1px dashed var(--accent); }
.bloco-dia.proposta .bloco-dia-semana,
.bloco-dia.proposta .bloco-dia-numero { color: var(--accent-dark); }

/* ---------- Table ---------- */

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: var(--shadow-sm);
}

table { width: 100%; border-collapse: collapse; }

thead th {
  text-align: left;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--ink-faint);
  background: var(--bg-soft);
  padding: 14px 20px;
  font-weight: 700;
}

tbody td {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 14.5px;
}

tbody tr:hover { background: var(--bg-soft); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.day-name { color: var(--ink-faint); font-weight: 500; }

/* ---------- Tabs (year switcher) ---------- */

.tab-row {
  display: flex;
  gap: 6px;
  background: var(--bg-soft-2);
  padding: 6px;
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  margin-bottom: 32px;
  /* Continua a poder deslizar quando não cabe, mas sem a barra à vista:
     dentro de um botão em forma de cápsula, o Android desenha-a por
     cima do conteúdo e parece um defeito. */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tab-row::-webkit-scrollbar { display: none; }

.rotulo-curto { display: none; }
.tab-row a, .tab-row button { flex-shrink: 0; }
.tab-row a, .tab-row button {
  padding: 9px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-muted);
  border: none;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}
.tab-row a.active, .tab-row button.active { background: white; color: var(--primary-dark); box-shadow: var(--shadow-sm); }

/* ---------- Breadcrumb ---------- */

.breadcrumb {
  font-size: 13.5px;
  color: var(--ink-faint);
  margin-bottom: 20px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.breadcrumb a { color: var(--ink-muted); font-weight: 600; }
.breadcrumb a:hover { color: var(--primary); }

/* ---------- Download CTA banner ---------- */

.cta-banner {
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  padding: 36px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin: 40px 0;
  box-shadow: var(--shadow-lg);
}
.cta-banner h3 { font-size: 22px; margin-bottom: 6px; }
.cta-banner p { color: rgba(255,255,255,.82); font-size: 14.5px; }
.cta-banner .btn-primary { background: white; color: var(--primary-dark); box-shadow: none; }
.cta-banner .btn-primary:hover { background: #f1f5f9; }

/* ---------- FAQ ---------- */

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 20px;
  margin-bottom: 12px;
  background: white;
}
.faq-item summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 700;
  font-size: 15px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 20px;
  color: var(--ink-faint);
  font-weight: 400;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item p { padding-bottom: 18px; color: var(--ink-muted); font-size: 14.5px; }

/* ---------- Article body (long-form content pages) ---------- */

.article-meta { color: var(--ink-faint); font-size: 13.5px; font-weight: 600; margin: 0 0 8px; }

.article-body { font-size: 17px; line-height: 1.7; color: var(--ink-muted); }
.article-body h2 {
  font-size: 24px;
  color: var(--ink);
  margin: 44px 0 16px;
  letter-spacing: -0.01em;
}
.article-body h2:first-of-type { margin-top: 8px; }
.article-body p { margin: 0 0 20px; }
.article-body ul { margin: 0 0 20px; padding-left: 22px; }
.article-body li { margin-bottom: 10px; }
.article-body strong { color: var(--ink); }
.article-body a { color: var(--primary); font-weight: 600; text-underline-offset: 2px; text-decoration: underline; text-decoration-color: var(--primary-soft); }
.article-body a:hover { text-decoration-color: var(--primary); }
.article-body .table-wrap { margin: 8px 0 28px; color: var(--ink); }
.article-body .cta-banner { margin: 32px 0; }

@media (max-width: 640px) {
  .article-body { font-size: 16px; }
}

/* ---------- Form (calculator) ---------- */

.calc-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 36px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 16px; align-items: end; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 8px;
}
.field input, .field select {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: white;
}
.field input:focus, .field select:focus { outline: 2px solid var(--primary); border-color: transparent; }

.result-panel {
  margin-top: 28px;
  padding: 32px;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}
.result-main .num { font-size: 48px; font-weight: 800; color: var(--primary-dark); }
.result-main .label { color: var(--ink-muted); font-weight: 600; font-size: 14px; }

.result-breakdown { display: flex; gap: 28px; flex-wrap: wrap; }
.result-breakdown .item .num { font-size: 22px; font-weight: 800; }
.result-breakdown .item .label { font-size: 12.5px; color: var(--ink-faint); font-weight: 600; }

/* ---------- Municipal search grid ---------- */

.concelho-pill {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
  background: white;
}
.concelho-pill:hover { border-color: var(--primary); color: var(--primary); }


.search-concelho {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 12px 20px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-sm);
  color: var(--ink-faint);
}
.search-concelho:focus-within { border-color: var(--primary); }
.search-concelho svg { width: 18px; height: 18px; flex-shrink: 0; }
.search-concelho input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
}

/* ---------- App download buttons ---------- */

.app-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--ink);
  color: white;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  flex: 1;
  min-width: 220px;
}
.app-btn .app-icon { width: 30px; height: 30px; flex-shrink: 0; }
.app-btn small { display: block; color: rgba(255,255,255,.6); font-size: 11px; }
.app-btn strong { font-size: 15.5px; }

/* ---------- Footer ---------- */

footer.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, .7);
  padding: 56px 0 28px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-grid h2 {
  color: white;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 16px;
}
.footer-grid a, .footer-grid p { display: block; font-size: 14px; margin-bottom: 10px; color: rgba(255,255,255,.65); }
.footer-grid a:hover { color: white; }
.footer-bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(255,255,255,.45);
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  nav.main-nav { display: none; }
  .hero h1 { font-size: 38px; }
  .grid-3, .grid-4, .grid-5, .grid-2 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .result-panel { flex-direction: column; align-items: flex-start; gap: 20px; }
}

@media (max-width: 560px) {
  .grid-3, .grid-4, .grid-5, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .cta-banner { flex-direction: column; align-items: flex-start; }
  /* CTAs grandes (nunca os pequenos, que usam .btn-sm) tinham texto
     comprido — nome de concelho, frase de otimizador — a ultrapassar o
     ecrã sem quebrar linha, por causa do `white-space: nowrap` de .btn.
     Apanhado num telemóvel real (Sintra), não reproduzia em Chromium
     headless com fontes de substituição — a largura exata depende da
     fonte do sistema (Roboto no Android vs. fallback no servidor). */
  .btn-primary:not(.btn-sm) {
    white-space: normal;
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .site-header .container { gap: 10px; }
  .brand small { display: none; }
  .header-cta-texto { display: none; }
  .header-cta { padding: 8px 10px; }
  .header-cta svg { margin: 0; }
}

/* ========================================================= */
/* Otimizador de Férias — wizard de 4 passos                 */
/* ========================================================= */

.wizard-bar {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

.wizard-steps {
  display: flex;
  align-items: center;
  max-width: 640px;
  margin: 0 auto;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.wizard-step .dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
  background: white;
  border: 2px solid var(--border);
  color: var(--ink-faint);
}

.wizard-step .label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-faint);
  white-space: nowrap;
}

.wizard-step.done .dot { background: var(--success); border-color: var(--success); color: white; }
.wizard-step.done .label { color: var(--ink-muted); }
.wizard-step.active .dot { background: var(--primary); border-color: var(--primary); color: white; box-shadow: 0 0 0 4px var(--primary-soft); }
.wizard-step.active .label { color: var(--ink); }

.wizard-line {
  height: 2px;
  flex: 1;
  background: var(--border);
  margin: 0 -2px;
}
.wizard-line.done { background: var(--success); }

/* Block builder (Passo 2) */

.block-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 14px;
  background: white;
  display: flex;
  align-items: center;
  gap: 18px;
}

.block-mode-badge {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 5px 11px;
  border-radius: 999px;
  flex-shrink: 0;
}
.block-mode-badge.optimized { background: var(--primary-soft); color: var(--primary-dark); }
.block-mode-badge.fixed { background: var(--accent-soft); color: var(--accent-dark); }

.block-card .block-body { flex: 1; }
.block-card .block-title { font-weight: 800; font-size: 16px; margin-bottom: 3px; }
.block-card .block-sub { font-size: 13.5px; color: var(--ink-muted); }

.block-actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: white;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-muted);
  cursor: pointer;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { border-color: var(--ink-muted); color: var(--ink); }
.icon-btn:disabled { opacity: .4; cursor: default; }
.icon-btn:disabled:hover { border-color: var(--border); color: var(--ink-muted); }

.new-block-form {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  background: var(--bg-soft);
}

.budget-track {
  height: 14px;
  border-radius: 999px;
  background: var(--bg-soft-2);
  overflow: hidden;
  display: flex;
  margin: 14px 0;
}
.budget-track .fill-used { background: var(--primary); }
.budget-track .fill-auto { background: #c7d2fe; }

/* Mini calendar (Passo 3) */

.mini-cal {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.calendarios-nav {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 16px;
}
.calendarios-pagina { font-size: 13px; font-weight: 700; color: var(--ink-muted); min-width: 40px; text-align: center; }

@media (max-width: 640px) {
  #calendarios { grid-template-columns: 1fr 1fr; gap: 10px; }
  #calendarios .mini-cal { display: none; padding: 12px; min-width: 0; }
  #calendarios .mini-cal.pagina-atual { display: block; }
  #calendarios .mini-cal-head { font-size: 12.5px; }
  #calendarios .mini-cal-grid { gap: 3px; }
  #calendarios .mini-cal-grid .day { font-size: 10px; border-radius: 5px; }
  #calendarios .mini-cal-grid .dow { font-size: 9px; padding-bottom: 2px; }
  .calendarios-nav { display: flex; }
}

/* Depois do bloco de 640px de propósito: mesma especificidade, ganha o
   que vier por último. Invertido, as duas colunas sobrepunham-se a esta
   regra e os dias ficavam com 15px. */
@media (max-width: 560px) {
  /* Um mês de cada vez: com dois, cada grelha ficava com menos de 155px
     e os dias saíam para fora do cartão (ver mesesPorPagina no JS). */
  #calendarios { grid-template-columns: 1fr; }
  #calendarios .mini-cal-grid { gap: 5px; }
  #calendarios .mini-cal-grid .day { font-size: 13px; border-radius: 8px; }
  #calendarios .mini-cal-grid .dow { font-size: 11px; }
  #calendarios .mini-cal { padding: 18px; }
  #calendarios .mini-cal-head { font-size: 15px; }
}
.mini-cal-head {
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mini-cal-grid {
  display: grid;
  /* minmax(0, 1fr) e não 1fr: com `1fr` as colunas nunca encolhem
     abaixo do min-content do dia, e a grelha transborda o cartão em vez
     de se ajustar. */
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}
.mini-cal-grid .dow {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-faint);
  text-align: center;
  padding-bottom: 4px;
}
.mini-cal-grid .day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  border-radius: 7px;
  color: var(--ink);
}
.mini-cal-grid .day.empty { visibility: hidden; }
.mini-cal-grid .day.weekend { background: var(--bg-soft-2); color: var(--ink-faint); }
.mini-cal-grid .day.holiday { background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; cursor: help; }
.mini-cal-grid .day.vacation { background: var(--primary); color: white; font-weight: 800; }
/* Dia que já era livre (feriado ou fim de semana) antes de entrar na
   ponte — mantém a cor de fundo própria (fim de semana ou feriado), só
   ganha a borda de "dia de descanso" à volta, para se perceber que não
   foi um dia de férias "gasto", só faz parte do span de descanso. */
.mini-cal-grid .day.weekend.vacation-folga {
  background: var(--bg-soft-2);
  color: var(--ink-faint);
  border: 2px solid var(--primary);
}
.mini-cal-grid .day.holiday.vacation-folga {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border: 2px solid var(--primary);
}

.feriado-tooltip {
  position: absolute;
  z-index: 60;
  transform: translate(-50%, calc(-100% - 10px));
  background: var(--ink);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s ease;
  box-shadow: var(--shadow-md);
}
.feriado-tooltip.visivel { opacity: 1; visibility: visible; }

.legend-row { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-muted); font-weight: 600; }
.legend-swatch { width: 14px; height: 14px; border-radius: 4px; }

/* Reward cards (Passo 3) */

.reward-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  border-left: 5px solid var(--success);
  background: white;
  padding: 22px 26px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.reward-card.manual { border-left-color: var(--accent); }
.reward-card.verao { border-left-color: #b45309; }
.reward-card.verao .reward-icon { background: #fef3c7; color: #b45309; }
.reward-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--success-soft);
  color: var(--success);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.reward-card.manual .reward-icon { background: var(--accent-soft); color: var(--accent-dark); }
.reward-icon svg { width: 24px; height: 24px; }
/* min-width:0 é o que permite este item encolher abaixo do seu
   conteúdo — sem isto, um flex item com texto longo força a linha
   toda (incluindo o ícone e o badge) a transbordar o cartão em ecrãs
   estreitos, mesmo com flex:1. */
.reward-body { flex: 1; min-width: 0; }
.reward-dates { font-size: 13px; color: var(--ink-muted); font-weight: 600; }
.reward-title { font-size: 17px; font-weight: 800; margin: 2px 0 8px; overflow-wrap: break-word; }
.reward-swap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  flex-wrap: wrap;
}
.reward-card .block-mode-badge { flex-shrink: 0; }
.reward-swap .spend { color: var(--ink-muted); }
.reward-swap .gain { color: var(--success); }
.reward-swap svg { width: 15px; height: 15px; color: var(--ink-faint); }

/* Final export CTA (Passo 4) */

.export-hero {
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
}
.export-check {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
}
.export-check svg { width: 36px; height: 36px; }

.receipt-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px 32px;
  max-width: 420px;
  margin: 0 auto 32px;
}
.receipt-row { display: flex; justify-content: space-between; padding: 10px 0; font-size: 14.5px; border-bottom: 1px dashed var(--border); }
.receipt-row:last-child { border-bottom: none; }
.receipt-row .label { color: var(--ink-muted); }
.receipt-row .value { font-weight: 800; }
.receipt-row.total { font-size: 17px; padding-top: 16px; }
.receipt-row.total .value { color: var(--primary-dark); }

.step-badge {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
  flex-shrink: 0;
}

.toggle-row { display: flex; gap: 10px; margin-bottom: 20px; }
.toggle-opt {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
}
.toggle-opt.selected { border-color: var(--primary); background: var(--primary-soft); }
.toggle-opt strong { display: block; font-size: 14.5px; margin-bottom: 3px; }
.toggle-opt span { font-size: 13px; color: var(--ink-muted); }

.totals-bar {
  display: flex;
  gap: 32px;
  padding: 20px 24px;
  background: var(--ink);
  color: white;
  border-radius: var(--radius-md);
  margin: 24px 0;
  flex-wrap: wrap;
}
.totals-bar .item .num { font-size: 26px; font-weight: 800; }
.totals-bar .item .label { font-size: 12px; color: rgba(255,255,255,.6); font-weight: 600; }

.share-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--ink-muted);
}

@media (max-width: 900px) {
  .wizard-step .label { display: none; }
  .block-card { flex-direction: column; align-items: flex-start; }
}

/* ========================================================= */
/* Otimizador — versão numa página                            */
/* ========================================================= */

.version-toggle-bar {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-muted);
}
.version-toggle-bar a { color: var(--primary); font-weight: 700; }
.version-toggle-bar a:hover { text-decoration: underline; }


.block-adder {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 34px;
  box-shadow: var(--shadow-sm);
}

.block-adder { overflow-x: auto; }

.sentence-row {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.7;
  color: var(--ink);
  letter-spacing: -0.01em;
  /* Quebra permitida: a frase inteira numa linha só provocava scroll
     horizontal em desktop. As duas metades — o pedido e o intervalo de
     datas — é que não se devem partir por dentro (ver .frase-parte). */
  white-space: normal;
}
.frase-parte { white-space: nowrap; }

.inline-input {
  display: inline-block;
  border: none;
  background: var(--primary-soft);
  border-radius: 8px;
  box-shadow: inset 0 -2.5px 0 var(--primary);
  padding: 3px 8px;
  font-family: inherit;
  font-weight: 800;
  font-size: 15.5px;
  color: var(--primary-dark);
  text-align: center;
  margin: 0 2px;
}
.inline-input.date { width: 150px; padding-left: 4px; padding-right: 4px; }
.inline-input.num { width: 54px; }
.inline-input.sel { padding-right: 6px; font-weight: 700; color: var(--primary-dark); }
.erro-bloco { color: var(--accent-dark); font-size: 13px; margin-top: 12px; max-width: 560px; line-height: 1.5; }

/* Link discreto "queres ver as interrupções letivas?" — mesmo espírito
   do "gerir blocos": a informação só aparece a quem a pede. */
.link-discreto { font-size: 13.5px; }
.link-discreto a { color: var(--primary); font-weight: 600; }
.link-discreto a:hover { text-decoration: underline; }

.interrupcoes-letivas {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  overflow: hidden;
}
.interrupcao-linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  font-size: 13.5px;
  color: var(--ink-muted);
  flex-wrap: wrap;
}
.interrupcao-linha + .interrupcao-linha { border-top: 1px solid var(--border); }
.interrupcao-linha strong { color: var(--ink); font-weight: 700; margin-right: 6px; }
.interrupcao-linha a { color: var(--primary); font-weight: 700; white-space: nowrap; }
.interrupcao-linha a:hover { text-decoration: underline; }
.interrupcao-aplicada { color: var(--ink-faint); font-weight: 700; white-space: nowrap; }

@media (max-width: 780px) {
  .sentence-row { white-space: normal; font-size: 17px; }
}

/* Barra de resultado — dias de férias → dias de descanso */
.outcome-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  flex-wrap: wrap;
}
.outcome-side { display: flex; align-items: center; gap: 16px; }
.outcome-stat { text-align: center; }
.outcome-stat .num { font-size: 56px; font-weight: 800; line-height: 1; color: var(--primary-dark); }
.outcome-stat .num.result { color: var(--success); }
.outcome-stat .label { font-size: 13px; color: var(--ink-muted); font-weight: 600; margin-top: 6px; }
.outcome-stat .sublabel { font-size: 10.5px; color: var(--ink-faint); margin-top: 1px; }
.outcome-arrow {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.outcome-arrow svg { width: 22px; height: 22px; }
.optim-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 12.5px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 999px;
  margin-top: 8px;
}

.settings-divider { height: 1px; background: var(--border); margin: 28px 0 22px; }
.settings-panel { display: flex; flex-direction: column; gap: 16px; }
.settings-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.settings-row-ano { margin-bottom: 24px; }
.settings-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-muted);
  min-width: 88px;
}
.settings-label-note { font-weight: 500; color: var(--ink-faint); font-size: 12px; }
.tab-row-compact { margin-bottom: 0; }
.tab-hint { opacity: .65; font-weight: 500; }
.settings-select {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: white;
  max-width: 280px;
  width: 100%;
}
.settings-select:focus { outline: 2px solid var(--primary); border-color: transparent; }

.autocomplete { position: relative; max-width: 280px; width: 100%; }
.autocomplete .settings-select { max-width: none; padding-right: 34px; }
.autocomplete-limpar {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  background: var(--bg-soft-2);
  color: var(--ink-faint);
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.autocomplete-limpar:hover { background: var(--border); color: var(--ink); }
.autocomplete-limpar[hidden] { display: none; }

.btn-detetar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
  flex-shrink: 0;
}
.btn-detetar svg { width: 15px; height: 15px; }
.btn-detetar:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-detetar:disabled { opacity: .55; cursor: default; }
.detetar-estado { font-size: 12.5px; color: var(--ink-faint); }
.detetar-estado.erro { color: var(--accent-dark); }

@media (max-width: 640px) {
  .settings-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .settings-label { min-width: 0; }
  .settings-select { max-width: none; }
  .autocomplete { max-width: none; }
}

@media (max-width: 560px) {
  /* Em ecrãs estreitos os toggles não cabem e passavam a deslizar. Em
     vez de os obrigar a isso, corta-se o que é acessório: a pista do
     ano ("este ano"/"próximo ano") e a versão longa dos rótulos. */
  .tab-hint { display: none; }
  .rotulo-longo { display: none; }
  .rotulo-curto { display: inline; }
  /* Menos folga nos botões: em ecrãs de 320px o par
     "Automático/Manual" ainda não cabia com o padding do desktop. */
  .tab-row a, .tab-row button { padding: 9px 14px; font-size: 13.5px; }
  /* Sem contentor de scroll nenhum no telemóvel: esconder a barra não
     chega, porque com a fonte do sistema aumentada (acessibilidade do
     Android) os botões voltam a não caber e a barra reaparece. Sem
     `overflow`, o pior caso passa a ser quebrar para duas linhas — que
     se lê bem — em vez de deslizar. */
  .tab-row { overflow-x: visible; flex-wrap: wrap; row-gap: 4px; }
  /* A frase do bloco tem de poder partir por dentro — a `nowrap` que
     protege "entre [data] e [data]" no desktop esticava-a para 513px
     num ecrã de 390px, e era isso que fazia o painel inteiro deslizar. */
  .frase-parte { white-space: normal; }
  .block-adder { overflow-x: visible; }

  /* A frase do bloco era a zona pior do telemóvel: dois campos de data
     de 150px fixos não cabem em ~310px de painel, e no Android a
     largura intrínseca do <input type=date> é ainda maior — não
     encolhia, empurrava tudo e não quebrava. Passam a ocupar a linha
     toda, um por linha: cabe sempre, lê-se melhor e são muito mais
     fáceis de tocar. */
  /* Frase empilhada, cada pedaço na sua linha. Depender do fluxo inline
     para quebrar era frágil: bastava a fonte do sistema estar maior ou
     o <input type=date> do Android pedir mais largura para voltar a
     empurrar tudo e reaparecer o scroll horizontal. Em blocos, não há
     largura mínima nenhuma a defender. */
  .sentence-row { display: flex; flex-direction: column; align-items: stretch; gap: 4px; font-size: 15px; }
  .frase-parte { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
  #frase-meio { display: block; }
  .inline-input.date {
    display: block;
    width: 100%;
    margin: 2px 0;
    padding: 10px 12px;
    text-align: left;
  }
  .inline-input.sel { align-self: flex-start; }
  .inline-input.num { width: 60px; }
}

@media (max-width: 640px) {
  /* Coluna em vez de wrap: com `flex-wrap` os três elementos partiam-se
     onde calhava e a seta acabava ao lado (ou por baixo) dos números,
     em vez de entre eles. Empilhados, a leitura é a mesma do desktop —
     dias de férias, seta, dias de descanso — só na vertical. */
  .outcome-bar { flex-direction: column; gap: 18px; }
  .outcome-side { justify-content: center; }
  .outcome-arrow { transform: rotate(90deg); }
}

.subtle-link {
  font-size: 13.5px;
  color: var(--ink-faint);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}
.subtle-link:hover { color: var(--primary); }

.sticky-export {
  position: sticky;
  bottom: 20px;
  display: flex;
  justify-content: center;
  z-index: 40;
  margin-top: -20px;
  pointer-events: none;
}
.sticky-export .btn { pointer-events: auto; box-shadow: var(--shadow-lg); }

/* Reward hero — recompensa logo no topo */
.reward-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-radius: var(--radius-lg);
  padding: 26px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-lg);
  margin-top: 16px;
}
.reward-hero-text {
  color: white;
  font-size: 19px;
  font-weight: 700;
  max-width: 480px;
  line-height: 1.45;
}
.reward-hero-text strong { font-size: 22px; }
.reward-hero-stat {
  text-align: center;
  background: rgba(255,255,255,.15);
  border-radius: var(--radius-md);
  padding: 12px 26px;
  flex-shrink: 0;
}
.reward-hero-stat .stat-num { display: block; font-size: 32px; font-weight: 800; color: white; line-height: 1; }
.reward-hero-stat .stat-label { display: block; font-size: 12px; font-weight: 700; color: rgba(255,255,255,.85); text-transform: uppercase; letter-spacing: .03em; margin-top: 4px; }

/* Link "gerir blocos" — substitui a lista aberta */
.manage-blocks-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-muted);
  margin-top: 16px;
}
.manage-blocks-link svg { width: 16px; height: 16px; color: var(--ink-faint); }
.manage-blocks-link a { color: var(--primary); }
.manage-blocks-link a:hover { text-decoration: underline; }

/* Partilha humana */
.share-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 36px 40px;
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
}
.share-card-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
}
.share-card-icon svg { width: 32px; height: 32px; }
.share-card h3 { font-size: 21px; margin-bottom: 10px; }
.share-card p { color: var(--ink-muted); font-size: 15px; max-width: 460px; margin: 0 auto 26px; }

.btn-whatsapp {
  background: #25D366;
  color: white;
  box-shadow: 0 4px 14px rgba(37, 211, 102, .35);
}
.btn-whatsapp:hover { background: #1fb955; }

.share-actions { display: flex; flex-direction: column; align-items: center; gap: 16px; }

/* ---------- Banner de consentimento de cookies ---------- */

.cookie-banner {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  max-width: 640px;
  margin: 0 auto;
  background: var(--ink);
  color: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.cookie-banner p { margin: 0; font-size: 13.5px; color: rgba(255, 255, 255, .8); flex: 1; min-width: 200px; }
.cookie-banner p a { color: white; text-decoration: underline; }
.cookie-banner-acoes { display: flex; gap: 10px; flex-shrink: 0; }

@media (max-width: 560px) {
  .cookie-banner { left: 12px; right: 12px; bottom: 12px; padding: 18px 20px; }
  .cookie-banner-acoes { width: 100%; }
  .cookie-banner-acoes .btn { flex: 1; }

  /* O ícone + texto ficam numa linha, o badge ("Automático"/"Fixo"/
     "Otimizado") passa para uma linha própria por baixo — em vez de
     espremer o título até partir palavras a meio. */
  .reward-card { padding: 16px; gap: 8px 12px; flex-wrap: wrap; }
  .reward-icon { width: 40px; height: 40px; }
  .reward-body { flex: 1 1 calc(100% - 52px); min-width: 0; }
  .block-mode-badge { flex-shrink: 0; margin-left: 52px; font-size: 10.5px; padding: 4px 8px; }

  /* Só 2 opções — em vez de obrigar a deslizar para ler a segunda por
     inteiro (como a barra de anos, que tem esse padrão de propósito),
     ocupam a largura toda, uma por cima da outra. */
  #estrategia-toggle { flex-direction: column; width: 100%; overflow: visible; }
  #estrategia-toggle button { width: 100%; text-align: center; }
}

/* ---------- Aviso do mínimo legal + modo de calendário ---------- */

.aviso-legal-plano {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 18px 0 4px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-muted);
}
.aviso-legal-plano[hidden] { display: none; }
.aviso-legal-plano strong { color: var(--accent-dark); }
.aviso-legal-plano svg { width: 20px; height: 20px; color: var(--accent-dark); flex-shrink: 0; margin-top: 1px; }

.calendarios-modo {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.calendarios-dica { font-size: 12.5px; color: var(--ink-faint); }

/* Dias clicáveis: só os do ano em curso do plano é que reagem. */
.mini-cal-grid .day:not(.empty) { cursor: pointer; }
.mini-cal-grid .day:not(.empty):hover { outline: 2px solid var(--primary); outline-offset: 1px; }

/* ---------- Painel de afinação: modos automático / manual ---------- */

.afinar-descricao { color: var(--ink-muted); font-size: 14px; margin-bottom: 18px; }

.saldo-manual {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}
.saldo-num { font-size: 40px; font-weight: 800; line-height: 1; color: var(--primary-dark); }
.saldo-manual.esgotado .saldo-num { color: var(--accent-dark); }
.saldo-txt { display: flex; flex-direction: column; }
.saldo-txt strong { font-size: 14px; }
.saldo-txt span { font-size: 12.5px; color: var(--ink-faint); }
.saldo-manual .btn { margin-left: auto; }

/* Aviso discreto num canto, para confirmar cada marcação sem interromper. */
.brinde-saldo {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 70;
  background: var(--ink);
  color: white;
  font-size: 13.5px;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.brinde-saldo.visivel { opacity: 1; transform: translateY(0); }

/* No modo automático o calendário não é clicável. */
#calendarios.sem-cliques .day { cursor: default; }
#calendarios.sem-cliques .day:hover { outline: none; }

/* Convite a retomar o plano da visita anterior — canto, dispensável. */
.convite-sessao {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  max-width: min(360px, calc(100vw - 40px));
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
}
.convite-sessao.visivel { opacity: 1; transform: translateY(0); }
.convite-sessao strong { display: block; font-size: 14px; }
.convite-sessao span { font-size: 12.5px; color: var(--ink-faint); }
.convite-accoes { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.convite-nao {
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.convite-nao:hover { color: var(--ink); }
