:root {
  color-scheme: light;
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-soft: #f8f7f4;
  --surface-strong: #eeece6;
  --text: #20211f;
  --muted: #6d6f69;
  --line: #deddd7;
  --line-strong: #cdcbc3;
  --accent: #246b4a;
  --accent-dark: #195339;
  --accent-soft: #e4f1e9;
  --danger: #b34b3d;
  --warning: #a76a13;
  --shadow: 0 18px 50px rgba(35, 37, 32, .08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
  --max: 1180px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #161815;
  --surface: #20231f;
  --surface-soft: #1b1e1a;
  --surface-strong: #292d28;
  --text: #f0f1ed;
  --muted: #a8aca4;
  --line: #353a34;
  --line-strong: #454b44;
  --accent: #79c99d;
  --accent-dark: #9ddbb8;
  --accent-soft: #263c30;
  --danger: #ff9d90;
  --warning: #e7b466;
  --shadow: 0 22px 55px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
a { color: inherit; }
button { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.skip-link {
  position: fixed;
  left: 14px;
  top: -60px;
  z-index: 999;
  background: var(--text);
  color: var(--surface);
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
}
.skip-link:focus { top: 14px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  backdrop-filter: blur(16px);
}
.topbar-inner {
  max-width: var(--max);
  min-height: 72px;
  margin: auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex: 0 0 auto;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--text);
  color: var(--surface);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.03em;
}
.brand-copy { display: grid; line-height: 1.25; }
.brand-copy strong { font-size: 15px; }
.brand-copy small { font-size: 12px; color: var(--muted); }
.desktop-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.desktop-nav a, .mobile-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  padding: 9px 11px;
  border-radius: 9px;
}
.desktop-nav a:hover, .mobile-nav a:hover { color: var(--text); background: var(--surface-strong); }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-button, .menu-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.icon-button svg, .menu-button svg { width: 19px; height: 19px; }
html[data-theme="light"] .moon-icon, html[data-theme="dark"] .sun-icon { display: none; }
.menu-button { display: none; }
.mobile-nav { border-top: 1px solid var(--line); padding: 10px 18px 14px; background: var(--bg); }
.mobile-nav a { display: block; }

.hero {
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 80% 10%, color-mix(in srgb, var(--accent-soft) 65%, transparent) 0, transparent 34%),
    var(--bg);
}
.hero-inner {
  max-width: 900px;
  margin: auto;
  padding: 78px 24px 64px;
  text-align: center;
}
.hero-label, .kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
h1, h2, h3 { letter-spacing: -.035em; line-height: 1.15; margin-top: 0; }
h1 { max-width: 760px; margin: 14px auto 18px; font-size: clamp(38px, 6vw, 66px); font-weight: 760; }
.hero p { max-width: 700px; margin: 0 auto; color: var(--muted); font-size: 18px; }
.search-box {
  max-width: 760px;
  min-height: 64px;
  margin: 34px auto 0;
  padding: 7px 10px 7px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  box-shadow: var(--shadow);
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 13%, transparent), var(--shadow); }
.search-box svg { width: 22px; height: 22px; color: var(--muted); flex: 0 0 auto; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.search-box kbd { border: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); border-radius: 7px; padding: 4px 8px; font-size: 11px; box-shadow: inset 0 -1px 0 var(--line); }
.popular-searches { margin-top: 16px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 13px; }
.popular-searches button { border: 0; background: transparent; color: var(--text); padding: 4px 7px; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }

.status-strip { background: var(--surface); border-bottom: 1px solid var(--line); }
.status-strip-inner { max-width: var(--max); min-height: 72px; margin: auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.device-summary { display: flex; align-items: center; gap: 12px; }
.device-summary div { display: grid; line-height: 1.3; }
.device-summary small { color: var(--muted); font-size: 12px; }
.device-summary strong { font-size: 14px; }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.status-strip a { color: var(--accent); font-size: 14px; font-weight: 750; text-decoration: none; }

.home-content, .articles-section { max-width: var(--max); margin: auto; padding: 74px 24px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.section-heading h2 { margin: 7px 0 0; font-size: clamp(30px, 4vw, 44px); }
.section-heading p { max-width: 440px; color: var(--muted); margin: 0; }
.section-heading.compact { align-items: center; margin-bottom: 20px; }
.section-heading.compact h2 { font-size: clamp(27px, 3vw, 38px); }
.text-button { border: 0; background: transparent; color: var(--accent); font-weight: 750; cursor: pointer; padding: 8px; }

.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.category-card {
  min-height: 122px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  text-align: left;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.category-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.category-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-strong); color: var(--muted); font-size: 12px; font-weight: 800; }
.category-card > span:nth-child(2) { display: grid; gap: 4px; }
.category-card strong { font-size: 17px; }
.category-card small { color: var(--muted); font-size: 14px; line-height: 1.45; }
.category-card .arrow { color: var(--muted); font-size: 21px; }

.diagnose-section { padding: 0 24px 74px; }
.diagnose-card { max-width: var(--max); margin: auto; background: var(--text); color: var(--surface); border-radius: var(--radius-lg); padding: 40px; display: grid; grid-template-columns: .85fr 1.15fr; gap: 54px; box-shadow: var(--shadow); }
html[data-theme="dark"] .diagnose-card { background: #edf0ea; color: #20211f; }
.diagnose-copy h2 { font-size: clamp(30px, 4vw, 46px); margin: 9px 0 14px; }
.diagnose-copy p, .diagnose-copy li { color: color-mix(in srgb, currentColor 70%, transparent); }
.diagnose-copy ul { padding-left: 19px; margin: 20px 0 0; }
.diagnose-form { display: flex; flex-direction: column; }
.diagnose-form label { font-size: 13px; font-weight: 750; margin-bottom: 7px; }
.diagnose-form textarea { width: 100%; resize: vertical; border: 1px solid rgba(255,255,255,.22); border-radius: 13px; padding: 15px; background: rgba(255,255,255,.09); color: inherit; outline: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
html[data-theme="dark"] .diagnose-form textarea { border-color: rgba(0,0,0,.15); background: rgba(0,0,0,.06); }
.diagnose-form textarea:focus { border-color: var(--accent); }
.button-row { margin-top: 12px; display: flex; gap: 9px; flex-wrap: wrap; }
.button { min-height: 44px; border: 1px solid transparent; border-radius: 11px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-weight: 750; cursor: pointer; }
.button.primary { background: var(--accent); color: #fff; }
html[data-theme="dark"] .button.primary { color: #13251b; }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.diagnose-card .button.secondary { background: transparent; color: inherit; border-color: color-mix(in srgb, currentColor 25%, transparent); }
.diagnose-result { margin-top: 15px; padding: 14px; border-radius: 12px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); }
html[data-theme="dark"] .diagnose-result { background: rgba(0,0,0,.06); border-color: rgba(0,0,0,.12); }
.diagnose-result strong { display: block; margin-bottom: 4px; }
.diagnose-result button { margin-top: 9px; border: 0; background: transparent; color: inherit; text-decoration: underline; cursor: pointer; padding: 0; font-weight: 750; }

.articles-section { padding-top: 0; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 18px; scrollbar-width: thin; }
.filter-chip { flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 13px; color: var(--muted); font-size: 13px; font-weight: 750; cursor: pointer; }
.filter-chip.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.article-list { border-top: 1px solid var(--line); }
.article-row { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 22px 4px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; text-align: left; cursor: pointer; }
.article-row:hover .article-title { color: var(--accent); }
.article-meta { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.article-meta span:first-child { color: var(--accent); font-weight: 800; }
.article-title { display: block; font-size: 18px; font-weight: 750; line-height: 1.35; transition: color .18s ease; }
.article-summary { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
.article-arrow { width: 35px; height: 35px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.empty-state { text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); padding: 48px 20px; background: var(--surface-soft); }
.empty-state > span { width: 48px; height: 48px; margin: auto; display: grid; place-items: center; border-radius: 50%; background: var(--surface-strong); font-weight: 800; }
.empty-state h3 { margin: 14px 0 5px; }
.empty-state p { color: var(--muted); }

.still-stuck { max-width: var(--max); margin: 0 auto 76px; padding: 34px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.still-stuck h2 { margin: 8px 0 7px; font-size: 29px; }
.still-stuck p { color: var(--muted); margin: 0; }
.report-actions { display: flex; gap: 9px; flex: 0 0 auto; }

footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { max-width: var(--max); min-height: 125px; margin: auto; padding: 28px 24px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.footer-inner > div:first-child { display: grid; }
.footer-inner span { color: var(--muted); font-size: 13px; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 13px; }
.footer-links a:hover { color: var(--text); }

.article-dialog, .report-dialog { width: min(760px, calc(100% - 28px)); max-height: calc(100vh - 36px); border: 1px solid var(--line); border-radius: 20px; padding: 0; background: var(--surface); color: var(--text); box-shadow: 0 30px 90px rgba(0,0,0,.25); }
.article-dialog::backdrop, .report-dialog::backdrop { background: rgba(15,17,14,.58); backdrop-filter: blur(5px); }
.dialog-shell { display: flex; flex-direction: column; max-height: calc(100vh - 38px); }
.dialog-head { padding: 25px 27px 19px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; }
.dialog-head span { color: var(--accent); text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.dialog-head h2 { margin: 5px 0 0; font-size: 28px; }
.dialog-close { flex: 0 0 auto; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-soft); cursor: pointer; font-size: 22px; line-height: 1; }
.dialog-body { overflow-y: auto; padding: 25px 27px; }
.dialog-body h3 { margin: 25px 0 8px; font-size: 18px; }
.dialog-body h3:first-child { margin-top: 0; }
.dialog-body p { color: var(--muted); }
.dialog-body ol, .dialog-body ul { padding-left: 22px; }
.dialog-body li { margin: 7px 0; }
.note { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 12px 14px; border-radius: 0 9px 9px 0; margin: 16px 0; color: var(--text); }
.warning-note { border-left-color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); }
.command-block { margin: 14px 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #191c19; color: #eef2eb; }
.command-bar { padding: 8px 11px; border-bottom: 1px solid rgba(255,255,255,.1); display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: #aeb6ac; }
.command-bar button { border: 0; background: transparent; color: #eef2eb; cursor: pointer; font-weight: 750; }
.command-block pre { margin: 0; padding: 14px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.source-links { display: grid; gap: 7px; margin-top: 18px; }
.source-links a { color: var(--accent); font-weight: 700; text-decoration: none; }
.source-links a:hover { text-decoration: underline; }
.dialog-footer { padding: 15px 27px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dialog-footer span { color: var(--muted); font-size: 12px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid label { display: grid; gap: 6px; }
.form-grid label span { color: var(--muted); font-size: 12px; font-weight: 750; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid input, .form-grid textarea { width: 100%; border: 1px solid var(--line); background: var(--surface-soft); color: var(--text); border-radius: 10px; padding: 11px 12px; outline: 0; resize: vertical; }
.form-grid input:focus, .form-grid textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.report-preview { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.result-head { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-soft); font-size: 12px; }
.copy-small { border: 0; background: transparent; color: var(--accent); font-weight: 800; cursor: pointer; }
.report-preview pre { margin: 0; padding: 14px; min-height: 160px; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; transform: translate(-50%, 80px); opacity: 0; pointer-events: none; background: var(--text); color: var(--surface); border-radius: 999px; padding: 10px 15px; font-size: 13px; font-weight: 750; transition: .25s ease; box-shadow: var(--shadow); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 900px) {
  .desktop-nav { display: none; }
  .menu-button { display: grid; }
  .topbar-inner { min-height: 66px; padding-inline: 18px; }
  .topbar-actions { margin-left: auto; }
  .hero-inner { padding: 58px 20px 48px; }
  .category-grid { grid-template-columns: 1fr; }
  .diagnose-card { grid-template-columns: 1fr; gap: 28px; padding: 30px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .still-stuck { margin-inline: 20px; align-items: flex-start; flex-direction: column; }
  .report-actions { width: 100%; }
  .report-actions .button { flex: 1; }
}

@media (max-width: 620px) {
  body { font-size: 15px; }
  .brand-copy small { display: none; }
  .brand-mark { width: 35px; height: 35px; }
  h1 { font-size: 39px; }
  .hero p { font-size: 16px; }
  .search-box { min-height: 58px; margin-top: 26px; padding-left: 14px; }
  .search-box kbd { display: none; }
  .popular-searches span { width: 100%; }
  .status-strip-inner { align-items: flex-start; flex-direction: column; padding-block: 15px; }
  .home-content, .articles-section { padding: 54px 18px; }
  .section-heading h2 { font-size: 33px; }
  .category-card { min-height: 108px; padding: 17px 15px; gap: 13px; }
  .category-icon { width: 39px; height: 39px; }
  .category-card strong { font-size: 16px; }
  .category-card small { font-size: 13px; }
  .diagnose-section { padding: 0 14px 54px; }
  .diagnose-card { padding: 24px 18px; border-radius: 18px; }
  .diagnose-copy h2 { font-size: 34px; }
  .article-row { padding: 18px 2px; grid-template-columns: 1fr auto; }
  .article-title { font-size: 16px; }
  .article-summary { font-size: 13px; }
  .still-stuck { margin: 0 14px 54px; padding: 24px 18px; border-radius: 18px; }
  .report-actions { flex-direction: column; }
  .footer-inner { align-items: flex-start; flex-direction: column; min-height: 150px; padding-inline: 18px; }
  .dialog-head, .dialog-body, .dialog-footer { padding-left: 18px; padding-right: 18px; }
  .dialog-head h2 { font-size: 24px; }
  .dialog-footer { align-items: stretch; flex-direction: column; }
  .dialog-footer .button { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* YT Conv ecosystem navigation */
.desktop-nav a.current,.mobile-nav a.current{background:var(--text);color:var(--bg);pointer-events:none}
