/* EscaleMax: sistema visual único para área do cliente e painel.
   Branco predominante, azul #006DA6 e neutros. Nenhum estilo depende de script para ser legível. */

:root {
  --azul: #006DA6;
  --azul-escuro: #005A8A;
  --azul-profundo: #0B3B57;
  --azul-claro: #E9F3F9;
  --azul-borda: #BBD8EA;
  --texto: #16202A;
  --texto-2: #475563;
  --texto-3: #647281;
  --borda: #E1E7ED;
  --borda-forte: #C8D1DA;
  --fundo: #FFFFFF;
  --fundo-2: #F6F8FA;
  --fundo-3: #EDF1F5;
  --verde: #12744A;
  --verde-claro: #E6F4ED;
  --ambar: #8A5700;
  --ambar-claro: #FFF4D9;
  --vermelho: #B42318;
  --vermelho-claro: #FDECEA;
  --raio: 10px;
  --raio-g: 16px;
  --sombra: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
  --sombra-g: 0 10px 28px rgba(16, 24, 40, .09);
  --fonte: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --lateral: 264px;
  /* Tons do tema. O /tema.css publica os valores calculados a partir de Aparência; estes são os do padrão.
     Para texto na cor principal use --azul-texto (sempre com contraste de leitura); --sobre-* é o texto
     por cima da cor de mesmo nome (branco ou escuro, escolhido automaticamente). */
  --azul-texto: #006DA6;
  --azul-foco: rgba(0, 109, 166, .18);
  --sobre-azul: #FFFFFF;
  --sobre-azul-suave: #D6E8F3;
  --sobre-profundo: #FFFFFF;
  --sobre-profundo-suave: #D5E6F1;
  --sobre-profundo-leve: #E6F0F7;
  --destaque: var(--azul);
  --destaque-escuro: var(--azul-escuro);
  --destaque-claro: var(--azul-claro);
  --destaque-texto: var(--azul-texto);
  --destaque-sobre-escuro: #549DC3;
  --sobre-destaque: var(--sobre-azul);
  --botao: var(--azul);
  --botao-hover: var(--azul-escuro);
  --sobre-botao: var(--sobre-azul);
  --sobre-botao-hover: var(--sobre-azul);
  --fonte-titulos: var(--fonte);
}

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

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

body {
  margin: 0;
  font-family: var(--fonte);
  font-size: 16px;
  line-height: 1.6;
  color: var(--texto);
  background: var(--fundo-2);
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5 {
  line-height: 1.25;
  margin: 0 0 .5em;
  font-family: var(--fonte-titulos);
  font-weight: 650;
  color: var(--texto);
  hyphens: manual;
  letter-spacing: -.01em;
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.12rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
a { color: var(--azul-texto); text-underline-offset: 2px; }
a:hover { color: var(--azul-escuro); }
img { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--borda); margin: 1.5rem 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: var(--fundo-3); padding: .1em .35em; border-radius: 5px; }
blockquote { margin: 0 0 1em; padding: .6em 1em; border-left: 3px solid var(--azul-borda); background: var(--azul-claro); border-radius: 0 var(--raio) var(--raio) 0; }
ul, ol { padding-left: 1.3em; margin: 0 0 1em; }
li + li { margin-top: .25em; }

:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -3rem; background: var(--azul); color: var(--sobre-azul); padding: .5rem 1rem; border-radius: var(--raio); z-index: 100; }
.skip-link:focus { top: 1rem; color: var(--sobre-azul); }

.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 1.6em; height: 1.6em; }

/* ---------- Estrutura geral ---------- */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--lateral);
  background: var(--fundo); border-right: 1px solid var(--borda);
  display: flex; flex-direction: column; z-index: 30; overflow-y: auto;
}
/* Marca: o símbolo fica com 34 px (30 px no topo do celular) e o nome acompanha a altura dele, com as
   maiúsculas em pouco mais da metade da altura do símbolo. A altura da linha do nome fica abaixo da do
   símbolo para a faixa da marca não crescer. */
.sidebar-brand { display: flex; align-items: center; gap: .6rem; padding: 1.25rem 1.25rem 1rem; text-decoration: none; color: var(--texto); font-weight: 700; font-size: 1.6rem; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--azul); color: var(--sobre-azul); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 20px; height: 20px; stroke: var(--sobre-azul); fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font-family: var(--fonte-titulos); line-height: 1.3; letter-spacing: -.01em; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-name span { color: var(--destaque); }
/* Nome comprido configurado em Aparência (partials/brand.php): menor, em degraus, para caber inteiro. */
.brand-name-90 { font-size: .9em; }
.brand-name-80 { font-size: .8em; }
.brand-name-72 { font-size: .72em; }
/* Marca com logo ou ícone enviados em Aparência (partials/brand.php) */
.brand-logo { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; }
.brand-logo img { display: block; height: 36px; width: auto; max-width: min(200px, 100%); object-fit: contain; }
.brand-logo-claro { background: #fff; border-radius: 12px; padding: .45rem .75rem; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.brand-mark-img { background: transparent; overflow: hidden; }
.brand-mark-img img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sidebar-project { margin: 0 .9rem 1rem; padding: .75rem .9rem; border: 1px solid var(--borda); border-radius: var(--raio); background: var(--fundo-2); }
.sidebar-project small { display: block; color: var(--texto-3); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.sidebar-project strong { display: block; font-size: .95rem; line-height: 1.3; }
.sidebar-project a { font-size: .85rem; }
.nav { list-style: none; margin: 0; padding: 0 .6rem; }
.nav li + li { margin-top: 2px; }
.nav a { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-radius: 8px; color: var(--texto-2); text-decoration: none; font-weight: 520; font-size: .95rem; }
.nav a:hover { background: var(--fundo-2); color: var(--texto); }
.nav a[aria-current="page"] { background: var(--azul-claro); color: var(--azul-escuro); }
.nav-label { padding: 1rem 1.35rem .35rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-3); font-weight: 650; }
.nav .count { margin-left: auto; background: var(--destaque); color: var(--sobre-destaque); font-size: .72rem; border-radius: 99px; padding: 0 .45rem; line-height: 1.5; }
.sidebar-footer { margin-top: auto; padding: 1rem .6rem 1.25rem; border-top: 1px solid var(--borda); }
.main { margin-left: var(--lateral); min-height: 100vh; display: flex; flex-direction: column; }
.content { width: 100%; max-width: 1120px; margin: 0 auto; padding: 2rem 2rem 4rem; flex: 1; }
.content-narrow { max-width: 760px; }
.topbar { display: none; }
.env-bar { background: var(--ambar-claro); color: var(--ambar); font-size: .85rem; padding: .45rem 2rem; border-bottom: 1px solid #F0DDA8; display: flex; gap: .5rem; align-items: center; }
.env-bar.demo { background: #F1ECFB; color: #4B3A8C; border-bottom-color: #DCD2F3; }
.env-bar.teste { background: #E8F1FB; color: #1F4E86; border-bottom-color: #CFE0F4; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-header h1 { margin: 0; }
.page-header p { margin: .35rem 0 0; color: var(--texto-2); }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.eyebrow { font-size: .8rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--destaque-texto); margin-bottom: .35rem; display: block; }
.breadcrumb { font-size: .88rem; color: var(--texto-3); margin-bottom: .75rem; }
.breadcrumb a { color: var(--texto-3); }

/* ---------- Cartões e grades ---------- */
.card { background: var(--fundo); border: 1px solid var(--borda); border-radius: var(--raio-g); box-shadow: var(--sombra); padding: 1.5rem; }
.card + .card, .card + .stack, .stack + .card { margin-top: 1rem; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.card-title h2, .card-title h3 { margin: 0; }
.card-muted { background: var(--fundo-2); box-shadow: none; }
.card-accent { border-color: var(--azul-borda); background: linear-gradient(180deg, var(--azul-claro), var(--fundo) 70%); }
.card-link { display: block; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.card-link:hover { border-color: var(--azul-borda); box-shadow: var(--sombra-g); color: inherit; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: .5rem; }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.muted { color: var(--texto-2); }
.faint { color: var(--texto-3); }
.small { font-size: .88rem; }
.tiny { font-size: .78rem; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2.25rem; }
.mb-0 { margin-bottom: 0 !important; }
.center { text-align: center; }
.divider { height: 1px; background: var(--borda); margin: 1.25rem 0; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .6rem 1.15rem; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  background: var(--fundo); color: var(--texto); border-color: var(--borda-forte); transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--fundo-2); color: var(--texto); }
.btn-primary { background: var(--botao); border-color: var(--botao); color: var(--sobre-botao); }
.btn-primary:hover { background: var(--botao-hover); border-color: var(--botao-hover); color: var(--sobre-botao-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--azul-texto); }
.btn-ghost:hover { background: var(--azul-claro); color: var(--azul-escuro); }
.btn-danger { background: var(--fundo); color: var(--vermelho); border-color: #F2B8B5; }
.btn-danger:hover { background: var(--vermelho-claro); color: var(--vermelho); }
.btn-success { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn-success:hover { background: #0E5F3C; color: #fff; }
.btn-lg { min-height: 52px; padding: .8rem 1.5rem; font-size: 1.05rem; border-radius: 12px; }
.btn-sm { min-height: 36px; padding: .35rem .8rem; font-size: .88rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-color: #fff transparent #fff transparent; animation: girar .8s linear infinite; }
.btn:not(.btn-primary):not(.btn-success).is-loading::after { border-color: var(--azul) transparent var(--azul) transparent; }
.btn-primary.is-loading::after { border-color: var(--sobre-botao) transparent var(--sobre-botao) transparent; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--azul-texto); text-decoration: underline; cursor: pointer; }

/* ---------- Selos e avisos ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 99px; font-size: .78rem; font-weight: 650; background: var(--fundo-3); color: var(--texto-2); white-space: nowrap; }
.badge .icon { width: 1em; height: 1em; }
.badge-azul { background: var(--azul-claro); color: var(--azul-escuro); }
.badge-verde { background: var(--verde-claro); color: var(--verde); }
.badge-ambar { background: var(--ambar-claro); color: var(--ambar); }
.badge-vermelho { background: var(--vermelho-claro); color: var(--vermelho); }
.badge-roxo { background: #F1ECFB; color: #4B3A8C; }
.badge-cinza { background: var(--fundo-3); color: var(--texto-2); }

.alert { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1rem; border-radius: var(--raio); border: 1px solid var(--azul-borda); background: var(--azul-claro); color: var(--azul-profundo); margin-bottom: 1rem; }
.alert > .icon { margin-top: .15rem; }
.alert p:last-child { margin-bottom: 0; }
.alert-success { background: var(--verde-claro); border-color: #B5DEC8; color: #0B4F32; }
.alert-warning { background: var(--ambar-claro); border-color: #F1D69A; color: #5E3C00; }
.alert-error { background: var(--vermelho-claro); border-color: #F4BDB8; color: #7A1A12; }
.alert-test { background: #FFF8E6; border: 2px dashed #D9A62B; color: #5E3C00; font-weight: 600; }

/* ---------- Formulários ---------- */
.form .field + .field, .field + .field { margin-top: 1.1rem; }
.field label, .label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .95rem; }
.field .help { font-size: .85rem; color: var(--texto-3); margin: .3rem 0 0; }
.input, .select, .textarea, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], input[type="date"], input[type="time"], input[type="search"], input[type="datetime-local"], select, textarea {
  width: 100%; min-height: 46px; padding: .65rem .8rem; border: 1px solid var(--borda-forte); border-radius: 10px;
  font: inherit; font-size: 1rem; color: var(--texto); background: var(--fundo); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--azul); box-shadow: 0 0 0 3px var(--azul-foco); outline: none; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--vermelho); }
.field-error { color: var(--vermelho); font-size: .88rem; margin: .35rem 0 0; font-weight: 550; }
/* Sugestão de e-mail (sugestao-email.js): "O correto não seria: nome@hotmail.com?". Laranja escuro para ler
   bem sobre o branco (contraste acima de 4,5:1); o endereço sugerido é um botão que troca o e-mail. */
.email-sugestao { color: #B54708; font-size: .88rem; margin: .35rem 0 0; }
.email-sugestao[hidden] { display: none; }
/* Dados da nota fiscal no pedido (partials/billing_details.php): e-mail e endereço longos quebram a linha. */
.billing-details dd { overflow-wrap: anywhere; }
.email-sugestao button { font: inherit; color: var(--texto); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(22, 32, 42, .35); text-underline-offset: 2px; overflow-wrap: anywhere; text-align: left; }
.email-sugestao button:hover, .email-sugestao button:focus-visible { text-decoration-color: currentColor; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 450; cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; margin-top: .15rem; accent-color: var(--azul); flex: none; }
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; align-items: center; }
.input-group { display: flex; gap: .5rem; }
.input-group > input { flex: 1; }
fieldset { border: 1px solid var(--borda); border-radius: var(--raio); padding: 1rem 1.1rem 1.2rem; margin: 0 0 1rem; }
legend { font-weight: 650; padding: 0 .35rem; }
.password-toggle { font-size: .85rem; }

/* ---------- Entrada e autenticação ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--fundo); }
.auth-aside { background: var(--azul-profundo); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-aside::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .06); }
.auth-aside h1 { color: #fff; font-size: 2.15rem; max-width: 22ch; }
.auth-aside p { color: var(--sobre-profundo-suave); font-size: 1.05rem; max-width: 46ch; }
.auth-aside .sidebar-brand { color: #fff; padding: 0; }
.auth-aside .brand-name span { color: var(--destaque-sobre-escuro); }
.auth-aside .brand-logo img { height: 44px; max-width: min(240px, 100%); }
.auth-aside .brand-mark { background: #fff; }
.auth-brand { display: grid; gap: .35rem; }
.auth-aside .brand-mark svg { stroke: var(--azul); }
/* Destaques da faixa escura (Aparência e textos): frases curtas com um sinal de confirmação. */
.auth-points { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .9rem; max-width: 46ch; }
.auth-points li { display: flex; gap: .8rem; align-items: flex-start; color: var(--sobre-profundo-leve); margin: 0; }
.auth-points b { flex: none; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; }
.auth-points b .icon { width: 16px; height: 16px; stroke-width: 2.6; vertical-align: 0; }
.auth-points span { padding-top: .1rem; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h2 { font-size: 1.5rem; }
/* Monitor largo: o painel escuro passa de 700 px e o texto encostado na borda esquerda fica perdido. A coluna
   de texto (marca, chamada e rodapé, com a mesma borda esquerda) vai para o centro do painel, como o formulário
   no lado claro, e a letra cresce com a tela até um teto. */
@media (min-width: 1440px) {
  .auth-aside { padding: 3.5rem 4rem; gap: 2rem; }
  .auth-aside > *, .auth-aside > p { width: 100%; max-width: 40rem; margin-inline: auto; }
  /* A letra cresce com a largura e com a altura (a menor das duas): tela larga e baixa não estoura a altura. */
  .auth-aside h1 { font-size: clamp(2.15rem, 1rem + min(1.25vw, 2.2vh), 3.25rem); }
  .auth-aside h1 + p { font-size: clamp(1.05rem, .8rem + min(.35vw, .65vh), 1.3rem); }
  .auth-points { gap: 1.1rem; }
  .auth-points li { font-size: clamp(1rem, .8rem + min(.3vw, .55vh), 1.2rem); }
  .auth-points b { width: 32px; height: 32px; }
  .auth-aside::after { width: clamp(380px, 28vw, 640px); height: clamp(380px, 28vw, 640px); border-width: clamp(60px, 3.6vw, 100px); right: clamp(-200px, -8vw, -120px); bottom: clamp(-200px, -8vw, -120px); }
  .auth-card { max-width: 480px; }
  .auth-card h2 { font-size: 1.75rem; }
}
@media (min-width: 2200px) {
  .auth-card { max-width: 540px; }
  .auth-card h2 { font-size: 2rem; }
}
.simple-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; background: var(--fundo-2); }
.simple-card { width: 100%; max-width: 620px; }

/* ---------- Jornada (etapas) ---------- */
.journey { display: flex; gap: .25rem; list-style: none; padding: 0; margin: 0 0 1.5rem; counter-reset: etapa; flex-wrap: wrap; }
.journey li { flex: 1 1 0; min-width: 110px; margin: 0; padding: .55rem .6rem .6rem; border-top: 4px solid var(--fundo-3); font-size: .84rem; color: var(--texto-3); font-weight: 560; }
.journey li.done { border-top-color: var(--azul-borda); color: var(--texto-2); }
.journey li.current { border-top-color: var(--azul); color: var(--azul-escuro); font-weight: 700; }
.journey li span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 650; opacity: .85; }

/* ---------- Próximo passo e progresso ---------- */
.hero-step { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.25rem; align-items: center; }
.hero-step h2 { font-size: 1.45rem; margin-bottom: .35rem; }
.progress-block { display: grid; gap: .4rem; }
.progress-block .row { font-size: .9rem; }
progress { -webkit-appearance: none; appearance: none; width: 100%; height: 12px; border: 0; border-radius: 99px; background: var(--fundo-3); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--fundo-3); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--azul); border-radius: 99px; transition: width .4s ease; }
progress::-moz-progress-bar { background: var(--azul); border-radius: 99px; }
progress.success::-webkit-progress-value { background: var(--verde); }
progress.success::-moz-progress-bar { background: var(--verde); }
.stat { display: grid; gap: .15rem; }
.stat strong { font-size: 1.6rem; line-height: 1.1; }
.stat span { color: var(--texto-3); font-size: .85rem; }
.kpi { background: var(--fundo); border: 1px solid var(--borda); border-radius: var(--raio-g); padding: 1rem 1.1rem; }
.kpi .kpi-label { font-size: .82rem; color: var(--texto-3); font-weight: 600; }
.kpi .kpi-value { font-size: 1.65rem; font-weight: 700; line-height: 1.2; }
.kpi .kpi-note { font-size: .8rem; color: var(--texto-3); }
.kpi.alertado { border-color: #F4BDB8; background: var(--vermelho-claro); }

/* ---------- Lista de projetos ---------- */
.project-card { display: grid; gap: .6rem; }
.project-card h3 { margin: 0; }
.project-card .row { font-size: .9rem; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; background: var(--fundo); border: 1px solid var(--borda); border-radius: var(--raio-g); box-shadow: var(--sombra); min-height: 60vh; }
.chat-head { display: flex; align-items: center; gap: .75rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--borda); }
.chat-head .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--azul-claro); color: var(--azul); display: grid; place-items: center; flex: none; overflow: hidden; }
/* Atendente com foto ou, sem ela, as iniciais do nome. */
.chat-head .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-head .avatar-iniciais { color: var(--azul-texto); font-weight: 700; font-size: .95rem; letter-spacing: .02em; }
.chat-head strong { display: block; line-height: 1.2; }
.chat-head small { color: var(--texto-3); }
.chat-log { list-style: none; margin: 0; flex: 1; overflow-y: auto; padding: 1.25rem 1.1rem; display: flex; flex-direction: column; gap: .9rem; max-height: 62vh; min-height: 300px; scroll-behavior: smooth; }
.msg { max-width: min(78%, 680px); padding: .75rem 1rem; border-radius: 14px; line-height: 1.55; }
.msg p:last-child, .msg ul:last-child, .msg ol:last-child { margin-bottom: 0; }
.msg-assistant { align-self: flex-start; background: var(--fundo-2); border: 1px solid var(--borda); border-top-left-radius: 4px; }
.msg-user { align-self: flex-end; background: var(--azul); color: var(--sobre-azul); border-top-right-radius: 4px; white-space: pre-wrap; }
.msg-user a { color: var(--sobre-azul); }
.msg-notice { align-self: center; max-width: 92%; background: var(--ambar-claro); color: #5E3C00; font-size: .9rem; border-radius: 10px; }
.msg-failed { border-color: #F4BDB8; background: var(--vermelho-claro); }
.msg-meta { font-size: .75rem; color: var(--texto-3); margin-top: .25rem; }
.msg-user .msg-meta { color: var(--sobre-azul-suave); }
.msg .citations { margin-top: .5rem; font-size: .82rem; }
/* O balão da mensagem já tem espaçamento; aqui só um respiro para os pontos e o "Eduardo está escrevendo". */
.typing { display: inline-flex; gap: 4px; align-items: center; padding: .3rem .1rem; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--texto-3); animation: piscar 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
.typing-label { margin-left: .45rem; font-size: .85rem; color: var(--texto-3); }
.quick-replies { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0 1.1rem .75rem; }
.quick-replies button { border: 1px solid var(--azul-borda); background: var(--fundo); color: var(--azul-escuro); border-radius: 99px; padding: .45rem .9rem; font: inherit; font-size: .9rem; cursor: pointer; min-height: 40px; }
.quick-replies button:hover { background: var(--azul-claro); }
.chat-composer { border-top: 1px solid var(--borda); padding: .8rem; display: flex; gap: .6rem; align-items: flex-end; }
.chat-composer textarea { min-height: 48px; max-height: 180px; resize: none; }
.chat-composer .btn { flex: none; }
.chat-foot { display: flex; justify-content: space-between; gap: .5rem; padding: 0 1rem .8rem; font-size: .82rem; color: var(--texto-3); flex-wrap: wrap; }
.action-card { align-self: stretch; border: 1px solid var(--azul-borda); background: var(--azul-claro); border-radius: 12px; padding: .9rem 1rem; }
.action-card .row { margin-top: .6rem; }
.attach-list { display: flex; gap: .4rem; flex-wrap: wrap; font-size: .82rem; }
.chat-closed { margin: 0; padding: .9rem 1.1rem; border-top: 1px solid var(--borda); color: var(--texto-2); background: var(--fundo-2); border-radius: 0 0 var(--raio-g) var(--raio-g); }
.chat-attach { padding-inline: .7rem; cursor: pointer; }
.quick-replies form { display: contents; }
/* Seletor de arquivo em português (app.js): o input fica escondido só para os olhos, com o foco do teclado
   aparecendo no botão ao lado. */
/* O seletor leva input[type="file"] porque as regras gerais de arquivo (largura de 100%) têm esse peso: sem ele,
   o campo escondido ficava com a largura da tela e empurrava a página para o lado no celular. */
input[type="file"].file-picker-input { position: absolute; width: 1px; max-width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; opacity: 0; }
.file-picker { display: flex; align-items: center; gap: .4rem .7rem; flex-wrap: wrap; min-width: 0; }
.file-picker-btn { flex: none; }
.file-picker-name { font-size: .9rem; color: var(--texto-3); overflow-wrap: anywhere; min-width: 0; }
.file-picker.has-file .file-picker-name { color: var(--texto); font-weight: 600; }
.file-picker-input:focus-visible + .file-picker .file-picker-btn { outline: 3px solid var(--azul-foco); outline-offset: 2px; border-color: var(--azul); }
.file-picker-input[aria-invalid="true"] + .file-picker .file-picker-btn, .has-error .file-picker-btn { border-color: var(--vermelho); }
/* Próximo passo logo abaixo da conversa (o "Revisar resumo" no fim do briefing): no celular o painel lateral fica
   bem abaixo, e o cliente precisa achar o botão onde acabou de ler o pedido. */
.chat-cta { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; margin: 0 1.1rem .8rem; padding: .8rem .95rem; border: 1px solid #B7DDC9; background: var(--verde-claro); border-radius: var(--raio); }
.chat-cta p { margin: 0; display: flex; gap: .5rem; align-items: flex-start; flex: 1 1 16rem; color: var(--texto); line-height: 1.45; }
.chat-cta p .icon { color: var(--verde); flex: none; margin-top: .15em; }
.chat-cta form { margin: 0; flex: none; }
@media (max-width: 480px) {
  .chat-cta { margin-inline: .6rem; }
  .chat-cta form, .chat-cta .btn { width: 100%; }
}

/* ---------- Resumo do briefing e proposta ---------- */
.summary-section + .summary-section { margin-top: 1.25rem; }
.proposal-hero { background: var(--azul-profundo); color: #fff; border-radius: var(--raio-g); padding: 2.25rem 2rem; }
.proposal-hero h1 { color: #fff; font-size: 2rem; max-width: 26ch; }
.proposal-hero p { color: var(--sobre-profundo-suave); max-width: 62ch; font-size: 1.05rem; margin-bottom: 0; }
.deliverables { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.deliverables li { display: flex; gap: .65rem; align-items: flex-start; margin: 0; padding: .8rem .9rem; border: 1px solid var(--borda); border-radius: var(--raio); background: var(--fundo); }
.deliverables .icon { color: var(--azul); margin-top: .2rem; }
.price-box { border: 2px solid var(--azul); border-radius: var(--raio-g); padding: 1.5rem; background: var(--fundo); }
.price-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0 1.25rem; }
.price-option { border: 1px solid var(--borda); border-radius: var(--raio); padding: 1rem; }
.price-option strong { display: block; font-size: 1.35rem; color: var(--texto); }
.price-option span { color: var(--texto-2); font-size: .92rem; }
.pay-choice { display: grid; gap: .75rem; }
.pay-choice label { display: flex; gap: .75rem; align-items: flex-start; border: 1px solid var(--borda-forte); border-radius: var(--raio); padding: .9rem 1rem; cursor: pointer; font-weight: 500; }
.pay-choice label:has(input:checked) { border-color: var(--azul); background: var(--azul-claro); }
.pay-choice input { width: 20px; height: 20px; min-height: 0; accent-color: var(--azul); margin-top: .2rem; }

/* ---------- Linha do tempo de preparação ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1.4rem 2.4rem; margin: 0; }
.timeline li::before { content: ""; position: absolute; left: 11px; top: 26px; bottom: 0; width: 2px; background: var(--borda); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 2px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--borda-forte); background: var(--fundo); display: grid; place-items: center; }
.timeline .dot .icon { width: 14px; height: 14px; }
.timeline li.done .dot { background: var(--verde); border-color: var(--verde); color: #fff; }
.timeline li.current .dot { border-color: var(--azul); color: var(--azul); box-shadow: 0 0 0 4px var(--azul-claro); }
.timeline strong { display: block; }
.timeline span { color: var(--texto-3); font-size: .9rem; }

/* ---------- Estratégia ---------- */
.strategy-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.section-toggle { border: 1px solid var(--borda); border-radius: var(--raio-g); background: var(--fundo); box-shadow: var(--sombra); }
.section-toggle + .section-toggle { margin-top: .75rem; }
.section-toggle > summary { list-style: none; cursor: pointer; padding: 1.1rem 1.25rem; display: flex; align-items: center; gap: .75rem; font-weight: 650; font-size: 1.08rem; }
.section-toggle > summary::-webkit-details-marker { display: none; }
.section-toggle > summary::after { content: ""; margin-left: auto; width: 10px; height: 10px; border-right: 2px solid var(--texto-3); border-bottom: 2px solid var(--texto-3); transform: rotate(45deg); transition: transform .2s; flex: none; }
.section-toggle[open] > summary::after { transform: rotate(-135deg); }
.section-body { padding: 0 1.25rem 1.25rem; }
.section-body h4 { margin-top: 1rem; }
.callout { border-left: 4px solid var(--destaque); background: var(--azul-claro); padding: .8rem 1rem; border-radius: 0 var(--raio) var(--raio) 0; margin: 0 0 1rem; }
.callout-warn { border-left-color: #D9A62B; background: var(--ambar-claro); }
.chip-list { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0; }
.chip-list li { margin: 0; }
.chip { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--borda); border-radius: 99px; padding: .2rem .7rem; font-size: .85rem; color: var(--texto-2); background: var(--fundo); text-decoration: none; }
a.chip:hover { border-color: var(--azul-borda); color: var(--azul-escuro); }
.evidence-tag { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .05rem .45rem; border-radius: 5px; }
.evidence-tag.observado { background: var(--verde-claro); color: var(--verde); }
.evidence-tag.relatado { background: var(--azul-claro); color: var(--azul-escuro); }
.evidence-tag.hipotese { background: var(--ambar-claro); color: var(--ambar); }
.md-table-wrap { overflow-x: auto; margin: 0 0 1rem; }
.md-table, .table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.md-table th, .md-table td { border: 1px solid var(--borda); padding: .45rem .6rem; text-align: left; vertical-align: top; }
.md-table th { background: var(--fundo-2); }

/* ---------- Mapa de ação ---------- */
.plan-map { position: relative; margin: .5rem 0 1.5rem; }
.plan-track { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; list-style: none; padding: 0; margin: 0; position: relative; }
.plan-track::before { content: ""; position: absolute; left: 10%; right: 10%; top: 31px; height: 4px; background: var(--fundo-3); border-radius: 4px; }
.plan-track li { margin: 0; position: relative; }
.plan-node { width: 100%; background: none; border: 0; padding: 0; font: inherit; text-align: center; cursor: pointer; color: inherit; display: grid; justify-items: center; gap: .5rem; }
.plan-dot { width: 66px; height: 66px; border-radius: 50%; background: var(--fundo); border: 3px solid var(--borda-forte); display: grid; place-items: center; position: relative; z-index: 1; transition: transform .2s, border-color .2s, box-shadow .2s; }
.plan-dot svg.ring { position: absolute; inset: -3px; width: 66px; height: 66px; transform: rotate(-90deg); }
.plan-dot .icon { width: 26px; height: 26px; color: var(--texto-3); }
.plan-node:hover .plan-dot { transform: translateY(-2px); }
.plan-node[aria-pressed="true"] .plan-dot { border-color: var(--azul); box-shadow: 0 0 0 5px var(--azul-claro); }
.plan-node.is-done .plan-dot { background: var(--verde); border-color: var(--verde); }
.plan-node.is-done .plan-dot .icon { color: #fff; }
.plan-node.is-current .plan-dot { border-color: var(--azul); }
.plan-node.is-current .plan-dot .icon { color: var(--azul); }
.plan-label { font-weight: 700; font-size: .98rem; line-height: 1.2; }
.plan-sub { font-size: .8rem; color: var(--texto-3); line-height: 1.3; }
.plan-state { font-size: .78rem; font-weight: 650; }
.phase-panel { margin-top: 1rem; }
.phase-panel[hidden] { display: none; }
.phase-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }

/* ---------- Checklist e tarefas ---------- */
.phase-group + .phase-group { margin-top: 2rem; }
.phase-group > header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; flex-wrap: wrap; }
.phase-group > header h2 { margin: 0; font-size: 1.2rem; }
.task-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.task-list li { margin: 0; }
.task { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .9rem; align-items: start; background: var(--fundo); border: 1px solid var(--borda); border-radius: 14px; padding: .9rem 1rem; box-shadow: var(--sombra); transition: border-color .2s, background .2s; }
.task.is-done { background: #FAFCFB; }
.task.is-done .task-title { color: var(--texto-2); text-decoration: line-through; text-decoration-color: var(--borda-forte); }
.task.is-blocked { border-color: #F1D69A; }
.task.is-next { border-color: var(--azul); box-shadow: 0 0 0 3px var(--azul-claro); }
.task-toggle { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--borda-forte); background: var(--fundo); display: grid; place-items: center; cursor: pointer; color: transparent; flex: none; transition: all .15s; }
.task-toggle:hover { border-color: var(--azul); color: var(--azul-borda); }
.task-toggle[aria-pressed="true"] { background: var(--verde); border-color: var(--verde); color: #fff; }
.task-toggle[disabled] { cursor: not-allowed; opacity: .5; }
.task-toggle .icon { width: 22px; height: 22px; stroke-width: 3; }
.task-title { font-weight: 650; margin: 0 0 .2rem; line-height: 1.35; }
.task-title a { color: inherit; text-decoration: none; }
.task-title a:hover { color: var(--azul-texto); text-decoration: underline; }
.task-meta { display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: .84rem; color: var(--texto-3); align-items: center; }
.task-meta .icon { width: 1em; height: 1em; }
.task-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .6rem; }
.status-select { width: auto; min-height: 36px; padding: .25rem .6rem; font-size: .88rem; }
.instructions { counter-reset: passo; list-style: none; padding: 0; }
.instructions li { counter-increment: passo; position: relative; padding-left: 2.4rem; margin: 0 0 .8rem; }
.instructions li::before { content: counter(passo); position: absolute; left: 0; top: 0; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--azul-claro); color: var(--azul-escuro); font-weight: 700; font-size: .85rem; display: grid; place-items: center; }
.def-list { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: .5rem 1.25rem; margin: 0; }
.def-list dt { color: var(--texto-3); font-weight: 600; font-size: .9rem; }
.def-list dd { margin: 0; }

/* ---------- Materiais ---------- */
.material-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 1rem; align-items: start; }
.material-cover { width: 96px; height: 124px; border-radius: 8px; background: var(--azul-claro); display: grid; place-items: center; overflow: hidden; border: 1px solid var(--borda); color: var(--azul); }
.material-cover img { width: 100%; height: 100%; object-fit: cover; }
.material-cover .icon { width: 34px; height: 34px; }
.material-cover-lg { width: 180px; height: 232px; }

/* ---------- Tabelas do painel ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--borda); border-radius: var(--raio-g); background: var(--fundo); }
.table th, .table td { padding: .7rem .85rem; border-bottom: 1px solid var(--borda); text-align: left; vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--texto-3); background: var(--fundo-2); font-weight: 650; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }
.table a { font-weight: 600; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { margin: 0; }
.filters .field + .field { margin-top: 0; }
.filters input, .filters select { min-height: 40px; padding: .4rem .7rem; font-size: .92rem; }
.pagination { display: flex; gap: .4rem; margin-top: 1rem; align-items: center; flex-wrap: wrap; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--borda); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a { padding: .6rem .9rem; text-decoration: none; color: var(--texto-2); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--azul-escuro); border-bottom-color: var(--azul); }
.code-block { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; background: var(--fundo-2); border: 1px solid var(--borda); border-radius: var(--raio); padding: .9rem; white-space: pre-wrap; word-break: break-word; max-height: 460px; overflow: auto; }
.diff-add { background: #E6F4ED; display: block; }
.diff-del { background: #FDECEA; display: block; text-decoration: line-through; }

/* ---------- Estados vazios e carregamento ---------- */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--texto-2); }
.empty .icon { width: 42px; height: 42px; color: var(--azul-borda); margin-bottom: .5rem; }
.empty h3 { color: var(--texto); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--azul-claro); border-top-color: var(--azul); animation: girar .9s linear infinite; display: inline-block; vertical-align: middle; }
.loading-panel { display: flex; gap: .9rem; align-items: center; padding: 1.25rem; }
.toast-area { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; z-index: 60; max-width: min(420px, calc(100vw - 2rem)); }
.toast { background: var(--texto); color: #fff; padding: .8rem 1rem; border-radius: var(--raio); box-shadow: var(--sombra-g); font-size: .93rem; }
.toast.error { background: var(--vermelho); }
.toast.success { background: var(--verde); }

dialog { border: 0; border-radius: var(--raio-g); padding: 0; width: min(560px, calc(100vw - 2rem)); box-shadow: var(--sombra-g); color: var(--texto); }
dialog::backdrop { background: rgba(10, 25, 40, .45); }
.dialog-body { padding: 1.5rem; }
.dialog-actions { display: flex; gap: .6rem; justify-content: flex-end; padding: 0 1.5rem 1.5rem; flex-wrap: wrap; }

.qr-box { display: grid; place-items: center; padding: 1rem; background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); width: fit-content; margin: 0 auto; }
.qr-box svg { width: 220px; height: 220px; }
.codes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem; }
.codes-grid span { background: var(--fundo-2); border: 1px solid var(--borda); border-radius: 8px; padding: .45rem .6rem; text-align: center; letter-spacing: .06em; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem 0; border-bottom: 1px solid var(--borda); margin: 0; }
.check-list .ok { color: var(--verde); }
.check-list .fail { color: var(--vermelho); }
.check-list .warn { color: var(--ambar); }
/* Caminhos de pasta (sem espaços) quebram onde precisar, sem rolagem lateral no celular. */
.check-list li > div { min-width: 0; overflow-wrap: anywhere; }
.help code, .alert code { overflow-wrap: anywhere; }

.footer { border-top: 1px solid var(--borda); padding: 1.25rem 2rem; color: var(--texto-3); font-size: .85rem; display: flex; gap: 1rem; flex-wrap: wrap; justify-content: space-between; background: var(--fundo); }
.footer a { color: var(--texto-3); }

@keyframes girar { to { transform: rotate(360deg); } }
@keyframes piscar { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes surgir { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.appear { animation: surgir .3s ease both; }

/* ---------- Telas médias ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--sombra-g); }
  .sidebar.is-open { transform: none; }
  .main { margin-left: 0; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; position: sticky; top: 0; z-index: 25; background: var(--fundo); border-bottom: 1px solid var(--borda); padding: .6rem 1rem; }
  .topbar .sidebar-brand { padding: 0; font-size: 1.4rem; min-width: 0; flex: 1 1 auto; overflow: hidden; }
  .topbar .menu-toggle { flex: none; }
  .topbar .brand-mark { width: 30px; height: 30px; }
  .topbar .brand-logo img { height: 30px; max-width: 150px; }
  .menu-toggle { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .4rem .8rem; border-radius: 10px; border: 1px solid var(--borda-forte); background: var(--fundo); font: inherit; font-weight: 600; cursor: pointer; color: var(--texto); }
  .scrim { position: fixed; inset: 0; background: rgba(10, 25, 40, .35); z-index: 28; }
  .scrim[hidden] { display: none; }
  .content { padding: 1.5rem 1.25rem 3rem; }
  .env-bar { padding: .45rem 1.25rem; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-aside { padding: 2rem 1.5rem; gap: 1.75rem; }
  .auth-aside h1 { font-size: 1.6rem; }
  .auth-aside::after { display: none; }
}

/* ---------- Celular ---------- */
@media (max-width: 720px) {
  body { font-size: 16px; }
  h1 { font-size: 1.45rem; }
  h2 { font-size: 1.2rem; }
  .content { padding: 1.1rem 1rem 3rem; }
  .card { padding: 1.1rem; border-radius: 14px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero-step { grid-template-columns: 1fr; }
  .hero-step .btn { width: 100%; }
  .page-header { flex-direction: column; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .deliverables, .price-options { grid-template-columns: 1fr; }
  .proposal-hero { padding: 1.5rem 1.2rem; }
  .proposal-hero h1 { font-size: 1.5rem; }
  .msg { max-width: 90%; }
  .chat { min-height: 70vh; border-radius: 14px; }
  .chat-log { max-height: none; min-height: 50vh; padding: 1rem .8rem; }
  .journey li { min-width: 0; flex-basis: 30%; font-size: .78rem; padding: .45rem .3rem; }
  .journey li span { display: none; }
  /* Mapa vira sequência vertical de cartões tocáveis, em vez de uma faixa espremida. */
  .plan-track { grid-template-columns: 1fr; gap: .6rem; }
  .plan-track::before { left: 32px; right: auto; top: 20px; bottom: 20px; width: 4px; height: auto; }
  .plan-node { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; align-items: center; gap: .9rem; background: var(--fundo); border: 1px solid var(--borda); border-radius: 14px; padding: .6rem .8rem; min-height: 72px; }
  .plan-node[aria-pressed="true"] { border-color: var(--azul); }
  .plan-dot { width: 50px; height: 50px; }
  .plan-dot svg.ring { width: 50px; height: 50px; }
  .plan-dot .icon { width: 20px; height: 20px; }
  .plan-text { display: grid; gap: .1rem; }
  .material-card { grid-template-columns: 72px minmax(0, 1fr); }
  .material-cover { width: 72px; height: 94px; }
  .def-list { grid-template-columns: 1fr; gap: .15rem; }
  .def-list dd { margin-bottom: .6rem; }
  .table-wrap { border-radius: 12px; }
  .footer { padding: 1rem; }
  .codes-grid { grid-template-columns: 1fr 1fr; font-size: .95rem; }
  .task { padding: .8rem .8rem; gap: .7rem; }
}

/* Celular estreito (menos de 360 px): o botão Menu mostra só o ícone (e a contagem de avisos, quando há),
   para a marca do topo caber inteira no mesmo tamanho. A palavra Menu continua para leitores de tela. */
@media (max-width: 359px) {
  .menu-toggle-rotulo { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

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

@media print {
  .sidebar, .topbar, .strategy-actions, .page-actions, .footer, .env-bar { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; }
}

.install-head { margin-bottom: 1.25rem; }
.p-0 { padding: 0 !important; }

/* Ajustes gerais consolidados dos módulos do painel */
.table-wrap { position: relative; }
.card-title { flex-wrap: wrap; }
.grid > .card + .card, .grid > .field + .field, .grid > .stack + .stack { margin-top: 0; }
.field label.check { font-weight: 450; }
.empty .btn .icon { width: 1.15em; height: 1.15em; margin: 0; color: inherit; }
.help { font-size: .85rem; color: var(--texto-3); margin: .3rem 0 0; }
input[type="file"] { width: 100%; font: inherit; font-size: .95rem; padding: .55rem; border: 1px dashed var(--borda-forte); border-radius: 10px; background: var(--fundo-2); color: var(--texto-2); }
input[type="file"]::file-selector-button { font: inherit; font-weight: 600; margin-right: .75rem; padding: .45rem .9rem; border-radius: 8px; border: 1px solid var(--borda-forte); background: var(--fundo); color: var(--texto); cursor: pointer; }
.filters .field input, .filters .field select { min-width: 0; }
.landing-origin { border: 1px solid var(--azul-borda); background: var(--azul-claro); border-radius: var(--raio); padding: .8rem 1rem; margin-bottom: 1.25rem; }
.landing-origin strong { display: block; font-size: 1.02rem; line-height: 1.35; }
.landing-origin p { margin: .35rem 0 0; }

/* Conversa no celular: o botão de enviar vira só ícone (o nome continua no aria-label) para sobrar espaço ao texto. */
@media (max-width: 480px) {
  .chat-composer { gap: .4rem; padding: .6rem; }
  .chat-composer .btn span { display: none; }
  .chat-composer .btn { padding-inline: .75rem; }
}

/* ---------- Senha gerada (cadastro e ficha do cliente no painel) ----------
   Cartão de destaque com a senha criada automaticamente no cadastro (partials/generated_password.php)
   e com a senha nova gerada pela equipe. A senha vai em letra de largura fixa, grande e selecionável
   com um toque, para ser lida e copiada sem confundir caracteres; em telas estreitas só quebra nos hífens. */
.generated-password { border: 2px solid var(--destaque); box-shadow: var(--sombra-g); margin-bottom: 1.5rem; }
.generated-password h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.25rem; }
.generated-password h2 .icon { color: var(--destaque-texto); }
.generated-password p { max-width: 70ch; }
.generated-password-box { display: flex; flex-wrap: wrap; align-items: stretch; gap: .6rem; max-width: 36rem; margin: 0 0 1rem; }
.generated-password-value {
  flex: 1 1 15rem; min-width: 0; display: flex; align-items: center; justify-content: center;
  padding: .55rem .9rem; border: 1px dashed var(--azul-borda); border-radius: var(--raio); background: var(--azul-claro);
  color: var(--texto); font-size: clamp(1.1rem, 5vw, 1.6rem); font-weight: 700; letter-spacing: .06em; line-height: 1.35;
  text-align: center; overflow-wrap: normal; -webkit-user-select: all; user-select: all;
}
.generated-password-box .btn { flex: 0 0 auto; }
.generated-password-done { margin: 0; }
.entry-consent { margin: .75rem 0 1.5rem; }
@media (max-width: 720px) {
  .generated-password h2 { font-size: 1.12rem; }
  .generated-password-box .btn, .generated-password-done .btn { width: 100%; }
}

/* ---------- Verificação em duas etapas do cliente ----------
   Conta e segurança, tela de ativação (QR, chave e código) e o passo do código na entrada. O QR encolhe
   em telas estreitas para caber na lista de passos sem rolagem para o lado. */
.two-factor-setup .instructions li { padding-bottom: .25rem; }
.two-factor-setup .qr-box { width: 100%; max-width: calc(220px + 1.5rem + 2px); margin: 0; padding: .75rem; }
.two-factor-setup .qr-box svg { width: 100%; height: auto; display: block; }
.two-factor-key { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.two-factor-key code { font-size: .95rem; letter-spacing: .04em; padding: .35em .6em; }
input.two-factor-code { max-width: 12rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.35rem; letter-spacing: .2em; }
.two-factor-off summary { cursor: pointer; color: var(--azul-texto); font-weight: 600; }
.two-factor .card-title .badge { white-space: normal; }
.two-factor-challenge { max-width: 480px; }
.two-factor-challenge h1 { font-size: 1.5rem; }
.two-factor-challenge .sidebar-brand { margin-bottom: 1.25rem; }
