:root {
  --bg:#f6f5ef;
  --paper:#fffefa;
  --ink:#1a2a22;
  --muted:#58655a;
  --line:#d4d9cb;
  --green:#13573f;
  --green2:#194f3a;
  --mint:#e6eedf;
  --gray:#ebede5;
  --sand:#f6ecd7;
  --amber:#805519;
  --red:#934536;
  --round:12px;
  --shadow:0 12px 40px #27362912;
}

* {
  box-sizing:border-box;
}

html {
  background:var(--bg);
  color:var(--ink);
  font:16px/1.5 'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  -webkit-text-size-adjust:100%;
}

body {
  margin:0;
}

a {
  color:var(--green);
  text-underline-offset:.18em;
}

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

button,a,input,textarea,select {
  touch-action:manipulation;
}

button {
  cursor:pointer;
}

button:disabled {
  cursor:wait;
  opacity:.56;
}

button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible {
  outline:3px solid #aa712a;
  outline-offset:3px;
}

[hidden] {
  display:none!important;
}

.skip {
  position:absolute;
  top:-4rem;
  left:.5rem;
  z-index:5;
}

.skip:focus {
  top:.4rem;
  background:white;
  padding:.4rem;
}

.rail {
  height:66px;
  border-bottom:1px solid var(--line);
  background:var(--paper);
  display:flex;
  align-items:center;
  gap:15px;
  padding:0 clamp(16px,4.2vw,70px);
}

.brand {
  color:var(--ink);
  display:inline-flex;
  align-items:center;
  gap:9px;
  font-size:1.28rem;
  font-weight:780;
  letter-spacing:-.06em;
  text-decoration:none;
}

.brand-mark {
  background:var(--green2);
  color:#f5f4e4;
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  border-radius:9px;
  font:italic 700 33px/.7 Georgia,serif;
  padding:0 3px 6px 0;
}

.brand-rule {
  height:22px;
  width:1px;
  background:var(--line);
}

.brand-context,.atlas-link {
  font-size:.86rem;
  color:var(--muted);
}

.rail-right {
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:1rem;
}

.atlas-link {
  text-decoration:none;
}

.rail-right button {
  background:transparent;
  border:0;
  display:inline-flex;
  gap:.5rem;
  align-items:center;
  padding:.2rem 0;
  color:var(--ink);
  font-size:.86rem;
}

.avatar {
  width:27px;
  height:27px;
  display:inline-grid;
  place-items:center;
  background:var(--mint);
  border:1px solid #bdcbb8;
  border-radius:50%;
  font-size:.8rem;
  font-weight:700;
  color:var(--green);
}

.account-name {
  max-width:120px;
  text-overflow:ellipsis;
  white-space:nowrap;
  overflow:hidden;
}

main {
  width:min(100%,1480px);
  margin:0 auto;
  padding:30px clamp(16px,4.2vw,70px) 70px;
}

main:focus {
  outline:none;
}

.initial {
  color:var(--muted);
  padding:3rem 0;
}

.crumb {
  display:flex;
  align-items:center;
  gap:9px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:.81rem;
  margin:0 0 19px;
}

.crumb a {
  color:var(--muted);
  text-decoration:none;
}

.crumb a:hover,.atlas-link:hover {
  text-decoration:underline;
}

.crumb span {
  max-width:380px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.overline {
  color:var(--green);
  font-size:.75rem;
  font-weight:700;
  letter-spacing:.045em;
  margin:0 0 .35rem;
}

.headline {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
}

.headline>div:first-child {
  min-width:0;
}

.headline .actions {
  flex-shrink:0;
}

h1,h2,h3,h4,p,dl,dd,ul,ol {
  margin:0;
}

h1 {
  font-size:clamp(2rem,4.1vw,4.25rem);
  line-height:1.02;
  letter-spacing:-.062em;
  font-weight:625;
  overflow-wrap:anywhere;
  max-width:23ch;
}

h2 {
  font-size:clamp(1.4rem,2.1vw,2rem);
  line-height:1.15;
  letter-spacing:-.045em;
  font-weight:650;
}

h3 {
  font-size:1.08rem;
  line-height:1.32;
  letter-spacing:-.022em;
}

h4 {
  font-size:1rem;
}

.subline,.muted,.hint,small {
  color:var(--muted);
}

.subline {
  margin-top:.65rem;
  max-width:76ch;
}

.hint,small {
  font-size:.85rem;
}

.btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  text-align:center;
  padding:10px 15px;
  border:1px solid #bdc8b9;
  border-radius:8px;
  color:var(--ink);
  background:var(--paper);
  font-size:.9rem;
  font-weight:640;
  text-decoration:none;
  line-height:1.35;
  min-height:43px;
}

.btn:hover,.chip:hover,.file-row:hover,.project-row:hover {
  border-color:#839d88;
  background:#f6f8f1;
}

.btn.primary {
  background:var(--green);
  border-color:var(--green);
  color:white;
}

.btn.primary:hover {
  background:#184a37;
}

.btn.quiet {
  background:transparent;
  border-color:transparent;
  color:var(--muted);
}

.btn.small {
  padding:7px 11px;
  min-height:36px;
  font-size:.84rem;
}

.text-action {
  border:none;
  background:none;
  color:var(--green);
  padding:0;
  text-decoration:underline;
  text-underline-offset:.18em;
}

.actions,.inline {
  display:flex;
  align-items:center;
  gap:.65rem;
  flex-wrap:wrap;
}

.panel {
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:var(--round);
  min-width:0;
}

.pad {
  padding:clamp(16px,2.4vw,30px);
}

.panel+.panel {
  margin-top:13px;
}

.split {
  display:grid;
  grid-template-columns:minmax(0,1.7fr) minmax(240px,1fr);
  gap:20px;
  align-items:start;
}

.two {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}

.stack {
  display:grid;
  gap:14px;
}

.tabs {
  display:flex;
  align-items:center;
  gap:22px;
  border-bottom:1px solid var(--line);
  margin:22px 0;
  overflow:auto;
}

.tabs a,.tabs button {
  display:inline-flex;
  align-items:center;
  gap:6px;
  white-space:nowrap;
  text-decoration:none;
  color:var(--muted);
  font-size:.91rem;
  font-weight:620;
  border:0;
  border-bottom:2px solid transparent;
  background:none;
  padding:10px 1px;
}

.tabs [aria-current=page],.tabs [aria-selected=true] {
  color:var(--green);
  border-bottom-color:var(--green);
}

.count {
  font:600 .73rem/1.4 'Inter',sans-serif;
  min-width:1.4rem;
  text-align:center;
  background:var(--gray);
  border-radius:4px;
  padding:1px 4px;
}

.tab-tools {
  margin-left:auto;
}

.section-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:14px;
}

.board {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  align-items:start;
}

.lane {
  min-width:0;
  background:#eeefe7;
  border:1px solid #d9dfd2;
  border-radius:10px;
  padding:11px;
  min-height:170px;
}

.lane-head {
  display:flex;
  gap:8px;
  align-items:center;
  margin:0 0 10px;
}

.lane-head h3 {
  font-size:.91rem;
  font-weight:670;
}

.lane-head .count {
  margin-left:auto;
  background:#fafbf5;
}

.dot {
  display:inline-block;
  width:9px;
  height:9px;
  background:#8f998e;
  border-radius:50%;
  flex-shrink:0;
}

.dot.running {
  background:#bc8550;
}

.dot.review {
  background:#458b87;
}

.dot.done {
  background:#31704e;
}

.dot.failed {
  background:#b3563f;
}

.task-tile {
  display:block;
  padding:12px;
  background:var(--paper);
  color:var(--ink);
  border:1px solid var(--line);
  border-radius:8px;
  text-decoration:none;
  margin-top:7px;
  overflow-wrap:anywhere;
}

.task-tile:hover {
  border-color:#8ea68f;
  box-shadow:0 2px 10px #234d3010;
}

.task-tile strong {
  font-size:.94rem;
  display:block;
  line-height:1.35;
  margin:6px 0;
}

.tile-meta,.pill {
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:.75rem;
  font-weight:580;
  color:var(--muted);
}

.pill {
  padding:3px 8px;
  background:var(--gray);
  border-radius:5px;
}

.pill.review,.pill.done {
  background:var(--mint);
  color:var(--green);
}

.pill.running {
  background:var(--sand);
  color:var(--amber);
}

.pill.failed {
  color:var(--red);
  background:#f9e8df;
}

.lane-empty {
  font-size:.81rem;
  color:#657166;
  padding:8px 1px;
}

.origin {
  font-size:.86rem;
  display:inline-flex;
  gap:5px;
  align-items:center;
  color:var(--muted);
}

.agent-focus {
  border:1px solid #b9ccba;
  background:#e7eee0;
  border-radius:var(--round);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding:clamp(16px,2vw,26px);
  margin:18px 0;
}

.agent-focus h2 {
  font-size:1.3rem;
}

.agent-focus p {
  margin-top:6px;
  max-width:65ch;
  color:#405847;
  font-size:.92rem;
}

.agent-emblem {
  display:inline-grid;
  place-items:center;
  flex-shrink:0;
  width:42px;
  height:42px;
  border-radius:11px;
  background:var(--green2);
  color:white;
  font:700 1rem/1.1 'Inter',sans-serif;
}

.agent-main {
  display:flex;
  align-items:center;
  gap:13px;
}

.recipe-row {
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin:12px 0 0;
}

.chip {
  border:1px solid #b5c6af;
  background:#f8fbf3;
  border-radius:6px;
  padding:6px 10px;
  font-size:.83rem;
  font-weight:610;
  color:var(--green2);
}

.workspace-list {
  border-top:1px solid var(--line);
  margin-top:20px;
}

.project-row,.file-row,.person-row {
  display:flex;
  align-items:center;
  gap:13px;
  width:100%;
  font:inherit;
  text-align:left;
  background:none;
  text-decoration:none;
  color:var(--ink);
  border:0;
  border-bottom:1px solid var(--line);
  padding:14px 8px;
  min-width:0;
}

.row-main {
  min-width:0;
  flex:1;
}

.row-main strong,.row-main small {
  display:block;
  overflow-wrap:anywhere;
}

.row-main strong {
  font-weight:620;
}

.file-icon {
  display:grid;
  place-items:center;
  flex:none;
  width:40px;
  height:43px;
  background:#edf1e6;
  border:1px solid #ccd7c8;
  border-radius:7px;
  font-size:.69rem;
  letter-spacing:.025em;
  color:var(--green);
  font-weight:750;
}

.panel .workspace-list {
  margin-top:10px;
}

.empty {
  border:1px dashed #c1cbbb;
  border-radius:10px;
  padding:clamp(18px,4vw,32px);
  color:var(--muted);
}

.empty h3 {
  color:var(--ink);
  margin-bottom:6px;
}

.empty .actions {
  margin-top:12px;
}

.eyeline {
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  margin-bottom:9px;
}

.task-layout {
  display:grid;
  grid-template-columns:minmax(0,1.95fr) minmax(230px,.85fr);
  gap:18px;
  align-items:start;
  margin-top:20px;
}

.task-layout aside {
  min-width:0;
}

.paper-head {
  padding:15px 20px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.paper-head .row-main strong {
  font-size:.95rem;
}

.document {
  overflow-wrap:anywhere;
  max-width:100%;
  padding:clamp(19px,3vw,40px);
  font-size:.95rem;
  line-height:1.65;
}

.document>*+* {
  margin-top:.8rem;
}

.document h2 {
  font-size:1.5rem;
}

.document h3 {
  font-size:1.1rem;
}

.document h4 {
  font-size:.96rem;
}

.document ul,.document ol {
  padding-left:1.5rem;
}

.document table {
  border-collapse:collapse;
  font-size:.89rem;
  min-width:270px;
}

.document td,.document th {
  padding:6px 10px;
  text-align:left;
  border:1px solid var(--line);
  vertical-align:top;
}

.document th {
  background:#f2f4ed;
}

.table-wrap {
  overflow:auto;
}

.document pre {
  white-space:pre-wrap;
  font-size:.87rem;
  padding:12px;
  background:var(--gray);
  border-radius:5px;
}

.facts {
  display:grid;
  gap:12px;
}

.facts dt,.field-label {
  color:var(--muted);
  font-size:.8rem;
  font-weight:650;
}

.facts dd {
  overflow-wrap:anywhere;
  white-space:pre-line;
  font-size:.92rem;
  margin:2px 0 0;
}

.vlist {
  margin-top:13px;
}

.vlist summary {
  cursor:pointer;
  color:var(--green);
  font-size:.88rem;
}

.vlist button {
  display:block;
  font:inherit;
  font-size:.85rem;
  padding:.35rem 0;
  border:0;
  background:none;
  color:var(--green);
  text-decoration:underline;
}

.review-bar {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  background:#f0f4e9;
  border-top:1px solid var(--line);
  padding:14px 20px;
  border-radius:0 0 var(--round) var(--round);
}

.progress {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:5px;
}

.progress i {
  height:5px;
  border-radius:6px;
  background:var(--gray);
}

.progress i.on {
  background:#3b7857;
}

.agent-state {
  padding:25px;
  display:grid;
  gap:12px;
}

.agent-state p {
  color:var(--muted);
  max-width:58ch;
}

.form {
  display:grid;
  gap:14px;
}

.form label,.field {
  display:grid;
  gap:5px;
  font-size:.88rem;
  font-weight:630;
}

.form input,.form textarea,.form select,.copy-line input,.input,.select {
  width:100%;
  min-width:0;
  background:#fffefb;
  border:1px solid #afbda9;
  border-radius:7px;
  font:inherit;
  font-size:1rem;
  font-weight:400;
  padding:9px 12px;
  min-height:43px;
}

.form textarea {
  min-height:91px;
  resize:vertical;
}

.form input:focus,.form textarea:focus,.form select:focus {
  border-color:var(--green);
}

.inline-form {
  display:flex;
  align-items:center;
  gap:10px;
}

.form-error {
  padding:9px 11px;
  background:#f9e9e2;
  border:1px solid #e5c4b5;
  border-radius:7px;
  font-size:.9rem;
  color:#833e2d;
}

.auth-layout {
  max-width:760px;
  margin:clamp(15px,7vh,78px) auto;
  display:grid;
  grid-template-columns:minmax(180px,.75fr) minmax(250px,1fr);
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  box-shadow:var(--shadow);
}

.auth-intro {
  padding:28px;
  background:var(--green2);
  color:white;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:35px;
}

.auth-intro .overline {
  color:#c3d6ba;
}

.auth-intro h1 {
  font-size:clamp(1.85rem,3.4vw,2.85rem);
}

.auth-intro p {
  color:#d3e1d1;
  font-size:.92rem;
}

.auth-main {
  padding:clamp(20px,3.4vw,38px);
}

.auth-main .tabs {
  margin:0 0 20px;
}

.intro-card {
  max-width:740px;
  margin:6vh auto;
}

.new-content {
  max-width:900px;
}

.new-content .panel {
  margin-top:16px;
}

.source-tabs {
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin:16px 0 18px;
}

.source-tabs button {
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--paper);
  color:var(--muted);
  padding:8px 13px;
  font-size:.88rem;
  font-weight:620;
}

.source-tabs button[aria-pressed=true] {
  background:var(--mint);
  border-color:#97ae93;
  color:var(--green);
}

.suggestion {
  margin-top:6px;
  padding:12px;
  background:#f0f4e9;
  border-radius:7px;
  color:var(--muted);
  font-size:.9rem;
  white-space:pre-line;
}

.divider {
  border:0;
  border-top:1px solid var(--line);
  margin:16px 0;
}

.role {
  font-size:.8rem;
  color:var(--muted);
}

.invite-share {
  margin-top:14px;
}

.copy-line {
  display:flex;
  gap:6px;
}

.toast {
  position:fixed;
  bottom:18px;
  left:50%;
  transform:translateX(-50%);
  z-index:6;
  background:var(--ink);
  color:white;
  padding:10px 15px;
  border-radius:8px;
  font-size:.91rem;
  max-width:calc(100% - 24px);
  box-shadow:var(--shadow);
}

dialog {
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--paper);
  width:min(560px,calc(100vw - 24px));
  max-height:90vh;
  color:var(--ink);
  padding:0;
  box-shadow:var(--shadow);
}

dialog::backdrop {
  background:#14291f6b;
}

#dialog-content {
  padding:clamp(17px,3vw,28px);
}

.dialog-head {
  display:flex;
  justify-content:space-between;
  align-items:start;
  gap:12px;
  margin-bottom:16px;
}

.close {
  border:0;
  background:var(--gray);
  border-radius:50%;
  height:32px;
  width:32px;
  flex:none;
  font-size:1.15rem;
  line-height:1;
}

.warn {
  color:var(--amber);
}

.section-gap {
  margin-top:22px;
}

.label-name {
  font-weight:620;
}

.auto {
  display:inline-block;
  width:8px;
  height:8px;
  border-radius:50%;
  background:#4f8565;
}

.pending {
  margin-top:12px;
  color:var(--muted);
  font-size:.85rem;
}

.empty-loading {
  height:90px;
  display:grid;
  align-items:center;
  color:var(--muted);
  padding:18px;
}

@media(max-width:980px) {
  .board {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .task-layout {
    grid-template-columns:minmax(0,1.5fr) minmax(215px,.85fr);
  }
}

@media(max-width:680px) {
  main {
    padding-top:19px;
  }
  .rail {
    height:55px;
    gap:8px;
  }
  .brand-rule,.brand-context,.account-name {
    display:none;
  }
  .rail-right {
    gap:14px;
  }
  .headline,.agent-focus {
    align-items:flex-start;
    flex-direction:column;
  }
  .headline .actions {
    width:100%;
  }
  .split,.task-layout,.two {
    grid-template-columns:1fr;
  }
  .lane {
    min-height:96px;
  }
  .task-layout {
    gap:12px;
  }
  .tabs {
    gap:15px;
    margin:16px 0;
  }
  .auth-layout {
    grid-template-columns:1fr;
    max-width:440px;
    margin:10px auto;
  }
  .auth-intro {
    padding:18px 22px;
    gap:12px;
  }
  .auth-intro h1 {
    max-width:24ch;
  }
  .auth-main {
    padding:20px;
  }
  .paper-head,.review-bar {
    padding:12px;
  }
  .board {
    gap:7px;
  }
  .lane {
    padding:8px;
  }
  .task-tile {
    padding:8px;
  }
  .task-tile strong {
    font-size:.86rem;
  }
  .tile-meta {
    font-size:.69rem;
  }
  .form label,.field {
    font-size:.88rem;
  }
  .dialog-head h2 {
    font-size:1.4rem;
  }
  .crumb {
    margin-bottom:12px;
  }
  .copy-line {
    flex-wrap:wrap;
  }
  .copy-line input {
    flex-basis:100%;
  }
}

@media(max-width:385px) {
  .rail {
    padding:0 12px;
  }
  main {
    padding-inline:12px;
  }
  .tabs {
    gap:12px;
  }
  .btn {
    padding-inline:12px;
  }
  .board {
    grid-template-columns:1fr;
  }
  .lane {
    min-height:60px;
  }
  .lane-empty {
    padding:2px 0;
  }
  .agent-main {
    align-items:start;
  }
  .origin {
    font-size:.8rem;
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior:auto!important;
  }
}

.attached {
  margin:10px 0 0;
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:7px;
  max-height:190px;
  overflow:auto;
}

.attached legend {
  font-size:.81rem;
  color:var(--muted);
}

.form .attached label {
  display:flex;
  gap:8px;
  align-items:baseline;
  padding:5px 1px;
  font-weight:500;
  overflow-wrap:anywhere;
}

.form .attached input {
  width:16px;
  height:16px;
  min-height:0;
  flex:none;
  margin:0;
  accent-color:var(--green);
}

.document {
  max-height:min(60vh,620px);
  overflow:auto;
  scrollbar-width:thin;
}

.document:focus-visible {
  outline:2px solid #749475;
  outline-offset:-2px;
}

@media(max-width:680px) {
  .document {
    max-height:54vh;
  }
}

.machine-panel {
  margin-top:1rem;
}

.machine-panel summary {
  cursor:pointer;
  font-weight:650;
  padding:15px 20px;
}

.machine-panel[open] summary {
  border-bottom:1px solid var(--line);
}

.machine-panel pre {
  margin:0;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  background:var(--gray);
  padding:10px 12px;
  border-radius:6px;
  font-size:.85rem;
}

.document blockquote {
  margin-left:0;
  padding:2px 0 2px 12px;
  border-left:3px solid #bfccb9;
  color:var(--muted);
}

.review-top {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  background:#f0f4e9;
  border-bottom:1px solid var(--line);
  padding:10px 20px;
}

.review-top .btn {
  min-height:36px;
  padding:7px 12px;
}

.review-bar {
  background:var(--paper);
}

