* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  font-family: Inter, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

h2 {
  margin: 0 0 4px;
  font-size: 14px;
}

.hint,
.info {
  color: #666;
}

/* --- Spalten --- */

.documents {
  width: 260px;
  min-width: 180px;
  max-width: 420px;
  overflow-y: auto;
  padding: 8px;
}

.viewer {
  flex: 1;
  min-width: 300px;
  padding: 8px;
}

.viewer:has(iframe:not([hidden])) {
  padding: 0;
}

.viewer iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.chat {
  width: 360px;
  min-width: 300px;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  padding: 8px;
  font-size: 13px;
}

.divider {
  width: 5px;
  flex-shrink: 0;
  cursor: col-resize;
  background: #ddd;
}

/* waehrend des Ziehens wuerde das PDF die Maus verschlucken */
body.resizing {
  user-select: none;
}

body.resizing iframe {
  pointer-events: none;
}

/* --- Dokumente --- */

#document-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

#document-list li {
  display: flex;
  gap: 6px;
  padding: 3px 4px;
}

#document-list li.open {
  background: #e8f0f8;
}

#document-list span {
  cursor: pointer;
  overflow-wrap: anywhere;
}

/* --- Assistent --- */

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.thinking {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 12px;
}

.messages {
  flex: 1;
  overflow-y: auto;
  margin: 8px 0;
}

.message {
  margin-bottom: 16px;
}

.message.user {
  padding: 4px 6px;
  background: #f0f0f0;
  white-space: pre-wrap;
}

.message :is(p, ul, ol) {
  margin: 0 0 10px;
}

.message li {
  margin-bottom: 3px;
}

.message :is(ul, ol) {
  padding-left: 18px;
}

.message :is(h1, h2, h3, h4) {
  margin: 14px 0 6px;
  font-size: 1em;
}

.citation {
  cursor: pointer;
}

.citation[data-kind="belegt"]:hover {
  background: #dbe8f6;
}

.citation[data-kind="abgeleitet"]:hover {
  background: #fbefc5;
}

.citation[data-kind="hinweis"]:hover {
  background: #e6e6e6;
}

/* Quellen einer Marke, nach Klick darauf */
.source-picker {
  position: fixed;
  z-index: 1;
  max-width: 300px;
  max-height: 300px;
  overflow-y: auto;
  padding: 3px 0;
  border: 1px solid #ccc;
  background: #fff;
  font-size: 12px;
}

.source-picker div {
  padding: 0 6px;
  color: #666;
}

.source-picker button {
  display: block;
  width: 100%;
  padding: 2px 6px;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.source-picker button:hover {
  background: #e8f0f8;
}

.message .info {
  font-size: 11px;
}

.message.error {
  color: #b42318;
}

.question-form {
  display: flex;
  gap: 4px;
}

.question-form textarea {
  flex: 1;
  min-width: 0;
  font: inherit;
  resize: vertical;
}
