:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #20232c;
  background: #f5f5f8;
  font-size: 14px;
  --surface: #fff;
  --muted: #727681;
  --border: #e3e5eb;
  --blue: #087df1;
  --soft: #edf4ff;
  --sidebar: #edeef3;
  --shadow: 0 2px 14px #27325706;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: var(--blue);
}
button {
  color: inherit;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 9px;
  padding: 9px 13px;
}
button:hover {
  border-color: var(--blue);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #42a2ff;
  outline-offset: 3px;
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
.shell {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 28px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 0 8px 26px;
}
.brandmark {
  display: grid;
  place-items: center;
  background: var(--blue);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 23px;
}
.brand strong {
  display: block;
  font-size: 17px;
  letter-spacing: -0.5px;
}
.brand small {
  color: var(--muted);
  font-size: 11px;
}
.nav-caption,
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 650;
  color: var(--muted);
}
.nav-caption {
  padding: 0 12px 9px;
}
nav {
  display: grid;
  gap: 3px;
}
nav a {
  text-decoration: none;
  color: inherit;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}
nav a[aria-current="page"] {
  background: var(--blue);
  color: white;
  box-shadow: 0 3px 8px #087df126;
}
.nav-icon {
  font-size: 17px;
  width: 20px;
  text-align: center;
}
.sidebar-footer {
  margin-top: auto;
  padding: 25px 10px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
.main {
  min-width: 0;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 25px 34px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
h1 {
  font-size: 28px;
  letter-spacing: -1px;
  margin: 0 0 5px;
  font-weight: 700;
}
h2 {
  font-size: 17px;
  letter-spacing: -0.4px;
  margin: 0 0 16px;
}
h3 {
  font-size: 14px;
  margin: 0 0 8px;
}
p {
  line-height: 1.6;
  margin: 6px 0;
}
.subtitle,
.muted {
  color: var(--muted);
  font-size: 12px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 10px;
  line-height: 1.4;
  white-space: normal;
  color: var(--muted);
  background: var(--surface);
}
.badge.blue {
  color: var(--blue);
  background: var(--soft);
}
.badge.orange {
  color: #a76a00;
  background: #fff8e8;
}
.badge.red {
  color: #c73d43;
  background: #fff0f0;
}
.banner {
  padding: 11px 18px;
  background: #fff7dd;
  color: #7f5909;
  border-bottom: 1px solid #eee0b4;
  font-size: 12px;
}
.banner.fixture {
  background: #edf3ff;
  color: #3353a1;
}
.content {
  padding: 26px 34px 36px;
  max-width: 1720px;
  margin: auto;
}
.section {
  margin-bottom: 26px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-head h2 {
  margin: 0;
}
.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow-wrap: anywhere;
}
.hero-card {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 25px 30px;
  min-height: 240px;
}
.hero-card .ring {
  width: 158px;
  height: 158px;
  flex-shrink: 0;
}
.hero-copy h2 {
  font-size: 21px;
  margin: 8px 0;
}
.hero-copy p {
  max-width: 210px;
}
.ring {
  position: relative;
  width: 82px;
  height: 82px;
  margin: auto;
  display: grid;
  place-items: center;
}
.ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring circle {
  fill: none;
  stroke-width: 7;
  stroke: var(--border);
}
.ring .value {
  stroke: #2dbb80;
  stroke-linecap: round;
}
.ring.blue .value {
  stroke: #1985f8;
}
.ring.purple .value {
  stroke: #a779ed;
}
.ring.orange .value {
  stroke: #e5a535;
}
.ring.red .value {
  stroke: #e45961;
}
.ring strong {
  position: absolute;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.7px;
}
.hero-card .ring strong {
  font-size: 40px;
}
.metric {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px;
}
.metric .ring {
  margin: 0;
  width: 68px;
  height: 68px;
  flex-shrink: 0;
}
.metric .ring strong {
  font-size: 16px;
}
.metric h3 {
  margin: 0 0 4px;
}
.metric p {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}
.stat {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -1px;
  margin: 10px 0;
}
.domain {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.domain:last-child {
  border: 0;
}
.progress {
  height: 5px;
  background: var(--border);
  border-radius: 5px;
  width: 100%;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--blue);
}
.row {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}
.stack {
  display: grid;
  gap: 12px;
}
.chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.toolbar input {
  flex: 1;
  min-width: 180px;
}
input,
select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  border-radius: 8px;
  padding: 10px 12px;
}
input[type="search"] {
  min-width: 180px;
}
.board {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  overflow-x: auto;
  padding: 2px 2px 20px;
  min-height: 480px;
}
.lane {
  flex: 0 0 258px;
  background: var(--sidebar);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 12px;
}
.lane-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 650;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  margin-right: 7px;
}
.proposed .dot {
  background: #e4b23e;
}
.doing .dot {
  background: #ea933a;
}
.stalled .dot {
  background: #a779ed;
}
.blocked .dot {
  background: #e55c64;
}
.deferred .dot {
  background: #999;
}
.done .dot {
  background: #2dbb80;
}
.task-card {
  display: block;
  text-align: left;
  width: 100%;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 10px;
  box-shadow: 0 1px 3px #00000004;
}
.task-card h3 {
  font-size: 13px;
  line-height: 1.5;
  margin: 7px 0;
}
.task-card .task-id {
  font-size: 10px;
  color: var(--muted);
}
.task-card p {
  font-size: 11px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.task-card .row {
  font-size: 11px;
  color: var(--muted);
  margin-top: 14px;
}
.empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.error {
  border: 1px solid #eccfcf;
  background: var(--surface);
  color: #b54c53;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 15px;
  font-size: 12px;
}
.source {
  color: var(--muted);
  font-size: 10px;
  margin: 14px 0 0;
  line-height: 1.5;
}
.table-scroll {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
.table th {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 10px;
}
.table td {
  padding: 14px 10px;
  border-top: 1px solid var(--border);
  vertical-align: top;
  max-width: 380px;
  overflow-wrap: anywhere;
}
.tabs {
  display: flex;
  gap: 5px;
  background: var(--sidebar);
  padding: 4px;
  border-radius: 10px;
  width: fit-content;
  margin-bottom: 18px;
}
.tabs button {
  background: transparent;
  border-color: transparent;
  padding: 7px 18px;
}
.tabs button[aria-pressed="true"] {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow);
}
.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--blue);
  font-weight: 700;
  font-size: 17px;
  flex-shrink: 0;
}
.message {
  border-left: 2px solid var(--blue);
  padding: 12px 17px;
  background: var(--surface);
  border-radius: 0 10px 10px 0;
}
.message p {
  white-space: pre-wrap;
  font-size: 13px;
}
.message .row {
  font-size: 11px;
  color: var(--muted);
}
.logline {
  font:
    11px/1.7 ui-monospace,
    monospace;
  white-space: pre-wrap;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.logline.error-line {
  color: #cc515a;
}
dialog {
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px;
  width: min(700px, 94vw);
  max-height: 88vh;
  box-shadow: 0 24px 100px #0004;
}
dialog::backdrop {
  background: #1e294855;
  backdrop-filter: blur(3px);
}
dialog .detail-copy {
  white-space: pre-wrap;
  font-size: 13px;
  margin: 10px 0 22px;
  overflow-wrap: anywhere;
}
dialog h2 {
  margin: 18px 0;
  font-size: 23px;
}
dl {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px;
  font-size: 12px;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.skip {
  position: fixed;
  top: -60px;
  z-index: 10;
  background: var(--surface);
  padding: 12px;
}
.skip:focus {
  top: 4px;
}
.small-button {
  padding: 6px 10px;
  font-size: 11px;
}
.full {
  width: 100%;
}
.graph {
  width: 100%;
  height: 300px;
  background: var(--sidebar);
  border-radius: 12px;
}
.graph line {
  stroke: #aab7ca;
  stroke-width: 1.5;
}
.graph circle {
  fill: var(--blue);
  stroke: var(--surface);
  stroke-width: 3;
}
.graph text {
  fill: currentColor;
  font-size: 10px;
}
.footer {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  margin-top: 28px;
}
.lead {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 20px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color: #ededf3;
    background: #191a20;
    --surface: #24252d;
    --sidebar: #202128;
    --border: #363843;
    --muted: #a2a5b3;
    --soft: #20334c;
    --blue: #409cff;
    --shadow: none;
  }
  .badge.orange,
  .banner {
    background: #3e341c;
    color: #f3d387;
  }
  .badge.red {
    background: #422a2d;
    color: #f3a4ad;
  }
  .banner.fixture {
    background: #25334d;
    color: #c1d2fb;
  }
  .error {
    color: #f3a4ad;
    border-color: #593a40;
  }
}
@media (max-width: 1200px) {
  .hero-card {
    gap: 15px;
    padding: 22px;
  }
  .hero-card .ring {
    width: 120px;
    height: 120px;
  }
  .hero-copy h2 {
    font-size: 18px;
  }
  .grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .content {
    padding: 22px;
  }
  .hero-card .ring strong {
    font-size: 32px;
  }
}
@media (max-width: 800px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 13px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .brand {
    padding: 0 0 12px;
  }
  .brandmark {
    width: 30px;
    height: 30px;
    font-size: 19px;
  }
  .brand strong {
    font-size: 15px;
  }
  .nav-caption,
  .sidebar-footer {
    display: none;
  }
  nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 3px;
  }
  nav a {
    flex-shrink: 0;
    padding: 8px 10px;
    font-size: 12px;
    gap: 6px;
  }
  .nav-icon {
    font-size: 14px;
    width: 16px;
  }
  header {
    padding: 19px 18px;
    align-items: flex-start;
  }
  h1 {
    font-size: 24px;
  }
  .header-actions {
    gap: 5px;
  }
  .header-actions > .badge {
    display: none;
  }
  .content {
    padding: 20px 16px;
  }
  .grid.two {
    grid-template-columns: 1fr;
  }
  .hero-card {
    min-height: 190px;
    gap: 24px;
  }
  .hero-card .ring {
    width: 132px;
    height: 132px;
  }
  .hero-copy h2 {
    font-size: 20px;
  }
  .grid.four {
    gap: 10px;
  }
  .metric {
    padding: 13px;
    gap: 10px;
  }
  .metric .ring {
    width: 54px;
    height: 54px;
  }
  .metric .ring strong {
    font-size: 14px;
  }
  .metric h3 {
    font-size: 12px;
  }
  .lane {
    flex-basis: 280px;
  }
  .toolbar > * {
    max-width: 100%;
  }
  .table td {
    min-width: 110px;
  }
  .tabs button {
    padding: 7px 12px;
  }
  dialog {
    padding: 19px;
  }
  .hero-copy p {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .card,
  .task-card {
    animation: appear 0.2s ease-out;
  }
  @keyframes appear {
    from {
      opacity: 0.65;
      transform: translateY(3px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

/* One bounded task overview; history is paginated rather than appended. */
.task-stack { display: grid; gap: 10px; }
.task-stack .task-card, [aria-label="Task board"] > .section > .task-card { width: 100%; margin-bottom: 10px; text-align: left; }
.task-summary { font-size: 1.1rem; font-weight: 600; }
[aria-label="Task board"] .section, [aria-label="Task board"] .task-stack { min-width: 0; }
[aria-label="Task board"] .task-card { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 800px) { [aria-label="Task board"] .grid.two { grid-template-columns: minmax(0, 1fr); } }
