/* OpenChat — folha de estilo única.
   Escrita à mão, sem Tailwind: a Fase 13 substitui as telas do painel pelo
   bundle React já compilado, e até lá o sistema roda sem nenhum passo de build. */

:root {
  --bg: #ffffff;
  --fg: #18181b;
  --surface: #f7f7f8;
  --surface-hover: #efeff1;
  --border: #e4e4e7;
  --border-hover: #d4d4d8;
  --muted: #71717a;
  --accent: #f97316;
  --accent-hover: #ea580c;
  --success: #16a34a;
  --error: #dc2626;
  --warning: #d97706;
  --radius: 12px;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

/* O `hidden` do navegador perde para qualquer classe que defina `display`.
   Como o sistema usa `hidden` para mostrar e esconder blocos inteiros, ele
   precisa vencer — senão o elemento continua visível sem nenhum aviso. */
[hidden] { display: none !important; }

html { color-scheme: light; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

/* ---------- Layout autenticado ---------- */

.shell { display: flex; min-height: 100dvh; }

.sidebar {
  width: 256px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 12px 20px;
  gap: 16px;
}

.sidebar__wordmark {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  padding: 0 12px;
}

.workspace-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  min-width: 0;
}

.workspace-chip__avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.workspace-chip__name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-chip__meta { display: block; font-size: 12px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: background-color 0.12s, color 0.12s;
}

.nav__item:hover { background: var(--surface); color: var(--fg); }

.nav__item--active {
  background: var(--surface-hover);
  color: var(--fg);
  font-weight: 600;
}

.nav__item svg { width: 20px; height: 20px; flex-shrink: 0; }

.nav__footer { display: flex; flex-direction: column; gap: 2px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
}

.topbar__title { font-size: 15px; font-weight: 600; margin: 0; }

.content { padding: 32px; max-width: 1280px; width: 100%; }

/* ---------- Blocos de conteúdo ---------- */

.stack { display: flex; flex-direction: column; gap: 40px; }

.greeting__title {
  font-size: 48px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
}

.greeting__meta { margin: 12px 0 0; font-size: 14px; color: var(--muted); }

.greeting__meta a { color: var(--accent); font-weight: 500; }

.section__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section__title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.section__action {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  flex-shrink: 0;
}

.section__action:hover { text-decoration: underline; }

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 20px;
}

.card__title { font-size: 14px; font-weight: 600; margin: 0 0 16px; }

/* Banner de próximo passo */
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--fg);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 24px;
}

.banner__title { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }

.banner__body { margin: 4px 0 0; font-size: 14px; color: rgba(255, 255, 255, 0.7); }

/* Botões */
.button {
  display: inline-block;
  border: 0;
  border-radius: 8px;
  padding: 11px 22px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: background-color 0.12s;
}

.button:hover { background: var(--accent-hover); }

.button--block { display: block; width: 100%; text-align: center; }

.button--ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.button--ghost:hover { background: var(--surface); color: var(--fg); }

/* Grades */
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid--activity { grid-template-columns: 3fr 1fr 2fr; }

/* Cartões de modelo */
.template-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  transition: background-color 0.12s, border-color 0.12s;
}

.template-card:hover { background: var(--surface); border-color: var(--border-hover); }

.template-card__title { font-size: 16px; font-weight: 600; line-height: 1.35; margin: 0; }

.template-card__summary { margin: 8px 0 0; font-size: 14px; color: var(--muted); }

.template-card__meta { display: flex; align-items: center; gap: 8px; }

.pill {
  border-radius: 999px;
  background: var(--surface-hover);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.template-card__time { font-size: 12px; color: var(--muted); }

/* Métricas */
.stat { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat__label { font-size: 14px; color: var(--muted); margin: 0; }

.stat__value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 8px 0 0;
  font-variant-numeric: tabular-nums;
}

/* Gráfico de 7 dias */
.chart { display: flex; align-items: flex-end; gap: 8px; height: 160px; }
.chart__col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }

.chart__count { font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }

.chart__bar { width: 100%; background: var(--accent); border-radius: 6px; min-height: 4px; }

.chart__label {
  width: 100%;
  text-align: center;
  font-size: 10px;
  color: #a1a1aa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Listas */
.list { display: flex; flex-direction: column; gap: 12px; }

.list__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.list__row:last-child { border-bottom: 0; padding-bottom: 0; }

.list__primary {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list__secondary {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty { font-size: 14px; color: var(--muted); padding: 32px 0; text-align: center; margin: 0; }

/* Selo de status */
.badge {
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge--sent { background: #dcfce7; color: #15803d; }
.badge--failed { background: #fee2e2; color: #b91c1c; }
.badge--pending { background: var(--surface-hover); color: var(--muted); }
.badge--skipped { background: #fef3c7; color: #a16207; }

/* Esqueleto de carregamento */
.skeleton { background: var(--surface-hover); border-radius: 8px; }

/* ---------- Telas sem sessão ---------- */

.centered {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card { width: 100%; max-width: 400px; }

.auth-card__brand {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.auth-card__lead { text-align: center; font-size: 14px; color: var(--muted); margin: 0 0 28px; }

.auth-card__panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 28px;
}

.field { display: block; margin-bottom: 20px; }
.field__label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px; }

.field__input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  padding: 12px 14px;
  font-family: inherit;
  /* 16px no celular: abaixo disso o Safari do iOS dá zoom no campo focado e
     nunca volta ao normal. */
  font-size: 16px;
}

.field__input:focus-visible { outline-offset: 1px; }

.alert {
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 20px;
  background: #fef2f2;
  color: #b91c1c;
}

.notice { text-align: center; padding: 8px 0; }
.notice__title { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.notice__body { font-size: 14px; color: var(--muted); margin: 0 0 20px; }
.notice__link { font-size: 14px; color: var(--accent); font-weight: 500; }

/* ---------- Responsivo ---------- */

@media (max-width: 1024px) {
  .grid--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--activity { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .content { padding: 20px 16px; }
  .topbar { padding: 12px 16px; }
  .greeting__title { font-size: 34px; }
  .grid--2 { grid-template-columns: 1fr; }
  .grid--3 { grid-template-columns: 1fr; }
  .grid--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section__title { font-size: 20px; }
}

/* =========================================================================
   Módulo de reservas
   ========================================================================= */

/* Abas (Dia | Semana | Mês) */
.tabs { display: inline-flex; gap: 2px; background: var(--surface); border-radius: 10px; padding: 3px; }
.tabs__item {
  border: 0; background: transparent; font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--muted); padding: 7px 16px; border-radius: 8px; cursor: pointer;
}
.tabs__item--active { background: var(--bg); color: var(--fg); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* Barra de ferramentas: seletores + ações */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.toolbar__group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.select {
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
  padding: 9px 12px; font-family: inherit; font-size: 14px; color: var(--fg);
}

/* Timeline do dia — a visão que a operação usa */
.timeline { display: flex; flex-direction: column; }
.timeline__row {
  display: grid; grid-template-columns: 68px 1fr; gap: 16px; align-items: center;
  padding: 10px 12px; border-bottom: 1px solid var(--border); border-radius: 8px;
}
.timeline__row:last-child { border-bottom: 0; }
.timeline__row--clickable { cursor: pointer; }
.timeline__row--clickable:hover { background: var(--surface); }
.timeline__row--full { background: #fef2f2; }
.timeline__row--blocked { background: var(--surface); opacity: .65; }
.timeline__time { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.timeline__body { min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.timeline__hint { font-size: 13px; color: var(--muted); }
.timeline__hint--full { color: var(--error); font-weight: 600; }

/* Cartão compacto de reserva dentro da timeline */
.res-chip {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 12px; font-size: 13px; background: var(--bg); cursor: pointer;
}
.res-chip:hover { border-color: var(--border-hover); background: var(--surface); }
.res-chip__dot { width: 7px; height: 7px; border-radius: 999px; flex-shrink: 0; }
.res-chip__name { font-weight: 500; }
.res-chip__meta { color: var(--muted); }

/* Calendário mensal */
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar__weekday {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); text-align: center; padding-bottom: 6px;
}
.calendar__day {
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
  min-height: 76px; padding: 8px; text-align: left; font-family: inherit; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
}
.calendar__day:hover { background: var(--surface); }
.calendar__day--muted { opacity: .35; }
.calendar__day--today { border-color: var(--accent); }
.calendar__num { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.calendar__count { font-size: 12px; color: var(--muted); }
.calendar__bar { height: 4px; border-radius: 999px; background: var(--accent); margin-top: auto; }

/* Drawer — painel lateral no desktop, tela cheia no celular */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.drawer-backdrop--open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 100%;
  background: var(--bg); z-index: 61; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s ease; box-shadow: -8px 0 32px rgba(0,0,0,.1);
}
.drawer--open { transform: translateX(0); }
.drawer__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.drawer__title { font-size: 16px; font-weight: 600; margin: 0; }
.drawer__close {
  border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--muted);
  cursor: pointer; padding: 4px 8px; border-radius: 8px;
}
.drawer__close:hover { background: var(--surface); color: var(--fg); }
.drawer__body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer__foot {
  padding: 16px 20px; border-top: 1px solid var(--border); flex-shrink: 0;
  display: flex; gap: 10px; align-items: center;
}

/* Passos do assistente de reserva */
.steps { display: flex; gap: 6px; margin-bottom: 20px; }
.steps__dot { height: 3px; flex: 1; border-radius: 999px; background: var(--surface-hover); }
.steps__dot--done { background: var(--accent); }
.step__label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 12px; }

/* Botões de quantidade de pessoas */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
  padding: 10px 16px; font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  min-width: 48px;
}
.chip-btn:hover { border-color: var(--border-hover); background: var(--surface); }
.chip-btn--active { border-color: var(--accent); background: var(--accent); color: #fff; }

/* Grade de horários */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot {
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
  padding: 11px 6px; font-family: inherit; font-size: 14px; font-weight: 600;
  font-variant-numeric: tabular-nums; cursor: pointer; text-align: center;
}
.slot:hover { border-color: var(--border-hover); background: var(--surface); }
.slot--active { border-color: var(--accent); background: var(--accent); color: #fff; }
.slot:disabled { opacity: .4; cursor: not-allowed; }

/* Resumo da reserva antes de confirmar */
.summary { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.summary__name { font-size: 17px; font-weight: 600; margin: 0 0 12px; }
.summary__row { display: flex; gap: 10px; font-size: 14px; padding: 5px 0; }
.summary__key { color: var(--muted); min-width: 92px; }

/* Cartão de reserva dentro da conversa do Instagram */
.res-card { border: 1px solid var(--border); border-left: 3px solid var(--success); border-radius: 10px; padding: 14px 16px; }
.res-card__label {
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--success);
}
.res-card__main { font-size: 15px; font-weight: 600; margin: 6px 0 2px; }
.res-card__meta { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.res-card__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Cores por status */
.badge--arrived { background: #dbeafe; color: #1d4ed8; }
.badge--completed { background: var(--surface-hover); color: var(--muted); }
.badge--noshow { background: #fee2e2; color: #b91c1c; }

@media (max-width: 768px) {
  /* No celular o drawer ocupa a tela quase inteira, como pedido. */
  .drawer { width: 100%; top: 0; border-radius: 0; }
  .timeline__row { grid-template-columns: 56px 1fr; gap: 10px; padding: 10px 4px; }
  .calendar { gap: 3px; }
  .calendar__day { min-height: 56px; padding: 5px; }
  .toolbar { align-items: stretch; }
  .slots { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
}

/* Submenu da barra lateral — só é exibido dentro da seção aberta. */
.nav__sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 32px; }
.nav__subitem {
  font-size: 13px; color: var(--muted); text-decoration: none;
  padding: 6px 12px; border-radius: 8px;
}
.nav__subitem:hover { background: var(--surface); color: var(--fg); }
.nav__subitem--active { color: var(--accent); font-weight: 600; }

/* Marca */
.sidebar__wordmark { display: block; padding: 0 12px 2px; }
/* A altura fixa e a proporção declarada evitam o pulo de layout enquanto a
   imagem carrega. */
.sidebar__wordmark img { height: 45px; width: auto; display: block; }

.auth-card__logo { height: 40px; width: auto; display: block; margin: 0 auto 8px; }

/* =========================================================================
   Construtor de campanha — formulário à esquerda, celular ao vivo à direita
   ========================================================================= */

.builder { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }

/* O preview acompanha a rolagem: a pessoa edita lá embaixo e continua vendo
   o efeito. É o que torna a montagem tangível em vez de abstrata. */
.builder__preview { position: sticky; top: 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* --- Passos numerados --- */
.step-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); overflow: hidden; }
.step-card + .step-card { margin-top: 16px; }

.step-card__head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }

.step-card__num {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 999px;
  background: var(--fg); color: #fff;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center;
}

.step-card__title { font-size: 15px; font-weight: 600; margin: 0; }
.step-card__hint { font-size: 13px; color: var(--muted); margin: 2px 0 0; }
.step-card__body { padding: 20px; }

/* --- Opções em cartão, no lugar de radio solto --- */
.choice {
  display: flex; align-items: flex-start; gap: 12px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 13px 15px; cursor: pointer; transition: border-color .12s, background-color .12s;
}
.choice + .choice { margin-top: 8px; }
.choice:hover { border-color: var(--border-hover); background: var(--surface); }
.choice--active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.choice input { margin-top: 2px; accent-color: var(--accent); }
.choice__label { font-size: 14px; font-weight: 500; }
.choice__hint { font-size: 12.5px; color: var(--muted); margin: 2px 0 0; }

/* --- Interruptor de recurso opcional --- */
.feature { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.feature + .feature { margin-top: 10px; }
.feature__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.feature__title { font-size: 14px; font-weight: 600; margin: 0; }
.feature__hint { font-size: 12.5px; color: var(--muted); margin: 3px 0 0; max-width: 46ch; }
.feature__body { margin-top: 16px; }

.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; border-radius: 999px; background: #d4d4d8; transition: background-color .15s; }
.switch--on { background: var(--accent); }
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 999px; background: #fff; transition: transform .15s;
}
.switch--on::after { transform: translateX(18px); }

/* --- Fichas de palavra-chave --- */
.keyword-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; min-height: 4px; }
.keyword-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--fg); color: #fff; border-radius: 999px;
  padding: 4px 6px 4px 11px; font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
.keyword-chip button { border: 0; background: transparent; color: rgba(255,255,255,.6); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 3px; }
.keyword-chip button:hover { color: #fff; }

/* --- Abas do preview --- */
.preview-tabs { display: inline-flex; gap: 2px; background: var(--surface); border-radius: 10px; padding: 3px; }
.preview-tabs button {
  border: 0; background: transparent; font-family: inherit; font-size: 12.5px; font-weight: 500;
  color: var(--muted); padding: 6px 13px; border-radius: 8px; cursor: pointer;
}
.preview-tabs button[aria-selected="true"] { background: var(--bg); color: var(--fg); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* --- Celular --- */
.phone { position: relative; width: 300px; max-width: 100%; }
.phone__frame { border-radius: 46px; padding: 3px; background: linear-gradient(140deg, #a1a1aa, #3f3f46 55%, #71717a); box-shadow: 0 20px 45px rgba(0,0,0,.22); }
.phone__bezel { border-radius: 44px; background: #000; padding: 9px; }
.phone__screen { position: relative; height: 600px; overflow: hidden; border-radius: 36px; background: #000; color: #fff; }
.phone__island { position: absolute; left: 50%; top: 9px; transform: translateX(-50%); width: 92px; height: 24px; border-radius: 999px; background: #000; z-index: 5; }

.phone__status { display: flex; justify-content: space-between; align-items: center; padding: 11px 22px 0; font-size: 11px; font-weight: 600; }
.phone__bars { display: flex; gap: 3px; align-items: flex-end; }
.phone__bars span { width: 3px; background: #fff; border-radius: 1px; }

.screen { display: none; height: 100%; flex-direction: column; }
.screen--active { display: flex; }

.ig-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.1); }
.ig-avatar { width: 30px; height: 30px; border-radius: 999px; flex-shrink: 0; background: linear-gradient(135deg, #f97316, #db2777); }
.ig-name { font-size: 13px; font-weight: 600; }
.ig-sub { font-size: 10.5px; color: #a1a1aa; }

.ig-media { height: 190px; background: linear-gradient(150deg, #27272a, #3f3f46); display: flex; align-items: center; justify-content: center; color: #52525b; font-size: 11px; }
.ig-caption { padding: 10px 14px; font-size: 12px; line-height: 1.45; color: #d4d4d8; }

.ig-comments { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 14px; }
.ig-comment { display: flex; gap: 9px; }
.ig-comment__avatar { width: 26px; height: 26px; border-radius: 999px; flex-shrink: 0; background: #3f3f46; }
.ig-comment__body { min-width: 0; }
.ig-comment__name { font-size: 12px; font-weight: 600; }
.ig-comment__text { font-size: 12.5px; line-height: 1.4; margin: 2px 0 0; word-break: break-word; }
.ig-comment__meta { font-size: 10.5px; color: #71717a; margin: 4px 0 0; }
.ig-comment--reply { margin-left: 35px; }

.ig-thread { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.bubble { max-width: 82%; border-radius: 18px; padding: 9px 13px; font-size: 12.5px; line-height: 1.45; word-break: break-word; }
.bubble--them { background: #262629; align-self: flex-start; border-bottom-left-radius: 5px; }
.bubble--us { background: linear-gradient(135deg, #3b82f6, #8b5cf6); align-self: flex-end; border-bottom-right-radius: 5px; }
.bubble__button {
  display: block; margin-top: 9px; padding-top: 9px; text-align: center;
  border-top: 1px solid rgba(255,255,255,.25); font-weight: 600; font-size: 12px;
}
.bubble__delay { align-self: center; font-size: 10.5px; color: #71717a; padding: 3px 0; }

.ig-composer { display: flex; align-items: center; padding: 9px 14px 16px; }
.ig-composer span { flex: 1; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; padding: 8px 14px; font-size: 12px; color: #71717a; }

.preview-note { font-size: 12px; color: var(--muted); text-align: center; max-width: 300px; margin: 0; }

/* --- Barra de ações fixa --- */
.builder__actions {
  position: sticky; bottom: 0; margin-top: 28px; padding: 16px 0;
  background: linear-gradient(to top, var(--bg) 72%, transparent);
  display: flex; gap: 12px; align-items: center;
}

@media (max-width: 1100px) {
  /* Abaixo disso as duas colunas espremem o formulário; o celular vai para
     cima, onde ainda serve de referência do que está sendo montado. */
  .builder { grid-template-columns: 1fr; gap: 28px; }
  .builder__preview { position: static; order: -1; }
  .phone__screen { height: 480px; }
}

/* Documentos legais — coluna de leitura */
.legal { max-width: 720px; margin: 0 auto; padding: 48px 24px 80px; }
.legal__head { padding-bottom: 28px; border-bottom: 1px solid var(--border); margin-bottom: 36px; }
.legal__logo { height: 34px; width: auto; display: block; margin-bottom: 28px; }
.legal__updated { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.legal__title { font-size: 34px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; margin: 0; }

.legal h2 { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; margin: 40px 0 12px; }
.legal h3 { font-size: 15px; font-weight: 600; margin: 24px 0 8px; }
/* Leitura longa pede linha mais alta que a da interface. */
.legal p, .legal li { font-size: 15.5px; line-height: 1.7; color: var(--ink-2, #3f3f46); }
.legal p { margin: 0 0 14px; }
.legal ul { margin: 0 0 16px; padding-left: 22px; }
.legal li { margin-bottom: 7px; }
.legal strong { color: var(--fg); font-weight: 600; }
.legal a { color: var(--accent); }
.legal code { font-size: .88em; background: var(--surface); padding: 2px 6px; border-radius: 4px; }

.legal__callout {
  border-left: 3px solid var(--accent); background: var(--surface);
  padding: 16px 20px; margin: 0 0 20px; border-radius: 0 8px 8px 0;
}
.legal__callout p:last-child { margin-bottom: 0; }

.legal__foot {
  display: flex; gap: 20px; flex-wrap: wrap;
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border);
  font-size: 14px;
}
.legal__foot a { color: var(--muted); text-decoration: none; }
.legal__foot a:hover { color: var(--fg); }

@media (max-width: 640px) {
  .legal { padding: 32px 20px 56px; }
  .legal__title { font-size: 27px; }
}

.legal__wordmark {
  display: block; margin-bottom: 28px;
  font-size: 19px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--fg); text-decoration: none;
}

.auth-card__legal {
  display: flex; justify-content: center; gap: 18px; flex-wrap: wrap;
  margin-top: 24px; font-size: 13px;
}
.auth-card__legal a { color: var(--muted); text-decoration: none; }
.auth-card__legal a:hover { color: var(--fg); }

/* --- Conta do Instagram conectada (Configurações) ------------------------- */
/* É a tela que o App Review assiste: precisa provar QUAL conta foi
   autorizada e a que estabelecimento ela pertence. */
.ig-account { display: flex; align-items: center; gap: 16px; }

.ig-account__avatar {
  flex: none; width: 64px; height: 64px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: var(--muted);
  overflow: hidden;
}
.ig-account__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ig-account__info { flex: 1; min-width: 0; }
.ig-account__handle { font-size: 19px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.ig-account__name { font-size: 14px; color: var(--fg); margin: 2px 0 0; }
.ig-account__meta { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }

.ig-account__linked {
  display: flex; align-items: center; gap: 10px;
  margin-top: 18px; padding: 12px 14px;
  background: var(--surface); border-radius: 10px;
}
.ig-account__linked-label { display: block; font-size: 12px; color: var(--muted); }
.ig-account__linked-name { display: block; font-size: 14px; font-weight: 600; }

@media (max-width: 560px) {
  .ig-account { flex-wrap: wrap; }
  .ig-account__avatar { width: 52px; height: 52px; font-size: 20px; }
}

/* --- Opções avançadas do construtor de campanha --------------------------- */
/* Fechadas por padrão: criar uma campanha são três decisões, e as outras
   quinze opções só atrapalham quem está publicando a primeira. */
.avancado { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.avancado__toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 18px; cursor: pointer; list-style: none; user-select: none;
}
.avancado__toggle::-webkit-details-marker { display: none; }
.avancado__toggle:hover { background: var(--surface); }
.avancado__title { display: block; font-size: 14px; font-weight: 600; }
.avancado__hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.avancado__chevron {
  font-size: 22px; color: var(--muted); line-height: 1;
  transition: transform .15s; flex: none;
}
.avancado[open] .avancado__chevron { transform: rotate(90deg); }
/* Os cartões internos perdem a borda própria: a moldura já é a do bloco. */
.avancado .step-card { border: 0; border-top: 1px solid var(--border); border-radius: 0; }


/* Atalho de link dentro de um campo (ex.: "Enviar o link da reserva"). */
.link-atalho {
  margin-top: 8px; border: 0; background: transparent; padding: 0;
  color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer;
}
.link-atalho:hover { text-decoration: underline; }

/* =========================================================================
   Reserva pela web — tela pública de agendamento
   =========================================================================
   Tema escuro próprio, isolado do painel. É a única tela vista por quem não é
   do restaurante, e quase sempre abre dentro do Instagram, no celular.
   Tudo aqui é prefixado com .sched para não vazar para o resto do sistema. */

.sched {
  --s-bg: #0b0b0c;
  --s-panel: #141416;
  --s-raised: #1d1d20;
  --s-line: #2a2a2e;
  --s-text: #f4f4f5;
  --s-muted: #8b8b93;
  --s-accent: #f4f4f5;
  min-height: 100vh;
  background: var(--s-bg);
  color: var(--s-text);
  padding: 28px 16px 48px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.sched__box {
  width: 100%; max-width: 640px;
  background: var(--s-panel);
  border: 1px solid var(--s-line);
  border-radius: 18px;
  overflow: hidden;
}

.sched__head { padding: 22px 24px 18px; }
.sched__title { font-size: 20px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.sched__sub { font-size: 14px; color: var(--s-text); margin: 6px 0 0; }
.sched__tz { font-size: 13px; color: var(--s-muted); margin: 2px 0 0; }

/* --- Calendário + horários, lado a lado --- */
.sched__grid {
  display: grid; grid-template-columns: 1fr 190px;
  border-top: 1px solid var(--s-line); border-bottom: 1px solid var(--s-line);
}
.sched__cal { padding: 18px; border-right: 1px solid var(--s-line); min-width: 0; }

.sched__nav { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.sched__pickers { display: flex; gap: 8px; flex: 1; justify-content: center; }
.sched__arrow {
  width: 30px; height: 30px; flex: none; border-radius: 999px;
  border: 1px solid var(--s-line); background: transparent;
  color: var(--s-text); font-size: 17px; line-height: 1; cursor: pointer;
}
.sched__arrow:hover { background: var(--s-raised); }

.sched__select {
  appearance: none; -webkit-appearance: none;
  background: var(--s-raised) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8b93' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--s-line); border-radius: 999px;
  color: var(--s-text); font: inherit; font-size: 14px;
  padding: 8px 32px 8px 16px; cursor: pointer;
}
.sched__select--block { width: 100%; border-radius: 10px; }

.sched__weekdays, .sched__days {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.sched__weekdays { margin-bottom: 8px; }
.sched__weekdays span { text-align: center; font-size: 11px; color: var(--s-muted); letter-spacing: .04em; }

.sched__day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; background: var(--s-raised);
  color: var(--s-text); font: inherit; font-size: 14px; cursor: pointer;
}
.sched__day:hover:not(:disabled) { background: #2b2b30; }
/* Dia sem vaga continua legível, só apagado: sumir com ele confundiria a grade. */
.sched__day--indisponivel { color: #4a4a50; background: transparent; cursor: not-allowed; }
.sched__day--fora { color: #3a3a40; background: transparent; cursor: default; }
.sched__day--hoje { box-shadow: inset 0 0 0 1px var(--s-muted); }
.sched__day--ativo { background: var(--s-accent); color: #0b0b0c; font-weight: 600; }

/* --- Horários --- */
.sched__times { padding: 18px 16px; display: flex; flex-direction: column; min-width: 0; }
.sched__day-label { font-size: 15px; font-weight: 600; margin: 0 0 12px; text-align: center; }
.sched__slots { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 292px; }
.sched__slots::-webkit-scrollbar { width: 5px; }
.sched__slots::-webkit-scrollbar-thumb { background: #3a3a40; border-radius: 999px; }
.sched__hint { font-size: 13px; color: var(--s-muted); text-align: center; margin: 12px 0; }

.sched__slot {
  border: 1px solid var(--s-line); border-radius: 999px; background: var(--s-raised);
  color: var(--s-text); font: inherit; font-size: 14px; font-weight: 600;
  padding: 11px 0; cursor: pointer; flex: none;
}
.sched__slot:hover { background: #2b2b30; }
.sched__slot--ativo { background: var(--s-accent); color: #0b0b0c; border-color: var(--s-accent); }

/* --- Formulário --- */
.sched__form { padding: 20px 24px 4px; }
.sched__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sched__field { display: block; margin-bottom: 16px; }
.sched__label { display: block; font-size: 13px; color: var(--s-muted); margin-bottom: 7px; }

.sched__input {
  width: 100%; box-sizing: border-box;
  background: var(--s-raised); border: 1px solid var(--s-line); border-radius: 10px;
  color: var(--s-text); font: inherit; font-size: 15px; padding: 11px 14px;
}
.sched__input::placeholder { color: #5c5c64; }
.sched__input:focus, .sched__select:focus { outline: none; border-color: var(--s-muted); }
.sched__input--area { resize: vertical; min-height: 78px; }

.sched .alert { background: #2a1416; border-color: #5b2226; color: #fca5a5; }

/* --- Rodapé --- */
.sched__foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 18px 24px; border-top: 1px solid var(--s-line);
}
.sched__btn {
  border: 0; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 600;
  padding: 12px 26px; cursor: pointer; text-decoration: none;
}
.sched__btn--ghost { background: transparent; border: 1px solid var(--s-line); color: var(--s-muted); }
.sched__btn--ghost:hover { color: var(--s-text); }
.sched__btn--primary { background: var(--s-accent); color: #0b0b0c; }
.sched__btn--primary:disabled { opacity: .35; cursor: not-allowed; }

/* --- Confirmação --- */
.sched__done { padding: 44px 24px 48px; text-align: center; }
.sched__check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 999px;
  background: #14301f; color: #4ade80; font-size: 26px; margin-bottom: 16px;
}
.sched__done-title { font-size: 21px; margin: 0 0 10px; }
.sched__done-text { font-size: 15px; color: var(--s-text); margin: 0 0 8px; }
.sched__ref { font-size: 13px; color: var(--s-muted); margin: 0; }

@media (max-width: 560px) {
  .sched { padding: 0; }
  .sched__box { border: 0; border-radius: 0; min-height: 100vh; }
  /* No celular o calendário vira largura cheia e os horários descem: lado a
     lado, nenhum dos dois caberia. */
  .sched__grid { grid-template-columns: 1fr; }
  .sched__cal { border-right: 0; border-bottom: 1px solid var(--s-line); }
  .sched__slots { max-height: none; display: grid; grid-template-columns: repeat(3, 1fr); }
  .sched__row { grid-template-columns: 1fr; gap: 0; }
}

/* Ajuste em destaque: o atalho mais usado não deve parecer só mais um da pilha. */
.feature--destaque { border-color: var(--accent); background: rgba(232,108,42,.04); }

/* --- Cartão do link de reservas (Configurações) --------------------------- */
/* A prévia imita o cartão que o Instagram monta no direct: quem configura
   precisa ver o resultado, não imaginar. */
.share { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }

.share__preview { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.share__thumb {
  aspect-ratio: 1200 / 630; background: #e4e4e7;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12.5px;
}
.share__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.share__meta { padding: 12px 14px; }
.share__title { font-size: 14px; font-weight: 600; margin: 0; }
.share__desc { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; line-height: 1.4; }
.share__url { font-size: 11.5px; color: var(--muted); margin: 8px 0 0; text-transform: lowercase; }

.share__form { min-width: 0; }

@media (max-width: 720px) {
  .share { grid-template-columns: 1fr; }
  .share__preview { max-width: 320px; }
}

/* Foto de capa da página de reserva. Mesma imagem do cartão de prévia do
   direct — configurada uma vez, aparece nos dois lugares. */
.sched__hero { line-height: 0; background: #1d1d20; }
.sched__hero img {
  width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; display: block;
}
/* Um degradê ligando a foto ao painel, para a emenda não ficar dura. */
.sched__hero + .sched__head { position: relative; }
.sched__hero + .sched__head::before {
  content: ""; position: absolute; left: 0; right: 0; top: -40px; height: 40px;
  background: linear-gradient(to bottom, transparent, var(--s-panel));
  pointer-events: none;
}
