/* Help & Tutorials — dock, chips, (?) icons, Help Center. See docs/claude/help.md. */

:root {
    --help-dock-width: 380px;
    --help-accent: #750909;
    --help-tip-bg: #eef6ff;
    --help-tip-border: #8fb8e8;
    --help-watch-bg: #fff4e5;
    --help-watch-border: #e0a040;
}

/* ── [[Label]] chip: looks like the button it names ───────────────────── */
.help-chip {
    display: inline-block;
    padding: 0 .45em;
    margin: 0 .1em;
    border: 1px solid #adb5bd;
    border-bottom-width: 2px;
    border-radius: 4px;
    background: #f8f9fa;
    color: #212529;
    font-weight: 600;
    font-size: .92em;
    line-height: 1.5;
    white-space: nowrap;
}

/* ── The dock ─────────────────────────────────────────────────────────
   ⚠️ LEFT, and z-index ABOVE the side-panel backdrop (31040) but BELOW the side panel (31050): a guide's own
   step opens a right-hand panel, and the guide must stay readable and clickable beside it. A full-width panel
   still covers the dock — that panel is the whole screen on purpose. */
.help-dock {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--help-dock-width);
    max-width: 100vw;
    z-index: 31045;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid #dee2e6;
    box-shadow: 2px 0 12px rgba(0, 0, 0, .18);
    font-size: 1.05rem;
    line-height: 1.5;
}

.help-dock-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .75rem;
    background: var(--help-accent);
    color: #fff;
}

.help-dock-header .help-dock-title { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.help-dock-header button { background: transparent; border: 0; color: #fff; padding: .15rem .4rem; border-radius: 4px; }
.help-dock-header button:hover { background: rgba(255, 255, 255, .18); }

.help-dock-body { flex: 1; overflow-y: auto; padding: .85rem .9rem; }
.help-dock-footer { display: flex; gap: .5rem; align-items: center; padding: .6rem .75rem; border-top: 1px solid #dee2e6; background: #f8f9fa; }

.help-dock-progress { height: 4px; background: #e9ecef; }
.help-dock-progress > div { height: 100%; background: var(--help-accent); transition: width .2s; }

.help-do-line { display: flex; gap: .5rem; align-items: flex-start; padding: .35rem 0; cursor: pointer; }
.help-do-line input { margin-top: .3rem; flex-shrink: 0; }
.help-do-line.done .help-do-text { color: #6c757d; text-decoration: line-through; }

.help-box { border-left: 4px solid; border-radius: 4px; padding: .5rem .65rem; margin: .65rem 0; font-size: .92em; }
.help-box-tip { background: var(--help-tip-bg); border-color: var(--help-tip-border); }
.help-box-watch { background: var(--help-watch-bg); border-color: var(--help-watch-border); }
.help-box i { margin-right: .35rem; }

.help-on-page { color: #2e7d32; font-size: .9em; font-weight: 600; }

.help-topic { display: block; width: 100%; text-align: left; border: 1px solid #e9ecef; border-left: 4px solid var(--help-accent);
              border-radius: 6px; background: #fff; padding: .55rem .7rem; margin-bottom: .5rem; color: inherit; }
.help-topic:hover { background: #f8f9fa; }
.help-topic-title { font-weight: 600; display: block; }
.help-topic-summary { color: #6c757d; font-size: .88em; display: block; }

/* Collapsed: a small tab on the left edge, so the guide is one click away without covering anything. */
.help-dock-tab {
    position: fixed;
    left: 0;
    top: 40%;
    z-index: 31045;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    background: var(--help-accent);
    color: #fff;
    border: 0;
    border-radius: 0 6px 6px 0;
    padding: .8rem .4rem;
    box-shadow: 2px 0 8px rgba(0, 0, 0, .25);
    font-weight: 600;
}

/* ⚠️ Wide screens: the dock PUSHES the page and takes the nav menu's place. Dock + menu on a 1366px laptop
   leaves too little page; the menu comes back the moment the dock closes or collapses. */
@media (min-width: 1200px) {
    body.help-docked { padding-left: var(--help-dock-width); }
    body.help-docked .main-drawer > .dxbl-drawer-panel { display: none !important; }
}

/* ── (?) icon ─────────────────────────────────────────────────────────── */
.help-icon { display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0;
             padding: 0 .2rem; color: #6c757d; font-size: .95em; vertical-align: middle; cursor: pointer; line-height: 1; }
.help-icon:hover { color: var(--help-accent); }
.help-icon.light { color: rgba(255, 255, 255, .85); }
.help-icon.light:hover { color: #fff; }

.help-link { cursor: pointer; text-decoration: underline dotted; }
.help-link i { margin-right: .25rem; }

/* ── Help Center + tutorial page ──────────────────────────────────────── */
.help-category { border-left: 4px solid #6c757d; }
.help-card { border: 1px solid #e9ecef; border-radius: 8px; padding: .75rem .9rem; height: 100%; background: #fff; }
.help-card:hover { box-shadow: 0 .2rem .6rem rgba(0, 0, 0, .08); }
.help-card a { text-decoration: none; }
.help-meta { color: #6c757d; font-size: .85em; }
.help-step-number { display: inline-flex; width: 1.8rem; height: 1.8rem; border-radius: 50%; align-items: center; justify-content: center;
                    background: var(--help-accent); color: #fff; font-weight: 700; margin-right: .5rem; flex-shrink: 0; }

@media print {
    .help-dock, .help-dock-tab, .help-no-print, .app-header-shell, .main-drawer > .dxbl-drawer-panel { display: none !important; }
    body.help-docked { padding-left: 0 !important; }
}

/* ── Plain-reader sizing: the people using this are not confident with software ──────── */
.help-dock .help-dock-title { font-size: 1.05rem; }
.help-dock h6 { font-size: 1.15rem; }
.help-dock .btn-sm { font-size: .98rem; padding: .35rem .8rem; }
.help-do-line { padding: .5rem 0; }
.help-do-line input { width: 1.2rem; height: 1.2rem; }

/* "Show me": a chip in the dock is a button that points at the real control. */
button.help-chip { cursor: pointer; }
button.help-chip:hover { background: #fff3cd; border-color: #e0a800; }
button.help-chip i { font-size: .75em; margin-left: .3em; opacity: .55; }
.help-show-note { font-size: .88em; color: #8a5a00; margin-top: .35rem; }

.help-box-see { background: #eaf7ee; border-color: #6cbf84; }

/* The real control being pointed at. Outline, not a size change, so the layout never jumps. */
@keyframes help-flash-pulse {
    0%, 100% { outline-color: rgba(255, 193, 7, 1); box-shadow: 0 0 0 4px rgba(255, 193, 7, .45); }
    50%      { outline-color: rgba(255, 193, 7, .35); box-shadow: 0 0 0 10px rgba(255, 193, 7, .15); }
}
.help-flash { outline: 3px solid #ffc107 !important; outline-offset: 3px; border-radius: 4px;
              animation: help-flash-pulse .9s ease-in-out 4; position: relative; z-index: 2; }
