/* ────────────────────────────────────────────────────────────────────── */
/*  Design tokens                                                          */
/* ────────────────────────────────────────────────────────────────────── */
:root {
  --bg:        #0d1117;
  --bg-elev:   #161b22;
  --bg-soft:   #1c2128;
  --bg-hover:  rgba(255,255,255,0.025);
  --border:    #30363d;
  --border-mute: #21262d;
  --fg:        #e6edf3;
  --fg-mute:   #8b949e;
  --fg-dim:    #6e7681;
  --blue:      #1f6feb;
  --blue-soft: #58a6ff;
  --green:     #3fb950;
  --red:       #f85149;
  --amber:     #d29922;

  --r-xs: 3px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-pill: 999px;

  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  20px;
  --s-6:  24px;

  --header-h:  48px;
  --pane-title-h: 36px;

  --lib-pane-w: 240px;
  --act-pane-w: 380px;

  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  background: var(--bg);
  color: var(--fg);
}
a { color: var(--blue-soft); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--border-mute);
  border-radius: var(--r-xs);
  padding: 1px 5px;
  color: var(--blue-soft);
}

/* ────────────────────────────────────────────────────────────────────── */
/*  App shell — three-column persistent layout                             */
/* ────────────────────────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-rows: var(--header-h) 1fr;
  height: 100vh;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--s-5);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.brand-mark { color: var(--blue-soft); font-size: 16px; line-height: 1; }
.header-status { display: inline-flex; gap: var(--s-2); align-items: center; }

.app-body {
  display: grid;
  grid-template-columns: var(--lib-pane-w) 1fr var(--act-pane-w);
  min-height: 0;
}

.lib-pane,
.act-pane {
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  min-height: 0;
}
.lib-pane { border-right: 1px solid var(--border); }
.act-pane { border-left:  1px solid var(--border); }

.work-pane {
  overflow: auto;
  padding: var(--s-6) var(--s-6) var(--s-6);
  min-height: 0;
}

.pane-title {
  display: flex;
  align-items: center;
  height: var(--pane-title-h);
  padding: 0 var(--s-4);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  border-bottom: 1px solid var(--border-mute);
  flex-shrink: 0;
}
.pane-title-row { justify-content: space-between; }

/* ────────────────────────────────────────────────────────────────────── */
/*  Status pill (single OnGuard health indicator)                          */
/* ────────────────────────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-mute);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1;
  font-family: inherit;
}
.pill:hover { background: var(--bg-soft); color: var(--fg); }
.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg-dim);
}
.pill-ok   .pill-dot { background: var(--green); box-shadow: 0 0 0 3px rgba(63,185,80,0.18); }
.pill-warn .pill-dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(210,153,34,0.18); }
.pill-err  .pill-dot { background: var(--red);   box-shadow: 0 0 0 3px rgba(248,81,73,0.18); }
.pill-ok   { color: var(--fg); border-color: rgba(63,185,80,0.32); }
.pill-warn { color: var(--fg); border-color: rgba(210,153,34,0.32); }
.pill-err  { color: var(--fg); border-color: rgba(248,81,73,0.32); }

/* ────────────────────────────────────────────────────────────────────── */
/*  Library sidebar                                                        */
/* ────────────────────────────────────────────────────────────────────── */
.lib-nav {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: var(--s-2) 0;
}
.lib-nav-item {
  display: block;
  padding: 8px var(--s-4);
  border-left: 2px solid transparent;
  color: var(--fg-mute);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
}
.lib-nav-item:hover { background: var(--bg-hover); color: var(--fg); text-decoration: none; }
.lib-nav-item.active {
  background: var(--bg-soft);
  color: var(--fg);
  border-left-color: var(--blue-soft);
}

/* ────────────────────────────────────────────────────────────────────── */
/*  Work pane — entry detail                                               */
/* ────────────────────────────────────────────────────────────────────── */
.entry { max-width: 880px; }

.entry-head {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--border-mute);
}
.entry-head h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.entry-summary {
  margin: 0;
  color: var(--fg-mute);
  font-size: 13px;
}

.entry-section {
  margin-bottom: var(--s-5);
}
.entry-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  margin: 0 0 var(--s-3);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
}

.entry-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}

.entry-actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.entry-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-mute);
}
.entry-meta.meta-ok  { color: var(--green); }
.entry-meta.meta-err { color: var(--red); }

/* Friendly interpretation block */
.entry-interpret {
  background: var(--bg-elev);
  border: 1px solid var(--border-mute);
  border-radius: var(--r-md);
  padding: var(--s-4);
}
.entry-interpret p { margin: 0 0 var(--s-2); font-size: 13px; line-height: 1.55; }
.entry-interpret p:last-child { margin-bottom: 0; }
.entry-interpret ul.lib-result-list { margin: var(--s-3) 0; padding: 0; list-style: none; }
.lib-result-list li {
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-mute);
}
.lib-result-list li:last-child { border-bottom: 0; }
.lib-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.lib-pill-ok   { background: rgba(63,185,80,0.16);  color: var(--green); }
.lib-pill-warn { background: rgba(210,153,34,0.16); color: var(--amber); }
.lib-error { color: var(--red); }

/* Request / Response monospace blocks (always visible, Postman-style) */
.entry-rw {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg);
}
.entry-rw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px var(--s-4);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
}
.entry-rw-status { font-family: var(--font-mono); font-size: 11px; }
.entry-rw-body {
  margin: 0;
  padding: var(--s-3) var(--s-4);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg);
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  max-height: 380px;
}

/* ────────────────────────────────────────────────────────────────────── */
/*  Library inputs                                                         */
/* ────────────────────────────────────────────────────────────────────── */
.lib-input { display: flex; flex-direction: column; gap: 4px; }
.lib-input label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
  font-weight: 600;
}
.lib-input input,
.lib-input select {
  padding: 7px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-size: 13px;
  font-family: var(--font-mono);
}
.lib-input select { appearance: none; cursor: pointer; }
.lib-input input:focus,
.lib-input select:focus {
  outline: none;
  border-color: var(--blue-soft);
  box-shadow: 0 0 0 2px rgba(88,166,255,0.18);
}
.lib-input small {
  font-size: 11px;
  color: var(--fg-dim);
  line-height: 1.45;
}

.lib-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.lib-toggle-btn {
  padding: 7px 14px;
  border: 0;
  background: var(--bg);
  color: var(--fg-mute);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.lib-toggle-btn + .lib-toggle-btn { border-left: 1px solid var(--border); }
.lib-toggle-btn:hover { background: var(--bg-soft); color: var(--fg); }
.lib-toggle-btn.active { background: var(--blue); color: #fff; }

/* ────────────────────────────────────────────────────────────────────── */
/*  Buttons                                                                */
/* ────────────────────────────────────────────────────────────────────── */
button.primary,
button.secondary {
  padding: 7px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
button.primary:hover { background: #388bfd; }
button.secondary:hover { background: var(--border-mute); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ────────────────────────────────────────────────────────────────────── */
/*  Activity (events) panel                                                */
/* ────────────────────────────────────────────────────────────────────── */
.act-clear {
  background: transparent;
  border: 0;
  color: var(--fg-dim);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: var(--r-xs);
  cursor: pointer;
  font-family: inherit;
}
.act-clear:hover { background: var(--bg-soft); color: var(--fg); }

.act-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}
.act-item {
  padding: 8px var(--s-4);
  border-bottom: 1px solid var(--border-mute);
  font-size: 12px;
  cursor: pointer;
  animation: actIn 0.18s ease-out;
}
@keyframes actIn {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}
.act-item:hover { background: var(--bg-hover); }
.act-item.expanded { background: var(--bg-soft); }

.act-row1 {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.act-time {
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.act-verdict {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.act-verdict::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.act-verdict-granted { color: var(--green); }
.act-verdict-denied  { color: var(--red); }
.act-verdict-other   { color: var(--fg-mute); }

/* Downstream (SIE/SIA) sign-in blocked on an otherwise-granted tap.
   The word stays GRANTED — Paxton/Lenel did grant it — but the row turns amber
   so QA can see at a glance why no sign-in followed. Deliberately overrides
   .act-verdict-granted: verdict and downstream readiness are separate concepts,
   and this colours the SECOND one. */
.act-verdict-warn { color: var(--amber); }
.act-item-warn {
  background: rgba(210,153,34,0.06);
  border-left: 2px solid var(--amber);
  padding-left: calc(var(--s-4) - 2px);
}
.act-item-warn:hover { background: rgba(210,153,34,0.11); }

.act-block {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  color: var(--amber);
  border: 1px solid var(--amber);
  background: rgba(210,153,34,0.12);
  flex-shrink: 0;
}

.act-note {
  margin-top: 4px;
  color: var(--amber);
  font-size: 11px;
  line-height: 1.35;
  opacity: 0.9;
}

/* Simulator-originated tap marker in the activity feed. */
.act-sim {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  color: var(--fg-mute);
  border: 1px solid var(--fg-mute);
  opacity: 0.7;
}

.act-row2 {
  margin-top: 3px;
  color: var(--fg-mute);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.act-row2 .act-who { color: var(--fg); }
.act-row2 .act-sep { color: var(--border); margin: 0 4px; }

.act-json {
  margin: var(--s-2) 0 0;
  padding: var(--s-3);
  background: var(--bg);
  border: 1px solid var(--border-mute);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow: auto;
}

.act-empty {
  padding: var(--s-5) var(--s-4);
  color: var(--fg-dim);
  font-size: 12px;
  text-align: center;
  font-style: italic;
}

/* ────────────────────────────────────────────────────────────────────── */
/*  Verdict picker (Grant / Deny / Auto) — segmented control               */
/* ────────────────────────────────────────────────────────────────────── */
.verdict-picker {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 2px;
  gap: 2px;
  width: fit-content;
}
.verdict-picker button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: transparent;
  color: var(--fg-dim);
  border: 0;
  border-radius: var(--r-xs);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
}
.verdict-picker button::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
}
.verdict-picker button:hover:not(.active) { color: var(--fg); background: var(--bg-hover); }
.verdict-picker button.active { font-weight: 600; }
.verdict-picker button.active::before { opacity: 1; }
.verdict-picker button.grant.active { background: rgba(46, 160, 67, 0.14); color: var(--green); }
.verdict-picker button.deny.active  { background: rgba(248, 81, 73, 0.14); color: var(--red); }
.verdict-picker button.auto.active  { background: rgba(88, 166, 255, 0.14); color: var(--blue-soft); }

/* ────────────────────────────────────────────────────────────────────── */
/*  Badge status quick-flip widget                                         */
/* ────────────────────────────────────────────────────────────────────── */
.badge-status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding: 7px 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border-mute);
  border-radius: var(--r-sm);
  font-size: 12px;
}
.badge-status-label {
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
  font-weight: 600;
}
.badge-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 11px;
  border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
}
.badge-status-pill::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-status-pill.active   { color: var(--green); background: rgba(46,160,67,0.12); border-color: rgba(46,160,67,0.35); }
.badge-status-pill.lost     { color: var(--red);   background: rgba(248,81,73,0.12); border-color: rgba(248,81,73,0.35); }
.badge-status-pill.returned { color: var(--amber); background: rgba(210,153,34,0.12); border-color: rgba(210,153,34,0.35); }
.badge-status-pill.loading,
.badge-status-pill.unknown,
.badge-status-pill.error { color: var(--fg-mute); background: transparent; border-color: var(--border); }
.badge-status-pill.loading::before { background: transparent; }
.badge-status-sep { color: var(--fg-dim); font-size: 13px; }
.badge-status-actions { display: inline-flex; gap: 4px; }
.badge-status-btn {
  padding: 2px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-mute);
  font-size: 11px;
  cursor: pointer;
}
.badge-status-btn:hover:not(:disabled) { color: var(--fg); background: var(--bg-elev); border-color: var(--blue-soft); }
.badge-status-btn:disabled:not(.current) { opacity: 0.4; cursor: not-allowed; }
.badge-status-btn.current { background: var(--bg-elev); color: var(--fg); cursor: not-allowed; }
.badge-status-msg { font-size: 11px; color: var(--fg-mute); margin-left: auto; }
.badge-status-msg.ok  { color: var(--green); }
.badge-status-msg.err { color: var(--red); }

/* ────────────────────────────────────────────────────────────────────── */
/*  Scan entry (hands-free RFID)                                           */
/* ────────────────────────────────────────────────────────────────────── */
.scan-target {
  position: relative;
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  background: var(--bg-elev);
  padding: var(--s-6);
  cursor: text;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.scan-target:has(.scan-input:focus) {
  border-style: solid;
  border-color: var(--blue-soft);
  background: rgba(88,166,255,0.04);
}
.scan-target.scan-busy { border-color: var(--blue);  background: rgba(31,111,235,0.06); }
.scan-target.scan-ok   { border-color: var(--green); background: rgba(46,160,67,0.06);  border-style: solid; }
.scan-target.scan-err  { border-color: var(--red);   background: rgba(248,81,73,0.06);  border-style: solid; }
.scan-target.scan-blur { border-color: var(--border); background: var(--bg-elev); opacity: 0.7; }

.scan-target-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.scan-eye {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--fg-dim);
  box-shadow: 0 0 0 4px rgba(110,118,129,0.18);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.scan-target:has(.scan-input:focus) .scan-eye {
  background: var(--blue-soft);
  box-shadow: 0 0 0 4px rgba(88,166,255,0.25);
  animation: scanPulse 1.4s ease-in-out infinite;
}
.scan-target.scan-busy .scan-eye { background: var(--blue);  box-shadow: 0 0 0 4px rgba(31,111,235,0.30);  animation: none; }
.scan-target.scan-ok   .scan-eye { background: var(--green); box-shadow: 0 0 0 4px rgba(46,160,67,0.30);   animation: none; }
.scan-target.scan-err  .scan-eye { background: var(--red);   box-shadow: 0 0 0 4px rgba(248,81,73,0.30);   animation: none; }
@keyframes scanPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(88,166,255,0.25); }
  50%      { box-shadow: 0 0 0 8px rgba(88,166,255,0.10); }
}
.scan-input {
  width: 100%;
  max-width: 420px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 16px;
  text-align: center;
  letter-spacing: 0.04em;
}
.scan-input:focus {
  outline: none;
  border-color: var(--blue-soft);
  box-shadow: 0 0 0 2px rgba(88,166,255,0.18);
}
.scan-hint {
  margin: 0;
  font-size: 12px;
  color: var(--fg-mute);
  font-variant-numeric: tabular-nums;
}
.scan-hint.scan-hint-ok   { color: var(--green); }
.scan-hint.scan-hint-warn { color: var(--amber); }
.scan-hint.scan-hint-err  { color: var(--red); }

.entry-section-tag {
  font-size: 10px;
  font-weight: 500;
  color: var(--fg-dim);
  letter-spacing: 0.04em;
  margin-left: var(--s-2);
  text-transform: none;
}

.scan-history {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-mute);
  border-radius: var(--r-md);
  overflow: hidden;
}
.scan-history:empty { display: none; }
.scan-history-empty {
  margin: 0;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border-mute);
  border-radius: var(--r-md);
  color: var(--fg-dim);
  font-size: 12px;
  font-style: italic;
}
.scan-history:not(:empty) ~ .scan-history-empty { display: none; }
.scan-row {
  display: grid;
  grid-template-columns: 80px 80px 130px 1fr auto;
  align-items: center;
  gap: var(--s-3);
  padding: 8px var(--s-4);
  border-bottom: 1px solid var(--border-mute);
  font-size: 12px;
  animation: actIn 0.18s ease-out;
}
.scan-row:last-child { border-bottom: 0; }
.scan-row-badge {
  font-family: var(--font-mono);
  color: var(--fg);
  font-weight: 600;
}
.scan-row-detail {
  color: var(--fg-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scan-row-register {
  padding: 3px 9px;
  background: transparent;
  color: var(--blue-soft);
  border: 1px solid rgba(88,166,255,0.32);
  border-radius: var(--r-xs);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  font-family: inherit;
}
.scan-row-register:hover {
  background: rgba(88,166,255,0.10);
  color: var(--fg);
}

/* ────────────────────────────────────────────────────────────────────── */
/*  Register-a-badge entry — person picker + form                          */
/* ────────────────────────────────────────────────────────────────────── */
.reg-person {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.reg-person-search {
  padding: 8px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-size: 13px;
  font-family: inherit;
}
.reg-person-search:focus {
  outline: none;
  border-color: var(--blue-soft);
  box-shadow: 0 0 0 2px rgba(88,166,255,0.18);
}
.reg-person-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border-mute);
  border-radius: var(--r-sm);
  background: var(--bg-elev);
}
.reg-person-list:empty { display: none; }
.reg-person-row {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-mute);
  cursor: pointer;
}
.reg-person-row:last-child { border-bottom: 0; }
.reg-person-row:hover { background: var(--bg-soft); }
.reg-person-row.selected {
  background: rgba(88,166,255,0.10);
  border-left: 2px solid var(--blue-soft);
  padding-left: 10px;
}
.reg-person-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
}
.reg-person-meta {
  display: flex;
  gap: 10px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--fg-mute);
}
.reg-person-source {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-dim);
  font-weight: 600;
}
.reg-person-id { font-family: var(--font-mono); }
.reg-person-email { color: var(--fg-mute); }
.reg-person-noemail { color: var(--amber); font-style: italic; }
.reg-person-empty {
  margin: 0;
  padding: var(--s-3);
  font-size: 12px;
  color: var(--fg-dim);
  font-style: italic;
}
.reg-person-selected {
  margin: 0;
  padding: 8px 12px;
  background: rgba(46,160,67,0.08);
  border: 1px solid rgba(46,160,67,0.28);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--fg);
}

/* ────────────────────────────────────────────────────────────────────── */
/*  Auto-verdict reasoning panel                                           */
/* ────────────────────────────────────────────────────────────────────── */
.auto-verdict-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 var(--s-3);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 12px;
  line-height: 1.45;
  background: var(--bg-elev);
}
.auto-verdict-note::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.auto-verdict-note strong { font-weight: 600; letter-spacing: 0.02em; text-transform: capitalize; }
.auto-verdict-note span   { color: var(--fg-mute); font-weight: 400; }
.auto-verdict-note.grant  { border: 1px solid rgba(46,160,67,0.32); color: var(--green); }
.auto-verdict-note.deny   { border: 1px solid rgba(248,81,73,0.32); color: var(--red); }

/* ────────────────────────────────────────────────────────────────────── */
/*  Misc utilities                                                         */
/* ────────────────────────────────────────────────────────────────────── */
.ev-mute  { color: var(--fg-dim); }
.loading  { padding: var(--s-6); color: var(--fg-mute); font-size: 13px; text-align: center; }
.error    { padding: var(--s-4); color: var(--red); font-size: 13px; }

/* Narrow viewport: hide the activity panel so the workspace fits */
@media (max-width: 1100px) {
  .app-body { grid-template-columns: var(--lib-pane-w) 1fr; }
  .act-pane { display: none; }
}
@media (max-width: 800px) {
  .app-body { grid-template-columns: 1fr; }
  .lib-pane { display: none; }
}

/* ── Provider picker ─────────────────────────────────────────────────── */
/* The header is space-between (brand | provider | pills), so the picker
   sits in the middle without needing a margin hack. */
.header-provider {
  display: inline-flex;
  align-items: center;
}
.provider-picker {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.provider-picker-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
}
.provider-picker select {
  background: var(--bg-soft);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px var(--s-2);
  font: inherit;
  font-size: 12px;
}
.provider-picker select:hover { border-color: var(--blue-soft); }
.provider-picker select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

/* Target-environment picker — a searchable combobox + refresh + resolved URL. */
.header-env { display: inline-flex; align-items: center; min-width: 0; }
.env-picker { display: inline-flex; align-items: center; gap: var(--s-2); min-width: 0; }
.env-picker-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
}
.env-refresh {
  background: var(--bg-soft);
  color: var(--fg-dim);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 3px 7px;
  font: inherit;
  cursor: pointer;
}
.env-refresh:hover:not(:disabled) { border-color: var(--blue-soft); color: var(--fg); }
.env-refresh:disabled { opacity: 0.5; cursor: default; }
.env-url {
  font-size: 11px;
  color: var(--fg-dim);
  max-width: 34ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.env-url.env-error { color: var(--red); font-weight: 700; max-width: none; }

/* Reusable combobox */
.cbx { position: relative; display: inline-block; }
.cbx-input {
  background: var(--bg-soft);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px 22px 4px var(--s-2);
  font: inherit;
  font-size: 12px;
  width: 24ch;
}
.cbx-input:hover { border-color: var(--blue-soft); }
.cbx-input:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.cbx-caret {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--fg-dim);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 2px;
}
.cbx-list {
  position: absolute;
  z-index: 40;
  top: calc(100% + 2px);
  left: 0;
  min-width: 100%;
  max-width: 42ch;
  max-height: 320px;
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.cbx-opt {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  padding: 4px var(--s-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}
.cbx-opt:hover, .cbx-active { background: var(--blue-soft); }
.cbx-opt-label { color: var(--fg); }
.cbx-manual .cbx-opt-label::before { content: "+ "; color: var(--blue); }
.cbx-badge {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-dim);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 4px;
  opacity: 0.9;
  flex: none;
}
.cbx-badge-open { color: var(--green); border-color: var(--green); }
.cbx-badge-branch { color: var(--fg-dim); border-color: var(--border); }
.cbx-hint { font-size: 11px; color: var(--fg-dim); overflow: hidden; text-overflow: ellipsis; }
.cbx-empty { padding: 6px var(--s-2); color: var(--fg-dim); font-size: 12px; }
.provider-static {
  font-size: 12px;
  color: var(--fg-mute);
}
.provider-none { color: var(--red); }

/* Entries the active provider cannot run stay visible, but inert — a row that
   silently vanishes on provider switch just looks like a bug. */
.lib-nav-item-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  text-decoration: line-through;
}
.lib-nav-item-disabled:hover { background: none; }
