/* DuckTV Help — shared stylesheet. Version stamp is updated in each page's <link rel="stylesheet" href="...?v=..."> */

/* ---------- design tokens ---------- */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --ink: #111827;
  --muted: #6b7280;
  --muted-soft: #9ca3af;
  --line: #e5e7eb;
  --accent: #0ea5e9;
  --accent-hover: #0284c7;
  --accent-soft: #e0f2fe;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.06), 0 2px 4px -2px rgb(0 0 0 / 0.03);
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { line-height: 1.5; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 16px; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 0.5em; font-weight: 700; line-height: 1.25; }
h1 { font-size: 2rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.25rem; } h4 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0 0 1em 1.2em; padding: 0; }
strong { font-weight: 700; }
.small { font-size: 0.875em; color: var(--muted); }
.skip { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip:not(:focus):not(:active) { clip: rect(0 0 0 0); border: 0; }

/* ---------- layout ---------- */
.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 720px; }

.section { padding: 48px 0; }
.section-alt { background: var(--surface-2); }

.page-head { padding: 32px 0 24px; }
.page-head .eyebrow { font-size: 0.875em; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; display: block; }
.page-head h1 { font-size: 2rem; margin-bottom: 8px; }
.page-head .lede { font-size: 1.0625rem; color: var(--muted); max-width: 64ch; }

/* ---------- header / nav ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,0.82); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1875rem; color: var(--ink); }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.brand span { font-variant-numeric: tabular-nums; }
.nav-links { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink); font-weight: 500; font-size: 0.9375rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav-links a:hover { border-bottom-color: var(--accent); color: var(--accent); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; cursor: pointer; color: var(--ink); }
.nav-toggle svg { width: 18px; height: 18px; stroke-width: 2; fill: none; stroke: currentColor; }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-cta .btn-sm { font-size: 0.875rem; padding: 6px 14px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 8px; font-weight: 600; font-size: 0.9375rem; cursor: pointer; padding: 10px 18px; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.btn-primary { background: var(--accent); color: #ffffff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }
.btn-ghost { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #e7e7ea; }
.btn-sm { padding: 7px 14px; font-size: 0.875rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-group { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- hero ---------- */
.hero { padding: 64px 0 24px; }
.hero .wrap { max-width: 980px; }
.hero-eyebrow { font-size: 0.875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 10px; }
.hero h1 { font-size: 2.5rem; line-height: 1.15; margin: 0 0 14px; letter-spacing: -0.02em; }
.hero-sub { font-size: 1.125rem; color: var(--muted); max-width: 56ch; margin: 0 0 26px; line-height: 1.55; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- app tiles ---------- */
.app-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 40px 0 10px; }
.app-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 12px; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.app-tile:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.app-tile .t-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); display: grid; place-items: center; }
.app-tile .t-icon svg { width: 22px; height: 22px; fill: var(--accent); stroke: none; }
.app-tile h3 { font-size: 1.125rem; margin: 0 0 6px; }
.app-tile p { font-size: 0.9375rem; color: var(--muted); margin: 0; line-height: 1.5; }
.app-tile .t-meta { margin-top: auto; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent-hover); }

/* ---------- search ---------- */
.search-wrap { max-width: 560px; margin: 0 auto 48px; position: relative; }
.search-wrap .search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted-soft); pointer-events: none; }
.search-wrap input { width: 100%; padding: 12px 16px 12px 46px; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; background: var(--surface); color: var(--ink); }
.search-wrap input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14,165,233,0.12); }
#results { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; box-shadow: var(--shadow-md); max-height: 260px; overflow-y: auto; z-index: 50; padding-top: 6px; }
#results.open { display: block; }
.result-item { padding: 10px 16px; font-size: 0.9375rem; color: var(--ink); border-bottom: 1px solid var(--surface-2); cursor: pointer; }
.result-item:last-child { border-bottom: 0; }
.result-item:hover { background: var(--surface-2); text-decoration: none; }
.result-item strong { color: var(--accent-hover); }
.result-item .cat { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted-soft); margin-right: 8px; }

/* ---------- guide grid ---------- */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin-top: 26px; }
.guide-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; display: flex; flex-direction: column; transition: border-color 0.15s, box-shadow 0.15s; }
.guide-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.guide-card .g-kicker { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted-soft); margin-bottom: 6px; }
.guide-card h3 { font-size: 1.05rem; margin: 0 0 8px; line-height: 1.35; }
.guide-card p { font-size: 0.9375rem; color: var(--muted); margin: 0 0 14px; line-height: 1.5; flex: 1; }
.guide-card .g-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.guide-card .g-time { font-size: 0.8125rem; color: var(--muted-soft); font-weight: 600; }
.guide-card .g-arrow { width: 20px; height: 20px; color: var(--muted-soft); }

/* ---------- section head ---------- */
.section-head { margin-bottom: 30px; }
.section-head .eyebrow { font-size: 0.875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 6px; }
.section-head h2 { font-size: 1.5rem; margin: 0 0 8px; }
.section-head p { color: var(--muted); font-size: 1.0625rem; margin: 0; max-width: 60ch; }

/* ---------- prose ---------- */
.prose { font-size: 1.0625rem; line-height: 1.7; color: var(--ink); }
.prose h2 { margin-top: 1.6em; font-size: 1.4rem; }
.prose h3 { margin-top: 1.4em; font-size: 1.2rem; }
.prose h4 { margin-top: 1.2em; font-size: 1.1rem; }
.prose p { margin-bottom: 1.1em; }
.prose a { font-weight: 600; }
.prose ul, .prose ol { margin-bottom: 1.1em; }
.prose li { margin-bottom: 0.45em; line-height: 1.6; }
.prose code { font-family: var(--mono); font-size: 0.875em; background: var(--surface-2); padding: 0.12em 0.4em; border-radius: 4px; color: var(--ink); }
.prose pre { background: #0f172a; color: #e2e8f0; padding: 16px; border-radius: 10px; overflow-x: auto; font-family: var(--mono); font-size: 0.875em; line-height: 1.55; margin: 1.2em 0; }
.prose pre code { background: transparent; padding: 0; color: inherit; font-size: inherit; }
.prose blockquote { border-left: 4px solid var(--line); padding-left: 16px; margin: 1.2em 0; color: var(--muted); font-style: italic; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 0.9375rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose th { background: var(--surface-2); font-weight: 700; color: var(--ink); }

/* ---------- notice ---------- */
.notice { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.4em 0; }
.notice h3 { margin-top: 0; font-size: 1.05rem; color: var(--ink); }
.notice p { margin: 6px 0 0; color: var(--ink); font-size: 0.975rem; }
.notice .notice-ok { border-left-color: var(--ok); background: #ecfdf5; }
.notice .notice-warn { border-left-color: var(--warn); background: #fffbeb; }
.notice .notice-danger { border-left-color: var(--danger); background: #fef2f2; }

/* ---------- step list ---------- */
.steps { list-style: none; margin: 1.4em 0; padding: 0; }
.steps li { position: relative; padding-left: 44px; margin-bottom: 18px; min-height: 32px; }
.steps li .num { position: absolute; left: 0; top: 2px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 0.9rem; display: grid; place-items: center; }
.steps li .step-title { font-weight: 700; display: block; margin-bottom: 3px; }
.steps li p { margin: 0; font-size: 0.975rem; color: var(--ink); line-height: 1.6; }

/* ---------- breadcrumbs ---------- */
.breadcrumbs { font-size: 0.8125rem; color: var(--muted-soft); margin-bottom: 14px; display: flex; gap: 6px; align-items: center; }
.breadcrumbs a { color: var(--muted-soft); }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumbs sep { color: var(--line); }

/* ---------- article page ---------- */
.article-head { margin-bottom: 26px; }
.article-head .eyebrow { font-size: 0.875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 6px; }
.article-head h1 { font-size: 2rem; margin: 0 0 8px; }
.article-head .lede { font-size: 1.0625rem; color: var(--muted); margin: 0; max-width: 62ch; }
.article-head .meta { margin-top: 12px; font-size: 0.875rem; color: var(--muted-soft); display: flex; gap: 16px; align-items: center; }
.meta .chip { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 2px 10px; font-weight: 600; font-size: 0.78rem; }
.article-body { max-width: 720px; }

/* ---------- TOC ---------- */
.toc-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-top: 26px; font-size: 0.9375rem; }
.toc-wrap .toc-title { font-weight: 700; font-size: 0.875rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted-soft); margin-bottom: 10px; display: block; }
.toc-wrap ul { list-style: none; margin: 0; padding: 0; }
.toc-wrap li { margin-bottom: 6px; }
.toc-wrap a { color: var(--ink); }
.toc-wrap a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- cta band ---------- */
.cta-band { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 40px; text-align: center; margin-top: 48px; }
.cta-band h2 { font-size: 1.4rem; margin: 0 0 8px; }
.cta-band p { color: var(--muted); margin: 0 0 20px; max-width: 60ch; margin-left: auto; margin-right: auto; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 34px 0; background: var(--surface); }
.site-footer .wrap { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 30px; align-items: start; }
.foot-about .brand { font-size: 1.125rem; }
.foot-about p { font-size: 0.9375rem; color: var(--muted); margin-top: 8px; max-width: 34ch; line-height: 1.55; }
.foot-col h4 { font-size: 0.875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-soft); margin-bottom: 12px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; }
.foot-col li { margin-bottom: 7px; }
.foot-col a { color: var(--ink); font-size: 0.9375rem; }
.foot-col a:hover { color: var(--accent); text-decoration: underline; }
.foot-bot { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 18px; font-size: 0.875rem; color: var(--muted-soft); display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .hero h1 { font-size: 1.9rem; }
  .nav-links { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); padding: 14px 16px; flex-direction: column; gap: 10px; box-shadow: var(--shadow-md); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .nav-cta { display: none; }
  .site-footer .wrap { grid-template-columns: 1fr; gap: 24px; }
  .cta-band { padding: 26px 20px; }
  .app-grid { grid-template-columns: 1fr; }
  .section { padding: 36px 0; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.6rem; }
  .btn-lg { width: 100%; }
  .btn-group { flex-direction: column; }
}
