:root { color-scheme: light dark; }
* { box-sizing: border-box; }
body { margin: 0; font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji"; }
header { padding: 12px 16px; border-bottom: 1px solid #ddd; }
header h1 { margin: 0; font-size: 18px; }
main { max-width: 880px; margin: 24px auto; padding: 0 16px; }

#dropzone { border: 2px dashed #888; border-radius: 10px; padding: 28px; text-align: center; margin-bottom: 12px; }
#dropzone.hover { border-color: #4f46e5; background: rgba(79,70,229,0.05); }
.btn { display: inline-block; padding: 8px 12px; background: #4f46e5; color: white; border-radius: 6px; cursor: pointer; }
button { padding: 8px 12px; border-radius: 6px; border: 1px solid #ccc; background: #f5f5f5; cursor: pointer; }
button:disabled { opacity: .6; cursor: not-allowed; }
.hint { font-size: 12px; opacity: .8; margin-left: 8px; }

.messages { height: 420px; border: 1px solid #ddd; border-radius: 8px; padding: 10px; overflow: auto; background: rgba(0,0,0,0.02); }
.bubble { max-width: 80%; padding: 10px 12px; margin: 8px 0; border-radius: 12px; white-space: pre-wrap; }
.bubble.user { margin-left: auto; background: #4f46e5; color: white; }
.bubble.assistant { margin-right: auto; background: #e5e7eb; color: #111827; }
.bubble.assistant table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.bubble.assistant th, .bubble.assistant td { border: 1px solid #ccc; padding: 6px; text-align: left; }
.bubble.assistant th { background: #f0f0f0; }

.thinking-bubble { display: flex; gap: 4px; padding: 12px 16px; width: fit-content; }
.dot { width: 4px; height: 4px; background: #555; border-radius: 50%; animation: blink 1.4s infinite both; }
.dot:nth-child(2) { animation-delay: .2s; }
.dot:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

.composer { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
#message-input { flex: 1; padding: 8px; border-radius: 6px; border: 1px solid #ccc; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #111827; color: white; padding: 8px 12px; border-radius: 6px; opacity: 0; transition: opacity .3s; }
