/* Attorney intake chat page */
.chat-hero {
  padding: calc(var(--space-6)) 0 var(--space-4);
  background: linear-gradient(180deg, var(--color-surface-2, #f2ede3) 0%, var(--color-surface, #f7f4ee) 100%);
  border-bottom: 1px solid var(--color-border, rgba(20, 33, 61, 0.08));
}
.chat-hero .eyebrow { color: var(--color-primary, #b08a3e); }
.chat-hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 3.6vw, 3.25rem);
  line-height: 1.05;
  color: var(--color-text, #14213d);
  margin: var(--space-2) 0 var(--space-3);
  max-width: 22ch;
}
.chat-hero .lede {
  max-width: 62ch;
  color: var(--color-text-muted, #4a5265);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.chat-shell { padding: var(--space-5) 0 var(--space-7); }
.chat-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 960px) {
  .chat-container { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
}

.chat-panel {
  background: var(--color-surface, #f7f4ee);
  border: 1px solid var(--color-border, rgba(20, 33, 61, 0.1));
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  box-shadow: 0 1px 2px rgba(20, 33, 61, 0.03);
}

.chat-log {
  padding: var(--space-4);
  overflow-y: auto;
  max-height: 62vh;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  scroll-behavior: smooth;
}

.chat-msg { display: flex; flex-direction: column; gap: 4px; max-width: 100%; }
.chat-msg-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted, #4a5265);
}
.chat-msg-body {
  border-radius: 4px;
  padding: var(--space-3);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text, #14213d);
}
.chat-msg-body p { margin: 0 0 0.6em; }
.chat-msg-body p:last-child { margin-bottom: 0; }
.chat-msg-body ul, .chat-msg-body ol { margin: 0.4em 0; padding-left: 1.25em; }
.chat-msg-body li { margin: 2px 0; }
.chat-msg-body a { color: var(--color-primary, #b08a3e); text-decoration: underline; text-underline-offset: 2px; }

.chat-msg--assistant .chat-msg-body {
  background: var(--color-bg, #fdfbf6);
  border: 1px solid var(--color-border, rgba(20, 33, 61, 0.08));
}
.chat-msg--user { align-items: flex-end; }
.chat-msg--user .chat-msg-role { text-align: right; }
.chat-msg--user .chat-msg-body {
  background: var(--color-text, #14213d);
  color: #f7f4ee;
  max-width: 88%;
}
.chat-msg--user .chat-msg-body a { color: #e8d9b3; }

.chat-msg--error .chat-msg-body {
  background: #fdf2ec;
  border: 1px solid #d99a7a;
  color: #7c3b1f;
}

.chat-citations {
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--color-text-muted, #4a5265);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.chat-citations span { text-transform: uppercase; letter-spacing: 0.06em; }
.chat-citations a { color: var(--color-primary, #b08a3e); }

.chat-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 6px 0;
}
.chat-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-text-muted, #4a5265);
  opacity: 0.4;
  animation: chatBlink 1.2s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chatBlink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 var(--space-4) var(--space-3);
  border-top: 1px solid var(--color-border, rgba(20, 33, 61, 0.08));
  padding-top: var(--space-3);
}
.chat-chip {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.8125rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--color-border, rgba(20, 33, 61, 0.15));
  background: transparent;
  color: var(--color-text, #14213d);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chat-chip:hover {
  background: var(--color-text, #14213d);
  border-color: var(--color-text, #14213d);
  color: #f7f4ee;
}

.chat-form {
  border-top: 1px solid var(--color-border, rgba(20, 33, 61, 0.08));
  padding: var(--space-3) var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.chat-form textarea {
  width: 100%;
  border: 1px solid var(--color-border, rgba(20, 33, 61, 0.15));
  border-radius: 4px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 60px;
  color: var(--color-text, #14213d);
  background: var(--color-bg, #fdfbf6);
}
.chat-form textarea:focus {
  outline: 2px solid var(--color-primary, #b08a3e);
  outline-offset: 1px;
  border-color: transparent;
}

.chat-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.chat-form-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--color-text-muted, #4a5265);
  min-height: 1em;
}
.chat-send {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--color-text, #14213d);
  color: #f7f4ee;
  border: none;
  border-radius: 4px;
  font-family: 'DM Sans', -apple-system, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.chat-send:hover { background: #1d2f57; }
.chat-send:disabled { opacity: 0.6; cursor: not-allowed; }

/* Aside */
.chat-aside { display: flex; flex-direction: column; gap: var(--space-3); }
.chat-aside-card {
  padding: var(--space-4);
  border: 1px solid var(--color-border, rgba(20, 33, 61, 0.1));
  border-radius: 6px;
  background: var(--color-surface, #f7f4ee);
}
.chat-aside-card--muted {
  background: transparent;
  border-color: rgba(20, 33, 61, 0.08);
}
.chat-aside-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary, #b08a3e);
  margin: 0 0 8px;
}
.chat-aside-body { color: var(--color-text, #14213d); margin: 0 0 var(--space-3); font-size: 0.9375rem; line-height: 1.5; }
.chat-aside-cta {
  display: inline-block;
  padding: 9px 18px;
  background: var(--color-text, #14213d);
  color: #f7f4ee;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 8px;
}
.chat-aside-cta:hover { background: #1d2f57; }
.chat-aside-link {
  display: block;
  color: var(--color-text, #14213d);
  font-size: 0.875rem;
  text-decoration: none;
  border-bottom: 1px solid var(--color-primary, #b08a3e);
  padding-bottom: 2px;
  width: fit-content;
}
.chat-aside-card ul {
  margin: 0;
  padding-left: 1.1em;
  color: var(--color-text-muted, #4a5265);
  font-size: 0.8125rem;
  line-height: 1.55;
}
.chat-aside-card li + li { margin-top: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
