/* Meu Portal · 03 — Personalizar chat
   Modal de aparência, abas, conversão, cartões de layout do calendário e a prévia da folha do chat (.fpv). */

.appearance-section {
  border: 1px solid #d7ddd9;
  border-radius: 22px;
  padding: 1.2rem;
  background: #fff;
  box-shadow: 0 14px 34px rgba(18, 37, 39, 0.06);
}
.appearance-actions { display: flex; gap: .65rem; flex-wrap: wrap; align-items: center; margin-top: .9rem; }
.appearance-hint { margin: .75rem 0 0; color: #5e6c70; font-size: .86rem; line-height: 1.5; }
.appearance-hint.locked { color: #92400e; }
.appearance-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 22px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.48);
}
.appearance-dialog {
  width: min(1040px, 100%);
  height: min(860px, calc(100vh - 44px));
  height: min(860px, calc(100dvh - 44px));
  max-height: calc(100vh - 44px);
  max-height: calc(100dvh - 44px);
  min-height: 0;
  margin: auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 1rem;
  overflow: hidden;
  box-sizing: border-box;
  border-radius: 22px;
  border: 1px solid #d7ddd9;
  background: #f8faf9;
  box-shadow: 0 26px 80px rgba(15, 23, 42, 0.24);
}
.appearance-editor, .appearance-preview {
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  box-sizing: border-box;
  overflow: auto;
  padding: 1.1rem;
  overscroll-behavior: contain;
}
.appearance-editor {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}
.appearance-preview { background: #eef3f0; border-left: 1px solid #d7ddd9; }
.appearance-modal-head {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.appearance-modal-head h3 { margin: 0 0 .25rem; font-size: 1.12rem; }
.appearance-modal-head p { margin: 0; color: #617174; font-size: .88rem; }
.appearance-editor > .appearance-hint { flex: 0 0 auto; }
.appearance-close {
  width: 36px;
  height: 36px;
  border: 1px solid #d7ddd9;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 1.2rem;
  color: #405356;
}
.appearance-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
}
.appearance-field label {
  display: block;
  margin-bottom: .35rem;
  color: #405356;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.appearance-field input,
.appearance-field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfd8d3;
  border-radius: 10px;
  padding: .55rem .7rem;
  background: #fff;
  color: #132022;
  font-family: inherit;
  font-size: .9rem;
}
.appearance-color-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: .5rem;
  align-items: center;
}
.appearance-color-row input[type="color"] {
  padding: 2px;
  cursor: pointer;
}
.appearance-presets {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin: .4rem 0 1rem;
}
.appearance-presets button {
  border: 1px solid #d7ddd9;
  border-radius: 999px;
  padding: .45rem .75rem;
  background: #fff;
  color: #203437;
  cursor: pointer;
  font-weight: 700;
  font-size: .82rem;
}
/* Abas do modal Personalizar chat (Visual / Agendamento) */
.appearance-tabs { flex: 0 0 auto; display: flex; gap: .35rem; margin: .2rem 0 1rem; border-bottom: 1px solid #e2e8e4; }
.appearance-tab {
  border: none; background: none; cursor: pointer; padding: .55rem .85rem;
  font-weight: 700; font-size: .9rem; color: #5e6c70; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.appearance-tab:hover { color: #203437; }
.appearance-tab.active { color: #0f766e; border-bottom-color: #0f766e; }
.appearance-tab.hidden { display: none; }
.appearance-pane {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: .25rem;
  scrollbar-gutter: stable;
}
.appearance-pane.hidden { display: none; }
.appearance-tab-hint { margin: 0 0 1rem; color: #5e6c70; font-size: .88rem; line-height: 1.5; }
/* Painel "Conversão" — subtítulo, texto de confiança e botões rápidos */
.appearance-conv-field { margin-bottom: 1.1rem; }
.appearance-conv-label {
  display: block; margin-bottom: .35rem; color: #405356;
  font-size: .76rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
.appearance-conv-switch {
  display: flex; align-items: center; gap: .5rem; cursor: pointer;
  font-size: .9rem; font-weight: 700; color: #203437; margin-bottom: .1rem;
}
.appearance-conv-switch input { width: auto; min-height: 0; }
.appearance-conv-field input[type="text"],
.appearance-conv-field textarea {
  width: 100%; border: 1px solid #cfd8d3; border-radius: 10px;
  padding: .55rem .7rem; background: #fff; color: #132022; font-family: inherit; font-size: .9rem;
}
.appearance-conv-field textarea { min-height: 70px; resize: vertical; margin-top: .5rem; }
.appearance-conv-help { margin: .35rem 0 0; color: #5e6c70; font-size: .78rem; line-height: 1.45; }
.appearance-qr-list { display: flex; flex-direction: column; gap: .55rem; margin-top: .6rem; }
.appearance-qr-list.appearance-conv-off { opacity: .5; }
.appearance-qr-row { display: flex; gap: .5rem; align-items: flex-start; }
.appearance-qr-inputs { flex: 1; display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.appearance-qr-inputs input {
  width: 100%; border: 1px solid #cfd8d3; border-radius: 8px;
  padding: .5rem .6rem; font-size: .86rem; font-family: inherit; color: #132022;
}
.appearance-qr-remove {
  flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid #e2c9c9;
  background: #fff5f5; color: #b42318; border-radius: 8px; cursor: pointer; font-size: 1.1rem; line-height: 1;
}
.appearance-qr-remove:hover { background: #fee2e2; }
.appearance-qr-add {
  margin-top: .6rem; border: 1px dashed #0f766e; background: #f0faf7; color: #0f766e;
  border-radius: 10px; padding: .5rem .8rem; cursor: pointer; font-weight: 700; font-size: .85rem;
}
.appearance-qr-add:disabled { opacity: .45; cursor: not-allowed; }
/* Cards de escolha do layout do calendário */
.callay-options { display: grid; gap: .7rem; }
.callay-card {
  display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: .85rem;
  width: 100%; text-align: left; cursor: pointer;
  border: 1.5px solid #d7ddd9; border-radius: 14px; background: #fff; padding: .75rem .85rem;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.callay-card:hover { border-color: #0f766e; }
.callay-card.active { border-color: #0f766e; box-shadow: 0 0 0 3px rgba(15,118,110,.12); }
.callay-card-title { margin: 0; font-weight: 700; font-size: .92rem; color: #203437; display: flex; align-items: center; gap: .4rem; }
.callay-card-title .callay-dot {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid #c2ccc7; flex: 0 0 auto;
}
.callay-card.active .callay-dot { border-color: #0f766e; background: radial-gradient(circle, #0f766e 0 45%, #fff 55% 100%); }
.callay-card-desc { margin: .2rem 0 0; color: #5e6c70; font-size: .8rem; line-height: 1.4; }
/* Mini-mockups de cada layout, desenhados com as cores do chat do dono (variáveis
   --chat-* aplicadas em #appearanceCalendarLayouts por applySheetPreviewTheme). */
.callay-mock { width: 96px; height: 70px; background: var(--chat-surface, #fff); border: 1px solid var(--chat-line, #e2e8e4); border-radius: 9px; padding: 7px; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.callay-row { display: flex; gap: 3px; }
.callay-day { flex: 1; height: 19px; border-radius: 4px; border: 1px solid var(--chat-line-strong, #d7ddd9); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.callay-day::before, .callay-day::after { content: ""; display: block; height: 2px; border-radius: 1px; }
.callay-day::before { width: 10px; background: var(--chat-bot-text, #203437); opacity: .75; }
.callay-day::after { width: 7px; background: var(--chat-primary-ink, #0f766e); }
.callay-day.on { background: var(--chat-primary, #0f766e); border-color: var(--chat-primary, #0f766e); }
.callay-day.on::before, .callay-day.on::after { background: var(--chat-on-primary, #fff); opacity: .9; }
.callay-pill { width: 18px; height: 6px; border-radius: 99px; border: 1px solid var(--chat-line-strong, #d7ddd9); }
.callay-pill.on { background: var(--chat-bot-text, #203437); border-color: var(--chat-bot-text, #203437); }
.callay-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.callay-grid.sm { grid-template-columns: repeat(3, 1fr); }
.callay-grid span { height: 9px; border-radius: 3px; border: 1px solid var(--chat-line-strong, #d7ddd9); }
.callay-grid span.on { background: var(--chat-primary, #0f766e); border-color: var(--chat-primary, #0f766e); }
.callay-acc { flex: 0 0 11px; border-radius: 4px; border: 1px solid var(--chat-line-strong, #d7ddd9); display: flex; align-items: center; gap: 3px; padding: 0 4px; }
.callay-acc::before { content: ""; width: 24px; height: 2px; border-radius: 1px; background: var(--chat-bot-text, #203437); opacity: .75; }
.callay-acc::after { content: ""; width: 12px; height: 2px; margin-left: auto; border-radius: 1px; background: var(--chat-muted, #94a3b8); }
.callay-acc.on { border-color: var(--chat-primary, #0f766e); }
.callay-acc.on::before { background: var(--chat-primary-ink, #0f766e); opacity: 1; }
.callay-cap { width: 14px; height: 2px; margin-top: 2px; border-radius: 1px; background: var(--chat-muted, #94a3b8); }
.callay-sel { flex: 0 0 15px; border-radius: 4px; border: 1px solid var(--chat-line-strong, #d7ddd9); display: flex; align-items: center; padding: 0 5px; }
.callay-sel::before { content: ""; width: 34px; height: 2px; border-radius: 1px; background: var(--chat-bot-text, #203437); opacity: .75; }
.callay-sel::after { content: ""; width: 4px; height: 4px; margin-left: auto; border-right: 1.5px solid var(--chat-muted, #94a3b8); border-bottom: 1.5px solid var(--chat-muted, #94a3b8); transform: translateY(-1px) rotate(45deg); }
/* Aba Agendamento: a pré-via é a mesma folha do chat (renderSheetPreview), num celular */
.calpv-wrap { width: min(100%, 320px); display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.calpv-wrap-title, .calpv-note { margin: 0; padding: .3rem .75rem; border-radius: 999px; background: rgba(255, 255, 255, .9); color: #334155; font-size: .76rem; font-weight: 700; text-align: center; }
.calpv-note { font-weight: 600; color: #475569; }

/* ── Prévia da folha do chat ─────────────────────────────────────────
   Espelha a folha de serviço do widget público (microbots/index.html):
   mesmas etapas, textos, layouts de horário e cores derivadas do chat_appearance.
   Valores padrão = tema padrão do chat; renderSheetPreview aplica os do dono. */
.aw-phone .preview-screen.fpv-host { padding: 0; overflow: hidden; background: #0f1115; }
.fpv {
  --chat-primary: #4f46e5; --chat-surface: #ffffff; --chat-bot-text: #111827; --chat-page: #f0f2f5;
  --chat-header-bg: #4f46e5; --chat-header-text: #ffffff; --chat-input-bg: #ffffff; --chat-input-border: #d1d5db;
  --chat-on-primary: #ffffff; --chat-primary-ink: #4f46e5; --chat-ring: rgba(79, 70, 229, .24);
  --chat-tint: #eeeefc; --chat-tint-strong: #dcdcfa; --chat-line: #e2e3e6; --chat-line-strong: #c9cbcf;
  --chat-muted: #6c7078; --chat-raise: #f6f6f7; --chat-raise-2: #edeef0; --chat-error: #c4321f;
  --chat-scrim: rgba(6, 8, 12, .46); --chat-radius-md: 12px; --chat-radius-lg: 18px; --fpv-font: sans-serif;
  position: relative; height: 100%; min-height: 380px; overflow: hidden;
  background: var(--chat-page); color: var(--chat-bot-text);
  font-family: var(--fpv-font); font-size: 14px; line-height: 1.4; text-align: left;
}
.fpv[data-font="grotesk"] { --fpv-font: "Space Grotesk", sans-serif; }
.fpv[data-font="rounded"] { --fpv-font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif; }
.fpv[data-radius="square"] { --chat-radius-md: 4px; --chat-radius-lg: 6px; }
.fpv[data-radius="soft"] { --chat-radius-md: 10px; --chat-radius-lg: 14px; }
.fpv *, .fpv *::before, .fpv *::after { box-sizing: border-box; }
/* :where() zera a especificidade: tamanho e peso de cada classe abaixo prevalecem */
:where(.fpv) :is(button, input, select, textarea) { font-family: inherit; letter-spacing: normal; text-transform: none; margin: 0; }
.fpv-chathead { display: flex; align-items: center; gap: 9px; padding: 26px 14px 16px; background: var(--chat-header-bg); color: var(--chat-header-text); }
.fpv-chathead-av { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; display: grid; place-items: center; background: var(--chat-primary); color: var(--chat-on-primary); font-size: 13px; font-weight: 800; box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
.fpv-chathead-t { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.fpv-chathead-t b, .fpv-chathead-t small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fpv-chathead-t b { font-size: 13.5px; }
.fpv-chathead-t small { font-size: 11px; opacity: .8; }
.fpv-scrim { position: absolute; inset: 0; background: var(--chat-scrim); }
.fpv-sheet { position: absolute; left: 0; right: 0; bottom: 0; top: 62px; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; background: var(--chat-surface); color: var(--chat-bot-text); border-radius: calc(var(--chat-radius-lg) + 6px) calc(var(--chat-radius-lg) + 6px) 0 0; box-shadow: 0 -18px 46px rgba(0, 0, 0, .28); }
.fpv-grab { flex: 0 0 4px; width: 38px; height: 4px; margin: 8px auto 2px; border-radius: 3px; background: var(--chat-line-strong); }
.fpv-head { display: flex; align-items: center; gap: 6px; padding: 4px 10px 8px; }
.fpv-head-t { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: center; line-height: 1.25; }
.fpv-head-t small { font-size: 11px; font-weight: 700; color: var(--chat-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fpv-head-t strong { font-size: 13.5px; }
.fpv-ib { width: 34px; height: 34px; flex: 0 0 34px; padding: 0; border: 0; border-radius: 50%; background: var(--chat-raise); color: var(--chat-bot-text); display: grid; place-items: center; cursor: pointer; }
.fpv-ib svg { width: 16px; height: 16px; }
.fpv-ib.is-hidden { visibility: hidden; }
.fpv-ib.is-static { cursor: default; }
.fpv-progress { display: flex; gap: 4px; padding: 0 16px; }
.fpv-progress i { flex: 1; height: 4px; border-radius: 2px; background: var(--chat-raise-2); }
.fpv-progress i.on { background: var(--chat-primary); }
.fpv-chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px 16px 0; }
.fpv-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 4px 10px 4px 7px; border: 0; border-radius: 999px; background: var(--chat-tint); color: var(--chat-primary-ink); font-size: 11.5px; font-weight: 700; cursor: pointer; }
.fpv-chip svg { width: 12px; height: 12px; flex: 0 0 auto; }
.fpv-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fpv-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px 16px; scrollbar-width: thin; }
.fpv-q { margin: 0 0 4px; font-size: 18.5px; font-weight: 800; line-height: 1.22; letter-spacing: -.01em; color: var(--chat-bot-text); }
.fpv-sub { margin: 0 0 14px; font-size: 12.5px; line-height: 1.5; color: var(--chat-muted); }
.fpv-sub.fpv-bottom { margin: 10px 0 0; }
.fpv-banner { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; padding: 9px 10px; border-radius: var(--chat-radius-md); background: var(--chat-tint); color: var(--chat-bot-text); font-size: 12px; line-height: 1.45; }
.fpv-banner svg { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 1px; color: var(--chat-primary-ink); }
.fpv-link { display: inline; margin-left: 3px; padding: 0; border: 0; background: none; color: var(--chat-primary-ink); font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.fpv-days { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 9px; scrollbar-width: none; }
.fpv-days::-webkit-scrollbar { display: none; }
.fpv-day { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 58px; padding: 7px 6px 6px; border: 1px solid var(--chat-line-strong); border-radius: var(--chat-radius-md); background: var(--chat-surface); color: var(--chat-bot-text); line-height: 1.15; cursor: pointer; }
.fpv-day-wd { font-size: 10.5px; font-weight: 700; color: var(--chat-muted); }
.fpv-day-dm { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fpv-day-n { font-size: 10px; font-weight: 800; color: var(--chat-primary-ink); }
.fpv-day.active { background: var(--chat-primary); border-color: var(--chat-primary); color: var(--chat-on-primary); }
.fpv-day.active .fpv-day-wd, .fpv-day.active .fpv-day-n { color: inherit; opacity: .85; }
.fpv-periods { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 10px; }
.fpv-period { padding: 5px 12px; border: 1px solid var(--chat-line-strong); border-radius: 999px; background: var(--chat-surface); color: var(--chat-bot-text); font-size: 12px; font-weight: 700; cursor: pointer; }
.fpv-period.active { background: var(--chat-bot-text); border-color: var(--chat-bot-text); color: var(--chat-surface); }
.fpv-times { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); }
.fpv-time { min-height: 40px; padding: 6px 4px; border: 1px solid var(--chat-line-strong); border-radius: var(--chat-radius-md); background: var(--chat-surface); color: var(--chat-bot-text); font-size: 13.5px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; text-align: center; cursor: pointer; }
.fpv-time.active { background: var(--chat-primary); border-color: var(--chat-primary); color: var(--chat-on-primary); box-shadow: 0 0 0 3px var(--chat-ring); }
.fpv-time-pro { display: block; margin-top: 1px; font-size: 10px; font-weight: 700; opacity: .8; }
.fpv-acc { display: flex; flex-direction: column; gap: 6px; }
.fpv-acc-head { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 11px; border: 1px solid var(--chat-line-strong); border-radius: var(--chat-radius-md); background: var(--chat-surface); color: var(--chat-bot-text); font-size: 13.5px; font-weight: 800; text-align: left; cursor: pointer; }
.fpv-acc-head.open { border-color: var(--chat-primary); color: var(--chat-primary-ink); }
.fpv-acc-day { flex: 1; min-width: 0; }
.fpv-acc-n { font-size: 11px; font-weight: 700; color: var(--chat-muted); }
.fpv-acc-caret { font-size: .75rem; opacity: .7; }
.fpv-acc-panel { padding: 8px 1px 3px; }
.fpv-sel-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.fpv-sel-row > label { font-size: 12px; font-weight: 700; color: var(--chat-muted); }
.fpv-input, .fpv-select { display: block; width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--chat-input-border); border-radius: var(--chat-radius-md); background-color: var(--chat-input-bg); color: var(--chat-bot-text); font-size: 14px; outline: none; appearance: none; -webkit-appearance: none; }
select.fpv-input:not([multiple]), select.fpv-select { padding-right: 34px; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--chat-muted) 50%), linear-gradient(135deg, var(--chat-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
select.fpv-input[multiple] { min-height: 96px; }
textarea.fpv-input { min-height: 76px; resize: vertical; }
.fpv-input::placeholder { color: var(--chat-muted); }
.fpv-input:focus, .fpv-select:focus { outline: none; border-color: var(--chat-primary); box-shadow: 0 0 0 3px var(--chat-ring); }
.fpv-picked { margin: 12px 0 0; padding: 9px 10px; border-radius: var(--chat-radius-md); background: var(--chat-raise); color: var(--chat-bot-text); font-size: 12.5px; }
.fpv-picked b { font-weight: 800; }
.fpv-field { margin-bottom: 13px; }
.fpv-field > label, .fpv-field > .fpv-label { display: block; margin-bottom: 5px; color: var(--chat-bot-text); font-size: 12.5px; font-weight: 700; }
.fpv-req { margin-left: 2px; color: var(--chat-error); }
.fpv-opt { color: var(--chat-muted); font-weight: 500; }
.fpv-choice { display: flex; flex-wrap: wrap; gap: 6px; }
.fpv-choice button { min-height: 36px; padding: 6px 14px; border: 1px solid var(--chat-line-strong); border-radius: 999px; background: var(--chat-surface); color: var(--chat-bot-text); font-size: 13px; font-weight: 700; cursor: pointer; }
.fpv-choice button[aria-checked="true"] { background: var(--chat-primary); border-color: var(--chat-primary); color: var(--chat-on-primary); }
.fpv-empty { margin: 4px 0 0; padding: 14px; border: 1px dashed var(--chat-line-strong); border-radius: var(--chat-radius-md); color: var(--chat-muted); font-size: 12.5px; text-align: center; }
.fpv-cards { display: flex; flex-direction: column; gap: 8px; }
.fpv-card { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 1.5px solid var(--chat-line-strong); border-radius: var(--chat-radius-lg); background: var(--chat-surface); color: var(--chat-bot-text); text-align: left; cursor: pointer; }
.fpv-card[aria-checked="true"] { border-color: var(--chat-primary); background: var(--chat-tint); }
.fpv-card-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fpv-card-t b { font-size: 13.5px; }
.fpv-card-t small { font-size: 11.5px; line-height: 1.35; color: var(--chat-muted); }
.fpv-dur { align-self: flex-start; margin-top: 3px; padding: 1px 8px; border-radius: 999px; background: var(--chat-tint); color: var(--chat-primary-ink); font-size: 11px; font-weight: 800; }
.fpv-card[aria-checked="true"] .fpv-dur { background: var(--chat-surface); }
.fpv-radio { width: 19px; height: 19px; flex: 0 0 19px; border: 2px solid var(--chat-line-strong); border-radius: 50%; display: grid; place-items: center; }
[aria-checked="true"] > .fpv-radio { border-color: var(--chat-primary); background: var(--chat-primary); }
[aria-checked="true"] > .fpv-radio::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--chat-on-primary); }
.fpv-pros { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fpv-pro { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 14px 8px 12px; border: 1.5px solid var(--chat-line-strong); border-radius: var(--chat-radius-lg); background: var(--chat-surface); color: var(--chat-bot-text); text-align: center; cursor: pointer; }
.fpv-pro[aria-checked="true"] { border-color: var(--chat-primary); background: var(--chat-tint); }
.fpv-pro > .fpv-radio { position: absolute; top: 8px; right: 8px; width: 16px; height: 16px; flex-basis: 16px; }
.fpv-pro b { font-size: 12.5px; line-height: 1.25; overflow-wrap: anywhere; }
.fpv-pro small { font-size: 11px; color: var(--chat-muted); }
.fpv-av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--chat-tint-strong); color: var(--chat-primary-ink); font-size: 15px; font-weight: 800; }
.fpv-av.alt { background: var(--chat-raise-2); color: var(--chat-bot-text); }
.fpv-av.any { background: var(--chat-raise); border: 1.5px dashed var(--chat-line-strong); font-size: 13px; }
.fpv-rows { display: flex; flex-direction: column; }
.fpv-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--chat-line-strong); }
.fpv-row-t { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fpv-row-t small { font-size: 11px; font-weight: 700; color: var(--chat-muted); }
.fpv-row-t b { font-size: 13px; overflow-wrap: anywhere; white-space: pre-line; }
.fpv-row-t b.fpv-ph { font-weight: 600; font-style: italic; color: var(--chat-muted); }
.fpv-row .fpv-link { flex: 0 0 auto; margin: 0; }
.fpv-wa-l { display: flex; align-items: center; gap: 5px; margin: 14px 0 5px; color: var(--chat-muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.fpv-wa-l svg { width: 13px; height: 13px; }
.fpv-wa { margin: 0; padding: 9px 11px; border: 1px solid var(--chat-line); border-radius: var(--chat-radius-md); background: var(--chat-raise); color: var(--chat-bot-text); font: inherit; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.fpv-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px 12px; border-top: 1px solid var(--chat-line); background: var(--chat-surface); }
.fpv-btn { flex: 1 1 140px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 12px; border: 0; border-radius: var(--chat-radius-md); font-size: 13.5px; font-weight: 800; line-height: 1.2; text-align: center; cursor: pointer; }
.fpv-btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.fpv-btn:disabled { opacity: .45; cursor: not-allowed; }
.fpv-btn.is-static { cursor: default; }
.fpv-btn-primary { background: var(--chat-primary); color: var(--chat-on-primary); }
.fpv-btn-ghost { flex: 0 1 auto; border: 1px solid var(--chat-line-strong); background: transparent; color: var(--chat-bot-text); }
.fpv-btn-soft { background: var(--chat-tint); color: var(--chat-primary-ink); }
.fpv-foot.is-review .fpv-btn { flex-basis: 100%; }
/* Atalhos de etapa acima do celular (editor de formulários) */
.fpv-stepbar { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; width: fit-content; max-width: 100%; margin: 0 auto 10px; padding: 3px; border: 1px solid #d7ddd9; border-radius: 999px; background: #fff; box-shadow: 0 4px 14px rgba(15, 23, 42, .08); }
.fpv-stepbar:empty { display: none; }
.fpv-stepbar button { padding: .3rem .65rem; border: 0; border-radius: 999px; background: transparent; color: #475569; font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer; }
.fpv-stepbar button.active { background: #0f766e; color: #fff; }
.appearance-preview-card {
  --pv-primary: #4f46e5;
  --pv-page: #f0f2f5;
  --pv-chat: #ffffff;
  --pv-header: #4f46e5;
  --pv-header-text: #ffffff;
  --pv-bot: #f0f2f5;
  --pv-bot-text: #111827;
  --pv-user: #4f46e5;
  --pv-user-text: #ffffff;
  --pv-input: #ffffff;
  --pv-border: #d1d5db;
  --pv-radius: 16px;
  --pv-phone-width: 320px;
  --pv-body-min: 310px;
  --pv-body-pad: 1rem;
  --pv-body-gap: .65rem;
  --pv-message-pad: .62rem .78rem;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: var(--pv-page);
  padding: 18px;
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  transition: background .12s ease, padding .12s ease;
}
.appearance-preview-card[data-preview-font="grotesk"] { font-family: "Space Grotesk", sans-serif; }
.appearance-preview-card[data-preview-font="rounded"] { font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif; }
.appearance-preview-card[data-preview-density="compact"] {
  --pv-body-min: 245px;
  --pv-body-pad: .75rem;
  --pv-body-gap: .45rem;
  --pv-message-pad: .5rem .65rem;
}
.appearance-preview-card[data-preview-layout="centered"] {
  padding: 28px;
}
.appearance-preview-card[data-preview-layout="centered"] .appearance-preview-phone {
  --pv-phone-width: 340px;
}
.appearance-preview-card[data-preview-layout="compact"] {
  justify-content: flex-start;
  padding: 14px;
}
.appearance-preview-card[data-preview-layout="compact"] .appearance-preview-phone {
  --pv-phone-width: 280px;
}
.appearance-preview-phone {
  width: min(100%, var(--pv-phone-width));
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: var(--pv-radius);
  background: var(--pv-chat);
  box-shadow: 0 18px 50px rgba(15, 23, 42, .18);
  transition: width .12s ease, border-radius .12s ease, background .12s ease;
}
.appearance-preview-header {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1rem;
  background: var(--pv-header);
  color: var(--pv-header-text);
  font-weight: 800;
}
/* Mesmo desenho do #bot-logo do chat público (logo inteira, sem corte; fundo para PNG transparente). */
.appearance-preview-logo {
  display: block;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
  background: rgba(255,255,255,.15);
}
.appearance-preview-body {
  display: flex;
  flex-direction: column;
  gap: var(--pv-body-gap);
  padding: var(--pv-body-pad);
  min-height: var(--pv-body-min);
  transition: min-height .12s ease, padding .12s ease, gap .12s ease;
}
.appearance-preview-msg {
  max-width: 80%;
  border-radius: var(--pv-radius);
  padding: var(--pv-message-pad);
  font-size: .86rem;
  line-height: 1.45;
  transition: background .12s ease, color .12s ease, border-radius .12s ease, padding .12s ease;
}
.appearance-preview-msg.bot { align-self: flex-start; background: var(--pv-bot); color: var(--pv-bot-text); border-bottom-left-radius: 4px; }
.appearance-preview-msg.user { align-self: flex-end; background: var(--pv-user); color: var(--pv-user-text); border-bottom-right-radius: 4px; }
/* Preview dos itens de conversão (subtítulo/confiança/botões rápidos) */
.appearance-preview-headtext { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.appearance-preview-subtitle { font-size: .72rem; font-weight: 500; opacity: .85; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appearance-preview-trust {
  align-self: stretch; display: flex; gap: .4rem; align-items: flex-start;
  background: #f8fafc; border: 1px solid #e5e7eb; border-left: 3px solid var(--pv-primary);
  color: #374151; font-size: .74rem; line-height: 1.4; padding: .5rem .6rem; border-radius: 8px;
}
.appearance-preview-trust svg { width: 14px; height: 14px; color: var(--pv-primary); flex: 0 0 auto; margin-top: 1px; }
.appearance-preview-quick { align-self: stretch; display: flex; flex-wrap: wrap; gap: .4rem; }
.appearance-preview-qr {
  border: 1px solid var(--pv-primary); color: var(--pv-primary); background: #fff;
  font-size: .72rem; font-weight: 700; padding: .3rem .6rem; border-radius: 999px;
  max-width: 100%; white-space: normal; text-align: left; line-height: 1.25;
}
.appearance-preview-input {
  margin: 0 1rem 1rem;
  min-height: 42px;
  border: 1px solid var(--pv-border);
  border-radius: 10px;
  background: var(--pv-input);
}
.appearance-modal-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: .65rem;
  flex-wrap: wrap;
  margin: 1rem -1.1rem -1.1rem;
  z-index: 2;
  padding: .85rem 1.1rem 1.1rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.82), #fff 34%);
  border-top: 1px solid #e2e8e4;
}
@media (max-width: 860px) {
  .appearance-dialog {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .appearance-preview { border-left: none; border-top: 1px solid #d7ddd9; }
  .appearance-form-grid { grid-template-columns: 1fr; }
  .appearance-modal { align-items: stretch; padding: 0; }
  .appearance-dialog {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
  .appearance-preview { max-height: 38vh; }
  .appearance-preview-card { min-height: 360px; }
  .appearance-modal-actions {
    justify-content: stretch;
  }
  .appearance-modal-actions .cta { flex: 1 1 150px; }
}
