:root {
  --sidebar-w: 260px;
}

.help-layout {
  font-size: var(--fs-xl);
  line-height: 1.6;
}

.article a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.article a:hover { text-decoration-thickness: 2px; }
.help-sidebar a { color: var(--accent); text-decoration: none; }
.article a.help-index-card,
.article a.help-index-card:hover { text-decoration: none; }

/* ── Layout ── */
.help-layout {
  display: flex;
  min-height: calc(100vh - 64px);
}

.help-layout + .footer {
  margin-top: 0;
}

/* ── Sidebar ── */
.help-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 24px 0;
  background: rgba(13,27,20,0.55);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.help-sidebar-inner {
  position: sticky;
  top: 64px;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}
.light .help-sidebar {
  background: rgba(242,242,247,0.6);
}

.sidebar-section { margin-bottom: 4px; }

.sidebar-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  gap: 8px;
}

.sidebar-section-title:hover { color: var(--text); }

.sidebar-chevron {
  font-size: var(--fs-xs);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.sidebar-section.open .sidebar-chevron { transform: rotate(180deg); }

.sidebar-items {
  display: none;
  padding: 0 0 8px 0;
}

.sidebar-section.open .sidebar-items { display: block; }

.sidebar-link {
  display: block;
  padding: 6px 20px 6px 32px;
  font-size: var(--fs-md);
  color: var(--text);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  line-height: 1.4;
}

.sidebar-link:hover {
  color: var(--text);
  text-decoration: none;
  background: var(--bg-input);
}

.sidebar-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-glow);
}

/* ── Content ── */
.help-content {
  flex: 1;
  min-width: 0;
  padding: 40px 48px 80px;
  max-width: 860px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-md);
  color: var(--text-dim);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb-sep { opacity: 0.4; }

/* Article typography */
.article-meta {
  font-size: var(--fs-md);
  color: var(--text-dim);
  margin-bottom: 32px;
}

.article h1 {
  font-size: calc(var(--fs-base) + 14px);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 8px;
}

.article h2 {
  font-size: calc(var(--fs-base) + 4px);
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.article h3 {
  font-size: var(--fs-xl);
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 8px;
  color: var(--text);
}

.article p { margin-bottom: 16px; }

.article ul, .article ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.article li { margin-bottom: 6px; }

.article code {
  font-family: var(--mono);
  font-size: var(--fs-md);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--accent);
}

.article pre {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  overflow-x: auto;
  margin-bottom: 16px;
}

.article pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: var(--fs-md);
  color: var(--text);
}

.article strong { font-weight: 600; }

/* Callout boxes */
.callout {
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: var(--fs-lg);
  line-height: 1.5;
  display: flex;
  gap: 12px;
}

.callout-icon { flex-shrink: 0; font-size: calc(var(--fs-base) + 2px); margin-top: 1px; }

.callout-info {
  background: var(--blue-bg);
  border: 1px solid var(--blue);
  border-color: color-mix(in srgb, var(--blue) 30%, transparent);
  color: var(--text);
}

.callout-warn {
  background: var(--yellow-bg);
  border: 1px solid var(--yellow);
  border-color: color-mix(in srgb, var(--yellow) 30%, transparent);
  color: var(--text);
}

.callout-danger {
  background: var(--red-bg);
  border: 1px solid var(--red);
  border-color: color-mix(in srgb, var(--red) 30%, transparent);
  color: var(--text);
}

.callout-success {
  background: var(--green-bg);
  border: 1px solid var(--green);
  border-color: color-mix(in srgb, var(--green) 30%, transparent);
  color: var(--text);
}

/* Причина-карточки */
.cause-list { margin-bottom: 20px; }

.cause {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}

.cause-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  font-size: var(--fs-lg);
  transition: background 0.15s;
}

.cause-header:hover { background: var(--bg-input); }

.cause-icon { font-size: calc(var(--fs-base) + 2px); flex-shrink: 0; }

.cause-chevron { margin-left: auto; font-size: calc(var(--fs-base) - 3px); color: var(--text-dim); transition: transform 0.2s; }

.cause.open .cause-chevron { transform: rotate(180deg); }

.cause-body {
  display: none;
  padding: 0 18px 16px 46px;
  font-size: var(--fs-lg);
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  background: var(--bg-input);
}

.cause.open .cause-body { display: block; padding-top: 14px; }

.cause-body p { color: var(--text-dim); margin-bottom: 10px; }
.cause-body p:last-child { margin-bottom: 0; }
.cause-body ul { color: var(--text-dim); }
.cause-body code { font-size: var(--fs-sm); }
.cause-body strong { color: var(--text); }

/* Индексная страница */
.help-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.help-index-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  display: block;
}

.help-index-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  text-decoration: none;
}

.help-index-card-icon { font-size: calc(var(--fs-base) + 14px); margin-bottom: 12px; }
.help-index-card-title { font-size: var(--fs-xl); font-weight: 600; margin-bottom: 8px; color: var(--text); }
.help-index-card-desc { font-size: var(--fs-md); color: var(--text-dim); line-height: 1.5; }

/* ── FAQ accordion ── */
.blog-faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--space-sm);
  overflow: hidden;
}

.blog-faq-item h3 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 18px;
  margin: 0;
  cursor: pointer;
  user-select: none;
  font-size: var(--fs-lg);
  font-weight: 500;
  color: var(--text);
  transition: background 0.15s;
}

.blog-faq-item h3:hover { background: var(--bg-input); }

.blog-faq-item h3::after {
  content: "▾";
  margin-left: auto;
  font-size: calc(var(--fs-base) - 3px);
  color: var(--text-dim);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.blog-faq-item.open h3::after { transform: rotate(180deg); }

.blog-faq-item > :not(h3) {
  display: none;
}

.blog-faq-item.open > :not(h3) {
  display: block;
}

.blog-faq-item.open > h3 + * {
  padding: 14px 18px 16px;
  border-top: 1px solid var(--border);
}

.blog-faq-item p {
  margin: 0;
  color: var(--text-dim);
}

/* ── Related articles ── */
.help-related {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.help-related-title {
  font-size: var(--fs-md);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

/* ── Responsive ── */
@media (max-width: 767px) {
  .help-layout { flex-direction: column; }


  .help-sidebar {
    display: none; /* moved into burger drawer on mobile */
  }

  .help-content { padding: 24px 20px 60px; }
  .article h1 { font-size: calc(var(--fs-base) + 8px); }
  .article h2 { font-size: calc(var(--fs-base) + 3px); }
}

/* ── URL checker widget ── */
.url-checker {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0 28px;
}
.url-checker-title {
  font-size: var(--fs-xl);
  font-weight: 600;
  margin-bottom: 6px;
}
.url-checker-desc {
  font-size: var(--fs-md);
  color: var(--text-dim);
  margin-bottom: 14px;
}
.url-checker-row {
  display: flex;
  gap: 10px;
}
.url-checker-input {
  flex: 1;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: var(--fs-md);
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}
.url-checker-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
/* url-checker-btn = .btn .btn-primary pattern */
.url-checker-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 20px; background: var(--accent); color: var(--bg);
  font-family: var(--font); font-size: var(--fs-md); font-weight: 700;
  border: none; border-radius: var(--radius); cursor: pointer;
  white-space: nowrap; transition: all 0.2s;
}
.url-checker-btn:hover { opacity: 0.9; }
.url-checker-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.url-checker-result {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: var(--fs-md);
  line-height: 1.6;
}
.url-checker-result.ok   { background: var(--green-bg);  border: 1px solid color-mix(in srgb, var(--green) 35%, transparent);  color: var(--text); }
.url-checker-result.warn { background: var(--yellow-bg); border: 1px solid color-mix(in srgb, var(--yellow) 35%, transparent); color: var(--text); }
.url-checker-result.bad  { background: var(--red-bg);    border: 1px solid color-mix(in srgb, var(--red) 35%, transparent);    color: var(--text); }
.url-checker-result .result-code {
  font-size: calc(var(--fs-base) + 10px);
  font-weight: 700;
  font-family: var(--mono);
  margin-bottom: 4px;
}
.url-checker-result .result-code .result-label {
  font-size: var(--fs-md);
  font-weight: 400;
  opacity: 0.7;
  margin-left: 8px;
  font-family: var(--font);
}
.url-checker-result .result-hint { margin-top: 6px; color: var(--text-dim); }
.url-checker-result .result-hint strong { color: var(--text); }
.url-checker-result .result-tip {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.15);
  border-radius: 6px;
  font-size: var(--fs-sm);
  color: var(--text-dim);
}
.url-checker-result .result-tip a { color: var(--accent); }
@media (max-width: 600px) {
  .url-checker-row { flex-direction: column; }
  .url-checker-btn { width: 100%; }
}

/* Scrollbar */
.help-sidebar-inner {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.help-sidebar-inner::-webkit-scrollbar { width: 4px; }
.help-sidebar-inner::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Help tables ── */
.help-table {
  width: 100%; border-collapse: collapse;
  font-size: var(--fs-md); margin-bottom: 16px;
  display: block; overflow-x: auto;
}
.help-table thead tr { border-bottom: 1px solid var(--border); }
.help-table th {
  text-align: left; padding: 8px 12px;
  color: var(--text-dim); font-weight: 600;
}
.help-table th.text-center { text-align: center; }
.help-table td { padding: 8px 12px; }
.help-table td.cell-lg { padding: 10px 12px; }
.help-table tbody tr { border-bottom: 1px solid var(--border); }
.help-table .text-center { text-align: center; }

/* ── TTFB progress bar ── */
.ttfb-track { margin: 10px 0 4px; background: var(--bg); border-radius: 4px; height: 8px; overflow: hidden; }
.ttfb-fill  { height: 100%; border-radius: 4px; transition: width 0.4s; }
.ttfb-scale { display: flex; justify-content: space-between; font-size: calc(var(--fs-base) - 3px); color: var(--text-dim); margin-bottom: 4px; }
