:root { color-scheme: light; --text: #203731; --muted: #75847d; --accent: #08766f; --line: #e4ebe7; }
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: #f3f6f4; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, textarea { font: inherit; }
button { padding: 10px 15px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: white; cursor: pointer; }
button:hover { background: #edf5f1; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.app-shell { max-width: 960px; height: 100dvh; margin: auto; display: flex; flex-direction: column; padding: 0 32px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent); color: white; font-size: 24px; font-weight: 700; }
h1 { margin: 0; font-size: 18px; letter-spacing: -.4px; }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; padding: 28px 4px; }
.message { max-width: 88%; align-self: flex-start; }
.message-label { margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.message-body { padding: 16px 20px; border-radius: 4px 18px 18px; background: white; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.message.user { align-self: flex-end; }
.user .message-label { text-align: right; }
.user .message-body { background: #e0efea; border-radius: 18px 4px 18px 18px; }
.error .message-body { background: #fff0eb; color: #a43f2c; }
.composer { margin-bottom: 24px; padding: 16px; background: white; border: 1px solid #d8e4de; border-radius: 18px; box-shadow: 0 8px 30px #20373108; }
textarea { display: block; width: 100%; min-height: 64px; max-height: 160px; resize: vertical; padding: 4px; border: 0; background: transparent; color: var(--text); line-height: 1.6; }
textarea:focus { outline: none; }
.composer:focus-within { border-color: var(--accent); }
textarea::placeholder { color: #8e9a94; }
.primary { color: white; background: var(--accent); border-color: var(--accent); }
.primary:hover { background: #075e58; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 600px) {
  .app-shell { padding: 0 16px; }
  .topbar { padding: 18px 0; }
  h1 { font-size: 15px; }
  .brand-mark { width: 36px; height: 36px; }
  .topbar button { padding: 9px; font-size: 12px; }
  .message { max-width: 94%; }
}

[hidden] { display: none !important; }
.login-panel { max-width: 380px; margin: 12vh auto; padding: 28px; }
.login-panel form { display: grid; gap: 12px; }
.login-panel input { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.login-panel input:focus-visible { outline: 2px solid var(--accent); }
#loginError { font-size: 14px; color: #a43f2c; margin: 0; }

.feedback { margin-top: 8px; padding: 5px 10px; font-size: 12px; color: var(--muted); background: transparent; }
.transfer-note { color: var(--muted); font-size: 12px; margin-top: 8px; }
.references { margin: 8px 0; padding-left: 20px; font-size: 12px; overflow-wrap: anywhere; }
.references a { color: var(--accent); }
@media (max-width: 600px) { .topbar { flex-wrap: wrap; } }
