: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;
}

.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 {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f9fbfa;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.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 .wide {
  grid-column: 1 / -1;
}

.fast-profile-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.fast-profile-grid input,
.fast-profile-grid textarea {
  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 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-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%; }
}

[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: 62px;
  max-width: 210px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #fff;
  filter: drop-shadow(0 8px 18px rgb(0 0 0 / 18%));
}

.admin-logo {
  height: 56px;
  max-width: 190px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #fff;
}

.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;
}

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

.admin-topbar {
  margin-bottom: 18px;
}

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

.admin-page-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

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

.admin-page-tabs button.active {
  border-bottom-color: var(--green);
  color: var(--green-dark);
}

.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;
}

.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;
}

.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;
}

.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;
}

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

.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;
}

.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;
}

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;
}

.records {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.record {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
}

.record strong {
  display: block;
  margin-bottom: 4px;
}

.record span {
  white-space: pre-line;
}

.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;
}

.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-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 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;
  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-card summary strong {
  font-size: 1rem;
}

.crm-card summary div > span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.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-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 {
  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;
}

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

.automation-menu-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;
}

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

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

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

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

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

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

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

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

.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.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;
}

.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,
  .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: calc(100% - 20px);
    margin: 12px auto 80px;
  }

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

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

  .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;
  }

  .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;
  }

  .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;
    margin: 0;
    padding: 20px 16px 22px;
  }

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

  .topbar-logo {
    height: 44px;
    max-width: 150px;
  }

  .topbar h1 {
    font-size: 2rem;
    line-height: 1.08;
  }

  .header-copy {
    font-size: 0.88rem;
  }

  .status {
    min-width: 0;
    width: fit-content;
  }

  .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 {
    align-items: stretch;
    flex-direction: column;
  }

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

  .form-grid,
  .calendar-board,
  .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.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);
  }
}
