:root {
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --pixel: "VT323", "IBM Plex Mono", ui-monospace, monospace;
  --bg: #000;
  --fg: #e8e8e8;
  --dim: #7a7a7a;
  --line: #d8d8d8;
  --hot: #ff8a4c;
  --red: #ff4f4f;
  --yellow: #ffd65a;
  --green: #61e36d;
  --orange: #ff9f3d;
  --board-col-item: 420px;
  --board-col-note: 220px;
  --board-col-owner: 104px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
}

body {
  font-family: var(--mono);
  -webkit-font-smoothing: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.desktop {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--bg-image, linear-gradient(#000, #000)),
    #000;
  background-size: 18px 18px, 18px 18px, cover, auto;
  background-position: 0 0, 0 0, center, 0 0;
  color: var(--fg);
  user-select: none;
}

.desktop.background-set .menubar,
.desktop.background-set .rwindow {
  background: rgba(0, 0, 0, 0.88);
}

.menubar {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  height: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: #000;
  font-family: var(--pixel);
  font-size: 18px;
  line-height: 1;
}

.mb-brand {
  min-width: 46px;
  max-width: 240px;
  padding: 1px 4px;
  color: var(--fg);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  outline: 0;
}

.mb-brand:focus {
  background: var(--fg);
  color: var(--bg);
}

.mb-menu-button {
  position: relative;
  height: 18px;
  padding: 0 7px 1px;
  border: 0;
  background: #000;
  color: var(--fg);
  font-family: var(--pixel);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.mb-menu-button:hover,
.mb-menu-button.open {
  background: var(--fg);
  color: var(--bg);
}

.view-menu {
  position: absolute;
  z-index: 80;
  top: 22px;
  left: 58px;
  min-width: 150px;
  border: 1px solid var(--line);
  background: #000;
  box-shadow: 3px 3px 0 var(--line);
}

.view-menu button {
  display: block;
  width: 100%;
  height: 25px;
  padding: 2px 9px;
  border: 0;
  border-bottom: 1px solid rgba(232, 232, 232, 0.22);
  background: #000;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.view-menu button:last-child {
  border-bottom: 0;
}

.view-menu button:hover {
  background: var(--fg);
  color: var(--bg);
}

.mb-spacer {
  flex: 1;
}

.mb-clock {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
}

.user-chip input {
  width: 110px;
  height: 18px;
  padding: 1px 5px;
  border: 1px solid var(--dim);
  background: #000;
  color: var(--fg);
  outline: 0;
  cursor: pointer;
}

.user-chip input:focus {
  border-color: var(--fg);
}

.workspace {
  position: absolute;
  inset: 22px 0 0 0;
  padding: 14px;
  overflow: hidden;
}

.desktop-icons {
  position: absolute;
  z-index: 1;
  top: 18px;
  left: 14px;
  display: grid;
  grid-template-columns: 80px;
  gap: 14px;
}

.desktop-icon {
  width: 80px;
  min-height: 78px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  display: grid;
  justify-items: center;
  gap: 4px;
  font-family: var(--pixel);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.desktop-icon:hover .desktop-icon-glyph,
.desktop-icon:focus-visible .desktop-icon-glyph {
  background: var(--fg);
  color: var(--bg);
}

.desktop-icon-glyph {
  position: relative;
  width: 56px;
  height: 56px;
  border: 1px solid var(--line);
  background: #000;
  box-shadow: 3px 3px 0 var(--line);
}

.desktop-icon-glyph::before,
.desktop-icon-glyph::after {
  content: "";
  position: absolute;
  border: 1px solid currentColor;
}

.board-glyph::before {
  inset: 10px 10px auto 10px;
  height: 7px;
}

.board-glyph::after {
  inset: auto 10px 10px 10px;
  height: 17px;
}

.intake-glyph::before {
  width: 18px;
  height: 25px;
  left: 18px;
  top: 9px;
  border-radius: 13px 13px 7px 7px;
}

.intake-glyph::after {
  width: 32px;
  height: 13px;
  left: 11px;
  bottom: 9px;
  border-top: 0;
}

.rwindow {
  position: absolute;
  min-width: 300px;
  min-height: 190px;
  border: 1px solid var(--line);
  background: #000;
  box-shadow: 3px 3px 0 var(--line);
  display: flex;
  flex-direction: column;
  resize: both;
  overflow: hidden;
}

.rwindow.is-closed {
  display: none;
}

.board-window {
  left: 114px;
  top: 18px;
  width: calc(100vw - 578px);
  max-width: calc(100vw - 140px);
  height: calc(100vh - 72px);
}

.intake-window {
  right: 22px;
  top: 48px;
  width: 390px;
  height: 322px;
}

.rwindow-title {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 22px;
  padding: 2px 6px;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(0deg, var(--line) 0 1px, #000 1px 3px);
  font-family: var(--pixel);
  font-size: 16px;
  line-height: 1;
  cursor: move;
  touch-action: none;
}

.rw-close {
  width: 13px;
  height: 13px;
  padding: 0;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #000;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 9px;
  text-align: center;
  cursor: pointer;
}

.rw-close:hover {
  background: var(--fg);
  color: var(--bg);
}

.rw-name {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 8px;
  background: #000;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rw-count {
  flex: 0 0 auto;
  min-width: 22px;
  padding: 0 4px;
  background: #000;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  text-align: right;
}

.toolbar,
.intake-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.icon-btn,
.text-btn,
.status-btn {
  height: 26px;
  border: 1px solid var(--line);
  background: #000;
  color: var(--fg);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--line);
}

.icon-btn {
  min-width: 28px;
  padding: 0 7px;
  font-family: var(--pixel);
  font-size: 18px;
  line-height: 1;
}

.text-btn {
  min-width: 54px;
  padding: 1px 10px;
  font-family: var(--pixel);
  font-size: 16px;
  line-height: 1;
}

.icon-btn:hover,
.text-btn:hover,
.status-btn:hover {
  background: var(--fg);
  color: var(--bg);
}

.icon-btn:active,
.text-btn:active,
.status-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--line);
}

.ghost {
  color: var(--dim);
  border-color: var(--dim);
  box-shadow: 2px 2px 0 var(--dim);
}

.record-button.recording,
.rec.recording {
  background: var(--red);
  color: #000;
}

.record-button.recording {
  border-color: var(--red);
  box-shadow: 3px 3px 0 var(--line);
}

.status-legend {
  margin-left: auto;
  color: var(--dim);
  font-size: 11px;
  white-space: nowrap;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 3px 0 8px;
  border: 1px solid currentColor;
  vertical-align: -1px;
}

.dot.red {
  background: var(--red);
}

.dot.yellow {
  background: var(--yellow);
}

.dot.green {
  background: var(--green);
}

.dot.orange {
  background: var(--orange);
}

.tree-head {
  display: grid;
  grid-template-columns:
    minmax(130px, var(--board-col-item)) 8px
    minmax(92px, var(--board-col-note)) 8px
    minmax(70px, var(--board-col-owner));
  gap: 0;
  align-items: stretch;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tree-head span {
  min-width: 0;
  padding-right: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-resizer {
  width: 8px;
  min-height: 17px;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(232, 232, 232, 0.35);
  border-right: 1px solid rgba(232, 232, 232, 0.15);
  background: transparent;
  color: var(--fg);
  cursor: col-resize;
}

.col-resizer:hover,
.col-resizer:focus-visible {
  background: var(--fg);
}

.tree {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 8px 0 20px;
}

.task-shell {
  min-width: 0;
}

.task-row {
  --depth: 0;
  --row-bg: transparent;
  --row-indent: calc(10px + var(--depth) * 18px);
  position: relative;
  display: grid;
  grid-template-columns:
    minmax(130px, var(--board-col-item))
    minmax(92px, var(--board-col-note))
    minmax(70px, var(--board-col-owner));
  gap: 8px;
  align-items: start;
  min-height: 38px;
  height: 38px;
  padding: 4px 48px 4px calc(var(--row-indent) + 8px);
  border-bottom: 2px solid #000;
  background: transparent;
  color: #050505;
  cursor: default;
  overflow: hidden;
  isolation: isolate;
}

.task-row::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  right: 8px;
  bottom: 2px;
  left: var(--row-indent);
  background: var(--row-bg);
  pointer-events: none;
}

.task-row > * {
  position: relative;
  z-index: 1;
}

.task-row.nested-row::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 4px;
  bottom: 6px;
  left: calc(var(--row-indent) - 7px);
  border-left: 1px solid rgba(232, 232, 232, 0.32);
  pointer-events: none;
}

.task-row:hover {
  filter: brightness(1.08);
}

.task-row.status-mixed {
  box-shadow: none;
}

.task-row.status-mixed::before {
  box-shadow: inset 0 0 0 1px var(--orange);
}

.task-row.review-row {
  box-shadow: none;
}

.task-row.review-row::before {
  box-shadow: inset 0 0 0 2px #000;
}

.task-row.review-child {
  box-shadow: none;
}

.task-row.review-child::before {
  box-shadow: inset 0 0 0 2px var(--orange);
}

.task-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 15px 20px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.status-advance {
  width: 13px;
  height: 13px;
  padding: 0;
  border: 1px solid #050505;
  background: var(--status-box-color, transparent);
  color: #050505;
  cursor: pointer;
  box-shadow: none;
}

.status-advance:hover {
  outline: 2px solid #050505;
  outline-offset: 1px;
}

.status-advance.review {
  background: var(--orange);
}

.twisty {
  width: 20px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #050505;
  font-family: var(--pixel);
  font-size: 17px;
  cursor: pointer;
  transition: transform 120ms linear;
}

.twisty.open {
  transform: rotate(90deg);
}

.twisty.draft-spacer {
  pointer-events: none;
}

.status-pick {
  display: flex;
  gap: 3px;
}

.status-btn {
  width: 18px;
  height: 18px;
  padding: 0;
  box-shadow: none;
  border-color: var(--dim);
}

.status-btn.red {
  background: var(--red);
}

.status-btn.yellow {
  background: var(--yellow);
}

.status-btn.green {
  background: var(--green);
}

.status-btn:not(.active) {
  background: #000;
}

.status-btn.active {
  border-color: var(--fg);
}

.editable {
  min-width: 0;
  min-height: 20px;
  max-height: 100%;
  padding: 2px 4px;
  outline: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: text;
  cursor: text;
}

.editable:focus {
  background: #000;
  color: var(--fg);
  white-space: normal;
  overflow-wrap: anywhere;
  overflow: auto;
}

.task-row.expanded-text .editable {
  white-space: normal;
  overflow-wrap: anywhere;
  overflow: auto;
  text-overflow: clip;
}

.task-title {
  font-size: 13px;
  font-weight: 600;
}

.task-note,
.task-owner {
  color: rgba(0, 0, 0, 0.68);
  font-size: 11px;
}

.task-note:focus,
.task-owner:focus {
  color: var(--fg);
}

.draft-row {
  --row-bg: #000;
  color: var(--dim);
  border-bottom: 1px dashed rgba(232, 232, 232, 0.35);
}

.draft-row::before {
  border: 1px dashed rgba(232, 232, 232, 0.35);
}

.draft-row {
  grid-template-columns: minmax(0, 1fr);
}

.draft-row .task-main {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr);
}

.draft-row .draft-status,
.draft-row .twisty.draft-spacer,
.draft-row .blank-cell {
  display: none;
}

.draft-row:hover {
  filter: none;
}

.draft-row .twisty,
.draft-row .twisty.draft-spacer {
  color: var(--dim);
}

.draft-row .editable {
  color: var(--dim);
  border: 1px dashed rgba(232, 232, 232, 0.35);
}

.draft-row .editable:focus {
  color: var(--fg);
  border-color: var(--fg);
}

.blank-cell {
  min-height: 20px;
}

.delete-item {
  position: absolute;
  right: 17px;
  top: 50%;
  width: 28px;
  height: 18px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: rgba(0, 0, 0, 0.62);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.delete-item:hover,
.delete-item:focus-visible {
  background: #000;
  color: var(--fg);
}

.row-height-grip {
  position: absolute;
  right: 3px;
  bottom: 2px;
  width: 13px;
  height: 9px;
  padding: 0;
  border: 0;
  background:
    linear-gradient(135deg, transparent 0 42%, rgba(0, 0, 0, 0.65) 43% 50%, transparent 51%),
    linear-gradient(135deg, transparent 0 62%, rgba(0, 0, 0, 0.65) 63% 70%, transparent 71%);
  cursor: ns-resize;
  opacity: 0.55;
}

.row-height-grip:hover {
  opacity: 1;
}

.side-stack {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(210px, 0.85fr) minmax(240px, 1fr);
  gap: 14px;
  overflow: hidden;
}

.intake-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.intake-record-panel {
  display: grid;
  place-items: center;
  padding: 16px 10px 8px;
}

.record-button {
  width: 104px;
  height: 88px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  background: #000;
  color: var(--fg);
  box-shadow: 4px 4px 0 var(--line);
  cursor: pointer;
}

.record-button:hover {
  background: var(--fg);
  color: var(--bg);
}

.record-button:active {
  transform: translate(1px, 1px);
  box-shadow: 3px 3px 0 var(--line);
}

.record-button:disabled {
  color: var(--dim);
  border-color: var(--dim);
  box-shadow: 4px 4px 0 var(--dim);
  cursor: not-allowed;
}

.record-button.recording {
  color: #000;
}

.mic-icon {
  position: relative;
  width: 42px;
  height: 52px;
}

.mic-icon::before,
.mic-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.mic-icon::before {
  top: 2px;
  width: 22px;
  height: 31px;
  border: 3px solid currentColor;
  border-radius: 13px 13px 8px 8px;
}

.mic-icon::after {
  bottom: 3px;
  width: 30px;
  height: 19px;
  border: 3px solid currentColor;
  border-top: 0;
  box-shadow: inset 0 -7px 0 -4px currentColor, 0 11px 0 -7px currentColor;
}

#intakeText {
  width: auto;
  min-height: 72px;
  max-height: 92px;
  resize: none;
  margin: 8px 10px 10px;
  padding: 9px;
  border: 1px solid var(--line);
  background: #000;
  color: var(--fg);
  outline: 0;
  line-height: 1.45;
}

#intakeText:focus {
  border-color: var(--hot);
}

.intake-actions {
  padding-top: 0;
  border-bottom: 0;
}

.feedback {
  min-height: 18px;
  padding: 0 10px 10px;
  color: var(--dim);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.proposal-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.empty {
  color: var(--dim);
  font-size: 12px;
}

.proposal {
  display: grid;
  gap: 8px;
  padding: 9px 0 12px;
  border-bottom: 1px dashed rgba(232, 232, 232, 0.35);
}

.proposal:first-child {
  padding-top: 0;
}

.proposal-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.proposal-kind {
  width: 44px;
  color: var(--hot);
  font-family: var(--pixel);
  font-size: 16px;
  text-transform: uppercase;
}

.proposal-path {
  min-width: 0;
  color: var(--dim);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proposal-actions {
  display: flex;
  gap: 6px;
}

.proposal-grid {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.proposal-label {
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.proposal-raw {
  color: var(--dim);
  font-size: 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.statusbar {
  display: none;
}

.lcd-label {
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.lcd {
  flex: 1;
  min-width: 0;
  color: var(--hot);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.updated {
  color: var(--dim);
  font-size: 11px;
  white-space: nowrap;
}

.signin-overlay {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.78);
}

.signin-overlay[hidden] {
  display: none;
}

.signin-dialog {
  width: min(300px, 100%);
  padding: 14px;
  border: 1px solid var(--line);
  background: #000;
  color: var(--fg);
  box-shadow: 4px 4px 0 var(--line);
}

.signin-title {
  margin-bottom: 12px;
  font-family: var(--pixel);
  font-size: 26px;
  line-height: 1;
}

.signin-field {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.signin-field input {
  width: 100%;
  height: 30px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  background: #000;
  color: var(--fg);
  outline: 0;
  letter-spacing: 0;
  text-transform: none;
}

.signin-field input:focus {
  border-color: var(--fg);
}

.color-popover {
  position: fixed;
  z-index: 100;
  top: 54px;
  left: 58px;
  right: auto;
  width: 210px;
  padding: 9px;
  border: 1px solid var(--line);
  background: #000;
  box-shadow: 3px 3px 0 var(--line);
  color: var(--fg);
}

.color-popover-title {
  margin-bottom: 8px;
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.color-swatch {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background: #000;
  cursor: pointer;
}

.color-swatch.default {
  background:
    linear-gradient(135deg, transparent 0 46%, var(--fg) 47% 53%, transparent 54%),
    #000;
}

.color-swatch:hover,
.custom-color:hover {
  outline: 1px solid var(--fg);
  outline-offset: 2px;
}

.custom-color {
  width: 100%;
  height: 24px;
  margin-top: 8px;
  border: 1px solid var(--line);
  background: #000;
  color: var(--fg);
  font-family: var(--pixel);
  font-size: 16px;
  cursor: pointer;
}

@media (max-width: 900px) {
  .workspace {
    overflow: auto;
  }

  .desktop-icons {
    position: relative;
    top: auto;
    left: auto;
    display: flex;
    padding-bottom: 10px;
  }

  .rwindow,
  .board-window,
  .intake-window {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 280px;
    margin-bottom: 12px;
    resize: vertical;
  }
}

@media (max-width: 620px) {
  .menubar {
    gap: 6px;
    padding: 0 7px;
  }

  .user-chip span,
  .status-legend,
  .tree-head,
  .updated {
    display: none;
  }

  .mb-brand {
    min-width: 40px;
    padding-inline: 2px;
  }

  .mb-menu-button {
    padding-inline: 6px;
  }

  .user-chip input {
    width: clamp(82px, 25vw, 110px);
  }

  .workspace {
    padding: 8px;
    gap: 10px;
  }

  .tree {
    padding: 6px 0 16px;
    overflow-x: hidden;
  }

  .task-row {
    --row-indent: calc(8px + var(--depth) * 14px);
    grid-template-columns: 1fr;
    gap: 5px;
    width: 100%;
    height: auto !important;
    min-height: 0;
    padding: 7px 42px 8px calc(var(--row-indent) + 8px);
  }

  .task-main,
  .task-note,
  .task-owner {
    grid-column: 1 / -1;
  }

  .task-main {
    grid-template-columns: 15px 20px minmax(0, 1fr);
  }

  .task-row .editable {
    min-height: 0;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
  }

  .task-note,
  .task-owner {
    padding-left: 41px;
  }

  .draft-row {
    grid-template-columns: minmax(0, 1fr);
    padding-block: 8px;
  }

  .draft-row .task-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .draft-row .task-title {
    min-height: 24px;
    padding: 3px 8px;
  }

  .delete-item {
    top: 50%;
    right: 19px;
  }

  .row-height-grip {
    display: none;
  }
}
