:root {
  --green: #338938;
  --green-deep: #1f6a2f;
  --green-soft: #edf7ee;
  --green-soft-strong: #dff0e1;
  --white: #ffffff;
  --text: #122117;
  --muted: #5d6e63;
  --line: rgba(18, 33, 23, 0.08);
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --shadow: 0 14px 34px rgba(21, 41, 27, 0.06);
  --shadow-soft: 0 8px 18px rgba(21, 41, 27, 0.045);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(51, 137, 56, 0.18), transparent 26%),
    radial-gradient(circle at bottom right, rgba(125, 199, 127, 0.18), transparent 22%),
    linear-gradient(180deg, #f7faf7 0%, #f2f5f2 48%, #eef3ef 100%);
}

button,
textarea,
input {
  font: inherit;
}

button {
  border: 0;
}

.page-shell {
  min-height: 100vh;
  padding: 14px;
  display: grid;
  gap: 14px;
  overflow-x: clip;
}

.brand-stage,
.chat-stage__workspace {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand-stage {
  border-radius: 34px;
  background:
    linear-gradient(150deg, rgba(23, 58, 33, 0.98), rgba(37, 99, 52, 0.96) 52%, rgba(109, 184, 113, 0.92) 100%);
  color: var(--white);
}

.brand-stage__glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(8px);
}

.brand-stage__glow--one {
  width: 220px;
  height: 220px;
  top: -50px;
  right: -30px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
}

.brand-stage__glow--two {
  width: 260px;
  height: 260px;
  left: -90px;
  bottom: -120px;
  background: radial-gradient(circle, rgba(181, 235, 174, 0.28), rgba(181, 235, 174, 0));
}

.brand-stage__content {
  position: relative;
  z-index: 1;
  padding: 22px;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo,
.chat-stage__logo {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #f3f8f3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 24px rgba(8, 15, 10, 0.14);
  border: 1px solid rgba(18, 33, 23, 0.08);
}

.brand-logo {
  width: 74px;
  height: 74px;
  padding: 9px;
}

.chat-stage__logo {
  width: 54px;
  height: 54px;
  padding: 7px;
}

.brand-logo img,
.chat-stage__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(18, 33, 23, 0.04);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.1));
}

.brand-header__text h1,
.chat-stage__header h2 {
  margin: 0;
  font-family: "Poppins", "Inter", sans-serif;
}

.brand-header__text h1 {
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 0.98;
}

.eyebrow,
.welcome-panel__eyebrow,
.dialog-card__eyebrow {
  margin: 0 0 8px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

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

.brand-copy {
  max-width: 34rem;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.99rem;
  line-height: 1.75;
}

.brand-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 11px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.92rem;
}

.brand-note__status,
.status-pill__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9bff9f;
}

.service-dock {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.service-dock__button,
.welcome-chip {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.service-dock__button {
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.service-dock__button:hover,
.service-dock__button:focus-visible,
.welcome-chip:hover,
.welcome-chip:focus-visible,
.message__chip:hover,
.message__chip:focus-visible,
.attach-button:hover,
.attach-button:focus-visible,
.send-button:hover,
.send-button:focus-visible,
.header-action:hover,
.header-action:focus-visible,
.dialog-button:hover,
.dialog-button:focus-visible {
  transform: translateY(-1px);
}

.service-dock__button:hover,
.service-dock__button:focus-visible {
  background: rgba(255, 255, 255, 0.18);
}

.service-dock__icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.9rem;
}

.insight-strip {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.insight-strip div {
  padding: 16px 16px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.insight-strip strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.insight-strip span {
  display: block;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.6;
  font-size: 0.9rem;
}

.chat-stage {
  min-height: 0;
}

.chat-stage__workspace {
  min-height: calc(100svh - 28px);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(250, 252, 250, 0.9)),
    radial-gradient(circle at top, rgba(51, 137, 56, 0.06), transparent 46%);
  display: flex;
  flex-direction: column;
}

.chat-stage__header {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(14px);
}

.chat-stage__identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-stage__header h2 {
  font-size: 1rem;
  line-height: 1.1;
}

.chat-stage__subline {
  margin: 5px 0 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-stage__subcopy {
  color: var(--muted);
  font-size: 0.84rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 0.76rem;
  font-weight: 700;
}

.status-pill__dot {
  box-shadow: 0 0 0 6px rgba(51, 137, 56, 0.12);
  background: var(--green);
}

.header-action {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f5f8f5;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-size: 0.84rem;
}

.welcome-panel {
  margin: 12px 14px 0;
  padding: 14px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(243, 249, 244, 0.98), rgba(250, 252, 250, 0.96)),
    radial-gradient(circle at top right, rgba(51, 137, 56, 0.1), transparent 42%);
  border: 1px solid rgba(51, 137, 56, 0.07);
  box-shadow: var(--shadow-soft);
}

.welcome-panel__eyebrow,
.dialog-card__eyebrow {
  color: var(--green);
}

.welcome-panel__text {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.94rem;
}

.welcome-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.welcome-chip {
  min-height: 40px;
  background: var(--white);
  color: var(--green-deep);
  box-shadow: 0 6px 16px rgba(51, 137, 56, 0.05);
  justify-content: center;
  border: 1px solid rgba(51, 137, 56, 0.08);
}

.messages {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 14px 118px;
  scroll-behavior: smooth;
}

.messages::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(51, 137, 56, 0.05), transparent 28%),
    linear-gradient(90deg, rgba(18, 33, 23, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(18, 33, 23, 0.02) 1px, transparent 1px);
  background-size: auto, 24px 24px, 24px 24px;
  pointer-events: none;
}

.message {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  margin-bottom: 12px;
  animation: message-in 0.28s ease both;
}

.message--agent {
  justify-content: flex-start;
}

.message--user {
  justify-content: flex-end;
}

.message__bubble {
  max-width: 92%;
  padding: 12px 13px 11px;
  border-radius: 18px;
  line-height: 1.55;
  white-space: pre-line;
}

.message--agent .message__bubble {
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid rgba(18, 33, 23, 0.05);
  border-bottom-left-radius: 10px;
  box-shadow: var(--shadow-soft);
}

.messages .message--agent:first-child .message__bubble {
  background:
    linear-gradient(180deg, rgba(246, 251, 247, 1), rgba(255, 255, 255, 0.98)),
    radial-gradient(circle at top right, rgba(51, 137, 56, 0.08), transparent 44%);
  border-color: rgba(51, 137, 56, 0.1);
}

.message--user .message__bubble {
  background: linear-gradient(180deg, #338938, #2a742f);
  color: var(--white);
  border-bottom-right-radius: 10px;
  box-shadow: 0 8px 18px rgba(51, 137, 56, 0.14);
}

.message__meta {
  display: block;
  margin-bottom: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(18, 33, 23, 0.46);
}

.message--user .message__meta {
  color: rgba(255, 255, 255, 0.72);
}

.message__chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.message__chip {
  width: 100%;
  min-height: 36px;
  padding: 0 11px;
  border-radius: 999px;
  background: #f6faf6;
  color: var(--green-deep);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid rgba(51, 137, 56, 0.08);
}

.attachment-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(18, 33, 23, 0.05);
  font-size: 0.88rem;
}

.message--user .attachment-tag {
  background: rgba(255, 255, 255, 0.14);
}

.composer {
  position: sticky;
  bottom: 0;
  z-index: 9;
  margin-top: 0;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(242, 245, 242, 0), rgba(247, 249, 247, 0.84) 26%, rgba(247, 249, 247, 0.96) 100%);
}

.composer__attachments {
  display: none;
}

.composer__attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(51, 137, 56, 0.1);
  color: var(--green-deep);
  font-size: 0.9rem;
}

.composer__attachment-pill button {
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

.composer__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(18, 33, 23, 0.045);
  box-shadow: 0 8px 18px rgba(21, 41, 27, 0.045);
}

.send-button {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 15px;
  background: linear-gradient(180deg, #338938, #2b752f);
  color: var(--white);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(51, 137, 56, 0.14);
}

#userInput {
  min-height: 44px;
  max-height: 132px;
  width: 100%;
  resize: none;
  border: 1px solid rgba(18, 33, 23, 0.045);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.95);
  padding: 11px 14px;
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

#userInput::placeholder {
  color: #8b9890;
}

#userInput:focus {
  border-color: rgba(51, 137, 56, 0.26);
  box-shadow: 0 0 0 4px rgba(51, 137, 56, 0.1);
}

.composer--locked .composer__row {
  background: rgba(247, 250, 247, 0.94);
}

.composer--locked #userInput {
  background: rgba(244, 247, 244, 0.92);
  color: #8b9890;
  cursor: not-allowed;
}

.send-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.message__datepicker {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(51, 137, 56, 0.04);
  border: 1px solid rgba(51, 137, 56, 0.08);
}

.message__date-field {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green-deep);
}

.message__date-input {
  min-height: 44px;
  border: 1px solid rgba(18, 33, 23, 0.08);
  border-radius: 14px;
  background: #ffffff;
  padding: 0 14px;
  color: var(--text);
  outline: none;
}

.message__date-input:focus {
  border-color: rgba(51, 137, 56, 0.26);
  box-shadow: 0 0 0 4px rgba(51, 137, 56, 0.1);
}

.message__date-submit {
  width: 100%;
  min-height: 40px;
  border-radius: 13px;
  background: linear-gradient(180deg, #338938, #2b752f);
  color: var(--white);
  font-weight: 700;
  cursor: pointer;
}

.message__date-submit:disabled {
  opacity: 0.55;
  cursor: default;
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(18, 33, 23, 0.3);
  animation: typing 1.05s infinite ease-in-out;
}

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

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

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  padding: 18px;
  display: grid;
  place-items: center;
  background: rgba(8, 18, 11, 0.46);
  backdrop-filter: blur(8px);
}

.dialog-backdrop[hidden] {
  display: none !important;
}

.dialog-card {
  width: min(100%, 420px);
  padding: 22px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 70px rgba(21, 41, 27, 0.18);
}

.dialog-card h3 {
  margin: 0;
  font-family: "Poppins", "Inter", sans-serif;
  font-size: 1.2rem;
  line-height: 1.3;
}

.dialog-card__text {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.dialog-card__actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.dialog-button {
  min-height: 46px;
  flex: 1;
  border-radius: 16px;
  cursor: pointer;
}

.dialog-button--ghost {
  background: #f3f6f3;
  color: var(--text);
}

.dialog-button--primary {
  background: linear-gradient(180deg, #338938, #2b752f);
  color: var(--white);
  font-weight: 700;
}

@keyframes typing {
  0%,
  80%,
  100% {
    transform: scale(0.82);
    opacity: 0.4;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

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

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (min-width: 760px) {
  .page-shell {
    padding: 18px;
  }

  .brand-stage__content {
    padding: 26px;
  }

  .insight-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .welcome-panel {
    margin-left: 18px;
    margin-right: 18px;
  }

  .messages {
    padding-left: 18px;
    padding-right: 18px;
  }

  .message__bubble {
    max-width: 80%;
  }

  .message__chips {
    display: flex;
    flex-wrap: wrap;
  }

  .message__chip {
    width: auto;
  }

  .composer__row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (min-width: 1100px) {
  .page-shell {
    grid-template-columns: minmax(340px, 0.92fr) minmax(420px, 1.08fr);
    align-items: stretch;
    gap: 18px;
    min-height: 100vh;
  }

  .brand-stage {
    min-height: calc(100vh - 36px);
  }

  .brand-stage__content {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    justify-content: flex-end;
    padding: 34px;
  }

  .brand-logo {
    width: 92px;
    height: 92px;
  }

  .brand-copy {
    font-size: 1.03rem;
    max-width: 28rem;
  }

  .chat-stage {
    min-height: calc(100vh - 36px);
  }

  .chat-stage__workspace {
    min-height: calc(100svh - 36px);
  }

  .chat-stage__header {
    padding: 18px 20px 16px;
  }

  .messages {
    padding-bottom: 130px;
  }
}

@media (max-width: 1099px) {
  .brand-stage {
    display: none;
  }

  .page-shell {
    display: block;
    padding: 0;
  }

  .chat-stage__workspace {
    min-height: 100svh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    box-shadow: none;
  }
}

@media (max-width: 420px) {
  .page-shell {
    padding: 0;
    gap: 0;
  }

  .chat-stage__header {
    padding-left: 14px;
    padding-right: 14px;
  }

  .chat-stage__header {
    align-items: center;
    gap: 10px;
  }

  .chat-stage__identity {
    gap: 10px;
  }

  .chat-stage__logo {
    width: 46px;
    height: 46px;
    padding: 6px;
  }

  .chat-stage__header h2 {
    font-size: 0.98rem;
  }

  .chat-stage__subcopy {
    display: none;
  }

  .header-action {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.8rem;
  }

  .welcome-panel {
    margin: 8px 12px 0;
    padding: 12px;
    border-radius: 18px;
  }

  .welcome-panel__text {
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .welcome-panel__actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .welcome-chip {
    min-height: 42px;
    padding: 0 10px;
    font-size: 0.84rem;
  }

  .message__bubble {
    max-width: 96%;
    padding: 11px 12px 10px;
    font-size: 0.93rem;
  }

  .message__meta {
    margin-bottom: 7px;
    font-size: 0.7rem;
  }

  .messages {
    padding: 12px 12px 108px;
  }

  .composer {
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  }

  .composer__row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 7px;
    border-radius: 20px;
  }

  .send-button {
    min-height: 40px;
    min-width: 58px;
    padding: 0 11px;
    font-size: 0.84rem;
  }

  #userInput {
    min-height: 42px;
    padding: 10px 13px;
    border-radius: 14px;
  }

  .message__datepicker {
    padding: 9px;
    border-radius: 14px;
  }

  .message__date-field {
    font-size: 0.84rem;
  }

  .message__date-input,
  .message__date-submit {
    min-height: 44px;
  }
}
