:root {
  --paper: #f4f3eb;
  --surface: #fbfcf7;
  --well: #e9ede5;
  --line: #d0d5c8;
  --ink: #253630;
  --muted: #627066;
  --forest: #304b40;
  --danger: #a9472b;
  --danger-soft: #faeee8;
  --brass: #8b6c32;
  --sans: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --serif: "Noto Serif SC", "Songti SC", Georgia, serif;
  --mono: "SFMono-Regular", Consolas, monospace;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.65 var(--sans);
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select {
  font: inherit;
}
button,
.button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 3px;
}
button:hover,
.button:hover {
  background: var(--well);
  border-color: #98a69b;
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
button.primary,
.button.primary {
  background: var(--forest);
  color: #f7f7ef;
  border-color: var(--forest);
}
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}
input,
select {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 3px;
  min-width: 0;
}
input[type="search"] {
  width: 100%;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font: 400 clamp(29px, 4vw, 43px)/1.25 var(--serif);
  letter-spacing: -0.035em;
}
h2 {
  font: 400 25px/1.3 var(--serif);
}
h3 {
  font-size: 15px;
  font-weight: 600;
}
small,
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.13em;
  color: var(--muted);
  margin-bottom: 10px;
}
.masthead {
  height: 66px;
  padding: 0 38px;
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand {
  font: 25px var(--serif);
  white-space: nowrap;
}
.brand span {
  font: 10px var(--sans);
  letter-spacing: 0.18em;
  border-left: 1px solid var(--line);
  margin-left: 16px;
  padding-left: 18px;
}
.mast-note {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
}
#logout {
  font-size: 12px;
  padding: 4px 10px;
}
#connection {
  background: #f7ebd4;
  padding: 8px 38px;
  color: #755821;
  font-size: 12px;
}
#app {
  max-width: 1440px;
  margin: auto;
}
.loading,
.empty {
  padding: 70px 26px;
  color: var(--muted);
  text-align: center;
}
.shell {
  display: grid;
  grid-template-columns: 225px minmax(0, 1fr);
  min-height: calc(100vh - 66px);
}
aside {
  border-right: 1px solid var(--line);
  padding: 28px 20px;
  background: #eeeee4;
}
aside .sticky {
  position: sticky;
  top: 25px;
}
.back {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 30px;
}
nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 15px 0;
}
nav a {
  padding: 9px 12px;
  border-left: 2px solid transparent;
  border-radius: 0 3px 3px 0;
  font-size: 13px;
}
nav a:hover,
nav a.current {
  background: #e1e6da;
  border-left-color: var(--forest);
}
nav a small {
  float: right;
  font: 11px var(--mono);
  padding-top: 4px;
}
.sidebar-note {
  white-space: pre-line;
  font-size: 11px;
  line-height: 1.8;
  margin-top: 28px;
  color: var(--muted);
  word-break: break-all;
}
.content {
  padding: 38px 42px 70px;
  min-width: 0;
}
.page-top {
  display: flex;
  gap: 22px;
  justify-content: space-between;
  align-items: flex-start;
}
.page-top .sub {
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.actions .button {
  font-size: 12px;
  white-space: nowrap;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 12px var(--sans);
  padding: 5px 9px;
  background: #e4ecdf;
  color: #31573d;
  border: 1px solid #ccd7c6;
  border-radius: 3px;
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}
.status.running {
  color: #5e6f41;
  background: #edf0e2;
}
.status.failed,
.status.partial {
  background: var(--danger-soft);
  border-color: #e6c6b8;
  color: var(--danger);
}
.status.interrupted,
.status.cancelled {
  background: #eee9df;
  border-color: #d9d0bd;
  color: #786844;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 28px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.stat {
  padding: 20px 22px;
  border-right: 1px solid var(--line);
}
.stat:last-child {
  border: 0;
}
.stat strong {
  display: block;
  font: 30px var(--serif);
  margin-bottom: 5px;
}
.stat span {
  font-size: 12px;
  color: var(--muted);
}
.stat.alert strong {
  color: var(--danger);
}
.section {
  margin: 32px 0;
  scroll-margin-top: 25px;
}
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 16px;
}
.section-title small {
  font-size: 12px;
}
.notice {
  padding: 16px 19px;
  border: 1px solid var(--line);
  border-left: 3px solid #8ca27c;
  background: var(--surface);
  line-height: 1.8;
}
.notice.error {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}
.issue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.issue {
  display: block;
  padding: 14px 17px;
  background: var(--danger-soft);
  border: 1px solid #e8cfc1;
  border-left: 3px solid var(--danger);
}
.issue:hover {
  background: #f4e3d9;
}
.issue strong {
  font-size: 13px;
}
.issue p {
  font-size: 12px;
  color: #794934;
  margin-top: 4px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.toolbar {
  display: flex;
  gap: 10px;
  margin: 22px 0 16px;
  align-items: center;
}
.toolbar label {
  flex: 1;
}
.toolbar label span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
}
.toolbar select {
  height: 44px;
  align-self: end;
}
.day {
  margin: 15px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  scroll-margin-top: 20px;
}
.day > summary {
  padding: 17px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}
.day > summary::before {
  content: "＋";
  color: var(--muted);
  font-size: 18px;
}
.day[open] > summary::before {
  content: "−";
}
.day[open] > summary {
  border-bottom: 1px solid var(--line);
}
.day-title {
  font: 21px var(--serif);
  min-width: 90px;
}
.day-sub {
  color: var(--muted);
  font-size: 12px;
}
.day-count {
  margin-left: auto;
  color: var(--forest);
  font-size: 12px;
  white-space: nowrap;
}
.day-count.has-error {
  color: var(--danger);
}
.day-body {
  padding: 4px 20px 22px;
}
.step {
  border-bottom: 1px solid #e4e8dd;
  scroll-margin-top: 25px;
}
.step:last-of-type {
  border: 0;
}
.step summary {
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  list-style: none;
  padding: 15px 0;
}
.step .mark {
  color: #537451;
  font-size: 14px;
  margin-top: 1px;
}
.step.failed .mark {
  color: var(--danger);
}
.step.intervention .mark {
  color: var(--brass);
}
.step-summary {
  flex: 1;
  min-width: 0;
}
.step-summary strong {
  font-size: 13px;
}
.step-summary p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.step .anchor,
.anchor {
  font-size: 12px;
  color: var(--muted);
  padding: 2px 5px;
}
.step-detail {
  margin: 0 0 17px 27px;
}
.mono,
code {
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}
code {
  background: var(--well);
  padding: 1px 4px;
}
.prose {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.9;
  font-size: 13px;
}
.prose p {
  margin: 10px 0;
}
.prose strong {
  font-weight: 600;
}
.prose h3 {
  margin: 18px 0 8px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #eff1e9;
  border: 1px solid var(--line);
  padding: 14px;
  font: 12px/1.7 var(--mono);
  max-height: 560px;
  overflow: auto;
  margin: 12px 0;
}
.evidence,
.transcripts,
.reasoning {
  margin-top: 17px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
}
.evidence > summary,
.transcripts > summary,
.reasoning > summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--forest);
}
.evidence .command {
  margin: 13px 0;
  border: 1px solid var(--line);
  padding: 12px;
  background: #f6f7f0;
}
.command summary {
  cursor: pointer;
  font-size: 12px;
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.command summary small {
  margin-left: auto;
}
.command.failure {
  border-color: #d9afa0;
}
.day-economy {
  display: flex;
  gap: 25px;
  font-size: 12px;
  color: var(--muted);
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.empty-filter {
  padding: 30px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
.run-list-page {
  max-width: 1120px;
  margin: auto;
  padding: 50px 32px;
}
.run-list-page .page-top {
  margin-bottom: 30px;
}
.run-list {
  border-top: 1px solid var(--line);
}
.run-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 160px 110px 110px 100px;
  gap: 16px;
  align-items: center;
  padding: 21px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
a.run-row:hover {
  background: var(--well);
}
.run-row h3 {
  font: 21px var(--serif);
  margin-bottom: 4px;
}
.run-row small {
  font-size: 11px;
}
.run-row .number {
  font: 20px var(--serif);
}
.run-row.heading {
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  padding: 10px 18px;
}
.login {
  max-width: 420px;
  margin: 11vh auto;
  padding: 32px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.login p {
  color: var(--muted);
  font-size: 13px;
  margin: 18px 0;
}
.login input {
  width: 100%;
  margin: 7px 0 18px;
}
.login label {
  font-size: 12px;
}
.login button {
  width: 100%;
}
.error-text {
  color: var(--danger);
  margin-top: 12px;
}
.more {
  margin-top: 20px;
}
.footer-note {
  color: var(--muted);
  font-size: 11px;
  margin-top: 35px;
  border-top: 1px solid var(--line);
  padding-top: 15px;
}
details:target,
.step:target,
.command:target {
  outline: 2px solid #b99d60;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.pill-count {
  color: var(--muted);
  font-size: 12px;
  margin-left: 8px;
}
@media (max-width: 900px) {
  .masthead {
    padding: 0 22px;
  }
  .content {
    padding: 28px 24px;
  }
  .shell {
    grid-template-columns: 175px minmax(0, 1fr);
  }
  aside {
    padding: 25px 12px;
  }
  .stats .stat {
    padding: 16px 13px;
  }
  .run-row {
    grid-template-columns: minmax(120px, 1fr) 130px 70px 90px;
  }
  .run-row > *:nth-child(4) {
    display: none;
  }
}
@media (max-width: 640px) {
  .masthead {
    height: 58px;
    padding: 0 18px;
  }
  .mast-note {
    display: none;
  }
  #logout {
    margin-left: auto;
  }
  .shell {
    display: block;
  }
  aside {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px 18px;
  }
  aside .sticky {
    position: static;
  }
  .back {
    margin: 0;
  }
  aside nav {
    flex-direction: row;
    overflow: auto;
    margin: 10px 0 0;
    white-space: nowrap;
  }
  aside nav a {
    padding: 5px 9px;
  }
  aside nav a small {
    float: none;
    margin-left: 6px;
  }
  .sidebar-note {
    display: none;
  }
  .content {
    padding: 25px 18px 45px;
  }
  .page-top {
    flex-direction: column;
    gap: 15px;
  }
  .stats {
    margin: 22px 0;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat:nth-child(2) {
    border-right: 0;
  }
  .stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
  .stat strong {
    font-size: 25px;
    white-space: nowrap;
  }
  .stat span {
    font-size: 10px;
  }
  .section-title {
    align-items: flex-start;
  }
  .day > summary {
    padding: 14px 12px;
    gap: 10px;
  }
  .day-title {
    font-size: 19px;
    min-width: 65px;
  }
  .day-sub {
    font-size: 11px;
  }
  .day-body {
    padding: 0 12px 17px;
  }
  .run-list-page {
    padding: 30px 18px;
  }
  .run-row {
    grid-template-columns: minmax(100px, 1fr) 88px 75px;
    gap: 10px;
    padding: 16px 10px;
  }
  .run-row > *:nth-child(3) {
    display: none;
  }
  .run-row .status {
    font-size: 10px;
    padding: 4px 5px;
  }
  .run-row small {
    font-size: 10px;
  }
  .login {
    margin: 8vh 18px;
  }
  .day-economy {
    gap: 15px;
  }
  .step-detail {
    margin-left: 0;
  }
}
@media print {
  .masthead button,
  aside,
  .actions,
  .toolbar,
  .anchor,
  .evidence,
  button {
    display: none !important;
  }
  .shell {
    display: block;
  }
  .content {
    padding: 0;
  }
  .masthead {
    padding: 0;
  }
  .day,
  .stats,
  .notice {
    break-inside: avoid;
  }
  body {
    background: white;
  }
  .day > summary {
    border-bottom: 1px solid #ccc;
  }
}

.content > .notice:first-child {
  margin-bottom: 24px;
}
