/* ai.html and the AI-app guides: the illustrative chat, the URL copy box and config snippets.
   Built on construction.css + resources.css; everything here wraps or scrolls inside itself,
   so nothing pushes the page sideways on a phone. */

/* ── ILLUSTRATIVE CHAT ── */
.ai-chat {
  max-width: 640px;
  margin: 40px auto 0;
  text-align: left; /* the hero centres its text; a chat reads left to right */
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.ai-chatBar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.ai-chatBar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.ai-chatBody { padding: 20px 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.ai-msg { font-size: 15px; line-height: 1.6; max-width: 88%; overflow-wrap: anywhere; }
.ai-msg--you {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 16px 16px 4px 16px;
  padding: 10px 14px;
  color: var(--fg);
}
.ai-msg--bot { color: var(--muted); }
.ai-msg--bot p { margin: 0 0 8px; }
.ai-msg--bot ul { margin: 0 0 8px; padding-left: 18px; }
.ai-msg--bot li { margin-bottom: 4px; }
.ai-msg--bot strong { color: var(--fg); font-weight: 600; }
.ai-tool {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 10px; padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
}
.ai-chatCaption { font-size: 13px; color: var(--faint); margin-top: 10px; }

/* ── EXAMPLE ASKS ── */
.ai-ask {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 700; line-height: 1.35;
  color: var(--fg); margin: 0 0 10px;
}
.ai-ask::before { content: '\201C'; color: var(--accent); }
.ai-ask::after { content: '\201D'; color: var(--accent); }
.res-card p { font-size: 14.5px; color: var(--muted); line-height: 1.65; margin: 0; }

/* ── URL COPY BOX ── */
.ai-copy {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  max-width: 560px;
  margin: 28px 0 0;
  padding: 10px 10px 10px 16px;
  background: var(--surface);
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  border-radius: 12px;
}
.ai-copy code {
  flex: 1 1 auto; min-width: 0;
  font-family: var(--font-mono); font-size: 16px; color: var(--fg);
  overflow-wrap: anywhere;
}
.ai-copyBtn {
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 8px 14px; border-radius: 8px; cursor: pointer;
  color: var(--bg); background: var(--accent); border: 0;
}
.ai-copyBtn:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

/* ── CONFIG SNIPPETS (Cursor, VS Code, Gemini CLI) ── */
/* A grid item grows to fit its widest line; let the cards shrink so a long snippet scrolls inside itself. */
.res-cards > .res-card { min-width: 0; }
.ai-code {
  margin: 12px 0 0;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; color: var(--fg);
  overflow-x: auto;
  white-space: pre;
}
.res-card code, .res-prose code { font-family: var(--font-mono); font-size: 0.9em; color: var(--fg); overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .ai-msg { max-width: 100%; font-size: 14.5px; }
  .ai-ask { font-size: 17px; }
  .ai-copy code { font-size: 14px; }
}
