/* ══════════════════════════════════════════════════════════════
   Notespark — note comments (note-level discussion)
   Isolated file. Load after the other nota-*.css files.
   ══════════════════════════════════════════════════════════════ */

/* Unresolved count on the toolbar button */
.nota .editor-toolbar .icon-btn { position: relative; }

.cm-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--n-accent);
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    border-radius: 8px;
    border: 1.5px solid #fffdf9;
}

.nota .editor-toolbar .icon-btn.active {
    background: var(--n-accent-dim) !important;
    color: var(--n-accent-text) !important;
}

/* ── Panel ── */
.cm-panel {
    margin: 18px 0 6px;
    padding: 14px 0 0;
    border-top: 1px solid var(--n-border-light);
}

.cm-head {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 800;
    color: var(--n-text-3);
    margin-bottom: 12px;
}

.cm-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
    color: var(--n-text-4);
}
.cm-close:hover { color: var(--n-text); }

.cm-empty {
    font-size: 13px;
    color: var(--n-text-4);
    margin: 0 0 12px;
}

/* ── Individual comment ── */
.cm-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid var(--n-border-light);
    border-radius: 12px;
}

.cm-item.resolved {
    opacity: 0.55;
    background: var(--n-surface);
}
.cm-item.resolved .cm-text { text-decoration: line-through; }

.cm-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
}
.cm-avatar img { width: 100%; height: 100%; object-fit: cover; }

.cm-body { flex: 1; min-width: 0; }

.cm-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 3px;
}

.cm-author { font-size: 13px; font-weight: 700; color: var(--n-text); }
.cm-time   { font-size: 11.5px; color: var(--n-text-4); }
.cm-edited { font-size: 11px; color: var(--n-text-4); font-style: italic; }

.cm-text {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--n-text-2);
    white-space: pre-wrap;
    word-break: break-word;
}

.cm-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s;
}
.cm-item:hover .cm-actions { opacity: 1; }

.cm-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--n-text-4);
    cursor: pointer;
}
.cm-act:hover { background: var(--n-surface-hover); color: var(--n-text); }
.cm-act.danger:hover { background: var(--n-danger-bg); color: var(--n-danger); }

/* ── Compose ── */
.cm-compose {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.cm-input {
    flex: 1;
    resize: vertical;
    min-height: 46px;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--n-text);
    background: #fff;
    border: 1px solid var(--n-border-light);
    border-radius: 10px;
    outline: none;
}
.cm-input:focus {
    border-color: rgba(108,92,231,0.45);
    box-shadow: 0 0 0 3px rgba(108,92,231,0.12);
}

.cm-send { flex-shrink: 0; }
.cm-send:disabled { opacity: 0.45; cursor: not-allowed; }
