:root {
  color-scheme: light;
  font-family: Verdana, Geneva, sans-serif;
  --bg: #f7f7f5;
  --surface: #fff;
  --ink: #18181b;
  --muted: #71717a;
  --border: #e4e4e7;
  --soft: #f4f4f5;
  --green: #047857;
  --green-soft: #ecfdf5;
  --amber: #a16207;
  --amber-soft: #fefce8;
  --violet: #6d28d9;
  --violet-soft: #f5f3ff;
  --radius: 2px;
  --rail: 350px;
  --inspector: 420px;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}
button {
  font: inherit;
}
main {
  height: 100dvh;
  padding: 0;
  transition: margin-right 0.2s ease;
}
body.drawer-open main {
  margin-right: var(--inspector);
}
.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 4px 14px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  display: inline;
  margin: 0 10px 0 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}
.lead {
  display: inline;
  color: var(--muted);
  font-size: 12px;
}
.eyebrow {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.projection-meta,
.meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.header-action,
.view-switch button,
.queue-filters button {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}
.header-action:hover,
.view-switch button.active,
.queue-filters button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}
.legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}
.legend i {
  display: inline-block;
  flex: none;
}
.legend-action {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2563eb;
}
.legend-state {
  width: 0;
  height: 0;
  border-right: 6px solid transparent;
  border-bottom: 10px solid #16a34a;
  border-left: 6px solid transparent;
}
.legend-edge {
  position: relative;
  width: 18px;
  height: 1px;
  background: #a1a1aa;
}
.legend-edge::after {
  position: absolute;
  top: -3px;
  right: -1px;
  width: 0;
  height: 0;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  border-left: 5px solid #a1a1aa;
  content: "";
}
.badge,
.pill,
.score {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.025em;
}
.badge.muted {
  color: var(--muted);
  font-weight: 500;
}
.pill.explore {
  border-color: #c4b5fd;
  background: var(--violet-soft);
  color: var(--violet);
}
.pill.exploit {
  border-color: #a7f3d0;
  background: var(--green-soft);
  color: var(--green);
}
.pill.gate {
  border-color: #fde68a;
  background: var(--amber-soft);
  color: var(--amber);
}
.score {
  margin-left: auto;
  background: transparent;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.decision-layout {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 2px;
  height: 100dvh;
}
.action-rail,
.graph-section {
  min-height: 0;
  border: 1px solid var(--border);
  background: var(--surface);
}
.action-rail {
  border-radius: 0 var(--radius) var(--radius) 0;
}
.action-rail {
  overflow-y: auto;
  padding: 16px;
  scrollbar-color: transparent transparent;
  scrollbar-width: thin;
}
.action-rail:hover,
.action-rail:focus-within {
  scrollbar-color: var(--muted) transparent;
}
.action-rail::-webkit-scrollbar {
  width: 4px;
}
.action-rail::-webkit-scrollbar-track {
  background: transparent;
}
.action-rail::-webkit-scrollbar-thumb {
  border-radius: 2px;
  background: transparent;
}
.action-rail:hover::-webkit-scrollbar-thumb,
.action-rail:focus-within::-webkit-scrollbar-thumb {
  background: var(--muted);
}
.queue-header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.queue-title-row,
.queue-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.queue-title-row h1 {
  display: block;
  margin: 2px 0 0;
  font-size: 18px;
}
.queue-header > p {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 10px;
}
.queue-header > .command-copy {
  margin-bottom: 14px;
}
.command-copy {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: #18181b;
  color: #fff;
  cursor: pointer;
  text-align: left;
}
.command-copy code {
  overflow: hidden;
  font:
    10px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.command-copy span {
  color: #d4d4d8;
  font-size: 9px;
}
.queue-tools {
  align-items: flex-end;
}
.updated {
  color: var(--muted);
  font-size: 9px;
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
}
.view-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 14px;
}
.ranked-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}
.ranked-header h2 {
  margin: 2px 0 0;
  font-size: 16px;
}
.queue-filters {
  display: flex;
  gap: 3px;
  margin: 0;
  padding: 0;
  border: 0;
}
.ranked-list {
  display: grid;
  gap: 0;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.ranked-list > li {
  border-bottom: 1px solid var(--border);
}
.ranked-list > li:last-child {
  border-bottom: 0;
}
.ranked-row {
  display: grid;
  width: 100%;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 4px;
  align-items: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.rank-number {
  padding-top: 12px;
  color: var(--muted);
  font:
    11px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}
.row-content {
  display: block;
  min-width: 0;
  padding: 12px 0;
}
.rail-section + .rail-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.section-heading,
.graph-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-heading h2,
.graph-heading h2 {
  margin: 2px 0 0;
  font-size: 14px;
}
.section-heading > span,
.hint {
  color: var(--muted);
  font-size: 10px;
}
.next-card {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 13px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.next-index {
  color: #a1a1aa;
  font-size: 18px;
  font-weight: 700;
}
.next-copy,
.next-copy strong,
.next-copy > span {
  display: block;
}
.next-copy strong {
  font-size: 13px;
}
.next-copy > span:not(.meta-row) {
  margin-top: 3px;
  color: #d4d4d8;
  font-size: 10px;
}
.next-copy .meta-row {
  margin-top: 8px;
}
.next-copy .badge,
.next-copy .pill,
.next-copy .score {
  border-color: #52525b;
  background: #27272a;
  color: #e4e4e7;
}
.next-arrow {
  font-size: 18px;
}
.actor-group {
  position: relative;
  margin-top: 10px;
}
.actor-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.count-source {
  position: absolute;
  top: 0;
  right: 0;
  color: var(--muted);
  font-size: 9px;
}
.item-list,
.approval-list {
  display: grid;
  gap: 6px;
}
.item-card,
.approval-row {
  border-radius: 0;
}
.item-card:hover,
.approval-row:hover {
  background: transparent;
}
.item-card.selected {
  box-shadow: inset 0 -2px 0 var(--ink);
}
.item-card h3 {
  margin: 6px 0 2px;
  font-size: 12px;
}
.item-card p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}
.card-top,
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.card-foot {
  margin-top: 7px;
}
.item-id {
  color: var(--muted);
  font:
    9px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}
.empty {
  padding: 12px 8px;
  border: 1px dashed var(--border);
  border-radius: 2px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}
.approval-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  background: var(--amber-soft);
}
.approval-row strong,
.approval-row span {
  display: block;
}
.approval-row strong {
  font-size: 11px;
}
.approval-row span {
  color: var(--amber);
  font-size: 9px;
}
.approval-avatars {
  display: flex;
  gap: 3px;
}
.avatar {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid #d4d4d8;
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
}
.avatar.approved {
  border-color: #a7f3d0;
  background: var(--green-soft);
  color: var(--green);
}
.graph-section {
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius) 0 0 var(--radius);
}
.graph-section > h2 {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 12px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.blocked-actions-toggle {
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 12px;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface);
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  cursor: pointer;
}
.blocked-actions-toggle[aria-pressed="true"] {
  border-color: var(--ink);
  color: var(--ink);
}
#dependency-graph {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  background: #fcfcfc;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.scrim {
  display: none;
}
.drawer {
  position: fixed;
  z-index: 9;
  top: 0;
  right: 0;
  width: min(100%, var(--inspector));
  height: 100dvh;
  padding: 28px;
  overflow-y: auto;
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: -16px 0 48px rgb(0 0 0 / 0.08);
  transform: translateX(105%);
  transition: transform 0.2s ease;
}
.drawer.open {
  transform: translateX(0);
}
.drawer h2 {
  margin: 7px 36px 7px 0;
  font-size: 24px;
}
.drawer-outcome {
  color: var(--muted);
  font-size: 13px;
}
.close {
  position: absolute;
  top: 18px;
  right: 20px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 25px;
}
.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 20px 0;
}
.fact {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--soft);
}
.fact dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.fact dd {
  margin: 4px 0 0;
  font-size: 11px;
  font-weight: 650;
}
.fact-help {
  float: right;
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 9px;
}
.fact-help[aria-expanded="true"] {
  border-color: var(--ink);
  color: var(--ink);
}
.fact-explanation {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
}
.next-transition {
  margin: 14px 0;
  padding: 14px;
  border-left: 3px solid var(--ink);
  background: var(--soft);
}
.next-transition p {
  margin: 4px 0 0;
  font-size: 12px;
}
.next-transition .command-copy {
  margin-top: 12px;
}
details {
  margin-top: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
summary {
  cursor: pointer;
  font-weight: 650;
}
details p {
  margin: 10px 0 0;
  color: var(--muted);
}
.context-note {
  color: var(--ink);
  font-size: 11px;
  white-space: pre-wrap;
}
.context-references {
  margin-top: 12px;
}
.context-references > strong {
  font-size: 10px;
}
.context-references ul {
  display: grid;
  gap: 7px;
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}
.context-references li {
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
}
.context-references a {
  display: block;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.context-references span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  overflow-wrap: anywhere;
}
.calculation {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--soft);
  font:
    11px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}
.action-chain {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  background: var(--soft);
}
.action-chain strong {
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
}
.action-chain ol {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 10px;
}
.action-chain .executable {
  color: var(--ink);
  font-weight: 700;
}
.timeline {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.timeline li {
  position: relative;
  margin-left: 6px;
  padding: 0 0 15px 16px;
  border-left: 1px solid var(--border);
}
.timeline li::before {
  content: "";
  position: absolute;
  top: 3px;
  left: -4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}
.timeline strong,
.timeline time {
  display: block;
}
.timeline time {
  color: var(--muted);
  font-size: 9px;
}
.journal-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--soft);
}
.journal-toolbar label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.journal-toolbar select {
  margin-left: 5px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: #fff;
}
.journal-toolbar > span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
}
.global-journal {
  margin: 0;
  padding: 0;
  list-style: none;
}
.global-event {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.event-position {
  color: var(--muted);
  font:
    11px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}
.event-main strong {
  display: block;
  font-size: 13px;
}
.event-summary {
  margin: 3px 0;
  color: var(--muted);
  font-size: 11px;
}
.event-main time {
  color: var(--muted);
  font-size: 9px;
}
.event-main details {
  padding-bottom: 0;
}
.event-main pre {
  max-width: 100%;
  overflow-x: hidden;
  padding: 10px;
  border-radius: 2px;
  background: var(--soft);
  font-size: 10px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}
@media (max-width: 900px) {
  body {
    overflow: auto;
  }
  main,
  body.drawer-open main {
    height: auto;
    min-height: 100dvh;
    margin-right: 0;
  }
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .decision-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .action-rail {
    overflow: visible;
  }
  .graph-section {
    min-height: 55dvh;
  }
  .scrim:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 8;
    background: rgb(24 24 27 / 0.25);
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #09090b;
    --surface: #18181b;
    --ink: #f4f4f5;
    --muted: #a1a1aa;
    --border: #3f3f46;
    --soft: #27272a;
    --green: #6ee7b7;
    --green-soft: #052e2b;
    --amber: #fcd34d;
    --amber-soft: #422006;
    --violet: #c4b5fd;
    --violet-soft: #2e1065;
  }
  #dependency-graph {
    background: #18181b;
  }
  .command-copy {
    border-color: #52525b;
    background: #f4f4f5;
    color: #18181b;
  }
  .command-copy span {
    color: #52525b;
  }
  .drawer {
    box-shadow: -16px 0 48px rgb(0 0 0 / 0.35);
  }
  .journal-toolbar select {
    background: #18181b;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
.mode-control #cadence-demo-notice {
  display: block;
  margin-top: 0.35rem;
  color: #b45309;
  font-size: 0.75rem;
  font-weight: 700;
}

.mode-control #cadence-demo-notice[hidden] {
  display: none;
}
