:root {
  color-scheme: light;

  --font-stack: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas,
    monospace;

  --surface-0: #eef1f4;
  --surface-1: #ffffff;
  --surface-2: #f4f7fa;
  --border: #d7dde3;
  --text-primary: #23282d;
  --text-secondary: #5b636b;
  --text-tertiary: #8b939b;
  --brand: #2dacf9;
  --brand-strong: #1580c9;
  --radius: 14px;
}

/* `theme.js` sets `data-theme` on <html> from the saved preference or the OS
   setting before the page paints, so the dark palette only needs this hook. */
:root[data-theme='dark'] {
  color-scheme: dark;

  --surface-0: #16191c;
  --surface-1: #1f2429;
  --surface-2: #262c31;
  --border: #363d44;
  --text-primary: #e7ebee;
  --text-secondary: #a3acb4;
  --text-tertiary: #767f87;
  --brand: #4db8ff;
  --brand-strong: #7fcbff;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: var(--font-stack);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Keep printing focused on the question sheet and its answer key. */
@media print {
  /* Force the light palette so a dark-theme user still prints dark ink on
     white paper. */
  :root,
  :root[data-theme='dark'] {
    color-scheme: light;

    --surface-0: #ffffff;
    --surface-1: #ffffff;
    --surface-2: #ffffff;
    --border: #d7dde3;
    --text-primary: #000000;
    --text-secondary: #000000;
    --text-tertiary: #000000;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  header,
  footer,
  form,
  #print-button,
  #print-total {
    display: none !important;
  }

  #print-root {
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
}
