/* Painel do dono AtendeBar. Dois temas: noite (padrão) e dia.
   Ousadia num lugar só: o número da semana com luz amarela atrás. */
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* Paleta da marca AtendeBar: preto, amarelo (#FFC300) e verde (#25D366), com
   tons derivados para separar camadas e estados. */
:root,
:root[data-theme="night"] {
  color-scheme: dark;
  --bg: #0A0B0A;
  --surface: #141614;
  --surface-2: #1D201D;
  --line: rgba(244, 245, 240, 0.09);
  --line-strong: rgba(244, 245, 240, 0.17);
  --text: #F4F5F0;
  --muted: #A6ADA6;
  --faint: #7C847C;
  --yellow: #FFC300;
  --yellow-strong: #FFD24D;
  --yellow-deep: #E0A800;
  --yellow-text: #FFC300;
  --yellow-soft: rgba(255, 195, 0, 0.13);
  --on-yellow: #141100;
  --green: #25D366;
  --green-text: #4BE083;
  --green-soft: rgba(37, 211, 102, 0.13);
  --ok: #25D366;
  --alert: #FF6B5A;
  --alert-soft: rgba(255, 107, 90, 0.13);
  --orange: #FF9A3D;
  --orange-soft: rgba(255, 154, 61, 0.14);
  --ai-bubble: #0E2A19;
  --team-bubble: #262414;
  --heat-low: #1D201D;
  --glow: rgba(255, 195, 0, 0.24);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  --tabbar: rgba(10, 11, 10, 0.88);
}

:root[data-theme="day"] {
  color-scheme: light;
  --bg: #F6F7F3;
  --surface: #FFFFFF;
  --surface-2: #ECEEE8;
  --line: rgba(18, 20, 18, 0.1);
  --line-strong: rgba(18, 20, 18, 0.19);
  --text: #121412;
  --muted: #545B54;
  --faint: #737A73;
  --yellow: #FFC300;
  --yellow-strong: #E0A800;
  --yellow-deep: #B88A00;
  --yellow-text: #8A6700;
  --yellow-soft: rgba(255, 195, 0, 0.2);
  --on-yellow: #141100;
  --green: #25D366;
  --green-text: #11793F;
  --green-soft: rgba(37, 211, 102, 0.16);
  --ok: #138A47;
  --alert: #C2412F;
  --alert-soft: rgba(194, 65, 47, 0.1);
  --orange: #A8520C;
  --orange-soft: rgba(232, 120, 30, 0.13);
  --ai-bubble: #DDF6E6;
  --team-bubble: #FFF2C7;
  --heat-low: #ECEEE8;
  --glow: rgba(255, 195, 0, 0.32);
  --shadow: 0 18px 40px rgba(18, 20, 18, 0.12);
  --tabbar: rgba(246, 247, 243, 0.92);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; border-radius: 6px; }

.serif { font-family: "Fraunces", Georgia, "Times New Roman", serif; font-optical-sizing: auto; }
.num { font-family: "Fraunces", Georgia, serif; font-variant-numeric: lining-nums tabular-nums; font-optical-sizing: auto; }
.muted { color: var(--muted); }

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 18px) 20px calc(env(safe-area-inset-bottom) + 108px);
}
.view:focus { outline: none; }

/* Topo */
.topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.topline h1 { margin: 0; font-size: 1.05rem; font-weight: 650; letter-spacing: 0.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-btn {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
  font-family: "Fraunces", Georgia, serif; font-size: 1rem; text-decoration: none;
}
.status { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 0.875rem; color: var(--muted); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); }
.status.is-alert { color: var(--alert); }
.status.is-alert::before { background: var(--alert); box-shadow: 0 0 0 4px var(--alert-soft); }
.status.is-unknown::before { background: var(--faint); box-shadow: none; }

/* Seletor de período */
.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.segmented button {
  min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent;
  color: var(--muted); font-size: 0.875rem; font-weight: 600; cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.period-row { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; gap: 12px; }

/* O número da semana */
.hero { position: relative; margin-top: 18px; padding: 26px 0 8px; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; z-index: -1; left: -40px; top: -30px; width: 300px; height: 260px;
  background: radial-gradient(closest-side, var(--glow), transparent 72%);
  filter: blur(6px); opacity: 0.9;
}
.hero-number {
  display: block; font-size: clamp(5.5rem, 31vw, 8.75rem); line-height: 0.86; font-weight: 560;
  letter-spacing: -0.045em; color: var(--text);
}
.hero-line { margin: 14px 0 0; font-size: 1.15rem; line-height: 1.35; max-width: 22ch; }
.hero-sub { margin: 10px 0 0; color: var(--muted); font-size: 0.95rem; max-width: 38ch; }
.is-first .hero-number { animation: rise 700ms cubic-bezier(.2, .7, .2, 1) both; }
.is-first .hero::before { animation: glow 1400ms ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes glow { from { opacity: 0; transform: scale(0.85); } to { opacity: 0.9; transform: none; } }

/* Indicadores */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 26px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 16px 10px 16px 0; min-width: 0; }
.stat + .stat { padding-left: 14px; border-left: 1px solid var(--line); }
.stat .num { display: block; font-size: 1.9rem; line-height: 1.05; font-weight: 540; letter-spacing: -0.02em; }
.stat .num small { font-size: 0.55em; font-weight: 500; letter-spacing: 0; margin-left: 2px; }
.stat span:last-child { display: block; margin-top: 6px; font-size: 0.8rem; line-height: 1.3; color: var(--muted); }

/* Seções */
.section { margin-top: 38px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section h2, .page-title { margin: 0; font-family: "Fraunces", Georgia, serif; font-weight: 540; letter-spacing: -0.01em; }
.section h2 { font-size: 1.35rem; }
.page-title { font-size: 2rem; line-height: 1.1; margin-top: 8px; }
.page-intro { margin: 8px 0 0; color: var(--muted); max-width: 46ch; }
.link { color: var(--yellow-text); font-weight: 600; font-size: 0.9rem; text-decoration: none; background: none; border: 0; padding: 6px 0; cursor: pointer; }
.empty { color: var(--muted); margin: 6px 0 0; }

/* Precisa de você */
.attention { margin-top: 26px; padding: 16px 16px 6px; border-radius: 16px; background: var(--yellow-soft); border: 1px solid color-mix(in srgb, var(--yellow) 34%, transparent); border-left: 4px solid var(--yellow); }
.attention h2 { margin: 0 0 6px; font-size: 1.05rem; font-family: inherit; font-weight: 700; color: var(--yellow-text); }
.attention .row { border-color: color-mix(in srgb, var(--yellow) 22%, transparent); }

/* Linhas de lista */
.rows { margin: 0; padding: 0; list-style: none; }
.row {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 14px 0;
  border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; text-decoration: none; cursor: pointer;
}
.rows > li:last-child > .row, .rows > .row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { display: flex; justify-content: space-between; gap: 10px; font-weight: 650; }
.row-title span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-time { flex: none; color: var(--faint); font-weight: 500; font-size: 0.82rem; }
.row-text { margin-top: 2px; color: var(--muted); font-size: 0.92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.initial {
  flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); font-family: "Fraunces", Georgia, serif; font-size: 1.05rem; color: var(--text);
}
.initial.is-waiting { box-shadow: 0 0 0 2px var(--yellow); color: var(--yellow-text); }

/* Citações dos clientes */
.quotes { display: grid; gap: 4px; }
.quote { padding: 14px 0; border-bottom: 1px solid var(--line); }
.quote:last-child { border-bottom: 0; }
.quote blockquote { margin: 0; font-family: "Fraunces", Georgia, serif; font-style: italic; font-size: 1.12rem; line-height: 1.4; font-weight: 400; }
.quote blockquote::before { content: "“"; color: var(--yellow-text); margin-right: 1px; }
.quote blockquote::after { content: "”"; color: var(--yellow-text); margin-left: 1px; }
.quote p { margin: 6px 0 0; color: var(--muted); font-size: 0.88rem; }

/* Etiquetas */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 0.76rem; font-weight: 650; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tag.is-yellow { background: var(--yellow-soft); color: var(--yellow-text); }
.tag.is-alert { background: var(--alert-soft); color: var(--alert); }
.tag.is-ok { background: var(--green-soft); color: var(--green-text); }
.tag.is-waiting { background: var(--yellow); color: var(--on-yellow); }

/* Radar: cliente quente (amarelo), em risco (vermelho), reclamação sensível (laranja) */
.radar .section-head { align-items: center; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 0.78rem; font-weight: 650; color: var(--faint); }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: live 2.4s ease-in-out infinite; }
@keyframes live { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }
.radar-item { --kind: var(--yellow-text); --kind-soft: var(--yellow-soft); }
.radar-item.is-risk, .radar-count.is-risk { --kind: var(--alert); --kind-soft: var(--alert-soft); }
.radar-item.is-sensitive, .radar-count.is-sensitive { --kind: var(--orange); --kind-soft: var(--orange-soft); }
.radar-count { --kind: var(--yellow-text); --kind-soft: var(--yellow-soft); }
.radar-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.radar-count {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px;
  background: var(--kind-soft); color: var(--kind); font-size: 0.8rem; font-weight: 650; line-height: 1.25;
}
.radar-count .num { font-size: 1.6rem; line-height: 1; font-weight: 560; }
.radar-count.is-zero { background: var(--surface); color: var(--faint); }
.radar-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.radar-item {
  position: relative; border-radius: 16px; background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--kind);
}
.radar-item.is-new { animation: radar-in 900ms cubic-bezier(.2, .7, .2, 1) both; }
@keyframes radar-in { from { opacity: 0; transform: translateY(-6px); box-shadow: 0 0 0 6px var(--kind-soft); } to { opacity: 1; transform: none; box-shadow: none; } }
.radar-link { display: flex; flex-direction: column; gap: 3px; padding: 13px 52px 13px 14px; text-decoration: none; color: inherit; }
.radar-top { display: flex; align-items: center; gap: 10px; }
.radar-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px;
  background: var(--kind-soft); color: var(--kind); font-size: 0.76rem; font-weight: 700; white-space: nowrap;
}
.radar-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.radar-name { margin-top: 4px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radar-reason { font-size: 0.92rem; }
.radar-quote {
  margin-top: 2px; color: var(--muted); font-size: 0.9rem; font-style: italic;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.radar-quote::before { content: "“"; } .radar-quote::after { content: "”"; }
.radar-hide {
  position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--faint); cursor: pointer;
}
.radar-hide:hover { background: var(--surface-2); color: var(--text); }
.radar-hide svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.radar-empty { margin: 4px 0 0; padding: 14px; border-radius: 14px; background: var(--surface); color: var(--muted); font-size: 0.92rem; }
.radar-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 6px; }
.link-quiet { color: var(--muted); font-weight: 600; }

/* Resumo do período em português */
.brief {
  margin-top: 30px; padding: 18px 18px 16px; border-radius: 18px; background: var(--surface);
  border: 1px solid var(--line); position: relative; overflow: hidden;
}
.brief::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--green); }
.brief-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.brief h2 { margin: 0; font-family: "Fraunces", Georgia, serif; font-weight: 540; font-size: 1.2rem; }
.brief-time { color: var(--faint); font-size: 0.8rem; flex: none; }
.brief p { margin: 10px 0 0; font-size: 1rem; line-height: 1.55; }

/* Agenda resumida */
.agenda { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.agenda a { display: block; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.agenda .num { display: block; font-size: 2.2rem; line-height: 1; font-weight: 540; }
.agenda span:not(.num) { display: block; margin-top: 6px; color: var(--muted); font-size: 0.88rem; }
.note { margin: 10px 0 0; font-size: 0.88rem; color: var(--muted); }
.note strong { color: var(--text); font-weight: 650; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border-radius: 14px; border: 0; background: var(--yellow); color: var(--on-yellow); font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn-quiet { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn-block { width: 100%; }
.btn-small { min-height: 36px; padding: 0 14px; border-radius: 11px; font-size: 0.88rem; }
.fab-space { height: 64px; }
.fab {
  position: fixed; right: max(20px, calc(50% - 260px)); bottom: calc(env(safe-area-inset-bottom) + 88px); z-index: 20;
  box-shadow: var(--shadow);
}

/* Navegação inferior */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  max-width: 560px; margin: 0 auto;
  padding: 6px 8px calc(env(safe-area-inset-bottom) + 6px);
  background: var(--tabbar); border-top: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.tabbar a {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; padding-top: 6px;
  color: var(--faint); text-decoration: none; font-size: 0.72rem; font-weight: 650; border-radius: 12px;
}
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current="page"] { color: var(--yellow-text); }
.tabbar a[aria-current="page"] svg { stroke-width: 2.1; }
.tabbar-dot { position: absolute; top: 6px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 2px var(--bg); }

/* Conversas */
.search {
  width: 100%; min-height: 46px; margin-top: 16px; padding: 0 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); outline: none;
}
.search:focus { border-color: var(--yellow); }
.chips { display: flex; gap: 8px; margin: 12px -20px 4px; padding: 0 20px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font-size: 0.88rem; font-weight: 600; cursor: pointer;
}
.chips button[aria-pressed="true"] { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); }
.chips .count { margin-left: 6px; opacity: 0.75; }

.thread-top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px;
  margin: calc(-18px - env(safe-area-inset-top)) -20px 0; padding: calc(env(safe-area-inset-top) + 10px) 12px 10px;
  background: var(--tabbar); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.back { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; text-decoration: none; }
.back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.thread-top strong { display: block; font-size: 1rem; line-height: 1.2; }
.thread-top small { color: var(--muted); }
.banner { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--yellow-soft); border-left: 4px solid var(--yellow); color: var(--text); font-size: 0.92rem; }
.messages { display: flex; flex-direction: column; gap: 6px; padding: 16px 0 12px; }
.day-sep { align-self: center; margin: 14px 0 6px; font-size: 0.78rem; color: var(--faint); font-weight: 600; }
.bubble { max-width: 84%; padding: 10px 13px 8px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.95rem; }
.bubble.is-customer { align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble.is-ai { align-self: flex-end; background: var(--ai-bubble); border-color: color-mix(in srgb, var(--green) 22%, transparent); border-bottom-right-radius: 6px; }
.bubble.is-team { align-self: flex-end; background: var(--team-bubble); border-color: color-mix(in srgb, var(--yellow) 22%, transparent); border-bottom-right-radius: 6px; }
.bubble-meta { display: block; margin-top: 4px; font-size: 0.72rem; color: var(--faint); text-align: right; }
.bubble.is-customer .bubble-meta { text-align: left; }
.bubble img { display: block; max-width: 100%; border-radius: 12px; margin-bottom: 6px; }
.composer { position: sticky; bottom: calc(env(safe-area-inset-bottom) + 8px); margin-top: 8px; }
.composer-box { padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.composer textarea { width: 100%; min-height: 84px; resize: vertical; border: 0; background: transparent; outline: none; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }

/* Reservas */
.res-day { margin-top: 26px; }
.res-day h2 { font-size: 1.1rem; }
.res-card { margin-top: 12px; padding: 16px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.res-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.res-who { min-width: 0; display: grid; gap: 2px; }
.res-name { font-weight: 650; font-size: 1.05rem; line-height: 1.3; overflow-wrap: anywhere; }
.res-phone { justify-self: start; color: var(--muted); font-size: 0.86rem; font-variant-numeric: tabular-nums; text-decoration: none; }
.res-phone::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--green); vertical-align: 1px; }
.res-phone:hover { color: var(--text); }
.res-size { flex: none; display: grid; justify-items: end; font-family: "Fraunces", Georgia, serif; font-size: 1.6rem; line-height: 1; }
.res-size small { margin-top: 4px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; font-size: 0.72rem; color: var(--muted); }
.res-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; align-items: center; }
/* Flex em vez de grid: o último campo cresce e a linha nunca fica com célula vazia. */
.res-facts { display: flex; flex-wrap: wrap; gap: 1px; margin: 14px 0 0; border-radius: 12px; overflow: hidden; background: var(--line); border: 1px solid var(--line); }
.res-facts > div { flex: 1 1 128px; padding: 10px 12px; background: var(--bg); min-width: 0; }
.res-facts dt { font-size: 0.68rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.res-facts dd { margin: 3px 0 0; font-size: 0.94rem; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.res-facts dd.is-yes { color: var(--green-text); }
.res-facts dd.is-quiet { color: var(--muted); font-weight: 500; }
.res-note { margin: 12px 0 0; padding-left: 12px; border-left: 2px solid var(--yellow); color: var(--muted); font-size: 0.9rem; }
.res-actions { margin-top: 12px; display: flex; gap: 8px; }
.pending-box { margin-top: 22px; }
.pending-box h2 { margin: 0; font-size: 1.05rem; font-family: inherit; font-weight: 700; color: var(--yellow-text); }
.pending-box .res-card { border-color: color-mix(in srgb, var(--yellow) 35%, transparent); box-shadow: 0 0 0 3px var(--yellow-soft); }

/* Insights */
.bars { margin: 0; padding: 0; list-style: none; }
.bar-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.bar-item:last-child { border-bottom: 0; }
.bar-label { display: flex; justify-content: space-between; gap: 10px; font-weight: 650; }
.bar-label .num { font-weight: 560; font-size: 1.1rem; }
.bar-track { margin-top: 8px; height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; width: calc(var(--v, 0) * 100%); border-radius: 6px; background: linear-gradient(90deg, var(--yellow-deep), var(--yellow)); }
.bar-delta { font-size: 0.8rem; color: var(--muted); font-weight: 500; margin-left: 6px; }
.bar-item details { margin-top: 6px; }
.bar-item summary { cursor: pointer; color: var(--yellow-text); font-size: 0.86rem; font-weight: 600; list-style: none; }
.bar-item summary::-webkit-details-marker { display: none; }
.bar-item details blockquote { margin: 8px 0 0; padding-left: 12px; border-left: 2px solid var(--line-strong); font-family: "Fraunces", Georgia, serif; font-style: italic; color: var(--text); }

.heatmap { display: grid; grid-template-columns: 30px repeat(24, minmax(0, 1fr)); gap: 2px; margin-top: 6px; width: 100%; }
.heat-day { font-size: 0.7rem; color: var(--faint); align-self: center; }
.heat-cell { aspect-ratio: 1 / 1.35; border-radius: 3px; background: color-mix(in srgb, var(--yellow) calc(var(--v, 0) * 100%), var(--heat-low)); }
.heat-hours { display: grid; grid-template-columns: 30px repeat(4, minmax(0, 1fr)); margin-top: 4px; font-size: 0.68rem; color: var(--faint); }
.compare { display: grid; gap: 0; }
.compare-row { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.compare-row:last-child { border-bottom: 0; }
.compare-row .num { font-size: 1.35rem; }
.compare-row small { color: var(--muted); margin-left: 8px; }

/* Conta e conhecimento */
.account-name { margin: 18px 0 0; font-family: "Fraunces", Georgia, serif; font-size: 2.1rem; line-height: 1.1; font-weight: 540; }
.settings { margin-top: 10px; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.setting:last-child { border-bottom: 0; }
.setting small { display: block; color: var(--muted); font-size: 0.86rem; }
.chev { color: var(--faint); }
.link-reset { width: 100%; background: none; border: 0; text-align: left; cursor: pointer; color: var(--alert); font-weight: 650; }
.row.is-static { cursor: default; }
.knowledge { margin-top: 18px; }
.k-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.k-section:last-child { border-bottom: 0; }
.k-section h2 { margin: 0; font-family: "Fraunces", Georgia, serif; font-size: 1.2rem; font-weight: 540; }
.k-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.k-body { margin-top: 8px; font-size: 0.95rem; line-height: 1.55; overflow-wrap: anywhere; }
.k-body p { margin: 0 0 10px; }
.k-body ul { margin: 0 0 10px; padding-left: 20px; }
.k-body li { margin: 3px 0; }
.k-body li::marker { color: var(--yellow-text); }
.k-body h3 { margin: 14px 0 4px; font-size: 0.82rem; font-weight: 650; color: var(--muted); }
.k-body h3:first-child { margin-top: 0; }
.k-body > :last-child, .k-body p:last-child { margin-bottom: 0; }
.k-body a { color: var(--yellow-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.k-body.is-clamped { max-height: 11.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 65%, transparent); mask-image: linear-gradient(#000 65%, transparent); }
.k-empty { margin: 6px 0 0; color: var(--faint); font-size: 0.9rem; }
.k-hours { margin: 0; display: grid; }
.k-hours div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.k-hours div:last-child { border-bottom: 0; }
.k-hours dt { font-weight: 600; }
.k-hours dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.k-hours .is-closed dd { color: var(--faint); }
.k-hours + p { margin-top: 10px; color: var(--muted); }
.k-answers { margin: 0; display: grid; gap: 12px; }
.k-answers dt { font-weight: 650; }
.k-answers dd { margin: 2px 0 0; }
.qa-row { padding: 4px 0 10px; border-bottom: 1px solid var(--line); }
.qa-row .field:first-child { margin-top: 12px; }
.qa-remove { color: var(--muted); font-size: 0.84rem; }
.qa-list + .btn { margin-top: 14px; }
.qa-thumb { display: block; max-width: min(220px, 100%); max-height: 220px; margin-top: 8px; border-radius: 12px; border: 1px solid var(--line); object-fit: contain; background: var(--surface-2); }
.qa-thumb[hidden] { display: none; }
.qa-image-actions { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.qa-pick { cursor: pointer; }
.qa-image-status { margin: 6px 0 0; font-size: 0.84rem; }
.qa-date { max-width: 200px; }
.k-answers .is-expired dt, .k-answers .is-expired dd > p { color: var(--faint); }
.k-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.k-facts .tag { white-space: normal; max-width: 100%; }
.k-actions { display: flex; gap: 16px; margin-top: 8px; }
.notice { margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: var(--yellow-soft); font-size: 0.92rem; }

/* Entrar */
.login { min-height: calc(100vh - 140px); display: flex; flex-direction: column; justify-content: center; max-width: 380px; margin: 0 auto; }
.login img { width: 76px; height: 76px; }
.login h1 { margin: 18px 0 0; font-family: "Fraunces", Georgia, serif; font-size: 2.3rem; line-height: 1.05; font-weight: 540; letter-spacing: -0.02em; }
.login p { color: var(--muted); margin: 10px 0 0; }
.field { display: block; margin-top: 18px; }
.field span { display: block; font-size: 0.88rem; font-weight: 650; margin-bottom: 6px; }
.field span small { display: block; margin-top: 2px; font-weight: 400; color: var(--muted); }
.input {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-strong);
  background: var(--surface); outline: none;
}
textarea.input { padding: 12px 14px; min-height: 120px; resize: vertical; }
.input:focus { border-color: var(--yellow); }
.form-error { color: var(--alert); font-size: 0.9rem; margin: 10px 0 0; }
.actions-top { margin-top: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.field-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; color: var(--faint); font-size: 0.8rem; }
.count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.small { font-size: 0.84rem; }
.preview { margin-top: 10px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); }
.preview summary { cursor: pointer; color: var(--yellow-text); font-size: 0.86rem; font-weight: 600; }
.preview[open] summary { margin-bottom: 8px; }
.preview-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 0.82rem; font-weight: 650; }
.switch-row { display: flex; align-items: center; gap: 12px; margin-top: 18px; font-weight: 600; cursor: pointer; }
.switch-row input, .week-day input, .choice-item input { width: 22px; height: 22px; accent-color: var(--yellow); flex: none; }
.choice { border: 0; padding: 0; margin: 18px 0 0; }
.choice legend { padding: 0; font-size: 0.88rem; font-weight: 650; margin-bottom: 6px; }
.choice-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.choice-item:last-child { border-bottom: 0; }
.week { margin-top: 16px; }
.week-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.week-day { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; min-height: 44px; }
.week-times { display: flex; align-items: center; gap: 6px; }
.week-times .input { width: 96px; min-height: 42px; padding: 0 8px; text-align: center; font-variant-numeric: tabular-nums; }
.week-sep { color: var(--muted); font-size: 0.85rem; }
.week-closed { display: none; color: var(--faint); font-size: 0.9rem; }
.week-row.is-closed .week-times { display: none; }
.week-row.is-closed .week-closed { display: block; }
.week + .link { margin-top: 6px; }
@media (max-width: 359px) {
  .week-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .week-day { min-height: 36px; }
  .week-times .input { flex: 1; width: auto; min-width: 0; }
  .week-row.is-closed .week-closed { display: none; }
}
.notice .k-body, .notice .muted { display: block; margin-top: 6px; }
.gap-quote { margin: 12px 0 0; padding-left: 12px; border-left: 2px solid var(--yellow); font-family: "Fraunces", Georgia, serif; font-style: italic; font-size: 1.05rem; }

/* Folha inferior */
.sheet {
  width: min(560px, 100%); max-width: 100%; max-height: 92vh; margin: auto auto 0; padding: 0;
  border: 0; border-radius: 22px 22px 0 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  overflow-y: auto; overscroll-behavior: contain;
}
.sheet::backdrop { background: rgba(8, 6, 4, 0.55); }
.sheet[open] { animation: sheet 220ms cubic-bezier(.2, .7, .2, 1); }
@keyframes sheet { from { transform: translateY(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet-body { padding: 10px 20px calc(env(safe-area-inset-bottom) + 20px); }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 0 auto 12px; }
.sheet h2 { margin: 0; font-family: "Fraunces", Georgia, serif; font-weight: 540; font-size: 1.45rem; }
.sheet .actions { display: grid; gap: 10px; margin-top: 18px; }

.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 86px); z-index: 50; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 40px); padding: 12px 16px; border-radius: 14px;
  background: var(--text); color: var(--bg); font-weight: 600; font-size: 0.92rem; box-shadow: var(--shadow);
}
.toast-action { margin-left: 8px; padding: 4px 2px; border: 0; background: none; color: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Carregamento */
.skel { border-radius: 12px; background: var(--surface); }
.skel-hero { height: 150px; width: 62%; margin-top: 40px; }
.skel-line { height: 18px; margin-top: 14px; }
.skel-line.short { width: 48%; }
.foot { margin-top: 36px; color: var(--faint); font-size: 0.8rem; }
.error-box { margin-top: 30px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }

@media (min-width: 720px) {
  .app { padding-top: 36px; }
  .hero::before { width: 380px; }
}

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

/* Ajustes e grupos do que a IA sabe */
.k-jump { margin-top: 14px; }
.k-group {
  margin: 30px 0 0; padding-top: 6px; scroll-margin-top: 16px;
  font-size: 0.78rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--yellow-text);
}
.k-group:first-child { margin-top: 8px; }
.setting-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.link.danger { margin-top: 18px; color: var(--alert); }
select.input { appearance: none; min-height: 48px; }

/* Reconectar WhatsApp */
.qr-steps { margin: 12px 0 0; padding-left: 20px; color: var(--muted); font-size: 0.94rem; line-height: 1.5; }
.qr-steps b { color: var(--text); font-weight: 650; }
.qr-box { display: grid; place-items: center; min-height: 272px; margin-top: 16px; padding: 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); text-align: center; }
.qr-img { display: block; width: min(248px, 100%); height: auto; aspect-ratio: 1; border-radius: 10px; background: #FFFFFF; padding: 8px; }
.qr-ok { margin: 0; color: var(--green-text); font-weight: 650; }

/* Vencimento do plano */
.billing { margin-top: 18px; padding: 14px 16px; border-radius: 16px; background: var(--yellow-soft); border: 1px solid color-mix(in srgb, var(--yellow) 34%, transparent); border-left: 4px solid var(--yellow); }
.billing.is-due { border-left-width: 6px; }
.billing.is-late { background: var(--alert-soft); border-color: color-mix(in srgb, var(--alert) 40%, transparent); border-left: 6px solid var(--alert); }
.billing-text { margin: 0 0 6px; font-weight: 700; font-size: 1.02rem; }
.billing.is-late .billing-text { color: var(--alert); }
.billing-pay { margin: 0 0 10px; font-size: 0.92rem; line-height: 1.45; }
.billing-pix { font-weight: 600; word-break: break-all; }
.billing-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.billing-copy, .billing-send { font: inherit; font-size: 0.88rem; font-weight: 600; padding: 8px 14px; border-radius: 999px; cursor: pointer; text-decoration: none; }
.billing-copy { background: transparent; color: inherit; border: 1px solid currentColor; }
.billing-send { background: var(--yellow); color: #0A0B0A; border: 0; }
