:root {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #10213f;
  background: #f3f6fb;
  font-synthesis: none;
  --blue: #1e60d4;
  --blue-dark: #174ca8;
  --green: #27983b;
  --navy: #10213f;
  --muted: #5e6a7f;
  --line: #dbe3ef;
  --surface: rgba(255, 255, 255, 0.96);
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(38, 96, 220, 0.16), transparent 34rem),
    radial-gradient(circle at 94% 18%, rgba(39, 152, 59, 0.10), transparent 28rem),
    #f3f6fb;
}

button, input, textarea { font: inherit; }

.page-shell {
  width: min(1120px, calc(100% - 42px));
  margin: 0 auto;
  padding: 30px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 235px;
  align-items: center;
  gap: 26px;
  margin-bottom: 28px;
}

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

.brand-card {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  padding: 0;
  overflow: visible;
}

.brand-logo {
  display: block;
  width: 100%;
  max-width: 235px;
  height: auto;
  max-height: 102px;
  object-fit: contain;
  object-position: center;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.2rem, 4.3vw, 3.35rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

h2 {
  margin-bottom: 7px;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
}

.eyebrow,
.section-kicker {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-kicker {
  margin-bottom: 5px;
  color: var(--green);
}

.subtitle,
.supporting-text,
.privacy-note,
.status {
  color: var(--muted);
  line-height: 1.58;
}

.subtitle {
  max-width: none;
  margin-bottom: 0;
  font-size: clamp(0.94rem, 1.35vw, 1.04rem);
  white-space: nowrap;
}

.card {
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 18px 55px rgba(31, 48, 78, 0.10);
}

.hidden { display: none; }

.section-heading { margin-bottom: 20px; }
.section-heading .supporting-text { margin-bottom: 0; }

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 760;
}

.start-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}

input, textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #b8c4d5;
  border-radius: 11px;
  color: var(--navy);
  background: #fff;
}

input:focus, textarea:focus {
  outline: 3px solid rgba(30, 96, 212, 0.17);
  border-color: var(--blue);
}

textarea {
  resize: vertical;
  min-height: 90px;
}

button {
  min-height: 48px;
  padding: 12px 20px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #356ef0);
  box-shadow: 0 9px 22px rgba(30, 96, 212, 0.20);
  font-weight: 780;
  cursor: pointer;
}

button:hover:not(:disabled) { filter: brightness(0.95); }
button:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.secondary { background: #626e82; box-shadow: none; }

.privacy-note {
  margin: 18px 0 0;
  font-size: 0.9rem;
}

.chat-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e2e7ef;
}

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

.chat-logo {
  width: 86px;
  height: 52px;
  flex: 0 0 auto;
  object-fit: contain;
}

.chat-heading p { margin-bottom: 0; }

.counter {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--blue);
  background: #edf3ff;
  font-size: 0.86rem;
  font-weight: 780;
  white-space: nowrap;
}

.messages {
  height: min(520px, 58vh);
  margin: 22px 0;
  padding: 16px;
  overflow-y: auto;
  border: 1px solid #e1e6ee;
  border-radius: 15px;
  background: #f7f9fc;
}

.message {
  width: min(80%, 650px);
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  line-height: 1.55;
}

.message strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.83rem;
}

.message p {
  margin: 0;
  white-space: pre-wrap;
}

.message.assistant {
  margin-right: auto;
  border: 1px solid #dce3ec;
  background: #fff;
}

.message.user {
  margin-left: auto;
  background: #dfe9ff;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.status {
  min-height: 23px;
  margin: 12px 0 0;
  font-size: 0.92rem;
}

.visually-hidden {
  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: 780px) {
  .page-shell {
    width: min(100% - 22px, 1120px);
    padding: 24px 0 38px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  h1,
  .subtitle {
    white-space: normal;
  }

  .brand-card {
    justify-content: flex-start;
  }

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

  .start-controls { grid-template-columns: 1fr; }
  .chat-heading { align-items: flex-start; flex-direction: column; }
  .message { width: 94%; }
  .actions { flex-direction: column; }
}

@media (max-width: 440px) {
  .card { padding: 18px; border-radius: 17px; }
  .chat-logo { width: 70px; height: 44px; }
  .messages { padding: 12px; }
}
