/* Public site, sign-in pages and dashboards.
   Palette: petrol (structure), mist (ground), marigold (waiting), leaf (live), coral (stop). */

@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --petrol-950: #0A2529;
  --petrol-900: #0E3238;
  --petrol-700: #17525B;
  --petrol-600: #1C6570;
  --petrol-100: #D9E8E7;
  --mist: #EEF3F2;
  --paper: #FFFFFF;
  --ink: #132225;
  --muted: #56696D;
  --line: #D5E0DF;
  --marigold: #F0A22E;
  --marigold-100: #FDF0D6;
  --marigold-ink: #6B4700;
  --leaf: #23855A;
  --leaf-100: #DDF1E6;
  --coral: #C6392D;
  --coral-100: #FBE3E0;
  --display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 15px/1.5 var(--text);
  color: var(--ink);
  background: var(--mist);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); font-weight: 650; line-height: 1.15; letter-spacing: -.015em; margin: 0; }
p { margin: 0 0 1em; }
a { color: var(--petrol-600); text-underline-offset: 2px; }
a:hover { color: var(--petrol-900); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--petrol-600); outline-offset: 2px; border-radius: 4px; }
code, pre, .mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Buttons, chips, fields ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--petrol-600);
  border-radius: 8px;
  background: var(--petrol-600);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--petrol-700); border-color: var(--petrol-700); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }
.btn--ghost { background: transparent; color: var(--petrol-700); border-color: var(--line); }
.btn--ghost:hover { background: var(--petrol-100); color: var(--petrol-900); border-color: var(--petrol-100); }
.btn--danger { background: transparent; color: var(--coral); border-color: var(--coral-100); }
.btn--danger:hover { background: var(--coral); border-color: var(--coral); color: #fff; }
.btn--warm { background: var(--marigold); border-color: var(--marigold); color: #2B1D00; }
.btn--warm:hover { background: #E0931D; border-color: #E0931D; color: #2B1D00; }
.btn--sm { padding: 5px 10px; font-size: 13px; border-radius: 6px; }
.btn--lg { padding: 13px 22px; font-size: 16px; border-radius: 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form { display: inline; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
  background: var(--petrol-100); color: var(--petrol-900);
  white-space: nowrap;
}
.chip--ok { background: var(--leaf-100); color: #14573A; }
.chip--wait { background: var(--marigold-100); color: var(--marigold-ink); }
.chip--off { background: #E6EAEA; color: #4A5A5D; }
.chip--bad { background: var(--coral-100); color: #8A241B; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }

/* Queue ticket: the number a chat carries from the queue into the history. */
.ticket {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--marigold-100);
  color: var(--marigold-ink);
  font: 600 12.5px/1.6 var(--mono);
  border-left: 3px solid var(--marigold);
  text-decoration: none;
}
a.ticket:hover { background: var(--marigold); color: #2B1D00; }

.field { display: block; margin-bottom: 14px; }
.field > span, .field > label, .label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 13.5px; }
.field small { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=tel],
.field input[type=url], .field input[type=number], .field input[type=search], .field input[type=date], .field input[type=datetime-local], .field input[type=time], .field select, .field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #BFCDCC;
  border-radius: 8px;
  background: var(--paper);
}
.field textarea { min-height: 96px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--petrol-600); outline: 2px solid var(--petrol-600); outline-offset: 0;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.check { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; }
.check input { margin-top: 4px; }
.hp-field { position: absolute; left: -5000px; height: 1px; overflow: hidden; }

.alert {
  padding: 11px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  overflow-wrap: anywhere;
}
.alert--ok { background: var(--leaf-100); color: #14573A; border-color: #BFE3CF; }
.alert--error { background: var(--coral-100); color: #8A241B; border-color: #F3C4BE; }
.alert--info { background: var(--marigold-100); color: var(--marigold-ink); border-color: #F5DCA8; }

/* ---------- Brand ---------- */

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 20px/1 var(--display);
  letter-spacing: -.02em;
  color: inherit; text-decoration: none;
}
.brand svg { flex: none; }

/* ---------- Public site ---------- */

.site { background: var(--paper); font-size: 17px; line-height: 1.55; }
.wrap { width: min(1120px, 100% - 40px); margin: 0 auto; }
.site-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; }
.site-head .brand { color: var(--petrol-900); }
.site-nav { display: flex; align-items: center; gap: 10px; }

.hero { background: var(--petrol-900); color: #fff; overflow: hidden; }
.hero .site-head .brand { color: #fff; }
.hero .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .3); }
.hero .btn--ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .3); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: 56px;
  align-items: center;
  padding: 44px 0 0;
}
.hero-copy { padding-bottom: 72px; }
.hero h1 {
  font-size: clamp(38px, 5.4vw, 66px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.035em;
  margin-bottom: 22px;
  text-wrap: balance;
}
.hero-lead { font-size: 19px; color: #C9DCDB; max-width: 34em; margin-bottom: 28px; }
.hero .btn-row { gap: 12px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 30px 0 0; padding: 0; list-style: none; color: #C9DCDB; font-size: 15px; }
.hero-facts li { display: flex; align-items: center; gap: 8px; }
.hero-facts .dot { color: var(--marigold); }

/* The scripted conversation in the hero: AI answers, then a person joins. */
.demo {
  align-self: end;
  background: var(--paper);
  color: var(--ink);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 60px rgba(0, 0, 0, .35);
  font-size: 15px;
  line-height: 1.45;
  overflow: hidden;
}
.demo-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--petrol-600); color: #fff; }
.demo-head .av { width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .2); display: grid; place-items: center; font: 700 16px var(--display); }
.demo-head strong { display: block; font: 650 16px/1.2 var(--display); }
.demo-head span { font-size: 13px; opacity: .85; }
.demo-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 16px 22px; min-height: 380px; }
.demo .b { max-width: 84%; padding: 9px 13px; border-radius: 14px 14px 14px 4px; background: var(--mist); }
.demo .b small { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.demo .b.me { align-self: flex-end; background: var(--petrol-600); color: #fff; border-radius: 14px 14px 4px 14px; }
.demo .b.staff small { color: var(--petrol-600); font-weight: 600; }
.demo .join { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.demo .join::before, .demo .join::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.demo .join b { font-weight: 600; color: var(--marigold-ink); background: var(--marigold-100); padding: 1px 8px; border-radius: 4px; }
.demo-body > * { opacity: 0; animation: demo-in .35s ease-out forwards; }
.demo-body > :nth-child(1) { animation-delay: .3s; }
.demo-body > :nth-child(2) { animation-delay: 1.2s; }
.demo-body > :nth-child(3) { animation-delay: 2.1s; }
.demo-body > :nth-child(4) { animation-delay: 3.2s; }
.demo-body > :nth-child(5) { animation-delay: 4.1s; }
.demo-body > :nth-child(6) { animation-delay: 5s; }
@keyframes demo-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.section { padding: 84px 0; }
.section--mist { background: var(--mist); }
.section h2 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -.03em; margin-bottom: 14px; text-wrap: balance; }
.section-lead { color: var(--muted); max-width: 40em; margin-bottom: 44px; }

/* How a chat moves: a real sequence, so it is numbered and joined by a line. */
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; counter-reset: step; }
.flow li { position: relative; padding-top: 58px; counter-increment: step; }
.flow li::before {
  content: counter(step);
  position: absolute; top: 0; left: 0;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--petrol-900); color: #fff;
  font: 700 17px var(--display);
}
.flow li::after { content: ""; position: absolute; top: 20px; left: 52px; right: -16px; height: 2px; background: var(--line); }
.flow li:last-child::after { display: none; }
.flow li:nth-child(3)::before { background: var(--marigold); color: #2B1D00; }
.flow h3 { font-size: 20px; margin-bottom: 8px; }
.flow p { color: var(--muted); font-size: 16px; margin: 0; }

.roles { border-top: 1px solid var(--line); }
.role { display: grid; grid-template-columns: 240px 1fr 1fr; gap: 28px; padding: 28px 0; border-bottom: 1px solid var(--line); align-items: start; }
.role h3 { font-size: 24px; }
.role p { margin: 0; color: var(--muted); font-size: 16px; }
.role ul { margin: 0; padding-left: 18px; font-size: 16px; }
.role li { margin-bottom: 4px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.split > * { min-width: 0; }
.snippet {
  background: var(--petrol-950);
  color: #D7E6E5;
  border-radius: 12px;
  padding: 20px 22px;
  overflow-x: auto;
  font: 14px/1.6 var(--mono);
  margin: 0 0 18px;
  white-space: pre;
}
.snippet .k { color: #F5C469; }
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { position: relative; padding: 0 0 12px 30px; }
.ticks li::before {
  content: ""; position: absolute; left: 4px; top: 7px;
  width: 12px; height: 7px;
  border-left: 2.5px solid var(--leaf); border-bottom: 2.5px solid var(--leaf);
  transform: rotate(-45deg);
}

.minis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.mini { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); font-size: 13px; }
.mini-head { height: 34px; background: var(--petrol-600); }
.mini-body { padding: 12px 10px 14px; display: flex; flex-direction: column; gap: 7px; }
.mini-body i { display: block; height: 14px; width: 68%; border-radius: 8px 8px 8px 3px; background: #E6EDEC; }
.mini-body i.me { align-self: flex-end; width: 52%; background: var(--petrol-600); border-radius: 8px 8px 3px 8px; }
.mini figcaption { padding: 8px 10px 10px; border-top: 1px solid var(--line); font-weight: 600; }
.mini figure, figure.mini { margin: 0; }
.mini--soft { border-radius: 22px; }
.mini--soft .mini-head { background: linear-gradient(135deg, var(--petrol-600), #7FB3B9); }
.mini--soft .mini-body i { border-radius: 999px; }
.mini--minimal { border-radius: 4px; }
.mini--minimal .mini-head { background: #fff; border-bottom: 1px solid var(--line); }
.mini--minimal .mini-body i { background: #fff; border: 1px solid var(--line); border-radius: 3px; }
.mini--minimal .mini-body i.me { border-color: var(--petrol-600); }
.mini--midnight { background: #151C1F; color: #E8EFEE; box-shadow: none; }
.mini--midnight .mini-head { background: #0E1416; }
.mini--midnight .mini-body i { background: #2A363B; }
.mini--midnight .mini-body i.me { background: var(--petrol-600); }
.mini--midnight figcaption { border-color: #29353A; }
.mini--bold .mini-head { height: 52px; }
.mini--bold .mini-body { margin-top: -10px; background: #fff; border-radius: 10px 10px 0 0; }

.cta { background: var(--marigold); color: #2B1D00; padding: 64px 0; }
.cta .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.cta h2 { font-size: clamp(26px, 3.2vw, 38px); letter-spacing: -.03em; max-width: 16em; }
.cta .btn { background: var(--petrol-900); border-color: var(--petrol-900); }
.site-foot { background: var(--petrol-950); color: #9DB5B4; padding: 28px 0; font-size: 14px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-foot a { color: #D7E6E5; }

/* ---------- Sign-in, register, installer ---------- */

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: var(--petrol-900);
}
.auth-card {
  width: min(440px, 100%);
  background: var(--paper);
  border-radius: 16px;
  padding: 34px 34px 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.auth-card--wide { width: min(640px, 100%); }
.auth-card .brand { color: var(--petrol-900); margin-bottom: 26px; }
.auth-card h1 { font-size: 28px; margin-bottom: 8px; }
.auth-card .lead { color: var(--muted); margin-bottom: 22px; }
.auth-card .btn { width: 100%; padding: 11px 16px; }
.auth-foot { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.error-code { font: 700 64px/1 var(--display); color: var(--marigold); margin: 0 0 8px; letter-spacing: -.04em; }
.auth-card fieldset { border: 0; padding: 0; margin: 0 0 8px; }
.auth-card legend { font: 650 17px var(--display); padding: 0; margin: 14px 0 12px; }

/* ---------- Dashboard shell ---------- */

.panel { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--petrol-900);
  color: #C9DCDB;
  display: flex; flex-direction: column;
  padding: 20px 14px 16px;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.side .brand { color: #fff; padding: 2px 8px; }
.side-org { margin: 14px 8px 18px; font-size: 13px; color: #9DB5B4; overflow-wrap: anywhere; }
.side-org strong { display: block; color: #fff; font-size: 14.5px; font-weight: 600; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #C9DCDB; text-decoration: none; font-weight: 500;
}
.side nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side nav a[aria-current=page] { background: var(--petrol-600); color: #fff; }
.side nav svg { flex: none; opacity: .9; }
.side nav .count {
  margin-left: auto;
  min-width: 22px; padding: 0 6px;
  border-radius: 11px;
  background: var(--marigold); color: #2B1D00;
  font-size: 12px; font-weight: 700; line-height: 22px; text-align: center;
}
.side-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 13px; }
.side-foot strong { display: block; color: #fff; font-size: 14px; }
.side-foot .btn { margin-top: 10px; width: 100%; color: #fff; border-color: rgba(255, 255, 255, .25); }
.side-foot .btn:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 28px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.top h1 { font-size: 24px; flex: 1; min-width: 0; }
.nav-toggle { display: none; }
.content { padding: 24px 28px 48px; flex: 1; }
.content--flush { padding: 0; display: flex; flex-direction: column; min-height: 0; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 20px;
}
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 18px; }
.card-body { padding: 20px; }
.card-body > :last-child { margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.stack > * + * { margin-top: 20px; }

/* One ruled strip of numbers rather than a row of separate cards. */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
}
.stat { padding: 18px 20px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font: 700 32px/1 var(--display); letter-spacing: -.03em; }
.stat span { display: block; margin-top: 6px; color: var(--muted); font-size: 13.5px; }
.stat--wait b { color: #B26F00; }
.stat--live b { color: var(--leaf); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th {
  text-align: left; font-weight: 600; font-size: 13px; color: var(--muted);
  padding: 10px 20px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px 20px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #F7FAF9; }
.table .sub { display: block; color: var(--muted); font-size: 13px; }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.actions form, .table td.actions .btn { margin-left: 4px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty h3 { font-size: 18px; color: var(--ink); margin-bottom: 6px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.filters .field { margin: 0; min-width: 150px; flex: 1; }
.filters .field--grow { flex: 2; min-width: 220px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

.chart { display: block; width: 100%; height: auto; }
.chart .bar { fill: var(--petrol-600); }
.chart .bar--bot { fill: #9FC5C9; }
.chart text { font: 11px var(--text); fill: var(--muted); }
.chart .axis { stroke: var(--line); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; background: var(--petrol-600); }
.legend i.bot { background: #9FC5C9; }

.keybox {
  display: flex; align-items: stretch; gap: 8px;
  margin: 8px 0 0;
}
.keybox pre {
  flex: 1; min-width: 0; margin: 0;
  padding: 10px 12px;
  background: var(--petrol-950); color: #D7E6E5;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px; line-height: 1.5;
  white-space: pre;
}
.onetime { font: 600 18px var(--mono); letter-spacing: .02em; }

/* Template picker */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tpl-opt { position: relative; cursor: pointer; }
.tpl-opt input { position: absolute; opacity: 0; }
.tpl-opt .mini { box-shadow: 0 0 0 1px var(--line); }
.tpl-opt .mini--midnight { box-shadow: 0 0 0 1px #151C1F; }
.tpl-opt input:checked + .mini { box-shadow: 0 0 0 3px var(--petrol-600); }
.tpl-opt input:focus-visible + .mini { outline: 2px solid var(--petrol-600); outline-offset: 5px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.swatch[aria-pressed=true] { box-shadow: 0 0 0 2px var(--ink); }
.swatches input[type=color] { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.preview-frame { width: 100%; height: 640px; border: 0; border-radius: 12px; background: repeating-linear-gradient(45deg, #E4ECEB 0 12px, #EBF1F0 12px 24px); }
.sticky { position: sticky; top: 20px; }

/* Transcript */
.transcript { display: flex; flex-direction: column; gap: 10px; padding: 20px; }
.msg { max-width: 76%; }
.msg-meta { font-size: 12px; color: var(--muted); margin: 0 4px 3px; }
.msg-body { padding: 9px 13px; border-radius: 14px 14px 14px 4px; background: var(--mist); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg--guest { align-self: flex-start; }
.msg--bot .msg-body { background: #E3EDF5; }
.msg--staff { align-self: flex-end; }
.msg--staff .msg-meta { text-align: right; color: var(--petrol-600); font-weight: 600; }
.msg--staff .msg-body { background: var(--petrol-600); color: #fff; border-radius: 14px 14px 4px 14px; }
.msg--system { align-self: stretch; max-width: none; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.msg--system::before, .msg--system::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 14.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Live console ---------- */

.console { flex: 1; display: grid; grid-template-columns: 310px minmax(0, 1fr) 300px; grid-template-rows: minmax(0, 1fr); min-height: 0; background: var(--paper); }
.panel--fixed .main { height: 100vh; height: 100dvh; }
.panel--fixed .content--flush { flex: 1; min-height: 0; }
.console-col { min-height: 0; min-width: 0; overflow: hidden; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.console-col:last-child { border-right: 0; }
.console-list { overflow-y: auto; flex: 1; }
.console-sec { padding: 14px 16px 6px; font: 650 14px var(--display); display: flex; justify-content: space-between; align-items: center; }
.console-sec .chip { font-family: var(--text); }
.q-item {
  display: block; width: 100%; text-align: left;
  padding: 11px 16px;
  border: 0; border-bottom: 1px solid var(--line); border-left: 3px solid transparent;
  background: none; cursor: pointer;
}
.q-item:hover { background: #F7FAF9; }
.q-item[aria-current=true] { background: var(--petrol-100); border-left-color: var(--petrol-600); }
.q-item--wait { border-left-color: var(--marigold); }
.q-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.q-top strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-top time, .q-top .q-wait { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.q-top .q-wait { color: #B26F00; font-weight: 600; }
.q-last { display: block; margin-top: 2px; color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-unread { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--coral); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.q-empty { padding: 6px 16px 16px; color: var(--muted); font-size: 13.5px; }
.console-note { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

.conv-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); min-height: 62px; }
.conv-head h2 { font-size: 18px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-back { display: none; }
.conv-msgs { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 18px; background: #FAFCFB; }
.conv-msgs .msg--guest .msg-body { background: #fff; box-shadow: 0 0 0 1px var(--line); }
.conv-foot { border-top: 1px solid var(--line); padding: 12px 16px; }
.conv-foot form { display: flex; gap: 10px; align-items: flex-end; }
.conv-foot textarea { flex: 1; min-height: 44px; max-height: 140px; padding: 10px 12px; border: 1px solid #BFCDCC; border-radius: 10px; resize: none; }
.conv-foot textarea:focus { border-color: var(--petrol-600); outline: 2px solid var(--petrol-600); outline-offset: 0; }
.conv-banner { padding: 10px 18px; background: var(--marigold-100); color: var(--marigold-ink); display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.conv-banner--idle { background: var(--coral-100); color: #8A241B; }
.conv-blank { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 30px; }
.conv-blank h2 { color: var(--ink); font-size: 22px; margin-bottom: 8px; }
.conv-blank p { max-width: 30em; }
.info-pane { overflow-y: auto; padding: 18px; }
.info-pane h3 { font-size: 15px; margin: 18px 0 8px; }
.info-pane h3:first-child { margin-top: 0; }
.prev-list { list-style: none; margin: 0; padding: 0; }
.prev-list li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.prev-list li:last-child { border-bottom: 0; }
.prev-list small { display: block; color: var(--muted); }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .console { grid-template-columns: 280px minmax(0, 1fr); }
  .console-col--info { display: none; }
  .grid-side { grid-template-columns: 1fr; }
  .sticky { position: static; }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-copy { padding-bottom: 0; }
  .flow { grid-template-columns: 1fr 1fr; }
  .flow li:nth-child(2)::after { display: none; }
  .role { grid-template-columns: 1fr; gap: 10px; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .minis { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }

  .panel { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  .panel.nav-open .side { transform: none; box-shadow: 0 0 0 100vw rgba(10, 37, 41, .5); }
  .nav-toggle { display: inline-flex; }
  .top { padding: 14px 16px; }
  .top h1 { font-size: 20px; }
  .content { padding: 16px 16px 40px; }
}
@media (max-width: 700px) {
  .section { padding: 56px 0; }
  .flow { grid-template-columns: 1fr; }
  .flow li::after { display: none; }
  .minis { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
  .auth-card { padding: 26px 22px; }
  .site-nav .btn--ghost { display: none; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }

  .console { grid-template-columns: 1fr; }
  .console-col--conv { display: none; }
  .console.has-open .console-col--list { display: none; }
  .console.has-open .console-col--conv { display: flex; }
  .conv-back { display: inline-flex; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-body > * { animation: none; opacity: 1; }
  .side { transition: none; }
}

/* ---------- Late additions ---------- */
.grid-2, .grid-side { margin-bottom: 20px; }
.conv { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.info-pane .facts { grid-template-columns: 1fr; gap: 0; }
.info-pane .facts dt { font-size: 12.5px; margin-top: 8px; }
.filters .check { margin: 0 0 9px; white-space: nowrap; }
.content.content--flush { padding: 0; }
.checklist { margin: 0; padding-left: 20px; font-size: 14px; }
.checklist li { margin-bottom: 8px; }
.checklist li:last-child { margin-bottom: 0; }
.card.sticky .card-head + .card-body + .card-head { border-top: 1px solid var(--line); }

/* ---------- AI answers: tabs and funnels ---------- */
.tabs { display: flex; gap: 4px; margin: 0 0 20px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 16px; border-radius: 8px 8px 0 0; color: var(--muted); font-weight: 600; text-decoration: none; border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; }
.tabs a:hover { color: var(--petrol-900); }
.tabs a[aria-current=page] { background: var(--paper); color: var(--petrol-900); border-color: var(--line); }
.funnel-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.funnel-step { flex: none; padding: 3px 10px; border-radius: 4px; background: var(--petrol-900); color: #fff; font: 650 12.5px/1.5 var(--display); white-space: nowrap; }
.funnel-note { color: var(--muted); font-size: 14px; margin: 0; }
.funnel-note + .funnel-note { margin-top: 4px; }
.funnel-note b { color: var(--ink); font-weight: 600; }
.q-cat { display: inline-block; margin-top: 3px; padding: 0 7px; border-radius: 4px; background: var(--petrol-100); color: var(--petrol-900); font-size: 12px; font-weight: 600; }
.flow-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.flow-preview li { padding: 5px 12px; border-radius: 999px; background: var(--mist); }
.flow-preview li + li::before { content: ""; }
.flow-preview .then { background: none; padding: 0; color: var(--muted); }
.table--tight th, .table--tight td { padding-left: 10px; padding-right: 10px; }
.table--tight th:first-child, .table--tight td:first-child { padding-left: 20px; }
.table--tight th:last-child, .table--tight td:last-child { padding-right: 20px; }
.table--tight td.actions .btn { padding: 5px 8px; }
.table--tight td.actions { white-space: normal; width: 150px; }
.table--tight td.actions .btn, .table--tight td.actions form { margin: 0 0 4px 4px; }
.form-foot { margin: 14px 0 0; }

/* ---------- Inquiries and AI calling (1.4.0) ---------- */
.tabs { flex-wrap: wrap; }
.tabs--inset { margin: 0; padding: 0 16px; }
.check .sub { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.check b { font-weight: 600; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0 12px; }
.check-grid .check { margin-bottom: 6px; }
fieldset.field { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.field-inline { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.field-inline .field { flex: 1; margin: 0; min-width: 0; }
.row-form { border-bottom: 1px solid var(--line); }
.filters--plain { padding: 0; border: 0; }
.input--sm { width: auto; min-width: 0; padding: 6px 8px; font-size: 14px; }
select.input--sm { max-width: 130px; }
input.input--sm[type=tel] { max-width: 150px; }
.facts--boxes { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 18px; }
.facts--boxes > div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.facts--boxes dt { font-size: 12.5px; }
.facts--boxes dd { font-weight: 600; }
.card-body h3.label { margin-top: 18px; }
.card-body h3.label:first-child { margin-top: 0; }
audio { width: 100%; max-width: 520px; }
.timeline { list-style: none; margin: 0; padding: 0 20px 20px; }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.timeline li.is-note { background: var(--marigold-100); margin: 0 -20px; padding: 9px 20px; }
.timeline .sub { display: block; color: var(--muted); font-size: 12.5px; }
.board { display: grid; grid-template-columns: repeat(6, minmax(185px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.board-col { background: rgba(255, 255, 255, .6); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 185px; min-height: 120px; }
.board-col h2 { margin: 0; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.board-card { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.board-card form { margin-top: 2px; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bars-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 40px; gap: 10px; align-items: center; font-size: 14.5px; }
.bars-row b { text-align: right; }
.bars meter { width: 100%; height: 12px; }
.bars meter::-webkit-meter-bar { background: var(--mist); border: 0; border-radius: 6px; }
.bars meter::-webkit-meter-optimum-value { background: var(--petrol-600); border-radius: 6px; }
.bars meter::-moz-meter-bar { background: var(--petrol-600); border-radius: 6px; }
@media (max-width: 700px) {
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .field-inline { flex-wrap: wrap; }
}
