.guide-overlay[hidden] {
  display: none;
}

.guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2.5vw, 32px);
  background: rgba(6, 24, 43, 0.72);
  backdrop-filter: blur(8px);
}

.guide-dialog {
  --guide-blue: #164b79;
  --guide-accent: #e36b31;
  width: min(1120px, 100%);
  max-height: min(880px, calc(100dvh - 24px));
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(22, 75, 121, 0.22);
  border-radius: 24px;
  background: #ffffff;
  color: #102a43;
  box-shadow: 0 28px 90px rgba(6, 24, 43, 0.34);
}

.guide-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(20px, 3vw, 32px) clamp(20px, 3.5vw, 40px) 18px;
}

.guide-kicker {
  margin: 0 0 6px;
  color: var(--guide-accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.guide-header h2 {
  margin: 0;
  color: #0b2d4b;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  line-height: 1.2;
}

.guide-header p:last-child {
  margin: 8px 0 0;
  color: #526d82;
  font-size: 0.92rem;
}

.guide-icon-button,
.guide-arrow {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(22, 75, 121, 0.24);
  border-radius: 14px;
  background: #f4f7fa;
  color: var(--guide-blue);
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.guide-icon-button svg,
.guide-arrow svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.guide-icon-button:hover,
.guide-arrow:hover:not(:disabled) {
  border-color: var(--guide-blue);
  background: #eaf2f8;
  transform: translateY(-1px);
}

.guide-icon-button:focus-visible,
.guide-arrow:focus-visible {
  outline: 3px solid var(--guide-accent);
  outline-offset: 3px;
}

.guide-progress {
  height: 4px;
  margin: 0 clamp(20px, 3.5vw, 40px);
  overflow: hidden;
  border-radius: 999px;
  background: #dce6ee;
}

.guide-progress span {
  display: block;
  width: 5.263%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--guide-blue), var(--guide-accent));
  transition: width 180ms ease;
}

.guide-body {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: clamp(20px, 3vw, 34px);
  padding: clamp(20px, 3vw, 32px) clamp(20px, 3.5vw, 40px) 22px;
}

.guide-visual {
  align-self: start;
  margin: 0;
  overflow: hidden;
  border: 1px solid #d9e4ec;
  border-radius: 16px;
  background: #edf3f7;
  box-shadow: 0 14px 32px rgba(18, 52, 77, 0.12);
}

.guide-visual img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1265 / 798;
  object-fit: contain;
}

.guide-step-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.guide-step {
  color: var(--guide-blue);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.guide-mode {
  padding: 5px 9px;
  border-radius: 999px;
  background: #f7e9e0;
  color: #9a431f;
  font-size: 0.72rem;
  font-weight: 800;
}

.guide-copy h3 {
  margin: 10px 0 18px;
  color: #0b2d4b;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.3;
}

.guide-facts {
  display: grid;
  gap: 12px;
  margin: 0;
}

.guide-fact {
  padding: 12px 14px;
  border-left: 3px solid #b8cedf;
  border-radius: 0 10px 10px 0;
  background: #f4f7fa;
}

.guide-fact dt {
  margin: 0 0 4px;
  color: #1d5e8c;
  font-size: 0.77rem;
  font-weight: 900;
}

.guide-fact dd {
  margin: 0;
  color: #334e68;
  font-size: 0.88rem;
  line-height: 1.55;
}

.guide-navigation {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 16px;
  padding: 0 clamp(20px, 3.5vw, 40px) clamp(20px, 3vw, 32px);
}

.guide-arrow {
  border-color: var(--guide-blue);
  background: var(--guide-blue);
  color: #ffffff;
}

.guide-arrow:disabled {
  border-color: #d5dfe7;
  background: #e8eef3;
  color: #8ba0b1;
  cursor: not-allowed;
}

.guide-live {
  min-height: 1.2rem;
  margin: 0;
  text-align: center;
  color: #627d98;
  font-size: 0.8rem;
  font-weight: 700;
}

@media (max-width: 820px) {
  .guide-overlay {
    padding: 10px;
  }

  .guide-dialog {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 20px);
    max-height: calc(100dvh - 20px);
    overflow: hidden;
    border-radius: 18px;
  }

  .guide-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    grid-template-columns: 1fr;
    grid-auto-rows: max-content;
    align-content: start;
  }

  .guide-navigation {
    position: static;
    z-index: 2;
    flex: 0 0 auto;
    padding: 12px 20px 20px;
    background: #ffffff;
    box-shadow: 0 -10px 24px rgba(18, 52, 77, 0.08);
  }

  .guide-copy h3 {
    margin-bottom: 14px;
  }
}

@media (max-width: 480px) {
  .guide-header {
    gap: 12px;
    padding: 16px 16px 14px;
  }

  .guide-header p:last-child {
    font-size: 0.82rem;
  }

  .guide-progress {
    margin-inline: 16px;
  }

  .guide-body {
    gap: 16px;
    padding: 16px;
  }

  .guide-fact {
    padding: 10px 12px;
  }

  .guide-navigation {
    padding: 12px 16px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .guide-icon-button,
  .guide-arrow,
  .guide-progress span {
    transition: none;
  }
}
