/* Console (ops.pronto.internal) — The Slash, ops dialect. Chunk UI-1.
   Ported from the signed-off mock (pronto-website/console/styles/tokens.css):
   ink chrome frames a chalk work surface, facts are always mono, state is a
   shape as well as a colour, and everything you can "pick up" casts a hard
   shadow. Tokens come from tokens.css; this file adds the console-only rail
   colours and the component layer, and maps the console's existing `cs-*`
   markup onto that language so no screen's structure — and no test that
   asserts on it — had to move. */
:root {
  --rail: #292927;
  --rail-hi: #33332f;
  --rail-line: #3d3d39;
  --rail-dim: #8f8f8a;
  --rail-w: 200px;
}
body.console {
  margin: 0;
  background: var(--chalk);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}
body.console .mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ================= SHELL ================= */
.cs-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.cs-nav {
  display: none;
}
.cs-rail-logo {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  text-decoration: none;
  padding: 1.05rem 1rem 0.9rem;
  border-bottom: 1.5px solid var(--rail-line);
}
.cs-tag {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.5rem;
  letter-spacing: 0.2em;
  background: var(--lime);
  color: var(--ink);
  padding: 0.3em 0.45em 0.24em;
}
.cs-nav ul {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  flex: 1;
}
.cs-nav li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a9a9a3;
  text-decoration: none;
  padding: 0.66rem 1rem;
  border-left: 3px solid transparent;
}
.cs-nav li a:hover {
  background: var(--rail-hi);
  color: var(--chalk);
}
/* an item that reaches no screen yet — present on the map, dimmed */
.cs-nav li a[href="#"] {
  color: #5c5c57;
}
.cs-nav li.on a {
  color: var(--lime);
  border-left-color: var(--lime);
  background: var(--rail-hi);
  font-weight: 700;
}
.cs-foot {
  border-top: 1.5px solid var(--rail-line);
  padding: 0.85rem 1rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  line-height: 1.75;
  color: var(--rail-dim);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.cs-foot b {
  color: var(--chalk);
  font-weight: 700;
}
.cs-role {
  align-self: flex-start;
  background: var(--rail-line);
  color: var(--lime);
  padding: 0.18em 0.5em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.2rem;
}
.cs-role--none {
  color: var(--rail-dim);
}

/* --- the work column: a slim ink bar, then the chalk body --- */
.cs-workcol {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.cs-topbar {
  background: var(--ink);
  color: var(--chalk);
  border-bottom: 2px solid var(--ink);
  padding: 0.6rem 0.9rem;
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.cs-topbar .cs-rail-logo {
  padding: 0;
  border: 0;
}
.cs-topbar .cs-tag {
  font-size: 0.44rem;
  padding: 0.28em 0.4em 0.22em;
}
.cs-crumb {
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--rail-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.cs-crumb b {
  color: var(--chalk);
}
.cs-topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.cs-sys {
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1.5px solid var(--rail-line);
  color: var(--chalk);
  padding: 0.32em 0.5em;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  white-space: nowrap;
}
.cs-sys i {
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--lime);
  flex: none;
}
.cs-work {
  flex: 1;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-width: 0;
  padding-bottom: calc(64px + 0.9rem);
}

/* --- tab bar: the pocket's navigation --- */
.cs-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  background: var(--ink);
  border-top: 2px solid var(--rail-line);
}
.cs-tabbar a {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: var(--rail-dim);
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.85rem 0.2rem;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 3px solid transparent;
}
.cs-tabbar a[aria-current] {
  color: var(--lime);
  font-weight: 700;
  border-top-color: var(--lime);
  background: var(--rail-hi);
}

/* ================= PAGE TITLE ROW ================= */
/* Each screen's own heading, styled as the mock's title bar: the semicond
   title with its mono subtitle, and any right-hand fact pushed to the end. */
.cs-top {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid var(--ink);
}
.cs-h {
  margin: 0;
  font-variation-settings:
    "wdth" 75,
    "wght" 700;
  font-weight: 700;
  font-stretch: 75%;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 1.15rem;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  flex-wrap: wrap;
  min-width: 0;
}
.cs-h small {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.56rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-60);
}
.cs-money {
  margin-left: auto;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--lime);
  color: var(--ink);
  padding: 0.3em 0.55em;
}

/* ================= PANELS (cs-panel, cs-col, cs-strip) ================= */
.cs-panel,
.cs-col,
.cs-strip,
.cs-stat {
  border: 2px solid var(--ink);
  background: var(--white);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.cs-panel {
  margin-bottom: 0;
}
.cs-cap {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--ink-12);
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: baseline;
  flex-wrap: wrap;
}
.cs-cap .t {
  color: var(--ink-60);
  margin-left: auto;
}
.cs-cap .n {
  font-weight: 700;
  background: var(--ink);
  color: var(--lime);
  padding: 0.12em 0.5em;
  min-width: 1.8em;
  text-align: center;
}
.cs-panel-body,
.cs-col-body,
.cs-strip-body {
  padding: 0.75rem;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.cs-strip {
  background: var(--lime-tint);
}
.cs-strip-body {
  flex-direction: row;
  flex-wrap: wrap;
}
.cs-panel--alarm {
  border-color: var(--red);
}
.cs-panel--alarm > .cs-cap {
  color: var(--red);
  border-bottom-color: var(--red-tint);
}
.cs-panel--ok {
  border-color: var(--lime-deep);
  background: var(--lime-tint);
}
.cs-panel--ok > .cs-cap {
  color: var(--lime-deep);
}
/* what the mock draws and the system does not have yet: dashed, quiet */
.cs-panel--absent,
.cs-col--absent {
  border: 2px dashed var(--ink-30);
  background: transparent;
  box-shadow: none !important;
}
.cs-panel--absent > .cs-cap,
.cs-col--absent > .cs-cap {
  color: var(--ink-60);
  border-bottom-color: transparent;
}
.cs-absent {
  margin: 0;
  padding: 0.5rem 0.75rem 0.7rem;
  font-size: 0.7rem;
  line-height: 1.65;
  color: var(--ink-60);
}
.cs-panel--absent .cs-absent + .cs-absent {
  border-top: 1.5px solid var(--ink-12);
}
.cs-note {
  margin: 0;
  padding: 0 0.75rem 0.7rem;
  font-family: var(--disp);
  font-size: 0.7rem;
  color: var(--ink-60);
  line-height: 1.65;
}
.cs-none {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-60);
  border: 2px dashed var(--ink-30);
  padding: 0.9rem;
  text-align: center;
}

/* ================= LINES (the order screen's facts) ================= */
.cs-line {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.82rem;
  padding: 0.35rem 0;
  border-bottom: 1.5px solid var(--ink-12);
}
.cs-line:last-child {
  border-bottom: none;
}
.cs-line b {
  font-variation-settings:
    "wdth" 75,
    "wght" 700;
  font-weight: 700;
  font-stretch: 75%;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.cs-line--alarm b {
  color: var(--red);
}
.cs-meta {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-60);
  line-height: 1.7;
}
.cs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.cs-list li {
  border: 2px solid var(--ink);
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.82rem;
}
.cs-list li b {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.74rem;
}

/* ================= BOARD (queue) ================= */
.cs-board {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.cs-card {
  border: 2px solid var(--ink);
  background: var(--white);
  padding: 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.cs-card--exception {
  flex: 1 1 14rem;
}
.cs-code {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

/* ================= STATS (deck) ================= */
.cs-stats {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cs-stat {
  padding: 0.65rem 0.75rem 0.6rem;
  gap: 0.1rem;
}
.cs-stat-k {
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-60);
}
.cs-stat-v {
  font-variation-settings:
    "wdth" 62,
    "wght" 800;
  font-weight: 800;
  font-stretch: 62%;
  font-size: 2rem;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

/* ================= FORMS & BUTTONS ================= */
.cs-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-width: 24rem;
}
.cs-form label,
.cs-panel-body label {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-60);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.cs-btn,
body.console button[type="submit"]:not(.btn) {
  border: none;
  cursor: pointer;
  font-family: var(--disp);
  font-variation-settings:
    "wdth" 75,
    "wght" 800;
  font-weight: 800;
  font-stretch: 75%;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
  padding: 0.7em 1.2em;
  min-height: 42px;
  background: var(--ink);
  color: var(--lime);
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%,
    0 100%
  );
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
}
.cs-btn:active,
body.console button[type="submit"]:not(.btn):active {
  transform: translateY(1px);
}
body.console input[type="text"]:not(.input),
body.console input[type="tel"]:not(.input),
body.console input[type="number"]:not(.input) {
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 0.6em 0.7em;
  min-height: 44px;
  border: 2px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  width: 100%;
  max-width: 24rem;
  letter-spacing: 0.04em;
}
.err {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--red);
  margin: 0;
}

/* ================= TABLE (the API contract) ================= */
.cs-ep {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.cs-ep th {
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-60);
  text-align: left;
  font-weight: 400;
  padding: 0.45rem 0.7rem;
  border-bottom: 2px solid var(--ink);
  white-space: nowrap;
}
.cs-ep td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1.5px solid var(--ink-12);
  vertical-align: top;
}
.cs-ep tr:last-child td {
  border-bottom: none;
}
.cs-ep-m {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  white-space: nowrap;
  color: var(--ink);
}
.cs-ep-sum {
  display: block;
  color: var(--ink-60);
  margin-top: 0.15rem;
  font-size: 0.74rem;
}
.cs-ep-a,
.cs-ep-c {
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: var(--ink-60);
}

/* ================= QC PAGES ================= */
.cs-pages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 0.55rem;
  padding: 0.75rem;
}
.cs-pg {
  border: 2px solid var(--ink);
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0;
  font-size: 0.6rem;
}
.cs-pg--colour {
  box-shadow: inset 0 0 0 2px var(--lime);
}
.cs-pg-thumb {
  width: 100%;
  aspect-ratio: 1 / 1.414;
  object-fit: cover;
  background: var(--ink-12);
}
.cs-pg-nothumb {
  margin: 0;
  aspect-ratio: 1 / 1.414;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--ink-12);
  color: var(--ink-60);
  padding: 0.3rem;
}
.cs-pg-no {
  font-family: var(--mono);
  font-weight: 700;
  padding: 0.28rem 0.38rem 0;
}
.cs-pg-why,
.cs-pg-file {
  font-family: var(--mono);
  font-size: 0.52rem;
  color: var(--ink-60);
  letter-spacing: 0.06em;
  padding: 0 0.38rem 0.3rem;
  overflow-wrap: anywhere;
}
.cs-ck {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.cs-ck li {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  font-size: 0.8rem;
  border-bottom: 1.5px solid var(--ink-12);
  padding: 0.4rem 0;
}
.cs-ck li::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--lime-deep);
  flex: none;
  transform: translateY(0.05em);
}

/* ================= CONFIG ================= */
.cs-blank {
  margin: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.7rem;
  line-height: 1.7;
  color: var(--ink-60);
  border-top: 1.5px solid var(--ink-12);
}
.cs-blank b {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
}

/* ==================================================================
   THE DESK — 900px and up. The rail appears, the tab bar goes away, and
   the board and the stats open out.
   ================================================================== */
@media (min-width: 900px) {
  .cs-shell {
    display: grid;
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
  }
  .cs-nav {
    display: flex;
    flex-direction: column;
    background: var(--rail);
    color: var(--chalk);
    border-right: 2px solid var(--ink);
    position: sticky;
    top: 0;
    height: 100dvh;
  }
  .cs-tabbar {
    display: none;
  }
  .cs-topbar .cs-rail-logo {
    display: none;
  }
  .cs-topbar {
    padding: 0.7rem 1.2rem;
  }
  .cs-work {
    padding: 1.1rem 1.2rem 1.6rem;
    gap: 1rem;
  }
  .cs-board {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .cs-stats {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
  .cs-panel,
  .cs-col,
  .cs-strip,
  .cs-stat,
  .cs-card {
    box-shadow: 4px 4px 0 var(--ink);
  }
  .cs-card {
    box-shadow: 3px 3px 0 var(--ink);
  }
}
@media (min-width: 1280px) {
  :root {
    --rail-w: 214px;
  }
  .cs-work {
    padding: 1.3rem 1.6rem 2rem;
  }
}
