:root {
  --bg: #ffffff;
  --text: #1b1b1b;
  --muted: #5c6660;
  --accent: #0e3a2f;
  --accent-contrast: #ffffff;
  --highlight: #78faae;
  --border: #d9dedb;
  --code-bg: #f2f5f3;
}

/* the dark palette applies when the system prefers it (unless overridden to light) or when
   explicitly picked; the two selectors must stay identical */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121613;
    --text: #e8ebe9;
    --muted: #9aa5a0;
    --accent: #78faae;
    --accent-contrast: #0e3a2f;
    --border: #2c332f;
    --code-bg: #1c221e;
  }
}

:root[data-theme="dark"] {
  --bg: #121613;
  --text: #e8ebe9;
  --muted: #9aa5a0;
  --accent: #78faae;
  --accent-contrast: #0e3a2f;
  --border: #2c332f;
  --code-bg: #1c221e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

header {
  position: relative;
  background: #0e3a2f;
  color: #ffffff;
  padding: 2rem 1.25rem;
}

/* keep the title clear of the absolutely positioned theme picker on narrow screens */
@media (max-width: 48rem) {
  header {
    padding-top: 3.5rem;
  }
}

header h1 {
  margin: 0;
  font-size: 1.6rem;
}

header .tagline {
  margin: 0.25rem 0 0;
  color: #b9e6cd;
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
}

.header-inner {
  max-width: 46rem;
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.header-link {
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.header-link:hover,
.header-link:focus-visible {
  background: #78faae;
  border-color: #78faae;
  color: #0e3a2f;
}

@media (min-width: 64rem) {
  main,
  .header-inner {
    max-width: 58rem;
  }
}

@media (min-width: 90rem) {
  main,
  .header-inner {
    max-width: 72rem;
  }
}

h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--highlight);
}

a {
  color: var(--accent);
}

p.muted {
  color: var(--muted);
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

code {
  background: var(--code-bg);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

pre {
  background: var(--code-bg);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}

.qr {
  margin: 1rem 0;
}

.qr img {
  width: 160px;
  height: 160px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.status-pill {
  display: inline-block;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.75rem;
  font-weight: 600;
  font-size: 0.9em;
}

.theme-picker {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  overflow: hidden;
}

.theme-picker button {
  background: none;
  border: none;
  color: #b9e6cd;
  font-family: inherit;
  font-size: 0.75rem;
  line-height: 1.6;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
}

.theme-picker button[aria-pressed="true"] {
  background: #78faae;
  color: #0e3a2f;
  font-weight: 600;
}
