/* Clearpath production skin — Soft Modern-grade polish (the standard the
 * Book & Pay themes set): generous radius, soft shadows, calm type, tenant
 * brand tint via --brand / --accent. External CSS only; no inline styles in
 * markup beyond tenant brand custom properties on the business bar. */
:root {
  --brand: #16324f;
  --accent: #e86a17;
  --ink: #14222e;
  --muted: #5d707d;
  --line: #dde5ea;
  --bg: #f4f7f9;
  --card: #ffffff;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(16, 42, 67, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
h1, h2, h3, .biz-name, .headline-value, .stat-num, .wordmark {
  font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
}
a { color: var(--brand); }
code, .snippet { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px 48px; }
.wrap.narrow { max-width: 760px; }
.loading { padding: 60px 0; color: var(--muted); }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; background: #0c1d2e; color: #e8f1f7;
}
.wordmark { color: #fff; font-weight: 800; font-size: 20px; text-decoration: none; letter-spacing: 0.2px; }
.topbar-tag { color: #9db8c9; font-size: 13px; }
.topbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.hero { padding: 56px 0 28px; max-width: 820px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; font-weight: 700; color: var(--accent); margin: 0 0 10px; }
.hero h1 { font-size: 42px; line-height: 1.12; margin: 0 0 16px; }
.lede { font-size: 18px; color: var(--muted); margin: 0 0 18px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0; }
.price-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); max-width: 680px;
}
.price-line { font-size: 18px; margin: 0 0 6px; }
.price-sub { color: var(--muted); margin: 0; font-size: 14px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 18px 0; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); margin: 14px 0;
}
.card h3 { margin-top: 0; }
.card.wide { max-width: 820px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 16px 34px; }
.hint { color: var(--muted); font-size: 13.5px; }
.note { background: #fdf3e7; border: 1px solid #f3ddba; border-radius: 12px; padding: 10px 14px; font-size: 14px; }

.btn {
  display: inline-block; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 9px 18px; font: 600 14.5px Inter, sans-serif;
  cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.12); }
.btn.ghost { background: transparent; }
.btn.big { padding: 13px 26px; font-size: 16px; }
.btn.full { width: 100%; text-align: center; }
.topbar .btn.ghost { color: #e8f1f7; border-color: #33506c; }

label { display: block; font-size: 14px; font-weight: 600; margin: 10px 0; }
input, select, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; font: 400 15px Inter, sans-serif;
  background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-error { color: #b3261e; font-size: 14px; }
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pipeline { padding-left: 20px; }
.pipeline li { margin: 14px 0; }
.checklist { display: grid; gap: 4px; margin-top: 8px; }
.check { display: flex; gap: 9px; align-items: center; font-weight: 500; }
.check input { width: auto; margin: 0; }

/* ------------------------------------------------------------- chat ------ */
.bizbar { background: var(--brand); color: #fff; }
.bizbar-in { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.biz-name { font-size: 24px; font-weight: 800; margin: 0; }
.biz-tag { margin: 2px 0 0; color: rgba(255, 255, 255, 0.82); font-size: 14px; }
.biz-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600; background: rgba(255, 255, 255, 0.16); color: #fff; }
.chip.phone { background: #fff; color: var(--brand); }
.chip.open { background: #1d7a4f; }
.chip.closed { background: var(--accent); }

.chat-layout { display: grid; grid-template-columns: 340px 1fr; gap: 18px; padding-top: 22px; align-items: start; }
.chat-layout.embed { grid-template-columns: 1fr; padding-top: 10px; }
.bizcard h2 { margin-top: 0; }
.svc-list { list-style: none; padding: 0; margin: 0 0 8px; }
.svc-list li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.svc-list li:last-child { border-bottom: 0; }
.svc-list strong { display: block; }
.svc-list span { color: var(--muted); font-size: 14px; }
.lead-form { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 6px; }

.chat { display: flex; flex-direction: column; min-height: 560px; }
.chat-head { display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font: 800 19px "Plus Jakarta Sans", sans-serif;
}
.chat-who { margin: 0; font-weight: 700; }
.chat-sub { margin: 0; color: var(--muted); font-size: 13px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #1d7a4f; }
.chat-messages { flex: 1; overflow-y: auto; padding: 18px 2px; display: flex; flex-direction: column; gap: 10px; max-height: 560px; }
.msg { max-width: 82%; padding: 11px 15px; border-radius: 16px; box-shadow: 0 2px 8px rgba(16, 42, 67, 0.05); }
.msg p { margin: 0; }
.msg.assistant { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 5px; }
.msg.visitor { background: var(--brand); color: #fff; align-self: flex-end; border-bottom-right-radius: 5px; }
.msg.system { background: #eef4f7; color: var(--muted); align-self: center; font-size: 13.5px; max-width: 92%; }
.msg-tags { margin-top: 6px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; padding: 6px 0 10px; }
.chip-btn {
  border: 1px solid var(--line); background: #f8fafc; border-radius: 999px;
  padding: 6px 13px; font: 600 13px Inter, sans-serif; cursor: pointer;
}
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.chat-form { display: flex; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.chat-form input { flex: 1; margin: 0; }
.lead-banner { background: #e7f4ec; border: 1px solid #bfe3cc; border-radius: 12px; padding: 10px 14px; font-size: 14.5px; }

.tag { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 700; background: #eef4f7; color: var(--muted); }
.tag.new { background: var(--accent); color: #fff; }
.tag.warn { background: #fbe9c9; color: #8a5a00; }
.tag.danger { background: #f8d7d2; color: #8f1d12; }
.badge { border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; background: #eef4f7; }
.badge.live { background: #d9efe1; color: #14532d; }
.badge.paused { background: #f8d7d2; color: #8f1d12; }

/* ------------------------------------------------------------ admin ------ */
.admin-head h1 { margin-bottom: 2px; }
.headline { background: var(--brand); color: #fff; border: 0; }
.headline-value { font-size: 32px; font-weight: 800; margin: 0; }
.headline-sub { margin: 4px 0 0; color: rgba(255, 255, 255, 0.85); }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 14px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-align: center; }
.stat-num { display: block; font-size: 24px; font-weight: 800; }
.stat-label { color: var(--muted); font-size: 12.5px; }
.insight { background: #fdf3e7; border: 1px solid #f3ddba; border-radius: 14px; padding: 12px 16px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 4px; }
.tab { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 16px; font: 600 14px Inter, sans-serif; cursor: pointer; }
.tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.lead-list { display: grid; gap: 4px; }
.lead-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lead-ref { font-family: ui-monospace, monospace; font-size: 13px; color: var(--muted); }
.lead-time { margin-left: auto; color: var(--muted); font-size: 13px; }
.lead-meta { color: var(--muted); margin: 4px 0 8px; }
.details { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 18px; margin: 10px 0; }
.details div { border-top: 1px solid var(--line); padding-top: 6px; }
.details dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.details dd { margin: 2px 0 0; }
.lead-actions { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; border-top: 1px dashed var(--line); padding-top: 10px; }
.lead-actions label { margin: 0; flex: 0 1 220px; }
.lead-actions input, .lead-actions select { margin-top: 4px; }

.conv-head { width: 100%; text-align: left; background: none; border: 0; font: inherit; cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 0; }
.thread { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.unanswered { padding-left: 18px; }
.unanswered li { margin: 8px 0; }
.edit-row { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin: 10px 0; background: #fbfcfd; }
.hours-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding: 6px 0; }
.hours-row .day { width: 110px; font-weight: 700; }
.hours-row label { margin: 0; display: flex; gap: 7px; align-items: center; font-weight: 500; }
.hours-row input[type="time"] { width: 130px; margin: 0; }
.snippet { background: #0c1d2e; color: #dcebf5; border-radius: 12px; padding: 14px 16px; overflow-x: auto; font-size: 13px; }

@media (max-width: 860px) {
  .grid-3, .auth-grid, .two-col { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 31px; }
  .msg { max-width: 92%; }
  .chat-messages { max-height: 480px; }
  .bizbar-in { flex-direction: column; align-items: flex-start; }
  .lead-time { margin-left: 0; }
}
