:root {
  color-scheme: light;
  --ink: #20342b;
  --muted: #5e7067;
  --line: #d7e0d6;
  --soft: #f4f7f1;
  --accent: #226847;
  --tint: #e7f2e9;
  font:
    14px/1.5 Inter,
    "Microsoft YaHei",
    system-ui,
    sans-serif;
  color: var(--ink);
  background: #f1f4ef;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
button,
select,
input,
textarea {
  font: inherit;
  color: inherit;
}
button,
select,
input[type="date"] {
  cursor: pointer;
}
button,
select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
button,
select,
input {
  padding: 5px 9px;
}
button:hover,
button:focus-visible {
  background: var(--soft);
  border-color: #a4b9aa;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #48966f;
  outline-offset: 1px;
}
button:disabled {
  opacity: 0.47;
  cursor: default;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
h1 {
  font-size: 17px;
  font-weight: 600;
}
h2 {
  font-size: 17px;
  letter-spacing: -0.03em;
}
h3 {
  font-size: 15px;
}
h4 {
  font-size: 14px;
}
small,
.meta,
.muted,
.empty {
  color: var(--muted);
  font-size: 12px;
}
.empty {
  padding: 12px;
}
.mast {
  min-height: 55px;
  padding: 9px clamp(14px, 2vw, 34px);
  display: flex;
  gap: 14px;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -1.2px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.brand i {
  font-style: normal;
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
}
.mast h1 {
  border-left: 1px solid var(--line);
  padding-left: 14px;
}
#tools {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
}
#project,
#thread {
  min-width: 0;
  max-width: 100%;
}
#login {
  max-width: 440px;
  margin: 15vh auto;
  padding: 15px;
}
#signin {
  display: grid;
  gap: 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 26px;
}
#signin h2 {
  font-size: 24px;
}
.primary,
.switch [aria-pressed="true"],
.mobile-tabs [aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
#notice:not(:empty) {
  padding: 7px 22px;
  background: #ecf0d7;
}
#notice.error,
#form-error {
  color: #863d2b;
}
#workspace {
  padding: 12px clamp(10px, 1.6vw, 24px);
  max-width: 2000px;
  margin: auto;
}
.playback,
.layout > .pane {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
}
.playback {
  padding: 9px 14px;
  margin-bottom: 10px;
}
.play-row,
.pager,
.switch,
.ends,
.scrub,
.bar,
.row,
.actions {
  display: flex;
  align-items: center;
  gap: 7px;
}
.play-row {
  flex-wrap: wrap;
  gap: 12px;
}
.ends {
  margin-left: auto;
  flex-wrap: wrap;
}
.ends label,
.thread-control {
  font-size: 12px;
  color: var(--muted);
}
.switch {
  gap: 0;
}
.switch button {
  border-radius: 0;
}
.switch button:first-child {
  border-radius: 6px 0 0 6px;
}
.switch button:last-child {
  border-radius: 0 6px 6px 0;
}
.pager output {
  min-width: 92px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.scrub {
  margin-top: 8px;
}
.scrub input {
  flex: 1;
  width: 100%;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
#position {
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  min-width: 68px;
  text-align: right;
}
.mobile-tabs {
  display: none;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 27fr) minmax(0, 36fr) minmax(0, 37fr);
  gap: 9px;
  height: calc(100dvh - 178px);
  min-height: 370px;
}
.pane {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pane-heading {
  min-height: 52px;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-bottom: 1px solid var(--line);
}
.pane-heading h2 {
  line-height: 1.3;
}
.pane-heading select {
  font-size: 12px;
}
.filter-row,
.thread-control {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-bottom: 1px solid var(--line);
}
.filter-row input,
.thread-control select {
  min-width: 0;
  flex: 1;
}
.filter-row button {
  white-space: nowrap;
  font-size: 12px;
}
.scroll {
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
#tree,
#messages,
#detail {
  flex: 1;
}
#tree {
  padding: 9px 5px;
}
.tree-row {
  display: flex;
  align-items: center;
  padding-left: calc(var(--depth) * 11px);
  min-height: 29px;
  border-radius: 4px;
}
.tree-row.affected {
  background: var(--tint);
}
.tree-row.chosen {
  box-shadow: inset 3px 0 #3a855a;
}
.tree-title,
.fold {
  border: 0;
  background: transparent;
  text-align: left;
}
.tree-title {
  padding: 4px 2px;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.fold,
.leaf {
  flex: 0 0 20px;
  text-align: center;
  padding: 1px;
}
.impact,
.badge,
.pill {
  display: inline-block;
  color: var(--accent);
  background: #e1eee1;
  font-size: 11px;
  border-radius: 4px;
  padding: 1px 5px;
}
.impact {
  margin-left: auto;
  white-space: nowrap;
}
#node-detail {
  max-height: 35%;
  overflow: auto;
  border-top: 1px solid var(--line);
  background: var(--soft);
  padding: 9px 12px;
  overflow-wrap: anywhere;
}
#node-detail .link {
  display: block;
}
#node-detail p {
  font-size: 13px;
}
#messages {
  background: #fafbf8;
  padding: 10px 12px;
}
.daymark {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  margin: 7px 0;
}
.bubble {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 7px;
  margin: 7px 0;
  padding: 9px 11px;
  overflow-wrap: anywhere;
}
.bubble.current {
  background: #eaf4e9;
  border-color: #70a883;
  box-shadow: inset 3px 0 #368153;
}
.bubble-head,
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.bubble-head b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
  font-size: 12px;
}
.bubble-head small {
  font-size: 11px;
  flex-shrink: 0;
}
.bubble-text,
.original,
.history p,
.msg,
.note {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bubble-text {
  display: block;
  margin: 4px 0 1px;
}
.quote {
  display: block;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  padding-left: 6px;
  margin-top: 4px;
}
#detail {
  padding: 13px;
  overflow-wrap: anywhere;
}
#detail > h2 {
  margin-top: 18px;
  font-size: 15px;
}
#detail > h3 {
  margin-top: 12px;
}
#detail details,
#detail section,
#task-content section {
  border-top: 1px solid var(--line);
  padding-top: 9px;
  margin-top: 12px;
}
#detail details:first-child {
  margin: 0;
  padding: 0;
  border: 0;
}
details summary {
  cursor: pointer;
  font-weight: 600;
}
.msg,
.history,
.note {
  padding: 7px 10px;
  background: var(--soft);
  border-left: 2px solid #b2c6b5;
  margin: 6px 0;
  border-radius: 2px;
}
.link {
  background: transparent;
  border: 0;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 2px 3px;
  text-align: left;
  overflow-wrap: anywhere;
}
.meta {
  margin: 4px 0;
}
.history .bar {
  margin-bottom: 5px;
}
#detail section h3 {
  margin-bottom: 7px;
}
select,
input,
textarea {
  max-width: 100%;
}
dialog {
  color: var(--ink);
  border: 1px solid #aec0b2;
  border-radius: 9px;
  padding: 17px;
  width: min(600px, 94vw);
  max-height: 86dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #182f2066;
}
#task-content,
#notes-content {
  margin-top: 11px;
  overflow-wrap: anywhere;
}
#fields label {
  display: grid;
  gap: 4px;
  margin: 12px 0;
}
textarea {
  resize: vertical;
  min-height: 85px;
  padding: 7px;
}
#form-error {
  margin: 7px 0;
}
.sr {
  position: absolute;
  clip-path: inset(100%);
  height: 1px;
  width: 1px;
  overflow: hidden;
}
@media (max-width: 1023px) {
  .mast {
    gap: 8px;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 20px;
  }
  .mast h1 {
    font-size: 15px;
  }
  #workspace {
    padding: 8px;
  }
  .playback {
    padding: 8px;
  }
  .play-row {
    gap: 6px;
  }
  .ends {
    margin-left: 0;
  }
  .pager output {
    min-width: 75px;
  }
  .ends button,
  .ends input {
    font-size: 12px;
    padding: 4px;
  }
  .mobile-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 7px;
  }
  .mobile-tabs button {
    flex: 1;
  }
  .layout {
    grid-template-columns: 1fr;
    height: calc(100dvh - 208px);
    min-height: 330px;
  }
  #workspace:not([data-pane="tree"]) #tree-pane,
  #workspace:not([data-pane="chat"]) #chat-pane,
  #workspace:not([data-pane="record"]) #record-pane {
    display: none;
  }
  #node-detail {
    max-height: 35%;
  }
}
@media (max-width: 480px) {
  .mast {
    padding: 7px 9px;
  }
  .mast h1 {
    display: none;
  }
  #tools {
    gap: 3px;
  }
  #project {
    max-width: 145px;
  }
  .ends {
    gap: 4px;
    width: 100%;
  }
  .ends label {
    margin-left: auto;
  }
  .layout {
    height: calc(100dvh - 218px);
  }
}
.message-search {
  padding: 6px 11px;
  border-bottom: 1px solid var(--line);
}
.message-search input {
  width: 100%;
}
#search-results {
  max-height: 24vh;
  overflow: auto;
}
.match {
  display: block;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
  width: 100%;
  font-size: 12px;
}
.tree-row.traced {
  border-left: 2px solid #aeceb9;
}
.tree-row.traced .impact {
  color: var(--muted);
  background: var(--soft);
}
