/* ==========================================================================
   御帝科技 · shared visual language
   ========================================================================== */

:root {
  --ink: #1f2c27;
  --ink-soft: #46564f;
  --ink-muted: #7b8881;
  --ink-faint: #a4ada8;
  --forest: #143c31;
  --forest-deep: #0d2b23;
  --forest-soft: #225b49;
  --sage: #8fa99b;
  --mint: #e0eadf;
  --mint-soft: #edf3e9;
  --cream: #f3efe5;
  --cream-deep: #ebe5d7;
  --paper: #fbf8f1;
  --white: #fffdf9;
  --line: rgba(20, 60, 49, 0.12);
  --line-strong: rgba(20, 60, 49, 0.2);
  --line-light: rgba(255, 255, 255, 0.12);
  --lime: #d9ef9a;
  --lime-soft: #eaf5c7;
  --coral: #d9795d;
  --coral-soft: #f4ded6;
  --gold: #d2a64f;
  --green-live: #6ab68b;
  --shadow-soft: 0 18px 45px -24px rgba(22, 44, 36, 0.35);
  --shadow-card: 0 40px 100px -34px rgba(31, 54, 44, 0.42);
  --shadow-float: 0 20px 55px -20px rgba(20, 45, 36, 0.32);
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Songti SC",
    "STSong", "SimSun", serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

img {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--lime);
  color: var(--forest);
}

:focus-visible {
  outline: 2px solid var(--forest-soft);
  outline-offset: 3px;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(20, 60, 49, 0.16);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1;
}

.eyebrow.light {
  color: rgba(255, 255, 255, 0.46);
}

.logo-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: var(--forest);
  color: var(--cream);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.logo-mark svg {
  width: 27px;
  height: 27px;
}

.logo-mark svg path {
  fill: currentColor;
}

.logo-mark svg circle {
  fill: var(--forest);
}

.logo-mark-light {
  background: var(--lime);
  color: var(--forest);
}

.logo-mark-light svg circle {
  fill: var(--lime);
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  font-weight: 600;
  letter-spacing: -0.03em;
  user-select: none;
}

.avatar-agent {
  width: 42px;
  height: 42px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.24), transparent 48%),
    linear-gradient(145deg, #2a6a55, var(--forest));
  color: var(--paper);
  font-size: 16px;
  box-shadow: 0 5px 14px -8px rgba(20, 60, 49, 0.9);
}

.avatar-hero {
  width: 52px;
  height: 52px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.3), transparent 45%),
    linear-gradient(145deg, #2c705a, var(--forest));
  color: var(--paper);
  font-size: 19px;
  box-shadow: 0 8px 20px -10px rgba(20, 60, 49, 0.75);
}

.avatar-start {
  width: 68px;
  height: 68px;
  border: 2px solid rgba(255, 255, 255, 0.65);
  background:
    radial-gradient(circle at 32% 20%, rgba(255, 255, 255, 0.3), transparent 45%),
    linear-gradient(145deg, #2d725b, var(--forest));
  color: var(--paper);
  font-size: 24px;
  box-shadow: 0 12px 30px -14px rgba(20, 60, 49, 0.9);
}

.avatar-mini {
  width: 26px;
  height: 26px;
  background: var(--forest);
  color: var(--paper);
  font-size: 10px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ink-faint);
}

.status-dot.online {
  background: var(--green-live);
  box-shadow: 0 0 0 3px rgba(106, 182, 139, 0.16);
}

.status-dot.away {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(210, 166, 79, 0.16);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 19px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.2s var(--ease-out), background 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn-primary {
  background: var(--forest);
  color: var(--paper);
  box-shadow: 0 12px 24px -14px rgba(20, 60, 49, 0.65);
}

.btn-primary:hover {
  background: var(--forest-soft);
}

.btn-dark {
  background: var(--forest);
  color: var(--paper);
  box-shadow: 0 12px 26px -16px rgba(20, 60, 49, 0.65);
}

.btn-dark:hover {
  background: var(--forest-soft);
}

.btn-lime {
  background: var(--lime);
  color: var(--forest-deep);
}

.btn-lime:hover {
  background: #e4f6b2;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.btn-ghost:hover {
  background: rgba(20, 60, 49, 0.05);
}

.btn-danger {
  background: var(--coral);
  color: #fff;
}

.btn-danger:hover {
  background: #ca6a4f;
}

.btn-small {
  min-height: 36px;
  padding: 0 15px;
  font-size: 12px;
}

.btn-subtle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.btn-subtle:hover {
  background: rgba(20, 60, 49, 0.06);
  color: var(--ink);
}

.btn-subtle.danger:hover {
  background: rgba(217, 121, 93, 0.1);
  color: #b8583f;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: rgba(20, 60, 49, 0.06);
  transition: background 0.2s;
}

.icon-button:hover {
  background: rgba(20, 60, 49, 0.11);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: 32px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--forest);
  color: var(--paper);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-float);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.25s, transform 0.25s var(--ease-out);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-dark {
  background: var(--forest-deep);
}

/* ==========================================================================
   Customer page
   ========================================================================== */

.customer-page {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  overflow-x: hidden;
  background:
    radial-gradient(1100px 760px at -8% -12%, rgba(211, 228, 199, 0.92), transparent 58%),
    radial-gradient(980px 700px at 108% 108%, rgba(241, 218, 196, 0.85), transparent 56%),
    var(--cream);
}

.ambient {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.7;
}

.ambient-blob-a {
  top: -160px;
  right: 16%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(255, 253, 245, 0.9), transparent 68%);
}

.ambient-blob-b {
  bottom: -180px;
  left: 6%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(255, 250, 234, 0.72), transparent 66%);
}

.ambient-blob-c {
  top: 36%;
  left: 42%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(224, 234, 218, 0.62), transparent 68%);
  filter: blur(28px);
}

.ambient-grain {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.32'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  max-width: 1380px;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  padding: 32px 52px 18px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.site-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-brand-copy strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.site-brand-copy small {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.18em;
}

.site-header-note {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.customer-layout {
  position: relative;
  z-index: 2;
  display: grid;
  width: 100%;
  max-width: 1270px;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) 452px;
  gap: clamp(48px, 6vw, 96px);
  align-items: center;
  margin: 0 auto;
  padding: 18px 52px 40px;
}

.hero {
  max-width: 620px;
  padding-left: 1vw;
  animation: rise-in 0.8s var(--ease-out) both;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.eyebrow-line {
  width: 34px;
  height: 1px;
  background: var(--forest);
  opacity: 0.55;
}

.hero-title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(50px, 5.5vw, 76px);
  font-weight: 620;
  letter-spacing: -0.07em;
  line-height: 1.08;
}

.hero-title em {
  position: relative;
  z-index: 0;
  color: var(--forest);
  font-style: normal;
}

.hero-title em::after {
  position: absolute;
  z-index: -1;
  right: -4px;
  bottom: 7px;
  left: 3px;
  height: 16px;
  border-radius: 50%;
  background: var(--lime);
  content: "";
  opacity: 0.78;
  transform: rotate(-1.5deg);
}

.hero-copy {
  max-width: 400px;
  margin: 28px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.95;
  letter-spacing: 0.015em;
}

.agent-card {
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 14px;
  margin-top: 36px;
  padding: 12px 15px 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 21px;
  background: rgba(255, 253, 246, 0.64);
  box-shadow: 0 16px 40px -30px rgba(28, 57, 46, 0.48);
  backdrop-filter: blur(12px);
}

.agent-card-copy {
  display: flex;
  min-width: 126px;
  flex-direction: column;
  gap: 1px;
}

.agent-card-kicker {
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.agent-card-copy strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.agent-card-copy small {
  color: var(--ink-muted);
  font-size: 10px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(106, 182, 139, 0.12);
  color: #397454;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.live-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-live);
  box-shadow: 0 0 0 3px rgba(106, 182, 139, 0.14);
}

.live-badge.is-away {
  background: rgba(210, 166, 79, 0.13);
  color: #876a2e;
}

.live-badge.is-away i {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(210, 166, 79, 0.14);
}

.start-online-dot.is-away {
  background: var(--gold);
}

.hero-trust {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 34px;
}

.trust-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.trust-item strong {
  color: var(--forest);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.trust-item span {
  color: var(--ink-muted);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.trust-rule {
  width: 1px;
  height: 26px;
  background: var(--line-strong);
}

.hero-note {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  max-width: 340px;
  margin: 38px 0 0;
  color: var(--ink-muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-style: italic;
  line-height: 1.8;
}

.hero-note span {
  color: var(--sage);
  font-size: 26px;
  font-style: normal;
  line-height: 1;
}

/* Chat card */

.chat-card {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 452px;
  height: min(740px, calc(100dvh - 190px));
  min-height: 560px;
  flex-direction: column;
  justify-self: end;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  background: var(--white);
  box-shadow: var(--shadow-card);
  animation: card-in 0.9s 0.12s var(--ease-out) both;
}

.chat-card::before {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
  content: "";
  pointer-events: none;
}

.chat-head {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 21px;
  border-bottom: 1px solid rgba(20, 60, 49, 0.075);
  background: rgba(255, 253, 249, 0.94);
  backdrop-filter: blur(14px);
}

.chat-head-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.chat-head-copy {
  min-width: 0;
}

.chat-head-copy h2 {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.verified-mark {
  display: inline-grid;
  width: 14px;
  height: 14px;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: var(--paper);
  font-size: 9px;
  font-weight: 700;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
}

.private-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
}

.private-pill svg {
  width: 11px;
  height: 11px;
}

.chat-scroll {
  position: relative;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(420px 260px at 100% 0%, rgba(235, 244, 226, 0.58), transparent 68%),
    radial-gradient(380px 300px at 0% 100%, rgba(247, 229, 210, 0.36), transparent 70%),
    var(--paper);
  scroll-behavior: smooth;
}

.loading-view {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 42px 26px;
}

.loading-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
}

.loading-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton {
  display: block;
  height: 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(20, 60, 49, 0.06), rgba(20, 60, 49, 0.12), rgba(20, 60, 49, 0.06));
  background-size: 200% 100%;
  animation: shimmer 1.7s infinite linear;
}

.loading-lines .skeleton {
  width: 72%;
}

.loading-lines .skeleton.short {
  width: 55%;
}

.loading-lines .skeleton.shorter {
  width: 38%;
}

.loading-label {
  margin: 6px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
  letter-spacing: 0.03em;
}

/* Start / welcome */

.start-panel {
  display: flex;
  min-height: 100%;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  padding: 38px 32px 34px;
  text-align: center;
  animation: rise-in 0.6s var(--ease-out) both;
}

.start-avatar-wrap {
  position: relative;
  margin-bottom: 20px;
}

.start-online-dot {
  position: absolute;
  right: 1px;
  bottom: 4px;
  width: 13px;
  height: 13px;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--green-live);
}

.start-kicker {
  margin: 0 0 10px;
  color: var(--sage);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.start-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: 26px;
  font-weight: 620;
  letter-spacing: -0.04em;
}

.start-panel h2 span {
  color: var(--forest);
}

.start-copy {
  max-width: 330px;
  margin: 13px 0 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.85;
}

.start-form {
  width: 100%;
  max-width: 322px;
  margin-top: 24px;
  text-align: left;
}

.start-form label {
  display: block;
  margin: 0 0 8px 3px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.name-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.name-field input {
  width: 100%;
  height: 50px;
  padding: 0 17px;
  border: 1.5px solid var(--line-strong);
  border-radius: 15px;
  outline: 0;
  background: rgba(255, 253, 249, 0.9);
  color: var(--ink);
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.name-field input::placeholder {
  color: var(--ink-faint);
}

.name-field input:focus {
  border-color: var(--forest);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(20, 60, 49, 0.07);
}

.start-button {
  display: flex;
  height: 50px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 15px;
  background: var(--forest);
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 14px 25px -17px rgba(20, 60, 49, 0.8);
  transition: background 0.2s, transform 0.2s var(--ease-out), opacity 0.2s;
}

.start-button:hover {
  background: var(--forest-soft);
  transform: translateY(-1px);
}

.start-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.start-button svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s;
}

.connection-error .start-copy {
  margin-bottom: 24px;
}

.connection-error .start-button {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}

.connection-error .start-foot {
  margin-top: 22px;
}

.start-button:hover svg {
  transform: translateX(2px);
}

.form-error {
  margin: 8px 0 0 3px;
  color: #b7563d;
  font-size: 11px;
  line-height: 1.5;
}

.start-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 22px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
}

.start-foot svg {
  width: 11px;
  height: 11px;
}

/* Messages */

.messages-view {
  min-height: 100%;
  padding: 0 20px 24px;
}

.day-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0 15px;
}

.day-divider span {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(20, 60, 49, 0.045);
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message-list .day-divider {
  padding: 4px 0 8px;
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  animation: message-in 0.32s var(--ease-out) both;
}

.msg-row.from-agent {
  justify-content: flex-start;
}

.msg-row.from-customer {
  justify-content: flex-end;
}

.msg-avatar {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  margin-bottom: 17px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--paper);
  font-size: 9px;
  font-weight: 600;
}

.msg-content {
  display: flex;
  max-width: 79%;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.from-customer .msg-content {
  align-items: flex-end;
}

.msg-bubble {
  padding: 10px 14px;
  border: 1px solid rgba(20, 60, 49, 0.08);
  border-radius: 4px 17px 17px 17px;
  background: var(--white);
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  box-shadow: 0 4px 14px -10px rgba(20, 45, 36, 0.34);
}

.from-customer .msg-bubble {
  border: 0;
  border-radius: 17px 4px 17px 17px;
  background: var(--forest);
  color: var(--paper);
  box-shadow: 0 7px 18px -12px rgba(20, 60, 49, 0.68);
}

.msg-time {
  padding: 0 2px;
  color: var(--ink-faint);
  font-size: 8px;
  line-height: 1;
}

.msg-row.is-continuation .msg-avatar {
  visibility: hidden;
}

.msg-row.is-continuation .msg-time {
  display: none;
}

.msg-system {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
}

.msg-system span {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(20, 60, 49, 0.045);
  color: var(--ink-muted);
  font-size: 9px;
  line-height: 1.4;
  text-align: center;
}

.typing-indicator {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  margin-top: 13px;
  animation: fade-in 0.2s both;
}

.typing-bubble {
  display: flex;
  height: 30px;
  align-items: center;
  gap: 3px;
  padding: 0 11px;
  border: 1px solid rgba(20, 60, 49, 0.08);
  border-radius: 4px 14px 14px 14px;
  background: var(--white);
}

.typing-bubble span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--sage);
  animation: typing-bounce 1.2s infinite ease-in-out;
}

.typing-bubble span:nth-child(2) {
  animation-delay: 0.16s;
}

.typing-bubble span:nth-child(3) {
  animation-delay: 0.32s;
}

.typing-label {
  margin-bottom: 2px;
  color: var(--ink-faint);
  font-size: 8px;
}

.conversation-end {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 0 4px;
}

.conversation-end p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 9px;
  white-space: nowrap;
}

.end-rule {
  height: 1px;
  flex: 1;
  background: var(--line);
}

/* Customer composer */

.composer-area {
  padding: 9px 17px 0;
  border-top: 1px solid rgba(20, 60, 49, 0.07);
  background: var(--white);
}

.suggestions {
  display: flex;
  gap: 6px;
  padding: 1px 2px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.suggestions::-webkit-scrollbar {
  display: none;
}

.suggestion-chip {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.suggestion-chip:hover {
  border-color: rgba(20, 60, 49, 0.24);
  background: var(--mint-soft);
  color: var(--forest);
}

.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 7px 7px 7px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 18px;
  background: var(--paper);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.composer-box:focus-within {
  border-color: var(--forest);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(20, 60, 49, 0.06);
}

.composer-box textarea {
  width: 100%;
  max-height: 112px;
  min-height: 36px;
  flex: 1;
  padding: 8px 0 7px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.55;
  scrollbar-width: thin;
}

.composer-box textarea::placeholder {
  color: var(--ink-faint);
}

.send-button {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: var(--forest);
  color: var(--paper);
  box-shadow: 0 7px 15px -9px rgba(20, 60, 49, 0.8);
  transition: background 0.2s, transform 0.2s var(--ease-out), opacity 0.2s;
}

.send-button:hover {
  background: var(--forest-soft);
  transform: translateY(-1px);
}

.send-button:active {
  transform: scale(0.96);
}

.send-button:disabled {
  cursor: default;
  opacity: 0.45;
  transform: none;
}

.send-button svg {
  width: 20px;
  height: 20px;
}

.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 3px 8px;
  color: var(--ink-faint);
  font-size: 8px;
}

.privacy-inline {
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.privacy-inline svg {
  width: 9px;
  height: 9px;
}

.chat-footnote {
  display: flex;
  min-height: 30px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 16px;
  border-top: 1px solid rgba(20, 60, 49, 0.055);
  background: var(--white);
  color: var(--ink-faint);
  font-size: 8px;
  letter-spacing: 0.02em;
}

.footnote-dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--ink-faint);
}

.closed-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px 14px;
  border-top: 1px solid var(--line);
  background: var(--mint-soft);
}

.closed-copy {
  display: flex;
  align-items: center;
  gap: 10px;
}

.closed-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
}

.closed-copy strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
}

.closed-copy p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 9.5px;
}

.reconnect-bar {
  position: absolute;
  z-index: 5;
  top: 86px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(20, 60, 49, 0.92);
  color: var(--paper);
  font-size: 9px;
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

.reconnect-spinner {
  width: 10px;
  height: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--paper);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.customer-footer {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  max-width: 1380px;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  padding: 0 52px 26px;
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.error-main {
  position: relative;
  z-index: 2;
  display: grid;
  flex: 1;
  place-items: center;
  padding: 40px 24px;
}

.error-card {
  width: 100%;
  max-width: 540px;
  padding: 54px 46px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 30px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: var(--shadow-card);
  text-align: center;
  backdrop-filter: blur(14px);
  animation: rise-in 0.7s var(--ease-out) both;
}

.error-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--forest);
  font-family: var(--font-display);
  font-size: 30px;
}

.error-card h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 620;
  letter-spacing: -0.05em;
  line-height: 1.3;
}

.error-card > p:not(.eyebrow) {
  max-width: 360px;
  margin: 16px auto 26px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.85;
}


/* ==========================================================================
   Agent gate
   ========================================================================== */

.agent-body {
  overflow: hidden;
  background: var(--cream-deep);
}

.gate {
  position: relative;
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  overflow: hidden;
  padding: 32px clamp(24px, 5vw, 64px) 24px;
  background:
    radial-gradient(900px 700px at 10% 0%, #235b49 0%, transparent 58%),
    radial-gradient(850px 700px at 100% 100%, #1d4f3f 0%, transparent 58%),
    var(--forest-deep);
  color: var(--paper);
}

.gate-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.gate-ring {
  position: absolute;
  border: 1px solid rgba(217, 239, 154, 0.14);
  border-radius: 50%;
}

.gate-ring-a {
  top: -38vw;
  right: -24vw;
  width: 80vw;
  height: 80vw;
}

.gate-ring-b {
  right: -12vw;
  bottom: -34vw;
  width: 64vw;
  height: 64vw;
  border-color: rgba(255, 255, 255, 0.08);
}

.gate-glow {
  position: absolute;
  top: 20%;
  left: 12%;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 239, 154, 0.12), transparent 68%);
  filter: blur(20px);
}

.gate-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.gate-brand small {
  margin-left: 8px;
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.16em;
}

.gate-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  margin: auto;
  padding: 40px 42px 34px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 30px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 50px 120px -50px rgba(0, 0, 0, 0.7);
  animation: rise-in 0.7s var(--ease-out) both;
}

.gate-card .eyebrow {
  margin-bottom: 14px;
}

.gate-card h1 {
  margin: 0;
  color: var(--forest);
  font-size: clamp(36px, 4vw, 46px);
  font-weight: 620;
  letter-spacing: -0.06em;
  line-height: 1.1;
}

.gate-copy {
  max-width: 340px;
  margin: 16px 0 28px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.8;
}

.gate-form label {
  display: block;
  margin: 0 0 8px 2px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.gate-field {
  display: flex;
  gap: 8px;
}

.gate-field input {
  min-width: 0;
  height: 48px;
  flex: 1;
  padding: 0 15px;
  border: 1.5px solid var(--line-strong);
  border-radius: 13px;
  outline: 0;
  background: var(--white);
  font-family: var(--font-mono);
  font-size: 11px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.gate-field input:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 4px rgba(20, 60, 49, 0.07);
}

.gate-field .btn {
  flex: 0 0 auto;
  min-height: 48px;
  border-radius: 13px;
  padding: 0 18px;
}

.gate-error {
  margin: 9px 0 0 2px;
  color: #b7563d;
  font-size: 10.5px;
}

.gate-status {
  margin: 16px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
}

.gate-customer-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 26px;
  color: var(--forest-soft);
  font-size: 10px;
  font-weight: 600;
  border-bottom: 1px solid rgba(20, 60, 49, 0.2);
  padding-bottom: 2px;
}

.gate-foot {
  position: relative;
  z-index: 2;
  color: rgba(255, 255, 255, 0.34);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-align: center;
}

/* ==========================================================================
   Agent workbench
   ========================================================================== */

.agent-page {
  display: grid;
  height: 100dvh;
  grid-template-columns: 338px minmax(0, 1fr);
  overflow: hidden;
  background: var(--forest-deep);
}

/* Sidebar */

.sidebar {
  position: relative;
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 24px 16px 15px;
  background:
    radial-gradient(560px 400px at 105% -4%, rgba(60, 119, 92, 0.45), transparent 62%),
    linear-gradient(180deg, #173f34 0%, #12362c 100%);
  color: var(--paper);
}

.sidebar-glow {
  position: absolute;
  right: -120px;
  bottom: 80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 239, 154, 0.08), transparent 68%);
  pointer-events: none;
}

.rail-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 5px 25px;
}

.rail-brand .logo-mark {
  width: 37px;
  height: 37px;
  border-radius: 12px;
}

.rail-brand .logo-mark svg {
  width: 25px;
  height: 25px;
}

.rail-brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.rail-brand-copy strong {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.rail-brand-copy small {
  color: rgba(255, 255, 255, 0.42);
  font-size: 8px;
  letter-spacing: 0.09em;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 8px;
  white-space: nowrap;
}

.connection-pill .status-dot {
  width: 5px;
  height: 5px;
}

.connection-pill.is-offline .status-dot {
  background: var(--gold);
  box-shadow: none;
}

.rail-heading {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 8px 14px;
}

.rail-heading h1 {
  margin: 0;
  color: var(--paper);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.1;
}

.round-add {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: var(--lime);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.round-add:hover {
  border-color: rgba(217, 239, 154, 0.42);
  background: rgba(217, 239, 154, 0.1);
  transform: rotate(90deg);
}

.round-add svg {
  width: 17px;
  height: 17px;
}

.share-banner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 2px 14px;
  padding: 12px 12px;
  border: 1px solid rgba(217, 239, 154, 0.15);
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(217, 239, 154, 0.1), rgba(255, 255, 255, 0.035));
  color: var(--paper);
  text-align: left;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease-out);
}

.share-banner:hover {
  border-color: rgba(217, 239, 154, 0.35);
  background: linear-gradient(120deg, rgba(217, 239, 154, 0.16), rgba(255, 255, 255, 0.06));
  transform: translateY(-1px);
}

.share-banner-icon {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--lime);
  color: var(--forest);
}

.share-banner-icon svg {
  width: 17px;
  height: 17px;
}

.share-banner-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.share-banner-copy strong {
  font-size: 10.5px;
  font-weight: 600;
}

.share-banner-copy small {
  color: rgba(255, 255, 255, 0.44);
  font-size: 8px;
  white-space: nowrap;
}

.share-banner-arrow {
  width: 14px;
  height: 14px;
  color: rgba(255, 255, 255, 0.38);
}

.search-box {
  position: relative;
  z-index: 2;
  display: flex;
  height: 38px;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  margin: 0 2px 12px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.1);
  transition: border-color 0.2s, background 0.2s;
}

.search-box:focus-within {
  border-color: rgba(217, 239, 154, 0.28);
  background: rgba(0, 0, 0, 0.16);
}

.search-box svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.35);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--paper);
  font-size: 10px;
}

.search-box input::placeholder {
  color: rgba(255, 255, 255, 0.31);
}

.search-box input::-webkit-search-cancel-button {
  filter: invert(1);
  opacity: 0.4;
}

.filters {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  margin: 0 2px 10px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.12);
}

.filter {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 3px;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 9.5px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.filter:hover {
  color: rgba(255, 255, 255, 0.78);
}

.filter.is-active {
  background: rgba(255, 255, 255, 0.11);
  color: var(--paper);
}

.filter-count {
  min-width: 14px;
  padding: 1px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-mono);
  font-size: 7.5px;
  text-align: center;
}

.filter.is-active .filter-count {
  background: var(--lime);
  color: var(--forest);
}

.conv-list {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 0 8px;
  scrollbar-width: thin;
}

.conv-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
}

.conv-item {
  display: flex;
  width: 100%;
  flex: 0 0 auto;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--paper);
  text-align: left;
  transition: background 0.18s, border-color 0.18s;
}

.conv-item:hover {
  background: rgba(255, 255, 255, 0.055);
}

.conv-item.is-active {
  border-color: rgba(255, 255, 255, 0.08);
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 13px 28px -22px rgba(0, 0, 0, 0.9);
}

.conv-item.is-closed:not(.is-active) {
  opacity: 0.58;
}

.conv-avatar {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: var(--forest);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.conv-avatar::after {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 8px;
  height: 8px;
  border: 2px solid #174035;
  border-radius: 50%;
  background: var(--green-live);
  content: "";
}

.conv-item.is-active .conv-avatar::after {
  border-color: var(--cream);
}

.conv-avatar.is-offline::after {
  background: #87958d;
}

.conv-main {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  padding-top: 1px;
}

.conv-top {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.conv-name {
  overflow: hidden;
  color: inherit;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-time {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.33);
  font-family: var(--font-mono);
  font-size: 7.5px;
}

.conv-item.is-active .conv-time {
  color: var(--ink-faint);
}

.conv-preview-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.conv-preview {
  overflow: hidden;
  flex: 1;
  color: rgba(255, 255, 255, 0.4);
  font-size: 9.5px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-item.is-active .conv-preview {
  color: var(--ink-muted);
}

.unread-badge {
  display: grid;
  min-width: 17px;
  height: 17px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--forest-deep);
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 700;
}

.conv-state {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 7.5px;
}

.conv-state i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}

.conv-item.is-active .conv-state {
  color: var(--ink-muted);
}

.conv-empty {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 8px;
  padding: 44px 18px;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
}

.conv-empty svg {
  width: 28px;
  height: 28px;
  opacity: 0.65;
}

.conv-empty p {
  margin: 0;
  font-size: 9.5px;
  line-height: 1.7;
}

.rail-footer {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.agent-profile {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 8px 7px;
  border-radius: 12px;
  color: var(--paper);
  text-align: left;
  transition: background 0.2s;
}

.agent-profile:hover {
  background: rgba(255, 255, 255, 0.055);
}

.avatar-profile {
  width: 31px;
  height: 31px;
  background: var(--lime);
  color: var(--forest);
  font-size: 11px;
}

.agent-profile-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.agent-profile-copy strong {
  font-size: 10px;
  font-weight: 600;
}

.agent-profile-copy small {
  color: rgba(255, 255, 255, 0.36);
  font-size: 7.5px;
}

.profile-gear {
  width: 14px;
  height: 14px;
  color: rgba(255, 255, 255, 0.3);
}

.rail-footnote {
  display: block;
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.2);
  font-family: var(--font-display);
  font-size: 8px;
  font-style: italic;
  letter-spacing: 0.02em;
  text-align: center;
}

/* Workspace */

.workspace {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(900px 600px at 100% 0%, rgba(223, 235, 216, 0.6), transparent 62%),
    var(--cream);
}

.empty-state {
  display: flex;
  width: 100%;
  max-width: 520px;
  flex: 1;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  margin: 0 auto;
  padding: 38px;
  text-align: center;
  animation: rise-in 0.7s var(--ease-out) both;
}

.empty-visual {
  position: relative;
  width: 230px;
  height: 178px;
  margin-bottom: 28px;
}

.empty-orbit {
  position: absolute;
  border: 1px solid rgba(20, 60, 49, 0.1);
  border-radius: 50%;
}

.empty-orbit-a {
  top: 2px;
  left: 33px;
  width: 164px;
  height: 164px;
}

.empty-orbit-b {
  top: 27px;
  left: 58px;
  width: 114px;
  height: 114px;
  border-color: rgba(20, 60, 49, 0.06);
}

.empty-quote {
  position: absolute;
  top: -2px;
  left: 49%;
  color: var(--sage);
  font-family: var(--font-display);
  font-size: 62px;
  line-height: 1;
  opacity: 0.6;
  transform: translateX(-50%);
}

.empty-card {
  position: absolute;
  z-index: 2;
  top: 52px;
  left: 61px;
  display: flex;
  width: 108px;
  height: 73px;
  flex-direction: column;
  gap: 8px;
  padding: 17px 16px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px 18px 18px 5px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 22px 35px -28px rgba(20, 60, 49, 0.5);
  backdrop-filter: blur(8px);
}

.empty-card-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--forest);
}

.empty-line {
  width: 72px;
  height: 3px;
  border-radius: 999px;
  background: rgba(20, 60, 49, 0.18);
}

.empty-line.short {
  width: 44px;
  opacity: 0.6;
}

.empty-leaf {
  position: absolute;
  right: 21px;
  bottom: 18px;
  width: 54px;
  height: 64px;
  color: var(--forest-soft);
  opacity: 0.32;
  transform: rotate(12deg);
}

.empty-leaf svg {
  width: 100%;
  height: 100%;
}

.empty-state h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 3.2vw, 40px);
  font-weight: 600;
  letter-spacing: -0.06em;
  line-height: 1.35;
}

.empty-copy {
  max-width: 340px;
  margin: 14px 0 24px;
  color: var(--ink-muted);
  font-size: 11.5px;
  line-height: 1.8;
}

/* Conversation */

.conversation-panel {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  animation: fade-in 0.25s both;
}

.chat-topbar {
  display: flex;
  min-height: 80px;
  flex: 0 0 auto;
  align-items: center;
  gap: 16px;
  padding: 13px 27px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 248, 241, 0.9);
  backdrop-filter: blur(14px);
}

.mobile-back {
  display: none;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: rgba(20, 60, 49, 0.06);
}

.mobile-back svg {
  width: 18px;
  height: 18px;
}

.chat-customer {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 11px;
}

.avatar-customer {
  width: 43px;
  height: 43px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: linear-gradient(145deg, #e5d7c0, #cdbfa5);
  color: #675a45;
  font-size: 14px;
  box-shadow: 0 7px 16px -12px rgba(75, 60, 38, 0.55);
}

.chat-customer-copy {
  min-width: 0;
}

.chat-customer-copy h2 {
  overflow: hidden;
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-customer-copy p {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.chat-customer-copy .status-dot {
  width: 6px;
  height: 6px;
}

.chat-customer-copy .status-dot.online {
  box-shadow: 0 0 0 2px rgba(106, 182, 139, 0.14);
}

.meta-sep {
  color: var(--ink-faint);
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.chat-customer-copy p {
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(210, 166, 79, 0.12);
  color: #8a6724;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.status-chip::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  content: "";
}

.status-chip.is-open {
  background: rgba(106, 182, 139, 0.13);
  color: #397454;
}

.status-chip.is-open::before {
  background: var(--green-live);
}

.status-chip.is-closed {
  background: rgba(20, 60, 49, 0.06);
  color: var(--ink-muted);
}

.status-chip.is-closed::before {
  background: var(--ink-faint);
}

.chat-meta-bar {
  display: flex;
  min-height: 32px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 29px;
  border-bottom: 1px solid rgba(20, 60, 49, 0.055);
  background: rgba(235, 229, 215, 0.38);
  color: var(--ink-faint);
  font-size: 8.5px;
  letter-spacing: 0.01em;
}

.sync-note {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.sync-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green-live);
}

.message-scroll {
  position: relative;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px 29px 24px;
  background:
    radial-gradient(760px 380px at 100% 0%, rgba(231, 241, 224, 0.45), transparent 68%),
    radial-gradient(600px 400px at 0% 100%, rgba(247, 230, 211, 0.25), transparent 70%);
  scroll-behavior: smooth;
}

.agent-messages {
  display: flex;
  width: 100%;
  max-width: 850px;
  flex-direction: column;
  gap: 15px;
  margin: 0 auto;
}

.agent-messages .msg-row {
  gap: 9px;
}

.agent-messages .from-agent {
  justify-content: flex-end;
}

.agent-messages .from-customer {
  justify-content: flex-start;
}

.agent-messages .msg-avatar {
  width: 27px;
  height: 27px;
  margin-bottom: 17px;
  font-size: 9px;
}

.agent-messages .msg-avatar.customer-avatar-small {
  background: linear-gradient(145deg, #e5d7c0, #cdbfa5);
  color: #675a45;
}

.agent-messages .msg-content {
  max-width: min(74%, 600px);
  align-items: flex-start;
}

.agent-messages .from-agent .msg-content {
  align-items: flex-end;
}

.agent-messages .msg-bubble {
  padding: 10px 14px;
  font-size: 12.5px;
}

.agent-messages .from-agent .msg-bubble {
  border: 0;
  border-radius: 17px 4px 17px 17px;
  background: var(--forest);
  color: var(--paper);
  box-shadow: 0 8px 20px -14px rgba(20, 60, 49, 0.8);
}

.agent-messages .from-customer .msg-bubble {
  border: 1px solid rgba(20, 60, 49, 0.075);
  border-radius: 4px 17px 17px 17px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 5px 16px -12px rgba(20, 45, 36, 0.32);
}

.agent-messages .msg-time {
  font-size: 8px;
}

.auto-reply-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(210, 166, 79, 0.12);
  color: #8a6724;
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.auto-reply-tag::before {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.agent-messages .msg-system span {
  font-size: 9px;
}

.agent-messages .day-divider {
  padding: 2px 0 8px;
}

.agent-message-empty {
  padding: 80px 20px;
  color: var(--ink-faint);
  font-size: 11px;
  text-align: center;
}

.message-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 90px 20px;
  color: var(--ink-muted);
  font-size: 10px;
}

.loading-spinner {
  width: 14px;
  height: 14px;
  border: 1.5px solid rgba(20, 60, 49, 0.16);
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.agent-typing {
  max-width: 850px;
  margin-right: auto;
  margin-left: auto;
}

.typing-indicator.agent-typing .typing-bubble {
  border-radius: 4px 14px 14px 14px;
}

.quick-reply-bar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  padding: 9px 28px;
  border-top: 1px solid var(--line);
  background: rgba(251, 248, 241, 0.82);
}

.quick-label {
  flex: 0 0 auto;
  color: var(--ink-faint);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.quick-replies {
  display: flex;
  min-width: 0;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-replies::-webkit-scrollbar {
  display: none;
}

.quick-reply {
  flex: 0 0 auto;
  max-width: 270px;
  overflow: hidden;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.quick-reply:hover {
  border-color: rgba(20, 60, 49, 0.25);
  background: var(--mint-soft);
  color: var(--forest);
}

.closed-notice {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 28px;
  border-top: 1px solid rgba(20, 60, 49, 0.08);
  background: var(--mint-soft);
  color: var(--ink-soft);
  font-size: 9.5px;
}

.closed-notice button {
  color: var(--forest);
  font-size: 9.5px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.agent-composer {
  flex: 0 0 auto;
  padding: 8px 28px 14px;
  background: var(--paper);
}

.agent-input-shell {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 7px 7px 7px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 18px;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.agent-input-shell:focus-within {
  border-color: var(--forest);
  box-shadow: 0 0 0 4px rgba(20, 60, 49, 0.055);
}

.agent-input-shell textarea {
  width: 100%;
  max-height: 138px;
  min-height: 38px;
  flex: 1;
  padding: 9px 0 8px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.55;
}

.agent-input-shell textarea::placeholder {
  color: var(--ink-faint);
}

.agent-input-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.agent-char {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 8px;
}

.agent-send {
  width: 38px;
  height: 38px;
}

.agent-composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 3px 0;
  color: var(--ink-faint);
  font-size: 8px;
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 29, 23, 0.55);
  backdrop-filter: blur(6px);
  animation: fade-in 0.2s both;
}

.modal-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 600px;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.55);
  animation: modal-in 0.28s var(--ease-out) both;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 28px 16px;
}

.modal-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 25px;
  font-weight: 620;
  letter-spacing: -0.045em;
  line-height: 1.25;
}

.modal-close {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-muted);
  transition: background 0.2s, color 0.2s;
}

.modal-close:hover {
  background: var(--cream);
  color: var(--ink);
}

.modal-close svg {
  width: 15px;
  height: 15px;
}

.modal-body {
  padding: 0 28px 26px;
}

.modal-copy {
  margin: 0 0 20px;
  color: var(--ink-muted);
  font-size: 11.5px;
  line-height: 1.8;
}

.share-block {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.68);
}

.share-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.share-block-head h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
}

.share-block-head p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 9.5px;
  line-height: 1.6;
}

.share-tag {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--mint-soft);
  color: #397454;
  font-size: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.copy-field {
  display: flex;
  gap: 7px;
  padding: 5px 5px 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.copy-field:focus-within {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(20, 60, 49, 0.05);
}

.copy-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.copy-button {
  display: inline-flex;
  height: 32px;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--forest);
  color: var(--paper);
  font-size: 9px;
  font-weight: 600;
  transition: background 0.2s;
}

.copy-button:hover {
  background: var(--forest-soft);
}

.copy-button svg {
  width: 13px;
  height: 13px;
}

.copy-button.is-copied {
  background: #397454;
}

.share-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 17px 0;
  color: var(--ink-faint);
  font-size: 8.5px;
  white-space: nowrap;
}

.share-divider::before,
.share-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.invite-block .share-block-head {
  margin-bottom: 0;
}

.invite-result {
  margin-top: 12px;
  animation: rise-in 0.25s var(--ease-out) both;
}

.network-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 18px;
  padding: 11px 12px;
  border-radius: 11px;
  background: rgba(210, 166, 79, 0.08);
  color: #7c6432;
}

.network-note-icon {
  flex: 0 0 auto;
  padding-top: 1px;
}

.network-note-icon svg {
  width: 14px;
  height: 14px;
}

.network-note p {
  margin: 0;
  font-size: 9px;
  line-height: 1.65;
}

.network-note code {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(210, 166, 79, 0.14);
  font-family: var(--font-mono);
  font-size: 8px;
}

/* Settings */

.settings-modal-card {
  max-width: 540px;
}

.settings-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--cream);
}

.avatar-settings {
  width: 43px;
  height: 43px;
  background: var(--forest);
  color: var(--paper);
  font-size: 15px;
}

.settings-profile strong {
  display: block;
  margin-bottom: 2px;
  font-size: 11.5px;
  font-weight: 650;
}

.settings-profile p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 9px;
}

.settings-section {
  padding: 0 0 17px;
}

.settings-section + .settings-section {
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.settings-section.is-disabled .text-area {
  opacity: 0.5;
}

.settings-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.settings-row .field-label {
  margin-bottom: 0;
}

.setting-badge {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--mint-soft);
  color: #397454;
  font-size: 8px;
  font-weight: 600;
}

.field-label {
  display: block;
  margin: 0 0 7px 2px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.text-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 11px;
  outline: 0;
  background: var(--white);
  font-size: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.text-input:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 4px rgba(20, 60, 49, 0.06);
}

.text-area {
  width: 100%;
  min-height: 86px;
  padding: 12px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 11px;
  outline: 0;
  resize: vertical;
  background: var(--white);
  color: var(--ink);
  font-size: 11.5px;
  line-height: 1.7;
  transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.text-area:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 4px rgba(20, 60, 49, 0.06);
}

.text-area:disabled {
  cursor: not-allowed;
  background: rgba(20, 60, 49, 0.025);
}

.auto-reply-text {
  margin-top: 11px;
}

.switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  cursor: pointer;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: relative;
  display: block;
  width: 40px;
  height: 23px;
  border-radius: 999px;
  background: rgba(20, 60, 49, 0.16);
  transition: background 0.2s;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 2px 5px rgba(20, 40, 33, 0.2);
  transition: transform 0.22s var(--ease-out);
}

.switch input:checked + .switch-track {
  background: var(--forest);
}

.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(17px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--forest-soft);
  outline-offset: 2px;
}

.field-hint {
  margin: 7px 0 0 2px;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.6;
}

.field-hint.no-top {
  margin-top: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}

.settings-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 8.5px;
}

.text-button {
  color: var(--coral);
  font-size: 8.5px;
  font-weight: 600;
}

.text-button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Confirm */

.confirm-modal-card {
  max-width: 390px;
  padding: 28px;
  text-align: center;
}

.confirm-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--coral-soft);
  color: var(--coral);
}

.confirm-icon svg {
  width: 24px;
  height: 24px;
}

.confirm-modal-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 620;
  letter-spacing: -0.04em;
}

.confirm-modal-card p {
  margin: 9px auto 0;
  color: var(--ink-muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.confirm-actions {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}

.confirm-actions .btn {
  flex: 1;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1180px) {
  .customer-layout {
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 44px;
    padding-right: 40px;
    padding-left: 40px;
  }

  .site-header,
  .customer-footer {
    padding-right: 40px;
    padding-left: 40px;
  }

  .hero-title {
    font-size: clamp(46px, 5.4vw, 64px);
  }

  .agent-page {
    grid-template-columns: 310px minmax(0, 1fr);
  }

  .share-banner-copy small {
    font-size: 7.5px;
  }
}

@media (max-width: 980px) {
  .customer-layout {
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 30px;
    padding: 10px 30px 30px;
  }

  .site-header {
    padding: 24px 30px 14px;
  }

  .customer-footer {
    padding: 0 30px 20px;
  }

  .hero-trust {
    gap: 14px;
  }

  .hero-note {
    display: none;
  }

  .chat-card {
    height: min(720px, calc(100dvh - 190px));
  }

  .agent-page {
    grid-template-columns: 292px minmax(0, 1fr);
  }

  .sidebar {
    padding-right: 12px;
    padding-left: 12px;
  }

  .chat-topbar {
    padding-right: 20px;
    padding-left: 20px;
  }

  .message-scroll {
    padding-right: 22px;
    padding-left: 22px;
  }

  .quick-reply-bar,
  .agent-composer,
  .closed-notice {
    padding-right: 22px;
    padding-left: 22px;
  }
}

@media (max-width: 860px) {
  .customer-page {
    height: 100dvh;
    overflow: hidden;
  }

  .site-header,
  .hero,
  .customer-footer,
  .chat-footnote {
    display: none;
  }

  .customer-layout {
    display: block;
    height: 100dvh;
    max-width: none;
    padding: 0;
  }

  .chat-card {
    height: 100dvh;
    max-width: none;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    animation: fade-in 0.4s both;
  }

  .chat-head {
    min-height: 70px;
    padding-top: max(13px, env(safe-area-inset-top));
    padding-right: 17px;
    padding-left: 17px;
  }

  .chat-scroll {
    background:
      radial-gradient(420px 260px at 100% 0%, rgba(235, 244, 226, 0.58), transparent 68%),
      var(--paper);
  }

  .messages-view {
    padding-right: 15px;
    padding-left: 15px;
  }

  .composer-area {
    padding-right: 13px;
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: 13px;
  }

  .start-panel {
    padding-right: 24px;
    padding-left: 24px;
  }

  .reconnect-bar {
    top: 78px;
  }

  .closed-area {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .agent-page {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: flex;
    padding-top: max(18px, env(safe-area-inset-top));
  }

  .workspace {
    display: none;
  }

  body.mobile-chat-open .sidebar {
    display: none;
  }

  body.mobile-chat-open .workspace {
    display: flex;
  }

  .mobile-back {
    display: grid;
  }

  .chat-topbar {
    min-height: 72px;
    padding: 10px 14px;
  }

  .chat-customer-copy h2 {
    font-size: 13px;
  }

  .status-chip {
    display: none;
  }

  .btn-subtle.danger {
    font-size: 10px;
    padding: 0 9px;
  }

  .chat-meta-bar {
    padding: 0 17px;
  }

  .message-scroll {
    padding: 18px 16px 18px;
  }

  .quick-reply-bar {
    padding: 8px 14px;
  }

  .agent-composer {
    padding: 7px 14px max(12px, env(safe-area-inset-bottom));
  }

  .closed-notice {
    padding: 9px 14px;
  }

  .modal {
    padding: 14px;
  }

  .modal-card {
    max-height: calc(100dvh - 28px);
    border-radius: 22px;
  }
}

@media (max-width: 620px) {
  .hero-trust {
    display: none;
  }

  .gate {
    padding: 22px 18px 18px;
  }

  .gate-card {
    padding: 32px 24px 27px;
    border-radius: 24px;
  }

  .gate-field {
    flex-direction: column;
  }

  .gate-field .btn {
    width: 100%;
  }

  .preview-pill {
    display: none;
  }

  .chat-customer-copy p {
    font-size: 8.5px;
  }

  .composer-foot {
    font-size: 7.5px;
  }

  .privacy-inline {
    display: none;
  }

  .msg-content {
    max-width: 84%;
  }

  .agent-messages .msg-content {
    max-width: 84%;
  }

  .topbar-actions {
    gap: 2px;
  }

  .modal-head {
    padding: 22px 20px 14px;
  }

  .modal-head h2 {
    font-size: 22px;
  }

  .modal-body {
    padding: 0 20px 21px;
  }

  .share-block {
    padding: 13px;
  }

  .share-block-head {
    flex-direction: column;
    gap: 9px;
  }

  .share-block-head .btn {
    align-self: flex-start;
  }

  .copy-field input {
    font-size: 8.5px;
  }

  .network-note {
    font-size: 8.5px;
  }

  .error-card {
    padding: 40px 24px;
    border-radius: 24px;
  }

  .customer-footer {
    display: none;
  }
}

@media (max-width: 900px) and (min-width: 861px) {
  .customer-layout {
    grid-template-columns: minmax(0, 1fr) 390px;
  }

  .hero-title {
    font-size: 48px;
  }

  .hero-copy {
    font-size: 12.5px;
  }
}

@media (max-height: 700px) and (min-width: 861px) {
  .chat-card {
    height: calc(100dvh - 165px);
    min-height: 500px;
  }

  .customer-footer {
    display: none;
  }

  .start-panel {
    padding-top: 24px;
    padding-bottom: 20px;
  }

  .start-avatar-wrap {
    margin-bottom: 12px;
  }

  .start-panel h2 {
    font-size: 23px;
  }

  .start-copy {
    margin-top: 9px;
    line-height: 1.7;
  }

  .start-form {
    margin-top: 17px;
  }

  .start-foot {
    margin-top: 14px;
  }

  .hero-note {
    margin-top: 20px;
  }
}

/* ==========================================================================
   Motion
   ========================================================================== */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes typing-bounce {
  0%,
  60%,
  100% {
    opacity: 0.4;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-2.5px);
  }
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

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

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