:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-soft: #eef4ff;
  --ink: #10182f;
  --muted: #5c6680;
  --line: #d8e0ee;
  --primary: #6c2eb9;
  --primary-dark: #4d2387;
  --cyan: #00a7c7;
  --success: #15865d;
  --shadow: 0 10px 28px rgba(16, 24, 47, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: var(--primary-dark);
}

button,
input,
textarea,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  border-radius: 7px;
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.language-picker span {
  color: var(--muted);
  font-size: 11px;
}

.language-picker {
  display: grid;
  gap: 1px;
}

.language-picker select {
  max-width: 112px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  background: white;
  color: var(--ink);
}

.header-link {
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 760px);
  gap: 22px;
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 18px 16px 36px;
}

.toc {
  position: sticky;
  top: 76px;
  align-self: start;
}

.toc-toggle {
  display: none;
}

.toc-links {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.toc-links a {
  padding: 7px 8px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
}

.toc-links a:hover,
.toc-links a:focus {
  color: var(--primary-dark);
  background: var(--surface-soft);
}

.content {
  min-width: 0;
}

.single-page {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 18px 16px 36px;
}

.hero,
.guide-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 26px 22px;
  margin-bottom: 16px;
  border-top: 5px solid var(--primary);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.18;
  letter-spacing: 0;
}

h1 {
  font-size: 31px;
}

h2 {
  font-size: 24px;
}

.hero-summary,
.section-summary {
  color: var(--muted);
}

.hero-summary {
  max-width: 640px;
  margin: 12px 0 16px;
  font-size: 17px;
}

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

.badges span {
  padding: 5px 8px;
  color: var(--primary-dark);
  background: #f2ebff;
  border: 1px solid #e2d2ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.guide-section {
  padding: 20px;
  margin-bottom: 16px;
  scroll-margin-top: 78px;
}

.plain-list,
.steps {
  padding-left: 20px;
}

.plain-list li,
.steps li {
  margin: 9px 0;
}

.steps strong {
  display: block;
  margin-bottom: 3px;
  color: var(--primary-dark);
}

.steps p {
  margin: 0;
}

.screen {
  margin: 16px auto;
  text-align: center;
}

.screen img {
  display: block;
  width: min(100%, 250px);
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
  box-shadow: 0 8px 22px rgba(16, 24, 47, 0.13);
}

.screen-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.compact-screen {
  margin: 0;
}

.compact-screen img {
  width: min(100%, 156px);
}

.facts {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.facts dt,
.facts dd {
  margin: 0;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  color: var(--muted);
  background: #f4f7fb;
  font-weight: 700;
}

.facts dd {
  background: white;
}

.facts dt:last-of-type,
.facts dd:last-of-type {
  border-bottom: 0;
}

.note {
  padding: 11px 12px;
  color: #0d4d40;
  background: #eafaf5;
  border-left: 4px solid var(--success);
  border-radius: 6px;
}

.back-top {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.site-footer {
  padding: 24px 16px 34px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--line);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px 14px;
  margin-top: 8px;
}

.footer-links a {
  font-size: 13px;
}

.loading,
.error {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.error-text {
  color: #b42318;
}

.status-message {
  margin-top: 0;
  color: var(--muted);
}

.admin-form {
  display: grid;
  gap: 14px;
}

.admin-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-weight: 700;
}

.admin-form input,
.admin-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--ink);
  background: white;
}

.version-rows {
  display: grid;
  gap: 10px;
}

.version-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  background: #f6f8fc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.button,
.icon-button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  color: white;
  background: var(--primary-dark);
  font-weight: 700;
  cursor: pointer;
}

.button {
  padding: 8px 13px;
}

.button.secondary {
  color: var(--primary-dark);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.icon-button {
  width: 36px;
  padding: 0;
}

@media (max-width: 720px) {
  body {
    font-size: 15px;
  }

  .site-header {
    padding: 7px 9px;
  }

  .brand strong {
    font-size: 14px;
  }

  .layout {
    display: block;
    padding: 10px 8px 28px;
  }

  .toc {
    position: sticky;
    top: 57px;
    z-index: 15;
    margin-bottom: 10px;
  }

  .toc-toggle {
    display: block;
    width: 100%;
    min-height: 38px;
    color: white;
    background: var(--primary-dark);
    border: 0;
    border-radius: 7px;
    font-weight: 700;
  }

  .toc-links {
    display: none;
    margin-top: 6px;
    box-shadow: 0 8px 18px rgba(16, 24, 47, 0.13);
  }

  .toc-links.open {
    display: grid;
  }

  .hero,
  .guide-section {
    border-radius: 7px;
  }

  .hero {
    padding: 20px 15px;
  }

  .guide-section {
    padding: 17px 14px;
    scroll-margin-top: 104px;
  }

  h1 {
    font-size: 25px;
  }

  h2 {
    font-size: 21px;
  }

  .hero-summary {
    font-size: 15px;
  }

  .screen img {
    width: min(100%, 214px);
  }

  .screen-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-screen img {
    width: min(100%, 128px);
  }

  .facts {
    grid-template-columns: 1fr;
  }

  .facts dt {
    border-bottom: 0;
  }

  .version-row {
    grid-template-columns: 1fr;
  }

  .icon-button {
    width: 100%;
  }
}

@media (max-width: 280px) {
  .brand small,
  .language-picker span {
    display: none;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .language-picker select {
    max-width: 94px;
  }

  .screen-gallery {
    grid-template-columns: 1fr;
  }
}
