:root {
  color-scheme: light;
  --paper: #f7f7f1;
  --ink: #172b23;
  --rail: #193128;
  --leaf: #37664b;
  --line: #cbd2c8;
  --accent: #e8bc4e;
  --muted: #58695f;
  --mono: "IBM Plex Mono",ui-monospace,Menlo,monospace;
  font: 16px/1.48 "Instrument Sans","Avenir Next","Segoe UI",sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

a {
  color: inherit;
  text-underline-offset: .2em;
}

a:hover {
  color: #32704d;
}

h1,h2,h3,p {
  margin: 0;
}

h1,h2,h3 {
  line-height: 1.12;
  letter-spacing: -.035em;
}

h1 {
  font-size: clamp(2.4rem,5vw,4.35rem);
  font-weight: 620;
}

h2 {
  font-size: 1.55rem;
  font-weight: 650;
}

h3 {
  font-size: 1.2rem;
}

button,.button,input,textarea,select {
  font: inherit;
}

button,.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid #aeb9af;
  padding: .48rem .85rem;
  border-radius: .32rem;
  text-decoration: none;
  cursor: pointer;
  font-size: .94rem;
  font-weight: 600;
}

button:hover,.button:hover {
  background: #e2e8de;
  color: var(--ink);
}

button.primary,.button.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  padding: .7rem 1.15rem;
}

button.primary:hover,.button.primary:hover {
  background: var(--leaf);
}

:focus-visible {
  outline: 3px solid #b27811;
  outline-offset: 3px;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: clamp(170px,17vw,235px) 1fr;
}

.rail {
  background: var(--rail);
  color: #eaf1e9;
  padding: 2.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 3.3rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  font-size: 1.8rem;
  letter-spacing: -.06em;
  font-weight: 750;
}

.rail .brand {
  padding-left: .6rem;
}

.brand:hover {
  color: inherit;
}

.brand i {
  display: inline-block;
  width: 25px;
  height: 25px;
  background: var(--accent);
  border-radius: 3px;
  clip-path: polygon(0 0,100% 0,100% 56%,67% 56%,100% 100%,65% 100%,34% 56%,34% 100%,0 100%,0 32%,66% 32%,66% 23%,0 23%);
}

.rail nav {
  display: grid;
  gap: .4rem;
}

.rail nav a {
  padding: .64rem .8rem;
  border-radius: .3rem;
  color: #c1d1c5;
  text-decoration: none;
}

.rail nav a[aria-current],.rail nav a:hover {
  background: #2c483a;
  color: #fff;
  box-shadow: inset 3px 0 var(--accent);
}

.logout {
  margin-top: auto;
}

.logout button {
  border-color: #6a8174;
  color: #e4ece4;
}

.logout button:hover {
  background: #375140;
}

.workspace {
  min-width: 0;
  width: 100%;
  max-width: 1530px;
  padding: clamp(1.5rem,4vw,4.4rem) clamp(1.3rem,4.4vw,5rem);
}

.heading,.list-head,.actions,.related,.paging,.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  flex-wrap: wrap;
}

.heading {
  margin-bottom: 2.25rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  margin: 0 0 2.5rem;
  border-block: 1px solid var(--line);
  background: #eff2e9;
}

.metrics a {
  padding: 1rem 1.2rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  border-right: 1px solid var(--line);
}

.metrics a:last-child {
  border: 0;
}

.metrics a:hover {
  background: #e6ecd9;
}

.metrics span,.hint,.back,.label,.info code,small,time,.signal,.mono {
  color: var(--muted);
}

.metrics strong {
  font: 500 2.35rem/1 var(--mono);
  letter-spacing: -.07em;
}

.list-head {
  margin-bottom: .9rem;
}

.filters {
  justify-content: flex-start;
  gap: .4rem;
}

select,input,textarea {
  border-radius: .32rem;
  border: 1px solid #aab8ab;
  color: var(--ink);
  background: #fff;
  padding: .55rem .65rem;
}

.filters select {
  font-size: .87rem;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .93rem;
  text-align: left;
}

th {
  font-weight: 600;
  color: var(--muted);
  font-size: .8rem;
}

td,th {
  padding: .85rem .55rem;
  border-bottom: 1px solid var(--line);
}

th:first-child,td:first-child {
  padding-left: 0;
}

.subject {
  font-weight: 650;
  text-decoration: none;
}

.subject:hover {
  text-decoration: underline;
}

small {
  display: block;
  font-size: .82rem;
  margin-top: .2rem;
}

.mono,time,code {
  font-family: var(--mono);
  font-size: .84rem;
}

.tag {
  display: inline-block;
  white-space: nowrap;
  line-height: 1.4;
  padding: .2rem .55rem;
  border-radius: 4px;
  background: #e4e9e1;
  color: #384b3e;
  font-weight: 600;
  font-size: .83rem;
}

.approval,.attention {
  background: #f4df9c;
  color: #624510;
}

.running,.done {
  background: #d6e9d8;
  color: #255232;
}

.failed {
  background: #f4d8cf;
  color: #7e3828;
}

.waiting {
  background: #e0e5f1;
  color: #435879;
}

.empty {
  padding: 2.8rem 1.2rem;
  text-align: center;
  border: 1px dashed #b5c3b4;
  border-radius: .32rem;
}

.empty h3 {
  margin-bottom: .5rem;
}

.nodes {
  margin-top: 2.5rem;
}

.node-grid,.agent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.node,.agent-card,.editor,.task-main,.info {
  border: 1px solid var(--line);
  border-radius: .42rem;
  background: #fff;
}

.node {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem;
  text-decoration: none;
}

.node:hover {
  border-color: var(--leaf);
}

.node-icon {
  font: 700 1.05rem var(--mono);
  background: #e7ece1;
  color: var(--leaf);
  border-radius: 4px;
  padding: .52rem;
}

.signal {
  font-size: .8rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.signal::before {
  content: "";
  width: .46rem;
  height: .46rem;
  border-radius: 100%;
  background: #87948b;
}

.signal.on::before {
  background: #34844b;
}

.node .signal {
  margin-left: auto;
}

.agent-card,.editor,.task-main,.info {
  padding: clamp(1.1rem,2.4vw,2rem);
}

.agent-card h2,.agent-card p,.agent-card dl {
  margin: .8rem 0;
}

.agent-card dt {
  color: var(--muted);
  font-size: .84rem;
}

.agent-card dd {
  margin: 0 0 .45rem;
}

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: linear-gradient(115deg,#183228 0 35%,#e9eee2 35%);
}

.login-panel {
  width: min(440px,100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: .55rem;
  padding: clamp(1.65rem,5vw,3rem);
  box-shadow: 0 16px 70px #112c211c;
}

.login-panel h1 {
  font-size: 2.15rem;
  margin: 2.65rem 0 1.3rem;
}

.stack {
  display: grid;
  gap: .55rem;
}

.stack label {
  font-weight: 600;
}

.stack label:not(:first-of-type) {
  margin-top: .65rem;
}

.stack .primary {
  margin-top: .6rem;
}

.back {
  display: inline-block;
  margin-bottom: 1.3rem;
}

.editor {
  max-width: 780px;
}

.editor textarea {
  resize: vertical;
  min-height: 7rem;
}

.hint {
  font-size: .9rem;
}

.actions,.paging {
  justify-content: flex-start;
}

.task-title {
  font-size: clamp(1.8rem,4vw,3.2rem);
  overflow-wrap: anywhere;
}

.task-layout {
  display: grid;
  grid-template-columns: minmax(0,2fr) minmax(195px,1fr);
  gap: 1.25rem;
  margin-bottom: 2.25rem;
}

.prose {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.info .label:not(:first-child),.task-main h2 {
  margin-top: 1.35rem;
}

.info code {
  overflow-wrap: anywhere;
}

.label {
  margin-bottom: .35rem;
  font-size: .8rem;
  font-weight: 650;
}

.related,.decision {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 1rem;
}

.decision p {
  margin-bottom: .65rem;
}

.timeline {
  padding: 0;
  list-style: none;
}

.timeline li {
  display: flex;
  gap: 1.1rem;
  padding: .7rem .2rem;
  border-top: 1px solid var(--line);
}

.timeline time {
  flex: none;
}

.error {
  color: #90351a;
}

.skip,.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

.skip:focus {
  z-index: 5;
  clip-path: none;
  width: auto;
  height: auto;
  background: white;
  padding: .5rem;
}

@media (max-width:850px) {
  .shell {
    grid-template-columns: 145px 1fr;
  }
  .rail {
    padding: 1.4rem .8rem;
  }
  .node-grid {
    grid-template-columns: 1fr;
  }
  .metrics a {
    padding: .9rem .65rem;
  }
  .metrics span {
    font-size: .85rem;
  }
}

@media (max-width:650px) {
  .shell {
    display: block;
  }
  .rail {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1rem;
  }
  .rail .brand {
    padding: 0;
    font-size: 1.35rem;
  }
  .rail nav {
    display: flex;
    gap: .2rem;
  }
  .rail nav a,.logout button {
    font-size: .83rem;
    padding: .36rem .45rem;
  }
  .logout {
    margin: 0 0 0 auto;
  }
  .heading {
    margin-bottom: 1.4rem;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
    margin-bottom: 1.6rem;
  }
  .metrics a {
    border: 1px solid var(--line);
  }
  .metrics a:last-child {
    border: 1px solid var(--line);
  }
  .agent-grid,.task-layout {
    grid-template-columns: 1fr;
  }
  .nodes {
    margin-top: 1.8rem;
  }
  .filters {
    width: 100%;
  }
  .filters label {
    flex: 1;
  }
  .filters select {
    width: 100%;
  }
  .heading h1 {
    max-width: 100%;
  }
  .gate {
    background: #e9eee2;
  }
}
