:root {
  --font-sans: "Avenir Next", "Nunito Sans", "Trebuchet MS", "Segoe UI", sans-serif;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --text: #101722;
  --heading: #0a1220;
  --muted: #4b5a70;
  --border: #c7d0dd;
  --link: #1e5ecf;
  --link-hover: #15479d;
  --accent: #1e5ecf;
  --accent-soft: #d8e4fb;
  --input-bg: #ffffff;
  --button-text: #ffffff;
  --button-bg: #1e5ecf;
  --button-bg-hover: #15479d;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d121a;
    --surface: #151c26;
    --surface-solid: #101720;
    --text: #e8eef8;
    --heading: #f3f7ff;
    --muted: #afbdd1;
    --border: #334259;
    --link: #9ec0ff;
    --link-hover: #c1d7ff;
    --accent: #8fb6ff;
    --accent-soft: #20334f;
    --input-bg: #111a27;
    --button-text: #081326;
    --button-bg: #9ec0ff;
    --button-bg-hover: #86adf1;
    color-scheme: dark;
  }
}

html[data-theme="light"] {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --text: #101722;
  --heading: #0a1220;
  --muted: #4b5a70;
  --border: #c7d0dd;
  --link: #1e5ecf;
  --link-hover: #15479d;
  --accent: #1e5ecf;
  --accent-soft: #d8e4fb;
  --input-bg: #ffffff;
  --button-text: #ffffff;
  --button-bg: #1e5ecf;
  --button-bg-hover: #15479d;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0d121a;
  --surface: #151c26;
  --surface-solid: #101720;
  --text: #e8eef8;
  --heading: #f3f7ff;
  --muted: #afbdd1;
  --border: #334259;
  --link: #9ec0ff;
  --link-hover: #c1d7ff;
  --accent: #8fb6ff;
  --accent-soft: #20334f;
  --input-bg: #111a27;
  --button-text: #081326;
  --button-bg: #9ec0ff;
  --button-bg-hover: #86adf1;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  line-height: 1.62;
  color: var(--text);
  background: var(--bg);
}

.page-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 22px 18px 46px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand {
  color: var(--heading);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.015em;
  font-size: 1.05rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 0;
  padding: 7px 12px;
  font-size: 0.9rem;
}

.nav-links a:hover {
  color: var(--heading);
  border-color: var(--accent);
}

.theme-switcher {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 0;
  overflow: hidden;
  background: var(--surface);
}

.theme-switcher button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  letter-spacing: 0.01em;
  padding: 7px 11px;
  min-width: 42px;
}

.theme-switcher button + button {
  border-left: 1px solid var(--border);
}

.theme-switcher button:hover {
  color: var(--heading);
  background: var(--accent-soft);
}

.theme-switcher button.is-active {
  background: var(--surface-solid);
  color: var(--heading);
  font-weight: 700;
}

.theme-icon {
  font-size: 1rem;
  line-height: 1;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: clamp(20px, 4vw, 34px);
}

h1,
h2 {
  color: var(--heading);
  line-height: 1.2;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(1.9rem, 5vw, 2.45rem);
  letter-spacing: -0.01em;
}

h2 {
  margin-top: 24px;
  margin-bottom: 8px;
  font-size: 1.18rem;
}

p,
li {
  margin-top: 0;
  color: var(--text);
}

ul {
  padding-left: 20px;
  margin-top: 6px;
}

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

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

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

a:hover {
  color: var(--link-hover);
}

.site-footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0 0 10px;
}

.support-form {
  max-width: 560px;
  margin-top: 14px;
}

.field {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  border-radius: 0;
  padding: 10px 12px;
  font: inherit;
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.field input:focus-visible,
.field textarea:focus-visible,
.theme-switcher button:focus-visible,
.button-primary:focus-visible,
.nav-links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.button-primary {
  appearance: none;
  border: 1px solid var(--button-bg);
  color: var(--button-text);
  background: var(--button-bg);
  border-radius: 0;
  font: inherit;
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
}

.button-primary:hover {
  background: var(--button-bg-hover);
  border-color: var(--button-bg-hover);
}

.subpage-links {
  margin-top: 16px;
}

@media (max-width: 640px) {
  .page-shell {
    padding-top: 16px;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }
}
