:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #f4f7fb, #eef4ff);
  color: #132238;
}

* { box-sizing: border-box; }
body { margin: 0; background: linear-gradient(135deg, #f4f7fb, #eef4ff); color: #132238; }
.app-shell { max-width: 1180px; margin: 0 auto; padding: 32px 20px 48px; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.eyebrow { text-transform: uppercase; letter-spacing: .2em; font-size: .78rem; color: #4169e1; font-weight: 700; }
h1 { margin: 4px 0; font-size: 2rem; }
.lead { color: #5b6882; max-width: 720px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { border: 0; border-radius: 999px; padding: 10px 16px; text-decoration: none; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.btn-primary { background: #4169e1; color: white; }
.btn-secondary { background: #e8eefc; color: #22408d; }
.chat-card, .card { background: white; border-radius: 24px; box-shadow: 0 16px 40px rgba(19, 34, 56, 0.08); padding: 24px; }
.chat-log { min-height: 420px; max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 6px; }
.message { max-width: 80%; padding: 12px 14px; border-radius: 16px; line-height: 1.5; }
.message.user { align-self: flex-end; background: #4169e1; color: white; }
.message.assistant { align-self: flex-start; background: #f2f5fb; color: #132238; }
.chat-form { margin-top: 16px; }
.composer { display: flex; gap: 12px; margin-top: 10px; }
.composer input, .stacked-form input, .stacked-form textarea, .stacked-form select { width: 100%; border: 1px solid #dfe7f5; border-radius: 14px; padding: 12px 14px; font: inherit; }
.options-area { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.option-btn { background: #eef3ff; color: #28479a; border: 0; padding: 8px 12px; border-radius: 999px; cursor: pointer; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.stacked-form { display: grid; gap: 12px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.doc-list { display: grid; gap: 12px; margin-top: 16px; }
.doc-item { border: 1px solid #e5ecf8; border-radius: 16px; padding: 14px; }
.doc-actions { display: flex; gap: 8px; margin-top: 8px; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } .hero { flex-direction: column; align-items: flex-start; } }

/* Modal Styles */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal.hidden { display: none; }
.modal-content { background: white; border-radius: 24px; padding: 32px; max-width: 400px; width: 90%; box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15); }
.modal-content h2 { margin: 0 0 8px 0; font-size: 1.5rem; }
.modal-content p { color: #5b6882; margin: 0 0 20px 0; }
.step { display: grid; gap: 12px; }
.step.hidden { display: none; }
.step label { font-weight: 600; color: #132238; }
.step input { width: 100%; border: 1px solid #dfe7f5; border-radius: 14px; padding: 12px 14px; font: inherit; }
.step input:focus { outline: none; border-color: #4169e1; box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.1); }
#loading { text-align: center; padding: 20px; }
