:root {
  --bg: #f4f5f7; --card: #fff; --ink: #1d2330; --muted: #6b7280; --line: #e3e6eb;
  --accent: #1f4fd1; --ok-bg: #e7f6ec; --ok: #17733a; --warn-bg: #fff6e0; --warn: #8a5a00;
  --err-bg: #fdeaea; --err: #a32020; --hit: #eaf7ee; --maybe: #fff8e6;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 40px; }
footer { text-align: center; padding: 0 16px 24px; font-size: 13px; }
h1 { font-size: 20px; margin: 0 0 16px; } h2 { font-size: 18px; margin: 0; }
h3 { font-size: 15px; margin: 28px 0 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
code, .mono { font-family: var(--mono); font-size: 13.5px; }
.muted { color: var(--muted); } .small, .small td { font-size: 13px; } .sub { font-size: 12px; color: var(--muted); }
.nowrap { white-space: nowrap; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 20px; background: #141a26; color: #fff; }
.top .muted { color: #a8b0c0; }
.brand { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #4f8cff; display: inline-block; }
.who { font-size: 14px; display: flex; gap: 10px; align-items: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin-bottom: 18px; }
.card.narrow { max-width: 480px; margin: 40px auto; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.span2 { grid-column: span 2; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } .span2 { grid-column: auto; } }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
label .muted { font-weight: 400; }
input, select { font: inherit; padding: 8px 10px; border: 1px solid #c9ced6; border-radius: 6px; background: #fff; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.actions { margin-top: 16px; display: flex; align-items: center; gap: 14px; }
.spin { display: none; } form.busy .spin { display: inline; }

.btn { display: inline-block; background: var(--accent); color: #fff; border: 1px solid var(--accent);
  border-radius: 6px; padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: #fff; color: var(--accent); }
.top .btn.ghost { background: transparent; color: #fff; border-color: #4a5468; }
.btn.small { padding: 3px 10px; font-size: 13px; }
form.inline { display: inline; }
.copy { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 2px; font-size: 13px; }
.copy:hover { color: var(--accent); }

.banner { padding: 10px 14px; border-radius: 6px; margin: 10px 0; font-size: 14px; }
.banner.err { background: var(--err-bg); color: var(--err); }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.rhead { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.answer { margin: 16px 0 4px; padding: 14px 16px; border-radius: 8px; font-size: 16px; border-left: 5px solid; }
.answer.ok { background: var(--ok-bg); border-color: var(--ok); }
.answer.maybe { background: var(--warn-bg); border-color: #d99a00; }
.answer.none { background: var(--err-bg); border-color: var(--err); }
.answer strong { font-size: 17px; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); margin-left: 6px; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; background: #fafbfc; }
td.num, th.num { text-align: right; }
tr.hit td { background: var(--hit); } tr.maybe td { background: var(--maybe); }
td.raw { font-family: var(--mono); font-size: 12px; word-break: break-all; min-width: 320px; }
.ev { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: 4px; background: #eef1f5; }
.ev.alloc { background: #e3ecff; color: #1f4fd1; } .ev.release { background: #fde8e8; color: #a32020; }
.ev.alloc_fail { background: #a32020; color: #fff; }

.kea { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.kea.relevant { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok) inset; }
.kea-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
dl.ids { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 8px 0; }
dl.ids dt { font-size: 12px; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
dl.ids dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #f0f2f5; border-radius: 5px; padding: 2px 4px 2px 8px; }
details { margin-top: 8px; } summary { cursor: pointer; color: var(--accent); font-size: 14px; }
details.events { margin-top: 24px; }
.next { background: #f0f4ff; border-radius: 8px; padding: 12px 16px; }

@media print {
  body { background: #fff; font-size: 12px; } .noprint, .top .btn, .copy, footer { display: none !important; }
  .top { background: #fff; color: #000; border-bottom: 2px solid #000; } .top .muted { color: #555; }
  .card { border: 0; padding: 0; } td.raw { min-width: 0; }
}
.chip.strong { background: #e3ecff; font-weight: 700; }
.answer.small-answer { font-size: 14px; margin: 8px 0; padding: 10px 14px; }
td.raw details { margin: 0; } td.raw summary { font-family: system-ui, sans-serif; font-size: 12px; }
