/* ReplayPRO Help — standalone stylesheet for the public help center (/help). */

:root {
    --page: #fbfbfd;
    --card: #ffffff;
    --tint: #f3f2f8;
    --ink: #1b1a24;
    --sub: #575567;
    --faint: #7b7889;
    --line: #e5e3ee;
    --line-soft: #efedf5;
    --accent: #5b3fd0;
    --accent-hover: #4a30b8;
    --accent-soft: #efebfc;
    --on-accent: #ffffff;
    --code-bg: #f4f3f8;
    --radius: 10px;
    --header-h: 56px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --page: #121118;
        --card: #1a1922;
        --tint: #22212c;
        --ink: #ecebf2;
        --sub: #b3b0c2;
        --faint: #8d8a9c;
        --line: #2e2c3a;
        --line-soft: #26242f;
        --accent: #a995ff;
        --accent-hover: #c1b2ff;
        --accent-soft: #2a2545;
        --on-accent: #16131f;
        --code-bg: #23222d;
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font: 400 15px/1.6 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
a:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header / footer ---------- */

.site-header {
    position: sticky; top: 0; z-index: 10;
    background: color-mix(in srgb, var(--page) 88%, transparent);
    backdrop-filter: saturate(1.3) blur(10px);
    -webkit-backdrop-filter: saturate(1.3) blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-row { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.brand b { color: var(--accent); font-weight: 600; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.header-links { display: flex; gap: 4px; }
.header-links a { color: var(--sub); text-decoration: none; font-size: 14px; font-weight: 500; padding: 6px 10px; border-radius: 7px; }
.header-links a:hover { color: var(--ink); background: var(--tint); }

.page { padding-top: 28px; padding-bottom: 48px; min-height: calc(100vh - var(--header-h) - 80px); }

.site-footer { border-top: 1px solid var(--line); color: var(--faint); font-size: 13.5px; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 20px; padding-bottom: 24px; }
.footer-links { display: flex; gap: 16px; }
.site-footer a { color: var(--sub); }

/* ---------- index ---------- */

.index { max-width: 820px; margin: 0 auto; }
.index-head { margin: 8px 0 20px; }
.index h1, .article h1 { font-size: 26px; line-height: 1.25; letter-spacing: -0.01em; margin: 0 0 8px; font-weight: 650; }
.lead { color: var(--sub); margin: 0 0 18px; font-size: 15.5px; }

.search { position: relative; display: block; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input {
    width: 100%; height: 42px; padding: 0 14px 0 36px;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--card); color: var(--ink); font: inherit; font-size: 15px;
    box-shadow: 0 1px 2px rgba(20, 18, 40, .04);
}
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

.article-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.article-card { display: flex; flex-direction: column; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.article-card:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.article-link { display: block; flex: 1 0 auto; padding: 14px 16px; text-decoration: none; color: inherit; }
.article-title { display: block; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.article-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--sub); font-size: 13.5px; line-height: 1.5; }
.article-matches { list-style: none; margin: 0; padding: 8px 16px 12px; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.article-matches li { padding: 2px 0; }
.article-matches a { text-decoration: none; }
.article-matches a::before { content: '§ '; color: var(--faint); }
.searching .article-list { grid-template-columns: minmax(0, 1fr); }
.empty { color: var(--sub); margin-top: 18px; }

/* ---------- article ---------- */

.article-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }

.article-nav { position: sticky; top: calc(var(--header-h) + 20px); max-height: calc(100vh - var(--header-h) - 40px); overflow: auto; font-size: 14px; }
.nav-heading { margin: 0 0 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); }
.article-nav ul { list-style: none; margin: 0; padding: 0; }
.article-nav a { display: block; padding: 5px 10px; margin: 1px 0; border-radius: 7px; color: var(--sub); text-decoration: none; line-height: 1.4; }
.article-nav a:hover { color: var(--ink); background: var(--tint); }
.article-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

.article { max-width: 760px; min-width: 0; }
.breadcrumbs { margin: 0 0 8px; color: var(--faint); font-size: 13.5px; }
.breadcrumbs a { color: var(--sub); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }

.toc { margin: 16px 0 8px; padding: 10px 16px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); font-size: 14px; }
.toc summary { cursor: pointer; font-weight: 600; color: var(--ink); padding: 2px 0; }
.toc ul { margin: 8px 0 0; padding: 0; list-style: none; columns: 2; column-gap: 24px; }
.toc li { break-inside: avoid; padding: 2px 0; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.contact-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 16px 0 8px; padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--card); }
.contact-box p { margin: 0; color: var(--sub); font-size: 14px; }
.contact-box .contact-title { color: var(--ink); font-weight: 600; margin-bottom: 2px; font-size: 15px; }
.button { flex: none; display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 14px; text-decoration: none; }
.button:hover { background: var(--accent-hover); color: var(--on-accent); }

/* ---------- prose ---------- */

.prose { font-size: 15.5px; line-height: 1.7; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 16px; }
.prose h2 { font-size: 20px; line-height: 1.3; margin: 36px 0 10px; padding-top: 20px; border-top: 1px solid var(--line-soft); font-weight: 650; }
.prose h3 { font-size: 16.5px; line-height: 1.35; margin: 26px 0 8px; font-weight: 600; }
.prose h4 { font-size: 15.5px; margin: 20px 0 6px; font-weight: 600; }
.prose h2:target, .prose h3:target { scroll-margin-top: calc(var(--header-h) + 16px); }
.prose .anchor { margin-left: 4px; color: var(--faint); text-decoration: none; opacity: 0; font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor, .prose .anchor:focus { opacity: 1; }
.prose p, .prose ul, .prose ol, .prose table, .prose pre, .prose blockquote { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose li > ul, .prose li > ol { margin: 4px 0; }
.prose strong { font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.prose img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }
.prose blockquote { padding: 8px 14px; border-left: 3px solid var(--line); color: var(--sub); background: var(--tint); border-radius: 0 8px 8px 0; }
.prose blockquote > :last-child { margin-bottom: 0; }

.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; font-size: .88em; background: var(--code-bg); padding: .12em .38em; border-radius: 5px; }
.prose pre { background: var(--code-bg); border: 1px solid var(--line-soft); border-radius: 8px; padding: 12px 14px; overflow-x: auto; line-height: 1.5; }
.prose pre code { background: none; padding: 0; font-size: 13.5px; }

.prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 14px; line-height: 1.5; max-width: 100%; }
.prose th, .prose td { border: 1px solid var(--line); padding: 7px 11px; text-align: left; vertical-align: top; }
.prose th { background: var(--tint); font-weight: 600; }

/* ---------- small screens ---------- */

@media (max-width: 860px) {
    .article-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .article-nav { position: static; max-height: none; order: 2; border-top: 1px solid var(--line); padding-top: 20px; }
    .article-list { grid-template-columns: minmax(0, 1fr); }
    .toc ul { columns: 1; }
}

@media (max-width: 520px) {
    .wrap { padding-left: 16px; padding-right: 16px; }
    .header-links a:first-child { display: none; }
    .index h1, .article h1 { font-size: 23px; }
    .prose { font-size: 15px; }
    .contact-box { flex-direction: column; align-items: flex-start; }
}
