:root {
  --bg: #070b14;
  --surface: #0f172a;
  --surface-alt: #162033;
  --header-bg: rgba(7, 11, 20, 0.88);
  --text: #e2e8f0;
  --heading: #f8fafc;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.18);
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --yt-red: #ef4444;
  --yt-bg: rgba(239, 68, 68, 0.12);
  --warn-bg: rgba(245, 158, 11, 0.12);
  --warn-border: #f59e0b;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --header-bg: rgba(255, 255, 255, 0.92);
  --text: #334155;
  --heading: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #1d4ed8;
  --accent-strong: #1e40af;
  --accent-soft: #eff6ff;
  --yt-red: #dc2626;
  --yt-bg: #fef2f2;
  --warn-bg: #fffbeb;
  --warn-border: #f59e0b;
}

html { scroll-behavior: smooth; }
* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background: var(--bg); color: var(--text); line-height: 1.7; display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }
a { color: var(--accent); }

/* Header */
header { background: var(--header-bg); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.nav-wrap { max-width: 1120px; margin: 0 auto; padding: 0.75rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--heading); font-weight: 800; font-size: 1.18rem; letter-spacing: -0.01em; }
.logo-circle { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(56, 189, 248, 0.55); flex-shrink: 0; background: #0b1120; }
.logo-circle img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.26); display: block; }
.nav-links { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.nav-links a { text-decoration: none; color: var(--text); font-weight: 500; font-size: 0.94rem; }
.nav-links a:hover { color: var(--accent); }
.theme-btn { background: var(--surface-alt); border: 1px solid var(--border); color: var(--text); padding: 0.4rem 0.7rem; border-radius: 8px; cursor: pointer; font-size: 0.85rem; font-weight: 600; }
.theme-btn:hover { border-color: var(--accent); }
.nav-support { background: rgba(245, 158, 11, 0.12); color: #fbbf24 !important; border: 1px solid rgba(245, 158, 11, 0.4); padding: 0.4rem 0.85rem; border-radius: 8px; font-weight: 600 !important; transition: 0.2s; }
.nav-support:hover { background: rgba(245, 158, 11, 0.22); border-color: #fbbf24; }
[data-theme="light"] .nav-support { background: #fef3c7; color: #b45309 !important; border-color: #f59e0b; }

/* Hero */
.hero { background: radial-gradient(circle at top right, rgba(217, 70, 239, 0.16), transparent 45%), radial-gradient(circle at top left, rgba(14, 165, 233, 0.18), transparent 45%), #090f1d; color: #f8fafc; text-align: center; padding: 3.25rem 1.25rem; border-bottom: 1px solid var(--border); }
.hero h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); max-width: 760px; margin: 0 auto 0.75rem; color: #f8fafc; }
.hero p { color: #cbd5e1; max-width: 620px; margin: 0 auto 1.5rem; }
.search-bar { max-width: 580px; margin: 0 auto; background: #0f172a; border: 1px solid rgba(56, 189, 248, 0.4); border-radius: 10px; padding: 4px; display: flex; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35); }
.search-bar input { flex: 1; border: none; outline: none; background: transparent; color: #f8fafc; padding: 0.8rem 1rem; font-size: 1rem; }
.search-bar input::placeholder { color: #94a3b8; }

/* Layout & Filters */
.container { max-width: 1120px; margin: 2rem auto; padding: 0 1.25rem; width: 100%; }
.narrow { max-width: 860px; }
.filters { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.35rem; align-items: center; }
.filter-btn { background: var(--surface); border: 1px solid var(--border); color: var(--muted); padding: 0.5rem 1rem; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 0.88rem; transition: 0.2s; }
.filter-btn.active, .filter-btn:hover { background: var(--accent-strong); color: #ffffff; border-color: var(--accent-strong); }
.count-note { flex-basis: 100%; font-size: 0.88rem; color: var(--muted); margin: 0.35rem 0 0; text-align: left; }

/* Home Cards Grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1.35rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; }
.card:hover { transform: translateY(-4px); border-color: rgba(56, 189, 248, 0.55); box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25); }
.thumb-wrap { position: relative; aspect-ratio: 16 / 9; background: #020617; overflow: hidden; }
.thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-badge { position: absolute; top: 10px; left: 10px; background: rgba(7, 11, 20, 0.88); color: #38bdf8; font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 6px; border: 1px solid rgba(56, 189, 248, 0.35); }
.card-body { padding: 1.2rem; flex: 1; display: flex; flex-direction: column; text-align: left; }
.card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--heading); }
.card-desc { font-size: 0.9rem; color: var(--muted); margin-bottom: 1rem; flex: 1; }
.card-link { font-size: 0.88rem; font-weight: 700; color: var(--accent); }

/* Guide Page */
.breadcrumb { font-size: 0.9rem; color: var(--muted); margin-bottom: 1rem; text-align: left; }
.breadcrumb a { text-decoration: none; font-weight: 600; }
.guide-box { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.85rem; text-align: left; }
.guide-box h1 { color: var(--heading); font-size: clamp(1.35rem, 2.5vw, 1.85rem); line-height: 1.3; margin-bottom: 0.65rem; }
.guide-intro { color: var(--muted); font-size: 0.98rem; margin-bottom: 1.25rem; }

.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #020617; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.video-frame iframe { width: 100%; height: 100%; border: 0; }

/* Balanced Full-Width Action Buttons */
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; margin: 1rem 0 1.5rem; }
.btn-grid.single { grid-template-columns: 1fr; }

.action-btn { display: flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%; padding: 0.8rem 1.1rem; border-radius: 10px; font-weight: 700; font-size: 0.94rem; text-decoration: none; text-align: center; transition: 0.2s; border: 1px solid var(--border); cursor: pointer; }
.btn-yt { background: var(--yt-bg); color: var(--yt-red); border-color: rgba(239, 68, 68, 0.45); }
.btn-yt:hover { background: var(--yt-red); color: #ffffff; }
.btn-ask { background: var(--surface-alt); color: var(--heading); border-color: var(--border); }
.btn-ask:hover { border-color: var(--accent); color: var(--accent); }
.btn-faq-jump { background: var(--accent-soft); color: var(--accent); border-color: rgba(56, 189, 248, 0.4); margin-top: 0.9rem; }
.btn-faq-jump:hover { background: var(--accent-strong); color: #ffffff; border-color: var(--accent-strong); }

/* Content Boxes */
.note-box { background: var(--warn-bg); border-left: 4px solid var(--warn-border); padding: 1rem 1.15rem; border-radius: 8px; margin: 1.25rem 0; font-size: 0.93rem; color: var(--text); text-align: left; }
.section-box { background: var(--surface-alt); border: 1px solid var(--border); padding: 1.35rem 1.5rem; border-radius: 10px; margin: 1.35rem 0; text-align: left; }
.section-box.links-accent { background: var(--accent-soft); border-color: rgba(56, 189, 248, 0.35); }
.section-box h2 { font-size: 1.12rem; margin-bottom: 0.85rem; color: var(--heading); }
.section-box ul { padding-left: 1.25rem; }
.section-box li { margin-bottom: 0.5rem; color: var(--text); }
.section-box p { margin-bottom: 0.8rem; color: var(--text); }
.section-box p:last-child { margin-bottom: 0; }
.empty-note { color: var(--muted) !important; font-style: italic; font-size: 0.93rem; }

/* Distinct Full-Width Prev / Next Buttons */
.step-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; margin: 1.75rem 0; }
.step-nav.single { grid-template-columns: 1fr; }
.step-btn { display: flex; flex-direction: column; justify-content: center; width: 100%; padding: 0.95rem 1.15rem; border-radius: 10px; text-decoration: none; background: var(--surface-alt); border: 1px solid var(--border); color: var(--heading); transition: 0.2s; text-align: left; }
.step-btn:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); }
.step-btn.next-primary { background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(37, 99, 235, 0.22)); border-color: rgba(56, 189, 248, 0.55); }
.step-label { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.2rem; }
.step-title { font-size: 0.94rem; font-weight: 700; color: var(--heading); }

/* Clickable FAQ Accordions */
.faq-group { margin-top: 1.75rem; scroll-margin-top: 85px; }
.faq-group-title { font-size: 1.12rem; color: var(--heading); margin-bottom: 0.85rem; padding-bottom: 0.45rem; border-bottom: 1px solid var(--border); }
.faq-accordion { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 0.65rem; overflow: hidden; transition: border-color 0.2s; text-align: left; }
.faq-accordion[open] { border-color: rgba(56, 189, 248, 0.5); }
.faq-accordion summary { list-style: none; cursor: pointer; padding: 0.95rem 1.15rem; font-weight: 600; color: var(--heading); display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: 0.96rem; }
.faq-accordion summary::-webkit-details-marker { display: none; }
.faq-accordion summary::after { content: "+"; font-size: 1.25rem; font-weight: 700; color: var(--accent); flex-shrink: 0; line-height: 1; }
.faq-accordion[open] summary::after { content: "−"; }
.faq-answer { padding: 0.85rem 1.15rem 1rem; color: var(--text); font-size: 0.93rem; border-top: 1px solid var(--border); }
.faq-guide-link { display: inline-block; margin-top: 0.65rem; font-size: 0.86rem; font-weight: 700; text-decoration: none; color: var(--accent); }
.faq-guide-link:hover { text-decoration: underline; }

/* Comments & Generic Pages */
.comments-box { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); text-align: left; }
.comments-box h2 { font-size: 1.15rem; margin-bottom: 0.85rem; color: var(--heading); }
.comment-placeholder { background: var(--surface-alt); border: 1px dashed var(--border); padding: 1.25rem; border-radius: 10px; font-size: 0.92rem; color: var(--muted); }

.page-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 2rem; text-align: left; }
.page-card h1 { margin-bottom: 0.75rem; color: var(--heading); }
.page-card h2 { margin: 1.5rem 0 0.65rem; font-size: 1.18rem; color: var(--heading); }
.page-card p, .page-card li { margin-bottom: 0.75rem; color: var(--text); }
.page-card ul { padding-left: 1.25rem; }
.form-embed { margin-top: 1.25rem; background: var(--surface-alt); border: 1px dashed var(--border); border-radius: 10px; padding: 1.5rem; text-align: left; }

/* Footer */
footer { background: #050811; color: #94a3b8; border-top: 1px solid var(--border); padding: 2.25rem 1.25rem; margin-top: 3.5rem; font-size: 0.86rem; }
.footer-wrap { max-width: 1120px; margin: 0 auto; text-align: center; }
.footer-links { display: flex; justify-content: center; gap: 1.35rem; flex-wrap: wrap; margin-bottom: 1rem; }
.footer-links a { color: #38bdf8; text-decoration: none; font-weight: 500; }
.footer-disclaimer { max-width: 820px; margin: 0 auto 0.75rem; color: #94a3b8; }

@media (max-width: 640px) {
  .btn-grid, .step-nav { grid-template-columns: 1fr; }
  .guide-box, .page-card { padding: 1.25rem; }
}