/* tokens.css and console.css are linked before this file (console/index.html). */

/*
 * The Instruments section (instruments.js): the flight summary's cards, the
 * list of documents, and a document set for reading. Like the shell around
 * it, everything here is trim: a status colour appears only where a reading
 * is a verdict (a stale front page, a deadline close or past, a breach).
 */

/* ── The flight summary ── */

.instruments-flight {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.instruments-card { margin-bottom: 0; min-width: 0; }
.instruments-card .console-card-head { margin-bottom: 10px; }
.instruments-source { font-family: var(--font-mono); font-size: var(--fs-0); }
.instruments-line { margin: 0 0 10px; line-height: 1.6; }
.instruments-lead { margin: 0 0 10px; color: var(--shell-fg-bright); line-height: 1.55; }
.instruments-card .md-list { margin: 0 0 10px; }
.instruments-card .console-note:last-child, .instruments-card .console-faint:last-child { margin-bottom: 0; }

.instruments-deadlines { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.instruments-deadlines li { display: grid; grid-template-columns: 9.5em 1fr; gap: 10px; line-height: 1.5; }
.instruments-when {
  font-family: var(--font-mono);
  font-size: var(--fs-1);
  font-variant-numeric: tabular-nums;
  color: var(--shell-fg-dim);
}
.instruments-deadlines .is-near .instruments-when { color: var(--color-yellow); }
.instruments-deadlines .is-past .instruments-when { color: var(--color-red); }

.instruments-stages { margin-bottom: 10px; table-layout: fixed; }
.instruments-stages th { padding: 6px 4px; font-size: 9px; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; }
.instruments-stages td { padding: 8px 4px; }
.instruments-stages td { font-family: var(--font-mono); font-size: var(--fs-4); font-variant-numeric: tabular-nums; color: var(--shell-fg-bright); }

/* ── The list of documents, and the one being read ── */

.instruments-columns { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 26px; align-items: start; }
@media (max-width: 900px) { .instruments-columns { grid-template-columns: minmax(0, 1fr); } }

.instruments-tree {
  position: sticky;
  top: 0;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 2px 0 12px;
  border-right: 1px solid var(--shell-line);
}
@media (max-width: 900px) { .instruments-tree { position: static; max-height: 260px; border-right: 0; border-bottom: 1px solid var(--shell-line); } }
.instruments-tree ul { margin: 0; padding: 0; list-style: none; }
.instruments-tree .signal-nav-label { padding-left: 8px; }
.instruments-item {
  display: block;
  padding: 5px 10px 5px 8px;
  border-radius: var(--r-1);
  color: var(--shell-fg);
  font-size: var(--fs-1);
  line-height: 1.4;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.instruments-item:hover, .instruments-item:focus-visible { background: var(--shell-raised); color: var(--shell-fg-bright); outline: none; }
.instruments-item.is-active { background: var(--shell-raised-2); color: var(--shell-fg-bright); }

.instruments-main { min-width: 0; }
.instruments-doc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--shell-line);
  font-size: var(--fs-1);
}
.instruments-path { flex: 1; font-family: var(--font-mono); color: var(--shell-fg-dim); overflow-wrap: anywhere; }

/* ── A document, set for reading (markdown.js) ── */

.md { max-width: 92ch; font-size: var(--fs-3); line-height: 1.65; color: var(--shell-fg); overflow-wrap: break-word; }
.md > :first-child { margin-top: 0; }
.md-h { margin: 1.6em 0 .55em; color: var(--shell-fg-bright); font-weight: 600; line-height: 1.3; scroll-margin-top: 16px; }
.md-h1 { font-size: var(--fs-6); margin-top: 0; }
.md-h2 { font-size: var(--fs-5); padding-bottom: 6px; border-bottom: 1px solid var(--shell-line); }
.md-h3 { font-size: var(--fs-4); }
.md-h4, .md-h5, .md-h6 { font-size: var(--fs-3); }
.md-p { margin: 0 0 1em; }
.md strong { color: var(--shell-fg-bright); font-weight: 600; }
.md-list { margin: 0 0 1em; padding-left: 1.5em; }
.md-list li { margin: .25em 0; }
.md-list li > .md-list { margin: .25em 0; }
.md-list li > .md-p { margin: 0 0 .5em; }
.md-rule { margin: 1.6em 0; border: 0; border-top: 1px solid var(--shell-line); }
.md-quote { margin: 0 0 1em; padding: 2px 0 2px 14px; border-left: 3px solid var(--shell-line-strong); color: var(--shell-fg-dim); }
.md-quote > :last-child { margin-bottom: 0; }
.md-code {
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: .88em;
  color: var(--shell-fg-bright);
  background: var(--shell-raised-2);
  border-radius: var(--r-1);
  overflow-wrap: anywhere;
}
.md-shortcode { color: var(--shell-fg-dim); border: 1px dashed var(--shell-line-strong); background: transparent; }
.md-pre { user-select: text; white-space: pre; }
.md-pre code { font: inherit; }
.md-table-wrap { margin: 0 0 1em; overflow-x: auto; }
.md-table { font-size: var(--fs-2); line-height: 1.5; }
.md-table th { white-space: nowrap; }
.md-table td { vertical-align: top; }
.md-table .is-right { text-align: right; }
.md-table .is-center { text-align: center; }
.md-image { font-family: var(--font-mono); font-size: var(--fs-1); }

.md-front {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 14px;
  margin: 0 0 1.4em;
  padding: 12px 14px;
  font-size: var(--fs-1);
  background: var(--shell-raised);
  border: 1px solid var(--shell-line);
  border-radius: var(--r-2);
}
.md-front dt { font-family: var(--font-mono); color: var(--shell-fg-faint); }
.md-front dd { margin: 0; overflow-wrap: anywhere; }
.md-front-value { margin: 0; font-family: var(--font-mono); font-size: var(--fs-1); white-space: pre-wrap; }
