:root {
  --bg: #0b0d12; --panel: #12151c; --line: #222733; --text: #e7e9ee; --muted: #8b93a7;
  --accent: #3b6ff5; --ok: #2fbf71; --busy: #3b6ff5; --bad: #e5484d;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.muted { color: var(--muted); font-weight: 400; }

/* login */
body.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 32px 28px; text-align: center; }
.card h1 { font-size: 20px; margin: 12px 0 4px; }
.card form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 20px; }
.card input { width: 100%; min-width: 0; font: 600 26px/1 var(--mono); letter-spacing: .3em; text-indent: .3em; text-align: center; padding: 14px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); outline: none; }
.card input::placeholder { color: #3a4152; }
.card input:focus { border-color: var(--accent); }
.card button { padding: 12px; border-radius: 10px; border: 0; background: var(--accent); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; }
.err { color: var(--bad); min-height: 1.5em; margin: 12px 0 0; }

/* dashboard */
header { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 1; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.pill { margin-left: auto; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--line); }
.pill.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pill.busy { background: color-mix(in srgb, var(--busy) 20%, transparent); color: #7fa2ff; }
.pill.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.logout { color: var(--muted); text-decoration: none; font-size: 13px; }
main { padding: 20px; max-width: 1400px; margin: 0 auto; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; }
.label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.value { font-size: 18px; font-weight: 600; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; margin-bottom: 16px; }
.panel h2 { font-size: 14px; margin: 0 0 10px; }
.feed { list-style: none; margin: 0; padding: 0; height: 62vh; overflow: auto; display: grid; align-content: start; gap: 8px; }
.item { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; font-size: 14px; }
.item .when { color: var(--muted); font: 12px var(--mono); padding-top: 2px; }
.item .what { white-space: pre-wrap; overflow-wrap: anywhere; }
.item.tool .what { color: var(--muted); font: 13px var(--mono); }
.item.user .what { color: #f3c969; }
.tabs { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.tab { background: var(--bg); color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.tab.on { color: var(--text); border-color: var(--accent); }
.screen, .report { margin: 0; background: #07080b; border: 1px solid var(--line); border-radius: 8px; padding: 12px; font: 12.5px/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.screen { height: calc(62vh - 40px); overflow: auto; }
.report { max-height: 40vh; overflow: auto; }
.foot { font-size: 12px; text-align: center; }
@media (max-width: 900px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { padding: 16px; }
  .feed, .screen { height: 50vh; }
}
