body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Ubuntu, "Helvetica Neue", Arial, sans-serif;
  background: #fafafa;
  color: #111827;
  line-height: 1.6;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

body:not(.app-page) > header:not(.site-header) {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 16px 0;
}

body:not(.app-page) main {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px;
}

.app-page main {
  max-width: none;
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.site-header__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-logo {
  font-weight: 700;
  text-decoration: none;
  color: #111827;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-left: auto;
}

.site-nav__link {
  color: #374151;
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav__link:hover {
  text-decoration: underline;
}

.site-nav__link.is-active {
  color: #111827;
  font-weight: 700;
}

.site-footer {
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
  margin-top: 60px;
}

.site-footer__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: space-between;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.site-footer__links a {
  color: #6b7280;
  text-decoration: underline;
  font-size: 0.9rem;
}

.site-footer__meta {
  color: #6b7280;
  font-size: 0.9rem;
}

.theme-dark .site-header {
  background: #0e0e0e;
  border-bottom-color: #2a2a2a;
}

.theme-dark .site-logo {
  color: #ffffff;
}

.theme-dark .site-nav__link {
  color: #d1d1d1;
}

.theme-dark .site-nav__link.is-active {
  color: #ffffff;
}

.theme-dark .site-footer {
  background: #0e0e0e;
  border-top-color: #2a2a2a;
}

.theme-dark .site-footer__links a,
.theme-dark .site-footer__meta {
  color: #9a9a9a;
}

@media (max-width: 720px) {
  .site-header__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    margin-left: 0;
  }
}
