.study-dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin: auto;
  width: min(620px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  box-shadow: var(--shadow);
  color: var(--text);
  background: var(--surface);
  overflow: auto;
}
.study-dialog::backdrop { background: rgba(15, 23, 42, .56); }
.dialog-heading, .dialog-actions, .sync-code-row { display: flex; gap: 8px; align-items: center; }
.dialog-heading { justify-content: space-between; }
.dialog-heading h2 { font-size: 1.1rem; }
.dialog-context, .field-hint, .dialog-actions span { color: var(--text-muted); font-size: .83rem; }
.dialog-context { margin: 8px 0; }
.study-dialog label { display: block; margin-bottom: 5px; font-weight: 600; font-size: .88rem; }
.study-dialog textarea, .sync-code-row input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  padding: 8px 10px;
  color: var(--text);
  background: var(--bg);
}
.study-dialog textarea { display: block; resize: vertical; }
.dialog-actions { justify-content: space-between; margin-top: 8px; }
.chat-messages { display: grid; gap: 8px; max-height: min(42vh, 350px); overflow: auto; margin-bottom: 10px; }
.chat-message { padding: 9px 12px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; }
.chat-message.user { background: var(--primary-soft); margin-left: 12%; }
.chat-message.assistant { background: var(--surface-2); margin-right: 8%; }
.sync-dialog { max-width: 500px; }
.sync-code-row button { flex-shrink: 0; }
.field-hint { margin: 4px 0 12px; }
.import-label { margin-top: 14px; }
