/* Chat typography and code presentation, shared by saved and streaming replies. */
.messages-container { gap: 24px; }
.messages-container .message.agent {
    width: 100%; max-width: 960px; align-self: center;
    font-size: 15px; line-height: 1.8 !important;
    letter-spacing: -.012em; overflow-wrap: anywhere;
}
.messages-container .message.user {
    padding: 13px 18px; line-height: 1.7;
    background: linear-gradient(145deg, #303035, #29292e);
    border: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 3px 12px rgba(0,0,0,.08);
}
.messages-container .message.agent h2,
.messages-container .message.agent h3,
.messages-container .message.agent h4,
.messages-container .message.agent h5,
.messages-container .message.agent h6 {
    margin: 28px 0 12px !important; font-weight: 650;
    line-height: 1.4; letter-spacing: -.025em;
}
.messages-container .message.agent h2 { font-size: 1.4em; }
.messages-container .message.agent h3 { font-size: 1.18em; }
.messages-container .message.agent h2:first-child,
.messages-container .message.agent h3:first-child { margin-top: 0 !important; }
.messages-container .message.agent p { margin: 0 0 16px !important; }
.messages-container .message.agent p:last-child { margin-bottom: 0 !important; }
.message.agent strong { font-weight: 650; }
.messages-container .message.agent ul,
.messages-container .message.agent ol { margin: 12px 0 18px !important; padding-left: 24px; }
.messages-container .message.agent li { margin: 7px 0 !important; padding-left: 3px; }
.message.agent li::marker { color: #989ce9; }
.message.agent a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.messages-container .message.agent blockquote {
    margin: 18px 0 !important; padding: 14px 18px;
    border-left: 3px solid #818cf8; border-radius: 0 10px 10px 0;
    background: rgba(129,140,248,.07); color: var(--text-secondary);
}
.message.agent .message-table-scroll {
    margin: 20px 0 !important; border: 1px solid var(--border);
    border-radius: 12px; background: rgba(255,255,255,.015);
}
.message.agent table { font-size: .91em; line-height: 1.6; }
.message.agent th, .message.agent td { padding: 12px 16px; min-width: 100px; }
.message.agent thead th { background: rgba(129,140,248,.075); border-top: 0; font-weight: 600; }
.message.agent tbody tr:last-child td { border-bottom: 0; }
.message.agent tbody tr:nth-child(even) { background: rgba(148,163,184,.035); }
.message.agent tbody tr:hover { background: rgba(129,140,248,.055); }
.message.agent :not(pre) > code {
    padding: 2px 6px; border-color: rgba(148,163,184,.14);
    background: rgba(148,163,184,.09); color: #c9d2ea; font-size: .87em;
}
.message .message-code-block {
    margin: 20px 0 !important; border-radius: 14px;
    background: #111822; border-color: #2a3544;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.message .message-code-header {
    padding: 11px 16px; background: #18212d; border-color: #2a3544;
    color: #b6c4d9; text-transform: none; letter-spacing: .06em;
}
.message-code-language { display: flex; align-items: center; gap: 9px; }
.message-code-language::before {
    content: '</>'; color: #95a3bb; font-family: ui-monospace, monospace;
    font-size: 12px; letter-spacing: -.04em;
}
.message .message-code-copy { padding: 7px 10px; border-radius: 8px; font-weight: 500; letter-spacing: 0; }
.message-code-copy:focus-visible, .message-table-scroll:focus-visible {
    outline: 2px solid #818cf8; outline-offset: 3px;
}
.message .message-code-block pre { padding: 18px 20px; tab-size: 4; }
.message .message-code-block pre code {
    font-size: 13px; line-height: 1.85; letter-spacing: 0;
    color: #dbe4f0; overflow-wrap: normal; font-variant-ligatures: none;
}
.erpcode-keyword, .sql-keyword { color: #c4b5fd; font-weight: 600; }
.erpcode-type, .sql-type { color: #67d8e4; }
.erpcode-string, .sql-string { color: #a7d9a4; }
.erpcode-comment, .sql-comment { color: #92a2b8; font-style: italic; }
.erpcode-number, .sql-number { color: #f4bc86; }
.erpcode-system, .sql-variable { color: #f0c674; }
.erpcode-function, .sql-function { color: #93c5fd; }
.erpcode-field, .sql-identifier { color: #b9d6e8; }
.erpcode-operator, .sql-operator { color: #f0abcb; }
.erpcode-punctuation, .sql-punctuation { color: #a5b3c8; }
body.theme-light .messages-container .message.user {
    background: linear-gradient(145deg, #f0f1f5, #e8eaf0);
    border-color: #dfe3eb; box-shadow: 0 3px 12px rgba(15,23,42,.025);
}
body.theme-light .message.agent :not(pre) > code { color: #334155; background: #eef1f6; border-color: #dce2eb; }
body.theme-light .message .message-code-block { background: #f8fafc; border-color: #d8e0ea; box-shadow: 0 8px 24px rgba(15,23,42,.045); }
body.theme-light .message .message-code-header { background: #edf2f7; border-color: #d8e0ea; color: #475569; }
body.theme-light .message .message-code-block pre code { color: #243247; background: transparent; }
body.theme-light .erpcode-keyword, body.theme-light .sql-keyword { color: #6d28d9; }
body.theme-light .erpcode-type, body.theme-light .sql-type { color: #0e6878; }
body.theme-light .erpcode-string, body.theme-light .sql-string { color: #247339; }
body.theme-light .erpcode-comment, body.theme-light .sql-comment { color: #53647b; }
body.theme-light .erpcode-number, body.theme-light .sql-number { color: #a34a13; }
body.theme-light .erpcode-system, body.theme-light .sql-variable { color: #93600c; }
body.theme-light .erpcode-function, body.theme-light .sql-function { color: #1d5ea6; }
body.theme-light .erpcode-field, body.theme-light .sql-identifier { color: #35566e; }
body.theme-light .erpcode-operator, body.theme-light .sql-operator { color: #a32069; }
body.theme-light .erpcode-punctuation, body.theme-light .sql-punctuation { color: #576a83; }
@media (max-width: 768px) {
    .messages-container { gap: 20px; }
    .messages-container .message.agent { font-size: 14px; }
    .message .message-code-header { padding: 10px 12px; }
    .message .message-code-block pre { padding: 14px; }
    .message .message-code-block pre code { font-size: 12px; }
    .message.agent th, .message.agent td { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .message.agent.streaming .message-stream-content::after { animation: none; }
}
/* The work-step timeline is not answer content; keep its own spacing inside agent messages. */
.messages-container .message.agent ol.task-steps { margin: 0 !important; padding: 2px 12px 12px 14px; }
.messages-container .message.agent li.task-step { margin: 0 !important; padding-left: 0; }

/* Öbekteki cevabın hangi soruya ait olduğu (turn-groups.js) */
.messages-container .reply-to {
  font-size: 12px;
  opacity: .7;
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}
