/* Hallmark · v2.0.0 · custom direction, pinned by the project surface brief · genre editorial · posture: restrained · surface: absolute · nav: wordmark left, six sheet links right · footer: title block carrying the boundary sentence · hero: copy on columns 1 to 5, the trip plot on 6 to 12 */
/* Hallmark · pre-emit critique: P4 H4 E4 S5 R4 V4 · weakest: H, below the hero the pages are one sheet after another; kept because ledgers want sameness, and the one bold move is the plot */
/* Hallmark · answered F4 · the second action is outlined on paper, not filled; only one button on the screen is solid ink */
/* Hallmark · answered F15 · two gaps on purpose: 32px between working columns, 48px where the hero and the footer split copy from data */
/* Hallmark · dismissed 58 · ledger, workbench and calculator pages are read and operated, not skimmed; their tables carry the words */

@font-face {
  font-family: "Public Sans";
  src: url("/assets/fonts/public-sans-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Red Hat Mono";
  src: url("/assets/fonts/red-hat-mono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Red Hat Mono";
  src: url("/assets/fonts/red-hat-mono-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f5f8f4;
  --paper-raised: #fbfcfa;
  --paper-sunk: #eaf0ea;
  --grid: #2f8a58;
  --grid-fine: color-mix(in oklab, var(--grid) 13%, transparent);
  --grid-bold: color-mix(in oklab, var(--grid) 30%, transparent);
  --ink: #13201a;
  --ink-2: #36443d;
  --ink-3: #55635c;
  --rule: color-mix(in oklab, var(--ink) 26%, transparent);
  --rule-soft: color-mix(in oklab, var(--ink) 12%, transparent);
  --trip: #b92d1a;
  --trip-wash: color-mix(in oklab, var(--trip) 8%, var(--paper-raised));
  --hold: #7d5400;
  --hold-wash: color-mix(in oklab, var(--hold) 9%, var(--paper-raised));
  --pass: #1b663f;
  --pass-wash: color-mix(in oklab, var(--pass) 9%, var(--paper-raised));
  --select: color-mix(in oklab, var(--grid) 28%, var(--paper));

  --font-ui: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --font-data: "Red Hat Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-md: 1.25rem;
  --text-lg: 1.625rem;
  --text-xl: 2.75rem;
  --text-2xl: 4.125rem;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;
  --space-9: 128px;
  --space-10: 152px;
  --space-11: 176px;

  --radius-container: 10px;
  --radius: 6px;
  --radius-inner: 4px;
  --container: 1440px;
  --measure: 68ch;
  --ease-out: cubic-bezier(0.24, 1, 0.4, 1);
  --ease-exit: cubic-bezier(0.3, 0, 0.6, 0.6);
  --dur-quick: 130ms;
  --dur-state: 230ms;
  --dur-reveal: 410ms;
  --dur-plot: 1100ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--space-8);
}

body {
  margin: 0;
  overflow-x: clip;
  background-color: var(--paper);
  background-image: url("/assets/img/grid.svg");
  background-size: 320px 320px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.55;
  font-feature-settings: "tnum" 0;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--select);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: var(--radius-inner);
}

a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--rule);
  transition: text-decoration-color var(--dur-quick) var(--ease-out), text-underline-offset var(--dur-quick) var(--ease-out);
}
a:hover {
  text-decoration-color: var(--ink);
  text-underline-offset: 0.3em;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-ui);
  margin: 0;
  overflow-wrap: break-word;
  min-width: 0;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.5rem, 1.4rem + 4.4vw, var(--text-2xl));
  line-height: 1.02;
  letter-spacing: -0.032em;
  font-weight: 720;
}
h2 {
  font-size: clamp(1.9rem, 1.3rem + 2vw, var(--text-xl));
  line-height: 1.08;
  letter-spacing: -0.024em;
  font-weight: 680;
}
h3 {
  font-size: var(--text-lg);
  line-height: 1.2;
  letter-spacing: -0.012em;
  font-weight: 640;
}
h4 {
  font-size: var(--text-md);
  line-height: 1.3;
  font-weight: 620;
}
p {
  margin: 0;
  max-width: var(--measure);
}
p + p {
  margin-top: var(--space-4);
}
code,
kbd,
samp,
pre,
.data {
  font-family: var(--font-data);
  font-size: 0.9em;
  font-variant-numeric: tabular-nums;
}
pre {
  margin: 0;
  padding: var(--space-4) var(--space-5);
  background: var(--paper-sunk);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: var(--text-sm);
  line-height: 1.6;
  white-space: pre;
  tab-size: 2;
}
.read {
  font-size: 1.125rem;
  line-height: 1.62;
}

.skip {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 20;
  padding: var(--space-2) var(--space-4);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
}
.skip:focus {
  top: var(--space-3);
}

.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(var(--space-4), 4vw, var(--space-8));
}

/* Header: a drawing-sheet index */
.masthead {
  background: var(--paper-raised);
  border-bottom: 1px solid var(--rule);
}
.masthead .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-6);
  min-height: 64px;
  padding-block: var(--space-3);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 760;
  font-size: var(--text-md);
  letter-spacing: 0.06em;
  text-decoration: none;
}
.wordmark svg {
  width: 30px;
  height: 30px;
  flex: none;
}
.sheets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}
.sheets a {
  display: inline-block;
  padding: var(--space-2) 0;
  font-size: 1rem;
  font-weight: 560;
  text-decoration: none;
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 2px;
  transition: background-size var(--dur-state) var(--ease-out);
}
.sheets a:hover,
.sheets a[aria-current="page"] {
  background-size: 100% 2px;
}

/* Sections */
main > section {
  padding-block: var(--space-9) 0;
}
main > section:nth-of-type(even) {
  padding-top: var(--space-10);
}
main > section:last-of-type {
  padding-bottom: var(--space-11);
}
.lede {
  font-size: var(--text-md);
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 52ch;
}
.section-head {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-7);
  max-width: 70ch;
}
.section-head p {
  color: var(--ink-2);
}
.note {
  font-size: var(--text-sm);
  color: var(--ink-3);
}

/* Sheet: an opaque label pasted on the grid */
.sheet {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-container);
  overflow: clip;
}
.sheet-pad {
  padding: clamp(var(--space-5), 3vw, var(--space-7));
}

/* Hero */
.hero {
  padding-block: clamp(var(--space-7), 7svh, var(--space-9)) 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 8fr);
  gap: clamp(var(--space-6), 4vw, var(--space-7));
  align-items: center;
}
.hero-copy {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-6);
  margin-left: calc(var(--space-6) * -1);
  background: var(--paper);
  border-radius: var(--radius);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-6);
  margin-top: var(--space-2);
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 46px;
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper-raised);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 620;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-quick) var(--ease-out), background-color var(--dur-quick) var(--ease-out), box-shadow var(--dur-quick) var(--ease-out);
  box-shadow: 0 2px 0 color-mix(in oklab, var(--ink) 35%, transparent);
}
.button:hover {
  background: var(--ink-2);
}
.button:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 transparent;
}
.button.quiet {
  background: var(--paper-raised);
  color: var(--ink);
  box-shadow: 0 2px 0 var(--rule-soft);
}
.button.quiet:hover {
  background: var(--paper-sunk);
}
.button[disabled] {
  background: var(--paper-sunk);
  color: var(--ink-3);
  border-color: var(--rule);
  box-shadow: none;
  cursor: not-allowed;
}

/* Plot */
.plot {
  margin: 0;
}
.plot svg {
  display: block;
  width: 100%;
  height: auto;
}
.plot figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2) var(--space-6);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--rule-soft);
  font-size: var(--text-sm);
  color: var(--ink-2);
}
.plot .minor {
  stroke: var(--grid-fine);
  stroke-width: 1;
}
.plot .major {
  stroke: var(--grid-bold);
  stroke-width: 1;
}
.plot .frame {
  fill: none;
  stroke: var(--rule);
}
.plot .curve {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.plot .ceiling {
  stroke: var(--ink-2);
  stroke-width: 1.4;
  stroke-dasharray: 7 5;
}
.plot .trip-ring {
  fill: var(--paper-raised);
  stroke: var(--trip);
  stroke-width: 2.4;
}
.plot .trip-drop {
  stroke: var(--trip);
  stroke-width: 1.4;
}
.plot .leader {
  stroke: var(--ink);
  stroke-width: 1;
}
.plot text {
  font-family: var(--font-data);
  font-size: 13px;
  fill: var(--ink-2);
}
.plot .axis-title {
  font-family: var(--font-ui);
  font-size: 14px;
}
.plot .label {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 620;
  fill: var(--ink);
}
.plot .label-trip {
  fill: var(--trip);
}
.plot .band-direct {
  fill: var(--grid);
}
.plot .band-bess {
  fill: color-mix(in oklab, var(--grid) 48%, var(--paper-raised));
}
.plot .band-grid {
  fill: color-mix(in oklab, var(--ink) 58%, var(--paper-raised));
}
.plot .band-gas {
  fill: var(--hold);
}
.plot .band-unserved {
  fill: var(--trip);
}
.plot .cursor {
  stroke: var(--ink);
  stroke-width: 1;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
  color: var(--ink-2);
}
.legend i {
  display: inline-block;
  width: 14px;
  height: 10px;
  margin-right: var(--space-2);
  border-radius: 1px;
}

.control-row {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--rule-soft);
  font-size: var(--text-sm);
}
input[type="range"] {
  width: 100%;
  min-width: 0;
  accent-color: var(--ink);
  height: 28px;
}

/* Title block: tabular facts */
.title-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin: var(--space-7) 0 0;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-container);
  overflow: clip;
}
.title-block > div {
  padding: var(--space-4) var(--space-5);
  border-right: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  margin: 0 -1px -1px 0;
}
.title-block dt {
  font-size: var(--text-sm);
  color: var(--ink-3);
}
.title-block dd {
  margin: var(--space-1) 0 0;
  font-size: var(--text-md);
  font-weight: 640;
  font-variant-numeric: tabular-nums;
}
.title-block .ghost dd {
  color: var(--ink-3);
}
.ghost {
  background-image: repeating-linear-gradient(135deg, transparent 0 7px, var(--rule-soft) 7px 8px);
}

/* Ledger tables */
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
caption {
  caption-side: top;
  text-align: left;
  padding: var(--space-4) var(--space-5);
  font-weight: 620;
  font-size: var(--text-base);
  border-bottom: 1px solid var(--rule);
}
th,
td {
  padding: var(--space-3) var(--space-5);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule-soft);
}
thead th {
  font-weight: 620;
  color: var(--ink-2);
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
tbody tr:last-child > * {
  border-bottom: 0;
}
tbody th {
  font-weight: 620;
}
td.num,
th.num {
  text-align: right;
  font-family: var(--font-data);
}
tr.is-ghost > * {
  color: var(--ink-3);
}

.tag {
  display: inline-block;
  padding: 2px var(--space-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-inner);
  font-size: var(--text-xs);
  font-weight: 620;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--paper-raised);
}
.tag.pass {
  color: var(--pass);
  border-color: color-mix(in oklab, var(--pass) 45%, transparent);
  background: var(--pass-wash);
}
.tag.hold {
  color: var(--hold);
  border-color: color-mix(in oklab, var(--hold) 45%, transparent);
  background: var(--hold-wash);
}
.tag.trip {
  color: var(--trip);
  border-color: color-mix(in oklab, var(--trip) 45%, transparent);
  background: var(--trip-wash);
}
.tag.ghosted {
  color: var(--ink-3);
  border-style: dashed;
}

/* Two-column prose and boundary lists */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: var(--space-6);
}
.plain-list {
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-3);
}
.plain-list li {
  padding-left: var(--space-5);
  position: relative;
  max-width: var(--measure);
}
.plain-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 12px;
  height: 1px;
  background: var(--ink);
}
.plain-list.not li::before {
  width: 10px;
  height: 10px;
  top: 0.42em;
  background: none;
  border: 1px dashed var(--ink-3);
  border-radius: 1px;
}
.rows {
  margin: 0;
  padding: 0;
  list-style: none;
}
.rows > li {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) minmax(0, auto);
  gap: var(--space-3) var(--space-6);
  align-items: baseline;
  padding: var(--space-5) clamp(var(--space-5), 3vw, var(--space-7));
  border-bottom: 1px solid var(--rule-soft);
}
.rows > li:last-child {
  border-bottom: 0;
}
.rows h3 {
  font-size: var(--text-md);
  letter-spacing: 0.04em;
}

/* Workbench */
.bench {
  display: grid;
  grid-template-columns: minmax(0, 27rem) minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}
.panel {
  display: grid;
  gap: var(--space-5);
}
fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
legend {
  padding: 0;
  margin-bottom: var(--space-3);
  font-weight: 640;
  font-size: var(--text-base);
}
.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  align-items: end;
  gap: var(--space-3) var(--space-4);
}
.field {
  display: grid;
  gap: var(--space-1);
  font-size: var(--text-sm);
  min-width: 0;
}
.field span {
  color: var(--ink-2);
}
.field small {
  font-size: var(--text-xs);
  color: var(--ink-3);
}
input[type="number"],
input[type="text"],
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink);
  font-family: var(--font-data);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  transition: border-color var(--dur-quick) var(--ease-out), background-color var(--dur-quick) var(--ease-out);
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--ink-3);
}
input[aria-invalid="true"] {
  border-color: var(--trip);
  background: var(--trip-wash);
}
textarea {
  min-height: 150px;
  line-height: 1.55;
  resize: vertical;
}
.checks {
  display: grid;
  gap: var(--space-2);
}
.step {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-4) clamp(var(--space-5), 3vw, var(--space-6));
  border-bottom: 1px solid var(--rule);
}
.step b {
  font-family: var(--font-data);
  font-weight: 500;
  color: var(--ink-3);
}
.verdict {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-5) clamp(var(--space-5), 3vw, var(--space-6));
  border-bottom: 1px solid var(--rule-soft);
}
.verdict[data-state="trip"] {
  background: var(--trip-wash);
}
.verdict[data-state="hold"] {
  background: var(--hold-wash);
}
.verdict strong {
  font-size: var(--text-lg);
  font-weight: 680;
  letter-spacing: -0.012em;
}
.swap {
  animation: swap var(--dur-state) var(--ease-out);
}
@keyframes swap {
  from {
    opacity: 0.25;
  }
  to {
    opacity: 1;
  }
}
.digest {
  font-family: var(--font-data);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}
.stack {
  display: grid;
  gap: var(--space-6);
}
.stack-tight {
  display: grid;
  gap: var(--space-4);
}
.tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-5) var(--space-6);
  padding: var(--space-6) clamp(var(--space-5), 3vw, var(--space-7));
  border-bottom: 1px solid var(--rule-soft);
}
.tool:last-child {
  border-bottom: 0;
}
.tool output {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--paper-sunk);
  border-radius: var(--radius);
  font-family: var(--font-data);
  font-size: var(--text-sm);
}
.tool output[data-state="trip"] {
  background: var(--trip-wash);
  color: var(--trip);
}
.scope {
  color: var(--ink-2);
  font-size: var(--text-sm);
}
.scope b {
  font-weight: 640;
  color: var(--ink);
}

/* Controls that answer an action: switch, segmented choice, copy, rolling value, step check */
.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 44px;
  font-size: var(--text-sm);
  cursor: pointer;
}
.switch input {
  appearance: none;
  flex: none;
  position: relative;
  width: 46px;
  height: 26px;
  margin: 0;
  border: 1px solid var(--ink-3);
  border-radius: 13px;
  background: var(--paper-sunk);
  cursor: pointer;
  transition: background-color var(--dur-reveal) var(--ease-out), border-color var(--dur-state) var(--ease-out);
}
.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--ink-3);
  transform-origin: left center;
  transition: transform 285ms var(--ease-out), background-color var(--dur-state) var(--ease-out);
}
.switch input:active::after {
  transform: scaleX(1.3);
}
.switch input:checked {
  background: var(--ink);
  border-color: var(--ink);
}
.switch input:checked::after {
  transform: translateX(20px);
  background: var(--paper-raised);
}
.switch input:checked:active::after {
  transform: translateX(15px) scaleX(1.3);
}

.copy {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 620;
  cursor: pointer;
  transition: background-color var(--dur-quick) var(--ease-out);
}
.copy:hover {
  background: var(--paper-sunk);
}
.copy[data-done] {
  color: var(--pass);
}
.snippet {
  position: relative;
}
.snippet .copy {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
}
.snippet pre {
  padding-right: 96px;
}

.roll {
  display: inline-block;
  animation: roll 260ms var(--ease-out);
}
@keyframes roll {
  from {
    transform: translateY(45%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.step svg {
  width: 20px;
  height: 20px;
  flex: none;
  align-self: center;
  margin-left: auto;
}
.step svg path {
  fill: none;
  stroke: var(--pass);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  transition: stroke-dashoffset 450ms cubic-bezier(0.65, 0, 0.35, 1);
}
.step[data-done] svg path {
  stroke-dashoffset: 0;
}

/* Spacing between stacked blocks inside a section */
[data-gap="4"] {
  margin-top: var(--space-4);
}
[data-gap="5"] {
  margin-top: var(--space-5);
}
[data-gap="6"] {
  margin-top: var(--space-6);
}
.title-block.flush {
  margin-top: 0;
}
.step-title {
  font-size: var(--text-lg);
  letter-spacing: -0.012em;
}
.ruled-top {
  border-top: 1px solid var(--rule-soft);
}
.sw-direct {
  background: var(--grid);
}
.sw-bess {
  background: color-mix(in oklab, var(--grid) 48%, var(--paper-raised));
}
.sw-grid {
  background: color-mix(in oklab, var(--ink) 58%, var(--paper-raised));
}
.sw-gas {
  background: var(--hold);
}
.sw-unserved {
  background: var(--trip);
}
[hidden] {
  display: none !important;
}

/* Grid children may shrink below their content, so a long command cannot widen the page */
.split > *,
.stack > *,
.stack-tight > *,
.bench > *,
.tool > *,
.hero-grid > * {
  min-width: 0;
}

/* Footer: the drawing title block */
.colophon {
  margin-top: var(--space-9);
  background: var(--paper-raised);
  border-top: 1px solid var(--rule);
}
.colophon .wrap {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--space-6) var(--space-7);
  padding-block: var(--space-7);
}
.colophon p {
  font-size: var(--text-sm);
  color: var(--ink-2);
  max-width: 72ch;
}
.colophon dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2) var(--space-6);
  margin: 0;
  font-size: var(--text-sm);
}
.colophon dt {
  color: var(--ink-3);
}
.colophon dd {
  margin: 0;
  font-family: var(--font-data);
}

@media (max-width: 1023px) {
  .hero-grid,
  .bench,
  .tool,
  .colophon .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-copy {
    margin-left: 0;
    padding: 0;
    background: none;
  }
  .rows > li {
    grid-template-columns: minmax(0, 1fr);
  }
  main > section,
  main > section:nth-of-type(even) {
    padding-top: var(--space-8);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .plot .curve.draw {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: plot var(--dur-plot) var(--ease-out) 150ms forwards;
  }
  .plot .after-plot {
    opacity: 0;
    animation: settle var(--dur-state) var(--ease-out) calc(var(--dur-plot) + 100ms) forwards;
  }
  .verdict[data-state="trip"] strong {
    animation: nudge 260ms var(--ease-out);
  }
}
@keyframes plot {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes settle {
  to {
    opacity: 1;
  }
}
@keyframes nudge {
  0% {
    transform: translateX(0);
  }
  30% {
    transform: translateX(-4px);
  }
  65% {
    transform: translateX(3px);
  }
  100% {
    transform: translateX(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}

@media print {
  body {
    background-image: none;
  }
  .masthead,
  .actions {
    display: none;
  }
}
