/* Client setup guides: help-center article layout using Admit One tokens.
   Breadcrumbed hero, sticky sidebar with saved progress and a scroll-spy
   table of contents, then the article itself. */

/* ---------- Hero: breadcrumb, title, meta ---------- */

.guide-intro {
  padding-top: 30px;
  padding-bottom: 46px;
}

.guide-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-bottom: 18px;
  font-size: 0.84rem;
  font-weight: 800;
}

.guide-crumbs a {
  color: rgba(251, 247, 238, 0.66);
}

.guide-crumbs a:hover,
.guide-crumbs a:focus-visible {
  color: var(--warm);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  outline: 0;
}

.guide-crumbs span[aria-hidden] {
  color: rgba(251, 247, 238, 0.35);
}

.guide-crumbs span[aria-current] {
  color: var(--gold);
}

.guide-intro h1 {
  margin: 0 0 12px;
  max-width: 720px;
  font-size: 3.1rem;
  line-height: 0.96;
}

.guide-intro .lead {
  margin: 0;
  max-width: 620px;
  color: rgba(251, 247, 238, 0.74);
  font-size: 1.06rem;
}

.guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 18px;
  color: rgba(251, 247, 238, 0.68);
  font-size: 0.9rem;
}

.guide-meta span + span::before {
  content: "·";
  margin-right: 14px;
  color: rgba(251, 247, 238, 0.4);
}

.guide-meta-no {
  color: var(--gold);
  font-family: var(--serif);
  font-style: italic;
}

/* ---------- Shell: sidebar + article ---------- */

.guide-shell {
  display: grid;
  grid-template-columns: minmax(210px, 250px) minmax(0, 1fr);
  align-items: start;
  gap: 48px 64px;
  padding-top: 56px;
}

.guide-sidebar {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 22px;
}

.guide-progress {
  display: grid;
  gap: 8px;
}

.guide-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.guide-progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-2);
}

.guide-progress-track span {
  display: block;
  width: var(--guide-progress, 0%);
  height: 100%;
  background: var(--gold);
  transition: width 180ms ease;
}

.guide-progress-hint {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.guide-toc {
  display: grid;
  gap: 2px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.guide-toc p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.guide-toc a {
  display: block;
  padding: 6px 0 6px 12px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.3;
  transition: border-color 120ms ease, color 120ms ease;
}

.guide-toc a:hover,
.guide-toc a:focus-visible {
  border-left-color: var(--gold);
  color: var(--black);
  outline: 0;
}

.guide-toc a.is-current {
  border-left-color: var(--red);
  color: var(--black);
}

.guide-sidebar-help {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.guide-sidebar-help a {
  color: var(--black);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.16em;
}

/* ---------- Article ---------- */

.guide-content {
  min-width: 0;
  max-width: 720px;
}

.guide-section {
  scroll-margin-top: 96px;
  padding: 40px 0;
  border-top: 1px solid var(--line);
}

.guide-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.guide-section h2 {
  margin: 0 0 10px;
  font-size: 1.75rem;
  line-height: 1.1;
  text-align: left;
}

.guide-section p {
  color: var(--muted);
}

.guide-section a {
  color: var(--black);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

.guide-step-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 20px;
}

.guide-step-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.guide-step-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.guide-step-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--red);
}

.guide-step-check:focus-within {
  color: var(--black);
}

/* ---------- Step plan ---------- */

.guide-plan {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.guide-plan li {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.guide-plan li:first-child {
  border-top: 0;
}

.guide-plan-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guide-plan-three li {
  border-top: 0;
  border-left: 1px solid var(--line);
}

.guide-plan-three li:first-child {
  border-left: 0;
}

.guide-plan strong {
  color: var(--black);
  font-size: 0.94rem;
  line-height: 1.2;
}

.guide-plan span {
  color: var(--muted);
  font-size: 0.78rem;
}

/* ---------- Numbered instructions ---------- */

.guide-instructions {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: guide-step;
}

.guide-instructions li {
  position: relative;
  margin: 0;
  padding: 0 0 14px 36px;
  color: var(--black);
  font-size: 1rem;
  line-height: 1.55;
}

.guide-instructions li:last-child {
  padding-bottom: 0;
}

.guide-instructions li::before {
  counter-increment: guide-step;
  content: counter(guide-step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
}

/* ---------- Callouts and copy boxes ---------- */

.guide-callout,
.copy-box {
  margin-top: 20px;
  border-radius: var(--radius);
}

.guide-callout {
  padding: 14px 16px;
  border-left: 3px solid var(--gold);
  background: var(--paper-2);
}

.guide-callout strong {
  display: block;
  margin-bottom: 4px;
  color: var(--black);
  font-size: 0.94rem;
}

.guide-callout p {
  margin: 0;
}

.copy-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
}

.copy-box span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.copy-box strong {
  color: var(--black);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

/* ---------- Checklist template (copy-paste email) ---------- */

.guide-template {
  margin-top: 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
}

.guide-template-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 16px;
  border-bottom: 1px dashed var(--line-strong);
}

.guide-template-head > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.guide-template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.guide-template-actions .button {
  min-height: 36px;
  font-size: 0.78rem;
  text-decoration: none;
}

.guide-template pre {
  margin: 0;
  padding: 16px;
  color: var(--black);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- Route options (pick one, no numbering) ---------- */

.guide-routes {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
}

.guide-routes li {
  padding: 16px 18px;
  border-top: 1px solid var(--line);
}

.guide-routes li:first-child {
  border-top: 0;
}

.guide-routes strong {
  display: block;
  margin-bottom: 4px;
  color: var(--black);
  font-size: 1rem;
}

.guide-routes strong::before {
  content: "→ ";
  color: var(--red);
}

.guide-routes p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

/* ---------- Completion list ---------- */

.guide-complete-list {
  display: grid;
  gap: 0;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.guide-complete-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--black);
  font-size: 0.96rem;
}

.guide-complete-list li:last-child {
  border-bottom: 0;
}

.guide-complete-list span {
  display: none;
}

.guide-complete-list strong {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 800;
}

/* ---------- Feedback ---------- */

.guide-feedback {
  margin-top: 28px;
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.guide-feedback-question {
  margin: 0 0 14px;
  color: var(--black);
  font-size: 1rem;
  font-weight: 800;
}

.guide-feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.guide-feedback-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.guide-feedback.has-answer .guide-feedback-actions {
  display: none;
}

/* ---------- Previous / next ---------- */

.guide-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 32px 0 8px;
  border-top: 1px solid var(--line);
}

.guide-page-link {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--black);
  transition: background 150ms ease;
}

.guide-page-link.is-next {
  text-align: right;
}

.guide-page-link span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.guide-page-link strong {
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.25;
}

.guide-page-link.is-prev strong::before {
  content: "← ";
  color: var(--red);
}

a.guide-page-link.is-next strong::after {
  content: " →";
  color: var(--red);
}

a.guide-page-link:hover,
a.guide-page-link:focus-visible {
  background: var(--paper-2);
  outline: 0;
}

.guide-page-link.is-pending {
  border-style: dashed;
  color: var(--muted);
}

.guide-page-link.is-pending strong {
  font-weight: 400;
  font-style: italic;
}

/* ---------- Toast ---------- */

.guide-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  transform: translate(-50%, 16px);
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--black);
  color: var(--warm);
  font-size: 0.84rem;
  font-weight: 800;
  opacity: 0;
  visibility: hidden;
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.guide-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.guide-mobile-progress {
  display: none;
}

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

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .guide-shell {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .guide-sidebar {
    position: static;
  }

  .guide-content {
    max-width: none;
  }

  .guide-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding-top: 12px;
  }

  .guide-toc p {
    width: 100%;
  }

  .guide-toc a {
    padding: 0;
    border-left: 0;
    font-size: 0.88rem;
  }

  .guide-toc a:hover,
  .guide-toc a:focus-visible,
  .guide-toc a.is-current {
    color: var(--red);
  }

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

  .guide-plan-three li {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .guide-plan-three li:first-child {
    border-top: 0;
  }
}

@media (max-width: 760px) {
  body.has-guide-mobile-progress {
    padding-bottom: 72px;
  }

  .guide-intro {
    padding-bottom: 38px;
  }

  .guide-intro h1 {
    font-size: 2.4rem;
  }

  .guide-shell {
    padding-top: 44px;
  }

  .guide-section {
    padding: 32px 0;
  }

  .guide-section h2 {
    font-size: 1.5rem;
  }

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

  .guide-instructions li {
    padding-left: 32px;
    font-size: 0.96rem;
  }

  .copy-box {
    grid-template-columns: 1fr;
  }

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

  .guide-page-link.is-next {
    text-align: left;
  }

  .guide-mobile-progress {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 70;
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: var(--shadow);
  }

  .guide-mobile-progress-copy {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
  }

  .guide-mobile-progress-copy span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
  }

  .guide-mobile-progress-copy strong {
    color: var(--black);
    font-size: 0.88rem;
  }

  .guide-mobile-progress-track {
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--paper-2);
  }

  .guide-mobile-progress-track span {
    display: block;
    width: var(--guide-mobile-progress, 0%);
    height: 100%;
    background: var(--gold);
    transition: width 180ms ease;
  }
}

@media (max-width: 520px) {
  .copy-box .button {
    width: 100%;
  }
}
