

/* ── Help Side Panel ── */
#help-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 100vw;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
}
#help-panel.open {
    transform: translateX(0);
}
#help-panel .help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
#help-panel .help-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}
#help-panel .help-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 18px;
    transition: background 0.15s, color 0.15s;
}
#help-panel .help-close:hover {
    background: #f1f5f9;
    color: #475569;
}
#help-panel .help-search {
    padding: 12px 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
#help-panel .help-search input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") 10px center no-repeat;
    outline: none;
    transition: border-color 0.15s;
}
#help-panel .help-search input:focus {
    border-color: #3b82f6;
    background-color: #fff;
}
#help-panel .help-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}
#help-panel .help-empty {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 13px;
}
#help-panel .help-section {
    margin-bottom: 24px;
}
#help-panel .help-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}
#help-panel .help-field {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
#help-panel .help-field-label {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}
#help-panel .help-field-what {
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 6px;
}
#help-panel .help-field-when {
    font-size: 11px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 4px;
    padding-left: 10px;
    border-left: 2px solid #93c5fd;
}
#help-panel .help-field-rec {
    font-size: 11px;
    color: #059669;
    margin-bottom: 4px;
}
#help-panel .help-field-rec strong {
    font-weight: 700;
}
#help-panel .help-field-mistake {
    font-size: 11px;
    color: #dc2626;
    margin-bottom: 4px;
    padding-left: 10px;
    border-left: 2px solid #fca5a5;
}
#help-panel .help-field-options {
    margin-top: 6px;
    padding: 0;
    list-style: none;
}
#help-panel .help-field-options li {
    font-size: 11px;
    color: #64748b;
    padding: 2px 0 2px 14px;
    position: relative;
}
#help-panel .help-field-options li::before {
    content: "\2022";
    position: absolute;
    left: 2px;
    color: #3b82f6;
}
#help-panel .help-doc-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 11px;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
}
#help-panel .help-doc-link:hover {
    text-decoration: underline;
}
#help-panel .help-summary {
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}
#help-panel .help-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 13px;
}
#help-panel .help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
#help-panel .help-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* ── Field-level Tooltips ── */
.help-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-left: 4px;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}
.help-tip:hover {
    background: #3b82f6;
    color: #fff;
}
.help-tip-content {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    background: #1e293b;
    color: #e2e8f0;
    font-size: 12px;
    line-height: 1.5;
    padding: 10px 12px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 999;
    font-weight: 400;
    text-align: left;
}
.help-tip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e293b;
}
.help-tip:hover .help-tip-content {
    display: block;
}
.help-tip-content .tip-rec {
    color: #34d399;
    font-weight: 600;
    margin-top: 4px;
}
.help-tip-content .tip-mistake {
    color: #f87171;
    margin-top: 4px;
    padding-left: 8px;
    border-left: 2px solid #f87171;
}
.help-tip-content .tip-link {
    display: block;
    color: #60a5fa;
    text-decoration: none;
    font-weight: 600;
    margin-top: 6px;
    font-size: 11px;
}
.help-tip-content .tip-link:hover {
    text-decoration: underline;
}

/* Tooltip variant for inline label usage */
label .help-tip {
    margin-left: 4px;
}

/* Responsive: narrower panel on small screens */
@media (max-width: 640px) {
    #help-panel {
        width: 100vw;
    }
}
