:root {
  --bg: #ffffff; --surface: #f6f6f4; --line: #e3e2de; --text: #1d1d1b; --muted: #6b6b66; --accent: #2c5bd1; --user: #e9efff;
  --claude: #c9611d; --codex: #0f8a5f; --error: #b3261e; --radius: 10px; --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141413; --surface: #1e1e1c; --line: #2f2f2c; --text: #ececea; --muted: #a0a09a; --accent: #7ea2ff; --user: #1f2a44; --claude: #f0894a; --codex: #3dbf8d; --error: #ff8a80; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
code, pre { font-family: var(--mono); font-size: 0.92em; }
pre { white-space: pre-wrap; word-break: break-word; margin: 0; }
button { font: inherit; cursor: pointer; }
button.primary { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 10px 16px; }
button.quiet { background: transparent; color: var(--accent); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; }
h1 { font-size: 1.5rem; margin: 0 0 16px; }
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 24px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.top .brand { font-weight: 600; color: var(--text); }
.top nav { display: flex; gap: 16px; } .top nav a { color: var(--muted); padding: 4px 0; } .top nav a.active { color: var(--text); border-bottom: 2px solid var(--accent); }
.top .logout { margin-left: auto; }
.content { padding: 24px; max-width: 1100px; width: 100%; margin: 0 auto; }
.filters { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted); } .filters .grow { flex: 1; min-width: 240px; }
.filters select, .filters input { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.status { color: var(--muted); font-size: 0.9rem; margin: 0 0 16px; } .status .error, .error { color: var(--error); }
.empty, .hint { color: var(--muted); }
.sessions { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sessions li + li { border-top: 1px solid var(--line); }
.sessions a { display: grid; grid-template-columns: 24px 1fr; grid-template-rows: auto auto; column-gap: 12px; padding: 12px 16px; color: var(--text); }
.sessions a:hover { background: var(--surface); text-decoration: none; }
.sessions .mark { grid-row: 1 / span 2; align-self: start; font-size: 1.1rem; }
.sessions .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sessions .meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 0.85rem; } .sessions .device { color: var(--text); }
.mark.claude { color: var(--claude); } .mark.codex { color: var(--codex); }
.more { margin-top: 12px; }
table.devices { width: 100%; border-collapse: collapse; } table.devices th, table.devices td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.devices th { color: var(--muted); font-weight: 500; font-size: 0.85rem; } table.devices small { display: block; color: var(--muted); }
.session-header h1 { display: flex; gap: 10px; align-items: baseline; }
.provenance { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 24px; padding: 12px 16px; background: var(--surface); border-radius: var(--radius); font-size: 0.9rem; }
.provenance dt { color: var(--muted); } .provenance dd { margin: 0; overflow-wrap: anywhere; }
.transcript { display: flex; flex-direction: column; gap: 10px; }
.entry { max-width: 100%; }
.entry.user { display: flex; flex-direction: column; align-items: flex-end; }
.entry.user .bubble { background: var(--user); border-radius: 14px 14px 4px 14px; padding: 10px 14px; max-width: 80%; white-space: pre-wrap; word-break: break-word; }
.entry .markdown { padding: 4px 0; } .markdown p { margin: 0 0 10px; } .markdown pre { background: var(--surface); border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 0 0 10px; }
.markdown table { border-collapse: collapse; } .markdown th, .markdown td { border: 1px solid var(--line); padding: 4px 8px; }
details.aside { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
details.aside summary { padding: 6px 12px; cursor: pointer; color: var(--muted); display: flex; gap: 8px; align-items: baseline; list-style: none; }
details.aside summary::before { content: "▸"; font-size: 0.8em; } details.aside[open] summary::before { content: "▾"; }
details.aside summary .label { color: var(--text); font-family: var(--mono); font-size: 0.85em; }
details.aside summary small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }
details.aside pre { padding: 8px 12px 12px; border-top: 1px solid var(--line); max-height: 60vh; overflow: auto; }
details.native { margin-top: 2px; } details.native summary { font-size: 0.75rem; color: var(--muted); cursor: pointer; } details.native pre { font-size: 0.8rem; background: var(--surface); border-radius: 8px; padding: 8px 12px; max-height: 50vh; overflow: auto; }
.entry.user details.native { align-self: flex-end; }
.login-shell { min-height: 100vh; display: grid; place-items: center; background: var(--surface); }
.login { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; width: min(360px, 90vw); display: flex; flex-direction: column; gap: 16px; }
.login h1 { margin: 0; } .login form { display: flex; flex-direction: column; gap: 12px; }
.login label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--muted); }
.login input { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
.login .error { margin: 0; font-size: 0.9rem; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 640px) { .content { padding: 16px; } .top { padding: 10px 16px; gap: 16px; } .provenance { grid-template-columns: 1fr; } .entry.user .bubble { max-width: 100%; } }
