/* ============================================================
   SquarePact — Guide layout framework (scoped to .sp-install)
   Shared by the setup-guide pages (Quick Start, OpenClaw Setup).
   Sidebar TOC + numbered steps + callouts + troubleshooting.
   Uses Barlow / Barlow Condensed; load those fonts on the page.
   ============================================================ */
.sp-install {
  --bg: #F9F7F1;
  --beige-accent: #E5D0AC;
  --dark-red: #6D2323;
  --green: #187C50;
  --brown: #7A4F2D;
  --gray: #2C2B2E;
  font-family: 'Barlow', sans-serif;
  color: var(--gray);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}
.sp-install *, .sp-install *::before, .sp-install *::after { box-sizing: border-box; }
.sp-install h2, .sp-install h3, .sp-install h4 { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; line-height: 1.15; }
.sp-install a { text-decoration: none; color: var(--dark-red); }
.sp-install a:hover { text-decoration: underline; }

.sp-layout { max-width: 1100px; margin: 0 auto; padding: 8px 0 24px; display: grid; grid-template-columns: 220px 1fr; gap: 56px; align-items: start; }

.sp-toc { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 110px); overflow-y: auto; padding-right: 8px; }
.sp-toc-title { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brown); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--beige-accent); }
.sp-toc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-toc-list a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 4px; font-size: 14px; color: #555; font-weight: 500; text-decoration: none; border-left: 2px solid transparent; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.sp-toc-list a:hover { background: rgba(109,35,35,0.05); color: var(--dark-red); text-decoration: none; }
.sp-toc-list a.sp-active { color: var(--dark-red); background: rgba(109,35,35,0.06); border-left-color: var(--dark-red); }
.sp-toc-num { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 13px; width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; background: var(--beige-accent); color: var(--brown); display: flex; align-items: center; justify-content: center; }
.sp-toc-list a.sp-active .sp-toc-num { background: var(--dark-red); color: #fff; }
.sp-toc-help { margin-top: 24px; padding: 16px; background: var(--beige-accent); border-radius: 6px; }
.sp-toc-help h4 { font-size: 16px; color: var(--dark-red); margin-bottom: 6px; }
.sp-toc-help p { font-size: 13px; color: var(--brown); line-height: 1.55; margin-bottom: 10px; }
.sp-toc-help a { font-size: 13px; color: var(--dark-red); font-weight: 600; }

.sp-content { padding-bottom: 8px; }
.sp-step { padding: 48px 0; border-bottom: 1px dashed var(--beige-accent); }
.sp-step:last-child { border-bottom: none; }
.sp-step:first-child { padding-top: 8px; }
.sp-step-header { display: flex; align-items: baseline; gap: 16px; margin-bottom: 12px; }
.sp-step-number { font-family: 'Barlow Condensed', sans-serif; font-size: 56px; font-weight: 800; color: var(--dark-red); line-height: 1; flex-shrink: 0; }
.sp-step-meta { flex: 1; }
.sp-step-time { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brown); margin-bottom: 4px; }
.sp-step-title { font-family: 'Barlow Condensed', sans-serif; font-size: clamp(28px, 3vw, 38px); font-weight: 700; color: var(--gray); line-height: 1.15; }
.sp-step-body { max-width: 720px; }
.sp-step-body > p { font-size: 17px; color: #444; margin-bottom: 18px; line-height: 1.7; }
.sp-step-body > p:first-child { font-size: 19px; color: #333; }
.sp-step-body strong { color: var(--gray); font-weight: 600; }

.sp-callout { margin: 24px 0; padding: 18px 22px; border-radius: 6px; border-left: 4px solid; display: flex; gap: 14px; }
.sp-callout.tip  { background: rgba(24,124,80,0.07); border-left-color: var(--green); }
.sp-callout.note { background: rgba(109,35,35,0.05); border-left-color: var(--dark-red); }
.sp-callout.warn { background: rgba(218,165,32,0.1); border-left-color: #b8860b; }
.sp-callout-icon { font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; flex-shrink: 0; }
.sp-callout.tip  .sp-callout-icon { color: var(--green); }
.sp-callout.note .sp-callout-icon { color: var(--dark-red); }
.sp-callout.warn .sp-callout-icon { color: #b8860b; }
.sp-callout-body { font-size: 15px; line-height: 1.6; color: #333; }
.sp-callout-body code, .sp-step-body p code { font-family: 'SF Mono', 'Consolas', monospace; font-size: 13.5px; background: #f0ece4; padding: 2px 6px; border-radius: 3px; color: var(--dark-red); }

ol.sp-instructions { list-style: none; counter-reset: ins; margin: 24px 0; padding: 0; }
ol.sp-instructions li { counter-increment: ins; padding: 14px 0 14px 44px; position: relative; border-bottom: 1px solid #ece6d8; font-size: 16px; color: #444; line-height: 1.65; }
ol.sp-instructions li:last-child { border-bottom: none; }
ol.sp-instructions li::before { content: counter(ins); position: absolute; left: 0; top: 12px; width: 28px; height: 28px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--dark-red); color: var(--dark-red); font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
ol.sp-instructions code { font-family: 'SF Mono', 'Consolas', monospace; font-size: 14px; background: #f0ece4; padding: 2px 6px; border-radius: 3px; color: var(--dark-red); }

.sp-troubleshoot details { background: #fff; border: 1px solid var(--beige-accent); border-radius: 6px; margin-bottom: 10px; overflow: hidden; }
.sp-troubleshoot summary { padding: 16px 20px; cursor: pointer; font-family: 'Barlow Condensed', sans-serif; font-size: 19px; font-weight: 700; color: var(--gray); list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; user-select: none; }
.sp-troubleshoot summary::-webkit-details-marker { display: none; }
.sp-troubleshoot summary::after { content: '+'; font-size: 22px; color: var(--dark-red); width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform 0.2s; }
.sp-troubleshoot details[open] summary::after { transform: rotate(45deg); }
.sp-troubleshoot details > div { padding: 0 20px 18px; font-size: 15px; line-height: 1.65; color: #555; }
.sp-troubleshoot details > div p { margin-bottom: 10px; }
.sp-troubleshoot details > div p:last-child { margin-bottom: 0; }
.sp-troubleshoot details > div code { font-family: 'SF Mono', 'Consolas', monospace; font-size: 13.5px; background: #f0ece4; padding: 2px 6px; border-radius: 3px; color: var(--dark-red); }

.sp-checklist { background: var(--gray); color: #fff; border-radius: 8px; padding: 36px 40px; margin: 32px 0; }
.sp-checklist h3 { font-family: 'Barlow Condensed', sans-serif; font-size: 26px; color: #fff; margin-bottom: 8px; }
.sp-checklist > p { color: rgba(255,255,255,0.7); font-size: 15px; margin-bottom: 20px; }
.sp-checklist-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.sp-checklist-items li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.85); font-size: 16px; line-height: 1.5; }
.sp-checklist-items li:first-child { border-top: none; padding-top: 0; }
.sp-checkbox { width: 22px; height: 22px; border: 1.5px solid var(--beige-accent); border-radius: 4px; flex-shrink: 0; margin-top: 1px; }

@media (max-width: 860px) {
  .sp-layout { grid-template-columns: 1fr; gap: 24px; padding: 8px 0; }
  .sp-toc { position: static; max-height: none; padding-right: 0; }
  .sp-step-header { flex-direction: column; gap: 4px; }
  .sp-step-number { font-size: 40px; }
}
