:root {
  color-scheme: light;
  --bg: #a8d6b8;
  --panel: #ffffff;
  --ink: #19221e;
  --muted: #78847f;
  --line: #dce8e1;
  --accent: #4cab83;
  --accent-dark: #246a55;
  --accent-soft: #e7f5ed;
  --green-dark: #246a55;
  --coral: #f47c59;
  --danger: #b42318;
  --gold: #e2aa45;
  --focus: #2f8068;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.fast-body {
  background: #edf5f1;
}

.api-doc-body {
  background: #edf5f1;
}

.api-doc-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.api-doc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.api-doc-header h1,
.api-doc-header p {
  margin: 0;
}

.api-doc-header h1 {
  margin-top: 4px;
  font-size: 2.2rem;
}

.api-doc-header p:not(.eyebrow) {
  margin-top: 8px;
  color: var(--muted);
}

.api-doc-card {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.api-doc-card h2,
.api-doc-card p {
  margin: 0;
}

.api-doc-card p {
  color: var(--muted);
}

.api-doc-card pre {
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  padding: 14px;
  border-radius: 8px;
  background: #1f2b26;
  color: #f6fbf8;
  font-size: 0.86rem;
  line-height: 1.5;
}

.api-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.api-field-grid > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fcfa;
}

.api-field-grid span {
  color: var(--muted);
  font-size: 0.9rem;
}

.fast-shell {
  width: min(560px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 50px rgb(35 83 68 / 10%);
}

.fast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}

.fast-header > div {
  display: grid;
  gap: 3px;
}

.fast-brand {
  display: flex !important;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.fast-brand > :not(.fast-logo) {
  display: none;
}

.fast-logo {
  height: 42px;
  max-width: 150px;
}

.fast-header .eyebrow {
  margin: 0;
}

.fast-trial {
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 750;
}

.fast-loading,
.fast-error {
  display: grid;
  min-height: calc(100vh - 76px);
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 36px;
  text-align: center;
}

.fast-entry {
  min-height: calc(100vh - 76px);
  padding: 72px 42px 48px;
}

.fast-entry-icon {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  margin-bottom: 26px;
  border-radius: 50%;
  background: #20352e;
  color: #fff;
}

.fast-entry-icon svg {
  width: 30px;
  height: 30px;
}

.fast-entry > .eyebrow {
  margin: 0 0 10px;
}

.fast-entry h1 {
  max-width: 430px;
  margin: 0;
  font-size: clamp(2.1rem, 8vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.fast-entry > p:not(.eyebrow) {
  margin: 16px 0 30px;
  color: var(--muted);
  font-size: 1.05rem;
}

.fast-entry-form {
  display: grid;
  gap: 16px;
}

.fast-entry-form label {
  display: grid;
  gap: 7px;
  font-weight: 750;
}

.fast-entry-form label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.fast-entry-form input {
  min-height: 54px;
}

.places-autocomplete-field {
  position: relative;
}

.places-autocomplete-field small {
  min-height: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.places-autocomplete-field small.error {
  color: #b42318;
}

.places-suggestions {
  position: relative;
  z-index: 20;
  display: grid;
  overflow: hidden;
  margin-top: -3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 18px 38px rgb(34 83 67 / 15%);
}

.places-suggestion {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  justify-content: stretch;
  gap: 12px;
  width: 100%;
  min-height: 0;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.places-suggestion:last-child {
  border-bottom: 0;
}

.places-suggestion:hover,
.places-suggestion:focus {
  background: #f1f7f4;
  box-shadow: none;
}

.places-suggestion-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #cfe5d9;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.places-suggestion-icon svg {
  width: 18px;
  height: 18px;
}

.places-suggestion-copy {
  display: grid;
  min-width: 0;
  justify-items: start;
  text-align: left;
}

.places-suggestion-copy strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-size: 0.95rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.places-suggestion-copy > span {
  display: block;
  max-width: 100%;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fast-entry-form button {
  min-height: 54px;
  margin-top: 4px;
}

.fast-loading h1,
.fast-loading p,
.fast-error h1,
.fast-error p {
  margin: 0;
}

.fast-loading p,
.fast-error p {
  color: var(--muted);
}

.fast-loader {
  width: 58px;
  height: 58px;
  border: 5px solid var(--accent-soft);
  border-top-color: var(--coral);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: fast-spin 0.9s linear infinite;
}

@keyframes fast-spin {
  to { transform: rotate(360deg); }
}

.fast-agent-stage {
  display: grid;
  justify-items: center;
  min-height: 430px;
  padding: 40px 24px 34px;
  background: #f7faf8;
  text-align: center;
}

.fast-orb {
  position: relative;
  display: grid;
  width: 170px;
  height: 170px;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 22px 50px rgb(36 106 85 / 16%);
}

.fast-orb canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.fast-orb svg {
  width: 42px;
  height: 42px;
  color: var(--accent-dark);
}

.fast-orb.live {
  box-shadow: 0 22px 60px rgb(244 124 89 / 20%);
}

.fast-status {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  text-transform: uppercase;
}

.fast-status.live {
  color: var(--accent-dark);
}

.fast-agent-stage h1 {
  max-width: 430px;
  margin: 0;
  font-size: clamp(1.7rem, 7vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.fast-agent-stage > p:not(.fast-status) {
  max-width: 440px;
  margin: 12px 0 24px;
  color: var(--muted);
  line-height: 1.5;
}

.fast-call-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fast-call-actions #talkButton {
  min-width: 210px;
}

.fast-call-actions #stopButton {
  width: 48px;
  min-width: 48px;
  padding: 0;
}

.fast-section {
  padding: 24px 22px;
  border-top: 1px solid var(--line);
}

.fast-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.fast-section-heading > div:first-child p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.fast-section h2 {
  margin: 0;
  font-size: 1.15rem;
}

.fast-section-heading span {
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 750;
}

.fast-profile-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.fast-profile-actions button {
  min-height: 40px;
  padding: 8px 12px;
}

.fast-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.fast-profile-grid > label {
  position: relative;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f9fbfa;
  cursor: text;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.fast-profile-grid > label:hover {
  border-color: rgba(76, 171, 131, 0.55);
  background: #fff;
  box-shadow: 0 10px 22px rgba(27, 66, 51, 0.08);
}

.fast-profile-grid > label:focus-within {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(76, 171, 131, 0.14);
}

.fast-profile-grid > label:has(select) {
  cursor: pointer;
}

.fast-profile-grid > label.compact {
  padding-block: 12px;
}

.fast-profile-grid .wide {
  grid-column: 1 / -1;
}

.fast-profile-grid span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.fast-profile-grid span svg {
  width: 15px;
  height: 15px;
  color: var(--accent-dark);
  opacity: 0.48;
  transition: opacity 160ms ease, transform 160ms ease;
}

.fast-profile-grid > label:hover span svg,
.fast-profile-grid > label:focus-within span svg {
  opacity: 1;
  transform: translateY(-1px);
}

.fast-profile-grid input,
.fast-profile-grid textarea,
.fast-profile-grid select {
  width: 100%;
  margin: 6px 0 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.fast-profile-grid select {
  min-height: 34px;
  cursor: pointer;
}

.fast-profile-grid textarea {
  resize: vertical;
  min-height: 56px;
}

.fast-profile-grid input::placeholder,
.fast-profile-grid textarea::placeholder {
  color: #9aa7a1;
}

.fast-profile-form .form-message {
  margin-top: 10px;
}

.fast-phone-number {
  display: block;
  margin-bottom: 14px;
  color: var(--accent-dark);
  font-size: 1.65rem;
  font-weight: 800;
  text-decoration: none;
}

.fast-inline-form {
  display: flex;
  gap: 8px;
}

.fast-inline-form input {
  min-width: 0;
  flex: 1;
}

.fast-inline-form button:not(.primary) {
  width: 48px;
  min-width: 48px;
  padding: 0;
}

.fast-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.fast-chips span {
  padding: 6px 8px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.8rem;
}

.fast-claim {
  background: #20352e;
  color: #fff;
}

.fast-claim > div p {
  margin: 7px 0 18px;
  color: #bed0c9;
}

.fast-claim .button-link {
  border-color: transparent;
  background: #fff;
  color: #20352e;
  font-weight: 800;
}

.fast-claim .form-message {
  color: #d9e8e2;
}

.fast-claim .form-message a {
  color: #fff;
}

.fast-paid-start {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.fast-paid-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #bed0c9;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.fast-paid-divider::before,
.fast-paid-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(255, 255, 255, 0.18);
}

.fast-period-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.fast-period-toggle button {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: #d9e8e2;
  box-shadow: none;
  font-size: 0.9rem;
  font-weight: 850;
}

.fast-period-toggle button.active {
  background: #fff;
  color: #20352e;
}

.fast-period-toggle span {
  display: inline-block;
  margin-left: 4px;
  color: #72c79d;
  font-size: 0.72rem;
  font-weight: 900;
}

.fast-period-toggle button.active span {
  color: var(--accent-dark);
}

.fast-plan-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.fast-plan-option {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-align: left;
  box-shadow: none;
}

.fast-plan-option:hover,
.fast-plan-option.active {
  border-color: #72c79d;
  background: rgba(114, 199, 157, 0.16);
}

.fast-plan-option.waitlisted {
  cursor: not-allowed;
  opacity: 0.72;
}

.fast-plan-option.waitlisted:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.fast-plan-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.fast-plan-top strong {
  font-size: 0.95rem;
}

.fast-plan-top b {
  color: #d8f4e7;
  font-size: 0.9rem;
  white-space: nowrap;
}

.fast-plan-slot {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(216, 244, 231, 0.13);
  color: #d8f4e7;
  font-size: 0.72rem;
  font-weight: 900;
}

.fast-plan-option.waitlisted .fast-plan-slot {
  background: rgba(244, 124, 89, 0.14);
  color: #ffd9cf;
}

.fast-plan-option small {
  color: #bed0c9;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.fast-paid-button {
  justify-self: end;
  border-color: transparent;
  background: #fff;
  color: #20352e;
  font-weight: 850;
}

.fast-transcript-wrap {
  border-top: 1px solid var(--line);
}

.fast-transcript-wrap summary {
  padding: 18px 22px;
  cursor: pointer;
  font-weight: 750;
}

.fast-transcript-wrap .transcript {
  max-height: 360px;
  border-top: 1px solid var(--line);
}

.password-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.password-panel {
  width: min(440px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 60px rgb(35 83 68 / 12%);
}

.password-panel h1 {
  margin: 12px 0 8px;
}

.password-panel > p {
  color: var(--muted);
}

.password-panel form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.password-panel label {
  display: grid;
  gap: 7px;
}

.business-info-grid .wide-field {
  grid-column: 1 / -1;
}

.business-info-grid textarea {
  resize: vertical;
}

@media (max-width: 560px) {
  .fast-shell { width: 100%; }
  .fast-header { padding: 14px 16px; }
  .fast-logo { height: 34px; max-width: 118px; }
  .fast-trial { max-width: 150px; text-align: right; }
  .fast-agent-stage { min-height: 410px; padding-inline: 18px; }
  .fast-entry { padding: 52px 20px 36px; }
  .fast-orb { width: 150px; height: 150px; }
  .fast-section { padding-inline: 16px; }
  .fast-section-heading { align-items: flex-start; flex-direction: column; }
  .fast-profile-actions { width: 100%; justify-content: space-between; }
  .fast-profile-actions button { flex: 0 0 auto; }
  .fast-profile-grid { grid-template-columns: 1fr; }
  .fast-profile-grid .wide { grid-column: auto; }
  .fast-inline-form { flex-wrap: wrap; }
  .fast-claim .button-link { width: 100%; }
  .fast-claim .fast-inline-form button { width: 100%; }
  .fast-paid-button { width: 100%; justify-self: stretch; }
}

[hidden] {
  display: none !important;
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: #edf5f1;
}

.auth-card {
  display: grid;
  width: min(420px, 100%);
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgb(30 79 64 / 12%);
}

.brand-logo {
  display: block;
  width: auto;
  object-fit: contain;
}

.auth-logo {
  height: 54px;
  max-width: 210px;
  margin-bottom: 2px;
}

.brand-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 16px;
}

.brand-heading > div {
  min-width: 0;
}

.topbar-logo {
  height: 64px;
  max-width: 235px;
  border-radius: 4px;
  filter: drop-shadow(0 8px 18px rgb(0 0 0 / 14%));
}

.admin-logo {
  height: 58px;
  max-width: 215px;
  border-radius: 4px;
}

.admin-brand-stack {
  display: grid;
  gap: 6px;
}

.admin-brand-stack p {
  margin: 0;
  padding-left: 8px;
  color: #d9f3e7;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.public-logo {
  height: 46px;
  max-width: 170px;
  margin-bottom: 10px;
}

.auth-card h1,
.auth-card p {
  margin: 0;
}

.auth-card label {
  display: grid;
  gap: 7px;
}

.form-error {
  min-height: 1.2em;
  color: var(--danger);
  font-size: 0.85rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  width: 44px;
  min-width: 44px;
  padding: 0;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto;
  padding: 0 0 20px;
  border-radius: 8px;
  background: #f7faf8;
  overflow: hidden;
  box-shadow: 0 22px 60px rgb(24 77 59 / 16%);
}

.admin-topbar,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-topbar {
  margin-bottom: 0;
  padding: 24px 30px 18px;
  background: #246a55;
  color: #fff;
}

.admin-topbar h1,
.section-heading h2,
.section-heading p {
  margin: 0;
}

.admin-page-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 0;
  padding: 0 30px;
  border-bottom: 1px solid rgb(255 255 255 / 18%);
  background: #246a55;
}

.admin-page-tabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #d9f3e7;
}

.admin-page-tabs button.active {
  border-bottom-color: #f47c59;
  color: #fff;
}

.admin-page-tabs button:hover,
.admin-page-tabs button:focus {
  background: rgb(255 255 255 / 8%);
  color: #fff;
}

.system-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -6px 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.system-subtabs button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 0.86rem;
}

.system-subtabs button svg {
  width: 16px;
  height: 16px;
}

.system-subtabs button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.system-panel {
  display: none;
}

.system-panel.active {
  display: block;
}

.system-panel-heading {
  margin-bottom: 16px;
}

.system-panel-heading h3,
.system-panel-heading p {
  margin: 0;
}

.system-panel-heading p {
  margin-top: 5px;
  color: var(--muted);
}

.system-panel > label.wide-field {
  display: grid;
  gap: 8px;
  font-weight: 750;
}

.system-panel textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
}

.model-settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.model-settings-grid label {
  display: grid;
  gap: 8px;
}

.custom-model-input[hidden] {
  display: none;
}

.model-settings-grid small {
  min-height: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.model-diagnostics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.model-diagnostics button {
  min-height: 38px;
}

.model-diagnostics span {
  color: var(--muted);
  font-size: 0.86rem;
}

.model-rate-limit-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.model-rate-limit-row {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fcfa;
}

.model-rate-limit-row strong {
  color: var(--ink);
}

.model-rate-limit-row small {
  color: var(--danger);
  overflow-wrap: anywhere;
}

.system-save-row {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.plan-manager-panel {
  padding-top: 2px;
}

.messaging-settings {
  display: grid;
  gap: 14px;
}

.messaging-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.messaging-card-heading h4,
.messaging-card-heading p {
  margin: 0;
}

.messaging-card-heading h4 {
  color: var(--ink);
  font-size: 1rem;
}

.messaging-card-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.messaging-card-grid {
  margin: 0;
}

.ad-platform-settings {
  display: grid;
  gap: 14px;
}

.ad-platform-card {
  background: #fbfdfc;
}

.postback-event-options {
  display: flex;
  min-height: 42px;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 10px 0;
}

.postback-event-options strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.postback-event-options .check-label {
  min-height: 0;
}

.postback-param-field textarea {
  min-height: 96px;
}

.ad-event-rows {
  display: grid;
  gap: 8px;
}

.ad-event-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) repeat(4, minmax(170px, 1fr));
  gap: 12px;
  align-items: stretch;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fcfa;
}

.ad-event-header {
  padding-block: 8px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ad-event-name,
.ad-platform-event-cell {
  display: grid;
  gap: 8px;
  align-content: start;
}

.ad-event-name strong {
  color: var(--ink);
}

.ad-event-name small {
  color: var(--muted);
  line-height: 1.35;
}

.ad-platform-event-cell label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.ad-event-parameters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  gap: 8px;
}

.ad-event-parameters label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.ad-platform-event-cell input[type="text"],
.ad-platform-event-cell input:not([type]),
.ad-event-parameters input {
  min-height: 38px;
}

.ad-event-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ad-event-toggles .check-label,
.ad-event-name .check-label {
  padding: 0;
  border: 0;
  background: transparent;
}

.system-webhook-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #dce8e1;
  border-radius: 8px;
  background: #f8fcfa;
}

.system-webhook-card h4,
.system-webhook-card p {
  margin: 0;
}

.system-webhook-card h4 {
  color: var(--ink);
  font-size: 0.95rem;
}

.system-webhook-card p,
.system-webhook-card small {
  color: var(--muted);
}

.system-webhook-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.system-webhook-controls input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
}

#planList.data-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.plan-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.plan-card.inactive {
  background: #fbfcfb;
}

.plan-card-body {
  min-width: 0;
}

.plan-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.plan-card-heading > div {
  display: grid;
  gap: 2px;
}

.plan-card-heading strong {
  color: var(--ink);
  font-size: 1.04rem;
}

.plan-card-heading span:not(.status-pill) {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.plan-price {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 850;
  line-height: 1.1;
}

.plan-description {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.plan-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.plan-metric {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid #dce8e1;
  border-radius: 8px;
  background: #f8fcfa;
}

.plan-metric span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.plan-metric strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.plan-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.plan-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 150px;
}

.plan-actions button {
  width: 100%;
  justify-content: flex-start;
}

.plan-actions button svg {
  width: 16px;
  height: 16px;
}

.admin-page-view {
  display: none;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-page-view.active {
  display: block;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading p {
  margin-top: 5px;
  color: var(--muted);
}

.settings-form h3 {
  margin: 24px 0 12px;
}

.secret-grid small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 500;
}

.secret-grid small.configured {
  color: var(--green-dark);
}

.secret-grid small.missing {
  color: var(--danger);
}

.account-create-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.account-create-form label {
  display: grid;
  gap: 6px;
}

.account-create-form label > span,
.account-create-form small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.account-subtabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fcfa;
}

.account-subtabs button {
  justify-content: center;
  min-height: 44px;
  background: #fff;
}

.account-subtabs button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.account-panel {
  display: none;
}

.account-panel.active {
  display: block;
}

.compact-heading {
  margin-bottom: 12px;
}

.form-message {
  min-height: 1.3em;
  margin: 12px 0;
  color: var(--muted);
}

.form-message.error {
  color: var(--danger);
}

.form-message.success {
  color: var(--green-dark);
  font-weight: 700;
}

.provider-diagnostic {
  display: grid;
  gap: 10px;
  align-content: start;
}

.provider-diagnostic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.provider-diagnostic > button {
  width: max-content;
}

.provider-diagnostic-actions > button {
  width: max-content;
}

.email-diagnostic {
  margin-top: 16px;
}

.email-diagnostic label {
  max-width: 520px;
}

.bluebubbles-diagnostic {
  padding-top: 4px;
}

.provider-diagnostic-output {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.provider-diagnostic-output p {
  margin: 0;
}

.inbound-replies-panel {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.inbound-replies-heading h4,
.inbound-replies-heading p {
  margin: 0;
}

.inbound-replies-heading h4 {
  color: var(--ink);
  font-size: 0.95rem;
}

.inbound-replies-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.inbound-replies-list {
  display: grid;
  gap: 8px;
}

.inbound-reply-row {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid #dce8e1;
  border-radius: 8px;
  background: #f8fcfa;
}

.inbound-reply-row strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.inbound-reply-row p {
  margin: 0;
  overflow-wrap: anywhere;
}

.inbound-reply-row small {
  color: var(--muted);
  font-weight: 650;
}

.sentdm-template-list {
  display: grid;
  gap: 7px;
}

.sentdm-template-row {
  display: grid;
  width: 100%;
  min-height: 48px;
  justify-items: start;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.sentdm-template-row strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.sentdm-template-row span {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.sentdm-template-row.muted-row {
  opacity: 0.68;
}

.number-search-form {
  display: grid;
  grid-template-columns: 90px 140px minmax(180px, 1fr) auto;
  gap: 10px;
  margin-bottom: 8px;
}

.number-results {
  margin: 10px 0 24px;
}

#ownedNumbers.number-results {
  display: grid;
  gap: 18px;
}

.number-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.number-group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #f8fbf9;
}

.number-group-header h4 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 1rem;
}

.number-group-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.number-group-count {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid #cfe8db;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.number-group-list {
  padding: 0 18px;
}

.number-group-list .number-row:last-child {
  border-bottom: 0;
}

.number-group-empty {
  margin: 0;
  padding: 16px 0;
  color: var(--muted);
  font-weight: 700;
}

.number-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 420px) minmax(220px, auto);
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.number-config,
.number-assignment {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.number-config select {
  width: 130px;
}

.number-config input {
  min-width: 120px;
  flex: 1;
}

.number-assignment select {
  min-width: 160px;
}

.onboarding-history-heading {
  margin-top: 34px;
}

.onboarding-call-detail {
  padding: 16px 0;
}

.onboarding-call-detail p {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.onboarding-call-detail span {
  overflow-wrap: anywhere;
}

.onboarding-call-detail pre {
  max-height: 320px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7faf8;
  white-space: pre-wrap;
}

.number-row.search-result {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.number-row strong,
.number-row span {
  display: block;
}

.number-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.account-list {
  margin-top: 10px;
}

.business-list {
  margin: 10px 0 24px;
}

.profile-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(0, auto);
  gap: 10px;
  align-items: end;
  margin: 14px 0 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fcfa;
}

.profile-search {
  margin: 0;
}

.profile-search input {
  width: 100%;
}

.profile-range-buttons,
.profile-custom-range {
  align-items: center;
}

.business-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 14px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.business-row.archived {
  opacity: 0.78;
}

.business-row strong,
.business-row b,
.business-row span {
  display: block;
}

.business-row b {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.business-row span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.business-plan-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 8px;
}

.business-plan-control select,
.business-plan-control button {
  min-height: 36px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.business-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.traffic-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.traffic-range-buttons,
.traffic-custom-range {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.traffic-range-buttons button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.traffic-custom-range {
  justify-content: flex-end;
}

.traffic-custom-range input {
  width: 150px;
}

.traffic-summary,
.traffic-breakdowns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.traffic-breakdowns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.traffic-stat-card,
.traffic-breakdowns > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fcfa;
}

.traffic-stat-card span,
.traffic-stat-card strong {
  display: block;
}

.traffic-stat-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.traffic-stat-card strong {
  margin-top: 4px;
  font-size: 1.6rem;
}

.traffic-mini-list,
.traffic-event-list {
  display: grid;
  gap: 8px;
}

.traffic-mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.traffic-mini-row strong {
  color: var(--ink);
}

.traffic-event-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.traffic-event-row summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
}

.traffic-event-row summary span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.traffic-event-detail {
  display: grid;
  gap: 7px;
  padding: 0 12px 12px;
}

.traffic-event-detail p {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.traffic-event-detail span {
  overflow-wrap: anywhere;
}

.call-log {
  border-bottom: 1px solid var(--line);
}

.call-log summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 2px;
  cursor: pointer;
  font-weight: 800;
}

.call-log summary span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.call-log.has-error summary {
  color: var(--danger);
}

.diagnostic-panel {
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf8;
}

.diagnostic-panel h3,
.diagnostic-panel p {
  margin-top: 0;
}

.call-log-actions {
  display: flex !important;
  grid-template-columns: none !important;
  gap: 8px;
  padding: 0 0 12px !important;
  border-top: 0 !important;
}

.call-log-actions button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.call-log-events {
  padding: 0 2px 14px;
}

.call-log-events > div {
  display: grid;
  grid-template-columns: 100px minmax(160px, 0.5fr) minmax(0, 1fr);
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}

.call-log-events code {
  overflow-wrap: anywhere;
  white-space: normal;
}

.call-log-error {
  color: var(--danger);
  font-weight: 700;
}

.account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.account-row strong,
.account-row span {
  display: block;
}

.account-row > div span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.account-state {
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.account-state.disabled {
  color: var(--danger);
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.plan-disabled {
  background: #f3f7f5;
}

.plan-gate-note {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #d8e7df;
  border-radius: 8px;
  background: #f7fbf8;
  color: #2f6f5b;
  font-size: 0.92rem;
  line-height: 1.35;
}

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

button.primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 180px;
  resize: vertical;
}

input:focus,
select:focus,
button:focus {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 75%);
  outline-offset: 1px;
}

.shell {
  width: min(1380px, calc(100% - 40px));
  min-height: 100vh;
  margin: 20px auto;
  padding: 24px;
  border-radius: 8px;
  background: #f7faf8;
  box-shadow: 0 24px 70px rgb(24 77 59 / 20%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin: -24px -24px 20px;
  padding: 26px 28px;
  background: #246a55;
  color: #fff;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 980px;
  font-size: 3rem;
  line-height: 1.06;
  letter-spacing: 0;
}

.topbar .eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #bcebd4;
}

.header-copy {
  margin: 10px 0 0;
  color: #d7eee3;
  font-size: 0.98rem;
}

h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  letter-spacing: 0;
}

.status {
  min-width: 132px;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgb(255 255 255 / 12%);
  color: #fff;
  text-align: center;
  white-space: nowrap;
}

.status.live {
  border-color: color-mix(in srgb, var(--accent), white 55%);
  color: var(--accent-dark);
}

.status.error {
  border-color: color-mix(in srgb, var(--danger), white 55%);
  color: var(--danger);
}

.topbar .status.live {
  border-color: #a9e0c4;
  color: #d8f5e7;
}

.topbar .status.error {
  border-color: #ffc1b0;
  color: #ffd9cf;
}

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

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgb(36 106 85 / 8%);
}

.controls,
.profile {
  padding: 16px;
}

.controls {
  display: grid;
  gap: 12px;
}

.number-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fcfa;
}

.number-status strong,
.number-status span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.number-status strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.number-status span {
  color: var(--muted);
  font-size: 0.76rem;
}

.number-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #9aa59f;
  box-shadow: 0 0 0 4px rgb(154 165 159 / 12%);
}

.number-status.assigned {
  border-color: #b8dbc9;
  background: #f0fbf5;
}

.number-status.assigned .number-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgb(83 178 131 / 14%);
}

.number-status.missing {
  border-color: #f1cabd;
  background: #fff7f4;
}

.number-status.missing .number-dot {
  background: var(--coral);
  box-shadow: 0 0 0 4px rgb(232 126 94 / 14%);
}

.controls button {
  justify-content: flex-start;
  padding: 0 13px;
  font-weight: 700;
}

.controls .call-action {
  min-height: 54px;
  border-color: var(--coral);
  background: var(--coral);
  color: #fff;
  font-size: 1rem;
}

.controls .call-action:hover:not(:disabled) {
  background: #dc6848;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.settings {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 12px;
}

.settings summary {
  cursor: pointer;
  font-weight: 800;
}

.settings[open] {
  display: grid;
  gap: 12px;
}

.call {
  min-height: 640px;
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto;
  overflow: hidden;
}

.meter-wrap {
  display: flex;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 18px;
  background: var(--accent-soft);
}

.meter-wrap p {
  margin: 0;
  color: var(--muted);
}

.meter-wrap .diagnostics {
  margin-top: 8px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.voice-visualizer {
  position: relative;
  width: 78px;
  height: 78px;
  flex: 0 0 78px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px #d6eadf;
}

.voice-visualizer canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.voice-visualizer > svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  color: var(--accent-dark);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.voice-visualizer.live {
  box-shadow: inset 0 0 0 1px #b8ddc9, 0 5px 18px rgb(36 106 85 / 14%);
}

.transcript {
  min-height: 320px;
  max-height: 54vh;
  overflow: auto;
  padding: 18px;
  background: #fbfdfc;
}

.bubble {
  width: fit-content;
  max-width: min(76ch, 92%);
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  line-height: 1.45;
}

.bubble.agent {
  border-color: #bde2cf;
  background: #edf8f2;
}

.bubble.caller {
  margin-left: auto;
  background: #fff0eb;
  border-color: #f8c5b5;
}

.speaker {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.text-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 14px;
}

dl {
  margin: 0 0 20px;
}

dt {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  line-height: 1.45;
}

.admin-panel {
  margin-top: 16px;
  overflow: hidden;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 18px;
  background: #fbfdfc;
}

.admin-header .eyebrow {
  margin-bottom: 4px;
}

.admin-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.admin-status {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.admin-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
  overflow: visible;
  border-bottom: 1px solid var(--line);
  padding: 12px;
  background: #f4faf7;
}

.admin-tab {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.15;
  white-space: normal;
}

.admin-tab.active {
  border-color: #bcdcca;
  background: var(--accent-soft);
  color: var(--accent-dark);
  box-shadow: inset 0 -3px 0 var(--coral);
}

.admin-content {
  min-height: 360px;
  padding: 18px;
}

.admin-view {
  display: none;
}

.admin-view.active {
  display: block;
}

.admin-view.active + .admin-view.active {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.admin-view-heading {
  max-width: 820px;
  margin-bottom: 14px;
}

.admin-view-heading h3,
.admin-view-heading p {
  margin: 0;
}

.admin-view-heading h3 {
  font-size: 1rem;
}

.admin-view-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.admin-panel .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid > .wide-field {
  grid-column: 1 / -1;
}

.action-button {
  margin-top: 16px;
  padding: 0 18px;
}

.inline-editor {
  display: grid;
  gap: 10px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.intake-editor {
  grid-template-columns: 1.2fr 1fr 1fr 1.4fr auto auto;
}

.knowledge-editor {
  grid-template-columns: 1fr 1.6fr 0.7fr auto;
}

.price-editor {
  grid-template-columns: 1.1fr 1.3fr 1fr 0.8fr 0.8fr 0.6fr 0.8fr auto;
}

.review-link-editor {
  grid-template-columns: 1fr 1.7fr 0.45fr auto;
}

.transfer-target-editor {
  grid-template-columns: 1fr 0.9fr 1.5fr 0.45fr auto auto;
}

.booking-provider-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.booking-provider-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.vagaro-settings-panel {
  display: grid;
  gap: 14px;
}

.vagaro-settings-panel[hidden] {
  display: none;
}

.booking-provider-advanced {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.booking-provider-advanced summary {
  cursor: pointer;
  font-weight: 800;
}

.booking-provider-advanced .form-grid {
  margin-top: 12px;
}

.booking-provider-advanced small {
  display: block;
  margin-top: 8px;
}

.booking-provider-actions {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.booking-link-editor {
  grid-template-columns: 1fr 1.5fr auto;
}

.tracking-domain-editor {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
}

.info-popover {
  position: relative;
}

.info-popover summary {
  display: grid;
  width: 44px;
  min-height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  background: #fff;
  cursor: pointer;
  list-style: none;
}

.info-popover summary::-webkit-details-marker {
  display: none;
}

.info-popover summary svg {
  width: 20px;
  height: 20px;
}

.info-popover-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: min(360px, calc(100vw - 40px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(12, 27, 23, 0.14);
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.4;
}

.info-popover-panel p {
  margin: 8px 0 0;
  color: var(--muted);
}

.info-popover-panel dl {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.info-popover-panel dl > div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
}

.info-popover-panel dt {
  color: var(--muted);
  font-weight: 800;
}

.info-popover-panel dd {
  margin: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}

.info-popover-panel code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}

.booking-directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.booking-followup-section {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px 0 20px;
  border-bottom: 1px solid var(--line);
}

.booking-flow-header,
.booking-flow-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.booking-flow-header h4,
.booking-flow-header p {
  margin: 0;
}

.booking-flow-header p,
.booking-flow-actions small,
.booking-flow-node p {
  color: var(--muted);
}

.booking-flow-toggle {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid #cfe0d7;
  border-radius: 8px;
  background: #f8fcfa;
  color: var(--accent-dark);
  font-weight: 800;
  white-space: nowrap;
}

.booking-flow-toggle input {
  width: 18px;
  min-height: 18px;
}

.booking-followup-section.is-disabled .booking-flow-canvas {
  opacity: 0.6;
}

.booking-flow-canvas {
  display: grid;
  grid-template-columns:
    minmax(210px, 0.8fr)
    38px
    minmax(320px, 1.35fr)
    38px
    minmax(280px, 1.05fr)
    38px
    minmax(240px, 0.9fr);
  gap: 0;
  align-items: center;
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.booking-flow-node {
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 14px;
  border: 1px solid #cfe0d7;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 22px rgb(36 106 85 / 7%);
}

.booking-flow-trigger {
  border-color: #b7d9c8;
  background: #f1fbf5;
}

.booking-flow-final {
  border-color: #d8dec4;
  background: #fffdf6;
}

.booking-flow-stop {
  border-color: #d3dbd7;
  background: #fbfcfc;
}

.booking-node-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.booking-node-eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.booking-flow-node strong {
  font-size: 1.05rem;
}

.booking-flow-node p {
  margin: 0;
  line-height: 1.35;
}

.booking-flow-chip {
  width: fit-content;
  padding: 6px 10px;
  border: 1px solid #cfe0d7;
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

.booking-flow-line {
  position: relative;
  height: 2px;
  background: #9cb3a8;
}

.booking-flow-line::after {
  position: absolute;
  top: 50%;
  right: -1px;
  width: 8px;
  height: 8px;
  border-top: 2px solid #9cb3a8;
  border-right: 2px solid #9cb3a8;
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.booking-flow-branch {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.booking-flow-branch-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.booking-delay-control,
.booking-window-control,
.booking-message-editor {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.booking-delay-control {
  grid-template-columns: auto minmax(70px, 78px) auto;
  align-items: center;
  min-width: 0;
  white-space: nowrap;
}

.booking-window-control {
  grid-template-columns: auto 84px auto;
  align-items: center;
}

.booking-delay-control input,
.booking-window-control input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 7px 9px;
  font-size: 0.95rem;
}

.booking-message-editor textarea {
  width: 100%;
  min-height: 116px;
  resize: vertical;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.4;
}

.booking-flow-final textarea {
  min-height: 160px;
}

.booking-stop-list {
  display: grid;
  gap: 8px;
}

.booking-stop-list span {
  padding: 9px 10px;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: #f4faf7;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.35;
}

.booking-flow-actions {
  align-items: center;
}

.booking-flow-actions small {
  line-height: 1.4;
}

.review-flow-section {
  display: grid;
  gap: 16px;
}

.review-flow-section.is-disabled .review-flow-canvas {
  opacity: 0.6;
}

.review-flow-canvas {
  grid-template-columns:
    minmax(270px, 1fr)
    38px
    minmax(330px, 1.18fr)
    38px
    minmax(310px, 1.1fr)
    38px
    minmax(270px, 0.95fr);
}

.review-flow-branch {
  align-self: stretch;
}

.review-flow-happy {
  border-color: #b7d9c8;
  background: #f3fbf6;
}

.review-flow-complaint {
  border-color: #ead3bc;
  background: #fffaf4;
}

.review-flow-destinations {
  align-self: stretch;
}

.review-flow-management {
  align-self: stretch;
}

.review-flow-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.review-flow-field input {
  width: 100%;
  min-height: 42px;
}

.review-flow-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.review-flow-title-row strong {
  font-size: 0.95rem;
}

.review-flow-title-row .button-link {
  min-height: 34px;
  padding: 0.45rem 0.7rem;
  font-size: 0.8rem;
}

.review-flow-destinations .review-link-editor {
  margin-top: 0;
}

.review-flow-destinations .compact-list {
  max-height: 250px;
  overflow: auto;
}

.appointment-editor {
  grid-template-columns: 1fr 0.9fr 1fr 1fr 1fr 0.8fr auto auto auto;
}

.check-label {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.check-label input {
  width: 18px;
  min-height: 18px;
}

.import-row,
.calendar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.import-row input[type="file"] {
  max-width: 360px;
}

.import-row span {
  color: var(--muted);
  font-size: 0.82rem;
}

.data-list {
  margin-top: 12px;
}

.data-row {
  display: grid;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.crm-heading {
  align-items: flex-start;
}

.crm-heading .admin-view-heading {
  margin-bottom: 0;
}

.crm-section .booking-followup-section {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.crm-records-panel {
  display: none;
  gap: 14px;
  margin-top: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.crm-records-panel.active {
  display: grid;
}

.crm-date-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crm-date-presets,
.crm-custom-range {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.crm-date-preset {
  min-height: 40px;
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 800;
}

.crm-date-preset.active {
  border-color: #a9d6bd;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.crm-custom-range input {
  width: 160px;
}

.crm-section .crm-webhook-card {
  margin-bottom: 0;
}

.crm-section .qualification-settings {
  margin: 0;
}

.crm-settings-save {
  margin-top: 18px;
}

.crm-webhook-card {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid #dce8e1;
  border-radius: 8px;
  background: #f8fcfa;
}

.crm-webhook-card h4,
.crm-webhook-card p {
  margin: 0;
}

.crm-webhook-card p,
.crm-webhook-card small {
  color: var(--muted);
}

.crm-webhook-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
}

.crm-webhook-controls input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.crm-webhook-card textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84rem;
}

.message-inbox {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(0, 1fr);
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.message-inbox.empty {
  display: block;
  min-height: auto;
  padding: 18px;
  color: var(--muted);
}

.message-thread-list {
  overflow: auto;
  border-right: 1px solid var(--line);
  background: #f8fcfa;
}

.message-thread {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.message-thread:hover,
.message-thread.active {
  background: #eaf6ef;
}

.message-avatar {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
}

.message-thread-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.message-thread-main strong,
.message-thread-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-thread-main span,
.message-thread-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.message-conversation {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #fbfdfc;
}

.message-conversation-header {
  display: grid;
  gap: 2px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.message-conversation-header strong {
  font-size: 1rem;
}

.message-conversation-header span {
  color: var(--muted);
  font-size: 0.82rem;
}

.message-chain {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding: 18px;
}

.message-bubble {
  max-width: min(680px, 78%);
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.message-bubble.outbound {
  align-self: flex-end;
  border-color: #bfe7d1;
  background: #2f7b62;
  color: #fff;
}

.message-bubble.inbound {
  align-self: flex-start;
  background: #eef4f1;
}

.message-bubble p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-bubble span {
  display: block;
  margin-top: 6px;
  color: inherit;
  font-size: 0.72rem;
  opacity: 0.72;
}

.message-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.message-composer input {
  min-height: 44px;
  border-radius: 999px;
  background: #f7fbf9;
}

.message-composer button {
  min-width: 88px;
  border-radius: 999px;
}

.crm-webhook-controls span {
  align-self: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.crm-editor {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 18px;
}

.crm-board {
  display: grid;
  gap: 12px;
}

.crm-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.billing-plan-card {
  display: grid;
  gap: 5px;
  flex: 1 1 280px;
  min-width: min(100%, 280px);
  border: 1px solid #dce8e1;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.billing-plan-card.active {
  border-color: var(--accent-dark);
  background: var(--accent-soft);
}

.billing-plan-card.inactive {
  background: #f8fbf9;
  opacity: 0.72;
}

.billing-plan-card strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.billing-plan-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.status-pill {
  min-height: 32px;
  border: 1px solid #dce8e1;
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: capitalize;
}

.status-pill.active {
  border-color: var(--accent-dark);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.status-pill.warning {
  border-color: #f0c36a;
  background: #fff4d8;
  color: #8a5a00;
}

.crm-filter-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px;
  gap: 10px;
  margin: 0 0 14px;
}

.compact-list {
  gap: 6px;
}

.compact-row {
  display: block;
  min-height: 0;
  padding: 10px 12px;
}

.mini-row {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.crm-card {
  overflow: hidden;
  border: 1px solid #dce8e1;
  border-radius: 8px;
  background: #fff;
}

.crm-card summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.crm-card summary::-webkit-details-marker {
  display: none;
}

.crm-card summary strong,
.crm-card summary span {
  display: block;
  min-width: 0;
}

.crm-summary-main {
  display: grid;
  gap: 7px;
}

.crm-card summary strong {
  font-size: 1rem;
}

.crm-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.crm-card summary .crm-summary-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid #e0ece6;
  border-radius: 999px;
  background: #f8fcfa;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.crm-summary-meta-item svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.crm-status-badge {
  border-radius: 999px;
  padding: 6px 10px;
  background: #eef7f1;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-booking-stage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #d7e5de;
  border-radius: 999px;
  background: #f7fbf9;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.crm-booking-stage svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.crm-booking-stage.stage-sent {
  background: #eef7ff;
  border-color: #cfe3f7;
  color: #24618e;
}

.crm-booking-stage.stage-delivered {
  background: #eef7f1;
  border-color: #cce9da;
  color: #267052;
}

.crm-booking-stage.stage-clicked {
  background: #fff7e8;
  border-color: #f1ddb8;
  color: #8a5b16;
}

.crm-booking-stage.stage-booked {
  background: #e7f6ef;
  border-color: #bde4d2;
  color: #1f6a52;
}

.crm-booking-stage.stage-pending {
  background: #f4f3fb;
  border-color: #ddd9ef;
  color: #5d5680;
}

.crm-booking-stage.stage-failed {
  background: #f9eeee;
  border-color: #edcccc;
  color: #a33d32;
}

.crm-open-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #d7e5de;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.crm-open-hint svg {
  width: 15px;
  height: 15px;
  transition: transform 0.18s ease;
}

.crm-card[open] .crm-open-hint svg {
  transform: rotate(180deg);
}

.crm-card.status-unqualified .crm-status-badge,
.crm-card.status-unreachable .crm-status-badge {
  background: #f7eeee;
  color: #a33d32;
}

.crm-card.status-callback .crm-status-badge,
.crm-card.status-transferred .crm-status-badge,
.crm-card.status-needs_reply .crm-status-badge {
  background: #fff5e5;
  color: #9b5d13;
}

.crm-card.status-qualified .crm-status-badge,
.crm-card.status-appointment .crm-status-badge {
  background: #e7f6ef;
  color: #1f6a52;
}

.crm-body {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.crm-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.crm-field {
  min-width: 0;
  border-top: 1px solid #e5eee9;
  padding-top: 8px;
}

.crm-field span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-field strong,
.crm-field a {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.crm-summary {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.crm-lead-editor {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.crm-lead-editor .wide-field {
  grid-column: span 5;
}

.crm-lead-editor button {
  min-height: 48px;
  align-self: end;
}

.qualification-settings {
  display: grid;
  gap: 14px;
  margin: 14px 0;
}

.crm-subnav {
  display: grid;
  gap: 8px;
  margin: 16px 0 4px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.crm-area-subnav {
  display: grid;
  gap: 8px;
  margin: 12px 0 4px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.crm-menu-button,
.crm-area-button {
  min-width: 0;
  min-height: 42px;
  justify-content: center;
  border-color: #d6e6dd;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.15;
  white-space: normal;
}

.crm-area-button {
  gap: 8px;
}

.crm-area-button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.crm-area-button[hidden] {
  display: none;
}

.crm-menu-button.active,
.crm-area-button.active {
  border-color: #a9d6bd;
  background: var(--accent-soft);
  color: var(--accent-dark);
  box-shadow: inset 0 -3px 0 var(--coral);
}

.crm-section {
  display: none;
  gap: 14px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.crm-section.active {
  display: grid;
}

.crm-area-panel {
  display: none;
  gap: 14px;
}

.crm-area-panel.active {
  display: grid;
}

.crm-section-heading {
  max-width: 760px;
}

.crm-section-heading h4,
.crm-section-heading p {
  margin: 0;
}

.crm-section-heading h4 {
  font-size: 0.96rem;
}

.crm-section-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.follow-up-settings {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qualification-attempts {
  display: grid;
  gap: 8px;
  border-top: 1px solid #e5eee9;
  padding-top: 10px;
}

.qualification-attempt {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.crm-transcript {
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
}

.data-row.intake-row {
  grid-template-columns: 1.1fr 0.8fr 0.8fr 1.2fr auto auto auto;
}

.data-row.knowledge-row {
  grid-template-columns: 1fr 1.7fr 0.7fr auto auto;
}

.data-row.price-row {
  grid-template-columns: 1fr 1.2fr 0.8fr 0.7fr 0.7fr 0.55fr 0.7fr auto auto;
}

.data-row.review-link-row {
  grid-template-columns: 1fr minmax(0, 1.7fr) 0.45fr auto auto auto;
}

.data-row.transfer-target-row {
  grid-template-columns: 1fr 0.9fr minmax(0, 1.5fr) 0.45fr auto auto auto;
}

.data-row.booking-directory-row {
  display: block;
}

.data-row.booking-directory-row strong,
.data-row.booking-directory-row small,
.data-row.webhook-event-row strong,
.data-row.webhook-event-row small {
  display: block;
}

.data-row.booking-directory-row small,
.data-row.webhook-event-row small,
.external-calendar-note {
  color: var(--muted);
}

.booking-service-link-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.booking-service-link-tools input {
  min-width: 0;
}

.data-row.booking-link-row {
  grid-template-columns: minmax(170px, 0.8fr) minmax(0, 1.2fr) auto auto;
}

.booking-tracking-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}

.data-row.appointment-row {
  display: block;
  padding: 14px 0;
}

.appointment-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.appointment-status {
  padding: 4px 9px;
  border-radius: 999px;
  background: #edf4f1;
  color: var(--green-dark);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: capitalize;
}

.appointment-status.confirmed {
  background: #dff3e9;
  color: #176644;
}

.appointment-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}

.appointment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.appointment-field {
  min-width: 0;
}

.appointment-field-label,
.appointment-field-value {
  display: block;
}

.appointment-field-label {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.appointment-field-value {
  overflow-wrap: anywhere;
  color: var(--ink);
}

a.appointment-field-value {
  color: var(--green-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.danger-button {
  color: var(--danger);
}

.availability-list {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.availability-day {
  border-left: 3px solid var(--line);
  padding-left: 10px;
}

.availability-day label:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--ink);
}

.availability-day input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
}

.availability-times {
  display: grid;
  gap: 6px;
}

.calendar-board {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 24px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.calendar-board h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.appointment-editor-card,
.review-directory-card {
  margin-bottom: 18px;
}

.appointment-editor-card.is-read-only {
  background: #f8fcfa;
}

.button-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 0.95rem;
  border: 1px solid #dce8e1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.schedule-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.schedule-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 0.72rem;
}

.schedule-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.legend-dot.available {
  background: #78c7a5;
}

.legend-dot.booked {
  background: #ef7c5d;
}

.legend-dot.requested {
  background: #e5b456;
}

.slot-grid {
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.slot-day + .slot-day {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.slot-day h4 {
  margin: 0 0 9px;
  color: var(--ink);
  font-size: 0.86rem;
}

.slot-day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.calendar-board > div:last-child .data-list {
  max-height: 520px;
  overflow: auto;
}

.slot {
  min-width: 0;
  min-height: 62px;
  padding: 9px 10px;
  text-align: left;
  border-color: #c8e6d5;
  background: #eff9f3;
  color: #205b49;
}

.slot strong,
.slot span {
  display: block;
}

.slot strong {
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.slot span {
  overflow: hidden;
  color: currentColor;
  font-size: 0.72rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot.booked,
.slot.requested {
  border: 1px solid transparent;
  border-radius: 8px;
}

.public-flow-body {
  min-height: 100vh;
  background: linear-gradient(180deg, #f3fbf7, #ffffff);
}

.public-flow-shell {
  width: min(760px, calc(100% - 28px));
  margin: 0 auto;
  padding: 42px 0;
}

.public-flow-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.public-flow-card h1 {
  margin: 8px 0;
  font-size: 2.6rem;
}

.public-summary {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf9;
  white-space: pre-wrap;
}

.public-flow-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
}

.review-button-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.review-service-button {
  min-height: 56px;
  justify-content: flex-start;
  padding-inline: 18px;
  font-weight: 800;
}

.slot.booked {
  border-color: #f0a08a;
  background: #fff0eb;
  color: #923c28;
}

.slot.requested {
  border-color: #e8c77e;
  background: #fff8e8;
  color: #79591b;
}

.mobile-nav {
  display: none;
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .profile {
    grid-column: 1 / -1;
  }

  .form-grid,
  .model-settings-grid,
  .calendar-board {
    grid-template-columns: 1fr 1fr;
  }

  .inline-editor,
  .data-row.intake-row,
  .data-row.knowledge-row,
  .data-row.price-row,
  .data-row.review-link-row,
  .data-row.transfer-target-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .availability-list {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    background: #f7faf8;
  }

  .shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0 0 92px;
    border-radius: 0;
    box-shadow: none;
  }

  .admin-shell {
    width: 100%;
    margin: 0 0 80px;
    border-radius: 0;
  }

  .admin-page-view {
    padding: 16px;
  }

  .admin-page-tabs,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-topbar {
    padding: 18px 16px 16px;
  }

  .admin-brand-stack p {
    padding-left: 6px;
    font-size: 0.75rem;
  }

  .admin-page-tabs {
    padding: 0 16px;
  }

  .admin-page-tabs button {
    justify-content: flex-start;
  }

  .api-doc-shell {
    width: min(100% - 20px, 980px);
    padding-top: 20px;
  }

  .api-doc-header {
    flex-direction: column;
  }

  .api-doc-header .button-link {
    width: 100%;
  }

  .api-field-grid {
    grid-template-columns: 1fr;
  }

  .system-subtabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-subtabs button {
    justify-content: flex-start;
    min-width: 0;
  }

  .ad-event-row {
    grid-template-columns: 1fr;
  }

  .ad-event-header {
    display: none;
  }

  .plan-card {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px;
  }

  .plan-card-heading {
    flex-direction: column;
    gap: 8px;
  }

  .plan-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-actions {
    min-width: 0;
  }

  .system-webhook-controls {
    grid-template-columns: 1fr;
  }

  .message-inbox {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .message-thread-list {
    max-height: 280px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .message-chain {
    max-height: 520px;
    padding: 14px;
  }

  .message-bubble {
    max-width: 92%;
  }

  .message-composer {
    grid-template-columns: 1fr;
  }

  .account-create-form,
  .account-row,
  .business-row,
  .number-search-form,
  .number-row,
  .number-row.search-result {
    grid-template-columns: 1fr;
  }

  .account-subtabs,
  .crm-subnav,
  .crm-area-subnav,
  .profile-toolbar,
  .traffic-toolbar,
  .crm-date-toolbar,
  .traffic-summary,
  .traffic-breakdowns,
  .traffic-event-row summary,
  .traffic-event-detail p {
    grid-template-columns: 1fr;
  }

  .traffic-custom-range {
    justify-content: stretch;
  }

  .crm-date-toolbar,
  .crm-date-presets,
  .crm-custom-range {
    align-items: stretch;
    flex-direction: column;
  }

  .crm-date-presets button,
  .crm-custom-range input,
  .crm-custom-range button {
    width: 100%;
  }

  .crm-card summary {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .crm-status-badge,
  .crm-booking-stage,
  .crm-open-hint {
    justify-self: start;
  }

  .profile-range-buttons,
  .profile-custom-range {
    width: 100%;
  }

  .traffic-custom-range input,
  .traffic-custom-range button {
    width: 100%;
  }

  .business-actions {
    justify-content: stretch;
  }

  .business-actions button {
    flex: 1;
  }

  .number-config,
  .number-assignment {
    align-items: stretch;
    flex-direction: column;
  }

  .number-group-header {
    flex-direction: column;
    gap: 10px;
    padding: 14px;
  }

  .number-group-count {
    align-self: flex-start;
  }

  .number-group-list {
    padding: 0 14px;
  }

  .number-config select,
  .number-assignment select {
    width: 100%;
  }

  .onboarding-call-detail p {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .call-log summary,
  .call-log-events > div {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 18px 16px 22px;
  }

  .brand-heading {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 14px;
  }

  .topbar .brand-heading > div {
    width: 100%;
  }

  .topbar-logo {
    width: min(230px, 70vw);
    height: auto;
    max-width: 100%;
  }

  .topbar h1 {
    font-size: clamp(2rem, 10vw, 2.8rem);
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  .header-copy {
    max-width: 100%;
    font-size: 0.96rem;
    line-height: 1.35;
  }

  .topbar-actions {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .status {
    min-width: 0;
    width: fit-content;
    max-width: calc(100% - 58px);
  }

  .workspace {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 12px;
    transform: translateY(-8px);
  }

  .panel {
    box-shadow: 0 8px 24px rgb(36 106 85 / 8%);
  }

  .controls {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px;
  }

  .controls > label,
  .controls .call-action,
  .controls #stopButton,
  .controls #openAdminButton {
    grid-column: 1 / -1;
  }

  .controls button {
    justify-content: center;
  }

  .call {
    min-height: 510px;
    grid-template-rows: auto minmax(220px, 1fr) auto;
  }

  .transcript {
    min-height: 250px;
    max-height: 48vh;
  }

  .admin-header,
  .import-row,
  .calendar-actions,
  .booking-flow-header,
  .booking-flow-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .booking-flow-canvas {
    grid-template-columns: 1fr;
    overflow-x: visible;
    padding: 12px;
  }

  .booking-flow-line {
    width: 2px;
    height: 30px;
    justify-self: center;
  }

  .booking-flow-line::after {
    top: auto;
    right: 50%;
    bottom: -1px;
    transform: translateX(50%) rotate(135deg);
  }

  .booking-node-head {
    align-items: stretch;
    flex-direction: column;
  }

  .booking-delay-control,
  .booking-window-control {
    grid-template-columns: 1fr;
    white-space: normal;
  }

  .booking-delay-control input,
  .booking-window-control input {
    width: 100%;
  }

  .booking-flow-toggle,
  .booking-flow-actions .primary {
    width: 100%;
    justify-content: center;
  }

  .review-flow-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .crm-subnav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid,
  .model-settings-grid,
  .calendar-board,
  .booking-provider-header,
  .booking-provider-grid,
  .booking-provider-actions,
  .booking-link-editor,
  .booking-directory-grid,
  .inline-editor,
  .review-link-editor,
  .transfer-target-editor,
  .appointment-editor,
  .crm-webhook-controls,
  .crm-filter-row,
  .crm-editor,
  .crm-detail-grid,
  .crm-lead-editor,
  .follow-up-settings,
  .data-row,
  .data-row.intake-row,
  .data-row.knowledge-row,
  .data-row.price-row,
  .data-row.review-link-row,
  .data-row.transfer-target-row,
  .data-row.booking-link-row,
  .booking-service-link-tools,
  .data-row.appointment-row {
    grid-template-columns: 1fr;
  }

  .public-flow-actions {
    grid-template-columns: 1fr;
  }

  .public-flow-card h1 {
    font-size: 2rem;
  }

  .crm-lead-editor .wide-field {
    grid-column: auto;
  }

  .appointment-details {
    grid-template-columns: 1fr;
  }

  .schedule-heading {
    display: block;
  }

  .schedule-legend {
    justify-content: flex-start;
  }

  .slot-day-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .availability-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-panel {
    margin: 4px 12px 20px;
    scroll-margin-top: 12px;
  }

  .admin-content {
    padding: 14px;
  }

  .admin-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    overflow: visible;
    padding: 10px;
    background: #f0f7f3;
  }

  .admin-tab {
    min-width: 0;
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 6px;
    white-space: normal;
    font-size: 0.82rem;
    line-height: 1.15;
  }

  .admin-tab.active {
    border-color: #cce5d7;
    background: #fff;
    color: var(--accent-dark);
    box-shadow: 0 3px 10px rgb(36 106 85 / 9%);
  }

  .meter-wrap {
    align-items: flex-start;
  }

  .voice-visualizer {
    width: 70px;
    height: 70px;
    flex-basis: 70px;
  }

  .voice-visualizer > svg {
    width: 17px;
    height: 17px;
  }

  .mobile-nav {
    position: fixed;
    z-index: 50;
    right: 10px;
    bottom: 10px;
    left: 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 68px;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border: 1px solid #dce8e1;
    border-radius: 8px;
    background: rgb(255 255 255 / 96%);
    box-shadow: 0 12px 38px rgb(24 77 59 / 22%);
  }

  .mobile-nav-item {
    display: grid;
    place-items: center;
    gap: 2px;
    min-height: 52px;
    border: 0;
    background: transparent;
    color: #8a9691;
    font-size: 0.7rem;
    font-weight: 800;
  }

  .mobile-nav-item svg {
    width: 21px;
    height: 21px;
  }

  .mobile-nav-item.active {
    color: var(--coral);
  }
}
