/* Shared by the standalone guide and the dialog. App styles stay scoped. */
.help-entry { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 24px; font-size: 14px; flex-shrink: 0; text-decoration: none; color: var(--text-secondary); }
.help-entry:hover { color: var(--text-primary); background: var(--bg-hover); }
.help-entry svg { flex-shrink: 0; }
.sidebar-settings-body a[data-open-help] { text-decoration: none; }
.welcome .help-welcome-link { margin-top: 8px; font-size: 14px; color: var(--accent); text-underline-offset: 4px; }
.help-dialog { margin: 0; padding: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; border: 0; background: var(--bg-primary); color: var(--text-primary); }
.help-dialog[open] { display: flex; flex-direction: column; animation: help-appear 160ms ease-out; }
.help-dialog::backdrop { background: rgb(0 0 0 / 55%); }
.help-dialog-header, .help-page-header { display: flex; align-items: center; gap: 16px; min-height: 65px; padding: 12px 28px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.help-dialog-header h2 { flex: 1; font-size: 16px; font-weight: 600; }
.help-dialog-header a { font-size: 13px; color: var(--text-secondary); text-underline-offset: 3px; }
.help-close { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; font-weight: 500; line-height: 1.5; flex-shrink: 0; }
.help-close span[aria-hidden] { font-size: 23px; line-height: 1; }
.help-close:hover { background: var(--bg-hover); }
.help-dialog-body { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.help-loading { padding: 32px; line-height: 1.8; }
.help-page { display: flex; flex-direction: column; overflow: auto; }
.help-page-header { max-width: 1080px; width: 100%; margin: auto; }
.help-page-header > span { flex: 1; color: var(--text-secondary); font-size: 14px; }
.help-page-header .brand { text-decoration: none; }
.help-content { color: var(--text-primary); font-size: 16px; line-height: 1.65; width: 100%; max-width: 1080px; margin: 0 auto; flex: 1; min-height: 0; }
.help-content.help-enhanced { display: flex; flex-direction: column; overflow: hidden; }
.help-nav { display: flex; gap: 4px; padding: 12px 28px; border-bottom: 1px solid var(--border); flex-shrink: 0; flex-wrap: wrap; }
.help-nav a { display: inline-flex; align-items: center; justify-content: center; padding: 9px 14px; min-height: 44px; border-radius: 9px; color: var(--text-secondary); text-decoration: none; font-weight: 500; font-size: 14px; }
.help-nav a:hover { background: var(--bg-hover); color: var(--text-primary); }
.help-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-subtle); }
.help-scroll { padding: 32px 40px; overflow: auto; overscroll-behavior: contain; min-height: 0; }
.help-content [data-help-section] { max-width: 900px; margin: 0 auto 36px; }
.help-enhanced [data-help-section] { margin-bottom: 0; }
.help-content [hidden] { display: none !important; }
.help-content h1 { font-size: clamp(27px, 3.3vw, 38px); letter-spacing: -1.1px; line-height: 1.18; font-weight: 650; margin: 10px 0 18px; max-width: 760px; }
.help-content h1:focus { outline: none; }
.help-content h2 { font-size: 17px; font-weight: 600; line-height: 1.4; }
.help-eyebrow { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 1.5px; }
.help-lead { color: var(--text-secondary); max-width: 710px; margin-bottom: 24px; }
.help-content a { color: var(--accent); text-underline-offset: 3px; }
.help-content a:focus-visible, .help-page-header a:focus-visible, .help-dialog-header a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.help-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 30px; }
.help-button { display: inline-flex; justify-content: center; align-items: center; gap: 14px; min-height: 44px; border: 1px solid var(--border); border-radius: 10px; padding: 9px 15px; color: var(--text-primary); text-decoration: none; font-size: 14px; font-weight: 500; line-height: 1.5; }
.help-content .help-button { color: var(--text-primary); }
.help-button:hover { background: var(--bg-hover); border-color: var(--text-muted); }
.help-content .help-primary { color: var(--bg-primary); background: var(--accent); border-color: var(--accent); }
.help-primary:hover { background: var(--accent-hover); }
.help-steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 28px 0; }
.help-steps li { display: flex; gap: 12px; }
.help-step-number { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; background: var(--accent-subtle); color: var(--accent); font-size: 13px; font-weight: 600; }
.help-steps p { font-size: 14px; color: var(--text-secondary); margin-top: 7px; }
.help-demo { padding: 22px 24px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-secondary); }
.help-demo-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.help-caption { font-size: 12px; color: var(--text-secondary); }
.help-demo-choices { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 12px; }
.help-demo-choices button { font-size: 13px; padding: 8px 12px; min-height: 44px; border-radius: 8px; border: 1px solid var(--border); }
.help-demo-choices button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }
.help-demo-prompt { font-size: 17px; min-height: 85px; margin: 14px 0; padding-left: 16px; border-left: 2px solid var(--accent); }
.help-note { font-size: 14px; color: var(--text-secondary); padding: 14px 0; margin-top: 12px; }
.help-section-footer { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 14px; margin-top: 8px; }
.help-section-footer a, .help-text-button { padding: 8px 0; min-height: 44px; }
.help-text-button { font-size: 13px; text-decoration: underline; text-underline-offset: 3px; color: var(--text-secondary); }
.help-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.help-card { border: 1px solid var(--border); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.help-card > p { font-size: 15px; color: var(--text-secondary); }
.help-card .help-prompt { color: var(--text-primary); }
.help-card .help-followup { font-size: 13px; }
.help-card .help-button { margin-top: auto; }
.help-tool-control { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.help-tool-control svg { width: 18px; height: 18px; flex-shrink: 0; }
.help-tool-state { font-size: 12px; color: var(--text-secondary); margin-top: auto; }
.help-card ul { padding-left: 20px; color: var(--text-secondary); font-size: 15px; }
.help-card li + li { margin-top: 8px; }
.help-subheading { margin: 28px 0 14px; }
.help-rules { padding-left: 24px; color: var(--text-secondary); }
.help-rules li { padding-left: 6px; margin-bottom: 12px; }
.help-rules strong { color: var(--text-primary); }
.help-detail { border-bottom: 1px solid var(--border); padding: 5px 0; margin-top: 12px; }
.help-detail h2 { padding: 14px 4px; font-weight: 600; line-height: 1.5; }
.help-detail p { color: var(--text-secondary); margin: 0 4px 16px; max-width: 760px; font-size: 15px; }
.help-status { color: var(--accent); font-size: 14px; }
.help-status:not(:empty) { margin-top: 16px; }
.help-mini-tip { padding: 16px 20px; margin: 12px 0; border-radius: 12px; background: var(--accent-subtle); color: var(--text-secondary); font-size: 14px; }
.help-mini-tip strong { color: var(--text-primary); }
.help-live-target { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; box-shadow: 0 0 0 7px var(--accent-subtle); }
@keyframes help-appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 700px) {
    .help-dialog { width: 100%; height: 100dvh; border-radius: 0; border: 0; }
    .help-dialog-header, .help-page-header { padding: 8px 16px; gap: 10px; }
    .help-dialog-header { padding-top: max(8px, env(safe-area-inset-top)); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
    .help-dialog-header a { font-size: 12px; }
    .help-dialog-header > a { display: none; }
    .help-page-header > span { display: none; }
    .help-page-header .brand { margin-right: auto; }
    .help-nav { padding: 10px 14px; gap: 2px; }
    .help-nav a { padding: 8px 11px; font-size: 13px; }
    .help-scroll { padding: 24px 20px; }
    .help-scroll { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
    .help-steps { grid-template-columns: 1fr; gap: 18px; }
    .help-card-grid { grid-template-columns: 1fr; }
    .help-demo { padding: 18px; }
    .help-demo-prompt { min-height: 140px; }
    .help-card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    .help-dialog[open] { animation: none; }
    .help-content *, .help-entry { transition: none; scroll-behavior: auto; }
}
@media print {
    @page { margin: 16mm; }
    body.help-printing { height: auto; overflow: visible; background: white; }
    body.help-printing > :not(.help-dialog):not(.help-content) { display: none !important; }
    body.help-printing .help-dialog, body.help-printing .help-dialog-body, body.help-printing .help-content, body.help-printing .help-scroll { display: block; position: static; width: auto; height: auto; max-height: none; overflow: visible; padding: 0; margin: 0; border: 0; box-shadow: none; color: #111; background: white; }
    body.help-printing .help-dialog::backdrop { display: none; }
    body.help-printing .help-dialog-header, body.help-printing .help-nav, body.help-printing .help-actions, body.help-printing .help-section-footer, body.help-printing .help-demo, body.help-printing .help-status { display: none; }
    body.help-printing [data-help-section] { display: none !important; }
    body.help-printing #help-start, body.help-printing #help-basics { display: block !important; break-after: page; }
    body.help-printing #help-basics { break-after: auto; }
    body.help-printing .help-content { font-size: 11pt; --text-primary: #111; --text-secondary: #333; --accent: #244b99; --border: #ccc; }
    body.help-printing .help-content h1 { font-size: 25pt; }
    body.help-printing .help-steps { grid-template-columns: 1fr; }
    body.help-printing .help-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.help-printing .help-card { padding: 14px; break-inside: avoid; }
    body.help-printing .help-legal { font-size: 10pt; }
    body.help-printing .help-legal p { font-size: 10pt; }
}
