:root {
  --bg: #f2ede3;
  --bg-accent: #d6e3de;
  --panel: rgba(255, 250, 244, 0.78);
  --card: #fffdf8;
  --line: rgba(33, 46, 58, 0.12);
  --ink: #18212b;
  --ink-soft: rgba(24, 33, 43, 0.68);
  --brand: #0b8f69;
  --brand-deep: #0a664d;
  --brand-wash: rgba(11, 143, 105, 0.1);
  --customer: #d9eaf9;
  --assistant: #fffdf8;
  --shadow: 0 30px 80px rgba(38, 49, 62, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(11, 143, 105, 0.18), transparent 26%),
    radial-gradient(circle at bottom right, rgba(138, 97, 56, 0.12), transparent 30%),
    linear-gradient(180deg, var(--bg) 0%, #ece6da 100%);
  font-family: "Noto Sans SC", "IBM Plex Sans", sans-serif;
}

button,
textarea,
input {
  font: inherit;
}

.shell {
  width: min(1360px, calc(100vw - 28px));
  margin: 24px auto;
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(360px, 520px);
  gap: 28px;
  justify-content: center;
}

.brand-panel {
  align-self: center;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brand-deep);
}

.brand-panel h1 {
  margin: 16px 0 0;
  font-size: clamp(38px, 5vw, 66px);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.lead {
  margin: 18px 0 0;
  max-width: 34rem;
  color: var(--ink-soft);
  line-height: 1.85;
}

.status-card,
.notice-grid article {
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow);
}

.status-card {
  margin-top: 28px;
  padding: 22px;
  border-radius: 28px;
}

.status-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--ink-soft);
}

.progress-label {
  display: block;
  margin-top: 14px;
  font-size: 28px;
  line-height: 1.15;
}

.stage-goal {
  margin: 10px 0 0;
  color: var(--ink-soft);
  line-height: 1.75;
}

.milestone-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.milestone {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.milestone-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(24, 33, 43, 0.16);
}

.milestone.current {
  background: rgba(11, 143, 105, 0.12);
}

.milestone.current .milestone-dot {
  background: var(--brand);
  box-shadow: 0 0 0 6px rgba(11, 143, 105, 0.12);
}

.milestone.completed .milestone-dot {
  background: #b78542;
}

.notice-grid {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.notice-grid article {
  padding: 18px 20px;
  border-radius: 22px;
}

.notice-grid h2 {
  margin: 0;
  font-size: 17px;
}

.notice-grid p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  line-height: 1.75;
}

.chat-panel {
  display: flex;
  justify-content: center;
}

.chat-card {
  width: min(100%, 500px);
  min-height: 860px;
  display: flex;
  flex-direction: column;
  border-radius: 34px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(214, 227, 222, 0.86) 0%, rgba(245, 242, 234, 0.96) 100%);
  border: 1px solid rgba(24, 33, 43, 0.06);
  box-shadow: 0 44px 120px rgba(38, 49, 62, 0.18);
}

.chat-header,
.composer {
  background: rgba(255, 251, 245, 0.9);
  backdrop-filter: blur(12px);
}

.chat-header {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid rgba(24, 33, 43, 0.08);
}

.avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  font-weight: 700;
}

.header-copy strong,
.header-copy span {
  display: block;
}

.header-copy strong {
  font-size: 16px;
}

.header-copy span {
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-soft);
}

.upload-button,
.ghost-button,
.secondary-button,
.send-button {
  border: 0;
  cursor: pointer;
}

.upload-button,
.ghost-button,
.secondary-button {
  padding: 10px 14px;
  border-radius: 999px;
}

.upload-button {
  background: rgba(11, 143, 105, 0.12);
  color: var(--brand-deep);
}

.ghost-button,
.secondary-button {
  background: rgba(24, 33, 43, 0.06);
  color: var(--ink);
}

.stage-banner {
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(24, 33, 43, 0.06);
}

.stage-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--brand-wash);
  color: var(--brand-deep);
  font-size: 12px;
}

.stage-banner strong {
  display: block;
  margin-top: 10px;
  font-size: 22px;
}

.stage-banner p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.timeline {
  flex: 1;
  overflow: auto;
  padding: 18px 16px 10px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 240px;
  color: var(--ink-soft);
}

.message-row + .message-row,
.typing {
  margin-top: 14px;
}

.message-meta {
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--ink-soft);
}

.message-row.customer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.message-row.customer .message-meta {
  text-align: right;
}

.message-bubble {
  max-width: 86%;
  padding: 12px 14px;
  border-radius: 20px;
  background: var(--assistant);
  border-top-left-radius: 8px;
  box-shadow: 0 12px 30px rgba(38, 49, 62, 0.08);
}

.message-row.customer .message-bubble {
  background: var(--customer);
  border-top-left-radius: 20px;
  border-top-right-radius: 8px;
}

.message-row.system .message-bubble {
  background: rgba(24, 33, 43, 0.06);
  border-radius: 16px;
}

.message-text {
  line-height: 1.78;
  white-space: pre-wrap;
}

.message-attachment {
  margin-top: 10px;
}

.attachment-image {
  display: block;
  max-width: 220px;
  border-radius: 16px;
  border: 1px solid rgba(24, 33, 43, 0.08);
}

.attachment-link {
  color: var(--brand-deep);
  text-decoration: none;
}

.typing {
  color: var(--ink-soft);
  font-size: 13px;
}

.quick-actions {
  padding: 12px 14px 0;
}

.section-head {
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--ink-soft);
}

.quick-replies {
  display: flex;
  gap: 10px;
  overflow: auto;
  padding-bottom: 6px;
}

.quick-reply {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid rgba(11, 143, 105, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--brand-deep);
  cursor: pointer;
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid rgba(24, 33, 43, 0.08);
}

.attachment-dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(11, 143, 105, 0.08);
  color: var(--brand-deep);
}

.composer textarea {
  min-height: 58px;
  max-height: 180px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(24, 33, 43, 0.1);
  resize: none;
  outline: none;
  background: #fff;
}

.composer textarea:focus {
  border-color: rgba(11, 143, 105, 0.28);
}

.composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.send-button {
  padding: 12px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
}

.send-button:disabled,
.ghost-button:disabled,
.secondary-button:disabled,
.quick-reply:disabled,
.upload-button.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 1040px) {
  .shell {
    grid-template-columns: 1fr;
    width: min(100vw - 20px, 100%);
  }

  .brand-panel {
    order: 2;
  }

  .chat-panel {
    order: 1;
  }
}
