/* Noko, TR-100 layout: the modern page (app.css, linked
   before this) with its status printed as a TR-100 Machine Report, after
   U.S. Graphics Company's usgc-machine-report (BSD 3-Clause, © 2024 U.S.
   Graphics, LLC): monospace, capitals, box lines, no colours. The box is
   drawn with borders, not box-drawing characters, so it fits any width.
   Dark (a terminal) here; tr100-light.css (paper) is linked after it. */

:root {
  --font-body: var(--font-mono);
  --bg: #0c0c0c;
  --surface: transparent;
  --surface-raised: transparent;
  --code: #141414;
  --line: #3a3a3a;
  --ink: #e6e6e6;
  --text: #e6e6e6;
  --heading: #ffffff;
  --muted: #9a9a9a;
  --accent: #ffffff;
  --accent-hover: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.12);
  --on-accent: #0c0c0c;
  --good: #e6e6e6;
  --warn: #e6e6e6;
  --bad: #e6e6e6;
  --key: #ffffff;
  --str: #c8c8c8;
  --num: #c8c8c8;
  --punct: #7a7a7a;
  --radius: 0;
  --shadow: none;
  --glow-1: transparent;
  --glow-2: transparent;
  --hover-line: #e6e6e6;
  --bar-empty: #4a4a4a;
  --spark-empty: var(--bar-empty);
  --primary-bg: transparent;
  --primary-line: var(--ink);
  --primary-text: var(--ink);
  --primary-hover-bg: var(--ink);
  --primary-hover-line: var(--ink);
  --primary-hover-text: var(--bg);
}

body {
  font-size: 14px;
}

a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── The report ───────────────────────────────────────────────────────── */

.report {
  position: relative;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ┌┬┬┬┬┐ / ├┴┴┴┴┤: a row of ticks across the top. */
.report__ticks {
  height: 0.7em;
  border-bottom: 1px solid var(--ink);
  background-image: repeating-linear-gradient(to right, var(--ink) 0 1px, transparent 1px 1ch);
}

.report__head {
  position: relative;
  padding: 0.6em 3.5em;
  text-align: center;
  border-bottom: 1px solid var(--ink);
}

.report__title {
  margin: 0;
  font: inherit;
  font-weight: 400;
  letter-spacing: 0.04em;
}

/* The colours: a half-filled circle icon with the native select laid over
   it, invisible, so a click opens the system's own list and keyboards and
   screen readers get a select. */
.report__scheme {
  position: absolute;
  top: 50%;
  right: 0.5em;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--ink);
  border: 1px solid transparent;
}

.report__scheme[hidden] {
  display: none;
}

.report__scheme:hover {
  border-color: var(--line);
}

/* The select itself is invisible, so its focus shows on the icon, in the
   same ring as the page's other controls. */
.report__scheme:has(:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.report__scheme-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  font-size: 16px;
  opacity: 0;
  cursor: pointer;
}

.report__table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* ├──┼──┤ between groups; the column line is the label's right border. */
.report__group + .report__group {
  border-top: 1px solid var(--ink);
}

.report__label {
  width: 17ch; /* with padding and border: "REPRESENTATIVE" whole */
  padding: 0.15em 1ch;
  border-right: 1px solid var(--ink);
  font-weight: 600;
  letter-spacing: 0.2px;
  text-align: left;
  vertical-align: top;
  /* "LOAD  1m" keeps its two spaces, as printed; wraps rather than clips
     when a reader widens the letter spacing (WCAG 1.4.12). */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.report__group > tr:first-child > * {
  padding-top: 0.45em;
}

.report__group > tr:last-child > * {
  padding-bottom: 0.45em;
}

.report__value {
  padding: 0.15em 1ch;
  overflow-wrap: anywhere;
}

.report__value--address {
  word-break: break-all;
}

/* The state, as printed: capitals; a warning gets the report's one sign,
   a fault is shown inverted. */
.status__state {
  display: inline;
  font: inherit;
  text-transform: uppercase;
}

.status__state::before {
  content: none;
}

.status__state--warn::before {
  content: "⚠ ";
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
}

.status__state--bad {
  padding: 0 0.5ch;
  color: var(--bg);
  background: var(--ink);
}

/* ████░░░░ bars: a meter, filled solid, the rest shaded. */
.report__bar {
  display: flex;
  flex-wrap: wrap; /* a narrow phone puts the figures under the bar */
  align-items: center;
  gap: 0.2em 1ch;
}

.report__meter {
  flex: 1 1 auto;
  min-width: 6ch;
  max-width: 24ch;
  height: 0.9em;
  -webkit-appearance: none;
  appearance: none;
  background: repeating-linear-gradient(to right, var(--bar-empty) 0 0.6ch, transparent 0.6ch 0.75ch);
  border: 0;
  border-radius: 0;
}

.report__meter::-webkit-meter-bar {
  height: 0.9em;
  background: none;
  border: 0;
  border-radius: 0;
}

.report__meter::-webkit-meter-optimum-value,
.report__meter::-webkit-meter-suboptimum-value,
.report__meter::-webkit-meter-even-less-good-value {
  background: var(--ink);
  border-radius: 0;
}

.report__meter::-moz-meter-bar {
  background: var(--ink);
  border-radius: 0;
}

.report__copy {
  margin-left: 0.5ch;
  padding: 0 0.75ch;
  font: inherit;
  color: var(--ink);
  background: none;
  border: 1px solid var(--ink);
  cursor: pointer;
}

.report__copy:hover {
  color: var(--bg);
  background: var(--ink);
}

/* Notices below the box: the report's warning sign. */
.notice::before {
  content: "⚠ ";
}

@media (max-width: 480px) {
  body {
    font-size: 13px;
  }
}
