:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #edf2f6;
  color: #13243a;
}

* { box-sizing: border-box; }

body { margin: 0; min-height: 100vh; }

button, textarea { font: inherit; }

.shell {
  width: min(960px, calc(100% - 32px));
  min-height: calc(100vh - 48px);
  margin: 24px auto;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  background: #fff;
  border: 1px solid #d6e0e8;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgb(16 38 65 / 10%);
  overflow: hidden;
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px 28px;
  background: #102b4e;
  color: #fff;
}

.eyebrow { margin: 0 0 4px; color: #8fc8f5; font-size: .75rem; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; font-size: clamp(1.35rem, 4vw, 2rem); }
.status { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: .85rem; }
.status span { width: 9px; height: 9px; border-radius: 50%; background: #74d69a; box-shadow: 0 0 0 4px rgb(116 214 154 / 14%); }

.notice { padding: 12px 28px; background: #eaf6ee; border-bottom: 1px solid #cfe7d7; color: #254f35; font-size: .9rem; }
.transcript { min-height: 360px; padding: 28px; overflow-y: auto; background: linear-gradient(#f9fbfc, #f4f7f9); }
.message { max-width: 78%; margin: 0 0 18px; padding: 14px 16px; border-radius: 14px; line-height: 1.5; box-shadow: 0 4px 14px rgb(23 43 69 / 6%); }
.message p { margin: 0; white-space: pre-wrap; }
.message-label { margin-bottom: 6px !important; color: #577087; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.user-message { margin-left: auto; background: #173f70; color: #fff; border-bottom-right-radius: 4px; }
.user-message .message-label { color: #bcd7ed; }
.assistant-message, .system-message { background: #fff; border: 1px solid #dce5ec; border-bottom-left-radius: 4px; }
.error-message { background: #fff3f1; border: 1px solid #f1c7c0; color: #7c271e; }

.composer { padding: 20px 28px 24px; border-top: 1px solid #dce5ec; }
.composer label { display: block; margin-bottom: 8px; font-size: .82rem; font-weight: 800; }
textarea { width: 100%; resize: vertical; min-height: 96px; padding: 13px 14px; border: 1px solid #afbfcc; border-radius: 10px; color: #13243a; }
textarea:focus { outline: 3px solid rgb(42 120 183 / 18%); border-color: #2a78b7; }
.composer-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 12px; }
.composer-footer p { margin: 0; color: #607487; font-size: .78rem; }
button { border: 0; border-radius: 9px; padding: 11px 20px; background: #196ca8; color: #fff; font-weight: 800; cursor: pointer; }
button:hover { background: #115b8e; }
button:disabled { opacity: .55; cursor: wait; }

@media (max-width: 640px) {
  .shell { width: 100%; min-height: 100vh; margin: 0; border: 0; border-radius: 0; }
  .masthead, .notice, .transcript, .composer { padding-left: 18px; padding-right: 18px; }
  .message { max-width: 92%; }
  .composer-footer { align-items: flex-end; }
}
