/* Malten — a minimalist black-and-white design system, shared by every page via
   the base template so the chat and issues views share one look. */

:root {
  --page-max: 760px;

  --bg: #ffffff;
  --fg: #111315;
  --muted: #6b7280;
  --border: #e6e6e8;
  --panel: #f6f6f7;
  --user-bg: #111315;   /* user messages: filled, inverted */
  --user-fg: #ffffff;
  --agent-bg: #ffffff;  /* agent messages: quiet, bordered */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c0d;
    --fg: #ececec;
    --muted: #8c9096;
    --border: #24262a;
    --panel: #141517;
    --user-bg: #ececec;
    --user-fg: #0b0c0d;
    --agent-bg: #0b0c0d;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0c0d; --fg: #ececec; --muted: #8c9096; --border: #24262a;
  --panel: #141517; --user-bg: #ececec; --user-fg: #0b0c0d; --agent-bg: #0b0c0d;
}
:root[data-theme="light"] {
  --bg: #ffffff; --fg: #111315; --muted: #6b7280; --border: #e6e6e8;
  --panel: #f6f6f7; --user-bg: #111315; --user-fg: #ffffff; --agent-bg: #ffffff;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}

/* Top bar: a thin rule, the wordmark, and quiet nav. */
.topbar { border-bottom: 1px solid var(--border); background: var(--bg); }
.topbar .bar {
  max-width: var(--page-max); margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 16px;
}
.brand { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; color: var(--fg); text-decoration: none; }
.topbar nav { margin-left: auto; display: flex; gap: 18px; }
.topbar nav a { color: var(--muted); font-size: 14px; text-decoration: none; }
.topbar nav a:hover { color: var(--fg); }
.topbar nav a.active { color: var(--fg); }

/* Document pages (issues): normal scroll, content centered to page width. */
body.doc { min-height: 100vh; }
.wrap { max-width: var(--page-max); margin: 0 auto; padding: 24px 20px; }

/* Chat page: pinned to the visible viewport so the mobile keyboard shrinks the
   message log rather than pushing the page around. Only #log scrolls. */
body.chat {
  position: fixed; top: 0; left: 0; right: 0;
  overflow: hidden; overscroll-behavior: none;
  display: flex; flex-direction: column;
  height: 100dvh; height: var(--app-h, 100dvh);
}
body.chat .topbar { flex: 0 0 auto; }
body.chat .topbar .bar { max-width: none; }
main.chat {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  width: 100%; max-width: var(--page-max); margin: 0 auto;
}

/* Shared atoms. */
.badge { font-size: 11px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); }

@media (max-width: 560px) {
  .topbar .bar { padding: 12px 14px; }
}
