/* V0 — functional, not pretty. */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: #f3f3f0;
  color: #1a1a1a;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.4;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- login ---- */

.login-card {
  margin: 80px auto 0;
  padding: 24px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  max-width: 360px;
}

.login-card h1 {
  margin: 0 0 4px;
  font-size: 20px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.login-form input {
  padding: 8px 10px;
  border: 1px solid #bbb;
  border-radius: 4px;
  font-size: 15px;
}

.login-form button {
  padding: 9px 14px;
  background: #2b6cb0;
  color: white;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 15px;
}

/* ---- chat ---- */

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
  margin-bottom: 12px;
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.case-chip {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e6efff;
  color: #2b4a7a;
}

.case-chip code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
}

.case-chip.muted {
  background: #eee;
  color: #777;
}

.case-status {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
}

.link-button {
  background: none;
  border: 0;
  color: #2b6cb0;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}

.messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 16px;
  overflow-y: auto;
}

.empty {
  color: #888;
  text-align: center;
  margin-top: 40px;
}

.bubble {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 10px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.bubble-user {
  background: #d6e8ff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.bubble-karen {
  background: white;
  border: 1px solid #ddd;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.bubble-text {
  font-size: 15px;
}

.bubble-time {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

.attachments {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attachment {
  font-size: 12px;
  color: #444;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 6px;
  padding: 6px 8px;
}

.att-meta {
  font-size: 11px;
  color: #666;
  margin-top: 4px;
}

.att-image img {
  max-width: 280px;
  max-height: 220px;
  border-radius: 4px;
  display: block;
}

.att-audio audio {
  width: 100%;
  max-width: 320px;
  display: block;
}

.att-pdf .pdf-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.06);
  text-decoration: none;
  color: #222;
  font-size: 13px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.att-pdf .pdf-chip:hover {
  background: rgba(0, 0, 0, 0.1);
}

.att-pdf .pdf-name {
  font-weight: 500;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.att-pdf .pdf-action {
  font-size: 11px;
  color: #666;
}

.att-other a {
  color: #1a5fb4;
  text-decoration: none;
}

.transcript {
  margin-top: 6px;
  font-size: 12px;
  color: #333;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.5);
  border-left: 2px solid #999;
  border-radius: 0 4px 4px 0;
}

.transcript-label {
  font-weight: 600;
  margin-right: 4px;
  color: #666;
}

.transcript-text {
  font-style: italic;
}

/* Composer preview for the recorded audio chip */
.audio-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.audio-preview audio {
  height: 28px;
  max-width: 220px;
}

/* ---- composer ---- */

.composer {
  border-top: 1px solid #ddd;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.composer-row textarea {
  width: 100%;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid #bbb;
  border-radius: 4px;
  resize: vertical;
  min-height: 40px;
}

.composer-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button {
  display: inline-block;
  padding: 6px 12px;
  background: #eee;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: #222;
}

.button-primary {
  background: #2b6cb0;
  border-color: #2b6cb0;
  color: white;
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.spacer {
  flex: 1;
}

.file-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.file-chip {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.file-chip button {
  background: none;
  border: 0;
  cursor: pointer;
  color: #c33;
  font-weight: bold;
  font-size: 14px;
  line-height: 1;
}

.record-indicator {
  color: #c33;
  font-size: 12px;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.recording {
  background: #c33 !important;
  border-color: #c33 !important;
  color: white !important;
}

.thinking {
  font-style: italic;
  color: #666;
  padding: 4px 0;
}

.error {
  background: #fde2e2;
  color: #7a1c1c;
  border: 1px solid #f5b5b5;
  border-radius: 4px;
  padding: 8px 10px;
  margin: 6px 0;
  font-size: 13px;
}

.muted {
  color: #777;
}

.hidden {
  display: none !important;
}
