/* Lead Desk. Tokens come from /assets/tokens.css (copied from packages/ui at build). */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: var(--cc-font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--cc-ink);
  background: var(--cc-navy);
  display: flex;
  flex-direction: column;
}
h1,
h2 {
  font-family: var(--cc-font-head);
  letter-spacing: -0.01em;
  margin: 0;
}
a {
  color: var(--cc-cobalt);
}
button,
input,
textarea {
  font: inherit;
}
[hidden] {
  display: none !important;
}
.sr-only,
.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--cc-white);
  color: var(--cc-ink);
  border-radius: var(--cc-radius-sm);
  font-weight: 700;
}
.skip:focus {
  top: 8px;
}
.muted {
  color: var(--cc-muted);
}
.tag {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}
.tag-demo {
  background: #fff4d6;
  color: #6b4a00;
}

/* Top bar */
.demo-banner {
  background: #fff4d6;
  color: #4a3300;
  padding: 10px 16px;
  font-size: 0.92rem;
  text-align: center;
}
.demo-banner a {
  color: #4a3300;
  font-weight: 700;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--cc-white);
  text-decoration: none;
}
.brand-mark {
  width: 36px;
  height: 36px;
  color: var(--cc-white);
}
.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-name {
  font-family: var(--cc-font-head);
  font-weight: 800;
  font-size: 1.05rem;
}
.brand-tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cc-muted-on-dark);
}
.top-link {
  color: var(--cc-muted-on-dark);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
}
.top-link:hover {
  color: var(--cc-white);
  text-decoration: underline;
}

/* Layout */
.desk {
  flex: 1;
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px 16px;
  min-height: 0;
}
@media (min-width: 960px) {
  .booking-open .desk {
    grid-template-columns: 1fr 420px;
  }
}
.chat-panel,
.booking-panel {
  background: var(--cc-white);
  border-radius: var(--cc-radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.chat-panel {
  height: calc(100vh - 100px);
  height: calc(100dvh - 100px);
  min-height: 480px;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #e1e6f3;
}
.panel-head h1 {
  font-size: 1.2rem;
}
.panel-head h2 {
  font-size: 1.1rem;
  flex: 1;
}
.sub {
  margin: 0;
  font-size: 0.88rem;
  color: var(--cc-muted);
}
.booking-panel > .sub {
  padding: 12px 20px 0;
}
.avatar {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--cc-cobalt);
  color: var(--cc-white);
  font-family: var(--cc-font-head);
  font-weight: 800;
}
.head-actions {
  margin-left: auto;
}

/* Messages */
.messages {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--cc-light);
}
.msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg-ai {
  align-self: flex-start;
  background: var(--cc-white);
  border: 1px solid #e1e6f3;
  border-bottom-left-radius: 4px;
}
.msg-visitor {
  align-self: flex-end;
  background: var(--cc-cobalt);
  color: var(--cc-white);
  border-bottom-right-radius: 4px;
}
.typing {
  color: var(--cc-muted);
  letter-spacing: 0.2em;
}

/* Composer */
.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e1e6f3;
}
.composer textarea {
  flex: 1;
  min-height: 48px;
  max-height: 160px;
  resize: none;
  padding: 12px 14px;
  border: 1px solid #c9d2ea;
  border-radius: 12px;
  color: var(--cc-ink);
}
.composer textarea:focus {
  border-color: var(--cc-cobalt);
}
.voice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 0 16px 8px;
  font-size: 0.9rem;
  color: var(--cc-muted);
}
.voice-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.fine {
  margin: 0;
  padding: 0 16px 14px;
  font-size: 0.8rem;
  color: var(--cc-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
@media (max-width: 480px) {
  .panel-head {
    padding: 12px 14px;
  }
  .head-actions .btn {
    padding: 8px 14px;
    font-size: 0.92rem;
  }
  .top-link {
    font-size: 0.88rem;
  }
}
.btn-primary {
  background: var(--cc-cobalt);
  color: var(--cc-white);
}
.btn-primary:hover {
  background: var(--cc-cobalt-hover);
  color: var(--cc-white);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: wait;
}
.btn-ghost {
  min-height: 42px;
  background: var(--cc-soft);
  color: var(--cc-ink);
}
.icon-btn {
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid #c9d2ea;
  border-radius: 50%;
  background: var(--cc-white);
  color: var(--cc-ink);
  font-size: 1.4rem;
  cursor: pointer;
}
.icon-btn svg {
  width: 22px;
  height: 22px;
}
.icon-btn.live {
  background: #fde2e2;
  border-color: #c62828;
  color: #8f1d1d;
}

/* Booking: side panel on wide screens, full-screen sheet on phones/tablets */
.booking-panel {
  max-height: calc(100dvh - 100px);
  overflow-y: auto;
}
.booking-panel .slots {
  flex: none;
  overflow: visible;
}
@media (max-width: 959px) {
  .booking-panel {
    position: fixed;
    inset: 0;
    z-index: 50;
    max-height: none;
    border-radius: 0;
  }
  .booking-open {
    overflow: hidden;
  }
}
.slots {
  padding: 12px 20px;
  overflow-y: auto;
  flex: 1;
}
.day {
  border: 0;
  margin: 0 0 14px;
  padding: 0;
}
.day legend {
  font-weight: 700;
  margin-bottom: 6px;
  padding: 0;
}
.slot {
  margin: 0 6px 6px 0;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #c9d2ea;
  border-radius: 10px;
  background: var(--cc-white);
  color: var(--cc-ink);
  font-weight: 600;
  cursor: pointer;
}
.slot:hover {
  border-color: var(--cc-cobalt);
}
.slot[aria-pressed='true'] {
  background: var(--cc-cobalt);
  border-color: var(--cc-cobalt);
  color: var(--cc-white);
}
.book-form {
  padding: 12px 20px 20px;
  border-top: 1px solid #e1e6f3;
}
.chosen {
  font-weight: 700;
  margin: 0 0 10px;
}
.field {
  margin-bottom: 10px;
}
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 4px;
}
.field input,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #c9d2ea;
  border-radius: 10px;
  color: var(--cc-ink);
}
.opt {
  font-weight: 400;
  color: var(--cc-muted);
}
.form-error {
  color: #a11a1a;
  font-weight: 600;
}
.book-done {
  margin: 16px 20px 20px;
  padding: 16px;
  border-radius: 12px;
  background: #e7f7ed;
  color: #0f5132;
  font-weight: 600;
}

/* Message pages */
.message-page {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 16px;
}
.message-page .card {
  max-width: 520px;
  padding: 32px;
  background: var(--cc-white);
  border-radius: var(--cc-radius);
}
.message-page h1 {
  font-size: 1.6rem;
  margin-bottom: 12px;
}
