:root {
  --chat-bg: #fffdf8;
  --chat-navy: #0a2149;
  --chat-gold: #d4a23a;
  --chat-gold-light: #f5e7c2;
  --chat-border: rgba(212, 162, 58, .22);
  --chat-text: #1a1a1a;
  --chat-muted: #666666;
  --chat-ivory: #fffaf0;
  --chat-white: #ffffff;
  --chat-green: #38a45b;
  --chat-shadow: 0 10px 28px rgba(86, 58, 20, .08);
}

* {
  box-sizing: border-box;
}

body.chat-page {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  color: var(--chat-text);
  background: var(--chat-bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.chat-page::before {
  display: none;
}

.chat-page [hidden] {
  display: none !important;
}

.chat-page button,
.chat-page input,
.chat-page select,
.chat-page textarea {
  font: inherit;
}

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

.chat-page-shell {
  min-height: 100dvh;
  overflow: hidden;
}

.chat-app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 320px;
  width: min(100%, 1720px);
  height: 100dvh;
  min-height: 680px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--chat-border);
  background: var(--chat-bg);
  box-shadow: 0 0 40px rgba(86, 58, 20, .04);
  animation: chat-page-in .36s ease both;
}

/* Left consultation navigation */
.chat-left-sidebar {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  padding: 30px 22px 24px;
  overflow-y: auto;
  border-right: 1px solid var(--chat-border);
  background: var(--chat-bg);
}

.chat-sidebar-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--chat-navy);
  text-decoration: none;
}

.chat-sidebar-brand img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 50%;
}

.chat-sidebar-brand strong,
.chat-sidebar-brand small {
  display: block;
}

.chat-sidebar-brand strong {
  font: 700 2rem/.9 "Cormorant Garamond", Georgia, serif;
  letter-spacing: .09em;
}

.chat-sidebar-brand small {
  margin-top: 8px;
  color: #b97812;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .28em;
}

.chat-sidebar-close {
  display: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--chat-border);
  border-radius: 10px;
  color: var(--chat-navy);
  background: var(--chat-white);
  font-size: 1.55rem;
}

.chat-sidebar-nav {
  display: grid;
  gap: 6px;
}

.chat-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 0 16px;
  border-left: 2px solid transparent;
  border-radius: 10px;
  color: var(--chat-text);
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.chat-sidebar-nav a span {
  display: grid;
  place-items: center;
  width: 24px;
  color: var(--chat-gold);
  font-size: 1.12rem;
}

.chat-sidebar-nav a:hover,
.chat-sidebar-nav a:focus-visible,
.chat-sidebar-nav a.is-active {
  border-left-color: var(--chat-gold);
  color: #9a6208;
  background: #fbf4e5;
  transform: translateX(2px);
}

.chat-sidebar-card {
  border: 1px solid var(--chat-border);
  border-radius: 14px;
  background: var(--chat-ivory);
  box-shadow: 0 5px 16px rgba(86, 58, 20, .045);
}

.chat-support-summary {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 13px;
  padding: 18px;
}

.chat-mini-logo,
.chat-agent-mark,
.chat-empty-symbol {
  flex: 0 0 auto;
  border: 1px solid var(--chat-border);
  border-radius: 50%;
  background-color: var(--chat-navy);
  background-image: url("./public/images/orion-brand-compass.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 158%;
}

.chat-mini-logo {
  width: 48px;
  height: 48px;
}

.chat-support-summary strong {
  color: var(--chat-navy);
  font-size: .88rem;
}

.chat-support-summary p {
  margin: 6px 0 12px;
  color: var(--chat-muted);
  font-size: .76rem;
  line-height: 1.55;
}

.chat-online-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 6px 10px;
  border: 1px solid rgba(56, 164, 91, .16);
  border-radius: 999px;
  color: #9b6308;
  background: #fff4da;
  font-size: .72rem;
  font-weight: 700;
}

.chat-online-badge i,
.chat-status-dot,
.chat-connection-label i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--chat-green);
  box-shadow: 0 0 0 3px rgba(56, 164, 91, .10);
}

.chat-privacy-card {
  margin-top: auto;
  padding: 22px 18px;
}

.chat-card-kicker {
  margin: 0 0 8px;
  color: #b97812;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.chat-privacy-card h2 {
  margin: 0;
  color: #a86a0b;
  font: 700 1.45rem/1.08 "Cormorant Garamond", Georgia, serif;
}

.chat-privacy-card > p:not(.chat-card-kicker) {
  margin: 14px 0 18px;
  color: var(--chat-muted);
  font-size: .8rem;
  line-height: 1.6;
}

.chat-privacy-card ul,
.chat-benefit-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.chat-privacy-card li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  border-top: 1px solid rgba(212, 162, 58, .13);
  color: var(--chat-muted);
  font-size: .78rem;
}

.chat-privacy-card li span {
  width: 20px;
  color: #bd790d;
  font-size: 1rem;
  text-align: center;
}

/* Center conversation */
.chat-center-panel {
  display: grid;
  grid-template-rows: 92px minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  background: var(--chat-bg);
}

.chat-window-header {
  position: relative;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--chat-border);
  color: var(--chat-text);
  background: var(--chat-bg);
}

.chat-window-identity {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.chat-mobile-nav-button,
.chat-back-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #a86a0b;
  background: transparent;
  font-size: 1.35rem;
  text-decoration: none;
  transition: background-color .18s ease, transform .18s ease;
}

.chat-mobile-nav-button {
  display: none;
}

.chat-back-button:hover,
.chat-mobile-nav-button:hover {
  background: var(--chat-gold-light);
  transform: translateY(-1px);
}

.chat-agent-mark {
  width: 54px;
  height: 54px;
}

.chat-header-copy h1 {
  margin: 0;
  color: var(--chat-navy);
  font: 700 1.12rem/1.1 Inter, sans-serif;
  letter-spacing: 0;
}

.chat-header-copy p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 7px 0 0;
  color: var(--chat-muted);
  font-size: .76rem;
}

.chat-window-icons {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #b97812;
  font-size: 1.25rem;
}

.chat-window-icons span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
}

.chat-window {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--chat-bg);
  box-shadow: none;
}

.chat-start-panel,
.chat-waiting-panel,
.chat-active-panel {
  height: 100%;
  min-height: 0;
}

.chat-start-panel.is-hidden,
.chat-waiting-panel.is-hidden,
.chat-active-panel.is-hidden {
  display: none !important;
}

.chat-waiting-panel {
  display: grid;
  place-items: center;
  padding: 34px;
  overflow-y: auto;
  background: var(--chat-bg);
}

.chat-waiting-card {
  width: min(100%, 420px);
  padding: 2rem 1.75rem;
  border: 1px solid var(--chat-border);
  border-radius: 18px;
  background: var(--chat-ivory);
  box-shadow: var(--chat-shadow);
  text-align: center;
}

.chat-waiting-card h2 {
  margin: 0.35rem 0 0.65rem;
  font-family: Georgia, serif;
  color: #0a2149;
  font-size: 1.35rem;
}

.chat-waiting-card p {
  margin: 0 0 0.75rem;
  color: rgba(10, 33, 73, 0.72);
  line-height: 1.55;
}

.chat-waiting-meta {
  font-size: 0.88rem;
  font-weight: 600;
  color: #0a2149 !important;
}

.chat-waiting-pulse {
  display: block;
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  border: 3px solid rgba(212, 162, 58, 0.35);
  border-top-color: #d4a23a;
  animation: chat-wait-spin 0.9s linear infinite;
}

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

.chat-free-timer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 0.75rem;
  align-items: center;
  width: 100%;
  margin: 0 0 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(212, 162, 58, 0.35);
  background: linear-gradient(135deg, rgba(10, 33, 73, 0.96), rgba(18, 48, 106, 0.94));
  color: #fff7e8;
}

.chat-free-timer-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}

.chat-free-timer-value {
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: #d4a23a;
}

.chat-free-timer-bar {
  grid-column: 1 / -1;
  display: block;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 247, 232, 0.15);
  overflow: hidden;
}

.chat-free-timer-bar i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d4a23a, #f0d48a);
  transition: width 0.25s linear;
}

.chat-free-timer.is-low {
  border-color: rgba(239, 68, 68, 0.45);
}

.chat-free-timer.is-low .chat-free-timer-value {
  color: #fca5a5;
}

.chat-free-timer.is-low .chat-free-timer-bar i {
  background: linear-gradient(90deg, #ef4444, #fbbf24);
}

.chat-free-timer.is-ended {
  opacity: 0.92;
}

.chat-free-timer.is-ended .chat-free-timer-value {
  color: #fca5a5;
}

.chat-start-panel {
  display: grid;
  place-items: center;
  padding: 34px;
  overflow-y: auto;
  background: var(--chat-bg);
}

.chat-onboarding {
  display: grid;
  grid-template-columns: minmax(230px, .9fr) minmax(290px, 1.1fr);
  gap: 34px;
  align-items: center;
  width: min(100%, 760px);
  padding: 34px;
  border: 1px solid var(--chat-border);
  border-radius: 18px;
  background: var(--chat-ivory);
  box-shadow: var(--chat-shadow);
}

.chat-empty-state {
  text-align: left;
}

.chat-empty-symbol {
  display: block;
  width: 72px;
  height: 72px;
  margin-bottom: 22px;
}

.chat-empty-state h2 {
  margin: 0;
  color: var(--chat-navy);
  font: 700 clamp(2rem, 4vw, 3rem)/.98 "Cormorant Garamond", Georgia, serif;
}

.chat-empty-state > p:not(.chat-card-kicker) {
  margin: 16px 0 0;
  color: var(--chat-muted);
  font-size: .88rem;
  line-height: 1.7;
}

.chat-start-form {
  display: grid;
  gap: 15px;
  padding: 24px;
  border: 1px solid var(--chat-border);
  border-radius: 14px;
  background: var(--chat-white);
}

.chat-start-form label {
  display: grid;
  gap: 7px;
  color: var(--chat-navy);
  font-size: .73rem;
  font-weight: 700;
}

.chat-start-form input,
.chat-start-form select {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid rgba(10, 33, 73, .13);
  border-radius: 10px;
  color: var(--chat-text);
  background: var(--chat-bg);
}

.chat-start-form input:focus,
.chat-start-form select:focus {
  outline: 0;
  border-color: var(--chat-gold);
  box-shadow: 0 0 0 3px rgba(212, 162, 58, .12);
}

.chat-start-form .button {
  min-height: 48px;
  margin-top: 2px;
  border-radius: 9px;
}

.chat-auth-status,
.chat-start-feedback {
  margin: 0;
  color: var(--chat-muted);
  font-size: .74rem;
  line-height: 1.45;
}

.chat-start-feedback:empty {
  display: none;
}

.chat-start-feedback.is-error,
.chat-auth-status.is-error {
  padding: 9px 10px;
  border: 1px solid rgba(180, 59, 59, .24);
  border-radius: 8px;
  color: #9a3030;
  background: #fff2f0;
}

/* Active conversation */
.chat-active-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  background: var(--chat-bg);
}

.chat-conversation-topbar {
  position: relative;
  z-index: 4;
  display: grid;
  gap: 9px;
  padding: 18px 28px 10px;
  background: var(--chat-bg);
}

.chat-today-divider {
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-today-divider::before,
.chat-today-divider::after {
  width: 64px;
  height: 1px;
  content: "";
  background: var(--chat-border);
}

.chat-today-divider span {
  margin: 0 12px;
  padding: 6px 15px;
  border: 1px solid var(--chat-border);
  border-radius: 999px;
  color: #a86a0b;
  background: var(--chat-white);
  font-size: .7rem;
  font-weight: 700;
}

.chat-conversation-privacy {
  max-width: 520px;
  margin: 0 auto;
  color: var(--chat-muted);
  font-size: .72rem;
  line-height: 1.5;
  text-align: center;
}

.chat-conversation-privacy span {
  margin-right: 6px;
  color: #b97812;
}

.chat-header-actions {
  position: absolute;
  top: 14px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-reference {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border: 1px solid var(--chat-border);
  border-radius: 8px;
  background: var(--chat-white);
  font-size: .65rem;
}

.chat-reference > span:first-child {
  display: none;
}

.chat-reference strong {
  color: var(--chat-navy);
  font-size: .67rem;
  letter-spacing: .04em;
}

.chat-reference button,
.chat-close-button {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--chat-border);
  border-radius: 7px;
  color: #9a6208;
  background: var(--chat-bg);
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
}

.chat-close-button {
  color: #8e3030;
  border-color: rgba(180, 59, 59, .20);
  background: #fff7f5;
}

.chat-reference-feedback {
  color: var(--chat-green);
  font-size: .62rem;
}

.chat-message-list,
.chat-messages {
  position: relative;
  min-height: 0;
  padding: 24px clamp(26px, 5vw, 64px) 18px;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--chat-bg);
  scroll-behavior: smooth;
}

.chat-message-list::before {
  position: absolute;
  top: 9%;
  right: -80px;
  width: 390px;
  height: 390px;
  content: "";
  opacity: .035;
  pointer-events: none;
  background-image: url("./public/images/orion-brand-compass.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 150%;
}

.chat-message-list::after {
  position: absolute;
  right: 18%;
  bottom: 12%;
  content: "\2726  \00b7  \2727";
  color: rgba(212, 162, 58, .14);
  font-size: 1rem;
  letter-spacing: 1rem;
  pointer-events: none;
}

.chat-live-messages {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
}

.chat-message {
  position: relative;
  display: grid;
  width: fit-content;
  max-width: min(72%, 620px);
  animation: chat-message-in .24s ease both;
}

.chat-message-admin {
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 10px;
  justify-self: start;
}

.chat-message-admin::before {
  grid-column: 1;
  grid-row: 1 / span 3;
  width: 40px;
  height: 40px;
  content: "";
  border-radius: 50%;
  background-color: var(--chat-navy);
  background-image: url("./public/images/orion-brand-compass.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 158%;
  box-shadow: 0 4px 10px rgba(10, 33, 73, .12);
}

.chat-message-user {
  justify-self: end;
  text-align: left;
}

.chat-message-bubble {
  grid-column: 2;
  margin: 0;
  padding: 13px 16px;
  color: var(--chat-text);
  font-size: .87rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-message-admin .chat-message-bubble {
  border: 1px solid var(--chat-border);
  border-radius: 15px 15px 15px 4px;
  background: var(--chat-white);
  box-shadow: 0 7px 18px rgba(86, 58, 20, .065);
}

.chat-message-user .chat-message-bubble {
  grid-column: 1;
  border: 1px solid rgba(212, 162, 58, .30);
  border-radius: 15px 15px 4px 15px;
  background: #fff2d3;
  box-shadow: 0 6px 15px rgba(86, 58, 20, .055);
}

.chat-message-time {
  margin-top: 5px;
  color: #858585;
  font-size: .63rem;
}

.chat-message-admin .chat-message-time {
  grid-column: 2;
  padding-left: 4px;
}

.chat-message-user .chat-message-time {
  justify-self: end;
  padding-right: 4px;
}

.chat-message-attachment {
  display: block;
  margin-top: 7px;
  border: 1px solid var(--chat-border);
  border-radius: 10px;
  color: var(--chat-navy);
  background: var(--chat-white);
  text-decoration: none;
  overflow: hidden;
}

.chat-message-attachment img {
  display: block;
  max-width: min(320px, 100%);
  max-height: 260px;
  object-fit: cover;
}

.chat-live-empty {
  margin: auto;
  padding: 14px 16px;
  border: 1px solid var(--chat-border);
  border-radius: 10px;
  color: var(--chat-muted);
  background: var(--chat-white);
  font-size: .8rem;
}

.chat-live-empty.is-error {
  color: #9a3030;
  border-color: rgba(180, 59, 59, .24);
  background: #fff2f0;
}

.chat-typing-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  padding: 2px 24px;
  color: var(--chat-muted);
  background: var(--chat-bg);
  font-size: .64rem;
}

.chat-connection-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chat-send-status {
  padding: 0;
  border: 0;
  color: var(--chat-muted);
  background: transparent;
  font-size: .68rem;
  text-align: left;
}

.chat-send-status.is-error {
  color: #a33a36;
  cursor: pointer;
}

.chat-sensitive-notice {
  margin: 0;
  padding: 7px 24px 8px;
  color: #898989;
  background: var(--chat-bg);
  font-size: .58rem;
  line-height: 1.45;
  text-align: center;
}

/* Composer */
.chat-composer {
  position: relative;
  z-index: 8;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 52px;
  gap: 10px;
  align-items: center;
  margin: 0 18px 18px;
  padding: 10px 12px;
  border: 1px solid var(--chat-border);
  border-radius: 16px;
  background: var(--chat-ivory);
  box-shadow: 0 -3px 18px rgba(86, 58, 20, .055);
}

.chat-attachment-controls {
  position: relative;
  min-width: 0;
}

.chat-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.chat-attach-button,
.chat-action--send {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 12px;
}

.chat-attach-button {
  border: 1px solid var(--chat-border);
  color: #a86a0b;
  background: var(--chat-bg) !important;
}

.chat-attach-button > span,
.chat-action--send > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.chat-action-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-message-field {
  position: relative;
  min-width: 0;
}

.chat-message-field textarea {
  display: block;
  width: 100%;
  height: 50px;
  min-height: 50px;
  max-height: 112px;
  padding: 14px 70px 10px 16px;
  overflow-y: auto;
  resize: none;
  border: 1px solid rgba(10, 33, 73, .11);
  border-radius: 12px;
  color: var(--chat-text);
  background: var(--chat-white);
  font-size: .84rem;
  line-height: 1.45;
}

.chat-message-field textarea:focus {
  outline: 0;
  border-color: var(--chat-gold);
  box-shadow: 0 0 0 3px rgba(212, 162, 58, .11);
}

.chat-character-count {
  position: absolute;
  right: 12px;
  bottom: 8px;
  color: #999;
  font-size: .56rem;
  pointer-events: none;
}

.chat-action--send {
  border: 1px solid var(--chat-gold);
  color: #fff;
  background: linear-gradient(135deg, #c48719, #e1b654) !important;
  box-shadow: 0 7px 15px rgba(212, 162, 58, .22);
  transition: transform .18s ease, box-shadow .18s ease;
}

.chat-action--send:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(212, 162, 58, .28);
}

.chat-attach-button:disabled,
.chat-action--send:disabled {
  cursor: not-allowed;
  opacity: .42;
  box-shadow: none;
}

.chat-attachment-preview {
  position: absolute;
  left: 0;
  bottom: calc(100% + 14px);
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(440px, calc(100vw - 54px));
  padding: 10px;
  border: 1px solid var(--chat-border);
  border-radius: 10px;
  background: var(--chat-white);
  box-shadow: var(--chat-shadow);
}

.chat-attachment-preview > span {
  min-width: 0;
  overflow: hidden;
  color: var(--chat-muted);
  font-size: .68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-attachment-preview button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--chat-border);
  border-radius: 7px;
  color: var(--chat-navy);
  background: var(--chat-bg) !important;
  font-size: .62rem;
}

/* Right guidance panel */
.chat-right-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 42px 28px 28px;
  overflow-y: auto;
  border-left: 1px solid var(--chat-border);
  background: var(--chat-bg);
  text-align: center;
}

.chat-right-emblem {
  width: 138px;
  height: 138px;
  margin-bottom: 26px;
  border-radius: 50%;
  background-image: url("./public/images/orion-brand-compass.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 150%;
}

.chat-right-sidebar h2 {
  margin: 0;
  color: var(--chat-navy);
  font: 700 2.25rem/1 "Cormorant Garamond", Georgia, serif;
}

.chat-ornament {
  display: flex;
  align-items: center;
  width: 160px;
  margin: 18px 0;
}

.chat-ornament::before,
.chat-ornament::after {
  flex: 1;
  height: 1px;
  content: "";
  background: var(--chat-border);
}

.chat-ornament span {
  width: 9px;
  height: 9px;
  margin: 0 9px;
  border: 1px solid var(--chat-gold);
  transform: rotate(45deg);
}

.chat-right-intro {
  max-width: 250px;
  margin: 0 0 26px;
  color: var(--chat-muted);
  font-size: .82rem;
  line-height: 1.7;
}

.chat-benefit-list {
  width: 100%;
  text-align: left;
}

.chat-benefit-list li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
  padding: 15px 4px;
  border-bottom: 1px solid rgba(212, 162, 58, .16);
}

.chat-benefit-list li > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--chat-border);
  border-radius: 50%;
  color: #b97812;
  background: var(--chat-white);
}

.chat-benefit-list strong,
.chat-benefit-list small {
  display: block;
}

.chat-benefit-list strong {
  color: var(--chat-navy);
  font: 700 1rem/1.2 "Cormorant Garamond", Georgia, serif;
}

.chat-benefit-list small {
  margin-top: 4px;
  color: var(--chat-muted);
  font-size: .68rem;
  line-height: 1.35;
}

.chat-quote-card {
  width: 100%;
  margin: auto 0 0;
  padding: 24px 18px 18px;
  border: 1px solid var(--chat-border);
  border-radius: 12px;
  color: var(--chat-navy);
  background: var(--chat-ivory);
  font: 600 1.15rem/1.45 "Cormorant Garamond", Georgia, serif;
}

.chat-quote-card span {
  display: block;
  margin-top: 12px;
  color: var(--chat-gold);
  font-size: .85rem;
}

.chat-sidebar-backdrop {
  display: none;
}

@keyframes chat-page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes chat-message-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1279px) {
  .chat-app-shell {
    grid-template-columns: 290px minmax(0, 1fr) 290px;
  }

  .chat-left-sidebar {
    padding-inline: 18px;
  }

  .chat-sidebar-brand img {
    width: 62px;
    height: 62px;
  }

  .chat-sidebar-brand strong {
    font-size: 1.75rem;
  }

  .chat-right-sidebar {
    padding-inline: 22px;
  }
}

@media (max-width: 1023px) {
  body.chat-page {
    overflow: hidden;
  }

  .chat-app-shell {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-height: 0;
    border: 0;
  }

  .chat-left-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 220;
    width: min(320px, 88vw);
    transform: translateX(-105%);
    box-shadow: 18px 0 40px rgba(10, 33, 73, .14);
    transition: transform .22s ease;
  }

  body.chat-sidebar-open .chat-left-sidebar {
    transform: translateX(0);
  }

  .chat-sidebar-close,
  .chat-mobile-nav-button {
    display: grid;
    place-items: center;
  }

  .chat-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 210;
    display: block;
    visibility: hidden;
    border: 0;
    opacity: 0;
    background: rgba(10, 33, 73, .28);
    transition: opacity .22s ease, visibility .22s ease;
  }

  body.chat-sidebar-open .chat-sidebar-backdrop {
    visibility: visible;
    opacity: 1;
  }

  .chat-right-sidebar {
    display: none;
  }

  .chat-center-panel {
    width: 100%;
  }

  .chat-onboarding {
    width: min(100%, 780px);
  }
}

@media (max-width: 680px) {
  .chat-center-panel {
    grid-template-rows: 76px minmax(0, 1fr);
  }

  .chat-window-header {
    min-height: 76px;
    padding: 10px 12px;
  }

  .chat-window-identity {
    gap: 8px;
  }

  .chat-back-button,
  .chat-mobile-nav-button {
    width: 36px;
    height: 36px;
  }

  .chat-agent-mark {
    width: 44px;
    height: 44px;
  }

  .chat-header-copy h1 {
    font-size: .95rem;
  }

  .chat-header-copy p {
    margin-top: 5px;
    font-size: .65rem;
  }

  .chat-window-icons {
    gap: 2px;
  }

  .chat-window-icons span {
    width: 28px;
    height: 32px;
  }

  .chat-start-panel {
    align-items: start;
    padding: 16px 12px;
  }

  .chat-onboarding {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 22px 18px;
  }

  .chat-empty-symbol {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
  }

  .chat-empty-state h2 {
    font-size: 2.15rem;
  }

  .chat-start-form {
    padding: 18px;
  }

  .chat-conversation-topbar {
    padding: 12px 10px 8px;
  }

  .chat-today-divider {
    justify-content: flex-start;
  }

  .chat-today-divider::before,
  .chat-today-divider::after {
    display: none;
  }

  .chat-today-divider span {
    margin: 0;
  }

  .chat-conversation-privacy {
    margin: 0;
    max-width: calc(100% - 118px);
    text-align: left;
  }

  .chat-header-actions {
    top: 11px;
    right: 10px;
  }

  .chat-reference {
    display: none;
  }

  .chat-close-button {
    min-height: 32px;
  }

  .chat-message-list,
  .chat-messages {
    padding: 16px 12px 12px;
  }

  .chat-message-list::before {
    right: -150px;
    width: 300px;
    height: 300px;
  }

  .chat-message {
    max-width: 88%;
  }

  .chat-message-admin {
    grid-template-columns: 34px minmax(0, 1fr);
    column-gap: 8px;
  }

  .chat-message-admin::before {
    width: 34px;
    height: 34px;
  }

  .chat-message-bubble {
    padding: 11px 13px;
    font-size: .82rem;
  }

  .chat-typing-status {
    padding-inline: 12px;
  }

  .chat-sensitive-notice {
    display: none;
  }

  .chat-composer {
    grid-template-columns: 44px minmax(0, 1fr) 48px;
    gap: 7px;
    margin: 0;
    padding: 9px max(9px, env(safe-area-inset-right)) max(9px, env(safe-area-inset-bottom)) max(9px, env(safe-area-inset-left));
    border-width: 1px 0 0;
    border-radius: 0;
  }

  .chat-attach-button {
    width: 44px;
    height: 48px;
  }

  .chat-action--send {
    width: 48px;
    height: 48px;
  }

  .chat-message-field textarea {
    padding-right: 16px;
  }

  .chat-character-count {
    display: none;
  }

  .chat-attachment-preview {
    left: -2px;
    width: calc(100vw - 18px);
  }
}

@media (max-width: 420px) {
  .chat-window-icons span:first-child {
    display: none;
  }

  .chat-header-copy h1 {
    font-size: .88rem;
  }

  .chat-message {
    max-width: 92%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-app-shell,
  .chat-message {
    animation: none;
  }

  .chat-left-sidebar,
  .chat-sidebar-backdrop,
  .chat-sidebar-nav a,
  .chat-action--send {
    transition: none;
  }
}
