:root {
  --bg: #ffffff; --fg: #1b1f24; --muted: #5a6572; --card: #f4f6f8; --line: #d9dee4;
  --user: #e8f0fe; --assistant: #f4f6f8; --accent: #2457c5;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171b; --fg: #e8ebef; --muted: #9aa5b1; --card: #1d2228; --line: #2c333b;
          --user: #1e2a44; --assistant: #1d2228; --accent: #8ab0ff; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg);
       font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.bar { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; padding: .75rem 1rem;
       border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; }
.note { color: var(--muted); font-size: .875rem; }
main { max-width: 46rem; margin: 0 auto; padding: 1rem; }
.status { color: var(--muted); padding: 2rem 0; text-align: center; }
.status.error { color: #b3261e; }
h1 { font-size: 1.4rem; margin: .5rem 0 .25rem; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: .85rem; margin-bottom: 1rem; }
.msg { border: 1px solid var(--line); border-radius: .75rem; padding: .6rem .9rem; margin: .75rem 0;
       background: var(--assistant); overflow-wrap: anywhere; }
.msg.role-user { background: var(--user); }
.who { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
       color: var(--muted); margin-bottom: .25rem; }
.msg p { margin: .4rem 0; white-space: pre-wrap; }
.msg ul, .msg ol { margin: .4rem 0; padding-left: 1.4rem; }
.msg h3, .msg h4, .msg h5 { margin: .6rem 0 .2rem; }
pre { background: var(--card); border: 1px solid var(--line); border-radius: .5rem; padding: .6rem .8rem;
      overflow-x: auto; font: .85rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
code { font: .9em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--card);
       padding: .05rem .3rem; border-radius: .25rem; }
pre code { background: none; padding: 0; }
.foot { max-width: 46rem; margin: 2rem auto; padding: 0 1rem; color: var(--muted); font-size: .8rem; }
.foot a { color: var(--accent); }

.report { margin: 2rem 0 0; padding: .6rem .9rem; border: 1px solid var(--line); border-radius: .75rem;
          color: var(--muted); font-size: .9rem; }
.report summary { cursor: pointer; }
.report select, .report textarea, .report button { display: block; width: 100%; margin: .5rem 0; font: inherit;
          color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: .5rem;
          padding: .45rem .6rem; }
.report button { width: auto; cursor: pointer; }
.report button[disabled] { opacity: .6; cursor: default; }
.report-status { min-height: 1.2em; margin: .25rem 0 0; }

.cutnote { border: 1px solid var(--line); border-left: .35rem solid var(--accent); border-radius: .5rem;
           padding: .6rem .9rem; margin: 1rem 0; background: var(--card); }
.sec { font-size: 1rem; margin: .1rem 0 .4rem; }
.msg h3 { font-size: .95rem; }
