/* AI chat layout */
.shell-wide { max-width: 1100px; }
.page-ai-chat .page { padding-bottom: 0.5rem; }
.ai-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1rem;
  min-height: 70vh;
}
.ai-sidebar {
  background: var(--card);
  border: 1px solid var(--line-gold);
  border-radius: var(--radius);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.ai-side-title { font-size: 0.85rem; margin: 0.4rem 0 0; color: var(--muted); }
.ai-session-list { list-style: none; margin: 0; padding: 0; overflow: auto; max-height: 50vh; }
.ai-session-list button {
  width: 100%; text-align: left; background: transparent; border: 0;
  padding: 0.45rem 0.5rem; border-radius: 8px; cursor: pointer; color: var(--ink);
}
.ai-session-list button:hover { background: rgba(201,162,39,0.12); }
.ai-hint { font-size: 0.8rem; color: var(--muted); margin-top: auto; }
.ai-main {
  background: var(--card);
  border: 1px solid var(--line-gold);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 70vh;
}
.ai-main-head { padding: 1rem 1.1rem 0.5rem; border-bottom: 1px solid var(--line); }
.ai-main-head h1 { margin: 0; font-size: 1.25rem; font-family: var(--font-display); color: var(--red-deep); }
.ai-main-head p { margin: 0.35rem 0 0.6rem; color: var(--muted); font-size: 0.92rem; }
.ai-messages { flex: 1; overflow: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.ai-empty { color: var(--muted); text-align: center; margin: 2rem auto; }
.ai-bubble {
  max-width: 85%;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 0.95rem;
}
.ai-bubble.is-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  color: #fff;
}
.ai-bubble.is-assistant {
  align-self: flex-start;
  background: #fff8ef;
  border: 1px solid var(--line-gold);
}
.ai-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  padding: 0.85rem;
  border-top: 1px solid var(--line);
}
.ai-composer textarea {
  width: 100%;
  resize: vertical;
  min-height: 52px;
  border-radius: 12px;
  border: 1px solid var(--line-gold);
  padding: 0.6rem 0.75rem;
  background: #fff;
}
@media (max-width: 760px) {
  .ai-layout { grid-template-columns: 1fr; }
  .ai-sidebar { max-height: 180px; }
  .ai-session-list { max-height: 90px; }
}
