:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f0f0ec;
  --text: #1c1c1a;
  --muted: #5f5f58;
  --border: #dcdcd5;
  --accent: #2557c7;
  --accent-text: #ffffff;
  --focus: #2557c7;
  --good: #1f7a3f;
  --good-bg: #e3f3e8;
  --bad: #b3261e;
  --bad-bg: #fbe7e5;
  --warn: #8a5a00;
  --warn-bg: #fdf1d8;
  --info: #2557c7;
  --info-bg: #e5ecfb;
  --neutral-bg: #ececea;
  --seg-good: #2e9d57;
  --seg-bad: #d0453b;
  --seg-bad2: #e58b5a;
  --seg-warn: #e0a72e;
  --seg-warn2: #b58bd8;
  --seg-info: #4b7be0;
  --seg-info2: #8aa9ec;
  --seg-neutral: #b9b9b0;
  --add-bg: #e3f3e8;
  --del-bg: #fbe7e5;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --surface: #1f1f1d;
    --surface-2: #2a2a27;
    --text: #ecece6;
    --muted: #a6a69c;
    --border: #3a3a36;
    --accent: #8fb0ff;
    --accent-text: #0e1a33;
    --focus: #8fb0ff;
    --good: #7fd69c;
    --good-bg: #1d3325;
    --bad: #ff9a90;
    --bad-bg: #3d2120;
    --warn: #f2c66b;
    --warn-bg: #3a2f17;
    --info: #9fbaff;
    --info-bg: #1f2b45;
    --neutral-bg: #2e2e2a;
    --add-bg: #1d3325;
    --del-bg: #3d2120;
  }
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}
body {
  background: var(--bg);
  color: var(--text);
  font: 16px / 1.55 var(--font);
}
a {
  color: var(--accent);
}
code,
pre {
  font-family: var(--mono);
  font-size: 0.9em;
}
pre {
  background: var(--surface-2);
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
}
h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  margin: 0.25em 0 0.5em;
}
h2 {
  font-size: 1.25rem;
  margin: 1.5em 0 0.5em;
}
h3 {
  font-size: 1.05rem;
  margin: 1em 0 0.4em;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 8px;
  background: var(--surface);
  padding: 8px;
  z-index: 10;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.875rem;
}
.spacer {
  flex: 1;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.row.wrap {
  flex-wrap: wrap;
}
.narrow {
  max-width: 420px;
  margin: 10vh auto;
  padding: 0 16px;
}

/* frame */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}
.project-name {
  font-weight: 600;
}
.me {
  font-size: 0.875rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 40vw;
}
.body {
  display: flex;
  max-width: 1240px;
  margin: 0 auto;
}
.sidenav {
  width: 200px;
  flex: none;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 52px;
  align-self: flex-start;
}
.sidenav a {
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
}
.sidenav a:hover {
  background: var(--surface-2);
}
.sidenav a.current {
  background: var(--info-bg);
  color: var(--info);
  font-weight: 600;
}
main {
  flex: 1;
  min-width: 0;
  padding: 20px 24px 64px;
}
main:focus {
  outline: none;
}
@media (max-width: 760px) {
  .body {
    flex-direction: column;
  }
  .sidenav {
    width: auto;
    flex-direction: row;
    overflow-x: auto;
    position: static;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
  }
  .sidenav a {
    white-space: nowrap;
  }
  main {
    padding: 16px 16px 64px;
  }
  .me {
    display: none;
  }
}

/* controls */
button,
.button {
  font: inherit;
  font-size: 0.9375rem;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  line-height: 1.4;
}
button:hover:not(:disabled),
.button:hover {
  background: var(--surface-2);
}
button.primary,
.button.primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}
button.primary:hover:not(:disabled),
.button.primary:hover {
  filter: brightness(1.08);
  background: var(--accent);
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.link-button {
  background: none;
  border: none;
  padding: 4px 6px;
  color: var(--accent);
  text-decoration: underline;
}
.link-button:hover:not(:disabled) {
  background: none;
}
.danger {
  color: var(--bad) !important;
}
input,
select,
textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}
textarea {
  resize: vertical;
}
select {
  width: auto;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 10px 0;
  flex: 1;
  min-width: 200px;
}
.field-label {
  font-weight: 600;
  font-size: 0.9375rem;
}
.field-hint {
  color: var(--muted);
  font-size: 0.8125rem;
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0 12px;
}
.check input {
  width: auto;
}
.inline-field {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 8px 0;
}
.segmented button {
  border: none;
  border-radius: 0;
  border-right: 1px solid var(--border);
}
.segmented button:last-child {
  border-right: none;
}
.segmented button.on {
  background: var(--info-bg);
  color: var(--info);
  font-weight: 600;
}
.toolbar {
  margin-bottom: 8px;
}

/* status */
.badge {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--neutral-bg);
  color: var(--text);
  white-space: nowrap;
}
.badge-good {
  background: var(--good-bg);
  color: var(--good);
}
.badge-bad {
  background: var(--bad-bg);
  color: var(--bad);
}
.badge-warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.badge-info {
  background: var(--info-bg);
  color: var(--info);
}
.chip {
  display: inline-block;
  font-size: 0.8125rem;
  font-family: var(--mono);
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--info-bg);
  text-decoration: none;
}
.error {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--bad-bg);
  color: var(--bad);
  padding: 10px 12px;
  border-radius: 8px;
  margin: 8px 0;
}
.empty {
  padding: 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 16px 0;
}
/* A panel's padding is its top space: a heading's own margin would double it. */
.panel > :first-child {
  margin-top: 0;
}
.warn-panel {
  background: var(--warn-bg);
  border-color: transparent;
}

/* lists of things */
.cards,
.bug-list,
.scripts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.cards {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  height: 100%;
}
.card-link:hover {
  border-color: var(--accent);
}
.crumbs {
  font-size: 0.875rem;
  color: var(--muted);
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.tile-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
}
.tile-of {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 500;
}
.tile-label {
  color: var(--muted);
  font-size: 0.875rem;
}
.table-wrap {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  background: var(--surface);
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
thead th {
  font-size: 0.8125rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
table.trace tbody th {
  font-weight: 400;
  min-width: 260px;
}

/* spec */
.spec {
  max-width: 860px;
}
.spec-head {
  margin-bottom: 16px;
}
.blocks {
  display: flex;
  flex-direction: column;
}
.block {
  position: relative;
  border-radius: 8px;
  scroll-margin-top: 80px;
}
.block-body {
  position: relative;
  padding: 2px 96px 2px 8px;
  border-left: 3px solid transparent;
}
.block:hover .block-body,
.block:focus-within .block-body {
  background: var(--surface);
}
.block.has-threads > .block-body {
  border-left-color: var(--info);
}
.block:target > .block-body {
  border-left-color: var(--accent);
  background: var(--info-bg);
}
.block-comment {
  position: absolute;
  right: 4px;
  top: 6px;
  font-size: 0.8125rem;
  padding: 2px 8px;
  opacity: 0;
}
.block:hover .block-comment,
.block-comment:focus-visible,
.block.has-threads .block-comment,
.block-comment[aria-expanded="true"] {
  opacity: 1;
}
@media (hover: none) {
  .block-comment {
    opacity: 1;
  }
}
.block-threads {
  margin: 4px 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.closed-toggle {
  margin-left: 12px;
}
.requirement {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 6px 0;
}
.req-head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.req-id {
  font-family: var(--mono);
  font-weight: 700;
  text-decoration: none;
}
.req-text {
  margin: 6px 0;
}
.decide {
  margin-top: 8px;
}
blockquote {
  border-left: 3px solid var(--border);
  margin: 8px 0;
  padding: 2px 12px;
  color: var(--muted);
}
.thread {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.thread-closed {
  opacity: 0.8;
}
.thread-head {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.comments {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comment-meta {
  font-size: 0.875rem;
}
.comments .prose p {
  margin: 2px 0;
}
.suggestion {
  background: var(--add-bg);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 8px;
}
.suggestion-label {
  font-size: 0.8125rem;
  font-weight: 600;
}
.reply {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.new-thread {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 12px;
}

/* flows */
.flow-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .flow-layout {
    grid-template-columns: 1fr;
  }
}
.flow-diagram {
  width: 100%;
  max-width: 420px;
  height: auto;
}
.flow-box {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 1.5;
}
.flow-box-system {
  fill: var(--surface-2);
  stroke: var(--muted);
  stroke-dasharray: 4 3;
}
.flow-actor {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
}
.flow-action {
  color: var(--text);
  font-size: 13px;
  line-height: 1.3;
  font-family: var(--font);
  overflow: hidden;
}
.flow-edge {
  stroke: var(--muted);
  stroke-width: 1.5;
}
.flow-arrowhead {
  fill: var(--muted);
}
.flow-steps li {
  margin-bottom: 12px;
}

/* UAT */
.script {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  scroll-margin-top: 80px;
}
.script-head {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  border: none;
  background: none;
  padding: 12px 14px;
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.script-code {
  font-family: var(--mono);
  font-weight: 700;
}
.script-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--border);
}
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 14px;
  font-size: 0.9375rem;
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  margin: 0;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 700px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}
.record {
  margin: 12px 0;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 8px;
}

/* bugs */
.attachments {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.attachments li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.attachments img,
.attachments video {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.form {
  max-width: 760px;
}

/* stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.stack,
.weekly {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.stack figcaption,
.weekly figcaption {
  font-weight: 600;
  margin-bottom: 8px;
}
.stack-bar {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  gap: 2px;
  background: var(--surface-2);
}
.stack-bar .seg {
  display: block;
  min-width: 4px;
}
.legend {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.875rem;
}
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  vertical-align: middle;
}
.bars td {
  white-space: nowrap;
}
.bar {
  display: inline-block;
  height: 10px;
  border-radius: 5px;
  vertical-align: middle;
  min-width: 2px;
  max-width: 70%;
}
.seg-good {
  background: var(--seg-good);
}
.seg-bad {
  background: var(--seg-bad);
}
.seg-bad2 {
  background: var(--seg-bad2);
}
.seg-warn {
  background: var(--seg-warn);
}
.seg-warn2 {
  background: var(--seg-warn2);
}
.seg-info {
  background: var(--seg-info);
}
.seg-info2 {
  background: var(--seg-info2);
}
.seg-neutral {
  background: var(--seg-neutral);
}

/* editing */
.block-editor {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 860px;
}
.edit-block {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 2px 8px;
}
.edit-block:hover,
.edit-block:focus-within {
  border-color: var(--border);
  background: var(--surface);
}
.edit-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  opacity: 0;
}
.edit-block:hover .edit-actions,
.edit-block:focus-within .edit-actions {
  opacity: 1;
}
@media (hover: none) {
  .edit-actions {
    opacity: 1;
  }
}
textarea.file,
pre.file {
  width: 100%;
  font-family: var(--mono);
  font-size: 0.875rem;
  min-height: 50vh;
}
.diff {
  white-space: pre-wrap;
}
.diff-add {
  background: var(--add-bg);
  display: block;
}
.diff-del {
  background: var(--del-bg);
  display: block;
  text-decoration: line-through;
  text-decoration-color: var(--muted);
}
.diff-same {
  display: block;
  color: var(--muted);
}
.diff-gap {
  display: block;
  color: var(--muted);
  font-style: italic;
}
.sticky-actions {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  padding: 12px 0;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}
.login form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.segmented {
  padding: 0;
}
.segmented label {
  padding: 7px 14px;
  cursor: pointer;
  border-right: 1px solid var(--border);
  font-size: 0.9375rem;
}
.segmented label:last-of-type {
  border-right: none;
}
.segmented label.on {
  background: var(--info-bg);
  color: var(--info);
  font-weight: 600;
}
.segmented input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.segmented label:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}
fieldset.plain {
  border: none;
  padding: 0;
  margin: 0;
}
.loading {
  display: block;
  margin: 16px 0;
}
.bars th {
  white-space: nowrap;
}
