:root {
  color-scheme: light dark;
  --primary: #1f6f78;
  --primary-strong: #175a62;
  --accent: #5bb89c;
  --bg: #f5faf9;
  --surface: #ffffff;
  --surface-muted: #e7f2f0;
  --text: #12303a;
  --text-muted: #46646d;
  --border: #c9dcd9;
  --focus: #0b5cad;
  --link: #1f6f78;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #5bb89c;
    --primary-strong: #7fcbb3;
    --accent: #5fb3bc;
    --bg: #0d1c21;
    --surface: #15292f;
    --surface-muted: #1d363d;
    --text: #e4f1ef;
    --text-muted: #a9c3c0;
    --border: #2f4c53;
    --focus: #8cc8ff;
    --link: #7fcbb3;
  }
}

* {
  box-sizing: border-box;
}

html {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--link);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--focus);
  z-index: 10;
}

.skip-link:focus {
  top: 1rem;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
}

.brand img {
  width: 2rem;
  height: 2rem;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.25rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.site-nav a:hover {
  text-decoration: underline;
}

.site-nav a[aria-current='page'] {
  color: var(--link);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* Main */

main.wrap {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

h1,
h2,
h3 {
  line-height: 1.25;
}

h1 {
  font-size: 2rem;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.35rem;
  margin: 2.25rem 0 0.5rem;
}

h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.25rem;
}

.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
}

.meta {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  margin: 1.25rem 0;
}

.card > :first-child {
  margin-top: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

.notice {
  background: var(--surface-muted);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
}

.notice > :first-child {
  margin-top: 0;
}

.notice > :last-child {
  margin-bottom: 0;
}

.links {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.links a {
  display: block;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.links a strong {
  display: block;
  color: var(--link);
  font-size: 1.1rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.links a span {
  color: var(--text-muted);
}

ol,
ul {
  padding-left: 1.4rem;
}

main li + li {
  margin-top: 0.35rem;
}

.site-nav li + li,
.links li + li {
  margin-top: 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  background: var(--surface);
  font-size: 0.97rem;
}

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

th {
  background: var(--surface-muted);
}

code {
  font-size: 0.95em;
  background: var(--surface-muted);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 1.5rem 0 2rem;
}

.site-footer address {
  font-style: normal;
}

.site-footer p {
  margin: 0.25rem 0;
}

/* Narrow screens: each table row becomes a card with labelled cells, no sideways scrolling. */
@media (max-width: 40rem) {
  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  table {
    background: transparent;
  }

  tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem 0.9rem;
    margin-bottom: 0.75rem;
  }

  td {
    border: none;
    padding: 0.3rem 0;
  }

  td::before {
    content: attr(data-label);
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
  }
}

@media (max-width: 30rem) {
  h1 {
    font-size: 1.7rem;
  }

  .site-nav ul {
    gap: 0 0.75rem;
  }
}
