:root {
  --ocean-950: #063044;
  --ocean-850: #0b4d66;
  --ocean-700: #0f6f8f;
  --ocean-500: #35a6c8;
  --ocean-120: #d8f4f8;
  --ocean-60: #f0fbfc;
  --coral-650: #d95b35;
  --coral-120: #ffe4d6;
  --sun-220: #ffe79c;
  --mint-140: #d8f4df;
  --ink: #17202a;
  --muted: #506577;
  --line: #c4dfe7;
  --white: #ffffff;
  --shadow: 0 16px 36px rgba(6, 48, 68, 0.14);
  color-scheme: light;
  font-family: "Segoe UI", "Nunito", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(53, 166, 200, 0.18), rgba(255, 231, 156, 0.18)),
    var(--ocean-60);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: auto 0 0;
  height: 120px;
  pointer-events: none;
  background:
    radial-gradient(60px 28px at 12% 82%, rgba(53, 166, 200, 0.12), transparent 70%),
    radial-gradient(90px 34px at 72% 84%, rgba(217, 91, 53, 0.1), transparent 70%);
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  max-width: 940px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px 18px;
  overflow: hidden;
  color: var(--white);
  background: linear-gradient(135deg, var(--ocean-950), var(--ocean-700));
  border-bottom: 4px solid var(--sun-220);
}

.topbar::after {
  content: "≈ ≈ ≈";
  position: absolute;
  right: 82px;
  bottom: 8px;
  color: rgba(255, 255, 255, 0.28);
  font-size: 1.4rem;
  letter-spacing: 10px;
}

.brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brand-mark {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(6, 48, 68, 0.22);
}

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

.eyebrow,
.subtitle,
h1 {
  margin: 0;
}

.eyebrow {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 231, 156, 0.18);
  color: var(--sun-220);
  font-size: 0.78rem;
  font-weight: 800;
}

h1 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 2.08rem;
  line-height: 1;
  font-weight: 900;
}

h1 span {
  font-size: 1.42rem;
}

.subtitle {
  margin-top: 6px;
  color: #d7f4f8;
  font-size: 0.96rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.icon-button,
.send-button {
  display: grid;
  place-items: center;
  border: 0;
  flex: 0 0 auto;
}

.icon-button {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.14);
}

.icon-button:hover,
.icon-button:focus-visible {
  background: rgba(255, 255, 255, 0.22);
}

.icon-button svg,
.send-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-area {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 0;
  padding: 16px;
  gap: 14px;
}

.mode-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 10px 26px rgba(6, 48, 68, 0.06);
}

.mode-strip-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--ocean-120);
  font-size: 1.38rem;
}

.mode-strip p,
.mode-strip span {
  margin: 0;
}

.mode-strip p {
  color: var(--ocean-950);
  font-size: 1.06rem;
  font-weight: 900;
}

.mode-strip div > span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 700;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 2px 10px;
  scroll-behavior: smooth;
}

.message {
  width: fit-content;
  max-width: min(78%, 620px);
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 22px rgba(6, 48, 68, 0.08);
}

.message-text {
  margin: 0;
}

.message-assistant {
  align-self: flex-start;
  background: var(--white);
  border: 1px solid var(--line);
  border-top-left-radius: 6px;
}

.message-user {
  align-self: flex-end;
  color: var(--white);
  background: linear-gradient(135deg, var(--ocean-700), var(--ocean-500));
  border-top-right-radius: 6px;
}

.message-error {
  border-color: var(--coral-650);
  color: #7b2c17;
  background: var(--coral-120);
}

.visual-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.visual-card {
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  height: 66px;
  overflow: hidden;
  border: 1px solid rgba(15, 111, 143, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(160deg, rgba(216, 244, 248, 0.92), rgba(255, 231, 156, 0.45)),
    var(--ocean-120);
}

.visual-emoji {
  position: relative;
  z-index: 1;
  font-size: 2rem;
}

.visual-wave {
  position: absolute;
  inset: auto -6px 7px;
  height: 16px;
  background:
    radial-gradient(18px 10px at 18px 4px, rgba(15, 111, 143, 0.26) 44%, transparent 46%) repeat-x;
  background-size: 34px 14px;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(6, 48, 68, 0.08);
}

.composer textarea {
  width: 100%;
  max-height: 132px;
  min-height: 44px;
  resize: none;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  line-height: 1.35;
}

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

.send-button {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: var(--white);
  background: var(--coral-650);
  box-shadow: 0 9px 16px rgba(217, 91, 53, 0.24);
}

.send-button:hover,
.send-button:focus-visible {
  filter: brightness(0.96);
}

.send-button:disabled,
.composer textarea:disabled {
  cursor: wait;
  opacity: 0.64;
}

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

@media (max-width: 700px) {
  .app-shell {
    max-width: none;
    box-shadow: none;
  }

  .topbar {
    padding: 14px;
  }

  .topbar::after {
    right: 64px;
    font-size: 1rem;
    letter-spacing: 7px;
  }

  .brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 14px;
  }

  h1 {
    font-size: 1.72rem;
  }

  h1 span {
    font-size: 1.18rem;
  }

  .subtitle {
    max-width: 235px;
    font-size: 0.84rem;
  }

  .chat-area {
    padding: 12px;
  }

  .mode-strip {
    min-height: 58px;
    border-radius: 14px;
  }

  .message {
    max-width: 92%;
  }

}
