/*
 * What's running — the whole style sheet. No image, no web font, no external sheet: the page is an
 * instrument, so the ink is legible, the rows are dense, and nothing on it is decorated. Colour
 * carries only what a document already states: the ok or refusal a callable returned, and a product
 * trying a change rather than running it.
 */

:root {
  --ink: #dfe4ec;
  --ink-dim: #9aa4b3;
  --ink-faint: #6e7785;
  --bg: #0f1216;
  --bg-raised: #161b22;
  --bg-sunken: #0b0e12;
  --rule: #262d37;
  --rule-soft: #1c222b;
  --ok: #58b36b;
  --refused: #e0685f;
  --amber: #d3a24a;
  --accent: #7aa2d6;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'Cascadia Mono', Consolas, 'Liberation Mono', monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  padding: 0 20px 64px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* ── The bar ─────────────────────────────────────────────────────────────── */

.bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 0 12px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 18px;
}

.bar-left {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

button {
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: var(--accent);
}

button:disabled {
  color: var(--ink-faint);
  cursor: default;
}

button.auth {
  padding: 6px 14px;
}

/* ── Sections ────────────────────────────────────────────────────────────── */

main {
  max-width: 1180px;
}

section {
  margin: 0 0 30px;
}

/* "Run now", above everything a record states, with the service's sentence beside it. */
.run-bar {
  margin: 0 0 22px;
}

.run-bar .run-now {
  padding: 6px 14px;
}

.run-bar .line {
  margin-top: 8px;
}

h2 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--rule-soft);
  padding-bottom: 6px;
}

h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--mono);
  color: var(--ink);
}

.note {
  margin: 0 0 16px;
  color: var(--ink-dim);
  max-width: 62ch;
}

.nothing {
  margin: 0;
  color: var(--ink-dim);
}

button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

.line {
  margin: 10px 0 0;
  font-size: 13px;
  max-width: 88ch;
}

.line.ok {
  color: var(--ok);
}

.line.refused {
  color: var(--refused);
}

#auth-error {
  margin: 0 0 18px;
}

/* ── Narrow screens ──────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  body {
    padding: 0 12px 48px;
  }
}

/* ══ One screen ═══════════════════════════════════════════════════════════════
   What's running: one line per tier, three choices, Select, one confirmation, Undo. The variables are the
   sheet's own; this page restates them for a reader on a light screen, because it is read at a desk
   in daylight as often as at night. */

body.screen {
  min-height: 100vh;
  background: var(--bg);
}

@media (prefers-color-scheme: light) {
  body.screen {
    --ink: #1c2128;
    --ink-dim: #55606e;
    --ink-faint: #78828f;
    --bg: #ffffff;
    --bg-raised: #f3f5f8;
    --bg-sunken: #eceff4;
    --rule: #d2d8e0;
    --rule-soft: #e3e7ed;
    --ok: #1f7a3d;
    --refused: #b3352c;
    --amber: #8a6415;
    --accent: #2c5f9e;
  }
}

.screen main {
  max-width: 760px;
}

.screen .product {
  margin: 0 0 30px;
}

/* A product is its plain name, set as a name and not as a section label. */
.screen .product-title {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

/* The one sentence under the title, read before any product. */
.screen .top-note {
  margin: 0 0 22px;
  color: var(--ink-dim);
  font-size: 14px;
  max-width: 72ch;
}

.screen .lines {
  border-top: 1px solid var(--rule-soft);
}

/* The Spend block: the record's two sentences. */
.screen .changes {
  padding: 12px 0;
  border-top: 1px solid var(--rule-soft);
}

/* One tier: its name, its jobs, what runs it now, then its three choices. */
.screen .line-block {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule-soft);
}

.screen .line-label {
  margin: 0 0 2px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.screen .line-jobs,
.screen .line-running,
.screen .line-comparison,
.screen .line-note {
  margin: 0 0 4px;
  color: var(--ink-dim);
  font-size: 13px;
  max-width: 88ch;
}

.screen .line-running {
  color: var(--ink);
}

.screen .trial {
  display: block;
  color: var(--amber);
  font-size: 12px;
}

.screen .choices {
  list-style: none;
  margin: 8px 0 4px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.screen .choice {
  padding: 8px 10px;
  background: var(--bg-raised);
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
}

.screen .choice-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.screen .choice-name {
  color: var(--ink);
  font-weight: 600;
}

.screen .choice-running {
  color: var(--ok);
  font-size: 12px;
}

.screen .choice-why,
.screen .choice-cost {
  margin: 2px 0 0;
  color: var(--ink-dim);
  font-size: 13px;
  max-width: 88ch;
}

.screen .choice button.select {
  margin-top: 6px;
}

.screen .choice-confirm {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.screen .confirm-question {
  margin: 0;
  color: var(--ink);
}

.screen .pickup {
  margin: 10px 0 0;
  color: var(--ink-dim);
  font-size: 13px;
  max-width: 88ch;
}

.screen button.undo,
button.update {
  margin: 8px 0 0;
}

.screen .nothing {
  margin: 10px 0 0;
  max-width: 88ch;
}

.screen #sign-in {
  margin-bottom: 20px;
}

.screen-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 34px;
  padding-top: 12px;
  border-top: 1px solid var(--rule-soft);
  font-size: 12px;
}
