:root {
  --header-footer-bg: #5A7D4F;   /* хедер и футер */
  --button-bg: #B35430;          /* кнопки */
  --page-bg: rgb(254, 242, 220);   /* фон страницы */
  --fg: #222;                    /* основной текст */
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--page-bg);
  color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.container {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  background: var(--header-footer-bg);
  border-bottom: 1px solid rgba(0,0,0,.05);
  position: sticky;
  top: 0;
  z-index: 10;
  color: #fff;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand .logo {
  display: block;
  height: 75px;
  width: auto;
  margin: 12px 0;
}
.site-header .nav a {
  margin-left: 16px;
  text-decoration: none;
  color: #fff;
}
.site-header .nav a:hover {
  text-decoration: underline;
}

/* Footer */
.site-footer {
  background: var(--header-footer-bg);
  border-top: 1px solid rgba(0,0,0,.05);
  margin-top: 40px;
  padding: 16px 0;
  color: #fff;
}

/* Hero */
.hero {
  padding: 48px 0;
  text-align: center;
}
.hero .btn {
  display: inline-block;
  margin: 6px;
  padding: 10px 16px;
  border-radius: 6px;
  background: var(--button-bg);
  color: #fff;
  text-decoration: none;
  border: 1px solid var(--button-bg);
}
.hero .btn.secondary {
  background: var(--button-bg);
  border: 1px solid var(--button-bg);
}

/* Headings */
.page h1, .insert h1 {
  font-size: 28px;
  margin: 16px 0;
}
@media(max-width:600px){
  .page h1, .insert h1 {
    font-size: 20px;
  }
}

/* Images: desktop centered (not full-bleed), mobile full-bleed */
.scan {
  margin: 0;
}
.scan img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}
@media(max-width:768px){
  .scan {
    margin: 0 calc(50% - 50vw);
  }
  .scan img {
    width: 100vw;
    max-width: none;
  }
}

/* Toggle text block */
.text-toggle {
  margin: 16px 0;
  padding: 8px;
  background: var(--page-bg);
  border-radius: 8px;
  color: #000000;
}
.text-body {
  white-space: pre-line;
  padding: 12px;
  background: rgba(255,255,255,.6);
  border: 1px dashed #9f8e7b;
  border-radius: 8px;
  color: var(--fg);
}

/* Pager: buttons on edges */
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.pager a {
  padding: 8px 14px;
  background: var(--button-bg);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid var(--button-bg);
}
.pager a:hover {
  opacity: 0.9;
}

/* Goto form */
.goto-form {
  margin: 12px 0;
  text-align: center;
}
.goto-form input {
  padding: 8px 10px;
  font-size: 16px;
  width: 200px;
  border: 1px solid #b79c7c;
  border-radius: 6px;
  appearance: textfield;
}
.goto-form input::-webkit-outer-spin-button,
.goto-form input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.goto-form input[type=number] {
  -moz-appearance: textfield;
}
.goto-form button {
  padding: 8px 14px;
  font-size: 16px;
  border-radius: 6px;
  background: var(--button-bg);
  border: 1px solid var(--button-bg);
  color: #fff;
  cursor: pointer;
}

/* Dropdown */
select {
  background: var(--page-bg);
  border: 1px solid #ccc;
  color: var(--fg);
}

/* Links default */
a {
  color: #000;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Inserts list */
.inserts-list {
  list-style: none;
  padding: 0;
}
.inserts-list li {
  margin: 8px 0;
}

/* Table of contents: два столбца */
.toc-links {
  column-count: 2;     /* количество столбцов */
  column-gap: 2em;     /* расстояние между столбцами */
}
.toc-links a {
  display: block;      /* каждая ссылка на новой строке */
  margin-bottom: 0.4em;
}
/* На маленьких экранах — один столбец */
@media(max-width: 600px) {
  .toc-links {
    column-count: 1;
  }
}

.donate-wrapper iframe {
  width: 500px;
  height: 480px;
  border: none;
  display: block;
  margin: 0 auto;
}

/* На экранах до 600px шириной */
@media (max-width: 600px) {
  .donate-wrapper iframe {
    width: 100% !important;
    height: 650px; /* увеличь так, чтобы кнопка точно влезала */
  }
}

.not-found {
  text-align: center;
  padding: 80px 20px;
}

.not-found h1 {
  font-size: 2rem;
  margin-bottom: 16px;
}

.not-found p {
  margin: 12px 0;
}

.not-found .button {
  display: inline-block;
  padding: 10px 20px;
  background: var(--button-bg);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  transition: background .2s;
}

.not-found .button:hover {
  background: #933a21; /* чуть темнее */
}

.not-found-img {
  width: 100%;
  height: auto;
  margin: 20px auto;
  display: block;
}

/* Ограничение на десктопах */
@media (min-width: 601px) {
  .not-found-img {
    max-width: 600px;
  }
}

.support-link {
  text-decoration: underline;
  text-underline-offset: 2px; /* чуть расстояния от текста, красиво смотрится */
  font-weight: 600;           /* опционально — сделать чуть заметнее */
  color: inherit;             /* чтобы цвет не ломался — наследует основной цвет */
}

/* небольшой ховер-эффект — опционально */
.support-link:hover,
.support-link:focus {
  opacity: 0.9;
  outline: none;
  text-decoration-thickness: 2px;
}
