* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f4f6f9;
  color: #1c2d41;
  font:
    14px/1.55 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
textarea,
select {
  font: inherit;
}
button,
select {
  cursor: pointer;
}
button {
  border: 1px solid #d9e1eb;
  border-radius: 9px;
  background: #fff;
  padding: 9px 15px;
  color: #29425a;
}
button:hover {
  background: #edf3fa;
}
.primary {
  background: #265ec9;
  color: white;
  border-color: #265ec9;
  font-weight: 600;
}
.primary:hover {
  background: #1e4fae;
}
.shell {
  max-width: 1180px;
  margin: 24px auto;
  border: 1px solid #dce3ed;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 28px #213b6010;
  overflow: hidden;
}
header {
  padding: 19px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e9edf3;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mark {
  width: 38px;
  height: 38px;
  background: #e9effe;
  color: #285dcc;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
  border-radius: 11px;
}
h1 {
  font-size: 17px;
  letter-spacing: -0.3px;
  margin: 0;
}
header p {
  margin: 0;
  color: #6c7e91;
  font-size: 12px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.badge {
  font-size: 11px;
  background: #edf3fa;
  padding: 5px 10px;
  border-radius: 20px;
  color: #53718d;
}
.login-panel {
  padding: 54px 40px 60px;
  max-width: 760px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: #6b83a2;
}
.login-panel h2 {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -1px;
  margin: 10px 0;
}
.login-panel > p {
  font-size: 15px;
  max-width: 520px;
  color: #63738b;
}
.login-panel .primary {
  margin-top: 16px;
  padding: 12px 20px;
}
.login-panel .primary span {
  margin-left: 24px;
}
.muted,
details {
  font-size: 12px;
  color: #7a889a;
}
details {
  margin-top: 26px;
}
summary {
  cursor: pointer;
}
.toolbar {
  display: flex;
  gap: 10px;
  padding: 12px 24px;
  background: #fbfcfe;
  border-bottom: 1px solid #eef1f5;
  align-items: center;
}
.toolbar select {
  border: 0;
  background: transparent;
  color: #486179;
  max-width: 460px;
}
.spacer {
  flex: 1;
}
.waiting-bar {
  margin: 16px 24px 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff5e0;
  color: #89611f;
  font-size: 12px;
  align-items: center;
  gap: 8px;
}
.waiting-bar:not([hidden]) {
  display: flex;
}
.waiting-dot {
  width: 7px;
  height: 7px;
  background: #d5a542;
  border-radius: 50%;
}
.timeline {
  height: 450px;
  overflow: auto;
  padding: 28px 30px;
  scroll-behavior: auto;
  background: linear-gradient(#fff, #fbfcff);
}
.event {
  margin: 0 0 23px;
  max-width: 88%;
}
.event.employee {
  margin-left: auto;
  max-width: 75%;
}
.event.email {
  margin: 20px 0;
  max-width: 94%;
  border: 1px solid #e0e5ed;
  border-radius: 10px;
  padding: 14px;
  background: #fafbfc;
}
.byline {
  display: flex;
  gap: 10px;
  align-items: center;
  color: #677b92;
  font-size: 11px;
  margin-bottom: 7px;
}
.byline strong {
  color: #314962;
  font-size: 12px;
}
.message-body {
  border-radius: 10px;
  padding: 15px 18px;
  background: #f0f4fa;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.employee .message-body {
  background: #eaf1ff;
}
.assistant .message-body {
  white-space: normal;
  background: #fff;
  border: 1px solid #e0e7f1;
  box-shadow: 0 2px 6px #38568205;
}
.email .message-body {
  padding: 0;
  background: transparent;
}
.system .message-body {
  background: #fff7e8;
  color: #886226;
}
.message-body h2,
.message-body h3 {
  margin: 3px 0 10px;
  font-size: 15px;
  color: #243d5b;
}
.message-body p {
  margin: 0 0 10px;
}
.message-body p:last-child {
  margin-bottom: 0;
}
.message-body table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  white-space: normal;
  margin: 14px 0;
  border: 1px solid #e1e7f0;
}
.message-body th {
  text-align: left;
  background: #f5f7fb;
  color: #71829a;
  font-size: 10px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 9px 12px;
}
.message-body td {
  padding: 10px 12px;
  border-top: 1px solid #e5ebf4;
}
.message-body .proposal-header {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #e5ebf4;
}
.message-body .proposal-tabs {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid #dfe7f3;
  padding: 9px 0;
  margin-bottom: 12px;
  color: #466cac;
  font-size: 12px;
}
.message-body .proposal-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.message-body .label {
  font-size: 10px;
  color: #798da5;
  text-transform: uppercase;
}
.message-body .total {
  text-align: right;
  font-weight: 650;
  color: #355471;
}
.message-body details {
  color: inherit;
}
form {
  margin: 0 24px 10px;
  border: 1px solid #d6dfec;
  border-radius: 10px;
  box-shadow: 0 2px 6px #304d6b05;
}
textarea {
  width: 100%;
  padding: 15px;
  border: 0;
  outline: none;
  resize: vertical;
  min-height: 65px;
  background: transparent;
  color: #223b54;
}
.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 10px;
  color: #8b98aa;
  font-size: 10px;
}
.composer-footer .primary {
  font-size: 12px;
}
.footnote {
  margin: 0 24px 18px;
  color: #8a98aa;
  font-size: 10px;
}
.error {
  margin: 18px 24px;
  padding: 12px 16px;
  background: #fff0ef;
  border-radius: 8px;
  color: #9b3e3b;
}
.latest {
  display: block;
  margin: -16px auto 12px;
  position: relative;
  color: #2b61c0;
  background: #eaf1ff;
  border-color: #ccddff;
  font-size: 11px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 700px) {
  .shell {
    margin: 0;
    border-radius: 0;
    border-width: 0;
  }
  .login-panel {
    padding: 35px 24px;
  }
  .timeline {
    padding: 18px;
    height: 420px;
  }
  .event,
  .event.employee {
    max-width: 100%;
  }
  .toolbar {
    padding: 12px;
  }
  .header-right .badge {
    display: none;
  }
  .message-body .proposal-fields {
    grid-template-columns: 1fr;
  }
  .composer-footer span {
    display: none;
  }
  header {
    padding: 15px 18px;
  }
}

.shell {
  height: calc(100dvh - 48px);
  min-height: 560px;
  display: flex;
  flex-direction: column;
}
header,
.toolbar,
.waiting-bar,
form,
.footnote {
  flex-shrink: 0;
}
#workspace {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}
.timeline {
  height: auto;
  flex: 1;
  min-height: 180px;
}
.login-panel {
  overflow: auto;
}
.error {
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .shell {
    height: 100dvh;
    min-height: 480px;
  }
  .timeline {
    height: auto;
  }
}

.message-body .agent-fields {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 2fr;
  gap: 8px 16px;
  white-space: normal;
}
.message-body .agent-fields dt {
  font-size: 11px;
  color: #798da5;
}
.message-body .agent-fields dd {
  margin: 0;
}
.message-body a {
  color: #265ec9;
  text-decoration: underline;
}

/* Auth failures use the same visual language as the embedded conversation. */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  background:
    radial-gradient(ellipse at 25% 10%, #eaf0ff 0, transparent 55%), #f4f6f9;
}
.auth-shell {
  width: 100%;
  max-width: 640px;
  margin: 0;
  box-shadow: 0 18px 65px #213b6010;
}
.auth-content {
  padding: 38px 40px 32px;
}
.auth-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid #d7e3fb;
  border-radius: 15px;
  background: #f0f5ff;
  color: #315fc3;
  font-size: 29px;
  margin-bottom: 25px;
}
.auth-content h2 {
  margin: 9px 0 14px;
  font-size: 29px;
  line-height: 1.18;
  letter-spacing: -0.9px;
  font-weight: 650;
}
.auth-description {
  margin: 0;
  color: #63738b;
  font-size: 15px;
  line-height: 1.7;
}
.auth-actions {
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 28px;
}
a.button {
  display: inline-flex;
  gap: 22px;
  align-items: center;
  text-decoration: none;
  border-radius: 9px;
  padding: 12px 17px;
}
.auth-return {
  color: #4e6580;
  text-decoration: none;
  font-size: 13px;
}
.auth-return:hover {
  text-decoration: underline;
}
.auth-details {
  margin-top: 30px;
  padding-top: 19px;
  border-top: 1px solid #e9edf3;
  color: #708198;
}
.auth-details summary {
  font-weight: 500;
}
.auth-details p {
  font:
    12px/1.65 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  overflow-wrap: anywhere;
  padding: 13px 15px;
  border-radius: 8px;
  background: #f7f9fc;
  color: #516078;
}
.auth-footnote {
  margin: 24px 0 0;
  color: #8a96a6;
  font-size: 12px;
}
@media (max-width: 520px) {
  .auth-content {
    padding: 28px 24px;
  }
  .auth-content h2 {
    font-size: 25px;
  }
  .auth-shell header {
    padding: 18px 24px;
  }
  .auth-shell .badge {
    display: none;
  }
}
