@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/Inter-Regular.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/Inter-Medium.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-synthesis: none;
  --bg: #f4f4f4;
  --panel: #f2f2f2;
  --surface: #ffffff;
  --line: #cccccc;
  --text: #353535;
  --muted: #5c5c5c;
  --accent: #3d5348;
  --help-mark: color-mix(in srgb, var(--muted) 75%, #ffffff);
  --help-mark-fill: color-mix(in srgb, var(--muted) 10%, var(--surface));
  --status-red: #c90027;
  --canvas: #ececec;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --checks-row-gap: 2px;
  --node-agent: #e8b86d;
  --node-message: #9aa7ff;
  --node-page: #c49cff;
  --node-artifact: #55d6be;
  --node-host: #60a5fa;
  --node-task_family: #fb7185;
  --node-call_sign: #fbbf24;
  --node-url: #38bdf8;
  --node-payload: #a7f3d0;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 340px;
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
}

aside {
  z-index: 2;
  overflow: auto;
  min-height: 0;
  padding: 22px 20px 28px;
  background: var(--panel);
}
#controls {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border-right: 1px solid var(--line);
}
#inspector { border-left: 1px solid var(--line); }
main {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  background: var(--canvas);
}
#canvas-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
}
canvas { display: block; width: 100%; height: 100%; cursor: grab; }
canvas.dragging { cursor: grabbing; }
canvas.has-message-cue { cursor: pointer; }

#controls header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
#controls header .eyebrow { margin-bottom: 6px; }
#controls header .wordmark { margin-bottom: 12px; }
#controls header h1 { margin-bottom: 0; }
#controls header #status { margin: 8px 0 0; }
#status[hidden], #status:empty { display: none; }

.wordmark {
  display: flex;
  align-items: center;
  min-width: 0;
  font-size: 14px;
  line-height: 1;
}
.wordmark a {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.wordmark a:hover, .wordmark a:focus-visible { color: var(--accent); }
.wordmark-rightminds { font-weight: 500; }
.wordmark-maxwell { font-weight: 400; }
.demon-mark {
  display: block;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  object-fit: contain;
}

h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
}
h2 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}
section { margin-top: 28px; }
.eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .08em;
}
#status, #inspector-body { color: var(--muted); font-size: 12px; line-height: 1.5; }
#status { font-family: var(--mono); font-size: 11px; }
#status.is-error { color: var(--status-red); }
#inspector-title { font-size: 14px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text); }

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover, a:focus-visible { color: var(--accent); }

input, select {
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 7px 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
input:hover, select:hover { border-color: #b3b3b3; }
input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}
.search { display: block; margin-top: 22px; color: var(--muted); font-size: 12px; }
.labeled-control { margin-top: 18px; color: var(--muted); font-size: 12px; }
.entity-browser .labeled-control { margin-top: 10px; font-size: 10px; }
.label-row, .entity-list-label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.entity-list-label { margin-top: 10px; color: var(--muted); font-size: 10px; }
.control-with-help {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.help-trigger {
  position: relative;
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--help-mark);
  font-size: 10px;
  line-height: 1;
}
.help-trigger::before {
  content: "?";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.58rem;
  height: 0.58rem;
  transform: translate(-50%, -50%);
  border: 1px solid currentColor;
  border-radius: 50%;
  background: var(--help-mark-fill);
  font-size: 9px;
  line-height: 0.56rem;
  text-align: center;
}
.help-trigger[aria-expanded="true"] {
  color: var(--accent);
  background: transparent;
}
.help-trigger[aria-expanded="true"]::before { border-color: var(--accent); }
#help-popover {
  position: fixed;
  z-index: 50;
  top: var(--help-top, 8px);
  left: var(--help-left, 8px);
  width: min(22rem, calc(100vw - 24px));
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
}
.help-popover-title {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.help-popover-body {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.button-row { display: flex; flex-wrap: wrap; gap: 7px; }
button {
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 5px 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 400;
}
button:hover {
  border-color: #b3b3b3;
  color: var(--text);
}
button.active {
  border-color: var(--accent);
  color: var(--text);
  font-weight: 500;
  background: var(--surface);
}
button:disabled {
  cursor: default;
  color: #9a9a9a;
  border-color: var(--line);
}
.checks { display: grid; gap: var(--checks-row-gap); }
.checks label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 1.25rem;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}
.checks input { width: auto; margin: 0; }
.checks input[type="checkbox"] {
  padding: 0;
  flex: 0 0 auto;
}
.filter-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}
.filter-option:has(.help-trigger) { min-height: 1.5rem; }
.filter-option label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}
.filter-option.is-blocked {
  opacity: 0.45;
}
.filter-option.is-blocked label { color: var(--muted); }
.filter-option.is-selected-hidden .filter-option-status { color: var(--muted); }
.filter-option-status {
  display: inline;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.entity-browser {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  margin-top: 18px;
  overflow: hidden;
}
.entity-browser > :not(#entity-list) { flex: 0 0 auto; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.section-heading h2 { margin-bottom: 8px; }
#entity-count { color: var(--muted); font-size: 10px; font-family: var(--mono); }
.entity-tabs { gap: 5px; }
.entity-tabs button { padding: 5px 7px; }
.discovery-includes { margin-top: 6px; }
.discovery-include-actions { margin-top: 6px; gap: 6px; }
.discovery-include-actions button { padding: 4px 7px; }
.match-mode { margin-top: 8px; }
.date-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
#date-filters-details {
  margin-top: 10px;
}
#date-filters-details summary {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}
#date-filters-details[data-active] summary {
  color: var(--accent);
}
.discovery-error {
  margin: 8px 0 0;
  color: var(--status-red);
  font-size: 10px;
}
.type-badge {
  display: inline-block;
  margin-right: 4px;
  padding: 0 4px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  font-family: var(--mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
#workspace-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 500;
}
#workspace-selection[hidden] { display: none; }
#workspace-selection button { padding: 4px 6px; font-weight: 400; color: var(--muted); }
.sort-control { display: block; margin-top: 10px; color: var(--muted); font-size: 10px; }
.sort-control select { margin-top: 4px; padding: 6px 8px; }
.entity-browser .labeled-control select { margin-top: 4px; padding: 6px 8px; }
#entity-list {
  flex: 1 1 auto;
  min-height: 8rem;
  max-height: none;
  overflow: auto;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  user-select: none;
}
#entity-list button {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 7px 8px;
  text-align: left;
  background: transparent;
}
#entity-list button:last-child { border-bottom: 0; }
#entity-list button.selected-entity {
  border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.entity-name { display: block; overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.entity-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; font-family: var(--mono); }
.entity-empty { padding: 10px; color: var(--muted); font-size: 10px; }
.entity-select-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}
.legend-glyph {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
}
.legend-glyph[data-node-type="agent"] { fill: var(--node-agent); stroke: var(--node-agent); }
.legend-glyph[data-node-type="message"] { fill: var(--node-message); stroke: var(--node-message); }
.legend-glyph[data-node-type="page"] { fill: var(--node-page); stroke: var(--node-page); }
.legend-glyph[data-node-type="artifact"] { fill: var(--node-artifact); stroke: var(--node-artifact); }
.legend-glyph[data-node-type="host"] { fill: var(--node-host); stroke: var(--node-host); }
.legend-glyph[data-node-type="task_family"] { fill: var(--node-task_family); stroke: var(--node-task_family); }
.legend-glyph[data-node-type="call_sign"] { fill: var(--node-call_sign); stroke: var(--node-call_sign); }
.legend-glyph[data-node-type="url"] { fill: none; stroke: var(--node-url); }
.legend-glyph[data-node-type="payload"] { fill: var(--node-payload); stroke: var(--node-payload); }
.legend-glyph[data-glyph="hollow-diamond"] { fill: none; stroke-width: 1.6; }
#legend {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
  max-width: calc(100% - 28px);
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  font-size: 10px;
  color: var(--muted);
  pointer-events: none;
}
.visible-graph-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 100%;
}
.visible-graph-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  max-width: 100%;
}
.visible-graph-heading {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}
.visible-graph-items {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
  max-width: 100%;
}
.visible-graph-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.visible-graph-encoding {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  max-width: 100%;
  pointer-events: auto;
}
.visible-graph-encoding .legend-edge-sample {
  pointer-events: none;
}
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-edge-sample {
  display: inline-block;
  width: 16px;
  height: 0;
  border-top: 2px solid #353535;
}
.legend-edge-sample[data-edge="inferred"] { border-top-style: dotted; }
.legend-edge-sample[data-edge="weight"] { border-top-width: 3px; }
.legend-edge-sample[data-edge="message"] { border-top-color: var(--accent); }
.legend-arrow-sample {
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 7px solid #353535;
}
#legend .help-trigger { pointer-events: auto; }

#canvas-toolbar {
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 12px;
  min-width: 0;
  max-width: 100%;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.toolbar-projection {
  margin-top: 0;
  min-width: 11rem;
  color: var(--muted);
  font-size: 10px;
}
.toolbar-projection select,
.toolbar-handoffs select { margin-top: 4px; padding: 5px 8px; }
.toolbar-handoffs {
  margin-top: 0;
  min-width: 8rem;
  color: var(--muted);
  font-size: 10px;
}
.toolbar-labels {
  align-items: center;
}
.toolbar-check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
}
.toolbar-check input { margin: 0; }
#show-all-labels-status {
  color: var(--muted);
  font-size: 10px;
  max-width: 9rem;
  line-height: 1.3;
}
#show-all-labels-wrap.is-disabled .toolbar-check { color: var(--muted); }
#canvas-toolbar .control-with-help { align-items: center; }
.dialog-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.graph-filters-body {
  display: grid;
  gap: 12px;
  max-height: min(70vh, 520px);
  overflow: auto;
  padding: 12px 18px 18px;
}
.graph-filters-body details {
  border: 1px solid var(--line);
  background: var(--surface);
}
.graph-filters-body summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.filter-group-actions { padding: 0 10px 8px; }
.graph-filters-body .checks { padding: 0 10px 10px; }

#empty {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  color: var(--muted);
  font-size: 12px;
}
#empty-recovery {
  position: absolute;
  inset: auto 16px 16px 16px;
  display: grid;
  gap: 8px;
  max-width: 28rem;
  margin: 0 auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}
#empty-recovery[hidden] { display: none; }
#empty-recovery-message { margin: 0; }
#projection-switch-dialog .dialog-body {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
}
#projection-switch-copy { margin: 0; font-size: 13px; line-height: 1.45; }
#projection-switch-dialog .toolbar-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  flex-wrap: nowrap;
  max-width: 100%;
  cursor: pointer;
}
#projection-switch-dialog .toolbar-check input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex: 0 0 auto;
}

.kv { display: grid; grid-template-columns: minmax(118px, max-content) 1fr; gap: 4px 9px; margin: 12px 0; }
.kv dt {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}
.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
}
.evidence {
  position: relative;
  margin-top: 12px;
  border-left: 2px solid var(--accent);
  padding: 8px 32px 8px 10px;
  background: var(--surface);
}
.evidence > .help-trigger {
  position: absolute;
  top: 8px;
  right: 8px;
}
.neighbor-list button { display: block; width: 100%; margin: 4px 0; text-align: left; }
.relation-row.is-hidden { color: var(--muted); }
.workspace-seed-list {
  max-height: 180px;
  overflow: auto;
  margin: 8px 0 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.workspace-seed-list button {
  display: block;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}
.workspace-seed-list button:last-child { border-bottom: 0; }
.evidence-notice { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.capability-list {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.evidence-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  background: var(--surface);
}
.evidence-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
}
.evidence-item:last-child { border-bottom: 0; }
.evidence-type {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 9px;
  font-family: var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.evidence-label {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11px;
}
.evidence-item button, .evidence-item a { justify-self: end; }
.evidence-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: end;
}
.evidence-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  font-family: var(--mono);
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

dialog, .app-dialog {
  width: min(820px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  box-shadow: none;
}
dialog[open], .app-dialog[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
dialog::backdrop { background: color-mix(in srgb, var(--text) 28%, transparent); }
.dialog-header, .context-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  flex: 0 0 auto;
}
.dialog-header h2, .context-header h2 { margin-bottom: 0; text-transform: none; letter-spacing: 0; font-size: 14px; }
.dialog-body, .graph-filters-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
#context-body { padding: 18px; }
.dialog-footer {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.context-meta { margin-bottom: 14px; }
.context-message {
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 12px;
  background: var(--surface);
}
.context-message.context-message-current,
.context-message.current { border-color: var(--accent); }
.context-message + .context-message { margin-top: 10px; }
.context-message summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}
.context-message[open] summary { margin-bottom: 9px; }
.context-message pre {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}
mark {
  background: color-mix(in srgb, var(--text) 14%, var(--surface));
  color: inherit;
  padding: 0;
}
.context-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  justify-content: space-between;
}
.context-nav-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 14rem;
}
.context-nav-heading {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
}
.context-nav-sep { color: var(--muted); }
.context-nav-pos { min-width: 3.5rem; }
.roster-view-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
#roster-selected-count { color: var(--muted); font-size: 10px; font-family: var(--mono); }

#roster-dialog { width: min(960px, calc(100vw - 32px)); }
.roster-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px 0;
  flex: 0 0 auto;
}
#roster-count, #roster-page, #context-evidence-page { color: var(--muted); font-size: 10px; font-family: var(--mono); }
.roster-table-wrap {
  margin: 12px 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}
#roster-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
#roster-table th, #roster-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
#roster-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  color: var(--muted);
  font-weight: 500;
  font-size: 10px;
}
#roster-table tbody tr { cursor: pointer; }
#roster-table tbody tr:hover, #roster-table tbody tr:focus {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  outline: none;
}
#roster-table tbody tr[aria-selected="true"] {
  background: color-mix(in srgb, var(--text) 8%, var(--surface));
  outline: 1px solid var(--text);
  outline-offset: -1px;
}
.roster-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 1 1 auto;
}

.header-guide { margin-top: 8px; }
#user-docs-open {
  white-space: normal;
  max-width: 100%;
  text-align: left;
}
.user-docs-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
#user-docs-dialog {
  width: min(960px, calc(100vw - 32px));
  height: min(860px, calc(100vh - 32px));
}
.user-docs-shell {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
}
.user-docs-nav {
  flex: 0 0 11.5rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 12px 12px 18px;
  border-right: 1px solid var(--line);
  overflow: auto;
}
.user-docs-nav-item {
  text-align: left;
  width: 100%;
}
.user-docs-nav-item[aria-current="page"] {
  background: color-mix(in srgb, var(--text) 8%, var(--surface));
}
.user-docs-article-wrap {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 16px 18px;
}
.user-docs-status { color: var(--muted); font-size: 12px; }
.user-docs-status.is-error { color: var(--text); }
.user-docs-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  margin: 4px 0 0;
  max-width: 42rem;
}
.user-docs-meta-item { white-space: nowrap; }
.user-docs-article { max-width: 46rem; }
.user-docs-article h1 { font-size: 18px; margin: 0 0 12px; }
.user-docs-article h2 { font-size: 14px; margin: 18px 0 8px; }
.user-docs-article h3 { font-size: 13px; margin: 14px 0 6px; }
.user-docs-article p, .user-docs-article li { font-size: 13px; line-height: 1.55; }
.user-docs-article ul, .user-docs-article ol { padding-left: 1.2rem; }
.user-docs-article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 12px 0;
}
.user-docs-article th, .user-docs-article td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}
.user-docs-article blockquote {
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--text);
  background: var(--surface);
}
.user-docs-article .user-docs-callout[data-callout="warning"],
.user-docs-article .user-docs-callout[data-callout="caution"] {
  border-left-color: var(--accent);
}
.user-docs-callout-title { font-weight: 500; margin-bottom: 6px; }
.user-docs-article pre {
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
}
.user-docs-article a { color: var(--text); text-decoration: underline; }
.user-docs-unsafe-link, .user-docs-inert-html { font-family: var(--mono); font-size: 12px; }
.user-docs-footer-note { color: var(--muted); font-size: 11px; margin: 0; flex: 1 1 auto; }

@media (max-width: 980px) {
    body { grid-template-columns: 240px minmax(0, 1fr); }
    .date-filters { grid-template-columns: 1fr; }
    #roster-dialog, #graph-filters-dialog, #user-docs-dialog { width: calc(100vw - 16px); }
  .toolbar-projection,
  .toolbar-handoffs { min-width: 0; flex: 1 1 12rem; }
  .user-docs-shell { flex-direction: column; }
  .user-docs-nav {
    flex: 0 0 auto;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
  }
  .user-docs-nav-item { width: auto; }
  .user-docs-meta { font-size: 11px; }
  .user-docs-meta-item { white-space: normal; }
  .user-docs-meta { overflow-wrap: anywhere; }
  #user-docs-open { white-space: normal; }
  #inspector {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(320px, 42vw);
    box-shadow: none;
    border-left: 1px solid var(--line);
  }
}
@media (max-height: 720px) {
  #controls { overflow: auto; }
}
@media (max-width: 720px) {
  #projection-switch-dialog .toolbar-check {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.4em;
  }
  #projection-switch-dialog .toolbar-check input[type="checkbox"] {
    width: auto;
    margin: 0;
    flex: 0 0 auto;
  }
}
