:root {
  --font-sans:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:
    ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
  --font-serif: "Newsreader", "Iowan Old Style", Georgia, serif;

  --radius: 2px;
  --row-h: 29px;

  --bg: #ffffff;
  --surface: #f7f8fa;
  --surface-2: #eef0f4;
  --hover: #f3f6fb;
  --selected: #eaf1ff;
  --ink: #0b0e14;
  --ink-2: #2f3746;
  --muted: #606978;
  --faint: #929aa8;
  --line: #e1e5ec;
  --line-strong: #c7cdd8;

  --blue: #0052ff;
  --blue-hover: #003ecc;
  --blue-deep: #003099;
  --blue-tint: #ebf2ff;
  --blue-border: #b8d0ff;

  --urgent: #c81e1e;
  --urgent-tint: #fef2f2;
  --warn: #b45309;
  --warn-tint: #fffbeb;
  --ok: #0b7a4b;
  --ok-tint: #ecfdf5;

  --map-0: #f0f2f6;
  --map-1: #d4e3ff;
  --map-2: #8ab4ff;
  --map-3: #2a70ff;
  --map-4: #003bb8;
  --map-active: #0b0e14;
}

body[data-density="ultra"] {
  --row-h: 25px;
}
body[data-density="tight"] {
  --row-h: 29px;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  font: 12px/1.35 var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.serif {
  font-family: var(--font-serif);
}
.kicker {
  font: 600 9.5px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.link {
  color: var(--blue);
  text-decoration: none;
  font-weight: 550;
}
.link:hover {
  text-decoration: underline;
}

.app-frame {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(13rem, 18vw, 15rem) minmax(0, 1fr);
}

aside.rail {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  user-select: none;
}
.rail-brand {
  height: 36px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.03em;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-right: 6px;
  background: var(--blue);
  color: #fff;
  font: 700 10px/1 var(--font-mono);
  border-radius: 1px;
}
.rail-co {
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 10px/1.2 var(--font-mono);
  color: var(--muted);
}
.rail-co a {
  min-width: 0;
}
.rail-co b {
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11.5px;
}

.rail-nav {
  padding: 5px 0;
  display: grid;
  gap: 1px;
}
.rail-nav + .rail-nav {
  border-top: 1px solid var(--line);
}
.rail-label {
  padding: 4px 10px 3px;
  font: 600 9px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
}
.rail-nav a {
  width: 100%;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--ink-2);
  padding: 6px 12px 6px 10px;
  gap: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  text-align: left;
}
.rail-nav a:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.rail-nav a[aria-current] {
  background: var(--blue-tint);
  border-left-color: var(--blue);
  color: var(--blue-deep);
  font-weight: 600;
}
.rail-nav a .ct {
  font: 10px/1 var(--font-mono);
  color: var(--muted);
}
.rail-nav a[aria-current] .ct {
  color: var(--blue);
  font-weight: 650;
}
.rail-nav a .ct.alert {
  background: var(--blue);
  color: #fff;
  padding: 1px 4px;
  border-radius: 1px;
}

.rail-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 8px 10px;
  display: grid;
  gap: 6px;
  background: var(--bg);
  font: 10px/1.2 var(--font-mono);
  color: var(--muted);
}
.meter-row {
  display: grid;
  gap: 3px;
}
.meter-row .mhead {
  display: flex;
  justify-content: space-between;
}
.meter-track {
  height: 3px;
  background: var(--surface-2);
}
.meter-fill {
  height: 100%;
  background: var(--blue);
}

.main-col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.topbar {
  height: 36px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.topbar h1 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.topbar .sub {
  font: 11px/1 var(--font-mono);
  color: var(--muted);
  padding-left: 8px;
  border-left: 1px solid var(--line);
  white-space: nowrap;
}
.topbar .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn {
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
}
.btn:hover {
  background: var(--hover);
  border-color: var(--ink-2);
}
.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
}
.btn.primary:hover {
  background: var(--blue-hover);
  border-color: var(--blue-hover);
}
.btn.ink {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}
.btn.sm {
  height: 20px;
  padding: 0 6px;
  font-size: 10.5px;
}

.telemetry {
  flex: none;
  display: grid;
  grid-template-columns: 1.45fr 1fr 1fr 1fr;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.t-cell {
  padding: 6px 10px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.t-cell:last-child {
  border-right: 0;
}
table.grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}
table.grid thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
  border-right: 1px solid var(--line);
  padding: 5px 8px;
  text-align: left;
  font: 600 9.5px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  white-space: nowrap;
}
table.grid thead th:last-child,
table.grid tbody td:last-child {
  border-right: 0;
}
table.grid tbody tr {
  height: var(--row-h);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
table.grid tbody tr:hover {
  background: var(--hover);
}
table.grid tbody tr.selected {
  background: var(--selected);
}
table.grid tbody td {
  padding: 0 8px;
  border-right: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.due-cell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 10.5px/1 var(--font-mono);
}
.due-bar {
  width: 28px;
  height: 4px;
  background: var(--surface-2);
  flex: none;
}
.due-bar i {
  display: block;
  height: 100%;
  background: var(--ink-2);
}
.due-cell.urgent {
  color: var(--urgent);
  font-weight: 650;
}
.due-cell.urgent .due-bar i {
  background: var(--urgent);
}
.due-cell.warn {
  color: var(--warn);
}
.due-cell.warn .due-bar i {
  background: var(--warn);
}

.tag {
  display: inline-block;
  padding: 1px 4px;
  border: 1px solid var(--line-strong);
  border-radius: 1px;
  font: 600 9.5px/1.2 var(--font-mono);
  color: var(--ink-2);
  background: var(--surface);
}
.tag.blue {
  border-color: var(--blue-border);
  background: var(--blue-tint);
  color: var(--blue-deep);
}
.tag.urgent {
  border-color: #f3c4c4;
  background: var(--urgent-tint);
  color: var(--urgent);
}
.tag.warn {
  border-color: #f0d7a3;
  background: var(--warn-tint);
  color: var(--warn);
}
.tag.ok {
  border-color: #b7e4ce;
  background: var(--ok-tint);
  color: var(--ok);
}

.board {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(175px, 1fr));
  overflow: auto;
}
.lane {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.lane:last-child {
  border-right: 0;
}
.sr-row {
  display: grid;
  grid-template-columns: 22px 1fr 24px;
  align-items: center;
  gap: 6px;
  font: 10.5px/1 var(--font-mono);
  cursor: pointer;
  padding: 2px 3px;
}
.sr-row:hover,
.sr-row.active {
  background: var(--selected);
  color: var(--blue-deep);
  font-weight: 700;
}
.kv {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  border-top: 1px solid var(--line);
  font-size: 11.5px;
}
.kv dt,
.kv dd {
  margin: 0;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.kv dt {
  font: 600 9.5px/1.4 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.quote-box {
  border-left: 2px solid var(--blue);
  padding: 6px 8px;
  background: var(--surface);
  font-family: var(--font-serif);
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-2);
}
.quote-box cite {
  display: block;
  margin-top: 4px;
  font: 9.5px/1 var(--font-mono);
  font-style: normal;
  color: var(--blue-deep);
}
.split-2 {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.95fr);
  overflow: hidden;
}
.col-pane {
  overflow: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.col-pane + .col-pane {
  border-left: 1px solid var(--line-strong);
  background: var(--surface);
}
.sec {
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
}
.sec h3 {
  margin: 0 0 6px;
  font: 600 9.5px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-snip {
  margin: 5px 0 0;
  padding: 7px 9px;
  background: #0b0e14;
  color: #e4e9f5;
  font: 10.5px/1.45 var(--font-mono);
  border-radius: var(--radius);
  overflow-x: auto;
}

.statusbar {
  height: 24px;
  flex: none;
  padding: 0 10px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 10px/1 var(--font-mono);
  color: var(--muted);
}
.statusbar kbd {
  border: 1px solid var(--line-strong);
  background: var(--bg);
  padding: 0 3px;
  border-radius: 1px;
  color: var(--ink);
}

body {
  height: 100dvh;
}
[hidden] {
  display: none !important;
}
a {
  color: var(--blue);
  text-underline-offset: 2px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}
.rail-brand,
.rail-nav a,
.rail-co a {
  text-decoration: none;
  color: inherit;
}
.rail {
  overflow: auto;
}
.rail-co b {
  overflow-wrap: anywhere;
}
.app-frame.no-rail,
.sidebar-collapsed .app-frame {
  grid-template-columns: minmax(0, 1fr);
}
.sidebar-collapsed .rail {
  display: none;
}
.detail-page,
.table-page {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  flex: 1;
}
.detail-page {
  padding: 12px 16px 28px;
}
.detail-page nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.detail-page h1,
.heading h1 {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.035em;
  margin: 0 0 9px;
}
h2 {
  font-size: 15px;
}
h3 {
  font-size: 13px;
}
p {
  margin: 0.55em 0;
}
summary {
  cursor: pointer;
}
button,
.btn,
input:not([type="checkbox"]):not([type="file"]),
select,
textarea {
  font: inherit;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  max-width: 100%;
}
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  min-height: 20px;
  height: 24px;
  cursor: pointer;
  text-decoration: none;
}
button:hover,
.btn:hover {
  background: var(--hover);
}
input:not([type="checkbox"]):not([type="file"]),
select {
  height: 24px;
  padding: 0 5px;
}
textarea {
  padding: 5px;
  vertical-align: top;
}
button.primary,
a.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}
.inline-form,
.actions,
.toolbar,
.tabs,
.heading,
.pagehead {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.heading,
.pagehead {
  justify-content: space-between;
}
.heading h1 {
  margin: 0;
}
.tabs,
.toolbar {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.tabs [aria-current] {
  color: var(--ink);
  font-weight: 650;
}
label {
  font-size: 12px;
}
pre,
code,
time,
.ct,
progress,
.meter-row,
.statusbar {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
code {
  overflow-wrap: anywhere;
}
blockquote {
  font: 13px/1.5 var(--font-serif);
  border-left: 2px solid var(--blue);
  margin: 6px 0;
  padding: 4px 9px;
}
progress {
  width: 100%;
  height: 4px;
  appearance: none;
  border: 0;
  background: var(--surface-2);
  color: var(--blue);
}
progress::-webkit-progress-bar {
  background: var(--surface-2);
}
progress::-webkit-progress-value {
  background: var(--blue);
}
progress::-moz-progress-bar {
  background: var(--blue);
}
.split-2 {
  overflow: visible;
}
.col-pane {
  min-width: 0;
}
.detail-page .grid,
.detail-page .kv {
  margin: 5px 0;
}
.grid button {
  height: 20px;
  min-height: 20px;
}
.detail-page .table-wrap,
.detail-page .table-scroll {
  max-width: 100%;
  overflow: auto;
}
.detail-page .grid {
  min-width: 480px;
}
.quote-box {
  overflow-wrap: anywhere;
}
@media (max-width: 720px) {
  .app-frame {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .rail-brand,
  .rail-co,
  .rail-foot,
  .rail-label {
    display: none;
  }
  .rail-nav {
    display: flex;
    flex-wrap: wrap;
    flex: none;
  }
  .rail-nav a {
    width: auto;
    white-space: nowrap;
    padding: 5px 8px;
    gap: 4px;
  }
  .sidebar-collapsed .app-frame,
  .no-rail {
    grid-template-rows: minmax(0, 1fr);
  }
  .split-2,
  .telemetry,
  .quickstart {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .split-2 {
    display: block;
  }
  .detail-page {
    padding: 10px;
  }
  .col-pane + .col-pane {
    border-left: 0;
  }
  .statusbar {
    min-width: 0;
  }
  .statusbar span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}
