/* ADEU LLM im Browser – helle Flächen, weiße Karten mit feinem Rand (wie der Stil „ADEU“ der App). */
@font-face {
  font-family: "Noto Sans";
  src: url("vendor/NotoSans.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --text: #1b1d24;
  --muted: #5b6070;
  --border: #dde1ea;
  --primary: #00305d;
  --primary-2: #0b5bd3;
  --on-primary: #ffffff;
  --mine: #e5edfb;
  --danger: #b3261e;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121418;
    --surface: #1b1e24;
    --surface-2: #242832;
    --text: #e8eaf0;
    --muted: #a3a8b6;
    --border: #333845;
    --primary: #8ab4ff;
    --primary-2: #8ab4ff;
    --on-primary: #0b1730;
    --mine: #23324d;
    --danger: #ffb4ab;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Noto Sans", "Segoe UI", system-ui, sans-serif;
}

button, input, select, textarea { font: inherit; color: inherit; }
button {
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 7px 12px;
}
button:hover { background: var(--surface-2); }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
button.primary:hover { filter: brightness(1.1); }
button.danger { color: var(--danger); }
button.ghost { background: transparent; border-color: transparent; }
button.icon { border: none; background: transparent; padding: 6px 9px; font-size: 17px; line-height: 1; }
button.wide { width: 100%; }
input, select, textarea {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 8px 10px;
  width: 100%;
}
textarea { resize: vertical; }
a { color: var(--primary-2); }

.hint { color: var(--muted); }
.small { font-size: 12.5px; }
.grow { flex: 1; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.app { display: flex; height: 100%; }

.sidebar {
  width: 280px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 12px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; margin-bottom: 4px; }
.brand span { flex: 1; }
.group-head { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.sidebar .hint { margin: 0; }
.list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.list.grow { flex: 1; min-height: 60px; }
.list li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list li span.name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.list li:hover { background: var(--surface-2); }
.list li.active { background: var(--mine); }
.list li .edit { visibility: hidden; padding: 0 4px; font-size: 14px; }
.list li:hover .edit { visibility: visible; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: relative;
}
.title-block { flex: 1; min-width: 0; }
.chat-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#model { width: auto; max-width: 260px; }
.menu {
  position: absolute;
  right: 12px;
  top: 52px;
  z-index: 5;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
  display: flex;
  flex-direction: column;
  padding: 6px;
  min-width: 220px;
}
.menu button { border: none; text-align: left; background: transparent; }
.menu button:hover { background: var(--surface-2); }

.messages { flex: 1; overflow-y: auto; padding: 20px 16px 8px; }
.messages > * { max-width: 820px; margin-left: auto; margin-right: auto; }
.welcome { text-align: center; margin-top: 8vh; }
.welcome h1 { font-weight: 600; margin: 12px 0 6px; }
.starters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.starters button { border-radius: 18px; }

.msg { margin: 10px auto 18px; }
.msg.user { display: flex; justify-content: flex-end; }
.msg.user .bubble { background: var(--mine); border-radius: 16px; padding: 9px 14px; max-width: 85%; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.assistant .bubble { overflow-wrap: anywhere; }
.msg .files { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 4px; }
.msg .files img { max-height: 120px; border-radius: 10px; }
.bubble pre { background: var(--surface-2); padding: 10px 12px; border-radius: 10px; overflow-x: auto; }
.bubble code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13.5px; }
.bubble table { border-collapse: collapse; display: block; overflow-x: auto; }
.bubble th, .bubble td { border: 1px solid var(--border); padding: 5px 9px; text-align: left; }
.bubble th { background: var(--surface-2); }
.bubble blockquote { border-left: 3px solid var(--border); margin: 0; padding-left: 12px; color: var(--muted); }
details.thinking { color: var(--muted); font-size: 13.5px; margin-bottom: 6px; }
details.thinking summary { cursor: pointer; }
.tool {
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 6px 10px;
  margin: 6px 0;
}
.tool.ok::before { content: "✓ "; color: #2e7d32; }
.tool.err::before { content: "⚠ "; color: var(--danger); }
.msg-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.msg-actions button { font-size: 12.5px; padding: 4px 9px; border-radius: 8px; }
.error { color: var(--danger); }
.cursor::after { content: "▍"; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.composer { padding: 8px 16px 12px; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.composer > * { max-width: 820px; margin-left: auto; margin-right: auto; }
.input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px;
}
.input-row textarea { border: none; resize: none; max-height: 220px; padding: 6px 4px; background: transparent; }
.input-row textarea:focus { outline: none; }
.status-row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 16px;
  padding: 3px 6px 3px 10px;
  font-size: 13px;
  max-width: 280px;
}
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { border: none; background: transparent; padding: 0 4px; }
.banner { background: var(--mine); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; font-size: 13.5px; }

.dialog { border: none; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--text); }
.dialog::backdrop { background: rgba(0, 0, 0, .35); }
.dialog-body { display: flex; flex-direction: column; gap: 10px; padding: 20px; max-height: 85vh; overflow-y: auto; }
.dialog h2 { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
.dialog label { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--muted); }
.dialog label input, .dialog label textarea { color: var(--text); }
.dialog fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px 12px; }
.dialog legend { font-size: 13.5px; color: var(--muted); padding: 0 4px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 6px; }

.only-mobile { display: none; }

@media (max-width: 800px) {
  .only-mobile { display: inline-block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
    transform: translateX(-100%);
    transition: transform .2s;
  }
  .sidebar.open { transform: none; box-shadow: 0 0 30px rgba(0, 0, 0, .2); }
  #model { max-width: 140px; }
  .messages { padding: 14px 16px 8px; }
  .composer { padding: 6px 16px 10px; }
}

@media print {
  .sidebar, .topbar, .composer, .msg-actions, .msg.user { display: none !important; }
  .messages { overflow: visible; }
  body { background: #fff; }
}
