.prose h1, .prose h2, .prose h3 { font-weight: 600; margin-top: 1.2em; margin-bottom: 0.5em; }
.prose h1 { font-size: 1.4rem; }
.prose h2 { font-size: 1.2rem; }
.prose h3 { font-size: 1.05rem; }
.prose p { margin: 0.6em 0; line-height: 1.6; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0.6em 0; }
.prose li { margin: 0.25em 0; }
.prose code { background: #f1f5f9; padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.875em; }
.prose pre { background: #0f172a; color: #f1f5f9; padding: 1em; border-radius: 8px; overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; margin: 0.8em 0; font-size: 0.9em; }
.prose th, .prose td { border: 1px solid #e2e8f0; padding: 0.5em 0.75em; text-align: left; }
.prose th { background: #f8fafc; font-weight: 600; }
.prose blockquote { border-left: 3px solid #c7d2fe; padding-left: 1em; color: #475569; margin: 0.8em 0; }
.prose strong { font-weight: 600; color: #0f172a; }

.dragover { background-color: rgb(238 242 255); border-color: rgb(99 102 241) !important; }

.chat-msg-user { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: white; align-self: flex-end; }
.chat-msg-ai { background: #f1f5f9; color: #0f172a; align-self: flex-start; }
.chat-msg { max-width: 80%; padding: 0.75rem 1rem; border-radius: 1rem; font-size: 0.875rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }

.section-card { background: white; border-radius: 1rem; border: 1px solid rgb(226 232 240); overflow: hidden; }
.section-card header { padding: 1rem 1.25rem; border-bottom: 1px solid rgb(241 245 249); display:flex; align-items:center; gap:.5rem; }
.section-card header h4 { font-weight: 600; font-size: .95rem; }
.section-card .body { padding: 0.5rem 0; }
.section-card table { width: 100%; font-size: .825rem; }
.section-card th { text-align: left; padding: .5rem 1.25rem; color: #64748b; font-weight: 500; background: #f8fafc; }
.section-card td { padding: .6rem 1.25rem; border-top: 1px solid #f1f5f9; vertical-align: top; }
.badge { display:inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .7rem; font-weight: 500; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-inactive { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-warn { background: #fef3c7; color: #92400e; }

.queue-run { border: 1px solid #e2e8f0; border-radius: 1rem; padding: 1.25rem; background: #fff; }
.queue-run > summary { cursor: pointer; list-style: none; }
.queue-run > summary::-webkit-details-marker { display: none; }
.queue-run-toggle { margin-left: auto; flex: 0 0 auto; color: #64748b; font-size: .7rem; font-weight: 500; }
.queue-run-toggle::before { content: 'Open details'; }
.queue-run[open] .queue-run-toggle::before { content: 'Close details'; }
.queue-suggestion { border: 1px solid #fde68a; border-radius: .75rem; padding: 1rem; background: #fffbeb; }
.queue-suggestion-resolved { border-color: #e2e8f0; background: #f8fafc; opacity: .86; }
.queue-eyebrow { color: #64748b; font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.queue-status { display: inline-flex; align-items: center; border-radius: 999px; padding: .18rem .55rem; font-size: .65rem; font-weight: 700; letter-spacing: .04em; }
.queue-status-neutral { background: #f1f5f9; color: #475569; }
.queue-status-running { background: #dbeafe; color: #1d4ed8; }
.queue-status-review { background: #fef3c7; color: #92400e; }
.queue-status-complete { background: #dcfce7; color: #166534; }
.queue-status-failed { background: #fee2e2; color: #991b1b; }
.queue-progress { height: .35rem; overflow: hidden; border-radius: 999px; background: #e2e8f0; }
.queue-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6366f1, #a855f7); transition: width .3s ease; }
.queue-callout { border: 1px solid #c7d2fe; border-radius: .65rem; background: #eef2ff; color: #3730a3; padding: .7rem .8rem; font-size: .75rem; line-height: 1.45; }
.queue-action { border-radius: .55rem; padding: .55rem .8rem; font-size: .75rem; font-weight: 600; transition: background-color .15s ease, opacity .15s ease; }
.queue-action:disabled { cursor: not-allowed; opacity: .5; }
.queue-action-approve { background: #047857; color: white; }
.queue-action-approve:hover:not(:disabled) { background: #065f46; }
.queue-action-reject { background: #fff; color: #b91c1c; box-shadow: inset 0 0 0 1px #fecaca; }
.queue-action-reject:hover:not(:disabled) { background: #fef2f2; }
.queue-empty { border: 1px dashed #cbd5e1; border-radius: .75rem; padding: 2rem; text-align: center; background: #f8fafc; }
.queue-spinner { width: 1rem; height: 1rem; display: inline-block; border: 2px solid #c7d2fe; border-top-color: #4f46e5; border-radius: 999px; animation: queue-spin .8s linear infinite; }
@keyframes queue-spin { to { transform: rotate(360deg); } }
.upload-card { text-align: left; transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
.upload-card:hover, .upload-card:focus-visible { border-color: #818cf8; background: #eef2ff; box-shadow: 0 0 0 2px #c7d2fe; outline: none; }
.upload-card-selected { border-color: #4f46e5; background: #eef2ff; box-shadow: 0 0 0 2px #c7d2fe; }

.history-filters { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; padding: .85rem; border: 1px solid #e2e8f0; border-radius: .75rem; background: #f8fafc; }
.history-filter-field { display: flex; min-width: 10rem; flex-direction: column; gap: .3rem; }
.history-filter-field label { color: #475569; font-size: .68rem; font-weight: 600; }
.history-filter-field input, .history-filter-field select { min-height: 2.35rem; border: 1px solid #cbd5e1; border-radius: .5rem; background: white; padding: .45rem .65rem; color: #334155; font-size: .75rem; outline: none; }
.history-filter-field input:focus, .history-filter-field select:focus { border-color: #818cf8; box-shadow: 0 0 0 2px #e0e7ff; }
.history-filter-grow { flex: 1 1 13rem; }
.history-filter-actions { display: flex; gap: .45rem; }
