/* Shared Help thread drawer */
.ap-help-status {
    display: none;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 0.85rem;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    background: #f3efff;
    color: #5b21b6;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: 0;
    text-transform: none;
    border: 1px solid #ddd6fe;
}
.ap-help-status.is-visible { display: block !important; }
.ap-help-status.resolved {
    background: #f8fafc;
    color: #475569;
    border-color: #e2e8f0;
}
.ap-help-thread {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: min(42vh, 320px);
    overflow-y: auto;
    padding: 0.75rem;
    margin-bottom: 1rem;
    background: #f7f8fc;
    border: 1px solid #e8ebf3;
    border-radius: 14px;
}
.ap-help-empty {
    font-size: 0.86rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0 0 1rem;
    padding: 0.95rem 1.05rem;
    background: #f7f8fc;
    border: 1px solid #e8ebf3;
    border-radius: 14px;
}
.ap-help-bubble {
    max-width: 92%;
    padding: 0.65rem 0.8rem;
    border-radius: 12px;
    font-size: 0.86rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}
.ap-help-bubble.user {
    align-self: flex-end;
    background: #1e3a8a;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.ap-help-bubble.staff {
    align-self: flex-start;
    background: #f1f5f9;
    color: #0f172a;
    border-bottom-left-radius: 4px;
}
.ap-help-bubble.system {
    align-self: stretch;
    max-width: 100%;
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
    font-size: 0.8rem;
}
.ap-help-meta {
    display: block;
    font-size: 0.68rem;
    opacity: 0.75;
    margin-top: 0.35rem;
}
.ap-help-note {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.4;
    margin: 0 0 0.75rem;
}
.ap-help-composer { display: flex; flex-direction: column; gap: 0.85rem; }
#apHelpIntake { display: flex; flex-direction: column; gap: 0.85rem; }
.ap-help-actions { display: flex; align-items: center; gap: 0.5rem 0.75rem; flex-wrap: wrap; }
.ap-help-topic {
    display: none;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 0.75rem;
    padding: 0.5rem 0.8rem;
    border-radius: 12px;
    background: #f3efff;
    color: #5b21b6;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid #ddd6fe;
}
.ap-help-topic.is-visible { display: block; }
.ap-help-text-btn {
    background: #f7f8fc;
    border: 1px solid #e8ebf3;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    text-decoration: none;
    font-family: inherit;
}
.ap-help-text-btn:hover {
    color: #5b21b6;
    background: #f3efff;
    border-color: #ddd6fe;
}
.ap-help-text-btn:disabled { opacity: 0.55; cursor: default; }
.ap-help-looking {
    display: none;
    margin: 0 0 0.75rem;
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.4;
}
.ap-help-looking.is-visible { display: block; }
.ap-help-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 16px;
    box-shadow: 0 0 0 2px #fff;
}
.ap-help-dot:not([hidden]) { display: flex; }

.ap-help-title-ic,
.ap-help-tour-ic {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #7c3aed, #1e3a8a);
    color: #fff;
    flex-shrink: 0;
}
.ap-help-tour {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0 0 1rem;
    padding: 12px 14px;
    border: 1px solid #ddd6fe;
    border-radius: 14px;
    background: #f3efff;
    color: #5b21b6;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    box-sizing: border-box;
    transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}
.ap-help-tour:hover {
    background: #ede9fe;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -14px rgba(91, 33, 182, 0.45);
}
.ap-help-auth {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}
.ap-help-auth .ap-help-send,
.ap-help-auth .ap-help-text-btn {
    width: 100%;
}
.ap-help-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 18px;
    border: none;
    border-radius: 12px;
    background: #1e3a8a;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.ap-help-send:hover {
    background: #1a337a;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(30, 58, 138, 0.25);
}
.ap-help-send:active { transform: translateY(0); }
.ap-help-send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Shared field chrome for Help drawers that do not define .fb-* locally */
.ap-help-composer .fb-label,
.apt-help-body .fb-label {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 0.4rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}
.ap-help-composer .fb-select,
.ap-help-composer .fb-textarea,
.apt-help-body .fb-select,
.apt-help-body .fb-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #e8ebf3;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    background-color: #f7f8fc;
    color: #1e293b;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.ap-help-composer .fb-select:hover,
.ap-help-composer .fb-textarea:hover,
.apt-help-body .fb-select:hover,
.apt-help-body .fb-textarea:hover { border-color: #d5d9e6; }
.ap-help-composer .fb-select:focus,
.ap-help-composer .fb-textarea:focus,
.apt-help-body .fb-select:focus,
.apt-help-body .fb-textarea:focus {
    outline: none;
    background-color: #fff;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
.ap-help-composer select.fb-select,
.apt-help-body select.fb-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 2.4rem;
    cursor: pointer;
}
.ap-help-composer .fb-textarea,
.apt-help-body .fb-textarea { resize: vertical; min-height: 112px; }

.ap-help-input-shell {
    position: relative;
}
.ap-help-input-shell .fb-textarea {
    padding-right: 48px;
    padding-bottom: 44px;
}
.ap-help-attach {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 36px;
    height: 36px;
    border: 0;
    background: #fff;
    color: #64748b;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px #e8ebf3;
}
.ap-help-attach:hover { color: #5b21b6; background: #f8f5ff; }
.ap-help-attach:disabled {
    opacity: 0.45;
    cursor: default;
}
.ap-help-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.ap-help-preview {
    position: relative;
    width: 64px;
    height: 64px;
}
.ap-help-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    border: 1px solid #e8ebf3;
}
.ap-help-preview-x {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-size: 14px;
    line-height: 20px;
    cursor: pointer;
    padding: 0;
}
.ap-help-shot {
    display: block;
    margin-top: 0.5rem;
}
.ap-help-shot img {
    max-width: min(100%, 220px);
    max-height: 180px;
    border-radius: 8px;
    display: block;
    background: #fff;
}
.ap-help-shot-gone {
    margin-top: 0.45rem;
    font-size: 0.75rem;
    font-style: italic;
    opacity: 0.85;
}
.ap-help-bot-intro {
    margin: 0.9rem 0 0;
    padding: 0.65rem 0.85rem;
    background: #f5f3ff;
    border: 1px solid #ede9fe;
    border-radius: 10px;
    font-size: 0.78rem;
    color: #6d28d9;
    font-style: italic;
    line-height: 1.5;
    text-align: center;
}
