:root {
  --ink: #15313b;
  --muted: #5e747c;
  --brand: #087d78;
  --brand-deep: #05615f;
  --accent: #d5f3ea;
  --page: #f2f7f6;
  --card: #ffffff;
  --line: #dce8e6;
  --shadow: 0 18px 45px rgba(14, 64, 69, .10);
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% 0%, #d9f4ec 0, transparent 25rem),
    radial-gradient(circle at 100% 100%, #e2eff9 0, transparent 25rem),
    var(--page);
  font-family: Tahoma, Arial, sans-serif;
}

button, input { font: inherit; }

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 22px 18px;
  border-radius: 22px;
  color: white;
  background: linear-gradient(135deg, var(--brand-deep), #13948b);
  box-shadow: var(--shadow);
}

.brand-mark {
  flex: 0 0 45px;
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 14px;
  background: rgba(255, 255, 255, .15);
  font-size: 24px;
}

.eyebrow {
  margin: 0 0 5px;
  color: #c8f4e9;
  direction: ltr;
  font-size: .66rem;
  letter-spacing: .08em;
}

h1 { margin: 0; font-size: clamp(1.08rem, 4.5vw, 1.45rem); }
.subtitle { margin: 7px 0 0; color: #e0f8f3; font-size: .83rem; }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid #cfe9e2;
  border-radius: 14px;
  background: #f5fffc;
  color: #406168;
  font-size: .82rem;
  line-height: 1.8;
}

.notice span {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--brand);
  font-family: Georgia, serif;
  font-weight: bold;
}
.notice p { margin: 0; }

.chat {
  flex: 1;
  min-height: 330px;
  max-height: 52vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 2px;
  scroll-behavior: smooth;
}

.message {
  width: fit-content;
  max-width: min(88%, 620px);
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.9;
  font-size: .92rem;
  box-shadow: 0 4px 14px rgba(14, 64, 69, .05);
}
.message p { margin: 4px 0 0; white-space: pre-wrap; }
.message--assistant { align-self: flex-start; border: 1px solid var(--line); background: var(--card); border-top-right-radius: 4px; }
.message--user { align-self: flex-end; color: #11423f; background: var(--accent); border-top-left-radius: 4px; }
.message__label { color: var(--brand); font-size: .73rem; font-weight: bold; }
.message--loading { color: var(--muted); }

.typing { display: inline-flex; gap: 4px; align-items: center; height: 18px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #77a49c; animation: pulse 1s infinite alternate; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { to { opacity: .25; transform: translateY(-2px); } }

.suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.suggestion {
  padding: 8px 11px;
  border: 1px solid #b8dcd3;
  border-radius: 999px;
  color: #176762;
  background: rgba(255,255,255,.72);
  cursor: pointer;
  font-size: .8rem;
}
.suggestion:hover { background: #e5f8f1; }

.composer { display: flex; gap: 9px; padding-top: 2px; }
.composer input {
  min-width: 0;
  flex: 1;
  padding: 13px 14px;
  border: 1px solid #cbdcda;
  border-radius: 14px;
  outline: 0;
  color: var(--ink);
  background: white;
}
.composer input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(8, 125, 120, .12); }
.composer button {
  min-width: 87px;
  padding: 0 13px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: var(--brand);
  cursor: pointer;
  font-weight: bold;
}
.composer button:hover { background: var(--brand-deep); }
.composer button:disabled { cursor: wait; opacity: .65; }
.send-icon { display: inline-block; margin-right: 3px; font-size: 1.1rem; }
.footer-note { margin: 0; color: #789097; text-align: center; font-size: .72rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 420px) {
  .app-shell { padding-right: 11px; padding-left: 11px; }
  .hero { padding: 18px 14px; }
  .chat { min-height: 300px; }
  .composer button span:first-child { display: none; }
  .composer button { min-width: 50px; }
  .send-icon { margin: 0; }
}
