:root {
  --display-font: 'Space Grotesk', system-ui, sans-serif;
  --body-font: 'Space Mono', ui-monospace, monospace;
  --ink: #1d1a2b;
  --muted: #625d78;
  --paper: #eceef3;
  --panel: #ffffff;
  --line: #d6d4df;
  --action: #6441a5;
  --action-ink: #ffffff;
  --plate: #ffffff;
  --plate-on: #e3f6ea;
  --plate-off: #625d78;
  --lamp: #146c3f;
  --lamp-bulb: #179a4e;
  --lamp-hint: #4a4560;
  --lamp-text-glow: none;
  --good: #1a6e44;
  --bad: #b3261e;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --display-font: 'Space Grotesk', system-ui, sans-serif;
    --body-font: 'Space Mono', ui-monospace, monospace;
    --ink: #ece9f5;
    --muted: #a29cb6;
    --paper: #17131f;
    --panel: #211b2c;
    --line: #3a3348;
    --action: #a68ae0;
    --action-ink: #17131f;
    --plate: #0e0a12;
    --plate-on: #0e0a12;
    --plate-off: #857d92;
    --lamp: #3ddc84;
    --lamp-bulb: #3ddc84;
    --lamp-hint: #b9b2c6;
    --lamp-text-glow: 0 0 12px rgb(61 220 132 / 0.6);
    --good: #6fd29e;
    --bad: #ff8a80;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 0.95rem/1.6 var(--body-font);
}
main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 3rem 1rem 4rem;
}
h1 {
  font-family: var(--display-font);
  letter-spacing: -0.01em;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}
.brand {
  font-family: var(--display-font);
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}
h2 {
  font-family: var(--display-font);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}
p {
  margin: 0 0 1rem;
}
a {
  color: var(--action);
}
small,
.muted {
  color: var(--muted);
}
small {
  font-size: 0.875rem;
  line-height: 1.45;
}
:focus-visible {
  outline: 3px solid var(--action);
  outline-offset: 2px;
}

button,
.button {
  font: inherit;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
}
.button {
  display: inline-block;
  font-family: var(--display-font);
  /* Larger text with a tighter line height and padding, so the button keeps its size. */
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  border: 0;
  background: var(--action);
  color: var(--action-ink);
  padding: 0.72rem 1rem;
  text-decoration: none;
}
.button:disabled {
  background: var(--line);
  color: var(--muted);
  cursor: default;
}
.quiet {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 0.3rem 0.75rem;
  font-size: 0.9rem;
}
.link {
  white-space: nowrap;
  border: 0;
  background: none;
  padding: 0;
  color: var(--action);
  text-decoration: underline;
}

.connect {
  text-align: center;
  margin-top: 1.5rem;
}
.account {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* The status lamp: the page's one loud element, and the pause/resume switch. */
.lamp {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.1rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--plate);
  color: var(--plate-off);
  text-align: left;
  transition:
    color 0.25s,
    background-color 0.25s,
    border-color 0.25s,
    text-shadow 0.25s;
}
.lamp-bulb {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--plate-off);
  transition:
    background-color 0.25s,
    box-shadow 0.25s;
}
.lamp-text {
  display: grid;
}
.lamp-title {
  font-family: var(--display-font);
  letter-spacing: -0.01em;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
}
.lamp-hint {
  font-size: 0.9rem;
  color: var(--lamp-hint);
  text-shadow: none;
}
.lamp[aria-pressed='true'] {
  background: var(--plate-on);
  border-color: color-mix(in srgb, var(--lamp-bulb) 40%, var(--line));
  color: var(--lamp);
  text-shadow: var(--lamp-text-glow);
}
.lamp[aria-pressed='true'] .lamp-bulb {
  background: var(--lamp-bulb);
  box-shadow:
    0 0 10px 2px color-mix(in srgb, var(--lamp-bulb) 80%, transparent),
    0 0 28px 6px color-mix(in srgb, var(--lamp-bulb) 35%, transparent);
}

section {
  margin-top: 2.5rem;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

form {
  display: grid;
  gap: 1rem;
  margin-top: 0.75rem;
}
.field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.field label {
  font-family: var(--display-font);
  font-weight: 600;
}
.field small {
  grid-column: 1;
}
.field .input {
  grid-row: 1 / span 2;
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}
.unit {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1;
}
.who-am-i {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.avatar {
  border-radius: 50%;
  background: var(--line);
}

/* Number input flanked by -/+ buttons, replacing the browser's spinners. */
.stepper {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
}
.stepper button {
  width: 2.25rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
}
.stepper :focus-visible {
  outline-offset: -3px;
}
.stepper button:hover {
  background: var(--line);
}
.stepper button:disabled {
  color: var(--muted);
  cursor: default;
  background: transparent;
}
input {
  font: inherit;
  font-variant-numeric: tabular-nums;
  width: 3.5rem;
  padding: 0.4rem 0;
  border: 0;
  border-inline: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: center;
  appearance: textfield;
}
input::-webkit-inner-spin-button,
input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status.good {
  color: var(--good);
}
.status.bad {
  color: var(--bad);
}

ol,
ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.queue li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}
.queue li:last-child {
  border-bottom: 1px solid var(--line);
}
.queue .who {
  flex: 1;
  min-width: 0;
}
.queue .who {
  display: grid;
}
.queue .who a {
  font-weight: 700;
  color: var(--ink);
}
.queue .who .muted {
  font-size: 0.9rem;
}
.log li {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 1rem;
  padding: 0.35rem 0;
  font-size: 0.95rem;
}
.log time {
  white-space: nowrap;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.empty {
  color: var(--muted);
  padding: 0.7rem 0;
}

.faq h2 {
  font-family: var(--display-font);
  margin-bottom: 0.5rem;
}
.faq details {
  border-top: 1px solid var(--line);
}
.faq details:last-of-type {
  border-bottom: 1px solid var(--line);
}
.faq summary {
  font-family: var(--display-font);
  padding: 0.75rem 0;
  font-weight: 600;
  cursor: pointer;
}
.faq details > :not(summary) {
  margin: 0 0 0.9rem;
  max-width: 34rem;
}
.faq ul {
  list-style: disc;
  padding-left: 1.25rem;
}
.faq li + li {
  margin-top: 0.25rem;
}

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 30rem) {
  h1 {
    font-size: 1.6rem;
  }
  .field {
    grid-template-columns: 1fr;
  }
  .field .input {
    grid-row: auto;
    grid-column: 1;
    justify-self: start;
  }
  .log li {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
