:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #f1f4f7;
  --ink: #1f2328;
  --muted: #667085;
  --line: #d7dee8;
  --line-soft: #e8edf3;
  --blue: #0969da;
  --green: #1a7f37;
  --amber: #9a6700;
  --red: #cf222e;
  --purple: #8250df;
  --shadow: 0 16px 42px rgba(31, 35, 40, .06);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .94em; overflow-wrap: anywhere; }

.app-shell {
  width: min(1460px, 100%);
  margin: 0 auto;
  padding: 18px 22px 34px;
}

.topbar {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
}

.brand:hover { text-decoration: none; }

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav a,
.button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 11px;
  color: var(--ink);
  font-weight: 720;
}

.nav a {
  color: var(--muted);
}

.nav a.active,
.nav a:hover {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
  text-decoration: none;
}

.button {
  border-color: var(--line);
  background: var(--surface);
}

.button:hover {
  border-color: #b8c1cc;
  text-decoration: none;
}

.button.primary {
  color: #fff;
  background: #1f883d;
  border-color: #1f883d;
}

.workspace {
  display: grid;
  gap: 16px;
}

.todo-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.todo-panel .section-head {
  align-items: flex-end;
}

.todo-panel h1 {
  margin-bottom: 4px;
  font-size: 26px;
}

.todo-list {
  display: grid;
  gap: 0;
}

.todo-day {
  position: relative;
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 0 14px;
  padding: 0 0 14px;
}

.todo-day::before {
  content: "";
  position: absolute;
  top: 29px;
  bottom: 0;
  left: 135px;
  width: 1px;
  background: var(--line);
}

.todo-day:last-child {
  padding-bottom: 0;
}

.todo-day:last-child::before {
  display: none;
}

.todo-day-head {
  grid-row: 1 / span 20;
  display: grid;
  align-content: start;
  gap: 3px;
  min-height: 34px;
  padding-top: 3px;
  color: var(--ink);
}

.todo-day-head strong {
  font-size: 15px;
  line-height: 1.2;
}

.todo-day-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.todo-item {
  min-width: 0;
  display: grid;
  grid-column: 2;
  grid-template-columns: 38px 154px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border-top: 1px solid var(--line-soft);
  border-radius: 8px;
  background: transparent;
  padding: 10px 0;
}

.todo-day-head + .todo-item {
  border-top: 0;
  padding-top: 0;
}

.todo-item.urgent {
  color: var(--red);
}

.todo-item.high {
  color: var(--amber);
}

.todo-marker {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: var(--surface);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.todo-item.urgent .todo-marker {
  color: var(--red);
}

.todo-item.high .todo-marker {
  color: var(--amber);
}

.todo-date {
  display: grid;
  gap: 3px;
  color: var(--ink);
}

.todo-date strong {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.todo-date span {
  color: var(--muted);
  font-size: 12px;
}

.todo-main {
  min-width: 0;
  color: var(--ink);
}

.todo-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.todo-title-row h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.todo-main p {
  margin: 0;
  color: #414954;
  font-size: 13px;
}

.completed-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.completed-list {
  display: grid;
  gap: 0;
}

.completed-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}

.completed-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.completed-check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--green);
  background: #f0fff4;
  border: 1px solid rgba(26, 127, 55, .35);
  font-size: 12px;
  font-weight: 900;
}

.completed-main {
  min-width: 0;
}

.completed-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.completed-title-row h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.completed-main p,
.completed-item time {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.completed-item time {
  white-space: nowrap;
}

.mainline {
  min-height: 180px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 10px;
  font-size: 34px;
  line-height: 1.08;
}

h2 {
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.28;
}

.lead {
  max-width: 820px;
  margin-bottom: 0;
  color: #3f4650;
  font-size: 15px;
}

.mainline-ops {
  min-width: 190px;
  display: grid;
  justify-items: end;
  gap: 9px;
}

.progress-block {
  width: 180px;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 750;
  text-align: right;
}

.progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #e7ecf2;
}

.progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blue);
  transition: width .28s ease;
}

.decision-strip {
  display: grid;
  grid-template-columns: .7fr 1.25fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.decision-strip div {
  min-width: 0;
  padding: 14px;
  background: var(--surface);
}

.decision-strip span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.decision-strip strong {
  display: block;
  overflow-wrap: anywhere;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.work-area,
.rail-section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.work-area {
  padding: 14px;
  box-shadow: var(--shadow);
}

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

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.section-head.compact {
  align-items: center;
  margin-bottom: 10px;
}

.sync-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.dot.ok { background: var(--green); }
.dot.warn { background: var(--amber); }
.dot.bad { background: var(--red); }

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.column {
  min-width: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.column-head {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
}

.column-body {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.task-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.task-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.task-card p {
  margin-bottom: 7px;
  color: #414954;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.task-card p:last-child { margin-bottom: 0; }

.pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.tag.good { color: var(--green); border-color: rgba(26, 127, 55, .35); background: #f0fff4; }
.tag.warn { color: var(--amber); border-color: rgba(154, 103, 0, .35); background: #fff8c5; }
.tag.bad { color: var(--red); border-color: rgba(207, 34, 46, .35); background: #ffebe9; }
.tag.neutral { color: var(--purple); border-color: rgba(130, 80, 223, .32); background: #f6f0ff; }

.side-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.rail-section {
  padding: 14px;
}

.project-list {
  display: grid;
  gap: 9px;
}

.project-item {
  display: grid;
  gap: 7px;
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
}

.project-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.project-item strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.health-list {
  display: grid;
  gap: 8px;
}

.health-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
}

.health-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.health-row span,
.muted {
  color: var(--muted);
}

.health-row strong {
  font-size: 13px;
  text-align: right;
}

.fact-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.fact-list div {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

.fact-list div:first-child {
  padding-top: 0;
  border-top: 0;
}

.fact-list dt {
  color: var(--muted);
  font-weight: 760;
}

.fact-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.empty-state,
.error-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: #fbfcfd;
}

.error-state {
  color: var(--red);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.noscript {
  max-width: 720px;
  margin: 20px auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

@media (max-width: 1120px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .todo-list {
    gap: 0;
  }

  .side-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 860px) {
  .app-shell {
    padding: 14px 12px 28px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .mainline {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .mainline-ops {
    justify-items: start;
  }

  .progress-block {
    width: 100%;
    text-align: left;
  }

  h1 {
    font-size: 28px;
  }

  .decision-strip {
    grid-template-columns: 1fr;
  }

  .todo-panel .section-head {
    align-items: flex-start;
  }

  .todo-list {
    grid-template-columns: 1fr;
  }

  .side-rail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .todo-day {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .todo-day::before {
    display: none;
  }

  .todo-day-head {
    grid-row: auto;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
  }

  .todo-day:first-child .todo-day-head {
    padding-top: 0;
    border-top: 0;
  }

  .todo-item {
    grid-column: 1;
    grid-template-columns: 32px minmax(104px, .45fr) minmax(0, 1fr);
  }

  .todo-title-row {
    align-items: flex-start;
  }

  .completed-item {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .completed-item time {
    grid-column: 2;
  }

  .board {
    grid-template-columns: 1fr;
    overflow-x: visible;
  }

  .column {
    min-width: 0;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
