* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f5f5f7;
  color: #1d1d1f;
  font-family: var(--layout-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  -webkit-font-smoothing: antialiased;
}

.guide-main {
  width: min(100%, 1120px);
  margin: 42px auto 56px;
  padding: 0 clamp(14px, 3vw, 24px);
}

.guide-hero {
  max-width: 760px;
  margin: 0 auto 30px;
  text-align: center;
}

.guide-hero h1 {
  display: inline-block;
  margin: 0 0 4px;
  padding: 0.06em 0 0.14em;
  background: linear-gradient(90deg, #0084ff 30%, #ff6600 60%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  font-size: clamp(38px, 5vw, 48px);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  overflow: visible;
  text-shadow: 0 0 70px rgba(255, 159, 64, 0.9);
}

.guide-hero p {
  margin: 0;
  color: #86868b;
  font-size: clamp(17px, 2.2vw, 21px);
  line-height: 1.45;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(18px, 3vw, 28px);
}

.guide-card,
.guide-empty {
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.035);
}

.guide-card {
  padding: clamp(18px, 2.6vw, 26px);
}

.guide-card-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-bottom: 18px;
}

.guide-step {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e8f2ff;
  color: #0071e3;
  font-size: 13px;
  font-weight: 750;
}

.guide-card h2 {
  margin: 0;
  color: #1d1d1f;
  font-size: clamp(19px, 2.4vw, 23px);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.25;
}

.guide-video {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  background: #111113;
}

.guide-video--portrait,
.guide-video--auto.is-portrait {
  width: min(100%, 360px);
  aspect-ratio: 9 / 16;
  margin-inline: auto;
}

.guide-video iframe,
.guide-video video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.guide-video video {
  object-fit: contain;
}

.guide-empty {
  max-width: 620px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 34px);
  text-align: center;
}

.guide-empty p {
  margin: 0;
  color: #86868b;
  font-size: 16px;
  line-height: 1.55;
}

@media (max-width: 700px) {
  .guide-main {
    margin-top: 28px;
  }

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

  .guide-card {
    padding: 18px;
  }

  .guide-video {
    border-radius: 15px;
  }
}

/* Main-domain installation guide.
   Typography and colors intentionally mirror terms.php. */
.guide-main-page {
  --guide-bg: #f5f5f7;
  --guide-text: #1d1d1f;
  --guide-sub: #6e6e73;
  --guide-line: #d2d2d7;
  --guide-blue: #0071e3;
  --guide-blue-hover: #0077ed;
  --layout-footer-margin-top: 20px;
  background: var(--guide-bg);
  color: var(--guide-text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.guide-main-page.guide-video-modal-open {
  overflow: hidden;
}

.guide-main-home {
  width: auto;
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 16px 0;
  line-height: 1.7;
}

.guide-home-heading {
  margin: 0 0 22px;
}

.guide-home-heading h1 {
  width: fit-content;
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -.03em;
  color: #304cca;
  background: linear-gradient(90deg, #304cca 0%, #2596d6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.guide-home-intro {
  margin: 0;
  color: var(--guide-sub);
  font-size: 16px;
}

.guide-home-content {
  background: transparent;
  counter-reset: guide-section;
}

.guide-home-toc {
  border: 0;
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
}

.guide-home-toc-title {
  margin: 0 0 8px;
  color: var(--guide-sub);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
}

.guide-home-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: guide-toc;
}

.guide-home-toc li {
  counter-increment: guide-toc;
}

.guide-home-toc li::before {
  content: counter(guide-toc) ". ";
  color: var(--guide-sub);
}

.guide-home-toc a {
  color: var(--guide-blue);
  text-decoration: none;
}

.guide-home-toc a:hover,
.guide-home-toc a:focus-visible {
  color: var(--guide-blue-hover);
  text-decoration: underline;
}

.guide-home-section {
  scroll-margin-top: 24px;
  margin: 0 0 32px;
  counter-increment: guide-section;
}

.guide-home-section:last-child {
  margin-bottom: 0;
}

.guide-home-section h2 {
  margin: 28px 0 10px;
  color: var(--guide-blue);
  font-size: 21px;
  letter-spacing: -.02em;
  line-height: 1.3;
}

.guide-home-section h2::before {
  content: counter(guide-section) ". ";
}

.guide-home-section h3 {
  margin: 18px 0 8px;
  color: var(--guide-text);
  font-size: 17px;
  letter-spacing: -.01em;
  line-height: 1.35;
}

.guide-home-section p,
.guide-home-section li {
  margin: 0 0 10px;
  font-size: 16px;
}

.guide-home-section p strong,
.guide-home-section li strong {
  font-weight: 700;
}

.guide-home-section-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: nowrap;
}

.guide-home-section-heading h2 {
  min-width: 0;
  flex: 0 1 auto;
  margin-bottom: 10px;
}

.guide-home-media {
  margin: 14px auto 18px;
  text-align: center;
}

.guide-home-media img {
  display: block;
  width: auto;
  max-width: min(100%, 760px);
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
}

.guide-home-media--order img {
  max-height: 520px;
}

.guide-home-steps {
  display: grid;
  gap: 22px;
}

.guide-home-step {
  margin: 0;
}

.guide-home-step-copy {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.guide-home-step-copy h3 {
  flex: 0 0 auto;
  margin: 0;
  white-space: nowrap;
}

.guide-home-step-copy p {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 0 10px;
}

.guide-home-step + .guide-home-step {
  border-top: 1px dashed var(--guide-line);
  padding-top: 10px;
}

.guide-home-errors {
  margin: 0 0 10px 20px;
  padding: 0;
}

.guide-video-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin-top: 20px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(0, 128, 255, .92), rgba(0, 113, 227, .82)),
    var(--layout-glass-control-bg);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--layout-liquid-glass-shadow);
  backdrop-filter: blur(8px) saturate(160%);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.guide-video-open:hover,
.guide-video-open:focus-visible {
  background:
    linear-gradient(180deg, rgba(0, 139, 255, .98), rgba(0, 119, 237, .9)),
    var(--layout-glass-control-hover-bg);
  color: #fff;
  box-shadow:
    var(--layout-liquid-glass-shadow),
    0 8px 18px rgba(0, 113, 227, .24);
  transform: translateY(-1px);
}

.guide-video-open:active {
  transform: translateY(0);
}

.guide-video-open:focus-visible {
  outline: 2px solid rgba(36, 95, 242, .45);
  outline-offset: 3px;
}

.guide-video-open svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.guide-video-dialog {
  width: min(92vw, 920px);
  max-height: min(92vh, 860px);
  padding: 0;
  overflow: hidden;
}

.guide-video-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(210, 210, 215, .7);
}

.guide-video-dialog-header h2 {
  margin: 0;
  color: var(--guide-text);
  font-size: 19px;
  line-height: 1.3;
}

.guide-video-close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(118, 118, 128, .12);
  color: var(--guide-text);
  cursor: pointer;
}

.guide-video-close:hover,
.guide-video-close:focus-visible {
  background: rgba(118, 118, 128, .2);
}

.guide-video-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.guide-video-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #111113;
}

.guide-video-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111113;
}

@media (max-width: 640px) {
  .guide-main-home {
    padding: 18px 16px 0;
  }

  .guide-home-heading h1 {
    font-size: 26px;
  }

  .guide-home-section h2 {
    font-size: 19px;
  }

  .guide-home-section h3 {
    font-size: 16px;
  }

  .guide-home-section p,
  .guide-home-section li {
    font-size: 15px;
  }

  .guide-home-media--order img {
    max-height: 340px;
  }

  .guide-home-step-copy {
    align-items: flex-start;
  }

  .guide-home-section-heading {
    gap: 10px;
  }

  .guide-video-open {
    flex: 0 0 auto;
    padding: 7px 9px;
    font-size: 15px;
  }

  .guide-video-dialog {
    width: min(96vw, 920px);
    max-height: 88vh;
    border-radius: 20px;
  }

  .guide-video-frame {
    width: min(100%, 390px);
    height: min(76vh, 690px);
    aspect-ratio: 9 / 16;
    margin: 0 auto;
  }

  .guide-video-dialog-header {
    padding: 12px;
  }

  .guide-video-dialog-header h2 {
    font-size: 16px;
  }
}

