:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #101828;
  background: #f4f6f8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}

button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: #0055a5;
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(0, 85, 165, .18);
  border-color: #0055a5;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, #344054 50%), linear-gradient(135deg, #344054 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

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

pre {
  overflow: auto;
  margin: 0;
  border-radius: 6px;
  background: #0b1220;
  color: #dbeafe;
  padding: 14px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}

h1,
h2 {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 32px;
}

h2 {
  margin-bottom: 8px;
  font-size: 18px;
}

h3 {
  margin: 14px 0 8px;
  font-size: 14px;
}

.muted,
.status,
.eyebrow {
  color: #667085;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

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

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  background: #0b1220;
  color: #fff;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
}

.admin-brand span {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d32027, #0055a5);
}

.admin-sidebar nav {
  display: grid;
  gap: 6px;
  margin-top: 26px;
}

.admin-sidebar a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 6px;
  color: #dbeafe;
  padding: 9px 10px;
  text-decoration: none;
}

.admin-sidebar a:hover {
  background: rgba(255, 255, 255, .08);
}

.nav-badge {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: #d32027;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.nav-badge[hidden] {
  display: none;
}

.admin-shell {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 32px 28px;
}

.topbar,
.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar {
  justify-content: space-between;
  margin-bottom: 18px;
}

.form-row {
  align-items: stretch;
}

.form-row > * {
  min-width: 0;
}

.form-row input:first-child {
  flex: 1;
}

.form-row input[type="number"] {
  width: 110px;
  text-align: center;
}

.panel {
  margin-bottom: 18px;
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.panel p {
  margin-top: 0;
}

.panel .muted {
  margin-bottom: 14px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.admin-stats div {
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.admin-stats span {
  display: block;
  margin-bottom: 6px;
  color: #667085;
  font-size: 12px;
}

.admin-stats strong {
  display: block;
  font-size: 18px;
}

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

.setting-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  padding: 14px;
}

.setting-row span {
  display: grid;
  gap: 5px;
}

.setting-row small {
  color: #667085;
  line-height: 1.35;
}

.setting-row input {
  width: 18px;
  height: 18px;
  accent-color: #0055a5;
}

.avatar-config {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}

.avatar-config.voice-config {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.avatar-config .wide {
  min-width: 0;
}

.avatar-config label {
  display: grid;
  gap: 6px;
}

.avatar-config span {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.avatar-config select {
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  padding: 10px 12px;
  font: inherit;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 18px;
}

.chat-log {
  min-height: 390px;
  max-height: 460px;
  overflow: auto;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
  background: #f8fafc;
}

.message {
  width: fit-content;
  max-width: 88%;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message.user {
  margin-left: auto;
  background: #0055a5;
  color: #fff;
}

.message.assistant {
  background: #fff;
  border: 1px solid #e4e7ec;
}

.citations {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
}

.citations a,
.source-item a {
  color: #0055a5;
  font-weight: 700;
}

.sources {
  display: grid;
  gap: 12px;
  max-height: 520px;
  overflow: auto;
  min-width: 0;
}

.source-item {
  min-width: 0;
  border-bottom: 1px solid #eaecf0;
  padding-bottom: 12px;
}

.source-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.source-item p {
  margin: 8px 0 0;
  color: #475467;
  font-size: 14px;
}

.appointment-item {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.appointment-header,
.appointment-actions,
.appointment-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.appointment-header {
  justify-content: space-between;
  min-width: 0;
}

.appointment-header strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.appointment-links a {
  color: #0055a5;
  font-size: 13px;
  font-weight: 700;
}

.appointment-tool-grid {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(260px, 1fr) minmax(120px, auto) minmax(140px, auto);
  gap: 8px;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.appointment-tool-grid > * {
  min-width: 0;
}

.appointment-tool-grid textarea {
  grid-column: span 2;
  min-height: 86px;
}

.appointment-tool-grid .wide {
  grid-column: 1 / -1;
}

button.button-secondary,
.button-secondary {
  border: 1px solid #cbd5e1 !important;
  background: #fff !important;
  color: #344054 !important;
}

.status-badge {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 0;
  border-radius: 999px;
  padding: 4px 9px;
  background: #e4e7ec !important;
  color: #344054 !important;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: capitalize;
  white-space: nowrap;
}

.status-pending {
  background: #fff4cc !important;
  color: #7a4f01 !important;
}

.status-confirmed,
.status-approved {
  background: #dcfae6 !important;
  color: #067647 !important;
}

.status-cancelled {
  background: #fee4e2 !important;
  color: #b42318 !important;
}

.service-manager {
  margin: 14px 0 18px;
  border-top: 1px solid #eaecf0;
  padding-top: 12px;
}

.service-form-grid,
.service-edit-grid {
  display: grid;
  gap: 8px;
  align-items: start;
  min-width: 0;
}

.service-form-grid {
  grid-template-columns: minmax(220px, 1fr) minmax(120px, .35fr) minmax(130px, .35fr) minmax(90px, .25fr);
}

.service-edit-grid {
  grid-template-columns: minmax(180px, 1fr) minmax(110px, .35fr) minmax(120px, .35fr) minmax(80px, .25fr) auto auto;
}

.service-form-grid > *,
.service-edit-grid > * {
  min-width: 0;
}

.service-form-grid textarea {
  grid-column: 1 / span 3;
  min-height: 76px;
}

.service-edit-grid textarea {
  grid-column: 1 / span 4;
  min-height: 76px;
}

.service-edit-grid {
  margin-top: 10px;
}

.service-edit-grid .wide {
  grid-column: 1 / -1;
}

.demo-nav {
  display: flex;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid #d9e1ea;
  background: #fff;
}

.demo-nav span {
  color: #667085;
}

.demo-hero {
  width: min(860px, calc(100vw - 40px));
  padding: 96px 0;
  margin: 0 auto;
}

.demo-hero h1 {
  max-width: 760px;
  font-size: clamp(38px, 7vw, 72px);
  line-height: .98;
}

.demo-hero p {
  max-width: 640px;
  margin-top: 24px;
  color: #475467;
  font-size: 18px;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
  }

  .admin-sidebar nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-stats,
  .experience-grid,
  .avatar-config,
  .appointment-tool-grid,
  .service-form-grid,
  .service-edit-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .appointment-tool-grid textarea,
  .service-form-grid textarea,
  .service-edit-grid textarea {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .topbar,
  .form-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-shell {
    padding: 24px 16px;
  }

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

  .form-row input[type="number"] {
    width: 100%;
  }

  .demo-nav {
    padding: 16px 20px;
  }
}
