/* v3 setup guide (HOWTO) styles. All classes prefixed .ht-. */

.ht-head { padding: 56px 0 40px; border-bottom: 1px solid var(--line); }

.ht-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 64px; padding: 48px 28px 72px; align-items: start; }
.ht-main { min-width: 0; }

/* TOC */
.ht-toc { position: sticky; top: 84px; align-self: start; }
.ht-toc-toggle { display: none; }
.ht-toc-title { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px 12px; font-weight: 500; }
.ht-toc-list a, .ht-toc-dl a {
  display: block; padding: 6px 12px; font-size: 14px; color: var(--ink-2);
  border-left: 2px solid var(--line); transition: all 0.12s; line-height: 1.4;
}
.ht-toc-list a:hover, .ht-toc-dl a:hover { color: var(--ink); background: var(--bg-soft); }
.ht-toc-list a.on { color: var(--ink); border-left-color: var(--ink); font-weight: 600; }
.ht-toc-dl { margin-top: 28px; }
.ht-toc-dl a { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

/* Sections */
.ht-section { scroll-margin-top: 92px; padding-bottom: 48px; margin-bottom: 48px; border-bottom: 1px solid var(--line); }
.ht-section:last-child { border-bottom: 0; margin-bottom: 0; }
.ht-h2 { margin-bottom: 18px; }
.ht-h3 { margin: 34px 0 10px; }
.ht-section p { margin: 0 0 14px; color: var(--ink-2); font-size: 16px; line-height: 1.6; max-width: 72ch; }
.ht-section p strong, .ht-section li strong { color: var(--ink); font-weight: 600; }
.ht-list { margin: 0 0 16px; padding-left: 22px; color: var(--ink-2); font-size: 16px; line-height: 1.6; max-width: 72ch; }
.ht-list li { margin-bottom: 8px; }
.ht-list li .ht-code { margin: 10px 0 4px; }
.ht-ol { counter-reset: none; }
.ht-link { color: var(--accent); font-weight: 500; text-decoration: underline; text-decoration-color: rgba(47,94,204,0.3); text-underline-offset: 3px; }
.ht-link:hover { text-decoration-color: var(--accent); }

/* Inline code */
.ht-k {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86em; color: var(--ink);
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 6px; overflow-wrap: anywhere;
}
.ht-section h1 .ht-k, .ht-section h2 .ht-k { font-size: 0.7em; }

/* Code blocks */
.ht-code { position: relative; margin: 10px 0 18px; background: #16171a; color: #e9e9e4; border-radius: 12px; overflow: hidden; }
.ht-code pre {
  margin: 0; padding: 16px 84px 16px 18px; overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.6;
  white-space: pre; -webkit-overflow-scrolling: touch;
}
.ht-code code { font-family: inherit; }
.ht-code-label { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; letter-spacing: 0.06em; color: rgba(233,233,228,0.55); padding: 10px 18px 0; }
.ht-copy {
  position: absolute; top: 10px; right: 10px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.10); color: #fff; border: 1px solid rgba(255,255,255,0.14);
  transition: background 0.12s;
}
.ht-copy:hover { background: rgba(255,255,255,0.2); }

/* Overview steps */
.ht-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 24px 0 24px; }
.ht-step { padding-top: 14px; border-top: 2px solid var(--ink); }
.ht-step-n { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--accent); letter-spacing: 0.1em; }
.ht-step-t { font-weight: 600; color: var(--ink); margin: 6px 0 6px; font-size: 16px; }
.ht-step p { font-size: 14.5px; margin: 0; line-height: 1.5; }

/* Notes */
.ht-note { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--bg-soft); border-radius: 0 12px 12px 0; padding: 16px 18px; margin: 18px 0 20px; font-size: 15px; color: var(--ink-2); line-height: 1.55; }
.ht-note p, .ht-note .ht-list { font-size: 15px; margin-bottom: 8px; }
.ht-note .ht-list { margin-bottom: 0; }
.ht-note-title { font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.ht-note-warn { border-left-color: #c0392b; background: #fbf2f0; }

/* Link cards */
.ht-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 18px 0 22px; }
.ht-linkcard { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.ht-linkcard-t { font-weight: 600; color: var(--ink); font-size: 16px; margin-bottom: 2px; }
.ht-linkcard p { font-size: 14.5px; margin: 0 0 6px; line-height: 1.5; }
.ht-linkcard .ht-link { font-size: 14px; }

/* Scripts */
.ht-scripts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 18px 0 8px; }
.ht-script { padding: 16px 18px; }
.ht-script-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.ht-script-n { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; font-size: 14px; color: var(--ink); }
.ht-script p { font-size: 14px; margin: 0; line-height: 1.5; }

/* URL picker */
.ht-picker { padding: 18px 20px; margin: 16px 0 20px; display: grid; gap: 16px; background: var(--bg-soft); border-color: transparent; }
.ht-picker-row p { margin: 4px 0 0; font-size: 14px; }
.ht-label { display: block; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 7px; font-weight: 500; }
.ht-select, .ht-input {
  width: 100%; padding: 11px 13px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg); color: var(--ink); outline: none; transition: all 0.14s;
}
.ht-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.ht-select:focus, .ht-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ht-err { color: #c0392b; }

/* FAQ / troubleshooting */
.ht-faq { display: grid; gap: 22px; margin-top: 6px; }
.ht-q { font-weight: 600; color: var(--ink); font-size: 16.5px; margin-bottom: 6px; line-height: 1.35; }
.ht-qa p { margin-bottom: 0; }

@media (max-width: 860px) {
  .ht-head { padding: 36px 0 28px; }
  .ht-layout { grid-template-columns: 1fr; gap: 28px; padding: 24px 16px 56px; }
  .ht-toc { position: static; }
  .ht-toc-toggle {
    display: flex; width: 100%; justify-content: space-between; align-items: center;
    padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg);
    font-size: 14px; font-weight: 600; color: var(--ink);
  }
  .ht-toc-caret { font-size: 10px; color: var(--ink-3); }
  .ht-toc-body { display: none; padding: 12px 0 4px; }
  .ht-toc-body.open { display: block; }
  .ht-toc-dl { margin-top: 18px; }
  .ht-section { scroll-margin-top: 76px; padding-bottom: 36px; margin-bottom: 36px; }
  .ht-steps { grid-template-columns: 1fr 1fr; gap: 16px; }
  .ht-links { grid-template-columns: 1fr; }
  .ht-scripts { grid-template-columns: 1fr; }
  .ht-code pre { padding-right: 18px; padding-top: 40px; font-size: 12.5px; }
  .ht-code-label + pre { padding-top: 12px; }
  .ht-code-label { padding-right: 80px; }
}

@media (max-width: 480px) {
  .ht-steps { grid-template-columns: 1fr; }
}
