:root {
  --background: #181818;
  --surface: rgba(36, 36, 35, 0.92);
  --gold: #c79b42;
  --gold-light: #e6c97a;
  --gold-dark: #8b6225;
  --silver: #e9e9e9;
  --muted: #aeb1b5;
  --line: rgba(199, 155, 66, 0.28);
  --success: #8fc89a;
  --danger: #e8a39d;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--background);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 12%, rgba(199, 155, 66, 0.13), transparent 32rem),
    radial-gradient(circle at 90% 88%, rgba(233, 233, 233, 0.07), transparent 34rem),
    var(--background);
  color: var(--silver);
  font-family: var(--font-space-grotesk), "Helvetica Neue", sans-serif;
}

button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
form { margin: 0; }

.ssl-warning {
  position: relative;
  z-index: 50;
  padding: 0.72rem 1rem;
  border-bottom: 1px solid rgba(232, 163, 157, 0.45);
  background: #3a211f;
  color: #ffd2ce;
  font-size: 0.78rem;
  font-weight: 650;
  text-align: center;
}

.is-hidden { display: none !important; }
.single-card { grid-template-columns: minmax(20rem, 32rem); justify-content: center; }
.single-card .login-card h1 {
  margin: 1rem 0;
  font-family: Georgia, serif;
  font-size: 2.2rem;
  font-weight: 500;
}

.chat-login-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  overflow: hidden;
}

.chat-login-card {
  position: relative;
  z-index: 2;
  width: min(100%, 27rem);
  padding: clamp(2rem, 5vw, 3.2rem);
}

.chat-login-card .brand-mark {
  margin: 0 auto;
}

.chat-login-card .eyebrow {
  margin-top: 1.6rem;
  text-align: center;
}

.chat-login-card h1 {
  margin: 0;
  font-family: var(--font-cinzel), Georgia, serif;
  font-size: 2.2rem;
  font-weight: 500;
  text-align: center;
}

.lumyrax-mark {
  border-color: rgba(233, 233, 233, 0.48);
  background: linear-gradient(145deg, rgba(233, 233, 233, 0.12), rgba(199, 155, 66, 0.05));
  color: var(--silver);
}

.chat-shell {
  min-height: 100vh;
}

.chat-header {
  min-height: 4.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  border-bottom: 1px solid rgba(199, 155, 66, 0.16);
  background: rgba(18, 18, 18, 0.82);
}

.chat-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.chat-brand strong {
  font-family: var(--font-cinzel), Georgia, serif;
  font-weight: 500;
}

.chat-surface {
  min-height: calc(100vh - 4.8rem);
  display: grid;
  place-items: center;
}

.chat-surface h1 {
  font-family: var(--font-cinzel), Georgia, serif;
  font-weight: 500;
}

.ambient {
  position: fixed;
  pointer-events: none;
  width: 32rem;
  height: 32rem;
  border-radius: 50%;
  opacity: 0.75;
}

.ambient-one {
  top: -16rem;
  left: -12rem;
  background: radial-gradient(circle, rgba(199, 155, 66, 0.21), transparent 70%);
}

.ambient-two {
  right: -15rem;
  bottom: -17rem;
  background: radial-gradient(circle, rgba(233, 233, 233, 0.11), transparent 70%);
}

.login-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(28rem, 0.75fr);
  align-items: center;
  gap: clamp(4rem, 9vw, 10rem);
  max-width: 78rem;
  margin: 0 auto;
  padding: 4rem;
  overflow: hidden;
}

.login-brand { position: relative; z-index: 1; }

.brand-mark {
  width: 4.8rem;
  height: 4.8rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(230, 201, 122, 0.12), rgba(139, 98, 37, 0.06));
  color: var(--gold-light);
  font-family: var(--font-cinzel), Georgia, serif;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: 0 0 0 8px rgba(199, 155, 66, 0.045), 0 18px 50px rgba(0, 0, 0, 0.28);
}

.brand-mark.small {
  width: 2.8rem;
  height: 2.8rem;
  font-size: 0.8rem;
  box-shadow: none;
}

.eyebrow, .panel-kicker {
  margin: 1.75rem 0 0.6rem;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-brand h1, .sidebar h1, .workspace-heading h2 {
  margin: 0;
  font-family: var(--font-cinzel), Georgia, serif;
  font-weight: 500;
}

.login-brand h1 {
  max-width: 9ch;
  font-size: clamp(3.4rem, 7vw, 6.4rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
}

.login-intro {
  max-width: 34rem;
  margin: 1.8rem 0 2.2rem;
  color: var(--muted);
  font-size: 1.07rem;
  line-height: 1.7;
}

.security-note {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.security-note strong, .security-note span { display: block; }
.security-note strong { margin-bottom: 0.2rem; color: var(--silver); }
.security-icon { color: var(--gold); font-size: 1rem; }

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 45%),
    var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(18px);
}

.login-card {
  position: relative;
  z-index: 2;
  padding: clamp(2rem, 4vw, 3.3rem);
}

.login-card h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font-cinzel), Georgia, serif;
  font-size: 1.75rem;
  font-weight: 500;
}

.login-card > p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.panel-kicker { margin-top: 0; }
.login-form { display: grid; gap: 1.2rem; margin-top: 2rem; }
.field { display: grid; gap: 0.48rem; }

.field > span:first-child {
  color: #d5d6d8;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.field input {
  width: 100%;
  min-height: 3.15rem;
  padding: 0.78rem 0.95rem;
  border: 1px solid rgba(199, 155, 66, 0.32);
  border-radius: 12px;
  outline: none;
  background: rgba(9, 9, 9, 0.42);
  color: var(--silver);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input:hover { border-color: rgba(199, 155, 66, 0.55); }

.field input:focus {
  border-color: var(--gold);
  background: rgba(9, 9, 9, 0.58);
  box-shadow: 0 0 0 3px rgba(199, 155, 66, 0.1);
}

.field input:disabled {
  cursor: not-allowed;
  color: #888;
  border-color: rgba(255, 255, 255, 0.09);
}

.field input::placeholder { color: #737373; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 4rem; }

.reveal-button {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--gold-light);
  font-size: 0.72rem;
  cursor: pointer;
}

.button {
  min-height: 2.85rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease, border-color 150ms ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.button:disabled { cursor: wait; opacity: 0.6; }

.button.primary {
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 52%, var(--gold-dark));
  color: #17120a;
  box-shadow: 0 12px 26px rgba(139, 98, 37, 0.23);
}

.button.secondary {
  border-color: rgba(199, 155, 66, 0.5);
  background: rgba(199, 155, 66, 0.08);
  color: var(--gold-light);
}

.button.ghost { border-color: rgba(255, 255, 255, 0.12); background: transparent; color: var(--muted); }
.button.full { width: 100%; }
.button.compact { min-height: 2.25rem; padding: 0.5rem 1rem; font-size: 0.73rem; }
.form-message { padding: 0.8rem 1rem; border-radius: 10px; font-size: 0.8rem; }

.form-message.error {
  border: 1px solid rgba(232, 163, 157, 0.32);
  background: rgba(232, 163, 157, 0.08);
  color: var(--danger);
}

.form-message.success {
  border: 1px solid rgba(143, 200, 154, 0.3);
  background: rgba(143, 200, 154, 0.08);
  color: var(--success);
}

.admin-shell { min-height: 100vh; }

.admin-header {
  height: 4.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.25rem;
  border-bottom: 1px solid rgba(199, 155, 66, 0.16);
  background: rgba(18, 18, 18, 0.8);
  backdrop-filter: blur(18px);
}

.brand-lockup, .account-area { display: flex; align-items: center; gap: 0.9rem; }
.brand-lockup span, .brand-lockup strong { display: block; }

.brand-lockup span {
  color: var(--gold);
  font-size: 0.59rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-lockup strong {
  margin-top: 0.1rem;
  font-family: var(--font-cinzel), Georgia, serif;
  font-size: 0.93rem;
  font-weight: 500;
}

.account-area { color: var(--muted); font-size: 0.75rem; }
.account-area strong { color: var(--silver); }

.admin-grid {
  min-height: calc(100vh - 4.8rem);
  display: grid;
  grid-template-columns: 19rem minmax(0, 1fr);
}

.sidebar {
  padding: 2rem 1.25rem;
  border-right: 1px solid rgba(199, 155, 66, 0.14);
  background: rgba(20, 20, 20, 0.48);
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.55rem 1.3rem;
}

.sidebar-heading .eyebrow { margin: 0 0 0.35rem; }
.sidebar h1 { font-size: 1.65rem; }

.icon-button {
  width: 2.45rem;
  height: 2.45rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: rgba(199, 155, 66, 0.08);
  color: var(--gold-light);
  font-size: 1.35rem;
  cursor: pointer;
}

.create-card {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 14px;
}

.create-card h2 {
  margin: 0 0 0.2rem;
  font-family: var(--font-cinzel), Georgia, serif;
  font-size: 1rem;
  font-weight: 500;
}

.compact-field { gap: 0.3rem; }
.compact-field input { min-height: 2.55rem; padding: 0.55rem 0.7rem; font-size: 0.78rem; }
.user-list { display: grid; gap: 0.4rem; }

.user-row {
  width: 100%;
  display: grid;
  grid-template-columns: 2.55rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.68rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.user-row:hover { background: rgba(255, 255, 255, 0.025); }

.user-row.selected {
  border-color: rgba(199, 155, 66, 0.32);
  background: linear-gradient(90deg, rgba(199, 155, 66, 0.12), rgba(199, 155, 66, 0.025));
}

.avatar {
  width: 2.55rem;
  height: 2.55rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(199, 155, 66, 0.35);
  border-radius: 50%;
  background: rgba(199, 155, 66, 0.08);
  color: var(--gold-light);
  font-size: 0.69rem;
  font-weight: 700;
}

.avatar.inactive { filter: grayscale(1); opacity: 0.55; }
.user-copy { min-width: 0; }
.user-copy strong, .user-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: 0.8rem; }
.user-copy small { margin-top: 0.18rem; color: var(--muted); font-size: 0.67rem; }
.status-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #696969; }
.status-dot.online { background: var(--success); box-shadow: 0 0 0 4px rgba(143, 200, 154, 0.08); }

.workspace {
  width: 100%;
  max-width: 76rem;
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 4rem);
}

.workspace-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.7rem;
}

.workspace-heading .eyebrow { margin: 0 0 0.5rem; }
.workspace-heading h2 { font-size: clamp(2rem, 4vw, 3.1rem); }
.workspace-heading p { margin: 0.45rem 0 0; color: var(--muted); font-size: 0.8rem; }

.status-badge {
  flex: 0 0 auto;
  padding: 0.48rem 0.8rem;
  border: 1px solid;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
}

.status-badge.active {
  border-color: rgba(143, 200, 154, 0.38);
  background: rgba(143, 200, 154, 0.08);
  color: var(--success);
}

.status-badge.disabled { border-color: rgba(255, 255, 255, 0.12); color: var(--muted); }
.status-badge.mini { margin-left: auto; padding: 0.35rem 0.65rem; font-size: 0.6rem; }
.settings-panel { margin-top: 1rem; padding: clamp(1.4rem, 3vw, 2rem); }
.section-title > div, .connected-heading > div { display: flex; align-items: flex-start; gap: 0.9rem; }
.section-number { color: var(--gold); font-family: var(--font-cinzel), Georgia, serif; font-size: 0.78rem; }

.section-title h3, .connected-heading h3, .service-card h3 {
  margin: 0;
  font-family: var(--font-cinzel), Georgia, serif;
  font-weight: 500;
}

.section-title p, .connected-heading p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.73rem; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.7rem;
}

.switch-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.15rem;
  padding-top: 1.15rem;
  cursor: pointer;
}

.switch-field input { position: absolute; opacity: 0; }

.switch {
  position: relative;
  width: 2.65rem;
  height: 1.42rem;
  border-radius: 999px;
  background: #4c4c4b;
  transition: background 150ms ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 0.2rem;
  left: 0.22rem;
  width: 1.02rem;
  height: 1.02rem;
  border-radius: 50%;
  background: #c9c9c7;
  transition: transform 150ms ease;
}

.switch-field input:checked + .switch { background: var(--gold-dark); }
.switch-field input:checked + .switch::after { transform: translateX(1.18rem); background: var(--gold-light); }
.switch-field strong, .switch-field small { display: block; }
.switch-field strong { font-size: 0.77rem; }
.switch-field small { margin-top: 0.14rem; color: var(--muted); font-size: 0.66rem; }

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.connected-heading { margin: 2.1rem 0 1.05rem; }
.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.service-card { padding: 1.35rem; }
.service-top { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.35rem; }

.service-icon {
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--gold);
  border-radius: 10px;
  background: rgba(199, 155, 66, 0.09);
  color: var(--gold-light);
  font-family: var(--font-cinzel), Georgia, serif;
  font-size: 0.7rem;
  font-weight: 700;
}

.service-icon.silver {
  border-color: rgba(233, 233, 233, 0.38);
  background: rgba(233, 233, 233, 0.06);
  color: var(--silver);
}

.service-card h3 { font-size: 0.93rem; }
.service-card .service-top p { margin: 0.23rem 0 0; color: var(--muted); font-size: 0.62rem; }
.service-card > .field + .field { margin-top: 1rem; }

.service-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.encrypted-note { color: var(--muted); font-size: 0.62rem; }
.loading-screen, .empty-state { min-height: 60vh; display: grid; place-items: center; align-content: center; gap: 1.5rem; color: var(--muted); }
.loading-screen p { font-size: 0.8rem; }
.empty-state { min-height: 24rem; }
.empty-state h3 { margin: 0; font-family: var(--font-cinzel), Georgia, serif; color: var(--silver); }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; gap: 3rem; padding: 3rem 1.5rem; }
  .login-brand h1 { font-size: 4rem; }
  .admin-grid { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid rgba(199, 155, 66, 0.14); }
  .user-list { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
}

@media (max-width: 680px) {
  .admin-header { height: auto; padding: 1rem; }
  .account-area > span { display: none; }
  .workspace { padding: 2rem 1rem; }
  .workspace-heading { align-items: flex-start; }
  .settings-grid, .service-grid { grid-template-columns: 1fr; }
  .form-actions { justify-content: stretch; }
  .form-actions .button { width: 100%; }
  .service-top { flex-wrap: wrap; }
  .status-badge.mini { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Chat workspace */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chat-body {
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% -8%, rgba(199, 155, 66, 0.12), transparent 31rem),
    #141414;
}

.chat-body textarea,
.chat-body select {
  font: inherit;
}

.chat-body textarea {
  resize: vertical;
}

.chat-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: 4.55rem auto minmax(0, 1fr);
}

.chat-header {
  min-height: 4.55rem;
  gap: 2rem;
  padding: 0 1.4rem;
  border-bottom-color: rgba(255, 255, 255, 0.07);
  background: rgba(17, 17, 17, 0.94);
  backdrop-filter: blur(18px);
}

.chat-brand {
  flex: 0 0 auto;
}

.chat-brand > div:last-child strong,
.chat-brand > div:last-child span {
  display: block;
}

.chat-brand > div:last-child strong {
  font-size: 0.93rem;
  letter-spacing: 0.01em;
}

.chat-brand > div:last-child span {
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.chat-source-strip {
  display: flex;
  align-items: center;
  gap: 0.48rem;
  margin-right: auto;
}

.chat-source {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 1.75rem;
  padding: 0 0.62rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: #7e8083;
  font-size: 0.61rem;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.chat-source i,
.platform-state {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: #555;
}

.chat-source.configured {
  color: #c3b998;
  border-color: rgba(199, 155, 66, 0.22);
}

.chat-source.configured i,
.platform-state.configured {
  background: var(--gold);
}

.chat-source.connected {
  color: var(--success);
  border-color: rgba(143, 200, 154, 0.22);
}

.chat-source.connected i,
.platform-state.connected {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(143, 200, 154, 0.08);
}

.chat-header-actions,
.chat-account,
.traffic-legend,
.traffic-value {
  display: flex;
  align-items: center;
}

.chat-header-actions {
  flex: 0 0 auto;
  gap: 1.25rem;
}

.chat-account {
  gap: 0.75rem;
  padding-left: 1.15rem;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-account > span {
  color: #c8c8c8;
  font-size: 0.7rem;
  font-weight: 650;
}

.traffic-legend {
  gap: 0.95rem;
}

.traffic-value {
  position: relative;
  gap: 0.18rem;
  padding-left: 0.7rem;
}

.traffic-value i {
  position: absolute;
  left: 0;
  width: 0.36rem;
  height: 0.36rem;
  border-radius: 50%;
}

.traffic-in i { background: #75bd85; }
.traffic-out i { background: #db7770; }
.traffic-value strong { font-size: 0.76rem; }
.traffic-value small { color: var(--muted); font-size: 0.65rem; }
.traffic-value em {
  margin-left: 0.18rem;
  color: #696b6e;
  font-size: 0.55rem;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
}

.chat-notice {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(232, 163, 157, 0.22);
  background: rgba(87, 39, 35, 0.8);
  color: #f2b9b4;
  font-size: 0.7rem;
  text-align: center;
}

.chat-notice.success {
  border-bottom-color: rgba(143, 200, 154, 0.24);
  background: rgba(35, 72, 44, 0.8);
  color: var(--success);
}

.chat-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(15rem, 19rem) minmax(15rem, 20rem) minmax(28rem, 1fr);
  grid-template-areas: "customer profile conversation";
  gap: 0;
}

.chat-rail {
  min-height: 0;
  padding: 1rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(199, 155, 66, 0.28) transparent;
  background: rgba(18, 18, 18, 0.62);
}

.chat-rail-left {
  grid-area: customer;
  border-right: 1px solid rgba(255, 255, 255, 0.065);
}

.chat-rail-right {
  grid-area: profile;
  border-right: 1px solid rgba(255, 255, 255, 0.065);
}

.chat-card {
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 42%),
    rgba(30, 30, 29, 0.78);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.14);
}

.chat-card + .chat-card {
  margin-top: 0.75rem;
}

.chat-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.chat-card-heading h1,
.chat-card-heading h2 {
  margin: 0;
  font-family: var(--font-cinzel), Georgia, serif;
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.25;
}

.chat-card-heading h2 {
  font-size: 0.91rem;
}

.compact-heading {
  align-items: center;
  margin-bottom: 0.9rem;
}

.chat-overline {
  margin: 0 0 0.28rem;
  color: var(--gold);
  font-size: 0.57rem;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.source-pill {
  max-width: 8rem;
  padding: 0.28rem 0.48rem;
  overflow: hidden;
  border: 1px solid rgba(199, 155, 66, 0.23);
  border-radius: 999px;
  color: #c5b98d;
  font-size: 0.54rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-facts {
  display: grid;
  gap: 0;
  margin: 0.85rem 0 0;
}

.profile-config {
  position: relative;
  margin: -1.55rem 0 0 auto;
  width: max-content;
}

.profile-config summary {
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(199, 155, 66, 0.35);
  border-radius: 50%;
  color: var(--gold-light);
  font-size: 0.65rem;
  cursor: pointer;
  list-style: none;
}

.profile-config summary::-webkit-details-marker {
  display: none;
}

.profile-config dl {
  position: absolute;
  z-index: 12;
  top: 1.7rem;
  right: 0;
  width: 17rem;
  max-height: 20rem;
  margin: 0;
  padding: 0.8rem;
  overflow: auto;
  border: 1px solid rgba(199, 155, 66, 0.28);
  border-radius: 10px;
  background: #181817;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.45);
}

.profile-config dl > div {
  display: grid;
  grid-template-columns: minmax(5rem, 0.75fr) minmax(0, 1.25fr);
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-config dt,
.profile-config dd {
  margin: 0;
  font-size: 0.58rem;
}

.profile-config dt { color: #85878a; }
.profile-config dd { color: #d1d1d1; }

.profile-section {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.profile-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0.9rem 0 0.6rem;
}

.profile-tabs button {
  flex: 1;
  min-height: 1.9rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.2);
  color: #888a8d;
  font-size: 0.57rem;
  cursor: pointer;
}

.profile-tabs button.active {
  border-color: rgba(199, 155, 66, 0.42);
  color: var(--gold-light);
  background: rgba(199, 155, 66, 0.1);
}

.profile-tabs button span {
  margin-left: 0.35rem;
  padding: 0.08rem 0.32rem;
  border-radius: 999px;
  background: #783e3e;
  color: #fff;
}

.profile-fact {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(4.8rem, 0.72fr) minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.53rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.profile-fact dt,
.profile-fact dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.profile-fact dt {
  color: #7f8185;
  font-size: 0.62rem;
}

.profile-fact dd {
  color: #d4d4d4;
  font-size: 0.67rem;
  font-weight: 600;
  text-align: right;
}

.profile-fact.wide {
  grid-template-columns: 1fr;
  gap: 0.35rem;
}

.profile-fact.wide dd {
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
}

.profile-media {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.9rem;
}

.media-tile {
  position: relative;
  min-height: 4rem;
  margin: 0;
  overflow: hidden;
  border-radius: 9px;
  background: #101010;
}

.media-tile img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-tile figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 0.35rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.84));
  font-size: 0.52rem;
}

.dynamic-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.62rem;
}

.dynamic-field {
  min-width: 0;
  display: grid;
  gap: 0.3rem;
}

.dynamic-field.wide,
.dynamic-field:has(textarea) {
  grid-column: 1 / -1;
}

.dynamic-field-label {
  color: #8e9093;
  font-size: 0.58rem;
  font-weight: 650;
}

.dynamic-field input,
.dynamic-field textarea,
.dynamic-field select,
.chat-search input {
  width: 100%;
  min-width: 0;
  padding: 0.58rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  outline: none;
  background: rgba(10, 10, 10, 0.45);
  color: #dedede;
  font-size: 0.65rem;
  line-height: 1.45;
}

.dynamic-field input:focus,
.dynamic-field textarea:focus,
.dynamic-field select:focus,
.chat-search input:focus {
  border-color: rgba(199, 155, 66, 0.65);
  box-shadow: 0 0 0 3px rgba(199, 155, 66, 0.08);
}

.dynamic-field input:disabled,
.dynamic-field textarea:disabled,
.dynamic-field select:disabled {
  color: #a5a5a5;
  background: rgba(255, 255, 255, 0.02);
}

.dynamic-field small {
  color: #6d6f72;
  font-size: 0.53rem;
}

.save-state {
  color: var(--success);
  font-size: 0.55rem;
}

.segmented-control {
  display: flex;
  padding: 0.16rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.18);
}

.segmented-control button {
  padding: 0.28rem 0.4rem;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #777;
  font-size: 0.52rem;
  cursor: pointer;
}

.segmented-control button.active {
  background: rgba(199, 155, 66, 0.15);
  color: var(--gold-light);
}

.chat-search {
  display: block;
  margin-bottom: 0.65rem;
}

.chat-search input {
  min-height: 2rem;
  padding-left: 0.7rem;
}

.note-fields {
  max-height: 24rem;
  padding-right: 0.25rem;
  overflow-y: auto;
}

.variable-note-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.variable-note-form input {
  min-width: 0;
  padding: 0.55rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 7px;
  outline: none;
  background: rgba(10, 10, 10, 0.45);
  color: #dedede;
  font-size: 0.62rem;
}

.conversation-column {
  grid-area: conversation;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  background:
    radial-gradient(circle at 50% 20%, rgba(199, 155, 66, 0.045), transparent 25rem),
    rgba(22, 22, 22, 0.7);
}

.dialog-banner {
  position: relative;
  margin: 0.75rem 1rem 0;
  padding: 0.8rem 5.5rem 0.8rem 1rem;
  border: 1px solid rgba(199, 155, 66, 0.28);
  border-radius: 10px;
  background: rgba(91, 64, 35, 0.28);
  color: #e2e2e2;
  font-size: 0.65rem;
  line-height: 1.5;
  text-align: center;
}

.dialog-banner strong {
  position: absolute;
  right: 0.75rem;
  bottom: 0.6rem;
  padding: 0.2rem 0.4rem;
  border-radius: 999px;
  background: rgba(199, 155, 66, 0.85);
  color: #151515;
  font-size: 0.5rem;
}

.conversation-info-card {
  margin: 0.75rem 1rem 0;
}

.conversation-toolbar {
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
}

.dialog-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.live-dot {
  width: 0.55rem;
  height: 0.55rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #4e4e4e;
}

.live-dot.active {
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(143, 200, 154, 0.08);
}

.dialog-identity strong,
.dialog-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-identity strong {
  font-family: var(--font-cinzel), Georgia, serif;
  font-size: 0.9rem;
  font-weight: 500;
}

.dialog-identity small {
  max-width: 35rem;
  margin-top: 0.2rem;
  color: #77797c;
  font-size: 0.59rem;
}

.dialog-actions,
.composer-tools,
.message-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.chat-action {
  min-height: 1.9rem;
  padding: 0.34rem 0.62rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: #aeb0b2;
  font-size: 0.57rem;
  font-weight: 700;
  cursor: pointer;
}

.chat-action:hover:not(:disabled) {
  border-color: rgba(199, 155, 66, 0.42);
  color: var(--gold-light);
}

.chat-action.primary {
  border-color: rgba(199, 155, 66, 0.35);
  background: rgba(199, 155, 66, 0.1);
  color: var(--gold-light);
}

.chat-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.message-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.chat-loading,
.conversation-empty {
  height: 100%;
  min-height: 15rem;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.55rem;
  padding: 2rem;
  text-align: center;
}

.chat-loading strong,
.conversation-empty h2 {
  margin: 0.5rem 0 0;
  font-family: var(--font-cinzel), Georgia, serif;
  font-size: 1.18rem;
  font-weight: 500;
}

.chat-loading small,
.conversation-empty p {
  max-width: 30rem;
  margin: 0;
  color: #77797c;
  font-size: 0.66rem;
  line-height: 1.6;
}

.loading-ring,
.empty-orbit {
  width: 3.5rem;
  height: 3.5rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(199, 155, 66, 0.35);
  border-radius: 50%;
  color: var(--gold-light);
  font-family: Georgia, serif;
}

.loading-ring {
  border-color: rgba(199, 155, 66, 0.18);
  border-top-color: var(--gold);
  animation: chat-spin 1s linear infinite;
}

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

.empty-orbit {
  box-shadow: 0 0 0 8px rgba(199, 155, 66, 0.035);
}

.message-list {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.25rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(199, 155, 66, 0.25) transparent;
}

.message {
  width: min(78%, 42rem);
  align-self: flex-start;
}

.message.outgoing {
  align-self: flex-end;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0.25rem 0.3rem;
  color: #77797c;
  font-size: 0.54rem;
}

.message-meta strong {
  color: #bcbdbf;
  font-size: 0.6rem;
}

.message-meta span {
  padding: 0.16rem 0.3rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
}

.message-meta time {
  margin-left: auto;
}

.message-bubble {
  padding: 0.8rem 0.92rem;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 5px 13px 13px 13px;
  background: #252525;
  color: #dedede;
  font-size: 0.72rem;
  line-height: 1.62;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.outgoing .message-bubble {
  border-color: rgba(199, 155, 66, 0.2);
  border-radius: 13px 5px 13px 13px;
  background: linear-gradient(145deg, rgba(199, 155, 66, 0.15), rgba(68, 53, 29, 0.44));
}

.system-message {
  width: min(90%, 50rem);
  align-self: center;
}

.system-message .message-bubble {
  border-style: dashed;
  background: transparent;
  color: #929497;
  text-align: center;
}

.message-actions {
  margin-top: 0.32rem;
}

.composer {
  margin: 0 1rem 1rem;
  padding: 0.75rem;
  border: 1px solid rgba(199, 155, 66, 0.22);
  border-radius: 14px;
  background: rgba(28, 28, 28, 0.96);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
}

.composer textarea {
  width: 100%;
  min-height: 5rem;
  padding: 0.35rem 0.45rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: #e3e3e3;
  font-size: 0.75rem;
  line-height: 1.55;
}

.composer textarea::placeholder {
  color: #626467;
}

.reply-context {
  margin-bottom: 0.4rem;
  padding: 0.5rem 0.65rem;
  border-left: 2px solid var(--gold);
  background: rgba(199, 155, 66, 0.05);
  color: #9c9d9f;
  font-size: 0.6rem;
}

.composer-footer,
.composer-submit {
  display: flex;
  align-items: center;
}

.composer-footer {
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.composer-submit {
  flex: 0 0 auto;
  gap: 0.75rem;
}

.character-count {
  color: #727477;
  font-size: 0.6rem;
  font-variant-numeric: tabular-nums;
}

.character-count.valid {
  color: var(--success);
}

.shortkey-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

.shortkey {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.12);
  color: #989a9d;
  cursor: pointer;
}

.shortkey kbd {
  min-width: 1.7rem;
  padding: 0.2rem;
  border: 1px solid rgba(199, 155, 66, 0.22);
  border-radius: 4px;
  background: rgba(199, 155, 66, 0.06);
  color: var(--gold-light);
  font: 700 0.52rem/1 monospace;
  text-align: center;
}

.shortkey span {
  min-width: 0;
  overflow: hidden;
  font-size: 0.55rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-list {
  display: grid;
  gap: 0.58rem;
}

.platform-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
}

.platform-monogram {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(199, 155, 66, 0.22);
  border-radius: 7px;
  color: var(--gold-light);
  font-family: Georgia, serif;
  font-size: 0.58rem;
}

.platform-copy {
  min-width: 0;
}

.platform-copy strong,
.platform-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-copy strong {
  color: #c6c6c6;
  font-size: 0.62rem;
}

.platform-copy small {
  margin-top: 0.16rem;
  color: #737578;
  font-size: 0.52rem;
}

.chat-option-dialog {
  width: min(92vw, 30rem);
  padding: 0;
  border: 1px solid rgba(199, 155, 66, 0.38);
  border-radius: 16px;
  background: #222220;
  color: var(--silver);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.72);
}

.chat-option-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.chat-option-dialog form {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
}

.chat-option-dialog h2 {
  margin: 0;
  font-family: var(--font-cinzel), Georgia, serif;
  font-size: 1.08rem;
  font-weight: 500;
}

.dialog-close {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
}

.option-select-field {
  margin-top: 0.4rem;
}

.option-preview {
  margin: 0;
  min-height: 10rem;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: #181817;
}

.option-description {
  margin: -0.35rem 0 0;
  color: #96989a;
  font-size: 0.61rem;
  line-height: 1.45;
}

.message-media {
  width: min(16rem, 100%);
  max-height: 16rem;
  display: block;
  margin-bottom: 0.55rem;
  border-radius: 8px;
  object-fit: contain;
}

.media-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1rem 0.5rem;
  color: #77797c;
  font-size: 0.62rem;
  text-align: center;
}

.option-preview img {
  display: block;
  width: 100%;
  max-height: 18rem;
  object-fit: contain;
}

.option-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  padding-top: 0.3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 1180px) {
  .chat-workspace {
    grid-template-columns: 17rem minmax(27rem, 1fr);
    grid-template-areas: "customer conversation";
  }

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

@media (max-width: 820px) {
  .chat-body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .chat-shell {
    height: auto;
    min-height: 100vh;
    grid-template-rows: auto auto auto;
  }

  .chat-header {
    min-height: 4rem;
  }

  .chat-source-strip,
  .traffic-legend,
  .chat-account > span {
    display: none;
  }

  .chat-header-actions {
    margin-left: auto;
  }

  .chat-workspace {
    display: flex;
    flex-direction: column;
  }

  .chat-rail-left {
    order: 1;
  }

  .chat-rail-right {
    order: 2;
    display: block;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  }

  .chat-rail {
    overflow: visible;
  }

  .chat-rail-left {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  }

  .conversation-column {
    order: 3;
    min-height: 42rem;
  }

  .conversation-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .message {
    width: 90%;
  }
}

@media (max-width: 520px) {
  .chat-header {
    padding: 0 0.75rem;
  }

  .chat-brand .brand-mark {
    width: 2.35rem;
    height: 2.35rem;
  }

  .chat-account {
    padding-left: 0;
    border-left: 0;
  }

  .chat-rail,
  .message-list {
    padding: 0.75rem;
  }

  .dynamic-fields {
    grid-template-columns: 1fr;
  }

  .dynamic-field.wide,
  .dynamic-field:has(textarea) {
    grid-column: auto;
  }

  .composer {
    margin: 0 0.65rem 0.65rem;
  }

  .composer-footer {
    align-items: flex-end;
  }

  .composer-submit {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
  }
}
