:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #677188;
  --line: #dfe5ee;
  --panel: #ffffff;
  --page: #f5f7fb;
  --mint: #12a886;
  --mint-dark: #08745d;
  --amber: #f4a62a;
  --rose: #d34f7f;
  --blue: #2f6fed;
  --shadow: 0 18px 45px rgba(36, 44, 66, 0.14);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--page);
  color: var(--ink);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.site-page {
  min-height: 100vh;
}

.top-nav,
.admin-header,
.panel-heading,
.hero-actions,
.nav-actions,
.form-row,
.row-actions,
.chat-header,
.chat-agent,
.prompt-row,
.chat-form,
.outcome-list,
.lead-row span,
.metric-card {
  display: flex;
}

.top-nav {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 clamp(18px, 5vw, 68px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(223, 229, 238, 0.85);
  backdrop-filter: blur(16px);
}

.brand-button,
.ghost-button,
.primary-button,
.secondary-button,
.primary-link,
.icon-button,
.chat-launcher,
.prompt-row button {
  border: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.brand-button {
  display: inline-flex;
  gap: 10px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
}

.brand-button svg {
  color: var(--mint);
}

.nav-actions {
  align-items: center;
  gap: 12px;
}

.primary-link,
.primary-button,
.secondary-button,
.ghost-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
}

.primary-link,
.primary-button {
  display: inline-flex;
  gap: 9px;
  background: var(--mint);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(18, 168, 134, 0.24);
}

.primary-button.compact {
  width: fit-content;
}

.secondary-button {
  display: inline-flex;
  gap: 9px;
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.ghost-button {
  display: inline-flex;
  gap: 8px;
  background: transparent;
  color: var(--ink);
}

.hero-section {
  min-height: 86vh;
  display: grid;
  align-items: end;
  padding: 132px clamp(18px, 5vw, 68px) 64px;
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(9, 17, 30, 0.84), rgba(9, 17, 30, 0.38)),
    url("https://images.unsplash.com/photo-1551434678-e076c223a692?auto=format&fit=crop&w=1800&q=80")
      center / cover;
}

.hero-content {
  max-width: 720px;
}

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

.hero-section .eyebrow {
  color: #79f4d8;
}

.hero-content h1 {
  max-width: 680px;
  margin-bottom: 18px;
  font-size: 3.65rem;
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 640px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.12rem;
  line-height: 1.7;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.section-band,
.proof-band {
  padding: 74px clamp(18px, 5vw, 68px);
}

.section-heading {
  max-width: 660px;
  margin-bottom: 28px;
}

.section-heading h2,
.proof-band h2,
.admin-header h1 {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1.18;
  letter-spacing: 0;
}

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

.service-card,
.metric-card,
.knowledge-form,
.knowledge-list,
.lead-section,
.login-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(36, 44, 66, 0.07);
}

.service-card {
  padding: 26px;
}

.service-icon,
.agent-avatar,
.message-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.service-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: #e9fbf6;
  color: var(--mint-dark);
}

.service-card h3 {
  margin-bottom: 10px;
  font-size: 1.08rem;
}

.service-card p,
.knowledge-item p,
.login-panel p {
  color: var(--muted);
  line-height: 1.65;
}

.proof-band {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 28px;
  background: #ffffff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.outcome-list {
  flex-wrap: wrap;
  gap: 10px;
}

.outcome-list span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  background: #f3f7fb;
  color: var(--ink);
  font-weight: 700;
}

.outcome-list svg {
  color: var(--mint);
}

.chat-shell {
  position: fixed;
  z-index: 30;
  right: 22px;
  bottom: 22px;
}

.chat-launcher {
  display: inline-flex;
  gap: 10px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  box-shadow: var(--shadow);
  font-weight: 800;
}

.chat-window {
  width: min(390px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.chat-header {
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #182033;
  color: #ffffff;
}

.chat-agent {
  align-items: center;
  gap: 12px;
}

.agent-avatar {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--mint);
}

.chat-agent small {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  margin-top: 2px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f4f7fb;
  color: var(--ink);
}

.chat-header .icon-button {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.icon-button.danger {
  color: #b4234d;
  background: #fff0f4;
}

.chat-messages {
  height: 350px;
  overflow-y: auto;
  padding: 16px;
  background: #f7f9fd;
}

.message-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  margin-bottom: 12px;
}

.message-row.user {
  grid-template-columns: minmax(0, 1fr) 28px;
}

.message-row.user .message-avatar {
  grid-column: 2;
  background: #fef4df;
  color: #8a5600;
}

.message-row.user p {
  grid-row: 1;
  background: var(--blue);
  color: #ffffff;
}

.message-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #e6fbf5;
  color: var(--mint-dark);
}

.message-row p {
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  line-height: 1.55;
  white-space: pre-wrap;
  box-shadow: 0 8px 18px rgba(31, 42, 68, 0.06);
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.typing svg,
button:disabled svg[data-lucide="loader-2"] {
  animation: spin 0.9s linear infinite;
}

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

.prompt-row {
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px 0;
}

.prompt-row button {
  min-height: 32px;
  border-radius: 8px;
  background: #eef7f5;
  color: var(--mint-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

.chat-form {
  gap: 10px;
  padding: 14px;
}

.chat-form input,
.login-form input,
.knowledge-form input,
.knowledge-form textarea,
.lead-row select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

.chat-form input {
  min-height: 44px;
  padding: 0 12px;
}

.chat-form button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--mint);
  color: #ffffff;
  cursor: pointer;
}

.chat-form button:disabled,
.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.admin-login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(246, 248, 252, 0.96), rgba(232, 247, 243, 0.92)),
    url("https://images.unsplash.com/photo-1519389950473-47ba0277781c?auto=format&fit=crop&w=1600&q=80")
      center / cover;
}

.login-panel {
  width: min(440px, 100%);
  padding: 30px;
}

.admin-brand {
  margin-bottom: 28px;
}

.login-panel h1 {
  margin-bottom: 10px;
  font-size: 2rem;
}

.login-form,
.knowledge-form {
  display: grid;
  gap: 16px;
}

.login-form label,
.knowledge-form label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

.login-form input,
.knowledge-form input,
.knowledge-form textarea {
  min-height: 44px;
  padding: 10px 12px;
  font-weight: 500;
}

.knowledge-form textarea {
  resize: vertical;
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff0f4;
  color: #a5123f;
  font-weight: 700;
}

.form-error.wide {
  margin-bottom: 18px;
}

.primary-button.full {
  width: 100%;
}

.admin-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: #ffffff;
  border-right: 1px solid var(--line);
}

.admin-sidebar nav {
  display: grid;
  gap: 8px;
}

.admin-sidebar nav button,
.sidebar-action {
  justify-content: flex-start;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.admin-sidebar nav button {
  display: flex;
  padding: 12px;
  border-radius: 8px;
}

.admin-sidebar nav button:hover,
.sidebar-action:hover {
  background: #f3f7fb;
  color: var(--ink);
}

.sidebar-action {
  margin-top: 28px;
}

.admin-content {
  padding: 34px;
}

.admin-header {
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card {
  align-items: center;
  gap: 12px;
  min-height: 104px;
  padding: 20px;
}

.metric-card svg {
  color: var(--mint);
}

.metric-card span {
  color: var(--muted);
  font-weight: 700;
}

.metric-card strong {
  margin-left: auto;
  font-size: 2rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.75fr) minmax(0, 1.25fr);
  gap: 20px;
  align-items: start;
}

.knowledge-form,
.knowledge-list,
.lead-section {
  padding: 22px;
}

.panel-heading {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.35rem;
}

.form-row {
  gap: 12px;
}

.toggle-row {
  grid-template-columns: 18px 1fr;
  align-items: center;
}

.toggle-row input {
  width: 18px;
  height: 18px;
}

.table-list {
  display: grid;
  gap: 12px;
}

.knowledge-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.knowledge-item h3 {
  margin: 8px 0;
  font-size: 1rem;
}

.knowledge-item p {
  margin-bottom: 8px;
}

.knowledge-item small {
  color: var(--muted);
  font-weight: 800;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  background: #fef4df;
  color: #7f4d00;
  font-size: 0.76rem;
  font-weight: 900;
}

.row-actions {
  align-items: start;
  gap: 8px;
}

.lead-section {
  margin-top: 20px;
}

.lead-table {
  overflow-x: auto;
}

.lead-row {
  display: grid;
  grid-template-columns: 1fr 1.15fr minmax(220px, 1.6fr) 140px;
  gap: 14px;
  align-items: center;
  min-width: 820px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.lead-row.heading {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lead-row span {
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  line-height: 1.45;
}

.lead-row small {
  color: var(--muted);
}

.lead-row a {
  color: var(--blue);
  font-weight: 800;
}

.lead-row select {
  min-height: 38px;
  padding: 0 10px;
  font-weight: 800;
}

.empty-state {
  color: var(--muted);
}

@media (max-width: 980px) {
  .service-grid,
  .metric-grid,
  .admin-grid,
  .proof-band {
    grid-template-columns: 1fr;
  }

  .admin-page {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }

  .admin-sidebar nav {
    display: none;
  }

  .sidebar-action {
    width: auto;
    margin-top: 0;
  }
}

@media (max-width: 680px) {
  .top-nav {
    height: auto;
    min-height: 68px;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .nav-actions {
    width: 100%;
  }

  .nav-actions .ghost-button,
  .nav-actions .primary-link {
    flex: 1;
  }

  .hero-section {
    min-height: 82vh;
    padding-top: 150px;
  }

  .hero-content h1 {
    font-size: 2.45rem;
  }

  .hero-copy {
    font-size: 1rem;
  }

  .section-band,
  .proof-band,
  .admin-content {
    padding: 42px 18px;
  }

  .chat-shell {
    right: 14px;
    bottom: 14px;
    left: 14px;
  }

  .chat-window {
    width: 100%;
  }

  .chat-messages {
    height: 330px;
  }

  .form-row,
  .admin-header,
  .admin-sidebar {
    flex-direction: column;
    align-items: stretch;
  }

  .metric-card strong {
    font-size: 1.7rem;
  }
}
