/* SolarKnock Help Center — same palette and type as /api (static-landing/api.html). */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0B1120;
  --bg-elev: #111827;
  --bg-hover: #172033;
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.14);
  --text: #F9FAFB;
  --text-body: #CBD5E1;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;
  --accent: #F59E0B;
  --accent-soft: rgba(245, 158, 11, 0.12);
  --tip: #10B981;
  --important: #EF4444;
}
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Top nav ─────────────────────────────────────────────────────────────── */
nav.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 64px; padding: 0 24px;
  display: flex; align-items: center; gap: 20px;
  background: rgba(11, 17, 32, 0.9);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; white-space: nowrap; }
.nav-logo:hover { text-decoration: none; }
.nav-logo .accent { color: var(--accent); }
.nav-section { color: var(--text-muted); font-weight: 600; font-size: 0.9rem; white-space: nowrap; }
.nav-section:hover { color: var(--text); text-decoration: none; }
.nav-search { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.nav-cta {
  padding: 8px 14px; border-radius: 8px; background: var(--accent); color: #000;
  font-weight: 700; font-size: 0.85rem; white-space: nowrap;
}
.nav-cta:hover { text-decoration: none; filter: brightness(1.08); }

/* ── Search ──────────────────────────────────────────────────────────────── */
.help-search {
  width: 100%; height: 38px; padding: 0 12px 0 36px;
  border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--bg-elev) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m14 14-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center;
  color: var(--text); font: inherit; font-size: 0.92rem;
}
.help-search::placeholder { color: var(--text-dim); }
.help-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 200;
  max-height: min(70vh, 560px); overflow-y: auto;
  background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: 10px;
  box-shadow: 0 20px 50px -12px rgba(0,0,0,0.7);
}
.search-results a {
  display: block; padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text-body);
}
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover, .search-results a.active { background: var(--bg-hover); text-decoration: none; }
.search-results .r-title { display: block; color: var(--text); font-weight: 600; font-size: 0.93rem; }
.search-results .r-meta { display: block; color: var(--accent); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.02em; margin: 1px 0 3px; }
.search-results .r-snip { display: block; color: var(--text-muted); font-size: 0.84rem; line-height: 1.5; }
.search-results mark { background: var(--accent-soft); color: var(--text); border-radius: 3px; padding: 0 1px; }
.search-results .r-empty { padding: 14px; color: var(--text-muted); font-size: 0.9rem; }

/* ── Front page ──────────────────────────────────────────────────────────── */
.hero { padding: 132px 24px 48px; text-align: center; }
.hero h1 { color: var(--text); font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; }
.hero p { color: var(--text-muted); margin: 10px auto 26px; font-size: 1.05rem; }
.hero-search { position: relative; max-width: 620px; margin: 0 auto; text-align: left; }
.hero-input { height: 52px; font-size: 1.02rem; padding-left: 42px; background-position: 15px center; border-radius: 12px; }
.topics {
  width: 100%; max-width: 1120px; margin: 0 auto; padding: 8px 24px 64px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px;
  flex: 1;
}
.topic { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; padding: 22px 22px 16px; }
.topic h2 { color: var(--text); font-size: 1.08rem; font-weight: 700; }
.topic > p { color: var(--text-muted); font-size: 0.88rem; margin: 4px 0 12px; }
.topic ul { list-style: none; }
.topic li { padding: 8px 0; border-top: 1px solid var(--border); }
.topic li a { font-weight: 600; font-size: 0.93rem; }
.topic li span { display: block; color: var(--text-dim); font-size: 0.82rem; line-height: 1.45; margin-top: 1px; }

/* ── Article layout ──────────────────────────────────────────────────────── */
.layout {
  width: 100%; max-width: 1180px; margin: 0 auto; padding: 88px 24px 48px;
  display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; flex: 1;
}
.side { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 104px); overflow-y: auto; padding-bottom: 16px; }
.side > summary { display: none; }
.side-group { margin-bottom: 18px; }
.side-title { color: var(--text-dim); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 6px; }
.side a { display: block; color: var(--text-muted); font-size: 0.88rem; padding: 4px 10px; border-left: 2px solid transparent; line-height: 1.4; }
.side a:hover { color: var(--text); text-decoration: none; }
.side a.current { color: var(--text); border-left-color: var(--accent); background: var(--accent-soft); border-radius: 0 6px 6px 0; }

.article { max-width: 760px; }
.crumbs { font-size: 0.84rem; color: var(--text-dim); margin-bottom: 10px; }
.crumbs a { color: var(--text-muted); }
.article h1 { color: var(--text); font-size: clamp(1.7rem, 4vw, 2.2rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.lede { color: var(--text-muted); font-size: 1.06rem; margin: 10px 0 24px; }
.toc { border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 28px; background: var(--bg-elev); }
.toc-title { color: var(--text-dim); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 6px; }
.toc a { display: block; font-size: 0.9rem; padding: 2px 0; }

.prose h2 { color: var(--text); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; margin: 34px 0 10px; position: relative; }
.prose h3 { color: var(--text); font-size: 1.08rem; font-weight: 700; margin: 24px 0 8px; position: relative; }
.prose .anchor { position: absolute; left: -1.1em; color: var(--text-dim); opacity: 0; font-weight: 500; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; text-decoration: none; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose li > ul, .prose li > ol { margin: 4px 0 0; }
.prose strong { color: var(--text); font-weight: 650; }
.prose code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.86em; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; color: var(--text); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }
.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--border); border-radius: 10px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { color: var(--text); background: var(--bg-elev); font-weight: 650; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.callout { border: 1px solid var(--border-strong); border-left: 3px solid var(--text-dim); background: var(--bg-elev); border-radius: 8px; padding: 12px 16px; margin: 0 0 16px; }
.callout p:last-child { margin-bottom: 0; }
.callout-tip { border-left-color: var(--tip); }
.callout-note { border-left-color: var(--accent); }
.callout-important { border-left-color: var(--important); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 40px; }
.pager a { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; color: var(--text); font-weight: 600; font-size: 0.92rem; }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager span { display: block; color: var(--text-dim); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.pager .next { text-align: right; }
.still { margin-top: 28px; color: var(--text-dim); font-size: 0.9rem; }

footer { border-top: 1px solid var(--border); padding: 28px 24px 36px; text-align: center; font-size: 0.86rem; }
footer a { color: var(--text-muted); margin: 0 10px; display: inline-block; }
footer p { color: var(--text-dim); margin-top: 12px; }

/* ── Phones and tablets ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 80px; }
  .side { position: static; max-height: none; border: 1px solid var(--border); border-radius: 10px; padding: 0; background: var(--bg-elev); }
  .side > summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 12px 16px; color: var(--text); font-weight: 600; font-size: 0.92rem; list-style: none; }
  .side > summary::-webkit-details-marker { display: none; }
  .side > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg); margin-top: -4px; transition: transform 0.15s; }
  .side[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
  .side[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 12px; }
  .side-group { padding: 0 12px; }
  .prose .anchor { display: none; }
}
@media (max-width: 640px) {
  nav.topnav { padding: 0 16px; gap: 12px; }
  .nav-section, .hide-mobile { display: none; }
  .nav-logo > span { display: none; }
  .home .nav-search { visibility: hidden; }
  .hero { padding: 108px 16px 32px; }
  .topics { padding: 8px 16px 48px; grid-template-columns: minmax(0, 1fr); }
  .layout { padding-left: 16px; padding-right: 16px; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  /* Tables become one labelled card per row: no sideways scrolling on a phone. */
  .table-wrap { border: 0; overflow: visible; }
  .prose table, .prose tbody, .prose tr, .prose td { display: block; width: 100%; }
  .prose thead { display: none; }
  .prose tr { border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elev); padding: 6px 0; margin-bottom: 10px; }
  .prose td { display: grid; grid-template-columns: minmax(84px, 34%) minmax(0, 1fr); gap: 10px; border: 0; padding: 5px 14px; }
  .prose td::before { content: attr(data-label); color: var(--text-dim); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 2px; }
  .prose tr:last-child td { border-bottom: 0; }
  .pager .next { text-align: left; }
}
