/**
 * BP Stories & Notes — Notes Stylesheet
 * Version: 3.3.0
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
    --bpsn-card-bg:        var(--socialv-card-bg, #ffffff);
    --bpsn-input-bg:       var(--socialv-input-bg, #f3f4f6);
    --bpsn-text-primary:   var(--socialv-body-color, #111827);
    --bpsn-text-secondary: var(--socialv-secondary-color, #4b5563);
    --bpsn-text-muted:     var(--socialv-muted-color, #9ca3af);
    --bpsn-border-color:   var(--socialv-border-color, #e5e7eb);
    --bpsn-hover-bg:       rgba(0, 149, 246, 0.06);
    --bpsn-primary-color:  var(--socialv-primary-color, #0095f6);
    --bpsn-primary-hover:  var(--socialv-primary-hover, #0077cc);
    --bpsn-danger-color:   #ef4444;
    --bpsn-overlay-bg:     rgba(0, 0, 0, 0.52);
    --bpsn-shadow:         0 1px 3px rgba(0,0,0,.07), 0 4px 12px rgba(0,0,0,.05);
    --bpsn-shadow-lg:      0 8px 30px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.06);
    --bpsn-radius:         16px;
    --bpsn-radius-sm:      10px;
    --bpsn-radius-xs:      6px;
    --bpsn-transition:     0.18s ease;
}

/* ==========================================================================
   Dark Mode — covers ALL SocialV / IQonic toggle patterns.
   Our JS (syncDarkMode) adds body.bpsn-dark-mode when it detects dark state.
   The selectors below handle native CSS-only detection as a bonus.
   ========================================================================== */

html.dark-mode body,
html.dark body,
html[data-theme="dark"] body,
html[data-bs-theme="dark"] body,
[data-bs-theme="dark"],
.dark-only,
body.dark,
body.dark-mode,
body[data-theme="dark"],
body[data-bs-theme="dark"],
body.iq-dark-mode,
body.bpsn-dark-mode {
    --bpsn-card-bg:        #1c1f2e;
    --bpsn-input-bg:       #252838;
    --bpsn-text-primary:   #e4e6eb;
    --bpsn-text-secondary: #9ba3af;
    --bpsn-text-muted:     #6b7280;
    --bpsn-border-color:   rgba(255, 255, 255, 0.08);
    --bpsn-hover-bg:       rgba(255, 255, 255, 0.05);
    --bpsn-shadow:         0 1px 4px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.3);
    --bpsn-shadow-lg:      0 8px 36px rgba(0,0,0,.6), 0 2px 8px rgba(0,0,0,.35);
}

/* ==========================================================================
   Notes Card & Bar
   ========================================================================== */

.bpsn-notes-card { margin-bottom: 20px; }
.bpsn-notes-card .card-inner { padding: 0; overflow: visible; }

.bpsn-notes-bar {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    overflow-x: auto;
    overflow-y: visible;
    background: transparent;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
.bpsn-notes-bar::-webkit-scrollbar { display: none; }

/* ==========================================================================
   Note Item
   ========================================================================== */

.bpsn-note-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    min-width: 66px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform var(--bpsn-transition);
}
.bpsn-note-item:hover  { transform: translateY(-2px); }
.bpsn-note-item:active { transform: scale(0.96); }

/* Bubble area — fixed height so all avatars line up regardless of bubble */
.bpsn-bubble-area {
    width: 100%;
    height: 36px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* Speech bubble */
.bpsn-note-bubble-preview {
    position: relative;
    background: var(--bpsn-input-bg);
    border: 1.5px solid var(--bpsn-border-color);
    border-radius: 11px;
    padding: 4px 9px;
    font-size: 10.5px;
    font-weight: 500;
    color: var(--bpsn-text-primary);
    white-space: nowrap;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: var(--bpsn-shadow);
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.35;
    margin-bottom: 3px;
}
.bpsn-note-bubble-preview::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--bpsn-border-color);
}
.bpsn-note-bubble-preview::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border: 3px solid transparent;
    border-top-color: var(--bpsn-input-bg);
    z-index: 1;
}
.bpsn-note-bubble-preview.bpsn-note-empty {
    color: var(--bpsn-text-muted);
    font-style: italic;
    font-weight: 400;
    border-style: dashed;
}

/* text-overflow:ellipsis doesn't work on flex containers directly — it must
   be on the text child. min-width:0 is critical: flex items default to
   min-width:auto which prevents shrinking below content size. */
.bpsn-note-bubble-preview > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
}

.bpsn-bubble-music-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--bpsn-primary-color);
    flex-shrink: 0;
}

/* Avatar */
.bpsn-avatar-ring-wrap { position: relative; width: 56px; height: 56px; }
.bpsn-note-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid var(--bpsn-border-color);
    background: var(--bpsn-input-bg);
    display: block;
    transition: border-color var(--bpsn-transition), box-shadow var(--bpsn-transition);
}
.bpsn-note-item.has-note .bpsn-note-avatar {
    border-color: var(--bpsn-primary-color);
    box-shadow: 0 0 0 2.5px var(--bpsn-primary-color);
}
.bpsn-note-edit-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 18px;
    height: 18px;
    background: var(--bpsn-primary-color);
    color: #fff;
    border-radius: 50%;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
}
.bpsn-note-name {
    font-size: 10.5px;
    color: var(--bpsn-text-secondary);
    text-align: center;
    max-width: 68px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================================================
   Shared Overlay
   ========================================================================== */

.bpsn-note-overlay {
    position: fixed;
    inset: 0;
    background: var(--bpsn-overlay-bg);
    z-index: 999990;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* ==========================================================================
   Shared close button
   ========================================================================== */

.bpsn-modal-close {
    background: none;
    border: none;
    color: var(--bpsn-text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 7px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--bpsn-transition), background var(--bpsn-transition);
}
.bpsn-modal-close:hover {
    color: var(--bpsn-text-primary);
    background: var(--bpsn-input-bg);
}

/* ==========================================================================
   Note Viewer Modal
   ========================================================================== */

.bpsn-note-viewer {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999999;
    background: var(--bpsn-card-bg);
    border-radius: var(--bpsn-radius);
    width: 90%;
    max-width: 340px;
    box-shadow: var(--bpsn-shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bpsn-note-viewer > .bpsn-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
}

.bpsn-viewer-user {
    padding: 30px 24px 14px;
    text-align: center;
}
.bpsn-viewer-avatar-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bpsn-border-color);
    display: block;
    margin: 0 auto 10px;
}
.bpsn-viewer-user-name {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: var(--bpsn-text-primary);
    margin-bottom: 2px;
}
.bpsn-viewer-time {
    display: block;
    font-size: 11px;
    color: var(--bpsn-text-muted);
}

.bpsn-viewer-bubble {
    margin: 0 20px 16px;
    background: var(--bpsn-input-bg);
    border: 1px solid var(--bpsn-border-color);
    border-radius: 18px;
    padding: 13px 20px;
}
.bpsn-viewer-bubble p {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--bpsn-text-primary);
    line-height: 1.5;
    word-break: break-word;
    text-align: center;
}

/* Music strip — no play button, auto-plays on open */
.bpsn-viewer-music {
    border-top: 1px solid var(--bpsn-border-color);
    padding: 12px 20px;
    cursor: pointer; /* tap to retry if autoplay blocked */
}
.bpsn-viewer-music-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}
.bpsn-viewer-art-wrap {
    position: relative;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
}
.bpsn-viewer-artwork {
    width: 46px;
    height: 46px;
    border-radius: var(--bpsn-radius-xs);
    object-fit: cover;
    display: block;
}

/* Animated playing bars overlay on artwork */
.bpsn-viewer-playing-bars {
    position: absolute;
    inset: 0;
    border-radius: var(--bpsn-radius-xs);
    background: rgba(0, 0, 0, 0.38);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2.5px;
    padding: 7px 6px;
}
.bpsn-viewer-playing-bars span {
    width: 3px;
    border-radius: 2px;
    background: #fff;
    animation: bpsn-bar 0.9s ease-in-out infinite;
    min-height: 3px;
}
.bpsn-viewer-playing-bars span:nth-child(1) { animation-delay: 0s;     }
.bpsn-viewer-playing-bars span:nth-child(2) { animation-delay: 0.18s;  }
.bpsn-viewer-playing-bars span:nth-child(3) { animation-delay: 0.36s;  }
.bpsn-viewer-playing-bars span:nth-child(4) { animation-delay: 0.12s;  }

@keyframes bpsn-bar {
    0%, 100% { height: 3px;  }
    50%       { height: 16px; }
}

.bpsn-viewer-music-info {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.bpsn-viewer-now-playing {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bpsn-primary-color);
}
.bpsn-viewer-song-title,
.bpsn-viewer-song-artist {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bpsn-viewer-song-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--bpsn-text-primary);
}
.bpsn-viewer-song-artist {
    font-size: 11.5px;
    color: var(--bpsn-text-secondary);
}

/* Viewer footer */
.bpsn-viewer-footer {
    border-top: 1px solid var(--bpsn-border-color);
    padding: 12px 16px;
}
.bpsn-viewer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.bpsn-viewer-action-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: var(--bpsn-radius-sm);
    border: none;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--bpsn-transition), transform var(--bpsn-transition);
}
.bpsn-viewer-action-btn:active { transform: scale(0.97); }
.bpsn-viewer-action-primary {
    background: var(--bpsn-primary-color);
    color: #fff;
}
.bpsn-viewer-action-primary:hover { opacity: 0.88; }
.bpsn-viewer-action-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--bpsn-danger-color);
    flex: 0 0 auto;
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.bpsn-viewer-action-danger:hover { background: rgba(239, 68, 68, 0.18); }
.bpsn-viewer-action-secondary {
    background: var(--bpsn-input-bg);
    color: var(--bpsn-text-secondary);
    border: 1.5px solid var(--bpsn-border-color);
}
.bpsn-viewer-action-secondary:hover {
    background: var(--bpsn-border-color);
    color: var(--bpsn-text-primary);
}

/* ==========================================================================
   Note Editor Modal
   ========================================================================== */

.bpsn-note-editor {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999999;
    width: 90%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
}
.bpsn-note-editor-inner {
    background: var(--bpsn-card-bg);
    border-radius: var(--bpsn-radius);
    box-shadow: var(--bpsn-shadow-lg);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}

/* Header */
.bpsn-note-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--bpsn-border-color);
    background-color: var(--bpsn-card-bg);
    flex-shrink: 0;
}
.bpsn-note-editor-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--bpsn-text-primary);
    letter-spacing: -0.01em;
}

/* Body */
.bpsn-note-editor-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bpsn-card-bg);
    scrollbar-width: thin;
    scrollbar-color: var(--bpsn-border-color) transparent;
}

/* Preview bubble */
.bpsn-editor-preview {
    display: flex;
    justify-content: center;
    padding: 4px 0;
}
.bpsn-editor-bubble {
    position: relative;
    background: var(--bpsn-input-bg);
    border: 1px solid var(--bpsn-border-color);
    border-radius: 18px;
    padding: 10px 20px;
    max-width: 85%;
    text-align: center;
}
.bpsn-editor-bubble span {
    font-size: 14px;
    font-weight: 500;
    color: var(--bpsn-text-primary);
    word-break: break-word;
    line-height: 1.45;
    display: block;
}
.bpsn-editor-bubble::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--bpsn-border-color);
}

/* Text input */
.bpsn-editor-text-wrap { position: relative; }
.bpsn-editor-text-input {
    width: 100%;
    padding: 10px 52px 10px 16px;
    border: 1.5px solid var(--bpsn-border-color);
    border-radius: 26px;
    font-size: 14px;
    color: var(--bpsn-text-primary);
    background: var(--bpsn-input-bg);
    outline: none;
    box-sizing: border-box;
    transition: border-color var(--bpsn-transition), box-shadow var(--bpsn-transition);
}
.bpsn-editor-text-input:focus {
    border-color: var(--bpsn-primary-color);
    box-shadow: 0 0 0 3px rgba(0, 149, 246, 0.13);
}
.bpsn-editor-text-input::placeholder { color: var(--bpsn-text-muted); }
.bpsn-editor-text-count {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: var(--bpsn-text-muted);
    pointer-events: none;
    white-space: nowrap;
}

/* ---- Music section ---- */
.bpsn-editor-music {
    border: 1.5px solid var(--bpsn-border-color);
    border-radius: var(--bpsn-radius-sm);
    overflow: hidden;
}
.bpsn-editor-music-header {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bpsn-text-muted);
    background: var(--bpsn-input-bg);
    border-bottom: 1px solid var(--bpsn-border-color);
}

/* Selected song strip */
.bpsn-editor-song-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: var(--bpsn-input-bg);
    border-bottom: 1px solid var(--bpsn-border-color);
}
.bpsn-editor-song-artwork {
    width: 38px;
    height: 38px;
    border-radius: var(--bpsn-radius-xs);
    object-fit: cover;
    flex-shrink: 0;
}
.bpsn-editor-song-info { flex: 1; overflow: hidden; }
.bpsn-editor-song-info span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bpsn-editor-song-info span:first-child {
    font-size: 13px;
    font-weight: 600;
    color: var(--bpsn-text-primary);
}
.bpsn-editor-song-info span:last-child {
    font-size: 11.5px;
    color: var(--bpsn-text-secondary);
    margin-top: 1px;
}
.bpsn-editor-song-remove {
    background: none;
    border: none;
    color: var(--bpsn-text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 5px;
    border-radius: 5px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: color var(--bpsn-transition), background var(--bpsn-transition);
}
.bpsn-editor-song-remove:hover {
    color: var(--bpsn-danger-color);
    background: rgba(239, 68, 68, 0.08);
}

/* Music search — flex row: icon + input, no absolute positioning needed */
.bpsn-editor-music-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--bpsn-border-color);
    background-color: var(--bpsn-card-bg);
}
.bpsn-search-icon {
    color: var(--bpsn-text-muted);
    font-size: 15px;
    flex-shrink: 0;
    line-height: 1;
}
.bpsn-music-search-input {
    flex: 1;
    min-width: 0;
    padding: 6px 12px;
    border: 1.5px solid var(--bpsn-border-color);
    border-radius: 20px;
    font-size: 13px;
    color: var(--bpsn-text-primary);
    background: var(--bpsn-input-bg);
    outline: none;
    transition: border-color var(--bpsn-transition), box-shadow var(--bpsn-transition);
}
.bpsn-music-search-input:focus {
    border-color: var(--bpsn-primary-color);
    box-shadow: 0 0 0 3px rgba(0, 149, 246, 0.13);
}
.bpsn-music-search-input::placeholder { color: var(--bpsn-text-muted); }

/* High-specificity overrides so SocialV/Bootstrap hard-coded input colours
   don't win when dark mode is active */
.bpsn-note-editor-inner .bpsn-editor-text-input,
.bpsn-note-editor-inner .bpsn-music-search-input {
    background-color: var(--bpsn-input-bg) !important;
    color:            var(--bpsn-text-primary) !important;
    border-color:     var(--bpsn-border-color) !important;
}
.bpsn-note-editor-inner .bpsn-editor-text-input::placeholder,
.bpsn-note-editor-inner .bpsn-music-search-input::placeholder {
    color: var(--bpsn-text-muted) !important;
}

/* Search results */
.bpsn-music-results {
    max-height: 188px;
    overflow-y: auto;
    border-bottom: 1px solid var(--bpsn-border-color);
    background-color: var(--bpsn-card-bg);
    scrollbar-width: thin;
    scrollbar-color: var(--bpsn-border-color) transparent;
}
.bpsn-music-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    cursor: pointer;
    transition: background var(--bpsn-transition);
}
.bpsn-music-result:hover { background: var(--bpsn-hover-bg); }
.bpsn-music-result + .bpsn-music-result {
    border-top: 1px solid var(--bpsn-border-color);
}
.bpsn-music-result-art {
    width: 38px;
    height: 38px;
    border-radius: var(--bpsn-radius-xs);
    object-fit: cover;
    flex-shrink: 0;
}
.bpsn-music-result-info { flex: 1; overflow: hidden; }
.bpsn-music-result-title,
.bpsn-music-result-artist {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bpsn-music-result-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--bpsn-text-primary);
}
.bpsn-music-result-artist {
    font-size: 11.5px;
    color: var(--bpsn-text-secondary);
    margin-top: 1px;
}
.bpsn-music-loading {
    display: flex;
    justify-content: center;
    padding: 16px;
}
.bpsn-music-no-results {
    text-align: center;
    color: var(--bpsn-text-muted);
    font-size: 13px;
    padding: 14px;
    margin: 0;
}

/* ==========================================================================
   Clip Picker — full 30s timeline scrubber with draggable 15s window
   ========================================================================== */

.bpsn-clip-picker {
    padding: 10px 12px 14px;
    background: var(--bpsn-card-bg);
}

/* Header row: label + "0:05 – 0:20" */
.bpsn-clip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.bpsn-clip-label {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bpsn-text-muted);
    margin: 0;
}
.bpsn-clip-time {
    font-size: 11px;
    font-weight: 700;
    color: var(--bpsn-primary-color);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* 30 s timeline bar — overflow:hidden keeps window inside at all times */
.bpsn-clip-timeline {
    position: relative;
    height: 36px;
    background: var(--bpsn-input-bg);
    border: 1px solid var(--bpsn-border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: ew-resize;
    touch-action: none; /* allow pointer capture on mobile */
    user-select: none;
}

/* Draggable 15s clip window — always 50% wide (15/30), left set by JS */
.bpsn-clip-window {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: var(--bpsn-primary-color);
    opacity: 0.82;
    border-radius: 7px;
    pointer-events: none;
}
/* Grip bars inside window to hint it's draggable */
.bpsn-clip-window::before,
.bpsn-clip-window::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 1px;
}
.bpsn-clip-window::before { left: 8px; }
.bpsn-clip-window::after  { right: 8px; }

/* 0:00 / 0:30 edge labels */
.bpsn-clip-edges {
    display: flex;
    justify-content: space-between;
    padding: 3px 2px 0;
    font-size: 9.5px;
    font-variant-numeric: tabular-nums;
    color: var(--bpsn-text-muted);
    user-select: none;
}

/* Preview button row */
.bpsn-clip-foot {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}
.bpsn-clip-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--bpsn-radius-sm);
    background: var(--bpsn-primary-color);
    border: none;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--bpsn-transition), transform var(--bpsn-transition);
}
.bpsn-clip-play-btn:hover  { background: var(--bpsn-primary-hover); }
.bpsn-clip-play-btn:active { transform: scale(0.96); }
.bpsn-clip-play-btn i { font-size: 14px; }

/* ==========================================================================
   Editor Footer
   ========================================================================== */

.bpsn-note-editor-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--bpsn-border-color);
    background-color: var(--bpsn-card-bg);
    flex-shrink: 0;
}
.bpsn-note-editor-footer .bpsn-footer-btn-danger {
    margin-right: auto; /* push to left */
}

.bpsn-footer-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--bpsn-radius-sm);
    border: none;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--bpsn-transition), transform var(--bpsn-transition);
    line-height: 1;
}
.bpsn-footer-btn:active { transform: scale(0.97); }
.bpsn-footer-btn-primary {
    background: var(--bpsn-primary-color);
    color: #fff;
}
.bpsn-footer-btn-primary:hover { opacity: 0.88; }
.bpsn-footer-btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--bpsn-danger-color);
    border: 1px solid rgba(239, 68, 68, 0.22);
}
.bpsn-footer-btn-danger:hover { background: rgba(239, 68, 68, 0.17); }

/* ==========================================================================
   Spinner
   ========================================================================== */

.bpsn-spinner {
    width: 26px;
    height: 26px;
    border: 2.5px solid var(--bpsn-border-color);
    border-top-color: var(--bpsn-primary-color);
    border-radius: 50%;
    animation: bpsn-spin 0.75s linear infinite;
}
@keyframes bpsn-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Profile-page note bubble
   ========================================================================== */

.bpsn-profile-note {
    margin: 8px 0 2px;
    text-align: center;
}

.bpsn-profile-note-card {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bpsn-input-bg);
    border: 1.5px solid var(--bpsn-border-color);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--bpsn-text-primary);
    max-width: 240px;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    transition: border-color var(--bpsn-transition);
}
.bpsn-profile-note-card:hover  { border-color: var(--bpsn-primary-color); }
.bpsn-profile-note-card:active { opacity: 0.7; }

.bpsn-pn-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bpsn-pn-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bpsn-primary-color);
    flex-shrink: 0;
}

.bpsn-profile-note-add {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: var(--bpsn-text-muted);
    cursor: pointer;
    transition: color var(--bpsn-transition);
    outline: none;
}
.bpsn-profile-note-add:hover { color: var(--bpsn-primary-color); }

/* ==========================================================================
   Member directory note bubble
   ========================================================================== */

.bpsn-note-bubble {
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
    background: var(--bpsn-card-bg);
    border: 1px solid var(--bpsn-border-color);
    border-radius: 14px 14px 14px 3px;
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 500;
    max-width: 200px;
    color: var(--bpsn-text-primary);
    box-shadow: var(--bpsn-shadow);
    word-break: break-word;
    margin: 4px 0;
}
.bpsn-note-text { display: block; }
.bpsn-note-music-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10.5px;
    font-weight: 500;
    color: var(--bpsn-primary-color);
}
.bpsn-note-music-tag i { font-size: 12px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 767px) {
    .bpsn-notes-bar { padding: 14px; gap: 8px; }
    .bpsn-avatar-ring-wrap, .bpsn-note-avatar { width: 50px; height: 50px; }
    .bpsn-bubble-area { height: 32px; }
    .bpsn-note-viewer, .bpsn-note-editor { width: 94%; }
    .bpsn-note-editor-inner { max-height: 94vh; }
}

@media (max-width: 480px) {
    .bpsn-avatar-ring-wrap, .bpsn-note-avatar { width: 46px; height: 46px; }
    .bpsn-note-bubble-preview { font-size: 10px; padding: 3px 7px; max-width: 90px; }
    .bpsn-bubble-area { height: 28px; }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
    .bpsn-notes-card, .bpsn-note-viewer,
    .bpsn-note-editor, .bpsn-note-overlay { display: none !important; }
}
