/* notabene — ruhig, groß, kontrastreich. Nichts blinkt, nichts springt. */

:root {
  --bg: #faf9f6;
  --fg: #1e1e1e;
  --muted: #6b6b6b;
  --line: #ddd8d0;
  --user: #e9e5dd;
  --bot: #ffffff;
  --accent: #3d5a80;
  --confidential: #7a4b8a;
  --error: #a33;
  --ok: #2a7a3d;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181a;
    --fg: #eaeaea;
    --muted: #9a9a9a;
    --line: #333;
    --user: #24272c;
    --bot: #1d1f23;
    --accent: #8fb3d9;
    --confidential: #b48ac4;
    --error: #e07070;
    --ok: #7fc48f;
  }
}

* { box-sizing: border-box; }
html { font-size: 18px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}
body.confidential { border-top: 6px solid var(--confidential); }

nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
nav a, button.link { color: var(--accent); text-decoration: none; }
nav form { margin-left: auto; }

main { max-width: 40rem; margin: 0 auto; padding: 1rem 1rem 6rem; }
h1 { font-size: 1.35rem; margin: 0.5rem 0 1rem; }
.muted { color: var(--muted); }
.error { color: var(--error); }
.ok { color: var(--ok); }

.stack { display: grid; gap: 0.75rem; }
.row { display: flex; gap: 1rem; align-items: center; }
.inline { margin-top: 1.5rem; }

label { font-weight: 600; }
.check { display: flex; gap: 0.6rem; align-items: center; font-weight: 600; }
.check input { width: 1.3rem; height: 1.3rem; }
input[type=text], textarea {
  width: 100%;
  font: inherit;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--bot);
  color: var(--fg);
}
textarea { resize: vertical; }

button, a.button {
  font: inherit;
  padding: 0.65rem 1.2rem;
  border: 0;
  border-radius: 0.5rem;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.link { background: none; color: var(--accent); padding: 0.4rem 0; }
button:disabled { opacity: 0.5; cursor: wait; }

.rooms { list-style: none; padding: 0; margin: 0; }
.rooms li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}
.rooms a { color: var(--fg); text-decoration: none; flex: 1; }
.rooms .meta { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
details { margin-top: 1.5rem; }
summary { cursor: pointer; color: var(--muted); }

.banner {
  padding: 0.6rem 0.9rem;
  border-radius: 0.5rem;
  background: var(--confidential);
  color: #fff;
  font-size: 0.95rem;
}
.banner.closed { background: var(--muted); }

.messages { display: grid; gap: 0.8rem; margin: 1rem 0; }
.msg { padding: 0.75rem 1rem; border-radius: 0.75rem; max-width: 92%; }
.msg .body p { margin: 0 0 0.6rem; }
.msg .body p:last-child { margin-bottom: 0; }
.msg-user { background: var(--user); justify-self: end; }
.msg-bot { background: var(--bot); border: 1px solid var(--line); justify-self: start; }
.msg-system { background: none; color: var(--muted); font-style: italic; justify-self: center; text-align: center; }
.who { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.2rem; }

.send { margin-top: 1rem; display: grid; gap: 0.6rem; }

h2 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
code { font-size: 0.95em; }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td:not(:first-child), th:not(:first-child) { text-align: right; }
.waiting { color: var(--muted); visibility: hidden; letter-spacing: 0.2em; }
.htmx-request .waiting, .waiting.htmx-request { visibility: visible; }
