/* Navbar account menu (fragments.html navbar), the Help page (help/index.html) and the
   admin Help Content page (admin/help.html). Dark mode keys off html[data-theme="dark"]. */

/* ---- navbar: "Need help?" and the avatar menu ---- */
.navbar .vx-help-link { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.vx-avatar-btn { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 2px 4px;
                 margin-left: 6px; color: inherit; border-radius: 999px; }
.vx-avatar-btn:focus-visible { outline: 2px solid #3498db; outline-offset: 2px; }
.vx-avatar-btn.dropdown-toggle::after { margin-left: 2px; color: #5b6b82; }
.vx-avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
             border-radius: 50%; background: #1f4e79; color: #fff; font-size: 13px; font-weight: 700;
             letter-spacing: .02em; flex: 0 0 auto; user-select: none; }
.vx-avatar-btn:hover .vx-avatar, .vx-avatar-btn[aria-expanded="true"] .vx-avatar { background: #163a5c; }
.vx-avatar-lg { width: 42px; height: 42px; font-size: 15px; }

.vx-account-menu { min-width: 260px; padding: 6px 0; border-radius: 10px; border-color: #e3e8ef;
                   box-shadow: 0 10px 28px rgba(15, 30, 55, .16); }
.vx-account-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px 8px; }
.vx-account-who { display: flex; flex-direction: column; min-width: 0; }
.vx-account-name { font-weight: 700; color: #1d2b3a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vx-account-email { font-size: 12px; color: #6c7a8c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vx-account-menu .dropdown-item { display: flex; align-items: center; gap: 12px; padding: 9px 16px; font-size: 15px; color: #1d2b3a; }
.vx-account-menu .dropdown-item i { width: 18px; text-align: center; color: #5b6b82; font-size: 16px; }
.vx-account-menu .dropdown-item:hover, .vx-account-menu .dropdown-item:focus { background: #eef4fb; }
.vx-account-menu .vx-signout { width: 100%; }
.vx-account-menu .vx-signout, .vx-account-menu .vx-signout i { color: #c0392b; }

[data-theme="dark"] .vx-avatar-btn.dropdown-toggle::after { color: #93a7c4; }
[data-theme="dark"] .vx-avatar { background: #2f6fb0; }
[data-theme="dark"] .vx-avatar-btn:hover .vx-avatar,
[data-theme="dark"] .vx-avatar-btn[aria-expanded="true"] .vx-avatar { background: #3d85cf; }
[data-theme="dark"] .vx-account-menu { background: #10203a; border-color: #1d3454; box-shadow: 0 10px 28px rgba(0, 0, 0, .5); }
[data-theme="dark"] .vx-account-name, [data-theme="dark"] .vx-account-menu .dropdown-item { color: #e6edf7; }
[data-theme="dark"] .vx-account-email, [data-theme="dark"] .vx-account-menu .dropdown-item i { color: #93a7c4; }
[data-theme="dark"] .vx-account-menu .dropdown-item:hover,
[data-theme="dark"] .vx-account-menu .dropdown-item:focus { background: #172b47; }
[data-theme="dark"] .vx-account-menu .dropdown-divider { border-color: #1d3454; }
[data-theme="dark"] .vx-account-menu .vx-signout, [data-theme="dark"] .vx-account-menu .vx-signout i { color: #ff8a80; }

/* ---- /help ---- */
.hc-page { max-width: 980px; margin: 0 auto; padding: 12px 0 40px; }
.hc-hero h1 { font-size: 2rem; font-weight: 700; margin: 8px 0 18px; color: #1d2b3a; }
.hc-search { position: relative; max-width: 620px; }
.hc-search i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #5b6b82; pointer-events: none; }
.hc-search input { width: 100%; padding: 13px 16px 13px 44px; border: 1px solid #cfd8e3; border-radius: 8px;
                   font-size: 16px; background: #fff; color: #1d2b3a; }
.hc-search input:focus { outline: none; border-color: #3498db; box-shadow: 0 0 0 3px rgba(52, 152, 219, .2); }
.hc-section { margin-top: 34px; }
.hc-section h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 14px; color: #1d2b3a; }
.hc-shortcuts { display: flex; flex-wrap: wrap; gap: 10px; }
.hc-shortcut { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border: 1px solid #cfd8e3;
               border-radius: 999px; background: #fff; color: #1f4e79; font-weight: 600; text-decoration: none; }
.hc-shortcut:hover { background: #eef4fb; border-color: #9fb9d6; color: #163a5c; }
.hc-group { margin-bottom: 22px; }
.hc-group h3 { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #5b6b82; margin: 0 0 6px; }
.hc-faq { border-top: 1px solid #e3e8ef; }
.hc-faq:last-child { border-bottom: 1px solid #e3e8ef; }
.hc-faq > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 4px;
                    cursor: pointer; list-style: none; font-size: 16px; color: #1d2b3a; }
.hc-faq > summary::-webkit-details-marker { display: none; }
.hc-faq > summary::after { content: "\F282"; font-family: bootstrap-icons; color: #1f6fb2; transition: transform .15s; flex: 0 0 auto; }
.hc-faq[open] > summary::after { transform: rotate(180deg); }
.hc-faq > summary:hover { color: #1f6fb2; }
.hc-answer { padding: 0 4px 18px; white-space: pre-line; color: #34495e; line-height: 1.6; }
.hc-empty, .hc-none { color: #6c7a8c; padding: 12px 0; }
mark.hc-hit { padding: 0 1px; background: #fff3b0; border-radius: 2px; }

[data-theme="dark"] .hc-hero h1, [data-theme="dark"] .hc-section h2,
[data-theme="dark"] .hc-faq > summary { color: #e6edf7; }
[data-theme="dark"] .hc-search input { background: #0d1a2f; border-color: #1d3454; color: #e6edf7; }
[data-theme="dark"] .hc-search i, [data-theme="dark"] .hc-group h3,
[data-theme="dark"] .hc-empty, [data-theme="dark"] .hc-none { color: #93a7c4; }
[data-theme="dark"] .hc-shortcut { background: #10203a; border-color: #1d3454; color: #8cc4ff; }
[data-theme="dark"] .hc-shortcut:hover { background: #172b47; }
[data-theme="dark"] .hc-faq, [data-theme="dark"] .hc-faq:last-child { border-color: #1d3454; }
[data-theme="dark"] .hc-faq > summary::after, [data-theme="dark"] .hc-faq > summary:hover { color: #4da3ff; }
[data-theme="dark"] .hc-answer { color: #c9d6e8; }
[data-theme="dark"] mark.hc-hit { background: #5a4b00; color: #fff; }

/* ---- /admin/help ---- */
.ha-page { max-width: 1180px; margin: 0 auto; padding: 20px 0; }
.ha-card { background: #fff; border: 1px solid #e3e8ef; border-radius: 14px; margin-bottom: 18px; overflow: hidden; }
.ha-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px;
                padding: 14px 18px; border-bottom: 1px solid #e3e8ef; }
.ha-card-head h2 { font-size: 1.15rem; font-weight: 700; margin: 0; }
.ha-form { display: grid; grid-template-columns: 1fr 2fr; gap: 12px 16px; padding: 16px 18px; }
.ha-form .ha-wide { grid-column: 1 / -1; }
.ha-form label.ha-label { display: block; min-width: 0; padding: 0; margin: 0 0 3px; font-size: .8rem; font-weight: 600; color: #5b6b82; }
.ha-form textarea { min-height: 160px; }
.ha-hint { font-size: .8rem; color: #6c757d; margin-top: 3px; }
.ha-form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ha-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ha-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #6c757d; padding: 8px 10px; text-align: left; white-space: nowrap; }
.ha-table td { padding: 8px 10px; border-top: 1px solid #edf1f6; vertical-align: top; }
.ha-table tr.is-hidden td { opacity: .6; }
.ha-table tr.is-editing td { background: rgba(13, 110, 253, .06); }
.ha-q { font-weight: 600; }
.ha-a { color: #6c757d; font-size: .85rem; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ha-actions { white-space: nowrap; text-align: right; }
.ha-actions form { display: inline; }
.ha-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.ha-badge.on { background: #e3f6ea; color: #1e7b45; }
.ha-badge.off { background: #eef1f5; color: #5b6b82; }
.ha-scroll { overflow-x: auto; }
@media (max-width: 760px) { .ha-form { grid-template-columns: 1fr; } }

[data-theme="dark"] .ha-card { background: #10203a; border-color: #1d3454; color: #e6edf7; }
[data-theme="dark"] .ha-card-head { border-color: #1d3454; }
[data-theme="dark"] .ha-table td { border-color: #172b47; }
[data-theme="dark"] .ha-a, [data-theme="dark"] .ha-hint, [data-theme="dark"] .ha-table th { color: #93a7c4; }
[data-theme="dark"] .ha-form label.ha-label { color: #93a7c4 !important; }
[data-theme="dark"] .ha-badge.on { background: #12402a; color: #7ee2a8; }
[data-theme="dark"] .ha-badge.off { background: #172b47; color: #93a7c4; }

/* ---- footer links (fragments.html footer) ---- */
.vx-footer-links { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; margin-bottom: 6px; }
.vx-footer-links a { color: #1f4e79; text-decoration: none; font-weight: 500; }
.vx-footer-links a:hover { text-decoration: underline; }
[data-theme="dark"] .vx-footer-links a { color: #8cc4ff; }

/* ---- "Back to" link at the top of flow pages (fragments.html backLink) ---- */
.vx-back { margin: 0 0 12px; font-size: .92rem; line-height: 1.4; }
.vx-back a { display: inline-flex; align-items: center; gap: 6px; color: #1f6fb2; text-decoration: none; font-weight: 500; }
.vx-back a:hover { text-decoration: underline; }
.vx-back a:focus-visible { outline: 2px solid #3498db; outline-offset: 2px; border-radius: 3px; }
[data-theme="dark"] .vx-back a { color: #8cc4ff; }

/* ---- "Are you still there?" idle warning (js/session-timeout.js) ---- */
.vx-idle { display: none; position: fixed; inset: 0; z-index: 2000; background: rgba(10, 20, 35, .55);
           align-items: center; justify-content: center; padding: 16px; }
.vx-idle.is-open { display: flex; }
.vx-idle-box { width: 100%; max-width: 420px; background: #fff; color: #1d2b3a; border-radius: 12px; padding: 24px 24px 20px;
               text-align: center; box-shadow: 0 18px 48px rgba(0, 0, 0, .3); }
.vx-idle-icon { font-size: 2.2rem; color: #1f6fb2; }
.vx-idle-box h2 { font-size: 1.3rem; font-weight: 700; margin: 8px 0 8px; }
.vx-idle-box p { color: #34495e; margin-bottom: 18px; }
.vx-idle-count { font-variant-numeric: tabular-nums; }
.vx-idle-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.vx-idle-actions button { min-width: 140px; padding: 10px 16px; border-radius: 6px; font-weight: 600; border: 1px solid #cfd8e3; background: #fff; color: #34495e; }
.vx-idle-actions .vx-idle-stay { background: #1f4e79; border-color: #1f4e79; color: #fff; }
.vx-idle-actions .vx-idle-stay:hover { background: #163a5c; }
.vx-idle-actions button:focus-visible { outline: 3px solid rgba(52, 152, 219, .5); outline-offset: 2px; }
[data-theme="dark"] .vx-idle-box { background: #10203a; color: #e6edf7; border: 1px solid #1d3454; }
[data-theme="dark"] .vx-idle-box p { color: #c9d6e8; }
[data-theme="dark"] .vx-idle-icon { color: #4da3ff; }
[data-theme="dark"] .vx-idle-actions button { background: #0d1a2f; border-color: #1d3454; color: #e6edf7; }
[data-theme="dark"] .vx-idle-actions .vx-idle-stay { background: #2f6fb0; border-color: #2f6fb0; }
