:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #182230;
  background: #f5f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --muted: #718096;
  --line: #e6eaf0;
  --blue: #3659c9;
  --blue-light: #eef2ff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-width: 320px;
  margin: 0;
  background: #f5f7fb;
  font-size: 14px;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(28px, calc((100vw - 1200px) / 2));
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1d2a42;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -.3px;
  text-decoration: none;
}

.brand-mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #3659c9;
  color: white;
  font-weight: 800;
}

.brand-light { font-weight: 450; color: #58657a; }
.environment-tag, .eyebrow { color: #586cbb; font-size: 10px; font-weight: 800; letter-spacing: 1.1px; }
.environment-tag { padding: 7px 9px; border-radius: 6px; background: #eef2ff; }
.page { width: min(1200px, calc(100% - 48px)); margin: 34px auto 24px; }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 17px;
  border: 1px solid #cbd7ff;
  border-radius: 10px;
  background: #f0f4ff;
  color: #293d78;
}

.notice-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  margin-top: 1px;
  border-radius: 50%;
  background: #dce5ff;
  font-size: 12px;
  font-weight: 800;
}

.notice strong { font-size: 13px; }
.notice p { margin: 4px 0 0; color: #55678e; font-size: 12px; line-height: 1.5; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 29px 0 19px; }
.eyebrow { margin: 0 0 7px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: 27px; letter-spacing: -.8px; }
.subtitle { margin-bottom: 0; color: var(--muted); }
.intro-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.subtitle #agent-session-status { color: #5265aa; font-size: 11px; font-weight: 650; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  transition: background .15s ease, border-color .15s ease;
}

.button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid #b9c8ff;
  outline-offset: 2px;
}
.button-primary { background: var(--blue); color: #fff; }
.button-primary:hover { background: #2948ae; }
.button-secondary { border-color: #dce2eb; background: #fff; color: #354258; }
.button-secondary:hover, .button-tertiary:hover { background: #f3f5f9; }
.button-tertiary { border-color: #e1e6ee; background: #fff; color: #657188; }
.button:disabled { cursor: wait; opacity: .6; }

.workspace { display: grid; grid-template-columns: 345px minmax(0, 1fr); gap: 16px; height: calc(100dvh - 225px); min-height: 400px; }
.panel { min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 2px 8px rgb(27 42 77 / 3%); }
.inbox { position: relative; display: flex; min-height: 0; height: 100%; flex-direction: column; }
.inbox-heading { display: flex; align-items: center; justify-content: space-between; padding: 18px 17px 15px; border-bottom: 1px solid #edf0f4; }
.inbox-heading h2 { margin: 0 0 3px; font-size: 14px; }
.muted { color: var(--muted); font-size: 11px; }
.online-indicator { display: flex; align-items: center; gap: 6px; color: #627084; font-size: 10px; }
.online-indicator span { width: 7px; height: 7px; border-radius: 50%; background: #37ad7a; }
.conversation-list { min-height: 0; flex: 1; overflow-y: auto; }
.conversation-card { display: flex; width: 100%; gap: 11px; padding: 14px 15px; border: 0; border-bottom: 1px solid #f0f2f6; background: #fff; text-align: left; }
.conversation-card:hover { background: #f8f9fc; }
.conversation-card.selected { background: #f0f3ff; box-shadow: inset 3px 0 var(--blue); }
.conversation-avatar, .customer-avatar { display: grid; flex: 0 0 37px; width: 37px; height: 37px; place-items: center; border-radius: 50%; background: #eef1f6; color: #58657a; font-size: 12px; font-weight: 750; }
.conversation-card-main { min-width: 0; flex: 1; }
.conversation-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.conversation-customer { overflow: hidden; color: #283349; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.conversation-time { flex: 0 0 auto; color: #929bad; font-size: 10px; }
.conversation-preview { overflow: hidden; margin: 5px 0 7px; color: #778196; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-block; padding: 3px 6px; border-radius: 4px; background: #eef2ff; color: #4e62a8; font-size: 9px; font-weight: 800; letter-spacing: .25px; }
.badge-closed { margin-left: 4px; background: #eef0f3; color: #6f7888; }
.empty-list { display: flex; min-height: 250px; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; color: var(--muted); text-align: center; }
#empty-list[hidden] { display: none; }
.empty-list strong { color: #47536a; font-size: 12px; }
.empty-list span:last-child { max-width: 190px; font-size: 11px; line-height: 1.5; }
.empty-icon { color: #9aa6bc; font-size: 26px; }

.thread { display: flex; height: 100%; min-height: 0; flex-direction: column; }
.thread-empty { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; padding: 30px; text-align: center; }
.thread-empty-icon { display: grid; width: 51px; height: 51px; place-items: center; margin-bottom: 15px; border-radius: 16px; background: #f0f3fa; color: #8896af; font-size: 22px; }
.thread-empty h2 { margin-bottom: 6px; font-size: 15px; }
.thread-empty p { max-width: 280px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
#thread-content { display: flex; min-height: 0; flex: 1; flex-direction: column; overflow: hidden; }
.thread-header { display: flex; align-items: center; gap: 11px; padding: 14px 18px; border-bottom: 1px solid #edf0f4; }
.customer-avatar { width: 39px; height: 39px; flex-basis: 39px; background: #edf0fb; color: #586cb2; }
.thread-person { min-width: 0; flex: 1; }
.thread-person h2 { margin: 0 0 4px; font-size: 13px; }
.thread-person span { color: var(--muted); font-size: 10px; }
.messages { display: flex; flex: 1; flex-direction: column; gap: 14px; overflow-y: auto; padding: 19px; }
.message-row { display: flex; max-width: 86%; flex-direction: column; align-items: flex-start; gap: 5px; }
.message-row.agent { align-self: flex-end; align-items: flex-end; }
.message-meta { color: #8993a5; font-size: 10px; }
.message-bubble { padding: 10px 12px; border: 1px solid #e9edf3; border-radius: 4px 12px 12px; background: #f6f7fa; color: #374258; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.message-row.agent .message-bubble { border-color: #dce4ff; border-radius: 12px 4px 12px 12px; background: #f0f3ff; }
.message-label { color: #a3772f; font-size: 9px; font-weight: 750; }
.composer { display: flex; gap: 9px; padding: 12px 16px 8px; border-top: 1px solid #edf0f4; }
.composer input, .dialog input, .dialog textarea, .dialog select { width: 100%; min-width: 0; border: 1px solid #dfe4ec; border-radius: 7px; background: #fff; color: #283349; }
.composer input { height: 38px; padding: 0 11px; font-size: 12px; }
.composer-note { margin: 0; padding: 0 16px 13px; color: #929bad; font-size: 10px; }
.agents { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 16px; padding: 16px 18px; }
.agents-title { display: flex; align-items: center; gap: 11px; }
.agents-icon { color: #6174bc; font-size: 21px; }
.agents-title h2 { margin: 0 0 3px; font-size: 12px; }
.agents-title p { margin: 0; color: var(--muted); font-size: 10px; }
.agent-list { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.agent-chip { padding: 7px 9px; border: 1px solid #e8ebf0; border-radius: 20px; color: #5c677a; font-size: 10px; }
.agent-chip::before { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #37ad7a; content: ""; }
.footer { display: flex; justify-content: space-between; gap: 12px; padding: 14px 2px 0; color: #929bad; font-size: 10px; }
.error-banner { margin: 0 0 14px; padding: 10px 12px; border: 1px solid #efc7c7; border-radius: 7px; background: #fff3f3; color: #9a3434; font-size: 12px; }
.success-banner { margin: 0 0 14px; padding: 10px 12px; border: 1px solid #b8dfcb; border-radius: 7px; background: #effaf4; color: #286344; font-size: 12px; }

.dialog { width: min(470px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 70px rgb(22 35 67 / 20%); }
.dialog::backdrop { background: rgb(21 31 51 / 36%); }
.dialog form { padding: 22px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: start; margin-bottom: 19px; }
.dialog-heading h2 { margin: 0; font-size: 18px; }
.dialog-close { width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: #758095; font-size: 22px; }
.dialog label { display: block; margin: 13px 0 6px; color: #49556a; font-size: 11px; font-weight: 700; }
.dialog input, .dialog textarea, .dialog select { padding: 10px; font-size: 12px; }
.dialog textarea { resize: vertical; }
.dialog-note { margin: 10px 0 0; color: #929bad; font-size: 10px; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

.user-actions { display: flex; align-items: center; gap: 8px; }
.user-page { max-width: 980px; }
.user-page > .notice { margin-bottom: 22px; }
.user-login { width: min(440px, 100%); margin: 42px auto; padding: 28px; }
.user-login h1, .user-heading h1 { font-size: 23px; }
.user-login form { margin-top: 23px; }
.user-login label { display: block; margin: 14px 0 6px; color: #49556a; font-size: 12px; font-weight: 700; }
.user-login input { width: 100%; height: 41px; padding: 0 11px; border: 1px solid #dfe4ec; border-radius: 7px; background: #fff; color: #283349; }
.user-login form > .button { width: 100%; justify-content: center; margin-top: 18px; }
.user-chat { overflow: hidden; }
.user-dashboard { display: grid; gap: 15px; }
.user-dashboard > .user-heading { border-bottom: 0; }
.user-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px; }
.user-heading .eyebrow { margin-bottom: 5px; }
.user-heading h1 { margin-bottom: 4px; }
.sample-tag { padding: 6px 9px; border-radius: 5px; background: #f1f3f7; color: #747f91; font-size: 9px; font-weight: 800; letter-spacing: .7px; }
.profile-card, .account-card, .records-card, .statistics-card { padding: 19px 20px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.section-heading h2 { margin: 0; color: #26334a; font-size: 14px; }
.status-pill { padding: 5px 9px; border-radius: 20px; background: #eaf7f0; color: #258054; font-size: 10px; font-weight: 750; }
.status-pill::before { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #37ad7a; content: ""; }
.profile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px 20px; }
.profile-grid > div, .statistics-grid > div { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.profile-grid span, .statistics-grid span { color: #8490a3; font-size: 10px; }
.profile-grid strong { overflow-wrap: anywhere; color: #344158; font-size: 12px; font-weight: 650; }
.profile-grid .profile-last-login { grid-column: span 2; }
.user-dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.account-details { margin: 0 0 16px; }
.account-details > div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f0f2f6; }
.account-details dt { color: #8490a3; font-size: 11px; }
.account-details dd { overflow-wrap: anywhere; margin: 0; color: #344158; font-size: 11px; font-weight: 650; }
.records-list { margin: -2px 0 15px; }
.record-row { display: flex; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid #f0f2f6; color: #69758a; font-size: 11px; }
.record-row strong { color: #344158; font-size: 10px; }
.empty-records { margin: 0; padding: 12px 0; color: #8490a3; font-size: 11px; }
.statistics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.statistics-grid strong { color: #344158; font-size: 14px; }
.statistics-grid > div:last-child strong { font-size: 11px; }
.user-messages { min-height: 390px; max-height: 58vh; }
.user-history { display: flex; gap: 7px; overflow-x: auto; padding: 10px 16px; border-bottom: 1px solid #edf0f4; }
.history-button { flex: 0 0 auto; padding: 7px 10px; border: 1px solid #e2e7ef; border-radius: 18px; background: #fff; color: #69758a; font-size: 10px; }
.history-button.active { border-color: #cbd7ff; background: #eef2ff; color: #4058a8; font-weight: 700; }
.user-chat > .error-banner { margin: 8px 16px; }
.user-chat .message-label { letter-spacing: .35px; }

@media (max-width: 450px) {
  .user-login { margin: 25px auto; padding: 20px; }
  .user-heading { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 650px) {
  .user-dashboard-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .statistics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; }
}

@media (max-width: 760px) {
  .topbar { height: 60px; padding: 0 18px; }
  .page { width: calc(100% - 28px); margin-top: 19px; }
  .intro { align-items: flex-start; flex-direction: column; margin-top: 22px; }
  .intro-actions { width: 100%; }
  .intro-actions .button { flex: 1; }
  .workspace { height: auto; min-height: 0; grid-template-columns: 1fr; }
  .inbox { height: 420px; min-height: 0; }
  .conversation-list { min-height: 0; max-height: none; flex: 1; }
  .thread { height: 60vh; min-height: 360px; }
  #thread-content { min-height: 0; }
  .agents { align-items: flex-start; flex-direction: column; gap: 13px; }
  .agent-list { justify-content: flex-start; }
  .footer { flex-direction: column; }
}

@media (max-width: 450px) {
  .environment-tag { padding: 6px; font-size: 8px; }
  h1 { font-size: 24px; }
  .button { padding: 0 9px; font-size: 11px; }
  .thread-header { padding: 12px; }
  .thread-header .button { max-width: 100px; white-space: normal; }
  .messages { padding: 13px; }
}

/* Simulator admin-style header */
body header.admin-style-header {
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 20px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 16px 24px !important;
  background: #fff !important;
  border: 0 !important;
  border-bottom: 1px solid #d9dee5 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #1f2937 !important;
  font-family: Arial, Helvetica, sans-serif !important;
}

body header.admin-style-header .admin-style-brand {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #1f2937 !important;
  font-size: 20px !important;
  font-weight: 700 !important;
}

body header.admin-style-header .admin-style-info {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 14px !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #1f2937 !important;
  font-size: 14px !important;
}

body header.admin-style-header .admin-style-button {
  display: inline-block !important;
  margin: 0 !important;
  padding: 8px 13px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  background: #fff !important;
  color: #1f2937 !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: normal !important;
  box-shadow: none !important;
  cursor: pointer !important;
}

body header.admin-style-header .admin-style-button:hover {
  background: #f8fafc !important;
}

@media (max-width: 650px) {
  body header.admin-style-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 14px 16px !important;
    gap: 12px !important;
  }

  body header.admin-style-header .admin-style-info {
    gap: 8px !important;
  }
}
/* End simulator admin-style header */


body header.admin-style-header a.admin-style-button {
  text-decoration: none !important;
  text-align: center !important;
}
