/* nMon help center (template/help.php) */
:root {
    --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f0f2f5; --text: #1f2933; --muted: #5f6b7a;
    --border: #e1e5ea; --accent: #2f7d5b; --accent-text: #ffffff; --accent-soft: #e6f2ec;
    --code-bg: #eef1f4; --mark: #fff1a8; --shadow: 0 8px 28px rgba(15, 23, 42, .12);
}
html[data-theme="dark"] {
    --bg: #12161b; --surface: #1a2027; --surface-2: #222a32; --text: #e4e8ec; --muted: #9aa6b2;
    --border: #2d3640; --accent: #4cb487; --accent-text: #0d1a13; --accent-soft: #1d3329;
    --code-bg: #0e1216; --mark: #5c4f12; --shadow: 0 8px 28px rgba(0, 0, 0, .45);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* top bar */
.help-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.help-brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; white-space: nowrap; }
.help-brand:hover { text-decoration: none; }
.help-brand img { height: 28px; }
.help-brand em { font-style: normal; font-weight: 400; color: var(--muted); padding-left: 8px; border-left: 1px solid var(--border); }
.help-search { position: relative; flex: 1; max-width: 520px; margin: 0 auto; }
.help-search > .fa { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.help-search input { width: 100%; padding: 8px 64px 8px 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 14px; outline: none; }
.help-search input:focus { border-color: var(--accent); background: var(--surface); }
.help-search input:not(:placeholder-shown) ~ kbd { display: none; }
.help-search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 11px/1 inherit; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 3px 5px; background: var(--surface); }
.help-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); max-height: 70vh; overflow-y: auto; padding: 6px; }
.help-results a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.help-results a:hover, .help-results a.sel { background: var(--accent-soft); text-decoration: none; }
.help-results b { display: block; font-size: 14px; }
.help-results small { display: block; color: var(--muted); font-size: 12px; }
.help-results span { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.help-results mark { background: var(--mark); color: inherit; border-radius: 2px; }
.help-results .none { padding: 10px; color: var(--muted); font-size: 14px; }
.help-actions { display: flex; align-items: center; gap: 8px; }
.help-icon-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; }
.help-icon-btn:hover { background: var(--surface-2); text-decoration: none; }
.help-btn { display: inline-block; padding: 7px 14px; border-radius: 8px; background: var(--accent); color: var(--accent-text); font-size: 14px; font-weight: 600; white-space: nowrap; border: 1px solid var(--accent); }
.help-btn:hover { text-decoration: none; filter: brightness(1.07); }
.help-btn-ghost { background: transparent; color: var(--accent); }
.help-menu-btn { display: none; }

/* layout */
.help-layout { display: flex; max-width: 1240px; margin: 0 auto; }
.help-nav { width: 270px; flex-shrink: 0; position: sticky; top: 57px; align-self: flex-start; max-height: calc(100vh - 57px); overflow-y: auto; padding: 22px 12px 40px 20px; font-size: 14px; }
.help-nav a { display: block; padding: 4px 10px; border-radius: 6px; color: var(--muted); }
.help-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.help-nav a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.help-nav-home { margin-bottom: 10px; }
.help-nav-section { margin-bottom: 14px; }
.help-nav-title { padding: 4px 10px; font-weight: 600; color: var(--text); font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.help-main { flex: 1; min-width: 0; padding: 28px 32px 60px; }

/* overview */
.help-hero h1 { margin: 0 0 6px; font-size: 30px; }
.help-hero p { margin: 0 0 26px; color: var(--muted); font-size: 16px; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.help-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
.help-card h2 { margin: 0 0 10px; font-size: 16px; }
.help-card h2 .fa { color: var(--accent); }
.help-card ul { margin: 0; padding: 0; list-style: none; font-size: 14px; }
.help-card li { padding: 3px 0; }

/* article */
.help-article { max-width: 780px; }
.help-crumb { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.help-article h1 { margin: 0 0 18px; font-size: 28px; line-height: 1.25; }
.help-body p, .help-body ul, .help-body ol { margin: 0 0 14px; }
.help-body li { margin-bottom: 6px; }
.help-body code { background: var(--code-bg); border-radius: 4px; padding: 1px 5px; font-size: 13px; word-break: break-word; }
.help-body pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow-x: auto; font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; }
.help-scroll { overflow-x: auto; margin-bottom: 14px; }
.help-table { border-collapse: collapse; width: 100%; font-size: 14px; margin-bottom: 14px; }
.help-table th, .help-table td { border-bottom: 1px solid var(--border); padding: 7px 10px; text-align: left; vertical-align: top; }
.help-table th { background: var(--surface-2); }
.help-plans td, .help-plans th { text-align: center; white-space: nowrap; }
.help-plans td:first-child { text-align: left; color: var(--muted); }
.help-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--border); }
.help-pager a { flex: 1; max-width: 48%; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; background: var(--surface); }
.help-pager a:hover { border-color: var(--accent); text-decoration: none; }
.help-pager small { display: block; color: var(--muted); font-size: 12px; }
.help-pager-next { text-align: right; margin-left: auto; }
.help-contact { margin-top: 36px; padding: 16px 20px; border-radius: 12px; background: var(--accent-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; max-width: 780px; }

/* phones and tablets */
@media (max-width: 900px) {
    .help-menu-btn { display: inline-flex; }
    .help-nav { position: fixed; z-index: 40; top: 0; left: 0; bottom: 0; max-height: none; width: 280px; background: var(--surface); border-right: 1px solid var(--border); transform: translateX(-100%); transition: transform .2s; }
    body.help-nav-open .help-nav { transform: none; box-shadow: var(--shadow); }
    .help-main { padding: 20px 16px 50px; }
    .help-brand em, .help-hide-sm { display: none; }
}
@media (max-width: 600px) {
    .help-top { flex-wrap: wrap; padding: 8px 16px; gap: 8px; }
    .help-search { order: 5; flex-basis: 100%; max-width: none; }
    .help-search kbd { display: none; }
    .help-search input { padding-right: 12px; }
    .help-actions { margin-left: auto; }
    .help-hero h1, .help-article h1 { font-size: 24px; }
    .help-pager { flex-direction: column; }
    .help-pager a { max-width: none; }
}
