/* =============================================================
   agenda.css - Agenda de produção de Matheus Castro
   Tema escuro com cores vivas (harmonia da paleta Apple),
   barra de abas flutuante, calendário completo e movimento
   fluido. Identidade própria deste app, separada do site.
   ============================================================= */

:root {
  --bg: #0B0D0C;
  --card: rgba(255, 255, 255, 0.055);
  --card-2: rgba(255, 255, 255, 0.09);
  --stroke: rgba(255, 255, 255, 0.08);
  --stroke-forte: rgba(255, 255, 255, 0.2);
  --text: #F5F7F6;
  --text-2: rgba(245, 247, 246, 0.65);
  --text-3: rgba(245, 247, 246, 0.4);

  /* harmonia Apple (dark mode system colors) */
  --verde: #30D158;
  --azul: #0A84FF;
  --roxo: #BF5AF2;
  --laranja: #FF9F0A;
  --menta: #66D4CF;
  --rosa: #FF375F;

  /* superfícies que mudam com o tema */
  --painel: #101312;
  --campo: rgba(0, 0, 0, 0.3);
  --rebaixo: rgba(0, 0, 0, 0.25);
  --barra: rgba(18, 22, 20, 0.72);

  --raio: 18px;
  --raio-p: 12px;
  --mola: cubic-bezier(0.32, 0.72, 0.35, 1);
  color-scheme: dark;
}

/* ---------- tema claro ---------- */
:root[data-tema="claro"] {
  --bg: #F2F4F3;
  --card: rgba(0, 0, 0, 0.045);
  --card-2: rgba(0, 0, 0, 0.08);
  --stroke: rgba(0, 0, 0, 0.1);
  --stroke-forte: rgba(0, 0, 0, 0.24);
  --text: #16201B;
  --text-2: rgba(22, 32, 27, 0.66);
  --text-3: rgba(22, 32, 27, 0.45);

  /* mesma harmonia, calibrada para fundo claro */
  --verde: #23A345;
  --azul: #0071E3;
  --roxo: #A339E0;
  --laranja: #E68600;
  --menta: #0FA9A1;
  --rosa: #E22B50;

  --painel: #FFFFFF;
  --campo: rgba(0, 0, 0, 0.05);
  --rebaixo: rgba(0, 0, 0, 0.05);
  --barra: rgba(255, 255, 255, 0.78);
  color-scheme: light;
}

/* touch-action: manipulation desliga o zoom por toque duplo do
   navegador (que atrapalhava os toques e dava zoom indesejado),
   mantendo rolagem e pinça normais */
* { margin: 0; padding: 0; box-sizing: border-box; touch-action: manipulation; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* toque duplo também não seleciona texto dos controles */
button, .semana, .ano__grade, .cal__grade, .abas, .fab,
.chips label, .card__topo, .card__titulo, .hero__data, .ano__titulo {
  -webkit-user-select: none;
  user-select: none;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100dvh;
  padding-bottom: 150px;
  overflow-x: hidden;
  transition: background 0.5s ease, color 0.5s ease;
  /* dígitos com largura igual: horários e valores alinham perfeito */
  font-variant-numeric: tabular-nums;
}

/* aurora de cores vivas atrás do topo;
   o matiz gira conforme a aba ativa e a luz flutua devagar,
   como neon desfocado respirando */
.fundo {
  position: fixed;
  inset: -18%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(55% 32% at 22% 12%, rgba(48, 209, 88, 0.26), transparent 70%),
    radial-gradient(45% 28% at 72% 14%, rgba(10, 132, 255, 0.18), transparent 70%),
    radial-gradient(40% 26% at 96% 22%, rgba(191, 90, 242, 0.14), transparent 70%);
  transition: filter 1.1s var(--mola), opacity 0.5s ease;
  animation: auroraFlutua 26s ease-in-out infinite alternate;
}

@keyframes auroraFlutua {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  33%  { transform: translate3d(3%, 1.5%, 0) scale(1.06); }
  66%  { transform: translate3d(-2.5%, -1%, 0) scale(1.03); }
  100% { transform: translate3d(1.5%, 2%, 0) scale(1.08); }
}

body[data-aba="calendario"] .fundo { filter: hue-rotate(75deg); }
body[data-aba="chat"] .fundo { filter: hue-rotate(115deg); }
body[data-aba="ajustes"] .fundo { filter: hue-rotate(160deg); }

/* na aba do assistente, o + sai de cena para não cobrir a entrada */
body[data-aba="chat"] .fab { display: none; }

:root[data-tema="claro"] .fundo { opacity: 0.5; }

/* pulso de cor que acompanha cada ação */
.pulso {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  opacity: 0;
  animation: pulsar 0.9s var(--mola) forwards;
}

@keyframes pulsar {
  0%   { opacity: 0; }
  22%  { opacity: 0.5; }
  100% { opacity: 0; }
}

.container {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

.oculto {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.rotulo {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-2);
  margin-bottom: 12px;
}

/* ---------- movimento ---------- */
@keyframes subir {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes entraDir {
  from { opacity: 0; transform: translateX(38px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes entraEsq {
  from { opacity: 0; transform: translateX(-38px); }
  to   { opacity: 1; transform: translateX(0); }
}

.painel { animation: subir 0.45s var(--mola); }

/* troca de aba desliza na direção do movimento */
.painel--dir { animation: entraDir 0.42s var(--mola); }
.painel--esq { animation: entraEsq 0.42s var(--mola); }

/* navegação de semana, mês e ano desliza também */
.desliza-dir { animation: entraDir 0.35s var(--mola); }
.desliza-esq { animation: entraEsq 0.35s var(--mola); }

.lista .card { animation: subir 0.5s var(--mola) both; }
.lista .card:nth-child(1) { animation-delay: 0.03s; }
.lista .card:nth-child(2) { animation-delay: 0.08s; }
.lista .card:nth-child(3) { animation-delay: 0.13s; }
.lista .card:nth-child(4) { animation-delay: 0.18s; }
.lista .card:nth-child(5) { animation-delay: 0.23s; }

/* ---------- vinheta de abertura: claquete ---------- */
.abertura {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #0B0D0C;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: aberturaSai 0.5s ease 1.7s forwards;
}

@keyframes aberturaSai {
  to { opacity: 0; visibility: hidden; }
}

.abertura__cena {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  animation: subir 0.5s var(--mola);
}

.claquete {
  position: relative;
  width: 206px;
}

.claquete__braco {
  height: 28px;
  border-radius: 7px 7px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: repeating-linear-gradient(-55deg, #F5F7F6 0 16px, #101314 16px 32px);
  transform-origin: 6px 26px;
  transform: rotate(-26deg);
  animation: claqueteBate 0.5s cubic-bezier(0.55, 0, 0.7, 0.2) 0.45s forwards;
}

@keyframes claqueteBate {
  0%   { transform: rotate(-26deg); }
  62%  { transform: rotate(0deg); }
  76%  { transform: rotate(-3.5deg); }
  100% { transform: rotate(0deg); }
}

.claquete__corpo {
  margin-top: 3px;
  border-radius: 0 0 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #14171A;
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  animation: claqueteTreme 0.25s ease 0.78s;
}

@keyframes claqueteTreme {
  0%   { transform: translateY(0); }
  40%  { transform: translateY(3px); }
  100% { transform: translateY(0); }
}

.claquete__linha {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: rgba(245, 247, 246, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 7px;
  white-space: nowrap;
  overflow: hidden;
}

.claquete__linha--2 {
  color: rgba(245, 247, 246, 0.32);
  border-bottom: 0;
  padding-bottom: 0;
}

.claquete__flash {
  position: absolute;
  inset: -46px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35), transparent 62%);
  opacity: 0;
  pointer-events: none;
  animation: claqueteFlash 0.4s ease 0.75s;
}

@keyframes claqueteFlash {
  0%   { opacity: 0; }
  30%  { opacity: 1; }
  100% { opacity: 0; }
}

.abertura__logo {
  width: 210px;
  max-width: 60vw;
  opacity: 0;
  animation: subir 0.6s var(--mola) 0.95s forwards;
}

/* ---------- hero ---------- */
.hero { padding-top: calc(20px + env(safe-area-inset-top)); }

.hero__topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.hero__acoes { display: flex; gap: 8px; }

.chip--ativo {
  border-color: var(--verde);
  background: color-mix(in srgb, var(--verde) 16%, transparent);
  color: var(--text);
}

.hero__data {
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero__data #dia-semana { color: var(--text-2); font-weight: 500; }

.hero__menu {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--card);
  color: var(--menta);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.2s var(--mola), border-color 0.25s ease;
}
.hero__menu:hover { border-color: var(--stroke-forte); }
.hero__menu:active { transform: scale(0.94); }

/* ---------- semana ---------- */
.semana__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.semana__mes {
  background: none;
  border: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--raio-p);
  transition: background 0.25s ease;
}
.semana__mes:hover { background: var(--card); }

.semana__seta {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--text-2);
  font-size: 1.125rem;
  cursor: pointer;
  transition: transform 0.2s var(--mola), color 0.25s ease, border-color 0.25s ease;
}
.semana__seta:hover { color: var(--text); border-color: var(--stroke-forte); }
.semana__seta:active { transform: scale(0.9); }

.semana {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 24px;
}

.semana__dia {
  border: 1px solid transparent;
  border-radius: 14px;
  background: none;
  color: var(--text-2);
  font-family: inherit;
  padding: 10px 0 8px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: background 0.3s ease, color 0.3s ease, transform 0.2s var(--mola);
}
.semana__dia:hover { background: var(--card); }
.semana__dia:active { transform: scale(0.92); }

.semana__dia small {
  display: block;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-3);
  margin-bottom: 2px;
}

.semana__dia strong { font-size: 1rem; font-weight: 600; }

.semana__dia--sel {
  background: var(--card-2);
  border-color: var(--stroke-forte);
  color: var(--text);
}

.semana__dia--hoje small { color: var(--verde); }

.semana__dia--tem::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cor-dia, var(--verde));
}

/* ---------- saudação ---------- */
.hero__saudacao {
  font-size: clamp(1.6rem, 6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.hero__resumo {
  font-size: clamp(1.3rem, 5vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text-2);
  margin-bottom: 16px;
}

.hero__resumo b { font-weight: 650; }
.hero__resumo b.cor-gravacao { color: var(--verde); }
.hero__resumo b.cor-reuniao { color: var(--azul); }
.hero__resumo b.cor-outro { color: var(--laranja); }

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

/* o contêiner interno dos chips dinâmicos entrega os filhos
   direto ao flex de cima, para o espaçamento valer entre todos */
#chips { display: contents; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--card);
  color: var(--text-2);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 8px 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.chip b { color: var(--cor, var(--verde)); font-weight: 600; }

.chip--acao {
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, transform 0.2s var(--mola);
}
.chip--acao:hover { color: var(--text); border-color: var(--stroke-forte); }
.chip--acao:active { transform: scale(0.95); }

/* ---------- blocos e cards ---------- */
.bloco { padding: 18px 0; }

.lista { display: grid; gap: 10px; }

.vazio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-3);
  font-size: 0.9375rem;
  text-align: center;
  padding: 22px 0 18px;
}

.vazio svg {
  width: 46px;
  height: 46px;
  color: var(--text-3);
  opacity: 0.75;
}

/* onda de luz na troca de tema, nascendo do botão */
.tema-onda {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
}

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--raio);
  padding: 16px 18px;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.25s var(--mola);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card:hover { background: var(--card-2); }
.card:active { transform: scale(0.985); }

/* gravação rolando agora: o card respira como um farol de set */
.card--agora {
  border-color: color-mix(in srgb, var(--cor, var(--verde)) 55%, transparent);
  animation: cardPulsa 2.8s ease-in-out infinite;
}

@keyframes cardPulsa {
  0%, 100% { box-shadow: 0 0 0 rgba(0, 0, 0, 0); }
  50% { box-shadow: 0 0 26px color-mix(in srgb, var(--cor, var(--verde)) 28%, transparent); }
}
.card--feito { opacity: 0.45; }

.card__topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.card__tipo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-2);
}

.card__tipo::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--cor, var(--verde));
  box-shadow: 0 0 10px color-mix(in srgb, var(--cor, var(--verde)) 60%, transparent);
  flex: none;
}

.card__hora {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}

.card__titulo {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin-top: 6px;
}

.card__meta { color: var(--text-3); font-size: 0.8125rem; margin-top: 2px; }
.card__meta span + span::before { content: ' · '; }
.card__meta .destaque { color: var(--cor, var(--verde)); }

/* previsão do tempo do dia da produção; toque abre o app de Tempo */
.card__tempo {
  color: var(--text-2);
  font-size: 0.8125rem;
  font-weight: 500;
  margin-top: 6px;
  cursor: pointer;
  transition: color 0.25s ease;
}
.card__tempo:hover { color: var(--text); }

/* detalhes: abrem com transição fluida de altura */
.card__detalhes {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--mola);
}

.card__detalhes > div { overflow: hidden; min-height: 0; }

.card--aberto .card__detalhes { grid-template-rows: 1fr; }

.card__equip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.card__equip span {
  font-size: 0.75rem;
  color: var(--text-2);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 4px 10px;
}

.card__obs {
  color: var(--text-2);
  font-size: 0.875rem;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--rebaixo);
  border-radius: var(--raio-p);
}

.card__valor {
  color: var(--verde);
  font-size: 0.9375rem;
  font-weight: 600;
  margin-top: 10px;
}

/* fechamento mensal em Ajustes */
.fin__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.fin__titulo {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: capitalize;
}

.fin {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--raio);
  padding: 6px 18px;
}

.fin__sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-3);
  padding: 12px 0 2px;
  border-top: 1px solid var(--stroke);
  margin-top: 4px;
}

.fin__linha--mini { padding: 8px 0; font-size: 0.8438rem; }
.fin__linha--mini b { color: var(--text-2); }
.fin__linha--mini + .fin__linha--mini { border-top: 1px solid var(--stroke); }

.fin__detalhes { padding: 10px 0 6px; border-top: 1px solid var(--stroke); margin-top: 4px; }
.fin__detalhes summary {
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2);
  padding: 2px 0 6px;
}

.ferramentas--fin { margin-top: 12px; }

.fin__linha {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  font-size: 0.9375rem;
  color: var(--text-2);
}

.fin__linha + .fin__linha { border-top: 1px solid var(--stroke); }

.fin__linha b { color: var(--verde); font-weight: 600; }

.card__acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--stroke);
}

.acao {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.2s var(--mola);
}
.acao:hover { color: var(--text); border-color: var(--stroke-forte); }
.acao:active { transform: scale(0.94); }

.acao--principal {
  color: #04120A;
  background: var(--cor, var(--verde));
  border-color: transparent;
}
.acao--principal:hover { color: #04120A; filter: brightness(1.1); }

/* ---------- visão de ano (estilo calendário do iPhone) ---------- */
.ano__titulo {
  font-size: clamp(2rem, 7vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--verde);
}

.ano__grade {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 12px;
  padding-bottom: 28px;
}

.mes-mini {
  background: none;
  border: 0;
  border-radius: 14px;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  padding: 8px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s var(--mola);
}
.mes-mini:hover { background: var(--card); }
.mes-mini:active { transform: scale(0.94); }

.mes-mini__nome {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.mes-mini--atual .mes-mini__nome { color: var(--verde); }

.mes-mini__ponto {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--verde);
}

.mes-mini__grade {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  font-size: 0.5625rem;
  font-weight: 500;
  color: var(--text-2);
}

.mes-mini__grade span {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mes-mini__hoje {
  background: var(--verde);
  color: #FFFFFF;
  border-radius: 50%;
  font-weight: 700;
}

.ano__voltar {
  background: none;
  border: 0;
  color: var(--verde);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 8px 0 0;
  margin-top: calc(14px + env(safe-area-inset-top));
  transition: opacity 0.25s ease;
}
.ano__voltar:hover { opacity: 0.75; }

.cal__cabecalho--mes { padding-top: 6px; }

/* zoom ano ↔ mês: a vista que sai flutua sobre a que entra */
.vista--flutua {
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  z-index: 2;
  pointer-events: none;
  will-change: transform, opacity;
}

/* ---------- calendário completo ---------- */
.painel__titulo { padding-top: calc(20px + env(safe-area-inset-top)); }

.cal__cabecalho {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: calc(20px + env(safe-area-inset-top));
  margin-bottom: 16px;
}

.cal__titulo {
  font-size: clamp(1.4rem, 5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cal__titulo small { color: var(--text-3); font-weight: 500; font-size: 0.7em; }

.cal__semana {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  color: var(--text-3);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.cal__grade {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal__dia {
  aspect-ratio: 0.92;
  border: 1px solid transparent;
  border-radius: 14px;
  background: none;
  color: var(--text-2);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  padding-top: 6px;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s var(--mola);
}
.cal__dia:hover { background: var(--card); }
.cal__dia:active { transform: scale(0.9); }

.cal__dia--fora { color: var(--text-3); opacity: 0.5; }
.cal__dia--hoje { color: var(--verde); font-weight: 700; }
.cal__dia--sel { background: var(--card-2); border-color: var(--stroke-forte); color: var(--text); }

.cal__pontos {
  position: absolute;
  left: 50%;
  bottom: 7px;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
}

.cal__pontos i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--verde);
}

.cal__legenda {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 8px 0 24px;
}

.cal__legenda span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-3);
}

.cal__legenda i {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--cor, var(--verde));
}

/* ---------- ajustes / rodapé ---------- */
.bloco--rodape { padding-bottom: 40px; }
details summary { cursor: pointer; list-style-position: inside; }
details .lista { margin-top: 12px; }

.ferramentas { display: flex; flex-wrap: wrap; gap: 10px; }

.nota { color: var(--text-3); font-size: 0.75rem; margin-top: 14px; max-width: 46ch; }

.nota--assinatura {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.6875rem;
  padding-bottom: 24px;
}

/* ---------- barra de abas ---------- */
.abas {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex;
  gap: 2px;
  background: var(--barra);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 5px;
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  z-index: 30;
}

.aba {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--text-3);
  font-family: inherit;
  font-size: 0.6563rem;
  font-weight: 600;
  padding: 8px 18px;
  cursor: pointer;
  transition: color 0.25s ease, background 0.3s ease, transform 0.2s var(--mola);
}
.aba:active { transform: scale(0.93); }

.aba svg { width: 22px; height: 22px; transition: transform 0.25s var(--mola); }

/* o ícone da aba escolhida dá um pulinho e se acende */
.aba--ativa svg {
  animation: abaPula 0.45s var(--mola);
  fill: currentColor;
  fill-opacity: 0.16;
}

@keyframes abaPula {
  0%   { transform: translateY(0) scale(1); }
  40%  { transform: translateY(-4px) scale(1.18); }
  100% { transform: translateY(0) scale(1); }
}

/* bolinha na aba Início quando há compromisso hoje */
.aba--ponto::after {
  content: '';
  position: absolute;
  top: 7px;
  right: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rosa);
}

.aba--ativa { color: var(--verde); background: rgba(48, 209, 88, 0.12); }
.aba--ativa[data-aba="calendario"] { color: var(--azul); background: rgba(10, 132, 255, 0.12); }
.aba--ativa[data-aba="chat"] { color: var(--menta); background: rgba(102, 212, 207, 0.12); }
.aba--ativa[data-aba="ajustes"] { color: var(--roxo); background: rgba(191, 90, 242, 0.12); }

/* ---------- assistente (chat) ---------- */
.chat { display: flex; flex-direction: column; min-height: calc(100dvh - 170px); }

.chat__nota { margin-top: 4px; margin-bottom: 10px; }

.chat__mensagens {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0 12px;
}

.msg {
  max-width: 86%;
  padding: 12px 15px;
  border-radius: 18px;
  font-size: 0.9375rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  animation: subir 0.35s var(--mola);
}

.msg--eu {
  align-self: flex-end;
  background: var(--verde);
  color: #04120A;
  font-weight: 500;
  border-bottom-right-radius: 6px;
}

.msg--bot {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--stroke);
  color: var(--text);
  border-bottom-left-radius: 6px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.msg__acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chat__sugestoes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 10px;
}

.chat__entrada {
  position: sticky;
  bottom: calc(88px + env(safe-area-inset-bottom));
  display: flex;
  gap: 8px;
  padding: 10px 0 4px;
  background: linear-gradient(to top, var(--bg) 65%, transparent);
  z-index: 5;
}

.chat__entrada input {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  padding: 13px 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.25s ease;
}
.chat__entrada input:focus { border-color: var(--menta); outline: none; }
.chat__entrada input::placeholder { color: var(--text-3); }

.chat__enviar {
  width: 48px;
  height: 48px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--menta), #2BA69F);
  color: #04120A;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s var(--mola), filter 0.25s ease;
}
.chat__enviar:hover { filter: brightness(1.08); }
.chat__enviar:active { transform: scale(0.9); }

/* ---------- botão flutuante ---------- */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, var(--verde), #1FA94A);
  color: #04120A;
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  z-index: 30;
  box-shadow: 0 6px 30px rgba(48, 209, 88, 0.4);
  transition: transform 0.25s var(--mola), box-shadow 0.3s ease;
}
.fab:hover { box-shadow: 0 8px 40px rgba(48, 209, 88, 0.55); }
.fab:active { transform: scale(0.9); }

/* ---------- botões do formulário ---------- */
.btn {
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
  transition: filter 0.25s ease, border-color 0.25s ease, transform 0.2s var(--mola);
}
.btn:active { transform: scale(0.97); }

.btn--primario { background: linear-gradient(135deg, var(--verde), #1FA94A); color: #04120A; border: 0; }
.btn--primario:hover { filter: brightness(1.08); }

.btn--fantasma { background: transparent; color: var(--text); border: 1px solid var(--stroke-forte); }
.btn--fantasma:hover { border-color: var(--text-2); }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--azul);
  outline-offset: 2px;
}

/* ---------- diálogo / formulário ---------- */
.dlg {
  margin: auto;
  background: var(--painel);
  color: var(--text);
  border: 1px solid var(--stroke);
  border-radius: 24px;
  padding: 0;
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 40px);
  /* a rolagem morre dentro da janela, não passa para trás */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* com o formulário aberto, a página de trás fica congelada */
body.trava-rolagem {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}

/* a entrada do diálogo é animada por JS: ele nasce do botão
   que o abriu, com zoom, no estilo iOS */

.dlg::backdrop {
  background: rgba(4, 7, 6, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dlg form { padding: 0 24px 24px; }

/* cabeçalho fixo: o × fica sempre à vista, mesmo rolando o formulário */
.dlg__cabecalho {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--painel);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 -24px 14px;
  padding: 16px 24px 12px;
  border-bottom: 1px solid var(--stroke);
}

.dlg__cabecalho .rotulo { margin: 0; font-size: 1rem; color: var(--text); }

.dlg__fechar {
  background: var(--card-2);
  border: 1px solid var(--stroke);
  border-radius: 50%;
  color: var(--text);
  font-size: 1.375rem;
  font-weight: 300;
  cursor: pointer;
  width: 44px;
  height: 44px;
  flex: none;
  transition: color 0.25s ease, transform 0.2s var(--mola);
}
.dlg__fechar:hover { color: var(--text); }
.dlg__fechar:active { transform: scale(0.9); }

.field { margin-bottom: 14px; border: 0; }

.field label,
.field legend {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--campo);
  border: 1px solid var(--stroke);
  border-radius: var(--raio-p);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  padding: 12px 14px;
  transition: border-color 0.25s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--azul); outline: none; }

.field input::placeholder,
.field textarea::placeholder { color: var(--text-3); }

.field--par { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chips label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  margin: 0;
  transition: border-color 0.25s ease, color 0.25s ease, background 0.3s ease, transform 0.2s var(--mola);
}
.chips label:active { transform: scale(0.95); }

.chips input { display: none; }

.chips label:has(input:checked) {
  border-color: var(--cor, var(--verde));
  background: color-mix(in srgb, var(--cor, var(--verde)) 16%, transparent);
  color: var(--text);
}

/* bolinha colorida nos chips de tipo */
.chips--tipo label::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--cor, var(--verde));
}

.dlg__acoes { display: flex; gap: 10px; margin-top: 20px; }
.dlg__acoes .btn { flex: 1; }

/* ---------- responsivo ---------- */
@media (max-width: 480px) {
  .field--par { grid-template-columns: 1fr; }
  .dlg {
    width: calc(100vw - 20px);
    /* centralizada, sem invadir a barra de status nem a de gestos */
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 48px);
    margin: auto;
    border-radius: 24px;
  }
  .dlg__acoes { flex-direction: column; }
  .fab { bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* aplicada por JS quando o usuário escolhe seguir o
   Reduzir Movimento do sistema */
html.sem-animacao * { transition: none !important; animation: none !important; }
