:root {
  color-scheme: light dark;
  --bg: #f5f4ef;
  --surface: #ffffff;
  --text: #1b1e22;
  --muted: #57606b;
  --line: #dcd9d0;
  --field-line: #848b95;
  --accent: #0b5c4d;
  --on-accent: #ffffff;
  --accent-soft: #e2f1ec;
  --wait: #7a4f00;
  --wait-soft: #fdf1d3;
  --wait-line: #d9a93a;
  --focus: #1a56db;
  --pad: clamp(1rem, 4vw, 2rem);
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131619;
    --surface: #1c2024;
    --text: #e9ebee;
    --muted: #a6afba;
    --line: #343a42;
    --field-line: #7b8490;
    --accent: #6ad0b5;
    --on-accent: #0c1f1a;
    --accent-soft: #17322b;
    --wait: #f0c36a;
    --wait-soft: #2f2610;
    --wait-line: #8a6a1c;
    --focus: #8ab4ff;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 100%/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  overflow-wrap: anywhere;
  hyphens: auto;
  /* Only long words are divided, and never close to either end. */
  hyphenate-limit-chars: 12 5 5;
  -webkit-hyphenate-limit-before: 5;
  -webkit-hyphenate-limit-after: 5;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--pad);
  top: -4rem;
  z-index: 1;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
}

.skip:focus {
  top: 0.5rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

h1 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.125rem;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1rem;
  line-height: 1.4;
}

h3 a {
  color: inherit;
}

/* The bar at the top */

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1rem;
  min-height: 3.5rem;
  padding: 0.25rem var(--pad);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

.brand img {
  display: block;
}

.who {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  hyphens: none;
}

.top form {
  display: flex;
  margin-left: auto;
}

/* On a narrow screen the customer's name gets a row of its own. */
@media (max-width: 34rem) {
  .who {
    order: 3;
    flex-basis: 100%;
    padding-bottom: 0.5rem;
  }
}

/* The page */

main {
  margin: 0 auto;
  padding: 2rem var(--pad) 4rem;
  max-width: 72rem;
}

main.medium {
  max-width: 52rem;
}

main.narrow {
  max-width: 34rem;
}

.lead {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 1.0625rem;
}

main > section,
[data-live] > section,
.columns section,
main > form,
main > p,
main > figure {
  margin-top: 2rem;
}

main > p.lead {
  margin-top: 0.5rem;
}

main > p:first-child {
  margin-top: 0;
  margin-bottom: 1rem;
}

@media (min-width: 62rem) {
  .columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 23rem;
    gap: 3rem;
    align-items: start;
  }
}

.notice {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
}

.notice.problem {
  border-color: var(--wait-line);
  background: var(--wait-soft);
}

/* Cards */

.cards {
  display: grid;
  gap: 0.75rem;
  padding: 0;
  list-style: none;
}

.card {
  padding: 1.125rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card > * + * {
  margin-top: 0.625rem;
}

.card.waits {
  border-left: 4px solid var(--wait-line);
}

.card.past {
  background: transparent;
  color: var(--muted);
}

.card.split {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.card.split > * {
  margin-top: 0;
}

.card.split > div {
  flex: 1 1 16rem;
}

.hint,
.empty,
.tag {
  color: var(--muted);
  font-size: 0.9375rem;
}

.empty {
  padding: 1rem 1.25rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.facts {
  display: grid;
  gap: 0.5rem;
  font-size: 0.9375rem;
}

.facts dt {
  color: var(--muted);
}

.facts ol {
  display: grid;
  gap: 0.25rem;
  padding-left: 1.25rem;
}

.trials {
  margin-top: 1rem;
}

/* What a price comes with */

.terms {
  display: grid;
  gap: 0.25rem;
  padding-left: 1.25rem;
  font-size: 0.9375rem;
}

/* What was understood at length, opened when she wants it */

details > summary {
  width: fit-content;
  color: var(--accent);
  font-size: 0.9375rem;
  cursor: pointer;
}

details > p {
  margin-top: 0.375rem;
  font-size: 0.9375rem;
}

/* Forms and buttons */

label {
  display: block;
  font-weight: 600;
}

h2 + form > label:first-of-type {
  font-weight: 400;
}

label + input,
label + textarea,
label + .inline {
  margin-top: 0.375rem;
}

form:not(.buttons) > :not([type="hidden"]) + label,
form:not(.buttons) > :not([type="hidden"]) + .hint,
form:not(.buttons) > :not([type="hidden"]) + button {
  margin-top: 0.875rem;
}

form > textarea + .hint {
  margin-top: 0.5rem;
}

input[type="text"],
input[type="email"],
textarea {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--field-line);
  border-radius: 8px;
}

textarea {
  resize: vertical;
}

input.code {
  max-width: 12rem;
  font-size: 1.375rem;
  letter-spacing: 0.2em;
  font-variant-numeric: tabular-nums;
}

.inline {
  display: flex;
  gap: 0.5rem;
}

.inline input {
  flex: 1;
  min-width: 0;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.125rem;
  font: inherit;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 8px;
  cursor: pointer;
}

button.primary,
.button.primary {
  color: var(--on-accent);
  background: var(--accent);
}

button.quiet,
.button.quiet {
  color: var(--text);
  border-color: var(--field-line);
  font-weight: 500;
}

button.plain {
  padding: 0.5rem 0.25rem;
  color: var(--text);
  border-color: transparent;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

@media (hover: hover) {
  button:hover,
  .button:hover {
    background: var(--accent-soft);
  }

  button.primary:hover,
  .button.primary:hover {
    background: var(--accent);
    filter: brightness(1.12);
  }
}

@media (prefers-reduced-motion: no-preference) {
  button,
  .button {
    transition: background-color 0.15s, filter 0.15s;
  }
}

/* The stages of a piece of work */

.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 0;
  list-style: none;
}

.card > .steps {
  margin-top: 0.875rem;
}

.steps li {
  padding-top: 0.375rem;
  border-top: 5px solid var(--line);
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.3;
  hyphens: none;
  overflow-wrap: normal;
}

.steps .done,
.steps .now {
  border-top-color: var(--accent);
}

.steps .now {
  color: var(--text);
  font-weight: 700;
}

/* On a narrow screen only the current stage is named, under the bar. */
@media (max-width: 34rem) {
  .steps {
    padding-bottom: 1.5rem;
  }

  .steps li {
    padding-top: 0;
  }

  .steps li span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .steps .now span {
    left: 0;
    bottom: 0;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }
}

.note {
  color: var(--muted);
  font-size: 0.9375rem;
}

.note.waiting {
  display: inline-block;
  padding: 0.125rem 0.625rem;
  color: var(--wait);
  background: var(--wait-soft);
  border-radius: 999px;
  font-weight: 600;
}

/* What happened */

.activity {
  display: grid;
  gap: 0.875rem;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.activity li {
  padding-left: 0.875rem;
  border-left: 2px solid var(--line);
}

.when {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
}

/* The page of one change */

.back::before {
  content: "\2190\00a0";
}

.changes {
  display: grid;
  gap: 0.375rem;
  padding-left: 1.25rem;
}

figure + figure {
  margin-top: 1.5rem;
}

figcaption {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.pair {
  display: grid;
  gap: 1rem;
}

@media (min-width: 44rem) {
  .pair.two {
    grid-template-columns: 1fr 1fr;
  }
}

.tag {
  margin-bottom: 0.25rem;
}

img {
  max-width: 100%;
  height: auto;
}

figure img {
  display: block;
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

section > p + p,
section > p + form,
section > p + ul {
  margin-top: 0.75rem;
}

main > [data-live] > p:not(.lead) {
  margin-top: 2rem;
}
