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

/*
 * Command (command.js): a campaign's distance from its date, what the plan
 * asks for now, its gates, its record and its rules. A status colour appears
 * only where a line is a verdict: late is red, due today is orange, and
 * everything else is trim.
 */

.command-head { display: flex; gap: 22px; align-items: flex-start; margin-bottom: 18px; flex-wrap: wrap; }
.command-count { display: flex; gap: 12px; align-items: center; min-width: 190px; }
.command-figure {
  font-family: var(--font-mono);
  font-size: 54px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--shell-fg-bright);
}
.command-count.is-near .command-figure { color: var(--color-yellow); }
.command-count.is-past .command-figure { color: var(--shell-fg-dim); }
.command-count-words { color: var(--shell-fg-dim); line-height: 1.45; }
.command-title { flex: 1; min-width: 280px; }
.command-title h2 { margin: 0 0 6px; }
.command-title h2 small { font-weight: 400; color: var(--shell-fg-dim); }
.command-call { margin: 0 0 6px; color: var(--shell-fg-bright); line-height: 1.55; }

.command-card { margin-bottom: 0; min-width: 0; }
.command-card .console-card-head { margin-bottom: 10px; justify-content: space-between; }
.command-now { margin-bottom: 16px; }
.command-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.command-line { margin: 0 0 10px; line-height: 1.6; }
.command-summary { display: block; text-decoration: none; color: inherit; }

.command-verdict { margin: 0 0 12px; font-size: var(--fs-3); line-height: 1.5; color: var(--shell-fg-bright); }
.command-verdict.is-behind { color: var(--color-red); }
.command-verdict.is-due { color: var(--color-orange); }

/* ── What the plan asks for now ── */

.command-push { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.command-item { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 12px; padding-top: 12px; border-top: 1px solid var(--shell-line); }
@media (max-width: 640px) { .command-item { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
.command-when {
  font-family: var(--font-mono);
  font-size: var(--fs-1);
  font-variant-numeric: tabular-nums;
  color: var(--shell-fg-dim);
}
.command-item.is-late .command-when { color: var(--color-red); }
.command-item.is-today .command-when { color: var(--color-orange); }
.command-label { margin: 0 0 4px; line-height: 1.5; }
.command-what .console-note, .command-what .console-faint { margin: 0 0 6px; }
.command-guide { font-family: var(--font-mono); font-size: var(--fs-0); }
.command-controls { margin-top: 6px; }
.command-controls .console-row { gap: 8px; flex-wrap: wrap; }
.command-reason { flex: 1; min-width: 180px; max-width: 420px; }
.command-mark { margin: 0 0 6px; }
.command-slot:empty { display: none; }

/* ── Lists: the gates, the rules, the tiers, the guide ── */

.command-list { margin: 0 0 10px; padding: 0; list-style: none; display: grid; gap: 9px; line-height: 1.5; }
.command-list .console-faint { margin: 2px 0 0; }

/* ── The record ── */

.command-rhythm { margin-bottom: 8px; }
.command-rhythm th {
  text-align: left;
  font-family: inherit;
  font-size: var(--fs-2);
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--shell-fg-bright);
  padding: 7px 8px 7px 0;
  vertical-align: top;
}
.command-rhythm td { padding: 7px 0; vertical-align: top; }
.command-dots { display: flex; flex-wrap: wrap; gap: 4px; max-width: 232px; }
.command-dot {
  width: 12px;
  height: 12px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--shell-fg-dim);
  background: transparent;
  cursor: pointer;
}
.command-dot:hover, .command-dot:focus-visible { outline: 1px solid var(--trim-bright); outline-offset: 2px; }
.command-dot.is-kept { background: var(--trim-bright); border-color: var(--trim-bright); }
.command-dot.is-skipped { background: transparent; border-color: var(--color-orange); border-style: dashed; }
.command-dot.is-missed { background: var(--color-red); border-color: var(--color-red); }
.command-dot.is-late { border-color: var(--color-red); }
.command-dot.is-today { border-color: var(--color-orange); }
.command-streak { white-space: nowrap; text-align: right; color: var(--shell-fg-dim); font-size: var(--fs-1); padding-left: 8px; }
.command-editor:empty { display: none; }
.command-editor { margin: 4px 0 10px; padding: 10px 12px; border: 1px solid var(--shell-line); border-radius: 6px; }

/* ── The calendar ── */

.command-calendar { margin: 0 0 10px; padding: 0; list-style: none; display: grid; gap: 7px; }
.command-calendar li { display: grid; grid-template-columns: 4.6em minmax(0, 1fr) auto; gap: 10px; line-height: 1.45; }
.command-calendar .command-state { font-family: var(--font-mono); font-size: var(--fs-1); color: var(--shell-fg-dim); white-space: nowrap; }
.command-calendar .is-late .command-state, .command-calendar .is-late .command-when { color: var(--color-red); }
.command-calendar .is-today .command-state, .command-calendar .is-today .command-when { color: var(--color-orange); }
.command-calendar .is-done, .command-calendar .is-skipped, .command-calendar .is-marker { color: var(--shell-fg-dim); }
.command-calendar .is-done .command-open { text-decoration: line-through; }
.command-open { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.command-open:hover, .command-open:focus-visible { color: var(--shell-fg-bright); text-decoration: underline; outline: none; }

/* ── The menu's count of what is late or due ── */

.console-item-count {
  margin-left: auto;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: var(--fs-0);
  line-height: 18px;
  text-align: center;
  color: var(--bg-dark);
  background: var(--color-orange);
}
.console-item-count.is-down { background: var(--color-red); }
