.table-page {
  display: flex;
  flex-direction: column;
}
.table-page > .heading,
.table-page > .toolbar,
.table-page > .aux,
.table-page > #summary,
.table-page > #pages {
  padding: 5px 10px;
}
.table-page > .toolbar {
  justify-content: space-between;
}
.eyebrow {
  font: 10px var(--font-mono);
  color: var(--muted);
  text-transform: uppercase;
}
.controls,
.switch,
.save,
.drawerhead,
.lanehead {
  display: flex;
  align-items: center;
  gap: 5px;
}
.switch .active,
.switch [aria-pressed="true"] {
  color: var(--blue);
  background: var(--blue-tint);
}
#work {
  overflow: auto;
  min-height: 0;
  flex: 1;
}
.grid table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
}
.grid th,
.grid td {
  height: var(--row-h);
  padding: 0 8px;
  border: 1px solid var(--line);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.grid th {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
  text-align: left;
}
.grid th button {
  padding: 0;
  border: 0;
  background: none;
  font: 600 10px var(--font-mono);
  text-transform: uppercase;
}
.grid tr:hover {
  background: var(--hover);
}
.grid tr:focus-within {
  background: var(--selected);
}
.record,
.card,
.maplist button {
  border: 0;
  background: transparent;
  text-align: left;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  padding: 0;
}
.grid .record {
  font-weight: 550;
}
.grid td:not(:first-child) {
  font-variant-numeric: tabular-nums;
}
.grid td input,
.grid td select {
  width: 100%;
}
.pill {
  font: 11px var(--font-mono);
  border: 1px solid var(--line);
  padding: 1px 4px;
}
.board {
  height: 100%;
  align-items: start;
}
.lane {
  padding: 6px;
}
.card {
  padding: 4px 6px;
  white-space: normal;
  height: auto;
  border: 1px solid var(--line);
  margin: 4px 0;
}
.card small {
  display: block;
  color: var(--muted);
}
.map {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(150px, 1fr);
  border-bottom: 1px solid var(--line);
}
.map svg {
  width: 100%;
  max-height: 290px;
}
.maplist {
  padding: 8px;
  max-height: 290px;
  overflow: auto;
}
.sr-row {
  display: flex;
  gap: 6px;
  width: 100%;
  align-items: center;
}
.sr-row progress {
  width: 50%;
}
#summary,
#pages {
  font: 10px var(--font-mono);
  color: var(--muted);
}
#summary {
  border-top: 1px solid var(--line);
}
#pages {
  display: flex;
  gap: 6px;
  align-items: center;
}
dialog {
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--ink);
  max-width: min(95vw, 38rem);
  max-height: 94dvh;
  overflow: auto;
  padding: 12px;
}
dialog::backdrop {
  background: rgb(11 14 20 / 0.15);
}
#detail,
#research-inspector {
  position: fixed;
  inset: 36px 0 24px auto;
  margin: 0;
  width: min(100%, clamp(25rem, 34vw, 32rem));
  height: calc(100dvh - 60px);
  max-height: none;
  max-width: 100%;
  border-right: 0;
}
.drawerhead,
.save {
  justify-content: space-between;
}
.drawerhead {
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
#fields label,
#column-list label,
#related a {
  display: block;
  padding: 4px 0;
}
#fields label {
  display: grid;
  grid-template-columns: minmax(6rem, 32%) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
#fields span {
  overflow-wrap: anywhere;
}
#column-manager form,
#create form,
#editor {
  display: grid;
  gap: 7px;
}
#feedback,
#editerror,
#column-error,
[role="alert"] {
  color: var(--urgent);
}
.toolbar .controls {
  flex-wrap: wrap;
}
button[aria-busy="true"],
tr[aria-busy="true"] {
  opacity: 0.65;
}
@media (max-width: 720px) {
  .map {
    grid-template-columns: minmax(0, 1fr);
  }
  .maplist {
    max-height: 130px;
  }
  .heading {
    flex-wrap: wrap;
  }
  .table-page .toolbar {
    align-items: start;
  }
  .table-page #work {
    min-height: 130px;
  }
  .table-page {
    display: block;
  }
  .table-page .grid {
    max-height: 62dvh;
    overflow: auto;
  }
}
.map path {
  stroke: white;
  stroke-width: 1px;
}
.map path[data-level="0"] {
  fill: var(--map-0);
}
.map path[data-level="1"] {
  fill: var(--map-1);
}
.map path[data-level="2"] {
  fill: var(--map-2);
}
.map path[data-level="3"] {
  fill: var(--map-3);
}
.map path[data-level="4"] {
  fill: var(--map-4);
}
.map path.selected,
.map path:focus-visible {
  fill: var(--map-active);
}
.map path[role="button"] {
  cursor: pointer;
}
.state-rank {
  max-height: 230px;
  overflow: auto;
  padding: 6px;
}
.state-rank button {
  justify-content: space-between;
  border: 0;
  background: none;
  font: 11px var(--font-mono);
}
.state-rank button[aria-pressed="true"] {
  background: var(--selected);
}
.maplist {
  grid-column: 1/-1;
}
.research-grid {
  min-width: 930px !important;
}
.research-grid th:first-child {
  width: 29%;
}
.research-grid th:nth-child(4) {
  width: 42px;
}
.research-grid th:last-child {
  width: 190px;
}
td progress {
  width: 50px;
}
.inline-form {
  margin: 0;
}
.topbar,
.statusbar {
  flex-shrink: 0;
}
.grid td .inline-form {
  flex-wrap: nowrap;
}
.detail-page form label {
  margin-right: 4px;
}
.rebid {
  display: flex;
  overflow: auto;
  border: 1px solid var(--line);
}
.rebid > div {
  min-width: 60px;
  flex: 1;
  padding: 6px;
  border-right: 1px solid var(--line);
}
.rebid strong {
  display: block;
}
.term-window {
  display: flex;
  gap: 10px;
  padding: 6px 0;
}
.requirement {
  height: auto;
  min-height: 29px;
  display: grid;
  grid-template-columns: 65px 55px 1fr;
  gap: 4px;
  text-align: left;
  justify-items: start;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 4px;
}
.requirement[aria-pressed="true"] {
  background: var(--selected);
}
.sec h2 {
  margin: 0 0 6px;
}
.detail-page .grid {
  margin: 0;
}
.copy-line {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}
.copy-line code {
  min-width: 0;
  white-space: pre-wrap;
}
.copy-line button {
  flex: none;
}
.onboarding {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--blue-tint);
}
.onboarding input {
  width: 115px;
}
.onboarding input[name="territory"] {
  width: 80px;
}
.table-page .sec {
  flex: none;
}
#deal-telemetry {
  grid-template-columns: 2fr 1.4fr 1fr;
}
.stage-segments,
.closing-strip,
.matrix {
  display: flex;
  gap: 2px;
}
.stage-segments button {
  min-width: 0;
  flex: var(--weight) 1 auto;
  font: 10px var(--font-mono);
  padding: 2px 4px;
  border: 0;
  border-bottom: 4px solid var(--blue);
  height: 23px;
  white-space: nowrap;
}
.stage-segments button[data-level="1"] {
  border-color: var(--map-2);
}
.stage-segments button[data-level="2"] {
  border-color: var(--line-strong);
}
.stage-segments button[data-level="3"] {
  border-color: var(--ink);
}
.stage-segments button[aria-pressed="true"] {
  background: var(--selected);
}
.closing-strip span,
.matrix span {
  font: 10px var(--font-mono);
  padding: 2px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
}
.closing-strip span {
  flex: 1;
  min-width: 0;
}
.closing-strip .filled,
.matrix .ready {
  background: var(--blue-tint);
  color: var(--blue);
  border-color: var(--blue-border);
}
.matrix span {
  width: 17px;
}
.grid td[data-field="name"] {
  position: relative;
  padding-right: 30px;
}
.link-count {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font: 10px var(--font-mono);
  color: var(--muted);
}
.grid th[data-field="name"] {
  width: 240px;
}
.grid th[data-field="status"] {
  width: 115px;
}
.grid th[data-field="State"] {
  width: 65px;
}
.grid th[data-field="Readiness"] {
  width: 100px;
}
.grid th[data-field="Deadline"] {
  width: 132px;
}
.grid td[tabindex]:hover {
  background: var(--blue-tint);
}
.table-page .empty:empty {
  display: none;
}
.detail-page .grid td {
  height: auto;
  min-height: var(--row-h);
}
.grid .icon,
.switch .icon {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
@media (max-width: 720px) {
  #deal-telemetry {
    grid-template-columns: 1fr 1fr;
  }
  #deal-telemetry .t-cell:first-child {
    grid-column: 1/-1;
  }
  .table-page > .toolbar {
    gap: 3px;
  }
  .rebid,
  .table-scroll {
    max-width: 100%;
    overflow: auto;
  }
  .rail-nav {
    max-width: 100%;
  }
  .onboarding {
    align-items: flex-start;
  }
}

.agency-list {
  list-style: none;
  padding: 0;
}
.agency-list > li {
  border-top: 1px solid var(--line);
  padding: 6px 0;
}
.agency-line,
.agency-values {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}
.agency-values {
  justify-content: flex-start;
}
.agency-values dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.scope,
.basis-note {
  color: var(--muted);
}
#agent-connection .grid {
  min-width: 300px;
}
.grid details[open] {
  white-space: normal;
}
.grid details[open] blockquote {
  white-space: pre-wrap;
}
.requirement small {
  display: block;
  color: var(--muted);
}
.switch svg {
  margin-right: 3px;
}
.table-page .grid td[data-field="State"],
.table-page .grid td[data-field="Follow up"],
.table-page .grid td[data-field="Observed"] {
  font-family: var(--font-mono);
}

.board {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(175px, 1fr);
}
.grid td[data-field="status"] {
  font-family: var(--font-mono);
}

#detail::backdrop,
#research-inspector::backdrop {
  background: transparent;
}
