/* Phonautogram: a seismograph record and a typed clinic form on a cream page. */

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.wordmark {
  display: block;
  height: 24px;
  width: auto;
}

h1 {
  margin: 20px 0 4px;
  color: var(--c-earth);
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.lead {
  margin: 0 0 32px;
}

section {
  border-top: 1px solid var(--ink);
  padding: 12px 0 28px;
}

h2 {
  margin: 0 0 12px;
  color: var(--c-earth);
  font-size: 1.125rem;
}

section > p {
  margin: 0 0 12px;
}

.buttons,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 7px 14px;
  cursor: pointer;
}

button:disabled {
  color: var(--ink-soft);
  border-color: var(--ink-soft);
  cursor: default;
}

button:focus-visible {
  outline: 2px solid var(--c-earth);
  outline-offset: 2px;
}

.status {
  min-height: 1.5em;
  margin: 12px 0;
  color: var(--ink-soft);
}

.error,
.status.error {
  color: var(--error);
}

figure {
  margin: 16px 0 0;
}

#sheet {
  display: block;
  width: 100%;
  max-width: 36rem;
  height: auto;
  aspect-ratio: 210 / 297;
  background: #ffffff;
  border: 1px solid var(--ink);
  box-sizing: border-box;
}

figcaption {
  margin-top: 12px;
}

.reading {
  margin-top: 20px;
}

pre {
  margin: 0 0 12px;
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

footer {
  color: var(--ink-soft);
  font-size: 0.875rem;
}

footer p {
  margin: 0;
}

/* Dark scheme: plum headings and the plum focus ring vanish on the dark ground. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) h1,
  :root:not([data-theme="light"]) h2 {
    color: var(--ink);
  }
  :root:not([data-theme="light"]) button:focus-visible {
    outline-color: var(--accent);
  }
  :root:not([data-theme="light"]) .wordmark {
    background: var(--c-cream);
    padding: 4px;
  }
}

:root[data-theme="dark"] h1,
:root[data-theme="dark"] h2 {
  color: var(--ink);
}

:root[data-theme="dark"] button:focus-visible {
  outline-color: var(--accent);
}

:root[data-theme="dark"] .wordmark {
  background: var(--c-cream);
  padding: 4px;
}

/* The sheet alone at its true size: for print, and for the view=sheet address. */
@page {
  size: A4;
  margin: 0;
}

@media print {
  html,
  body {
    background: #ffffff;
    margin: 0;
    padding: 0;
  }
  header,
  footer,
  h2,
  .buttons,
  .status,
  .actions,
  figcaption,
  #read {
    display: none !important;
  }
  main,
  section,
  figure {
    margin: 0;
    padding: 0;
    border: 0;
    max-width: none;
  }
  #sheet {
    width: 210mm;
    height: 297mm;
    max-width: none;
    border: 0;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

html.view-sheet,
html.view-sheet body {
  background: #ffffff;
  margin: 0;
  padding: 0;
}

html.view-sheet #sheet {
  width: 210mm;
  height: 297mm;
  max-width: none;
  border: 0;
}

.status:empty {
  min-height: 0;
  margin: 0;
}
