@import url("https://fonts.googleapis.com/css2?family=Barlow+Semi+Condensed:wght@500;700&family=Martian+Mono:wght@400;700&display=swap");

:root {
  --case: #23262a; --case-hi: #31353a; --case-lo: #191b1e; --bezel: #0e1012;
  --screen: #07100b; --screen-ink: #7ef2a8; --screen-dim: #3f7a56;
  --key: #e8a33d; --key-lo: #c9852a; --key-ink: #231a08;
  --ink: #d7dbde; --dim: #8b9298; --rule: #3a3f45;
  --sans: "Barlow Semi Condensed", Arial Narrow, "Helvetica Neue", Arial, sans-serif;
  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 18px 14px 40px;
  background: #15171a linear-gradient(180deg, #1b1e22, #121417);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.term {
  max-width: 620px;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--case-hi), var(--case));
  border: 1px solid var(--case-lo);
  border-radius: 10px;
  box-shadow: 0 1px 0 #3d4248 inset, 0 18px 40px rgba(0, 0, 0, 0.45);
  padding: 16px 14px 18px;
}

.id { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--rule); padding-bottom: 10px; }
.mark { font-family: var(--sans); font-weight: 700; font-size: 19px; letter-spacing: 0.04em; color: var(--ink); text-decoration: none; }
.mark b { color: var(--key); font-weight: 700; }
.loc { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; text-align: right; }

h1 { font-size: clamp(26px, 8vw, 36px); font-weight: 700; letter-spacing: 0.03em; line-height: 1.06; margin: 16px 0 4px; }
h1.long { font-size: clamp(20px, 6vw, 26px); }
.sub { color: var(--dim); margin: 0 0 14px; }

.label { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--rule); border-radius: 3px; padding: 9px 11px; margin: 12px 0; }
.label .k { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; }
.label .v { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }

/* the screen: where code and its output live */
.screen { background: var(--screen); border: 1px solid var(--bezel); border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,.5) inset; padding: 10px; margin: 12px 0; }
.screen textarea, .screen pre {
  width: 100%; margin: 0; background: transparent; border: 0; color: var(--screen-ink);
  font-family: var(--mono); font-size: 13px; line-height: 1.5; resize: vertical;
}
.screen textarea { min-height: 128px; outline: none; }
.screen pre { white-space: pre-wrap; word-break: break-word; min-height: 22px; color: var(--screen-dim); overflow-x: auto; }
.screen pre.has { color: var(--screen-ink); }

/* An engraved heading: the casing's own voice, for a section that is part of the machine rather
   than a page about it. Small, tracked, and never competing with the display type. */
.engraved { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; margin: 18px 0 8px; }

/* The three beats of a session. Numbered because the order is the information — you cannot press
   End before Run — and engraved in the casing's label type so the numerals read as machined marks
   rather than decoration. */
.steps { list-style: none; counter-reset: step; margin: 0 0 18px; padding: 0; }
.steps li { position: relative; counter-increment: step; padding: 0 0 0 30px; margin: 0 0 10px; color: var(--dim); }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 1px;
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.16em;
  color: var(--key);
}
.steps b { color: var(--ink); font-weight: 700; }

/* The join between what the machine does and the merchant's own story. A machined seam, not a
   hairline: the case is two pieces and this is where they meet. */
.seam { height: 0; border: 0; border-top: 1px solid var(--case-lo); border-bottom: 1px solid #3d4248; margin: 26px 0 22px; }

code { font-family: var(--mono); font-size: 0.86em; color: var(--ink); }

/* the tariff plate: what the machine charges, engraved on the casing rather than printed on it.
   Money is amber wherever it appears on this terminal — the same ink as `.meter .amt`. */
.plate { margin: 20px 0 24px; border: 1px solid var(--rule); border-radius: 3px; }
.plate > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 11px 12px; }
.plate > div + div { border-top: 1px solid var(--rule); }
.plate dt { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; white-space: nowrap; }
.plate dd { margin: 0; font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.plate .lead { font-size: 14px; color: var(--key); }

/* Below the narrowest useful column the two halves stop competing for one line. */
@media (max-width: 430px) {
  .plate > div { flex-direction: column; align-items: stretch; gap: 5px; }
  .plate dd { text-align: left; }
}

.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }

.key {
  appearance: none; border: 0; cursor: pointer;
  background: linear-gradient(180deg, var(--key), var(--key-lo));
  color: var(--key-ink); font-family: var(--sans); font-weight: 700; font-size: 17px;
  letter-spacing: 0.06em; text-transform: uppercase;
  min-height: 48px; min-width: 108px; padding: 0 22px; border-radius: 6px;
  box-shadow: 0 1px 0 #f3c076 inset, 0 3px 0 #8f5d18;
}
/* The landing's way in is the same physical key the console's Run is, because on this machine the
   key is what you press. It starts no billing; the note beneath it says so. */
a.key { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.key:active { transform: translateY(2px); box-shadow: 0 1px 0 #f3c076 inset, 0 1px 0 #8f5d18; }
.key:focus-visible { outline: 2px solid var(--screen-ink); outline-offset: 3px; }
.key[disabled] { opacity: .55; cursor: default; box-shadow: none; }

/* the meter: engraved on the casing, tabular, never blinking */
.meter { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 15px; color: var(--ink); letter-spacing: 0.02em; }
.meter .amt { color: var(--key); }
.meter small { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; }

.note { color: var(--dim); font-size: 13px; margin: 14px 0 0; }
.open { display: inline-block; margin-top: 6px; font-family: var(--mono); font-size: 13px; color: var(--key); text-decoration: none; border-bottom: 1px solid var(--key-lo); padding-bottom: 2px; min-height: 44px; line-height: 44px; }
.back { display: inline-block; margin-top: 14px; min-height: 44px; line-height: 44px; color: var(--dim); font-family: var(--mono); font-size: 12px; }
.tag { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; }

/*
 * The meter's slot. The editor leads this page, so the readout cannot simply scroll away above the
 * work — it sticks to the bottom of the viewport for as long as there is page beneath it, which is
 * the whole time a subscriber is reading output or the runner's source. The card inside is the
 * component Furqaan signed (FR-EXM-152); only its position belongs to Northwind.
 */
.gauge { position: sticky; bottom: 0; z-index: 2; }
.gauge:empty { display: none; }
.gauge .screen { margin-bottom: 0; box-shadow: 0 2px 10px rgba(0,0,0,.5) inset, 0 -10px 24px rgba(21,23,26,.72); }

/* The work surface. Monaco measures its container when it mounts, so the height is set here rather
   than inline and the narrow breakpoint gets its own. */
#editor { height: 300px; padding: 0; }
@media (max-width: 430px) { #editor { height: 220px; } }

/* The one control that stops the money. It is engraved into the casing rather than moulded as a
   second amber key: Run is pressed all day, this is pressed once, and a terminal whose two controls
   look alike is a terminal you press the wrong one on. `margin-left: auto` holds it at the far end
   of the row so the gap itself does the separating (FR-EXM-155). */
.switch {
  margin-left: auto;
  min-height: 44px;
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--case-lo);
  border: 1px solid var(--rule);
  border-radius: 3px;
  cursor: pointer;
}
.switch:hover { border-color: var(--dim); }
.switch:active { transform: translateY(1px); }
.switch:focus-visible { outline: 2px solid var(--screen-ink); outline-offset: 3px; }
.switch[disabled] { opacity: .55; cursor: default; }

/* Engraved fine print: the line that says whose policy an auto-end is. Smaller and dimmer than
   `.note`, because it answers a question rather than instructing. */
.fine { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--dim); }

/* Below the narrowest useful column the switch stops sharing a line with the key. */
@media (max-width: 430px) {
  .switch { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) { .key:active { transform: none; } }
@media (prefers-reduced-motion: reduce) { .switch:active { transform: none; } }

/*
 * The Elapse components inside the console (FR-EXM-152). @elapse/react ships its own stylesheet;
 * a merchant re-dresses it with CSS variables, so here they become part of the terminal: the
 * phosphor screen, its green ink, and the amber key colour on the one primary action.
 */
.screen .elapse {
  --elapse-bg: var(--screen);
  --elapse-surface: transparent;
  --elapse-fg: var(--screen-ink);
  --elapse-muted: var(--screen-dim);
  --elapse-accent: var(--key);
  --elapse-accent-soft: rgba(232, 163, 61, 0.14);
  --elapse-border: var(--rule);
  --elapse-radius: 3px;
  --elapse-font: var(--sans);
  --elapse-font-mono: var(--mono);
}

.screen .elapse-card {
  max-width: none;
  padding: 2px;
  border: 0;
}

.screen .elapse-primary {
  color: var(--key-ink);
  background: linear-gradient(180deg, var(--key), var(--key-lo));
  border-color: var(--key-lo);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.screen .elapse-title,
.screen .elapse-preset-cap {
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
