: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-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 82px;
  height: 34px;
  padding: 0 10px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: 7px;
  box-shadow: 0 6px 14px rgba(77, 35, 135, 0.18);
}

.brand-logo img {
  display: block;
  width: 62px;
  height: auto;
}

.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;
}

.step-screen {
  margin: 10px 0 4px;
  text-align: left;
}

.step-screen img {
  width: min(100%, 170px);
  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;
}

.step-gallery {
  margin-top: 10px;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.compact-screen {
  margin: 0;
}

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

.facts {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.fact-item {
  padding: 13px 16px;
  background: white;
  border-bottom: 1px solid var(--line);
}

.fact-item:nth-child(odd) {
  background: #f7f9fd;
}

.fact-item:last-child {
  border-bottom: 0;
}

.facts dt,
.facts dd {
  margin: 0;
}

.facts dt {
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.35;
}

.facts dd {
  position: relative;
  margin-top: 8px;
  padding-left: 18px;
  color: var(--ink);
  font-size: 18px;
}

.facts dd::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.45em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--primary);
}

.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 {
  margin-top: 8px;
  padding: 22px 16px 26px;
  color: var(--muted);
  background: #f2f5fb;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
  width: min(1040px, 100%);
  margin: 0 auto;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.footer-logo {
  flex: 0 0 auto;
  width: 78px;
  height: 32px;
  border-radius: 7px;
}

.footer-logo img {
  width: 58px;
}

.footer-brand strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
}

.footer-brand p {
  margin: 1px 0 0;
  font-size: 12px;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.footer-action {
  display: grid;
  gap: 4px;
  min-height: 86px;
  padding: 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  line-height: 1.2;
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.08s ease;
}

.footer-action strong {
  color: var(--primary-dark);
  font-size: 14px;
}

.footer-action span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.footer-action:hover,
.footer-action:focus {
  border-color: var(--primary-dark);
  box-shadow: 0 8px 18px rgba(16, 24, 47, 0.1);
}

.footer-action:active {
  transform: translateY(1px);
}

.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);
}

.success-text {
  color: var(--success);
  font-weight: 700;
}

.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;
  transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.08s ease;
}

.button:active,
.icon-button:active {
  transform: translateY(1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.82;
}

.button.is-saving {
  background: #6b7280;
}

.button.is-saved {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(21, 134, 93, 0.15);
}

.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;
  }

  .site-footer {
    padding: 16px 12px 22px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .footer-links {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .footer-action {
    min-height: 0;
    padding: 11px 12px;
  }

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

  .toc-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 38px;
    color: white;
    background: var(--primary-dark);
    border: 0;
    border-radius: 7px;
    font-weight: 700;
  }

  .toc-chevron {
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.18s ease;
  }

  .toc-toggle[aria-expanded="true"] .toc-chevron {
    transform: rotate(225deg) translateY(-2px);
  }

  .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);
  }

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

  .fact-item {
    padding: 12px 14px;
  }

  .facts dd {
    font-size: 17px;
  }

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

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

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

  .brand-logo {
    width: 70px;
    height: 30px;
    padding: 0 8px;
  }

  .brand-logo img {
    width: 54px;
  }

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

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