:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --border: #e3e6ee;
  --text: #1a1d29;
  --text-muted: #5b6072;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14151f;
    --surface: #1c1e2b;
    --border: #2c2f42;
    --text: #eef0f7;
    --text-muted: #a2a6bd;
    --accent: #818cf8;
    --accent-hover: #a5b0fb;
    --accent-soft: #262a45;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 12px rgba(0,0,0,.25);
  }
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

header.topbar {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #9333ea);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 13px;
}
nav.top-links {
  display: flex;
  gap: 22px;
  font-size: 14px;
  color: var(--text-muted);
}
nav.top-links a { color: var(--text-muted); }
nav.top-links a:hover { color: var(--text); }

.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 64px 24px 40px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(26px, 4vw, 38px);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.hero p {
  color: var(--text-muted);
  font-size: 16px;
  margin: 0 0 28px;
}
.search-wrap {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}
.search-wrap input {
  width: 100%;
  padding: 14px 18px 14px 46px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  outline: none;
  box-shadow: var(--shadow);
  transition: border-color .15s;
}
.search-wrap input:focus { border-color: var(--accent); }
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
#no-results {
  display: none;
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
  font-size: 14px;
}

main { max-width: 1080px; margin: 0 auto; padding: 0 24px 80px; }

.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  font-weight: 700;
  margin: 48px 0 18px;
}
.section-title:first-of-type { margin-top: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform .12s, border-color .12s;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card p.desc { margin: 0 0 14px; color: var(--text-muted); font-size: 13.5px; }
.card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.card ul li a {
  font-size: 13.5px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.card ul li a:hover { color: var(--accent); }
.card ul li a::before {
  content: "›";
  color: var(--accent);
  font-weight: 700;
}
.card.hidden, .cat-hidden { display: none !important; }

.faq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
details {
  border-bottom: 1px solid var(--border);
}
details:last-child { border-bottom: none; }
summary {
  cursor: pointer;
  padding: 16px 20px;
  font-size: 14.5px;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  color: var(--text-muted);
  font-weight: 400;
  font-size: 20px;
  transition: transform .15s;
}
details[open] summary::after { transform: rotate(45deg); }
details p {
  margin: 0;
  padding: 0 20px 18px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.contact-band {
  margin-top: 48px;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
}
.contact-band h2 { margin: 0 0 4px; font-size: 18px; }
.contact-band p { margin: 0; color: var(--text-muted); font-size: 14px; }
.btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); color: white; }

footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
}

/* --- Category / article pages --- */

.breadcrumb {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 24px 0;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

.cat-hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 24px 36px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.cat-hero .card-icon {
  width: 48px;
  height: 48px;
  font-size: 22px;
  margin-bottom: 0;
  flex-shrink: 0;
}
.cat-hero h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -0.02em; }
.cat-hero p { margin: 0; color: var(--text-muted); font-size: 14.5px; }

.article-layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 80px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 760px) {
  .article-layout { grid-template-columns: 1fr; }
}
.toc {
  position: sticky;
  top: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 13.5px;
}
.toc div.toc-label {
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.toc a { color: var(--text); }
.toc a:hover { color: var(--accent); }

.articles { display: flex; flex-direction: column; gap: 12px; }
article.help-article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  scroll-margin-top: 20px;
}
article.help-article h2 {
  margin: 0 0 6px;
  font-size: 20px;
  letter-spacing: -0.01em;
}
article.help-article .article-meta {
  color: var(--text-muted);
  font-size: 12.5px;
  margin-bottom: 20px;
}
article.help-article p { font-size: 14.5px; color: var(--text); margin: 0 0 14px; }
article.help-article p.lead { color: var(--text-muted); }
article.help-article h3 { font-size: 15px; margin: 22px 0 8px; }
article.help-article ol, article.help-article ul.plain {
  margin: 0 0 14px;
  padding-left: 22px;
  font-size: 14.5px;
}
article.help-article ol li, article.help-article ul.plain li { margin-bottom: 8px; }
article.help-article .tip {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13.5px;
  margin: 16px 0;
}
article.help-article .tip strong { color: var(--accent); }
article.help-article hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

.subsection-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  font-weight: 700;
  margin: 40px 0 14px;
}
.mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}
.mini-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  scroll-margin-top: 20px;
}
.mini-card h3 {
  margin: 0 0 6px;
  font-size: 14.5px;
}
.mini-card p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}
