/* Componentes do app. Só tokens de tokens.css. Specs em replica/design/components.md */
/* Fontes da marca (SIL OFL, servidas daqui; ver fontes/LICENSE-*) */
@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(/fontes/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(/fontes/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url(/fontes/inter-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 800; font-display: swap; src: url(/fontes/inter-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Playfair Display"; font-weight: 700; font-display: swap; src: url(/fontes/playfair-display-latin-700-normal.woff2) format("woff2"); }

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--weight-base) var(--text-base) / var(--leading-base) var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1 { font: var(--weight-xl) var(--text-xl) / var(--leading-xl) var(--font-display); }
h2 { font: var(--weight-lg) var(--text-lg) / var(--leading-lg) var(--font-sans); }
a { color: var(--accent); }
.muted { color: var(--text-muted); }
.pequeno { font-size: var(--text-sm); line-height: var(--leading-sm); }
.oculto { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- layout ---------- */
.topo {
  position: sticky; top: 0; z-index: 5;
  height: var(--header); display: flex; align-items: center; gap: var(--space-3);
  padding: 0 var(--space-4); background: var(--bg); border-bottom: 1px solid var(--border);
}
.topo .marca { font: 700 var(--text-lg) / 1 var(--font-display); flex: 1; text-decoration: none; color: var(--text); }
.topo .marca { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.topo .marca span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.marca-logo { height: 32px; width: auto; max-width: 96px; object-fit: contain; flex: none; }
.logo-previa img { max-height: 96px; max-width: 200px; object-fit: contain; }
.topo .marca em { font-style: normal; color: var(--accent); }
.conteudo { max-width: var(--content-max); margin: 0 auto; padding: var(--space-5) var(--space-4) var(--space-8); }
.pilha > * + * { margin-top: var(--space-4); }
.linha { display: flex; align-items: center; gap: var(--space-3); }
.entre { justify-content: space-between; }

/* ---------- botão ---------- */
.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap-min); padding: 0 var(--space-5);
  border-radius: var(--radius-md); background: var(--accent); color: var(--on-accent);
  font: 600 var(--text-base) / 1 var(--font-sans); text-decoration: none;
  transition: filter var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease);
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; filter: none; transform: none; }
.btn[aria-busy="true"]::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: gira .7s linear infinite;
}
.btn-sec { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-perigo { background: var(--bg); color: var(--danger); border-color: var(--danger); }
.btn-lg { min-height: 52px; font-size: var(--text-lg); }
.btn-sm { min-height: 36px; padding: 0 var(--space-3); font-size: var(--text-sm); }
.btn-bloco { width: 100%; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- cartões e opções ---------- */
.card { background: var(--surface); border-radius: var(--radius-lg); padding: var(--space-4); }
.opcoes { display: grid; gap: var(--space-2); }
.opcao {
  appearance: none; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit;
  display: flex; align-items: center; gap: var(--space-3);
  min-height: 64px; padding: var(--space-3) var(--space-4);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md);
}
.opcao:hover { border-color: var(--border-input); }
.opcao[aria-checked="true"] { border: 2px solid var(--accent); padding: calc(var(--space-3) - 1px) calc(var(--space-4) - 1px); }
.opcao .titulo { font-weight: 600; }
.opcao .corpo { flex: 1; min-width: 0; }
.opcao .valor { font-weight: 600; white-space: nowrap; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--surface); color: var(--accent); font-weight: 700;
}

/* foto do profissional: grande o bastante para reconhecer, sem tomar a tela */
.avatar-foto { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface); }
@media (min-width: 768px) { .avatar-foto { width: 104px; height: 104px; } }
.foto-perfil { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--surface); color: var(--accent); font-size: 36px; font-weight: 700; }
.foto-perfil img { width: 100%; height: 100%; object-fit: cover; }
.bloco-foto { align-items: center; gap: var(--space-4); }
.equipe-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-4); }
.equipe-lista a.membro { text-decoration: none; color: inherit; }
.equipe-lista .membro { display: grid; justify-items: center; gap: var(--space-2); text-align: center; }
.equipe-lista .foto-perfil { width: 112px; height: 112px; font-size: 32px; }

/* ---------- dias e horários ---------- */
.dias { display: flex; gap: var(--space-2); overflow-x: auto; padding: 2px 2px var(--space-2); scroll-snap-type: x mandatory; }
.dia {
  appearance: none; cursor: pointer; font: inherit; color: var(--text); flex: none; scroll-snap-align: start;
  width: 60px; min-height: 68px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--bg);
  display: grid; place-content: center; text-align: center; gap: 2px;
}
.dia .sem { font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--text-muted); text-transform: capitalize; }
.dia .num { font-size: var(--text-lg); font-weight: 700; }
.dia[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.dia[aria-pressed="true"] .sem { color: var(--on-accent); }
.dia[aria-disabled="true"] { color: var(--text-muted); background: var(--surface); }
.dia[aria-disabled="true"] .num { text-decoration: line-through; }

.horarios { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: var(--space-2); }
.horario {
  appearance: none; cursor: pointer; font: 600 var(--text-base) / 1 var(--font-sans); color: var(--text);
  min-height: var(--tap-min); border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--bg);
}
.horario:hover { border-color: var(--accent); }
.horario[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.esqueleto { min-height: var(--tap-min); border-radius: var(--radius-md); background: var(--surface); animation: pisca 1.2s ease-in-out infinite; }
@keyframes pisca { 50% { opacity: .5; } }

/* ---------- campos ---------- */
.campo { display: grid; gap: var(--space-1); }
.campo label { font-size: var(--text-sm); font-weight: 600; }
.campo input, .campo select, .campo textarea, .form-inline input, .form-inline select, .tabela input {
  font: inherit; color: var(--text); background: var(--bg);
  min-height: var(--tap-min); padding: 0 var(--space-3);
  border: 1px solid var(--border-input); border-radius: var(--radius-sm); width: 100%;
}
.campo textarea { padding: var(--space-2) var(--space-3); min-height: 88px; }
.campo input:focus, .campo select:focus, .campo textarea:focus, .form-inline input:focus, .form-inline select:focus, .tabela input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.campo input[aria-invalid="true"] { border-color: var(--danger); }
.campo .erro { color: var(--danger); font-size: var(--text-sm); }
.codigo-input { letter-spacing: .5em; font-size: var(--text-xl) !important; text-align: center; font-weight: 700 !important; }

/* ---------- passos ---------- */
.passos { display: grid; gap: var(--space-2); }
.passos .barra { height: 4px; background: var(--surface); border-radius: var(--radius-pill); overflow: hidden; }
.passos .barra span { display: block; height: 100%; background: var(--accent); transition: width var(--motion-base) var(--motion-ease); }

/* ---------- folha / modal ---------- */
dialog.folha {
  border: 0; padding: var(--space-5) var(--space-4); width: 100%; max-width: 100%;
  margin: auto 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--bg); color: var(--text); box-shadow: var(--shadow-pop);
  max-height: 90vh; overflow: auto;
}
dialog.folha::backdrop { background: rgba(10, 12, 16, .45); }
@media (min-width: 768px) {
  dialog.folha { margin: auto; max-width: 480px; border-radius: var(--radius-lg); }
}

/* ---------- agendamentos ---------- */
.card-ag { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); display: grid; gap: var(--space-2); }
.card-ag.passado { color: var(--text-muted); }
.selo {
  display: inline-block; font-size: var(--text-xs); line-height: var(--leading-xs); font-weight: 600;
  padding: 2px var(--space-2); border-radius: var(--radius-pill); border: 1px solid currentColor;
}
.selo.danger { color: var(--danger); }
.selo.success { color: var(--success); }
.selo.warning { color: var(--warning); }

.selos { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.selos span { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--highlight); }
.selos span.cheio { background: var(--highlight); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: var(--space-5); transform: translateX(-50%); z-index: 20;
  background: var(--text); color: var(--bg); padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md); box-shadow: var(--shadow-pop); max-width: calc(100% - 32px);
}
.toast.erro { background: var(--danger); color: var(--on-accent); }

/* ---------- painel ---------- */
.painel { max-width: var(--painel-max); margin: 0 auto; padding: var(--space-4); }
.abas { display: flex; gap: var(--space-1); overflow-x: auto; border-bottom: 1px solid var(--border); }
.abas a {
  padding: var(--space-3) var(--space-4); color: var(--text-muted); text-decoration: none; font-weight: 600; white-space: nowrap;
  border-bottom: 2px solid transparent; min-height: var(--tap-min);
}
.abas a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.colunas { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.coluna { background: var(--surface); border-radius: var(--radius-lg); padding: var(--space-3); display: grid; gap: var(--space-2); align-content: start; }
.coluna h2 { font-size: var(--text-base); line-height: var(--leading-base); }
.bloco {
  appearance: none; text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%;
  background: var(--bg); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3);
}
.bloco.concluido { border-left-color: #B8902C; background: #FBF3DC; } /* atendimento finalizado: dourado */
.bloco.falta { border-left-color: var(--danger); }
.bloco.bloqueio {
  border-left-color: var(--border-input); color: var(--text-muted);
  background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 6px, var(--surface) 6px, var(--surface) 12px);
}
.numeros { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.numero { background: var(--surface); border-radius: var(--radius-lg); padding: var(--space-4); }
.numero strong { display: block; font-size: var(--text-xl); line-height: var(--leading-xl); }
table.tabela { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.tabela th, .tabela td { text-align: left; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); }
.tabela th { color: var(--text-muted); font-weight: 600; }
.rolagem { overflow-x: auto; position: relative; } /* position: o texto só para leitor de tela (.sr) fica dentro da rolagem e não alarga a página */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* utilitários (o CSP bloqueia style inline) */
.direita { text-align: right; }
.esqueleto.alto { min-height: 120px; }
.centro { text-align: center; }
.cresce { flex: 1; min-width: 0; }
.quebra { flex-wrap: wrap; }
.passos .barra .w1 { width: 20%; }
.passos .barra .w2 { width: 40%; }
.passos .barra .w3 { width: 60%; }
.passos .barra .w4 { width: 80%; }
.passos .barra .w5 { width: 100%; }
.centro-auto { margin-left: auto; margin-right: auto; }
.esqueleto.dia { border: 0; animation: pisca 1.2s ease-in-out infinite; background: var(--surface); }
.nowrap { white-space: nowrap; }
.lead { font-size: var(--text-lg); line-height: var(--leading-lg); }
.passos-lista { margin: 0; padding-left: var(--space-5); display: grid; gap: var(--space-3); }
footer { padding-top: var(--space-5); border-top: 1px solid var(--border); }
footer a { color: var(--text-muted); }
.margem-esq { margin-left: var(--space-2); }

/* ---------- visão geral (gráficos) ---------- */
.chip {
  appearance: none; cursor: pointer; font: 600 var(--text-sm) / 1 var(--font-sans); color: var(--text);
  min-height: 36px; padding: 0 var(--space-3); border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--bg);
}
.chip[aria-pressed="true"], .chip[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tile { display: grid; gap: var(--space-1); align-content: start; }
.delta { font-size: var(--text-xs); line-height: var(--leading-xs); font-weight: 600; color: var(--text-muted); }
.delta.bom { color: var(--success); }
.delta.ruim { color: var(--danger); }
.grade-graficos { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grafico h2 { margin: 0; }
.barras { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.barras li {
  display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: var(--space-2);
  font-size: var(--text-sm); line-height: var(--leading-sm); border-radius: var(--radius-sm);
}
.barras li:hover, .barras li:focus-visible { background: var(--bg); }
.barra-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-trilho { height: 12px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.barra { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 0 4px 4px 0; transition: width var(--motion-base) var(--motion-ease); }
.barra-valor { color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.colunas-grafico {
  display: flex; align-items: flex-end; gap: 2px; height: 160px;
  border-bottom: 1px solid var(--border); padding-top: var(--space-2);
}
.coluna-dia { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 3px; border-radius: 4px 4px 0 0; }
.coluna-dia:hover, .coluna-dia:focus-visible { background: var(--bg); }
.coluna-barra { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; }
table.calor { border-collapse: separate; border-spacing: 2px; font-size: var(--text-xs); }
.calor th { color: var(--text-muted); font-weight: 600; padding: 2px var(--space-1); text-align: center; }
.calor td { width: 36px; height: 26px; text-align: center; border-radius: 4px; background: var(--bg); color: var(--text); font-variant-numeric: tabular-nums; }
.calor td.n1 { background: rgba(201, 164, 92, .18); }
.calor td.n2 { background: rgba(201, 164, 92, .35); }
.calor td.n3 { background: rgba(201, 164, 92, .6); color: var(--on-accent); }
.calor td.n4 { background: rgba(201, 164, 92, .78); color: var(--on-accent); }
.calor td.n5 { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.grupo-rel { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.rel { display: grid; gap: var(--space-2); align-content: space-between; }
.sem-borda { border: 0; padding: 0; margin: 0; }
.tile strong { white-space: nowrap; font-size: clamp(18px, 2vw, var(--text-xl)); }

.curto { max-width: 8rem; }
.form-inline input, .form-inline select { width: auto; flex: 1 1 10rem; }
/* paginação, período e consulta de preços */
.paginacao { justify-content: space-between; }
.paginacao select { width: auto; flex: 0 0 auto; }
.num-curto { max-width: 5.5rem; flex: 0 0 auto !important; }
.lista-precos { max-height: 55vh; overflow-y: auto; }
/* grade da agenda: horário x profissional */
.grade-rolagem { max-height: 75vh; overflow: auto; border-radius: var(--radius-lg); background: var(--surface); }
.grade-agenda {
  display: grid; grid-template-columns: 52px repeat(var(--colunas, 3), minmax(150px, 1fr));
  column-gap: var(--space-1); padding: 0 var(--space-2) var(--space-2) 0; min-width: min-content;
}
.grade-canto, .grade-nome {
  position: sticky; top: 0; z-index: 3; background: var(--surface); padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}
.grade-canto { left: 0; z-index: 4; }
.grade-nome { font-size: var(--text-base); line-height: var(--leading-base); text-align: center; margin: 0; }
.grade-horas { position: sticky; left: 0; z-index: 2; background: var(--surface); }
.grade-hora { position: absolute; right: var(--space-2); padding-top: 2px; font-size: var(--text-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.grade-col {
  position: relative; border-top: 1px solid transparent; background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 4px, transparent 4px, transparent 10px);
  border-radius: var(--radius-sm);
}
.grade-aberto { position: absolute; left: 0; right: 0; background: var(--bg); }
.grade-livre {
  position: absolute; left: 2px; right: 2px; display: flex; justify-content: space-between; align-items: center;
  padding: 0 var(--space-2); border: 1px dashed var(--border); border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted); font: inherit; font-size: var(--text-xs); cursor: pointer;
}
.grade-livre.grade-passado { border-style: dotted; }
.lista-hist { margin: var(--space-2) 0 0; padding-left: var(--space-4); display: grid; gap: var(--space-1); }
.grade-livre:hover, .grade-livre:focus-visible { border-color: var(--accent); color: var(--accent); background: var(--surface); }
.grade-item { position: absolute; z-index: 1; overflow: hidden; padding: var(--space-1) var(--space-2); font-size: var(--text-sm); line-height: var(--leading-sm); }
.grade-item:hover, .grade-item:focus-visible { z-index: 2; overflow: visible; height: auto !important; min-height: fit-content; box-shadow: var(--shadow-pop); }

/* configurações */
.grade-campos { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tabela-form input, .tabela-form select { min-width: 5.5rem; }
.tabela-form td:first-child input { min-width: 12rem; }
.centro { text-align: center; }
/* chat com a Estela */
.chat { gap: var(--space-3); }
.chat-lista { display: flex; flex-direction: column; gap: var(--space-2); min-height: 280px; max-height: 60vh; overflow-y: auto; padding: var(--space-2); background: var(--bg); border-radius: var(--radius-md); }
.bolha { max-width: 85%; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); white-space: pre-wrap; overflow-wrap: anywhere; }
.bolha-eu { align-self: flex-end; background: var(--royal); border: 1px solid var(--border); }
.bolha-estela { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); }
.bolha-erro { border-color: var(--danger); }
.chat-lista ul { padding-left: var(--space-5); margin: 0; }
.tabela select { width: 100%; min-height: var(--tap-min); padding: var(--space-2); font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border-input); border-radius: var(--radius-sm); }
.tabela input[type="checkbox"] { width: 22px; height: 22px; min-width: 0; min-height: 0; padding: 0; accent-color: var(--accent); }
/* forma de pagamento: botões que quebram o texto em vez de estourar */
.opcoes-pagamento { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.opcao-pagamento {
  min-height: var(--tap-min); padding: var(--space-2); border-radius: var(--radius-sm); border: 1px solid var(--border-input);
  background: var(--bg); color: var(--text); font: inherit; font-size: var(--text-sm); font-weight: 600; line-height: 1.2;
  white-space: normal; overflow-wrap: anywhere; cursor: pointer; text-align: center;
}
.opcao-pagamento[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.opcao-pagamento:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.total-comanda { font-size: var(--text-xl); line-height: var(--leading-xl); }
.pilha-direita { display: flex; flex-direction: column; align-items: flex-end; }
.lista-simples { margin: 0; padding-left: var(--space-5); display: grid; gap: var(--space-1); }
.editor-pop { min-height: 60vh !important; font-family: var(--font-mono); font-size: var(--text-sm); line-height: 1.5; }
.dica { display: inline-block; }
.dica > summary { list-style: none; cursor: pointer; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border-input); color: var(--text-muted); display: grid; place-items: center; font-size: var(--text-xs); font-weight: 700; }
.dica > summary::-webkit-details-marker { display: none; }
.dica[open] { display: block; }
.dica[open] > p { margin-top: var(--space-2); padding: var(--space-3); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); max-width: 70ch; }
/* chat flutuante da Estela */
.chat-fab {
  position: fixed; right: var(--space-4); bottom: var(--space-4); z-index: 20;
  min-height: 48px; padding: 0 var(--space-5); border-radius: var(--radius-pill); border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent); font: 700 var(--text-base) / 1 var(--font-sans); box-shadow: var(--shadow-pop);
}
.chat-flutuante {
  position: fixed; right: var(--space-4); bottom: calc(var(--space-4) + 60px); z-index: 20;
  width: min(380px, calc(100vw - 2 * var(--space-4))); max-height: min(70vh, 640px);
  display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-pop);
}
.chat-flutuante .chat-lista { flex: 1; min-height: 160px; max-height: none; }
.chat-flutuante textarea { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border-input); border-radius: var(--radius-sm); padding: var(--space-2); resize: vertical; }
.chat-cabeca { padding-bottom: var(--space-2); border-bottom: 1px solid var(--border); }
.chat textarea { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border-input); border-radius: var(--radius-sm); padding: var(--space-2); }

/* ---------- painel: visual de sistema de gestão (menu lateral no computador, mais denso) ---------- */
.grupo-nav { display: none; }
.abas a { display: flex; align-items: center; }
.layout-painel .card { border-radius: var(--radius-md); border: 1px solid var(--border); }
.layout-painel .numero { border-radius: var(--radius-md); border: 1px solid var(--border); padding: var(--space-3) var(--space-4); }
.layout-painel .numero strong { font-size: clamp(18px, 1.6vw + 8px, var(--text-xl)); line-height: 1.25; overflow-wrap: anywhere; }
.layout-painel h1 { font-family: var(--font-sans); font-weight: 700; font-size: var(--text-xl); letter-spacing: -.01em; }
.layout-painel .btn { border-radius: var(--radius-sm); }
.layout-painel .chip { border-radius: var(--radius-sm); }
.layout-painel .tabela th { text-transform: uppercase; font-size: var(--text-xs); letter-spacing: .04em; }
.layout-painel .pilha > * + * { margin-top: var(--space-3); }
#quem:empty { display: none; }

@media (min-width: 1024px) {
  .layout-painel { --lateral: 232px; }
  .layout-painel .topo { padding-left: calc(var(--lateral) + var(--space-4)); }
  .layout-painel .topo .marca { position: fixed; left: 0; top: 0; width: var(--lateral); height: var(--header); display: flex; align-items: center; padding: 0 var(--space-4); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg); font-size: var(--text-base); z-index: 6; }
  .layout-painel .abas {
    position: fixed; left: 0; top: var(--header); bottom: 0; width: var(--lateral); z-index: 4;
    flex-direction: column; gap: 0; overflow-y: auto; padding: var(--space-3) var(--space-2) var(--space-6);
    border-bottom: 0; border-right: 1px solid var(--border); background: var(--bg);
  }
  /* títulos dos grupos (não clicáveis): destacados, para separar bem as seções do menu */
  .layout-painel .grupo-nav { display: block; margin: var(--space-5) var(--space-3) var(--space-2); padding: var(--space-1) var(--space-2); font-size: var(--text-sm); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); background: var(--surface); border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; cursor: default; user-select: none; }
  .layout-painel .grupo-nav:first-child { margin-top: 0; }
  .layout-painel .abas a { min-height: 40px; padding: 0 var(--space-3); border: 0; border-left: 3px solid transparent; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-weight: 500; }
  .layout-painel .abas a:hover { background: var(--surface); color: var(--text); }
  .layout-painel .abas a[aria-current="page"] { background: var(--surface); color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
  .layout-painel .painel { margin-left: var(--lateral); max-width: none; padding: var(--space-5) var(--space-6); }
  .layout-painel .abas.oculto ~ .painel { margin-left: 0; }
}
/* números dos indicadores cabem no cartão em qualquer largura */
.layout-painel .tile strong, .layout-painel .numero strong { white-space: normal; font-size: clamp(17px, 0.9vw + 9px, 24px); font-variant-numeric: tabular-nums; }
.layout-painel .numeros { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.barra-salvar { position: sticky; bottom: 0; padding: var(--space-3) 0; background: var(--bg); border-top: 1px solid var(--border); z-index: 2; }

/* links de agendamento (painel e app da equipe) */
.link-ag { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.link-ag .pilha-justa { display: flex; flex-direction: column; min-width: 0; }
.link-ag .link-url { overflow-wrap: anywhere; }

/* cartão presente virtual: arte com a identidade da casa (navy, royal e dourado) */
.pagina-presente { background: #0B1A3D; }
.pagina-presente .conteudo { max-width: 480px; margin: 0 auto; padding: 24px 16px 40px; }
.cartao-presente { background: linear-gradient(160deg, #13286B 0%, #0B1A3D 70%); color: #F5F1E8; border: 1px solid #C9A45C; outline: 1px solid rgba(201, 164, 92, 0.35); outline-offset: -10px; border-radius: 6px; padding: 32px 24px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.cartao-presente h1 { font-family: "Playfair Display", serif; color: #F5F1E8; font-size: 1.9rem; margin: 0; }
.presente-logo { max-height: 72px; max-width: 70%; object-fit: contain; }
.presente-marca { font-family: "Playfair Display", serif; font-size: 1.3rem; letter-spacing: 0.04em; margin: 0; color: #C9A45C; }
.presente-selo { text-transform: uppercase; letter-spacing: 0.25em; font-size: 0.75rem; color: #C9A45C; margin: 0; border-top: 1px solid rgba(201, 164, 92, 0.5); border-bottom: 1px solid rgba(201, 164, 92, 0.5); padding: 6px 14px; }
.presente-mensagem { font-style: italic; font-size: 1.05rem; line-height: 1.55; margin: 4px 0; quotes: "“" "”"; }
.presente-mensagem::before { content: open-quote; color: #C9A45C; }
.presente-mensagem::after { content: close-quote; color: #C9A45C; }
.presente-de { margin: 0; color: #E6D3A8; }
.presente-servico { display: flex; flex-direction: column; gap: 2px; background: rgba(201, 164, 92, 0.12); border: 1px solid rgba(201, 164, 92, 0.5); border-radius: 4px; padding: 10px 22px; }
.presente-servico span { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.2em; color: #C9A45C; }
.presente-servico strong { font-size: 1.15rem; color: #F5F1E8; }
.presente-validade { font-size: 0.8rem; color: #CFC7B4; margin: 0; }
.pagina-presente .btn-ouro { background: #C9A45C; color: #0B1A3D; border-color: #C9A45C; }
.presente-aviso { background: #F5F1E8; color: #0B1A3D; border-radius: 4px; padding: 12px 16px; text-align: center; margin: 0; }
.pagina-presente .muted { color: #CFC7B4; }
.pagina-presente .card { background: #F5F1E8; color: #0B1A3D; }
.centro { text-align: center; }
.link-url { overflow-wrap: anywhere; }

/* etiquetas de cliente e prontuário (painel e app da equipe) */
.etiquetas { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; vertical-align: middle; }
.etiqueta { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; line-height: 1.3; padding: 1px 8px; border-radius: 999px; background: #EFE7D3; color: #5A4517; border: 1px solid #D9C69A; }
.etiqueta button { background: none; border: 0; padding: 0 2px; color: inherit; cursor: pointer; font-size: 0.9rem; line-height: 1; }
.anotacao { border-left: 3px solid var(--border); padding: 4px 0 4px 10px; }
.conversa-guardada { white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 0.9rem; margin: 8px 0 0; max-height: 50vh; overflow: auto; }
.texto-peca { white-space: pre-wrap; word-break: break-word; margin: 0; }
.anotacao-texto { white-space: pre-wrap; margin: 0; }
.fotos-prontuario { display: flex; flex-wrap: wrap; gap: 6px; }
.foto-mini { padding: 0; border: 1px solid var(--border); border-radius: 3px; background: none; cursor: zoom-in; width: 72px; height: 72px; overflow: hidden; }
.foto-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-grande img { max-width: 100%; max-height: 75vh; object-fit: contain; }
.num-medio { max-width: 9rem; flex: 0 0 auto !important; }

/* app da equipe: serviços adicionais, aviso de confronto e bloqueio rápido */
.servico-adicional { border-left: 3px solid var(--border); padding-left: 8px; }
.servico-adicional .form-inline { flex-wrap: nowrap; }
.servico-adicional select { flex: 1 1 0; min-width: 0; }
.servico-adicional input[type="time"] { flex: 0 0 110px; }
.aviso-confronto { border-left: 4px solid var(--danger); padding: 8px 12px; color: var(--danger); }
.chip-bloquear:hover, .chip-bloquear:focus-visible { border-color: var(--danger); color: var(--danger); }
/* itens acrescentados ao atendimento */
.lista-itens { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
/* X para fechar qualquer janela */
dialog.folha { position: relative; }
.fechar-folha { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 26px; line-height: 1; cursor: pointer; z-index: 2; }
.fechar-folha:hover, .fechar-folha:focus-visible { background: rgba(127, 127, 127, 0.18); }
dialog.folha > h2:first-of-type { padding-right: 44px; }
/* marketing: fotos, vídeos e artes das peças */
.mk-galeria { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-midia { margin: 0; display: flex; flex-direction: column; gap: 2px; width: 112px; }
.mk-mini { width: 112px; height: 140px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); background: #0B1A3D; }
.mk-escolha { display: flex; align-items: flex-start; gap: 4px; }
.mk-legenda { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* app do cliente: bolha de ajuda flutuante e opções grandes (para quem não tem costume com app) */
.bolha-ajuda { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40; max-width: 560px; margin: 0 auto; display: flex; gap: 10px; align-items: flex-start; background: #0B1A3D; color: #F5F1E8; border: 1px solid #C9A45C; border-radius: 14px; padding: 12px 40px 12px 12px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.bolha-ajuda p { margin: 0; font-size: 1rem; line-height: 1.4; }
.bolha-icone { font-size: 1.3rem; }
.bolha-fechar { position: absolute; top: 4px; right: 6px; background: none; border: 0; color: #F5F1E8; font-size: 1.6rem; line-height: 1; min-width: 44px; min-height: 44px; cursor: pointer; }
main.conteudo:has(.bolha-ajuda) { padding-bottom: 120px; }
.opcao-grande { min-height: 72px; font-size: 1.1rem; }
/* app do cliente: menu de botões grandes, loja, vitrine */
.menu-cliente { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.menu-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 96px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface, #fff); color: inherit; text-decoration: none; font-weight: 600; font-size: 1.05rem; text-align: center; }
.menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.menu-icone { font-size: 1.8rem; }
.produto-card { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start; }
.produto-foto { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; background: var(--surface-2, #eee); display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.produto-card p { margin: 0; }
.carrinho-barra { position: sticky; bottom: 0; background: var(--surface, #fff); border-top: 1px solid var(--border); padding: 10px 0; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.post-vitrine img, .post-vitrine video { width: 100%; max-height: 70vh; object-fit: cover; border-radius: 8px; background: #0B1A3D; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.chip { white-space: nowrap; }
.estrelas { display: flex; gap: 6px; }
.estrela { font-size: 2rem; min-width: 48px; min-height: 48px; background: none; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.estrela[aria-checked="true"] { background: #FBF3DC; border-color: #B8902C; }
.comentario { display: flex; gap: 8px; justify-content: space-between; align-items: baseline; }
.produto-foto-original { object-fit: contain; background: #fff; height: auto; max-height: 160px; }
.menu-imagem { width: 100%; max-width: 150px; height: 68px; object-fit: contain; background: #fff; border-radius: 10px; padding: 4px; }
