/* ================================================================
   NAGAT0RO WIKI — Minimal Wiki Style
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9375rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
code { font-family: 'Fira Mono', 'Cascadia Code', 'Consolas', monospace; }

/* ── TOKENS : LIGHT (default) ─────────────────────────────────── */
:root {
  --bg:            #f7f7f8;
  --bg-sidebar:    #f3f4f6;
  --surface:       #ffffff;
  --surface-2:     #f3f4f6;
  --hover:         #f3f4f6;
  --border:        #e5e7eb;
  --border-strong: #d1d5db;
  --text:          #111827;
  --text-2:        #374151;
  --muted:         #6b7280;
  --text-faint:    #9ca3af;
  --accent:        #2563eb;
  --accent-hover:  #1d4ed8;
  --accent-bg:     #eff6ff;
  --accent-border: #bfdbfe;
  --ok:            #16a34a;
  --ok-bg:         #ecfdf5;
  --ok-border:     #bbf7d0;
  --warn:          #d97706;
  --warn-bg:       #fff7ed;
  --warn-border:   #fed7aa;
  --danger:        #dc2626;
  --code-bg:       #f3f4f6;
  --code-border:   #e5e7eb;
  --header-h:      100px;
  --sidebar-w:     248px;
  --content-max:   960px;
  --shadow-md:     0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg:     0 12px 32px rgba(0,0,0,0.12);
}

/* ── TOKENS : DARK ────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:            #111827;
  --bg-sidebar:    #0f172a;
  --surface:       #1e2535;
  --surface-2:     #273045;
  --hover:         #273045;
  --border:        #2d3748;
  --border-strong: #3d4f6e;
  --text:          #f1f5f9;
  --text-2:        #cbd5e1;
  --muted:         #94a3b8;
  --text-faint:    #64748b;
  --accent:        #3b82f6;
  --accent-hover:  #60a5fa;
  --accent-bg:     rgba(59,130,246,0.12);
  --accent-border: rgba(59,130,246,0.3);
  --ok:            #22c55e;
  --ok-bg:         rgba(34,197,94,0.1);
  --ok-border:     rgba(34,197,94,0.25);
  --warn:          #f59e0b;
  --warn-bg:       rgba(245,158,11,0.1);
  --warn-border:   rgba(245,158,11,0.25);
  --danger:        #ef4444;
  --code-bg:       #1a2235;
  --code-border:   #2d3748;
  --shadow-lg:     0 12px 32px rgba(0,0,0,0.4);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ── HEADER ───────────────────────────────────────────────────── */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 200;
}
.header-inner {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0 16px;
  position: relative;
}
.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
  margin-top: -24px;
}
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 32px; height: 32px;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  border-radius: 6px;
  transition: background 0.15s;
}
.hamburger:hover { background: var(--surface-2); }
.hamburger span {
  display: block;
  width: 16px; height: 1.5px;
  background: var(--muted);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* Header logo */
.header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  width: 320px;
  line-height: normal;
}
.header-logo:hover { text-decoration: none; }
.header-logo-text {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  text-align: center;
  width: 100%;
}
.header-logo:hover .header-logo-text { color: var(--accent); }

/* ── SEARCH ───────────────────────────────────────────────────── */
.search-wrap {
  position: relative;
  width: 320px;
  max-width: 320px;
  flex-shrink: 0;
}
#siteSearch {
  width: 100%;
  height: 32px;
  padding: 0 32px 0 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#siteSearch::placeholder { color: var(--text-faint); }
#siteSearch:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.search-icon {
  position: absolute;
  left: 9px; top: 16px;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--text-faint);
  pointer-events: none;
}
.search-kbd {
  position: absolute;
  right: 8px; top: 16px;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-faint);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 5px;
  line-height: 18px;
  pointer-events: none;
}
#siteSearch:focus ~ .search-kbd { display: none; }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 4px;
  z-index: 300;
  max-height: 70vh;
  overflow-y: auto;
}
.search-result {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
  font: inherit;
}
.search-result:hover, .search-result:focus {
  background: var(--hover);
  outline: none;
}
.search-result-title {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
}
.search-result-subtitle {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--muted);
}
.search-empty {
  padding: 14px;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.theme-btn {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.theme-btn:hover { background: var(--surface-2); color: var(--text); }
.theme-btn svg { width: 14px; height: 14px; }
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: block; }
[data-theme="dark"]  .icon-sun  { display: block; }
[data-theme="dark"]  .icon-moon { display: none; }

/* ── LAYOUT ───────────────────────────────────────────────────── */
.layout {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ── SIDEBAR ──────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--header-h));
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.25s ease;
}
.sidebar::-webkit-scrollbar { width: 4px; }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 90;
}
.sidebar-overlay.open { display: block; }

.sidebar-nav { padding: 12px 0 16px; flex: 1; display: flex; flex-direction: column; }

.nav-section-label {
  padding: 16px 14px 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.nav-section-label:first-child { padding-top: 8px; }

.nav-list { padding: 0 6px; }
.nav-list > li { margin-bottom: 1px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
  transition: background 0.12s, color 0.12s;
  position: relative;
  cursor: pointer;
}
.nav-link:hover { background: var(--border); color: var(--text-2); text-decoration: none; }
.nav-link.active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 500;
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 2px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-icon { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.7; }
.nav-link.active .nav-icon { opacity: 1; }

.nav-separator { height: 1px; background: var(--border); margin: 8px 10px; }

.sidebar-footer {
  margin-top: auto;
  padding: 10px 10px 14px;
  border-top: 1px solid var(--border);
}
.sidebar-note {
  font-size: 0.75rem;
  color: var(--text-faint);
  line-height: 1.5;
  padding: 8px 4px;
}

/* ── MAIN CONTENT ─────────────────────────────────────────────── */
.content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
}
.content-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 32px 32px 80px;
}

/* ── PAGE SECTIONS (SPA) ──────────────────────────────────────── */
.page-section { display: none; }
.page-section.active {
  display: block;
  animation: section-fade 0.15s ease both;
}
@keyframes section-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── INTRO BLOCK : NO frame on logo ──────────────────────────── */
.intro-block {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.intro-logo {
  width: auto;
  height: clamp(120px, 14vw, 180px);
  max-width: 100%;
  object-fit: contain;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  flex-shrink: 0;
  display: block;
}
.intro-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.2;
}
.intro-text p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 520px;
}
.intro-unofficial {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 4px;
  padding: 1px 8px;
  margin-top: 5px;
}

.intro-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.intro-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  cursor: pointer;
  text-decoration: none;
}
.intro-link-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); text-decoration: none; }
.intro-link-btn svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ── WIKI CARDS (home) ───────────────────────────────────────── */
.wiki-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.wiki-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.wiki-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(37,99,235,0.07); text-decoration: none; }
.wiki-card-icon {
  width: 30px; height: 30px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.wiki-card-icon svg { width: 15px; height: 15px; }
.wiki-card-icon.blue   { background: var(--accent-bg);   color: var(--accent); }
.wiki-card-icon.green  { background: var(--ok-bg);       color: var(--ok); }
.wiki-card-icon.purple { background: rgba(139,92,246,0.1); color: #7c3aed; }
.wiki-card-icon.orange { background: var(--warn-bg);     color: var(--warn); }
[data-theme="dark"] .wiki-card-icon.purple { background: rgba(167,139,250,0.12); color: #a78bfa; }
.wiki-card h3 { font-size: 0.9375rem; font-weight: 600; color: var(--text); }
.wiki-card p  { font-size: 0.8125rem; color: var(--muted); line-height: 1.5; }
.wiki-card-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  margin-top: auto;
  padding-top: 8px;
}

/* ── PAGE HEADER ──────────────────────────────────────────────── */
.page-header {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.page-header-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.badge-blue   { background: var(--accent-bg);   color: var(--accent);  border: 1px solid var(--accent-border); }
.badge-green  { background: var(--ok-bg);       color: var(--ok);      border: 1px solid var(--ok-border); }
.badge-orange { background: var(--warn-bg);     color: var(--warn);    border: 1px solid var(--warn-border); }
.badge-purple { background: rgba(139,92,246,0.1); color: #7c3aed; border: 1px solid rgba(139,92,246,0.25); }
[data-theme="dark"] .badge-purple { background: rgba(167,139,250,0.1); color: #a78bfa; border-color: rgba(167,139,250,0.25); }
.page-header h2 { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); margin-bottom: 6px; line-height: 1.25; }
.page-header p  { font-size: 0.9375rem; color: var(--muted); line-height: 1.55; max-width: 600px; }

.page-section h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  margin: 28px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}
.page-section h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}

/* ── STEPS ────────────────────────────────────────────────────── */
.steps { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-body { min-width: 0; }
.step-body p { font-size: 0.875rem; color: var(--muted); line-height: 1.55; }
.step-body p + p { margin-top: 6px; }

/* ── DOWNLOAD CARDS ───────────────────────────────────────────── */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.download-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.download-card-head { display: flex; align-items: center; gap: 10px; }
.dl-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dl-icon svg { width: 18px; height: 18px; }
.dl-icon.blue   { background: var(--accent-bg);   color: var(--accent); }
.dl-icon.green  { background: var(--ok-bg);       color: var(--ok); }
.dl-icon.purple { background: rgba(139,92,246,0.1); color: #7c3aed; }
.dl-icon.orange { background: var(--warn-bg);     color: var(--warn); }
[data-theme="dark"] .dl-icon.purple { background: rgba(167,139,250,0.12); color: #a78bfa; }
.download-card h3 { font-size: 0.9375rem; font-weight: 700; color: var(--text); line-height: 1.2; margin: 0; padding: 0; border: none; }
.download-card p  { font-size: 0.8125rem; color: var(--muted); line-height: 1.5; flex: 1; }
.download-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.download-note {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.download-note::before { content: '✓'; color: var(--ok); font-weight: 700; }

/* ── BUTTONS ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-outline {
  background: var(--surface);
  color: var(--text-2);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 0.8125rem; }

/* ── LINKS GRID ───────────────────────────────────────────────── */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.link-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s;
}
.link-card:hover { border-color: var(--accent); }
.link-card h4 { font-size: 0.9375rem; font-weight: 600; color: var(--text); }
.link-card p  { font-size: 0.8125rem; color: var(--muted); line-height: 1.5; flex: 1; }
.link-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.official-tag {
  font-size: 0.6875rem;
  color: var(--ok);
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 600;
}

/* ── CODE / COPY ──────────────────────────────────────────────── */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 8px;
  overflow: hidden;
  margin: 10px 0;
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--code-border);
}
.code-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.code-block pre { padding: 12px 16px; overflow-x: auto; }
.code-block code {
  font-size: 0.875rem;
  color: var(--accent);
  white-space: pre;
  line-height: 1.6;
  background: transparent;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.copy-btn svg { width: 11px; height: 11px; }
.copy-btn.copied { color: var(--ok); border-color: var(--ok-border); background: var(--ok-bg); }

.copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 10px 0;
}
.copy-row code { flex: 1; font-size: 0.875rem; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: transparent; }
.copy-row .copy-btn { flex-shrink: 0; }

/* ── SCREENSHOT ───────────────────────────────────────────────── */
.screenshot {
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--surface-2);
  transition: border-color 0.15s;
}
.screenshot:hover { border-color: var(--border-strong); }
.screenshot img { width: 100%; height: auto; display: block; }

/* ── NOTE / WARNING ──────────────────────────────────────────── */
.note, .warning, .tip, .success {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.55;
  margin: 12px 0;
  border: 1px solid;
}
.note-icon { font-size: 1em; flex-shrink: 0; margin-top: 1px; }
.note    { background: var(--accent-bg);  border-color: var(--accent-border); color: var(--text-2); }
.warning { background: var(--warn-bg);    border-color: var(--warn-border);   color: var(--text-2); }
.tip     { background: var(--surface-2);  border-color: var(--border);        color: var(--muted); }
.success { background: var(--ok-bg);      border-color: var(--ok-border);     color: var(--text-2); }

/* ── CHECKLIST ────────────────────────────────────────────────── */
.check-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.check-list li::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 6px;
}
.check-list li.deny::before { background: var(--danger); }
.check-list li.allow::before { background: var(--ok); }
.check-list code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; font-size: 0.85em; }

/* ── FAQ ──────────────────────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 6px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.faq-item.open { border-color: var(--accent); }
.faq-q {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}
.faq-q:hover { color: var(--accent); }
.faq-item.open .faq-q { color: var(--accent); }
.faq-chevron {
  width: 14px; height: 14px;
  flex-shrink: 0;
  color: var(--text-faint);
  transition: transform 0.2s, color 0.12s;
}
.faq-item.open .faq-chevron { transform: rotate(180deg); color: var(--accent); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease, opacity 0.2s;
  opacity: 0;
}
.faq-item.open .faq-a { max-height: 400px; opacity: 1; }
.faq-a p { padding: 0 16px 12px; font-size: 0.875rem; color: var(--muted); line-height: 1.6; }
.faq-a code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; font-size: 0.85em; }
.faq-a a { color: var(--accent); }

/* ── SECURITY ─────────────────────────────────────────────────── */
.security-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 22px;
  margin: 16px 0;
}
.security-block h3 { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0 0 12px; border: none; padding: 0; }

/* ── MODAL ────────────────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0,0,0,0.7);
}
.modal.open { display: flex; }
.modal-content {
  position: relative;
  max-width: min(95vw, 1100px);
  max-height: 90vh;
  border-radius: 10px;
  overflow: hidden;
}
.modal-content img { max-width: 100%; max-height: 85vh; object-fit: contain; display: block; }
.modal-close {
  position: absolute;
  top: 8px; right: 8px;
  width: 32px; height: 32px;
  border-radius: 6px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background 0.15s;
}
.modal-close:hover { background: rgba(220,38,38,0.8); }
.modal-close svg { width: 14px; height: 14px; }

/* ── TOAST ────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--text);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 100px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  z-index: 8000;
  white-space: nowrap;
  transition: opacity 0.18s, transform 0.18s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); color: #fff; }

/* ── BACK TO TOP ──────────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 20px; right: 20px;
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, background 0.15s, color 0.15s;
  z-index: 80;
  cursor: pointer;
}
#back-to-top.visible { opacity: 1; pointer-events: auto; }
#back-to-top:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
#back-to-top svg { width: 14px; height: 14px; }

/* ── FOOTER ───────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  padding: 18px 16px;
  margin-left: var(--sidebar-w);
}
.footer p { font-size: 0.8125rem; color: var(--text-faint); }

/* ── RESPONSIVE ───────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 150;
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  }
  .sidebar.open { transform: translateX(0); }
  .content { margin-left: 0; }
  .footer { margin-left: 0; }
  .hamburger { display: flex; }
}

@media (max-width: 767px) {
  :root { --header-h: 80px; }
  .content-inner { padding: 20px 16px 60px; }
  .intro-block { flex-direction: column; gap: 14px; padding: 16px 0 20px; align-items: flex-start; }
  .intro-logo { height: clamp(90px, 22vw, 130px); }
  .wiki-cards  { grid-template-columns: 1fr 1fr; }
  .download-grid { grid-template-columns: 1fr; }
  .links-grid  { grid-template-columns: 1fr 1fr; }
  .step { grid-template-columns: 24px 1fr; gap: 10px; padding: 12px 14px; }
  .search-wrap { width: 200px; max-width: calc(100% - 120px); }
}

@media (max-width: 479px) {
  .wiki-cards, .links-grid { grid-template-columns: 1fr; }
}

@media print {
  #site-header, .sidebar, #back-to-top, .toast { display: none !important; }
  .layout { padding-top: 0; }
  .content, .footer { margin-left: 0; }
}
