:root {
  --bg: #f7f8fa; --surface: #ffffff; --text: #1c2430; --muted: #5b6676; --line: #d9dee6;
  --accent: #33618f; --accent-soft: #e7eef6; --ok: #2f6b4a; --warn: #8a5a12; --bad: #9b2c2c;
}
* { box-sizing: border-box; }
html { font-size: 17px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Georgia, 'Times New Roman', serif; line-height: 1.6; }
a { color: var(--accent); }
header.site { background: var(--surface); border-bottom: 1px solid var(--line); }
header.site .inner { max-width: 60rem; margin: 0 auto; padding: 0.9rem 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; }
header.site .brand { display: flex; align-items: center; gap: 0.6rem; font-weight: bold; text-decoration: none; color: var(--text); }
header.site img { width: 2.2rem; height: 2.2rem; }
nav a { margin-right: 1rem; text-decoration: none; font-family: system-ui, sans-serif; font-size: 0.9rem; }
nav a:hover, nav a[aria-current] { text-decoration: underline; }
main { max-width: 60rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
main.narrow { max-width: 42rem; }
h1 { font-size: 2rem; line-height: 1.2; margin: 1rem 0; }
h2 { font-size: 1.3rem; margin: 2rem 0 0.5rem; }
.lede { font-size: 1.15rem; color: var(--muted); }
footer { max-width: 60rem; margin: 0 auto; padding: 1rem; color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--line); }

button, input, select, textarea { font: inherit; font-family: system-ui, sans-serif; font-size: 0.9rem; }
button { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 0.4rem 0.75rem; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--bad); }
button:disabled { opacity: 0.5; cursor: default; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #7aa7d6; outline-offset: 1px; }
input[type=text], input[type=password], input[type=search], input[type=number], textarea, select { width: 100%; padding: 0.5rem; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--text); }
input[type=number] { width: 5rem; }
textarea { min-height: 6rem; resize: vertical; }
label { display: block; font-family: system-ui, sans-serif; font-size: 0.85rem; color: var(--muted); margin: 0.75rem 0 0.25rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.6rem 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1rem; margin: 1rem 0; }
.sans { font-family: system-ui, sans-serif; font-size: 0.85rem; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.error { color: var(--bad); font-family: system-ui, sans-serif; font-size: 0.9rem; min-height: 1.2rem; }
.layout { display: grid; grid-template-columns: 16rem 1fr; gap: 1.25rem; }
@media (max-width: 760px) { .layout { grid-template-columns: 1fr; } }
ul.sessions { list-style: none; margin: 0; padding: 0; }
ul.sessions button { width: 100%; text-align: left; margin-bottom: 0.35rem; }
ul.sessions button[aria-current=true] { border-color: var(--accent); background: var(--accent-soft); }

.msg { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 4px; padding: 0.75rem 1rem; margin: 0.75rem 0; }
.msg.ai { border-left-color: var(--accent); }
.msg.withheld { opacity: 0.55; }
.msg .meta { font-family: system-ui, sans-serif; font-size: 0.8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: center; }
.msg .who { color: var(--text); font-weight: 600; font-size: 0.9rem; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 0.4rem; }
.msg .actions { margin-top: 0.5rem; }
.msg .actions button { font-size: 0.75rem; padding: 0.15rem 0.5rem; }
.tag { font-family: system-ui, sans-serif; font-size: 0.72rem; padding: 0.05rem 0.45rem; border-radius: 999px; border: 1px solid var(--line); }
.tag.approved { color: var(--ok); border-color: var(--ok); }
.tag.withheld { color: var(--bad); border-color: var(--bad); }
.tag.ai { color: var(--accent); border-color: var(--accent); }
.status { font-family: system-ui, sans-serif; font-size: 0.85rem; padding: 0.5rem 0.75rem; border-radius: 4px; background: var(--accent-soft); margin: 0.5rem 0; }
.status.bad { background: #f8e9e9; color: var(--bad); }
.dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--muted); margin-right: 0.35rem; }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); }
